diff --git a/.github/workflows/compile-msvc.yml b/.github/workflows/compile-msvc.yml index 35ec32e544..b31c262e32 100644 --- a/.github/workflows/compile-msvc.yml +++ b/.github/workflows/compile-msvc.yml @@ -26,6 +26,7 @@ jobs: shell: bash run: | python3 -m pip install numpy + python3 -m pip install pyyaml cmake -C cmake/presets/windows.cmake \ -D PKG_PYTHON=on \ -S cmake -B build \ diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index 6e2f9bd800..a222380f60 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -37,6 +37,7 @@ jobs: working-directory: build run: | ccache -z + python3 -m pip install pyyaml cmake -C ../cmake/presets/clang.cmake \ -C ../cmake/presets/most.cmake \ -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ diff --git a/bench/README b/bench/README index 7d5aced119..99a0484355 100644 --- a/bench/README +++ b/bench/README @@ -4,10 +4,8 @@ This directory contains 5 benchmark problems which are discussed in the Benchmark section of the LAMMPS documentation, and on the Benchmark page of the LAMMPS WWW site (https://www.lammps.org/bench.html). -This directory also has several sub-directories: +This directory also has one sub-directories: -FERMI benchmark scripts for desktop machine with Fermi GPUs (Tesla) -KEPLER benchmark scripts for GPU cluster with Kepler GPUs POTENTIALS benchmarks scripts for various potentials in LAMMPS The results for all of these benchmarks are displayed and discussed on diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 0b270cc68f..7d1b2894c8 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -172,6 +172,7 @@ set(STANDARD_PACKAGES AWPMD BOCS BODY + BPM BROWNIAN CG-DNA CG-SDK @@ -208,7 +209,6 @@ set(STANDARD_PACKAGES MDI MEAM MESONT - MESSAGE MGPT MISC ML-HDNNP @@ -451,7 +451,7 @@ else() endif() foreach(PKG_WITH_INCL KSPACE PYTHON ML-IAP VORONOI COLVARS ML-HDNNP MDI MOLFILE NETCDF - PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM LATTE MESSAGE MSCG COMPRESS ML-PACE) + PLUMED QMMM ML-QUIP SCAFACOS MACHDYN VTK KIM LATTE MSCG COMPRESS ML-PACE) if(PKG_${PKG_WITH_INCL}) include(Packages/${PKG_WITH_INCL}) endif() @@ -810,6 +810,7 @@ endif() include(FeatureSummary) feature_summary(DESCRIPTION "The following tools and libraries have been found and configured:" WHAT PACKAGES_FOUND) message(STATUS "<<< Build configuration >>> + LAMMPS Version: ${PROJECT_VERSION} Operating System: ${CMAKE_SYSTEM_NAME} ${CMAKE_LINUX_DISTRO} ${CMAKE_DISTRO_VERSION} Build type: ${LAMMPS_BUILD_TYPE} Install path: ${CMAKE_INSTALL_PREFIX} diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index aec8887c30..75569aa55d 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -80,14 +80,14 @@ if(GPU_API STREQUAL "CUDA") # --arch translates directly instead of JIT, so this should be for the preferred or most common architecture set(GPU_CUDA_GENCODE "-arch=${GPU_ARCH}") - # apply the following to build "fat" CUDA binaries only for known CUDA toolkits - if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0") - message(WARNING "Untested CUDA Toolkit version. Use at your own risk") + # apply the following to build "fat" CUDA binaries only for known CUDA toolkits since version 8.0 + # only the Kepler achitecture and beyond is supported + if(CUDA_VERSION VERSION_LESS 8.0) + message(FATAL_ERROR "CUDA Toolkit version 8.0 or later is required") + elseif(CUDA_VERSION VERSION_GREATER_EQUAL "12.0") + message(WARNING "Untested CUDA Toolkit version ${CUDA_VERSION}. Use at your own risk") + set(GPU_CUDA_GENCODE "-arch=all") else() - # Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0 - if((CUDA_VERSION VERSION_GREATER_EQUAL "3.2") AND (CUDA_VERSION VERSION_LESS "9.0")) - string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_20,code=[sm_20,compute_20] ") - endif() # Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2 if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0")) string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30] ") @@ -120,6 +120,14 @@ if(GPU_API STREQUAL "CUDA") if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1") string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_86,code=[sm_86,compute_86]") endif() + # Hopper (GPU Arch 9.0) is supported by CUDA 12.0? and later + if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0") + string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]") + endif() + # # Lovelace (GPU Arch 9.x) is supported by CUDA 12.0? and later + #if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0") + # string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_9x,code=[sm_9x,compute_9x]") + #endif() endif() cuda_compile_fatbin(GPU_GEN_OBJS ${GPU_LIB_CU} OPTIONS ${CUDA_REQUEST_PIC} @@ -257,43 +265,47 @@ elseif(GPU_API STREQUAL "HIP") find_package(CUDA REQUIRED) set(HIP_ARCH "sm_50" CACHE STRING "HIP primary CUDA architecture (e.g. sm_60)") - # build arch/gencode commands for nvcc based on CUDA toolkit version and use choice - # --arch translates directly instead of JIT, so this should be for the preferred or most common architecture - set(HIP_CUDA_GENCODE "-arch=${HIP_ARCH}") - # Fermi (GPU Arch 2.x) is supported by CUDA 3.2 to CUDA 8.0 - if((CUDA_VERSION VERSION_GREATER_EQUAL "3.2") AND (CUDA_VERSION VERSION_LESS "9.0")) - string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_20,code=[sm_20,compute_20]") - endif() - # Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2 - if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0")) - string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30]") - endif() - # Kepler (GPU Arch 3.5) is supported by CUDA 5 to CUDA 11.0 - if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "12.0")) - string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_35,code=[sm_35,compute_35]") - endif() - # Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later - if(CUDA_VERSION VERSION_GREATER_EQUAL "6.0") - string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52]") - endif() - # Pascal (GPU Arch 6.x) is supported by CUDA 8 and later - if(CUDA_VERSION VERSION_GREATER_EQUAL "8.0") - string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61]") - endif() - # Volta (GPU Arch 7.0) is supported by CUDA 9 and later - if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0") - string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_70,code=[sm_70,compute_70]") - endif() - # Turing (GPU Arch 7.5) is supported by CUDA 10 and later - if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") - string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]") - endif() - # Ampere (GPU Arch 8.0) is supported by CUDA 11 and later - if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0") - string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]") - endif() - if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0") - message(WARNING "Unsupported CUDA version. Use at your own risk.") + if(CUDA_VERSION VERSION_LESS 8.0) + message(FATAL_ERROR "CUDA Toolkit version 8.0 or later is required") + elseif(CUDA_VERSION VERSION_GREATER_EQUAL "12.0") + message(WARNING "Untested CUDA Toolkit version ${CUDA_VERSION}. Use at your own risk") + set(HIP_CUDA_GENCODE "-arch=all") + else() + # build arch/gencode commands for nvcc based on CUDA toolkit version and use choice + # --arch translates directly instead of JIT, so this should be for the preferred or most common architecture + set(HIP_CUDA_GENCODE "-arch=${HIP_ARCH}") + # Kepler (GPU Arch 3.0) is supported by CUDA 5 to CUDA 10.2 + if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "11.0")) + string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30]") + endif() + # Kepler (GPU Arch 3.5) is supported by CUDA 5 to CUDA 11.0 + if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "12.0")) + string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_35,code=[sm_35,compute_35]") + endif() + # Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later + if(CUDA_VERSION VERSION_GREATER_EQUAL "6.0") + string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52]") + endif() + # Pascal (GPU Arch 6.x) is supported by CUDA 8 and later + if(CUDA_VERSION VERSION_GREATER_EQUAL "8.0") + string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61]") + endif() + # Volta (GPU Arch 7.0) is supported by CUDA 9 and later + if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0") + string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_70,code=[sm_70,compute_70]") + endif() + # Turing (GPU Arch 7.5) is supported by CUDA 10 and later + if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") + string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_75,code=[sm_75,compute_75]") + endif() + # Ampere (GPU Arch 8.0) is supported by CUDA 11 and later + if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0") + string(APPEND HIP_CUDA_GENCODE " -gencode arch=compute_80,code=[sm_80,compute_80]") + endif() + # Hopper (GPU Arch 9.0) is supported by CUDA 12.0? and later + if(CUDA_VERSION VERSION_GREATER_EQUAL "12.0") + string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_90,code=[sm_90,compute_90]") + endif() endif() endif() @@ -347,6 +359,10 @@ elseif(GPU_API STREQUAL "HIP") target_link_libraries(gpu PRIVATE hip::host) if(HIP_USE_DEVICE_SORT) + if(HIP_PLATFORM STREQUAL "amd") + # newer version of ROCm (5.1+) require c++14 for rocprim + set_property(TARGET gpu PROPERTY CXX_STANDARD 14) + endif() # add hipCUB target_include_directories(gpu PRIVATE ${HIP_ROOT_DIR}/../include) target_compile_definitions(gpu PRIVATE -DUSE_HIP_DEVICE_SORT) diff --git a/cmake/Modules/Packages/H5MD.cmake b/cmake/Modules/Packages/H5MD.cmake index 4fcae93027..6f6922f13e 100644 --- a/cmake/Modules/Packages/H5MD.cmake +++ b/cmake/Modules/Packages/H5MD.cmake @@ -1,5 +1,14 @@ enable_language(C) +# we don't use the parallel i/o interface. +set(HDF5_PREFER_PARALLEL FALSE) + find_package(HDF5 REQUIRED) + +# parallel HDF5 will import incompatible MPI headers with a serial build +if((NOT BUILD_MPI) AND HDF5_IS_PARALLEL) + message(FATAL_ERROR "Serial LAMMPS build and parallel HDF5 library are not compatible") +endif() + target_link_libraries(h5md PRIVATE ${HDF5_LIBRARIES}) target_include_directories(h5md PUBLIC ${HDF5_INCLUDE_DIRS}) diff --git a/cmake/Modules/Packages/MDI.cmake b/cmake/Modules/Packages/MDI.cmake index 047c30c603..1eec53db37 100644 --- a/cmake/Modules/Packages/MDI.cmake +++ b/cmake/Modules/Packages/MDI.cmake @@ -8,8 +8,8 @@ option(DOWNLOAD_MDI "Download and compile the MDI library instead of using an al if(DOWNLOAD_MDI) message(STATUS "MDI download requested - we will build our own") - set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.2.9.tar.gz" CACHE STRING "URL for MDI tarball") - set(MDI_MD5 "ddfa46d6ee15b4e59cfd527ec7212184" CACHE STRING "MD5 checksum for MDI tarball") + set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.3.2.tar.gz" CACHE STRING "URL for MDI tarball") + set(MDI_MD5 "836f5da400d8cff0f0e4435640f9454f" CACHE STRING "MD5 checksum for MDI tarball") mark_as_advanced(MDI_URL) mark_as_advanced(MDI_MD5) enable_language(C) diff --git a/cmake/Modules/Packages/MESSAGE.cmake b/cmake/Modules/Packages/MESSAGE.cmake deleted file mode 100644 index b5a61a1607..0000000000 --- a/cmake/Modules/Packages/MESSAGE.cmake +++ /dev/null @@ -1,31 +0,0 @@ -if(LAMMPS_SIZES STREQUAL "BIGBIG") - message(FATAL_ERROR "The MESSAGE Package is not compatible with -DLAMMPS_BIGBIG") -endif() -option(MESSAGE_ZMQ "Use ZeroMQ in MESSAGE package" OFF) -file(GLOB_RECURSE cslib_SOURCES - ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/[^.]*.cpp) - -add_library(cslib STATIC ${cslib_SOURCES}) -target_compile_definitions(cslib PRIVATE -DLAMMPS_${LAMMPS_SIZES}) -set_target_properties(cslib PROPERTIES OUTPUT_NAME lammps_cslib${LAMMPS_MACHINE}) -if(BUILD_MPI) - target_compile_definitions(cslib PRIVATE -DMPI_YES) - set_target_properties(cslib PROPERTIES OUTPUT_NAME "csmpi") - target_link_libraries(cslib PRIVATE MPI::MPI_CXX) -else() - target_compile_definitions(cslib PRIVATE -DMPI_NO) - target_include_directories(cslib PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src/STUBS_MPI) - set_target_properties(cslib PROPERTIES OUTPUT_NAME "csnompi") -endif() - -if(MESSAGE_ZMQ) - target_compile_definitions(cslib PRIVATE -DZMQ_YES) - find_package(ZMQ REQUIRED) - target_link_libraries(cslib PUBLIC ZMQ::ZMQ) -else() - target_compile_definitions(cslib PRIVATE -DZMQ_NO) - target_include_directories(cslib PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src/STUBS_ZMQ) -endif() - -target_link_libraries(lammps PRIVATE cslib) -target_include_directories(lammps PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src) diff --git a/cmake/Modules/Packages/ML-HDNNP.cmake b/cmake/Modules/Packages/ML-HDNNP.cmake index 5a4c287fa2..f52d7ca6f3 100644 --- a/cmake/Modules/Packages/ML-HDNNP.cmake +++ b/cmake/Modules/Packages/ML-HDNNP.cmake @@ -42,15 +42,9 @@ if(DOWNLOAD_N2P2) if(NOT BUILD_MPI) set(N2P2_PROJECT_OPTIONS "-DN2P2_NO_MPI") else() - # get path to MPI include directory when cross-compiling to windows - if((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING) - get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES) - set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}") - endif() - if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") - get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES) - set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}") - endif() + # get path to MPI include directory + get_target_property(N2P2_MPI_INCLUDE MPI::MPI_CXX INTERFACE_INCLUDE_DIRECTORIES) + set(N2P2_PROJECT_OPTIONS "-I${N2P2_MPI_INCLUDE}") endif() # prefer GNU make, if available. N2P2 lib seems to need it. diff --git a/cmake/presets/all_off.cmake b/cmake/presets/all_off.cmake index 2893bbab6b..6a8f70c9ea 100644 --- a/cmake/presets/all_off.cmake +++ b/cmake/presets/all_off.cmake @@ -8,6 +8,7 @@ set(ALL_PACKAGES AWPMD BOCS BODY + BPM BROWNIAN CG-DNA CG-SDK @@ -48,7 +49,6 @@ set(ALL_PACKAGES MDI MEAM MESONT - MESSAGE MGPT MISC ML-HDNNP diff --git a/cmake/presets/all_on.cmake b/cmake/presets/all_on.cmake index 9f38f1e1e4..4cff7d945d 100644 --- a/cmake/presets/all_on.cmake +++ b/cmake/presets/all_on.cmake @@ -10,6 +10,7 @@ set(ALL_PACKAGES AWPMD BOCS BODY + BPM BROWNIAN CG-DNA CG-SDK @@ -50,7 +51,6 @@ set(ALL_PACKAGES MDI MEAM MESONT - MESSAGE MGPT MISC ML-HDNNP diff --git a/cmake/presets/kokkos-sycl.cmake b/cmake/presets/kokkos-sycl.cmake new file mode 100644 index 0000000000..01abe7762f --- /dev/null +++ b/cmake/presets/kokkos-sycl.cmake @@ -0,0 +1,15 @@ +# preset that enables KOKKOS and selects SYCL compilation with OpenMP +# enabled as well. Also sets some performance related compiler flags. +set(PKG_KOKKOS ON CACHE BOOL "" FORCE) +set(Kokkos_ENABLE_SERIAL ON CACHE BOOL "" FORCE) +set(Kokkos_ENABLE_OPENMP ON CACHE BOOL "" FORCE) +set(Kokkos_ENABLE_CUDA OFF CACHE BOOL "" FORCE) +set(Kokkos_ENABLE_SYCL ON CACHE BOOL "" FORCE) +set(Kokkos_ARCH_MAXWELL50 on CACHE BOOL "" FORCE) +set(BUILD_OMP ON CACHE BOOL "" FORCE) + +set(CMAKE_CXX_COMPILER clang++ CACHE STRING "" FORCE) +set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE) +set(CMAKE_CXX_STANDARD 17 CACHE STRING "" FORCE) +set(CMAKE_SHARED_LINKER_FLAGS "-Xsycl-target-frontend -O3" CACHE STRING "" FORCE) +set(CMAKE_TUNE_FLAGS "-fgpu-inline-threshold=100000 -Xsycl-target-frontend -O3 -Xsycl-target-frontend -ffp-contract=on -Wno-unknown-cuda-version" CACHE STRING "" FORCE) diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index fe828a6d9a..ef7f15fec2 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -4,6 +4,7 @@ set(WIN_PACKAGES AWPMD BOCS BODY + BPM BROWNIAN CG-DNA CG-SDK diff --git a/cmake/presets/most.cmake b/cmake/presets/most.cmake index 27ce57621c..44d668fd83 100644 --- a/cmake/presets/most.cmake +++ b/cmake/presets/most.cmake @@ -6,6 +6,7 @@ set(ALL_PACKAGES ASPHERE BOCS BODY + BPM BROWNIAN CG-DNA CG-SDK diff --git a/cmake/presets/nolib.cmake b/cmake/presets/nolib.cmake index fd9c2ed1ac..cb9c6f26b3 100644 --- a/cmake/presets/nolib.cmake +++ b/cmake/presets/nolib.cmake @@ -15,7 +15,6 @@ set(PACKAGES_WITH_LIB MACHDYN MDI MESONT - MESSAGE ML-HDNNP ML-PACE ML-QUIP diff --git a/cmake/presets/windows.cmake b/cmake/presets/windows.cmake index d4e69c5fca..c83b16d855 100644 --- a/cmake/presets/windows.cmake +++ b/cmake/presets/windows.cmake @@ -2,6 +2,7 @@ set(WIN_PACKAGES ASPHERE BOCS BODY + BPM BROWNIAN CG-DNA CG-SDK diff --git a/doc/.gitignore b/doc/.gitignore index 7649fb34f1..7c953d2432 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,6 +1,6 @@ /old /html -/html-offline +/fasthtml /epub /latex /mathjax diff --git a/doc/Makefile b/doc/Makefile index a082018dfb..58be62e712 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -18,7 +18,6 @@ PYTHON = $(shell which python3) DOXYGEN = $(shell which doxygen) VIRTUALENV = virtualenv HAS_PYTHON3 = NO -HAS_VIRTUALENV = NO HAS_DOXYGEN = NO HAS_PDFLATEX = NO @@ -30,16 +29,6 @@ ifeq ($(shell which doxygen >/dev/null 2>&1; echo $$?), 0) HAS_DOXYGEN = YES endif -ifeq ($(shell which virtualenv-3 >/dev/null 2>&1; echo $$?), 0) -VIRTUALENV = virtualenv-3 -HAS_VIRTUALENV = YES -endif - -ifeq ($(shell which virtualenv >/dev/null 2>&1; echo $$?), 0) -VIRTUALENV = virtualenv -HAS_VIRTUALENV = YES -endif - ifeq ($(shell which pdflatex >/dev/null 2>&1; echo $$?), 0) ifeq ($(shell which latexmk >/dev/null 2>&1; echo $$?), 0) HAS_PDFLATEX = YES @@ -58,7 +47,7 @@ SPHINXEXTRA = -E -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiproc # we only want to use explicitly listed files. DOXYFILES = $(shell sed -n -e 's/\#.*$$//' -e '/^ *INPUT \+=/,/^[A-Z_]\+ \+=/p' doxygen/Doxyfile.in | sed -e 's/@LAMMPS_SOURCE_DIR@/..\/src/g' -e 's/\\//g' -e 's/ \+/ /' -e 's/[A-Z_]\+ \+= *\(YES\|NO\|\)//') -.PHONY: help clean-all clean clean-spelling epub mobi rst html pdf spelling anchor_check style_check char_check xmlgen +.PHONY: help clean-all clean clean-spelling epub mobi rst html pdf spelling anchor_check style_check char_check xmlgen fasthtml # ------------------------------------------ @@ -70,7 +59,8 @@ help: @echo " epub create ePUB format manual for e-book readers" @echo " mobi convert ePUB to MOBI format manual for e-book readers (e.g. Kindle)" @echo " (requires ebook-convert tool from calibre)" - @echo " clean remove all intermediate RST files" + @echo " fasthtml approximate HTML page creation in fasthtml dir (for development)" + @echo " clean remove all intermediate files" @echo " clean-all reset the entire build environment" @echo " anchor_check scan for duplicate anchor labels" @echo " style_check check for complete and consistent style lists" @@ -83,7 +73,7 @@ clean-all: clean rm -rf $(BUILDDIR)/docenv $(MATHJAX) $(BUILDDIR)/LAMMPS.mobi $(BUILDDIR)/LAMMPS.epub $(BUILDDIR)/Manual.pdf clean: clean-spelling - rm -rf $(BUILDDIR)/html $(BUILDDIR)/epub $(BUILDDIR)/latex $(BUILDDIR)/doctrees $(BUILDDIR)/doxygen/xml $(BUILDDIR)/doxygen-warn.log $(BUILDDIR)/doxygen/Doxyfile $(SPHINXCONFIG)/conf.py + rm -rf $(BUILDDIR)/html $(BUILDDIR)/epub $(BUILDDIR)/latex $(BUILDDIR)/doctrees $(BUILDDIR)/doxygen/xml $(BUILDDIR)/doxygen-warn.log $(BUILDDIR)/doxygen/Doxyfile $(SPHINXCONFIG)/conf.py $(BUILDDIR)/fasthtml clean-spelling: rm -rf $(BUILDDIR)/spelling @@ -118,6 +108,23 @@ html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX) @rm -rf html/PDF/.[sg]* @echo "Build finished. The HTML pages are in doc/html." +fasthtml: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX) + @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi + @$(MAKE) $(MFLAGS) -C graphviz all + @mkdir -p fasthtml + @(\ + . $(VENV)/bin/activate ; env PYTHONWARNINGS= \ + sphinx-build -j 4 -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/fasthtml/doctrees $(RSTDIR) fasthtml ;\ + deactivate ;\ + ) + @rm -rf fasthtml/_sources + @rm -rf fasthtml/PDF + @rm -rf fasthtml/USER + @rm -rf fasthtml/JPG + @cp -r src/PDF fasthtml/PDF + @rm -rf fasthtml/PDF/.[sg]* + @echo "Fast HTML build finished. The HTML pages are in doc/fasthtml." + spelling: xmlgen $(SPHINXCONFIG)/conf.py $(VENV) $(SPHINXCONFIG)/false_positives.txt @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi @(\ @@ -220,9 +227,8 @@ $(VENV): @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi @if [ "$(HAS_PYTHON3)" == "NO" ] ; then echo "python3 was not found! Please see README for further instructions" 1>&2; exit 1; fi @if [ "$(HAS_DOXYGEN)" == "NO" ] ; then echo "doxygen was not found! Please see README for further instructions" 1>&2; exit 1; fi - @if [ "$(HAS_VIRTUALENV)" == "NO" ] ; then echo "virtualenv was not found! Please see README for further instructions" 1>&2; exit 1; fi @( \ - $(VIRTUALENV) -p $(PYTHON) $(VENV); \ + $(PYTHON) -m venv $(VENV); \ . $(VENV)/bin/activate; \ pip $(PIP_OPTIONS) install --upgrade pip; \ pip $(PIP_OPTIONS) install -r $(BUILDDIR)/utils/requirements.txt; \ diff --git a/doc/msi2lmp.1 b/doc/msi2lmp.1 index ba771da7dc..f088603483 100644 --- a/doc/msi2lmp.1 +++ b/doc/msi2lmp.1 @@ -98,7 +98,7 @@ msi2lmp decane -c 0 -f oplsaa .SH COPYRIGHT -© 2003--2021 Sandia Corporation +© 2003--2022 Sandia Corporation This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 9648df402f..d2d12b48db 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -45,7 +45,6 @@ This is the list of packages that may require additional steps. * :ref:`MACHDYN ` * :ref:`MDI ` * :ref:`MESONT ` - * :ref:`MESSAGE ` * :ref:`ML-HDNNP ` * :ref:`ML-IAP ` * :ref:`ML-PACE ` @@ -142,8 +141,6 @@ CMake build :code:`GPU_ARCH` settings for different GPU hardware is as follows: -* sm_12 or sm_13 for GT200 (supported by CUDA 3.2 until CUDA 6.5) -* sm_20 or sm_21 for Fermi (supported by CUDA 3.2 until CUDA 7.5) * sm_30 for Kepler (supported since CUDA 5 and until CUDA 10.x) * sm_35 or sm_37 for Kepler (supported since CUDA 5 and until CUDA 11.x) * sm_50 or sm_52 for Maxwell (supported since CUDA 6) @@ -161,6 +158,12 @@ Thus the GPU_ARCH setting is merely an optimization, to have code for the preferred GPU architecture directly included rather than having to wait for the JIT compiler of the CUDA driver to translate it. +When compiling for CUDA or HIP with CUDA, version 8.0 or later of the CUDA toolkit +is required and a GPU architecture of Kepler or later, which must *also* be +supported by the CUDA toolkit in use **and** the CUDA driver in use. +When compiling for OpenCL, OpenCL version 1.2 or later is required and the +GPU must be supported by the GPU driver and OpenCL runtime bundled with the driver. + When building with CMake, you **must NOT** build the GPU library in ``lib/gpu`` using the traditional build procedure. CMake will detect files generated by that process and will terminate with an error and a suggestion for how to remove them. @@ -638,13 +641,14 @@ This list was last updated for version 3.5.0 of the Kokkos library. -D CMAKE_CXX_COMPILER=${HOME}/lammps/lib/kokkos/bin/nvcc_wrapper - To simplify compilation, three preset files are included in the + To simplify compilation, four preset files are included in the ``cmake/presets`` folder, ``kokkos-serial.cmake``, - ``kokkos-openmp.cmake``, and ``kokkos-cuda.cmake``. They will - enable the KOKKOS package and enable some hardware choice. So to - compile with OpenMP host parallelization, CUDA device - parallelization (for GPUs with CC 5.0 and up) with some common - packages enabled, you can do the following: + ``kokkos-openmp.cmake``, ``kokkos-cuda.cmake``, and + ``kokkos-sycl.cmake``. They will enable the KOKKOS package and + enable some hardware choice. So to compile with OpenMP host + parallelization, CUDA device parallelization (for GPUs with CC 5.0 + and up) with some common packages enabled, you can do the + following: .. code-block:: bash @@ -796,47 +800,6 @@ library. ---------- -.. _message: - -MESSAGE package ------------------------------ - -This package can optionally include support for messaging via sockets, -using the open-source `ZeroMQ library `_, which must -be installed on your system. - -.. tabs:: - - .. tab:: CMake build - - .. code-block:: bash - - -D MESSAGE_ZMQ=value # build with ZeroMQ support, value = no (default) or yes - -D ZMQ_LIBRARY=path # ZMQ library file (only needed if a custom location) - -D ZMQ_INCLUDE_DIR=path # ZMQ include directory (only needed if a custom location) - - .. tab:: Traditional make - - Before building LAMMPS, you must build the CSlib library in - ``lib/message``\ . You can build the CSlib library manually if - you prefer; follow the instructions in ``lib/message/README``\ . - You can also do it in one step from the ``lammps/src`` dir, using - a command like these, which simply invoke the - ``lib/message/Install.py`` script with the specified args: - - .. code-block:: bash - - $ make lib-message # print help message - $ make lib-message args="-m -z" # build with MPI and socket (ZMQ) support - $ make lib-message args="-s" # build as serial lib with no ZMQ support - - The build should produce two files: ``lib/message/cslib/src/libmessage.a`` - and ``lib/message/Makefile.lammps``. The latter is copied from an - existing ``Makefile.lammps.*`` and has settings to link with the ZeroMQ - library if requested in the build. - ----------- - .. _mliap: ML-IAP package diff --git a/doc/src/Build_manual.rst b/doc/src/Build_manual.rst index 5dbefd8b6e..90633d0811 100644 --- a/doc/src/Build_manual.rst +++ b/doc/src/Build_manual.rst @@ -78,11 +78,12 @@ folder. The following ``make`` commands are available: make html # generate HTML in html dir using Sphinx make pdf # generate PDF as Manual.pdf using Sphinx and PDFLaTeX - make fetch # fetch HTML pages and PDF files from LAMMPS website - # and unpack into the html_www folder and Manual_www.pdf make epub # generate LAMMPS.epub in ePUB format using Sphinx make mobi # generate LAMMPS.mobi in MOBI format using ebook-convert + make fasthtml # generate approximate HTML in fasthtml dir using Sphinx + # some Sphinx extensions do not work correctly with this + make clean # remove intermediate RST files created by HTML build make clean-all # remove entire build folder and any cached data @@ -193,8 +194,13 @@ folder need to be updated or new files added. These files are written in `reStructuredText `_ markup for translation with the Sphinx tool. Before contributing any documentation, please check that both the HTML -and the PDF format documentation can translate without errors. Please also -check the output to the console for any warnings or problems. There will +and the PDF format documentation can translate without errors. During +testing the html translation, you may use the ``make fasthtml`` command +which does an approximate translation (i.e. not all Sphinx features and +extensions will work), but runs very fast because it will only translate +files that have been changed since the last ``make fasthtml`` command. + +Please also check the output to the console for any warnings or problems. There will be multiple tests run automatically: - A test for correctness of all anchor labels and their references diff --git a/doc/src/Build_package.rst b/doc/src/Build_package.rst index a7dda52b41..67639a46b9 100644 --- a/doc/src/Build_package.rst +++ b/doc/src/Build_package.rst @@ -45,7 +45,6 @@ packages: * :ref:`KOKKOS ` * :ref:`LATTE ` * :ref:`MACHDYN ` - * :ref:`MESSAGE ` * :ref:`ML-HDNNP ` * :ref:`ML-PACE ` * :ref:`ML-QUIP ` diff --git a/doc/src/Build_windows.rst b/doc/src/Build_windows.rst index c1af555696..28fd3ff48b 100644 --- a/doc/src/Build_windows.rst +++ b/doc/src/Build_windows.rst @@ -73,8 +73,9 @@ configuration should set this up automatically, but is untested. In case of problems, you are recommended to contact somebody with experience in using Cygwin. If you do come across portability problems requiring changes to the LAMMPS source code, or figure out corrections -yourself, please report them on the lammps-users mailing list, or file -them as an issue or pull request on the LAMMPS GitHub project. +yourself, please report them on the +`LAMMPS forum at MatSci `_, +or file them as an issue or pull request on the LAMMPS GitHub project. .. _msvc: @@ -117,8 +118,8 @@ LAMMPS with MPI enabled. .. note:: This is work in progress and you should contact the LAMMPS developers - via GitHub, the forum, or the mailing list, if you have questions or - LAMMPS specific problems. + via GitHub or the `LAMMPS forum at MatSci `_, + if you have questions or LAMMPS specific problems. .. _cross: diff --git a/doc/src/Commands_all.rst b/doc/src/Commands_all.rst index 8995ffdcc4..bc25d0c0e0 100644 --- a/doc/src/Commands_all.rst +++ b/doc/src/Commands_all.rst @@ -67,8 +67,7 @@ An alphabetic list of all general LAMMPS commands. * :doc:`lattice ` * :doc:`log ` * :doc:`mass ` - * :doc:`mdi/engine ` - * :doc:`message ` + * :doc:`mdi ` * :doc:`minimize ` * :doc:`min_modify ` * :doc:`min_style ` @@ -105,7 +104,6 @@ An alphabetic list of all general LAMMPS commands. * :doc:`restart ` * :doc:`run ` * :doc:`run_style ` - * :doc:`server ` * :doc:`set ` * :doc:`shell ` * :doc:`special_bonds ` diff --git a/doc/src/Commands_bond.rst b/doc/src/Commands_bond.rst index d0083d7c63..40b99a5fb8 100644 --- a/doc/src/Commands_bond.rst +++ b/doc/src/Commands_bond.rst @@ -32,6 +32,8 @@ OPT. * * * + * :doc:`bpm/rotational ` + * :doc:`bpm/spring ` * :doc:`class2 (ko) ` * :doc:`fene (iko) ` * :doc:`fene/expand (o) ` diff --git a/doc/src/Commands_compute.rst b/doc/src/Commands_compute.rst index 5dc3014ca9..61c5e83eda 100644 --- a/doc/src/Commands_compute.rst +++ b/doc/src/Commands_compute.rst @@ -64,6 +64,7 @@ KOKKOS, o = OPENMP, t = OPT. * :doc:`event/displace ` * :doc:`fabric ` * :doc:`fep ` + * :doc:`fep/ta ` * :doc:`force/tally ` * :doc:`fragment/atom ` * :doc:`global/atom ` @@ -91,6 +92,7 @@ KOKKOS, o = OPENMP, t = OPT. * :doc:`msd ` * :doc:`msd/chunk ` * :doc:`msd/nongauss ` + * :doc:`nbond/atom ` * :doc:`omega/chunk ` * :doc:`orientorder/atom (k) ` * :doc:`pair ` diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 2dfa6e3fdb..fddf3435f9 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -51,7 +51,6 @@ OPT. * :doc:`bond/swap ` * :doc:`box/relax ` * :doc:`charge/regulation ` - * :doc:`client/md ` * :doc:`cmap ` * :doc:`colvars ` * :doc:`controller ` @@ -101,7 +100,7 @@ OPT. * :doc:`lb/viscous ` * :doc:`lineforce ` * :doc:`manifoldforce ` - * :doc:`mdi/engine ` + * :doc:`mdi/aimd ` * :doc:`meso/move ` * :doc:`mol/swap ` * :doc:`momentum (k) ` @@ -142,6 +141,7 @@ OPT. * :doc:`nve/manifold/rattle ` * :doc:`nve/noforce ` * :doc:`nve/sphere (ko) ` + * :doc:`nve/bpm/sphere ` * :doc:`nve/spin ` * :doc:`nve/tri ` * :doc:`nvk ` @@ -159,7 +159,6 @@ OPT. * :doc:`orient/fcc ` * :doc:`orient/eco ` * :doc:`pafi ` - * :doc:`pair/tracker ` * :doc:`phonon ` * :doc:`pimd ` * :doc:`planeforce ` diff --git a/doc/src/Commands_pair.rst b/doc/src/Commands_pair.rst index 7d8c5c31e8..ed521f39b2 100644 --- a/doc/src/Commands_pair.rst +++ b/doc/src/Commands_pair.rst @@ -53,6 +53,7 @@ OPT. * :doc:`born/coul/msm (o) ` * :doc:`born/coul/wolf (go) ` * :doc:`born/coul/wolf/cs (g) ` + * :doc:`bpm/spring ` * :doc:`brownian (o) ` * :doc:`brownian/poly (o) ` * :doc:`buck (giko) ` @@ -88,12 +89,12 @@ OPT. * :doc:`coul/tt ` * :doc:`coul/wolf (ko) ` * :doc:`coul/wolf/cs ` - * :doc:`dpd (gio) ` + * :doc:`dpd (giko) ` * :doc:`dpd/fdt ` - * :doc:`dpd/ext ` - * :doc:`dpd/ext/tstat ` + * :doc:`dpd/ext (k) ` + * :doc:`dpd/ext/tstat (k) ` * :doc:`dpd/fdt/energy (k) ` - * :doc:`dpd/tstat (go) ` + * :doc:`dpd/tstat (gko) ` * :doc:`dsmc ` * :doc:`e3b ` * :doc:`drip ` @@ -151,7 +152,7 @@ OPT. * :doc:`lj/cut/coul/cut/dielectric (o) ` * :doc:`lj/cut/coul/cut/soft (o) ` * :doc:`lj/cut/coul/debye (gko) ` - * :doc:`lj/cut/coul/debye/dielectric ` + * :doc:`lj/cut/coul/debye/dielectric (o) ` * :doc:`lj/cut/coul/dsf (gko) ` * :doc:`lj/cut/coul/long (gikot) ` * :doc:`lj/cut/coul/long/cs ` diff --git a/doc/src/Developer_plugins.rst b/doc/src/Developer_plugins.rst index 264a77ed5b..9bf52801a7 100644 --- a/doc/src/Developer_plugins.rst +++ b/doc/src/Developer_plugins.rst @@ -68,7 +68,7 @@ Members of ``lammpsplugin_t`` * - author - String with the name and email of the author * - creator.v1 - - Pointer to factory function for pair, bond, angle, dihedral, improper or command styles + - Pointer to factory function for pair, bond, angle, dihedral, improper, kspace, or command styles * - creator.v2 - Pointer to factory function for compute, fix, or region styles * - handle @@ -262,3 +262,24 @@ A plugin may be registered under an existing style name. In that case the plugin will override the existing code. This can be used to modify the behavior of existing styles or to debug new versions of them without having to re-compile or re-install all of LAMMPS. + +Compiling plugins +^^^^^^^^^^^^^^^^^ + +Plugins need to be compiled with the same compilers and libraries +(e.g. MPI) and compilation settings (MPI on/off, OpenMP, integer sizes) +as the LAMMPS executable and library. Otherwise the plugin will likely +not load due to mismatches in the function signatures (LAMMPS is C++ so +scope, type, and number of arguments are encoded into the symbol names +and thus differences in them will lead to failed plugin load commands. +Compilation of the plugin can be managed via both, CMake or traditional +GNU makefiles. Some examples that can be used as a template are in the +``examples/plugins`` folder. The CMake script code has some small +adjustments to allow building the plugins for running unit tests with +them. Another example that converts the KIM package into a plugin can be +found in the ``examples/kim/plugin`` folder. No changes to the sources +of the KIM package themselves are needed; only the plugin interface and +loader code needs to be added. This example only supports building with +CMake, but is probably a more typical example. To compile you need to +run CMake with -DLAMMPS_SOURCE_DIR=. Other +configuration setting are identical to those for compiling LAMMPS. diff --git a/doc/src/Developer_utils.rst b/doc/src/Developer_utils.rst index 720eececcc..9c6ef67945 100644 --- a/doc/src/Developer_utils.rst +++ b/doc/src/Developer_utils.rst @@ -133,6 +133,9 @@ and parsing files or arguments. .. doxygenfunction:: trim_comment :project: progguide +.. doxygenfunction:: star_subst + :project: progguide + .. doxygenfunction:: has_utf8 :project: progguide diff --git a/doc/src/Errors_bugs.rst b/doc/src/Errors_bugs.rst index dbec1ef895..ed60999b5f 100644 --- a/doc/src/Errors_bugs.rst +++ b/doc/src/Errors_bugs.rst @@ -17,9 +17,8 @@ the steps outlined below: if your issue has already been reported and if it is still open. * Check the `GitHub Pull Requests page `_ to see if there is already a fix for your bug pending. - * Check the `mailing list archives `_ or - the `LAMMPS forum `_ to see if the - issue has been discussed before. + * Check the `LAMMPS forum at MatSci `_ + to see if the issue has been discussed before. If none of these steps yields any useful information, please file a new bug report on the `GitHub Issue page `_. @@ -38,12 +37,9 @@ generate this restart from a data file or a simple additional input. This input deck can be used with tools like a debugger or `valgrind `_ to further :doc:`debug the crash `. -You may also send an email to the LAMMPS mailing list at -"lammps-users at lists.sourceforge.net" describing the problem with the -same kind of information. The mailing list can provide a faster response, -especially if the bug reported is actually expected behavior. But because -of the high volume of the mailing list, it can happen that your e-mail -is overlooked and then forgotten. Issues on GitHub have to be explicitly -closed, so that will *guarantee* that at least one LAMMPS developer will -have looked at it. +You may also post a message in the `development category of the LAMMPS +forum at MatSci `_ +describing the problem with the same kind of information. The forum can +provide a faster response, especially if the bug reported is actually +expected behavior or other LAMMPS users have come across it before. diff --git a/doc/src/Examples.rst b/doc/src/Examples.rst index c211727902..bbd4db8508 100644 --- a/doc/src/Examples.rst +++ b/doc/src/Examples.rst @@ -54,6 +54,8 @@ Lowercase directories +-------------+------------------------------------------------------------------+ | body | body particles, 2d system | +-------------+------------------------------------------------------------------+ +| bpm | BPM simulations of pouring elastic grains and plate impact | ++-------------+------------------------------------------------------------------+ | cmap | CMAP 5-body contributions to CHARMM force field | +-------------+------------------------------------------------------------------+ | colloid | big colloid particles in a small particle solvent, 2d system | @@ -94,12 +96,12 @@ Lowercase directories +-------------+------------------------------------------------------------------+ | latte | examples for using fix latte for DFTB via the LATTE library | +-------------+------------------------------------------------------------------+ +| mdi | use of the MDI package and MolSSI MDI code coupling library | ++-------------+------------------------------------------------------------------+ | meam | MEAM test for SiC and shear (same as shear examples) | +-------------+------------------------------------------------------------------+ | melt | rapid melt of 3d LJ system | +-------------+------------------------------------------------------------------+ -| message | demos for LAMMPS client/server coupling with the MESSAGE package | -+-------------+------------------------------------------------------------------+ | micelle | self-assembly of small lipid-like molecules into 2d bilayers | +-------------+------------------------------------------------------------------+ | min | energy minimization of 2d LJ melt | diff --git a/doc/src/Howto.rst b/doc/src/Howto.rst index 1d7d626e02..0f1abcd7d7 100644 --- a/doc/src/Howto.rst +++ b/doc/src/Howto.rst @@ -22,8 +22,9 @@ General howto Howto_replica Howto_library Howto_couple - Howto_client_server Howto_mdi + Howto_bpm + Howto_broken_bonds Settings howto ============== diff --git a/doc/src/Howto_bpm.rst b/doc/src/Howto_bpm.rst new file mode 100644 index 0000000000..8da6511213 --- /dev/null +++ b/doc/src/Howto_bpm.rst @@ -0,0 +1,124 @@ +Bonded particle models +====================== + +The BPM package implements bonded particle models which can be used to +simulate mesoscale solids. Solids are constructed as a collection of + +particles which each represent a coarse-grained region of space much +larger than the atomistic scale. Particles within a solid region are +then connected by a network of bonds to provide solid elasticity. + +Unlike traditional bonds in molecular dynamics, the equilibrium bond +length can vary between bonds. Bonds store the reference state. This +includes setting the equilibrium length equal to the initial distance +between the two particles but can also include data on the bond +orientation for rotational models. This produces a stress free initial +state. Furthermore, bonds are allowed to break under large strains +producing fracture. The examples/bpm directory has sample input scripts +for simulations of the fragmentation of an impacted plate and the +pouring of extended, elastic bodies. + +---------- + +Bonds can be created using a :doc:`read data ` or +:doc:`create bonds ` command. Alternatively, a +:doc:`molecule ` template with bonds can be used with +:doc:`fix deposit ` or :doc:`fix pour ` to +create solid grains. + +In this implementation, bonds store their reference state when they are +first computed in the setup of the first simulation run. Data is then +preserved across run commands and is written to :doc:`binary restart +files ` such that restarting the system will not reset the +reference state of a bond. Bonds that are created midway into a run, +such as those created by pouring grains using :doc:`fix pour +`, are initialized on that timestep. + +As bonds can be broken between neighbor list builds, the +:doc:`special_bonds ` command works differently for BPM +bond styles. There are two possible settings which determine how pair +interactions work between bonded particles. First, one can turn off +all pair interactions between bonded particles. Unlike :doc:`bond +quartic `, this is not done by subtracting pair forces +during the bond computation but rather by dynamically updating the +special bond list. This is the default behavior of BPM bond styles and +is done by updating the 1-2 special bond list as bonds break. To do +this, LAMMPS requires :doc:`newton ` bond off such that all +processors containing an atom know when a bond breaks. Additionally, +one must do either (A) or (B). + +(A) + +Use the following special bond settings + +.. code-block:: LAMMPS + + special_bonds lj 0 1 1 coul 1 1 1 + +These settings accomplish two goals. First, they turn off 1-3 and 1-4 +special bond lists, which are not currently supported for BPMs. As +BPMs often have dense bond networks, generating 1-3 and 1-4 special +bond lists is expensive. By setting the lj weight for 1-2 bonds to +zero, this turns off pairwise interactions. Even though there are no +charges in BPM models, setting a nonzero coul weight for 1-2 bonds +ensures all bonded neighbors are still included in the neighbor list +in case bonds break between neighbor list builds. + +(B) + +Alternatively, one can simply overlay pair interactions such that all +bonded particles also feel pair interactions. This can be accomplished +by using the *overlay/pair* keyword present in all bpm bond styles and +by using the following special bond settings + +.. code-block:: LAMMPS + + special_bonds lj/coul 1 1 1 + +See the :doc:`Howto ` page on broken bonds for +more information. + +---------- + +Currently there are two types of bonds included in the BPM +package. The first bond style, :doc:`bond bpm/spring +`, only applies pairwise, central body forces. Point +particles must have :doc:`bond atom style ` and may be +thought of as nodes in a spring network. Alternatively, the second +bond style, :doc:`bond bpm/rotational `, resolves +tangential forces and torques arising with the shearing, bending, and +twisting of the bond due to rotation or displacement of particles. +Particles are similar to those used in the :doc:`granular package +`, :doc:`atom style sphere `. However, +they must also track the current orientation of particles and store bonds +and therefore use a :doc:`bpm/sphere atom style `. +This also requires a unique integrator :doc:`fix nve/bpm/sphere +` which numerically integrates orientation similar +to :doc:`fix nve/asphere `. + +To monitor the fracture of bonds in the system, all BPM bond styles +have the ability to record instances of bond breakage to output using +the :doc:`dump local ` command. Additionally, one can use +:doc:`compute nbond/atom ` to tally the current +number of bonds per atom. + +In addition to bond styles, a new pair style :doc:`pair bpm/spring +` was added to accompany the bpm/spring bond +style. This pair style is simply a hookean repulsion with similar +velocity damping as its sister bond style. + +---------- + +While LAMMPS has many utilities to create and delete bonds, *only* +the following are currently compatible with BPM bond styles: + +* :doc:`create_bonds ` +* :doc:`delete_bonds ` +* :doc:`fix bond/create ` +* :doc:`fix bond/break ` +* :doc:`fix bond/swap ` + +Note :doc:`create_bonds ` requires certain special_bonds settings. +To subtract pair interactions, one will need to switch between different +special_bonds settings in the input script. An example is found in +examples/bpm/impact. diff --git a/doc/src/Howto_broken_bonds.rst b/doc/src/Howto_broken_bonds.rst new file mode 100644 index 0000000000..1a356df510 --- /dev/null +++ b/doc/src/Howto_broken_bonds.rst @@ -0,0 +1,48 @@ +Broken Bonds +============ + +Typically, bond interactions persist for the duration of a simulation +in LAMMPS. However, there are some exceptions that allow for bonds to +break including the :doc:`quartic bond style ` and the +bond styles in the :doc:`BPM package ` which contains the +:doc:`bpm/spring ` and +:doc:`bpm/rotational ` bond styles. In these cases, +a bond can be broken if it is stretched beyond a user-defined threshold. +LAMMPS accomplishes this by setting the bond type to zero such that the +bond force is no longer computed. + +Users are normally able to weight the contribution of pair forces to atoms +that are bonded using the :doc:`special_bonds command `. +When bonds break, this is not always the case. For the quartic bond style, +pair forces are always turned off between bonded particles. LAMMPS does +this via a computational sleight-of-hand. It subtracts the pairwise +interaction as part of the bond computation. When the bond breaks, the +subtraction stops. For this to work, the pairwise interaction must always +be computed by the :doc:`pair_style ` command, whether the bond +is broken or not. This means that :doc:`special_bonds ` must +be set to 1,1,1. After the bond breaks, the pairwise interaction between the +two atoms is turned on, since they are no longer bonded. + +In the BPM package, one can either turn off all pair interactions between +bonded particles or leave them on, overlaying pair forces on top of bond +forces. To remove pair forces, the special bond list is dynamically +updated. More details can be found on the :doc:`Howto BPM ` +page. + +Bonds can also be broken by fixes which change bond topology, including +:doc:`fix bond/break ` and +:doc:`fix bond/react `. These fixes will automatically +trigger a rebuild of the neighbor list and update special bond data structures +when bonds are broken. + +Note that when bonds are dumped to a file via the :doc:`dump local ` command, bonds with type 0 are not included. The +:doc:`delete_bonds ` command can also be used to query the +status of broken bonds or permanently delete them, e.g.: + +.. code-block:: LAMMPS + + delete_bonds all stats + delete_bonds all bond 0 remove + +The compute :doc:`nbond/atom ` can also be used +to tally the current number of bonds per atom, excluding broken bonds. diff --git a/doc/src/Howto_client_server.rst b/doc/src/Howto_client_server.rst deleted file mode 100644 index 7e21b78dfd..0000000000 --- a/doc/src/Howto_client_server.rst +++ /dev/null @@ -1,163 +0,0 @@ -Using LAMMPS in client/server mode -================================== - -Client/server coupling of two codes is where one code is the "client" -and sends request messages to a "server" code. The server responds to -each request with a reply message. This enables the two codes to work -in tandem to perform a simulation. LAMMPS can act as either a client -or server code. - -Some advantages of client/server coupling are that the two codes run -as stand-alone executables; they are not linked together. Thus -neither code needs to have a library interface. This often makes it -easier to run the two codes on different numbers of processors. If a -message protocol (format and content) is defined for a particular kind -of simulation, then in principle any code that implements the -client-side protocol can be used in tandem with any code that -implements the server-side protocol, without the two codes needing to -know anything more specific about each other. - -A simple example of client/server coupling is where LAMMPS is the -client code performing MD timestepping. Each timestep it sends a -message to a server quantum code containing current coords of all the -atoms. The quantum code computes energy and forces based on the -coords. It returns them as a message to LAMMPS, which completes the -timestep. - -A more complex example is where LAMMPS is the client code and -processes a series of data files, sending each configuration to a -quantum code to compute energy and forces. Or LAMMPS runs dynamics -with an atomistic force field, but pauses every N steps to ask the -quantum code to compute energy and forces. - -Alternate methods for code coupling with LAMMPS are described on -the :doc:`Howto couple ` doc page. - -The protocol for using LAMMPS as a client is to use these 3 commands -in this order (other commands may come in between): - -* :doc:`message client ` # initiate client/server interaction -* :doc:`fix client/md ` # any client fix which makes specific requests to the server -* :doc:`message quit ` # terminate client/server interaction - -In between the two message commands, a client fix command and -:doc:`unfix ` command can be used multiple times. Similarly, -this sequence of 3 commands can be repeated multiple times, assuming -the server program operates in a similar fashion, to initiate and -terminate client/server communication. - -The protocol for using LAMMPS as a server is to use these 2 commands -in this order (other commands may come in between): - -* :doc:`message server ` # initiate client/server interaction -* :doc:`server md ` # any server command which responds to specific requests from the client - -This sequence of 2 commands can be repeated multiple times, assuming -the client program operates in a similar fashion, to initiate and -terminate client/server communication. - -LAMMPS support for client/server coupling is in its :ref:`MESSAGE package ` which implements several -commands that enable LAMMPS to act as a client or server, as discussed -below. The MESSAGE package also wraps a client/server library called -CSlib which enables two codes to exchange messages in different ways, -either via files, sockets, or MPI. The CSlib is provided with LAMMPS -in the lib/message dir. The CSlib has its own -`website `_ with documentation and test -programs. - -.. note:: - - For client/server coupling to work between LAMMPS and another - code, the other code also has to use the CSlib. This can sometimes be - done without any modifications to the other code by simply wrapping it - with a Python script that exchanges CSlib messages with LAMMPS and - prepares input for or processes output from the other code. The other - code also has to implement a matching protocol for the format and - content of messages that LAMMPS exchanges with it. - -These are the commands currently in the MESSAGE package for two -protocols, MD and MC (Monte Carlo). New protocols can easily be -defined and added to this directory, where LAMMPS acts as either the -client or server. - -* :doc:`message ` -* :doc:`fix client md ` = LAMMPS is a client for running MD -* :doc:`server md ` = LAMMPS is a server for computing MD forces -* :doc:`server mc ` = LAMMPS is a server for computing a Monte Carlo energy - -The server doc files give details of the message protocols -for data that is exchanged between the client and server. - -These example directories illustrate how to use LAMMPS as either a -client or server code: - -* examples/message -* examples/COUPLE/README -* examples/COUPLE/lammps_mc -* examples/COUPLE/lammps_nwchem -* examples/COUPLE/lammps_vasp - -The examples/message directory couples a client instance of LAMMPS to a -server instance of LAMMPS. - -The files in the *lammps_mc* folder show how to couple LAMMPS as -a server to a simple Monte Carlo client code as the driver. - -The files in the *lammps_nwchem* folder show how to couple LAMMPS -as a client code running MD timestepping to NWChem acting as a -server providing quantum DFT forces, through a Python wrapper script -on NWChem. - -The files in the *lammps_vasp* folder show how to couple LAMMPS as -a client code running MD timestepping to VASP acting as a server -providing quantum DFT forces, through a Python wrapper script on VASP. - -Here is how to launch a client and server code together for any of the -4 modes of message exchange that the :doc:`message ` command -and the CSlib support. Here LAMMPS is used as both the client and -server code. Another code could be substituted for either. - -The examples below show launching both codes from the same window (or -batch script), using the "&" character to launch the first code in the -background. For all modes except *mpi/one*, you could also launch the -codes in separate windows on your desktop machine. It does not -matter whether you launch the client or server first. - -In these examples either code can be run on one or more processors. -If running in a non-MPI mode (file or zmq) you can launch a code on a -single processor without using mpirun. - -IMPORTANT: If you run in mpi/two mode, you must launch both codes via -mpirun, even if one or both of them runs on a single processor. This -is so that MPI can figure out how to connect both MPI processes -together to exchange MPI messages between them. - -For message exchange in *file*, *zmq*, or *mpi/two* modes: - -.. code-block:: bash - - % mpirun -np 1 lmp_mpi -log log.client < in.client & - % mpirun -np 2 lmp_mpi -log log.server < in.server - - % mpirun -np 4 lmp_mpi -log log.client < in.client & - % mpirun -np 1 lmp_mpi -log log.server < in.server - - % mpirun -np 2 lmp_mpi -log log.client < in.client & - % mpirun -np 4 lmp_mpi -log log.server < in.server - -For message exchange in *mpi/one* mode: - -Launch both codes in a single mpirun command: - -.. code-block:: bash - - mpirun -np 2 lmp_mpi -mpicolor 0 -in in.message.client -log log.client : -np 4 lmp_mpi -mpicolor 1 -in in.message.server -log log.server - -The two -np values determine how many procs the client and the server -run on. - -A LAMMPS executable run in this manner must use the -mpicolor color -command-line option as their its option, where color is an integer -label that will be used to distinguish one executable from another in -the multiple executables that the mpirun command launches. In this -example the client was colored with a 0, and the server with a 1. diff --git a/doc/src/Howto_couple.rst b/doc/src/Howto_couple.rst index 31cafd1f94..2f24fa93f8 100644 --- a/doc/src/Howto_couple.rst +++ b/doc/src/Howto_couple.rst @@ -12,16 +12,16 @@ LAMMPS can be coupled to other codes in at least 4 ways. Each has advantages and disadvantages, which you will have to think about in the context of your application. -1. Define a new :doc:`fix ` command that calls the other code. In - this scenario, LAMMPS is the driver code. During timestepping, +1. Define a new :doc:`fix ` command that calls the other code. + In this scenario, LAMMPS is the driver code. During timestepping, the fix is invoked, and can make library calls to the other code, - which has been linked to LAMMPS as a library. This is the way how the + which has been linked to LAMMPS as a library. This is the way the :ref:`LATTE ` package, which performs density-functional - tight-binding calculations using the `LATTE software `_ - to compute forces, is hooked to LAMMPS. - See the :doc:`fix latte ` command for more details. - Also see the :doc:`Modify ` doc pages for info on how to - add a new fix to LAMMPS. + tight-binding calculations using the `LATTE software + `_ to compute forces, is hooked to + LAMMPS. See the :doc:`fix latte ` command for more + details. Also see the :doc:`Modify ` doc pages for info on + how to add a new fix to LAMMPS. .. spacer @@ -58,6 +58,12 @@ context of your application. .. spacer -4. Couple LAMMPS with another code in a client/server mode. This is - described on the :doc:`Howto client/server ` doc - page. +4. Couple LAMMPS with another code in a client/server fashion, using + using the `MDI Library + `_ + developed by the `Molecular Sciences Software Institute (MolSSI) + `_ to run LAMMPS as either an MDI driver + (client) or an MDI engine (server). The MDI driver issues commands + to the MDI server to exchange data between them. See the + :doc:`Howto mdi ` page for more information about how + LAMMPS can operate in either of these modes. diff --git a/doc/src/Howto_mdi.rst b/doc/src/Howto_mdi.rst index 12c4cfa527..f5aab0be22 100644 --- a/doc/src/Howto_mdi.rst +++ b/doc/src/Howto_mdi.rst @@ -1,132 +1,144 @@ Using LAMMPS with the MDI library for code coupling =================================================== -.. note:: - - This Howto page will eventually replace the - :doc:`Howto client/server ` doc page. - -Client/server coupling of two codes is where one code is the "client" -and sends request messages (data) to a "server" code. The server -responds to each request with a reply message. This enables the two -codes to work in tandem to perform a simulation. LAMMPS can act as -either a client or server code; it does this by using the `MolSSI -Driver Interface (MDI) library +Client/server coupling of two (or more) codes is where one code is the +"client" and sends request messages (data) to one (or more) "server" +code(s). A server responds to each request with a reply message +(data). This enables two (or more) codes to work in tandem to perform +a simulation. LAMMPS can act as either a client or server code; it +does this by using the `MolSSI Driver Interface (MDI) library `_, developed by the `Molecular Sciences Software Institute (MolSSI) -`_. +`_, which is supported by the :ref:`MDI ` +package. Alternate methods for code coupling with LAMMPS are described on the :doc:`Howto couple ` doc page. -Some advantages of client/server coupling are that the two codes can run +Some advantages of client/server coupling are that the codes can run as stand-alone executables; they need not be linked together. Thus -neither code needs to have a library interface. This also makes it easy -to run the two codes on different numbers of processors. If a message -protocol (format and content) is defined for a particular kind of -simulation, then in principle any code which implements the client-side -protocol can be used in tandem with any code which implements the -server-side protocol. Neither code needs to know what specific other -code it is working with. +neither code needs to have a library interface. This also makes it +easy to run the two codes on different numbers of processors. If a +message protocol (format and content) is defined for a particular kind +of simulation, then in principle any code which implements the +client-side protocol can be used in tandem with any code which +implements the server-side protocol. Neither code needs to know what +specific other code it is working with. In MDI nomenclature, a client code is the "driver", and a server code is an "engine". One driver code can communicate with one or more instances of one or more engine codes. Driver and engine codes can be written in any language: C, C++, Fortran, Python, etc. -In addition to allowing driver and engine(s) running to run as -stand-alone executables, MDI also enables a server code to be a -"plugin" to the client code. In this scenario, server code(s) are -compiled as shared libraries, and one (or more) instances of the -server are instantiated by the driver code. If the driver code runs -in parallel, it can split its MPI communicator into multiple -sub-communicators, and launch each plugin engine instance on a -sub-communicator. Driver processors in that sub-communicator exchange -messages with that engine instance, and can also send MPI messages to -other processors in the driver. The driver code can also destroy -engine instances and re-instantiate them. +In addition to allowing driver and engine(s) to run as stand-alone +executables, MDI also enables an engine to be a *plugin* to the client +code. In this scenario, server code(s) are compiled as shared +libraries, and one (or more) instances of the server are instantiated +by the driver code. If the driver code runs in parallel, it can split +its MPI communicator into multiple sub-communicators, and launch each +plugin engine instance on a sub-communicator. Driver processors +within that sub-communicator exchange messages with the corresponding +engine instance, and can also send MPI messages to other processors in +the driver. The driver code can also destroy engine instances and +re-instantiate them. LAMMPS can operate as either a stand-alone or +plugin MDI engine. When it operates as a driver, if can use either +stand-alone or plugin MDI engines. -The way that a driver communicates with an engine is by making -MDI_Send() and MDI_Recv() calls, which are conceptually similar to -MPI_Send() and MPI_Recv() calls. Each send or receive has a string -which identifies the command name, and optionally some data, which can -be a single value or vector of values of any data type. Inside the -MDI library, data is exchanged between the driver and engine via MPI -calls or sockets. This a run-time choice by the user. +The way in which an MDI driver communicates with an MDI engine is by +making MDI_Send() and MDI_Recv() calls, which are conceptually similar +to MPI_Send() and MPI_Recv() calls. Each send or receive operation +uses a string to identify the command name, and optionally some data, +which can be a single value or vector of values of any data type. +Inside the MDI library, data is exchanged between the driver and +engine via MPI calls or sockets. This a run-time choice by the user. + +---------- + +The :ref:`MDI ` package provides a :doc:`mdi engine ` +command which enables LAMMPS to operate as an MDI engine. Its doc +page explains the variety of standard and custom MDI commands which +the LAMMPS engine recognizes and can respond to. + +The package also provides a :doc:`mdi plugin ` command which +enables LAMMPS to operate as an MDI driver and load an MDI engine as a +plugin library. + +The package also has a `fix mdi/aimd ` command in which +LAMMPS operates as an MDI driver to perform *ab initio* MD simulations +in conjunction with a quantum mechanics code. Its post_force() method +illustrates how a driver issues MDI commands to another code. This +command can be used to couple to an MDI engine which is either a +stand-alone code or a plugin library. + +---------- + +The examples/mdi directory contains Python scripts and LAMMPS input +script which use LAMMPS as either an MDI driver or engine or both. +Three example use cases are provided: + +* Run ab initio MD (AIMD) using 2 instances of LAMMPS, one as driver + and one as an engine. As an engine, LAMMPS is a surrogate for a + quantum code. + +* A Python script driver invokes a sequence of unrelated LAMMPS + calculations. Calculations can be single-point energy/force + evaluations, MD runs, or energy minimizations. + +* Run AIMD with a Python driver code and 2 LAMMPS instances as + engines. The first LAMMPS instance performs MD timestepping. The + second LAMMPS instance acts as a surrogate QM code to compute + forces. + +Note that in any of these example where LAMMPS is used as an engine, +an actual QM code (which supports MDI) could be used in its place, +without modifying other code or scripts, except to specify the name of +the QM code. + +The examples/mdi/README file explains how to launch both driver and +engine codes so that they communicate using the MDI library via either +MPI or sockets. ------------- -As an example, LAMMPS and the ``pw.x`` command from Quantum Espresso (a -suite of quantum DFT codes), can work together via the MDI library to -perform an ab initio MD (AIMD) simulation, where LAMMPS runs an MD -simulation and sends a message each timestep to ``pw.x`` asking it to -compute quantum forces on the current configuration of atoms. Here is -how the 2 codes are launched to communicate by MPI: +Currently there are two quantum DFT codes which have direct MDI +support, `Quantum ESPRESSO (QE) `_ +and `INQ `_. There are also +several QM codes which have indirect support through QCEngine or i-PI. +The former means they require a wrapper program (QCEngine) with MDI +support which writes/read files to pass data to the quantum code +itself. The list of QCEngine-supported and i-PI-supported quantum +codes is on the `MDI webpage +`_. + +Here is how to build QE as a stand-alone ``pw.x`` file which can be +used in stand-alone mode: .. code-block:: bash - % mpirun -np 2 lmp_mpi -mdi "-role DRIVER -name d -method MPI" \ - -in in.aimd : -np 16 pw.x -in qe.in -mdi "-role ENGINE -name e -method MPI" + % git clone --branch mdi_plugin https://github.com/MolSSI-MDI/q-e.git /q-e + % build the executable pw.x, following the `QE build guide `_ -In this case LAMMPS runs on 2 processors (MPI tasks), ``pw.x`` runs on 16 -processors. - -Here is how the 2 codes are launched to communicate by sockets: +Here is how to build QE as a shared library which can be used in plugin mode, +which results in a libqemdi.so file in /q-e/MDI/src: .. code-block:: bash - % mpirun -np 2 lmp_mpi -mdi "-role DRIVER -name d -method TCP -port 8021" -in in.aimd - % mpirun -np 16 pw.x -in qe.in -mdi "-role ENGINE -name e -method TCP -port 8021 -hostname localhost" + % git clone --branch mdi_plugin https://github.com/MolSSI-MDI/q-e.git /q-e + % cd /q-e + % ./configure --enable-parallel --enable-openmp --enable-shared FFLAGS="-fPIC" FCFLAGS="-fPIC" CFLAGS="-fPIC" foxflags="-fPIC" try_foxflags="-fPIC" + % make -j 4 mdi -These commands could be issued in different windows on a desktop -machine. Or in the same window, if the first command is ended with -"&" so as to run in the background. If "localhost" is replaced by an -IP address, ``pw.x`` could be run on another machine on the same network, or -even on another machine across the country. +INQ cannot be built as a stand-alone code; it is by design a library. +Here is how to build INQ as a shared library which can be used in +plugin mode, which results in a libinqmdi.so file in +/inq/build/examples: -After both codes initialize themselves to model the same system, this is -what occurs each timestep: +.. code-block:: bash -* LAMMPS send a ">COORDS" message to ``pw.x`` with a 3*N vector of current atom coords -* ``pw.x`` receives the message/coords and computes quantum forces on all the atoms -* LAMMPS send a "` command. This will put LAMMPS into -"engine mode" where it waits for messages and data from the driver. -When the driver sends an "EXIT" command, LAMMPS will exit engine mode -and the input script will continue. - -If LAMMPS is used as a plugin engine it operates the same way, except -that the driver will pass LAMMPS an input script to initialize itself. -Upon receiving the "EXIT" command, LAMMPS will exit engine mode and the -input script will continue. After finishing execution of the input -script, the instance of LAMMPS will be destroyed. - -LAMMPS supports the full set of MD-appropriate engine commands defined -by the MDI library. See the :doc:`mdi/engine ` page for -a list of these. - -If those commands are not sufficient for a user-developed driver to use -LAMMPS as an engine, then new commands can be easily added. See these -two files which implement the definition of MDI commands and the logic -for responding to them: - -* src/MDI/mdi_engine.cpp -* src/MDI/fix_mdi_engine.cpp + % git clone --branch mdi --recurse-submodules https://gitlab.com/taylor-a-barnes/inq.git /inq + % cd /inq + % mkdir -p build + % cd build + % ../configure --prefix=/install + % make -j 4 + % make install diff --git a/doc/src/Howto_structured_data.rst b/doc/src/Howto_structured_data.rst index 56a1778ece..b320e87279 100644 --- a/doc/src/Howto_structured_data.rst +++ b/doc/src/Howto_structured_data.rst @@ -79,6 +79,10 @@ This data can be extracted and parsed from a log file using python with: .. code-block:: python import re, yaml + try: + from yaml import CSafeLoader as Loader, CSafeDumper as Dumper + except ImportError: + from yaml import SafeLoader as Loader, SafeDumper as Dumper docs = "" with open("log.lammps") as f: @@ -86,7 +90,7 @@ This data can be extracted and parsed from a log file using python with: m = re.search(r"^(keywords:.*$|data:$|---$|\.\.\.$| - \[.*\]$)", line) if m: docs += m.group(0) + '\n' - thermo = list(yaml.load_all(docs, Loader=yaml.SafeLoader)) + thermo = list(yaml.load_all(docs, Loader=Loader)) print("Number of runs: ", len(thermo)) print(thermo[1]['keywords'][4], ' = ', thermo[1]['data'][2][4]) diff --git a/doc/src/Install_mac.rst b/doc/src/Install_mac.rst index 14aa8075ee..4bc0dcb88b 100644 --- a/doc/src/Install_mac.rst +++ b/doc/src/Install_mac.rst @@ -5,7 +5,7 @@ LAMMPS can be downloaded, built, and configured for OS X on a Mac with `Homebrew `_. (Alternatively, see the install instructions for :doc:`Download an executable via Conda `.) The following LAMMPS packages are unavailable at this time because of additional needs not yet met: -GPU, KOKKOS, LATTE, MSCG, MESSAGE, MPIIO POEMS VORONOI. +GPU, KOKKOS, LATTE, MSCG, MPIIO, POEMS, VORONOI. After installing Homebrew, you can install LAMMPS on your system with the following commands: diff --git a/doc/src/Install_tarball.rst b/doc/src/Install_tarball.rst index caa8f700a9..21727a4aeb 100644 --- a/doc/src/Install_tarball.rst +++ b/doc/src/Install_tarball.rst @@ -6,7 +6,7 @@ of the `LAMMPS website `_. .. _download: https://www.lammps.org/download.html .. _bug: https://www.lammps.org/bug.html -.. _older: https://www.lammps.org/tars +.. _older: https://download.lammps.org/tars/ .. _lws: https://www.lammps.org You have two choices of tarballs, either the most recent stable diff --git a/doc/src/Intro_citing.rst b/doc/src/Intro_citing.rst index 08f82fac33..9f761a7616 100644 --- a/doc/src/Intro_citing.rst +++ b/doc/src/Intro_citing.rst @@ -46,7 +46,7 @@ In addition there are DOIs for individual stable releases. Currently there are: - 3 March 2020 version: `DOI:10.5281/zenodo.3726417 `_ - 29 October 2020 version: `DOI:10.5281/zenodo.4157471 `_ - +- 29 September 2021 version: `DOI:10.5281/zenodo.6386596 `_ Home page ^^^^^^^^^ diff --git a/doc/src/Intro_website.rst b/doc/src/Intro_website.rst index db930a1b26..bf16efe185 100644 --- a/doc/src/Intro_website.rst +++ b/doc/src/Intro_website.rst @@ -20,7 +20,6 @@ available online are listed below. * `Glossary of terms relevant to LAMMPS `_ * `LAMMPS highlights with images `_ * `LAMMPS highlights with movies `_ -* `Mailing list `_ * `LAMMPS forum `_ * `Workshops `_ * `Tutorials `_ diff --git a/doc/src/Manual.rst b/doc/src/Manual.rst index 2bbf2d95be..3d7c7ad8dd 100644 --- a/doc/src/Manual.rst +++ b/doc/src/Manual.rst @@ -14,11 +14,11 @@ LAMMPS is an open-source code, distributed freely under the terms of the GNU Public License Version 2 (GPLv2). The `LAMMPS website `_ has a variety of information about the -code. It includes links to an on-line version of this manual, a -`mailing list `_ and -`online forum `_ where users can -post questions, and a `GitHub site `_ -where all LAMMPS development is coordinated. +code. It includes links to an on-line version of this manual, an +`online forum `_ where users can post +questions and discuss LAMMPS, and a `GitHub site +`_ where all LAMMPS development is +coordinated. ---------- diff --git a/doc/src/Modify_contribute.rst b/doc/src/Modify_contribute.rst index a7476d0174..5ccb83e328 100644 --- a/doc/src/Modify_contribute.rst +++ b/doc/src/Modify_contribute.rst @@ -27,11 +27,10 @@ join the `LAMMPS developers on Slack `_. This slack work space is by invitation only. Thus for access, please send an e-mail to ``slack@lammps.org`` explaining what part of LAMMPS you are working on. Only discussions related to LAMMPS development are -tolerated in that work space, so this is **NOT** for people that look for -help with compiling, installing, or using LAMMPS. Please post a message -to the `lammps-users mailing list `_ -or the `LAMMPS forum `_ for those -purposes. +tolerated in that work space, so this is **NOT** for people that look +for help with compiling, installing, or using LAMMPS. Please post a +message to the `LAMMPS forum `_ for +those purposes. Packages versus individual files -------------------------------- diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index 5876d82cc5..6d2b2f5a68 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -32,6 +32,7 @@ page gives those details. * :ref:`AWPMD ` * :ref:`BOCS ` * :ref:`BODY ` + * :ref:`BPM ` * :ref:`BROWNIAN ` * :ref:`CG-DNA ` * :ref:`CG-SDK ` @@ -72,7 +73,6 @@ page gives those details. * :ref:`MDI ` * :ref:`MEAM ` * :ref:`MESONT ` - * :ref:`MESSAGE ` * :ref:`MGPT ` * :ref:`MISC ` * :ref:`ML-HDNNP ` @@ -284,6 +284,33 @@ overview. ---------- +.. _PKG-BPM: + +BPM package +------------ + +**Contents:** + +Pair styles, bond styles, fixes, and computes for bonded particle +models for mesoscale simulations of solids and fracture. See the +:doc:`Howto bpm ` page for an overview. + +**Authors:** Joel T. Clemmer (Sandia National Labs) + +**Supporting info:** + +* src/BPM filenames -> commands +* :doc:`Howto_bpm ` +* :doc:`atom_style bpm/sphere ` +* :doc:`bond_style bpm/rotational ` +* :doc:`bond_style bpm/spring ` +* :doc:`compute nbond/atom ` +* :doc:`fix nve/bpm/sphere ` +* :doc:`pair_style bpm/spring ` +* examples/bpm + +---------- + .. _PKG-BROWNIAN: BROWNIAN package @@ -529,8 +556,20 @@ To use this package, also the :ref:`KSPACE ` and **Supporting info:** * src/DIELECTRIC: filenames -> commands +* :doc:`atom_style dielectric ` +* :doc:`pair_style coul/cut/dielectric ` +* :doc:`pair_style coul/long/dielectric ` +* :doc:`pair_style lj/cut/coul/cut/dielectric ` +* :doc:`pair_style lj/cut/coul/debye/dielectric ` +* :doc:`pair_style lj/cut/coul/long/dielectric ` +* :doc:`pair_style lj/cut/coul/msm/dielectric ` +* :doc:`pair_style pppm/dielectric ` +* :doc:`pair_style pppm/disp/dielectric ` +* :doc:`pair_style msm/dielectric ` +* :doc:`fix_style polarize/bem/icc ` +* :doc:`fix_style polarize/bem/gmres ` +* :doc:`fix_style polarize/functional ` * :doc:`compute efield/atom ` -* TODO: add all styles * examples/PACKAGES/dielectric ---------- @@ -1396,17 +1435,25 @@ MDI package **Contents:** -A LAMMPS command and fix to allow client-server coupling of LAMMPS to -other atomic or molecular simulation codes via the `MolSSI Driver Interface +A LAMMPS command and fixes to allow client-server coupling of LAMMPS +to other atomic or molecular simulation codes or materials modeling +workflows via the `MolSSI Driver Interface (MDI) library `_. **Author:** Taylor Barnes - MolSSI, taylor.a.barnes at gmail.com +**Install:** + +This package has :ref:`specific installation instructions ` on +the :doc:`Build extras ` page. + **Supporting info:** * src/MDI/README -* :doc:`mdi/engine ` -* :doc:`fix mdi/engine ` +* lib/mdi/README +* :doc:`Howto MDI ` +* :doc:`mdi ` +* :doc:`fix mdi/aimd ` * examples/PACKAGES/mdi ---------- @@ -1483,32 +1530,6 @@ Philipp Kloza (U Cambridge) ---------- -.. _PKG-MESSAGE: - -MESSAGE package ---------------- - -**Contents:** - -Commands to use LAMMPS as either a client or server and couple it to -another application. - -**Install:** - -This package has :ref:`specific installation instructions ` on the :doc:`Build extras ` page. - -**Supporting info:** - -* src/MESSAGE: filenames -> commands -* lib/message/README -* :doc:`message ` -* :doc:`fix client/md ` -* :doc:`server md ` -* :doc:`server mc ` -* examples/message - ----------- - .. _PKG-MGPT: MGPT package @@ -1564,7 +1585,6 @@ listing, "ls src/MISC", to see the list of commands. * :doc:`pair_style list ` * :doc:`pair_style srp ` * :doc:`pair_style tracker ` -* :doc:`fix pair/tracker ` ---------- diff --git a/doc/src/Packages_list.rst b/doc/src/Packages_list.rst index 22dfa2c69e..14d76e0ba3 100644 --- a/doc/src/Packages_list.rst +++ b/doc/src/Packages_list.rst @@ -58,6 +58,11 @@ whether an extra library is needed to build and use the package: - :doc:`Howto body ` - body - no + * - :ref:`BPM ` + - bonded particle models + - :doc:`Howto bpm ` + - bpm + - no * - :ref:`BROWNIAN ` - Brownian dynamics, self-propelled particles - :doc:`fix brownian `, :doc:`fix propel/self ` @@ -244,7 +249,7 @@ whether an extra library is needed to build and use the package: - n/a - no * - :ref:`MDI ` - - client-server coupling + - client-server code coupling - :doc:`MDI Howto ` - PACKAGES/mdi - ext @@ -258,11 +263,6 @@ whether an extra library is needed to build and use the package: - pair styles :doc:`mesont/tpm `, :doc:`mesocnt ` - PACKAGES/mesont - int - * - :ref:`MESSAGE ` - - client/server messaging - - :doc:`message ` - - message - - int * - :ref:`MGPT ` - fast MGPT multi-ion potentials - :doc:`pair_style mgpt ` diff --git a/doc/src/Run_options.rst b/doc/src/Run_options.rst index 96015b1613..ceae464a59 100644 --- a/doc/src/Run_options.rst +++ b/doc/src/Run_options.rst @@ -226,15 +226,6 @@ other executable(s) perform an MPI_Comm_split() with their own colors to shrink the MPI_COMM_WORLD communication to be the subset of processors they are actually running on. -Currently, this is only used in LAMMPS to perform client/server -messaging with another application. LAMMPS can act as either a client -or server (or both). More details are given on the :doc:`Howto client/server ` doc page. - -Specifically, this refers to the "mpi/one" mode of messaging provided -by the :doc:`message ` command and the CSlib library LAMMPS -links with from the lib/message directory. See the -:doc:`message ` command for more details. - ---------- .. _cite: diff --git a/doc/src/atom_style.rst b/doc/src/atom_style.rst index 3a525b27f5..bd0c193962 100644 --- a/doc/src/atom_style.rst +++ b/doc/src/atom_style.rst @@ -10,7 +10,7 @@ Syntax atom_style style args -* style = *angle* or *atomic* or *body* or *bond* or *charge* or *dipole* or *dpd* or *edpd* or *electron* or *ellipsoid* or *full* or *line* or *mdpd* or *molecular* or *oxdna* or *peri* or *smd* or *sph* or *sphere* or *spin* or *tdpd* or *tri* or *template* or *hybrid* +* style = *angle* or *atomic* or *body* or *bond* or *charge* or *dipole* or *dpd* or *edpd* or *electron* or *ellipsoid* or *full* or *line* or *mdpd* or *molecular* or *oxdna* or *peri* or *smd* or *sph* or *sphere* or *bpm/sphere* or *spin* or *tdpd* or *tri* or *template* or *hybrid* .. parsed-literal:: @@ -21,6 +21,7 @@ Syntax see the :doc:`Howto body ` doc page for details *sphere* arg = 0/1 (optional) for static/dynamic particle radii + *bpm/sphere* arg = 0/1 (optional) for static/dynamic particle radii *tdpd* arg = Nspecies Nspecies = # of chemical species *template* arg = template-ID @@ -120,6 +121,8 @@ quantities. +--------------+-----------------------------------------------------+--------------------------------------+ | *sphere* | diameter, mass, angular velocity | granular models | +--------------+-----------------------------------------------------+--------------------------------------+ +| *bpm/sphere* | diameter, mass, angular velocity, quaternion | granular bonded particle models (BPM)| ++--------------+-----------------------------------------------------+--------------------------------------+ | *spin* | magnetic moment | system with magnetic particles | +--------------+-----------------------------------------------------+--------------------------------------+ | *tdpd* | chemical concentration | tDPD particles | @@ -141,8 +144,9 @@ quantities. output the custom values. All of the above styles define point particles, except the *sphere*, -*ellipsoid*, *electron*, *peri*, *wavepacket*, *line*, *tri*, and -*body* styles, which define finite-size particles. See the :doc:`Howto spherical ` page for an overview of using +*bpm/sphere*, *ellipsoid*, *electron*, *peri*, *wavepacket*, *line*, +*tri*, and *body* styles, which define finite-size particles. See the +:doc:`Howto spherical ` page for an overview of using finite-size particle models with LAMMPS. All of the point-particle styles assign mass to particles on a @@ -150,15 +154,15 @@ per-type basis, using the :doc:`mass ` command, The finite-size particle styles assign mass to individual particles on a per-particle basis. -For the *sphere* style, the particles are spheres and each stores a +For the *sphere* and *bpm/sphere* styles, the particles are spheres and each stores a per-particle diameter and mass. If the diameter > 0.0, the particle is a finite-size sphere. If the diameter = 0.0, it is a point particle. Note that by use of the *disc* keyword with the :doc:`fix nve/sphere `, :doc:`fix nvt/sphere `, :doc:`fix nph/sphere `, :doc:`fix npt/sphere -` commands, spheres can be effectively treated as 2d +` commands for the *sphere* style, spheres can be effectively treated as 2d discs for a 2d simulation if desired. See also the :doc:`set -density/disc ` command. The *sphere* style takes an optional 0 +density/disc ` command. The *sphere* and *bpm/sphere* styles take an optional 0 or 1 argument. A value of 0 means the radius of each sphere is constant for the duration of the simulation. A value of 1 means the radii may vary dynamically during the simulation, e.g. due to use of @@ -195,6 +199,8 @@ position, which is represented by the eradius = electron size. For the *peri* style, the particles are spherical and each stores a per-particle mass and volume. +The *bpm/sphere* style is part of the BPM package. + The *oxdna* style is for coarse-grained nucleotides and stores the 3'-to-5' polarity of the nucleotide strand, which is set through the bond topology in the data file. The first (second) atom in a diff --git a/doc/src/bond_bpm_rotational.rst b/doc/src/bond_bpm_rotational.rst new file mode 100644 index 0000000000..b13d27dfbe --- /dev/null +++ b/doc/src/bond_bpm_rotational.rst @@ -0,0 +1,258 @@ +.. index:: bond_style bpm/rotational + +bond_style bpm/rotational command +================================= + +Syntax +"""""" + +.. code-block:: LAMMPS + + bond_style bpm/rotational keyword value attribute1 attribute2 ... + +* optional keyword = *overlay/pair* or *store/local* or *smooth* + + .. parsed-literal:: + + *store/local* values = fix_ID N attributes ... + * fix_ID = ID of associated internal fix to store data + * N = prepare data for output every this many timesteps + * attributes = zero or more of the below attributes may be appended + + *id1, id2* = IDs of 2 atoms in the bond + *time* = the timestep the bond broke + *x, y, z* = the center of mass position of the 2 atoms when the bond broke (distance units) + *x/ref, y/ref, z/ref* = the initial center of mass position of the 2 atoms (distance units) + + *overlay/pair* value = none + bonded particles will still interact with pair forces + + *smooth* value = *yes* or *no* + smooths bond forces near the breaking point + +Examples +"""""""" + +.. code-block:: LAMMPS + + bond_style bpm/rotational + bond_coeff 1 1.0 0.2 0.02 0.02 0.20 0.04 0.04 0.04 0.1 0.02 0.002 0.002 + + bond_style bpm/rotational myfix 1000 time id1 id2 + fix myfix all store/local 1000 3 + dump 1 all local 1000 dump.broken f_myfix[1] f_myfix[2] f_myfix[3] + dump_modify 1 write_header no + +Description +""""""""""" + +The *bpm/rotational* bond style computes forces and torques based on +deviations from the initial reference state of the two atoms. The +reference state is stored by each bond when it is first computed in +the setup of a run. Data is then preserved across run commands and is +written to :doc:`binary restart files ` such that restarting +the system will not reset the reference state of a bond. + +Forces include a normal and tangential component. The base normal force +has a magnitude of + +.. math:: + + f_r = k_r (r - r_0) + +where :math:`k_r` is a stiffness and :math:`r` is the current distance and +:math:`r_0` is the initial distance between the two particles. + +A tangential force is applied perpendicular to the normal direction +which is proportional to the tangential shear displacement with a +stiffness of :math:`k_s`. This tangential force also induces a torque. +In addition, bending and twisting torques are also applied to +particles which are proportional to angular bending and twisting +displacements with stiffnesses of :math`k_b` and :math:`k_t', +respectively. Details on the calculations of shear displacements and +angular displacements can be found in :ref:`(Wang) ` and +:ref:`(Wang and Mora) `. + +Bonds will break under sufficient stress. A breaking criteria is calculated + +.. math:: + + B = \mathrm{max}\{0, \frac{f_r}{f_{r,c}} + \frac{|f_s|}{f_{s,c}} + + \frac{|\tau_b|}{\tau_{b,c}} + \frac{|\tau_t|}{\tau_{t,c}} \} + +where :math:`|f_s|` is the magnitude of the shear force and +:math:`|\tau_b|` and :math:`|\tau_t|` are the magnitudes of the +bending and twisting forces, respectively. The corresponding variables +:math:`f_{r,c}` :math:`f_{s,c}`, :math:`\tau_{b,c}`, and +:math:`\tau_{t,c}` are critical limits to each force or torque. If +:math:`B` is ever equal to or exceeds one, the bond will break. This +is done by setting by setting its type to 0 such that forces and +torques are no longer computed. + +After computing the base magnitudes of the forces and torques, they +can be optionally multiplied by an extra factor :math:`w` to smoothly +interpolate forces and torques to zero as the bond breaks. This term +is calculated as :math:`w = (1.0 - B^4)`. This smoothing factor can be +added or removed using the *smooth* keyword. + +Finally, additional damping forces and torques are applied to the two +particles. A force is applied proportional to the difference in the +normal velocity of particles using a similar construction as +dissipative particle dynamics (:ref:`(Groot) `): + +.. math:: + + F_D = - \gamma_n w (\hat{r} \bullet \vec{v}) + +where :math:`\gamma_n` is the damping strength, :math:`\hat{r}` is the +radial normal vector, and :math:`\vec{v}` is the velocity difference +between the two particles. Similarly, tangential forces are applied to +each atom proportional to the relative differences in sliding +velocities with a constant prefactor :math:`\gamma_s` (:ref:`(Wang et +al.) `) along with their associated torques. The rolling and +twisting components of the relative angular velocities of the two +atoms are also damped by applying torques with prefactors of +:math:`\gamma_r` and :math:`\gamma_t`, respectively. + +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:`k_r` (force/distance units) +* :math:`k_s` (force/distance units) +* :math:`k_t` (force*distance/radians units) +* :math:`k_b` (force*distance/radians units) +* :math:`f_{r,c}` (force units) +* :math:`f_{s,c}` (force units) +* :math:`\tau_{b,c}` (force*distance units) +* :math:`\tau_{t,c}` (force*distance units) +* :math:`\gamma_n` (force/velocity units) +* :math:`\gamma_s` (force/velocity units) +* :math:`\gamma_r` (force*distance/velocity units) +* :math:`\gamma_t` (force*distance/velocity units) + +By default, pair forces are not calculated between bonded particles. +Pair forces can alternatively be overlaid on top of bond forces using +the *overlay/pair* keyword. These settings require specific +:doc:`special_bonds ` settings described in the +restrictions. Further details can be found in the `:doc: how to +` page on BPMs. + +If the *store/local* keyword is used, this fix will track bonds that +break during the simulation. Whenever a bond breaks, data is processed +and transferred to an internal fix labeled *fix_ID*. This allows the +local data to be accessed by other LAMMPS commands. +Following any optional keyword/value arguments, a list of one or more +attributes is specified. These include the IDs of the two atoms in +the bond. The other attributes for the two atoms include the timestep +during which the bond broke and the current/initial center of mass +position of the two atoms. + +Data is continuously accumulated over intervals of *N* +timesteps. At the end of each interval, all of the saved accumulated +data is deleted to make room for new data. Individual datum may +therefore persist anywhere between *1* to *N* timesteps depending on +when they are saved. This data can be accessed using the *fix_ID* and a +:doc:`dump local ` command. To ensure all data is output, +the dump frequency should correspond to the same interval of *N* +timesteps. A dump frequency of an integer multiple of *N* can be used +to regularly output a sample of the accumulated data. + +Note that when unbroken bonds are dumped to a file via the +:doc:`dump local ` command, bonds with type 0 (broken bonds) +are not included. +The :doc:`delete_bonds ` command can also be used to +query the status of broken bonds or permanently delete them, e.g.: + +.. code-block:: LAMMPS + + delete_bonds all stats + delete_bonds all bond 0 remove + + +---------- + +Restart and other info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +This bond style writes the reference state of each bond to +:doc:`binary restart files `. Loading a restart file will +properly resume bonds. + +The single() function of these pair styles returns 0.0 for the energy +of a pairwise interaction, since energy is not conserved in these +dissipative potentials. It also returns only the normal component of +the pairwise interaction force. + +The accumulated data is not written to restart files and should be +output before a restart file is written to avoid missing data. + +The internal fix calculates a local vector or local array depending on the +number of input values. The length of the vector or number of rows in +the array is the number of recorded, lost interactions. If a single +input is specified, a local vector is produced. If two or more inputs +are specified, a local array is produced where the number of columns = +the number of inputs. The vector or array can be accessed by any +command that uses local values from a compute as input. See the +:doc:`Howto output ` page for an overview of LAMMPS +output options. + +The vector or array will be floating point values that correspond to +the specified attribute. + +Restrictions +"""""""""""" + +This bond style can only be used if LAMMPS was built with the BPM +package. See the :doc:`Build package ` doc page for +more info. + +By default if pair interactions are to be disabled, this bond style +requires setting + +.. code-block:: LAMMPS + + special_bonds lj 0 1 1 coul 1 1 1 + +and :doc:`newton ` must be set to bond off. If the +*overlay/pair* option is used, this bond style alternatively requires +setting + +.. code-block:: LAMMPS + + special_bonds lj/coul 1 1 1 + +The *bpm/rotational* style requires :doc:`atom style bpm/sphere `. + +Related commands +"""""""""""""""" + +:doc:`bond_coeff `, :doc:`fix nve/bpm/sphere ` + +Default +""""""" + +The option defaults are *smooth* = *yes* + +---------- + +.. _Wang2009: + +**(Wang)** Wang, Acta Geotechnica, 4, +p 117-127 (2009). + +.. _Wang2009b: + +**(Wang and Mora)** Wang, Mora, Advances in Geocomputing, +119, p 183-228 (2009). + +.. _Groot3: + +**(Groot)** Groot and Warren, J Chem Phys, 107, 4423-35 (1997). + +.. _Wang20152: + +**(Wang et al, 2015)** Wang, Y., Alonso-Marroquin, F., & Guo, +W. W. (2015). Rolling and sliding in 3-D discrete element +models. Particuology, 23, 49-55. diff --git a/doc/src/bond_bpm_spring.rst b/doc/src/bond_bpm_spring.rst new file mode 100644 index 0000000000..1d2f12701d --- /dev/null +++ b/doc/src/bond_bpm_spring.rst @@ -0,0 +1,202 @@ +.. index:: bond_style bpm/spring + +bond_style bpm/spring command +============================= + +Syntax +"""""" + +.. code-block:: LAMMPS + + bond_style bpm/spring keyword value attribute1 attribute2 ... + +* optional keyword = *overlay/pair* or *store/local* or *smooth* + + .. parsed-literal:: + + *store/local* values = fix_ID N attributes ... + * fix_ID = ID of associated internal fix to store data + * N = prepare data for output every this many timesteps + * attributes = zero or more of the below attributes may be appended + + *id1, id2* = IDs of 2 atoms in the bond + *time* = the timestep the bond broke + *x, y, z* = the center of mass position of the 2 atoms when the bond broke (distance units) + *x/ref, y/ref, z/ref* = the initial center of mass position of the 2 atoms (distance units) + + *overlay/pair* value = none + bonded particles will still interact with pair forces + + *smooth* value = *yes* or *no* + smooths bond forces near the breaking point + +Examples +"""""""" + +.. code-block:: LAMMPS + + bond_style bpm/spring + bond_coeff 1 1.0 0.05 0.1 + + bond_style bpm/spring myfix 1000 time id1 id2 + dump 1 all local 1000 dump.broken f_myfix[1] f_myfix[2] f_myfix[3] + dump_modify 1 write_header no + +Description +""""""""""" + +The *bpm/spring* bond style computes forces and torques based on +deviations from the initial reference state of the two atoms. The +reference state is stored by each bond when it is first computed in +the setup of a run. Data is then preserved across run commands and is +written to :doc:`binary restart files ` such that restarting +the system will not reset the reference state of a bond. + +This bond style only applies central-body forces which conserve the +translational and rotational degrees of freedom of a bonded set of +particles. The force has a magnitude of + +.. math:: + + F = k (r - r_0) w + +where :math:`k_r` is a stiffness, :math:`r` is the current distance +and :math:`r_0` is the initial distance between the two particles, and +:math:`w` is an optional smoothing factor discussed below. Bonds will +break at a strain of :math:`\epsilon_c`. This is done by setting by +setting its type to 0 such that forces are no longer computed. + +An additional damping force is applied to the bonded +particles. This forces is proportional to the difference in the +normal velocity of particles using a similar construction as +dissipative particle dynamics (:ref:`(Groot) `): + +.. math:: + + F_D = - \gamma w (\hat{r} \bullet \vec{v}) + +where :math:`\gamma` is the damping strength, :math:`\hat{r}` is the +radial normal vector, and :math:`\vec{v}` is the velocity difference +between the two particles. + +The smoothing factor :math:`w` can be added or removed using the +*smooth* keyword. It is constructed such that forces smoothly go +to zero, avoiding discontinuities, as bonds approach the critical strain + +.. math:: + + w = 1.0 - \left( \frac{r - r_0}{r_0 \epsilon_c} \right)^8 . + +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:`k` (force/distance units) +* :math:`\epsilon_c` (unit less) +* :math:`\gamma` (force/velocity units) + +By default, pair forces are not calculated between bonded particles. +Pair forces can alternatively be overlaid on top of bond forces using +the *overlay/pair* keyword. These settings require specific +:doc:`special_bonds ` settings described in the +restrictions. Further details can be found in the `:doc: how to +` page on BPMs. + +If the *store/local* keyword is used, this fix will track bonds that +break during the simulation. Whenever a bond breaks, data is processed +and transferred to an internal fix labeled *fix_ID*. This allows the +local data to be accessed by other LAMMPS commands. +Following any optional keyword/value arguments, a list of one or more +attributes is specified. These include the IDs of the two atoms in +the bond. The other attributes for the two atoms include the timestep +during which the bond broke and the current/initial center of mass +position of the two atoms. + +Data is continuously accumulated over intervals of *N* +timesteps. At the end of each interval, all of the saved accumulated +data is deleted to make room for new data. Individual datum may +therefore persist anywhere between *1* to *N* timesteps depending on +when they are saved. This data can be accessed using the *fix_ID* and a +:doc:`dump local ` command. To ensure all data is output, +the dump frequency should correspond to the same interval of *N* +timesteps. A dump frequency of an integer multiple of *N* can be used +to regularly output a sample of the accumulated data. + +Note that when unbroken bonds are dumped to a file via the +:doc:`dump local ` command, bonds with type 0 (broken bonds) +are not included. +The :doc:`delete_bonds ` command can also be used to +query the status of broken bonds or permanently delete them, e.g.: + +.. code-block:: LAMMPS + + delete_bonds all stats + delete_bonds all bond 0 remove + +---------- + +Restart and other info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +This bond style writes the reference state of each bond to +:doc:`binary restart files `. Loading a restart +file will properly resume bonds. + +The single() function of these pair styles returns 0.0 for the energy +of a pairwise interaction, since energy is not conserved in these +dissipative potentials. + +The accumulated data is not written to restart files and should be +output before a restart file is written to avoid missing data. + +The internal fix calculates a local vector or local array depending on the +number of input values. The length of the vector or number of rows in +the array is the number of recorded, lost interactions. If a single +input is specified, a local vector is produced. If two or more inputs +are specified, a local array is produced where the number of columns = +the number of inputs. The vector or array can be accessed by any +command that uses local values from a compute as input. See the +:doc:`Howto output ` page for an overview of LAMMPS +output options. + +The vector or array will be floating point values that correspond to +the specified attribute. + +Restrictions +"""""""""""" + +This bond style can only be used if LAMMPS was built with the BPM +package. See the :doc:`Build package ` doc page for +more info. + +By default if pair interactions are to be disabled, this bond style +requires setting + +.. code-block:: LAMMPS + + special_bonds lj 0 1 1 coul 1 1 1 + +and :doc:`newton ` must be set to bond off. If the +*overlay/pair* option is used, this bond style alternatively requires +setting + +.. code-block:: LAMMPS + + special_bonds lj/coul 1 1 1 + +Related commands +"""""""""""""""" + +:doc:`bond_coeff `, :doc:`pair bpm/spring ` + +Default +""""""" + +The option defaults are *smooth* = *yes* + +---------- + +.. _Groot4: + +**(Groot)** Groot and Warren, J Chem Phys, 107, 4423-35 (1997). diff --git a/doc/src/bond_quartic.rst b/doc/src/bond_quartic.rst index 89c33607ac..1f9f9bf4e9 100644 --- a/doc/src/bond_quartic.rst +++ b/doc/src/bond_quartic.rst @@ -67,7 +67,8 @@ local maximum. If a bond length ever becomes :math:`> R_c`, LAMMPS "breaks" the bond, which means two things. First, the bond potential is turned off by setting its type to 0, and is no longer computed. Second, a pairwise interaction between the two atoms is turned on, since they -are no longer bonded. +are no longer bonded. See the :doc:`Howto ` page +on broken bonds for more information. LAMMPS does the second task via a computational sleight-of-hand. It subtracts the pairwise interaction as part of the bond computation. diff --git a/doc/src/bond_style.rst b/doc/src/bond_style.rst index 4dee48a78d..95ba1572c1 100644 --- a/doc/src/bond_style.rst +++ b/doc/src/bond_style.rst @@ -84,6 +84,8 @@ accelerated styles exist. * :doc:`zero ` - topology but no interactions * :doc:`hybrid ` - define multiple styles of bond interactions +* :doc:`bpm/rotational ` - breakable bond with forces and torques based on deviation from reference state +* :doc:`bpm/spring ` - breakable bond with forces based on deviation from reference length * :doc:`class2 ` - COMPASS (class 2) bond * :doc:`fene ` - FENE (finite-extensible non-linear elastic) bond * :doc:`fene/expand ` - FENE bonds with variable size particles diff --git a/doc/src/commands_list.rst b/doc/src/commands_list.rst index 75affe7ce6..fdfb6d1d59 100644 --- a/doc/src/commands_list.rst +++ b/doc/src/commands_list.rst @@ -59,8 +59,7 @@ Commands lattice log mass - mdi_engine - message + mdi min_modify min_spin min_style @@ -96,9 +95,6 @@ Commands restart run run_style - server - server_mc - server_md set shell special_bonds diff --git a/doc/src/compute.rst b/doc/src/compute.rst index e5f4323c34..6fdedbbb95 100644 --- a/doc/src/compute.rst +++ b/doc/src/compute.rst @@ -209,7 +209,8 @@ The individual style names on the :doc:`Commands compute ` pag * :doc:`erotate/sphere/atom ` - rotational energy for each spherical particle * :doc:`event/displace ` - detect event on atom displacement * :doc:`fabric ` - calculates fabric tensors from pair interactions -* :doc:`fep ` - +* :doc:`fep ` - compute free energies for alchemical transformation from perturbation theory +* :doc:`fep/ta ` - compute free energies for a test area perturbation * :doc:`force/tally ` - force between two groups of atoms via the tally callback mechanism * :doc:`fragment/atom ` - fragment ID for each atom * :doc:`global/atom ` - @@ -236,6 +237,7 @@ The individual style names on the :doc:`Commands compute ` pag * :doc:`msd ` - mean-squared displacement of group of atoms * :doc:`msd/chunk ` - mean-squared displacement for each chunk * :doc:`msd/nongauss ` - MSD and non-Gaussian parameter of group of atoms +* :doc:`nbond/atom ` - calculates number of bonds per atom * :doc:`omega/chunk ` - angular velocity for each chunk * :doc:`orientorder/atom ` - Steinhardt bond orientational order parameters Ql * :doc:`pair ` - values computed by a pair style diff --git a/doc/src/compute_fep_ta.rst b/doc/src/compute_fep_ta.rst new file mode 100644 index 0000000000..eeb4a10915 --- /dev/null +++ b/doc/src/compute_fep_ta.rst @@ -0,0 +1,99 @@ +.. index:: compute fep/ta + +compute fep/ta command +====================== + +Syntax +"""""" + +.. parsed-literal:: + + compute ID group-ID fep/ta temp plane scale_factor keyword value ... + +* ID, group-ID are documented in the :doc:`compute ` command +* fep/ta = name of this compute command +* temp = external temperature (as specified for constant-temperature run) +* plane = *xy* or *xz* or *yz* +* scale_factor = multiplicative factor for change in plane area +* zero or more keyword/value pairs may be appended +* keyword = *tail* + + .. parsed-literal:: + + *tail* value = *no* or *yes* + *no* = ignore tail correction to pair energies (usually small in fep) + *yes* = include tail correction to pair energies + +Examples +"""""""" + +.. code-block:: LAMMPS + + compute 1 all fep/ta 298 xy 1.0005 + +Description +""""""""""" + +Define a computation that calculates the change in the free energy due +to a test-area (TA) perturbation :ref:`(Gloor) `. The test-area +approach can be used to determine the interfacial tension of the system +in a single simulation: + +.. math:: + + \gamma = \lim_{\Delta \mathcal{A} \to 0} \left( \frac{\Delta A_{0 \to 1 }}{\Delta \mathcal{A}}\right)_{N,V,T} + = - \frac{kT}{\Delta \mathcal{A}} \ln \left< \exp(-(U_1 - U_0)/kT) \right>_0 + +During the perturbation, both axes of *plane* are scaled by multiplying +:math:`\sqrt{scale\_factor}`, while the other axis divided by +*scale_factor* such that the overall volume of the system is maintained. + +The *tail* keyword controls the calculation of the tail correction to +"van der Waals" pair energies beyond the cutoff, if this has been +activated via the :doc:`pair_modify ` command. If the +perturbation is small, the tail contribution to the energy difference +between the reference and perturbed systems should be negligible. + +---------- + +Output info +""""""""""" + +This compute calculates a global vector of length 3 which contains the +energy difference ( :math:`U_1-U_0` ) as c_ID[1], the Boltzmann factor +:math:`\exp(-(U_1-U_0)/kT)`, as c_ID[2] and the change in the *plane* +area :math:`\Delta \mathcal{A}` as c_ID[3]. :math:`U_1` is the potential +energy of the perturbed state and :math:`U_0` is the potential energy of +the reference state. The energies include kspace terms if these are +used in the simulation. + +These output results can be used by any command that uses a global +scalar or vector from a compute as input. See the :doc:`Howto output +` page for an overview of LAMMPS output options. For +example, the computed values can be averaged using :doc:`fix ave/time +`. + +Restrictions +"""""""""""" + +Constraints, like fix shake, may lead to incorrect values for energy difference. + +This compute is distributed as the FEP package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package +` page for more info. + +Related commands +"""""""""""""""" + +:doc:`compute fep ` + +Default +""""""" + +The option defaults are *tail* = *no*\ . + +---------- + +.. _Gloor: + +**(Gloor)** Gloor, J Chem Phys, 123, 134703 (2005) diff --git a/doc/src/compute_msd.rst b/doc/src/compute_msd.rst index 02b5550093..6e89cc59c1 100644 --- a/doc/src/compute_msd.rst +++ b/doc/src/compute_msd.rst @@ -75,10 +75,11 @@ solids undergoing thermal motion. .. note:: Initial coordinates are stored in "unwrapped" form, by using the - image flags associated with each atom. See the :doc:`dump custom ` command for a discussion of "unwrapped" coordinates. - See the Atoms section of the :doc:`read_data ` command for a - discussion of image flags and how they are set for each atom. You can - reset the image flags (e.g. to 0) before invoking this compute by + image flags associated with each atom. See the :doc:`dump custom + ` command for a discussion of "unwrapped" coordinates. See the + Atoms section of the :doc:`read_data ` command for a + discussion of image flags and how they are set for each atom. You + can reset the image flags (e.g. to 0) before invoking this compute by using the :doc:`set image ` command. .. note:: @@ -108,7 +109,8 @@ distance\^2 :doc:`units `. Restrictions """""""""""" - none + +Compute *msd* cannot be used with a dynamic group. Related commands """""""""""""""" diff --git a/doc/src/compute_msd_nongauss.rst b/doc/src/compute_msd_nongauss.rst index 70f4505d7f..1658d26f93 100644 --- a/doc/src/compute_msd_nongauss.rst +++ b/doc/src/compute_msd_nongauss.rst @@ -74,8 +74,11 @@ the third is dimensionless. Restrictions """""""""""" -This compute is part of the EXTRA-COMPUTE package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` page for more info. +Compute *msd/nongauss* cannot be used with a dynamic group. + +This compute is part of the EXTRA-COMPUTE package. It is only enabled +if LAMMPS was built with that package. See the :doc:`Build package +` page for more info. Related commands """""""""""""""" diff --git a/doc/src/compute_nbond_atom.rst b/doc/src/compute_nbond_atom.rst new file mode 100644 index 0000000000..e86986287f --- /dev/null +++ b/doc/src/compute_nbond_atom.rst @@ -0,0 +1,52 @@ +.. index:: compute nbond/atom + +compute nbond/atom command +========================== + +Syntax +"""""" + +.. parsed-literal:: + + compute ID group-ID nbond/atom + +* ID, group-ID are documented in :doc:`compute ` command +* nbond/atom = style name of this compute command + +Examples +"""""""" + +.. code-block:: LAMMPS + + compute 1 all nbond/atom + +Description +""""""""""" + +Define a computation that computes the number of bonds each atom is +part of. Bonds which are broken are not counted in the tally. See +the :doc:`Howto broken bonds ` page for more information. +The number of bonds will be zero for atoms not in the specified +compute group. This compute does not depend on Newton bond settings. + +Output info +""""""""""" + +This compute calculates a per-atom vector, which can be accessed by +any command that uses per-atom values from a compute as input. See +the :doc:`Howto output ` doc page for an overview of +LAMMPS output options. + +Restrictions +"""""""""""" + +This fix can only be used if LAMMPS was built with the BPM package. +See the :doc:`Build package ` doc page for more info. + +Related commands +"""""""""""""""" + +Default +""""""" + +none diff --git a/doc/src/dump.rst b/doc/src/dump.rst index c94813a41e..fdf31bbd06 100644 --- a/doc/src/dump.rst +++ b/doc/src/dump.rst @@ -36,7 +36,7 @@ Syntax * ID = user-assigned name for the dump * group-ID = ID of the group of atoms to be dumped -* style = *atom* or *atom/gz* or *atom/zstd or *atom/mpiio* or *cfg* or *cfg/gz* or *cfg/zstd* or *cfg/mpiio* or *custom* or *custom/gz* or *custom/zstd* or *custom/mpiio* or *dcd* or *h5md* or *image* or *local* or *local/gz* or *local/zstd* or *molfile* or *movie* or *netcdf* or *netcdf/mpiio* or *vtk* or *xtc* or *xyz* or *xyz/gz* or *xyz/zstd* or *xyz/mpiio* +* style = *atom* or *atom/gz* or *atom/zstd or *atom/mpiio* or *cfg* or *cfg/gz* or *cfg/zstd* or *cfg/mpiio* or *custom* or *custom/gz* or *custom/zstd* or *custom/mpiio* or *dcd* or *h5md* or *image* or *local* or *local/gz* or *local/zstd* or *molfile* or *movie* or *netcdf* or *netcdf/mpiio* or *vtk* or *xtc* or *xyz* or *xyz/gz* or *xyz/zstd* or *xyz/mpiio* or *yaml* * N = dump every this many timesteps * file = name of file to write dump info to * args = list of arguments for a particular style @@ -68,8 +68,9 @@ Syntax *xyz/gz* args = none *xyz/zstd* args = none *xyz/mpiio* args = none + *yaml* args = same as *custom* args, see below -* *custom* or *custom/gz* or *custom/zstd* or *custom/mpiio* or *netcdf* or *netcdf/mpiio* args = list of atom attributes +* *custom* or *custom/gz* or *custom/zstd* or *custom/mpiio* or *netcdf* or *netcdf/mpiio* or *yaml* args = list of atom attributes .. parsed-literal:: @@ -386,6 +387,70 @@ from using the (numerical) atom type to an element name (or some other label). This will help many visualization programs to guess bonds and colors. +Dump style *yaml* has the same command syntax as style *custom* and +writes YAML format files that can be easily parsed by a variety of data +processing tools and programming languages. Each timestep will be +written as a YAML "document" (i.e. starts with "---" and ends with +"..."). The style supports writing one file per timestep through the +"\*" wildcard but not multi-processor outputs with the "%" token in the +filename. In addition to per-atom data, :doc:`thermo ` data can +be included in the *yaml* style dump file using the :doc:`dump_modify +thermo yes `. The data included in the dump file uses the +"thermo" tag and is otherwise identical to data specified by the +:doc:`thermo_style ` command. + +Below is an example for a YAML format dump created by the following commands. + +.. code-block:: LAMMPS + + dump out all yaml 100 dump.yaml id type x y z vx vy vz ix iy iz + dump_modify out time yes units yes thermo yes format 1 %5d format "% 10.6e" + +The tags "time", "units", and "thermo" are optional and enabled by the +dump_modify command. The list under the "box" tag has 3 lines for +orthogonal boxes and 4 lines with triclinic boxes, where the first 3 are +the box boundaries and the 4th the three tilt factors (xy, xz, yz). The +"thermo" data follows the format of the *yaml* thermo style. The +"keywords" tag lists the per-atom properties contained in the "data" +columns, which contain a list with one line per atom. The keywords may +be renamed using the dump_modify command same as for the *custom* dump +style. + +.. code-block:: yaml + + --- + timestep: 0 + units: lj + time: 0 + natoms: 4000 + boundary: [ p, p, p, p, p, p, ] + thermo: + - keywords: [ Step, Temp, E_pair, E_mol, TotEng, Press, ] + - data: [ 0, 0, -27093.472213010766, 0, 0, 0, ] + box: + - [ 0, 16.795961913825074 ] + - [ 0, 16.795961913825074 ] + - [ 0, 16.795961913825074 ] + - [ 0, 0, 0 ] + keywords: [ id, type, x, y, z, vx, vy, vz, ix, iy, iz, ] + data: + - [ 1 , 1 , 0.000000e+00 , 0.000000e+00 , 0.000000e+00 , -1.841579e-01 , -9.710036e-01 , -2.934617e+00 , 0 , 0 , 0, ] + - [ 2 , 1 , 8.397981e-01 , 8.397981e-01 , 0.000000e+00 , -1.799591e+00 , 2.127197e+00 , 2.298572e+00 , 0 , 0 , 0, ] + - [ 3 , 1 , 8.397981e-01 , 0.000000e+00 , 8.397981e-01 , -1.807682e+00 , -9.585130e-01 , 1.605884e+00 , 0 , 0 , 0, ] + + [...] + ... + --- + timestep: 100 + units: lj + time: 0.5 + + [...] + + ... + +---------- + Note that *atom*, *custom*, *dcd*, *xtc*, and *xyz* style dump files can be read directly by `VMD `_, a popular molecular viewing program. @@ -427,9 +492,9 @@ If a "%" character appears in the filename, then each of P processors writes a portion of the dump file, and the "%" character is replaced with the processor ID from 0 to P-1. For example, tmp.dump.% becomes tmp.dump.0, tmp.dump.1, ... tmp.dump.P-1, etc. This creates smaller -files and can be a fast mode of output on parallel machines that -support parallel I/O for output. This option is not available for the -*dcd*, *xtc*, and *xyz* styles. +files and can be a fast mode of output on parallel machines that support +parallel I/O for output. This option is **not** available for the *dcd*, +*xtc*, *xyz*, and *yaml* styles. By default, P = the number of processors meaning one file per processor, but P can be set to a smaller value via the *nfile* or @@ -722,8 +787,8 @@ are part of the MPIIO package. They are only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. -The *xtc* and *dcd* styles are part of the EXTRA-DUMP package. They -are only enabled if LAMMPS was built with that package. See the +The *xtc*, *dcd* and *yaml* styles are part of the EXTRA-DUMP package. +They are only enabled if LAMMPS was built with that package. See the :doc:`Build package ` page for more info. Related commands diff --git a/doc/src/dump_adios.rst b/doc/src/dump_adios.rst index 71ab6a07d9..750d697e2c 100644 --- a/doc/src/dump_adios.rst +++ b/doc/src/dump_adios.rst @@ -35,13 +35,21 @@ Examples Description """"""""""" -Dump a snapshot of atom coordinates every N timesteps in the -`ADIOS `_ based "BP" file format, or using different I/O solutions in ADIOS, -to a stream that can be read on-line by another program. +Dump a snapshot of atom coordinates every N timesteps in the `ADIOS +`_ based "BP" file format, or using different I/O solutions in +ADIOS, to a stream that can be read on-line by another program. ADIOS-BP files are binary, portable and self-describing. .. _adios: https://github.com/ornladios/ADIOS2 +.. note:: + + To be able to use ADIOS, a file ``adios2_config.xml`` with specific + configuration settings is expected in the current working directory. + If the file is not present, LAMMPS will try to create a minimal + default file. Please refer to the ADIOS documentation for details on + how to adjust this file for optimal performance and desired features. + **Use from write_dump:** It is possible to use these dump styles with the diff --git a/doc/src/dump_modify.rst b/doc/src/dump_modify.rst index 352f9c61bf..c65cd68a29 100644 --- a/doc/src/dump_modify.rst +++ b/doc/src/dump_modify.rst @@ -26,6 +26,10 @@ Syntax N = index of frame written upon first dump *balance* arg = *yes* or *no* *buffer* arg = *yes* or *no* + *colname* values = ID string, or *default* + string = new column header name + ID = integer from 1 to N, or integer from -1 to -N, where N = # of quantities being output + *or* a custom dump keyword or reference to compute, fix, property or variable. *delay* arg = Dstep Dstep = delay output until this timestep *element* args = E1 E2 ... EN, where N = # of atom types @@ -40,9 +44,10 @@ Syntax Np = write one file for every this many processors *first* arg = *yes* or *no* *flush* arg = *yes* or *no* - *format* args = *line* string, *int* string, *float* string, M string, or *none* + *format* args = *line* string, *int* string, *float* string, ID string, or *none* string = C-style format string - M = integer from 1 to N, where N = # of per-atom quantities being output + ID = integer from 1 to N, or integer from -1 to -N, where N = # of quantities being output + *or* a custom dump keyword or reference to compute, fix, property or variable. *header* arg = *yes* or *no* *yes* to write the header *no* to not write the header @@ -375,6 +380,29 @@ performed with dump style *xtc*\ . ---------- +The *colname* keyword can be used to change the default header keyword +for dump styles: *atom*, *custom*, and *cfg* and their compressed, ADIOS, +and MPIIO variants. The setting for *ID string* replaces the default +text with the provided string. *ID* can be a positive integer when it +represents the column number counting from the left, a negative integer +when it represents the column number from the right (i.e. -1 is the last +column/keyword), or a custom dump keyword (or compute, fix, property, or +variable reference) and then it replaces the string for that specific +keyword. For *atom* dump styles only the keywords "id", "type", "x", +"y", "z", "ix", "iy", "iz" can be accessed via string regardless of +whether scaled or unwrapped coordinates were enabled or disabled, and +it always assumes 8 columns for indexing regardless of whether image +flags are enabled or not. For dump style *cfg* only the "auxiliary" +keywords (6th or later keyword) may be changed and the column indexing +considers only them (i.e. the 6th keyword is the the 1st column). + +The *colname* keyword can be used multiple times. If multiple *colname* +settings refer to the same keyword, the last setting has precedence. A +setting of *default* clears all previous settings, reverting all values +to their default names. + +---------- + The *format* keyword can be used to change the default numeric format output by the text-based dump styles: *atom*, *local*, *custom*, *cfg*, and *xyz* styles, and their MPIIO variants. Only the *line* or *none* @@ -446,8 +474,9 @@ The *fileper* keyword is documented below with the *nfile* keyword. The *header* keyword toggles whether the dump file will include a header. Excluding a header will reduce the size of the dump file for -fixes such as :doc:`fix pair/tracker ` which do not -require the information typically written to the header. +data produced by :doc:`pair tracker ` or +:doc:`bpm bond styles ` which may not require the +information typically written to the header. ---------- @@ -684,8 +713,8 @@ run, this option is ignored since the output is already balanced. ---------- -The *thermo* keyword only applies the dump *netcdf* style. It -triggers writing of :doc:`thermo ` information to the dump file +The *thermo* keyword only applies the dump styles *netcdf* and *yaml*. +It triggers writing of :doc:`thermo ` information to the dump file alongside per-atom data. The values included in the dump file are identical to the values specified by :doc:`thermo_style `. diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 03c9f70254..3b6ef044c8 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -194,7 +194,6 @@ accelerated styles exist. * :doc:`bond/swap ` - Monte Carlo bond swapping * :doc:`box/relax ` - relax box size during energy minimization * :doc:`charge/regulation ` - Monte Carlo sampling of charge regulation -* :doc:`client/md ` - MD client for client/server simulations * :doc:`cmap ` - enables CMAP cross-terms of the CHARMM force field * :doc:`colvars ` - interface to the collective variables "Colvars" library * :doc:`controller ` - apply control loop feedback mechanism @@ -244,7 +243,7 @@ accelerated styles exist. * :doc:`lb/viscous ` - * :doc:`lineforce ` - constrain atoms to move in a line * :doc:`manifoldforce ` - restrain atoms to a manifold during minimization -* :doc:`mdi/engine ` - connect LAMMPS to external programs via the MolSSI Driver Interface (MDI) +* :doc:`mdi/aimd ` - LAMMPS operates as driver for ab initio MD (AIMD) via the MolSSI Driver Interface (MDI) * :doc:`meso/move ` - move mesoscopic SPH/SDPD particles in a prescribed fashion * :doc:`mol/swap ` - Monte Carlo atom type swapping with a molecule * :doc:`momentum ` - zero the linear and/or angular momentum of a group of atoms @@ -285,6 +284,7 @@ accelerated styles exist. * :doc:`nve/manifold/rattle ` - * :doc:`nve/noforce ` - NVE without forces (v only) * :doc:`nve/sphere ` - NVE for spherical particles +* :doc:`nve/bpm/sphere ` - NVE for spherical particles used in the BPM package * :doc:`nve/spin ` - NVE for a spin or spin-lattice system * :doc:`nve/tri ` - NVE for triangles * :doc:`nvk ` - constant kinetic energy time integration @@ -302,7 +302,6 @@ accelerated styles exist. * :doc:`orient/fcc ` - add grain boundary migration force for FCC * :doc:`orient/eco ` - add generalized grain boundary migration force * :doc:`pafi ` - constrained force averages on hyper-planes to compute free energies (PAFI) -* :doc:`pair/tracker ` - track properties of pairwise interactions * :doc:`phonon ` - calculate dynamical matrix from MD simulations * :doc:`pimd ` - Feynman path integral molecular dynamics * :doc:`planeforce ` - constrain atoms to move in a plane diff --git a/doc/src/fix_acks2_reaxff.rst b/doc/src/fix_acks2_reaxff.rst index b555f77a66..c8804497e7 100644 --- a/doc/src/fix_acks2_reaxff.rst +++ b/doc/src/fix_acks2_reaxff.rst @@ -19,6 +19,12 @@ Syntax * cutlo,cuthi = lo and hi cutoff for Taper radius * tolerance = precision to which charges will be equilibrated * params = reaxff or a filename +* one or more keywords or keyword/value pairs may be appended + + .. parsed-literal:: + + keyword = *maxiter* + *maxiter* N = limit the number of iterations to *N* Examples """""""" @@ -26,7 +32,7 @@ Examples .. code-block:: LAMMPS fix 1 all acks2/reaxff 1 0.0 10.0 1.0e-6 reaxff - fix 1 all acks2/reaxff 1 0.0 10.0 1.0e-6 param.acks2 + fix 1 all acks2/reaxff 1 0.0 10.0 1.0e-6 param.acks2 maxiter 500 Description """"""""""" @@ -44,14 +50,14 @@ the charge equilibration performed by fix acks2/reaxff, see the The ACKS2 method minimizes the electrostatic energy of the system by adjusting the partial charge on individual atoms based on interactions -with their neighbors. It requires some parameters for each atom type. +with their neighbors. It requires some parameters for each atom type. If the *params* setting above is the word "reaxff", then these are extracted from the :doc:`pair_style reaxff ` command and the ReaxFF force field file it reads in. If a file name is specified -for *params*\ , then the parameters are taken from the specified file -and the file must contain one line for each atom type. The latter form -must be used when performing QeQ with a non-ReaxFF potential. The lines -should be formatted as follows: +for *params*, then the parameters are taken from the specified file +and the file must contain one line for each atom type. The latter +form must be used when performing QeQ with a non-ReaxFF potential. +The lines should be formatted as follows: .. parsed-literal:: @@ -67,13 +73,25 @@ ReaxFF potential file, except that eta is defined here as twice the eta value in the ReaxFF file. Note that unlike the rest of LAMMPS, the units of this fix are hard-coded to be A, eV, and electronic charge. -**Restart, fix_modify, output, run start/stop, minimize info:** +The optional *maxiter* keyword allows changing the max number +of iterations in the linear solver. The default value is 200. + +.. note:: + + In order to solve the self-consistent equations for electronegativity + equalization, LAMMPS imposes the additional constraint that all the + charges in the fix group must add up to zero. The initial charge + assignments should also satisfy this constraint. LAMMPS will print a + warning if that is not the case. + +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files -`. No global scalar or vector or per-atom quantities are -stored by this fix for access by various :doc:`output commands -`. No parameter of this fix can be used with the -*start/stop* keywords of the :doc:`run ` command. +`. This fix computes a global scalar (the number of +iterations) for access by various :doc:`output commands `. +No parameter of this fix can be used with the *start/stop* keywords of +the :doc:`run ` command. This fix is invoked during :doc:`energy minimization `. @@ -86,12 +104,12 @@ This fix is invoked during :doc:`energy minimization `. Restrictions """""""""""" -This fix is part of the REAXFF package. It is only enabled if LAMMPS -was built with that package. See the :doc:`Build package -` doc page for more info. +This fix is part of the REAXFF package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package +` page for more info. This fix does not correctly handle interactions involving multiple -periodic images of the same atom. Hence, it should not be used for +periodic images of the same atom. Hence, it should not be used for periodic cell dimensions less than 10 angstroms. This fix may be used in combination with :doc:`fix efield ` @@ -105,7 +123,10 @@ Related commands :doc:`pair_style reaxff `, :doc:`fix qeq/reaxff ` -**Default:** none +Default +""""""" + +maxiter 200 ---------- diff --git a/doc/src/fix_bond_break.rst b/doc/src/fix_bond_break.rst index 9538fa8ef3..ba12e154c5 100644 --- a/doc/src/fix_bond_break.rst +++ b/doc/src/fix_bond_break.rst @@ -113,6 +113,9 @@ You can dump out snapshots of the current bond topology via the :doc:`dump local may need to thermostat your system to compensate for energy changes resulting from broken bonds (and angles, dihedrals, impropers). +See the :doc:`Howto ` page on broken bonds for more +information on related features in LAMMPS. + ---------- Restart, fix_modify, output, run start/stop, minimize info diff --git a/doc/src/fix_brownian.rst b/doc/src/fix_brownian.rst index 5e0a899deb..fe57ecc8e0 100644 --- a/doc/src/fix_brownian.rst +++ b/doc/src/fix_brownian.rst @@ -23,7 +23,7 @@ Syntax * temp = temperature * seed = random number generator seed * one or more keyword/value pairs may be appended -* keyword = *rng* or *dipole* or *gamma_r_eigen* or *gamma_t_eigen* or *gamma_r* or *gamma_t* +* keyword = *rng* or *dipole* or *gamma_r_eigen* or *gamma_t_eigen* or *gamma_r* or *gamma_t* or *rotation_temp* or *planar_rotation* .. parsed-literal:: @@ -40,8 +40,10 @@ Syntax *gamma_t_eigen* values = *gt1* and *gt2* and *gt3* for *brownian/asphere* *gt1*, *gt2*, and *gt3* = diagonal entries of body frame translational friction tensor *gamma_t* values = *gt* for *brownian* and *brownian/sphere* - *gt* = magnitude of the (isotropic) translational friction tensor - + *gt* = magnitude of the (isotropic) translational friction tensor + *rotation_temp* values = *T* for *brownian/sphere* and *brownian/asphere* + *T* = rotation temperature, which can be different then *temp* when out of equilibrium + *planar_rotation* values = None (constrains rotational diffusion to be in xy plane if in 3D) Examples """""""" @@ -86,12 +88,45 @@ For the style *brownian/sphere*, the positions of the particles are updated, and a dipole slaved to the spherical orientation is also updated. This style therefore requires the hybrid atom style :doc:`atom_style dipole ` and :doc:`atom_style sphere -`. +`. The equation of motion for the dipole is + +.. math:: + + \mathbf{\mu}(t+dt) = \frac{\mathbf{\mu}(t) + \mathbf{\omega} \times \mathbf{\mu}dt + }{|\mathbf{\mu}(t) + \mathbf{\omega} \times \mathbf{\mu}|} + +which correctly reproduces a Boltzmann distribution of orientations and +rotational diffusion moments (see :ref:`(Ilie) `) when + +.. math:: + + \mathbf{\omega} = \frac{\mathbf{T}}{\gamma_r} + \sqrt{\frac{2 k_B T_{rot}}{\gamma_r}\frac{d\mathbf{W}}{dt}}, + +with :math:`d\mathbf{W}` being a random number with zero mean and variance :math:`dt` +and :math:`T_{rot}` is *rotation_temp*. For the style *brownian/asphere*, the center of mass positions and the quaternions of ellipsoidal particles are updated. This fix style is suitable for equations of motion where the rotational and translational -friction tensors can be diagonalized in a certain (body) reference frame. +friction tensors can be diagonalized in a certain (body) reference +frame. In this case, the rotational equation of motion is updated via +the quaternion + +.. math:: + + \mathbf{q}(t+dt) = \frac{\mathbf{q}(t) + d\mathbf{q}}{|\mathbf{q}(t) + d\mathbf{q}|} + +which correctly reproduces a Boltzmann distribution of orientations and rotational +diffusion moments (see :ref:`(Ilie) `) when the quaternion step given by + +.. math:: + + d\mathbf{q} = \mathbf{\Psi}\mathbf{\omega}dt + +where :math:`\mathbf{Psi}` has rows :math:`(-q_1,-q_2,-q_3)`, :math:`(q_0,-q_3,q_2)`, +:math:`(q_3,q_0,-q_1)`, and :math:`(-q_2,q_1,q_0)`. :math:`\mathbf{\omega}` is +evaluated in the body frame of reference where the friction tensor is diagonal. +See :ref:`(Delong) ` for more details of a similar algorithm. --------- @@ -99,13 +134,16 @@ friction tensors can be diagonalized in a certain (body) reference frame. .. note:: This integrator does not by default assume a relationship between the - rotational and translational friction tensors, though such a relationship - should exist in the case of no-slip boundary conditions between the particles and - the surrounding (implicit) solvent. E.g. in the case of spherical particles, - the condition :math:`\gamma_t=3\gamma_r/\sigma^2` must be explicitly - accounted for by setting *gamma_t* to 3x and *gamma_r* to x (where - :math:`\sigma` is the spherical diameter). A similar (though more complex) - relationship holds for ellipsoids and rod-like particles. + rotational and translational friction tensors, though such a + relationship should exist in the case of no-slip boundary conditions + between the particles and the surrounding (implicit) solvent. E.g. in + the case of spherical particles, the condition + :math:`\gamma_t=3\gamma_r/\sigma^2` must be explicitly accounted for + by setting *gamma_t* to 3x and *gamma_r* to x (where :math:`\sigma` + is the spherical diameter). A similar (though more complex) + relationship holds for ellipsoids and rod-like particles. The + translational diffusion and rotational diffusion are given by + *temp/gamma_t* and *rotation_temp/gamma_r*. --------- @@ -113,10 +151,10 @@ friction tensors can be diagonalized in a certain (body) reference frame. Temperature computation using the :doc:`compute temp ` will not correctly compute temperature of these overdamped dynamics - since we are explicitly neglecting inertial effects. - Furthermore, this time integrator does not add the stochastic terms or - viscous terms to the force and/or torques. Rather, they are just added - in to the equations of motion to update the degrees of freedom. + since we are explicitly neglecting inertial effects. Furthermore, + this time integrator does not add the stochastic terms or viscous + terms to the force and/or torques. Rather, they are just added in to + the equations of motion to update the degrees of freedom. --------- @@ -145,14 +183,22 @@ The units of *gamma_r* are mass*length**2/time. The *gamma_r_eigen*, and *gamma_t_eigen* keywords are the eigenvalues of the rotational and viscous damping tensors (having the same units as their isotropic counterparts). Required for (and only compatible with) -*brownian/asphere*. For a 2D system, the first two values of *gamma_r_eigen* -must be inf (only rotation in xy plane), and the third value of *gamma_t_eigen* -must be inf (only diffusion in xy plane). +*brownian/asphere*. For a 2D system, the first two values of +*gamma_r_eigen* must be inf (only rotation in xy plane), and the third +value of *gamma_t_eigen* must be inf (only diffusion in xy plane). If the *dipole* keyword is used, then the dipole moments of the particles are updated as described above. Only compatible with *brownian/asphere* (as *brownian/sphere* updates dipoles automatically). +If the *rotation_temp* keyword is used, then the rotational diffusion +will be occur at this prescribed temperature instead of *temp*. Only +compatible with *brownian/sphere* and *brownian/asphere*. + +If the *planar_rotation* keyword is used, then rotation is constrained +to the xy plane in a 3D simulation. Only compatible with +*brownian/sphere* and *brownian/asphere* in 3D. + ---------- .. note:: @@ -165,9 +211,9 @@ are updated as described above. Only compatible with *brownian/asphere* Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. -No global or per-atom quantities are stored -by this fix for access by various :doc:`output commands `. +No information about this fix is written to :doc:`binary restart files +`. No global or per-atom quantities are stored by this fix for +access by various :doc:`output commands `. No parameter of this fix can be used with the *start/stop* keywords of @@ -177,16 +223,17 @@ the :doc:`run ` command. This fix is not invoked during Restrictions """""""""""" -The style *brownian/sphere* fix requires that atoms store torque and angular velocity (omega) -as defined by the :doc:`atom_style sphere ` command. -The style *brownian/asphere* fix requires that atoms store torque and quaternions -as defined by the :doc:`atom_style ellipsoid ` command. -If the *dipole* keyword is used, they must also store a dipole moment -as defined by the :doc:`atom_style dipole ` command. +The style *brownian/sphere* fix requires that atoms store torque and +angular velocity (omega) as defined by the :doc:`atom_style sphere +` command. The style *brownian/asphere* fix requires that +atoms store torque and quaternions as defined by the :doc:`atom_style +ellipsoid ` command. If the *dipole* keyword is used, they +must also store a dipole moment as defined by the :doc:`atom_style +dipole ` command. -This fix is part of the BROWNIAN package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` -doc page for more info. +This fix is part of the BROWNIAN package. It is only enabled if LAMMPS +was built with that package. See the :doc:`Build package +` doc page for more info. Related commands """""""""""""""" @@ -197,8 +244,8 @@ Related commands Default """"""" -The default for *rng* is *uniform*. The default for the rotational and translational friction -tensors are the identity tensor. +The default for *rng* is *uniform*. The default for the rotational and +translational friction tensors are the identity tensor. ---------- diff --git a/doc/src/fix_client_md.rst b/doc/src/fix_client_md.rst deleted file mode 100644 index a688d38e25..0000000000 --- a/doc/src/fix_client_md.rst +++ /dev/null @@ -1,118 +0,0 @@ -.. index:: fix client/md - -fix client/md command -===================== - -Syntax -"""""" - -.. parsed-literal:: - - fix ID group-ID client/md - -* ID, group-ID are documented in :doc:`fix ` command -* client/md = style name of this fix command - -Examples -"""""""" - -.. code-block:: LAMMPS - - fix 1 all client/md - -Description -""""""""""" - -This fix style enables LAMMPS to run as a "client" code and -communicate each timestep with a separate "server" code to perform an -MD simulation together. - -The :doc:`Howto client/server ` page gives an -overview of client/server coupling of LAMMPS with another code where -one code is the "client" and sends request messages to a "server" -code. The server responds to each request with a reply message. This -enables the two codes to work in tandem to perform a simulation. - -When using this fix, LAMMPS (as the client code) passes the current -coordinates of all particles to the server code each timestep, which -computes their interaction, and returns the energy, forces, and virial -for the interacting particles to LAMMPS, so it can complete the -timestep. - -Note that the server code can be a quantum code, or another classical -MD code which encodes a force field (pair_style in LAMMPS lingo) which -LAMMPS does not have. In the quantum case, this fix is a mechanism -for running *ab initio* MD with quantum forces. - -The group associated with this fix is ignored. - -The protocol and :doc:`units ` for message format and content -that LAMMPS exchanges with the server code is defined on the -:doc:`server md ` doc page. - -Note that when using LAMMPS as an MD client, your LAMMPS input script -should not normally contain force field commands, like a -:doc:`pair_style `, :doc:`bond_style `, or -:doc:`kspace_style ` command. However it is possible -for a server code to only compute a portion of the full force-field, -while LAMMPS computes the remaining part. Your LAMMPS script can also -specify boundary conditions or force constraints in the usual way, -which will be added to the per-atom forces returned by the server -code. - -See the examples/message directory for example scripts where LAMMPS is both -the "client" and/or "server" code for this kind of client/server MD -simulation. The examples/message/README file explains how to launch -LAMMPS and another code in tandem to perform a coupled simulation. - ----------- - -Restart, fix_modify, output, run start/stop, minimize info -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -No information about this fix is written to :doc:`binary restart files -`. - -The :doc:`fix_modify ` *energy* option is supported by -this fix to add the potential energy set by the server application to -the global potential energy of the system as part of -:doc:`thermodynamic output `. The default setting for -this fix is :doc:`fix_modify energy yes `. - -The :doc:`fix_modify ` *virial* option is supported by -this fix to add the contribution computed by the server application to -the global pressure of the system via the :doc:`compute pressure -` command. This can be accessed by -:doc:`thermodynamic output `. The default setting for -this fix is :doc:`fix_modify virial yes `. - -This fix computes a global scalar which can be accessed by various -:doc:`output commands `. The scalar is the potential -energy discussed above. The scalar value calculated by this fix is -"extensive". - -No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. - -This fix is not invoked during :doc:`energy minimization `. - -Restrictions -"""""""""""" - -This fix is part of the MESSAGE package. It is only enabled if LAMMPS -was built with that package. See the :doc:`Build package -` page for more info. - -A script that uses this command must also use the -:doc:`message ` command to setup and shut down the messaging -protocol with the server code. - -Related commands -"""""""""""""""" - -:doc:`message `, :doc:`server ` - -Default -""""""" - -none diff --git a/doc/src/fix_deform.rst b/doc/src/fix_deform.rst index a21a3a6044..805bd84382 100644 --- a/doc/src/fix_deform.rst +++ b/doc/src/fix_deform.rst @@ -70,7 +70,7 @@ Syntax *remap* value = *x* or *v* or *none* x = remap coords of atoms in group into deforming box - v = remap velocities of all atoms when they cross periodic boundaries + v = remap velocities of atoms in group when they cross periodic boundaries none = no remapping of x or v *flip* value = *yes* or *no* allow or disallow box flips when it becomes highly skewed diff --git a/doc/src/fix_lb_fluid.rst b/doc/src/fix_lb_fluid.rst index d0de406156..0191f14b1c 100644 --- a/doc/src/fix_lb_fluid.rst +++ b/doc/src/fix_lb_fluid.rst @@ -8,7 +8,7 @@ Syntax .. parsed-literal:: - fix ID group-ID lb/fluid nevery LBtype viscosity density keyword values ... + fix ID group-ID lb/fluid nevery viscosity density keyword values ... * ID, group-ID are documented in :doc:`fix ` command * lb/fluid = style name of this fix command diff --git a/doc/src/fix_mdi_aimd.rst b/doc/src/fix_mdi_aimd.rst new file mode 100644 index 0000000000..64bc4a3d6a --- /dev/null +++ b/doc/src/fix_mdi_aimd.rst @@ -0,0 +1,103 @@ +.. index:: fix mdi/aimd + +fix mdi/aimd command +====================== + +Syntax +"""""" + +.. parsed-literal:: + + fix ID group-ID mdi/aimd keyword + +* ID, group-ID are documented in :doc:`fix ` command +* mdi/aimd = style name of this fix command +* optional keyword = *plugin* + +Examples +"""""""" + +.. code-block:: LAMMPS + + fix 1 all mdi/aimd + fix 1 all mdi/aimd plugin + +Description +""""""""""" + +This command enables LAMMPS to act as a client with another server +code to couple the two codes together to perform ab initio MD (AIMD) +simulations. + +More specifically, this command causes LAMMPS to begin using the `MDI +Library `_ +to run as an MDI driver (client), which sends MDI commands to an +external MDI engine code (server) which in the case of AIMD is a +quantum mechanics (QM) code, or could be LAMMPS itself, acting as a +surrogate for a QM code. See the :doc:`Howto mdi ` page +for more information about how LAMMPS can operate as either an MDI +driver or engine. + +The examples/mdi directory contains input scripts performing AIMD in +this manner with LAMMPS acting as both a driver and an engine +(surrogate for a QM code). The examples/mdi/README file explains how +to launch both driver and engine codes so that they communicate using +the MDI library via either MPI or sockets. Any QM code that supports +MDI could be used in place of LAMMPS acting as a QM surrogate. See +the :doc:`Howto mdi ` page for a current list (March 2022) +of such QM codes. + +The engine code can run either as a stand-alone code, launched at the +same time as LAMMPS, or as a plugin library. See the :doc:`mdi plugin +` command for how to trigger LAMMPS to load the plugin library. +Again, the examples/mdi/README file explains how to launch both driver +and engine codes so that engine is used in plugin mode. + +To use this fix with a plugin engine, you must specify the +*plugin* keyword as the last argument, as illustrated above. + +.. note:: + + As of April 2022, the *plugin* keyword is needed. In a future + version of the MDI library it will no longer be necessary. + +---------- + +This fix performs the timestepping portion of an AIMD simulation. +Both LAMMPS and the engine code (QM or LAMMPS) should define the same +system (simulation box, atoms and their types) in their respective +input scripts. LAMMPS then begins its timestepping. + +At the point in each timestep when LAMMPS needs the force on each +atom, it communicates with the engine code. It sends the current +simulation box size and shape (if they change dynamically, e.g. during +an NPT simulation), and the current atom coordinates. The engine code +computes quantum forces on each atom and returns them to LAMMPS. If +LAMMPS also needs the system energy and/or virial, it requests those +values from the engine code as well. + +Restrictions +"""""""""""" + +This command is part of the MDI package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package +` page for more info. + +To use LAMMPS as an MDI driver in conjunction with other MDI-enabled +atomistic codes, the :doc:`units ` command should be used to +specify *real* or *metal* units. This will ensure the correct unit +conversions between LAMMPS and MDI units, which the other codes will +also perform in their preferred units. + +LAMMPS can also be used as an MDI driver in other unit choices it +supports, e.g. *lj*, but then no unit conversion is performed. + +Related commands +"""""""""""""""" + +:doc:`mdi engine ` + +Default +""""""" + +none diff --git a/doc/src/fix_mdi_engine.rst b/doc/src/fix_mdi_engine.rst deleted file mode 100644 index 51a4545fd8..0000000000 --- a/doc/src/fix_mdi_engine.rst +++ /dev/null @@ -1,59 +0,0 @@ -.. index:: fix mdi/engine - -fix mdi/engine command -====================== - -Syntax -"""""" - -.. parsed-literal:: - - fix ID group-ID mdi/engine - -* ID, group-ID are documented in :doc:`fix ` command -* mdi/engine = style name of this fix command - -Examples -"""""""" - -.. code-block:: LAMMPS - - fix 1 all mdi/engine - -Description -""""""""""" - -This fix is used along with the :doc:`mdi/engine ` command -to enable LAMMPS to use the `MDI Library -`_ to run as -an MDI engine. The fix provides hooks that enable MDI driver codes to -communicate with LAMMPS at various points within a LAMMPS timestep. - -It is not generally necessary to add this fix to a LAMMPS input file, -even when using the :doc:`mdi/engine ` command. If the -:doc:`mdi/engine ` command is executed and this fix is not -present, it will automatically be added and applied as a new fix for -all atoms for the duration of the command. Thus it is only necessary -to add this fix to an input file when you want to modify the group-ID -or the ordering of this fix relative to other fixes in the input script. - -For more information about running LAMMPS as an MDI engine, see the -:doc:`mdi/engine ` command and the :doc:`Howto mdi -` doc page. - -Restrictions -"""""""""""" - -This command is part of the MDI package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package -` page for more info. - -Related commands -"""""""""""""""" - -:doc:`mdi/engine ` - -Default -""""""" - -none diff --git a/doc/src/fix_move.rst b/doc/src/fix_move.rst index 5d3a9de47f..ff1f8403df 100644 --- a/doc/src/fix_move.rst +++ b/doc/src/fix_move.rst @@ -12,7 +12,7 @@ Syntax * ID, group-ID are documented in :doc:`fix ` command * move = style name of this fix command -* style = *linear* or *wiggle* or *rotate* or *variable* +* style = *linear* or *wiggle* or *rotate* or *transrot* or *variable* .. parsed-literal:: @@ -25,6 +25,11 @@ Syntax Px,Py,Pz = origin point of axis of rotation (distance units) Rx,Ry,Rz = axis of rotation vector period = period of rotation (time units) + *transrot* args = Vx Vy Vz Px Py Pz Rx Ry Rz period + Vx,Vy,Vz = components of velocity vector (velocity units) + Px,Py,Pz = origin point of axis of rotation (distance units) + Rx,Ry,Rz = axis of rotation vector + period = period of rotation (time units) *variable* args = v_dx v_dy v_dz v_vx v_vy v_vz v_dx,v_dy,v_dz = 3 variable names that calculate x,y,z displacement as function of time, any component can be specified as NULL v_vx,v_vy,v_vz = 3 variable names that calculate x,y,z velocity as function of time, any component can be specified as NULL @@ -44,6 +49,7 @@ Examples fix 1 boundary move wiggle 3.0 0.0 0.0 1.0 units box fix 2 boundary move rotate 0.0 0.0 0.0 0.0 0.0 1.0 5.0 fix 2 boundary move variable v_myx v_myy NULL v_VX v_VY NULL + fix 3 boundary move transrot 0.1 0.1 0.0 0.0 0.0 0.0 0.0 0.0 1.0 5.0 units box Description """"""""""" @@ -55,15 +61,17 @@ whose movement can influence nearby atoms. .. note:: - The atoms affected by this fix should not normally be time - integrated by other fixes (e.g. :doc:`fix nve `, :doc:`fix nvt `), since that will change their positions and - velocities twice. + The atoms affected by this fix should not normally be time integrated + by other fixes (e.g. :doc:`fix nve `, :doc:`fix nvt + `), since that will change their positions and velocities + twice. .. note:: As atoms move due to this fix, they will pass through periodic boundaries and be remapped to the other side of the simulation box, - just as they would during normal time integration (e.g. via the :doc:`fix nve ` command). It is up to you to decide whether + just as they would during normal time integration (e.g. via the + :doc:`fix nve ` command). It is up to you to decide whether periodic boundaries are appropriate with the kind of atom motion you are prescribing with this fix. @@ -73,11 +81,11 @@ whose movement can influence nearby atoms. position at the time the fix is specified. These initial coordinates are stored by the fix in "unwrapped" form, by using the image flags associated with each atom. See the :doc:`dump custom ` command - for a discussion of "unwrapped" coordinates. See the Atoms section of - the :doc:`read_data ` command for a discussion of image flags - and how they are set for each atom. You can reset the image flags - (e.g. to 0) before invoking this fix by using the :doc:`set image ` - command. + for a discussion of "unwrapped" coordinates. See the Atoms section + of the :doc:`read_data ` command for a discussion of image + flags and how they are set for each atom. You can reset the image + flags (e.g. to 0) before invoking this fix by using the :doc:`set + image ` command. ---------- @@ -118,13 +126,13 @@ notation as where *X0* = (x0,y0,z0) is their position at the time the fix is specified, *A* is the specified amplitude vector with components -(Ax,Ay,Az), *omega* is 2 PI / *period*, and *delta* is the time -elapsed since the fix was specified. This style also sets the -velocity of each atom to the time derivative of this expression. If -any of the amplitude components is specified as NULL, then the -position and velocity of that component is time integrated the same as -the :doc:`fix nve ` command would perform, using the -corresponding force component on the atom. +(Ax,Ay,Az), *omega* is 2 PI / *period*, and *delta* is the time elapsed +since the fix was specified. This style also sets the velocity of each +atom to the time derivative of this expression. If any of the amplitude +components is specified as NULL, then the position and velocity of that +component is time integrated the same as the :doc:`fix nve ` +command would perform, using the corresponding force component on the +atom. Note that the *wiggle* style is identical to using the *variable* style with :doc:`equal-style variables ` that use the @@ -139,21 +147,29 @@ swiggle() and cwiggle() functions. E.g. variable v equal v_omega*($A-cwiggle(0.0,$A,$T)) fix 1 boundary move variable v_x NULL NULL v_v NULL NULL -The *rotate* style rotates atoms around a rotation axis *R* = -(Rx,Ry,Rz) that goes through a point *P* = (Px,Py,Pz). The *period* of -the rotation is also specified. The direction of rotation for the -atoms around the rotation axis is consistent with the right-hand rule: -if your right-hand thumb points along *R*, then your fingers wrap -around the axis in the direction of rotation. +The *rotate* style rotates atoms around a rotation axis *R* = (Rx,Ry,Rz) +that goes through a point *P* = (Px,Py,Pz). The *period* of the +rotation is also specified. The direction of rotation for the atoms +around the rotation axis is consistent with the right-hand rule: if your +right-hand thumb points along *R*, then your fingers wrap around the +axis in the direction of rotation. This style also sets the velocity of each atom to (omega cross Rperp) where omega is its angular velocity around the rotation axis and Rperp is a perpendicular vector from the rotation axis to the atom. If the defined :doc:`atom_style ` assigns an angular velocity or -angular momentum or orientation to each atom (:doc:`atom styles ` sphere, ellipsoid, line, tri, body), then +angular momentum or orientation to each atom (:doc:`atom styles +` sphere, ellipsoid, line, tri, body), then those properties are also updated appropriately to correspond to the atom's motion and rotation over time. +The *transrot* style combines the effects of *rotate* and *linear* so +that it is possible to prescribe a rotating group of atoms that also +moves at a constant velocity. The arguments are for the translation +first and then for the rotation. Since the rotation affects all +coordinate components, it is not possible to set any of the +translation vector components to NULL. + The *variable* style allows the position and velocity components of each atom to be set by formulas specified via the :doc:`variable ` command. Each of the 6 variables is @@ -165,10 +181,10 @@ Each variable must be of either the *equal* or *atom* style. a function of the timestep as well as of other simulation values. *Atom*\ -style variables compute a numeric quantity for each atom, that can be a function per-atom quantities, such as the atom's position, as -well as of the timestep and other simulation values. Note that this -fix stores the original coordinates of each atom (see note below) so -that per-atom quantity can be used in an atom-style variable formula. -See the :doc:`variable ` command for details. +well as of the timestep and other simulation values. Note that this fix +stores the original coordinates of each atom (see note below) so that +per-atom quantity can be used in an atom-style variable formula. See +the :doc:`variable ` command for details. The first 3 variables (v_dx,v_dy,v_dz) specified for the *variable* style are used to calculate a displacement from the atom's original @@ -206,8 +222,9 @@ spacings can be different in x,y,z. Restart, fix_modify, output, run start/stop, minimize info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the original coordinates of moving atoms to :doc:`binary restart files `, as well as the initial timestep, so that -the motion can be continuous in a restarted simulation. See the +This fix writes the original coordinates of moving atoms to :doc:`binary +restart files `, as well as the initial timestep, so that the +motion can be continuous in a restarted simulation. 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 operation of the fix continues in an uninterrupted fashion. @@ -224,11 +241,12 @@ fix. This fix produces a per-atom array which can be accessed by various :doc:`output commands `. The number of columns for each -atom is 3, and the columns store the original unwrapped x,y,z coords -of each atom. The per-atom values can be accessed on any timestep. +atom is 3, and the columns store the original unwrapped x,y,z coords of +each atom. The per-atom values can be accessed on any timestep. No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. +the :doc:`run ` command. This fix is not invoked during +:doc:`energy minimization `. For :doc:`rRESPA time integration `, this fix adjusts the position and velocity of atoms on the outermost rRESPA level. diff --git a/doc/src/fix_nve_bpm_sphere.rst b/doc/src/fix_nve_bpm_sphere.rst new file mode 100644 index 0000000000..861586ab2a --- /dev/null +++ b/doc/src/fix_nve_bpm_sphere.rst @@ -0,0 +1,87 @@ +.. index:: fix nve/bpm/sphere + +fix nve/bpm/sphere command +========================== + +Syntax +"""""" + +.. parsed-literal:: + + fix ID group-ID nve/bpm/sphere + +* ID, group-ID are documented in :doc:`fix ` command +* nve/bpm/sphere = style name of this fix command +* zero or more keyword/value pairs may be appended +* keyword = *disc* + + .. parsed-literal:: + + *disc* value = none = treat particles as 2d discs, not spheres + +Examples +"""""""" + +.. code-block:: LAMMPS + + fix 1 all nve/bpm/sphere + fix 1 all nve/bpm/sphere disc + +Description +""""""""""" + +Perform constant NVE integration to update position, velocity, angular +velocity, and quaternion orientation for finite-size spherical +particles in the group each timestep. V is volume; E is energy. This +creates a system trajectory consistent with the microcanonical +ensemble. + +This fix differs from the :doc:`fix nve ` command, which +assumes point particles and only updates their position and velocity. +It also differs from the :doc:`fix nve/sphere ` +command which assumes finite-size spheroid particles which do not +store a quaternion. It thus does not update a particle's orientation +or quaternion. + +If the *disc* keyword is used, then each particle is treated as a 2d +disc (circle) instead of as a sphere. This is only possible for 2d +simulations, as defined by the :doc:`dimension ` keyword. +The only difference between discs and spheres in this context is their +moment of inertia, as used in the time integration. + +---------- + +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +No information about this fix is written to :doc:`binary restart files +`. None of the :doc:`fix_modify ` options are +relevant to this fix. No global or per-atom quantities are stored by +this fix for access by various :doc:`output commands `. +No parameter of this fix can be used with the *start/stop* keywords of +the :doc:`run ` command. This fix is not invoked during +:doc:`energy minimization `. + +Restrictions +"""""""""""" + +This fix requires that atoms store torque, angular velocity (omega), a +radius, and a quaternion as defined by the :doc:`atom_style bpm/sphere +` command. + +All particles in the group must be finite-size spheres with +quaternions. They cannot be point particles. + +Use of the *disc* keyword is only allowed for 2d simulations, as +defined by the :doc:`dimension ` keyword. + +Related commands +"""""""""""""""" + +:doc:`fix nve `, :doc:`fix nve/sphere ` + +Default +""""""" + +none + diff --git a/doc/src/fix_pair_tracker.rst b/doc/src/fix_pair_tracker.rst deleted file mode 100644 index 5c2ecf5774..0000000000 --- a/doc/src/fix_pair_tracker.rst +++ /dev/null @@ -1,124 +0,0 @@ -.. index:: fix pair/tracker - -fix pair/tracker command -======================== - -Syntax -"""""" - -.. parsed-literal:: - - fix ID group-ID pair/tracker N attribute1 attribute2 ... keyword values ... - -* ID, group-ID are documented in :doc:`fix ` command -* pair/tracker = style name of this fix command -* N = prepare data for output every this many timesteps -* one or more attributes may be appended - - .. parsed-literal:: - - possible attributes = id1 id2 time/created time/broken time/total - rmin rave x y z - - .. parsed-literal:: - - id1, id2 = IDs of the 2 atoms in each pair interaction - time/created = the time that the 2 atoms began interacting - time/broken = the time that the 2 atoms stopped interacting - time/total = the total time the 2 atoms interacted - r/min = the minimum radial distance between the 2 atoms during the interaction - r/ave = the average radial distance between the 2 atoms during the interaction - x, y, z = the center of mass position of the 2 atoms when they stopped interacting - -* zero or more keyword/value pairs may be appended -* keyword = *time/min* or *type/include* - - .. parsed-literal:: - - *time/min* value = T - T = minimum interaction time - *type/include* value = arg1 arg2 - arg = separate lists of types (see below) - -Examples -"""""""" - -.. code-block:: LAMMPS - - fix 1 all pair/tracker 1000 id1 id2 time/min 100 - fix 1 all pair/tracker 1000 time/created time/broken type/include 1 * type/include 2 3,4 - -Description -""""""""""" - -Tracks properties of pairwise interactions between two atoms and records data -whenever the atoms move beyond the interaction cutoff. -Must be used in conjunction with :doc:`pair tracker `. -Data is accumulated over a span of *N* timesteps before being deleted. -The number of datums generated, aggregated across all processors, equals -the number of broken interactions. Interactions are only included if both -atoms are included in the specified fix group. Additional filters can be -applied using the *time/min* or *type/include* keywords described below. - -.. note:: - - For extremely long-lived interactions, the calculation of *r/ave* may not be - correct due to double overflow. - -The *time/min* keyword sets a minimum amount of time that an interaction must -persist to be included. This setting can be used to censor short-lived interactions. -The *type/include* keyword filters interactions based on the types of the two atoms. -Data is only saved for interactions between atoms with types in the two lists. -Each list consists of a series of type -ranges separated by commas. The range can be specified as a -single numeric value, or a wildcard asterisk can be used to specify a range -of values. This takes the form "\*" or "\*n" or "n\*" or "m\*n". For -example, if M = the number of atom types, then an asterisk with no numeric -values means all types from 1 to M. A leading asterisk means all types -from 1 to n (inclusive). A trailing asterisk means all types from n to M -(inclusive). A middle asterisk means all types from m to n (inclusive). -Multiple *type/include* keywords may be added. - ----------- - -Restart, fix_modify, run start/stop, minimize info -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -No information about this fix is written to :doc:`binary restart files `. -None of the :doc:`fix_modify ` options are -relevant to this fix. -No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. - -Output info -""""""""""" - -This compute calculates a local vector or local array depending on the -number of input values. The length of the vector or number of rows in -the array is the number of recorded, lost interactions. If a single input is -specified, a local vector is produced. If two or more inputs are -specified, a local array is produced where the number of columns = the -number of inputs. The vector or array can be accessed by any command -that uses local values from a compute as input. See the :doc:`Howto output ` page for an overview of LAMMPS output -options. - -The vector or array values will be doubles that correspond to the -specified attribute. - -Restrictions -"""""""""""" - -Must be used in conjunction with :doc:`pair style tracker `. - -This fix is part of the MISC package. It is only enabled if LAMMPS -was built with that package. See the :doc:`Build package ` page for more info. - -Related commands -"""""""""""""""" - -:doc:`pair tracker ` - -Default -""""""" - -none diff --git a/doc/src/fix_polarize.rst b/doc/src/fix_polarize.rst index b95692b92b..6ed3b36c55 100644 --- a/doc/src/fix_polarize.rst +++ b/doc/src/fix_polarize.rst @@ -80,7 +80,7 @@ It is assumed that the particles cannot pass through the interface during the si so that its local dielectric constant value does not change. There are some example scripts for using these fixes -with LAMMPS in the ``examples/PACKAGES/dielectric directory``. The README file +with LAMMPS in the ``examples/PACKAGES/dielectric`` directory. The README file therein contains specific details on the system setup. Note that the example data files show the additional fields (columns) needed for :doc:`atom_style dielectric ` beyond the conventional fields *id*, *mol*, *type*, *q*, *x*, *y*, and *z*. @@ -91,7 +91,7 @@ For fix *polarize/bem/gmres* and fix *polarize/bem/icc* the induced charges of the atoms in the specified group, which are the vertices on the interface, are computed using the equation: -..math:: +.. math:: \sigma_b(\mathbf{s}) = \dfrac{1 - \bar{\epsilon}}{\bar{\epsilon}} \sigma_f(\mathbf{s}) - \epsilon_0 \dfrac{\Delta \epsilon}{\bar{\epsilon}} @@ -154,6 +154,9 @@ if LAMMPS was built with that package, which requires that also the KSPACE package is installed. See the :doc:`Build package ` page for more info. +Note that the *polarize/bem/gmres* and *polarize/bem/icc* fixes only support +:doc:`units ` *lj*, *real*, *metal*, *si* and *nano* at the moment. + Related commands """""""""""""""" diff --git a/doc/src/fix_tmd.rst b/doc/src/fix_tmd.rst index b4595d24cd..ccebb35823 100644 --- a/doc/src/fix_tmd.rst +++ b/doc/src/fix_tmd.rst @@ -29,10 +29,10 @@ Description """"""""""" Perform targeted molecular dynamics (TMD) on a group of atoms. A -holonomic constraint is used to force the atoms to move towards (or -away from) the target configuration. The parameter "rho" is -monotonically decreased (or increased) from its initial value to -rho_final at the end of the run. +holonomic constraint is used to force the atoms to move towards (or away +from) the target configuration. The parameter "rho" is monotonically +decreased (or increased) from its initial value to rho_final at the end +of the run. Rho has distance units and is a measure of the root-mean-squared distance (RMSD) between the current configuration of the atoms in the @@ -55,22 +55,25 @@ a .gz suffix). The format of the target file1 is as follows: The first 3 lines may or may not be needed, depending on the format of the atoms to follow. If image flags are included with the atoms, the -first 3 lo/hi lines must appear in the file. If image flags are not -included, the first 3 lines should not appear. The 3 lines contain the +first 3 lo/hi lines **must** appear in the file. If image flags are not +included, the first 3 lines **must not** appear. The 3 lines contain the simulation box dimensions for the atom coordinates, in the same format as in a LAMMPS data file (see the :doc:`read_data ` command). The remaining lines each contain an atom ID and its target x,y,z coordinates. The atom lines (all or none of them) can optionally be -followed by 3 integer values: nx,ny,nz. For periodic dimensions, they +followed by 3 integer values: nx,ny,nz.For periodic dimensions, they specify which image of the box the atom is considered to be in, i.e. a value of N (positive or negative) means add N times the box length to -the coordinate to get the true value. +the coordinate to get the true value. Those 3 integers either must +be given for all atoms or none. The atom lines can be listed in any order, but every atom in the group must be listed in the file. Atoms not in the fix group may also be listed; they will be ignored. +Comments starting with '#' and empty lines may be included as well. + TMD statistics are written to file2 every N timesteps, unless N is specified as 0, which means no statistics. diff --git a/doc/src/fix_ttm.rst b/doc/src/fix_ttm.rst index 777e7a894b..c2b4f2cf97 100644 --- a/doc/src/fix_ttm.rst +++ b/doc/src/fix_ttm.rst @@ -154,7 +154,7 @@ of the electronic specific heat, but ignored temperature dependencies of any of the other parameters. See more discussion below for fix ttm/mod. -..note:: +.. note:: These fixes do not perform time integration of the atoms in the fix group, they only rescale their velocities. Thus a time integration @@ -164,7 +164,7 @@ ttm/mod. fix, e.g. :doc:`fix nvt ` or :doc:`fix langevin `. -..note:: +.. note:: These fixes require use of an orthogonal 3d simulation box with periodic boundary conditions in all dimensions. They also require @@ -214,7 +214,7 @@ generate an error. LAMMPS will check if a "UNITS:" tag is in the first line and stop with an error, if there is a mismatch with the current units used. -..note:: +.. note:: The electronic temperature at each grid point must be a non-zero positive value, both initially, and as the temperature evovles over @@ -305,8 +305,8 @@ is calculated as where lambda is the electron mean free path (see :ref:`(Norman) `, :ref:`(Pisarev) `) -The fix ttm/mod parameter file *init_file* has the following syntax/ -Every line with the odd number is considered as a comment and +The fix ttm/mod parameter file *init_file* has the following syntax. +Every line with an odd number is considered as a comment and ignored. The lines with the even numbers are treated as follows: .. parsed-literal:: diff --git a/doc/src/group.rst b/doc/src/group.rst index 36559ba68a..1720ecfe1a 100644 --- a/doc/src/group.rst +++ b/doc/src/group.rst @@ -294,11 +294,13 @@ group and running further. .. note:: - All fixes and computes take a group ID as an argument, but they - do not all allow for use of a dynamic group. If you get an error + All fixes and computes take a group ID as an argument, but they do + not all allow for use of a dynamic group. If you get an error message that this is not allowed, but feel that it should be for the fix or compute in question, then please post your reasoning to the - LAMMPS mail list and we can change it. + `LAMMPS forum at MatSci `_ + and we can look into changing it. The same applies if you come + across inconsistent behavior when dynamic groups are allowed. The *static* style removes the setting for a dynamic group, converting it to a static group (the default). The atoms in the static group are diff --git a/doc/src/mdi.rst b/doc/src/mdi.rst new file mode 100644 index 0000000000..3a6f0234fc --- /dev/null +++ b/doc/src/mdi.rst @@ -0,0 +1,312 @@ +.. index:: mdi + +mdi command +================== + +Syntax +"""""" + +.. parsed-literal:: + + mdi mode args + +* mode = *engine* or *plugin* + + .. parsed-literal:: + + *engine* args = none + *plugin* args = name keyword value keyword value + name = name of plugin library, e.g. lammps means a liblammps.so library will be loaded + keywords = *mdi* or *infile* or *extra* or *command* + *mdi* value = args passed to MDI for driver to operate with plugins + *infile* value = filename the engine will read at start-up + *extra* value = aditional command-line args to pass to engine library when loaded + *command* value = a LAMMPS input script command to execute + + +Examples +"""""""" + +.. code-block:: LAMMPS + + mdi engine + mdi plugin lammps mdi "-role ENGINE -name lammps -method LINK" & + infile in.aimd.engine extra "-log log.aimd.engine.plugin" & + command "run 5" + +Description +""""""""""" + +This command implements two high-level operations within LAMMPS to use +the `MDI Library +` for +coupling to other codes in a client/server protocol. + +The *engine* mode enables LAMMPS to act as an MDI engine (server), +responding to requests from an MDI driver (client) code. + +The *plugin* mode enables LAMMPS to act as an MDI driver (client), and +load the MDI engine (server) code as a library plugin. In this case +the MDI engine is a library plugin. It can also be a stand-alone +code, launched separately from LAMMPS, in which case the mdi plugin +command is not used. + +See the Howto MDI doc page for a discussion of all the different ways +2 or more codes can interact via MDI. + +The examples/mdi directory has examples which use LAMMPS in 4 +different modes: as a driver using an engine as either a stand-alone +code or as a plugin, and as an engine operating as either a +stand-alone code or as a plugin. The README file in that directory +shows how to launch and couple codes for all the 4 usage modes, and so +they communicate via the MDI library using either MPI or sockets. + +---------- + +The *mdi engine* command is used to make LAMMPS operate as an MDI +engine. It is typically used in an input script after LAMMPS has +setup the system it is going to model consistent with what the driver +code expects. Depending on when the driver code tells the LAMMPS +engine to exit, other commands can be executed after this command, but +typically it is used at the end of a LAMMPS input script. + +To act as an MDI engine operating as an MD code (or surrogate QM +code), this is the list of standard MDI commands issued by a driver +code which LAMMPS currently recognizes. Using standard commands +defined by the MDI library means that a driver code can work +interchangeably with LAMMPS or other MD codes or with QM codes which +support the MDI standard. See more details about these commands in +the `MDI library documentation +`_ + +These commands are valid at the @DEFAULT node defined by MDI. +Commands that start with ">" mean the driver is sending information to +LAMMPS. Commands that start with "<" are requests by the driver for +LAMMPS to send it information. Commands that start with an alphabetic +letter perform actions. Commands that start with "@" are MDI "node" +commands, which are described further below. + +.. list-table:: + :widths: 20 80 + :header-rows: 1 + + * - Command name + - Action + * - >CELL or CELL_DISPL or CHARGES or COORDS or FORCES or +FORCES + - Send forces to add to each atom (3N values) + * - NSTEPS value) + * - OPTG + - Perform an energy minimization to convergence (most recent >TOLERANCE values) + * - >NATOMS or NSTEPS + - Send number of timesteps for next MD dynamics run via MD command + * - TOLERANCE + - Send 4 tolerance parameters for next MD minimization via OPTG command + * - >TYPES or VELOCITIES or COORDS command), then LAMMPS will do a more expensive + operation to migrate atoms to new processors as needed and + re-neighbor. If the >NATOMS or >TYPES commands have been sent + (since the previous >COORDS command), then LAMMPS assumes the + system is new and re-initializes an entirely new simulation. + +The MD and OPTG commands perform an entire MD simulation or energy +minimization (to convergence) with no communication from the driver +until the simulation is complete. By contrast, the @INIT_MD and +@INIT_OPTG commands allow the driver to communicate with the engine at +each timestep of a dynamics run or iteration of a minimization; see +more info below. + +The MD command performs a simulation using the most recent >NSTEPS +value. The OPTG command performs a minimization using the 4 +convergence parameters from the most recent >TOLERANCE command. The 4 +parameters sent are those used by the :doc:`minimize ` +command in LAMMPS: etol, ftol, maxiter, and maxeval. + +The mdi engine command also implements the following custom MDI +commands which are LAMMPS-specific. These commands are also valid at +the @DEFAULT node defined by MDI: + + * - Command name + - Action + * - >NBYTES + - Send # of datums in a subsequent command (1 value) + * - >COMMAND + - Send a LAMMPS input script command as a string (Nbytes in length) + * - >COMMANDS + - Send multiple LAMMPS input script commands as a newline-separated string (Nbytes in length) + * - >INFILE + - Send filename of an input script to execute (filename Nbytes in length) + * - COORDS or FORCES +or >+FORCES or ` command, should perform MDI +communication with the engine, while the specified *command* executes. +Note that if *command* is an :doc:`include ` command, then it +could specify a filename with multiple LAMMPS commands. + +.. note:: + + When the single *command* is complete, LAMMPS will send an MDI + EXIT command to the plugin engine and the plugin will be removed. + The "mdi plugin" command will then exit and the next command + (if any) in the LAMMPS input script will be processed. A subsequent + "mdi plugin" command could then load the same library plugin or + a different one if desired. + + +Restrictions +"""""""""""" + +This command is part of the MDI package. It is only enabled if LAMMPS +was built with that package. See the :doc:`Build package +` page for more info. + +To use LAMMPS in conjunction with other MDI-enabled atomistic codes, +the :doc:`units ` command should be used to specify *real* or +*metal* units. This will ensure the correct unit conversions between +LAMMPS and MDI units, which the other codes will also perform in their +preferred units. + +LAMMPS can also be used as an MDI engine in other unit choices it +supports, e.g. *lj*, but then no unit conversion is performed. + +Related commands +"""""""""""""""" + +:doc:`fix mdi/aimd ` + +Default +""""""" + +None diff --git a/doc/src/mdi_engine.rst b/doc/src/mdi_engine.rst deleted file mode 100644 index e06f571922..0000000000 --- a/doc/src/mdi_engine.rst +++ /dev/null @@ -1,88 +0,0 @@ -.. index:: mdi/engine - -mdi_engine command -================== - -Syntax -"""""" - -.. parsed-literal:: - - mdi_engine - -Description -""""""""""" - -This command is used to have LAMMPS act as a server with another -client code to effectively couple the two codes together in -client/server mode. - -More specifically, this command causes LAMMPS to begin using the `MDI -Library `_ -to run as an MDI engine (server), responding to commands made by an -external MDI driver code (client). See the :doc:`Howto mdi -` page for more information about how LAMMPS can work -as both an MDI driver or engine. - -General information about launching codes that communicate using the -MDI Library can be found in the `corresponding page -`_ -of the MDI Library's documentation. - ----------- - -This command should typically be used in an input script after LAMMPS -has setup the system it is going to model in collaboration with the -driver code. Depending on how the driver code tells the LAMMPS engine -to exit, other commands can be executed after this command, but -typically it should be used at the end of the LAMMPS input script. - -To act as a MD-based MDI engine, this is the list of MDI commands from -a driver code which LAMMPS currently recognizes. See more details -about these commands in the `MDI library documentation -`_ -.. NOTE: Taylor - is this the best link for this info? Can we flesh this -.. out with the full list of supported commands? Maybe the distinction -.. of what "node" the commands refer to is not needed in this table? - -.. list-table:: - :widths: 20 80 - :header-rows: 1 - - * - Command name - - Action - * - >NATOMS - - Driver sends the number of atoms in the system - * - FORCES - - Driver sends 3*N double-precision atom forces - * - ` page for more info. - -Related commands -"""""""""""""""" - -:doc:`fix mdi/engine ` - -Default -""""""" - -None diff --git a/doc/src/message.rst b/doc/src/message.rst deleted file mode 100644 index 83ce965e91..0000000000 --- a/doc/src/message.rst +++ /dev/null @@ -1,204 +0,0 @@ -.. index:: message - -message command -=============== - -Syntax -"""""" - -.. parsed-literal:: - - message which protocol mode arg - -* which = *client* or *server* or *quit* -* protocol = *md* or *mc* -* mode = *file* or *zmq* or *mpi/one* or *mpi/two* - - .. parsed-literal:: - - *file* arg = filename - filename = file used for message exchanges - *zmq* arg = socket-ID - socket-ID for client = localhost:5555, see description below - socket-ID for server = \*:5555, see description below - *mpi/one* arg = none - *mpi/two* arg = filename - filename = file used to establish communication between 2 MPI jobs - -Examples -"""""""" - -.. code-block:: LAMMPS - - message client md file tmp.couple - message server md file tmp.couple - - message client md zmq localhost:5555 - message server md zmq *:5555 - - message client md mpi/one - message server md mpi/one - - message client md mpi/two tmp.couple - message server md mpi/two tmp.couple - - message quit - -Description -""""""""""" - -Establish a messaging protocol between LAMMPS and another code for the -purpose of client/server coupling. - -The :doc:`Howto client/server ` page gives an -overview of client/server coupling of LAMMPS with another code where -one code is the "client" and sends request messages to a "server" -code. The server responds to each request with a reply message. This -enables the two codes to work in tandem to perform a simulation. - ----------- - -The *which* argument defines LAMMPS to be the client or the server. - -As explained below the *quit* option should be used when LAMMPS is -finished as a client. It sends a message to the server to tell it to -shut down. - ----------- - -The *protocol* argument defines the format and content of messages -that will be exchanged between the two codes. The current options -are: - -* md = run dynamics with another code -* mc = perform Monte Carlo moves with another code - -For protocol *md*, LAMMPS can be either a client or server. See the -:doc:`server md ` page for details on the protocol. - -For protocol *mc*, LAMMPS can be the server. See the :doc:`server mc ` page for details on the protocol. - ----------- - -The *mode* argument specifies how messages are exchanged between the -client and server codes. Both codes must use the same mode and use -consistent parameters. - -For mode *file*, the 2 codes communicate via binary files. They must -use the same filename, which is actually a file prefix. Several files -with that prefix will be created and deleted as a simulation runs. -The filename can include a path. Both codes must be able to access -the path/file in a common filesystem. - -For mode *zmq*, the 2 codes communicate via a socket on the server -code's machine. Support for socket messaging is provided by the -open-source `ZeroMQ library `_, which must be -installed on your system. The client specifies an IP address (IPv4 -format) or the DNS name of the machine the server code is running on, -followed by a 4 or 5 digit port ID for the socket, separated by a colon. -E.g. - -.. parsed-literal:: - - localhost:5555 # client and server running on same machine - 192.168.1.1:5555 # server is 192.168.1.1 - deptbox.uni.edu:5555 # server is deptbox.uni.edu - -The server specifies "\*:5555" where "\*" represents all available -interfaces on the server's machine, and the port ID must match -what the client specifies. - -.. note:: - - On Linux or Unix machines port IDs below 1024 are reserved to the - superuser and thus not available. Other ports may already be in - use and cannot be opened by a second process. On a Linux machine - the commands "netstat -t4an" or "ss -t4an" will list all locally - used port IDs for IPv4 addresses. - -.. note:: - - On many machines (and sometimes on local networks) also ports IDs - may be blocked by default through firewalls. In that case either - access to the required port (or a desired range of ports) has to - be selectively enabled to the firewall disabled (the latter is - usually not a good idea unless you are on a (small) local network - that is already protected from outside access. - -.. note:: - - Additional explanation is needed here about how to use the *zmq* - mode on a parallel machine, e.g. a cluster with many nodes. - -For mode *mpi/one*, the 2 codes communicate via MPI and are launched -by the same mpirun command, e.g. with this syntax for OpenMPI: - -.. code-block:: bash - - mpirun -np 2 lmp_mpi -mpicolor 0 -in in.client -log log.client : -np 4 othercode args # LAMMPS is client - mpirun -np 2 othercode args : -np 4 lmp_mpi -mpicolor 1 -in in.server # LAMMPS is server - -Note the use of the "-mpicolor color" command-line argument with -LAMMPS. See the :doc:`command-line args ` page for -further explanation. - -For mode *mpi/two*, the 2 codes communicate via MPI, but are launched -be 2 separate mpirun commands. The specified *filename* argument is a -file the 2 MPI processes will use to exchange info so that an MPI -inter-communicator can be established to enable the 2 codes to send -MPI messages to each other. Both codes must be able to access the -path/file in a common filesystem. - ----------- - -Normally, the message client or message server command should be used -at the top of a LAMMPS input script. It performs an initial handshake -with the other code to setup messaging and to verify that both codes -are using the same message protocol and mode. Assuming both codes are -launched at (nearly) the same time, the other code should perform the -same kind of initialization. - -If LAMMPS is the client code, it will begin sending messages when a -LAMMPS client command begins its operation. E.g. for the :doc:`fix client/md ` command, it is when a :doc:`run ` -command is executed. - -If LAMMPS is the server code, it will begin receiving messages when -the :doc:`server ` command is invoked. - -If LAMMPS is being used as a client, the message quit command will -terminate its messaging with the server. If you do not use this -command and just allow LAMMPS to exit, then the server will continue -to wait for further messages. This may not be a problem, but if both -the client and server programs were launched in the same batch script, -then if the server runs indefinitely, it may consume the full allocation -of computer time, even if the calculation finishes sooner. - -Note that if LAMMPS is the client or server, it will continue -processing the rest of its input script after client/server -communication terminates. - -If both codes cooperate in this manner, a new round of client/server -messaging can be initiated after termination by re-using a second message -command in your LAMMPS input script, followed by a new fix client or -server command, followed by another message quit command (if LAMMPS is -the client). As an example, this can be performed in a loop to use a -quantum code as a server to compute quantum forces for multiple LAMMPS -data files or periodic snapshots while running dynamics. - ----------- - -Restrictions -"""""""""""" - -This command is part of the MESSAGE package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` page for more info. - -Related commands -"""""""""""""""" - -:doc:`server `, :doc:`fix client/md ` - -Default -""""""" - -none diff --git a/doc/src/package.rst b/doc/src/package.rst index 437601dc60..8f9a65b2cc 100644 --- a/doc/src/package.rst +++ b/doc/src/package.rst @@ -71,7 +71,7 @@ Syntax *no_affinity* values = none *kokkos* args = keyword value ... zero or more keyword/value pairs may be appended - keywords = *neigh* or *neigh/qeq* or *neigh/thread* or *newton* or *binsize* or *comm* or *comm/exchange* or *comm/forward* *pair/comm/forward* *fix/comm/forward* or *comm/reverse* or *gpu/aware* or *pair/only* + keywords = *neigh* or *neigh/qeq* or *neigh/thread* or *newton* or *binsize* or *comm* or *comm/exchange* or *comm/forward* *comm/pair/forward* *comm/fix/forward* or *comm/reverse* or *gpu/aware* or *pair/only* *neigh* value = *full* or *half* full = full neighbor list half = half neighbor list built in thread-safe manner @@ -81,17 +81,20 @@ Syntax *neigh/thread* value = *off* or *on* off = thread only over atoms on = thread over both atoms and neighbors + *neigh/transpose* value = *off* or *on* + off = use same memory layout for GPU neigh list build as pair style + on = use transposed memory layout for GPU neigh list build *newton* = *off* or *on* off = set Newton pairwise and bonded flags off on = set Newton pairwise and bonded flags on *binsize* value = size size = bin size for neighbor list construction (distance units) *comm* value = *no* or *host* or *device* - use value for comm/exchange and comm/forward and pair/comm/forward and fix/comm/forward and comm/reverse + use value for comm/exchange and comm/forward and comm/pair/forward and comm/fix/forward and comm/reverse *comm/exchange* value = *no* or *host* or *device* *comm/forward* value = *no* or *host* or *device* - *pair/comm/forward* value = *no* or *device* - *fix/comm/forward* value = *no* or *device* + *comm/pair/forward* value = *no* or *device* + *comm/fix/forward* value = *no* or *device* *comm/reverse* value = *no* or *host* or *device* no = perform communication pack/unpack in non-KOKKOS mode host = perform pack/unpack on host (e.g. with OpenMP threading) @@ -463,6 +466,16 @@ potentials support this keyword yet, and only thread over atoms. Many simple pairwise potentials such as Lennard-Jones do support threading over both atoms and neighbors. +If the *neigh/transpose* keyword is set to *off*, then the KOKKOS +package will use the same memory layout for building the neighbor list on +GPUs as used for the pair style. When this keyword is set to *on* it +will use a different (transposed) memory layout to build the neighbor +list on GPUs. This can be faster in some cases (e.g. ReaxFF HNS +benchmark) but slower in others (e.g. Lennard Jones benchmark). The +copy between different memory layouts is done out of place and +therefore doubles the memory overhead of the neighbor list, which can +be significant. + The *newton* keyword sets the Newton flags for pairwise and bonded interactions to *off* or *on*, the same as the :doc:`newton ` command allows. The default for GPUs is *off* because this will almost @@ -471,11 +484,12 @@ computation is done, but less communication. However, when running on CPUs a value of *on* is the default since it can often be faster, just as it is for non-accelerated pair styles -The *binsize* keyword sets the size of bins used to bin atoms in -neighbor list builds. The same value can be set by the :doc:`neigh_modify binsize ` command. Making it an option in the package -kokkos command allows it to be set from the command line. The default -value for CPUs is 0.0, which means the LAMMPS default will be used, -which is bins = 1/2 the size of the pairwise cutoff + neighbor skin +The *binsize* keyword sets the size of bins used to bin atoms during +neighbor list builds. The same value can be set by the +:doc:`neigh_modify binsize ` command. Making it an option +in the package kokkos command allows it to be set from the command line. +The default value for CPUs is 0.0, which means the LAMMPS default will be +used, which is bins = 1/2 the size of the pairwise cutoff + neighbor skin distance. This is fine when neighbor lists are built on the CPU. For GPU builds, a 2x larger binsize equal to the pairwise cutoff + neighbor skin is often faster, which is the default. Note that if you use a @@ -485,8 +499,8 @@ because the GPU is faster at performing pairwise interactions, then this rule of thumb may give too large a binsize and the default should be overridden with a smaller value. -The *comm* and *comm/exchange* and *comm/forward* and *pair/comm/forward* -and *fix/comm/forward* and comm/reverse* +The *comm* and *comm/exchange* and *comm/forward* and *comm/pair/forward* +and *comm/fix/forward* and comm/reverse* keywords determine whether the host or device performs the packing and unpacking of data when communicating per-atom data between processors. "Exchange" communication happens only on timesteps that neighbor lists @@ -507,8 +521,8 @@ packing/unpacking data for the communication. A value of *host* means to use the host, typically a multi-core CPU, and perform the packing/unpacking in parallel with threads. A value of *device* means to use the device, typically a GPU, to perform the packing/unpacking -operation. If a value of *host* is used for the *pair/comm/forward* or -*fix/comm/forward* keyword, it will be automatically be changed to *no* +operation. If a value of *host* is used for the *comm/pair/forward* or +*comm/fix/forward* keyword, it will be automatically be changed to *no* since these keywords don't support *host* mode. The optimal choice for these keywords depends on the input script and @@ -681,15 +695,16 @@ script or via the "-pk intel" :doc:`command-line switch `. For the KOKKOS package, the option defaults for GPUs are neigh = full, neigh/qeq = full, newton = off, binsize for GPUs = 2x LAMMPS default -value, comm = device, gpu/aware = on. When LAMMPS can safely detect -that GPU-aware MPI is not available, the default value of gpu/aware -becomes "off". For CPUs or Xeon Phis, the option defaults are neigh = -half, neigh/qeq = half, newton = on, binsize = 0.0, and comm = no. The -option neigh/thread = on when there are 16K atoms or less on an MPI -rank, otherwise it is "off". These settings are made automatically by -the required "-k on" :doc:`command-line switch `. You can -change them by using the package kokkos command in your input script or -via the :doc:`-pk kokkos command-line switch `. +value, comm = device, neigh/transpose = off, gpu/aware = on. When +LAMMPS can safely detect that GPU-aware MPI is not available, the +default value of gpu/aware becomes "off". For CPUs or Xeon Phis, the +option defaults are neigh = half, neigh/qeq = half, newton = on, +binsize = 0.0, and comm = no. The option neigh/thread = on when there +are 16K atoms or less on an MPI rank, otherwise it is "off". These +settings are made automatically by the required "-k on" +:doc:`command-line switch `. You can change them by using +the package kokkos command in your input script or via the :doc:`-pk +kokkos command-line switch `. For the OMP package, the default is Nthreads = 0 and the option defaults are neigh = yes. These settings are made automatically if diff --git a/doc/src/pair_bpm_spring.rst b/doc/src/pair_bpm_spring.rst new file mode 100644 index 0000000000..8235b1c624 --- /dev/null +++ b/doc/src/pair_bpm_spring.rst @@ -0,0 +1,114 @@ +.. index:: pair_style bpm/spring + +pair_style bpm/spring command +============================= + +Syntax +"""""" + +.. code-block:: LAMMPS + + pair_style bpm/spring + +Examples +"""""""" + +.. code-block:: LAMMPS + + pair_style bpm/spring + pair_coeff * * 1.0 1.0 1.0 + pair_coeff 1 1 1.0 1.0 1.0 + +Description +""""""""""" + +Style *bpm/spring* computes pairwise forces with the formula + +.. math:: + + F = k (r - r_c) + +where :math:`k` is a stiffness and :math:`r_c` is the cutoff length. +An additional damping force is also applied to interacting +particles. The force is proportional to the difference in the +normal velocity of particles + +.. math:: + + F_D = - \gamma w (\hat{r} \bullet \vec{v}) + +where :math:`\gamma` is the damping strength, :math:`\hat{r}` is the +radial normal vector, :math:`\vec{v}` is the velocity difference +between the two particles, and :math:`w` is a smoothing factor. +This smoothing factor is constructed such that damping forces go to zero +as particles come out of contact to avoid discontinuities. It is +given by + +.. math:: + + w = 1.0 - \left( \frac{r}{r_c} \right)^8 . + +This pair style is designed for use in a spring-based bonded particle +model. It mirrors the construction of the :doc:`bpm/spring +` bond style. + +This pair interaction is always applied to pairs of non-bonded particles +that are within the interaction distance. For pairs of bonded particles +that are within the interaction distance, there is the option to either +include this pair interaction and overlay the pair force over the bond +force or to exclude this pair interaction such that the two particles +only interact via the bond force. See discussion of the *overlay/pair* +option for BPM bond styles and the :doc:`special_bonds ` +command in the `:doc: how to ` page on BPMs for more details. + +The following coefficients must be defined for each pair of atom types +via the :doc:`pair_coeff ` command as in the examples +above, or in the data file or restart files read by the +:doc:`read_data ` or :doc:`read_restart ` +commands, or by mixing as described below: + +* :math:`k` (force/distance units) +* :math:`r_c` (distance units) +* :math:`\gamma` (force/velocity units) + + +---------- + +Mixing, shift, table, tail correction, restart, rRESPA info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +For atom type pairs I,J and I != J, the A coefficient and cutoff +distance for this pair style can be mixed. A is always mixed via a +*geometric* rule. The cutoff is mixed according to the pair_modify +mix value. The default mix value is *geometric*\ . See the +"pair_modify" command for details. + +This pair style does not support the :doc:`pair_modify ` +shift option, since the pair interaction goes to 0.0 at the cutoff. + +The :doc:`pair_modify ` table and tail options are not +relevant for this pair style. + +This pair style writes its information to :doc:`binary restart files +`, so pair_style and pair_coeff commands do not need to be +specified in an input script that reads a restart file. + +This pair style can only be used via the *pair* keyword of the +:doc:`run_style respa ` command. It does not support the +*inner*, *middle*, *outer* keywords. + +---------- + +Restrictions +"""""""""""" + none + +Related commands +"""""""""""""""" + +:doc:`pair_coeff `, :doc:`bond bpm/spring ` + +Default +""""""" + +none diff --git a/doc/src/pair_dielectric.rst b/doc/src/pair_dielectric.rst index c1f28c2089..dbdd163a76 100644 --- a/doc/src/pair_dielectric.rst +++ b/doc/src/pair_dielectric.rst @@ -3,6 +3,7 @@ .. index:: pair_style lj/cut/coul/cut/dielectric .. index:: pair_style lj/cut/coul/cut/dielectric/omp .. index:: pair_style lj/cut/coul/debye/dielectric +.. index:: pair_style lj/cut/coul/debye/dielectric/omp .. index:: pair_style lj/cut/coul/long/dielectric .. index:: pair_style lj/cut/coul/long/dielectric/omp .. index:: pair_style lj/cut/coul/msm/dielectric @@ -22,6 +23,8 @@ Accelerator Variants: *lj/cut/coul/cut/dielectric/omp* pair_style lj/cut/coul/debye/dielectric command =============================================== +Accelerator Variants: *lj/cut/coul/debye/dielectric/omp* + pair_style lj/cut/coul/long/dielectric command ============================================== diff --git a/doc/src/pair_dpd.rst b/doc/src/pair_dpd.rst index 8c61c789a6..5bc8cedaed 100644 --- a/doc/src/pair_dpd.rst +++ b/doc/src/pair_dpd.rst @@ -1,20 +1,22 @@ .. index:: pair_style dpd .. index:: pair_style dpd/gpu .. index:: pair_style dpd/intel +.. index:: pair_style dpd/kk .. index:: pair_style dpd/omp .. index:: pair_style dpd/tstat .. index:: pair_style dpd/tstat/gpu +.. index:: pair_style dpd/tstat/kk .. index:: pair_style dpd/tstat/omp pair_style dpd command ====================== -Accelerator Variants: *dpd/gpu*, *dpd/intel*, *dpd/omp* +Accelerator Variants: *dpd/gpu*, *dpd/intel*, *dpd/kk*, *dpd/omp* pair_style dpd/tstat command ============================ -Accelerator Variants: *dpd/tstat/gpu*, *dpd/tstat/omp* +Accelerator Variants: *dpd/tstat/gpu*, *dpd/tstat/kk*, *dpd/tstat/omp* Syntax """""" diff --git a/doc/src/pair_dpd_ext.rst b/doc/src/pair_dpd_ext.rst index 7512f8e688..88395f1c73 100644 --- a/doc/src/pair_dpd_ext.rst +++ b/doc/src/pair_dpd_ext.rst @@ -1,12 +1,18 @@ .. index:: pair_style dpd/ext +.. index:: pair_style dpd/ext/kk .. index:: pair_style dpd/ext/tstat +.. index:: pair_style dpd/ext/tstat/kk pair_style dpd/ext command ========================== +Accelerator Variants: dpd/ext/kk + pair_style dpd/ext/tstat command ================================ +Accelerator Variants: dpd/ext/tstat/kk + Syntax """""" @@ -137,6 +143,10 @@ except that A is not included. ---------- +.. include:: accel_styles.rst + +---------- + **Mixing, shift, table, tail correction, restart, rRESPA info**\ : diff --git a/doc/src/pair_lj_long.rst b/doc/src/pair_lj_long.rst index f7bdf49189..02ce9b0de5 100644 --- a/doc/src/pair_lj_long.rst +++ b/doc/src/pair_lj_long.rst @@ -238,7 +238,7 @@ none .. _Veld2: -**(In 't Veld)** In 't Veld, Ismail, Grest, J Chem Phys (accepted) (2007). +**(In 't Veld)** In 't Veld, Ismail, Grest, J Chem Phys, 127, 144711 (2007). .. _Jorgensen4: diff --git a/doc/src/pair_meam.rst b/doc/src/pair_meam.rst index 022de60f98..afa89e10ca 100644 --- a/doc/src/pair_meam.rst +++ b/doc/src/pair_meam.rst @@ -75,16 +75,16 @@ N additional arguments after the second filename in the pair_coeff command, where N is the number of LAMMPS atom types: * MEAM library file -* Elem1, Elem2, ... +* Element1, Element2, ... * MEAM parameter file * N element names = mapping of MEAM elements to atom types See the :doc:`pair_coeff ` page for alternate ways to specify the path for the potential files. -As an example, the potentials/library.meam file has generic MEAM -settings for a variety of elements. The potentials/SiC.meam file has -specific parameter settings for a Si and C alloy system. If your +As an example, the ``potentials/library.meam`` file has generic MEAM +settings for a variety of elements. The ``potentials/SiC.meam`` file +has specific parameter settings for a Si and C alloy system. If your LAMMPS simulation has 4 atoms types and you want the first 3 to be Si, and the fourth to be C, you would use the following pair_coeff command: @@ -118,30 +118,30 @@ that will be used with other potentials. If the second filename is NULL, the element names between the two filenames can appear in any order, e.g. "Si C" or "C Si" in the - example above. However, if the second filename is not NULL (as in the - example above), it contains settings that are Fortran-indexed for the - elements that precede it. Thus you need to insure you list the - elements between the filenames in an order consistent with how the + example above. However, if the second filename is **not** NULL (as in the + example above), it contains settings that are indexed **by numbers** + for the elements that precede it. Thus you need to insure that you list + the elements between the filenames in an order consistent with how the values in the second filename are indexed. See details below on the syntax for settings in the second file. The MEAM library file provided with LAMMPS has the name -potentials/library.meam. It is the "meamf" file used by other MD -codes. Aside from blank and comment lines (start with #) which can -appear anywhere, it is formatted as a series of entries, each of which +``potentials/library.meam``. It is the "meamf" file used by other MD +codes. Aside from blank and comment lines (starting with # which can +appear anywhere), it is formatted as a series of entries, each of which has 19 parameters and can span multiple lines: elt, lat, z, ielement, atwt, alpha, b0, b1, b2, b3, alat, esub, asub, t0, t1, t2, t3, rozero, ibar -The "elt" and "lat" parameters are text strings, such as elt = Si or -Cu and lat = dia or fcc. Because the library file is used by Fortran +The *elt* and *lat* parameters are text strings, such as *elt* = Si or +Cu and *lat* = dia or fcc. Because the library file is used by Fortran MD codes, these strings may be enclosed in single quotes, but this is not required. The other numeric parameters match values in the -formulas above. The value of the "elt" string is what is used in the +formulas above. The value of the *elt* string is what is used in the pair_coeff command to identify which settings from the library file you wish to read in. There can be multiple entries in the library -file with the same "elt" value; LAMMPS reads the first matching entry it +file with the same *elt* value; LAMMPS reads the first matching entry it finds and ignores the rest. Other parameters in the MEAM library file correspond to single-element @@ -157,13 +157,13 @@ potential parameters: esub = energy per atom (eV) in the reference structure at equilibrium asub = "A" parameter for MEAM (see e.g. :ref:`(Baskes) `) -The alpha, b0, b1, b2, b3, t0, t1, t2, t3 parameters correspond to the +The *alpha*, *b0*, *b1*, *b2*, *b3*, *t0*, *t1*, *t2*, *t3* parameters correspond to the standard MEAM parameters in the literature :ref:`(Baskes) ` (the b parameters are the standard beta parameters). Note that only parameters -normalized to t0 = 1.0 are supported. The rozero parameter is +normalized to *t0 = 1.0* are supported. The *rozero* parameter is an element-dependent density scaling that weights the reference background density (see e.g. equation 4.5 in :ref:`(Gullet) `) and -is typically 1.0 for single-element systems. The ibar parameter +is typically 1.0 for single-element systems. The *ibar* parameter selects the form of the function G(Gamma) used to compute the electron density; options are @@ -180,7 +180,7 @@ If used, the MEAM parameter file contains settings that override or complement the library file settings. Examples of such parameter files are in the potentials directory with a ".meam" suffix. Their format is the same as is read by other Fortran MD codes. Aside from -blank and comment lines (start with #) which can appear anywhere, each +blank and comment lines (start with # which can appear anywhere), each line has one of the following forms. Each line can also have a trailing comment (starting with #) which is ignored. @@ -213,7 +213,7 @@ The recognized keywords for the parameter file are as follows: delta(I,J) = heat of formation for I-J alloy; if Ec_IJ is input as zero, then LAMMPS sets Ec_IJ = (Ec_II + Ec_JJ)/2 - delta_IJ alpha(I,J) = alpha parameter for pair potential between I and J (can - be computed from bulk modulus of reference structure + be computed from bulk modulus of reference structure) re(I,J) = equilibrium distance between I and J in the reference structure Cmax(I,J,K) = Cmax screening parameter when I-J pair is screened @@ -283,8 +283,8 @@ The recognized keywords for the parameter file are as follows: 1 = rho_bkgd = rho0_meam(a)\*Z_meam(a) (matches DYNAMO) default = 0 -Rc, delr, re are in distance units (Angstroms in the case of metal -units). Ec and delta are in energy units (eV in the case of metal +*Rc*, *delr*, *re* are in distance units (Angstroms in the case of metal +units). *Ec* and *delta* are in energy units (eV in the case of metal units). Each keyword represents a quantity which is either a scalar, vector, @@ -299,37 +299,37 @@ Thus these lines rho0(2) = 2.25 alpha(1,2) = 4.37 -set rho0 for the second element to the value 2.25 and set alpha for the +set *rho0* for the second element to the value 2.25 and set *alpha* for the alloy interaction between elements 1 and 2 to 4.37. -The augt1 parameter is related to modifications in the MEAM +The *augt1* parameter is related to modifications in the MEAM formulation of the partial electron density function. In recent literature, an extra term is included in the expression for the third-order density in order to make the densities orthogonal (see for example :ref:`(Wang) `, equation 3d); this term is included in the MEAM implementation in lammps. However, in earlier published work this term was not included when deriving parameters, including most of -those provided in the library.meam file included with lammps, and to -account for this difference the parameter t1 must be augmented by -3/5\*t3. If augt1=1, the default, this augmentation is done +those provided in the ``library.meam`` file included with lammps, and to +account for this difference the parameter *t1* must be augmented by +3/5\**t3*. If *augt1* = 1, the default, this augmentation is done automatically. When parameter values are fit using the modified density function, as in more recent literature, augt1 should be set to 0. -The mixture_ref_t parameter is available to match results with those +The *mixture_ref_t* parameter is available to match results with those of previous versions of lammps (before January 2011). Newer versions -of lammps, by default, use the single-element values of the t +of lammps, by default, use the single-element values of the *t* parameters to compute the background reference density. This is the proper way to compute these parameters. Earlier versions of lammps -used an alloy mixture averaged value of t to compute the background -reference density. Setting mixture_ref_t=1 gives the old behavior. -WARNING: using mixture_ref_t=1 will give results that are demonstrably +used an alloy mixture averaged value of *t* to compute the background +reference density. Setting *mixture_ref_t* = 1 gives the old behavior. +WARNING: using *mixture_ref_t* = 1 will give results that are demonstrably incorrect for second-neighbor MEAM, and non-standard for first-neighbor MEAM; this option is included only for matching with previous versions of lammps and should be avoided if possible. -The parameters attrac and repuls, along with the integer selection -parameter erose_form, can be used to modify the Rose energy function +The parameters *attrac* and *repuls*, along with the integer selection +parameter *erose_form*, can be used to modify the Rose energy function used to compute the pair potential. This function gives the energy of the reference state as a function of interatomic spacing. The form of this function is: @@ -343,19 +343,19 @@ this function is: a3 = repuls, astar < 0 a3 = attrac, astar >= 0 -Most published MEAM parameter sets use the default values attrac=repulse=0. -Setting repuls=attrac=delta corresponds to the form used in several +Most published MEAM parameter sets use the default values *attrac* = *repulse* = 0. +Setting *repuls* = *attrac* = *delta* corresponds to the form used in several recent published MEAM parameter sets, such as :ref:`(Valone) ` .. note:: - The default form of the erose expression in LAMMPS was corrected + The default form of the *erose* expression in LAMMPS was corrected in March 2009. The current version is correct, but may show different behavior compared with earlier versions of lammps with the attrac and/or repuls parameters are non-zero. To obtain the previous default - form, use erose_form = 1 (this form does not seem to appear in the + form, use *erose_form* = 1 (this form does not seem to appear in the literature). An alternative form (see e.g. :ref:`(Lee2) `) is - available using erose_form = 2. + available using *erose_form* = 2. ---------- @@ -364,13 +364,13 @@ Mixing, shift, table, tail correction, restart, rRESPA info For atom type pairs I,J and I != J, where types I and J correspond to two different element types, mixing is performed by LAMMPS with -user-specifiable parameters as described above. You never need to -specify a pair_coeff command with I != J arguments for this style. +user-specifiable parameters as described above. This pair style does not support the :doc:`pair_modify ` -shift, table, and tail options. +*shift*, *table*, and *tail* options. -This pair style does not write its information to :doc:`binary restart files `, since it is stored in potential files. Thus, you +This pair style does not write its information to :doc:`binary restart files `, +since it is stored in potential files. Thus, you need to re-specify the pair_style and pair_coeff commands in an input script that reads a restart file. diff --git a/doc/src/pair_style.rst b/doc/src/pair_style.rst index f90a718d95..b42e3c9a50 100644 --- a/doc/src/pair_style.rst +++ b/doc/src/pair_style.rst @@ -131,6 +131,7 @@ accelerated styles exist. * :doc:`born/coul/msm ` - Born with long-range MSM Coulomb * :doc:`born/coul/wolf ` - Born with Wolf potential for Coulomb * :doc:`born/coul/wolf/cs ` - Born with Wolf potential for Coulomb and core/shell model +* :doc:`bpm/spring ` - repulsive harmonic force with damping * :doc:`brownian ` - Brownian potential for Fast Lubrication Dynamics * :doc:`brownian/poly ` - Brownian potential for Fast Lubrication Dynamics with polydispersity * :doc:`buck ` - Buckingham potential diff --git a/doc/src/pair_tracker.rst b/doc/src/pair_tracker.rst index d2cee1d879..04967e952d 100644 --- a/doc/src/pair_tracker.rst +++ b/doc/src/pair_tracker.rst @@ -8,89 +8,182 @@ Syntax .. code-block:: LAMMPS - pair_style tracker keyword + pair_style tracker fix_ID N keyword values attribute1 attribute2 ... -* zero or more keyword/arg pairs may be appended -* keyword = *finite* +* fix_ID = ID of associated internal fix to store data +* N = prepare data for output every this many timesteps +* zero or more keywords may be appended +* keyword = *finite* or *time/min* or *type/include* .. parsed-literal:: *finite* value = none pair style uses atomic diameters to identify contacts + *time/min* value = T + T = minimum number of timesteps of interaction + *type/include* value = list1 list2 + list1,list2 = separate lists of types (see below) + +* one or more attributes may be appended + + .. parsed-literal:: + + possible attributes = id1 id2 time/created time/broken time/total + r/min r/ave x y z + + .. parsed-literal:: + + id1, id2 = IDs of the 2 atoms in each pair interaction + time/created = the timestep that the 2 atoms began interacting + time/broken = the timestep that the 2 atoms stopped interacting + time/total = the total number of timesteps the 2 atoms interacted + r/min = the minimum radial distance between the 2 atoms during the interaction (distance units) + r/ave = the average radial distance between the 2 atoms during the interaction (distance units) + x, y, z = the center of mass position of the 2 atoms when they stopped interacting (distance units) Examples """""""" .. code-block:: LAMMPS - pair_style hybrid/overlay tracker ... + pair_style hybrid/overlay tracker myfix 1000 id1 id2 type/include 1 * type/include 2 3,4 lj/cut 2.5 pair_coeff 1 1 tracker 2.0 - pair_style hybrid/overlay tracker finite ... + pair_style hybrid/overlay tracker myfix 1000 finite x y z time/min 100 granular pair_coeff * * tracker - fix 1 all pair/tracker 1000 time/created time/broken - dump 1 all local 1000 dump.local f_1[1] f_1[2] + dump 1 all local 1000 dump.local f_myfix[1] f_myfix[2] f_myfix[3] dump_modify 1 write_header no Description """"""""""" -Style *tracker* monitors information about pairwise interactions. -It does not calculate any forces on atoms. -:doc:`Pair hybrid/overlay ` can be used to combine this pair -style with another pair style. Style *tracker* must be used in conjunction -with about :doc:`fix pair_tracker ` which contains -information on what data can be output. +Style *tracker* monitors information about pairwise interactions. It +does not calculate any forces on atoms. :doc:`Pair hybrid/overlay +` can be used to combine this pair style with any other +pair style, as shown in the examples above. -If the *finite* keyword is not defined, the following coefficients must be -defined for each pair of atom types via the :doc:`pair_coeff ` -command as in the examples above, or in the data file or restart files -read by the :doc:`read_data ` or :doc:`read_restart ` -commands, or by mixing as described below: +At each timestep, if two neighboring atoms move beyond the interaction +cutoff, pairwise data is processed and transferred to an internal fix +labeled *fix_ID*. This allows the local data to be accessed by other +LAMMPS commands. Additional +filters can be applied using the *time/min* or *type/include* keywords +described below. Note that this is the interaction cutoff defined by +this pair style, not the short-range cutoff defined by the pair style +that is calculating forces on atoms. + +Following any optional keyword/value arguments, a list of one or more +attributes is specified. These include the IDs of the two atoms in +the pair. The other attributes for the pair of atoms are the +duration of time they were "interacting" or at the point in time they +started or stopped interacting. In this context, "interacting" means +the time window during which the two atoms were closer than the +interaction cutoff distance. The attributes for time/* refer to +timesteps. + +Data is continuously accumulated by the internal fix over intervals of *N* +timesteps. At the end of each interval, all of the saved accumulated +data is deleted to make room for new data. Individual datum may +therefore persist anywhere between *1* to *N* timesteps depending on +when they are saved. This data can be accessed using the *fix_ID* and a +:doc:`dump local ` command. To ensure all data is output, +the dump frequency should correspond to the same interval of *N* +timesteps. A dump frequency of an integer multiple of *N* can be used +to regularly output a sample of the accumulated data. + +---------- + +The following optional keywords may be used. + +If the *finite* keyword is not used, the following coefficients must +be defined for each pair of atom types via the :doc:`pair_coeff +` command as in the examples above, or in the data file or +restart files read by the :doc:`read_data ` or +:doc:`read_restart ` commands, or by mixing as described +below: * cutoff (distance units) -If the *finite* keyword is defined, no coefficients may be defined. -Interaction cutoffs are alternatively calculated based on the -diameter of finite particles. +If the *finite* keyword is used, there are no additional coefficients +to set for each pair of atom types via the +:doc:`pair_coeff ` command. Interaction cutoffs are +instead calculated based on the diameter of finite particles. However +you must still use the :doc:`pair_coeff ` for all atom +types. For example the command +.. code-block:: LAMMPS + + pair_coeff * * + +should be used. + +The *time/min* keyword sets a minimum amount of time that an +interaction must persist to be included. This setting can be used to +censor short-lived interactions. + +The *type/include* keyword filters interactions based on the types of +the two atoms. Data is only saved for interactions between atoms +whose two atom types appear in *list1* and *list2*. Atom type 1 must +be in list1 and atom type 2 in list2. Or vice versa. + +Each type list consists of a series of type ranges separated by +commas. Each range can be specified as a single numeric value, or a +wildcard asterisk can be used to specify a range of values. This +takes the form "\*" or "\*n" or "n\*" or "m\*n". For example, if M = +the number of atom types, then an asterisk with no numeric values +means all types from 1 to M. A leading asterisk means all types from +1 to n (inclusive). A trailing asterisk means all types from n to M +(inclusive). A middle asterisk means all types from m to n +(inclusive). Note that the *type/include* keyword can be specified +multiple times. Mixing, shift, table, tail correction, restart, rRESPA info """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" For atom type pairs I,J and I != J, the cutoff coefficient and cutoff -distance for this pair style can be mixed. The cutoff is always mixed via a -*geometric* rule. The cutoff is mixed according to the pair_modify -mix value. The default mix value is *geometric*\ . See the -"pair_modify" command for details. +distance for this pair style can be mixed. The cutoff is always mixed +via a *geometric* rule. The cutoff is mixed according to the +pair_modify mix value. The default mix value is *geometric*\ . See +the "pair_modify" command for details. -This pair style writes its information to :doc:`binary restart files `, so -pair_style and pair_coeff commands do not need -to be specified in an input script that reads a restart file. +This pair style writes its information to :doc:`binary restart files +`, so pair_style and pair_coeff commands do not need to be +specified in an input script that reads a restart file. The :doc:`pair_modify ` shift, table, and tail options are not relevant for this pair style. +The accumulated data is not written to restart files and should be +output before a restart file is written to avoid missing data. + +The internal fix calculates a local vector or local array depending on the +number of input values. The length of the vector or number of rows in +the array is the number of recorded, lost interactions. If a single +input is specified, a local vector is produced. If two or more inputs +are specified, a local array is produced where the number of columns = +the number of inputs. The vector or array can be accessed by any +command that uses local values from a compute as input. See the +:doc:`Howto output ` page for an overview of LAMMPS +output options. + +The vector or array will be floating point values that correspond to +the specified attribute. + ---------- Restrictions """""""""""" -A corresponding :doc:`fix pair_tracker ` must be defined -to use this pair style. - -This pair style is currently incompatible with granular pair styles that extend -beyond the contact (e.g. JKR and DMT). - This fix is part of the MISC package. It is only enabled if LAMMPS -was built with that package. See the :doc:`Build package ` page for more info. +was built with that package. See the :doc:`Build package +` page for more info. + +This pair style is currently incompatible with granular pair styles +that extend beyond the contact (e.g. JKR and DMT). Related commands """""""""""""""" -:doc:`fix pair_tracker ` - Default """"""" diff --git a/doc/src/plugin.rst b/doc/src/plugin.rst index 3ce9e41870..1a10ab84ad 100644 --- a/doc/src/plugin.rst +++ b/doc/src/plugin.rst @@ -17,7 +17,7 @@ Syntax *load* file = load plugin(s) from shared object in *file* *unload* style name = unload plugin *name* of style *style* - *style* = *pair* or *bond* or *angle* or *dihedral* or *improper* or *compute* or *fix* or *region* or *command* + *style* = *pair* or *bond* or *angle* or *dihedral* or *improper* or *kspace* or *compute* or *fix* or *region* or *command* *list* = print a list of currently loaded plugins *clear* = unload all currently loaded plugins @@ -70,12 +70,11 @@ Restrictions """""""""""" The *plugin* command is part of the PLUGIN package. It is -only enabled if LAMMPS was built with that package. -See the :doc:`Build package ` page for -more info. Plugins are not available on Windows. +only enabled if LAMMPS was built with that package. See +the :doc:`Build package ` page for more info. -If plugins access functions or classes from a package, LAMMPS must -have been compiled with that package included. +If plugins access functions or classes from a package, +LAMMPS must have been compiled with that package included. Plugins are dependent on the LAMMPS binary interface (ABI) and particularly the MPI library used. So they are not guaranteed diff --git a/doc/src/read_data.rst b/doc/src/read_data.rst index 24f882b658..68e1efc496 100644 --- a/doc/src/read_data.rst +++ b/doc/src/read_data.rst @@ -650,6 +650,8 @@ of analysis. - atom-ID atom-type rho esph cv x y z * - sphere - atom-ID atom-type diameter density x y z + * - bpm/sphere + - atom-ID molecule-ID atom-type diameter density x y z * - spin - atom-ID atom-type x y z spx spy spz sp * - tdpd diff --git a/doc/src/server.rst b/doc/src/server.rst deleted file mode 100644 index 7423653c14..0000000000 --- a/doc/src/server.rst +++ /dev/null @@ -1,74 +0,0 @@ -.. index:: server - -server command -============== - -Syntax -"""""" - -.. parsed-literal:: - - server protocol - -* protocol = *md* or *mc* - -Examples -"""""""" - -.. code-block:: LAMMPS - - server md - -Description -""""""""""" - -This command starts LAMMPS running in "server" mode, where it receives -messages from a separate "client" code and responds by sending a reply -message back to the client. The specified *protocol* determines the -format and content of messages LAMMPS expects to receive and how it -responds. - -The :doc:`Howto client/server ` page gives an -overview of client/server coupling of LAMMPS with another code where -one code is the "client" and sends request messages to a "server" -code. The server responds to each request with a reply message. This -enables the two codes to work in tandem to perform a simulation. - -When this command is invoked, LAMMPS will run in server mode in an -endless loop, waiting for messages from the client code. The client -signals when it is done sending messages to LAMMPS, at which point the -loop will exit, and the remainder of the LAMMPS input script will be -processed. - -The *protocol* argument defines the format and content of messages -that will be exchanged between the two codes. The current options -are: - -* :doc:`md ` = run dynamics with another code -* :doc:`mc ` = perform Monte Carlo moves with another code - -For protocol *md*, LAMMPS can be either a client (via the :doc:`fix client/md ` command) or server. See the :doc:`server md ` page for details on the protocol. - -For protocol *mc*, LAMMPS can be the server. See the :doc:`server mc ` page for details on the protocol. - ----------- - -Restrictions -"""""""""""" - -This command is part of the MESSAGE package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` page for more info. - -A script that uses this command must also use the -:doc:`message ` command to setup the messaging protocol with -the other client code. - -Related commands -"""""""""""""""" - -:doc:`message `, :doc:`fix client/md ` - -Default -""""""" - -none diff --git a/doc/src/server_mc.rst b/doc/src/server_mc.rst deleted file mode 100644 index f5ddf2f468..0000000000 --- a/doc/src/server_mc.rst +++ /dev/null @@ -1,126 +0,0 @@ -.. index:: server mc - -server mc command -================= - -Syntax -"""""" - -.. parsed-literal:: - - server mc - -mc = the protocol argument to the :doc:`server ` command - -Examples -"""""""" - -.. code-block:: LAMMPS - - server mc - -Description -""""""""""" - -This command starts LAMMPS running in "server" mode, where it will -expect messages from a separate "client" code that match the *mc* -protocol for format and content explained below. For each message -LAMMPS receives it will send a message back to the client. - -The :doc:`Howto client/server ` page gives an -overview of client/server coupling of LAMMPS with another code where -one code is the "client" and sends request messages to a "server" -code. The server responds to each request with a reply message. This -enables the two codes to work in tandem to perform a simulation. - -When this command is invoked, LAMMPS will run in server mode in an -endless loop, waiting for messages from the client code. The client -signals when it is done sending messages to LAMMPS, at which point the -loop will exit, and the remainder of the LAMMPS script will be -processed. - -The :doc:`server ` page gives other options for using LAMMPS -See an example of how this command is used in -examples/COUPLE/lammps_mc/in.server. - ----------- - -When using this command, LAMMPS (as the server code) receives -instructions from a Monte Carlo (MC) driver to displace random atoms, -compute the energy before and after displacement, and run dynamics to -equilibrate the system. - -The MC driver performs the random displacements on random atoms, -accepts or rejects the move in an MC sense, and orchestrates the MD -runs. - -The format and content of the exchanged messages are explained here in -a conceptual sense. Python-style pseudo code for the library calls to -the CSlib is shown, which performs the actual message exchange between -the two codes. See the `CSlib website `_ doc -pages for more details on the actual library syntax. The "cs" object -in this pseudo code is a pointer to an instance of the CSlib. - -See the src/MESSAGE/server_mc.cpp file for details on how LAMMPS uses -these messages. See the examples/COUPLE/lammps_mc/mc.cpp file for an -example of how an MC driver code can use these messages. - -Define NATOMS=1, EINIT=2, DISPLACE=3, ACCEPT=4, RUN=5. - -**Client sends one of these kinds of message**\ : - -.. parsed-literal:: - - cs->send(NATOMS,0) # msgID = 1 with no fields - - cs->send(EINIT,0) # msgID = 2 with no fields - - cs->send(DISPLACE,2) # msgID = 3 with 2 fields - cs->pack_int(1,ID) # 1st field = ID of atom to displace - cs->pack(2,3,xnew) # 2nd field = new xyz coords of displaced atom - - cs->send(ACCEPT,1) # msgID = 4 with 1 field - cs->pack_int(1,flag) # 1st field = accept/reject flag - - cs->send(RUN,1) # msgID = 5 with 1 field - cs->pack_int(1,nsteps) # 1st field = # of timesteps to run MD - -**Server replies**\ : - -.. parsed-literal:: - - cs->send(NATOMS,1) # msgID = 1 with 1 field - cs->pack_int(1,natoms) # 1st field = number of atoms - - cs->send(EINIT,2) # msgID = 2 with 2 fields - cs->pack_double(1,poteng) # 1st field = potential energy of system - cs->pack(2,3\*natoms,x) # 2nd field = 3N coords of Natoms - - cs->send(DISPLACE,1) # msgID = 3 with 1 field - cs->pack_double(1,poteng) # 1st field = new potential energy of system - - cs->send(ACCEPT,0) # msgID = 4 with no fields - - cs->send(RUN,0) # msgID = 5 with no fields - ----------- - -Restrictions -"""""""""""" - -This command is part of the MESSAGE package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` page for more info. - -A script that uses this command must also use the -:doc:`message ` command to setup the messaging protocol with -the other client code. - -Related commands -"""""""""""""""" - -:doc:`message ` - -Default -""""""" - -none diff --git a/doc/src/server_md.rst b/doc/src/server_md.rst deleted file mode 100644 index f9a25a4718..0000000000 --- a/doc/src/server_md.rst +++ /dev/null @@ -1,161 +0,0 @@ -.. index:: server md - -server md command -================= - -Syntax -"""""" - -.. parsed-literal:: - - server md - -md = the protocol argument to the :doc:`server ` command - -Examples -"""""""" - -.. code-block:: LAMMPS - - server md - -Description -""""""""""" - -This command starts LAMMPS running in "server" mode, where it will -expect messages from a separate "client" code that match the *md* -protocol for format and content explained below. For each message -LAMMPS receives it will send a message back to the client. - -The :doc:`Howto client/server ` page gives an -overview of client/server coupling of LAMMPS with another code where -one code is the "client" and sends request messages to a "server" -code. The server responds to each request with a reply message. This -enables the two codes to work in tandem to perform a simulation. - -When this command is invoked, LAMMPS will run in server mode in an -endless loop, waiting for messages from the client code. The client -signals when it is done sending messages to LAMMPS, at which point the -loop will exit, and the remainder of the LAMMPS script will be -processed. - -The :doc:`server ` page gives other options for using LAMMPS -in server mode. See an example of how this command is used in -examples/message/in.message.server. - ----------- - -When using this command, LAMMPS (as the server code) receives the -current coordinates of all particles from the client code each -timestep, computes their interaction, and returns the energy, forces, -and pressure for the interacting particles to the client code, so it -can complete the timestep. This command could also be used with a -client code that performs energy minimization, using the server to -compute forces and energy each iteration of its minimizer. - -When using the :doc:`fix client/md ` command, LAMMPS (as -the client code) does the timestepping and receives needed energy, -forces, and pressure values from the server code. - -The format and content of the exchanged messages are explained here in -a conceptual sense. Python-style pseudo code for the library calls to -the CSlib is shown, which performs the actual message exchange between -the two codes. See the `CSlib website `_ doc -pages for more details on the actual library syntax. The "cs" object -in this pseudo code is a pointer to an instance of the CSlib. - -See the src/MESSAGE/server_md.cpp and src/MESSAGE/fix_client_md.cpp -files for details on how LAMMPS uses these messages. See the -examples/COUPLE/lammps_vasp/vasp_wrap.py or -examples/COUPLE/lammps_nwchem/nwchem_wrap.py files for examples of how -a quantum code (VASP or NWChem) can use these messages. - -The following pseudo-code uses these values, defined as enums. - -Define: - -.. parsed-literal:: - - SETUP=1, STEP=2 - DIM=1, PERIODICITY=2, ORIGIN=3, BOX=4, NATOMS=5, NTYPES=6, TYPES=7, COORDS=8, UNITS-9, CHARGE=10 - FORCES=1, ENERGY=2, PRESSURE=3, ERROR=4 - -**Client sends 2 kinds of messages**\ : - -.. parsed-literal:: - - # required fields: DIM, PERIODICTY, ORIGIN, BOX, NATOMS, NTYPES, TYPES, COORDS - # optional fields: UNITS, CHARGE - - cs->send(SETUP,nfields) # msgID with nfields - - cs->pack_int(DIM,dim) # dimension (2,3) of simulation - cs->pack(PERIODICITY,3,xyz) # periodicity flags in 3 dims - cs->pack(ORIGIN,3,origin) # lower-left corner of simulation box - cs->pack(BOX,9,box) # 3 edge vectors of simulation box - cs->pack_int(NATOMS,natoms) # total number of atoms - cs->pack_int(NTYPES,ntypes) # number of atom types - cs->pack(TYPES,natoms,type) # vector of per-atom types - cs->pack(COORDS,3\*natoms,x) # vector of 3N atom coords - cs->pack_string(UNITS,units) # units = "lj", "real", "metal", etc - cs->pack(CHARGE,natoms,q) # vector of per-atom charge - - # required fields: COORDS - # optional fields: ORIGIN, BOX - - cs->send(STEP,nfields) # msgID with nfields - - cs->pack(COORDS,3\*natoms,x) # vector of 3N atom coords - cs->pack(ORIGIN,3,origin) # lower-left corner of simulation box - cs->pack(BOX,9,box) # 3 edge vectors of simulation box - -**Server replies to either kind of message**\ : - -.. parsed-literal:: - - # required fields: FORCES, ENERGY, PRESSURE - # optional fields: ERROR - - cs->send(msgID,nfields) # msgID with nfields - cs->pack(FORCES,3\*Natoms,f) # vector of 3N forces on atoms - cs->pack(ENERGY,1,poteng) # total potential energy of system - cs->pack(PRESSURE,6,press) # global pressure tensor (6-vector) - cs->pack_int(ERROR,flag) # server had an error (e.g. DFT non-convergence) - ----------- - -The units for various quantities that are sent and received iva -messages are defined for atomic-scale simulations in the table below. -The client and server codes (including LAMMPS) can use internal units -different than these (e.g. :doc:`real units ` in LAMMPS), so long -as they convert to these units for messaging. - -* COORDS, ORIGIN, BOX = Angstroms -* CHARGE = multiple of electron charge (1.0 is a proton) -* ENERGY = eV -* FORCES = eV/Angstrom -* PRESSURE = bars - -Note that these are :doc:`metal units ` in LAMMPS. - -If you wish to run LAMMPS in another its non-atomic units, e.g. :doc:`lj units `, then the client and server should exchange a UNITS -message as indicated above, and both the client and server should -agree on the units for the data they exchange. - ----------- - -Restrictions -"""""""""""" - -This command is part of the MESSAGE package. It is only enabled if -LAMMPS was built with that package. See the :doc:`Build package ` page for more info. - -Related commands -"""""""""""""""" - -:doc:`message `, :doc:`fix client/md ` - -Default -""""""" - -none diff --git a/doc/src/set.rst b/doc/src/set.rst index 1ca8168317..cc1d2766e3 100644 --- a/doc/src/set.rst +++ b/doc/src/set.rst @@ -22,7 +22,7 @@ Syntax *volume* or *image* or *bond* or *angle* or *dihedral* or *improper* or *sph/e* or *sph/cv* or *sph/rho* or *smd/contact/radius* or *smd/mass/density* or *dpd/theta* or - *edpd/temp* or *edpd/cv* or *cc* or + *edpd/temp* or *edpd/cv* or *cc* or *epsilon* or *i_name* or *d_name* or *i2_name* or *d2_name* .. parsed-literal:: @@ -124,6 +124,7 @@ Syntax *cc* values = index cc index = index of a chemical species (1 to Nspecies) cc = chemical concentration of tDPD particles for a species (mole/volume units) + *epsilon* value = dielectric constant of the medium where the atoms reside *i_name* value = custom integer vector with name *d_name* value = custom floating-point vector with name *i2_name* value = column of a custom integer array with name @@ -372,13 +373,13 @@ vector of the particles is set to the 3 specified components. Keyword *omega* sets the angular velocity of selected atoms. The particles must be spheres as defined by the :doc:`atom_style sphere -` command. The angular velocity vector of the particles -is set to the 3 specified components. +` command. The angular velocity vector of the particles is +set to the 3 specified components. Keyword *mass* sets the mass of all selected particles. The particles -must have a per-atom mass attribute, as defined by the -:doc:`atom_style ` command. See the "mass" command for -how to set mass values on a per-type basis. +must have a per-atom mass attribute, as defined by the :doc:`atom_style +` command. See the "mass" command for how to set mass +values on a per-type basis. Keyword *density* or *density/disc* also sets the mass of all selected particles, but in a different way. The particles must have a per-atom @@ -387,22 +388,21 @@ command. If the atom has a radius attribute (see :doc:`atom_style sphere `) and its radius is non-zero, its mass is set from the density and particle volume for 3d systems (the input density is assumed to be in mass/distance\^3 units). For 2d, the default is for -LAMMPS to model particles with a radius attribute as spheres. -However, if the *density/disc* keyword is used, then they can be -modeled as 2d discs (circles). Their mass is set from the density and -particle area (the input density is assumed to be in mass/distance\^2 -units). +LAMMPS to model particles with a radius attribute as spheres. However, +if the *density/disc* keyword is used, then they can be modeled as 2d +discs (circles). Their mass is set from the density and particle area +(the input density is assumed to be in mass/distance\^2 units). If the atom has a shape attribute (see :doc:`atom_style ellipsoid -`) and its 3 shape parameters are non-zero, then its mass -is set from the density and particle volume (the input density is -assumed to be in mass/distance\^3 units). The *density/disc* keyword -has no effect; it does not (yet) treat 3d ellipsoids as 2d ellipses. +`) and its 3 shape parameters are non-zero, then its mass is +set from the density and particle volume (the input density is assumed +to be in mass/distance\^3 units). The *density/disc* keyword has no +effect; it does not (yet) treat 3d ellipsoids as 2d ellipses. If the atom has a length attribute (see :doc:`atom_style line -`) and its length is non-zero, then its mass is set from -the density and line segment length (the input density is assumed to -be in mass/distance units). If the atom has an area attribute (see +`) and its length is non-zero, then its mass is set from the +density and line segment length (the input density is assumed to be in +mass/distance units). If the atom has an area attribute (see :doc:`atom_style tri `) and its area is non-zero, then its mass is set from the density and triangle area (the input density is assumed to be in mass/distance\^2 units). @@ -410,84 +410,91 @@ assumed to be in mass/distance\^2 units). If none of these cases are valid, then the mass is set to the density value directly (the input density is assumed to be in mass units). -Keyword *volume* sets the volume of all selected particles. -Currently, only the :doc:`atom_style peri ` command defines -particles with a volume attribute. Note that this command does not -adjust the particle mass. +Keyword *volume* sets the volume of all selected particles. Currently, +only the :doc:`atom_style peri ` command defines particles +with a volume attribute. Note that this command does not adjust the +particle mass. Keyword *image* sets which image of the simulation box the atom is considered to be in. An image of 0 means it is inside the box as -defined. A value of 2 means add 2 box lengths to get the true value. -A value of -1 means subtract 1 box length to get the true value. -LAMMPS updates these flags as atoms cross periodic boundaries during -the simulation. The flags can be output with atom snapshots via the -:doc:`dump ` command. If a value of NULL is specified for any -of nx,ny,nz, then the current image value for that dimension is -unchanged. For non-periodic dimensions only a value of 0 can be -specified. This command can be useful after a system has been -equilibrated and atoms have diffused one or more box lengths in -various directions. This command can then reset the image values for -atoms so that they are effectively inside the simulation box, e.g if a -diffusion coefficient is about to be measured via the :doc:`compute -msd ` command. Care should be taken not to reset the -image flags of two atoms in a bond to the same value if the bond -straddles a periodic boundary (rather they should be different by +/- -1). This will not affect the dynamics of a simulation, but may mess -up analysis of the trajectories if a LAMMPS diagnostic or your own -analysis relies on the image flags to unwrap a molecule which -straddles the periodic box. +defined. A value of 2 means add 2 box lengths to get the true value. A +value of -1 means subtract 1 box length to get the true value. LAMMPS +updates these flags as atoms cross periodic boundaries during the +simulation. The flags can be output with atom snapshots via the +:doc:`dump ` command. If a value of NULL is specified for any of +nx,ny,nz, then the current image value for that dimension is unchanged. +For non-periodic dimensions only a value of 0 can be specified. This +command can be useful after a system has been equilibrated and atoms +have diffused one or more box lengths in various directions. This +command can then reset the image values for atoms so that they are +effectively inside the simulation box, e.g if a diffusion coefficient is +about to be measured via the :doc:`compute msd ` command. +Care should be taken not to reset the image flags of two atoms in a bond +to the same value if the bond straddles a periodic boundary (rather they +should be different by +/- 1). This will not affect the dynamics of a +simulation, but may mess up analysis of the trajectories if a LAMMPS +diagnostic or your own analysis relies on the image flags to unwrap a +molecule which straddles the periodic box. -Keywords *bond*, *angle*, *dihedral*, and *improper*, set the bond -type (angle type, etc) of all bonds (angles, etc) of selected atoms to -the specified value from 1 to nbondtypes (nangletypes, etc). All -atoms in a particular bond (angle, etc) must be selected atoms in -order for the change to be made. The value of nbondtype (nangletypes, -etc) was set by the *bond types* (\ *angle types*, etc) field in the -header of the data file read by the :doc:`read_data ` -command. These keywords do not allow use of an atom-style variable. +Keywords *bond*, *angle*, *dihedral*, and *improper*, set the bond type +(angle type, etc) of all bonds (angles, etc) of selected atoms to the +specified value from 1 to nbondtypes (nangletypes, etc). All atoms in a +particular bond (angle, etc) must be selected atoms in order for the +change to be made. The value of nbondtype (nangletypes, etc) was set by +the *bond types* (\ *angle types*, etc) field in the header of the data +file read by the :doc:`read_data ` command. These keywords +do not allow use of an atom-style variable. -Keywords *sph/e*, *sph/cv*, and *sph/rho* set the energy, heat -capacity, and density of smoothed particle hydrodynamics (SPH) -particles. See `this PDF guide `_ -to using SPH in LAMMPS. +Keywords *sph/e*, *sph/cv*, and *sph/rho* set the energy, heat capacity, +and density of smoothed particle hydrodynamics (SPH) particles. See +`this PDF guide `_ to using SPH in LAMMPS. -Keyword *smd/mass/density* sets the mass of all selected particles, -but it is only applicable to the Smooth Mach Dynamics package -MACHDYN. It assumes that the particle volume has already been -correctly set and calculates particle mass from the provided mass -density value. +Keyword *smd/mass/density* sets the mass of all selected particles, but +it is only applicable to the Smooth Mach Dynamics package MACHDYN. It +assumes that the particle volume has already been correctly set and +calculates particle mass from the provided mass density value. -Keyword *smd/contact/radius* only applies to simulations with the -Smooth Mach Dynamics package MACHDYN. Itsets an interaction radius -for computing short-range interactions, e.g. repulsive forces to -prevent different individual physical bodies from penetrating each -other. Note that the SPH smoothing kernel diameter used for computing -long range, nonlocal interactions, is set using the *diameter* -keyword. +Keyword *smd/contact/radius* only applies to simulations with the Smooth +Mach Dynamics package MACHDYN. Itsets an interaction radius for +computing short-range interactions, e.g. repulsive forces to prevent +different individual physical bodies from penetrating each other. Note +that the SPH smoothing kernel diameter used for computing long range, +nonlocal interactions, is set using the *diameter* keyword. Keyword *dpd/theta* sets the internal temperature of a DPD particle as -defined by the DPD-REACT package. If the specified value is a number -it must be >= 0.0. If the specified value is NULL, then the kinetic -temperature Tkin of each particle is computed as 3/2 k Tkin = KE = 1/2 -m v\^2 = 1/2 m (vx\*vx+vy\*vy+vz\*vz). Each particle's internal +defined by the DPD-REACT package. If the specified value is a number it +must be >= 0.0. If the specified value is NULL, then the kinetic +temperature Tkin of each particle is computed as 3/2 k Tkin = KE = 1/2 m +v\^2 = 1/2 m (vx\*vx+vy\*vy+vz\*vz). Each particle's internal temperature is set to Tkin. If the specified value is an atom-style -variable, then the variable is evaluated for each particle. If a -value >= 0.0, the internal temperature is set to that value. If it is -< 0.0, the computation of Tkin is performed and the internal -temperature is set to that value. +variable, then the variable is evaluated for each particle. If a value +>= 0.0, the internal temperature is set to that value. If it is < 0.0, +the computation of Tkin is performed and the internal temperature is set +to that value. Keywords *edpd/temp* and *edpd/cv* set the temperature and volumetric heat capacity of an eDPD particle as defined by the DPD-MESO package. Currently, only :doc:`atom_style edpd ` defines particles -with these attributes. The values for the temperature and heat -capacity must be positive. +with these attributes. The values for the temperature and heat capacity +must be positive. Keyword *cc* sets the chemical concentration of a tDPD particle for a specified species as defined by the DPD-MESO package. Currently, only :doc:`atom_style tdpd ` defines particles with this attribute. An integer for "index" selects a chemical species (1 to -Nspecies) where Nspecies is set by the atom_style command. The value -for the chemical concentration must be >= 0.0. +Nspecies) where Nspecies is set by the atom_style command. The value for +the chemical concentration must be >= 0.0. + +Keyword *epsilon* sets the dielectric constant of a particle, precisely +of the medium where the particle resides as defined by the DIELECTRIC +package. Currently, only :doc:`atom_style dielectric ` +defines particles with this attribute. The value for the dielectric +constant must be >= 0.0. Note that the set command with this keyword +will rescale the particle charge accordingly so that the real charge +(e.g., as read from a data file) stays intact. To change the real +charges, one needs to use the set command with the *charge* +keyword. Care must be taken to ensure that the real and scaled charges, +and dielectric constants are consistent. Keywords *i_name*, *d_name*, *i2_name*, *d2_name* refer to custom per-atom integer and floating-point vectors or arrays that have been diff --git a/doc/src/thermo_modify.rst b/doc/src/thermo_modify.rst index e209dd937b..ffdbf020a1 100644 --- a/doc/src/thermo_modify.rst +++ b/doc/src/thermo_modify.rst @@ -21,9 +21,14 @@ Syntax *norm* value = *yes* or *no* *flush* value = *yes* or *no* *line* value = *one* or *multi* or *yaml* - *format* values = *line* string, *int* string, *float* string, M string, or *none* + *colname* values = ID string, or *default* + string = new column header name + ID = integer from 1 to N, or integer from -1 to -N, where N = # of quantities being output + *or* a thermo keyword or reference to compute, fix, property or variable. + *format* values = *line* string, *int* string, *float* string, ID string, or *none* string = C-style format string - M = integer from 1 to N, where N = # of quantities being output + ID = integer from 1 to N, or integer from -1 to -N, where N = # of quantities being output + *or* a thermo keyword or reference to compute, fix, property or variable. *temp* value = compute ID that calculates a temperature *press* value = compute ID that calculates a pressure @@ -36,7 +41,8 @@ Examples thermo_modify temp myTemp format 3 %15.8g thermo_modify temp myTemp format line "%ld %g %g %15.8g" thermo_modify line multi format float %g - themos_modify line yaml format none + thermo_modify line yaml format none + thermo_modify colname 1 Timestep colname -2 Pressure colname f_1[1] AvgDensity Description """"""""""" @@ -147,6 +153,20 @@ containing the timestep and CPU time ("multi"), or in a YAML format block ("yaml"). This modify option overrides the *one*, *multi*, or *yaml* thermo_style settings. +The *colname* keyword can be used to change the default header keyword +for a column or field of thermodynamic output. The setting for *ID +string* replaces the default text with the provided string. *ID* can be +a positive integer when it represents the column number counting from +the left, a negative integer when it represents the column number from +the right (i.e. -1 is the last column/keyword), or a thermo keyword (or +compute, fix, property, or variable reference) and then it replaces the +string for that specific thermo keyword. + +The *colname* keyword can be used multiple times. If multiple *colname* +settings refer to the same keyword, the last setting has precedence. A +setting of *default* clears all previous settings, reverting all values +to their default values. + The *format* keyword can be used to change the default numeric format of any of quantities the :doc:`thermo_style ` command outputs. All the specified format strings are C-style formats, e.g. as @@ -155,12 +175,16 @@ argument which is the format string for the entire line of thermo output, with N fields, which you must enclose in quotes if it is more than one field. The *int* and *float* keywords take a single format argument and are applied to all integer or floating-point quantities -output. The setting for *M string* also takes a single format argument -which is used for the Mth value output in each line, e.g. the fifth -column is output in high precision for "format 5 %20.15g". +output. The setting for *ID string* also takes a single format argument +which is used for the indexed value in each line. The interpretation is +the same as for *colname*, i.e. a positive integer is the n-th value +corresponding to the n-th thermo keyword, a negative integer is counting +backwards, and a string matches the entry with the thermo keyword., +e.g. the fifth column is output in high precision for "format 5 %20.15g" +and the pair energy for "format epair %20.15g". The *format* keyword can be used multiple times. The precedence is -that for each value in a line of output, the *M* format (if specified) +that for each value in a line of output, the *ID* format (if specified) is used, else the *int* or *float* setting (if specified) is used, else the *line* setting (if specified) for that value is used, else the default setting is used. A setting of *none* clears all previous @@ -173,9 +197,10 @@ settings, reverting all values to their default format. When specifying the *format int* option you can use a "%d"-style format identifier in the format string and LAMMPS will convert this to the corresponding 8-byte form when it is applied to those - keywords. However, when specifying the *line* option or *format M + keywords. However, when specifying the *line* option or *format ID string* option for *step* and *natoms*, you should specify a format - string appropriate for an 8-byte signed integer, e.g. one with "%ld". + string appropriate for an 8-byte signed integer, e.g. one with "%ld" + or "%lld" depending on the platform. The *temp* keyword is used to determine how thermodynamic temperature is calculated, which is used by all thermo quantities that require a diff --git a/doc/src/variable.rst b/doc/src/variable.rst index 25861ae17b..d0ad568cf1 100644 --- a/doc/src/variable.rst +++ b/doc/src/variable.rst @@ -65,8 +65,8 @@ Syntax bound(group,dir,region), gyration(group,region), ke(group,reigon), angmom(group,dim,region), torque(group,dim,region), inertia(group,dimdim,region), omega(group,dim,region) - special functions = sum(x), min(x), max(x), ave(x), trap(x), slope(x), gmask(x), rmask(x), grmask(x,y), next(x), is_file(name) - feature functions = is_available(category,feature), is_active(category,feature), is_defined(category,id) + special functions = sum(x), min(x), max(x), ave(x), trap(x), slope(x), gmask(x), rmask(x), grmask(x,y), next(x), is_file(name), extract_setting(name) + feature functions = is_active(category,feature), is_available(category,feature), is_defined(category,id) atom value = id[i], mass[i], type[i], mol[i], x[i], y[i], z[i], vx[i], vy[i], vz[i], fx[i], fy[i], fz[i], q[i] atom vector = id, mass, type, mol, x, y, z, vx, vy, vz, fx, fy, fz, q compute references = c_ID, c_ID[i], c_ID[i][j], C_ID, C_ID[i] @@ -823,10 +823,15 @@ Special Functions Special functions take specific kinds of arguments, meaning their arguments cannot be formulas themselves. -The is_file(x) function is a test whether 'x' is a (readable) file -and returns 1 in this case, otherwise it returns 0. For that 'x' +The is_file(name) function is a test whether *name* is a (readable) file +and returns 1 in this case, otherwise it returns 0. For that *name* is taken as a literal string and must not have any blanks in it. +The extract_setting(name) function allows to access some basic settings +through calling the :cpp:func:`lammps_extract_setting` library function. +For available keywords *name* and their meaning, please see the +documentation of that function. + The sum(x), min(x), max(x), ave(x), trap(x), and slope(x) functions each take 1 argument which is of the form "c_ID" or "c_ID[N]" or "f_ID" or "f_ID[N]" or "v_name". The first two are computes and the @@ -911,30 +916,30 @@ Feature Functions ----------------- Feature functions allow to probe the running LAMMPS executable for -whether specific features are either active, defined, or available. -The functions take two arguments, a *category* and a corresponding -*argument*\ . The arguments are strings thus cannot be formulas -themselves (only $-style immediate variable expansion is possible). +whether specific features are either active, defined, or available. The +functions take two arguments, a *category* and a corresponding +*argument*\ . The arguments are strings and thus cannot be formulas +themselves; only $-style immediate variable expansion is possible. Return value is either 1.0 or 0.0 depending on whether the function evaluates to true or false, respectively. -The *is_active()* function allows to query for active settings which -are grouped by categories. Currently supported categories and -arguments are: +The *is_active(category,feature)* function allows to query for active +settings which are grouped by categories. Currently supported categories +and arguments are: -* *package* (argument = *gpu* or *intel* or *kokkos* or *omp*\ ) -* *newton* (argument = *pair* or *bond* or *any*\ ) -* *pair* (argument = *single* or *respa* or *manybody* or *tail* or *shift*\ ) -* *comm_style* (argument = *brick* or *tiled*\ ) -* *min_style* (argument = any of the compiled in minimizer styles) -* *run_style* (argument = any of the compiled in run styles) -* *atom_style* (argument = any of the compiled in atom styles) -* *pair_style* (argument = any of the compiled in pair styles) -* *bond_style* (argument = any of the compiled in bond styles) -* *angle_style* (argument = any of the compiled in angle styles) -* *dihedral_style* (argument = any of the compiled in dihedral styles) -* *improper_style* (argument = any of the compiled in improper styles) -* *kspace_style* (argument = any of the compiled in kspace styles) +* *package*\ : argument = *gpu* or *intel* or *kokkos* or *omp* +* *newton*\ : argument = *pair* or *bond* or *any* +* *pair*\ : argument = *single* or *respa* or *manybody* or *tail* or *shift* +* *comm_style*\ : argument = *brick* or *tiled* +* *min_style*\ : argument = any of the compiled in minimizer styles +* *run_style*\ : argument = any of the compiled in run styles +* *atom_style*\ : argument = any of the compiled in atom style) +* *pair_style*\ : argument = any of the compiled in pair styles +* *bond_style*\ : argument = any of the compiled in bond styles +* *angle_style*\ : argument = any of the compiled in angle styles +* *dihedral_style*\ : argument = any of the compiled in dihedral styles +* *improper_style*\ : argument = any of the compiled in improper styles +* *kspace_style*\ : argument = any of the compiled in kspace styles Most of the settings are self-explanatory, the *single* argument in the *pair* category allows to check whether a pair style supports a @@ -943,7 +948,9 @@ features or LAMMPS, *respa* allows to check whether the inner/middle/outer mode of r-RESPA is supported. In the various style categories, the checking is also done using suffix flags, if available and enabled. -Example 1: disable use of suffix for pppm when using GPU package (i.e. run it on the CPU concurrently to running the pair style on the GPU), but do use the suffix otherwise (e.g. with OPENMP). +Example 1: disable use of suffix for pppm when using GPU package +(i.e. run it on the CPU concurrently to running the pair style on the +GPU), but do use the suffix otherwise (e.g. with OPENMP). .. code-block:: LAMMPS @@ -951,17 +958,15 @@ Example 1: disable use of suffix for pppm when using GPU package (i.e. run it on if $(is_active(package,gpu)) then "suffix off" kspace_style pppm -Example 2: use r-RESPA with inner/outer cutoff, if supported by pair style, otherwise fall back to using pair and reducing the outer time step +Example 2: use r-RESPA with inner/outer cutoff, if supported by pair +style, otherwise fall back to using pair and reducing the outer time +step .. code-block:: LAMMPS timestep $(2.0*(1.0+2.0*is_active(pair,respa)) if $(is_active(pair,respa)) then "run_style respa 4 3 2 2 improper 1 inner 2 5.5 7.0 outer 3 kspace 4" else "run_style respa 3 3 2 improper 1 pair 2 kspace 3" -The *is_defined()* function allows to query categories like *compute*, -*dump*, *fix*, *group*, *region*, and *variable* whether an entry -with the provided name or id is defined. - The *is_available(category,name)* function allows to query whether a specific optional feature is available, i.e. compiled in. This currently works for the following categories: *command*, @@ -983,6 +988,10 @@ the compiled binary supports it. if "$(is_available(feature,ffmpeg)" then "dump 3 all movie 25 movie.mp4 type type zoom 1.6 adiam 1.0" +The *is_defined(categoy,id)* function allows to query categories like +*compute*, *dump*, *fix*, *group*, *region*, and *variable* whether an +entry with the provided name or id is defined. + ---------- Atom Values and Vectors diff --git a/doc/utils/requirements.txt b/doc/utils/requirements.txt index 9797d4d119..1f5711dd6b 100644 --- a/doc/utils/requirements.txt +++ b/doc/utils/requirements.txt @@ -5,3 +5,4 @@ sphinx_tabs breathe Pygments six +pyyaml diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 2b7716bbe7..ee183a5877 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -328,6 +328,8 @@ boxzlo bp bpclermont bpls +bpm +BPM br Branduardi Branicio @@ -1149,8 +1151,10 @@ gdot GeC Geier gencode +Geocomputing georg Georg +Geotechnica germain Germann Germano @@ -1180,6 +1184,7 @@ Gladky gld gle globbing +Gloor Glosli Glotzer gmail @@ -1319,6 +1324,7 @@ Holm holonomic Homebrew hooke +hookean Hookean hostname hotpink @@ -1417,6 +1423,7 @@ initializations InitiatorIDs initio InP +inq inregion instantiation Institut @@ -1428,6 +1435,7 @@ interal interatomic Interatomic interconvert +interfacial interial interlayer intermolecular @@ -1738,6 +1746,7 @@ libdl libfftw libgcc libgpu +libinqmdi libjpeg libkim liblammps @@ -1752,6 +1761,7 @@ libplumed libplumedKernel libpng libpoems +libqemdi libqmmm librar libreax @@ -1787,6 +1797,7 @@ Liu Livermore lj llammps +lld LLVM lm lmp @@ -2068,6 +2079,7 @@ monopole monovalent Montalenti Montero +Mora Morefoo Morfill Mori @@ -2197,6 +2209,7 @@ Nbin Nbins nbody Nbody +nbond nbonds nbondtype Nbondtype @@ -2205,6 +2218,7 @@ Nbondtypes nBOt nbrhood Nbtypes +Nbytes nc Nc nchunk @@ -3167,6 +3181,7 @@ Steinhauser Stepaniants stepwise Stesmans +stiffnesses Stillinger stk stochastically diff --git a/examples/COUPLE/README b/examples/COUPLE/README index a7053ade2f..d1e8f01c60 100644 --- a/examples/COUPLE/README +++ b/examples/COUPLE/README @@ -9,6 +9,11 @@ model a realistic problem. In many of the examples included here, LAMMPS must first be built as a library. +Also see the Howto_mdi doc page in the LAMMPS manual for a description +of how LAMMPS can be coupled to other codes in a client/server fashion +using the MDI Library created by the MolSSI consortium. The MDI +package in LAMMPS has support for this style of code coupling. + See these sections of the LAMMPS manual for details: Build LAMMPS as a library (doc/html/Build_basics.html) @@ -28,15 +33,9 @@ These are the sub-directories included in this directory: simple simple example of driver code calling LAMMPS as a lib multiple example of driver code calling multiple instances of LAMMPS plugin example for loading LAMMPS at runtime from a shared library -lammps_mc client/server coupling of Monte Carlo client - with LAMMPS server for energy evaluation -lammps_nwchem client/server coupling of LAMMPS client with - NWChem quantum DFT as server for quantum forces 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 -lammps_vasp client/server coupling of LAMMPS client with - VASP quantum DFT as server for quantum forces library collection of useful inter-code communication routines fortran a simple wrapper on the LAMMPS library API that can be called from Fortran diff --git a/examples/COUPLE/lammps_mc/Makefile b/examples/COUPLE/lammps_mc/Makefile deleted file mode 100644 index c75bd08c73..0000000000 --- a/examples/COUPLE/lammps_mc/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -# Makefile for MC - -SHELL = /bin/sh - -SRC = mc.cpp random_park.cpp -OBJ = $(SRC:.cpp=.o) - -# change this line for your machine to path for CSlib src dir - -CSLIB = /home/sjplimp/lammps/lib/message/cslib/src - -# compiler/linker settings - -CC = g++ -CCFLAGS = -g -O3 -I$(CSLIB) -LINK = g++ -LINKFLAGS = -g -O -L$(CSLIB) - -# targets - -mc: $(OBJ) -# first line if built the CSlib within lib/message with ZMQ support -# second line if built the CSlib without ZMQ support - $(LINK) $(LINKFLAGS) $(OBJ) -lcsnompi -lzmq -o mc -# $(LINK) $(LINKFLAGS) $(OBJ) -lcsnompi -o mc - -clean: - @rm -f *.o mc - -# rules - -%.o:%.cpp - $(CC) $(CCFLAGS) -c $< diff --git a/examples/COUPLE/lammps_mc/README b/examples/COUPLE/lammps_mc/README deleted file mode 100644 index 4aed39dc8e..0000000000 --- a/examples/COUPLE/lammps_mc/README +++ /dev/null @@ -1,128 +0,0 @@ -Sample Monte Carlo (MC) wrapper on LAMMPS via client/server coupling - -See the MESSAGE package documentation Build_extras.html#message -and Build_extras.html#message for more details on how client/server -coupling works in LAMMPS. - -In this dir, the mc.cpp/h files are a standalone "client" MC code. It -should be run on a single processor, though it could become a parallel -program at some point. LAMMPS is also run as a standalone executable -as a "server" on as many processors as desired using its "server mc" -command; see it's doc page for details. - -Messages are exchanged between MC and LAMMPS via a client/server -library (CSlib), which is included in the LAMMPS distribution in -lib/message. As explained below you can choose to exchange data -between the two programs either via files or sockets (ZMQ). If the MC -program became parallel, data could also be exchanged via MPI. - -The MC code makes simple MC moves, by displacing a single random atom -by a small random amount. It uses LAMMPS to calculate the energy -change, and to run dynamics between MC moves. - ----------------- - -Build LAMMPS with its MESSAGE package installed: - -See the Build extras doc page and its MESSAGE package -section for details. - -CMake: - --D PKG_MESSAGE=yes # include the MESSAGE package --D MESSAGE_ZMQ=value # build with ZeroMQ support, value = no (default) or yes - -Traditional make: - -% cd lammps/lib/message -% python Install.py -m -z # build CSlib with MPI and ZMQ support -% cd lammps/src -% make yes-message -% make mpi - -You can leave off the -z if you do not have ZMQ on your system. - ----------------- - -Build the MC client code - -The source files for the MC code are in this dir. It links with the -CSlib library in lib/message/cslib. - -You must first build the CSlib in serial mode, e.g. - -% cd lammps/lib/message/cslib/src -% make lib # build serial and parallel lib with ZMQ support -% make lib zmq=no # build serial and parallel lib without ZMQ support - -Then edit the Makefile in this dir. The CSLIB variable should be the -path to where the LAMMPS lib/message/cslib/src dir is on your system. -If you built the CSlib without ZMQ support you will also need to -comment/uncomment one line. Then you can just type - -% make - -and you should get an "mc" executable. - ----------------- - -To run in client/server mode: - -Both the client (MC) and server (LAMMPS) must use the same messaging -mode, namely file or zmq. This is an argument to the MC code; it can -be selected by setting the "mode" variable when you run LAMMPS. The -default mode = file. - -Here we assume LAMMPS was built to run in parallel, and the MESSAGE -package was installed with socket (ZMQ) support. This means either of -the messaging modes can be used and LAMMPS can be run in serial or -parallel. The MC code is always run in serial. - -When you run, the server should print out thermodynamic info -for every MD run it performs (between MC moves). The client -will print nothing until the simulation ends, then it will -print stats about the accepted MC moves. - -The examples below are commands you should use in two different -terminal windows. The order of the two commands (client or server -launch) does not matter. You can run them both in the same window if -you append a "&" character to the first one to run it in the -background. - --------------- - -File mode of messaging: - -% mpirun -np 1 mc in.mc file tmp.couple -% mpirun -np 1 lmp_mpi -v mode file -in in.mc.server - -% mpirun -np 1 mc in.mc file tmp.couple -% mpirun -np 4 lmp_mpi -v mode file -in in.mc.server - -ZMQ mode of messaging: - -% mpirun -np 1 mc in.mc zmq localhost:5555 -% mpirun -np 1 lmp_mpi -v mode zmq -in in.mc.server - -% mpirun -np 1 mc in.mc zmq localhost:5555 -% mpirun -np 4 lmp_mpi -v mode zmq -in in.mc.server - --------------- - -The input script for the MC program is in.mc. You can edit it to run -longer simulations. - -500 nsteps = total # of steps of MD -100 ndynamics = # of MD steps between MC moves -0.1 delta = displacement size of MC move -1.0 temperature = used in MC Boltzman factor -12345 seed = random number seed - --------------- - -The problem size that LAMMPS is computing the MC energy for and -running dynamics on is set by the x,y,z variables in the LAMMPS -in.mc.server script. The default size is 500 particles. You can -adjust the size as follows: - -lmp_mpi -v x 10 -v y 10 -v z 20 # 8000 particles diff --git a/examples/COUPLE/lammps_mc/in.mc b/examples/COUPLE/lammps_mc/in.mc deleted file mode 100644 index 85052d09f1..0000000000 --- a/examples/COUPLE/lammps_mc/in.mc +++ /dev/null @@ -1,7 +0,0 @@ -# MC params - -500 nsteps -100 ndynamics -0.1 delta -1.0 temperature -12345 seed diff --git a/examples/COUPLE/lammps_mc/in.mc.server b/examples/COUPLE/lammps_mc/in.mc.server deleted file mode 100644 index 8b10bb0f7b..0000000000 --- a/examples/COUPLE/lammps_mc/in.mc.server +++ /dev/null @@ -1,36 +0,0 @@ -# 3d Lennard-Jones Monte Carlo server script - -variable mode index file - -if "${mode} == file" then & - "message server mc file tmp.couple" & -elif "${mode} == zmq" & - "message server mc zmq *:5555" & - -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -region box block 0 $x 0 $y 0 $z -create_box 1 box -create_atoms 1 box -mass 1 1.0 - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 20 check no - -velocity all create 1.44 87287 loop geom - -fix 1 all nve - -thermo 50 - -server mc diff --git a/examples/COUPLE/lammps_mc/log.28Aug18.file.g++.1 b/examples/COUPLE/lammps_mc/log.28Aug18.file.g++.1 deleted file mode 100644 index 0d67c89cf1..0000000000 --- a/examples/COUPLE/lammps_mc/log.28Aug18.file.g++.1 +++ /dev/null @@ -1,254 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones Monte Carlo server script - -variable mode index file - -if "${mode} == file" then "message server mc file tmp.couple" elif "${mode} == zmq" "message server mc zmq *:5555" -message server mc file tmp.couple -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000649929 secs -mass 1 1.0 - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 20 check no - -velocity all create 1.44 87287 loop geom - -fix 1 all nve - -thermo 50 - -server mc -run 0 -Neighbor list info ... - update every 20 steps, delay 0 steps, check no - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7733681 0 -4.6176881 -5.0221006 -Loop time of 2.14577e-06 on 1 procs for 0 steps with 500 atoms - -93.2% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 2.146e-06 | | |100.00 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1956 ave 1956 max 1956 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 19500 ave 19500 max 19500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 19500 -Ave neighs/atom = 39 -Neighbor list builds = 0 -Dangerous builds not checked -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7723127 0 -4.6166327 -5.015531 -Loop time of 2.14577e-06 on 1 procs for 0 steps with 500 atoms - -93.2% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 2.146e-06 | | |100.00 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1956 ave 1956 max 1956 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 19501 ave 19501 max 19501 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 19501 -Ave neighs/atom = 39.002 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7723127 0 -4.6166327 -5.015531 - 50 0.70239211 -5.6763152 0 -4.6248342 0.59544428 - 100 0.7565013 -5.757431 0 -4.6249485 0.21982657 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 0.7565013 -5.7565768 0 -4.6240944 0.22436405 -Loop time of 1.90735e-06 on 1 procs for 0 steps with 500 atoms - -157.3% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 1.907e-06 | | |100.00 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1939 ave 1939 max 1939 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 18757 ave 18757 max 18757 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 18757 -Ave neighs/atom = 37.514 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 0.7565013 -5.757431 0 -4.6249485 0.21982657 - 150 0.76110797 -5.7664315 0 -4.6270529 0.16005254 - 200 0.73505651 -5.7266069 0 -4.6262273 0.34189744 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 200 0.73505651 -5.7181381 0 -4.6177585 0.37629943 -Loop time of 2.14577e-06 on 1 procs for 0 steps with 500 atoms - -139.8% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 2.146e-06 | | |100.00 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1899 ave 1899 max 1899 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 18699 ave 18699 max 18699 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 18699 -Ave neighs/atom = 37.398 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 200 0.73505651 -5.7266069 0 -4.6262273 0.34189744 - 250 0.73052476 -5.7206316 0 -4.627036 0.39287516 - 300 0.76300831 -5.7675007 0 -4.6252773 0.16312925 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 300 0.76300831 -5.768304 0 -4.6260806 0.15954325 -Loop time of 2.14577e-06 on 1 procs for 0 steps with 500 atoms - -139.8% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 2.146e-06 | | |100.00 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1903 ave 1903 max 1903 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 18715 ave 18715 max 18715 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 18715 -Ave neighs/atom = 37.43 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 300 0.76300831 -5.768304 0 -4.6260806 0.15954325 - 350 0.72993309 -5.7193261 0 -4.6266162 0.3358374 - 400 0.72469448 -5.713463 0 -4.6285954 0.44859547 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 400 0.72469448 -5.7077332 0 -4.6228655 0.47669832 -Loop time of 1.90735e-06 on 1 procs for 0 steps with 500 atoms - -157.3% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 1.907e-06 | | |100.00 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1899 ave 1899 max 1899 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 18683 ave 18683 max 18683 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 18683 -Ave neighs/atom = 37.366 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 400 0.72469448 -5.713463 0 -4.6285954 0.44859547 - 450 0.75305735 -5.7518283 0 -4.6245015 0.34658587 - 500 0.73092571 -5.7206337 0 -4.6264379 0.43715809 -Total wall time: 0:00:02 diff --git a/examples/COUPLE/lammps_mc/log.28Aug18.file.g++.4 b/examples/COUPLE/lammps_mc/log.28Aug18.file.g++.4 deleted file mode 100644 index 2ae51d2461..0000000000 --- a/examples/COUPLE/lammps_mc/log.28Aug18.file.g++.4 +++ /dev/null @@ -1,254 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones Monte Carlo server script - -variable mode index file - -if "${mode} == file" then "message server mc file tmp.couple" elif "${mode} == zmq" "message server mc zmq *:5555" -message server mc file tmp.couple -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 2 by 2 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000592947 secs -mass 1 1.0 - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 20 check no - -velocity all create 1.44 87287 loop geom - -fix 1 all nve - -thermo 50 - -server mc -run 0 -Neighbor list info ... - update every 20 steps, delay 0 steps, check no - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7733681 0 -4.6176881 -5.0221006 -Loop time of 3.8147e-06 on 4 procs for 0 steps with 500 atoms - -59.0% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 3.815e-06 | | |100.00 - -Nlocal: 125 ave 125 max 125 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Nghost: 1099 ave 1099 max 1099 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Neighs: 4875 ave 4875 max 4875 min -Histogram: 4 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 19500 -Ave neighs/atom = 39 -Neighbor list builds = 0 -Dangerous builds not checked -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7723127 0 -4.6166327 -5.015531 -Loop time of 3.03984e-06 on 4 procs for 0 steps with 500 atoms - -106.9% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 3.04e-06 | | |100.00 - -Nlocal: 125 ave 125 max 125 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Nghost: 1099 ave 1099 max 1099 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Neighs: 4875.25 ave 4885 max 4866 min -Histogram: 1 0 0 0 2 0 0 0 0 1 - -Total # of neighbors = 19501 -Ave neighs/atom = 39.002 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7723127 0 -4.6166327 -5.015531 - 50 0.70210225 -5.6759068 0 -4.6248598 0.59609192 - 100 0.75891559 -5.7611234 0 -4.6250267 0.20841608 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 0.75891559 -5.7609392 0 -4.6248426 0.20981291 -Loop time of 3.75509e-06 on 4 procs for 0 steps with 500 atoms - -113.2% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 3.755e-06 | | |100.00 - -Nlocal: 125 ave 126 max 124 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 1085.25 ave 1089 max 1079 min -Histogram: 1 0 0 0 0 1 0 0 0 2 -Neighs: 4690.25 ave 4996 max 4401 min -Histogram: 1 0 0 1 0 1 0 0 0 1 - -Total # of neighbors = 18761 -Ave neighs/atom = 37.522 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 0.75891559 -5.7609392 0 -4.6248426 0.20981291 - 150 0.75437991 -5.7558622 0 -4.6265555 0.20681722 - 200 0.73111257 -5.7193748 0 -4.6248993 0.35230715 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 200 0.73111257 -5.7143906 0 -4.6199151 0.37126023 -Loop time of 2.563e-06 on 4 procs for 0 steps with 500 atoms - -117.1% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 2.563e-06 | | |100.00 - -Nlocal: 125 ave 126 max 123 min -Histogram: 1 0 0 0 0 0 1 0 0 2 -Nghost: 1068.5 ave 1076 max 1063 min -Histogram: 2 0 0 0 0 0 1 0 0 1 -Neighs: 4674.75 ave 4938 max 4419 min -Histogram: 1 0 0 0 1 1 0 0 0 1 - -Total # of neighbors = 18699 -Ave neighs/atom = 37.398 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 200 0.73111257 -5.7193748 0 -4.6248993 0.35230715 - 250 0.73873144 -5.7312505 0 -4.6253696 0.33061033 - 300 0.76392796 -5.7719207 0 -4.6283206 0.18197874 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 300 0.76392796 -5.7725589 0 -4.6289588 0.17994628 -Loop time of 3.99351e-06 on 4 procs for 0 steps with 500 atoms - -93.9% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 3.994e-06 | | |100.00 - -Nlocal: 125 ave 128 max 121 min -Histogram: 1 0 0 0 0 1 0 1 0 1 -Nghost: 1069 ave 1080 max 1055 min -Histogram: 1 0 0 0 0 0 2 0 0 1 -Neighs: 4672 ave 4803 max 4600 min -Histogram: 2 0 0 1 0 0 0 0 0 1 - -Total # of neighbors = 18688 -Ave neighs/atom = 37.376 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 300 0.76392796 -5.7725589 0 -4.6289588 0.17994628 - 350 0.71953041 -5.7041632 0 -4.6270261 0.44866153 - 400 0.7319047 -5.7216051 0 -4.6259438 0.46321355 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 400 0.7319047 -5.7158168 0 -4.6201554 0.49192039 -Loop time of 3.57628e-06 on 4 procs for 0 steps with 500 atoms - -111.8% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 3.576e-06 | | |100.00 - -Nlocal: 125 ave 132 max 118 min -Histogram: 1 0 0 0 0 2 0 0 0 1 -Nghost: 1057.5 ave 1068 max 1049 min -Histogram: 1 0 0 1 1 0 0 0 0 1 -Neighs: 4685.75 ave 5045 max 4229 min -Histogram: 1 0 0 1 0 0 0 0 0 2 - -Total # of neighbors = 18743 -Ave neighs/atom = 37.486 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 400 0.7319047 -5.7216051 0 -4.6259438 0.46321355 - 450 0.74503154 -5.7405318 0 -4.6252196 0.33211879 - 500 0.70570501 -5.6824439 0 -4.6260035 0.62020788 -Total wall time: 0:00:02 diff --git a/examples/COUPLE/lammps_mc/log.28Aug18.zmq.g++.1 b/examples/COUPLE/lammps_mc/log.28Aug18.zmq.g++.1 deleted file mode 100644 index 0565487bc6..0000000000 --- a/examples/COUPLE/lammps_mc/log.28Aug18.zmq.g++.1 +++ /dev/null @@ -1,254 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones Monte Carlo server script - -variable mode index file - -if "${mode} == file" then "message server mc file tmp.couple" elif "${mode} == zmq" "message server mc zmq *:5555" -message server mc zmq *:5555 -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000741005 secs -mass 1 1.0 - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 20 check no - -velocity all create 1.44 87287 loop geom - -fix 1 all nve - -thermo 50 - -server mc -run 0 -Neighbor list info ... - update every 20 steps, delay 0 steps, check no - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7733681 0 -4.6176881 -5.0221006 -Loop time of 1.90735e-06 on 1 procs for 0 steps with 500 atoms - -52.4% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 1.907e-06 | | |100.00 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1956 ave 1956 max 1956 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 19500 ave 19500 max 19500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 19500 -Ave neighs/atom = 39 -Neighbor list builds = 0 -Dangerous builds not checked -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7723127 0 -4.6166327 -5.015531 -Loop time of 1.90735e-06 on 1 procs for 0 steps with 500 atoms - -52.4% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 1.907e-06 | | |100.00 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1956 ave 1956 max 1956 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 19501 ave 19501 max 19501 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 19501 -Ave neighs/atom = 39.002 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7723127 0 -4.6166327 -5.015531 - 50 0.70239211 -5.6763152 0 -4.6248342 0.59544428 - 100 0.7565013 -5.757431 0 -4.6249485 0.21982657 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 0.7565013 -5.7565768 0 -4.6240944 0.22436405 -Loop time of 1.19209e-06 on 1 procs for 0 steps with 500 atoms - -83.9% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 1.192e-06 | | |100.00 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1939 ave 1939 max 1939 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 18757 ave 18757 max 18757 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 18757 -Ave neighs/atom = 37.514 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 0.7565013 -5.757431 0 -4.6249485 0.21982657 - 150 0.76110797 -5.7664315 0 -4.6270529 0.16005254 - 200 0.73505651 -5.7266069 0 -4.6262273 0.34189744 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 200 0.73505651 -5.7181381 0 -4.6177585 0.37629943 -Loop time of 9.53674e-07 on 1 procs for 0 steps with 500 atoms - -209.7% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 9.537e-07 | | |100.00 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1899 ave 1899 max 1899 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 18699 ave 18699 max 18699 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 18699 -Ave neighs/atom = 37.398 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 200 0.73505651 -5.7266069 0 -4.6262273 0.34189744 - 250 0.73052476 -5.7206316 0 -4.627036 0.39287516 - 300 0.76300831 -5.7675007 0 -4.6252773 0.16312925 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 300 0.76300831 -5.768304 0 -4.6260806 0.15954325 -Loop time of 9.53674e-07 on 1 procs for 0 steps with 500 atoms - -104.9% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 9.537e-07 | | |100.00 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1903 ave 1903 max 1903 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 18715 ave 18715 max 18715 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 18715 -Ave neighs/atom = 37.43 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 300 0.76300831 -5.768304 0 -4.6260806 0.15954325 - 350 0.72993309 -5.7193261 0 -4.6266162 0.3358374 - 400 0.72469448 -5.713463 0 -4.6285954 0.44859547 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 400 0.72469448 -5.7077332 0 -4.6228655 0.47669832 -Loop time of 9.53674e-07 on 1 procs for 0 steps with 500 atoms - -209.7% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 9.537e-07 | | |100.00 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1899 ave 1899 max 1899 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 18683 ave 18683 max 18683 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 18683 -Ave neighs/atom = 37.366 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.658 | 2.658 | 2.658 Mbytes -Step Temp E_pair E_mol TotEng Press - 400 0.72469448 -5.713463 0 -4.6285954 0.44859547 - 450 0.75305735 -5.7518283 0 -4.6245015 0.34658587 - 500 0.73092571 -5.7206337 0 -4.6264379 0.43715809 -Total wall time: 0:00:00 diff --git a/examples/COUPLE/lammps_mc/log.28Aug18.zmq.g++.4 b/examples/COUPLE/lammps_mc/log.28Aug18.zmq.g++.4 deleted file mode 100644 index e74d03235d..0000000000 --- a/examples/COUPLE/lammps_mc/log.28Aug18.zmq.g++.4 +++ /dev/null @@ -1,254 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones Monte Carlo server script - -variable mode index file - -if "${mode} == file" then "message server mc file tmp.couple" elif "${mode} == zmq" "message server mc zmq *:5555" -message server mc zmq *:5555 -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 2 by 2 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000576019 secs -mass 1 1.0 - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 20 check no - -velocity all create 1.44 87287 loop geom - -fix 1 all nve - -thermo 50 - -server mc -run 0 -Neighbor list info ... - update every 20 steps, delay 0 steps, check no - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7733681 0 -4.6176881 -5.0221006 -Loop time of 4.76837e-06 on 4 procs for 0 steps with 500 atoms - -89.1% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 4.768e-06 | | |100.00 - -Nlocal: 125 ave 125 max 125 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Nghost: 1099 ave 1099 max 1099 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Neighs: 4875 ave 4875 max 4875 min -Histogram: 4 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 19500 -Ave neighs/atom = 39 -Neighbor list builds = 0 -Dangerous builds not checked -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7723127 0 -4.6166327 -5.015531 -Loop time of 3.45707e-06 on 4 procs for 0 steps with 500 atoms - -94.0% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 3.457e-06 | | |100.00 - -Nlocal: 125 ave 125 max 125 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Nghost: 1099 ave 1099 max 1099 min -Histogram: 4 0 0 0 0 0 0 0 0 0 -Neighs: 4875.25 ave 4885 max 4866 min -Histogram: 1 0 0 0 2 0 0 0 0 1 - -Total # of neighbors = 19501 -Ave neighs/atom = 39.002 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7723127 0 -4.6166327 -5.015531 - 50 0.70210225 -5.6759068 0 -4.6248598 0.59609192 - 100 0.75891559 -5.7611234 0 -4.6250267 0.20841608 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 0.75891559 -5.7609392 0 -4.6248426 0.20981291 -Loop time of 3.03984e-06 on 4 procs for 0 steps with 500 atoms - -115.1% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 3.04e-06 | | |100.00 - -Nlocal: 125 ave 126 max 124 min -Histogram: 2 0 0 0 0 0 0 0 0 2 -Nghost: 1085.25 ave 1089 max 1079 min -Histogram: 1 0 0 0 0 1 0 0 0 2 -Neighs: 4690.25 ave 4996 max 4401 min -Histogram: 1 0 0 1 0 1 0 0 0 1 - -Total # of neighbors = 18761 -Ave neighs/atom = 37.522 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 100 0.75891559 -5.7609392 0 -4.6248426 0.20981291 - 150 0.75437991 -5.7558622 0 -4.6265555 0.20681722 - 200 0.73111257 -5.7193748 0 -4.6248993 0.35230715 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 200 0.73111257 -5.7143906 0 -4.6199151 0.37126023 -Loop time of 2.38419e-06 on 4 procs for 0 steps with 500 atoms - -125.8% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 2.384e-06 | | |100.00 - -Nlocal: 125 ave 126 max 123 min -Histogram: 1 0 0 0 0 0 1 0 0 2 -Nghost: 1068.5 ave 1076 max 1063 min -Histogram: 2 0 0 0 0 0 1 0 0 1 -Neighs: 4674.75 ave 4938 max 4419 min -Histogram: 1 0 0 0 1 1 0 0 0 1 - -Total # of neighbors = 18699 -Ave neighs/atom = 37.398 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 200 0.73111257 -5.7193748 0 -4.6248993 0.35230715 - 250 0.73873144 -5.7312505 0 -4.6253696 0.33061033 - 300 0.76392796 -5.7719207 0 -4.6283206 0.18197874 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 300 0.76392796 -5.7725589 0 -4.6289588 0.17994628 -Loop time of 2.44379e-06 on 4 procs for 0 steps with 500 atoms - -112.5% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 2.444e-06 | | |100.00 - -Nlocal: 125 ave 128 max 121 min -Histogram: 1 0 0 0 0 1 0 1 0 1 -Nghost: 1069 ave 1080 max 1055 min -Histogram: 1 0 0 0 0 0 2 0 0 1 -Neighs: 4672 ave 4803 max 4600 min -Histogram: 2 0 0 1 0 0 0 0 0 1 - -Total # of neighbors = 18688 -Ave neighs/atom = 37.376 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 300 0.76392796 -5.7725589 0 -4.6289588 0.17994628 - 350 0.71953041 -5.7041632 0 -4.6270261 0.44866153 - 400 0.7319047 -5.7216051 0 -4.6259438 0.46321355 -run 0 -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 400 0.7319047 -5.7158168 0 -4.6201554 0.49192039 -Loop time of 2.14577e-06 on 4 procs for 0 steps with 500 atoms - -139.8% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 0 | 0 | 0 | 0.0 | 0.00 -Output | 0 | 0 | 0 | 0.0 | 0.00 -Modify | 0 | 0 | 0 | 0.0 | 0.00 -Other | | 2.146e-06 | | |100.00 - -Nlocal: 125 ave 132 max 118 min -Histogram: 1 0 0 0 0 2 0 0 0 1 -Nghost: 1057.5 ave 1068 max 1049 min -Histogram: 1 0 0 1 1 0 0 0 0 1 -Neighs: 4685.75 ave 5045 max 4229 min -Histogram: 1 0 0 1 0 0 0 0 0 2 - -Total # of neighbors = 18743 -Ave neighs/atom = 37.486 -Neighbor list builds = 0 -Dangerous builds not checked -Per MPI rank memory allocation (min/avg/max) = 2.619 | 2.619 | 2.619 Mbytes -Step Temp E_pair E_mol TotEng Press - 400 0.7319047 -5.7216051 0 -4.6259438 0.46321355 - 450 0.74503154 -5.7405318 0 -4.6252196 0.33211879 - 500 0.70570501 -5.6824439 0 -4.6260035 0.62020788 -Total wall time: 0:00:00 diff --git a/examples/COUPLE/lammps_mc/mc.cpp b/examples/COUPLE/lammps_mc/mc.cpp deleted file mode 100644 index 27d356f264..0000000000 --- a/examples/COUPLE/lammps_mc/mc.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov -------------------------------------------------------------------------- */ - -// MC code used with LAMMPS in client/server mode -// MC is the client, LAMMPS is the server - -// Syntax: mc infile mode modearg -// mode = file, zmq -// modearg = filename for file, localhost:5555 for zmq - -#include -#include -#include -#include -#include "mc.h" -#include "random_park.h" - -#include "cslib.h" -using namespace CSLIB_NS; - -void error(const char *); -CSlib *cs_create(char *, char *); - -#define MAXLINE 256 - -/* ---------------------------------------------------------------------- */ - -// main program - -int main(int narg, char **arg) -{ - if (narg != 4) { - error("Syntax: mc infile mode modearg"); - exit(1); - } - - // initialize CSlib - - CSlib *cs = cs_create(arg[2],arg[3]); - - // create MC class and perform run - - MC *mc = new MC(arg[1],cs); - mc->run(); - - // final MC stats - - int naccept = mc->naccept; - int nattempt = mc->nattempt; - - printf("------ MC stats ------\n"); - printf("MC attempts = %d\n",nattempt); - printf("MC accepts = %d\n",naccept); - printf("Acceptance ratio = %g\n",1.0*naccept/nattempt); - - // clean up - - delete cs; - delete mc; -} - -/* ---------------------------------------------------------------------- */ - -void error(const char *str) -{ - printf("ERROR: %s\n",str); - exit(1); -} - -/* ---------------------------------------------------------------------- */ - -CSlib *cs_create(char *mode, char *arg) -{ - CSlib *cs = new CSlib(0,mode,arg,NULL); - - // initial handshake to agree on protocol - - cs->send(0,1); - cs->pack_string(1,(char *) "mc"); - - int msgID,nfield; - int *fieldID,*fieldtype,*fieldlen; - msgID = cs->recv(nfield,fieldID,fieldtype,fieldlen); - - return cs; -} - -// ---------------------------------------------------------------------- -// MC class -// ---------------------------------------------------------------------- - -MC::MC(char *mcfile, void *cs_caller) -//MC::MC(char *mcfile, CSlib *cs_caller) -{ - cs_void = cs_caller; - - // setup MC params - - options(mcfile); - - // random # generator - - random = new RanPark(seed); -} - -/* ---------------------------------------------------------------------- */ - -MC::~MC() -{ - free(x); - delete random; -} - -/* ---------------------------------------------------------------------- */ - -void MC::run() -{ - int iatom,accept,msgID,nfield; - double pe_initial,pe_final,edelta; - double dx,dy,dz; - double xold[3],xnew[3]; - int *fieldID,*fieldtype,*fieldlen; - - enum{NATOMS=1,EINIT,DISPLACE,ACCEPT,RUN}; - - CSlib *cs = (CSlib *) cs_void; - - // one-time request for atom count from MD - // allocate 1d coord buffer - - cs->send(NATOMS,0); - - msgID = cs->recv(nfield,fieldID,fieldtype,fieldlen); - natoms = cs->unpack_int(1); - - x = (double *) malloc(3*natoms*sizeof(double)); - - // loop over MC moves - - naccept = nattempt = 0; - - for (int iloop = 0; iloop < nloop; iloop++) { - - // request current energy from MD - // recv energy, coords from MD - - cs->send(EINIT,0); - - msgID = cs->recv(nfield,fieldID,fieldtype,fieldlen); - pe_initial = cs->unpack_double(1); - double *x = (double *) cs->unpack(2); - - // perform simple MC event - // displace a single atom by random amount - - iatom = (int) natoms*random->uniform(); - xold[0] = x[3*iatom+0]; - xold[1] = x[3*iatom+1]; - xold[2] = x[3*iatom+2]; - - dx = 2.0*delta*random->uniform() - delta; - dy = 2.0*delta*random->uniform() - delta; - dz = 2.0*delta*random->uniform() - delta; - - xnew[0] = xold[0] + dx; - xnew[1] = xold[1] + dx; - xnew[2] = xold[2] + dx; - - // send atom ID and its new coords to MD - // recv new energy - - cs->send(DISPLACE,2); - cs->pack_int(1,iatom+1); - cs->pack(2,4,3,xnew); - - msgID = cs->recv(nfield,fieldID,fieldtype,fieldlen); - pe_final = cs->unpack_double(1); - - // decide whether to accept/reject MC event - - if (pe_final <= pe_initial) accept = 1; - else if (temperature == 0.0) accept = 0; - else if (random->uniform() > - exp(natoms*(pe_initial-pe_final)/temperature)) accept = 0; - else accept = 1; - - nattempt++; - if (accept) naccept++; - - // send accept (1) or reject (0) flag to MD - - cs->send(ACCEPT,1); - cs->pack_int(1,accept); - - msgID = cs->recv(nfield,fieldID,fieldtype,fieldlen); - - // send dynamics timesteps - - cs->send(RUN,1); - cs->pack_int(1,ndynamics); - - msgID = cs->recv(nfield,fieldID,fieldtype,fieldlen); - } - - // send exit message to MD - - cs->send(-1,0); - msgID = cs->recv(nfield,fieldID,fieldtype,fieldlen); -} - -/* ---------------------------------------------------------------------- */ - -void MC::options(char *filename) -{ - // default params - - nsteps = 0; - ndynamics = 100; - delta = 0.1; - temperature = 1.0; - seed = 12345; - - // read and parse file - - FILE *fp = fopen(filename,"r"); - if (fp == NULL) error("Could not open MC file"); - - char line[MAXLINE]; - char *keyword,*value; - char *eof = fgets(line,MAXLINE,fp); - - while (eof) { - if (line[0] == '#') { // comment line - eof = fgets(line,MAXLINE,fp); - continue; - } - - value = strtok(line," \t\n\r\f"); - if (value == NULL) { // blank line - eof = fgets(line,MAXLINE,fp); - continue; - } - - keyword = strtok(NULL," \t\n\r\f"); - if (keyword == NULL) error("Missing keyword in MC file"); - - if (strcmp(keyword,"nsteps") == 0) nsteps = atoi(value); - else if (strcmp(keyword,"ndynamics") == 0) ndynamics = atoi(value); - else if (strcmp(keyword,"delta") == 0) delta = atof(value); - else if (strcmp(keyword,"temperature") == 0) temperature = atof(value); - else if (strcmp(keyword,"seed") == 0) seed = atoi(value); - else error("Unknown param in MC file"); - - eof = fgets(line,MAXLINE,fp); - } - - // derived params - - nloop = nsteps/ndynamics; -} diff --git a/examples/COUPLE/lammps_mc/mc.h b/examples/COUPLE/lammps_mc/mc.h deleted file mode 100644 index fd3eff24f8..0000000000 --- a/examples/COUPLE/lammps_mc/mc.h +++ /dev/null @@ -1,40 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/ Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov -------------------------------------------------------------------------- */ - -#ifndef MC_H -#define MC_H - -/* ---------------------------------------------------------------------- */ - -class MC { - public: - int naccept; // # of accepted MC events - int nattempt; // # of attempted MC events - - MC(char *, void *); - ~MC(); - void run(); - - private: - int nsteps; // total # of MD steps - int ndynamics; // steps in one short dynamics run - int nloop; // nsteps/ndynamics - int natoms; // # of MD atoms - - double delta; // MC displacement distance - double temperature; // MC temperature for Boltzmann criterion - double *x; // atom coords as 3N 1d vector - double energy; // global potential energy - - int seed; // RNG seed - class RanPark *random; - - void *cs_void; // messaging library - - void options(char *); -}; - -#endif diff --git a/examples/COUPLE/lammps_mc/random_park.cpp b/examples/COUPLE/lammps_mc/random_park.cpp deleted file mode 100644 index 1c9018dee3..0000000000 --- a/examples/COUPLE/lammps_mc/random_park.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, 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. -------------------------------------------------------------------------- */ - -// Park/Miller RNG - -#include -#include "random_park.h" -//#include "error.h" - -#define IA 16807 -#define IM 2147483647 -#define AM (1.0/IM) -#define IQ 127773 -#define IR 2836 - -/* ---------------------------------------------------------------------- */ - -RanPark::RanPark(int seed_init) -{ - //if (seed_init <= 0) - // error->one(FLERR,"Invalid seed for Park random # generator"); - seed = seed_init; - save = 0; -} - -/* ---------------------------------------------------------------------- - uniform RN -------------------------------------------------------------------------- */ - -double RanPark::uniform() -{ - int k = seed/IQ; - seed = IA*(seed-k*IQ) - IR*k; - if (seed < 0) seed += IM; - double ans = AM*seed; - return ans; -} - -/* ---------------------------------------------------------------------- - gaussian RN -------------------------------------------------------------------------- */ - -double RanPark::gaussian() -{ - double first,v1,v2,rsq,fac; - - if (!save) { - do { - v1 = 2.0*uniform()-1.0; - v2 = 2.0*uniform()-1.0; - rsq = v1*v1 + v2*v2; - } while ((rsq >= 1.0) || (rsq == 0.0)); - fac = sqrt(-2.0*log(rsq)/rsq); - second = v1*fac; - first = v2*fac; - save = 1; - } else { - first = second; - save = 0; - } - return first; -} diff --git a/examples/COUPLE/lammps_mc/random_park.h b/examples/COUPLE/lammps_mc/random_park.h deleted file mode 100644 index c4dfa40ee4..0000000000 --- a/examples/COUPLE/lammps_mc/random_park.h +++ /dev/null @@ -1,28 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/ 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. -------------------------------------------------------------------------- */ - -#ifndef RANPARK_H -#define RANPARK_H - -class RanPark { - public: - RanPark(int); - double uniform(); - double gaussian(); - - private: - int seed,save; - double second; -}; - -#endif diff --git a/examples/COUPLE/lammps_nwchem/README b/examples/COUPLE/lammps_nwchem/README deleted file mode 100644 index fc0f0cf868..0000000000 --- a/examples/COUPLE/lammps_nwchem/README +++ /dev/null @@ -1,197 +0,0 @@ -Sample LAMMPS MD wrapper on NWChem via client/server coupling - -See the MESSAGE package documentation Build_extras.html#message -and Build_extras.html#message for more details on how client/server -coupling works in LAMMPS. - -In this dir, the nwchem_wrap.py is a wrapper on the NWChem electronic -structure code so it can work as a "server" code which LAMMPS drives -as a "client" code to perform ab initio MD. LAMMPS performs the MD -timestepping, sends NWChem a current set of coordinates each timestep, -NWChem computes forces and energy (and virial) and returns that info -to LAMMPS. - -Messages are exchanged between NWChem and LAMMPS via a client/server -library (CSlib), which is included in the LAMMPS distribution in -lib/message. As explained below you can choose to exchange data -between the two programs either via files or sockets (ZMQ). If the -nwchem_wrap.py program became parallel, or the CSlib library calls were -integrated into NWChem directly, then data could also be exchanged via -MPI. - -There are 2 examples provided in the planeware and ao_basis -sub-directories. See details below. - ----------------- - -Build LAMMPS with its MESSAGE package installed: - -See the Build extras doc page and its MESSAGE package -section for details. - -CMake: - --D PKG_MESSAGE=yes # include the MESSAGE package --D MESSAGE_ZMQ=value # build with ZeroMQ support, value = no (default) or yes - -Traditional make: - -cd lammps/lib/message -python Install.py -m -z # build CSlib with MPI and ZMQ support -cd lammps/src -make yes-message -make mpi - -You can leave off the -z if you do not have ZMQ on your system. - ----------------- - -Build the CSlib in a form usable by the nwchem_wrapper.py script: - -% cd lammps/lib/message/cslib/src -% make shlib # build serial and parallel shared lib with ZMQ support -% make shlib zmq=no # build serial and parallel shared lib w/out ZMQ support - -This will make a shared library versions of the CSlib, which Python -requires. Python must be able to find both the cslib.py script and -the libcsnompi.so library in your lammps/lib/message/cslib/src -directory. If it is not able to do this, you will get an error when -you run nwchem_wrapper.py. - -You can do this by augmenting two environment variables, either from -the command line, or in your shell start-up script. Here is the -sample syntax for the csh or tcsh shells: - -setenv PYTHONPATH ${PYTHONPATH}:/home/sjplimp/lammps/lib/message/cslib/src -setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/sjplimp/lammps/lib/message/cslib/src - ----------------- - -Prepare to use NWChem and the nwchem_wrap.py script - -You can run the nwchem_wrap.py script as-is to test that the coupling -between it and LAMMPS is functional. This will use the included -nwchem_lammps.out files output by a previous NWChem run. - -But note that the as-is version of nwchem_wrap.py will not attempt to -run NWChem. - -To do this, you must edit the 1st nwchemcmd line at the top of -nwchem_wrapper.py to be the launch command needed to run NWChem on -your system. It can be a command to run NWChem in serial or in -parallel, e.g. an mpirun command. Then comment out the 2nd nwchemcmd -line immediately following it. - -Ensure you have the necessary NWChem input file in this directory, -suitable for the NWChem calculation you want to perform. - -Example input files are provided for both atom-centered AO basis sets -and plane-wave basis sets. Note that the NWChem template file should -be matched to the LAMMPS input script (# of atoms and atom types, box -size, etc). - -Once you run NWChem yourself, the nwchem_lammps.out file will be -overwritten. - -The syntax of the wrapper is: -nwchem_wrap.py file/zmq ao/pw input_template -* file/zmg = messaging mode, must match LAMMPS messaging mode -* ao/pw = basis set mode, selects between atom-centered and plane-wave - the input_template file must correspond to the appropriate basis set mode: - the "ao" mode supports the scf and dft modules in NWChem, - the "pw" mode supports the nwpw module. -* input_template = NWChem input file used as template, must include a - "geometry" block with the atoms in the simulation, dummy - xyz coordinates should be included (but are not used). - Atom ordering must match LAMMPS input. - -During a simulation, the molecular orbitals from the previous timestep -will be used as the initial guess for the next NWChem calculation. If -a file named "nwchem_lammps.movecs" is in the directory the wrapper is -called from, these orbitals will be used as the initial guess orbitals -in the first step of the simulation. - ----------------- - -Example directories - -(1) planewave - -Demonstrates coupling of the nwpw module in NWChem with LAMMPS. Only fully -periodic boundary conditions and orthogonal simulation boxes are currently -supported by the wrapper. The included files provide an example run using a -2 atom unit cell of tungsten. - -Files: - * data.W LAMMPS input with geometry information - * in.client.W LAMMPS simulation input - * log.client.output LAMMPS simulation output - * w.nw NWChem template input file - * nwchem_lammps.out NWChem output - -(2) ao_basis - -Demonstrates coupling of the scf (or dft) modules in NWChem with -LAMMPS. Only fully aperiodic boundary conditions are currently -supported by the wrapper. The included files provide an example run -using a single water molecule. - -Files: - * data.h2o LAMMPS input with geometry information - * in.client.h2o LAMMPS simulation input - * log.client.output LAMMPS simulation output - * h2o.nw NWChem template input file - * nwchem_lammps.out NWChem output - -As noted above, you can run the nwchem_wrap.py script as-is to test that -the coupling between it and LAMMPS is functional. This will use the included -nwchem_lammps.out files. - ----------------- - -To run in client/server mode: - -NOTE: The nwchem_wrap.py script must be run with Python version 2, not -3. This is because it used the CSlib python wrapper, which only -supports version 2. We plan to upgrade CSlib to support Python 3. - -Both the client (LAMMPS) and server (nwchem_wrap.py) must use the same -messaging mode, namely file or zmq. This is an argument to the -nwchem_wrap.py code; it can be selected by setting the "mode" variable -when you run LAMMPS. The default mode = file. - -Here we assume LAMMPS was built to run in parallel, and the MESSAGE -package was installed with socket (ZMQ) support. This means either of -the messaging modes can be used and LAMMPS can be run in serial or -parallel. The nwchem_wrap.py code is always run in serial, but it -launches NWChem from Python via an mpirun command which can run NWChem -itself in parallel. - -When you run, the server should print out thermodynamic info every -timestep which corresponds to the forces and virial computed by NWChem. -NWChem will also generate output files each timestep. Output files from -previous timesteps are archived in a "nwchem_logs" directory. - -The examples below are commands you should use in two different -terminal windows. The order of the two commands (client or server -launch) does not matter. You can run them both in the same window if -you append a "&" character to the first one to run it in the -background. - --------------- - -File mode of messaging: - -% mpirun -np 1 lmp_mpi -v mode file -in in.client.W -% python nwchem_wrap.py file pw w.nw - -% mpirun -np 2 lmp_mpi -v mode file -in in.client.h2o -% python nwchem_wrap.py file ao h2o.nw - -ZMQ mode of messaging: - -% mpirun -np 1 lmp_mpi -v mode zmq -in in.client.W -% python nwchem_wrap.py zmq pw w.nw - -% mpirun -np 2 lmp_mpi -v mode zmq -in in.client.h2o -% python nwchem_wrap.py zmq ao h2o.nw diff --git a/examples/COUPLE/lammps_nwchem/ao_basis/data.h2o b/examples/COUPLE/lammps_nwchem/ao_basis/data.h2o deleted file mode 100644 index 90f63e17ce..0000000000 --- a/examples/COUPLE/lammps_nwchem/ao_basis/data.h2o +++ /dev/null @@ -1,20 +0,0 @@ -LAMMPS H2O data file - -3 atoms - -2 atom types - --10.0 10.0 xlo xhi --10.0 10.0 ylo yhi --10.0 10.0 zlo zhi - -Masses - -1 15.994915008544922 -2 1.0078250169754028 - -Atoms - -1 1 0.0 0.0 0.0 -2 2 0.0 0.756723 -0.585799 -3 2 0.0 -0.756723 -0.585799 diff --git a/examples/COUPLE/lammps_nwchem/ao_basis/h2o.nw b/examples/COUPLE/lammps_nwchem/ao_basis/h2o.nw deleted file mode 100644 index 285a2a33c8..0000000000 --- a/examples/COUPLE/lammps_nwchem/ao_basis/h2o.nw +++ /dev/null @@ -1,25 +0,0 @@ -echo - -memory global 40 mb stack 23 mb heap 5 mb - -geometry units angstrom noautosym - O 0.0 0.0 0.0 - H 1.0 0.5 0.0 - H -1.0 0.5 0.0 -end - -basis - O library 6-31g* - H library 6-31g* -end - -scf - maxiter 100 -end - -#dft -# xc b3lyp -#end - -task scf gradient -#task dft gradient diff --git a/examples/COUPLE/lammps_nwchem/ao_basis/in.client.h2o b/examples/COUPLE/lammps_nwchem/ao_basis/in.client.h2o deleted file mode 100644 index 20072f50aa..0000000000 --- a/examples/COUPLE/lammps_nwchem/ao_basis/in.client.h2o +++ /dev/null @@ -1,27 +0,0 @@ -# H2O with NWChem - -variable mode index file - -if "${mode} == file" then & - "message client md file tmp.couple" & -elif "${mode} == zmq" & - "message client md zmq localhost:5555" & - -units metal -atom_style atomic -atom_modify sort 0 0.0 map yes - -boundary m m m -read_data data.h2o - -velocity all create 300.0 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 10 check no - -fix 1 all nve -fix 2 all client/md -fix_modify 2 energy yes - -thermo 1 -run 3 diff --git a/examples/COUPLE/lammps_nwchem/ao_basis/in.client.h2o.min b/examples/COUPLE/lammps_nwchem/ao_basis/in.client.h2o.min deleted file mode 100644 index 4a506d0924..0000000000 --- a/examples/COUPLE/lammps_nwchem/ao_basis/in.client.h2o.min +++ /dev/null @@ -1,30 +0,0 @@ -# H2O with NWChem - -variable mode index file - -if "${mode} == file" then & - "message client md file tmp.couple" & -elif "${mode} == zmq" & - "message client md zmq localhost:5555" & - -units metal -atom_style atomic -atom_modify sort 0 0.0 map yes - -boundary m m m -read_data data.h2o - -group one id 2 -displace_atoms one move 0.1 0.2 0.3 - -velocity all create 300.0 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 10 check no - -fix 1 all nve -fix 2 all client/md -fix_modify 2 energy yes - -thermo 1 -minimize 1.0e-6 1.0e-6 10 50 diff --git a/examples/COUPLE/lammps_nwchem/ao_basis/log.client.output b/examples/COUPLE/lammps_nwchem/ao_basis/log.client.output deleted file mode 100644 index 49ec904bea..0000000000 --- a/examples/COUPLE/lammps_nwchem/ao_basis/log.client.output +++ /dev/null @@ -1,66 +0,0 @@ -LAMMPS (19 Sep 2019) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:93) - using 1 OpenMP thread(s) per MPI task -# H2O with NWChem - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" -message client md file tmp.couple -units metal -atom_style atomic -atom_modify sort 0 0.0 map yes - -boundary m m m -read_data data.h2o - orthogonal box = (-10 -10 -10) to (10 10 10) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 3 atoms - read_data CPU = 0.000627125 secs - -velocity all create 300.0 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 10 check no - -fix 1 all nve -fix 2 all client/md -fix_modify 2 energy yes - -thermo 1 -run 3 -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:166) -Per MPI rank memory allocation (min/avg/max) = 0.0276 | 0.0276 | 0.0276 Mbytes -Step Temp E_pair E_mol TotEng Press Volume - 0 300 0 0 0.077556087 10.354878 8000 - 1 300 0 0 0.077556087 10.354878 8000 - 2 300 0 0 0.077556087 10.354878 8000 - 3 300 0 0 0.077556087 10.354878 8000 -Loop time of 0.30198 on 1 procs for 3 steps with 3 atoms - -Performance: 0.858 ns/day, 27.961 hours/ns, 9.934 timesteps/s -0.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 2.5979e-06 | 2.5979e-06 | 2.5979e-06 | 0.0 | 0.00 -Output | 0.00012053 | 0.00012053 | 0.00012053 | 0.0 | 0.04 -Modify | 0.30185 | 0.30185 | 0.30185 | 0.0 | 99.96 -Other | | 8.211e-06 | | | 0.00 - -Nlocal: 3 ave 3 max 3 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 0 -Dangerous builds not checked -Total wall time: 0:00:07 diff --git a/examples/COUPLE/lammps_nwchem/ao_basis/log.lammps.h2o.31Jan20 b/examples/COUPLE/lammps_nwchem/ao_basis/log.lammps.h2o.31Jan20 deleted file mode 100644 index f4dedfcce5..0000000000 --- a/examples/COUPLE/lammps_nwchem/ao_basis/log.lammps.h2o.31Jan20 +++ /dev/null @@ -1,66 +0,0 @@ -LAMMPS (19 Sep 2019) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:93) - using 1 OpenMP thread(s) per MPI task -# H2O with NWChem - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" -message client md file tmp.couple -units metal -atom_style atomic -atom_modify sort 0 0.0 map yes - -boundary m m m -read_data data.h2o - orthogonal box = (-10 -10 -10) to (10 10 10) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 3 atoms - read_data CPU = 0.000608759 secs - -velocity all create 300.0 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 10 check no - -fix 1 all nve -fix 2 all client/md -fix_modify 2 energy yes - -thermo 1 -run 3 -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:166) -Per MPI rank memory allocation (min/avg/max) = 0.0276 | 0.0276 | 0.0276 Mbytes -Step Temp E_pair E_mol TotEng Press Volume - 0 300 0 0 -2068.2746 10.354878 8000 - 1 200.33191 0 0 -2068.2704 6.9147085 8000 - 2 152.36218 0 0 -2068.269 5.2589726 8000 - 3 227.40679 0 0 -2068.2722 7.8492321 8000 -Loop time of 1.90319 on 1 procs for 3 steps with 3 atoms - -Performance: 0.136 ns/day, 176.221 hours/ns, 1.576 timesteps/s -0.0% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 3.9274e-06 | 3.9274e-06 | 3.9274e-06 | 0.0 | 0.00 -Output | 0.00011798 | 0.00011798 | 0.00011798 | 0.0 | 0.01 -Modify | 1.9031 | 1.9031 | 1.9031 | 0.0 | 99.99 -Other | | 1.054e-05 | | | 0.00 - -Nlocal: 3 ave 3 max 3 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 0 -Dangerous builds not checked -Total wall time: 0:00:07 diff --git a/examples/COUPLE/lammps_nwchem/ao_basis/log.lammps.h2o.min.31Jan20 b/examples/COUPLE/lammps_nwchem/ao_basis/log.lammps.h2o.min.31Jan20 deleted file mode 100644 index 5fb1f93318..0000000000 --- a/examples/COUPLE/lammps_nwchem/ao_basis/log.lammps.h2o.min.31Jan20 +++ /dev/null @@ -1,82 +0,0 @@ -LAMMPS (19 Sep 2019) -OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:93) - using 1 OpenMP thread(s) per MPI task -# H2O with NWChem - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" -message client md file tmp.couple -units metal -atom_style atomic -atom_modify sort 0 0.0 map yes - -boundary m m m -read_data data.h2o - orthogonal box = (-10 -10 -10) to (10 10 10) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 3 atoms - read_data CPU = 0.000615383 secs - -group one id 2 -1 atoms in group one -displace_atoms one move 0.1 0.2 0.3 - -velocity all create 300.0 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 10 check no - -fix 1 all nve -fix 2 all client/md -fix_modify 2 energy yes - -thermo 1 -minimize 1.0e-6 1.0e-6 10 50 -WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (src/min.cpp:174) -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:166) -Per MPI rank memory allocation (min/avg/max) = 0.0279 | 0.0279 | 0.0279 Mbytes -Step Temp E_pair E_mol TotEng Press Volume - 0 300 0 0 -2067.8909 10.354878 8000 - 1 300 0 0 -2068.0707 10.354878 8000 - 2 300 0 0 -2068.252 10.354878 8000 -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:166) - 3 300 0 0 -2068.2797 10.354878 8000 -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:166) - 4 300 0 0 -2068.2799 10.354878 8000 -Loop time of 5.71024 on 1 procs for 4 steps with 3 atoms - -0.1% CPU use with 1 MPI tasks x 1 OpenMP threads - -Minimization stats: - Stopping criterion = energy tolerance - Energy initial, next-to-last, final = - -2067.96847053 -2068.35730416 -2068.35745184 - Force two-norm initial, final = 4.54685 0.124714 - Force max component initial, final = 3.48924 0.0859263 - Final line search alpha, max atom move = 1 0.0859263 - Iterations, force evaluations = 4 8 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 6.2305e-07 | 6.2305e-07 | 6.2305e-07 | 0.0 | 0.00 -Comm | 1.1522e-05 | 1.1522e-05 | 1.1522e-05 | 0.0 | 0.00 -Output | 8.4217e-05 | 8.4217e-05 | 8.4217e-05 | 0.0 | 0.00 -Modify | 5.7099 | 5.7099 | 5.7099 | 0.0 | 99.99 -Other | | 0.0002355 | | | 0.00 - -Nlocal: 3 ave 3 max 3 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 2 -Dangerous builds not checked -Total wall time: 0:00:10 diff --git a/examples/COUPLE/lammps_nwchem/ao_basis/nwchem_lammps.out b/examples/COUPLE/lammps_nwchem/ao_basis/nwchem_lammps.out deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/examples/COUPLE/lammps_nwchem/ao_basis/nwchem_lammps.out.h2o.31Jan20 b/examples/COUPLE/lammps_nwchem/ao_basis/nwchem_lammps.out.h2o.31Jan20 deleted file mode 100644 index bba8a12a22..0000000000 --- a/examples/COUPLE/lammps_nwchem/ao_basis/nwchem_lammps.out.h2o.31Jan20 +++ /dev/null @@ -1,626 +0,0 @@ - argument 1 = nwchem_lammps.nw - - - -============================== echo of input deck ============================== -echo - -memory global 40 mb stack 23 mb heap 5 mb - -geometry units angstrom noautosym nocenter -O 0.00197082 0.0012463 -0.00298048 -H -0.0432066 0.769363 -0.596119 -H 0.0119282 -0.789143 -0.528177 -end - -scf - vectors input nwchem_lammps.movecs -end - -dft - vectors input nwchem_lammps.movecs -end - -basis - O library 6-31g* - H library 6-31g* -end - -scf - maxiter 100 -end - -#dft -# xc b3lyp -#end - -task scf gradient -#task dft gradient -================================================================================ - - - - - - - Northwest Computational Chemistry Package (NWChem) 6.8 - ------------------------------------------------------ - - - Environmental Molecular Sciences Laboratory - Pacific Northwest National Laboratory - Richland, WA 99352 - - Copyright (c) 1994-2018 - Pacific Northwest National Laboratory - Battelle Memorial Institute - - NWChem is an open-source computational chemistry package - distributed under the terms of the - Educational Community License (ECL) 2.0 - A copy of the license is included with this distribution - in the LICENSE.TXT file - - ACKNOWLEDGMENT - -------------- - - This software and its documentation were developed at the - EMSL at Pacific Northwest National Laboratory, a multiprogram - national laboratory, operated for the U.S. Department of Energy - by Battelle under Contract Number DE-AC05-76RL01830. Support - for this work was provided by the Department of Energy Office - of Biological and Environmental Research, Office of Basic - Energy Sciences, and the Office of Advanced Scientific Computing. - - - Job information - --------------- - - hostname = almondjoy - program = /home/jboschen/nwchem-6.8.1-release/bin/LINUX64/nwchem - date = Fri Jan 31 00:31:00 2020 - - compiled = Tue_Oct_01_13:20:43_2019 - source = /home/jboschen/nwchem-6.8.1-release - nwchem branch = Development - nwchem revision = N/A - ga revision = 5.6.5 - use scalapack = F - input = nwchem_lammps.nw - prefix = nwchem_lammps. - data base = ./nwchem_lammps.db - status = restart - nproc = 1 - time left = -1s - - - - Memory information - ------------------ - - heap = 655358 doubles = 5.0 Mbytes - stack = 3014651 doubles = 23.0 Mbytes - global = 5242880 doubles = 40.0 Mbytes (distinct from heap & stack) - total = 8912889 doubles = 68.0 Mbytes - verify = yes - hardfail = no - - - Directory information - --------------------- - - 0 permanent = . - 0 scratch = . - - - Previous task information - ------------------------- - - Theory = scf - Operation = gradient - Status = ok - Qmmm = F - Ignore = F - - - Geometries in the database - -------------------------- - - Name Natoms Last Modified - -------------------------------- ------ ------------------------ - 1 geometry 3 Fri Jan 31 00:30:59 2020 - - The geometry named "geometry" is the default for restart - - - - Basis sets in the database - -------------------------- - - Name Natoms Last Modified - -------------------------------- ------ ------------------------ - 1 ao basis 2 Fri Jan 31 00:30:59 2020 - - The basis set named "ao basis" is the default AO basis for restart - - - - - NWChem Input Module - ------------------- - - - - Scaling coordinates for geometry "geometry" by 1.889725989 - (inverse scale = 0.529177249) - - - ------ - auto-z - ------ - no constraints, skipping 0.0000000000000000 - no constraints, skipping 0.0000000000000000 - - - Geometry "geometry" -> "" - ------------------------- - - Output coordinates in angstroms (scale by 1.889725989 to convert to a.u.) - - No. Tag Charge X Y Z - ---- ---------------- ---------- -------------- -------------- -------------- - 1 O 8.0000 0.00197082 0.00124630 -0.00298048 - 2 H 1.0000 -0.04320660 0.76936300 -0.59611900 - 3 H 1.0000 0.01192820 -0.78914300 -0.52817700 - - Atomic Mass - ----------- - - O 15.994910 - H 1.007825 - - - Effective nuclear repulsion energy (a.u.) 9.1573270473 - - Nuclear Dipole moment (a.u.) - ---------------------------- - X Y Z - ---------------- ---------------- ---------------- - -0.0293131272 -0.0185374561 -2.1696696942 - - - - Z-matrix (autoz) - -------- - - Units are Angstrom for bonds and degrees for angles - - Type Name I J K L M Value - ----------- -------- ----- ----- ----- ----- ----- ---------- - 1 Stretch 1 2 0.97152 - 2 Stretch 1 3 0.94902 - 3 Bend 2 1 3 108.72901 - - - XYZ format geometry - ------------------- - 3 - geometry - O 0.00197082 0.00124630 -0.00298048 - H -0.04320660 0.76936300 -0.59611900 - H 0.01192820 -0.78914300 -0.52817700 - - ============================================================================== - internuclear distances - ------------------------------------------------------------------------------ - center one | center two | atomic units | angstroms - ------------------------------------------------------------------------------ - 2 H | 1 O | 1.83591 | 0.97152 - 3 H | 1 O | 1.79339 | 0.94902 - ------------------------------------------------------------------------------ - number of included internuclear distances: 2 - ============================================================================== - - - - ============================================================================== - internuclear angles - ------------------------------------------------------------------------------ - center 1 | center 2 | center 3 | degrees - ------------------------------------------------------------------------------ - 2 H | 1 O | 3 H | 108.73 - ------------------------------------------------------------------------------ - number of included internuclear angles: 1 - ============================================================================== - - - - Basis "ao basis" -> "" (cartesian) - ----- - O (Oxygen) - ---------- - Exponent Coefficients - -------------- --------------------------------------------------------- - 1 S 5.48467170E+03 0.001831 - 1 S 8.25234950E+02 0.013950 - 1 S 1.88046960E+02 0.068445 - 1 S 5.29645000E+01 0.232714 - 1 S 1.68975700E+01 0.470193 - 1 S 5.79963530E+00 0.358521 - - 2 S 1.55396160E+01 -0.110778 - 2 S 3.59993360E+00 -0.148026 - 2 S 1.01376180E+00 1.130767 - - 3 P 1.55396160E+01 0.070874 - 3 P 3.59993360E+00 0.339753 - 3 P 1.01376180E+00 0.727159 - - 4 S 2.70005800E-01 1.000000 - - 5 P 2.70005800E-01 1.000000 - - 6 D 8.00000000E-01 1.000000 - - H (Hydrogen) - ------------ - Exponent Coefficients - -------------- --------------------------------------------------------- - 1 S 1.87311370E+01 0.033495 - 1 S 2.82539370E+00 0.234727 - 1 S 6.40121700E-01 0.813757 - - 2 S 1.61277800E-01 1.000000 - - - - Summary of "ao basis" -> "" (cartesian) - ------------------------------------------------------------------------------ - Tag Description Shells Functions and Types - ---------------- ------------------------------ ------ --------------------- - O 6-31g* 6 15 3s2p1d - H 6-31g* 2 2 2s - - - NWChem SCF Module - ----------------- - - - - ao basis = "ao basis" - functions = 19 - atoms = 3 - closed shells = 5 - open shells = 0 - charge = 0.00 - wavefunction = RHF - input vectors = ./nwchem_lammps.movecs - output vectors = ./nwchem_lammps.movecs - use symmetry = F - symmetry adapt = F - - - Summary of "ao basis" -> "ao basis" (cartesian) - ------------------------------------------------------------------------------ - Tag Description Shells Functions and Types - ---------------- ------------------------------ ------ --------------------- - O 6-31g* 6 15 3s2p1d - H 6-31g* 2 2 2s - - - - Forming initial guess at 0.0s - - - Loading old vectors from job with title : - - - - - Starting SCF solution at 0.0s - - - - ---------------------------------------------- - Quadratically convergent ROHF - - Convergence threshold : 1.000E-04 - Maximum no. of iterations : 100 - Final Fock-matrix accuracy: 1.000E-07 - ---------------------------------------------- - - - #quartets = 1.540D+03 #integrals = 1.424D+04 #direct = 0.0% #cached =100.0% - - - Integral file = ./nwchem_lammps.aoints.0 - Record size in doubles = 65536 No. of integs per rec = 43688 - Max. records in memory = 2 Max. records in file = 1392051 - No. of bits per label = 8 No. of bits per value = 64 - - - iter energy gnorm gmax time - ----- ------------------- --------- --------- -------- - 1 -76.0095751323 4.63D-02 1.64D-02 0.1 - 2 -76.0097628164 8.13D-04 2.83D-04 0.1 - 3 -76.0097629130 3.92D-06 1.55D-06 0.1 - - - Final RHF results - ------------------ - - Total SCF energy = -76.009762913030 - One-electron energy = -123.002897732381 - Two-electron energy = 37.835807772101 - Nuclear repulsion energy = 9.157327047250 - - Time for solution = 0.0s - - - Final eigenvalues - ----------------- - - 1 - 1 -20.5584 - 2 -1.3367 - 3 -0.7128 - 4 -0.5617 - 5 -0.4959 - 6 0.2104 - 7 0.3038 - 8 1.0409 - 9 1.1202 - 10 1.1606 - 11 1.1691 - 12 1.3840 - 13 1.4192 - 14 2.0312 - 15 2.0334 - - ROHF Final Molecular Orbital Analysis - ------------------------------------- - - Vector 2 Occ=2.000000D+00 E=-1.336749D+00 - MO Center= -2.8D-03, -1.3D-02, -1.7D-01, r^2= 5.1D-01 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 2 0.476636 1 O s 6 0.442369 1 O s - 1 -0.210214 1 O s - - Vector 3 Occ=2.000000D+00 E=-7.127948D-01 - MO Center= -4.9D-03, 3.9D-03, -2.1D-01, r^2= 7.8D-01 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 4 0.504894 1 O py 8 0.303932 1 O py - 18 -0.234724 3 H s 16 0.229765 2 H s - - Vector 4 Occ=2.000000D+00 E=-5.617306D-01 - MO Center= 3.6D-03, 9.0D-03, 5.6D-02, r^2= 6.9D-01 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 5 0.559565 1 O pz 9 0.410981 1 O pz - 6 0.315892 1 O s 2 0.157960 1 O s - - Vector 5 Occ=2.000000D+00 E=-4.959173D-01 - MO Center= 1.4D-03, 6.9D-05, -2.2D-02, r^2= 6.0D-01 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 3 0.638390 1 O px 7 0.511530 1 O px - - Vector 6 Occ=0.000000D+00 E= 2.103822D-01 - MO Center= -2.3D-02, 3.5D-02, -7.3D-01, r^2= 2.6D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 6 1.416869 1 O s 17 -1.068330 2 H s - 19 -1.014775 3 H s 9 -0.490951 1 O pz - 5 -0.212990 1 O pz - - Vector 7 Occ=0.000000D+00 E= 3.037943D-01 - MO Center= -1.8D-02, -8.9D-02, -7.1D-01, r^2= 2.8D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 19 -1.426837 3 H s 17 1.332767 2 H s - 8 -0.842141 1 O py 4 -0.327553 1 O py - - Vector 8 Occ=0.000000D+00 E= 1.040852D+00 - MO Center= -7.4D-03, 1.3D-01, -1.6D-01, r^2= 1.4D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 16 0.931594 2 H s 18 -0.747590 3 H s - 8 -0.655817 1 O py 17 -0.523035 2 H s - 19 0.366407 3 H s 14 -0.357109 1 O dyz - - Vector 9 Occ=0.000000D+00 E= 1.120172D+00 - MO Center= -6.8D-03, -2.9D-02, -3.1D-01, r^2= 1.5D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 6 1.145090 1 O s 18 0.841596 3 H s - 2 -0.727471 1 O s 16 0.684927 2 H s - 9 0.559191 1 O pz 19 -0.546678 3 H s - 17 -0.538778 2 H s 10 -0.344609 1 O dxx - 15 -0.250035 1 O dzz - - Vector 10 Occ=0.000000D+00 E= 1.160603D+00 - MO Center= 1.2D-02, -4.3D-02, 2.5D-01, r^2= 1.0D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 6 1.137949 1 O s 5 -0.844233 1 O pz - 9 0.595088 1 O pz 2 -0.475986 1 O s - 18 -0.455932 3 H s 16 -0.357325 2 H s - 13 -0.317117 1 O dyy 15 -0.196968 1 O dzz - - Vector 11 Occ=0.000000D+00 E= 1.169054D+00 - MO Center= 1.9D-03, 1.2D-03, -6.4D-03, r^2= 1.1D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 7 -1.034653 1 O px 3 0.962043 1 O px - - Vector 12 Occ=0.000000D+00 E= 1.384034D+00 - MO Center= 6.0D-04, -2.6D-03, -5.0D-02, r^2= 1.4D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 8 1.557767 1 O py 4 -1.035829 1 O py - 17 -0.900920 2 H s 19 0.901756 3 H s - - Vector 13 Occ=0.000000D+00 E= 1.419205D+00 - MO Center= -1.3D-02, -4.9D-02, -5.2D-01, r^2= 1.4D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 6 3.605136 1 O s 2 -1.454853 1 O s - 9 -1.107532 1 O pz 19 -0.874208 3 H s - 17 -0.757016 2 H s 13 -0.634436 1 O dyy - 5 0.516593 1 O pz 15 -0.401100 1 O dzz - 10 -0.319873 1 O dxx 16 -0.260650 2 H s - - Vector 14 Occ=0.000000D+00 E= 2.031234D+00 - MO Center= 1.9D-03, 2.3D-03, -3.0D-03, r^2= 6.1D-01 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 11 1.727083 1 O dxy - - Vector 15 Occ=0.000000D+00 E= 2.033369D+00 - MO Center= 3.4D-03, 3.4D-03, 4.3D-02, r^2= 6.2D-01 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 15 1.012642 1 O dzz 13 -0.512441 1 O dyy - 10 -0.438481 1 O dxx 6 -0.226567 1 O s - - - center of mass - -------------- - x = -0.00000001 y = -0.00000003 z = -0.12388979 - - moments of inertia (a.u.) - ------------------ - 6.378705068992 0.153373998471 -0.069687034145 - 0.153373998471 2.014476065716 0.150739744400 - -0.069687034145 0.150739744400 4.379134195179 - - Mulliken analysis of the total density - -------------------------------------- - - Atom Charge Shell Charges - ----------- ------ ------------------------------------------------------- - 1 O 8 8.87 2.00 0.90 2.90 0.92 2.08 0.08 - 2 H 1 0.56 0.46 0.11 - 3 H 1 0.56 0.47 0.10 - - Multipole analysis of the density wrt the origin - ------------------------------------------------ - - L x y z total open nuclear - - - - - ----- ---- ------- - 0 0 0 0 -0.000000 0.000000 10.000000 - - 1 1 0 0 -0.026417 0.000000 -0.029313 - 1 0 1 0 -0.023604 0.000000 -0.018537 - 1 0 0 1 -0.846090 0.000000 -2.169670 - - 2 2 0 0 -5.373227 0.000000 0.007286 - 2 1 1 0 -0.085617 0.000000 -0.152252 - 2 1 0 1 0.038215 0.000000 0.069311 - 2 0 2 0 -2.927589 0.000000 4.337695 - 2 0 1 1 -0.071410 0.000000 -0.149465 - 2 0 0 2 -4.159949 0.000000 2.265483 - - - Parallel integral file used 1 records with 0 large values - - NWChem Gradients Module - ----------------------- - - - - wavefunction = RHF - - - - RHF ENERGY GRADIENTS - - atom coordinates gradient - x y z x y z - 1 O 0.003724 0.002355 -0.005632 0.000909 -0.019294 0.007866 - 2 H -0.081649 1.453885 -1.126502 -0.001242 0.025549 -0.011605 - 3 H 0.022541 -1.491264 -0.998110 0.000333 -0.006255 0.003739 - - ---------------------------------------- - | Time | 1-e(secs) | 2-e(secs) | - ---------------------------------------- - | CPU | 0.00 | 0.03 | - ---------------------------------------- - | WALL | 0.00 | 0.03 | - ---------------------------------------- - - Task times cpu: 0.1s wall: 0.1s - - - NWChem Input Module - ------------------- - - - Summary of allocated global arrays ------------------------------------ - No active global arrays - - - - GA Statistics for process 0 - ------------------------------ - - create destroy get put acc scatter gather read&inc -calls: 182 182 2869 728 468 0 0 68 -number of processes/call 1.00e+00 1.00e+00 1.00e+00 0.00e+00 0.00e+00 -bytes total: 6.18e+05 3.56e+05 1.04e+05 0.00e+00 0.00e+00 5.44e+02 -bytes remote: 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 -Max memory consumed for GA by this process: 39432 bytes - -MA_summarize_allocated_blocks: starting scan ... -MA_summarize_allocated_blocks: scan completed: 0 heap blocks, 0 stack blocks -MA usage statistics: - - allocation statistics: - heap stack - ---- ----- - current number of blocks 0 0 - maximum number of blocks 18 28 - current total bytes 0 0 - maximum total bytes 1060104 16000888 - maximum total K-bytes 1061 16001 - maximum total M-bytes 2 17 - - - CITATION - -------- - Please cite the following reference when publishing - results obtained with NWChem: - - M. Valiev, E.J. Bylaska, N. Govind, K. Kowalski, - T.P. Straatsma, H.J.J. van Dam, D. Wang, J. Nieplocha, - E. Apra, T.L. Windus, W.A. de Jong - "NWChem: a comprehensive and scalable open-source - solution for large scale molecular simulations" - Comput. Phys. Commun. 181, 1477 (2010) - doi:10.1016/j.cpc.2010.04.018 - - AUTHORS - ------- - E. Apra, E. J. Bylaska, W. A. de Jong, N. Govind, K. Kowalski, - T. P. Straatsma, M. Valiev, H. J. J. van Dam, D. Wang, T. L. Windus, - J. Hammond, J. Autschbach, K. Bhaskaran-Nair, J. Brabec, K. Lopata, - S. A. Fischer, S. Krishnamoorthy, M. Jacquelin, W. Ma, M. Klemm, O. Villa, - Y. Chen, V. Anisimov, F. Aquino, S. Hirata, M. T. Hackler, V. Konjkov, - D. Mejia-Rodriguez, T. Risthaus, M. Malagoli, A. Marenich, - A. Otero-de-la-Roza, J. Mullin, P. Nichols, R. Peverati, J. Pittner, Y. Zhao, - P.-D. Fan, A. Fonari, M. J. Williamson, R. J. Harrison, J. R. Rehr, - M. Dupuis, D. Silverstein, D. M. A. Smith, J. Nieplocha, V. Tipparaju, - M. Krishnan, B. E. Van Kuiken, A. Vazquez-Mayagoitia, L. Jensen, M. Swart, - Q. Wu, T. Van Voorhis, A. A. Auer, M. Nooijen, L. D. Crosby, E. Brown, - G. Cisneros, G. I. Fann, H. Fruchtl, J. Garza, K. Hirao, R. A. Kendall, - J. A. Nichols, K. Tsemekhman, K. Wolinski, J. Anchell, D. E. Bernholdt, - P. Borowski, T. Clark, D. Clerc, H. Dachsel, M. J. O. Deegan, K. Dyall, - D. Elwood, E. Glendening, M. Gutowski, A. C. Hess, J. Jaffe, B. G. Johnson, - J. Ju, R. Kobayashi, R. Kutteh, Z. Lin, R. Littlefield, X. Long, B. Meng, - T. Nakajima, S. Niu, L. Pollack, M. Rosing, K. Glaesemann, G. Sandrone, - M. Stave, H. Taylor, G. Thomas, J. H. van Lenthe, A. T. Wong, Z. Zhang. - - Total times cpu: 0.1s wall: 0.2s diff --git a/examples/COUPLE/lammps_nwchem/ao_basis/nwchem_lammps.out.h2o.min.31Jan20 b/examples/COUPLE/lammps_nwchem/ao_basis/nwchem_lammps.out.h2o.min.31Jan20 deleted file mode 100644 index 0595813728..0000000000 --- a/examples/COUPLE/lammps_nwchem/ao_basis/nwchem_lammps.out.h2o.min.31Jan20 +++ /dev/null @@ -1,626 +0,0 @@ - argument 1 = nwchem_lammps.nw - - - -============================== echo of input deck ============================== -echo - -memory global 40 mb stack 23 mb heap 5 mb - -geometry units angstrom noautosym nocenter -O -0.00836667 0.0010006 0.0866404 -H 0.0968795 0.837453 -0.346117 -H 0.0114839 -0.638453 -0.612122 -end - -scf - vectors input nwchem_lammps.movecs -end - -dft - vectors input nwchem_lammps.movecs -end - -basis - O library 6-31g* - H library 6-31g* -end - -scf - maxiter 100 -end - -#dft -# xc b3lyp -#end - -task scf gradient -#task dft gradient -================================================================================ - - - - - - - Northwest Computational Chemistry Package (NWChem) 6.8 - ------------------------------------------------------ - - - Environmental Molecular Sciences Laboratory - Pacific Northwest National Laboratory - Richland, WA 99352 - - Copyright (c) 1994-2018 - Pacific Northwest National Laboratory - Battelle Memorial Institute - - NWChem is an open-source computational chemistry package - distributed under the terms of the - Educational Community License (ECL) 2.0 - A copy of the license is included with this distribution - in the LICENSE.TXT file - - ACKNOWLEDGMENT - -------------- - - This software and its documentation were developed at the - EMSL at Pacific Northwest National Laboratory, a multiprogram - national laboratory, operated for the U.S. Department of Energy - by Battelle under Contract Number DE-AC05-76RL01830. Support - for this work was provided by the Department of Energy Office - of Biological and Environmental Research, Office of Basic - Energy Sciences, and the Office of Advanced Scientific Computing. - - - Job information - --------------- - - hostname = almondjoy - program = /home/jboschen/nwchem-6.8.1-release/bin/LINUX64/nwchem - date = Fri Jan 31 00:33:40 2020 - - compiled = Tue_Oct_01_13:20:43_2019 - source = /home/jboschen/nwchem-6.8.1-release - nwchem branch = Development - nwchem revision = N/A - ga revision = 5.6.5 - use scalapack = F - input = nwchem_lammps.nw - prefix = nwchem_lammps. - data base = ./nwchem_lammps.db - status = restart - nproc = 1 - time left = -1s - - - - Memory information - ------------------ - - heap = 655358 doubles = 5.0 Mbytes - stack = 3014651 doubles = 23.0 Mbytes - global = 5242880 doubles = 40.0 Mbytes (distinct from heap & stack) - total = 8912889 doubles = 68.0 Mbytes - verify = yes - hardfail = no - - - Directory information - --------------------- - - 0 permanent = . - 0 scratch = . - - - Previous task information - ------------------------- - - Theory = scf - Operation = gradient - Status = ok - Qmmm = F - Ignore = F - - - Geometries in the database - -------------------------- - - Name Natoms Last Modified - -------------------------------- ------ ------------------------ - 1 geometry 3 Fri Jan 31 00:33:40 2020 - - The geometry named "geometry" is the default for restart - - - - Basis sets in the database - -------------------------- - - Name Natoms Last Modified - -------------------------------- ------ ------------------------ - 1 ao basis 2 Fri Jan 31 00:33:40 2020 - - The basis set named "ao basis" is the default AO basis for restart - - - - - NWChem Input Module - ------------------- - - - - Scaling coordinates for geometry "geometry" by 1.889725989 - (inverse scale = 0.529177249) - - - ------ - auto-z - ------ - no constraints, skipping 0.0000000000000000 - no constraints, skipping 0.0000000000000000 - - - Geometry "geometry" -> "" - ------------------------- - - Output coordinates in angstroms (scale by 1.889725989 to convert to a.u.) - - No. Tag Charge X Y Z - ---- ---------------- ---------- -------------- -------------- -------------- - 1 O 8.0000 -0.00836667 0.00100060 0.08664040 - 2 H 1.0000 0.09687950 0.83745300 -0.34611700 - 3 H 1.0000 0.01148390 -0.63845300 -0.61212200 - - Atomic Mass - ----------- - - O 15.994910 - H 1.007825 - - - Effective nuclear repulsion energy (a.u.) 9.2881144400 - - Nuclear Dipole moment (a.u.) - ---------------------------- - X Y Z - ---------------- ---------------- ---------------- - 0.0782914233 0.3911823503 -0.5009962172 - - - - Z-matrix (autoz) - -------- - - Units are Angstrom for bonds and degrees for angles - - Type Name I J K L M Value - ----------- -------- ----- ----- ----- ----- ----- ---------- - 1 Stretch 1 2 0.94763 - 2 Stretch 1 3 0.94740 - 3 Bend 2 1 3 104.86952 - - - XYZ format geometry - ------------------- - 3 - geometry - O -0.00836667 0.00100060 0.08664040 - H 0.09687950 0.83745300 -0.34611700 - H 0.01148390 -0.63845300 -0.61212200 - - ============================================================================== - internuclear distances - ------------------------------------------------------------------------------ - center one | center two | atomic units | angstroms - ------------------------------------------------------------------------------ - 2 H | 1 O | 1.79077 | 0.94763 - 3 H | 1 O | 1.79032 | 0.94740 - ------------------------------------------------------------------------------ - number of included internuclear distances: 2 - ============================================================================== - - - - ============================================================================== - internuclear angles - ------------------------------------------------------------------------------ - center 1 | center 2 | center 3 | degrees - ------------------------------------------------------------------------------ - 2 H | 1 O | 3 H | 104.87 - ------------------------------------------------------------------------------ - number of included internuclear angles: 1 - ============================================================================== - - - - Basis "ao basis" -> "" (cartesian) - ----- - O (Oxygen) - ---------- - Exponent Coefficients - -------------- --------------------------------------------------------- - 1 S 5.48467170E+03 0.001831 - 1 S 8.25234950E+02 0.013950 - 1 S 1.88046960E+02 0.068445 - 1 S 5.29645000E+01 0.232714 - 1 S 1.68975700E+01 0.470193 - 1 S 5.79963530E+00 0.358521 - - 2 S 1.55396160E+01 -0.110778 - 2 S 3.59993360E+00 -0.148026 - 2 S 1.01376180E+00 1.130767 - - 3 P 1.55396160E+01 0.070874 - 3 P 3.59993360E+00 0.339753 - 3 P 1.01376180E+00 0.727159 - - 4 S 2.70005800E-01 1.000000 - - 5 P 2.70005800E-01 1.000000 - - 6 D 8.00000000E-01 1.000000 - - H (Hydrogen) - ------------ - Exponent Coefficients - -------------- --------------------------------------------------------- - 1 S 1.87311370E+01 0.033495 - 1 S 2.82539370E+00 0.234727 - 1 S 6.40121700E-01 0.813757 - - 2 S 1.61277800E-01 1.000000 - - - - Summary of "ao basis" -> "" (cartesian) - ------------------------------------------------------------------------------ - Tag Description Shells Functions and Types - ---------------- ------------------------------ ------ --------------------- - O 6-31g* 6 15 3s2p1d - H 6-31g* 2 2 2s - - - NWChem SCF Module - ----------------- - - - - ao basis = "ao basis" - functions = 19 - atoms = 3 - closed shells = 5 - open shells = 0 - charge = 0.00 - wavefunction = RHF - input vectors = ./nwchem_lammps.movecs - output vectors = ./nwchem_lammps.movecs - use symmetry = F - symmetry adapt = F - - - Summary of "ao basis" -> "ao basis" (cartesian) - ------------------------------------------------------------------------------ - Tag Description Shells Functions and Types - ---------------- ------------------------------ ------ --------------------- - O 6-31g* 6 15 3s2p1d - H 6-31g* 2 2 2s - - - - Forming initial guess at 0.0s - - - Loading old vectors from job with title : - - - - - Starting SCF solution at 0.0s - - - - ---------------------------------------------- - Quadratically convergent ROHF - - Convergence threshold : 1.000E-04 - Maximum no. of iterations : 100 - Final Fock-matrix accuracy: 1.000E-07 - ---------------------------------------------- - - - #quartets = 1.540D+03 #integrals = 1.424D+04 #direct = 0.0% #cached =100.0% - - - Integral file = ./nwchem_lammps.aoints.0 - Record size in doubles = 65536 No. of integs per rec = 43688 - Max. records in memory = 2 Max. records in file = 1392051 - No. of bits per label = 8 No. of bits per value = 64 - - - iter energy gnorm gmax time - ----- ------------------- --------- --------- -------- - 1 -76.0107350035 4.75D-05 2.49D-05 0.1 - - - Final RHF results - ------------------ - - Total SCF energy = -76.010735003510 - One-electron energy = -123.220958992568 - Two-electron energy = 37.922109549024 - Nuclear repulsion energy = 9.288114440035 - - Time for solution = 0.0s - - - Final eigenvalues - ----------------- - - 1 - 1 -20.5583 - 2 -1.3466 - 3 -0.7130 - 4 -0.5721 - 5 -0.4985 - 6 0.2129 - 7 0.3068 - 8 1.0286 - 9 1.1338 - 10 1.1678 - 11 1.1807 - 12 1.3845 - 13 1.4334 - 14 2.0187 - 15 2.0311 - - ROHF Final Molecular Orbital Analysis - ------------------------------------- - - Vector 2 Occ=2.000000D+00 E=-1.346587D+00 - MO Center= 1.1D-02, 3.1D-02, -8.5D-02, r^2= 5.0D-01 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 2 0.475648 1 O s 6 0.435095 1 O s - 1 -0.209463 1 O s - - Vector 3 Occ=2.000000D+00 E=-7.129747D-01 - MO Center= 1.5D-02, 3.8D-02, -1.3D-01, r^2= 7.6D-01 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 4 0.500246 1 O py 8 0.299047 1 O py - 16 0.232138 2 H s 18 -0.232195 3 H s - - Vector 4 Occ=2.000000D+00 E=-5.720760D-01 - MO Center= -1.5D-02, -9.7D-03, 1.5D-01, r^2= 6.8D-01 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 5 0.545527 1 O pz 9 0.395332 1 O pz - 6 0.326735 1 O s 2 0.164593 1 O s - - Vector 5 Occ=2.000000D+00 E=-4.984552D-01 - MO Center= -6.2D-03, 4.4D-03, 6.7D-02, r^2= 6.0D-01 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 3 0.634559 1 O px 7 0.507891 1 O px - - Vector 6 Occ=0.000000D+00 E= 2.128732D-01 - MO Center= 7.5D-02, 1.3D-01, -6.6D-01, r^2= 2.6D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 6 1.437795 1 O s 17 -1.050892 2 H s - 19 -1.050374 3 H s 9 -0.494696 1 O pz - 5 -0.208359 1 O pz - - Vector 7 Occ=0.000000D+00 E= 3.067764D-01 - MO Center= 7.1D-02, 1.3D-01, -6.3D-01, r^2= 2.7D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 17 1.413885 2 H s 19 -1.414835 3 H s - 8 -0.824411 1 O py 4 -0.320355 1 O py - - Vector 8 Occ=0.000000D+00 E= 1.028607D+00 - MO Center= 7.1D-03, 2.6D-02, -5.2D-02, r^2= 1.4D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 16 0.839269 2 H s 18 -0.838060 3 H s - 8 -0.692349 1 O py 17 -0.426291 2 H s - 19 0.425092 3 H s 14 -0.319117 1 O dyz - - Vector 9 Occ=0.000000D+00 E= 1.133833D+00 - MO Center= -2.7D-02, -2.9D-02, 2.6D-01, r^2= 1.5D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 6 1.621086 1 O s 2 -0.910150 1 O s - 9 0.744864 1 O pz 16 0.490586 2 H s - 18 0.491102 3 H s 5 -0.484186 1 O pz - 17 -0.426087 2 H s 19 -0.425823 3 H s - 10 -0.375325 1 O dxx 15 -0.317874 1 O dzz - - Vector 10 Occ=0.000000D+00 E= 1.167849D+00 - MO Center= -8.0D-03, 1.6D-03, 8.3D-02, r^2= 1.1D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 7 -1.028149 1 O px 3 0.955686 1 O px - - Vector 11 Occ=0.000000D+00 E= 1.180721D+00 - MO Center= 1.8D-02, 4.2D-02, -1.5D-01, r^2= 1.1D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 16 0.710073 2 H s 18 0.711177 3 H s - 5 0.704677 1 O pz 17 -0.389719 2 H s - 19 -0.389376 3 H s 6 -0.326170 1 O s - 9 -0.288739 1 O pz 13 0.229749 1 O dyy - - Vector 12 Occ=0.000000D+00 E= 1.384514D+00 - MO Center= -7.4D-04, 1.3D-02, 1.8D-02, r^2= 1.4D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 8 1.510506 1 O py 4 -1.021750 1 O py - 17 -0.934844 2 H s 19 0.935260 3 H s - 9 0.272171 1 O pz 5 -0.184286 1 O pz - - Vector 13 Occ=0.000000D+00 E= 1.433397D+00 - MO Center= 4.7D-02, 8.7D-02, -4.1D-01, r^2= 1.4D+00 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 6 3.628985 1 O s 2 -1.436467 1 O s - 9 -1.143870 1 O pz 17 -0.805578 2 H s - 19 -0.806493 3 H s 13 -0.635948 1 O dyy - 5 0.489050 1 O pz 15 -0.410417 1 O dzz - 16 -0.312860 2 H s 18 -0.312722 3 H s - - Vector 14 Occ=0.000000D+00 E= 2.018721D+00 - MO Center= -1.4D-02, -7.1D-03, 1.3D-01, r^2= 6.2D-01 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 15 0.947149 1 O dzz 14 -0.531399 1 O dyz - 13 -0.526961 1 O dyy 10 -0.358371 1 O dxx - 12 -0.297495 1 O dxz 6 -0.233087 1 O s - - Vector 15 Occ=0.000000D+00 E= 2.031133D+00 - MO Center= -8.4D-03, 1.0D-03, 8.7D-02, r^2= 6.1D-01 - Bfn. Coefficient Atom+Function Bfn. Coefficient Atom+Function - ----- ------------ --------------- ----- ------------ --------------- - 11 1.681563 1 O dxy 12 0.314688 1 O dxz - - - center of mass - -------------- - x = -0.00258245 y = 0.02272235 z = 0.04407491 - - moments of inertia (a.u.) - ------------------ - 6.155330507195 -0.266185800841 0.185335033231 - -0.266185800841 2.211585220634 -0.350250164177 - 0.185335033231 -0.350250164177 4.020009073007 - - Mulliken analysis of the total density - -------------------------------------- - - Atom Charge Shell Charges - ----------- ------ ------------------------------------------------------- - 1 O 8 8.87 2.00 0.90 2.91 0.91 2.06 0.08 - 2 H 1 0.57 0.47 0.10 - 3 H 1 0.57 0.47 0.10 - - Multipole analysis of the density wrt the origin - ------------------------------------------------ - - L x y z total open nuclear - - - - - ----- ---- ------- - 0 0 0 0 -0.000000 0.000000 10.000000 - - 1 1 0 0 0.094145 0.000000 0.078291 - 1 0 1 0 0.148179 0.000000 0.391182 - 1 0 0 1 -0.851621 0.000000 -0.500996 - - 2 2 0 0 -5.338111 0.000000 0.035987 - 2 1 1 0 0.149191 0.000000 0.263306 - 2 1 0 1 -0.084723 0.000000 -0.165556 - 2 0 2 0 -3.114464 0.000000 3.960160 - 2 0 1 1 0.205130 0.000000 0.362991 - 2 0 0 2 -4.329185 0.000000 1.980308 - - - Parallel integral file used 1 records with 0 large values - - NWChem Gradients Module - ----------------------- - - - - wavefunction = RHF - - - - RHF ENERGY GRADIENTS - - atom coordinates gradient - x y z x y z - 1 O -0.015811 0.001891 0.163727 -0.000201 -0.000505 0.001671 - 2 H 0.183076 1.582557 -0.654066 0.000065 -0.000505 -0.001056 - 3 H 0.021701 -1.206501 -1.156743 0.000136 0.001011 -0.000616 - - ---------------------------------------- - | Time | 1-e(secs) | 2-e(secs) | - ---------------------------------------- - | CPU | 0.00 | 0.03 | - ---------------------------------------- - | WALL | 0.00 | 0.03 | - ---------------------------------------- - - Task times cpu: 0.1s wall: 0.1s - - - NWChem Input Module - ------------------- - - - Summary of allocated global arrays ------------------------------------ - No active global arrays - - - - GA Statistics for process 0 - ------------------------------ - - create destroy get put acc scatter gather read&inc -calls: 46 46 2296 477 27 0 0 68 -number of processes/call 1.00e+00 1.00e+00 1.00e+00 0.00e+00 0.00e+00 -bytes total: 2.70e+05 1.39e+05 2.27e+04 0.00e+00 0.00e+00 5.44e+02 -bytes remote: 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 -Max memory consumed for GA by this process: 37544 bytes - -MA_summarize_allocated_blocks: starting scan ... -MA_summarize_allocated_blocks: scan completed: 0 heap blocks, 0 stack blocks -MA usage statistics: - - allocation statistics: - heap stack - ---- ----- - current number of blocks 0 0 - maximum number of blocks 18 28 - current total bytes 0 0 - maximum total bytes 1060104 16000888 - maximum total K-bytes 1061 16001 - maximum total M-bytes 2 17 - - - CITATION - -------- - Please cite the following reference when publishing - results obtained with NWChem: - - M. Valiev, E.J. Bylaska, N. Govind, K. Kowalski, - T.P. Straatsma, H.J.J. van Dam, D. Wang, J. Nieplocha, - E. Apra, T.L. Windus, W.A. de Jong - "NWChem: a comprehensive and scalable open-source - solution for large scale molecular simulations" - Comput. Phys. Commun. 181, 1477 (2010) - doi:10.1016/j.cpc.2010.04.018 - - AUTHORS - ------- - E. Apra, E. J. Bylaska, W. A. de Jong, N. Govind, K. Kowalski, - T. P. Straatsma, M. Valiev, H. J. J. van Dam, D. Wang, T. L. Windus, - J. Hammond, J. Autschbach, K. Bhaskaran-Nair, J. Brabec, K. Lopata, - S. A. Fischer, S. Krishnamoorthy, M. Jacquelin, W. Ma, M. Klemm, O. Villa, - Y. Chen, V. Anisimov, F. Aquino, S. Hirata, M. T. Hackler, V. Konjkov, - D. Mejia-Rodriguez, T. Risthaus, M. Malagoli, A. Marenich, - A. Otero-de-la-Roza, J. Mullin, P. Nichols, R. Peverati, J. Pittner, Y. Zhao, - P.-D. Fan, A. Fonari, M. J. Williamson, R. J. Harrison, J. R. Rehr, - M. Dupuis, D. Silverstein, D. M. A. Smith, J. Nieplocha, V. Tipparaju, - M. Krishnan, B. E. Van Kuiken, A. Vazquez-Mayagoitia, L. Jensen, M. Swart, - Q. Wu, T. Van Voorhis, A. A. Auer, M. Nooijen, L. D. Crosby, E. Brown, - G. Cisneros, G. I. Fann, H. Fruchtl, J. Garza, K. Hirao, R. A. Kendall, - J. A. Nichols, K. Tsemekhman, K. Wolinski, J. Anchell, D. E. Bernholdt, - P. Borowski, T. Clark, D. Clerc, H. Dachsel, M. J. O. Deegan, K. Dyall, - D. Elwood, E. Glendening, M. Gutowski, A. C. Hess, J. Jaffe, B. G. Johnson, - J. Ju, R. Kobayashi, R. Kutteh, Z. Lin, R. Littlefield, X. Long, B. Meng, - T. Nakajima, S. Niu, L. Pollack, M. Rosing, K. Glaesemann, G. Sandrone, - M. Stave, H. Taylor, G. Thomas, J. H. van Lenthe, A. T. Wong, Z. Zhang. - - Total times cpu: 0.1s wall: 0.1s diff --git a/examples/COUPLE/lammps_nwchem/nwchem_wrap.py b/examples/COUPLE/lammps_nwchem/nwchem_wrap.py deleted file mode 100644 index 28b7239f8f..0000000000 --- a/examples/COUPLE/lammps_nwchem/nwchem_wrap.py +++ /dev/null @@ -1,447 +0,0 @@ -#!/usr/bin/env python - -# ---------------------------------------------------------------------- -# LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -# https://www.lammps.org/ Sandia National Laboratories -# Steve Plimpton, sjplimp@sandia.gov -# ---------------------------------------------------------------------- - -# Syntax: nwchem_wrap.py file/zmq ao/pw input_template -# file/zmg = messaging mode, must match LAMMPS messaging mode -# ao/pw = basis set mode, selects between atom-centered and plane-wave -# the input_template file must correspond to the appropriate basis set mode: -# the "ao" mode supports the scf and dft modules in NWChem, -# the "pw" mode supports the nwpw module. -# input_template = NWChem input file used as template, must include a -# "geometry" block with the atoms in the simulation, dummy -# xyz coordinates should be included (but are not used). -# Atom ordering must match LAMMPS input. - -# wrapper on NWChem -# receives message with list of coords -# creates NWChem inputs -# invokes NWChem to calculate self-consistent energy of that config -# reads NWChem outputs -# sends message with energy, forces, pressure to client - -from __future__ import print_function -import sys - -version = sys.version_info[0] -if version == 3: - sys.exit("The CSlib python wrapper does not yet support python 3") - -import subprocess -import re -import os -import shutil -from cslib import CSlib - -# comment out 2nd line once 1st line is correct for your system - -nwchemcmd = "mpirun -np 1 /usr/bin/nwchem" -nwchemcmd = "touch tmp" - -# enums matching FixClientMD class in LAMMPS - -SETUP,STEP = range(1,2+1) -DIM,PERIODICITY,ORIGIN,BOX,NATOMS,NTYPES,TYPES,COORDS,UNITS,CHARGE = range(1,10+1) -FORCES,ENERGY,VIRIAL,ERROR = range(1,4+1) - -# ------------------------------------- -# functions - -# error message and exit - -def error(txt): - print("ERROR:",txt) - sys.exit(1) - -# ------------------------------------- -# read initial input file to setup problem -# return natoms - -def nwchem_setup_ao(input): - - template = open(input,'r') - - geometry_block = False - natoms = 0 - - while True: - line = template.readline() - if not line: break - - if geometry_block and re.search("end",line): - geometry_block = False - if geometry_block and not re.match("#",line) : - natoms += 1 - if re.search("geometry",line): - geometry_block = True - - return natoms - -# ------------------------------------- -# write a new input file for NWChem -# assumes the NWChem input geometry is to be specified in angstroms - -def nwchem_input_write_ao(input,coords): - - template = open(input,'r') - new_input = open("nwchem_lammps.nw",'w') - - geometry_block = False - i = 0 - - while True: - line = template.readline() - if not line: break - - if geometry_block and not re.match("#",line) and re.search("end",line): - geometry_block = False - if os.path.exists("nwchem_lammps.movecs"): - # The below is hacky, but one of these lines will be ignored - # by NWChem depending on if the input file is for scf/dft. - append = "\nscf\n vectors input nwchem_lammps.movecs\nend\n" - append2 = "\ndft\n vectors input nwchem_lammps.movecs\nend\n" - line = line + append + append2 - - if geometry_block and not re.match("#",line): - x = coords[3*i+0] - y = coords[3*i+1] - z = coords[3*i+2] - coord_string = " %g %g %g \n" % (x,y,z) - atom_string = line.split()[0] - line = atom_string + coord_string - i += 1 - - if (not re.match("#",line)) and re.search("geometry",line): - geometry_block = True - line = "geometry units angstrom noautosym nocenter\n" - - print(line,file=new_input,end='') - - new_input.close() - -# ------------------------------------- -# read a NWChem output nwchem_lammps.out file - -def nwchem_read_ao(natoms, log): - - nwchem_output = open(log, 'r') - energy_pattern = r"Total \w+ energy" - gradient_pattern = "x y z x y z" - - eout = 0.0 - fout = [] - - while True: - line = nwchem_output.readline() - if not line: break - - # pattern match for energy - if re.search(energy_pattern,line): - eout = float(line.split()[4]) - - # pattern match for forces - if re.search(gradient_pattern, line): - for i in range(natoms): - line = nwchem_output.readline() - forces = line.split() - fout += [float(forces[5]), float(forces[6]), float(forces[7])] - - # convert units - hartree2eV = 27.21138602 - bohr2angstrom = 0.52917721092 - eout = eout * hartree2eV - fout = [i * -hartree2eV/bohr2angstrom for i in fout] - - return eout,fout - -# ------------------------------------- -# read initial planewave input file to setup problem -# return natoms,box -def nwchem_setup_pw(input): - - template = open(input,'r') - - geometry_block = False - system_block = False - coord_pattern = r"^\s*\w{1,2}(?:\s+-?(?:\d+.?\d*|\d*.?\d+)){3}" - natoms = 0 - box = [] - - while True: - line = template.readline() - if not line: break - - if geometry_block and re.search("system crystal",line): - system_block = True - for i in range(3): - line = template.readline() - line = re.sub(r'd|D', 'e', line) - box += [float(line.split()[1])] - - if geometry_block and not system_block and re.match("#",line) and re.search("end",line): - geometry_block = False - - if system_block and re.search("end",line): - system_block = False - - if geometry_block and not re.match("#",line) and re.search(coord_pattern,line): - natoms += 1 - - if re.search("geometry",line) and not re.match("#",line): - geometry_block = True - - return natoms,box - -# ------------------------------------- -# write a new planewave input file for NWChem -# assumes the NWChem input geometry is to be specified fractional coordinates - -def nwchem_input_write_pw(input,coords,box): - - template = open(input,'r') - new_input = open("nwchem_lammps.nw",'w') - - writing_atoms = False - geometry_block = False - system_block = False - coord_pattern = r"^\s*\w{1,2}(?:\s+-?(?:\d+.?\d*|\d*.?\d+)){3}" - i = 0 - - while True: - line = template.readline() - if not line: break - - if geometry_block and re.search("system crystal",line): - system_block = True - - if geometry_block and not system_block and not re.match("#",line) and re.search("end",line): - geometry_block = False - if os.path.exists("nwchem_lammps.movecs"): - append = "\nnwpw\n vectors input nwchem_lammps.movecs\nend\n" - line = line + append - - if system_block and re.search("end",line): - system_block = False - - if geometry_block and not re.match("#",line) and re.search(coord_pattern,line): - x = coords[3*i+0] / box[0] - y = coords[3*i+1] / box[1] - z = coords[3*i+2] / box[2] - coord_string = " %g %g %g \n" % (x,y,z) - atom_string = line.split()[0] - line = atom_string + coord_string - i += 1 - - if re.search("geometry",line) and not re.match("#",line): - geometry_block = True - - print(line,file=new_input,end='') - - new_input.close() - -# ------------------------------------- -# read a NWChem output nwchem_lammps.out file for planewave calculation - -def nwchem_read_pw(log): - nw_output = open(log, 'r') - - eout = 0.0 - sout = [] - fout = [] - reading_forces = False - - while True: - line = nw_output.readline() - if not line: break - - # pattern match for energy - if re.search("PSPW energy",line): - eout = float(line.split()[4]) - - # pattern match for forces - if re.search("C\.O\.M", line): - reading_forces = False - if reading_forces: - forces = line.split() - fout += [float(forces[3]), float(forces[4]), float(forces[5])] - if re.search("Ion Forces",line): - reading_forces = True - - # pattern match for stress - if re.search("=== total gradient ===",line): - stensor = [] - for i in range(3): - line = nw_output.readline() - line = line.replace("S ="," ") - stress = line.split() - stensor += [float(stress[1]), float(stress[2]), float(stress[3])] - sxx = stensor[0] - syy = stensor[4] - szz = stensor[8] - sxy = 0.5 * (float(stensor[1]) + float(stensor[3])) - sxz = 0.5 * (stensor[2] + stensor[6]) - syz = 0.5 * (stensor[5] + stensor[7]) - sout = [sxx,syy,szz,sxy,sxz,syz] - - # convert units - hartree2eV = 27.21138602 - bohr2angstrom = 0.52917721092 - austress2bar = 294210156.97 - eout = eout * hartree2eV - fout = [i * hartree2eV/bohr2angstrom for i in fout] - sout = [i * austress2bar for i in sout] - - return eout,fout,sout - -# ------------------------------------- -# main program - -# command-line args -# -if len(sys.argv) != 4: - print("Syntax: python nwchem_wrap.py file/zmq ao/pw input_template") - sys.exit(1) - -comm_mode = sys.argv[1] -basis_type = sys.argv[2] -input_template = sys.argv[3] - -if comm_mode == "file": cs = CSlib(1,comm_mode,"tmp.couple",None) -elif comm_mode == "zmq": cs = CSlib(1,comm_mode,"*:5555",None) -else: - print("Syntax: python nwchem_wrap.py file/zmq") - sys.exit(1) - - -natoms = 0 -box = [] -if basis_type == "ao": - natoms = nwchem_setup_ao(input_template) -elif basis_type == "pw": - natoms,box = nwchem_setup_pw(input_template) - -# initial message for AIMD protocol - -msgID,nfield,fieldID,fieldtype,fieldlen = cs.recv() -if msgID != 0: error("Bad initial client/server handshake") -protocol = cs.unpack_string(1) -if protocol != "md": error("Mismatch in client/server protocol") -cs.send(0,0) - -# endless server loop - -i = 0 -if not os.path.exists("nwchem_logs"): - os.mkdir("nwchem_logs") - -while 1: - - # recv message from client - # msgID = 0 = all-done message - - msgID,nfield,fieldID,fieldtype,fieldlen = cs.recv() - if msgID < 0: break - - # SETUP receive at beginning of each run - # required fields: DIM, PERIODICITY, ORIGIN, BOX, - # NATOMS, COORDS - # optional fields: others in enum above, but NWChem ignores them - - if msgID == SETUP: - - origin = [] - box_lmp = [] - natoms_recv = ntypes_recv = 0 - types = [] - coords = [] - - for field in fieldID: - if field == DIM: - dim = cs.unpack_int(DIM) - if dim != 3: error("NWChem only performs 3d simulations") - elif field == PERIODICITY: - periodicity = cs.unpack(PERIODICITY,1) - if basis_type == "ao": - if periodicity[0] or periodicity[1] or periodicity[2]: - error("NWChem AO basis wrapper only currently supports fully aperiodic systems") - elif basis_type == "pw": - if not periodicity[0] or not periodicity[1] or not periodicity[2]: - error("NWChem PW basis wrapper only currently supports fully periodic systems") - elif field == ORIGIN: - origin = cs.unpack(ORIGIN,1) - elif field == BOX: - box_lmp = cs.unpack(BOX,1) - if (basis_type == "pw"): - if (box[0] != box_lmp[0] or box[1] != box_lmp[4] or box[2] != box_lmp[8]): - error("NWChem wrapper mismatch in box dimensions") - elif field == NATOMS: - natoms_recv = cs.unpack_int(NATOMS) - if natoms != natoms_recv: - error("NWChem wrapper mismatch in number of atoms") - elif field == COORDS: - coords = cs.unpack(COORDS,1) - - if not origin or not box_lmp or not natoms or not coords: - error("Required NWChem wrapper setup field not received"); - - # STEP receive at each timestep of run or minimization - # required fields: COORDS - # optional fields: ORIGIN, BOX - - elif msgID == STEP: - - coords = [] - - for field in fieldID: - if field == COORDS: - coords = cs.unpack(COORDS,1) - - if not coords: error("Required NWChem wrapper step field not received"); - - else: error("NWChem wrapper received unrecognized message") - - # unpack coords from client - # create NWChem input - - if basis_type == "ao": - nwchem_input_write_ao(input_template,coords) - elif basis_type == "pw": - nwchem_input_write_pw(input_template,coords,box) - - # invoke NWChem - - i += 1 - log = "nwchem_lammps.out" - archive = "nwchem_logs/nwchem_lammps" + str(i) + ".out" - cmd = nwchemcmd + " nwchem_lammps.nw > " + log - print("\nLaunching NWChem ...") - print(cmd) - subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) - - shutil.copyfile(log,archive) - - # process NWChem output - - if basis_type == "ao": - energy,forces = nwchem_read_ao(natoms,log) - virial = [0,0,0,0,0,0] - elif basis_type == "pw": - energy,forces,virial = nwchem_read_pw(log) - - # return forces, energy to client - cs.send(msgID,3) - cs.pack(FORCES,4,3*natoms,forces) - cs.pack_double(ENERGY,energy) - cs.pack(VIRIAL,4,6,virial) - -# final reply to client - -cs.send(0,0) - -# clean-up - -del cs diff --git a/examples/COUPLE/lammps_nwchem/planewave/data.W b/examples/COUPLE/lammps_nwchem/planewave/data.W deleted file mode 100644 index 8accd9ca79..0000000000 --- a/examples/COUPLE/lammps_nwchem/planewave/data.W +++ /dev/null @@ -1,15 +0,0 @@ -LAMMPS W data file - -2 atoms - -1 atom types - -0.0 3.16 xlo xhi -0.0 3.16 ylo yhi -0.0 3.16 zlo zhi - -Atoms - -1 1 0.000 0.000 0.000 -2 1 1.58 1.58 1.58 - diff --git a/examples/COUPLE/lammps_nwchem/planewave/in.client.W b/examples/COUPLE/lammps_nwchem/planewave/in.client.W deleted file mode 100644 index 8eef888b5b..0000000000 --- a/examples/COUPLE/lammps_nwchem/planewave/in.client.W +++ /dev/null @@ -1,34 +0,0 @@ -# small W unit cell for use with NWChem - -variable mode index file - -if "${mode} == file" then & - "message client md file tmp.couple" & -elif "${mode} == zmq" & - "message client md zmq localhost:5555" & - -variable x index 1 -variable y index 1 -variable z index 1 - -units metal -atom_style atomic -atom_modify sort 0 0.0 map yes - -read_data data.W -mass 1 183.85 - -replicate $x $y $z - -velocity all create 300.0 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 10 check no - -fix 1 all nve -fix 2 all client/md -fix_modify 2 energy yes - -thermo 1 -run 3 - diff --git a/examples/COUPLE/lammps_nwchem/planewave/in.client.W.min b/examples/COUPLE/lammps_nwchem/planewave/in.client.W.min deleted file mode 100644 index 2cdca6b006..0000000000 --- a/examples/COUPLE/lammps_nwchem/planewave/in.client.W.min +++ /dev/null @@ -1,38 +0,0 @@ -# small W unit cell for use with NWChem - -variable mode index file - -if "${mode} == file" then & - "message client md file tmp.couple" & -elif "${mode} == zmq" & - "message client md zmq localhost:5555" & - -variable x index 1 -variable y index 1 -variable z index 1 - -units metal -atom_style atomic -atom_modify sort 0 0.0 map yes - -read_data data.W -mass 1 183.85 - -group one id 2 -displace_atoms one move 0.1 0.2 0.3 - -replicate $x $y $z - -velocity all create 300.0 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 10 check no - -fix 1 all nve -fix 2 all client/md -fix_modify 2 energy yes - -dump 1 all custom 1 dump.W.min id type x y z - -thermo 1 -minimize 1.0e-6 1.0e-6 10 50 diff --git a/examples/COUPLE/lammps_nwchem/planewave/log.client.output b/examples/COUPLE/lammps_nwchem/planewave/log.client.output deleted file mode 100644 index b797816583..0000000000 --- a/examples/COUPLE/lammps_nwchem/planewave/log.client.output +++ /dev/null @@ -1,76 +0,0 @@ -LAMMPS (18 Sep 2018) -# small W unit cell for use with NWChem - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" -message client md file tmp.couple -variable x index 1 -variable y index 1 -variable z index 1 - -units metal -atom_style atomic -atom_modify sort 0 0.0 map yes - -read_data data.W - orthogonal box = (0 0 0) to (3.16 3.16 3.16) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 2 atoms -mass 1 183.85 - -replicate $x $y $z -replicate 1 $y $z -replicate 1 1 $z -replicate 1 1 1 - orthogonal box = (0 0 0) to (3.16 3.16 3.16) - 1 by 1 by 1 MPI processor grid - 2 atoms - Time spent = 0.000187325 secs - -velocity all create 300.0 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 10 check no - -fix 1 all nve -fix 2 all client/md -fix_modify 2 energy yes - -thermo 1 -run 3 -Per MPI rank memory allocation (min/avg/max) = 1.8 | 1.8 | 1.8 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 300 0 0 -549.75686 36815830 - 1 300 0 0 -549.75686 36815830 - 2 300 0 0 -549.75686 36815830 - 3 300 0 0 -549.75686 36815830 -Loop time of 0.400933 on 1 procs for 3 steps with 2 atoms - -Performance: 0.646 ns/day, 37.123 hours/ns, 7.483 timesteps/s -0.1% CPU use with 1 MPI tasks x 1 OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 4.755e-06 | 4.755e-06 | 4.755e-06 | 0.0 | 0.00 -Output | 0.00010114 | 0.00010114 | 0.00010114 | 0.0 | 0.03 -Modify | 0.40082 | 0.40082 | 0.40082 | 0.0 | 99.97 -Other | | 1.232e-05 | | | 0.00 - -Nlocal: 2 ave 2 max 2 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 7 ave 7 max 7 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 0 -Dangerous builds not checked - -Total wall time: 0:00:09 diff --git a/examples/COUPLE/lammps_nwchem/planewave/log.lammps.W.3Oct19 b/examples/COUPLE/lammps_nwchem/planewave/log.lammps.W.3Oct19 deleted file mode 100644 index 6087cd22bb..0000000000 --- a/examples/COUPLE/lammps_nwchem/planewave/log.lammps.W.3Oct19 +++ /dev/null @@ -1,78 +0,0 @@ -LAMMPS (19 Sep 2019) -# small W unit cell for use with NWChem - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" -message client md file tmp.couple -variable x index 1 -variable y index 1 -variable z index 1 - -units metal -atom_style atomic -atom_modify sort 0 0.0 map yes - -read_data data.W - orthogonal box = (0 0 0) to (3.16 3.16 3.16) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 2 atoms - read_data CPU = 0.0014801 secs -mass 1 183.85 - -replicate $x $y $z -replicate 1 $y $z -replicate 1 1 $z -replicate 1 1 1 - orthogonal box = (0 0 0) to (3.16 3.16 3.16) - 1 by 1 by 1 MPI processor grid - 2 atoms - replicate CPU = 0.000123978 secs - -velocity all create 300.0 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 10 check no - -fix 1 all nve -fix 2 all client/md -fix_modify 2 energy yes - -thermo 1 -run 3 -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:166) -Per MPI rank memory allocation (min/avg/max) = 1.801 | 1.801 | 1.801 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 300 0 0 -549.75686 36815830 - 1 298.93216 0 0 -549.75686 36815825 - 2 295.76254 0 0 -549.75687 36814830 - 3 290.55935 0 0 -549.75687 36811865 -Loop time of 2.60414 on 1 procs for 3 steps with 2 atoms - -Performance: 0.100 ns/day, 241.124 hours/ns, 1.152 timesteps/s -0.0% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 7.1526e-06 | 7.1526e-06 | 7.1526e-06 | 0.0 | 0.00 -Output | 0.00012779 | 0.00012779 | 0.00012779 | 0.0 | 0.00 -Modify | 2.604 | 2.604 | 2.604 | 0.0 | 99.99 -Other | | 9.06e-06 | | | 0.00 - -Nlocal: 2 ave 2 max 2 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 7 ave 7 max 7 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 0 -Dangerous builds not checked - -Total wall time: 0:00:05 diff --git a/examples/COUPLE/lammps_nwchem/planewave/log.lammps.W.min.3Oct19 b/examples/COUPLE/lammps_nwchem/planewave/log.lammps.W.min.3Oct19 deleted file mode 100644 index e54cc3c433..0000000000 --- a/examples/COUPLE/lammps_nwchem/planewave/log.lammps.W.min.3Oct19 +++ /dev/null @@ -1,92 +0,0 @@ -LAMMPS (19 Sep 2019) -# small W unit cell for use with NWChem - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" -message client md file tmp.couple -variable x index 1 -variable y index 1 -variable z index 1 - -units metal -atom_style atomic -atom_modify sort 0 0.0 map yes - -read_data data.W - orthogonal box = (0 0 0) to (3.16 3.16 3.16) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 2 atoms - read_data CPU = 0.00183487 secs -mass 1 183.85 - -group one id 2 -1 atoms in group one -displace_atoms one move 0.1 0.2 0.3 - -replicate $x $y $z -replicate 1 $y $z -replicate 1 1 $z -replicate 1 1 1 - orthogonal box = (0 0 0) to (3.16 3.16 3.16) - 1 by 1 by 1 MPI processor grid - 2 atoms - replicate CPU = 0.000159979 secs - -velocity all create 300.0 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 10 check no - -fix 1 all nve -fix 2 all client/md -fix_modify 2 energy yes - -dump 1 all custom 1 tmp.dump id type x y z - -thermo 1 -minimize 1.0e-6 1.0e-6 10 50 -WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (../min.cpp:174) -WARNING: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (../comm_brick.cpp:166) -Per MPI rank memory allocation (min/avg/max) = 4.676 | 4.676 | 4.676 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 300 0 0 -547.52142 28510277 - 1 300 0 0 -549.43104 35614471 - 2 300 0 0 -549.75661 36815830 - 3 300 0 0 -549.75662 36815830 -Loop time of 7.71121 on 1 procs for 3 steps with 2 atoms - -0.0% CPU use with 1 MPI tasks x no OpenMP threads - -Minimization stats: - Stopping criterion = energy tolerance - Energy initial, next-to-last, final = - -547.560202518 -549.795386038 -549.795398827 - Force two-norm initial, final = 16.0041 0.00108353 - Force max component initial, final = 9.57978 0.000719909 - Final line search alpha, max atom move = 1 0.000719909 - Iterations, force evaluations = 3 5 - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 9.5367e-07 | 9.5367e-07 | 9.5367e-07 | 0.0 | 0.00 -Comm | 1.3113e-05 | 1.3113e-05 | 1.3113e-05 | 0.0 | 0.00 -Output | 0.00017023 | 0.00017023 | 0.00017023 | 0.0 | 0.00 -Modify | 7.7109 | 7.7109 | 7.7109 | 0.0 |100.00 -Other | | 0.0001729 | | | 0.00 - -Nlocal: 2 ave 2 max 2 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 1 -Dangerous builds not checked -Total wall time: 0:00:19 diff --git a/examples/COUPLE/lammps_nwchem/planewave/nwchem_lammps.out b/examples/COUPLE/lammps_nwchem/planewave/nwchem_lammps.out deleted file mode 100644 index 92f2ff0037..0000000000 --- a/examples/COUPLE/lammps_nwchem/planewave/nwchem_lammps.out +++ /dev/null @@ -1,2305 +0,0 @@ - argument 1 = w.nw - - - -============================== echo of input deck ============================== -echo - -#**** Enter the geometry using fractional coordinates **** -geometry units angstrom noautosym - system crystal - lat_a 3.16d0 - lat_b 3.16d0 - lat_c 3.16d0 - end -W 0.0 0.0 0.0 -W 0.5 0.5 0.5 -end - -#***** setup the nwpw gamma point code **** -nwpw - simulation_cell - ngrid 16 16 16 - end - ewald_ncut 8 - mulliken - lcao #old default -end - -nwpw - tolerances 1.0d-9 1.0d-9 -end - -task pspw stress -================================================================================ - - - - - - - Northwest Computational Chemistry Package (NWChem) 6.8 - ------------------------------------------------------ - - - Environmental Molecular Sciences Laboratory - Pacific Northwest National Laboratory - Richland, WA 99352 - - Copyright (c) 1994-2017 - Pacific Northwest National Laboratory - Battelle Memorial Institute - - NWChem is an open-source computational chemistry package - distributed under the terms of the - Educational Community License (ECL) 2.0 - A copy of the license is included with this distribution - in the LICENSE.TXT file - - ACKNOWLEDGMENT - -------------- - - This software and its documentation were developed at the - EMSL at Pacific Northwest National Laboratory, a multiprogram - national laboratory, operated for the U.S. Department of Energy - by Battelle under Contract Number DE-AC05-76RL01830. Support - for this work was provided by the Department of Energy Office - of Biological and Environmental Research, Office of Basic - Energy Sciences, and the Office of Advanced Scientific Computing. - - - Job information - --------------- - - hostname = mcq - program = nwchem - date = Mon Sep 23 14:29:18 2019 - - compiled = Wed_Aug_15_19:14:19_2018 - source = /home/edo/debichem-team/nwchem/nwchem-6.8.1 - nwchem branch = 6.8.1 - nwchem revision = v6.8-133-ge032219 - ga revision = 5.6.5 - use scalapack = T - input = w.nw - prefix = w. - data base = ./w.db - status = startup - nproc = 1 - time left = -1s - - - - Memory information - ------------------ - - heap = 13107194 doubles = 100.0 Mbytes - stack = 13107199 doubles = 100.0 Mbytes - global = 26214400 doubles = 200.0 Mbytes (distinct from heap & stack) - total = 52428793 doubles = 400.0 Mbytes - verify = yes - hardfail = no - - - Directory information - --------------------- - - 0 permanent = . - 0 scratch = . - - - - - NWChem Input Module - ------------------- - - - - !!!!!!!!! geom_3d NEEDS TESTING !!!!!!!!!! - - - Geometry "geometry" -> "" - ------------------------- - - Output coordinates in angstroms (scale by 1.889725989 to convert to a.u.) - - No. Tag Charge X Y Z - ---- ---------------- ---------- -------------- -------------- -------------- - 1 W 74.0000 0.00000000 0.00000000 0.00000000 - 2 W 74.0000 1.58000000 1.58000000 1.58000000 - - Lattice Parameters - ------------------ - - lattice vectors in angstroms (scale by 1.889725989 to convert to a.u.) - - a1=< 3.160 0.000 0.000 > - a2=< 0.000 3.160 0.000 > - a3=< 0.000 0.000 3.160 > - a= 3.160 b= 3.160 c= 3.160 - alpha= 90.000 beta= 90.000 gamma= 90.000 - omega= 31.6 - - reciprocal lattice vectors in a.u. - - b1=< 1.052 0.000 -0.000 > - b2=< -0.000 1.052 -0.000 > - b3=< 0.000 0.000 1.052 > - - Atomic Mass - ----------- - - W 183.951000 - - - - XYZ format geometry - ------------------- - 2 - geometry - W 0.00000000 0.00000000 0.00000000 - W 1.58000000 1.58000000 1.58000000 - - ============================================================================== - internuclear distances - ------------------------------------------------------------------------------ - center one | center two | atomic units | angstroms - ------------------------------------------------------------------------------ - 2 W | 1 W | 5.17150 | 2.73664 - ------------------------------------------------------------------------------ - number of included internuclear distances: 1 - ============================================================================== - - - - >>>> PSPW Parallel Module - stress <<<< - **************************************************** - * * - * NWPW PSPW Calculation * - * * - * [ (Grassmann/Stiefel manifold implementation) ] * - * * - * [ NorthWest Chemistry implementation ] * - * * - * version #5.10 06/12/02 * - * * - * This code was developed by Eric J. Bylaska, * - * and was based upon algorithms and code * - * developed by the group of Prof. John H. Weare * - * * - **************************************************** - >>> JOB STARTED AT Mon Sep 23 14:29:18 2019 <<< - ================ input data ======================== - library name resolved from: compiled reference - NWCHEM_NWPW_LIBRARY set to: - Generating 1d pseudopotential for W - - Generated formatted_filename: ./W.vpp - library name resolved from: compiled reference - NWCHEM_NWPW_LIBRARY set to: - - Generated formatted atomic orbitals, filename: ./W.aorb - - lcao guess, initial psi:w.movecs - - spin, nalpha, nbeta: 1 6 0 - - input psi filename:./w.movecs - - initializing pspw_APC data structure - ------------------------------------ - nga, ngs: 3 6 - Gc : 2.5000000000000000 - APC gamma: 1 0.59999999999999998 - APC gamma: 2 0.90000000000000002 - APC gamma: 3 1.3500000000000001 - - number of processors used: 1 - processor grid : 1 x 1 - parallel mapping :2d hilbert - parallel mapping : balanced - number of threads : 1 - parallel io : off - - options: - boundary conditions = periodic (version3) - electron spin = restricted - exchange-correlation = LDA (Vosko et al) parameterization - - elements involved in the cluster: - 1: W valence charge: 6.0000 lmax= 2 - comment : Troullier-Martins pseudopotential - pseudpotential type : 0 - highest angular component : 2 - local potential used : 0 - number of non-local projections: 8 - semicore corrections included : 1.800 (radius) 4.533 (charge) - cutoff = 2.389 3.185 2.244 - - - total charge: 0.000 - - atomic composition: - W : 2 - - number of electrons: spin up= 6 ( 6 per task) down= 6 ( 6 per task) (Fourier space) - number of orbitals : spin up= 6 ( 6 per task) down= 6 ( 6 per task) (Fourier space) - - supercell: - cell_name: cell_default - lattice: a1=< 5.972 0.000 0.000 > - a2=< 0.000 5.972 0.000 > - a3=< 0.000 0.000 5.972 > - reciprocal: b1=< 1.052 0.000 -0.000 > - b2=< -0.000 1.052 -0.000 > - b3=< 0.000 0.000 1.052 > - lattice: a= 5.972 b= 5.972 c= 5.972 - alpha= 90.000 beta= 90.000 gamma= 90.000 - omega= 212.9 - - density cutoff= 8.857 fft= 16x 16x 16( 126 waves 126 per task) - wavefnc cutoff= 8.857 fft= 16x 16x 16( 126 waves 126 per task) - Ewald summation: cut radius= 1.90 and 8 - Madelung Wigner-Seitz= 1.76011888 (alpha= 2.83729748 rs= 3.70444413) - - technical parameters: - time step= 5.80 fictitious mass= 400000.0 - tolerance=0.100E-08 (energy) 0.100E-08 (density) - maximum iterations = 1000 ( 10 inner 100 outer ) - - - - - -== Energy Calculation == - - - ====== Grassmann conjugate gradient iteration ====== - >>> ITERATION STARTED AT Mon Sep 23 14:29:20 2019 <<< - iter. Energy DeltaE DeltaRho - ------------------------------------------------------ - - 15 steepest descent iterations performed - 10 -0.2000104801E+02 -0.37587E-05 0.13338E-06 - 20 -0.2000105396E+02 -0.10125E-07 0.37843E-09 - 30 -0.2000105397E+02 -0.67882E-09 0.25413E-10 - *** tolerance ok. iteration terminated - >>> ITERATION ENDED AT Mon Sep 23 14:29:20 2019 <<< - - -== Summary Of Results == - - number of electrons: spin up= 6.00000 down= 6.00000 (real space) - - total energy : -0.2000105397E+02 ( -0.10001E+02/ion) - total orbital energy: 0.5258382071E+01 ( 0.87640E+00/electron) - hartree energy : 0.2613505492E+00 ( 0.43558E-01/electron) - exc-corr energy : -0.9420636831E+01 ( -0.15701E+01/electron) - ion-ion energy : -0.2193948839E+02 ( -0.10970E+02/ion) - - kinetic (planewave) : 0.1407870943E+02 ( 0.23465E+01/electron) - V_local (planewave) : 0.1138092693E+02 ( 0.18968E+01/electron) - V_nl (planewave) : -0.1436191566E+02 ( -0.23937E+01/electron) - V_Coul (planewave) : 0.5227010984E+00 ( 0.87117E-01/electron) - V_xc. (planewave) : -0.6362039732E+01 ( -0.10603E+01/electron) - Virial Coefficient : -0.6265011295E+00 - - orbital energies: - 0.5487535E+00 ( 14.932eV) - 0.5487525E+00 ( 14.932eV) - 0.5487517E+00 ( 14.932eV) - 0.3889676E+00 ( 10.584eV) - 0.3889667E+00 ( 10.584eV) - 0.2049989E+00 ( 5.578eV) - - Total PSPW energy : -0.2000105397E+02 - - -=== Spin Contamination === - - = 0.0000000000000000 - = 0.0000000000000000 - - - -== Center of Charge == - -spin up ( -0.0000, -0.0000, -0.0000 ) -spin down ( -0.0000, -0.0000, -0.0000 ) - total ( -0.0000, -0.0000, -0.0000 ) -ionic ( 1.4929, 1.4929, 1.4929 ) - - -== Molecular Dipole wrt Center of Mass == - -mu = ( 17.9146, 17.9146, 17.9146 ) au -|mu| = 31.0290 au, 78.8633 Debye - -== W.psp1 expansion coefficients == - -ATOM S P D F -W : 0.93998E-01 0.56488E-01 0.13036E+01 0.00000E+00 - - - - Generated formatted atomic orbitals, filename: ./W.aorb - - - - ************************************************************* - ** ** - ** PSPW Mulliken analysis ** - ** ** - ** Population analysis algorithm devloped by Ryoichi Kawai ** - ** ** - ** Mon Sep 23 14:29 ** - ** ** - ************************************************************* - - -== XYZ OUTPUT == - - - 2 - -W 0.000000 0.000000 0.000000 -W 1.579999 1.579999 1.579999 - - -== Atomic Orbital Expansion == - - W nodamping - - - ===================================================== - | POPULATION ANALYSIS OF FILLED MOLECULAR ORBITALS | - ===================================================== - - -== Using pseudoatomic orbital expansion == - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 1*** SPIN=BOTH SUM= 0.12495E+01 E= 0.54875E+00 ( 14.932eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 -0.00000 -0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 0.00000 -0.42734 -0.00000 0.56337 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 0.00000 -0.00000 -0.00000 -0.00000 -0.00000 0.00000 0.00000 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00000 0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 0.00000 -0.42734 -0.00000 0.56337 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 0.00000 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 2*** SPIN=BOTH SUM= 0.12495E+01 E= 0.54875E+00 ( 14.932eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 -0.00000 -0.00000 0.00002 0.00000 0.70711 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 -0.00001 0.00000 0.00000 -0.00000 0.00000 0.00000 -0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 -0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 -0.00000 -0.00000 0.00002 0.00000 0.70711 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 -0.00001 0.00000 0.00000 -0.00000 0.00000 -0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 3*** SPIN=BOTH SUM= 0.12495E+01 E= 0.54875E+00 ( 14.932eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 -0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 0.00000 -0.56337 -0.00000 -0.42734 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 0.00000 0.00000 -0.00000 0.00000 -0.00000 -0.00000 0.00000 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00000 0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 0.00000 -0.56337 -0.00000 -0.42734 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 0.00000 0.00000 -0.00000 -0.00000 -0.00000 -0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 4*** SPIN=BOTH SUM= 0.14281E+01 E= 0.38897E+00 ( 10.584eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.49992 0.42773 0.00000 0.56299 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00009 0.00925 0.00000 0.00000 0.00000 -0.00000 -0.00000 0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.49991 -0.42773 0.00000 -0.56299 0.00000 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00009 -0.00925 0.00000 0.00000 0.00000 -0.00000 -0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 0.9998 0.0002 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 5*** SPIN=BOTH SUM= 0.15051E+01 E= 0.38897E+00 ( 10.584eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 -0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.47435 -0.54841 0.00000 0.41665 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.02565 -0.16016 -0.00000 0.00000 0.00000 0.00000 0.00000 -0.00000 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00000 0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.47435 0.54841 0.00000 -0.41665 0.00000 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.02565 0.16016 -0.00000 0.00000 0.00000 0.00000 -0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 0.9487 0.0513 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 6*** SPIN=BOTH SUM= 0.19550E+01 E= 0.20500E+00 ( 5.578eV) - -NO ATOM L POPULATION - s - 1 W 0 0.49970 0.70689 - px pz py - 1 W 1 0.00000 0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.00000 -0.00000 -0.00000 0.00000 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00030 -0.01746 -0.00000 0.00000 -0.00000 0.00000 -0.00000 -0.00000 - s - 2 W 0 0.49970 0.70689 - px pz py - 2 W 1 0.00000 -0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.00000 0.00000 -0.00000 -0.00000 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00030 -0.01746 -0.00000 0.00000 -0.00000 0.00000 -0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.9994 0.0000 0.0000 0.0006 - - - ======================================== - | POPULATION ANALYSIS ON EACH ATOM | - ======================================== - - -NO ATOM SPIN TOTAL s p d f - 1 W UP 3.00000 0.49970 0.00000 2.47426 0.02604 - 1 W DOWN 3.00000 0.49970 0.00000 2.47426 0.02604 - 2 W UP 3.00000 0.49970 0.00000 2.47426 0.02604 - 2 W DOWN 3.00000 0.49970 0.00000 2.47426 0.02604 - - - -=== TOTAL ANGULAR MOMENTUM POPULATION === - - SPIN s p d f - UP 16.66% 0.00% 82.48% 0.87% - UP 16.66% 0.00% 82.48% 0.87% - TOTAL 16.66% 0.00% 82.48% 0.87% - - ************************************************************* - ** ** - ** PSPW Atomic Point Charge (APC) Analysis ** - ** ** - ** Point charge analysis based on paper by P.E. Blochl ** - ** (J. Chem. Phys. vol 103, page 7422, 1995) ** - ** ** - ************************************************************* - - pspw_APC data structure - ----------------------- - nga, ngs: 3 6 - Gc : 2.5000000000000000 - APC gamma: 1 0.59999999999999998 - APC gamma: 2 0.90000000000000002 - APC gamma: 3 1.3500000000000001 - - charge analysis on each atom - ---------------------------- - - no atom Qelc Qion Qtotal - -- ---- ------- ------- ------- - 1 W -3.500 6.000 2.500 - 2 W -9.500 6.000 -3.500 - Total Q -13.000 12.000 -1.000 - - - gaussian coefficients of model density - -------------------------------------- - - no atom g=0.000 g=0.600 g=0.900 g=1.350 - -- ---- ------- ------- ------- ------- - 1 W 6.000 46.000 -75.500 26.000 - 2 W 6.000 -17.625 40.500 -32.375 - - -=== Electric Field at Atoms === - - 1 W Atomic Electric Field =( -0.00000 0.00000 0.00000 ) - (ion) =( 0.00000 0.00000 -0.00000 ) - (electronic) =( -0.00000 0.00000 0.00000 ) - 2 W Atomic Electric Field =( -0.00000 -0.00000 0.00000 ) - (ion) =( -0.00000 -0.00000 0.00000 ) - (electronic) =( -0.00000 -0.00000 0.00000 ) - - output psi filename:./w.movecs - - -== Timing == - -cputime in seconds - prologue : 0.246520E+01 - main loop : 0.218408E+00 - epilogue : 0.196378E+00 - total : 0.287999E+01 - cputime/step: 0.186674E-02 ( 117 evalulations, 25 linesearches) - - -Time spent doing total step percent - total time : 0.288044E+01 0.246191E-01 100.0 % - i/o time : 0.793162E+00 0.677916E-02 27.5 % - FFTs : 0.794410E-01 0.678983E-03 2.8 % - dot products : 0.401928E-02 0.343528E-04 0.1 % - geodesic : 0.812297E-02 0.694271E-04 0.3 % - ffm_dgemm : 0.340981E-03 0.291437E-05 0.0 % - fmf_dgemm : 0.111075E-02 0.949356E-05 0.0 % - mmm_dgemm : 0.146757E-03 0.125433E-05 0.0 % - m_diagonalize : 0.464895E-03 0.397346E-05 0.0 % - exchange correlation : 0.105077E+00 0.898093E-03 3.6 % - local pseudopotentials : 0.326800E-04 0.279316E-06 0.0 % - non-local pseudopotentials : 0.585081E-02 0.500069E-04 0.2 % - hartree potentials : 0.774990E-03 0.662385E-05 0.0 % - ion-ion interaction : 0.368566E-02 0.315014E-04 0.1 % - structure factors : 0.526235E+00 0.449774E-02 18.3 % - phase factors : 0.173820E-04 0.148564E-06 0.0 % - masking and packing : 0.134380E+00 0.114855E-02 4.7 % - queue fft : 0.649379E-01 0.555025E-03 2.3 % - queue fft (serial) : 0.461475E-01 0.394423E-03 1.6 % - queue fft (message passing): 0.166764E-01 0.142533E-03 0.6 % - non-local psp FFM : 0.303331E-02 0.259257E-04 0.1 % - non-local psp FMF : 0.706270E-03 0.603650E-05 0.0 % - non-local psp FFM A : 0.298729E-03 0.255324E-05 0.0 % - non-local psp FFM B : 0.252926E-02 0.216176E-04 0.1 % - - >>> JOB COMPLETED AT Mon Sep 23 14:29:21 2019 <<< - **************************************************** - * * - * NWPW PSPW Calculation * - * * - * [ (Grassmann/Stiefel manifold implementation) ] * - * * - * [ NorthWest Chemistry implementation ] * - * * - * version #5.10 06/12/02 * - * * - * This code was developed by Eric J. Bylaska, * - * and was based upon algorithms and code * - * developed by the group of Prof. John H. Weare * - * * - **************************************************** - >>> JOB STARTED AT Mon Sep 23 14:29:21 2019 <<< - ================ input data ======================== - - input psi filename:./w.movecs - - initializing pspw_APC data structure - ------------------------------------ - nga, ngs: 3 6 - Gc : 2.5000000000000000 - APC gamma: 1 0.59999999999999998 - APC gamma: 2 0.90000000000000002 - APC gamma: 3 1.3500000000000001 - - number of processors used: 1 - processor grid : 1 x 1 - parallel mapping :2d hilbert - parallel mapping : balanced - number of threads : 1 - parallel io : off - - options: - boundary conditions = periodic (version3) - electron spin = restricted - exchange-correlation = LDA (Vosko et al) parameterization - - elements involved in the cluster: - 1: W valence charge: 6.0000 lmax= 2 - comment : Troullier-Martins pseudopotential - pseudpotential type : 0 - highest angular component : 2 - local potential used : 0 - number of non-local projections: 8 - semicore corrections included : 1.800 (radius) 4.537 (charge) - cutoff = 2.389 3.185 2.244 - - - total charge: 0.000 - - atomic composition: - W : 2 - - number of electrons: spin up= 6 ( 6 per task) down= 6 ( 6 per task) (Fourier space) - number of orbitals : spin up= 6 ( 6 per task) down= 6 ( 6 per task) (Fourier space) - - supercell: - cell_name: cell_default - lattice: a1=< 5.972 0.000 0.000 > - a2=< 0.000 5.972 0.000 > - a3=< 0.000 0.000 5.972 > - reciprocal: b1=< 1.052 0.000 -0.000 > - b2=< -0.000 1.052 -0.000 > - b3=< 0.000 0.000 1.052 > - lattice: a= 5.972 b= 5.972 c= 5.972 - alpha= 90.000 beta= 90.000 gamma= 90.000 - omega= 212.9 - - density cutoff= 17.714 fft= 16x 16x 16( 370 waves 370 per task) - wavefnc cutoff= 17.714 fft= 16x 16x 16( 370 waves 370 per task) - Ewald summation: cut radius= 1.90 and 8 - Madelung Wigner-Seitz= 1.76011888 (alpha= 2.83729748 rs= 3.70444413) - - technical parameters: - time step= 5.80 fictitious mass= 400000.0 - tolerance=0.100E-08 (energy) 0.100E-08 (density) - maximum iterations = 1000 ( 10 inner 100 outer ) - - - - - -== Energy Calculation == - - - ====== Grassmann conjugate gradient iteration ====== - >>> ITERATION STARTED AT Mon Sep 23 14:29:21 2019 <<< - iter. Energy DeltaE DeltaRho - ------------------------------------------------------ - 10 -0.2020117257E+02 -0.65975E-06 0.18611E-07 - 20 -0.2020117265E+02 -0.51757E-09 0.18099E-10 - *** tolerance ok. iteration terminated - >>> ITERATION ENDED AT Mon Sep 23 14:29:21 2019 <<< - - -== Summary Of Results == - - number of electrons: spin up= 6.00000 down= 6.00000 (real space) - - total energy : -0.2020117265E+02 ( -0.10101E+02/ion) - total orbital energy: 0.5095674266E+01 ( 0.84928E+00/electron) - hartree energy : 0.2895200675E+00 ( 0.48253E-01/electron) - exc-corr energy : -0.9444169901E+01 ( -0.15740E+01/electron) - ion-ion energy : -0.2193948849E+02 ( -0.10970E+02/ion) - - kinetic (planewave) : 0.1440959829E+02 ( 0.24016E+01/electron) - V_local (planewave) : 0.1156148265E+02 ( 0.19269E+01/electron) - V_nl (planewave) : -0.1507811526E+02 ( -0.25130E+01/electron) - V_Coul (planewave) : 0.5790401350E+00 ( 0.96507E-01/electron) - V_xc. (planewave) : -0.6376331545E+01 ( -0.10627E+01/electron) - Virial Coefficient : -0.6463694432E+00 - - orbital energies: - 0.5415668E+00 ( 14.737eV) - 0.5415663E+00 ( 14.737eV) - 0.5415658E+00 ( 14.737eV) - 0.3599778E+00 ( 9.796eV) - 0.3599778E+00 ( 9.796eV) - 0.2031826E+00 ( 5.529eV) - - Total PSPW energy : -0.2020117265E+02 - - -=== Spin Contamination === - - = 0.0000000000000000 - = 0.0000000000000000 - - - -== Center of Charge == - -spin up ( -0.0000, -0.0000, 0.0000 ) -spin down ( -0.0000, -0.0000, 0.0000 ) - total ( -0.0000, -0.0000, 0.0000 ) -ionic ( 1.4929, 1.4929, 1.4929 ) - - -== Molecular Dipole wrt Center of Mass == - -mu = ( 17.9146, 17.9146, 17.9146 ) au -|mu| = 31.0290 au, 78.8633 Debye - - - - ************************************************************* - ** ** - ** PSPW Mulliken analysis ** - ** ** - ** Population analysis algorithm devloped by Ryoichi Kawai ** - ** ** - ** Mon Sep 23 14:29 ** - ** ** - ************************************************************* - - -== XYZ OUTPUT == - - - 2 - -W 0.000000 0.000000 0.000000 -W 1.579999 1.579999 1.579999 - - -== Atomic Orbital Expansion == - - W nodamping - - - ===================================================== - | POPULATION ANALYSIS OF FILLED MOLECULAR ORBITALS | - ===================================================== - - -== Using pseudoatomic orbital expansion == - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 1*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54157E+00 ( 14.737eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 -0.00000 0.49980 0.00000 -0.50020 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 -0.00000 0.00000 0.00000 0.00000 0.00000 -0.00000 -0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 -0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 -0.00000 0.49980 0.00000 -0.50020 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 -0.00000 0.00000 0.00000 -0.00000 0.00000 0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 2*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54157E+00 ( 14.737eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 -0.00000 -0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 0.00000 0.00000 -0.00001 -0.00000 -0.70711 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 0.00001 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 0.00000 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00000 0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 0.00000 0.00000 -0.00001 -0.00000 -0.70711 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 0.00001 -0.00000 -0.00000 0.00000 -0.00000 0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 3*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54157E+00 ( 14.737eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 -0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 0.00000 -0.50020 -0.00000 -0.49980 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 0.00000 0.00000 -0.00000 0.00000 -0.00000 -0.00000 0.00000 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00000 0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 0.00000 -0.50020 -0.00000 -0.49980 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 0.00000 0.00000 -0.00000 -0.00000 -0.00000 0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 4*** SPIN=BOTH SUM= 0.14815E+01 E= 0.35998E+00 ( 9.796eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 0.00000 -0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.48214 0.68695 -0.00000 -0.10120 -0.00000 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.01786 0.13364 0.00000 -0.00000 -0.00000 -0.00000 0.00000 -0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.48214 -0.68695 -0.00000 0.10120 -0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.01786 -0.13364 0.00000 0.00000 -0.00000 -0.00000 -0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 0.9643 0.0357 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 5*** SPIN=BOTH SUM= 0.14420E+01 E= 0.35998E+00 ( 9.796eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 -0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.49535 0.10258 0.00000 0.69630 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00465 -0.06819 0.00000 0.00000 0.00000 0.00000 -0.00000 0.00000 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00000 0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.49535 -0.10258 0.00000 -0.69630 0.00000 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00465 0.06819 0.00000 -0.00000 0.00000 -0.00000 0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 0.9907 0.0093 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 6*** SPIN=BOTH SUM= 0.19541E+01 E= 0.20318E+00 ( 5.529eV) - -NO ATOM L POPULATION - s - 1 W 0 0.49972 0.70691 - px pz py - 1 W 1 0.00000 -0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.00000 -0.00000 -0.00000 0.00000 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00028 -0.01665 0.00000 0.00000 0.00000 -0.00000 0.00000 -0.00000 - s - 2 W 0 0.49972 0.70691 - px pz py - 2 W 1 0.00000 0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.00000 0.00000 -0.00000 -0.00000 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00028 -0.01665 0.00000 -0.00000 0.00000 0.00000 0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.9994 0.0000 0.0000 0.0006 - - - ======================================== - | POPULATION ANALYSIS ON EACH ATOM | - ======================================== - - -NO ATOM SPIN TOTAL s p d f - 1 W UP 3.00000 0.49972 0.00000 2.47749 0.02279 - 1 W DOWN 3.00000 0.49972 0.00000 2.47749 0.02279 - 2 W UP 3.00000 0.49972 0.00000 2.47749 0.02279 - 2 W DOWN 3.00000 0.49972 0.00000 2.47749 0.02279 - - - -=== TOTAL ANGULAR MOMENTUM POPULATION === - - SPIN s p d f - UP 16.66% 0.00% 82.58% 0.76% - UP 16.66% 0.00% 82.58% 0.76% - TOTAL 16.66% 0.00% 82.58% 0.76% - - ************************************************************* - ** ** - ** PSPW Atomic Point Charge (APC) Analysis ** - ** ** - ** Point charge analysis based on paper by P.E. Blochl ** - ** (J. Chem. Phys. vol 103, page 7422, 1995) ** - ** ** - ************************************************************* - - pspw_APC data structure - ----------------------- - nga, ngs: 3 6 - Gc : 2.5000000000000000 - APC gamma: 1 0.59999999999999998 - APC gamma: 2 0.90000000000000002 - APC gamma: 3 1.3500000000000001 - - charge analysis on each atom - ---------------------------- - - no atom Qelc Qion Qtotal - -- ---- ------- ------- ------- - 1 W -8.000 6.000 -2.000 - 2 W -5.500 6.000 0.500 - Total Q -13.500 12.000 -1.500 - - - gaussian coefficients of model density - -------------------------------------- - - no atom g=0.000 g=0.600 g=0.900 g=1.350 - -- ---- ------- ------- ------- ------- - 1 W 6.000 37.000 -52.000 7.000 - 2 W 6.000 -7.500 18.000 -16.000 - - -=== Electric Field at Atoms === - - 1 W Atomic Electric Field =( -0.00000 -0.00000 0.00000 ) - (ion) =( 0.00000 0.00000 -0.00000 ) - (electronic) =( -0.00000 -0.00000 0.00000 ) - 2 W Atomic Electric Field =( 0.00000 -0.00000 0.00000 ) - (ion) =( -0.00000 -0.00000 0.00000 ) - (electronic) =( 0.00000 -0.00000 0.00000 ) - - output psi filename:./w.movecs - - -== Timing == - -cputime in seconds - prologue : 0.745387E-01 - main loop : 0.136737E+00 - epilogue : 0.182997E-01 - total : 0.229575E+00 - cputime/step: 0.210365E-02 ( 65 evalulations, 15 linesearches) - - -Time spent doing total step percent - total time : 0.230022E+00 0.353880E-02 100.0 % - i/o time : 0.368268E-02 0.566566E-04 1.6 % - FFTs : 0.118074E-01 0.181652E-03 5.1 % - dot products : 0.278644E-02 0.428683E-04 1.2 % - geodesic : 0.648055E-02 0.997007E-04 2.8 % - ffm_dgemm : 0.284575E-03 0.437808E-05 0.1 % - fmf_dgemm : 0.189982E-02 0.292280E-04 0.8 % - mmm_dgemm : 0.513420E-04 0.789877E-06 0.0 % - m_diagonalize : 0.289267E-03 0.445026E-05 0.1 % - exchange correlation : 0.533441E-01 0.820678E-03 23.2 % - local pseudopotentials : 0.185780E-04 0.285815E-06 0.0 % - non-local pseudopotentials : 0.490618E-02 0.754796E-04 2.1 % - hartree potentials : 0.506539E-03 0.779291E-05 0.2 % - ion-ion interaction : 0.228455E-02 0.351469E-04 1.0 % - structure factors : 0.998308E-02 0.153586E-03 4.3 % - phase factors : 0.119090E-04 0.183215E-06 0.0 % - masking and packing : 0.834395E-02 0.128368E-03 3.6 % - queue fft : 0.432896E-01 0.665994E-03 18.8 % - queue fft (serial) : 0.309097E-01 0.475534E-03 13.4 % - queue fft (message passing): 0.111107E-01 0.170934E-03 4.8 % - non-local psp FFM : 0.270164E-02 0.415637E-04 1.2 % - non-local psp FMF : 0.966417E-03 0.148680E-04 0.4 % - non-local psp FFM A : 0.351360E-03 0.540554E-05 0.2 % - non-local psp FFM B : 0.216041E-02 0.332371E-04 0.9 % - - >>> JOB COMPLETED AT Mon Sep 23 14:29:21 2019 <<< - **************************************************** - * * - * NWPW PSPW Calculation * - * * - * [ (Grassmann/Stiefel manifold implementation) ] * - * * - * [ NorthWest Chemistry implementation ] * - * * - * version #5.10 06/12/02 * - * * - * This code was developed by Eric J. Bylaska, * - * and was based upon algorithms and code * - * developed by the group of Prof. John H. Weare * - * * - **************************************************** - >>> JOB STARTED AT Mon Sep 23 14:29:21 2019 <<< - ================ input data ======================== - - input psi filename:./w.movecs - - initializing pspw_APC data structure - ------------------------------------ - nga, ngs: 3 6 - Gc : 2.5000000000000000 - APC gamma: 1 0.59999999999999998 - APC gamma: 2 0.90000000000000002 - APC gamma: 3 1.3500000000000001 - - number of processors used: 1 - processor grid : 1 x 1 - parallel mapping :2d hilbert - parallel mapping : balanced - number of threads : 1 - parallel io : off - - options: - boundary conditions = periodic (version3) - electron spin = restricted - exchange-correlation = LDA (Vosko et al) parameterization - - elements involved in the cluster: - 1: W valence charge: 6.0000 lmax= 2 - comment : Troullier-Martins pseudopotential - pseudpotential type : 0 - highest angular component : 2 - local potential used : 0 - number of non-local projections: 8 - semicore corrections included : 1.800 (radius) 4.538 (charge) - cutoff = 2.389 3.185 2.244 - - - total charge: 0.000 - - atomic composition: - W : 2 - - number of electrons: spin up= 6 ( 6 per task) down= 6 ( 6 per task) (Fourier space) - number of orbitals : spin up= 6 ( 6 per task) down= 6 ( 6 per task) (Fourier space) - - supercell: - cell_name: cell_default - lattice: a1=< 5.972 0.000 0.000 > - a2=< 0.000 5.972 0.000 > - a3=< 0.000 0.000 5.972 > - reciprocal: b1=< 1.052 0.000 -0.000 > - b2=< -0.000 1.052 -0.000 > - b3=< 0.000 0.000 1.052 > - lattice: a= 5.972 b= 5.972 c= 5.972 - alpha= 90.000 beta= 90.000 gamma= 90.000 - omega= 212.9 - - density cutoff= 26.570 fft= 16x 16x 16( 679 waves 679 per task) - wavefnc cutoff= 26.570 fft= 16x 16x 16( 679 waves 679 per task) - Ewald summation: cut radius= 1.90 and 8 - Madelung Wigner-Seitz= 1.76011888 (alpha= 2.83729748 rs= 3.70444413) - - technical parameters: - time step= 5.80 fictitious mass= 400000.0 - tolerance=0.100E-08 (energy) 0.100E-08 (density) - maximum iterations = 1000 ( 10 inner 100 outer ) - - - - - -== Energy Calculation == - - - ====== Grassmann conjugate gradient iteration ====== - >>> ITERATION STARTED AT Mon Sep 23 14:29:21 2019 <<< - iter. Energy DeltaE DeltaRho - ------------------------------------------------------ - 10 -0.2020451899E+02 -0.26409E-08 0.50388E-10 - 20 -0.2020451899E+02 -0.97153E-09 0.52248E-11 - *** tolerance ok. iteration terminated - >>> ITERATION ENDED AT Mon Sep 23 14:29:21 2019 <<< - - -== Summary Of Results == - - number of electrons: spin up= 6.00000 down= 6.00000 (real space) - - total energy : -0.2020451899E+02 ( -0.10102E+02/ion) - total orbital energy: 0.5093462286E+01 ( 0.84891E+00/electron) - hartree energy : 0.2902599490E+00 ( 0.48377E-01/electron) - exc-corr energy : -0.9444898225E+01 ( -0.15741E+01/electron) - ion-ion energy : -0.2193948849E+02 ( -0.10970E+02/ion) - - kinetic (planewave) : 0.1441599938E+02 ( 0.24027E+01/electron) - V_local (planewave) : 0.1156112031E+02 ( 0.19269E+01/electron) - V_nl (planewave) : -0.1508751191E+02 ( -0.25146E+01/electron) - V_Coul (planewave) : 0.5805198980E+00 ( 0.96753E-01/electron) - V_xc. (planewave) : -0.6376665384E+01 ( -0.10628E+01/electron) - Virial Coefficient : -0.6466799038E+00 - - orbital energies: - 0.5414224E+00 ( 14.733eV) - 0.5414220E+00 ( 14.733eV) - 0.5414216E+00 ( 14.733eV) - 0.3596618E+00 ( 9.787eV) - 0.3596618E+00 ( 9.787eV) - 0.2031417E+00 ( 5.528eV) - - Total PSPW energy : -0.2020451899E+02 - - -=== Spin Contamination === - - = 0.0000000000000000 - = 0.0000000000000000 - - - -== Center of Charge == - -spin up ( -0.0000, -0.0000, 0.0000 ) -spin down ( -0.0000, -0.0000, 0.0000 ) - total ( -0.0000, -0.0000, 0.0000 ) -ionic ( 1.4929, 1.4929, 1.4929 ) - - -== Molecular Dipole wrt Center of Mass == - -mu = ( 17.9146, 17.9146, 17.9146 ) au -|mu| = 31.0290 au, 78.8633 Debye - - - - ************************************************************* - ** ** - ** PSPW Mulliken analysis ** - ** ** - ** Population analysis algorithm devloped by Ryoichi Kawai ** - ** ** - ** Mon Sep 23 14:29 ** - ** ** - ************************************************************* - - -== XYZ OUTPUT == - - - 2 - -W 0.000000 0.000000 0.000000 -W 1.579999 1.579999 1.579999 - - -== Atomic Orbital Expansion == - - W nodamping - - - ===================================================== - | POPULATION ANALYSIS OF FILLED MOLECULAR ORBITALS | - ===================================================== - - -== Using pseudoatomic orbital expansion == - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 1*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54142E+00 ( 14.733eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 -0.00000 -0.50150 0.00000 0.49850 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 -0.00000 -0.00000 0.00000 -0.00000 0.00000 0.00000 -0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 -0.00000 -0.50150 0.00000 0.49850 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 -0.00000 -0.00000 0.00000 0.00000 0.00000 -0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 2*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54142E+00 ( 14.733eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 -0.00000 0.00000 0.00001 -0.00000 0.70711 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 -0.00001 -0.00000 0.00000 -0.00000 0.00000 0.00000 -0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 -0.00000 0.00000 0.00001 -0.00000 0.70711 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 -0.00001 -0.00000 0.00000 0.00000 0.00000 -0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 3*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54142E+00 ( 14.733eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 -0.00000 -0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 0.00000 0.49850 -0.00000 0.50150 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 0.00000 -0.00000 -0.00000 -0.00000 -0.00000 0.00000 0.00000 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00000 0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 0.00000 0.49850 -0.00000 0.50150 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 0.00000 -0.00000 -0.00000 0.00000 -0.00000 -0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 4*** SPIN=BOTH SUM= 0.14906E+01 E= 0.35966E+00 ( 9.787eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 0.00000 -0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.47918 0.62168 0.00000 -0.30446 0.00000 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.02082 0.14429 0.00000 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.47918 -0.62168 -0.00000 0.30446 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.02082 -0.14429 0.00000 0.00000 -0.00000 0.00000 -0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 0.9584 0.0416 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 5*** SPIN=BOTH SUM= 0.14301E+01 E= 0.35966E+00 ( 9.787eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 0.00000 -0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.49946 -0.31083 -0.00000 -0.63470 0.00000 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00054 0.02331 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.49946 0.31083 0.00000 0.63470 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00054 -0.02331 -0.00000 -0.00000 -0.00000 0.00000 -0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 0.9989 0.0011 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 6*** SPIN=BOTH SUM= 0.19541E+01 E= 0.20314E+00 ( 5.528eV) - -NO ATOM L POPULATION - s - 1 W 0 0.49973 0.70692 - px pz py - 1 W 1 0.00000 -0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.00000 -0.00000 0.00000 0.00000 -0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00027 -0.01628 0.00000 0.00000 0.00000 -0.00000 -0.00000 -0.00000 - s - 2 W 0 0.49973 0.70692 - px pz py - 2 W 1 0.00000 0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.00000 0.00000 0.00000 -0.00000 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00027 -0.01628 0.00000 -0.00000 0.00000 -0.00000 -0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.9995 0.0000 0.0000 0.0005 - - - ======================================== - | POPULATION ANALYSIS ON EACH ATOM | - ======================================== - - -NO ATOM SPIN TOTAL s p d f - 1 W UP 3.00000 0.49973 0.00000 2.47864 0.02163 - 1 W DOWN 3.00000 0.49973 0.00000 2.47864 0.02163 - 2 W UP 3.00000 0.49973 0.00000 2.47864 0.02163 - 2 W DOWN 3.00000 0.49973 0.00000 2.47864 0.02163 - - - -=== TOTAL ANGULAR MOMENTUM POPULATION === - - SPIN s p d f - UP 16.66% 0.00% 82.62% 0.72% - UP 16.66% 0.00% 82.62% 0.72% - TOTAL 16.66% 0.00% 82.62% 0.72% - - ************************************************************* - ** ** - ** PSPW Atomic Point Charge (APC) Analysis ** - ** ** - ** Point charge analysis based on paper by P.E. Blochl ** - ** (J. Chem. Phys. vol 103, page 7422, 1995) ** - ** ** - ************************************************************* - - pspw_APC data structure - ----------------------- - nga, ngs: 3 6 - Gc : 2.5000000000000000 - APC gamma: 1 0.59999999999999998 - APC gamma: 2 0.90000000000000002 - APC gamma: 3 1.3500000000000001 - - charge analysis on each atom - ---------------------------- - - no atom Qelc Qion Qtotal - -- ---- ------- ------- ------- - 1 W -6.906 6.000 -0.906 - 2 W -5.625 6.000 0.375 - Total Q -12.531 12.000 -0.531 - - - gaussian coefficients of model density - -------------------------------------- - - no atom g=0.000 g=0.600 g=0.900 g=1.350 - -- ---- ------- ------- ------- ------- - 1 W 6.000 -25.719 50.250 -31.438 - 2 W 6.000 -5.000 12.188 -12.812 - - -=== Electric Field at Atoms === - - 1 W Atomic Electric Field =( -0.00000 -0.00000 0.00000 ) - (ion) =( 0.00000 0.00000 -0.00000 ) - (electronic) =( -0.00000 -0.00000 0.00000 ) - 2 W Atomic Electric Field =( 0.00000 -0.00000 -0.00000 ) - (ion) =( -0.00000 -0.00000 0.00000 ) - (electronic) =( 0.00000 -0.00000 -0.00000 ) - - output psi filename:./w.movecs - - -== Timing == - -cputime in seconds - prologue : 0.745646E-01 - main loop : 0.114422E+00 - epilogue : 0.186484E-01 - total : 0.207635E+00 - cputime/step: 0.233514E-02 ( 49 evalulations, 11 linesearches) - - -Time spent doing total step percent - total time : 0.208073E+00 0.424639E-02 100.0 % - i/o time : 0.369110E-02 0.753285E-04 1.8 % - FFTs : 0.938805E-02 0.191593E-03 4.5 % - dot products : 0.334735E-02 0.683133E-04 1.6 % - geodesic : 0.620612E-02 0.126655E-03 3.0 % - ffm_dgemm : 0.410025E-03 0.836786E-05 0.2 % - fmf_dgemm : 0.262005E-02 0.534703E-04 1.3 % - mmm_dgemm : 0.403200E-04 0.822857E-06 0.0 % - m_diagonalize : 0.265351E-03 0.541533E-05 0.1 % - exchange correlation : 0.403655E-01 0.823786E-03 19.4 % - local pseudopotentials : 0.218100E-04 0.445102E-06 0.0 % - non-local pseudopotentials : 0.583915E-02 0.119166E-03 2.8 % - hartree potentials : 0.445709E-03 0.909610E-05 0.2 % - ion-ion interaction : 0.230654E-02 0.470722E-04 1.1 % - structure factors : 0.101746E-01 0.207644E-03 4.9 % - phase factors : 0.125530E-04 0.256184E-06 0.0 % - masking and packing : 0.763773E-02 0.155872E-03 3.7 % - queue fft : 0.369776E-01 0.754645E-03 17.8 % - queue fft (serial) : 0.262466E-01 0.535645E-03 12.6 % - queue fft (message passing): 0.969198E-02 0.197796E-03 4.7 % - non-local psp FFM : 0.320117E-02 0.653300E-04 1.5 % - non-local psp FMF : 0.137954E-02 0.281539E-04 0.7 % - non-local psp FFM A : 0.490631E-03 0.100129E-04 0.2 % - non-local psp FFM B : 0.245399E-02 0.500814E-04 1.2 % - - >>> JOB COMPLETED AT Mon Sep 23 14:29:21 2019 <<< - **************************************************** - * * - * NWPW PSPW Calculation * - * * - * [ (Grassmann/Stiefel manifold implementation) ] * - * * - * [ NorthWest Chemistry implementation ] * - * * - * version #5.10 06/12/02 * - * * - * This code was developed by Eric J. Bylaska, * - * and was based upon algorithms and code * - * developed by the group of Prof. John H. Weare * - * * - **************************************************** - >>> JOB STARTED AT Mon Sep 23 14:29:21 2019 <<< - ================ input data ======================== - - input psi filename:./w.movecs - - initializing pspw_APC data structure - ------------------------------------ - nga, ngs: 3 6 - Gc : 2.5000000000000000 - APC gamma: 1 0.59999999999999998 - APC gamma: 2 0.90000000000000002 - APC gamma: 3 1.3500000000000001 - - number of processors used: 1 - processor grid : 1 x 1 - parallel mapping :2d hilbert - parallel mapping : balanced - number of threads : 1 - parallel io : off - - options: - boundary conditions = periodic (version3) - electron spin = restricted - exchange-correlation = LDA (Vosko et al) parameterization - - elements involved in the cluster: - 1: W valence charge: 6.0000 lmax= 2 - comment : Troullier-Martins pseudopotential - pseudpotential type : 0 - highest angular component : 2 - local potential used : 0 - number of non-local projections: 8 - semicore corrections included : 1.800 (radius) 4.538 (charge) - cutoff = 2.389 3.185 2.244 - - - total charge: 0.000 - - atomic composition: - W : 2 - - number of electrons: spin up= 6 ( 6 per task) down= 6 ( 6 per task) (Fourier space) - number of orbitals : spin up= 6 ( 6 per task) down= 6 ( 6 per task) (Fourier space) - - supercell: - cell_name: cell_default - lattice: a1=< 5.972 0.000 0.000 > - a2=< 0.000 5.972 0.000 > - a3=< 0.000 0.000 5.972 > - reciprocal: b1=< 1.052 0.000 -0.000 > - b2=< -0.000 1.052 -0.000 > - b3=< 0.000 0.000 1.052 > - lattice: a= 5.972 b= 5.972 c= 5.972 - alpha= 90.000 beta= 90.000 gamma= 90.000 - omega= 212.9 - - density cutoff= 35.427 fft= 16x 16x 16( 1052 waves 1052 per task) - wavefnc cutoff= 35.427 fft= 16x 16x 16( 1052 waves 1052 per task) - Ewald summation: cut radius= 1.90 and 8 - Madelung Wigner-Seitz= 1.76011888 (alpha= 2.83729748 rs= 3.70444413) - - technical parameters: - time step= 5.80 fictitious mass= 400000.0 - tolerance=0.100E-08 (energy) 0.100E-08 (density) - maximum iterations = 1000 ( 10 inner 100 outer ) - - - - - -== Energy Calculation == - - - ====== Grassmann conjugate gradient iteration ====== - >>> ITERATION STARTED AT Mon Sep 23 14:29:21 2019 <<< - iter. Energy DeltaE DeltaRho - ------------------------------------------------------ - 10 -0.2020461705E+02 -0.23340E-09 0.27270E-11 - *** tolerance ok. iteration terminated - >>> ITERATION ENDED AT Mon Sep 23 14:29:21 2019 <<< - - -== Summary Of Results == - - number of electrons: spin up= 6.00000 down= 6.00000 (real space) - - total energy : -0.2020461705E+02 ( -0.10102E+02/ion) - total orbital energy: 0.5093528357E+01 ( 0.84892E+00/electron) - hartree energy : 0.2902733730E+00 ( 0.48379E-01/electron) - exc-corr energy : -0.9445058980E+01 ( -0.15742E+01/electron) - ion-ion energy : -0.2193948849E+02 ( -0.10970E+02/ion) - - kinetic (planewave) : 0.1441576162E+02 ( 0.24026E+01/electron) - V_local (planewave) : 0.1156121019E+02 ( 0.19269E+01/electron) - V_nl (planewave) : -0.1508731476E+02 ( -0.25146E+01/electron) - V_Coul (planewave) : 0.5805467460E+00 ( 0.96758E-01/electron) - V_xc. (planewave) : -0.6376675440E+01 ( -0.10628E+01/electron) - Virial Coefficient : -0.6466694934E+00 - - orbital energies: - 0.5414197E+00 ( 14.733eV) - 0.5414193E+00 ( 14.733eV) - 0.5414189E+00 ( 14.733eV) - 0.3596821E+00 ( 9.788eV) - 0.3596821E+00 ( 9.788eV) - 0.2031419E+00 ( 5.528eV) - - Total PSPW energy : -0.2020461705E+02 - - -=== Spin Contamination === - - = 0.0000000000000000 - = 0.0000000000000000 - - - -== Center of Charge == - -spin up ( -0.0000, -0.0000, -0.0000 ) -spin down ( -0.0000, -0.0000, -0.0000 ) - total ( -0.0000, -0.0000, -0.0000 ) -ionic ( 1.4929, 1.4929, 1.4929 ) - - -== Molecular Dipole wrt Center of Mass == - -mu = ( 17.9146, 17.9146, 17.9146 ) au -|mu| = 31.0290 au, 78.8633 Debye - - -Translation force removed: ( -0.00000 -0.00000 -0.00000) - - - ============= Ion Gradients ================= - Ion Forces: - 1 W ( 0.000000 0.000000 -0.000000 ) - 2 W ( -0.000000 -0.000000 -0.000000 ) - C.O.M. ( 0.000000 0.000000 -0.000000 ) - =============================================== - |F| = 0.418432E-08 - |F|/nion = 0.209216E-08 - max|Fatom|= 0.295876E-08 ( 0.000eV/Angstrom) - - - - Outputting formatted_stress_filename: ./W.vpp2 - - -====================== -= Stress calculation = -====================== - - - ============= total gradient ============== - S = ( 0.12513 0.00001 0.00000 ) - ( 0.00001 0.12513 0.00000 ) - ( 0.00000 0.00000 0.12513 ) - =================================================== - |S| = 0.21673E+00 - pressure = 0.125E+00 au - = 0.368E+02 Mbar - = 0.368E+04 GPa - = 0.363E+08 atm - - - dE/da = 0.12513 - dE/db = 0.12513 - dE/dc = 0.12513 - dE/dalpha = 0.00000 - dE/dbeta = 0.00000 - dE/dgamma = -0.00004 - - - - - ************************************************************* - ** ** - ** PSPW Mulliken analysis ** - ** ** - ** Population analysis algorithm devloped by Ryoichi Kawai ** - ** ** - ** Mon Sep 23 14:29 ** - ** ** - ************************************************************* - - -== XYZ OUTPUT == - - - 2 - -W 0.000000 0.000000 0.000000 -W 1.579999 1.579999 1.579999 - - -== Atomic Orbital Expansion == - - W nodamping - - - ===================================================== - | POPULATION ANALYSIS OF FILLED MOLECULAR ORBITALS | - ===================================================== - - -== Using pseudoatomic orbital expansion == - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 1*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54142E+00 ( 14.733eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 -0.00000 -0.50144 0.00000 0.49855 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 -0.00000 -0.00000 0.00000 -0.00000 0.00000 0.00000 -0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 -0.00000 -0.50144 0.00000 0.49855 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 -0.00000 -0.00000 0.00000 0.00000 0.00000 -0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 2*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54142E+00 ( 14.733eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 -0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 0.00000 -0.00000 -0.00001 0.00000 -0.70711 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 0.00001 0.00000 -0.00000 0.00000 -0.00000 -0.00000 0.00000 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00000 0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 0.00000 -0.00000 -0.00001 0.00000 -0.70711 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 0.00001 0.00000 -0.00000 -0.00000 -0.00000 0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 3*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54142E+00 ( 14.733eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 -0.00000 -0.49855 0.00000 -0.50144 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 -0.00000 0.00000 0.00000 0.00000 0.00000 -0.00000 -0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 -0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 -0.00000 -0.49855 0.00000 -0.50144 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 -0.00000 0.00000 0.00000 -0.00000 0.00000 0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 4*** SPIN=BOTH SUM= 0.14893E+01 E= 0.35968E+00 ( 9.788eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 -0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.47961 -0.61917 -0.00000 0.31022 -0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.02039 -0.14281 -0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00000 0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.47961 0.61917 0.00000 -0.31022 -0.00000 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.02039 0.14281 -0.00000 -0.00000 0.00000 -0.00000 -0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 0.9592 0.0408 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 5*** SPIN=BOTH SUM= 0.14299E+01 E= 0.35968E+00 ( 9.788eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 -0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.49953 0.31660 0.00000 0.63190 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00047 -0.02171 0.00000 0.00000 0.00000 0.00000 -0.00000 0.00000 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00000 0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.49953 -0.31660 -0.00000 -0.63190 -0.00000 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00047 0.02171 0.00000 0.00000 0.00000 -0.00000 -0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 0.9991 0.0009 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 6*** SPIN=BOTH SUM= 0.19540E+01 E= 0.20314E+00 ( 5.528eV) - -NO ATOM L POPULATION - s - 1 W 0 0.49974 0.70692 - px pz py - 1 W 1 0.00000 -0.00000 -0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.00000 -0.00000 0.00000 0.00000 -0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00026 -0.01609 0.00000 0.00000 0.00000 -0.00000 -0.00000 -0.00000 - s - 2 W 0 0.49974 0.70692 - px pz py - 2 W 1 0.00000 0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.00000 0.00000 0.00000 -0.00000 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00026 -0.01609 -0.00000 -0.00000 0.00000 -0.00000 0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.9995 0.0000 0.0000 0.0005 - - - ======================================== - | POPULATION ANALYSIS ON EACH ATOM | - ======================================== - - -NO ATOM SPIN TOTAL s p d f - 1 W UP 3.00000 0.49974 0.00000 2.47913 0.02112 - 1 W DOWN 3.00000 0.49974 0.00000 2.47913 0.02112 - 2 W UP 3.00000 0.49974 0.00000 2.47913 0.02112 - 2 W DOWN 3.00000 0.49974 0.00000 2.47913 0.02112 - - - -=== TOTAL ANGULAR MOMENTUM POPULATION === - - SPIN s p d f - UP 16.66% 0.00% 82.64% 0.70% - UP 16.66% 0.00% 82.64% 0.70% - TOTAL 16.66% 0.00% 82.64% 0.70% - - ************************************************************* - ** ** - ** PSPW Atomic Point Charge (APC) Analysis ** - ** ** - ** Point charge analysis based on paper by P.E. Blochl ** - ** (J. Chem. Phys. vol 103, page 7422, 1995) ** - ** ** - ************************************************************* - - pspw_APC data structure - ----------------------- - nga, ngs: 3 6 - Gc : 2.5000000000000000 - APC gamma: 1 0.59999999999999998 - APC gamma: 2 0.90000000000000002 - APC gamma: 3 1.3500000000000001 - - charge analysis on each atom - ---------------------------- - - no atom Qelc Qion Qtotal - -- ---- ------- ------- ------- - 1 W -5.594 6.000 0.406 - 2 W -6.250 6.000 -0.250 - Total Q -11.844 12.000 0.156 - - - gaussian coefficients of model density - -------------------------------------- - - no atom g=0.000 g=0.600 g=0.900 g=1.350 - -- ---- ------- ------- ------- ------- - 1 W 6.000 -6.219 15.062 -14.438 - 2 W 6.000 -8.281 20.125 -18.094 - - -=== Electric Field at Atoms === - - 1 W Atomic Electric Field =( -0.00000 -0.00000 0.00000 ) - (ion) =( 0.00000 0.00000 -0.00000 ) - (electronic) =( -0.00000 -0.00000 0.00000 ) - 2 W Atomic Electric Field =( 0.00000 -0.00000 0.00000 ) - (ion) =( -0.00000 -0.00000 0.00000 ) - (electronic) =( 0.00000 -0.00000 -0.00000 ) - - output psi filename:./w.movecs - - -== Timing == - -cputime in seconds - prologue : 0.746791E-01 - main loop : 0.359966E+00 - epilogue : 0.187162E-01 - total : 0.453362E+00 - cputime/step: 0.133321E-01 ( 27 evalulations, 6 linesearches) - - -Time spent doing total step percent - total time : 0.453809E+00 0.168078E-01 100.0 % - i/o time : 0.371068E-02 0.137433E-03 0.8 % - FFTs : 0.870071E-02 0.322248E-03 1.9 % - dot products : 0.347239E-02 0.128607E-03 0.8 % - geodesic : 0.430554E-02 0.159464E-03 0.9 % - ffm_dgemm : 0.322600E-03 0.119481E-04 0.1 % - fmf_dgemm : 0.226656E-02 0.839466E-04 0.5 % - mmm_dgemm : 0.241260E-04 0.893554E-06 0.0 % - m_diagonalize : 0.143440E-03 0.531259E-05 0.0 % - exchange correlation : 0.226012E-01 0.837082E-03 5.0 % - local pseudopotentials : 0.247782E-03 0.917711E-05 0.1 % - non-local pseudopotentials : 0.596243E-02 0.220831E-03 1.3 % - hartree potentials : 0.303066E-03 0.112247E-04 0.1 % - ion-ion interaction : 0.742231E-01 0.274901E-02 16.4 % - structure factors : 0.100176E-01 0.371024E-03 2.2 % - phase factors : 0.123850E-04 0.458704E-06 0.0 % - masking and packing : 0.747819E-02 0.276970E-03 1.6 % - queue fft : 0.227258E-01 0.841697E-03 5.0 % - queue fft (serial) : 0.159551E-01 0.590931E-03 3.5 % - queue fft (message passing): 0.615529E-02 0.227974E-03 1.4 % - non-local psp FFM : 0.252122E-02 0.933787E-04 0.6 % - non-local psp FMF : 0.112022E-02 0.414896E-04 0.2 % - non-local psp FFM A : 0.456889E-03 0.169218E-04 0.1 % - non-local psp FFM B : 0.186526E-02 0.690838E-04 0.4 % - - >>> JOB COMPLETED AT Mon Sep 23 14:29:22 2019 <<< - - Task times cpu: 5.6s wall: 3.8s - - - NWChem Input Module - ------------------- - - - Summary of allocated global arrays ------------------------------------ - No active global arrays - - - - GA Statistics for process 0 - ------------------------------ - - create destroy get put acc scatter gather read&inc -calls: 8 8 86 10 0 0 0 0 -number of processes/call 1.00e+00 1.00e+00 0.00e+00 0.00e+00 0.00e+00 -bytes total: 1.81e+05 8.19e+04 0.00e+00 0.00e+00 0.00e+00 0.00e+00 -bytes remote: 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 -Max memory consumed for GA by this process: 65536 bytes - -MA_summarize_allocated_blocks: starting scan ... -heap block 'sw1t', handle 348, address 0x55eea965d008: - type of elements: double precision - number of elements: 16 - address of client space: 0x55eea965d080 - index for client space: 10242743 - total number of bytes: 256 -MA_summarize_allocated_blocks: scan completed: 1 heap block, 0 stack blocks -MA usage statistics: - - allocation statistics: - heap stack - ---- ----- - current number of blocks 1 0 - maximum number of blocks 304 17 - current total bytes 256 0 - maximum total bytes 5596824 351896 - maximum total K-bytes 5597 352 - maximum total M-bytes 6 1 - - - CITATION - -------- - Please cite the following reference when publishing - results obtained with NWChem: - - M. Valiev, E.J. Bylaska, N. Govind, K. Kowalski, - T.P. Straatsma, H.J.J. van Dam, D. Wang, J. Nieplocha, - E. Apra, T.L. Windus, W.A. de Jong - "NWChem: a comprehensive and scalable open-source - solution for large scale molecular simulations" - Comput. Phys. Commun. 181, 1477 (2010) - doi:10.1016/j.cpc.2010.04.018 - - AUTHORS - ------- - E. Apra, E. J. Bylaska, W. A. de Jong, N. Govind, K. Kowalski, - T. P. Straatsma, M. Valiev, H. J. J. van Dam, D. Wang, T. L. Windus, - J. Hammond, J. Autschbach, K. Bhaskaran-Nair, J. Brabec, K. Lopata, - S. A. Fischer, S. Krishnamoorthy, M. Jacquelin, W. Ma, M. Klemm, O. Villa, - Y. Chen, V. Anisimov, F. Aquino, S. Hirata, M. T. Hackler, V. Konjkov, - D. Mejia-Rodriguez, T. Risthaus, M. Malagoli, A. Marenich, - A. Otero-de-la-Roza, J. Mullin, P. Nichols, R. Peverati, J. Pittner, Y. Zhao, - P.-D. Fan, A. Fonari, M. J. Williamson, R. J. Harrison, J. R. Rehr, - M. Dupuis, D. Silverstein, D. M. A. Smith, J. Nieplocha, V. Tipparaju, - M. Krishnan, B. E. Van Kuiken, A. Vazquez-Mayagoitia, L. Jensen, M. Swart, - Q. Wu, T. Van Voorhis, A. A. Auer, M. Nooijen, L. D. Crosby, E. Brown, - G. Cisneros, G. I. Fann, H. Fruchtl, J. Garza, K. Hirao, R. A. Kendall, - J. A. Nichols, K. Tsemekhman, K. Wolinski, J. Anchell, D. E. Bernholdt, - P. Borowski, T. Clark, D. Clerc, H. Dachsel, M. J. O. Deegan, K. Dyall, - D. Elwood, E. Glendening, M. Gutowski, A. C. Hess, J. Jaffe, B. G. Johnson, - J. Ju, R. Kobayashi, R. Kutteh, Z. Lin, R. Littlefield, X. Long, B. Meng, - T. Nakajima, S. Niu, L. Pollack, M. Rosing, K. Glaesemann, G. Sandrone, - M. Stave, H. Taylor, G. Thomas, J. H. van Lenthe, A. T. Wong, Z. Zhang. - - Total times cpu: 5.6s wall: 3.8s diff --git a/examples/COUPLE/lammps_nwchem/planewave/nwchem_lammps.out.W.3Oct19 b/examples/COUPLE/lammps_nwchem/planewave/nwchem_lammps.out.W.3Oct19 deleted file mode 100644 index 36b6cfa4c4..0000000000 --- a/examples/COUPLE/lammps_nwchem/planewave/nwchem_lammps.out.W.3Oct19 +++ /dev/null @@ -1,817 +0,0 @@ - argument 1 = nwchem_lammps.nw - - - -============================== echo of input deck ============================== -echo - -#**** Enter the geometry using fractional coordinates **** -geometry units angstrom noautosym - system crystal - lat_a 3.16d0 - lat_b 3.16d0 - lat_c 3.16d0 - end -W 0.999335 0.99967 0.998875 -W 0.500665 0.50033 0.501125 -end - -nwpw - vectors input nwchem_lammps.movecs -end - -#***** setup the nwpw gamma point code **** -nwpw - simulation_cell - ngrid 16 16 16 - end - ewald_ncut 8 - mulliken - lcao #old default -end - -nwpw - tolerances 1.0d-9 1.0d-9 -end - -task pspw stress -================================================================================ - - - - - - - Northwest Computational Chemistry Package (NWChem) 6.8 - ------------------------------------------------------ - - - Environmental Molecular Sciences Laboratory - Pacific Northwest National Laboratory - Richland, WA 99352 - - Copyright (c) 1994-2018 - Pacific Northwest National Laboratory - Battelle Memorial Institute - - NWChem is an open-source computational chemistry package - distributed under the terms of the - Educational Community License (ECL) 2.0 - A copy of the license is included with this distribution - in the LICENSE.TXT file - - ACKNOWLEDGMENT - -------------- - - This software and its documentation were developed at the - EMSL at Pacific Northwest National Laboratory, a multiprogram - national laboratory, operated for the U.S. Department of Energy - by Battelle under Contract Number DE-AC05-76RL01830. Support - for this work was provided by the Department of Energy Office - of Biological and Environmental Research, Office of Basic - Energy Sciences, and the Office of Advanced Scientific Computing. - - - Job information - --------------- - - hostname = singsing - program = /home/sjplimp/tools/nwchem-6.8.1-release/bin/LINUX64/nwchem - date = Thu Oct 3 16:57:17 2019 - - compiled = Wed_Oct_02_09:25:27_2019 - source = /home/sjplimp/tools/nwchem-6.8.1-release - nwchem branch = Development - nwchem revision = N/A - ga revision = 5.6.5 - use scalapack = F - input = nwchem_lammps.nw - prefix = nwchem_lammps. - data base = ./nwchem_lammps.db - status = restart - nproc = 1 - time left = -1s - - - - Memory information - ------------------ - - heap = 13107200 doubles = 100.0 Mbytes - stack = 13107197 doubles = 100.0 Mbytes - global = 26214400 doubles = 200.0 Mbytes (distinct from heap & stack) - total = 52428797 doubles = 400.0 Mbytes - verify = yes - hardfail = no - - - Directory information - --------------------- - - 0 permanent = . - 0 scratch = . - - - Previous task information - ------------------------- - - Theory = pspw - Operation = stress - Status = unknown - Qmmm = F - Ignore = F - - - Geometries in the database - -------------------------- - - Name Natoms Last Modified - -------------------------------- ------ ------------------------ - 1 geometry 2 Thu Oct 3 16:57:16 2019 - - The geometry named "geometry" is the default for restart - - - - Basis sets in the database - -------------------------- - - There are no basis sets in the database - - - - NWChem Input Module - ------------------- - - - - !!!!!!!!! geom_3d NEEDS TESTING !!!!!!!!!! - - - Geometry "geometry" -> "" - ------------------------- - - Output coordinates in angstroms (scale by 1.889725989 to convert to a.u.) - - No. Tag Charge X Y Z - ---- ---------------- ---------- -------------- -------------- -------------- - 1 W 74.0000 3.15789860 3.15895720 3.15644500 - 2 W 74.0000 1.58210140 1.58104280 1.58355500 - - Lattice Parameters - ------------------ - - lattice vectors in angstroms (scale by 1.889725989 to convert to a.u.) - - a1=< 3.160 0.000 0.000 > - a2=< 0.000 3.160 0.000 > - a3=< 0.000 0.000 3.160 > - a= 3.160 b= 3.160 c= 3.160 - alpha= 90.000 beta= 90.000 gamma= 90.000 - omega= 31.6 - - reciprocal lattice vectors in a.u. - - b1=< 1.052 0.000 -0.000 > - b2=< -0.000 1.052 -0.000 > - b3=< 0.000 0.000 1.052 > - - Atomic Mass - ----------- - - W 183.951000 - - - - XYZ format geometry - ------------------- - 2 - geometry - W 3.15789860 3.15895720 3.15644500 - W 1.58210140 1.58104280 1.58355500 - - ============================================================================== - internuclear distances - ------------------------------------------------------------------------------ - center one | center two | atomic units | angstroms - ------------------------------------------------------------------------------ - 2 W | 1 W | 5.15689 | 2.72891 - ------------------------------------------------------------------------------ - number of included internuclear distances: 1 - ============================================================================== - - - - >>>> PSPW Parallel Module - stress <<<< - **************************************************** - * * - * NWPW PSPW Calculation * - * * - * [ (Grassmann/Stiefel manifold implementation) ] * - * * - * [ NorthWest Chemistry implementation ] * - * * - * version #5.10 06/12/02 * - * * - * This code was developed by Eric J. Bylaska, * - * and was based upon algorithms and code * - * developed by the group of Prof. John H. Weare * - * * - **************************************************** - >>> JOB STARTED AT Thu Oct 3 16:57:17 2019 <<< - ================ input data ======================== - - input psi filename:./nwchem_lammps.movecs - - initializing pspw_APC data structure - ------------------------------------ - nga, ngs: 3 6 - Gc : 2.5000000000000000 - APC gamma: 1 0.59999999999999998 - APC gamma: 2 0.90000000000000002 - APC gamma: 3 1.3500000000000001 - - number of processors used: 1 - processor grid : 1 x 1 - parallel mapping :2d hilbert - parallel mapping : balanced - number of threads : 1 - parallel io : off - - options: - boundary conditions = periodic (version3) - electron spin = restricted - exchange-correlation = LDA (Vosko et al) parameterization - - elements involved in the cluster: - 1: W valence charge: 6.0000 lmax= 2 - comment : Troullier-Martins pseudopotential - pseudpotential type : 0 - highest angular component : 2 - local potential used : 0 - number of non-local projections: 8 - semicore corrections included : 1.800 (radius) 4.538 (charge) - cutoff = 2.389 3.185 2.244 - - - total charge: 0.000 - - atomic composition: - W : 2 - - number of electrons: spin up= 6 ( 6 per task) down= 6 ( 6 per task) (Fourier space) - number of orbitals : spin up= 6 ( 6 per task) down= 6 ( 6 per task) (Fourier space) - - supercell: - cell_name: cell_default - lattice: a1=< 5.972 0.000 0.000 > - a2=< 0.000 5.972 0.000 > - a3=< 0.000 0.000 5.972 > - reciprocal: b1=< 1.052 0.000 -0.000 > - b2=< -0.000 1.052 -0.000 > - b3=< 0.000 0.000 1.052 > - lattice: a= 5.972 b= 5.972 c= 5.972 - alpha= 90.000 beta= 90.000 gamma= 90.000 - omega= 212.9 - - density cutoff= 35.427 fft= 16x 16x 16( 1052 waves 1052 per task) - wavefnc cutoff= 35.427 fft= 16x 16x 16( 1052 waves 1052 per task) - Ewald summation: cut radius= 1.90 and 8 - Madelung Wigner-Seitz= 1.76011888 (alpha= 2.83729748 rs= 3.70444413) - - technical parameters: - time step= 5.80 fictitious mass= 400000.0 - tolerance=0.100E-08 (energy) 0.100E-08 (density) - maximum iterations = 1000 ( 10 inner 100 outer ) - - - - - -== Energy Calculation == - - - ====== Grassmann conjugate gradient iteration ====== - >>> ITERATION STARTED AT Thu Oct 3 16:57:17 2019 <<< - iter. Energy DeltaE DeltaRho - ------------------------------------------------------ - 10 -0.2020457267E+02 -0.12753E-06 0.54770E-09 - 20 -0.2020457281E+02 -0.96520E-09 0.65680E-11 - *** tolerance ok. iteration terminated - >>> ITERATION ENDED AT Thu Oct 3 16:57:18 2019 <<< - - -== Summary Of Results == - - number of electrons: spin up= 6.00000 down= 6.00000 (real space) - - total energy : -0.2020457281E+02 ( -0.10102E+02/ion) - total orbital energy: 0.5093546150E+01 ( 0.84892E+00/electron) - hartree energy : 0.2903382088E+00 ( 0.48390E-01/electron) - exc-corr energy : -0.9445078100E+01 ( -0.15742E+01/electron) - ion-ion energy : -0.2193939674E+02 ( -0.10970E+02/ion) - - kinetic (planewave) : 0.1441586264E+02 ( 0.24026E+01/electron) - V_local (planewave) : 0.1156111351E+02 ( 0.19269E+01/electron) - V_nl (planewave) : -0.1508741234E+02 ( -0.25146E+01/electron) - V_Coul (planewave) : 0.5806764176E+00 ( 0.96779E-01/electron) - V_xc. (planewave) : -0.6376694082E+01 ( -0.10628E+01/electron) - Virial Coefficient : -0.6466707350E+00 - - orbital energies: - 0.5414291E+00 ( 14.733eV) - 0.5414285E+00 ( 14.733eV) - 0.5414070E+00 ( 14.733eV) - 0.3596871E+00 ( 9.788eV) - 0.3596781E+00 ( 9.787eV) - 0.2031433E+00 ( 5.528eV) - - Total PSPW energy : -0.2020457281E+02 - - -=== Spin Contamination === - - = 0.0000000000000000 - = 0.0000000000000000 - - - -== Center of Charge == - -spin up ( -0.0030, -0.0015, -0.0050 ) -spin down ( -0.0030, -0.0015, -0.0050 ) - total ( -0.0030, -0.0015, -0.0050 ) -ionic ( -1.4929, -1.4929, -1.4929 ) - - -== Molecular Dipole wrt Center of Mass == - -mu = ( -17.8792, -17.8970, -17.8547 ) au -|mu| = 30.9638 au, 78.6976 Debye - - -Translation force removed: ( -0.00000 -0.00000 -0.00000) - - - ============= Ion Gradients ================= - Ion Forces: - 1 W ( 0.002737 0.001358 0.004631 ) - 2 W ( -0.002737 -0.001358 -0.004631 ) - C.O.M. ( 0.000000 0.000000 0.000000 ) - =============================================== - |F| = 0.784689E-02 - |F|/nion = 0.392344E-02 - max|Fatom|= 0.554859E-02 ( 0.285eV/Angstrom) - - - - -====================== -= Stress calculation = -====================== - - - ============= total gradient ============== - S = ( 0.12512 0.00000 0.00000 ) - ( 0.00000 0.12512 0.00001 ) - ( 0.00000 0.00001 0.12511 ) - =================================================== - |S| = 0.21671E+00 - pressure = 0.125E+00 au - = 0.368E+02 Mbar - = 0.368E+04 GPa - = 0.363E+08 atm - - - dE/da = 0.12512 - dE/db = 0.12512 - dE/dc = 0.12511 - dE/dalpha = -0.00003 - dE/dbeta = -0.00002 - dE/dgamma = -0.00001 - - - - - ************************************************************* - ** ** - ** PSPW Mulliken analysis ** - ** ** - ** Population analysis algorithm devloped by Ryoichi Kawai ** - ** ** - ** Thu Oct 3 16:57 ** - ** ** - ************************************************************* - - -== XYZ OUTPUT == - - - 2 - -W -0.002101 -0.001043 -0.003555 -W -1.577898 -1.578956 -1.576444 - - -== Atomic Orbital Expansion == - - W nodamping - - - ===================================================== - | POPULATION ANALYSIS OF FILLED MOLECULAR ORBITALS | - ===================================================== - - -== Using pseudoatomic orbital expansion == - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 1*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54143E+00 ( 14.733eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 -0.00018 -0.00011 0.00005 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.49999 0.00003 -0.68532 0.00001 0.10591 0.13824 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00001 -0.00003 -0.00187 -0.00238 -0.00028 0.00001 0.00000 -0.00017 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 0.00018 0.00011 -0.00005 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.49999 0.00003 -0.68532 0.00001 0.10591 0.13824 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00001 -0.00003 0.00187 0.00238 0.00028 -0.00001 -0.00000 0.00017 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 2*** SPIN=BOTH SUM= 0.12472E+01 E= 0.54143E+00 ( 14.733eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 0.00002 -0.00005 -0.00011 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.49998 -0.00001 -0.02322 0.00001 -0.61187 0.35363 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00002 -0.00001 0.00071 -0.00049 -0.00015 -0.00283 0.00006 0.00266 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00002 0.00005 0.00011 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.49998 -0.00001 -0.02322 0.00001 -0.61187 0.35363 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00002 -0.00001 -0.00071 0.00049 0.00015 0.00283 -0.00006 -0.00266 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 3*** SPIN=BOTH SUM= 0.12472E+01 E= 0.54141E+00 ( 14.733eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 0.00010 0.00006 0.00020 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.49999 0.00000 0.17259 0.00000 0.33820 0.59651 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00001 0.00000 0.00001 -0.00015 0.00015 -0.00033 -0.00325 -0.00033 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00000 -0.00010 -0.00006 -0.00020 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.49999 0.00000 0.17259 0.00000 0.33820 0.59651 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00001 0.00000 -0.00001 0.00015 -0.00015 0.00033 0.00325 0.00033 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 4*** SPIN=BOTH SUM= 0.14577E+01 E= 0.35969E+00 ( 9.788eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00002 0.00162 -0.00440 0.00049 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.48998 -0.09896 0.00001 0.69296 0.00001 -0.00001 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00999 -0.09993 0.00031 -0.00131 -0.00234 -0.00064 0.00000 0.00022 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00002 0.00162 -0.00440 0.00049 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.48998 0.09896 -0.00001 -0.69296 -0.00001 0.00001 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00999 0.09993 0.00031 -0.00131 -0.00234 -0.00064 0.00000 0.00022 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 0.9800 0.0200 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 5*** SPIN=BOTH SUM= 0.14616E+01 E= 0.35968E+00 ( 9.787eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00001 0.00206 0.00063 -0.00121 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.48871 -0.69206 -0.00002 -0.09883 0.00001 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.01129 -0.10621 0.00214 0.00009 0.00033 0.00014 0.00000 0.00063 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00001 0.00206 0.00063 -0.00121 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.48871 0.69206 0.00002 0.09883 -0.00001 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.01129 0.10621 0.00214 0.00009 0.00033 0.00014 0.00000 0.00063 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 0.9774 0.0226 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 6*** SPIN=BOTH SUM= 0.19540E+01 E= 0.20314E+00 ( 5.528eV) - -NO ATOM L POPULATION - s - 1 W 0 0.49974 -0.70692 - px pz py - 1 W 1 0.00000 0.00028 0.00047 0.00014 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.00000 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00026 0.01609 -0.00000 -0.00007 0.00021 -0.00003 0.00000 -0.00004 - s - 2 W 0 0.49974 -0.70692 - px pz py - 2 W 1 0.00000 -0.00028 -0.00047 -0.00014 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.00000 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00026 0.01609 0.00000 0.00007 -0.00021 0.00003 -0.00000 0.00004 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.9995 0.0000 0.0000 0.0005 - - - ======================================== - | POPULATION ANALYSIS ON EACH ATOM | - ======================================== - - -NO ATOM SPIN TOTAL s p d f - 1 W UP 3.00000 0.49974 0.00003 2.47866 0.02157 - 1 W DOWN 3.00000 0.49974 0.00003 2.47866 0.02157 - 2 W UP 3.00000 0.49974 0.00003 2.47866 0.02157 - 2 W DOWN 3.00000 0.49974 0.00003 2.47866 0.02157 - - - -=== TOTAL ANGULAR MOMENTUM POPULATION === - - SPIN s p d f - UP 16.66% 0.00% 82.62% 0.72% - UP 16.66% 0.00% 82.62% 0.72% - TOTAL 16.66% 0.00% 82.62% 0.72% - - ************************************************************* - ** ** - ** PSPW Atomic Point Charge (APC) Analysis ** - ** ** - ** Point charge analysis based on paper by P.E. Blochl ** - ** (J. Chem. Phys. vol 103, page 7422, 1995) ** - ** ** - ************************************************************* - - pspw_APC data structure - ----------------------- - nga, ngs: 3 6 - Gc : 2.5000000000000000 - APC gamma: 1 0.59999999999999998 - APC gamma: 2 0.90000000000000002 - APC gamma: 3 1.3500000000000001 - - charge analysis on each atom - ---------------------------- - - no atom Qelc Qion Qtotal - -- ---- ------- ------- ------- - 1 W -6.000 6.000 -0.000 - 2 W -6.000 6.000 -0.000 - Total Q -12.000 12.000 -0.000 - - - gaussian coefficients of model density - -------------------------------------- - - no atom g=0.000 g=0.600 g=0.900 g=1.350 - -- ---- ------- ------- ------- ------- - 1 W 6.000 -7.235 17.653 -16.419 - 2 W 6.000 -7.235 17.653 -16.419 - - -=== Electric Field at Atoms === - - 1 W Atomic Electric Field =( -0.00022 -0.00011 -0.00038 ) - (ion) =( 0.00094 0.00047 0.00159 ) - (electronic) =( -0.00116 -0.00058 -0.00197 ) - 2 W Atomic Electric Field =( 0.00022 0.00011 0.00038 ) - (ion) =( -0.00094 -0.00047 -0.00159 ) - (electronic) =( 0.00116 0.00058 0.00197 ) - - output psi filename:./nwchem_lammps.movecs - - -== Timing == - -cputime in seconds - prologue : 0.114428E+00 - main loop : 0.475396E+00 - epilogue : 0.316691E-01 - total : 0.621493E+00 - cputime/step: 0.559289E-02 ( 85 evalulations, 20 linesearches) - - -Time spent doing total step percent - total time : 0.623259E+00 0.733246E-02 100.0 % - i/o time : 0.103071E-01 0.121260E-03 1.7 % - FFTs : 0.348712E-01 0.410250E-03 5.6 % - dot products : 0.981057E-02 0.115418E-03 1.6 % - geodesic : 0.696999E-01 0.819999E-03 11.2 % - ffm_dgemm : 0.104145E-02 0.122523E-04 0.2 % - fmf_dgemm : 0.565297E-01 0.665055E-03 9.1 % - mmm_dgemm : 0.129490E-03 0.152342E-05 0.0 % - m_diagonalize : 0.701885E-03 0.825747E-05 0.1 % - exchange correlation : 0.764353E-01 0.899239E-03 12.3 % - local pseudopotentials : 0.439882E-03 0.517509E-05 0.1 % - non-local pseudopotentials : 0.271890E-01 0.319871E-03 4.4 % - hartree potentials : 0.202482E-02 0.238214E-04 0.3 % - ion-ion interaction : 0.104062E+00 0.122426E-02 16.7 % - structure factors : 0.152984E-01 0.179981E-03 2.5 % - phase factors : 0.107278E-04 0.126210E-06 0.0 % - masking and packing : 0.304392E-01 0.358108E-03 4.9 % - queue fft : 0.111536E+00 0.131219E-02 17.9 % - queue fft (serial) : 0.708244E-01 0.833228E-03 11.4 % - queue fft (message passing): 0.360800E-01 0.424470E-03 5.8 % - non-local psp FFM : 0.860008E-02 0.101177E-03 1.4 % - non-local psp FMF : 0.111482E-01 0.131155E-03 1.8 % - non-local psp FFM A : 0.214632E-02 0.252509E-04 0.3 % - non-local psp FFM B : 0.560879E-02 0.659858E-04 0.9 % - - >>> JOB COMPLETED AT Thu Oct 3 16:57:18 2019 <<< - - Task times cpu: 0.6s wall: 0.6s - Summary of allocated global arrays ------------------------------------ - No active global arrays - - - - GA Statistics for process 0 - ------------------------------ - - create destroy get put acc scatter gather read&inc -calls: 0 0 0 0 0 0 0 0 -number of processes/call 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 -bytes total: 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 -bytes remote: 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 -Max memory consumed for GA by this process: 0 bytes -MA_summarize_allocated_blocks: starting scan ... -MA_summarize_allocated_blocks: scan completed: 0 heap blocks, 0 stack blocks -MA usage statistics: - - allocation statistics: - heap stack - ---- ----- - current number of blocks 0 0 - maximum number of blocks 294 17 - current total bytes 0 0 - maximum total bytes 4879496 351944 - maximum total K-bytes 4880 352 - maximum total M-bytes 5 1 - - - NWChem Input Module - ------------------- - - - - - - CITATION - -------- - Please cite the following reference when publishing - results obtained with NWChem: - - M. Valiev, E.J. Bylaska, N. Govind, K. Kowalski, - T.P. Straatsma, H.J.J. van Dam, D. Wang, J. Nieplocha, - E. Apra, T.L. Windus, W.A. de Jong - "NWChem: a comprehensive and scalable open-source - solution for large scale molecular simulations" - Comput. Phys. Commun. 181, 1477 (2010) - doi:10.1016/j.cpc.2010.04.018 - - AUTHORS - ------- - E. Apra, E. J. Bylaska, W. A. de Jong, N. Govind, K. Kowalski, - T. P. Straatsma, M. Valiev, H. J. J. van Dam, D. Wang, T. L. Windus, - J. Hammond, J. Autschbach, K. Bhaskaran-Nair, J. Brabec, K. Lopata, - S. A. Fischer, S. Krishnamoorthy, M. Jacquelin, W. Ma, M. Klemm, O. Villa, - Y. Chen, V. Anisimov, F. Aquino, S. Hirata, M. T. Hackler, V. Konjkov, - D. Mejia-Rodriguez, T. Risthaus, M. Malagoli, A. Marenich, - A. Otero-de-la-Roza, J. Mullin, P. Nichols, R. Peverati, J. Pittner, Y. Zhao, - P.-D. Fan, A. Fonari, M. J. Williamson, R. J. Harrison, J. R. Rehr, - M. Dupuis, D. Silverstein, D. M. A. Smith, J. Nieplocha, V. Tipparaju, - M. Krishnan, B. E. Van Kuiken, A. Vazquez-Mayagoitia, L. Jensen, M. Swart, - Q. Wu, T. Van Voorhis, A. A. Auer, M. Nooijen, L. D. Crosby, E. Brown, - G. Cisneros, G. I. Fann, H. Fruchtl, J. Garza, K. Hirao, R. A. Kendall, - J. A. Nichols, K. Tsemekhman, K. Wolinski, J. Anchell, D. E. Bernholdt, - P. Borowski, T. Clark, D. Clerc, H. Dachsel, M. J. O. Deegan, K. Dyall, - D. Elwood, E. Glendening, M. Gutowski, A. C. Hess, J. Jaffe, B. G. Johnson, - J. Ju, R. Kobayashi, R. Kutteh, Z. Lin, R. Littlefield, X. Long, B. Meng, - T. Nakajima, S. Niu, L. Pollack, M. Rosing, K. Glaesemann, G. Sandrone, - M. Stave, H. Taylor, G. Thomas, J. H. van Lenthe, A. T. Wong, Z. Zhang. - - Total times cpu: 0.6s wall: 0.7s diff --git a/examples/COUPLE/lammps_nwchem/planewave/nwchem_lammps.out.W.min.3Oct19 b/examples/COUPLE/lammps_nwchem/planewave/nwchem_lammps.out.W.min.3Oct19 deleted file mode 100644 index 519df5d8ba..0000000000 --- a/examples/COUPLE/lammps_nwchem/planewave/nwchem_lammps.out.W.min.3Oct19 +++ /dev/null @@ -1,816 +0,0 @@ - argument 1 = nwchem_lammps.nw - - - -============================== echo of input deck ============================== -echo - -#**** Enter the geometry using fractional coordinates **** -geometry units angstrom noautosym - system crystal - lat_a 3.16d0 - lat_b 3.16d0 - lat_c 3.16d0 - end -W 0.0158218 0.0316436 0.0474661 -W 0.515824 0.531647 0.547471 -end - -nwpw - vectors input nwchem_lammps.movecs -end - -#***** setup the nwpw gamma point code **** -nwpw - simulation_cell - ngrid 16 16 16 - end - ewald_ncut 8 - mulliken - lcao #old default -end - -nwpw - tolerances 1.0d-9 1.0d-9 -end - -task pspw stress -================================================================================ - - - - - - - Northwest Computational Chemistry Package (NWChem) 6.8 - ------------------------------------------------------ - - - Environmental Molecular Sciences Laboratory - Pacific Northwest National Laboratory - Richland, WA 99352 - - Copyright (c) 1994-2018 - Pacific Northwest National Laboratory - Battelle Memorial Institute - - NWChem is an open-source computational chemistry package - distributed under the terms of the - Educational Community License (ECL) 2.0 - A copy of the license is included with this distribution - in the LICENSE.TXT file - - ACKNOWLEDGMENT - -------------- - - This software and its documentation were developed at the - EMSL at Pacific Northwest National Laboratory, a multiprogram - national laboratory, operated for the U.S. Department of Energy - by Battelle under Contract Number DE-AC05-76RL01830. Support - for this work was provided by the Department of Energy Office - of Biological and Environmental Research, Office of Basic - Energy Sciences, and the Office of Advanced Scientific Computing. - - - Job information - --------------- - - hostname = singsing - program = /home/sjplimp/tools/nwchem-6.8.1-release/bin/LINUX64/nwchem - date = Thu Oct 3 16:58:54 2019 - - compiled = Wed_Oct_02_09:25:27_2019 - source = /home/sjplimp/tools/nwchem-6.8.1-release - nwchem branch = Development - nwchem revision = N/A - ga revision = 5.6.5 - use scalapack = F - input = nwchem_lammps.nw - prefix = nwchem_lammps. - data base = ./nwchem_lammps.db - status = restart - nproc = 1 - time left = -1s - - - - Memory information - ------------------ - - heap = 13107200 doubles = 100.0 Mbytes - stack = 13107197 doubles = 100.0 Mbytes - global = 26214400 doubles = 200.0 Mbytes (distinct from heap & stack) - total = 52428797 doubles = 400.0 Mbytes - verify = yes - hardfail = no - - - Directory information - --------------------- - - 0 permanent = . - 0 scratch = . - - - Previous task information - ------------------------- - - Theory = pspw - Operation = stress - Status = unknown - Qmmm = F - Ignore = F - - - Geometries in the database - -------------------------- - - Name Natoms Last Modified - -------------------------------- ------ ------------------------ - 1 geometry 2 Thu Oct 3 16:58:53 2019 - - The geometry named "geometry" is the default for restart - - - - Basis sets in the database - -------------------------- - - There are no basis sets in the database - - - - NWChem Input Module - ------------------- - - - - !!!!!!!!! geom_3d NEEDS TESTING !!!!!!!!!! - - - Geometry "geometry" -> "" - ------------------------- - - Output coordinates in angstroms (scale by 1.889725989 to convert to a.u.) - - No. Tag Charge X Y Z - ---- ---------------- ---------- -------------- -------------- -------------- - 1 W 74.0000 0.04999689 0.09999378 0.14999288 - 2 W 74.0000 1.63000384 1.68000452 1.73000836 - - Lattice Parameters - ------------------ - - lattice vectors in angstroms (scale by 1.889725989 to convert to a.u.) - - a1=< 3.160 0.000 0.000 > - a2=< 0.000 3.160 0.000 > - a3=< 0.000 0.000 3.160 > - a= 3.160 b= 3.160 c= 3.160 - alpha= 90.000 beta= 90.000 gamma= 90.000 - omega= 31.6 - - reciprocal lattice vectors in a.u. - - b1=< 1.052 0.000 -0.000 > - b2=< -0.000 1.052 -0.000 > - b3=< 0.000 0.000 1.052 > - - Atomic Mass - ----------- - - W 183.951000 - - - - XYZ format geometry - ------------------- - 2 - geometry - W 0.04999689 0.09999378 0.14999288 - W 1.63000384 1.68000452 1.73000836 - - ============================================================================== - internuclear distances - ------------------------------------------------------------------------------ - center one | center two | atomic units | angstroms - ------------------------------------------------------------------------------ - 2 W | 1 W | 5.17154 | 2.73666 - ------------------------------------------------------------------------------ - number of included internuclear distances: 1 - ============================================================================== - - - - >>>> PSPW Parallel Module - stress <<<< - **************************************************** - * * - * NWPW PSPW Calculation * - * * - * [ (Grassmann/Stiefel manifold implementation) ] * - * * - * [ NorthWest Chemistry implementation ] * - * * - * version #5.10 06/12/02 * - * * - * This code was developed by Eric J. Bylaska, * - * and was based upon algorithms and code * - * developed by the group of Prof. John H. Weare * - * * - **************************************************** - >>> JOB STARTED AT Thu Oct 3 16:58:54 2019 <<< - ================ input data ======================== - - input psi filename:./nwchem_lammps.movecs - - initializing pspw_APC data structure - ------------------------------------ - nga, ngs: 3 6 - Gc : 2.5000000000000000 - APC gamma: 1 0.59999999999999998 - APC gamma: 2 0.90000000000000002 - APC gamma: 3 1.3500000000000001 - - number of processors used: 1 - processor grid : 1 x 1 - parallel mapping :2d hilbert - parallel mapping : balanced - number of threads : 1 - parallel io : off - - options: - boundary conditions = periodic (version3) - electron spin = restricted - exchange-correlation = LDA (Vosko et al) parameterization - - elements involved in the cluster: - 1: W valence charge: 6.0000 lmax= 2 - comment : Troullier-Martins pseudopotential - pseudpotential type : 0 - highest angular component : 2 - local potential used : 0 - number of non-local projections: 8 - semicore corrections included : 1.800 (radius) 4.538 (charge) - cutoff = 2.389 3.185 2.244 - - - total charge: 0.000 - - atomic composition: - W : 2 - - number of electrons: spin up= 6 ( 6 per task) down= 6 ( 6 per task) (Fourier space) - number of orbitals : spin up= 6 ( 6 per task) down= 6 ( 6 per task) (Fourier space) - - supercell: - cell_name: cell_default - lattice: a1=< 5.972 0.000 0.000 > - a2=< 0.000 5.972 0.000 > - a3=< 0.000 0.000 5.972 > - reciprocal: b1=< 1.052 0.000 -0.000 > - b2=< -0.000 1.052 -0.000 > - b3=< 0.000 0.000 1.052 > - lattice: a= 5.972 b= 5.972 c= 5.972 - alpha= 90.000 beta= 90.000 gamma= 90.000 - omega= 212.9 - - density cutoff= 35.427 fft= 16x 16x 16( 1052 waves 1052 per task) - wavefnc cutoff= 35.427 fft= 16x 16x 16( 1052 waves 1052 per task) - Ewald summation: cut radius= 1.90 and 8 - Madelung Wigner-Seitz= 1.76011888 (alpha= 2.83729748 rs= 3.70444413) - - technical parameters: - time step= 5.80 fictitious mass= 400000.0 - tolerance=0.100E-08 (energy) 0.100E-08 (density) - maximum iterations = 1000 ( 10 inner 100 outer ) - - - - - -== Energy Calculation == - - - ====== Grassmann conjugate gradient iteration ====== - >>> ITERATION STARTED AT Thu Oct 3 16:58:54 2019 <<< - iter. Energy DeltaE DeltaRho - ------------------------------------------------------ - 10 -0.2020460841E+02 -0.37164E-09 0.13892E-11 - *** tolerance ok. iteration terminated - >>> ITERATION ENDED AT Thu Oct 3 16:58:54 2019 <<< - - -== Summary Of Results == - - number of electrons: spin up= 6.00000 down= 6.00000 (real space) - - total energy : -0.2020460841E+02 ( -0.10102E+02/ion) - total orbital energy: 0.5093526999E+01 ( 0.84892E+00/electron) - hartree energy : 0.2902689593E+00 ( 0.48378E-01/electron) - exc-corr energy : -0.9445045626E+01 ( -0.15742E+01/electron) - ion-ion energy : -0.2193948849E+02 ( -0.10970E+02/ion) - - kinetic (planewave) : 0.1441573280E+02 ( 0.24026E+01/electron) - V_local (planewave) : 0.1156119613E+02 ( 0.19269E+01/electron) - V_nl (planewave) : -0.1508727219E+02 ( -0.25145E+01/electron) - V_Coul (planewave) : 0.5805379185E+00 ( 0.96756E-01/electron) - V_xc. (planewave) : -0.6376667662E+01 ( -0.10628E+01/electron) - Virial Coefficient : -0.6466688811E+00 - - orbital energies: - 0.5414223E+00 ( 14.733eV) - 0.5414201E+00 ( 14.733eV) - 0.5414174E+00 ( 14.733eV) - 0.3596809E+00 ( 9.787eV) - 0.3596804E+00 ( 9.787eV) - 0.2031424E+00 ( 5.528eV) - - Total PSPW energy : -0.2020460841E+02 - - -=== Spin Contamination === - - = 0.0000000000000000 - = 0.0000000000000000 - - - -== Center of Charge == - -spin up ( 0.0106, 0.0203, 0.0283 ) -spin down ( 0.0106, 0.0203, 0.0283 ) - total ( 0.0106, 0.0203, 0.0283 ) -ionic ( -1.3984, -1.3039, -1.2094 ) - - -== Molecular Dipole wrt Center of Mass == - -mu = ( -16.9083, -15.8910, -14.8528 ) au -|mu| = 27.5503 au, 70.0218 Debye - - -Translation force removed: ( -0.00002 0.00000 0.00002) - - - ============= Ion Gradients ================= - Ion Forces: - 1 W ( -0.000001 0.000005 0.000014 ) - 2 W ( 0.000001 -0.000005 -0.000014 ) - C.O.M. ( -0.000000 0.000000 0.000000 ) - =============================================== - |F| = 0.216488E-04 - |F|/nion = 0.108244E-04 - max|Fatom|= 0.153080E-04 ( 0.001eV/Angstrom) - - - - -====================== -= Stress calculation = -====================== - - - ============= total gradient ============== - S = ( 0.12513 0.00001 -0.00003 ) - ( 0.00001 0.12513 -0.00001 ) - ( -0.00003 -0.00001 0.12513 ) - =================================================== - |S| = 0.21673E+00 - pressure = 0.125E+00 au - = 0.368E+02 Mbar - = 0.368E+04 GPa - = 0.363E+08 atm - - - dE/da = 0.12513 - dE/db = 0.12513 - dE/dc = 0.12513 - dE/dalpha = 0.00006 - dE/dbeta = 0.00020 - dE/dgamma = -0.00008 - - - - - ************************************************************* - ** ** - ** PSPW Mulliken analysis ** - ** ** - ** Population analysis algorithm devloped by Ryoichi Kawai ** - ** ** - ** Thu Oct 3 16:58 ** - ** ** - ************************************************************* - - -== XYZ OUTPUT == - - - 2 - -W 0.049997 0.099994 0.149993 -W -1.529995 -1.479995 -1.429991 - - -== Atomic Orbital Expansion == - - W nodamping - - - ===================================================== - | POPULATION ANALYSIS OF FILLED MOLECULAR ORBITALS | - ===================================================== - - -== Using pseudoatomic orbital expansion == - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 1*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54142E+00 ( 14.733eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00000 - px pz py - 1 W 1 0.00000 0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 -0.00001 -0.03953 0.00002 0.50309 0.49532 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 -0.00001 -0.00000 -0.00000 0.00000 0.00000 -0.00001 -0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 -0.00001 -0.03953 0.00002 0.50309 0.49532 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 -0.00001 0.00000 0.00000 -0.00000 -0.00000 0.00001 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 2*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54142E+00 ( 14.733eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 0.00004 0.62658 0.00003 -0.20360 0.25680 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 -0.00004 0.00000 0.00000 -0.00000 -0.00000 -0.00001 0.00000 - s - 2 W 0 0.00000 -0.00000 - px pz py - 2 W 1 0.00000 -0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 0.00004 0.62658 0.00003 -0.20360 0.25680 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 -0.00004 -0.00000 -0.00000 -0.00000 0.00000 0.00001 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 3*** SPIN=BOTH SUM= 0.12471E+01 E= 0.54142E+00 ( 14.733eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 0.00001 - px pz py - 1 W 1 0.00000 0.00000 -0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.50000 -0.00001 -0.32532 -0.00000 -0.45327 0.43441 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00000 0.00001 0.00000 -0.00000 -0.00000 -0.00000 -0.00000 0.00000 - s - 2 W 0 0.00000 0.00001 - px pz py - 2 W 1 0.00000 -0.00000 0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.50000 -0.00001 -0.32532 -0.00000 -0.45327 0.43441 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00000 0.00001 -0.00000 0.00001 0.00000 0.00000 0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 1.0000 0.0000 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 4*** SPIN=BOTH SUM= 0.14785E+01 E= 0.35968E+00 ( 9.787eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 -0.00000 0.00001 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.48310 0.33381 0.00000 -0.60965 0.00000 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.01690 0.13001 -0.00000 0.00000 0.00000 0.00000 0.00000 -0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 0.00001 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.48310 -0.33381 -0.00000 0.60965 -0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.01690 -0.13001 -0.00000 0.00000 0.00000 0.00000 0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 0.9662 0.0338 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 5*** SPIN=BOTH SUM= 0.14407E+01 E= 0.35968E+00 ( 9.787eV) - -NO ATOM L POPULATION - s - 1 W 0 0.00000 -0.00000 - px pz py - 1 W 1 0.00000 -0.00000 -0.00000 0.00001 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.49580 0.61761 -0.00000 0.33817 0.00000 -0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00420 0.06484 -0.00001 0.00000 -0.00000 -0.00000 -0.00000 -0.00000 - s - 2 W 0 0.00000 0.00000 - px pz py - 2 W 1 0.00000 -0.00000 -0.00000 0.00001 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.49580 -0.61761 0.00000 -0.33817 -0.00000 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00420 -0.06484 -0.00001 0.00000 -0.00000 -0.00000 -0.00000 -0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.0000 0.0000 0.9916 0.0084 - - ------------------------------------------------------------------------------- - - -*** ORBITAL= 6*** SPIN=BOTH SUM= 0.19540E+01 E= 0.20314E+00 ( 5.528eV) - -NO ATOM L POPULATION - s - 1 W 0 0.49974 -0.70692 - px pz py - 1 W 1 0.00000 0.00000 -0.00000 0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 1 W 2 0.00000 0.00000 -0.00000 -0.00000 -0.00000 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 1 W 3 0.00026 0.01609 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 -0.00000 - s - 2 W 0 0.49974 -0.70692 - px pz py - 2 W 1 0.00000 -0.00000 0.00000 -0.00000 - dx2-y2 dzx d3z2-1 dyz dxy - 2 W 2 0.00000 0.00000 -0.00000 -0.00000 -0.00000 0.00000 - fx(x2-3y2) fz(5z2-1) fx(5z2-1) fz(5z2-3) fy(5z2-1) fxyz fy(3x2-y2) - 2 W 3 0.00026 0.01609 0.00000 0.00000 -0.00000 0.00000 0.00000 0.00000 - - -=== DISTRIBUTION === - - 1(W ) 0.5000 2(W ) 0.5000 - - -== ANGULAR MOMENTUM POPULATIONS === - - s p d f - 0.9995 0.0000 0.0000 0.0005 - - - ======================================== - | POPULATION ANALYSIS ON EACH ATOM | - ======================================== - - -NO ATOM SPIN TOTAL s p d f - 1 W UP 3.00000 0.49974 0.00000 2.47889 0.02137 - 1 W DOWN 3.00000 0.49974 0.00000 2.47889 0.02137 - 2 W UP 3.00000 0.49974 0.00000 2.47889 0.02137 - 2 W DOWN 3.00000 0.49974 0.00000 2.47889 0.02137 - - - -=== TOTAL ANGULAR MOMENTUM POPULATION === - - SPIN s p d f - UP 16.66% 0.00% 82.63% 0.71% - UP 16.66% 0.00% 82.63% 0.71% - TOTAL 16.66% 0.00% 82.63% 0.71% - - ************************************************************* - ** ** - ** PSPW Atomic Point Charge (APC) Analysis ** - ** ** - ** Point charge analysis based on paper by P.E. Blochl ** - ** (J. Chem. Phys. vol 103, page 7422, 1995) ** - ** ** - ************************************************************* - - pspw_APC data structure - ----------------------- - nga, ngs: 3 6 - Gc : 2.5000000000000000 - APC gamma: 1 0.59999999999999998 - APC gamma: 2 0.90000000000000002 - APC gamma: 3 1.3500000000000001 - - charge analysis on each atom - ---------------------------- - - no atom Qelc Qion Qtotal - -- ---- ------- ------- ------- - 1 W -6.000 6.000 -0.000 - 2 W -6.000 6.000 0.000 - Total Q -12.000 12.000 -0.000 - - - gaussian coefficients of model density - -------------------------------------- - - no atom g=0.000 g=0.600 g=0.900 g=1.350 - -- ---- ------- ------- ------- ------- - 1 W 6.000 -7.235 17.654 -16.419 - 2 W 6.000 -7.234 17.651 -16.418 - - -=== Electric Field at Atoms === - - 1 W Atomic Electric Field =( -0.00002 0.00000 0.00001 ) - (ion) =( 0.00000 0.00000 0.00000 ) - (electronic) =( -0.00002 -0.00000 0.00001 ) - 2 W Atomic Electric Field =( -0.00002 0.00000 0.00002 ) - (ion) =( -0.00000 -0.00000 -0.00000 ) - (electronic) =( -0.00002 0.00000 0.00002 ) - - output psi filename:./nwchem_lammps.movecs - - -== Timing == - -cputime in seconds - prologue : 0.991130E-01 - main loop : 0.101190E+00 - epilogue : 0.203540E-01 - total : 0.220657E+00 - cputime/step: 0.252975E-01 ( 4 evalulations, 1 linesearches) - - -Time spent doing total step percent - total time : 0.222262E+00 0.555655E-01 100.0 % - i/o time : 0.847340E-02 0.211835E-02 3.8 % - FFTs : 0.576015E-02 0.144004E-02 2.6 % - dot products : 0.157053E-02 0.392634E-03 0.7 % - geodesic : 0.203228E-02 0.508070E-03 0.9 % - ffm_dgemm : 0.641376E-04 0.160344E-04 0.0 % - fmf_dgemm : 0.202988E-02 0.507471E-03 0.9 % - mmm_dgemm : 0.286302E-05 0.715756E-06 0.0 % - m_diagonalize : 0.101088E-03 0.252721E-04 0.0 % - exchange correlation : 0.287819E-02 0.719547E-03 1.3 % - local pseudopotentials : 0.346661E-03 0.866652E-04 0.2 % - non-local pseudopotentials : 0.268912E-02 0.672280E-03 1.2 % - hartree potentials : 0.163791E-03 0.409476E-04 0.1 % - ion-ion interaction : 0.699389E-01 0.174847E-01 31.5 % - structure factors : 0.889608E-02 0.222402E-02 4.0 % - phase factors : 0.102510E-04 0.256275E-05 0.0 % - masking and packing : 0.839656E-02 0.209914E-02 3.8 % - queue fft : 0.418949E-02 0.104737E-02 1.9 % - queue fft (serial) : 0.264608E-02 0.661519E-03 1.2 % - queue fft (message passing): 0.136477E-02 0.341193E-03 0.6 % - non-local psp FFM : 0.391964E-03 0.979910E-04 0.2 % - non-local psp FMF : 0.407219E-03 0.101805E-03 0.2 % - non-local psp FFM A : 0.144235E-03 0.360588E-04 0.1 % - non-local psp FFM B : 0.216961E-03 0.542402E-04 0.1 % - - >>> JOB COMPLETED AT Thu Oct 3 16:58:54 2019 <<< - - Task times cpu: 0.2s wall: 0.2s - Summary of allocated global arrays ------------------------------------ - No active global arrays - - - - GA Statistics for process 0 - ------------------------------ - - create destroy get put acc scatter gather read&inc -calls: 0 0 0 0 0 0 0 0 -number of processes/call 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 -bytes total: 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 -bytes remote: 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 0.00e+00 -Max memory consumed for GA by this process: 0 bytes -MA_summarize_allocated_blocks: starting scan ... -MA_summarize_allocated_blocks: scan completed: 0 heap blocks, 0 stack blocks -MA usage statistics: - - allocation statistics: - heap stack - ---- ----- - current number of blocks 0 0 - maximum number of blocks 294 17 - current total bytes 0 0 - maximum total bytes 4879496 351944 - maximum total K-bytes 4880 352 - maximum total M-bytes 5 1 - - - NWChem Input Module - ------------------- - - - - - - CITATION - -------- - Please cite the following reference when publishing - results obtained with NWChem: - - M. Valiev, E.J. Bylaska, N. Govind, K. Kowalski, - T.P. Straatsma, H.J.J. van Dam, D. Wang, J. Nieplocha, - E. Apra, T.L. Windus, W.A. de Jong - "NWChem: a comprehensive and scalable open-source - solution for large scale molecular simulations" - Comput. Phys. Commun. 181, 1477 (2010) - doi:10.1016/j.cpc.2010.04.018 - - AUTHORS - ------- - E. Apra, E. J. Bylaska, W. A. de Jong, N. Govind, K. Kowalski, - T. P. Straatsma, M. Valiev, H. J. J. van Dam, D. Wang, T. L. Windus, - J. Hammond, J. Autschbach, K. Bhaskaran-Nair, J. Brabec, K. Lopata, - S. A. Fischer, S. Krishnamoorthy, M. Jacquelin, W. Ma, M. Klemm, O. Villa, - Y. Chen, V. Anisimov, F. Aquino, S. Hirata, M. T. Hackler, V. Konjkov, - D. Mejia-Rodriguez, T. Risthaus, M. Malagoli, A. Marenich, - A. Otero-de-la-Roza, J. Mullin, P. Nichols, R. Peverati, J. Pittner, Y. Zhao, - P.-D. Fan, A. Fonari, M. J. Williamson, R. J. Harrison, J. R. Rehr, - M. Dupuis, D. Silverstein, D. M. A. Smith, J. Nieplocha, V. Tipparaju, - M. Krishnan, B. E. Van Kuiken, A. Vazquez-Mayagoitia, L. Jensen, M. Swart, - Q. Wu, T. Van Voorhis, A. A. Auer, M. Nooijen, L. D. Crosby, E. Brown, - G. Cisneros, G. I. Fann, H. Fruchtl, J. Garza, K. Hirao, R. A. Kendall, - J. A. Nichols, K. Tsemekhman, K. Wolinski, J. Anchell, D. E. Bernholdt, - P. Borowski, T. Clark, D. Clerc, H. Dachsel, M. J. O. Deegan, K. Dyall, - D. Elwood, E. Glendening, M. Gutowski, A. C. Hess, J. Jaffe, B. G. Johnson, - J. Ju, R. Kobayashi, R. Kutteh, Z. Lin, R. Littlefield, X. Long, B. Meng, - T. Nakajima, S. Niu, L. Pollack, M. Rosing, K. Glaesemann, G. Sandrone, - M. Stave, H. Taylor, G. Thomas, J. H. van Lenthe, A. T. Wong, Z. Zhang. - - Total times cpu: 0.2s wall: 0.3s diff --git a/examples/COUPLE/lammps_nwchem/planewave/w.nw b/examples/COUPLE/lammps_nwchem/planewave/w.nw deleted file mode 100644 index 5f78801174..0000000000 --- a/examples/COUPLE/lammps_nwchem/planewave/w.nw +++ /dev/null @@ -1,28 +0,0 @@ -echo - -#**** Enter the geometry using fractional coordinates **** -geometry units angstrom noautosym - system crystal - lat_a 3.16d0 - lat_b 3.16d0 - lat_c 3.16d0 - end -W 0.0 0.0 0.0 -W 0.5 0.5 0.5 -end - -#***** setup the nwpw gamma point code **** -nwpw - simulation_cell - ngrid 16 16 16 - end - ewald_ncut 8 - mulliken - lcao #old default -end - -nwpw - tolerances 1.0d-9 1.0d-9 -end - -task pspw stress diff --git a/examples/COUPLE/lammps_vasp/INCAR b/examples/COUPLE/lammps_vasp/INCAR deleted file mode 100644 index ac2358e5fb..0000000000 --- a/examples/COUPLE/lammps_vasp/INCAR +++ /dev/null @@ -1,53 +0,0 @@ -# Startparameter for this run: - NWRITE = 2 write-flag & timer - PREC = normal normal or accurate (medium, high low for compatibility) - ISTART = 0 job : 0-new 1-cont 2-samecut - ICHARG = 2 charge: 1-file 2-atom 10-const - ISPIN = 1 spin polarized calculation? - LSORBIT = F spin-orbit coupling - INIWAV = 1 electr: 0-lowe 1-rand 2-diag - -# Electronic Relaxation 1 - ENCUT = 600.0 eV #Plane wave energy cutoff - ENINI = 600.0 initial cutoff - NELM = 100; NELMIN= 2; NELMDL= -5 # of ELM steps - EDIFF = 0.1E-05 stopping-criterion for ELM -# Ionic relaxation - EDIFFG = 0.1E-02 stopping-criterion for IOM - NSW = 0 number of steps for IOM - NBLOCK = 1; KBLOCK = 1 inner block; outer block - IBRION = -1 ionic relax: 0-MD 1-quasi-New 2-CG #No ion relaxation with -1 - NFREE = 0 steps in history (QN), initial steepest desc. (CG) - ISIF = 2 stress and relaxation # 2: F-yes Sts-yes RlxIon-yes cellshape-no cellvol-no - IWAVPR = 10 prediction: 0-non 1-charg 2-wave 3-comb # 10: TMPCAR stored in memory rather than file - - POTIM = 0.5000 time-step for ionic-motion - TEBEG = 3500.0; TEEND = 3500.0 temperature during run # Finite Temperature variables if AI-MD is on - SMASS = -3.00 Nose mass-parameter (am) - estimated Nose-frequenzy (Omega) = 0.10E-29 period in steps =****** mass= -0.366E-27a.u. - PSTRESS= 0.0 pullay stress - -# DOS related values: - EMIN = 10.00; EMAX =-10.00 energy-range for DOS - EFERMI = 0.00 - ISMEAR = 0; SIGMA = 0.10 broadening in eV -4-tet -1-fermi 0-gaus - -# Electronic relaxation 2 (details) - IALGO = 48 algorithm - -# Write flags - LWAVE = T write WAVECAR - LCHARG = T write CHGCAR - LVTOT = F write LOCPOT, total local potential - LVHAR = F write LOCPOT, Hartree potential only - LELF = F write electronic localiz. function (ELF) - -# Dipole corrections - LMONO = F monopole corrections only (constant potential shift) - LDIPOL = F correct potential (dipole corrections) - IDIPOL = 0 1-x, 2-y, 3-z, 4-all directions - EPSILON= 1.0000000 bulk dielectric constant - -# Exchange correlation treatment: - GGA = -- GGA type - diff --git a/examples/COUPLE/lammps_vasp/KPOINTS b/examples/COUPLE/lammps_vasp/KPOINTS deleted file mode 100644 index 322509da30..0000000000 --- a/examples/COUPLE/lammps_vasp/KPOINTS +++ /dev/null @@ -1,6 +0,0 @@ -K-Points - 0 -Monkhorst Pack - 15 15 15 - 0 0 0 - diff --git a/examples/COUPLE/lammps_vasp/POSCAR_W b/examples/COUPLE/lammps_vasp/POSCAR_W deleted file mode 100644 index aba5df54a0..0000000000 --- a/examples/COUPLE/lammps_vasp/POSCAR_W +++ /dev/null @@ -1,11 +0,0 @@ -W unit cell -1.0 -3.16 0.00000000 0.00000000 -0.00000000 3.16 0.00000000 -0.00000000 0.00000000 3.16 -W -2 -Direct - 0.00000000 0.00000000 0.00000000 - 0.50000000 0.50000000 0.50000000 - diff --git a/examples/COUPLE/lammps_vasp/README b/examples/COUPLE/lammps_vasp/README deleted file mode 100644 index d81a5326e6..0000000000 --- a/examples/COUPLE/lammps_vasp/README +++ /dev/null @@ -1,149 +0,0 @@ -Sample LAMMPS MD wrapper on VASP quantum DFT via client/server -coupling - -See the MESSAGE package documentation Build_extras.html#message -and Build_extras.html#message for more details on how client/server -coupling works in LAMMPS. - -In this dir, the vasp_wrap.py is a wrapper on the VASP quantum DFT -code so it can work as a "server" code which LAMMPS drives as a -"client" code to perform ab initio MD. LAMMPS performs the MD -timestepping, sends VASP a current set of coordinates each timestep, -VASP computes forces and energy and virial and returns that info to -LAMMPS. - -Messages are exchanged between MC and LAMMPS via a client/server -library (CSlib), which is included in the LAMMPS distribution in -lib/message. As explained below you can choose to exchange data -between the two programs either via files or sockets (ZMQ). If the -vasp_wrap.py program became parallel, or the CSlib library calls were -integrated into VASP directly, then data could also be exchanged via -MPI. - ----------------- - -Build LAMMPS with its MESSAGE package installed: - -See the Build extras doc page and its MESSAGE package -section for details. - -CMake: - --D PKG_MESSAGE=yes # include the MESSAGE package --D MESSAGE_ZMQ=value # build with ZeroMQ support, value = no (default) or yes - -Traditional make: - -cd lammps/lib/message -python Install.py -m -z # build CSlib with MPI and ZMQ support -cd lammps/src -make yes-message -make mpi - -You can leave off the -z if you do not have ZMQ on your system. - ----------------- - -Build the CSlib in a form usable by the vasp_wrapper.py script: - -% cd lammps/lib/message/cslib/src -% make shlib # build serial and parallel shared lib with ZMQ support -% make shlib zmq=no # build serial and parallel shared lib w/out ZMQ support - -This will make a shared library versions of the CSlib, which Python -requires. Python must be able to find both the cslib.py script and -the libcsnompi.so library in your lammps/lib/message/cslib/src -directory. If it is not able to do this, you will get an error when -you run vasp_wrapper.py. - -You can do this by augmenting two environment variables, either -from the command line, or in your shell start-up script. -Here is the sample syntax for the csh or tcsh shells: - -setenv PYTHONPATH ${PYTHONPATH}:/home/sjplimp/lammps/lib/message/cslib/src -setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/home/sjplimp/lammps/lib/message/cslib/src - ----------------- - -Prepare to use VASP and the vasp_wrapper.py script - -You can run the vasp_wrap.py script as-is to test that the coupling -between it and LAMMPS is functional. This will use the included -vasprun.xml file output by a previous VASP run. - -But note that the as-is version of vasp_wrap.py will not attempt to -run VASP. - -To do this, you must edit the 1st vaspcmd line at the top of -vasp_wrapper.py to be the launch command needed to run VASP on your -system. It can be a command to run VASP in serial or in parallel, -e.g. an mpirun command. Then comment out the 2nd vaspcmd line -immediately following it. - -Insure you have the necessary VASP input files in this -directory, suitable for the VASP calculation you want to perform: - -INCAR -KPOINTS -POSCAR_template -POTCAR - -Examples of all but the POTCAR file are provided. As explained below, -POSCAR_W is an input file for a 2-atom unit cell of tungsten and can -be used to test the LAMMPS/VASP coupling. The POTCAR file is a -proprietary VASP file, so use one from your VASP installation. - -Note that the POSCAR_template file should be matched to the LAMMPS -input script (# of atoms and atom types, box size, etc). The provided -POSCAR_W matches in.client.W. - -Once you run VASP yourself, the vasprun.xml file will be overwritten. - ----------------- - -To run in client/server mode: - -NOTE: The vasp_wrap.py script must be run with Python version 2, not -3. This is because it used the CSlib python wrapper, which only -supports version 2. We plan to upgrade CSlib to support Python 3. - -Both the client (LAMMPS) and server (vasp_wrap.py) must use the same -messaging mode, namely file or zmq. This is an argument to the -vasp_wrap.py code; it can be selected by setting the "mode" variable -when you run LAMMPS. The default mode = file. - -Here we assume LAMMPS was built to run in parallel, and the MESSAGE -package was installed with socket (ZMQ) support. This means either of -the messaging modes can be used and LAMMPS can be run in serial or -parallel. The vasp_wrap.py code is always run in serial, but it -launches VASP from Python via an mpirun command which can run VASP -itself in parallel. - -When you run, the server should print out thermodynamic info every -timestep which corresponds to the forces and virial computed by VASP. -VASP will also generate output files each timestep. The vasp_wrapper.py -script could be generalized to archive these. - -The examples below are commands you should use in two different -terminal windows. The order of the two commands (client or server -launch) does not matter. You can run them both in the same window if -you append a "&" character to the first one to run it in the -background. - --------------- - -File mode of messaging: - -% mpirun -np 1 lmp_mpi -v mode file -in in.client.W -% python vasp_wrap.py file POSCAR_W - -% mpirun -np 2 lmp_mpi -v mode file -in in.client.W -% python vasp_wrap.py file POSCAR_W - -ZMQ mode of messaging: - -% mpirun -np 1 lmp_mpi -v mode zmq -in in.client.W -% python vasp_wrap.py zmq POSCAR_W - -% mpirun -np 2 lmp_mpi -v mode zmq -in in.client.W -% python vasp_wrap.py zmq POSCAR_W diff --git a/examples/COUPLE/lammps_vasp/data.W b/examples/COUPLE/lammps_vasp/data.W deleted file mode 100644 index 8accd9ca79..0000000000 --- a/examples/COUPLE/lammps_vasp/data.W +++ /dev/null @@ -1,15 +0,0 @@ -LAMMPS W data file - -2 atoms - -1 atom types - -0.0 3.16 xlo xhi -0.0 3.16 ylo yhi -0.0 3.16 zlo zhi - -Atoms - -1 1 0.000 0.000 0.000 -2 1 1.58 1.58 1.58 - diff --git a/examples/COUPLE/lammps_vasp/in.client.W b/examples/COUPLE/lammps_vasp/in.client.W deleted file mode 100644 index 1af1c312e4..0000000000 --- a/examples/COUPLE/lammps_vasp/in.client.W +++ /dev/null @@ -1,35 +0,0 @@ -# small W unit cell for use with VASP - -variable mode index file - -if "${mode} == file" then & - "message client md file tmp.couple" & -elif "${mode} == zmq" & - "message client md zmq localhost:5555" & - -variable x index 1 -variable y index 1 -variable z index 1 - -units metal -atom_style atomic -atom_modify sort 0 0.0 map yes - -read_data data.W -mass 1 183.85 - -replicate $x $y $z - -velocity all create 300.0 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 10 check no - -fix 1 all nve -fix 2 all client/md -fix_modify 2 energy yes - -thermo 1 -run 3 - -message quit diff --git a/examples/COUPLE/lammps_vasp/log.client.output b/examples/COUPLE/lammps_vasp/log.client.output deleted file mode 100644 index fa8f4f920a..0000000000 --- a/examples/COUPLE/lammps_vasp/log.client.output +++ /dev/null @@ -1,76 +0,0 @@ -LAMMPS (22 Aug 2018) -# small W unit cell for use with VASP - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" -message client md zmq localhost:5555 -variable x index 1 -variable y index 1 -variable z index 1 - -units metal -atom_style atomic -atom_modify sort 0 0.0 map yes - -read_data data.W - orthogonal box = (0 0 0) to (3.16 3.16 3.16) - 1 by 1 by 2 MPI processor grid - reading atoms ... - 2 atoms -mass 1 183.85 - -replicate $x $y $z -replicate 1 $y $z -replicate 1 1 $z -replicate 1 1 1 - orthogonal box = (0 0 0) to (3.16 3.16 3.16) - 1 by 1 by 2 MPI processor grid - 2 atoms - Time spent = 0.000148058 secs - -velocity all create 300.0 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 10 check no - -fix 1 all nve -fix 2 all client/md -fix_modify 2 energy yes - -thermo 1 -run 3 -Per MPI rank memory allocation (min/avg/max) = 1.8 | 1.8 | 1.8 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 300 0 0 -48.030793 -78159.503 - 1 298.24318 0 0 -48.03102 -78167.19 - 2 296.85584 0 0 -48.031199 -78173.26 - 3 295.83795 0 0 -48.031331 -78177.714 -Loop time of 0.457491 on 2 procs for 3 steps with 2 atoms - -Performance: 0.567 ns/day, 42.360 hours/ns, 6.558 timesteps/s -50.1% CPU use with 2 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0 | 0 | 0 | 0.0 | 0.00 -Comm | 1.3828e-05 | 2.9922e-05 | 4.6015e-05 | 0.0 | 0.01 -Output | 7.5817e-05 | 9.3937e-05 | 0.00011206 | 0.0 | 0.02 -Modify | 0.45735 | 0.45736 | 0.45736 | 0.0 | 99.97 -Other | | 1.204e-05 | | | 0.00 - -Nlocal: 1 ave 1 max 1 min -Histogram: 2 0 0 0 0 0 0 0 0 0 -Nghost: 4 ave 4 max 4 min -Histogram: 2 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 0 -Dangerous builds not checked - -Total wall time: 0:01:21 diff --git a/examples/COUPLE/lammps_vasp/vasp_wrap.py b/examples/COUPLE/lammps_vasp/vasp_wrap.py deleted file mode 100644 index bef8e899b9..0000000000 --- a/examples/COUPLE/lammps_vasp/vasp_wrap.py +++ /dev/null @@ -1,300 +0,0 @@ -#!/usr/bin/env python - -# ---------------------------------------------------------------------- -# LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -# https://www.lammps.org/ Sandia National Laboratories -# Steve Plimpton, sjplimp@sandia.gov -# ---------------------------------------------------------------------- - -# Syntax: vasp_wrap.py file/zmq POSCARfile - -# wrapper on VASP to act as server program using CSlib -# receives message with list of coords from client -# creates VASP inputs -# invokes VASP to calculate self-consistent energy of that config -# reads VASP outputs -# sends message with energy, forces, pressure to client - -# NOTES: -# check to insure basic VASP input files are in place? -# could archive VASP input/output in special filenames or dirs? -# need to check that POTCAR file is consistent with atom ordering? -# could make syntax for launching VASP more flexible -# e.g. command-line arg for # of procs -# detect if VASP had an error and return ERROR field, e.g. non-convergence ?? - -from __future__ import print_function -import sys - -version = sys.version_info[0] -if version == 3: - sys.exit("The CSlib python wrapper does not yet support python 3") - -import subprocess -import xml.etree.ElementTree as ET -from cslib import CSlib - -# comment out 2nd line once 1st line is correct for your system - -vaspcmd = "srun -N 1 --ntasks-per-node=4 " + \ - "-n 4 /projects/vasp/2017-build/cts1/vasp5.4.4/vasp_tfermi/bin/vasp_std" -vaspcmd = "touch tmp" - -# enums matching FixClientMD class in LAMMPS - -SETUP,STEP = range(1,2+1) -DIM,PERIODICITY,ORIGIN,BOX,NATOMS,NTYPES,TYPES,COORDS,UNITS,CHARGE = range(1,10+1) -FORCES,ENERGY,VIRIAL,ERROR = range(1,4+1) - -# ------------------------------------- -# functions - -# error message and exit - -def error(txt): - print("ERROR:",txt) - sys.exit(1) - -# ------------------------------------- -# read initial VASP POSCAR file to setup problem -# return natoms,ntypes,box - -def vasp_setup(poscar): - - ps = open(poscar,'r').readlines() - - # box size - - words = ps[2].split() - xbox = float(words[0]) - words = ps[3].split() - ybox = float(words[1]) - words = ps[4].split() - zbox = float(words[2]) - box = [xbox,ybox,zbox] - - ntypes = 0 - natoms = 0 - words = ps[6].split() - for word in words: - if word == '#': break - ntypes += 1 - natoms += int(word) - - return natoms,ntypes,box - -# ------------------------------------- -# write a new POSCAR file for VASP - -def poscar_write(poscar,natoms,ntypes,types,coords,box): - - psold = open(poscar,'r').readlines() - psnew = open("POSCAR",'w') - - # header, including box size - - psnew.write(psold[0]) - psnew.write(psold[1]) - psnew.write("%g %g %g\n" % (box[0],box[1],box[2])) - psnew.write("%g %g %g\n" % (box[3],box[4],box[5])) - psnew.write("%g %g %g\n" % (box[6],box[7],box[8])) - psnew.write(psold[5]) - psnew.write(psold[6]) - - # per-atom coords - # grouped by types - - psnew.write("Cartesian\n") - - for itype in range(1,ntypes+1): - for i in range(natoms): - if types[i] != itype: continue - x = coords[3*i+0] - y = coords[3*i+1] - z = coords[3*i+2] - aline = " %g %g %g\n" % (x,y,z) - psnew.write(aline) - - psnew.close() - -# ------------------------------------- -# read a VASP output vasprun.xml file -# uses ElementTree module -# see https://docs.python.org/2/library/xml.etree.elementtree.html - -def vasprun_read(): - tree = ET.parse('vasprun.xml') - root = tree.getroot() - - #fp = open("vasprun.xml","r") - #root = ET.parse(fp) - - scsteps = root.findall('calculation/scstep') - energy = scsteps[-1].find('energy') - for child in energy: - if child.attrib["name"] == "e_0_energy": - eout = float(child.text) - - fout = [] - sout = [] - - varrays = root.findall('calculation/varray') - for varray in varrays: - if varray.attrib["name"] == "forces": - forces = varray.findall("v") - for line in forces: - fxyz = line.text.split() - fxyz = [float(value) for value in fxyz] - fout += fxyz - if varray.attrib["name"] == "stress": - tensor = varray.findall("v") - stensor = [] - for line in tensor: - sxyz = line.text.split() - sxyz = [float(value) for value in sxyz] - stensor.append(sxyz) - sxx = stensor[0][0] - syy = stensor[1][1] - szz = stensor[2][2] - # symmetrize off-diagonal components - sxy = 0.5 * (stensor[0][1] + stensor[1][0]) - sxz = 0.5 * (stensor[0][2] + stensor[2][0]) - syz = 0.5 * (stensor[1][2] + stensor[2][1]) - sout = [sxx,syy,szz,sxy,sxz,syz] - - #fp.close() - - return eout,fout,sout - -# ------------------------------------- -# main program - -# command-line args - -if len(sys.argv) != 3: - print("Syntax: python vasp_wrap.py file/zmq POSCARfile") - sys.exit(1) - -mode = sys.argv[1] -poscar_template = sys.argv[2] - -if mode == "file": cs = CSlib(1,mode,"tmp.couple",None) -elif mode == "zmq": cs = CSlib(1,mode,"*:5555",None) -else: - print("Syntax: python vasp_wrap.py file/zmq POSCARfile") - sys.exit(1) - -natoms,ntypes,box = vasp_setup(poscar_template) - -# initial message for MD protocol - -msgID,nfield,fieldID,fieldtype,fieldlen = cs.recv() -if msgID != 0: error("Bad initial client/server handshake") -protocol = cs.unpack_string(1) -if protocol != "md": error("Mismatch in client/server protocol") -cs.send(0,0) - -# endless server loop - -while 1: - - # recv message from client - # msgID = 0 = all-done message - - msgID,nfield,fieldID,fieldtype,fieldlen = cs.recv() - if msgID < 0: break - - # SETUP receive at beginning of each run - # required fields: DIM, PERIODICTY, ORIGIN, BOX, - # NATOMS, NTYPES, TYPES, COORDS - # optional fields: others in enum above, but VASP ignores them - - if msgID == SETUP: - - origin = [] - box = [] - natoms_recv = ntypes_recv = 0 - types = [] - coords = [] - - for field in fieldID: - if field == DIM: - dim = cs.unpack_int(DIM) - if dim != 3: error("VASP only performs 3d simulations") - elif field == PERIODICITY: - periodicity = cs.unpack(PERIODICITY,1) - if not periodicity[0] or not periodicity[1] or not periodicity[2]: - error("VASP wrapper only currently supports fully periodic systems") - elif field == ORIGIN: - origin = cs.unpack(ORIGIN,1) - elif field == BOX: - box = cs.unpack(BOX,1) - elif field == NATOMS: - natoms_recv = cs.unpack_int(NATOMS) - if natoms != natoms_recv: - error("VASP wrapper mis-match in number of atoms") - elif field == NTYPES: - ntypes_recv = cs.unpack_int(NTYPES) - if ntypes != ntypes_recv: - error("VASP wrapper mis-match in number of atom types") - elif field == TYPES: - types = cs.unpack(TYPES,1) - elif field == COORDS: - coords = cs.unpack(COORDS,1) - - if not origin or not box or not natoms or not ntypes or \ - not types or not coords: - error("Required VASP wrapper setup field not received"); - - # STEP receive at each timestep of run or minimization - # required fields: COORDS - # optional fields: ORIGIN, BOX - - elif msgID == STEP: - - coords = [] - - for field in fieldID: - if field == COORDS: - coords = cs.unpack(COORDS,1) - elif field == ORIGIN: - origin = cs.unpack(ORIGIN,1) - elif field == BOX: - box = cs.unpack(BOX,1) - - if not coords: error("Required VASP wrapper step field not received"); - - else: error("VASP wrapper received unrecognized message") - - # create POSCAR file - - poscar_write(poscar_template,natoms,ntypes,types,coords,box) - - # invoke VASP - - print("\nLaunching VASP ...") - print(vaspcmd) - subprocess.check_output(vaspcmd,stderr=subprocess.STDOUT,shell=True) - - # process VASP output - - energy,forces,virial = vasprun_read() - - # convert VASP kilobars to bars - - for i,value in enumerate(virial): virial[i] *= 1000.0 - - # return forces, energy, pressure to client - - cs.send(msgID,3); - cs.pack(FORCES,4,3*natoms,forces) - cs.pack_double(ENERGY,energy) - cs.pack(VIRIAL,4,6,virial) - -# final reply to client - -cs.send(0,0) - -# clean-up - -del cs diff --git a/examples/COUPLE/lammps_vasp/vasprun.xml b/examples/COUPLE/lammps_vasp/vasprun.xml deleted file mode 100644 index 0f15c871b4..0000000000 --- a/examples/COUPLE/lammps_vasp/vasprun.xml +++ /dev/null @@ -1,12329 +0,0 @@ - - - - vasp - 5.4.4.18Apr17-6-g9f103f2a35 - (build Aug 01 2017 10:32:50) complex parallel - LinuxIFC - 2017 12 19 - 15:22:45 - - - 0 - normal normal or accurate (medium, h - 48 - F - 1 - 2 - 1 - 100 - -5 - 2 - -1 - 0 - 0.00000100 - 0.00100000 - 0 - 2 - 10 - 1 - 1 - 600.00000000 - 600.00000000 - 0.50000000 - 3500.00000000 - 3500.00000000 - -3.00000000 - 10.00000000 - -10.00000000 - 0.00000000 - 0 - 0.10000000 - 2 - 0.00000000 - T - T - F - F - F - -1 0 0 0 - 100 - -- GGA type - F - F - 0 - 1.00000000 - - - - - 3.66961100 0.00000000 0.00000000 - 0.00000000 3.55744000 0.00000000 - 0.00000000 0.00000000 3.17678100 - - 41.47103646 - - 0.27250845 0.00000000 0.00000000 - 0.00000000 0.28110102 0.00000000 - 0.00000000 0.00000000 0.31478405 - - - - 0.00000000 0.00000000 0.00000000 - 0.00000000 -0.50000000 -0.50000000 - -0.50000000 0.00000000 -0.50000000 - -0.50000000 -0.50000000 0.00000000 - - - - 1 - 2 - 3 - 4 - - - - 15 15 15 - 0.00000000 0.00000000 0.00000000 - 0.06666667 0.00000000 0.00000000 - 0.00000000 0.06666667 0.00000000 - 0.00000000 0.00000000 0.06666667 - 0.00000000 0.00000000 0.00000000 - - - 0.00000000 0.00000000 0.00000000 - 0.06666667 0.00000000 0.00000000 - 0.13333333 0.00000000 0.00000000 - 0.20000000 0.00000000 0.00000000 - 0.26666667 0.00000000 0.00000000 - 0.33333333 0.00000000 0.00000000 - 0.40000000 0.00000000 0.00000000 - 0.46666667 0.00000000 0.00000000 - 0.00000000 0.06666667 0.00000000 - 0.06666667 0.06666667 0.00000000 - 0.13333333 0.06666667 0.00000000 - 0.20000000 0.06666667 0.00000000 - 0.26666667 0.06666667 0.00000000 - 0.33333333 0.06666667 0.00000000 - 0.40000000 0.06666667 0.00000000 - 0.46666667 0.06666667 0.00000000 - 0.00000000 0.13333333 0.00000000 - 0.06666667 0.13333333 0.00000000 - 0.13333333 0.13333333 0.00000000 - 0.20000000 0.13333333 0.00000000 - 0.26666667 0.13333333 0.00000000 - 0.33333333 0.13333333 0.00000000 - 0.40000000 0.13333333 0.00000000 - 0.46666667 0.13333333 0.00000000 - 0.00000000 0.20000000 0.00000000 - 0.06666667 0.20000000 0.00000000 - 0.13333333 0.20000000 0.00000000 - 0.20000000 0.20000000 0.00000000 - 0.26666667 0.20000000 0.00000000 - 0.33333333 0.20000000 0.00000000 - 0.40000000 0.20000000 0.00000000 - 0.46666667 0.20000000 0.00000000 - 0.00000000 0.26666667 0.00000000 - 0.06666667 0.26666667 0.00000000 - 0.13333333 0.26666667 0.00000000 - 0.20000000 0.26666667 0.00000000 - 0.26666667 0.26666667 0.00000000 - 0.33333333 0.26666667 0.00000000 - 0.40000000 0.26666667 0.00000000 - 0.46666667 0.26666667 0.00000000 - 0.00000000 0.33333333 0.00000000 - 0.06666667 0.33333333 0.00000000 - 0.13333333 0.33333333 0.00000000 - 0.20000000 0.33333333 0.00000000 - 0.26666667 0.33333333 0.00000000 - 0.33333333 0.33333333 0.00000000 - 0.40000000 0.33333333 0.00000000 - 0.46666667 0.33333333 0.00000000 - 0.00000000 0.40000000 0.00000000 - 0.06666667 0.40000000 0.00000000 - 0.13333333 0.40000000 0.00000000 - 0.20000000 0.40000000 0.00000000 - 0.26666667 0.40000000 0.00000000 - 0.33333333 0.40000000 0.00000000 - 0.40000000 0.40000000 0.00000000 - 0.46666667 0.40000000 0.00000000 - 0.00000000 0.46666667 0.00000000 - 0.06666667 0.46666667 0.00000000 - 0.13333333 0.46666667 0.00000000 - 0.20000000 0.46666667 0.00000000 - 0.26666667 0.46666667 0.00000000 - 0.33333333 0.46666667 0.00000000 - 0.40000000 0.46666667 0.00000000 - 0.46666667 0.46666667 0.00000000 - 0.00000000 0.00000000 0.06666667 - 0.06666667 0.00000000 0.06666667 - 0.13333333 0.00000000 0.06666667 - 0.20000000 0.00000000 0.06666667 - 0.26666667 0.00000000 0.06666667 - 0.33333333 0.00000000 0.06666667 - 0.40000000 0.00000000 0.06666667 - 0.46666667 0.00000000 0.06666667 - 0.00000000 0.06666667 0.06666667 - 0.06666667 0.06666667 0.06666667 - 0.13333333 0.06666667 0.06666667 - 0.20000000 0.06666667 0.06666667 - 0.26666667 0.06666667 0.06666667 - 0.33333333 0.06666667 0.06666667 - 0.40000000 0.06666667 0.06666667 - 0.46666667 0.06666667 0.06666667 - 0.00000000 0.13333333 0.06666667 - 0.06666667 0.13333333 0.06666667 - 0.13333333 0.13333333 0.06666667 - 0.20000000 0.13333333 0.06666667 - 0.26666667 0.13333333 0.06666667 - 0.33333333 0.13333333 0.06666667 - 0.40000000 0.13333333 0.06666667 - 0.46666667 0.13333333 0.06666667 - 0.00000000 0.20000000 0.06666667 - 0.06666667 0.20000000 0.06666667 - 0.13333333 0.20000000 0.06666667 - 0.20000000 0.20000000 0.06666667 - 0.26666667 0.20000000 0.06666667 - 0.33333333 0.20000000 0.06666667 - 0.40000000 0.20000000 0.06666667 - 0.46666667 0.20000000 0.06666667 - 0.00000000 0.26666667 0.06666667 - 0.06666667 0.26666667 0.06666667 - 0.13333333 0.26666667 0.06666667 - 0.20000000 0.26666667 0.06666667 - 0.26666667 0.26666667 0.06666667 - 0.33333333 0.26666667 0.06666667 - 0.40000000 0.26666667 0.06666667 - 0.46666667 0.26666667 0.06666667 - 0.00000000 0.33333333 0.06666667 - 0.06666667 0.33333333 0.06666667 - 0.13333333 0.33333333 0.06666667 - 0.20000000 0.33333333 0.06666667 - 0.26666667 0.33333333 0.06666667 - 0.33333333 0.33333333 0.06666667 - 0.40000000 0.33333333 0.06666667 - 0.46666667 0.33333333 0.06666667 - 0.00000000 0.40000000 0.06666667 - 0.06666667 0.40000000 0.06666667 - 0.13333333 0.40000000 0.06666667 - 0.20000000 0.40000000 0.06666667 - 0.26666667 0.40000000 0.06666667 - 0.33333333 0.40000000 0.06666667 - 0.40000000 0.40000000 0.06666667 - 0.46666667 0.40000000 0.06666667 - 0.00000000 0.46666667 0.06666667 - 0.06666667 0.46666667 0.06666667 - 0.13333333 0.46666667 0.06666667 - 0.20000000 0.46666667 0.06666667 - 0.26666667 0.46666667 0.06666667 - 0.33333333 0.46666667 0.06666667 - 0.40000000 0.46666667 0.06666667 - 0.46666667 0.46666667 0.06666667 - 0.00000000 0.00000000 0.13333333 - 0.06666667 0.00000000 0.13333333 - 0.13333333 0.00000000 0.13333333 - 0.20000000 0.00000000 0.13333333 - 0.26666667 0.00000000 0.13333333 - 0.33333333 0.00000000 0.13333333 - 0.40000000 0.00000000 0.13333333 - 0.46666667 0.00000000 0.13333333 - 0.00000000 0.06666667 0.13333333 - 0.06666667 0.06666667 0.13333333 - 0.13333333 0.06666667 0.13333333 - 0.20000000 0.06666667 0.13333333 - 0.26666667 0.06666667 0.13333333 - 0.33333333 0.06666667 0.13333333 - 0.40000000 0.06666667 0.13333333 - 0.46666667 0.06666667 0.13333333 - 0.00000000 0.13333333 0.13333333 - 0.06666667 0.13333333 0.13333333 - 0.13333333 0.13333333 0.13333333 - 0.20000000 0.13333333 0.13333333 - 0.26666667 0.13333333 0.13333333 - 0.33333333 0.13333333 0.13333333 - 0.40000000 0.13333333 0.13333333 - 0.46666667 0.13333333 0.13333333 - 0.00000000 0.20000000 0.13333333 - 0.06666667 0.20000000 0.13333333 - 0.13333333 0.20000000 0.13333333 - 0.20000000 0.20000000 0.13333333 - 0.26666667 0.20000000 0.13333333 - 0.33333333 0.20000000 0.13333333 - 0.40000000 0.20000000 0.13333333 - 0.46666667 0.20000000 0.13333333 - 0.00000000 0.26666667 0.13333333 - 0.06666667 0.26666667 0.13333333 - 0.13333333 0.26666667 0.13333333 - 0.20000000 0.26666667 0.13333333 - 0.26666667 0.26666667 0.13333333 - 0.33333333 0.26666667 0.13333333 - 0.40000000 0.26666667 0.13333333 - 0.46666667 0.26666667 0.13333333 - 0.00000000 0.33333333 0.13333333 - 0.06666667 0.33333333 0.13333333 - 0.13333333 0.33333333 0.13333333 - 0.20000000 0.33333333 0.13333333 - 0.26666667 0.33333333 0.13333333 - 0.33333333 0.33333333 0.13333333 - 0.40000000 0.33333333 0.13333333 - 0.46666667 0.33333333 0.13333333 - 0.00000000 0.40000000 0.13333333 - 0.06666667 0.40000000 0.13333333 - 0.13333333 0.40000000 0.13333333 - 0.20000000 0.40000000 0.13333333 - 0.26666667 0.40000000 0.13333333 - 0.33333333 0.40000000 0.13333333 - 0.40000000 0.40000000 0.13333333 - 0.46666667 0.40000000 0.13333333 - 0.00000000 0.46666667 0.13333333 - 0.06666667 0.46666667 0.13333333 - 0.13333333 0.46666667 0.13333333 - 0.20000000 0.46666667 0.13333333 - 0.26666667 0.46666667 0.13333333 - 0.33333333 0.46666667 0.13333333 - 0.40000000 0.46666667 0.13333333 - 0.46666667 0.46666667 0.13333333 - 0.00000000 0.00000000 0.20000000 - 0.06666667 0.00000000 0.20000000 - 0.13333333 0.00000000 0.20000000 - 0.20000000 0.00000000 0.20000000 - 0.26666667 0.00000000 0.20000000 - 0.33333333 0.00000000 0.20000000 - 0.40000000 0.00000000 0.20000000 - 0.46666667 0.00000000 0.20000000 - 0.00000000 0.06666667 0.20000000 - 0.06666667 0.06666667 0.20000000 - 0.13333333 0.06666667 0.20000000 - 0.20000000 0.06666667 0.20000000 - 0.26666667 0.06666667 0.20000000 - 0.33333333 0.06666667 0.20000000 - 0.40000000 0.06666667 0.20000000 - 0.46666667 0.06666667 0.20000000 - 0.00000000 0.13333333 0.20000000 - 0.06666667 0.13333333 0.20000000 - 0.13333333 0.13333333 0.20000000 - 0.20000000 0.13333333 0.20000000 - 0.26666667 0.13333333 0.20000000 - 0.33333333 0.13333333 0.20000000 - 0.40000000 0.13333333 0.20000000 - 0.46666667 0.13333333 0.20000000 - 0.00000000 0.20000000 0.20000000 - 0.06666667 0.20000000 0.20000000 - 0.13333333 0.20000000 0.20000000 - 0.20000000 0.20000000 0.20000000 - 0.26666667 0.20000000 0.20000000 - 0.33333333 0.20000000 0.20000000 - 0.40000000 0.20000000 0.20000000 - 0.46666667 0.20000000 0.20000000 - 0.00000000 0.26666667 0.20000000 - 0.06666667 0.26666667 0.20000000 - 0.13333333 0.26666667 0.20000000 - 0.20000000 0.26666667 0.20000000 - 0.26666667 0.26666667 0.20000000 - 0.33333333 0.26666667 0.20000000 - 0.40000000 0.26666667 0.20000000 - 0.46666667 0.26666667 0.20000000 - 0.00000000 0.33333333 0.20000000 - 0.06666667 0.33333333 0.20000000 - 0.13333333 0.33333333 0.20000000 - 0.20000000 0.33333333 0.20000000 - 0.26666667 0.33333333 0.20000000 - 0.33333333 0.33333333 0.20000000 - 0.40000000 0.33333333 0.20000000 - 0.46666667 0.33333333 0.20000000 - 0.00000000 0.40000000 0.20000000 - 0.06666667 0.40000000 0.20000000 - 0.13333333 0.40000000 0.20000000 - 0.20000000 0.40000000 0.20000000 - 0.26666667 0.40000000 0.20000000 - 0.33333333 0.40000000 0.20000000 - 0.40000000 0.40000000 0.20000000 - 0.46666667 0.40000000 0.20000000 - 0.00000000 0.46666667 0.20000000 - 0.06666667 0.46666667 0.20000000 - 0.13333333 0.46666667 0.20000000 - 0.20000000 0.46666667 0.20000000 - 0.26666667 0.46666667 0.20000000 - 0.33333333 0.46666667 0.20000000 - 0.40000000 0.46666667 0.20000000 - 0.46666667 0.46666667 0.20000000 - 0.00000000 0.00000000 0.26666667 - 0.06666667 0.00000000 0.26666667 - 0.13333333 0.00000000 0.26666667 - 0.20000000 0.00000000 0.26666667 - 0.26666667 0.00000000 0.26666667 - 0.33333333 0.00000000 0.26666667 - 0.40000000 0.00000000 0.26666667 - 0.46666667 0.00000000 0.26666667 - 0.00000000 0.06666667 0.26666667 - 0.06666667 0.06666667 0.26666667 - 0.13333333 0.06666667 0.26666667 - 0.20000000 0.06666667 0.26666667 - 0.26666667 0.06666667 0.26666667 - 0.33333333 0.06666667 0.26666667 - 0.40000000 0.06666667 0.26666667 - 0.46666667 0.06666667 0.26666667 - 0.00000000 0.13333333 0.26666667 - 0.06666667 0.13333333 0.26666667 - 0.13333333 0.13333333 0.26666667 - 0.20000000 0.13333333 0.26666667 - 0.26666667 0.13333333 0.26666667 - 0.33333333 0.13333333 0.26666667 - 0.40000000 0.13333333 0.26666667 - 0.46666667 0.13333333 0.26666667 - 0.00000000 0.20000000 0.26666667 - 0.06666667 0.20000000 0.26666667 - 0.13333333 0.20000000 0.26666667 - 0.20000000 0.20000000 0.26666667 - 0.26666667 0.20000000 0.26666667 - 0.33333333 0.20000000 0.26666667 - 0.40000000 0.20000000 0.26666667 - 0.46666667 0.20000000 0.26666667 - 0.00000000 0.26666667 0.26666667 - 0.06666667 0.26666667 0.26666667 - 0.13333333 0.26666667 0.26666667 - 0.20000000 0.26666667 0.26666667 - 0.26666667 0.26666667 0.26666667 - 0.33333333 0.26666667 0.26666667 - 0.40000000 0.26666667 0.26666667 - 0.46666667 0.26666667 0.26666667 - 0.00000000 0.33333333 0.26666667 - 0.06666667 0.33333333 0.26666667 - 0.13333333 0.33333333 0.26666667 - 0.20000000 0.33333333 0.26666667 - 0.26666667 0.33333333 0.26666667 - 0.33333333 0.33333333 0.26666667 - 0.40000000 0.33333333 0.26666667 - 0.46666667 0.33333333 0.26666667 - 0.00000000 0.40000000 0.26666667 - 0.06666667 0.40000000 0.26666667 - 0.13333333 0.40000000 0.26666667 - 0.20000000 0.40000000 0.26666667 - 0.26666667 0.40000000 0.26666667 - 0.33333333 0.40000000 0.26666667 - 0.40000000 0.40000000 0.26666667 - 0.46666667 0.40000000 0.26666667 - 0.00000000 0.46666667 0.26666667 - 0.06666667 0.46666667 0.26666667 - 0.13333333 0.46666667 0.26666667 - 0.20000000 0.46666667 0.26666667 - 0.26666667 0.46666667 0.26666667 - 0.33333333 0.46666667 0.26666667 - 0.40000000 0.46666667 0.26666667 - 0.46666667 0.46666667 0.26666667 - 0.00000000 0.00000000 0.33333333 - 0.06666667 0.00000000 0.33333333 - 0.13333333 0.00000000 0.33333333 - 0.20000000 0.00000000 0.33333333 - 0.26666667 0.00000000 0.33333333 - 0.33333333 0.00000000 0.33333333 - 0.40000000 0.00000000 0.33333333 - 0.46666667 0.00000000 0.33333333 - 0.00000000 0.06666667 0.33333333 - 0.06666667 0.06666667 0.33333333 - 0.13333333 0.06666667 0.33333333 - 0.20000000 0.06666667 0.33333333 - 0.26666667 0.06666667 0.33333333 - 0.33333333 0.06666667 0.33333333 - 0.40000000 0.06666667 0.33333333 - 0.46666667 0.06666667 0.33333333 - 0.00000000 0.13333333 0.33333333 - 0.06666667 0.13333333 0.33333333 - 0.13333333 0.13333333 0.33333333 - 0.20000000 0.13333333 0.33333333 - 0.26666667 0.13333333 0.33333333 - 0.33333333 0.13333333 0.33333333 - 0.40000000 0.13333333 0.33333333 - 0.46666667 0.13333333 0.33333333 - 0.00000000 0.20000000 0.33333333 - 0.06666667 0.20000000 0.33333333 - 0.13333333 0.20000000 0.33333333 - 0.20000000 0.20000000 0.33333333 - 0.26666667 0.20000000 0.33333333 - 0.33333333 0.20000000 0.33333333 - 0.40000000 0.20000000 0.33333333 - 0.46666667 0.20000000 0.33333333 - 0.00000000 0.26666667 0.33333333 - 0.06666667 0.26666667 0.33333333 - 0.13333333 0.26666667 0.33333333 - 0.20000000 0.26666667 0.33333333 - 0.26666667 0.26666667 0.33333333 - 0.33333333 0.26666667 0.33333333 - 0.40000000 0.26666667 0.33333333 - 0.46666667 0.26666667 0.33333333 - 0.00000000 0.33333333 0.33333333 - 0.06666667 0.33333333 0.33333333 - 0.13333333 0.33333333 0.33333333 - 0.20000000 0.33333333 0.33333333 - 0.26666667 0.33333333 0.33333333 - 0.33333333 0.33333333 0.33333333 - 0.40000000 0.33333333 0.33333333 - 0.46666667 0.33333333 0.33333333 - 0.00000000 0.40000000 0.33333333 - 0.06666667 0.40000000 0.33333333 - 0.13333333 0.40000000 0.33333333 - 0.20000000 0.40000000 0.33333333 - 0.26666667 0.40000000 0.33333333 - 0.33333333 0.40000000 0.33333333 - 0.40000000 0.40000000 0.33333333 - 0.46666667 0.40000000 0.33333333 - 0.00000000 0.46666667 0.33333333 - 0.06666667 0.46666667 0.33333333 - 0.13333333 0.46666667 0.33333333 - 0.20000000 0.46666667 0.33333333 - 0.26666667 0.46666667 0.33333333 - 0.33333333 0.46666667 0.33333333 - 0.40000000 0.46666667 0.33333333 - 0.46666667 0.46666667 0.33333333 - 0.00000000 0.00000000 0.40000000 - 0.06666667 0.00000000 0.40000000 - 0.13333333 0.00000000 0.40000000 - 0.20000000 0.00000000 0.40000000 - 0.26666667 0.00000000 0.40000000 - 0.33333333 0.00000000 0.40000000 - 0.40000000 0.00000000 0.40000000 - 0.46666667 0.00000000 0.40000000 - 0.00000000 0.06666667 0.40000000 - 0.06666667 0.06666667 0.40000000 - 0.13333333 0.06666667 0.40000000 - 0.20000000 0.06666667 0.40000000 - 0.26666667 0.06666667 0.40000000 - 0.33333333 0.06666667 0.40000000 - 0.40000000 0.06666667 0.40000000 - 0.46666667 0.06666667 0.40000000 - 0.00000000 0.13333333 0.40000000 - 0.06666667 0.13333333 0.40000000 - 0.13333333 0.13333333 0.40000000 - 0.20000000 0.13333333 0.40000000 - 0.26666667 0.13333333 0.40000000 - 0.33333333 0.13333333 0.40000000 - 0.40000000 0.13333333 0.40000000 - 0.46666667 0.13333333 0.40000000 - 0.00000000 0.20000000 0.40000000 - 0.06666667 0.20000000 0.40000000 - 0.13333333 0.20000000 0.40000000 - 0.20000000 0.20000000 0.40000000 - 0.26666667 0.20000000 0.40000000 - 0.33333333 0.20000000 0.40000000 - 0.40000000 0.20000000 0.40000000 - 0.46666667 0.20000000 0.40000000 - 0.00000000 0.26666667 0.40000000 - 0.06666667 0.26666667 0.40000000 - 0.13333333 0.26666667 0.40000000 - 0.20000000 0.26666667 0.40000000 - 0.26666667 0.26666667 0.40000000 - 0.33333333 0.26666667 0.40000000 - 0.40000000 0.26666667 0.40000000 - 0.46666667 0.26666667 0.40000000 - 0.00000000 0.33333333 0.40000000 - 0.06666667 0.33333333 0.40000000 - 0.13333333 0.33333333 0.40000000 - 0.20000000 0.33333333 0.40000000 - 0.26666667 0.33333333 0.40000000 - 0.33333333 0.33333333 0.40000000 - 0.40000000 0.33333333 0.40000000 - 0.46666667 0.33333333 0.40000000 - 0.00000000 0.40000000 0.40000000 - 0.06666667 0.40000000 0.40000000 - 0.13333333 0.40000000 0.40000000 - 0.20000000 0.40000000 0.40000000 - 0.26666667 0.40000000 0.40000000 - 0.33333333 0.40000000 0.40000000 - 0.40000000 0.40000000 0.40000000 - 0.46666667 0.40000000 0.40000000 - 0.00000000 0.46666667 0.40000000 - 0.06666667 0.46666667 0.40000000 - 0.13333333 0.46666667 0.40000000 - 0.20000000 0.46666667 0.40000000 - 0.26666667 0.46666667 0.40000000 - 0.33333333 0.46666667 0.40000000 - 0.40000000 0.46666667 0.40000000 - 0.46666667 0.46666667 0.40000000 - 0.00000000 0.00000000 0.46666667 - 0.06666667 0.00000000 0.46666667 - 0.13333333 0.00000000 0.46666667 - 0.20000000 0.00000000 0.46666667 - 0.26666667 0.00000000 0.46666667 - 0.33333333 0.00000000 0.46666667 - 0.40000000 0.00000000 0.46666667 - 0.46666667 0.00000000 0.46666667 - 0.00000000 0.06666667 0.46666667 - 0.06666667 0.06666667 0.46666667 - 0.13333333 0.06666667 0.46666667 - 0.20000000 0.06666667 0.46666667 - 0.26666667 0.06666667 0.46666667 - 0.33333333 0.06666667 0.46666667 - 0.40000000 0.06666667 0.46666667 - 0.46666667 0.06666667 0.46666667 - 0.00000000 0.13333333 0.46666667 - 0.06666667 0.13333333 0.46666667 - 0.13333333 0.13333333 0.46666667 - 0.20000000 0.13333333 0.46666667 - 0.26666667 0.13333333 0.46666667 - 0.33333333 0.13333333 0.46666667 - 0.40000000 0.13333333 0.46666667 - 0.46666667 0.13333333 0.46666667 - 0.00000000 0.20000000 0.46666667 - 0.06666667 0.20000000 0.46666667 - 0.13333333 0.20000000 0.46666667 - 0.20000000 0.20000000 0.46666667 - 0.26666667 0.20000000 0.46666667 - 0.33333333 0.20000000 0.46666667 - 0.40000000 0.20000000 0.46666667 - 0.46666667 0.20000000 0.46666667 - 0.00000000 0.26666667 0.46666667 - 0.06666667 0.26666667 0.46666667 - 0.13333333 0.26666667 0.46666667 - 0.20000000 0.26666667 0.46666667 - 0.26666667 0.26666667 0.46666667 - 0.33333333 0.26666667 0.46666667 - 0.40000000 0.26666667 0.46666667 - 0.46666667 0.26666667 0.46666667 - 0.00000000 0.33333333 0.46666667 - 0.06666667 0.33333333 0.46666667 - 0.13333333 0.33333333 0.46666667 - 0.20000000 0.33333333 0.46666667 - 0.26666667 0.33333333 0.46666667 - 0.33333333 0.33333333 0.46666667 - 0.40000000 0.33333333 0.46666667 - 0.46666667 0.33333333 0.46666667 - 0.00000000 0.40000000 0.46666667 - 0.06666667 0.40000000 0.46666667 - 0.13333333 0.40000000 0.46666667 - 0.20000000 0.40000000 0.46666667 - 0.26666667 0.40000000 0.46666667 - 0.33333333 0.40000000 0.46666667 - 0.40000000 0.40000000 0.46666667 - 0.46666667 0.40000000 0.46666667 - 0.00000000 0.46666667 0.46666667 - 0.06666667 0.46666667 0.46666667 - 0.13333333 0.46666667 0.46666667 - 0.20000000 0.46666667 0.46666667 - 0.26666667 0.46666667 0.46666667 - 0.33333333 0.46666667 0.46666667 - 0.40000000 0.46666667 0.46666667 - 0.46666667 0.46666667 0.46666667 - - - 0.00029630 - 0.00059259 - 0.00059259 - 0.00059259 - 0.00059259 - 0.00059259 - 0.00059259 - 0.00059259 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00059259 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00118519 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - 0.00237037 - - - - - unknown system - F - - - normal - 600.00000000 - 1293.44900000 - 0.00000100 - 48 - 10 - 18 - 26.00000000 - 0 - 0 - 0 - 0 - 0.00000000 - - 0 - 0.10000000 - 0.50000000 - T - - - F - 0.00000000 0.00000000 - -100 - 2 - F - - - 0 - 2 - 1 - - - 1 - F - 1.00000000 1.00000000 1.00000000 1.00000000 - -1.00000000 - F - 0.00000000 0.00000000 1.00000000 - F - 0.00000000 0.00000000 0.00000000 - F - - - F - F - - - 100 - -5 - 2 - 600.00000000 - - T - F - 0.00000000 - 0.00000001 - 0.30000000 - 4 - 0.40000000 - - - - 0.40000000 - 1.00000000 - 0.10000000 - 1.60000000 - 1.00000000 - - 4 - F - -45 - 100.00000000 - 1 - 1 - 5 - - - - F - F - 0 - 1.00000000 - -100.00000000 -100.00000000 -100.00000000 - 0.00000000 - - - - 24 - 24 - 20 - 48 - 48 - 40 - F - - - 0 - -1 - 0 - 2 - 0.00000000 - 0.00100000 - 0 - 0.50000000 - -3.00000000 - 1.00000000 - - - 3500.00000000 - 3500.00000000 - 1 - 1 - 256 - 16.00000000 - - - 2 - 0.00001000 - - - 0 - -1.00000000 -1.00000000 - 301 - 10.00000000 - -10.00000000 - 0.00000000 - - - 2 - T - F - T - F - F - F - F - F - 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 - - - 9 - 4 - -1 - T - T - F - F - F - F - - - 3 - 0 - F - 183.85000000 9.01300000 - 0.00000000 0.00000000 - 1.00000000 1.00000000 - T - - T - F - 0 - F - 0 - - -- - 0 - F - - F - F - F - F - F - -1.00000000 - 0 - 0 - 0.00000000 - 0.00000000 - 0.00000000 - 1.00000000 - 1.00000000 - 1.00000000 - 1.00000000 - 1 - 1 - 1 - F - F - F - 0 - 0 - F - 0.00000000 - 0.00000000 - 0 - - - F - -0.84910000 - 0.12340000 - 1.00000000 - 0.00000000 - - - 0 - 6.22065547 - 1.00000000 - - - F - F - F - F - 0 - 0.10000000 - -1.00000000 - 0.00200000 - -0.10000000 - 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 - - - F - 0.00000000 0.00000000 0.00000000 - T - F - F - F - T - 0 - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.00000000 0.00000000 - - - F - F - F - T - 0 - -1 0 0 0 - F - F - F - F - F - 2 - F - F - F - -2.00000000 - -2.00000000 - -1.00000000 - -1 - 0.00000000 - 0 - 0 - -1 - -1 - -1 - 100 - 1 - 3 - 0 - -30.00000000 - -30.00000000 - -200.00000000 - 140 - -0.10000000 - F - F - F - F - F - F - F - 1 - 1 - 1 - 2800 - 0 - 1 - -1 - 1.00000000 - - - 0.00000000 - 0.00000000 0.00000000 0.00000000 - 0.00000000 - 0.00000000 - 0.00000000 - - - - 4 - 2 - - ion - element - atomtype - - W 1 - Be 2 - Be 2 - Be 2 - - - - type - atomspertype - element - mass - valence - pseudopotential - - 1W 183.85000000 14.00000000 PAW_PBE W_sv_GW 23Mar2010 - 3Be 9.01300000 4.00000000 PAW_PBE Be_sv_GW 31Mar2010 - - - - - - - 3.66961100 0.00000000 0.00000000 - 0.00000000 3.55744000 0.00000000 - 0.00000000 0.00000000 3.17678100 - - 41.47103646 - - 0.27250845 0.00000000 0.00000000 - 0.00000000 0.28110102 0.00000000 - 0.00000000 0.00000000 0.31478405 - - - - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.50000000 0.50000000 - 0.50000000 0.00000000 0.50000000 - 0.50000000 0.50000000 0.00000000 - - - - - - - - - - 131.43308500 - -1959.85115532 - -527.41646070 - 35.33916255 - 1941.62980019 - -1939.43826086 - -0.00530052 - -1293.52360327 - 3036.59145287 - -575.24128006 - -575.23597954 - -575.23862980 - - - - - - - - - 102.38566418 - 102.39047960 - 102.38807189 - - - - - - - - - -28.97782713 - -28.97098459 - -28.97440586 - - - - - - - - - -49.69418359 - -49.68840810 - -49.69129585 - - - - - - - - - -51.91588940 - -51.91302415 - -51.91445678 - - - - - - - - - -48.35881744 - -48.35566410 - -48.35724077 - - - - - - - - - -48.54575148 - -48.54295784 - -48.54435466 - - - - - - - - - -48.07609882 - -48.07342458 - -48.07476170 - - - - - - - - - -48.12313644 - -48.12026988 - -48.12170316 - - - - - - - - - -48.09347519 - -48.09050147 - -48.09198833 - - - - - - - - - -48.07191482 - -48.06891772 - -48.07041627 - - - - - - - - - -48.07102791 - -48.06801376 - -48.06952083 - - - - - - - - - -48.07113736 - -48.06809293 - -48.06961515 - - - - - - - - - -48.07118539 - -48.06814100 - -48.06966319 - - - - - - - - - -48.07110546 - -48.06805494 - -48.06958020 - - - - - - - - - -48.07109869 - -48.06804980 - -48.06957425 - - - - - - - - - -48.07109883 - -48.06804872 - -48.06957377 - - - - - - - - - -48.07109628 - -48.06804655 - -48.06957141 - - - - - - - - - 131.43308500 - -1959.85115532 - -480.61520692 - 33.47431066 - 3204.45646866 - -3203.57677692 - -0.00304986 - -809.98022412 - 3036.59145287 - -48.07109596 - -48.06804610 - -48.06957103 - - - - - - 3.66961100 0.00000000 0.00000000 - 0.00000000 3.55744000 0.00000000 - 0.00000000 0.00000000 3.17678100 - - 41.47103646 - - 0.27250845 0.00000000 0.00000000 - 0.00000000 0.28110102 0.00000000 - 0.00000000 0.00000000 0.31478405 - - - - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.50000000 0.50000000 - 0.50000000 0.00000000 0.50000000 - 0.50000000 0.50000000 0.00000000 - - - - 0.1 -0.2 -0.3 - 0.4 -0.5 -0.6 - - - -214.84833704 0.00000000 0.00000000 - 0.00000000 -123.75352996 0.00000000 - 0.00000000 -0.00000000 100.18545515 - - - -48.07109596 - -48.06957103 - -0.00304986 - - - - - band - kpoint - spin - eigene - occ - - - - -91.8804 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7478 1.0000 - -30.0216 1.0000 - -29.9884 1.0000 - -29.8113 1.0000 - -2.0041 1.0000 - 4.4237 1.0000 - 4.8277 1.0000 - 6.4981 1.0000 - 6.9617 1.0000 - 8.1586 0.0000 - 8.8821 0.0000 - 8.9648 0.0000 - 9.0855 0.0000 - 13.1593 0.0000 - 14.6689 0.0000 - - - -91.8808 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7478 1.0000 - -30.0237 1.0000 - -29.9882 1.0000 - -29.8111 1.0000 - -1.9535 1.0000 - 4.3336 1.0000 - 4.8001 1.0000 - 6.5232 1.0000 - 6.7555 1.0000 - 8.3862 0.0000 - 8.4025 0.0000 - 8.9705 0.0000 - 9.5855 0.0000 - 13.3605 0.0000 - 14.6572 0.0000 - - - -91.8814 1.0000 - -91.4262 1.0000 - -91.2911 1.0000 - -65.7477 1.0000 - -30.0297 1.0000 - -29.9877 1.0000 - -29.8105 1.0000 - -1.8058 1.0000 - 4.0326 1.0000 - 4.7589 1.0000 - 6.3613 1.0000 - 6.6323 1.0000 - 7.8755 0.5410 - 8.8446 0.0000 - 8.9868 0.0000 - 10.1754 0.0000 - 14.0117 0.0000 - 14.7252 0.0000 - - - -91.8809 1.0000 - -91.4258 1.0000 - -91.2907 1.0000 - -65.7475 1.0000 - -30.0383 1.0000 - -29.9868 1.0000 - -29.8096 1.0000 - -1.5620 1.0000 - 3.5407 1.0000 - 4.7314 1.0000 - 5.9618 1.0000 - 6.8672 1.0000 - 7.4063 1.0000 - 9.0110 0.0000 - 9.3490 0.0000 - 10.7563 0.0000 - 14.0913 0.0000 - 15.1642 0.0000 - - - -91.8806 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7473 1.0000 - -30.0481 1.0000 - -29.9858 1.0000 - -29.8086 1.0000 - -1.2340 1.0000 - 2.9354 1.0000 - 4.7102 1.0000 - 5.6128 1.0000 - 7.0130 1.0000 - 7.2261 1.0000 - 9.0390 0.0000 - 9.8394 0.0000 - 11.3191 0.0000 - 14.0352 0.0000 - 15.4144 0.0000 - - - -91.8804 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7471 1.0000 - -30.0576 1.0000 - -29.9848 1.0000 - -29.8076 1.0000 - -0.8326 1.0000 - 2.2914 1.0000 - 4.6917 1.0000 - 5.3376 1.0000 - 6.7081 1.0000 - 7.6717 0.9986 - 9.0662 0.0000 - 10.2804 0.0000 - 11.8535 0.0000 - 13.4527 0.0000 - 14.9300 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7470 1.0000 - -30.0651 1.0000 - -29.9841 1.0000 - -29.8068 1.0000 - -0.3829 1.0000 - 1.6674 1.0000 - 4.6772 1.0000 - 5.1483 1.0000 - 6.5003 1.0000 - 8.1260 0.0003 - 9.0876 0.0000 - 10.6305 0.0000 - 12.3305 0.0000 - 12.9072 0.0000 - 15.1709 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7470 1.0000 - -30.0692 1.0000 - -29.9837 1.0000 - -29.8064 1.0000 - 0.0259 1.0000 - 1.1640 1.0000 - 4.6691 1.0000 - 5.0521 1.0000 - 6.3951 1.0000 - 8.4419 0.0000 - 9.0994 0.0000 - 10.8329 0.0000 - 12.5866 0.0000 - 12.7497 0.0000 - 15.0542 0.0000 - - - -91.8808 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7478 1.0000 - -30.0213 1.0000 - -29.9915 1.0000 - -29.8110 1.0000 - -1.9529 1.0000 - 4.3901 1.0000 - 4.7755 1.0000 - 6.3415 1.0000 - 6.9388 1.0000 - 8.3265 0.0000 - 8.4311 0.0000 - 8.8898 0.0000 - 9.6264 0.0000 - 13.5937 0.0000 - 14.7192 0.0000 - - - -91.8807 1.0000 - -91.4256 1.0000 - -91.2905 1.0000 - -65.7477 1.0000 - -30.0234 1.0000 - -29.9912 1.0000 - -29.8108 1.0000 - -1.9023 1.0000 - 4.3246 1.0000 - 4.7293 1.0000 - 6.2087 1.0000 - 6.9819 1.0000 - 8.2546 0.0000 - 8.4565 0.0000 - 8.8007 0.0000 - 9.9214 0.0000 - 13.6485 0.0000 - 14.6504 0.0000 - - - -91.8811 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7476 1.0000 - -30.0294 1.0000 - -29.9906 1.0000 - -29.8102 1.0000 - -1.7528 1.0000 - 4.0516 1.0000 - 4.6663 1.0000 - 5.9785 1.0000 - 7.0276 1.0000 - 7.8427 0.7144 - 8.7719 0.0000 - 8.8056 0.0000 - 10.4508 0.0000 - 14.3989 0.0000 - 15.1127 0.0000 - - - -91.8807 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7474 1.0000 - -30.0379 1.0000 - -29.9898 1.0000 - -29.8093 1.0000 - -1.5097 1.0000 - 3.5587 1.0000 - 4.6450 1.0000 - 5.7408 1.0000 - 7.1387 1.0000 - 7.4085 1.0000 - 8.7921 0.0000 - 9.2640 0.0000 - 11.0130 0.0000 - 14.0760 0.0000 - 15.2142 0.0000 - - - -91.8804 1.0000 - -91.4252 1.0000 - -91.2903 1.0000 - -65.7472 1.0000 - -30.0478 1.0000 - -29.9888 1.0000 - -29.8083 1.0000 - -1.1815 1.0000 - 2.9494 1.0000 - 4.6412 1.0000 - 5.4944 1.0000 - 7.0285 1.0000 - 7.3926 1.0000 - 8.8271 0.0000 - 9.7408 0.0000 - 11.5692 0.0000 - 13.8620 0.0000 - 14.8771 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7471 1.0000 - -30.0573 1.0000 - -29.9878 1.0000 - -29.8073 1.0000 - -0.7815 1.0000 - 2.3062 1.0000 - 4.6436 1.0000 - 5.2669 1.0000 - 6.7293 1.0000 - 7.7653 0.9516 - 8.8638 0.0000 - 10.1806 0.0000 - 12.1051 0.0000 - 13.3952 0.0000 - 14.8765 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7470 1.0000 - -30.0648 1.0000 - -29.9871 1.0000 - -29.8065 1.0000 - -0.3310 1.0000 - 1.6815 1.0000 - 4.6514 1.0000 - 5.0908 1.0000 - 6.5240 1.0000 - 8.1695 0.0000 - 8.8934 0.0000 - 10.5364 0.0000 - 12.5997 0.0000 - 12.8998 0.0000 - 15.5154 0.0000 - - - -91.8813 1.0000 - -91.4263 1.0000 - -91.2913 1.0000 - -65.7469 1.0000 - -30.0689 1.0000 - -29.9867 1.0000 - -29.8062 1.0000 - 0.0847 1.0000 - 1.1741 1.0000 - 4.6613 1.0000 - 4.9916 1.0000 - 6.4197 1.0000 - 8.4555 0.0000 - 8.9099 0.0000 - 10.7473 0.0000 - 12.4480 0.0000 - 12.9600 0.0000 - 14.8774 0.0000 - - - -91.8810 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7476 1.0000 - -30.0204 1.0000 - -29.9998 1.0000 - -29.8102 1.0000 - -1.7946 1.0000 - 4.2094 1.0000 - 4.6772 1.0000 - 5.9995 1.0000 - 6.9517 1.0000 - 7.8739 0.5498 - 8.7041 0.0000 - 8.9110 0.0000 - 10.2112 0.0000 - 14.2659 0.0000 - 14.8795 0.0000 - - - -91.8814 1.0000 - -91.4263 1.0000 - -91.2912 1.0000 - -65.7476 1.0000 - -30.0226 1.0000 - -29.9996 1.0000 - -29.8099 1.0000 - -1.7450 1.0000 - 4.2129 1.0000 - 4.5661 1.0000 - 5.8355 1.0000 - 7.1501 1.0000 - 7.8382 0.7357 - 8.7026 0.0000 - 8.7336 0.0000 - 10.4623 0.0000 - 13.8631 0.0000 - 14.8598 0.0000 - - - -91.8810 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7475 1.0000 - -30.0285 1.0000 - -29.9991 1.0000 - -29.8093 1.0000 - -1.5968 1.0000 - 4.0989 1.0000 - 4.3522 1.0000 - 5.6129 1.0000 - 7.4328 1.0000 - 7.6870 0.9972 - 8.4839 0.0000 - 8.7940 0.0000 - 10.9754 0.0000 - 14.1029 0.0000 - 15.2039 0.0000 - - - -91.8810 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7473 1.0000 - -30.0371 1.0000 - -29.9982 1.0000 - -29.8084 1.0000 - -1.3533 1.0000 - 3.5980 1.0000 - 4.3620 1.0000 - 5.4512 1.0000 - 7.3952 1.0000 - 7.5979 1.0000 - 8.3845 0.0000 - 9.0910 0.0000 - 11.5502 0.0000 - 14.7238 0.0000 - 15.9954 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7471 1.0000 - -30.0470 1.0000 - -29.9972 1.0000 - -29.8074 1.0000 - -1.0273 1.0000 - 2.9802 1.0000 - 4.4181 1.0000 - 5.2968 1.0000 - 7.0683 1.0000 - 7.7534 0.9663 - 8.3858 0.0000 - 9.5100 0.0000 - 12.1157 0.0000 - 13.7017 0.0000 - 16.0755 0.0000 - - - -91.8811 1.0000 - -91.4260 1.0000 - -91.2911 1.0000 - -65.7470 1.0000 - -30.0566 1.0000 - -29.9963 1.0000 - -29.8065 1.0000 - -0.6301 1.0000 - 2.3392 1.0000 - 4.4826 1.0000 - 5.1281 1.0000 - 6.7895 1.0000 - 7.9927 0.0600 - 8.4203 0.0000 - 9.9342 0.0000 - 12.6686 0.0000 - 14.6904 0.0000 - 16.3415 0.0000 - - - -91.8806 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7468 1.0000 - -30.0640 1.0000 - -29.9955 1.0000 - -29.8057 1.0000 - -0.1783 1.0000 - 1.7219 1.0000 - 4.5543 1.0000 - 4.9634 1.0000 - 6.5924 1.0000 - 8.2811 0.0000 - 8.4564 0.0000 - 10.2930 0.0000 - 12.6655 0.0000 - 13.2024 0.0000 - 15.4432 0.0000 - - - -91.8804 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7467 1.0000 - -30.0681 1.0000 - -29.9951 1.0000 - -29.8053 1.0000 - 0.2566 1.0000 - 1.2033 1.0000 - 4.6272 1.0000 - 4.8360 1.0000 - 6.4912 1.0000 - 8.4783 0.0000 - 8.4935 0.0000 - 10.5194 0.0000 - 12.2814 0.0000 - 13.6544 0.0000 - 14.8524 0.0000 - - - -91.8808 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7473 1.0000 - -30.0191 1.0000 - -30.0121 1.0000 - -29.8089 1.0000 - -1.5376 1.0000 - 3.7788 1.0000 - 4.6305 1.0000 - 5.6232 1.0000 - 7.1210 1.0000 - 7.3732 1.0000 - 8.9428 0.0000 - 9.1443 0.0000 - 10.7771 0.0000 - 14.0933 0.0000 - 15.6423 0.0000 - - - -91.8809 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7473 1.0000 - -30.0213 1.0000 - -30.0119 1.0000 - -29.8086 1.0000 - -1.4880 1.0000 - 3.7961 1.0000 - 4.5072 1.0000 - 5.5227 1.0000 - 7.3126 1.0000 - 7.3745 1.0000 - 8.7532 0.0000 - 9.0824 0.0000 - 11.0146 0.0000 - 13.9004 0.0000 - 15.4021 0.0000 - - - -91.8806 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7472 1.0000 - -30.0271 1.0000 - -30.0113 1.0000 - -29.8080 1.0000 - -1.3394 1.0000 - 3.8230 1.0000 - 4.1696 1.0000 - 5.3756 1.0000 - 7.3639 1.0000 - 7.6935 0.9963 - 8.3844 0.0000 - 8.9738 0.0000 - 11.5333 0.0000 - 14.0395 0.0000 - 15.4431 0.0000 - - - -91.8806 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7470 1.0000 - -30.0358 1.0000 - -30.0105 1.0000 - -29.8072 1.0000 - -1.1004 1.0000 - 3.5412 1.0000 - 4.0159 1.0000 - 5.2627 1.0000 - 7.2896 1.0000 - 7.9988 0.0504 - 8.0788 0.0028 - 9.0073 0.0000 - 12.1244 0.0000 - 13.7520 0.0000 - 16.7152 0.0000 - - - -91.8807 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7468 1.0000 - -30.0459 1.0000 - -30.0096 1.0000 - -29.8061 1.0000 - -0.7790 1.0000 - 2.9721 1.0000 - 4.1076 1.0000 - 5.1462 1.0000 - 7.1030 1.0000 - 7.9500 0.1708 - 8.1422 0.0001 - 9.2822 0.0000 - 12.7110 0.0000 - 13.3886 0.0000 - 15.6710 0.0000 - - - -91.8809 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7467 1.0000 - -30.0554 1.0000 - -30.0087 1.0000 - -29.8053 1.0000 - -0.3863 1.0000 - 2.3710 1.0000 - 4.2299 1.0000 - 5.0035 1.0000 - 6.8764 1.0000 - 7.9435 0.1954 - 8.2650 0.0000 - 9.6513 0.0000 - 12.8907 0.0000 - 13.2663 0.0000 - 15.5200 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7465 1.0000 - -30.0629 1.0000 - -30.0079 1.0000 - -29.8045 1.0000 - 0.0623 1.0000 - 1.7821 1.0000 - 4.3653 1.0000 - 4.8399 1.0000 - 6.6971 1.0000 - 7.9722 0.1031 - 8.4241 0.0000 - 9.9878 0.0000 - 12.3795 0.0000 - 13.7744 0.0000 - 15.4918 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7464 1.0000 - -30.0669 1.0000 - -30.0075 1.0000 - -29.8040 1.0000 - 0.5200 1.0000 - 1.2543 1.0000 - 4.5122 1.0000 - 4.6723 1.0000 - 6.6015 1.0000 - 7.9946 0.0570 - 8.5494 0.0000 - 10.2089 0.0000 - 12.0275 0.0000 - 14.4133 0.0000 - 15.6167 0.0000 - - - -91.8808 1.0000 - -91.4257 1.0000 - -91.2908 1.0000 - -65.7470 1.0000 - -30.0263 1.0000 - -30.0177 1.0000 - -29.8073 1.0000 - -1.1910 1.0000 - 3.1811 1.0000 - 4.6122 1.0000 - 5.2814 1.0000 - 6.9503 1.0000 - 7.4746 1.0000 - 8.9798 0.0000 - 9.5814 0.0000 - 11.3283 0.0000 - 13.6460 0.0000 - 15.5948 0.0000 - - - -91.8811 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7470 1.0000 - -30.0261 1.0000 - -30.0198 1.0000 - -29.8072 1.0000 - -1.1414 1.0000 - 3.1889 1.0000 - 4.5083 1.0000 - 5.2434 1.0000 - 6.9639 1.0000 - 7.6097 0.9999 - 8.7962 0.0000 - 9.4992 0.0000 - 11.5568 0.0000 - 13.6608 0.0000 - 15.2250 0.0000 - - - -91.8809 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7469 1.0000 - -30.0257 1.0000 - -30.0255 1.0000 - -29.8066 1.0000 - -0.9957 1.0000 - 3.1942 1.0000 - 4.2418 1.0000 - 5.1757 1.0000 - 7.0004 1.0000 - 7.9287 0.2579 - 8.4011 0.0000 - 9.3080 0.0000 - 12.0788 0.0000 - 13.5578 0.0000 - 15.2519 0.0000 - - - -91.8806 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7467 1.0000 - -30.0345 1.0000 - -30.0247 1.0000 - -29.8057 1.0000 - -0.7602 1.0000 - 3.1062 1.0000 - 3.9790 1.0000 - 5.1030 1.0000 - 7.0431 1.0000 - 7.9901 0.0646 - 8.2728 0.0000 - 9.1426 0.0000 - 12.6730 0.0000 - 13.3289 0.0000 - 15.7896 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7465 1.0000 - -30.0445 1.0000 - -30.0237 1.0000 - -29.8047 1.0000 - -0.4475 1.0000 - 2.8028 1.0000 - 3.9098 1.0000 - 5.0079 1.0000 - 7.0489 1.0000 - 7.6784 0.9981 - 8.4720 0.0000 - 9.1821 0.0000 - 12.9563 0.0000 - 13.5965 0.0000 - 17.2388 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7463 1.0000 - -30.0541 1.0000 - -30.0228 1.0000 - -29.8038 1.0000 - -0.0679 1.0000 - 2.3493 1.0000 - 3.9944 1.0000 - 4.8777 1.0000 - 6.9573 1.0000 - 7.5462 1.0000 - 8.5230 0.0000 - 9.4304 0.0000 - 12.4873 0.0000 - 13.6262 0.0000 - 16.0306 0.0000 - - - -91.8797 1.0000 - -91.4246 1.0000 - -91.2897 1.0000 - -65.7461 1.0000 - -30.0615 1.0000 - -30.0221 1.0000 - -29.8030 1.0000 - 0.3633 1.0000 - 1.8487 1.0000 - 4.1415 1.0000 - 4.7166 1.0000 - 6.8214 1.0000 - 7.5399 1.0000 - 8.5695 0.0000 - 9.7014 0.0000 - 12.0422 0.0000 - 13.9068 0.0000 - 16.1837 0.0000 - - - -91.8795 1.0000 - -91.4245 1.0000 - -91.2895 1.0000 - -65.7461 1.0000 - -30.0656 1.0000 - -30.0217 1.0000 - -29.8026 1.0000 - 0.8283 1.0000 - 1.3477 1.0000 - 4.3004 1.0000 - 4.5506 1.0000 - 6.7365 1.0000 - 7.5567 1.0000 - 8.6157 0.0000 - 9.8832 0.0000 - 11.7458 0.0000 - 14.0429 0.0000 - 16.0539 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2910 1.0000 - -65.7468 1.0000 - -30.0398 1.0000 - -30.0163 1.0000 - -29.8059 1.0000 - -0.7675 1.0000 - 2.5196 1.0000 - 4.5999 1.0000 - 5.0061 1.0000 - 6.6208 1.0000 - 7.9708 0.1066 - 9.0157 0.0000 - 9.9775 0.0000 - 11.8614 0.0000 - 13.1993 0.0000 - 15.3650 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7467 1.0000 - -30.0395 1.0000 - -30.0184 1.0000 - -29.8057 1.0000 - -0.7188 1.0000 - 2.5262 1.0000 - 4.5193 1.0000 - 4.9986 1.0000 - 6.6392 1.0000 - 8.0523 0.0083 - 8.8426 0.0000 - 9.8894 0.0000 - 12.0868 0.0000 - 13.1663 0.0000 - 16.1220 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7466 1.0000 - -30.0390 1.0000 - -30.0243 1.0000 - -29.8052 1.0000 - -0.5758 1.0000 - 2.5363 1.0000 - 4.3168 1.0000 - 4.9744 1.0000 - 6.6919 1.0000 - 8.2598 0.0000 - 8.4520 0.0000 - 9.6694 0.0000 - 12.6304 0.0000 - 13.0732 0.0000 - 15.6443 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2911 1.0000 - -65.7465 1.0000 - -30.0382 1.0000 - -30.0332 1.0000 - -29.8043 1.0000 - -0.3483 1.0000 - 2.5183 1.0000 - 4.0832 1.0000 - 4.9265 1.0000 - 6.7709 1.0000 - 8.0186 0.0274 - 8.5126 0.0000 - 9.4183 0.0000 - 12.8043 0.0000 - 13.1910 0.0000 - 15.7181 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7462 1.0000 - -30.0432 1.0000 - -30.0373 1.0000 - -29.8034 1.0000 - -0.0478 1.0000 - 2.4216 1.0000 - 3.9190 1.0000 - 4.8440 1.0000 - 6.8610 1.0000 - 7.6333 0.9998 - 8.7054 0.0000 - 9.2656 0.0000 - 12.4562 0.0000 - 13.6001 0.0000 - 16.2032 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7460 1.0000 - -30.0528 1.0000 - -30.0364 1.0000 - -29.8024 1.0000 - 0.3045 1.0000 - 2.2066 1.0000 - 3.8869 1.0000 - 4.7195 1.0000 - 6.9324 1.0000 - 7.3479 1.0000 - 8.7335 0.0000 - 9.3281 0.0000 - 12.0629 0.0000 - 13.7569 0.0000 - 16.5710 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7459 1.0000 - -30.0602 1.0000 - -30.0357 1.0000 - -29.8017 1.0000 - 0.6908 1.0000 - 1.8937 1.0000 - 3.9664 1.0000 - 4.5594 1.0000 - 6.9277 1.0000 - 7.2186 1.0000 - 8.6985 0.0000 - 9.4867 0.0000 - 11.7099 0.0000 - 13.7542 0.0000 - 16.7032 0.0000 - - - -91.8786 1.0000 - -91.4236 1.0000 - -91.2886 1.0000 - -65.7457 1.0000 - -30.0642 1.0000 - -30.0352 1.0000 - -29.8012 1.0000 - 1.0768 1.0000 - 1.5402 1.0000 - 4.0958 1.0000 - 4.3989 1.0000 - 6.8746 1.0000 - 7.2086 1.0000 - 8.6828 0.0000 - 9.6000 0.0000 - 11.4903 0.0000 - 13.7171 0.0000 - 16.6030 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7465 1.0000 - -30.0502 1.0000 - -30.0152 1.0000 - -29.8048 1.0000 - -0.2969 1.0000 - 1.8722 1.0000 - 4.5904 1.0000 - 4.8147 1.0000 - 6.3956 1.0000 - 8.5207 0.0000 - 9.0442 0.0000 - 10.2923 0.0000 - 12.3631 0.0000 - 12.6799 0.0000 - 15.4633 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7465 1.0000 - -30.0501 1.0000 - -30.0173 1.0000 - -29.8046 1.0000 - -0.2476 1.0000 - 1.8793 1.0000 - 4.5376 1.0000 - 4.8080 1.0000 - 6.4159 1.0000 - 8.5593 0.0000 - 8.8804 0.0000 - 10.2052 0.0000 - 12.5854 0.0000 - 12.5895 0.0000 - 14.7751 0.0000 - - - -91.8814 1.0000 - -91.4264 1.0000 - -91.2914 1.0000 - -65.7464 1.0000 - -30.0496 1.0000 - -30.0233 1.0000 - -29.8041 1.0000 - -0.1045 1.0000 - 1.8964 1.0000 - 4.3983 1.0000 - 4.7846 1.0000 - 6.4746 1.0000 - 8.5014 0.0000 - 8.6596 0.0000 - 9.9796 0.0000 - 12.4726 0.0000 - 13.1496 0.0000 - 15.1815 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2908 1.0000 - -65.7462 1.0000 - -30.0487 1.0000 - -30.0321 1.0000 - -29.8032 1.0000 - 0.1204 1.0000 - 1.9197 1.0000 - 4.2177 1.0000 - 4.7361 1.0000 - 6.5646 1.0000 - 8.0702 0.0040 - 8.7844 0.0000 - 9.6958 0.0000 - 12.2586 0.0000 - 13.7021 0.0000 - 15.4427 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7460 1.0000 - -30.0478 1.0000 - -30.0422 1.0000 - -29.8023 1.0000 - 0.4035 1.0000 - 1.9363 1.0000 - 4.0468 1.0000 - 4.6515 1.0000 - 6.6739 1.0000 - 7.6760 0.9983 - 8.8822 0.0000 - 9.4477 0.0000 - 11.9748 0.0000 - 13.8742 0.0000 - 16.0112 0.0000 - - - -91.8797 1.0000 - -91.4248 1.0000 - -91.2897 1.0000 - -65.7458 1.0000 - -30.0517 1.0000 - -30.0469 1.0000 - -29.8013 1.0000 - 0.7108 1.0000 - 1.9297 1.0000 - 3.9336 1.0000 - 4.5238 1.0000 - 6.7857 1.0000 - 7.3592 1.0000 - 8.8793 0.0000 - 9.3398 0.0000 - 11.6821 0.0000 - 13.7440 0.0000 - 16.5307 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7456 1.0000 - -30.0593 1.0000 - -30.0463 1.0000 - -29.8006 1.0000 - 0.9965 1.0000 - 1.8877 1.0000 - 3.9039 1.0000 - 4.3616 1.0000 - 6.8809 1.0000 - 7.1374 1.0000 - 8.7963 0.0000 - 9.3615 0.0000 - 11.4387 0.0000 - 13.5583 0.0000 - 16.9470 0.0000 - - - -91.8787 1.0000 - -91.4238 1.0000 - -91.2887 1.0000 - -65.7455 1.0000 - -30.0632 1.0000 - -30.0459 1.0000 - -29.8002 1.0000 - 1.1916 1.0000 - 1.8308 1.0000 - 3.9520 1.0000 - 4.2094 1.0000 - 6.9473 1.0000 - 7.0123 1.0000 - 8.7381 0.0000 - 9.3978 0.0000 - 11.2989 0.0000 - 13.4437 0.0000 - 16.5925 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7463 1.0000 - -30.0559 1.0000 - -30.0145 1.0000 - -29.8042 1.0000 - 0.1293 1.0000 - 1.3542 1.0000 - 4.5849 1.0000 - 4.7168 1.0000 - 6.2814 1.0000 - 8.9385 0.0000 - 9.0598 0.0000 - 10.4726 0.0000 - 12.1850 0.0000 - 12.8255 0.0000 - 15.1774 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7463 1.0000 - -30.0557 1.0000 - -30.0167 1.0000 - -29.8040 1.0000 - 0.1836 1.0000 - 1.3565 1.0000 - 4.5671 1.0000 - 4.6874 1.0000 - 6.3024 1.0000 - 8.9015 0.0000 - 8.9469 0.0000 - 10.3933 0.0000 - 12.1353 0.0000 - 13.0125 0.0000 - 15.3429 0.0000 - - - -91.8806 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7462 1.0000 - -30.0552 1.0000 - -30.0227 1.0000 - -29.8035 1.0000 - 0.3435 1.0000 - 1.3655 1.0000 - 4.4967 1.0000 - 4.6242 1.0000 - 6.3631 1.0000 - 8.5307 0.0000 - 8.9685 0.0000 - 10.1791 0.0000 - 12.0342 0.0000 - 13.5893 0.0000 - 16.0045 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7460 1.0000 - -30.0544 1.0000 - -30.0315 1.0000 - -29.8026 1.0000 - 0.5914 1.0000 - 1.3832 1.0000 - 4.3674 1.0000 - 4.5524 1.0000 - 6.4562 1.0000 - 8.1044 0.0009 - 8.9932 0.0000 - 9.8884 0.0000 - 11.8622 0.0000 - 14.2861 0.0000 - 15.0487 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7459 1.0000 - -30.0535 1.0000 - -30.0416 1.0000 - -29.8017 1.0000 - 0.8833 1.0000 - 1.4308 1.0000 - 4.2192 1.0000 - 4.4522 1.0000 - 6.5696 1.0000 - 7.7127 0.9919 - 9.0016 0.0000 - 9.5963 0.0000 - 11.6488 0.0000 - 14.0297 0.0000 - 15.9577 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7457 1.0000 - -30.0528 1.0000 - -30.0512 1.0000 - -29.8008 1.0000 - 1.1157 1.0000 - 1.5761 1.0000 - 4.0844 1.0000 - 4.3103 1.0000 - 6.6854 1.0000 - 7.3974 1.0000 - 8.9559 0.0000 - 9.3894 0.0000 - 11.4424 0.0000 - 13.7001 0.0000 - 16.5151 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7455 1.0000 - -30.0587 1.0000 - -30.0521 1.0000 - -29.8000 1.0000 - 1.2081 1.0000 - 1.8399 1.0000 - 3.9754 1.0000 - 4.1492 1.0000 - 6.7823 1.0000 - 7.1786 1.0000 - 8.8498 0.0000 - 9.3109 0.0000 - 11.2830 0.0000 - 13.4354 0.0000 - 16.6304 0.0000 - - - -91.8793 1.0000 - -91.4243 1.0000 - -91.2893 1.0000 - -65.7454 1.0000 - -30.0627 1.0000 - -30.0518 1.0000 - -29.7996 1.0000 - 1.2328 1.0000 - 2.0507 1.0000 - 3.8985 1.0000 - 4.0417 1.0000 - 6.8389 1.0000 - 7.0660 1.0000 - 8.7690 0.0000 - 9.2970 0.0000 - 11.2437 0.0000 - 14.1131 0.0000 - 18.0681 0.0000 - - - -91.8804 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7474 1.0000 - -30.0205 1.0000 - -29.9874 1.0000 - -29.8211 1.0000 - -1.9380 1.0000 - 4.4295 1.0000 - 4.8508 1.0000 - 6.3792 1.0000 - 6.8138 1.0000 - 8.1771 0.0000 - 8.8386 0.0000 - 8.9434 0.0000 - 9.0466 0.0000 - 13.4689 0.0000 - 14.8465 0.0000 - - - -91.8802 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7474 1.0000 - -30.0226 1.0000 - -29.9872 1.0000 - -29.8209 1.0000 - -1.8859 1.0000 - 4.3438 1.0000 - 4.8274 1.0000 - 6.3656 1.0000 - 6.6651 1.0000 - 8.2366 0.0000 - 8.4561 0.0000 - 9.1702 0.0000 - 9.3749 0.0000 - 14.6979 0.0000 - 15.1035 0.0000 - - - -91.8808 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7473 1.0000 - -30.0286 1.0000 - -29.9866 1.0000 - -29.8203 1.0000 - -1.7375 1.0000 - 4.0528 1.0000 - 4.7878 1.0000 - 6.3364 1.0000 - 6.3830 1.0000 - 8.0619 0.0057 - 8.3336 0.0000 - 9.5014 0.0000 - 9.9115 0.0000 - 14.1815 0.0000 - 14.9183 0.0000 - - - -91.8808 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7471 1.0000 - -30.0372 1.0000 - -29.9857 1.0000 - -29.8195 1.0000 - -1.4939 1.0000 - 3.5647 1.0000 - 4.7595 1.0000 - 5.9723 1.0000 - 6.4743 1.0000 - 7.7497 0.9700 - 8.4147 0.0000 - 9.9423 0.0000 - 10.4794 0.0000 - 14.3282 0.0000 - 15.0758 0.0000 - - - -91.8796 1.0000 - -91.4244 1.0000 - -91.2894 1.0000 - -65.7469 1.0000 - -30.0470 1.0000 - -29.9846 1.0000 - -29.8185 1.0000 - -1.1660 1.0000 - 2.9634 1.0000 - 4.7389 1.0000 - 5.6413 1.0000 - 6.5416 1.0000 - 7.6483 0.9995 - 8.4831 0.0000 - 10.4090 0.0000 - 11.0447 0.0000 - 15.0305 0.0000 - 15.6832 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7468 1.0000 - -30.0566 1.0000 - -29.9837 1.0000 - -29.8176 1.0000 - -0.7654 1.0000 - 2.3210 1.0000 - 4.7218 1.0000 - 5.3752 1.0000 - 6.4754 1.0000 - 7.8474 0.6915 - 8.5405 0.0000 - 10.8486 0.0000 - 11.5771 0.0000 - 13.5613 0.0000 - 15.1290 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2911 1.0000 - -65.7467 1.0000 - -30.0642 1.0000 - -29.9830 1.0000 - -29.8168 1.0000 - -0.3160 1.0000 - 1.6951 1.0000 - 4.7092 1.0000 - 5.1905 1.0000 - 6.3590 1.0000 - 8.1987 0.0000 - 8.5831 0.0000 - 11.2134 0.0000 - 12.0304 0.0000 - 12.9684 0.0000 - 14.5851 0.0000 - - - -91.8817 1.0000 - -91.4266 1.0000 - -91.2917 1.0000 - -65.7467 1.0000 - -30.0683 1.0000 - -29.9826 1.0000 - -29.8165 1.0000 - 0.1015 1.0000 - 1.1853 1.0000 - 4.7026 1.0000 - 5.0962 1.0000 - 6.2848 1.0000 - 8.4738 0.0000 - 8.6059 0.0000 - 11.4369 0.0000 - 12.3087 0.0000 - 12.6173 0.0000 - 14.4394 0.0000 - - - -91.8803 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7474 1.0000 - -30.0202 1.0000 - -29.9904 1.0000 - -29.8208 1.0000 - -1.8853 1.0000 - 4.3956 1.0000 - 4.8088 1.0000 - 6.2602 1.0000 - 6.7341 1.0000 - 8.1965 0.0000 - 8.5252 0.0000 - 9.0697 0.0000 - 9.4119 0.0000 - 13.8616 0.0000 - 15.2576 0.0000 - - - -91.8804 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7473 1.0000 - -30.0223 1.0000 - -29.9901 1.0000 - -29.8206 1.0000 - -1.8347 1.0000 - 4.3325 1.0000 - 4.7685 1.0000 - 6.1044 1.0000 - 6.8162 1.0000 - 7.9710 0.1061 - 8.7574 0.0000 - 8.9151 0.0000 - 9.6966 0.0000 - 13.8495 0.0000 - 14.8611 0.0000 - - - -91.8808 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7473 1.0000 - -30.0283 1.0000 - -29.9896 1.0000 - -29.8200 1.0000 - -1.6854 1.0000 - 4.0715 1.0000 - 4.7055 1.0000 - 5.8924 1.0000 - 6.8149 1.0000 - 7.7859 0.9146 - 8.5439 0.0000 - 9.2979 0.0000 - 10.1790 0.0000 - 14.4429 0.0000 - 14.9450 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7471 1.0000 - -30.0369 1.0000 - -29.9887 1.0000 - -29.8192 1.0000 - -1.4415 1.0000 - 3.5859 1.0000 - 4.6793 1.0000 - 5.7131 1.0000 - 6.7163 1.0000 - 7.7038 0.9943 - 8.3889 0.0000 - 9.7722 0.0000 - 10.7211 0.0000 - 14.3964 0.0000 - 15.0087 0.0000 - - - -91.8804 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7469 1.0000 - -30.0468 1.0000 - -29.9877 1.0000 - -29.8182 1.0000 - -1.1142 1.0000 - 2.9798 1.0000 - 4.6736 1.0000 - 5.5108 1.0000 - 6.6199 1.0000 - 7.7221 0.9885 - 8.3636 0.0000 - 10.2499 0.0000 - 11.2691 0.0000 - 14.1095 0.0000 - 16.1309 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7467 1.0000 - -30.0564 1.0000 - -29.9867 1.0000 - -29.8173 1.0000 - -0.7140 1.0000 - 2.3366 1.0000 - 4.6761 1.0000 - 5.3013 1.0000 - 6.5008 1.0000 - 7.9230 0.2850 - 8.3953 0.0000 - 10.6940 0.0000 - 11.7823 0.0000 - 13.5487 0.0000 - 15.0697 0.0000 - - - -91.8810 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7466 1.0000 - -30.0639 1.0000 - -29.9860 1.0000 - -29.8166 1.0000 - -0.2628 1.0000 - 1.7117 1.0000 - 4.6852 1.0000 - 5.1307 1.0000 - 6.3817 1.0000 - 8.2332 0.0000 - 8.4366 0.0000 - 11.0609 0.0000 - 12.1858 0.0000 - 13.0336 0.0000 - 14.9369 0.0000 - - - -91.8812 1.0000 - -91.4262 1.0000 - -91.2912 1.0000 - -65.7466 1.0000 - -30.0680 1.0000 - -29.9856 1.0000 - -29.8162 1.0000 - 0.1614 1.0000 - 1.1971 1.0000 - 4.6963 1.0000 - 5.0329 1.0000 - 6.3108 1.0000 - 8.4305 0.0000 - 8.5088 0.0000 - 11.2905 0.0000 - 12.2531 0.0000 - 13.6523 0.0000 - 15.0165 0.0000 - - - -91.8799 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7472 1.0000 - -30.0193 1.0000 - -29.9987 1.0000 - -29.8199 1.0000 - -1.7259 1.0000 - 4.2208 1.0000 - 4.7206 1.0000 - 5.9736 1.0000 - 6.6199 1.0000 - 8.1432 0.0001 - 8.2436 0.0000 - 9.3875 0.0000 - 9.9330 0.0000 - 14.2783 0.0000 - 14.9326 0.0000 - - - -91.8805 1.0000 - -91.4253 1.0000 - -91.2904 1.0000 - -65.7472 1.0000 - -30.0214 1.0000 - -29.9985 1.0000 - -29.8197 1.0000 - -1.6767 1.0000 - 4.2223 1.0000 - 4.6204 1.0000 - 5.7734 1.0000 - 6.8479 1.0000 - 7.7918 0.9010 - 8.5549 0.0000 - 9.2077 0.0000 - 10.1836 0.0000 - 14.6923 0.0000 - 15.0199 0.0000 - - - -91.8807 1.0000 - -91.4255 1.0000 - -91.2906 1.0000 - -65.7471 1.0000 - -30.0274 1.0000 - -29.9980 1.0000 - -29.8192 1.0000 - -1.5287 1.0000 - 4.1177 1.0000 - 4.4062 1.0000 - 5.5506 1.0000 - 7.1483 1.0000 - 7.4218 1.0000 - 8.7268 0.0000 - 9.0973 0.0000 - 10.6622 0.0000 - 14.4498 0.0000 - 15.1810 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7469 1.0000 - -30.0361 1.0000 - -29.9971 1.0000 - -29.8183 1.0000 - -1.2856 1.0000 - 3.6350 1.0000 - 4.3984 1.0000 - 5.4250 1.0000 - 6.9924 1.0000 - 7.5022 1.0000 - 8.4908 0.0000 - 9.4686 0.0000 - 11.2024 0.0000 - 14.4000 0.0000 - 15.1855 0.0000 - - - -91.8808 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7467 1.0000 - -30.0460 1.0000 - -29.9962 1.0000 - -29.8174 1.0000 - -0.9603 1.0000 - 3.0182 1.0000 - 4.4522 1.0000 - 5.3087 1.0000 - 6.7413 1.0000 - 7.7217 0.9886 - 8.3005 0.0000 - 9.9206 0.0000 - 11.7328 0.0000 - 13.9753 0.0000 - 15.3830 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7465 1.0000 - -30.0556 1.0000 - -29.9952 1.0000 - -29.8164 1.0000 - -0.5617 1.0000 - 2.3790 1.0000 - 4.5170 1.0000 - 5.1603 1.0000 - 6.5656 1.0000 - 7.9200 0.2994 - 8.2560 0.0000 - 10.3547 0.0000 - 12.1577 0.0000 - 13.5549 0.0000 - 17.9977 0.0000 - - - -91.8808 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7464 1.0000 - -30.0631 1.0000 - -29.9945 1.0000 - -29.8157 1.0000 - -0.1093 1.0000 - 1.7590 1.0000 - 4.5897 1.0000 - 5.0004 1.0000 - 6.4473 1.0000 - 8.0381 0.0140 - 8.3802 0.0000 - 10.7217 0.0000 - 12.2601 0.0000 - 13.3666 0.0000 - 15.0205 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7464 1.0000 - -30.0672 1.0000 - -29.9941 1.0000 - -29.8153 1.0000 - 0.3334 1.0000 - 1.2318 1.0000 - 4.6652 1.0000 - 4.8709 1.0000 - 6.3846 1.0000 - 8.0775 0.0029 - 8.5356 0.0000 - 10.9631 0.0000 - 12.0560 0.0000 - 14.6802 0.0000 - 15.7986 0.0000 - - - -91.8809 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7470 1.0000 - -30.0181 1.0000 - -30.0111 1.0000 - -29.8187 1.0000 - -1.4695 1.0000 - 3.7994 1.0000 - 4.6693 1.0000 - 5.6325 1.0000 - 6.5974 1.0000 - 7.8461 0.6978 - 8.3061 0.0000 - 9.7917 0.0000 - 10.4886 0.0000 - 14.2428 0.0000 - 15.3871 0.0000 - - - -91.8808 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7469 1.0000 - -30.0202 1.0000 - -30.0109 1.0000 - -29.8185 1.0000 - -1.4195 1.0000 - 3.8193 1.0000 - 4.5504 1.0000 - 5.5098 1.0000 - 6.7466 1.0000 - 7.7637 0.9539 - 8.3458 0.0000 - 9.6384 0.0000 - 10.7162 0.0000 - 14.2161 0.0000 - 15.3807 0.0000 - - - -91.8806 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7468 1.0000 - -30.0261 1.0000 - -30.0103 1.0000 - -29.8179 1.0000 - -1.2729 1.0000 - 3.8625 1.0000 - 4.2037 1.0000 - 5.3571 1.0000 - 6.9709 1.0000 - 7.5306 1.0000 - 8.5275 0.0000 - 9.3693 0.0000 - 11.1903 0.0000 - 14.9903 0.0000 - 31.3493 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7467 1.0000 - -30.0349 1.0000 - -30.0095 1.0000 - -29.8171 1.0000 - -1.0337 1.0000 - 3.6024 1.0000 - 4.0290 1.0000 - 5.2643 1.0000 - 7.0029 1.0000 - 7.3935 1.0000 - 8.6571 0.0000 - 9.2934 0.0000 - 11.7135 0.0000 - 14.0675 0.0000 - 15.4038 0.0000 - - - -91.8804 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7464 1.0000 - -30.0448 1.0000 - -30.0085 1.0000 - -29.8161 1.0000 - -0.7114 1.0000 - 3.0260 1.0000 - 4.1301 1.0000 - 5.1712 1.0000 - 6.8136 1.0000 - 7.4784 1.0000 - 8.5466 0.0000 - 9.5926 0.0000 - 12.1469 0.0000 - 13.8100 0.0000 - 15.8147 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7463 1.0000 - -30.0544 1.0000 - -30.0076 1.0000 - -29.8152 1.0000 - -0.3183 1.0000 - 2.4223 1.0000 - 4.2569 1.0000 - 5.0412 1.0000 - 6.6493 1.0000 - 7.5743 1.0000 - 8.4765 0.0000 - 9.9779 0.0000 - 12.2811 0.0000 - 13.6749 0.0000 - 15.6480 0.0000 - - - -91.8806 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7461 1.0000 - -30.0619 1.0000 - -30.0069 1.0000 - -29.8145 1.0000 - 0.1309 1.0000 - 1.8302 1.0000 - 4.3950 1.0000 - 4.8792 1.0000 - 6.5467 1.0000 - 7.6338 0.9998 - 8.5191 0.0000 - 10.3234 0.0000 - 12.0332 0.0000 - 13.9324 0.0000 - 15.8350 0.0000 - - - -91.8807 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7461 1.0000 - -30.0660 1.0000 - -30.0065 1.0000 - -29.8141 1.0000 - 0.5962 1.0000 - 1.2931 1.0000 - 4.5437 1.0000 - 4.7091 1.0000 - 6.4966 1.0000 - 7.6617 0.9991 - 8.5908 0.0000 - 10.5605 0.0000 - 11.7454 0.0000 - 14.3195 0.0000 - 15.4240 0.0000 - - - -91.8811 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7467 1.0000 - -30.0253 1.0000 - -30.0166 1.0000 - -29.8173 1.0000 - -1.1232 1.0000 - 3.2045 1.0000 - 4.6486 1.0000 - 5.3096 1.0000 - 6.5657 1.0000 - 7.8108 0.8458 - 8.3758 0.0000 - 10.2111 0.0000 - 11.0400 0.0000 - 13.9258 0.0000 - 15.5259 0.0000 - - - -91.8810 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7466 1.0000 - -30.0251 1.0000 - -30.0187 1.0000 - -29.8171 1.0000 - -1.0740 1.0000 - 3.2169 1.0000 - 4.5463 1.0000 - 5.2645 1.0000 - 6.6130 1.0000 - 7.8637 0.6062 - 8.2993 0.0000 - 10.0666 0.0000 - 11.2485 0.0000 - 13.8793 0.0000 - 15.1310 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7465 1.0000 - -30.0247 1.0000 - -30.0245 1.0000 - -29.8165 1.0000 - -0.9278 1.0000 - 3.2332 1.0000 - 4.2746 1.0000 - 5.1943 1.0000 - 6.7018 1.0000 - 7.7714 0.9424 - 8.3727 0.0000 - 9.7624 0.0000 - 11.6929 0.0000 - 13.8341 0.0000 - 15.2470 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7463 1.0000 - -30.0335 1.0000 - -30.0237 1.0000 - -29.8157 1.0000 - -0.6936 1.0000 - 3.1651 1.0000 - 3.9951 1.0000 - 5.1310 1.0000 - 6.7693 1.0000 - 7.5109 1.0000 - 8.6573 0.0000 - 9.4680 0.0000 - 12.1191 0.0000 - 13.7501 0.0000 - 16.2199 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7461 1.0000 - -30.0435 1.0000 - -30.0228 1.0000 - -29.8147 1.0000 - -0.3808 1.0000 - 2.8709 1.0000 - 3.9188 1.0000 - 5.0470 1.0000 - 6.7750 1.0000 - 7.3303 1.0000 - 8.7957 0.0000 - 9.4194 0.0000 - 12.2854 0.0000 - 15.1004 0.0000 - 16.6631 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7460 1.0000 - -30.0531 1.0000 - -30.0219 1.0000 - -29.8138 1.0000 - -0.0012 1.0000 - 2.4149 1.0000 - 4.0086 1.0000 - 4.9212 1.0000 - 6.7199 1.0000 - 7.2772 1.0000 - 8.7185 0.0000 - 9.6676 0.0000 - 12.0399 0.0000 - 13.9078 0.0000 - 16.1396 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7458 1.0000 - -30.0605 1.0000 - -30.0212 1.0000 - -29.8131 1.0000 - 0.4304 1.0000 - 1.9114 1.0000 - 4.1602 1.0000 - 4.7577 1.0000 - 6.6629 1.0000 - 7.2826 1.0000 - 8.6633 0.0000 - 9.9472 0.0000 - 11.6785 0.0000 - 15.2726 0.0000 - 16.0488 0.0000 - - - -91.8797 1.0000 - -91.4247 1.0000 - -91.2897 1.0000 - -65.7457 1.0000 - -30.0646 1.0000 - -30.0207 1.0000 - -29.8127 1.0000 - 0.8992 1.0000 - 1.4048 1.0000 - 4.3197 1.0000 - 4.5902 1.0000 - 6.6327 1.0000 - 7.2942 1.0000 - 8.6558 0.0000 - 10.1424 0.0000 - 11.4034 0.0000 - 14.2472 0.0000 - 41.7288 0.0000 - - - -91.8814 1.0000 - -91.4263 1.0000 - -91.2913 1.0000 - -65.7464 1.0000 - -30.0388 1.0000 - -30.0152 1.0000 - -29.8160 1.0000 - -0.7011 1.0000 - 2.5446 1.0000 - 4.6365 1.0000 - 5.0441 1.0000 - 6.4285 1.0000 - 8.1110 0.0006 - 8.4422 0.0000 - 10.6018 0.0000 - 11.5597 0.0000 - 13.3506 0.0000 - 15.1051 0.0000 - - - -91.8812 1.0000 - -91.4261 1.0000 - -91.2911 1.0000 - -65.7464 1.0000 - -30.0386 1.0000 - -30.0173 1.0000 - -29.8158 1.0000 - -0.6526 1.0000 - 2.5545 1.0000 - 4.5567 1.0000 - 5.0344 1.0000 - 6.4474 1.0000 - 8.1580 0.0000 - 8.3450 0.0000 - 10.4604 0.0000 - 11.7435 0.0000 - 13.3794 0.0000 - 15.8365 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7462 1.0000 - -30.0381 1.0000 - -30.0233 1.0000 - -29.8152 1.0000 - -0.5089 1.0000 - 2.5736 1.0000 - 4.3507 1.0000 - 5.0102 1.0000 - 6.4989 1.0000 - 7.9569 0.1473 - 8.4473 0.0000 - 10.1404 0.0000 - 12.0883 0.0000 - 13.4032 0.0000 - 15.1473 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7461 1.0000 - -30.0373 1.0000 - -30.0321 1.0000 - -29.8143 1.0000 - -0.2806 1.0000 - 2.5705 1.0000 - 4.1067 1.0000 - 4.9666 1.0000 - 6.5721 1.0000 - 7.6198 0.9999 - 8.7017 0.0000 - 9.7782 0.0000 - 12.2391 0.0000 - 13.5917 0.0000 - 15.4441 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7459 1.0000 - -30.0422 1.0000 - -30.0363 1.0000 - -29.8134 1.0000 - 0.0188 1.0000 - 2.4896 1.0000 - 3.9304 1.0000 - 4.8876 1.0000 - 6.6514 1.0000 - 7.3330 1.0000 - 8.9105 0.0000 - 9.5027 0.0000 - 12.0077 0.0000 - 14.3536 0.0000 - 16.5093 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7457 1.0000 - -30.0518 1.0000 - -30.0354 1.0000 - -29.8125 1.0000 - 0.3709 1.0000 - 2.2835 1.0000 - 3.8916 1.0000 - 4.7617 1.0000 - 6.7183 1.0000 - 7.1436 1.0000 - 8.9049 0.0000 - 9.4941 0.0000 - 11.7396 0.0000 - 15.6793 0.0000 - 16.9345 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7455 1.0000 - -30.0593 1.0000 - -30.0348 1.0000 - -29.8117 1.0000 - 0.7545 1.0000 - 1.9742 1.0000 - 3.9744 1.0000 - 4.5954 1.0000 - 6.7577 1.0000 - 7.0518 1.0000 - 8.7886 0.0000 - 9.6473 0.0000 - 11.3101 0.0000 - 14.0340 0.0000 - 16.7643 0.0000 - - - -91.8795 1.0000 - -91.4245 1.0000 - -91.2895 1.0000 - -65.7454 1.0000 - -30.0633 1.0000 - -30.0343 1.0000 - -29.8114 1.0000 - 1.1319 1.0000 - 1.6271 1.0000 - 4.1052 1.0000 - 4.4298 1.0000 - 6.7711 1.0000 - 7.0239 1.0000 - 8.7206 0.0000 - 9.7665 0.0000 - 11.0890 0.0000 - 13.9788 0.0000 - 16.9520 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7462 1.0000 - -30.0493 1.0000 - -30.0141 1.0000 - -29.8149 1.0000 - -0.2288 1.0000 - 1.8983 1.0000 - 4.6283 1.0000 - 4.8575 1.0000 - 6.2772 1.0000 - 8.4945 0.0000 - 8.5804 0.0000 - 10.9224 0.0000 - 11.9786 0.0000 - 12.7899 0.0000 - 14.9087 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7461 1.0000 - -30.0491 1.0000 - -30.0162 1.0000 - -29.8147 1.0000 - -0.1792 1.0000 - 1.9074 1.0000 - 4.5762 1.0000 - 4.8487 1.0000 - 6.2969 1.0000 - 8.3585 0.0000 - 8.6284 0.0000 - 10.7823 0.0000 - 12.0806 0.0000 - 12.8868 0.0000 - 15.2348 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7460 1.0000 - -30.0486 1.0000 - -30.0222 1.0000 - -29.8141 1.0000 - -0.0352 1.0000 - 1.9332 1.0000 - 4.4339 1.0000 - 4.8242 1.0000 - 6.3536 1.0000 - 8.0475 0.0099 - 8.7378 0.0000 - 10.4554 0.0000 - 12.1158 0.0000 - 13.2657 0.0000 - 14.9000 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7458 1.0000 - -30.0478 1.0000 - -30.0311 1.0000 - -29.8133 1.0000 - 0.1893 1.0000 - 1.9679 1.0000 - 4.2451 1.0000 - 4.7769 1.0000 - 6.4400 1.0000 - 7.6916 0.9966 - 8.8745 0.0000 - 10.0643 0.0000 - 11.9241 0.0000 - 13.8014 0.0000 - 15.2989 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7456 1.0000 - -30.0469 1.0000 - -30.0412 1.0000 - -29.8123 1.0000 - 0.4706 1.0000 - 1.9998 1.0000 - 4.0636 1.0000 - 4.6916 1.0000 - 6.5446 1.0000 - 7.3787 1.0000 - 8.9926 0.0000 - 9.6981 0.0000 - 11.6104 0.0000 - 14.1038 0.0000 - 15.9363 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7454 1.0000 - -30.0508 1.0000 - -30.0460 1.0000 - -29.8114 1.0000 - 0.7753 1.0000 - 2.0098 1.0000 - 3.9391 1.0000 - 4.5583 1.0000 - 6.6530 1.0000 - 7.1493 1.0000 - 9.0079 0.0000 - 9.4727 0.0000 - 11.2802 0.0000 - 14.0000 0.0000 - 16.5368 0.0000 - - - -91.8795 1.0000 - -91.4245 1.0000 - -91.2895 1.0000 - -65.7452 1.0000 - -30.0583 1.0000 - -30.0454 1.0000 - -29.8107 1.0000 - 1.0560 1.0000 - 1.9838 1.0000 - 3.9064 1.0000 - 4.3863 1.0000 - 6.7511 1.0000 - 7.0039 1.0000 - 8.8800 0.0000 - 9.4519 0.0000 - 11.0055 0.0000 - 13.8522 0.0000 - 16.8940 0.0000 - - - -91.8797 1.0000 - -91.4247 1.0000 - -91.2896 1.0000 - -65.7452 1.0000 - -30.0624 1.0000 - -30.0450 1.0000 - -29.8103 1.0000 - 1.2424 1.0000 - 1.9383 1.0000 - 3.9540 1.0000 - 4.2239 1.0000 - 6.8299 1.0000 - 6.9158 1.0000 - 8.7739 0.0000 - 9.4832 0.0000 - 10.8480 0.0000 - 13.7576 0.0000 - 16.7488 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2908 1.0000 - -65.7460 1.0000 - -30.0550 1.0000 - -30.0134 1.0000 - -29.8143 1.0000 - 0.2043 1.0000 - 1.3732 1.0000 - 4.6240 1.0000 - 4.7616 1.0000 - 6.1883 1.0000 - 8.5233 0.0000 - 8.9674 0.0000 - 11.1121 0.0000 - 12.0071 0.0000 - 12.6025 0.0000 - 14.7790 0.0000 - - - -91.8807 1.0000 - -91.4258 1.0000 - -91.2907 1.0000 - -65.7460 1.0000 - -30.0547 1.0000 - -30.0156 1.0000 - -29.8141 1.0000 - 0.2601 1.0000 - 1.3783 1.0000 - 4.6072 1.0000 - 4.7289 1.0000 - 6.2110 1.0000 - 8.3945 0.0000 - 8.9806 0.0000 - 10.9757 0.0000 - 11.9688 0.0000 - 12.8374 0.0000 - 14.6721 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7458 1.0000 - -30.0543 1.0000 - -30.0216 1.0000 - -29.8135 1.0000 - 0.4205 1.0000 - 1.3934 1.0000 - 4.5342 1.0000 - 4.6626 1.0000 - 6.2753 1.0000 - 8.0869 0.0019 - 9.0106 0.0000 - 10.6601 0.0000 - 11.8277 0.0000 - 13.4681 0.0000 - 14.6325 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7457 1.0000 - -30.0535 1.0000 - -30.0305 1.0000 - -29.8127 1.0000 - 0.6680 1.0000 - 1.4216 1.0000 - 4.3948 1.0000 - 4.5926 1.0000 - 6.3719 1.0000 - 7.7299 0.9847 - 9.0457 0.0000 - 10.2612 0.0000 - 11.5905 0.0000 - 14.2426 0.0000 - 14.7492 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7455 1.0000 - -30.0527 1.0000 - -30.0406 1.0000 - -29.8117 1.0000 - 0.9557 1.0000 - 1.4873 1.0000 - 4.2358 1.0000 - 4.4908 1.0000 - 6.4878 1.0000 - 7.4124 1.0000 - 9.0712 0.0000 - 9.8506 0.0000 - 11.3089 0.0000 - 14.3846 0.0000 - 15.5524 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7453 1.0000 - -30.0518 1.0000 - -30.0502 1.0000 - -29.8108 1.0000 - 1.1737 1.0000 - 1.6621 1.0000 - 4.0925 1.0000 - 4.3402 1.0000 - 6.6061 1.0000 - 7.1785 1.0000 - 9.0505 0.0000 - 9.5155 0.0000 - 11.0400 0.0000 - 13.9482 0.0000 - 16.5775 0.0000 - - - -91.8795 1.0000 - -91.4245 1.0000 - -91.2895 1.0000 - -65.7451 1.0000 - -30.0577 1.0000 - -30.0512 1.0000 - -29.8101 1.0000 - 1.2606 1.0000 - 1.9475 1.0000 - 3.9805 1.0000 - 4.1622 1.0000 - 6.7058 1.0000 - 7.0369 1.0000 - 8.9273 0.0000 - 9.3617 0.0000 - 10.8310 0.0000 - 13.7460 0.0000 - 17.0707 0.0000 - - - -91.8798 1.0000 - -91.4249 1.0000 - -91.2898 1.0000 - -65.7451 1.0000 - -30.0619 1.0000 - -30.0509 1.0000 - -29.8097 1.0000 - 1.2859 1.0000 - 2.1702 1.0000 - 3.8990 1.0000 - 4.0390 1.0000 - 6.7652 1.0000 - 6.9729 1.0000 - 8.8041 0.0000 - 9.3315 0.0000 - 10.7166 0.0000 - 13.6320 0.0000 - 16.7501 0.0000 - - - -91.8804 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7464 1.0000 - -30.0175 1.0000 - -29.9844 1.0000 - -29.8488 1.0000 - -1.7370 1.0000 - 4.4422 1.0000 - 4.8585 1.0000 - 6.0714 1.0000 - 6.4466 1.0000 - 8.2302 0.0000 - 8.3749 0.0000 - 9.1175 0.0000 - 9.2619 0.0000 - 14.1349 0.0000 - 15.4013 0.0000 - - - -91.8799 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7463 1.0000 - -30.0195 1.0000 - -29.9841 1.0000 - -29.8486 1.0000 - -1.6861 1.0000 - 4.3659 1.0000 - 4.8534 1.0000 - 5.9862 1.0000 - 6.3903 1.0000 - 8.0854 0.0021 - 8.4524 0.0000 - 9.1354 0.0000 - 9.5120 0.0000 - 14.3643 0.0000 - 15.3071 0.0000 - - - -91.8803 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7463 1.0000 - -30.0256 1.0000 - -29.9835 1.0000 - -29.8481 1.0000 - -1.5384 1.0000 - 4.0964 1.0000 - 4.8387 1.0000 - 5.8780 1.0000 - 6.2244 1.0000 - 7.8814 0.5077 - 8.4118 0.0000 - 9.4051 0.0000 - 10.0237 0.0000 - 14.7831 0.0000 - 15.5390 0.0000 - - - -91.8800 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7461 1.0000 - -30.0342 1.0000 - -29.9826 1.0000 - -29.8473 1.0000 - -1.2961 1.0000 - 3.6243 1.0000 - 4.8224 1.0000 - 5.8880 1.0000 - 5.9794 1.0000 - 7.7697 0.9451 - 8.2240 0.0000 - 9.9152 0.0000 - 10.6017 0.0000 - 14.8981 0.0000 - 15.7528 0.0000 - - - -91.8798 1.0000 - -91.4247 1.0000 - -91.2897 1.0000 - -65.7459 1.0000 - -30.0442 1.0000 - -29.9816 1.0000 - -29.8464 1.0000 - -0.9701 1.0000 - 3.0306 1.0000 - 4.8098 1.0000 - 5.7145 1.0000 - 5.9645 1.0000 - 7.7405 0.9779 - 8.1068 0.0008 - 10.4758 0.0000 - 11.1795 0.0000 - 14.4320 0.0000 - 15.4052 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7457 1.0000 - -30.0538 1.0000 - -29.9807 1.0000 - -29.8456 1.0000 - -0.5710 1.0000 - 2.3983 1.0000 - 4.8012 1.0000 - 5.4818 1.0000 - 6.0144 1.0000 - 7.7545 0.9652 - 8.1644 0.0000 - 11.0095 0.0000 - 11.7243 0.0000 - 13.7286 0.0000 - 15.7410 0.0000 - - - -91.8806 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7456 1.0000 - -30.0614 1.0000 - -29.9799 1.0000 - -29.8449 1.0000 - -0.1177 1.0000 - 1.7781 1.0000 - 4.7964 1.0000 - 5.3133 1.0000 - 6.0112 1.0000 - 7.7807 0.9256 - 8.3693 0.0000 - 11.4739 0.0000 - 12.2127 0.0000 - 12.9109 0.0000 - 14.6649 0.0000 - - - -91.8817 1.0000 - -91.4266 1.0000 - -91.2916 1.0000 - -65.7457 1.0000 - -30.0656 1.0000 - -29.9796 1.0000 - -29.8446 1.0000 - 0.3197 1.0000 - 1.2526 1.0000 - 4.7946 1.0000 - 5.2255 1.0000 - 5.9923 1.0000 - 7.7988 0.8824 - 8.5626 0.0000 - 11.8394 0.0000 - 12.3313 0.0000 - 12.5446 0.0000 - 14.3190 0.0000 - - - -91.8800 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7463 1.0000 - -30.0172 1.0000 - -29.9873 1.0000 - -29.8485 1.0000 - -1.6849 1.0000 - 4.4076 1.0000 - 4.8483 1.0000 - 6.0207 1.0000 - 6.2826 1.0000 - 8.0528 0.0081 - 8.5353 0.0000 - 9.2108 0.0000 - 9.3896 0.0000 - 14.3918 0.0000 - 15.3197 0.0000 - - - -91.8797 1.0000 - -91.4246 1.0000 - -91.2896 1.0000 - -65.7463 1.0000 - -30.0193 1.0000 - -29.9870 1.0000 - -29.8483 1.0000 - -1.6339 1.0000 - 4.3516 1.0000 - 4.8346 1.0000 - 5.7996 1.0000 - 6.4178 1.0000 - 7.7836 0.9196 - 8.8250 0.0000 - 9.1722 0.0000 - 9.5353 0.0000 - 14.5019 0.0000 - 15.3716 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7462 1.0000 - -30.0253 1.0000 - -29.9865 1.0000 - -29.8478 1.0000 - -1.4861 1.0000 - 4.1162 1.0000 - 4.7981 1.0000 - 5.5891 1.0000 - 6.4356 1.0000 - 7.5244 1.0000 - 8.7710 0.0000 - 9.5148 0.0000 - 9.9362 0.0000 - 15.1352 0.0000 - 15.4072 0.0000 - - - -91.8803 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7460 1.0000 - -30.0340 1.0000 - -29.9857 1.0000 - -29.8470 1.0000 - -1.2446 1.0000 - 3.6518 1.0000 - 4.7706 1.0000 - 5.5402 1.0000 - 6.2682 1.0000 - 7.4667 1.0000 - 8.5007 0.0000 - 10.0751 0.0000 - 10.4593 0.0000 - 14.9293 0.0000 - 15.7909 0.0000 - - - -91.8800 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7458 1.0000 - -30.0439 1.0000 - -29.9846 1.0000 - -29.8461 1.0000 - -0.9180 1.0000 - 3.0555 1.0000 - 4.7621 1.0000 - 5.5144 1.0000 - 6.0975 1.0000 - 7.5228 1.0000 - 8.3066 0.0000 - 10.6374 0.0000 - 11.0036 0.0000 - 14.3882 0.0000 - 15.7788 0.0000 - - - -91.8803 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7457 1.0000 - -30.0536 1.0000 - -29.9837 1.0000 - -29.8453 1.0000 - -0.5188 1.0000 - 2.4214 1.0000 - 4.7659 1.0000 - 5.3939 1.0000 - 6.0417 1.0000 - 7.5977 1.0000 - 8.2829 0.0000 - 11.1508 0.0000 - 11.5105 0.0000 - 13.7183 0.0000 - 14.9755 0.0000 - - - -91.8811 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7456 1.0000 - -30.0611 1.0000 - -29.9830 1.0000 - -29.8447 1.0000 - -0.0651 1.0000 - 1.8001 1.0000 - 4.7789 1.0000 - 5.2458 1.0000 - 6.0321 1.0000 - 7.6461 0.9996 - 8.4238 0.0000 - 11.5584 0.0000 - 11.9266 0.0000 - 13.0831 0.0000 - 15.6069 0.0000 - - - -91.8817 1.0000 - -91.4266 1.0000 - -91.2916 1.0000 - -65.7456 1.0000 - -30.0653 1.0000 - -29.9826 1.0000 - -29.8443 1.0000 - 0.3795 1.0000 - 1.2691 1.0000 - 4.7936 1.0000 - 5.1515 1.0000 - 6.0240 1.0000 - 7.6686 0.9988 - 8.5805 0.0000 - 11.7779 0.0000 - 12.1352 0.0000 - 12.7618 0.0000 - 14.3597 0.0000 - - - -91.8797 1.0000 - -91.4246 1.0000 - -91.2897 1.0000 - -65.7461 1.0000 - -30.0163 1.0000 - -29.9957 1.0000 - -29.8477 1.0000 - -1.5268 1.0000 - 4.2431 1.0000 - 4.8102 1.0000 - 5.8696 1.0000 - 6.0346 1.0000 - 7.8110 0.8450 - 8.5785 0.0000 - 9.3930 0.0000 - 9.9093 0.0000 - 14.8181 0.0000 - 15.3992 0.0000 - - - -91.8800 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7461 1.0000 - -30.0184 1.0000 - -29.9955 1.0000 - -29.8475 1.0000 - -1.4775 1.0000 - 4.2438 1.0000 - 4.7542 1.0000 - 5.5293 1.0000 - 6.3522 1.0000 - 7.5150 1.0000 - 8.8801 0.0000 - 9.4592 0.0000 - 9.8752 0.0000 - 15.2792 0.0000 - 15.6628 0.0000 - - - -91.8804 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7460 1.0000 - -30.0244 1.0000 - -29.9950 1.0000 - -29.8470 1.0000 - -1.3299 1.0000 - 4.1576 1.0000 - 4.5679 1.0000 - 5.2979 1.0000 - 6.6150 1.0000 - 7.0904 1.0000 - 9.1579 0.0000 - 9.5750 0.0000 - 10.0825 0.0000 - 15.1794 0.0000 - 15.4777 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7459 1.0000 - -30.0332 1.0000 - -29.9941 1.0000 - -29.8463 1.0000 - -1.0889 1.0000 - 3.7247 1.0000 - 4.5126 1.0000 - 5.2739 1.0000 - 6.5053 1.0000 - 7.0116 1.0000 - 8.9177 0.0000 - 10.0553 0.0000 - 10.5390 0.0000 - 14.9488 0.0000 - 15.7735 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7457 1.0000 - -30.0432 1.0000 - -29.9932 1.0000 - -29.8454 1.0000 - -0.7637 1.0000 - 3.1184 1.0000 - 4.5570 1.0000 - 5.2947 1.0000 - 6.2309 1.0000 - 7.1569 1.0000 - 8.6614 0.0000 - 10.5778 0.0000 - 11.0215 0.0000 - 14.3672 0.0000 - 16.4135 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7455 1.0000 - -30.0528 1.0000 - -29.9922 1.0000 - -29.8445 1.0000 - -0.3665 1.0000 - 2.4849 1.0000 - 4.6192 1.0000 - 5.2403 1.0000 - 6.0991 1.0000 - 7.2727 1.0000 - 8.5350 0.0000 - 11.0432 0.0000 - 11.4229 0.0000 - 13.8722 0.0000 - 15.2253 0.0000 - - - -91.8809 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7454 1.0000 - -30.0603 1.0000 - -29.9915 1.0000 - -29.8439 1.0000 - 0.0883 1.0000 - 1.8666 1.0000 - 4.6927 1.0000 - 5.1041 1.0000 - 6.0902 1.0000 - 7.3348 1.0000 - 8.5545 0.0000 - 11.3690 0.0000 - 11.6761 0.0000 - 13.4279 0.0000 - 14.9423 0.0000 - - - -91.8813 1.0000 - -91.4263 1.0000 - -91.2913 1.0000 - -65.7454 1.0000 - -30.0645 1.0000 - -29.9911 1.0000 - -29.8436 1.0000 - 0.5523 1.0000 - 1.3197 1.0000 - 4.7737 1.0000 - 4.9700 1.0000 - 6.1067 1.0000 - 7.3584 1.0000 - 8.6259 0.0000 - 11.4672 0.0000 - 11.8083 0.0000 - 13.3060 0.0000 - 14.7773 0.0000 - - - -91.8804 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7459 1.0000 - -30.0150 1.0000 - -30.0082 1.0000 - -29.8466 1.0000 - -1.2712 1.0000 - 3.8438 1.0000 - 4.7684 1.0000 - 5.6401 1.0000 - 5.9574 1.0000 - 7.6738 0.9984 - 8.3685 0.0000 - 9.9037 0.0000 - 10.4726 0.0000 - 15.0041 0.0000 - 15.6011 0.0000 - - - -91.8803 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7459 1.0000 - -30.0172 1.0000 - -30.0079 1.0000 - -29.8464 1.0000 - -1.2218 1.0000 - 3.8708 1.0000 - 4.6756 1.0000 - 5.4045 1.0000 - 6.1889 1.0000 - 7.4347 1.0000 - 8.5911 0.0000 - 10.0325 0.0000 - 10.3726 0.0000 - 14.9251 0.0000 - 15.8940 0.0000 - - - -91.8801 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7457 1.0000 - -30.0231 1.0000 - -30.0074 1.0000 - -29.8459 1.0000 - -1.0751 1.0000 - 3.9445 1.0000 - 4.3254 1.0000 - 5.2342 1.0000 - 6.4457 1.0000 - 7.0265 1.0000 - 8.9822 0.0000 - 9.9608 0.0000 - 10.5366 0.0000 - 15.3724 0.0000 - 16.2209 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7456 1.0000 - -30.0320 1.0000 - -30.0066 1.0000 - -29.8451 1.0000 - -0.8371 1.0000 - 3.7696 1.0000 - 4.0713 1.0000 - 5.2102 1.0000 - 6.5202 1.0000 - 6.7576 1.0000 - 9.2256 0.0000 - 9.8208 0.0000 - 10.9794 0.0000 - 14.6872 0.0000 - 16.0115 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7454 1.0000 - -30.0420 1.0000 - -30.0056 1.0000 - -29.8442 1.0000 - -0.5159 1.0000 - 3.1732 1.0000 - 4.2009 1.0000 - 5.2095 1.0000 - 6.2786 1.0000 - 6.8561 1.0000 - 9.0363 0.0000 - 10.1403 0.0000 - 11.3532 0.0000 - 14.1947 0.0000 - 15.7790 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2902 1.0000 - -65.7452 1.0000 - -30.0516 1.0000 - -30.0047 1.0000 - -29.8434 1.0000 - -0.1232 1.0000 - 2.5651 1.0000 - 4.3406 1.0000 - 5.1419 1.0000 - 6.1556 1.0000 - 6.9535 1.0000 - 8.8219 0.0000 - 10.5329 0.0000 - 11.5193 0.0000 - 13.9904 0.0000 - 15.7124 0.0000 - - - -91.8806 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7451 1.0000 - -30.0592 1.0000 - -30.0040 1.0000 - -29.8427 1.0000 - 0.3259 1.0000 - 1.9702 1.0000 - 4.4841 1.0000 - 4.9917 1.0000 - 6.1733 1.0000 - 7.0010 1.0000 - 8.7133 0.0000 - 10.8431 0.0000 - 11.4585 0.0000 - 13.9770 0.0000 - 15.7545 0.0000 - - - -91.8804 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7450 1.0000 - -30.0633 1.0000 - -30.0036 1.0000 - -29.8424 1.0000 - 0.8108 1.0000 - 1.4140 1.0000 - 4.6313 1.0000 - 4.8202 1.0000 - 6.2227 1.0000 - 7.0116 1.0000 - 8.6872 0.0000 - 11.0198 0.0000 - 11.3364 0.0000 - 14.1763 0.0000 - 15.9685 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7456 1.0000 - -30.0224 1.0000 - -30.0136 1.0000 - -29.8453 1.0000 - -0.9268 1.0000 - 3.2623 1.0000 - 4.7464 1.0000 - 5.3834 1.0000 - 5.9960 1.0000 - 7.6341 0.9998 - 8.2611 0.0000 - 10.4569 0.0000 - 11.0184 0.0000 - 14.2330 0.0000 - 15.5535 0.0000 - - - -91.8807 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7456 1.0000 - -30.0222 1.0000 - -30.0157 1.0000 - -29.8451 1.0000 - -0.8773 1.0000 - 3.2832 1.0000 - 4.6571 1.0000 - 5.2991 1.0000 - 6.0714 1.0000 - 7.4689 1.0000 - 8.4217 0.0000 - 10.5908 0.0000 - 10.8787 0.0000 - 14.2953 0.0000 - 16.5961 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7455 1.0000 - -30.0218 1.0000 - -30.0216 1.0000 - -29.8446 1.0000 - -0.7317 1.0000 - 3.3310 1.0000 - 4.3786 1.0000 - 5.2110 1.0000 - 6.1851 1.0000 - 7.1526 1.0000 - 8.7615 0.0000 - 10.4513 0.0000 - 10.9940 0.0000 - 14.2699 0.0000 - 15.4567 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7453 1.0000 - -30.0306 1.0000 - -30.0209 1.0000 - -29.8438 1.0000 - -0.4981 1.0000 - 3.3273 1.0000 - 4.0470 1.0000 - 5.1832 1.0000 - 6.2401 1.0000 - 6.8777 1.0000 - 9.1353 0.0000 - 10.0431 0.0000 - 11.3235 0.0000 - 14.1794 0.0000 - 15.5671 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7451 1.0000 - -30.0407 1.0000 - -30.0200 1.0000 - -29.8429 1.0000 - -0.1859 1.0000 - 3.0693 1.0000 - 3.9456 1.0000 - 5.1491 1.0000 - 6.2051 1.0000 - 6.7650 1.0000 - 9.2971 0.0000 - 9.8622 0.0000 - 11.4431 0.0000 - 14.0899 0.0000 - 16.4426 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7449 1.0000 - -30.0503 1.0000 - -30.0191 1.0000 - -29.8421 1.0000 - 0.1920 1.0000 - 2.6071 1.0000 - 4.0528 1.0000 - 5.0472 1.0000 - 6.1874 1.0000 - 6.7639 1.0000 - 9.0797 0.0000 - 10.0903 0.0000 - 11.2974 0.0000 - 14.2166 0.0000 - 15.6033 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7448 1.0000 - -30.0579 1.0000 - -30.0184 1.0000 - -29.8414 1.0000 - 0.6211 1.0000 - 2.0968 1.0000 - 4.2164 1.0000 - 4.8791 1.0000 - 6.2614 1.0000 - 6.7657 1.0000 - 8.8662 0.0000 - 10.3491 0.0000 - 11.0306 0.0000 - 14.4108 0.0000 - 15.3788 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7447 1.0000 - -30.0620 1.0000 - -30.0180 1.0000 - -29.8411 1.0000 - 1.0880 1.0000 - 1.5873 1.0000 - 4.3747 1.0000 - 4.7100 1.0000 - 6.3575 1.0000 - 6.7421 1.0000 - 8.7550 0.0000 - 10.5500 0.0000 - 10.7906 0.0000 - 14.5624 0.0000 - 15.1655 0.0000 - - - -91.8811 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7454 1.0000 - -30.0360 1.0000 - -30.0122 1.0000 - -29.8440 1.0000 - -0.5057 1.0000 - 2.6136 1.0000 - 4.7370 1.0000 - 5.1523 1.0000 - 6.0130 1.0000 - 7.6494 0.9995 - 8.3935 0.0000 - 10.9701 0.0000 - 11.5187 0.0000 - 13.5916 0.0000 - 15.0632 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7453 1.0000 - -30.0358 1.0000 - -30.0143 1.0000 - -29.8438 1.0000 - -0.4569 1.0000 - 2.6313 1.0000 - 4.6641 1.0000 - 5.1321 1.0000 - 6.0295 1.0000 - 7.5280 1.0000 - 8.4922 0.0000 - 11.0888 0.0000 - 11.3355 0.0000 - 13.6775 0.0000 - 15.0131 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2907 1.0000 - -65.7452 1.0000 - -30.0353 1.0000 - -30.0204 1.0000 - -29.8433 1.0000 - -0.3133 1.0000 - 2.6752 1.0000 - 4.4540 1.0000 - 5.1041 1.0000 - 6.0697 1.0000 - 7.2554 1.0000 - 8.7315 0.0000 - 10.8888 0.0000 - 11.3448 0.0000 - 13.6890 0.0000 - 15.8847 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7450 1.0000 - -30.0345 1.0000 - -30.0292 1.0000 - -29.8426 1.0000 - -0.0859 1.0000 - 2.7166 1.0000 - 4.1804 1.0000 - 5.0770 1.0000 - 6.1163 1.0000 - 6.9765 1.0000 - 9.0212 0.0000 - 10.3917 0.0000 - 11.4336 0.0000 - 13.9055 0.0000 - 15.2813 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7448 1.0000 - -30.0394 1.0000 - -30.0336 1.0000 - -29.8417 1.0000 - 0.2123 1.0000 - 2.6878 1.0000 - 3.9634 1.0000 - 5.0147 1.0000 - 6.1592 1.0000 - 6.7920 1.0000 - 9.2662 0.0000 - 9.9512 0.0000 - 11.2415 0.0000 - 14.1593 0.0000 - 15.4866 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7446 1.0000 - -30.0491 1.0000 - -30.0327 1.0000 - -29.8408 1.0000 - 0.5609 1.0000 - 2.5137 1.0000 - 3.9070 1.0000 - 4.8851 1.0000 - 6.2238 1.0000 - 6.7173 1.0000 - 9.2451 0.0000 - 9.8021 0.0000 - 10.8954 0.0000 - 14.4228 0.0000 - 16.8868 0.0000 - - - -91.8798 1.0000 - -91.4247 1.0000 - -91.2897 1.0000 - -65.7444 1.0000 - -30.0566 1.0000 - -30.0320 1.0000 - -29.8402 1.0000 - 0.9361 1.0000 - 2.2131 1.0000 - 3.9968 1.0000 - 4.7012 1.0000 - 6.3401 1.0000 - 6.6831 1.0000 - 8.9915 0.0000 - 9.9352 0.0000 - 10.5511 0.0000 - 14.6648 0.0000 - 16.6490 0.0000 - - - -91.8799 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7444 1.0000 - -30.0607 1.0000 - -30.0317 1.0000 - -29.8398 1.0000 - 1.2854 1.0000 - 1.8883 1.0000 - 4.1342 1.0000 - 4.5244 1.0000 - 6.4820 1.0000 - 6.6213 1.0000 - 8.8197 0.0000 - 10.0947 0.0000 - 10.2879 0.0000 - 14.4258 0.0000 - 16.1813 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7451 1.0000 - -30.0466 1.0000 - -30.0111 1.0000 - -29.8430 1.0000 - -0.0307 1.0000 - 1.9718 1.0000 - 4.7340 1.0000 - 4.9824 1.0000 - 5.9781 1.0000 - 7.6817 0.9978 - 8.7276 0.0000 - 11.3873 0.0000 - 11.9478 0.0000 - 12.7854 0.0000 - 23.9436 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7451 1.0000 - -30.0464 1.0000 - -30.0132 1.0000 - -29.8428 1.0000 - 0.0185 1.0000 - 1.9888 1.0000 - 4.6859 1.0000 - 4.9653 1.0000 - 5.9970 1.0000 - 7.5729 1.0000 - 8.7751 0.0000 - 11.4491 0.0000 - 11.7029 0.0000 - 13.0190 0.0000 - 14.7782 0.0000 - - - -91.8812 1.0000 - -91.4262 1.0000 - -91.2911 1.0000 - -65.7450 1.0000 - -30.0459 1.0000 - -30.0193 1.0000 - -29.8423 1.0000 - 0.1624 1.0000 - 2.0359 1.0000 - 4.5378 1.0000 - 4.9360 1.0000 - 6.0484 1.0000 - 7.3135 1.0000 - 8.8969 0.0000 - 11.2099 0.0000 - 11.4930 0.0000 - 13.3525 0.0000 - 14.7482 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7448 1.0000 - -30.0451 1.0000 - -30.0282 1.0000 - -29.8416 1.0000 - 0.3853 1.0000 - 2.1069 1.0000 - 4.3253 1.0000 - 4.8953 1.0000 - 6.1228 1.0000 - 7.0290 1.0000 - 9.0504 0.0000 - 10.6735 0.0000 - 11.2840 0.0000 - 13.8208 0.0000 - 15.4677 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7446 1.0000 - -30.0442 1.0000 - -30.0384 1.0000 - -29.8407 1.0000 - 0.6619 1.0000 - 2.1867 1.0000 - 4.1117 1.0000 - 4.8111 1.0000 - 6.2095 1.0000 - 6.8181 1.0000 - 9.1919 0.0000 - 10.1602 0.0000 - 10.8993 0.0000 - 15.1026 0.0000 - 15.8962 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7444 1.0000 - -30.0481 1.0000 - -30.0434 1.0000 - -29.8399 1.0000 - 0.9577 1.0000 - 2.2499 1.0000 - 3.9565 1.0000 - 4.6608 1.0000 - 6.3079 1.0000 - 6.7191 1.0000 - 9.2475 0.0000 - 9.7542 0.0000 - 10.4853 0.0000 - 14.4236 0.0000 - 15.9769 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2900 1.0000 - -65.7442 1.0000 - -30.0556 1.0000 - -30.0428 1.0000 - -29.8392 1.0000 - 1.2239 1.0000 - 2.2689 1.0000 - 3.9080 1.0000 - 4.4598 1.0000 - 6.4254 1.0000 - 6.6915 1.0000 - 9.0705 0.0000 - 9.6405 0.0000 - 10.1444 0.0000 - 14.3430 0.0000 - 17.2812 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7442 1.0000 - -30.0598 1.0000 - -30.0424 1.0000 - -29.8388 1.0000 - 1.3946 1.0000 - 2.2508 1.0000 - 3.9615 1.0000 - 4.2707 1.0000 - 6.5390 1.0000 - 6.6669 1.0000 - 8.8711 0.0000 - 9.6833 0.0000 - 9.9342 0.0000 - 14.2821 0.0000 - 16.8667 0.0000 - - - -91.8809 1.0000 - -91.4260 1.0000 - -91.2909 1.0000 - -65.7450 1.0000 - -30.0524 1.0000 - -30.0105 1.0000 - -29.8425 1.0000 - 0.4229 1.0000 - 1.4332 1.0000 - 4.7335 1.0000 - 4.8932 1.0000 - 5.9406 1.0000 - 7.7046 0.9941 - 9.0485 0.0000 - 11.6113 0.0000 - 12.2365 0.0000 - 12.4166 0.0000 - 14.4069 0.0000 - - - -91.8809 1.0000 - -91.4260 1.0000 - -91.2909 1.0000 - -65.7450 1.0000 - -30.0522 1.0000 - -30.0126 1.0000 - -29.8423 1.0000 - 0.4791 1.0000 - 1.4433 1.0000 - 4.7207 1.0000 - 4.8490 1.0000 - 5.9697 1.0000 - 7.5985 1.0000 - 9.0623 0.0000 - 11.5449 0.0000 - 11.9351 0.0000 - 12.6346 0.0000 - 14.4028 0.0000 - - - -91.8811 1.0000 - -91.4262 1.0000 - -91.2911 1.0000 - -65.7449 1.0000 - -30.0517 1.0000 - -30.0187 1.0000 - -29.8418 1.0000 - 0.6406 1.0000 - 1.4754 1.0000 - 4.6393 1.0000 - 4.7744 1.0000 - 6.0463 1.0000 - 7.3409 1.0000 - 9.0974 0.0000 - 11.2685 0.0000 - 11.5426 0.0000 - 13.2087 0.0000 - 14.4572 0.0000 - - - -91.8808 1.0000 - -91.4259 1.0000 - -91.2908 1.0000 - -65.7447 1.0000 - -30.0509 1.0000 - -30.0276 1.0000 - -29.8411 1.0000 - 0.8849 1.0000 - 1.5379 1.0000 - 4.4679 1.0000 - 4.7154 1.0000 - 6.1524 1.0000 - 7.0495 1.0000 - 9.1423 0.0000 - 10.8507 0.0000 - 11.0603 0.0000 - 14.0298 0.0000 - 14.7766 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2911 1.0000 - -65.7445 1.0000 - -30.0501 1.0000 - -30.0378 1.0000 - -29.8402 1.0000 - 1.1502 1.0000 - 1.6634 1.0000 - 4.2778 1.0000 - 4.6118 1.0000 - 6.2733 1.0000 - 6.8222 1.0000 - 9.1840 0.0000 - 10.3474 0.0000 - 10.5871 0.0000 - 14.4557 0.0000 - 15.2545 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7443 1.0000 - -30.0493 1.0000 - -30.0475 1.0000 - -29.8393 1.0000 - 1.3315 1.0000 - 1.9197 1.0000 - 4.1103 1.0000 - 4.4350 1.0000 - 6.3954 1.0000 - 6.7111 1.0000 - 9.1975 0.0000 - 9.8332 0.0000 - 10.1952 0.0000 - 14.3744 0.0000 - 15.8908 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7441 1.0000 - -30.0551 1.0000 - -30.0487 1.0000 - -29.8387 1.0000 - 1.4141 1.0000 - 2.2587 1.0000 - 3.9834 1.0000 - 4.2083 1.0000 - 6.5037 1.0000 - 6.7025 1.0000 - 9.0928 0.0000 - 9.5006 0.0000 - 9.9082 0.0000 - 14.2642 0.0000 - 16.9205 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7441 1.0000 - -30.0593 1.0000 - -30.0483 1.0000 - -29.8383 1.0000 - 1.4457 1.0000 - 2.5199 1.0000 - 3.9004 1.0000 - 4.0331 1.0000 - 6.5737 1.0000 - 6.7304 1.0000 - 8.8995 0.0000 - 9.4301 0.0000 - 9.7525 0.0000 - 14.2685 0.0000 - 34.2814 0.0000 - - - -91.8795 1.0000 - -91.4244 1.0000 - -91.2894 1.0000 - -65.7449 1.0000 - -30.0129 1.0000 - -29.9797 1.0000 - -29.8895 1.0000 - -1.4187 1.0000 - 4.4601 1.0000 - 4.6731 1.0000 - 5.6743 1.0000 - 5.9932 1.0000 - 8.1576 0.0001 - 8.3102 0.0000 - 9.3878 0.0000 - 9.5739 0.0000 - 14.6169 0.0000 - 15.2950 0.0000 - - - -91.8800 1.0000 - -91.4249 1.0000 - -91.2900 1.0000 - -65.7449 1.0000 - -30.0151 1.0000 - -29.9795 1.0000 - -29.8894 1.0000 - -1.3679 1.0000 - 4.3898 1.0000 - 4.6848 1.0000 - 5.5775 1.0000 - 5.9882 1.0000 - 8.0710 0.0039 - 8.3358 0.0000 - 9.2963 0.0000 - 9.8808 0.0000 - 14.7640 0.0000 - 15.2851 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7447 1.0000 - -30.0211 1.0000 - -29.9789 1.0000 - -29.8889 1.0000 - -1.2205 1.0000 - 4.1260 1.0000 - 4.7341 1.0000 - 5.4333 1.0000 - 5.9646 1.0000 - 7.6673 0.9988 - 8.7032 0.0000 - 9.1336 0.0000 - 10.4886 0.0000 - 14.8840 0.0000 - 16.1247 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2897 1.0000 - -65.7446 1.0000 - -30.0299 1.0000 - -29.9782 1.0000 - -29.8882 1.0000 - -0.9808 1.0000 - 3.6652 1.0000 - 4.7987 1.0000 - 5.3993 1.0000 - 5.9001 1.0000 - 7.3364 1.0000 - 8.6839 0.0000 - 9.4310 0.0000 - 11.1616 0.0000 - 14.7250 0.0000 - 16.1963 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2899 1.0000 - -65.7444 1.0000 - -30.0400 1.0000 - -29.9771 1.0000 - -29.8874 1.0000 - -0.6587 1.0000 - 3.0989 1.0000 - 4.8498 1.0000 - 5.4590 1.0000 - 5.7806 1.0000 - 7.1397 1.0000 - 8.5209 0.0000 - 9.9588 0.0000 - 11.8236 0.0000 - 14.2014 0.0000 - 16.2147 0.0000 - - - -91.8801 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7442 1.0000 - -30.0497 1.0000 - -29.9762 1.0000 - -29.8866 1.0000 - -0.2656 1.0000 - 2.4987 1.0000 - 4.8835 1.0000 - 5.5379 1.0000 - 5.6319 1.0000 - 7.0597 1.0000 - 8.4828 0.0000 - 10.4687 0.0000 - 12.4416 0.0000 - 13.3290 0.0000 - 15.1337 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7441 1.0000 - -30.0573 1.0000 - -29.9754 1.0000 - -29.8860 1.0000 - 0.1849 1.0000 - 1.9035 1.0000 - 4.9056 1.0000 - 5.5030 1.0000 - 5.5861 1.0000 - 7.0432 1.0000 - 8.5758 0.0000 - 10.9253 0.0000 - 12.5527 0.0000 - 13.0088 0.0000 - 14.8073 0.0000 - - - -91.8812 1.0000 - -91.4261 1.0000 - -91.2912 1.0000 - -65.7441 1.0000 - -30.0615 1.0000 - -29.9750 1.0000 - -29.8857 1.0000 - 0.6491 1.0000 - 1.3651 1.0000 - 4.9176 1.0000 - 5.4303 1.0000 - 5.6017 1.0000 - 7.0458 1.0000 - 8.6931 0.0000 - 11.3271 0.0000 - 11.9366 0.0000 - 13.5779 0.0000 - 14.3517 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7449 1.0000 - -30.0127 1.0000 - -29.9828 1.0000 - -29.8893 1.0000 - -1.3666 1.0000 - 4.4223 1.0000 - 4.6934 1.0000 - 5.6697 1.0000 - 5.8285 1.0000 - 8.0271 0.0206 - 8.3692 0.0000 - 9.4509 0.0000 - 9.7370 0.0000 - 14.9651 0.0000 - 15.3421 0.0000 - - - -91.8801 1.0000 - -91.4250 1.0000 - -91.2901 1.0000 - -65.7448 1.0000 - -30.0148 1.0000 - -29.9826 1.0000 - -29.8892 1.0000 - -1.3163 1.0000 - 4.3772 1.0000 - 4.7020 1.0000 - 5.4537 1.0000 - 5.9491 1.0000 - 7.7861 0.9142 - 8.5756 0.0000 - 9.5058 0.0000 - 9.8346 0.0000 - 15.0595 0.0000 - 16.2568 0.0000 - - - -91.8797 1.0000 - -91.4246 1.0000 - -91.2896 1.0000 - -65.7447 1.0000 - -30.0208 1.0000 - -29.9819 1.0000 - -29.8886 1.0000 - -1.1678 1.0000 - 4.1541 1.0000 - 4.7483 1.0000 - 5.2311 1.0000 - 6.0125 1.0000 - 7.4085 1.0000 - 8.9608 0.0000 - 9.3188 0.0000 - 10.3531 0.0000 - 15.1264 0.0000 - 15.6355 0.0000 - - - -91.8797 1.0000 - -91.4247 1.0000 - -91.2897 1.0000 - -65.7445 1.0000 - -30.0296 1.0000 - -29.9811 1.0000 - -29.8879 1.0000 - -0.9290 1.0000 - 3.7034 1.0000 - 4.8102 1.0000 - 5.1970 1.0000 - 5.9664 1.0000 - 7.1173 1.0000 - 8.9157 0.0000 - 9.5830 0.0000 - 14.0696 0.0000 - 15.5381 0.0000 - 16.0450 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7443 1.0000 - -30.0398 1.0000 - -29.9802 1.0000 - -29.8871 1.0000 - -0.6068 1.0000 - 3.1346 1.0000 - 4.8473 1.0000 - 5.3098 1.0000 - 5.8138 1.0000 - 6.9753 1.0000 - 8.6937 0.0000 - 10.0930 0.0000 - 11.5987 0.0000 - 14.2851 0.0000 - 15.4916 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7442 1.0000 - -30.0495 1.0000 - -29.9792 1.0000 - -29.8864 1.0000 - -0.2132 1.0000 - 2.5322 1.0000 - 4.8734 1.0000 - 5.4530 1.0000 - 5.6251 1.0000 - 6.9349 1.0000 - 8.5950 0.0000 - 10.5671 0.0000 - 12.1071 0.0000 - 13.6101 0.0000 - 15.2056 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7441 1.0000 - -30.0571 1.0000 - -29.9785 1.0000 - -29.8858 1.0000 - 0.2373 1.0000 - 1.9361 1.0000 - 4.9016 1.0000 - 5.4135 1.0000 - 5.6118 1.0000 - 6.9300 1.0000 - 8.6308 0.0000 - 10.9545 0.0000 - 12.2321 0.0000 - 13.3411 0.0000 - 14.6028 0.0000 - - - -91.8813 1.0000 - -91.4262 1.0000 - -91.2912 1.0000 - -65.7440 1.0000 - -30.0612 1.0000 - -29.9781 1.0000 - -29.8855 1.0000 - 0.7080 1.0000 - 1.3914 1.0000 - 4.9262 1.0000 - 5.3148 1.0000 - 5.6677 1.0000 - 6.9317 1.0000 - 8.7105 0.0000 - 11.2069 0.0000 - 11.9941 0.0000 - 13.6247 0.0000 - 14.2566 0.0000 - - - -91.8801 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7447 1.0000 - -30.0118 1.0000 - -29.9913 1.0000 - -29.8886 1.0000 - -1.2087 1.0000 - 4.2480 1.0000 - 4.7537 1.0000 - 5.5479 1.0000 - 5.6464 1.0000 - 7.5854 1.0000 - 8.8369 0.0000 - 9.1686 0.0000 - 10.3783 0.0000 - 15.1703 0.0000 - 16.5372 0.0000 - - - -91.8799 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7446 1.0000 - -30.0140 1.0000 - -29.9911 1.0000 - -29.8884 1.0000 - -1.1599 1.0000 - 4.2600 1.0000 - 4.7624 1.0000 - 5.1876 1.0000 - 5.8950 1.0000 - 7.3708 1.0000 - 9.0334 0.0000 - 9.3519 0.0000 - 10.2679 0.0000 - 15.3111 0.0000 - 15.6587 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7445 1.0000 - -30.0200 1.0000 - -29.9906 1.0000 - -29.8880 1.0000 - -1.0132 1.0000 - 4.2030 1.0000 - 4.7943 1.0000 - 4.8011 1.0000 - 6.0641 1.0000 - 6.9806 1.0000 - 9.4178 0.0000 - 9.6455 0.0000 - 10.1655 0.0000 - 15.5541 0.0000 - 16.0175 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7444 1.0000 - -30.0289 1.0000 - -29.9897 1.0000 - -29.8872 1.0000 - -0.7738 1.0000 - 3.8102 1.0000 - 4.7014 1.0000 - 4.8920 1.0000 - 6.0747 1.0000 - 6.6867 1.0000 - 9.3773 0.0000 - 9.9364 0.0000 - 10.5923 0.0000 - 15.0458 0.0000 - 15.9243 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7441 1.0000 - -30.0390 1.0000 - -29.9887 1.0000 - -29.8864 1.0000 - -0.4528 1.0000 - 3.2344 1.0000 - 4.7338 1.0000 - 5.0752 1.0000 - 5.8733 1.0000 - 6.6224 1.0000 - 9.0753 0.0000 - 10.3673 0.0000 - 11.1413 0.0000 - 14.3495 0.0000 - 16.6028 0.0000 - - - -91.8801 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7440 1.0000 - -30.0487 1.0000 - -29.9878 1.0000 - -29.8857 1.0000 - -0.0611 1.0000 - 2.6291 1.0000 - 4.7819 1.0000 - 5.2693 1.0000 - 5.6458 1.0000 - 6.6483 1.0000 - 8.8604 0.0000 - 10.6806 0.0000 - 11.6275 0.0000 - 13.8130 0.0000 - 15.2714 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7438 1.0000 - -30.0563 1.0000 - -29.9871 1.0000 - -29.8850 1.0000 - 0.3892 1.0000 - 2.0335 1.0000 - 4.8463 1.0000 - 5.2455 1.0000 - 5.6563 1.0000 - 6.6606 1.0000 - 8.7680 0.0000 - 10.8072 0.0000 - 11.9897 0.0000 - 13.5317 0.0000 - 14.8625 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7438 1.0000 - -30.0604 1.0000 - -29.9867 1.0000 - -29.8847 1.0000 - 0.8747 1.0000 - 1.4744 1.0000 - 4.9295 1.0000 - 5.1004 1.0000 - 5.7671 1.0000 - 6.6527 1.0000 - 8.7570 0.0000 - 10.8011 0.0000 - 12.1859 0.0000 - 13.5593 0.0000 - 14.6572 0.0000 - - - -91.8800 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7444 1.0000 - -30.0105 1.0000 - -30.0038 1.0000 - -29.8876 1.0000 - -0.9548 1.0000 - 3.8567 1.0000 - 4.8138 1.0000 - 5.4323 1.0000 - 5.5813 1.0000 - 7.2363 1.0000 - 8.8397 0.0000 - 9.4096 0.0000 - 11.0606 0.0000 - 14.9041 0.0000 - 15.9154 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7444 1.0000 - -30.0127 1.0000 - -30.0037 1.0000 - -29.8874 1.0000 - -0.9054 1.0000 - 3.8932 1.0000 - 4.8113 1.0000 - 5.0970 1.0000 - 5.8095 1.0000 - 7.0569 1.0000 - 9.0275 0.0000 - 9.5614 0.0000 - 10.9012 0.0000 - 15.3640 0.0000 - 16.2477 0.0000 - - - -91.8804 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7443 1.0000 - -30.0188 1.0000 - -30.0031 1.0000 - -29.8869 1.0000 - -0.7600 1.0000 - 3.9970 1.0000 - 4.5299 1.0000 - 4.9001 1.0000 - 6.0104 1.0000 - 6.6764 1.0000 - 9.4299 0.0000 - 9.9366 0.0000 - 10.5322 0.0000 - 15.0414 0.0000 - 15.7405 0.0000 - - - -91.8806 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7441 1.0000 - -30.0277 1.0000 - -30.0023 1.0000 - -29.8862 1.0000 - -0.5239 1.0000 - 3.9586 1.0000 - 4.1573 1.0000 - 4.9630 1.0000 - 6.1585 1.0000 - 6.2704 1.0000 - 9.7369 0.0000 - 10.1887 0.0000 - 10.4392 0.0000 - 14.6116 0.0000 - 15.8892 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7439 1.0000 - -30.0379 1.0000 - -30.0014 1.0000 - -29.8854 1.0000 - -0.2066 1.0000 - 3.3648 1.0000 - 4.3281 1.0000 - 5.0858 1.0000 - 5.8933 1.0000 - 6.2876 1.0000 - 9.4924 0.0000 - 10.3513 0.0000 - 10.9098 0.0000 - 14.1968 0.0000 - 15.6095 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7437 1.0000 - -30.0476 1.0000 - -30.0005 1.0000 - -29.8847 1.0000 - 0.1788 1.0000 - 2.7700 1.0000 - 4.4886 1.0000 - 5.2214 1.0000 - 5.6433 1.0000 - 6.3659 1.0000 - 9.1667 0.0000 - 10.4414 0.0000 - 11.3646 0.0000 - 13.8896 0.0000 - 16.6031 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7436 1.0000 - -30.0552 1.0000 - -29.9998 1.0000 - -29.8840 1.0000 - 0.6216 1.0000 - 2.1905 1.0000 - 4.6276 1.0000 - 5.1554 1.0000 - 5.7004 1.0000 - 6.3833 1.0000 - 8.9358 0.0000 - 10.3679 0.0000 - 11.7330 0.0000 - 13.7871 0.0000 - 15.4993 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2905 1.0000 - -65.7435 1.0000 - -30.0593 1.0000 - -29.9994 1.0000 - -29.8837 1.0000 - 1.1087 1.0000 - 1.6347 1.0000 - 4.7486 1.0000 - 4.9984 1.0000 - 5.8749 1.0000 - 6.3442 1.0000 - 8.8213 0.0000 - 10.2716 0.0000 - 11.9440 0.0000 - 13.8193 0.0000 - 14.8856 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2901 1.0000 - -65.7441 1.0000 - -30.0183 1.0000 - -30.0091 1.0000 - -29.8863 1.0000 - -0.6139 1.0000 - 3.3047 1.0000 - 4.8442 1.0000 - 5.4603 1.0000 - 5.4868 1.0000 - 7.0343 1.0000 - 8.6590 0.0000 - 9.9415 0.0000 - 11.7134 0.0000 - 14.2240 0.0000 - 15.8795 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7441 1.0000 - -30.0181 1.0000 - -30.0113 1.0000 - -29.8862 1.0000 - -0.5649 1.0000 - 3.3377 1.0000 - 4.8084 1.0000 - 5.2074 1.0000 - 5.6705 1.0000 - 6.9017 1.0000 - 8.8064 0.0000 - 10.0721 0.0000 - 11.5068 0.0000 - 14.3145 0.0000 - 15.6369 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2908 1.0000 - -65.7440 1.0000 - -30.0176 1.0000 - -30.0174 1.0000 - -29.8857 1.0000 - -0.4208 1.0000 - 3.4287 1.0000 - 4.5635 1.0000 - 5.0640 1.0000 - 5.7943 1.0000 - 6.6030 1.0000 - 9.1559 0.0000 - 10.3672 0.0000 - 11.0498 0.0000 - 14.3100 0.0000 - 15.6899 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7438 1.0000 - -30.0263 1.0000 - -30.0168 1.0000 - -29.8850 1.0000 - -0.1891 1.0000 - 3.5310 1.0000 - 4.1526 1.0000 - 5.0962 1.0000 - 5.8378 1.0000 - 6.3101 1.0000 - 9.5515 0.0000 - 10.4117 0.0000 - 10.7785 0.0000 - 14.0757 0.0000 - 16.4690 0.0000 - - - -91.8807 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7436 1.0000 - -30.0365 1.0000 - -30.0159 1.0000 - -29.8842 1.0000 - 0.1197 1.0000 - 3.3712 1.0000 - 3.9854 1.0000 - 5.1910 1.0000 - 5.7030 1.0000 - 6.2124 1.0000 - 9.7686 0.0000 - 10.0355 0.0000 - 10.9145 0.0000 - 13.9867 0.0000 - 15.9162 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7434 1.0000 - -30.0463 1.0000 - -30.0150 1.0000 - -29.8835 1.0000 - 0.4894 1.0000 - 2.9018 1.0000 - 4.1317 1.0000 - 5.2339 1.0000 - 5.5776 1.0000 - 6.2422 1.0000 - 9.4373 0.0000 - 9.9987 0.0000 - 11.0336 0.0000 - 14.2044 0.0000 - 15.5874 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7433 1.0000 - -30.0539 1.0000 - -30.0143 1.0000 - -29.8829 1.0000 - 0.9061 1.0000 - 2.3921 1.0000 - 4.3127 1.0000 - 5.0699 1.0000 - 5.7376 1.0000 - 6.2494 1.0000 - 9.0950 0.0000 - 9.8623 0.0000 - 11.1873 0.0000 - 15.0131 0.0000 - 17.2295 0.0000 - - - -91.8797 1.0000 - -91.4247 1.0000 - -91.2897 1.0000 - -65.7431 1.0000 - -30.0580 1.0000 - -30.0139 1.0000 - -29.8825 1.0000 - 1.3392 1.0000 - 1.9119 1.0000 - 4.4535 1.0000 - 4.9101 1.0000 - 5.9724 1.0000 - 6.1724 1.0000 - 8.8920 0.0000 - 9.7378 0.0000 - 11.2934 0.0000 - 14.5094 0.0000 - 14.9006 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7438 1.0000 - -30.0320 1.0000 - -30.0077 1.0000 - -29.8852 1.0000 - -0.1990 1.0000 - 2.6933 1.0000 - 4.8622 1.0000 - 5.3088 1.0000 - 5.5698 1.0000 - 6.9576 1.0000 - 8.6840 0.0000 - 10.4231 0.0000 - 12.3103 0.0000 - 13.3388 0.0000 - 15.0063 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7438 1.0000 - -30.0318 1.0000 - -30.0099 1.0000 - -29.8850 1.0000 - -0.1505 1.0000 - 2.7229 1.0000 - 4.8168 1.0000 - 5.2487 1.0000 - 5.5888 1.0000 - 6.8570 1.0000 - 8.7830 0.0000 - 10.5162 0.0000 - 12.0017 0.0000 - 13.5605 0.0000 - 14.9311 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2902 1.0000 - -65.7436 1.0000 - -30.0312 1.0000 - -30.0160 1.0000 - -29.8846 1.0000 - -0.0083 1.0000 - 2.8063 1.0000 - 4.6280 1.0000 - 5.1868 1.0000 - 5.6156 1.0000 - 6.6210 1.0000 - 9.0297 0.0000 - 10.6548 0.0000 - 11.4979 0.0000 - 13.6805 0.0000 - 16.1680 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7435 1.0000 - -30.0305 1.0000 - -30.0249 1.0000 - -29.8838 1.0000 - 0.2176 1.0000 - 2.9196 1.0000 - 4.3150 1.0000 - 5.2001 1.0000 - 5.6107 1.0000 - 6.3844 1.0000 - 9.3223 0.0000 - 10.4868 0.0000 - 11.1488 0.0000 - 13.7394 0.0000 - 15.2525 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7433 1.0000 - -30.0353 1.0000 - -30.0296 1.0000 - -29.8831 1.0000 - 0.5095 1.0000 - 2.9934 1.0000 - 4.0235 1.0000 - 5.2081 1.0000 - 5.5733 1.0000 - 6.2653 1.0000 - 9.5540 0.0000 - 10.0537 0.0000 - 10.8460 0.0000 - 14.0317 0.0000 - 16.9865 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7431 1.0000 - -30.0450 1.0000 - -30.0288 1.0000 - -29.8823 1.0000 - 0.8493 1.0000 - 2.8878 1.0000 - 3.9281 1.0000 - 5.0740 1.0000 - 5.6506 1.0000 - 6.2584 1.0000 - 9.5863 0.0000 - 9.6119 0.0000 - 10.5896 0.0000 - 14.5477 0.0000 - 16.1231 0.0000 - - - -91.8806 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7430 1.0000 - -30.0527 1.0000 - -30.0281 1.0000 - -29.8818 1.0000 - 1.2065 1.0000 - 2.5979 1.0000 - 4.0342 1.0000 - 4.8601 1.0000 - 5.8427 1.0000 - 6.2709 1.0000 - 9.2185 0.0000 - 9.4083 0.0000 - 10.5443 0.0000 - 14.9799 0.0000 - 16.9946 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7429 1.0000 - -30.0568 1.0000 - -30.0277 1.0000 - -29.8814 1.0000 - 1.5149 1.0000 - 2.3015 1.0000 - 4.1783 1.0000 - 4.6820 1.0000 - 6.0499 1.0000 - 6.2287 1.0000 - 8.9581 0.0000 - 9.2598 0.0000 - 10.5742 0.0000 - 14.8199 0.0000 - 15.4551 0.0000 - - - -91.8812 1.0000 - -91.4262 1.0000 - -91.2912 1.0000 - -65.7436 1.0000 - -30.0427 1.0000 - -30.0068 1.0000 - -29.8843 1.0000 - 0.2722 1.0000 - 2.0800 1.0000 - 4.8773 1.0000 - 5.1767 1.0000 - 5.6077 1.0000 - 6.9482 1.0000 - 8.9102 0.0000 - 10.8202 0.0000 - 12.5032 0.0000 - 12.8741 0.0000 - 14.6540 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7436 1.0000 - -30.0425 1.0000 - -30.0088 1.0000 - -29.8842 1.0000 - 0.3219 1.0000 - 2.1086 1.0000 - 4.8435 1.0000 - 5.1373 1.0000 - 5.6282 1.0000 - 6.8548 1.0000 - 8.9591 0.0000 - 10.8385 0.0000 - 12.1616 0.0000 - 13.3887 0.0000 - 14.7173 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7434 1.0000 - -30.0420 1.0000 - -30.0149 1.0000 - -29.8837 1.0000 - 0.4637 1.0000 - 2.1902 1.0000 - 4.6998 1.0000 - 5.0929 1.0000 - 5.6713 1.0000 - 6.6315 1.0000 - 9.0845 0.0000 - 10.7099 0.0000 - 11.8347 0.0000 - 13.3260 0.0000 - 14.8037 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2904 1.0000 - -65.7433 1.0000 - -30.0412 1.0000 - -30.0239 1.0000 - -29.8830 1.0000 - 0.6817 1.0000 - 2.3190 1.0000 - 4.4554 1.0000 - 5.0740 1.0000 - 5.7125 1.0000 - 6.4023 1.0000 - 9.2380 0.0000 - 10.3235 0.0000 - 11.4656 0.0000 - 13.6342 0.0000 - 15.3546 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7431 1.0000 - -30.0404 1.0000 - -30.0342 1.0000 - -29.8822 1.0000 - 0.9487 1.0000 - 2.4808 1.0000 - 4.1899 1.0000 - 5.0008 1.0000 - 5.7567 1.0000 - 6.2838 1.0000 - 9.3589 0.0000 - 9.8771 0.0000 - 10.8863 0.0000 - 14.2986 0.0000 - 15.7162 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2905 1.0000 - -65.7429 1.0000 - -30.0441 1.0000 - -30.0396 1.0000 - -29.8814 1.0000 - 1.2299 1.0000 - 2.6376 1.0000 - 3.9806 1.0000 - 4.8199 1.0000 - 5.8594 1.0000 - 6.2868 1.0000 - 9.3046 0.0000 - 9.5580 0.0000 - 10.2980 0.0000 - 14.7255 0.0000 - 15.1041 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7427 1.0000 - -30.0517 1.0000 - -30.0390 1.0000 - -29.8808 1.0000 - 1.4810 1.0000 - 2.7241 1.0000 - 3.9050 1.0000 - 4.5774 1.0000 - 6.0293 1.0000 - 6.3312 1.0000 - 9.0511 0.0000 - 9.2924 0.0000 - 9.9968 0.0000 - 14.8542 0.0000 - 17.0014 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7427 1.0000 - -30.0559 1.0000 - -30.0387 1.0000 - -29.8806 1.0000 - 1.6404 1.0000 - 2.7265 1.0000 - 3.9706 1.0000 - 4.3593 1.0000 - 6.1919 1.0000 - 6.3459 1.0000 - 8.8868 0.0000 - 9.0124 0.0000 - 9.9580 0.0000 - 16.6992 0.0000 - 18.2794 0.0000 - - - -91.8816 1.0000 - -91.4266 1.0000 - -91.2915 1.0000 - -65.7435 1.0000 - -30.0485 1.0000 - -30.0062 1.0000 - -29.8839 1.0000 - 0.7508 1.0000 - 1.5290 1.0000 - 4.8872 1.0000 - 5.1019 1.0000 - 5.6111 1.0000 - 6.9563 1.0000 - 9.1684 0.0000 - 11.0963 0.0000 - 11.8845 0.0000 - 13.4542 0.0000 - 13.9816 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7434 1.0000 - -30.0483 1.0000 - -30.0082 1.0000 - -29.8836 1.0000 - 0.8074 1.0000 - 1.5503 1.0000 - 4.8837 1.0000 - 5.0282 1.0000 - 5.6611 1.0000 - 6.8614 1.0000 - 9.1821 0.0000 - 10.9712 0.0000 - 11.9443 0.0000 - 13.3175 0.0000 - 14.0111 0.0000 - - - -91.8809 1.0000 - -91.4260 1.0000 - -91.2909 1.0000 - -65.7433 1.0000 - -30.0478 1.0000 - -30.0143 1.0000 - -29.8832 1.0000 - 0.9654 1.0000 - 1.6153 1.0000 - 4.7866 1.0000 - 4.9431 1.0000 - 5.7637 1.0000 - 6.6281 1.0000 - 9.2181 0.0000 - 10.6031 0.0000 - 12.0239 0.0000 - 13.2393 0.0000 - 14.3926 0.0000 - - - -91.8809 1.0000 - -91.4260 1.0000 - -91.2909 1.0000 - -65.7432 1.0000 - -30.0471 1.0000 - -30.0234 1.0000 - -29.8825 1.0000 - 1.1904 1.0000 - 1.7430 1.0000 - 4.5650 1.0000 - 4.9174 1.0000 - 5.8769 1.0000 - 6.3717 1.0000 - 9.2652 0.0000 - 10.1220 0.0000 - 11.6464 0.0000 - 13.6165 0.0000 - 14.7417 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2905 1.0000 - -65.7430 1.0000 - -30.0463 1.0000 - -30.0337 1.0000 - -29.8817 1.0000 - 1.4108 1.0000 - 1.9753 1.0000 - 4.3324 1.0000 - 4.8220 1.0000 - 5.9828 1.0000 - 6.2221 1.0000 - 9.3061 0.0000 - 9.6403 0.0000 - 10.9581 0.0000 - 14.3215 0.0000 - 14.8365 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7428 1.0000 - -30.0455 1.0000 - -30.0435 1.0000 - -29.8809 1.0000 - 1.5658 1.0000 - 2.3279 1.0000 - 4.1275 1.0000 - 4.6077 1.0000 - 6.0847 1.0000 - 6.2409 1.0000 - 9.1753 0.0000 - 9.3638 0.0000 - 10.2421 0.0000 - 14.7264 0.0000 - 15.1864 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7426 1.0000 - -30.0512 1.0000 - -30.0449 1.0000 - -29.8803 1.0000 - 1.6627 1.0000 - 2.7320 1.0000 - 3.9747 1.0000 - 4.3124 1.0000 - 6.2217 1.0000 - 6.3335 1.0000 - 8.8577 0.0000 - 9.2736 0.0000 - 9.7144 0.0000 - 14.6891 0.0000 - 16.0466 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7426 1.0000 - -30.0554 1.0000 - -30.0446 1.0000 - -29.8800 1.0000 - 1.7108 1.0000 - 3.0627 1.0000 - 3.8918 1.0000 - 4.0425 1.0000 - 6.3299 1.0000 - 6.4187 1.0000 - 8.6764 0.0000 - 9.0361 0.0000 - 9.5744 0.0000 - 15.1073 0.0000 - 16.7779 0.0000 - - - -91.8791 1.0000 - -91.4239 1.0000 - -91.2890 1.0000 - -65.7431 1.0000 - -30.0077 1.0000 - -29.9745 1.0000 - -29.9360 1.0000 - -0.9922 1.0000 - 4.1697 1.0000 - 4.4791 1.0000 - 5.2762 1.0000 - 5.5520 1.0000 - 8.4050 0.0000 - 8.4412 0.0000 - 9.7376 0.0000 - 9.9653 0.0000 - 14.6114 0.0000 - 15.5437 0.0000 - - - -91.8795 1.0000 - -91.4244 1.0000 - -91.2894 1.0000 - -65.7431 1.0000 - -30.0099 1.0000 - -29.9743 1.0000 - -29.9359 1.0000 - -0.9433 1.0000 - 4.1493 1.0000 - 4.4316 1.0000 - 5.2543 1.0000 - 5.5665 1.0000 - 8.1472 0.0001 - 8.5627 0.0000 - 9.6381 0.0000 - 10.2814 0.0000 - 14.5670 0.0000 - 16.3874 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7431 1.0000 - -30.0160 1.0000 - -29.9738 1.0000 - -29.9355 1.0000 - -0.7997 1.0000 - 3.9591 1.0000 - 4.4276 1.0000 - 5.2220 1.0000 - 5.6067 1.0000 - 7.6690 0.9988 - 8.8770 0.0000 - 9.3920 0.0000 - 10.9261 0.0000 - 14.5052 0.0000 - 15.8789 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7429 1.0000 - -30.0250 1.0000 - -29.9729 1.0000 - -29.9348 1.0000 - -0.5652 1.0000 - 3.5680 1.0000 - 4.5355 1.0000 - 5.2114 1.0000 - 5.6623 1.0000 - 7.2067 1.0000 - 9.1059 0.0000 - 9.2908 0.0000 - 11.6363 0.0000 - 14.1697 0.0000 - 15.7589 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7427 1.0000 - -30.0353 1.0000 - -29.9719 1.0000 - -29.9341 1.0000 - -0.2521 1.0000 - 3.0868 1.0000 - 4.6814 1.0000 - 5.2185 1.0000 - 5.7142 1.0000 - 6.8332 1.0000 - 8.8793 0.0000 - 9.7265 0.0000 - 12.2929 0.0000 - 13.5685 0.0000 - 16.1058 0.0000 - - - -91.8801 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7425 1.0000 - -30.0450 1.0000 - -29.9710 1.0000 - -29.9334 1.0000 - 0.1257 1.0000 - 2.5716 1.0000 - 4.8261 1.0000 - 5.2273 1.0000 - 5.7364 1.0000 - 6.5820 1.0000 - 8.7708 0.0000 - 10.1434 0.0000 - 12.7927 0.0000 - 12.8308 0.0000 - 15.4481 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7424 1.0000 - -30.0526 1.0000 - -29.9703 1.0000 - -29.9329 1.0000 - 0.5574 1.0000 - 2.0489 1.0000 - 4.9438 1.0000 - 5.2220 1.0000 - 5.7179 1.0000 - 6.4574 1.0000 - 8.7837 0.0000 - 10.5245 0.0000 - 12.1279 0.0000 - 13.0743 0.0000 - 15.2254 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7423 1.0000 - -30.0568 1.0000 - -29.9699 1.0000 - -29.9325 1.0000 - 1.0239 1.0000 - 1.5364 1.0000 - 5.0194 1.0000 - 5.2031 1.0000 - 5.6900 1.0000 - 6.4177 1.0000 - 8.8427 0.0000 - 10.8611 0.0000 - 11.5754 0.0000 - 13.1725 0.0000 - 14.7884 0.0000 - - - -91.8797 1.0000 - -91.4246 1.0000 - -91.2897 1.0000 - -65.7431 1.0000 - -30.0075 1.0000 - -29.9776 1.0000 - -29.9357 1.0000 - -0.9418 1.0000 - 4.1601 1.0000 - 4.4633 1.0000 - 5.2925 1.0000 - 5.4803 1.0000 - 8.1369 0.0002 - 8.5843 0.0000 - 9.8748 0.0000 - 14.2706 0.0000 - 16.6056 0.0000 - 16.6825 0.0000 - - - -91.8797 1.0000 - -91.4246 1.0000 - -91.2896 1.0000 - -65.7431 1.0000 - -30.0097 1.0000 - -29.9774 1.0000 - -29.9356 1.0000 - -0.8921 1.0000 - 4.1617 1.0000 - 4.4064 1.0000 - 5.2343 1.0000 - 5.5218 1.0000 - 7.8744 0.5472 - 8.6852 0.0000 - 9.8973 0.0000 - 10.2230 0.0000 - 14.6840 0.0000 - 15.1549 0.0000 - - - -91.8797 1.0000 - -91.4246 1.0000 - -91.2897 1.0000 - -65.7430 1.0000 - -30.0157 1.0000 - -29.9768 1.0000 - -29.9352 1.0000 - -0.7465 1.0000 - 4.0060 1.0000 - 4.3910 1.0000 - 5.1646 1.0000 - 5.5823 1.0000 - 7.4453 1.0000 - 8.9926 0.0000 - 9.6515 0.0000 - 10.7842 0.0000 - 14.7401 0.0000 - 15.9068 0.0000 - - - -91.8799 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7428 1.0000 - -30.0247 1.0000 - -29.9759 1.0000 - -29.9346 1.0000 - -0.5124 1.0000 - 3.6173 1.0000 - 4.5175 1.0000 - 5.1467 1.0000 - 5.6283 1.0000 - 7.0241 1.0000 - 9.3214 0.0000 - 9.4009 0.0000 - 11.4365 0.0000 - 14.2651 0.0000 - 15.7142 0.0000 - - - -91.8801 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7426 1.0000 - -30.0350 1.0000 - -29.9750 1.0000 - -29.9339 1.0000 - -0.2008 1.0000 - 3.1352 1.0000 - 4.6826 1.0000 - 5.1753 1.0000 - 5.6422 1.0000 - 6.6940 1.0000 - 9.0514 0.0000 - 9.8080 0.0000 - 13.0238 0.0000 - 15.4136 0.0000 - 16.0797 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7424 1.0000 - -30.0447 1.0000 - -29.9741 1.0000 - -29.9332 1.0000 - 0.1782 1.0000 - 2.6185 1.0000 - 4.8334 1.0000 - 5.2268 1.0000 - 5.6216 1.0000 - 6.4836 1.0000 - 8.8850 0.0000 - 10.1806 0.0000 - 12.1773 0.0000 - 13.4647 0.0000 - 15.3704 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7423 1.0000 - -30.0524 1.0000 - -29.9734 1.0000 - -29.9327 1.0000 - 0.6080 1.0000 - 2.0944 1.0000 - 4.9487 1.0000 - 5.2360 1.0000 - 5.6214 1.0000 - 6.3720 1.0000 - 8.8398 0.0000 - 10.4741 0.0000 - 11.9232 0.0000 - 13.5675 0.0000 - 15.0575 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7422 1.0000 - -30.0566 1.0000 - -29.9730 1.0000 - -29.9323 1.0000 - 1.0767 1.0000 - 1.5797 1.0000 - 5.0331 1.0000 - 5.1824 1.0000 - 5.6559 1.0000 - 6.3220 1.0000 - 8.8601 0.0000 - 10.6497 0.0000 - 11.6448 0.0000 - 13.4921 0.0000 - 14.9068 0.0000 - - - -91.8794 1.0000 - -91.4243 1.0000 - -91.2893 1.0000 - -65.7429 1.0000 - -30.0066 1.0000 - -29.9862 1.0000 - -29.9351 1.0000 - -0.7866 1.0000 - 4.0335 1.0000 - 4.4889 1.0000 - 5.3371 1.0000 - 5.3463 1.0000 - 7.5604 1.0000 - 8.8667 0.0000 - 9.5757 0.0000 - 10.8119 0.0000 - 15.0193 0.0000 - 16.5679 0.0000 - - - -91.8797 1.0000 - -91.4246 1.0000 - -91.2896 1.0000 - -65.7429 1.0000 - -30.0088 1.0000 - -29.9860 1.0000 - -29.9350 1.0000 - -0.7381 1.0000 - 4.0728 1.0000 - 4.4246 1.0000 - 5.1607 1.0000 - 5.4807 1.0000 - 7.3825 1.0000 - 8.9797 0.0000 - 9.7876 0.0000 - 10.6899 0.0000 - 14.8927 0.0000 - 16.0636 0.0000 - - - -91.8801 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7428 1.0000 - -30.0149 1.0000 - -29.9854 1.0000 - -29.9346 1.0000 - -0.5926 1.0000 - 4.1214 1.0000 - 4.2640 1.0000 - 5.0156 1.0000 - 5.5704 1.0000 - 7.0120 1.0000 - 9.2675 0.0000 - 10.0834 0.0000 - 10.5691 0.0000 - 14.8072 0.0000 - 15.6699 0.0000 - - - -91.8799 1.0000 - -91.4248 1.0000 - -91.2899 1.0000 - -65.7426 1.0000 - -30.0239 1.0000 - -29.9846 1.0000 - -29.9340 1.0000 - -0.3590 1.0000 - 3.7621 1.0000 - 4.4212 1.0000 - 4.9587 1.0000 - 5.6136 1.0000 - 6.6438 1.0000 - 9.6171 0.0000 - 9.8168 0.0000 - 11.0150 0.0000 - 14.3910 0.0000 - 16.1444 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7424 1.0000 - -30.0342 1.0000 - -29.9837 1.0000 - -29.9333 1.0000 - -0.0480 1.0000 - 3.2758 1.0000 - 4.6646 1.0000 - 4.9722 1.0000 - 5.5802 1.0000 - 6.3794 1.0000 - 9.4388 0.0000 - 9.9520 0.0000 - 11.4875 0.0000 - 13.9130 0.0000 - 15.6021 0.0000 - - - -91.8801 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7422 1.0000 - -30.0440 1.0000 - -29.9828 1.0000 - -29.9326 1.0000 - 0.3278 1.0000 - 2.7560 1.0000 - 4.8584 1.0000 - 5.1054 1.0000 - 5.4544 1.0000 - 6.2435 1.0000 - 9.1535 0.0000 - 10.1417 0.0000 - 11.7635 0.0000 - 13.9583 0.0000 - 15.3074 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7421 1.0000 - -30.0516 1.0000 - -29.9821 1.0000 - -29.9320 1.0000 - 0.7545 1.0000 - 2.2317 1.0000 - 4.9434 1.0000 - 5.2715 1.0000 - 5.3901 1.0000 - 6.1613 1.0000 - 8.9788 0.0000 - 10.1660 0.0000 - 11.8759 0.0000 - 14.0401 0.0000 - 14.7589 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7421 1.0000 - -30.0559 1.0000 - -29.9817 1.0000 - -29.9317 1.0000 - 1.2187 1.0000 - 1.7187 1.0000 - 5.0186 1.0000 - 5.1440 1.0000 - 5.6004 1.0000 - 6.0785 1.0000 - 8.9071 0.0000 - 10.1124 0.0000 - 11.9295 0.0000 - 14.1658 0.0000 - 14.5853 0.0000 - - - -91.8799 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7427 1.0000 - -30.0054 1.0000 - -29.9989 1.0000 - -29.9343 1.0000 - -0.5379 1.0000 - 3.7030 1.0000 - 4.6090 1.0000 - 5.2630 1.0000 - 5.3959 1.0000 - 7.0695 1.0000 - 9.0908 0.0000 - 9.4357 0.0000 - 11.5575 0.0000 - 14.3516 0.0000 - 16.3601 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7426 1.0000 - -30.0076 1.0000 - -29.9987 1.0000 - -29.9341 1.0000 - -0.4887 1.0000 - 3.7492 1.0000 - 4.5743 1.0000 - 5.0985 1.0000 - 5.4857 1.0000 - 6.9239 1.0000 - 9.2263 0.0000 - 9.5939 0.0000 - 11.3727 0.0000 - 14.7170 0.0000 - 16.1538 0.0000 - - - -91.8808 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7426 1.0000 - -30.0138 1.0000 - -29.9982 1.0000 - -29.9337 1.0000 - -0.3455 1.0000 - 3.8851 1.0000 - 4.3963 1.0000 - 4.8981 1.0000 - 5.5780 1.0000 - 6.6012 1.0000 - 9.5131 0.0000 - 9.9903 0.0000 - 10.9583 0.0000 - 15.0569 0.0000 - 16.3985 0.0000 - - - -91.8808 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7424 1.0000 - -30.0228 1.0000 - -29.9974 1.0000 - -29.9331 1.0000 - -0.1133 1.0000 - 3.9680 1.0000 - 4.1423 1.0000 - 4.8263 1.0000 - 5.6458 1.0000 - 6.2595 1.0000 - 9.7738 0.0000 - 10.2498 0.0000 - 10.7319 0.0000 - 13.9527 0.0000 - 15.3880 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7422 1.0000 - -30.0330 1.0000 - -29.9965 1.0000 - -29.9323 1.0000 - 0.1946 1.0000 - 3.4921 1.0000 - 4.4185 1.0000 - 4.8251 1.0000 - 5.6324 1.0000 - 6.0245 1.0000 - 9.7715 0.0000 - 9.9943 0.0000 - 11.1510 0.0000 - 13.7014 0.0000 - 16.5495 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7420 1.0000 - -30.0429 1.0000 - -29.9956 1.0000 - -29.9316 1.0000 - 0.5628 1.0000 - 2.9731 1.0000 - 4.7045 1.0000 - 4.9098 1.0000 - 5.4759 1.0000 - 5.9673 1.0000 - 9.4317 0.0000 - 9.8472 0.0000 - 11.5921 0.0000 - 13.6688 0.0000 - 15.3116 0.0000 - - - -91.8800 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7418 1.0000 - -30.0505 1.0000 - -29.9949 1.0000 - -29.9311 1.0000 - 0.9775 1.0000 - 2.4579 1.0000 - 4.7922 1.0000 - 5.2187 1.0000 - 5.3117 1.0000 - 5.9343 1.0000 - 9.1395 0.0000 - 9.6338 0.0000 - 11.9354 0.0000 - 13.8117 0.0000 - 15.0790 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7418 1.0000 - -30.0548 1.0000 - -29.9946 1.0000 - -29.9308 1.0000 - 1.4086 1.0000 - 1.9761 1.0000 - 4.8168 1.0000 - 5.2061 1.0000 - 5.5597 1.0000 - 5.8151 1.0000 - 8.9724 0.0000 - 9.4790 0.0000 - 12.1291 0.0000 - 14.1071 0.0000 - 15.6601 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2903 1.0000 - -65.7424 1.0000 - -30.0135 1.0000 - -30.0040 1.0000 - -29.9332 1.0000 - -0.2065 1.0000 - 3.2450 1.0000 - 4.7589 1.0000 - 5.2488 1.0000 - 5.4433 1.0000 - 6.6906 1.0000 - 8.9578 0.0000 - 9.7562 0.0000 - 12.2284 0.0000 - 13.6467 0.0000 - 15.6738 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7424 1.0000 - -30.0133 1.0000 - -30.0062 1.0000 - -29.9330 1.0000 - -0.1582 1.0000 - 3.2898 1.0000 - 4.7575 1.0000 - 5.1144 1.0000 - 5.4721 1.0000 - 6.5804 1.0000 - 9.0982 0.0000 - 9.8501 0.0000 - 11.9458 0.0000 - 13.9323 0.0000 - 15.6257 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7422 1.0000 - -30.0128 1.0000 - -30.0124 1.0000 - -29.9326 1.0000 - -0.0156 1.0000 - 3.4223 1.0000 - 4.6865 1.0000 - 4.8536 1.0000 - 5.5334 1.0000 - 6.3183 1.0000 - 9.4083 0.0000 - 10.0693 0.0000 - 11.4327 0.0000 - 13.8385 0.0000 - 15.3753 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7421 1.0000 - -30.0214 1.0000 - -30.0120 1.0000 - -29.9320 1.0000 - 0.2115 1.0000 - 3.6251 1.0000 - 4.2944 1.0000 - 4.8274 1.0000 - 5.6180 1.0000 - 6.0093 1.0000 - 9.6312 0.0000 - 10.2757 0.0000 - 11.0215 0.0000 - 13.6105 0.0000 - 15.5689 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7418 1.0000 - -30.0317 1.0000 - -30.0111 1.0000 - -29.9313 1.0000 - 0.5117 1.0000 - 3.6756 1.0000 - 4.0282 1.0000 - 4.8696 1.0000 - 5.6990 1.0000 - 5.7349 1.0000 - 9.5362 0.0000 - 10.2061 0.0000 - 11.0080 0.0000 - 13.5324 0.0000 - 15.5343 0.0000 - - - -91.8804 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7417 1.0000 - -30.0416 1.0000 - -30.0103 1.0000 - -29.9306 1.0000 - 0.8642 1.0000 - 3.2318 1.0000 - 4.2558 1.0000 - 4.9684 1.0000 - 5.4836 1.0000 - 5.8019 1.0000 - 9.2565 0.0000 - 9.8056 0.0000 - 11.2920 0.0000 - 13.6768 0.0000 - 15.4872 0.0000 - - - -91.8801 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7415 1.0000 - -30.0493 1.0000 - -30.0096 1.0000 - -29.9300 1.0000 - 1.2490 1.0000 - 2.7560 1.0000 - 4.4489 1.0000 - 5.1394 1.0000 - 5.3565 1.0000 - 5.8359 1.0000 - 8.9975 0.0000 - 9.3530 0.0000 - 11.5665 0.0000 - 14.0109 0.0000 - 15.4805 0.0000 - - - -91.8796 1.0000 - -91.4245 1.0000 - -91.2895 1.0000 - -65.7414 1.0000 - -30.0535 1.0000 - -30.0091 1.0000 - -29.9298 1.0000 - 1.6087 1.0000 - 2.3515 1.0000 - 4.5288 1.0000 - 5.1724 1.0000 - 5.4938 1.0000 - 5.7819 1.0000 - 8.8529 0.0000 - 9.0524 0.0000 - 11.7104 0.0000 - 14.0573 0.0000 - 15.0900 0.0000 - - - -91.8814 1.0000 - -91.4264 1.0000 - -91.2914 1.0000 - -65.7422 1.0000 - -30.0274 1.0000 - -30.0027 1.0000 - -29.9322 1.0000 - 0.1919 1.0000 - 2.7296 1.0000 - 4.8887 1.0000 - 5.2689 1.0000 - 5.4479 1.0000 - 6.4571 1.0000 - 8.9309 0.0000 - 10.1141 0.0000 - 12.7287 0.0000 - 12.8456 0.0000 - 15.3170 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7421 1.0000 - -30.0272 1.0000 - -30.0048 1.0000 - -29.9320 1.0000 - 0.2409 1.0000 - 2.7729 1.0000 - 4.8898 1.0000 - 5.2223 1.0000 - 5.3965 1.0000 - 6.3796 1.0000 - 9.0274 0.0000 - 10.1593 0.0000 - 12.1501 0.0000 - 13.4325 0.0000 - 15.0368 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7419 1.0000 - -30.0267 1.0000 - -30.0110 1.0000 - -29.9316 1.0000 - 0.3806 1.0000 - 2.8996 1.0000 - 4.8497 1.0000 - 5.0127 1.0000 - 5.3985 1.0000 - 6.1868 1.0000 - 9.2455 0.0000 - 10.1860 0.0000 - 11.6938 0.0000 - 13.6620 0.0000 - 14.8455 0.0000 - - - -91.8809 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7418 1.0000 - -30.0259 1.0000 - -30.0201 1.0000 - -29.9310 1.0000 - 0.6011 1.0000 - 3.0992 1.0000 - 4.5252 1.0000 - 4.9705 1.0000 - 5.4410 1.0000 - 5.9674 1.0000 - 9.3795 0.0000 - 10.0938 0.0000 - 11.4215 0.0000 - 13.4946 0.0000 - 15.3249 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7416 1.0000 - -30.0305 1.0000 - -30.0251 1.0000 - -29.9303 1.0000 - 0.8844 1.0000 - 3.3282 1.0000 - 4.1307 1.0000 - 4.9976 1.0000 - 5.4432 1.0000 - 5.8368 1.0000 - 9.1709 0.0000 - 10.0960 0.0000 - 11.0760 0.0000 - 13.6019 0.0000 - 15.5760 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7414 1.0000 - -30.0404 1.0000 - -30.0242 1.0000 - -29.9296 1.0000 - 1.2071 1.0000 - 3.3733 1.0000 - 3.9450 1.0000 - 5.0033 1.0000 - 5.4115 1.0000 - 5.8500 1.0000 - 8.8027 0.0000 - 9.9189 0.0000 - 10.8392 0.0000 - 13.9632 0.0000 - 15.2363 0.0000 - - - -91.8810 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7413 1.0000 - -30.0482 1.0000 - -30.0236 1.0000 - -29.9291 1.0000 - 1.5374 1.0000 - 3.0788 1.0000 - 4.0952 1.0000 - 4.9405 1.0000 - 5.4963 1.0000 - 5.8970 1.0000 - 8.4845 0.0000 - 9.4593 0.0000 - 10.8758 0.0000 - 14.4053 0.0000 - 17.6986 0.0000 - - - -91.8806 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7411 1.0000 - -30.0524 1.0000 - -30.0233 1.0000 - -29.9289 1.0000 - 1.8017 1.0000 - 2.7984 1.0000 - 4.2319 1.0000 - 4.8727 1.0000 - 5.6545 1.0000 - 5.8902 1.0000 - 8.3046 0.0000 - 9.1174 0.0000 - 10.9361 0.0000 - 14.6714 0.0000 - 15.1061 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2910 1.0000 - -65.7419 1.0000 - -30.0381 1.0000 - -30.0016 1.0000 - -29.9314 1.0000 - 0.6438 1.0000 - 2.1972 1.0000 - 4.9816 1.0000 - 5.2821 1.0000 - 5.4079 1.0000 - 6.3587 1.0000 - 9.0891 0.0000 - 10.4109 0.0000 - 12.0762 0.0000 - 12.9720 0.0000 - 14.7931 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7418 1.0000 - -30.0379 1.0000 - -30.0038 1.0000 - -29.9312 1.0000 - 0.6917 1.0000 - 2.2385 1.0000 - 4.9684 1.0000 - 5.2605 1.0000 - 5.3795 1.0000 - 6.2871 1.0000 - 9.1342 0.0000 - 10.3626 0.0000 - 11.8755 0.0000 - 13.5638 0.0000 - 14.7415 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7417 1.0000 - -30.0374 1.0000 - -30.0100 1.0000 - -29.9308 1.0000 - 0.8289 1.0000 - 2.3628 1.0000 - 4.8680 1.0000 - 5.2167 1.0000 - 5.3487 1.0000 - 6.1151 1.0000 - 9.2333 0.0000 - 10.1098 0.0000 - 11.7864 0.0000 - 13.8645 0.0000 - 14.5821 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7415 1.0000 - -30.0368 1.0000 - -30.0191 1.0000 - -29.9302 1.0000 - 1.0385 1.0000 - 2.5659 1.0000 - 4.6184 1.0000 - 5.2494 1.0000 - 5.2935 1.0000 - 5.9474 1.0000 - 9.2299 0.0000 - 9.7805 0.0000 - 11.7623 0.0000 - 14.6669 0.0000 - 33.9627 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7413 1.0000 - -30.0360 1.0000 - -30.0295 1.0000 - -29.9295 1.0000 - 1.2933 1.0000 - 2.8351 1.0000 - 4.3053 1.0000 - 5.1462 1.0000 - 5.3500 1.0000 - 5.8888 1.0000 - 8.8751 0.0000 - 9.7440 0.0000 - 11.2586 0.0000 - 13.7436 0.0000 - 15.3267 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2908 1.0000 - -65.7412 1.0000 - -30.0394 1.0000 - -30.0352 1.0000 - -29.9289 1.0000 - 1.5626 1.0000 - 3.1227 1.0000 - 4.0176 1.0000 - 4.9307 1.0000 - 5.5039 1.0000 - 5.9329 1.0000 - 8.4289 0.0000 - 9.7601 0.0000 - 10.6018 0.0000 - 14.2919 0.0000 - 15.0899 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2911 1.0000 - -65.7410 1.0000 - -30.0472 1.0000 - -30.0346 1.0000 - -29.9284 1.0000 - 1.8088 1.0000 - 3.2901 1.0000 - 3.8891 1.0000 - 4.7082 1.0000 - 5.7010 1.0000 - 6.0056 1.0000 - 8.0678 0.0044 - 9.5108 0.0000 - 10.2464 0.0000 - 14.9130 0.0000 - 15.6767 0.0000 - - - -91.8813 1.0000 - -91.4263 1.0000 - -91.2912 1.0000 - -65.7409 1.0000 - -30.0515 1.0000 - -30.0343 1.0000 - -29.9281 1.0000 - 1.9715 1.0000 - 3.2549 1.0000 - 3.9834 1.0000 - 4.5315 1.0000 - 5.8883 1.0000 - 6.0297 1.0000 - 7.8661 0.5933 - 9.1689 0.0000 - 10.2004 0.0000 - 15.0616 0.0000 - 32.0644 0.0000 - - - -91.8815 1.0000 - -91.4266 1.0000 - -91.2915 1.0000 - -65.7418 1.0000 - -30.0440 1.0000 - -30.0011 1.0000 - -29.9310 1.0000 - 1.1269 1.0000 - 1.6721 1.0000 - 5.0342 1.0000 - 5.2771 1.0000 - 5.3683 1.0000 - 6.3348 1.0000 - 9.3061 0.0000 - 10.6059 0.0000 - 11.5175 0.0000 - 13.0325 0.0000 - 14.6615 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2907 1.0000 - -65.7417 1.0000 - -30.0438 1.0000 - -30.0032 1.0000 - -29.9308 1.0000 - 1.1784 1.0000 - 1.7101 1.0000 - 5.0365 1.0000 - 5.1518 1.0000 - 5.4647 1.0000 - 6.2520 1.0000 - 9.3181 0.0000 - 10.4031 0.0000 - 11.5903 0.0000 - 13.3633 0.0000 - 14.5583 0.0000 - - - -91.8801 1.0000 - -91.4252 1.0000 - -91.2901 1.0000 - -65.7415 1.0000 - -30.0433 1.0000 - -30.0093 1.0000 - -29.9303 1.0000 - 1.3163 1.0000 - 1.8312 1.0000 - 4.8941 1.0000 - 5.1190 1.0000 - 5.5631 1.0000 - 6.0425 1.0000 - 9.3454 0.0000 - 9.9129 0.0000 - 12.0493 0.0000 - 13.9108 0.0000 - 14.3729 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7414 1.0000 - -30.0427 1.0000 - -30.0185 1.0000 - -29.9297 1.0000 - 1.5003 1.0000 - 2.0569 1.0000 - 4.6455 1.0000 - 5.1693 1.0000 - 5.5995 1.0000 - 5.8371 1.0000 - 9.2378 0.0000 - 9.4800 0.0000 - 11.9139 0.0000 - 13.5604 0.0000 - 14.7551 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7412 1.0000 - -30.0419 1.0000 - -30.0289 1.0000 - -29.9291 1.0000 - 1.6855 1.0000 - 2.3977 1.0000 - 4.3844 1.0000 - 5.1110 1.0000 - 5.5521 1.0000 - 5.8491 1.0000 - 8.7124 0.0000 - 9.4831 0.0000 - 11.3760 0.0000 - 13.8572 0.0000 - 14.9892 0.0000 - - - -91.8810 1.0000 - -91.4261 1.0000 - -91.2910 1.0000 - -65.7410 1.0000 - -30.0411 1.0000 - -30.0389 1.0000 - -29.9285 1.0000 - 1.8550 1.0000 - 2.8180 1.0000 - 4.1421 1.0000 - 4.8462 1.0000 - 5.6803 1.0000 - 5.9491 1.0000 - 8.2154 0.0000 - 9.5095 0.0000 - 10.5843 0.0000 - 14.5072 0.0000 - 15.0778 0.0000 - - - -91.8812 1.0000 - -91.4262 1.0000 - -91.2911 1.0000 - -65.7409 1.0000 - -30.0467 1.0000 - -30.0406 1.0000 - -29.9280 1.0000 - 1.9950 1.0000 - 3.2581 1.0000 - 3.9509 1.0000 - 4.5226 1.0000 - 5.8957 1.0000 - 6.0587 1.0000 - 7.8278 0.7815 - 9.4491 0.0000 - 9.9344 0.0000 - 15.0260 0.0000 - 18.3727 0.0000 - - - -91.8815 1.0000 - -91.4265 1.0000 - -91.2915 1.0000 - -65.7408 1.0000 - -30.0510 1.0000 - -30.0402 1.0000 - -29.9277 1.0000 - 2.0780 1.0000 - 3.6286 1.0000 - 3.8595 1.0000 - 4.2059 1.0000 - 6.0817 1.0000 - 6.1302 1.0000 - 7.6065 1.0000 - 9.1931 0.0000 - 9.7385 0.0000 - 15.0476 0.0000 - 16.6319 0.0000 - - - -91.8793 1.0000 - -91.4243 1.0000 - -91.2893 1.0000 - -65.7415 1.0000 - -30.0028 1.0000 - -29.9802 1.0000 - -29.9695 1.0000 - -0.4815 1.0000 - 3.4597 1.0000 - 4.4964 1.0000 - 4.9371 1.0000 - 5.1831 1.0000 - 8.4989 0.0000 - 9.1550 0.0000 - 10.1399 0.0000 - 10.4152 0.0000 - 14.2974 0.0000 - 14.8308 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2897 1.0000 - -65.7415 1.0000 - -30.0050 1.0000 - -29.9801 1.0000 - -29.9693 1.0000 - -0.4342 1.0000 - 3.4391 1.0000 - 4.4529 1.0000 - 4.9676 1.0000 - 5.2040 1.0000 - 8.2556 0.0000 - 9.2125 0.0000 - 10.0413 0.0000 - 10.7194 0.0000 - 14.2965 0.0000 - 15.1176 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7414 1.0000 - -30.0112 1.0000 - -29.9796 1.0000 - -29.9688 1.0000 - -0.2928 1.0000 - 3.3540 1.0000 - 4.3881 1.0000 - 5.0261 1.0000 - 5.2648 1.0000 - 7.7736 0.9387 - 9.3605 0.0000 - 9.8023 0.0000 - 11.3678 0.0000 - 13.9531 0.0000 - 14.9554 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7412 1.0000 - -30.0203 1.0000 - -29.9791 1.0000 - -29.9679 1.0000 - -0.0672 1.0000 - 3.1662 1.0000 - 4.3914 1.0000 - 5.0790 1.0000 - 5.3596 1.0000 - 7.2805 1.0000 - 9.4059 0.0000 - 9.6783 0.0000 - 12.0688 0.0000 - 13.4792 0.0000 - 15.2550 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7411 1.0000 - -30.0306 1.0000 - -29.9785 1.0000 - -29.9670 1.0000 - 0.2282 1.0000 - 2.8837 1.0000 - 4.4758 1.0000 - 5.1145 1.0000 - 5.4784 1.0000 - 6.8477 1.0000 - 9.1811 0.0000 - 9.8874 0.0000 - 12.5970 0.0000 - 12.9048 0.0000 - 15.2176 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7408 1.0000 - -30.0404 1.0000 - -29.9778 1.0000 - -29.9661 1.0000 - 0.5762 1.0000 - 2.5428 1.0000 - 4.6037 1.0000 - 5.1264 1.0000 - 5.6095 1.0000 - 6.4965 1.0000 - 9.0211 0.0000 - 10.1220 0.0000 - 12.3062 0.0000 - 12.7724 0.0000 - 15.5499 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7407 1.0000 - -30.0482 1.0000 - -29.9773 1.0000 - -29.9654 1.0000 - 0.9542 1.0000 - 2.1721 1.0000 - 4.7324 1.0000 - 5.1121 1.0000 - 5.7425 1.0000 - 6.2291 1.0000 - 8.9691 0.0000 - 10.3317 0.0000 - 11.7644 0.0000 - 12.7021 0.0000 - 15.1622 0.0000 - - - -91.8793 1.0000 - -91.4243 1.0000 - -91.2893 1.0000 - -65.7406 1.0000 - -30.0524 1.0000 - -29.9770 1.0000 - -29.9649 1.0000 - 1.3325 1.0000 - 1.8005 1.0000 - 4.8244 1.0000 - 5.0841 1.0000 - 5.8749 1.0000 - 6.0344 1.0000 - 8.9800 0.0000 - 10.4848 0.0000 - 11.3991 0.0000 - 12.6194 0.0000 - 17.5491 0.0000 - - - -91.8794 1.0000 - -91.4244 1.0000 - -91.2894 1.0000 - -65.7415 1.0000 - -30.0025 1.0000 - -29.9799 1.0000 - -29.9726 1.0000 - -0.4309 1.0000 - 3.4495 1.0000 - 4.4823 1.0000 - 4.9614 1.0000 - 5.1769 1.0000 - 8.1972 0.0000 - 9.2037 0.0000 - 10.3016 0.0000 - 10.5059 0.0000 - 14.3943 0.0000 - 15.2824 0.0000 - - - -91.8797 1.0000 - -91.4247 1.0000 - -91.2897 1.0000 - -65.7414 1.0000 - -30.0047 1.0000 - -29.9798 1.0000 - -29.9724 1.0000 - -0.3827 1.0000 - 3.4372 1.0000 - 4.4369 1.0000 - 4.9880 1.0000 - 5.1943 1.0000 - 7.9855 0.0733 - 9.2633 0.0000 - 10.3201 0.0000 - 10.6409 0.0000 - 14.3071 0.0000 - 15.7382 0.0000 - - - -91.8800 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7413 1.0000 - -30.0109 1.0000 - -29.9795 1.0000 - -29.9718 1.0000 - -0.2406 1.0000 - 3.3744 1.0000 - 4.3644 1.0000 - 5.0412 1.0000 - 5.2443 1.0000 - 7.5476 1.0000 - 9.4153 0.0000 - 10.0599 0.0000 - 11.2380 0.0000 - 14.8208 0.0000 - 16.0819 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7412 1.0000 - -30.0200 1.0000 - -29.9789 1.0000 - -29.9710 1.0000 - -0.0152 1.0000 - 3.2090 1.0000 - 4.3636 1.0000 - 5.0929 1.0000 - 5.3207 1.0000 - 7.0926 1.0000 - 9.5502 0.0000 - 9.7938 0.0000 - 11.8036 0.0000 - 13.5951 0.0000 - 14.9192 0.0000 - - - -91.8800 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7410 1.0000 - -30.0303 1.0000 - -29.9783 1.0000 - -29.9700 1.0000 - 0.2806 1.0000 - 2.9377 1.0000 - 4.4563 1.0000 - 5.1302 1.0000 - 5.4164 1.0000 - 6.6996 1.0000 - 9.3444 0.0000 - 9.9025 0.0000 - 12.0852 0.0000 - 13.4362 0.0000 - 15.8291 0.0000 - - - -91.8795 1.0000 - -91.4245 1.0000 - -91.2895 1.0000 - -65.7407 1.0000 - -30.0402 1.0000 - -29.9776 1.0000 - -29.9691 1.0000 - 0.6271 1.0000 - 2.6012 1.0000 - 4.5958 1.0000 - 5.1415 1.0000 - 5.5298 1.0000 - 6.3932 1.0000 - 9.1313 0.0000 - 10.0660 0.0000 - 11.8833 0.0000 - 13.3141 0.0000 - 15.1866 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7406 1.0000 - -30.0479 1.0000 - -29.9771 1.0000 - -29.9684 1.0000 - 1.0037 1.0000 - 2.2324 1.0000 - 4.7288 1.0000 - 5.1208 1.0000 - 5.6641 1.0000 - 6.1656 1.0000 - 9.0233 0.0000 - 10.1524 0.0000 - 11.6108 0.0000 - 13.1453 0.0000 - 15.2752 0.0000 - - - -91.8800 1.0000 - -91.4249 1.0000 - -91.2900 1.0000 - -65.7405 1.0000 - -30.0521 1.0000 - -29.9768 1.0000 - -29.9680 1.0000 - 1.3741 1.0000 - 1.8670 1.0000 - 4.8158 1.0000 - 5.0875 1.0000 - 5.8147 1.0000 - 5.9871 1.0000 - 8.9976 0.0000 - 10.1607 0.0000 - 11.4588 0.0000 - 13.0058 0.0000 - 15.0515 0.0000 - - - -91.8795 1.0000 - -91.4245 1.0000 - -91.2895 1.0000 - -65.7413 1.0000 - -30.0017 1.0000 - -29.9814 1.0000 - -29.9793 1.0000 - -0.2798 1.0000 - 3.3917 1.0000 - 4.4650 1.0000 - 5.0319 1.0000 - 5.1692 1.0000 - 7.6464 0.9996 - 9.3147 0.0000 - 10.0458 0.0000 - 11.2372 0.0000 - 14.4922 0.0000 - 15.3633 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7412 1.0000 - -30.0039 1.0000 - -29.9812 1.0000 - -29.9792 1.0000 - -0.2318 1.0000 - 3.4031 1.0000 - 4.4148 1.0000 - 5.0453 1.0000 - 5.1799 1.0000 - 7.4709 1.0000 - 9.3790 0.0000 - 10.2465 0.0000 - 11.0981 0.0000 - 14.1220 0.0000 - 16.8656 0.0000 - - - -91.8797 1.0000 - -91.4246 1.0000 - -91.2896 1.0000 - -65.7411 1.0000 - -30.0101 1.0000 - -29.9806 1.0000 - -29.9788 1.0000 - -0.0888 1.0000 - 3.4098 1.0000 - 4.3128 1.0000 - 5.0782 1.0000 - 5.2075 1.0000 - 7.0931 1.0000 - 9.5240 0.0000 - 10.5314 0.0000 - 10.9313 0.0000 - 13.8315 0.0000 - 14.9563 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7410 1.0000 - -30.0192 1.0000 - -29.9798 1.0000 - -29.9782 1.0000 - 0.1365 1.0000 - 3.3258 1.0000 - 4.2788 1.0000 - 5.1226 1.0000 - 5.2385 1.0000 - 6.6994 1.0000 - 9.6594 0.0000 - 10.2232 0.0000 - 11.3212 0.0000 - 13.9202 0.0000 - 16.2795 0.0000 - - - -91.8801 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7408 1.0000 - -30.0296 1.0000 - -29.9790 1.0000 - -29.9776 1.0000 - 0.4308 1.0000 - 3.0973 1.0000 - 4.3838 1.0000 - 5.1738 1.0000 - 5.2576 1.0000 - 6.3799 1.0000 - 9.6051 0.0000 - 9.9623 0.0000 - 11.5706 0.0000 - 13.6078 0.0000 - 14.8495 0.0000 - - - -91.8796 1.0000 - -91.4245 1.0000 - -91.2895 1.0000 - -65.7405 1.0000 - -30.0394 1.0000 - -29.9782 1.0000 - -29.9768 1.0000 - 0.7749 1.0000 - 2.7747 1.0000 - 4.5617 1.0000 - 5.1803 1.0000 - 5.3158 1.0000 - 6.1636 1.0000 - 9.3464 0.0000 - 9.8339 0.0000 - 11.6131 0.0000 - 13.9966 0.0000 - 14.7722 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7404 1.0000 - -30.0472 1.0000 - -29.9775 1.0000 - -29.9763 1.0000 - 1.1431 1.0000 - 2.4134 1.0000 - 4.7126 1.0000 - 5.1290 1.0000 - 5.4671 1.0000 - 6.0157 1.0000 - 9.1396 0.0000 - 9.6449 0.0000 - 11.6446 0.0000 - 14.7531 0.0000 - 45.4682 0.0000 - - - -91.8802 1.0000 - -91.4251 1.0000 - -91.2902 1.0000 - -65.7404 1.0000 - -30.0514 1.0000 - -29.9772 1.0000 - -29.9760 1.0000 - 1.4899 1.0000 - 2.0701 1.0000 - 4.7840 1.0000 - 5.0904 1.0000 - 5.6669 1.0000 - 5.8686 1.0000 - 9.0434 0.0000 - 9.4853 0.0000 - 11.6814 0.0000 - 13.7976 0.0000 - 15.2308 0.0000 - - - -91.8796 1.0000 - -91.4246 1.0000 - -91.2896 1.0000 - -65.7410 1.0000 - -30.0005 1.0000 - -29.9942 1.0000 - -29.9785 1.0000 - -0.0384 1.0000 - 3.2400 1.0000 - 4.4989 1.0000 - 5.1411 1.0000 - 5.1734 1.0000 - 7.1079 1.0000 - 9.3512 0.0000 - 9.8771 0.0000 - 11.9958 0.0000 - 13.6113 0.0000 - 21.7136 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7410 1.0000 - -30.0027 1.0000 - -29.9940 1.0000 - -29.9784 1.0000 - 0.0097 1.0000 - 3.2752 1.0000 - 4.4507 1.0000 - 5.1290 1.0000 - 5.1813 1.0000 - 6.9619 1.0000 - 9.4416 0.0000 - 10.0172 0.0000 - 11.7522 0.0000 - 13.6423 0.0000 - 14.9614 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7409 1.0000 - -30.0089 1.0000 - -29.9935 1.0000 - -29.9780 1.0000 - 0.1509 1.0000 - 3.3699 1.0000 - 4.3172 1.0000 - 5.1057 1.0000 - 5.2032 1.0000 - 6.6401 1.0000 - 9.5752 0.0000 - 10.3957 0.0000 - 11.2701 0.0000 - 13.5268 0.0000 - 14.8940 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7407 1.0000 - -30.0180 1.0000 - -29.9927 1.0000 - -29.9775 1.0000 - 0.3757 1.0000 - 3.4547 1.0000 - 4.1789 1.0000 - 5.0808 1.0000 - 5.2321 1.0000 - 6.3094 1.0000 - 9.5872 0.0000 - 10.6701 0.0000 - 10.9785 0.0000 - 13.3361 0.0000 - 16.3021 0.0000 - - - -91.8798 1.0000 - -91.4247 1.0000 - -91.2897 1.0000 - -65.7405 1.0000 - -30.0284 1.0000 - -29.9918 1.0000 - -29.9768 1.0000 - 0.6661 1.0000 - 3.3528 1.0000 - 4.2329 1.0000 - 5.0410 1.0000 - 5.2587 1.0000 - 6.0667 1.0000 - 9.4049 0.0000 - 10.2926 0.0000 - 11.3119 0.0000 - 13.8752 0.0000 - 38.4800 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7403 1.0000 - -30.0384 1.0000 - -29.9910 1.0000 - -29.9762 1.0000 - 1.0012 1.0000 - 3.0611 1.0000 - 4.4746 1.0000 - 4.9804 1.0000 - 5.2893 1.0000 - 5.9349 1.0000 - 9.1205 0.0000 - 9.8404 0.0000 - 11.5936 0.0000 - 13.6823 0.0000 - 15.1706 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7401 1.0000 - -30.0461 1.0000 - -29.9903 1.0000 - -29.9758 1.0000 - 1.3562 1.0000 - 2.7118 1.0000 - 4.6771 1.0000 - 4.9797 1.0000 - 5.3623 1.0000 - 5.8533 1.0000 - 8.8711 0.0000 - 9.4054 0.0000 - 11.8042 0.0000 - 14.1600 0.0000 - 14.8362 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7401 1.0000 - -30.0504 1.0000 - -29.9899 1.0000 - -29.9755 1.0000 - 1.6624 1.0000 - 2.4033 1.0000 - 4.7026 1.0000 - 5.0589 1.0000 - 5.5288 1.0000 - 5.7361 1.0000 - 8.7332 0.0000 - 9.1257 0.0000 - 11.9246 0.0000 - 14.4000 0.0000 - 14.8474 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7407 1.0000 - -30.0089 1.0000 - -29.9991 1.0000 - -29.9776 1.0000 - 0.2750 1.0000 - 2.9834 1.0000 - 4.6018 1.0000 - 5.1861 1.0000 - 5.2760 1.0000 - 6.6473 1.0000 - 9.2218 0.0000 - 9.9612 0.0000 - 12.7917 0.0000 - 14.6660 0.0000 - 37.0432 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7407 1.0000 - -30.0087 1.0000 - -30.0013 1.0000 - -29.9775 1.0000 - 0.3237 1.0000 - 3.0324 1.0000 - 4.5699 1.0000 - 5.1962 1.0000 - 5.2285 1.0000 - 6.5349 1.0000 - 9.3249 0.0000 - 10.0206 0.0000 - 12.0589 0.0000 - 13.6356 0.0000 - 16.3395 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7406 1.0000 - -30.0082 1.0000 - -30.0075 1.0000 - -29.9771 1.0000 - 0.4629 1.0000 - 3.1773 1.0000 - 4.4588 1.0000 - 5.1107 1.0000 - 5.2302 1.0000 - 6.2832 1.0000 - 9.4510 0.0000 - 10.2180 0.0000 - 11.5408 0.0000 - 13.5178 0.0000 - 14.9785 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7404 1.0000 - -30.0167 1.0000 - -30.0075 1.0000 - -29.9766 1.0000 - 0.6833 1.0000 - 3.4070 1.0000 - 4.2516 1.0000 - 4.9747 1.0000 - 5.2836 1.0000 - 6.0299 1.0000 - 9.3115 0.0000 - 10.5371 0.0000 - 11.2041 0.0000 - 13.5198 0.0000 - 16.1069 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2905 1.0000 - -65.7402 1.0000 - -30.0271 1.0000 - -30.0066 1.0000 - -29.9760 1.0000 - 0.9662 1.0000 - 3.6247 1.0000 - 4.0527 1.0000 - 4.8364 1.0000 - 5.3481 1.0000 - 5.8553 1.0000 - 8.9510 0.0000 - 10.5646 0.0000 - 11.1623 0.0000 - 13.2954 0.0000 - 15.4682 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7400 1.0000 - -30.0371 1.0000 - -30.0058 1.0000 - -29.9754 1.0000 - 1.2872 1.0000 - 3.4438 1.0000 - 4.2743 1.0000 - 4.7030 1.0000 - 5.4051 1.0000 - 5.7716 1.0000 - 8.5488 0.0000 - 10.0763 0.0000 - 11.4481 0.0000 - 13.4035 0.0000 - 15.3922 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7398 1.0000 - -30.0450 1.0000 - -30.0051 1.0000 - -29.9749 1.0000 - 1.6159 1.0000 - 3.1051 1.0000 - 4.5944 1.0000 - 4.6676 1.0000 - 5.4494 1.0000 - 5.7286 1.0000 - 8.2204 0.0000 - 9.5427 0.0000 - 11.6960 0.0000 - 13.7216 0.0000 - 15.3053 0.0000 - - - -91.8805 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7398 1.0000 - -30.0492 1.0000 - -30.0047 1.0000 - -29.9747 1.0000 - 1.8783 1.0000 - 2.8300 1.0000 - 4.5354 1.0000 - 4.9641 1.0000 - 5.5125 1.0000 - 5.6496 1.0000 - 8.0373 0.0144 - 9.1984 0.0000 - 11.8323 0.0000 - 13.9270 0.0000 - 15.3527 0.0000 - - - -91.8801 1.0000 - -91.4252 1.0000 - -91.2901 1.0000 - -65.7404 1.0000 - -30.0228 1.0000 - -29.9977 1.0000 - -29.9766 1.0000 - 0.6424 1.0000 - 2.6545 1.0000 - 4.7408 1.0000 - 5.1925 1.0000 - 5.4185 1.0000 - 6.2853 1.0000 - 9.1528 0.0000 - 10.1154 0.0000 - 12.2959 0.0000 - 12.6644 0.0000 - 15.1835 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2910 1.0000 - -65.7404 1.0000 - -30.0228 1.0000 - -30.0000 1.0000 - -29.9766 1.0000 - 0.6883 1.0000 - 2.7077 1.0000 - 4.7264 1.0000 - 5.2034 1.0000 - 5.3412 1.0000 - 6.2150 1.0000 - 9.2183 0.0000 - 10.0975 0.0000 - 11.8514 0.0000 - 13.2505 0.0000 - 15.4538 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2911 1.0000 - -65.7403 1.0000 - -30.0223 1.0000 - -30.0062 1.0000 - -29.9762 1.0000 - 0.8257 1.0000 - 2.8686 1.0000 - 4.6756 1.0000 - 5.1155 1.0000 - 5.2552 1.0000 - 6.0553 1.0000 - 9.2590 0.0000 - 10.0607 0.0000 - 11.5620 0.0000 - 14.3861 0.0000 - 15.3778 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7401 1.0000 - -30.0215 1.0000 - -30.0154 1.0000 - -29.9757 1.0000 - 1.0393 1.0000 - 3.1357 1.0000 - 4.5429 1.0000 - 4.8526 1.0000 - 5.3235 1.0000 - 5.8912 1.0000 - 8.9678 0.0000 - 10.1859 0.0000 - 11.4775 0.0000 - 13.5169 0.0000 - 15.2678 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7399 1.0000 - -30.0259 1.0000 - -30.0207 1.0000 - -29.9751 1.0000 - 1.3079 1.0000 - 3.4975 1.0000 - 4.2537 1.0000 - 4.6695 1.0000 - 5.4215 1.0000 - 5.7678 1.0000 - 8.4790 0.0000 - 10.3583 0.0000 - 11.2562 0.0000 - 13.7957 0.0000 - 15.4576 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2903 1.0000 - -65.7397 1.0000 - -30.0359 1.0000 - -30.0199 1.0000 - -29.9745 1.0000 - 1.6071 1.0000 - 3.8504 1.0000 - 3.9497 1.0000 - 4.5723 1.0000 - 5.5290 1.0000 - 5.6928 1.0000 - 7.9970 0.0531 - 10.1882 0.0000 - 11.0596 0.0000 - 13.6172 0.0000 - 15.4580 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7395 1.0000 - -30.0438 1.0000 - -30.0193 1.0000 - -29.9740 1.0000 - 1.9028 1.0000 - 3.5236 1.0000 - 4.2368 1.0000 - 4.6294 1.0000 - 5.6020 1.0000 - 5.6607 1.0000 - 7.6208 0.9999 - 9.6622 0.0000 - 11.1234 0.0000 - 13.9670 0.0000 - 15.5268 0.0000 - - - -91.8808 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7395 1.0000 - -30.0481 1.0000 - -30.0189 1.0000 - -29.9738 1.0000 - 2.1226 1.0000 - 3.2739 1.0000 - 4.2868 1.0000 - 4.8744 1.0000 - 5.6116 1.0000 - 5.6455 1.0000 - 7.4201 1.0000 - 9.2695 0.0000 - 11.1923 0.0000 - 14.0391 0.0000 - 15.3789 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7402 1.0000 - -30.0338 1.0000 - -29.9968 1.0000 - -29.9759 1.0000 - 1.0386 1.0000 - 2.2838 1.0000 - 4.8741 1.0000 - 5.1768 1.0000 - 5.5479 1.0000 - 6.0278 1.0000 - 9.2474 0.0000 - 10.2163 0.0000 - 11.7129 0.0000 - 12.5232 0.0000 - 15.0058 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7401 1.0000 - -30.0336 1.0000 - -29.9990 1.0000 - -29.9758 1.0000 - 1.0849 1.0000 - 2.3392 1.0000 - 4.8595 1.0000 - 5.1791 1.0000 - 5.4792 1.0000 - 5.9945 1.0000 - 9.2635 0.0000 - 10.0727 0.0000 - 11.5584 0.0000 - 12.9761 0.0000 - 14.9006 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7400 1.0000 - -30.0331 1.0000 - -30.0052 1.0000 - -29.9755 1.0000 - 1.2159 1.0000 - 2.5063 1.0000 - 4.8118 1.0000 - 5.1287 1.0000 - 5.3567 1.0000 - 5.9132 1.0000 - 9.1604 0.0000 - 9.8071 0.0000 - 11.5723 0.0000 - 13.7995 0.0000 - 14.5522 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7399 1.0000 - -30.0325 1.0000 - -30.0144 1.0000 - -29.9750 1.0000 - 1.4162 1.0000 - 2.7831 1.0000 - 4.7111 1.0000 - 4.9082 1.0000 - 5.3719 1.0000 - 5.8226 1.0000 - 8.6841 0.0000 - 9.8145 0.0000 - 11.6802 0.0000 - 13.7580 0.0000 - 15.0949 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7397 1.0000 - -30.0317 1.0000 - -30.0249 1.0000 - -29.9744 1.0000 - 1.6606 1.0000 - 3.1538 1.0000 - 4.4685 1.0000 - 4.7356 1.0000 - 5.4606 1.0000 - 5.7551 1.0000 - 8.0965 0.0013 - 9.9238 0.0000 - 11.4526 0.0000 - 13.4892 0.0000 - 15.4328 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7394 1.0000 - -30.0350 1.0000 - -30.0309 1.0000 - -29.9738 1.0000 - 1.9273 1.0000 - 3.5628 1.0000 - 4.1380 1.0000 - 4.6730 1.0000 - 5.5708 1.0000 - 5.7308 1.0000 - 7.5590 1.0000 - 9.9659 0.0000 - 10.8523 0.0000 - 14.1412 0.0000 - 15.3603 0.0000 - - - -91.8813 1.0000 - -91.4263 1.0000 - -91.2912 1.0000 - -65.7394 1.0000 - -30.0429 1.0000 - -30.0304 1.0000 - -29.9734 1.0000 - 2.1834 1.0000 - 3.8283 1.0000 - 3.8862 1.0000 - 4.7204 1.0000 - 5.6527 1.0000 - 5.7690 1.0000 - 7.1423 1.0000 - 9.7054 0.0000 - 10.4694 0.0000 - 14.5817 0.0000 - 17.9482 0.0000 - - - -91.8812 1.0000 - -91.4262 1.0000 - -91.2912 1.0000 - -65.7393 1.0000 - -30.0472 1.0000 - -30.0300 1.0000 - -29.9732 1.0000 - 2.3655 1.0000 - 3.6194 1.0000 - 4.0214 1.0000 - 4.8461 1.0000 - 5.7172 1.0000 - 5.7917 1.0000 - 6.9188 1.0000 - 9.3231 0.0000 - 10.4174 0.0000 - 14.4421 0.0000 - 15.8976 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7400 1.0000 - -30.0397 1.0000 - -29.9962 1.0000 - -29.9755 1.0000 - 1.4380 1.0000 - 1.9003 1.0000 - 4.9695 1.0000 - 5.1428 1.0000 - 5.6423 1.0000 - 5.8766 1.0000 - 9.4326 0.0000 - 10.2038 0.0000 - 11.3534 0.0000 - 12.4003 0.0000 - 15.1798 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7400 1.0000 - -30.0396 1.0000 - -29.9984 1.0000 - -29.9754 1.0000 - 1.4775 1.0000 - 1.9610 1.0000 - 4.9344 1.0000 - 5.1436 1.0000 - 5.6222 1.0000 - 5.8407 1.0000 - 9.4328 0.0000 - 9.9118 0.0000 - 11.4086 0.0000 - 12.7786 0.0000 - 14.7529 0.0000 - - - -91.8802 1.0000 - -91.4253 1.0000 - -91.2902 1.0000 - -65.7399 1.0000 - -30.0391 1.0000 - -30.0046 1.0000 - -29.9751 1.0000 - 1.5884 1.0000 - 2.1473 1.0000 - 4.8263 1.0000 - 5.1395 1.0000 - 5.5663 1.0000 - 5.7671 1.0000 - 9.1881 0.0000 - 9.5548 0.0000 - 11.6103 0.0000 - 13.5641 0.0000 - 14.7151 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2902 1.0000 - -65.7397 1.0000 - -30.0384 1.0000 - -30.0138 1.0000 - -29.9746 1.0000 - 1.7510 1.0000 - 2.4554 1.0000 - 4.6493 1.0000 - 5.1054 1.0000 - 5.5016 1.0000 - 5.7219 1.0000 - 8.5259 0.0000 - 9.5738 0.0000 - 11.7986 0.0000 - 14.0607 0.0000 - 14.5081 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2904 1.0000 - -65.7395 1.0000 - -30.0377 1.0000 - -30.0244 1.0000 - -29.9740 1.0000 - 1.9503 1.0000 - 2.8575 1.0000 - 4.4232 1.0000 - 5.0190 1.0000 - 5.4953 1.0000 - 5.7259 1.0000 - 7.8787 0.5228 - 9.6218 0.0000 - 11.5688 0.0000 - 13.6440 0.0000 - 15.2299 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7393 1.0000 - -30.0369 1.0000 - -30.0345 1.0000 - -29.9735 1.0000 - 2.1724 1.0000 - 3.2887 1.0000 - 4.1759 1.0000 - 4.9222 1.0000 - 5.5665 1.0000 - 5.7737 1.0000 - 7.3144 1.0000 - 9.6562 0.0000 - 10.8484 0.0000 - 13.8758 0.0000 - 15.6076 0.0000 - - - -91.8813 1.0000 - -91.4263 1.0000 - -91.2913 1.0000 - -65.7392 1.0000 - -30.0424 1.0000 - -30.0364 1.0000 - -29.9731 1.0000 - 2.3889 1.0000 - 3.6451 1.0000 - 3.9430 1.0000 - 4.8684 1.0000 - 5.6997 1.0000 - 5.8611 1.0000 - 6.8688 1.0000 - 9.6086 0.0000 - 10.1393 0.0000 - 15.1730 0.0000 - 16.3079 0.0000 - - - -91.8813 1.0000 - -91.4263 1.0000 - -91.2913 1.0000 - -65.7391 1.0000 - -30.0467 1.0000 - -30.0360 1.0000 - -29.9728 1.0000 - 2.5397 1.0000 - 3.7856 1.0000 - 3.8326 1.0000 - 4.8610 1.0000 - 5.8430 1.0000 - 5.9453 1.0000 - 6.5965 1.0000 - 9.3465 0.0000 - 9.8978 0.0000 - 15.1892 0.0000 - 16.2199 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2900 1.0000 - -65.7403 1.0000 - -30.0144 1.0000 - -29.9990 1.0000 - -29.9656 1.0000 - 0.0785 1.0000 - 2.7125 1.0000 - 4.5094 1.0000 - 4.6940 1.0000 - 4.9214 1.0000 - 8.5745 0.0000 - 10.1269 0.0000 - 10.5365 0.0000 - 10.8704 0.0000 - 13.9768 0.0000 - 14.6979 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7402 1.0000 - -30.0143 1.0000 - -30.0012 1.0000 - -29.9654 1.0000 - 0.1273 1.0000 - 2.6983 1.0000 - 4.4779 1.0000 - 4.7369 1.0000 - 4.9443 1.0000 - 8.3529 0.0000 - 10.1419 0.0000 - 10.4344 0.0000 - 11.1645 0.0000 - 13.6110 0.0000 - 14.5556 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7401 1.0000 - -30.0140 1.0000 - -30.0074 1.0000 - -29.9649 1.0000 - 0.2683 1.0000 - 2.6518 1.0000 - 4.4352 1.0000 - 4.8169 1.0000 - 5.0107 1.0000 - 7.8922 0.4469 - 10.1231 0.0000 - 10.2307 0.0000 - 11.8214 0.0000 - 13.2548 0.0000 - 14.5906 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7399 1.0000 - -30.0165 1.0000 - -30.0135 1.0000 - -29.9640 1.0000 - 0.4880 1.0000 - 2.5740 1.0000 - 4.4223 1.0000 - 4.8957 1.0000 - 5.1141 1.0000 - 7.4082 1.0000 - 9.8145 0.0000 - 10.2589 0.0000 - 12.5295 0.0000 - 12.7207 0.0000 - 14.5641 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7397 1.0000 - -30.0269 1.0000 - -30.0129 1.0000 - -29.9631 1.0000 - 0.7614 1.0000 - 2.4691 1.0000 - 4.4450 1.0000 - 4.9606 1.0000 - 5.2429 1.0000 - 6.9802 1.0000 - 9.4992 0.0000 - 10.2989 0.0000 - 12.2571 0.0000 - 12.7704 0.0000 - 14.6183 0.0000 - - - -91.8797 1.0000 - -91.4247 1.0000 - -91.2897 1.0000 - -65.7395 1.0000 - -30.0369 1.0000 - -30.0123 1.0000 - -29.9621 1.0000 - 1.0553 1.0000 - 2.3467 1.0000 - 4.4910 1.0000 - 5.0061 1.0000 - 5.3805 1.0000 - 6.6366 1.0000 - 9.2609 0.0000 - 10.3038 0.0000 - 11.8735 0.0000 - 12.5601 0.0000 - 15.5151 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7394 1.0000 - -30.0447 1.0000 - -30.0119 1.0000 - -29.9614 1.0000 - 1.3266 1.0000 - 2.2198 1.0000 - 4.5371 1.0000 - 5.0314 1.0000 - 5.5048 1.0000 - 6.3900 1.0000 - 9.1261 0.0000 - 10.2612 0.0000 - 11.5989 0.0000 - 12.2895 0.0000 - 15.2894 0.0000 - - - -91.8792 1.0000 - -91.4242 1.0000 - -91.2892 1.0000 - -65.7392 1.0000 - -30.0489 1.0000 - -30.0116 1.0000 - -29.9610 1.0000 - 1.5141 1.0000 - 2.1185 1.0000 - 4.5650 1.0000 - 5.0425 1.0000 - 5.5850 1.0000 - 6.2547 1.0000 - 9.0783 0.0000 - 10.2059 0.0000 - 11.4660 0.0000 - 12.1310 0.0000 - 14.9984 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7402 1.0000 - -30.0143 1.0000 - -29.9987 1.0000 - -29.9687 1.0000 - 0.1308 1.0000 - 2.7052 1.0000 - 4.5062 1.0000 - 4.7211 1.0000 - 4.9341 1.0000 - 8.2944 0.0000 - 10.1322 0.0000 - 10.7510 0.0000 - 10.8939 0.0000 - 14.0685 0.0000 - 19.2975 0.0000 - - - -91.8799 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7402 1.0000 - -30.0141 1.0000 - -30.0009 1.0000 - -29.9685 1.0000 - 0.1799 1.0000 - 2.6961 1.0000 - 4.4700 1.0000 - 4.7546 1.0000 - 4.9662 1.0000 - 8.0964 0.0013 - 10.1465 0.0000 - 10.7223 0.0000 - 11.0608 0.0000 - 13.4843 0.0000 - 14.7098 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7400 1.0000 - -30.0138 1.0000 - -30.0071 1.0000 - -29.9680 1.0000 - 0.3214 1.0000 - 2.6647 1.0000 - 4.4164 1.0000 - 4.8132 1.0000 - 5.0527 1.0000 - 7.6707 0.9986 - 10.1672 0.0000 - 10.4384 0.0000 - 11.6127 0.0000 - 13.1255 0.0000 - 15.0675 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7399 1.0000 - -30.0163 1.0000 - -30.0133 1.0000 - -29.9671 1.0000 - 0.5403 1.0000 - 2.6055 1.0000 - 4.3962 1.0000 - 4.8703 1.0000 - 5.1699 1.0000 - 7.2169 1.0000 - 9.9996 0.0000 - 10.2485 0.0000 - 11.9915 0.0000 - 13.4963 0.0000 - 14.9307 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7397 1.0000 - -30.0266 1.0000 - -30.0127 1.0000 - -29.9662 1.0000 - 0.8138 1.0000 - 2.5179 1.0000 - 4.4217 1.0000 - 4.9184 1.0000 - 5.2999 1.0000 - 6.8210 1.0000 - 9.6472 0.0000 - 10.2064 0.0000 - 11.8412 0.0000 - 13.2636 0.0000 - 14.4602 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7395 1.0000 - -30.0366 1.0000 - -30.0121 1.0000 - -29.9653 1.0000 - 1.1061 1.0000 - 2.4089 1.0000 - 4.4770 1.0000 - 4.9499 1.0000 - 5.4309 1.0000 - 6.5164 1.0000 - 9.3564 0.0000 - 10.0920 0.0000 - 11.6293 0.0000 - 13.0657 0.0000 - 15.1621 0.0000 - - - -91.8797 1.0000 - -91.4247 1.0000 - -91.2897 1.0000 - -65.7393 1.0000 - -30.0444 1.0000 - -30.0117 1.0000 - -29.9646 1.0000 - 1.3737 1.0000 - 2.2928 1.0000 - 4.5311 1.0000 - 4.9651 1.0000 - 5.5497 1.0000 - 6.3103 1.0000 - 9.1728 0.0000 - 9.9154 0.0000 - 11.5234 0.0000 - 12.7770 0.0000 - 15.3120 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7392 1.0000 - -30.0487 1.0000 - -30.0114 1.0000 - -29.9642 1.0000 - 1.5535 1.0000 - 2.2004 1.0000 - 4.5595 1.0000 - 4.9718 1.0000 - 5.6296 1.0000 - 6.2011 1.0000 - 9.0958 0.0000 - 9.7761 0.0000 - 11.4975 0.0000 - 12.5932 0.0000 - 15.0907 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7400 1.0000 - -30.0138 1.0000 - -29.9979 1.0000 - -29.9775 1.0000 - 0.2825 1.0000 - 2.6761 1.0000 - 4.5064 1.0000 - 4.8000 1.0000 - 4.9688 1.0000 - 7.7564 0.9630 - 10.1137 0.0000 - 10.4867 0.0000 - 11.6479 0.0000 - 13.3919 0.0000 - 14.4508 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7400 1.0000 - -30.0137 1.0000 - -30.0001 1.0000 - -29.9773 1.0000 - 0.3313 1.0000 - 2.6826 1.0000 - 4.4604 1.0000 - 4.8061 1.0000 - 5.0256 1.0000 - 7.5867 1.0000 - 10.1283 0.0000 - 10.6729 0.0000 - 11.4680 0.0000 - 13.1394 0.0000 - 14.3328 0.0000 - - - -91.8797 1.0000 - -91.4247 1.0000 - -91.2897 1.0000 - -65.7398 1.0000 - -30.0133 1.0000 - -30.0063 1.0000 - -29.9768 1.0000 - 0.4736 1.0000 - 2.6942 1.0000 - 4.3753 1.0000 - 4.8323 1.0000 - 5.1415 1.0000 - 7.2084 1.0000 - 10.1072 0.0000 - 10.9314 0.0000 - 11.2329 0.0000 - 12.9608 0.0000 - 14.6853 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2900 1.0000 - -65.7397 1.0000 - -30.0155 1.0000 - -30.0128 1.0000 - -29.9760 1.0000 - 0.6917 1.0000 - 2.6939 1.0000 - 4.3211 1.0000 - 4.8693 1.0000 - 5.2665 1.0000 - 6.8005 1.0000 - 9.9630 0.0000 - 10.5675 0.0000 - 11.4806 0.0000 - 13.0652 0.0000 - 14.4338 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7395 1.0000 - -30.0259 1.0000 - -30.0122 1.0000 - -29.9751 1.0000 - 0.9628 1.0000 - 2.6633 1.0000 - 4.3343 1.0000 - 4.8939 1.0000 - 5.3859 1.0000 - 6.4620 1.0000 - 9.6578 0.0000 - 10.1908 0.0000 - 11.5257 0.0000 - 13.6164 0.0000 - 15.5505 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7393 1.0000 - -30.0359 1.0000 - -30.0116 1.0000 - -29.9742 1.0000 - 1.2487 1.0000 - 2.5974 1.0000 - 4.4087 1.0000 - 4.8823 1.0000 - 5.5018 1.0000 - 6.2380 1.0000 - 9.3183 0.0000 - 9.7979 0.0000 - 11.5299 0.0000 - 13.8800 0.0000 - 14.6587 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7391 1.0000 - -30.0437 1.0000 - -30.0112 1.0000 - -29.9735 1.0000 - 1.5051 1.0000 - 2.5119 1.0000 - 4.4950 1.0000 - 4.8424 1.0000 - 5.6205 1.0000 - 6.1187 1.0000 - 9.0647 0.0000 - 9.4200 0.0000 - 11.5701 0.0000 - 13.6103 0.0000 - 15.8073 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7390 1.0000 - -30.0480 1.0000 - -30.0110 1.0000 - -29.9731 1.0000 - 1.6705 1.0000 - 2.4419 1.0000 - 4.5400 1.0000 - 4.8182 1.0000 - 5.7164 1.0000 - 6.0601 1.0000 - 8.9498 0.0000 - 9.1654 0.0000 - 11.6090 0.0000 - 13.4604 0.0000 - 15.4612 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7397 1.0000 - -30.0130 1.0000 - -29.9967 1.0000 - -29.9905 1.0000 - 0.5171 1.0000 - 2.6203 1.0000 - 4.5293 1.0000 - 4.9234 1.0000 - 5.0169 1.0000 - 7.2171 1.0000 - 9.9208 0.0000 - 10.3388 0.0000 - 12.4204 0.0000 - 12.7407 0.0000 - 14.2892 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7397 1.0000 - -30.0129 1.0000 - -29.9989 1.0000 - -29.9903 1.0000 - 0.5656 1.0000 - 2.6459 1.0000 - 4.4784 1.0000 - 4.8801 1.0000 - 5.1125 1.0000 - 7.0689 1.0000 - 9.9752 0.0000 - 10.4280 0.0000 - 12.5187 0.0000 - 32.9739 0.0000 - 35.7387 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7396 1.0000 - -30.0125 1.0000 - -30.0051 1.0000 - -29.9898 1.0000 - 0.7061 1.0000 - 2.7176 1.0000 - 4.3568 1.0000 - 4.8822 1.0000 - 5.2415 1.0000 - 6.7298 1.0000 - 9.8871 0.0000 - 10.7646 0.0000 - 11.4466 0.0000 - 14.5915 0.0000 - 38.5493 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2900 1.0000 - -65.7394 1.0000 - -30.0143 1.0000 - -30.0120 1.0000 - -29.9890 1.0000 - 0.9230 1.0000 - 2.8144 1.0000 - 4.2395 1.0000 - 4.9255 1.0000 - 5.3419 1.0000 - 6.3667 1.0000 - 9.5538 0.0000 - 11.0084 0.0000 - 11.1693 0.0000 - 13.0107 0.0000 - 14.8133 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7392 1.0000 - -30.0248 1.0000 - -30.0115 1.0000 - -29.9881 1.0000 - 1.1884 1.0000 - 2.8932 1.0000 - 4.1953 1.0000 - 4.9555 1.0000 - 5.3985 1.0000 - 6.1037 1.0000 - 9.0980 0.0000 - 10.5664 0.0000 - 11.4010 0.0000 - 13.2814 0.0000 - 14.7039 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7390 1.0000 - -30.0349 1.0000 - -30.0110 1.0000 - -29.9873 1.0000 - 1.4648 1.0000 - 2.9108 1.0000 - 4.2604 1.0000 - 4.8930 1.0000 - 5.4670 1.0000 - 5.9927 1.0000 - 8.6547 0.0000 - 10.0335 0.0000 - 11.5522 0.0000 - 13.8640 0.0000 - 14.7888 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7389 1.0000 - -30.0427 1.0000 - -30.0105 1.0000 - -29.9866 1.0000 - 1.7087 1.0000 - 2.8704 1.0000 - 4.3914 1.0000 - 4.7599 1.0000 - 5.6061 1.0000 - 5.9584 1.0000 - 8.3087 0.0000 - 9.5375 0.0000 - 11.6648 0.0000 - 14.4457 0.0000 - 14.7936 0.0000 - - - -91.8810 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7388 1.0000 - -30.0470 1.0000 - -30.0104 1.0000 - -29.9863 1.0000 - 1.8594 1.0000 - 2.8218 1.0000 - 4.4916 1.0000 - 4.6640 1.0000 - 5.7708 1.0000 - 5.9044 1.0000 - 8.1176 0.0004 - 9.2281 0.0000 - 11.7299 0.0000 - 14.3458 0.0000 - 15.1540 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7395 1.0000 - -30.0121 1.0000 - -30.0053 1.0000 - -29.9953 1.0000 - 0.8079 1.0000 - 2.5334 1.0000 - 4.5838 1.0000 - 5.0666 1.0000 - 5.0783 1.0000 - 6.7500 1.0000 - 9.6333 0.0000 - 10.3108 0.0000 - 12.2505 0.0000 - 12.6826 0.0000 - 14.7554 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7394 1.0000 - -30.0120 1.0000 - -30.0051 1.0000 - -29.9975 1.0000 - 0.8563 1.0000 - 2.5778 1.0000 - 4.5415 1.0000 - 4.9542 1.0000 - 5.2219 1.0000 - 6.6261 1.0000 - 9.6800 0.0000 - 10.3030 0.0000 - 11.8282 0.0000 - 13.2292 0.0000 - 14.7293 0.0000 - - - -91.8806 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7393 1.0000 - -30.0117 1.0000 - -30.0046 1.0000 - -30.0037 1.0000 - 0.9944 1.0000 - 2.7079 1.0000 - 4.4058 1.0000 - 4.9318 1.0000 - 5.3400 1.0000 - 6.3377 1.0000 - 9.5130 0.0000 - 10.4672 0.0000 - 11.4998 0.0000 - 13.8778 0.0000 - 18.0925 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7391 1.0000 - -30.0130 1.0000 - -30.0112 1.0000 - -30.0039 1.0000 - 1.2055 1.0000 - 2.9156 1.0000 - 4.2276 1.0000 - 4.9929 1.0000 - 5.3616 1.0000 - 6.0549 1.0000 - 9.0232 0.0000 - 10.8076 0.0000 - 11.3166 0.0000 - 13.1705 0.0000 - 14.8540 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7389 1.0000 - -30.0235 1.0000 - -30.0107 1.0000 - -30.0030 1.0000 - 1.4620 1.0000 - 3.1623 1.0000 - 4.0828 1.0000 - 5.0864 1.0000 - 5.2214 1.0000 - 5.9363 1.0000 - 8.4563 0.0000 - 10.8355 0.0000 - 11.2520 0.0000 - 13.1419 0.0000 - 15.5800 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7387 1.0000 - -30.0336 1.0000 - -30.0102 1.0000 - -30.0022 1.0000 - 1.7297 1.0000 - 3.3337 1.0000 - 4.0790 1.0000 - 4.9123 1.0000 - 5.2921 1.0000 - 5.9385 1.0000 - 7.9391 0.2131 - 10.2850 0.0000 - 11.4643 0.0000 - 13.4225 0.0000 - 15.4710 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2909 1.0000 - -65.7386 1.0000 - -30.0415 1.0000 - -30.0098 1.0000 - -30.0016 1.0000 - 1.9664 1.0000 - 3.3331 1.0000 - 4.2564 1.0000 - 4.6894 1.0000 - 5.4784 1.0000 - 5.9482 1.0000 - 7.5447 1.0000 - 9.6945 0.0000 - 11.6252 0.0000 - 13.7684 0.0000 - 15.1176 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7385 1.0000 - -30.0458 1.0000 - -30.0096 1.0000 - -30.0012 1.0000 - 2.1159 1.0000 - 3.2777 1.0000 - 4.4136 1.0000 - 4.5730 1.0000 - 5.6529 1.0000 - 5.9143 1.0000 - 7.3340 1.0000 - 9.3087 0.0000 - 11.7152 0.0000 - 14.2992 0.0000 - 15.1018 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7391 1.0000 - -30.0194 1.0000 - -30.0113 1.0000 - -29.9940 1.0000 - 1.1188 1.0000 - 2.4225 1.0000 - 4.6599 1.0000 - 5.1059 1.0000 - 5.2458 1.0000 - 6.3781 1.0000 - 9.4462 0.0000 - 10.2515 0.0000 - 11.8462 0.0000 - 12.3849 0.0000 - 15.2872 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7391 1.0000 - -30.0192 1.0000 - -30.0112 1.0000 - -29.9962 1.0000 - 1.1663 1.0000 - 2.4798 1.0000 - 4.6338 1.0000 - 5.0065 1.0000 - 5.3465 1.0000 - 6.2884 1.0000 - 9.4413 0.0000 - 10.1362 0.0000 - 11.5983 0.0000 - 12.9221 0.0000 - 14.9830 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2905 1.0000 - -65.7390 1.0000 - -30.0187 1.0000 - -30.0108 1.0000 - -30.0025 1.0000 - 1.2998 1.0000 - 2.6535 1.0000 - 4.5224 1.0000 - 4.9355 1.0000 - 5.4403 1.0000 - 6.0847 1.0000 - 9.1320 0.0000 - 10.1355 0.0000 - 11.4935 0.0000 - 14.1593 0.0000 - 15.0031 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7388 1.0000 - -30.0181 1.0000 - -30.0118 1.0000 - -30.0103 1.0000 - 1.5018 1.0000 - 2.9434 1.0000 - 4.3332 1.0000 - 4.9416 1.0000 - 5.4009 1.0000 - 5.9358 1.0000 - 8.5164 0.0000 - 10.3690 0.0000 - 11.4796 0.0000 - 13.6233 0.0000 - 15.4168 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7386 1.0000 - -30.0224 1.0000 - -30.0173 1.0000 - -30.0098 1.0000 - 1.7486 1.0000 - 3.3382 1.0000 - 4.1257 1.0000 - 4.9091 1.0000 - 5.2805 1.0000 - 5.9294 1.0000 - 7.8705 0.5687 - 10.5822 0.0000 - 11.3190 0.0000 - 14.4746 0.0000 - 15.4084 0.0000 - - - -91.8812 1.0000 - -91.4262 1.0000 - -91.2911 1.0000 - -65.7384 1.0000 - -30.0325 1.0000 - -30.0165 1.0000 - -30.0094 1.0000 - 2.0137 1.0000 - 3.7924 1.0000 - 3.9366 1.0000 - 4.7182 1.0000 - 5.3253 1.0000 - 5.9653 1.0000 - 7.2969 1.0000 - 10.3874 0.0000 - 11.1648 0.0000 - 13.7918 0.0000 - 15.7649 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2910 1.0000 - -65.7383 1.0000 - -30.0404 1.0000 - -30.0159 1.0000 - -30.0090 1.0000 - 2.2614 1.0000 - 3.7478 1.0000 - 4.2324 1.0000 - 4.5462 1.0000 - 5.4530 1.0000 - 5.9817 1.0000 - 6.8661 1.0000 - 9.8164 0.0000 - 11.2354 0.0000 - 13.3824 0.0000 - 15.4946 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2909 1.0000 - -65.7382 1.0000 - -30.0447 1.0000 - -30.0156 1.0000 - -30.0087 1.0000 - 2.4276 1.0000 - 3.6308 1.0000 - 4.3095 1.0000 - 4.6704 1.0000 - 5.5414 1.0000 - 5.9604 1.0000 - 6.6554 1.0000 - 9.3847 0.0000 - 11.2998 0.0000 - 13.4998 0.0000 - 15.5406 0.0000 - - - -91.8812 1.0000 - -91.4262 1.0000 - -91.2911 1.0000 - -65.7389 1.0000 - -30.0304 1.0000 - -30.0107 1.0000 - -29.9930 1.0000 - 1.4059 1.0000 - 2.2991 1.0000 - 4.7303 1.0000 - 5.1280 1.0000 - 5.4014 1.0000 - 6.1085 1.0000 - 9.4200 0.0000 - 10.1068 0.0000 - 11.5735 0.0000 - 12.0510 0.0000 - 15.2640 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2908 1.0000 - -65.7389 1.0000 - -30.0302 1.0000 - -30.0105 1.0000 - -29.9952 1.0000 - 1.4496 1.0000 - 2.3666 1.0000 - 4.7143 1.0000 - 5.0343 1.0000 - 5.4738 1.0000 - 6.0596 1.0000 - 9.3470 0.0000 - 9.8894 0.0000 - 11.4911 0.0000 - 12.5501 0.0000 - 15.0042 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7387 1.0000 - -30.0298 1.0000 - -30.0102 1.0000 - -30.0014 1.0000 - 1.5741 1.0000 - 2.5692 1.0000 - 4.6449 1.0000 - 4.8922 1.0000 - 5.5587 1.0000 - 5.9560 1.0000 - 8.8420 0.0000 - 9.8198 0.0000 - 11.5326 0.0000 - 13.4548 0.0000 - 15.3070 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2903 1.0000 - -65.7385 1.0000 - -30.0291 1.0000 - -30.0108 1.0000 - -30.0097 1.0000 - 1.7645 1.0000 - 2.9023 1.0000 - 4.5006 1.0000 - 4.7818 1.0000 - 5.5503 1.0000 - 5.9099 1.0000 - 8.1185 0.0004 - 9.9431 0.0000 - 11.5982 0.0000 - 14.1559 0.0000 - 15.5155 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7383 1.0000 - -30.0283 1.0000 - -30.0214 1.0000 - -30.0092 1.0000 - 2.0055 1.0000 - 3.3368 1.0000 - 4.3451 1.0000 - 4.6481 1.0000 - 5.4981 1.0000 - 5.9423 1.0000 - 7.4143 1.0000 - 10.0772 0.0000 - 11.5013 0.0000 - 14.0698 0.0000 - 15.1813 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7382 1.0000 - -30.0316 1.0000 - -30.0276 1.0000 - -30.0088 1.0000 - 2.2811 1.0000 - 3.7459 1.0000 - 4.2885 1.0000 - 4.4782 1.0000 - 5.5123 1.0000 - 5.9815 1.0000 - 6.7976 1.0000 - 10.1223 0.0000 - 10.9975 0.0000 - 13.3162 0.0000 - 35.4508 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7380 1.0000 - -30.0395 1.0000 - -30.0270 1.0000 - -30.0084 1.0000 - 2.5605 1.0000 - 3.8201 1.0000 - 4.2232 1.0000 - 4.6720 1.0000 - 5.5887 1.0000 - 5.9853 1.0000 - 6.3304 1.0000 - 9.8542 0.0000 - 10.6312 0.0000 - 13.3008 0.0000 - 15.9780 0.0000 - - - -91.8815 1.0000 - -91.4265 1.0000 - -91.2915 1.0000 - -65.7380 1.0000 - -30.0439 1.0000 - -30.0268 1.0000 - -30.0082 1.0000 - 2.7690 1.0000 - 3.7318 1.0000 - 4.1082 1.0000 - 5.0768 1.0000 - 5.5474 1.0000 - 5.9652 1.0000 - 6.1318 1.0000 - 9.4421 0.0000 - 10.5773 0.0000 - 13.3598 0.0000 - 15.6239 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2911 1.0000 - -65.7388 1.0000 - -30.0364 1.0000 - -30.0103 1.0000 - -29.9924 1.0000 - 1.6041 1.0000 - 2.1949 1.0000 - 4.7707 1.0000 - 5.1368 1.0000 - 5.5104 1.0000 - 5.9515 1.0000 - 9.5274 0.0000 - 9.9063 0.0000 - 11.4475 0.0000 - 11.8572 0.0000 - 14.7311 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2905 1.0000 - -65.7387 1.0000 - -30.0362 1.0000 - -30.0101 1.0000 - -29.9946 1.0000 - 1.6419 1.0000 - 2.2709 1.0000 - 4.7507 1.0000 - 5.0499 1.0000 - 5.5743 1.0000 - 5.9294 1.0000 - 9.4032 0.0000 - 9.6388 0.0000 - 11.4753 0.0000 - 12.3145 0.0000 - 15.0586 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7386 1.0000 - -30.0358 1.0000 - -30.0099 1.0000 - -30.0009 1.0000 - 1.7525 1.0000 - 2.4947 1.0000 - 4.6872 1.0000 - 4.8807 1.0000 - 5.6780 1.0000 - 5.8786 1.0000 - 8.6877 0.0000 - 9.6263 0.0000 - 11.5761 0.0000 - 13.1883 0.0000 - 15.0368 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2909 1.0000 - -65.7384 1.0000 - -30.0351 1.0000 - -30.0103 1.0000 - -30.0094 1.0000 - 1.9301 1.0000 - 2.8492 1.0000 - 4.5787 1.0000 - 4.7121 1.0000 - 5.7281 1.0000 - 5.8578 1.0000 - 7.8952 0.4304 - 9.6755 0.0000 - 11.6667 0.0000 - 14.3103 0.0000 - 38.9176 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2909 1.0000 - -65.7382 1.0000 - -30.0344 1.0000 - -30.0209 1.0000 - -30.0089 1.0000 - 2.1704 1.0000 - 3.2839 1.0000 - 4.4368 1.0000 - 4.5966 1.0000 - 5.6971 1.0000 - 5.9055 1.0000 - 7.1618 1.0000 - 9.7305 0.0000 - 11.5519 0.0000 - 13.7092 0.0000 - 15.1518 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7380 1.0000 - -30.0336 1.0000 - -30.0310 1.0000 - -30.0084 1.0000 - 2.4625 1.0000 - 3.6552 1.0000 - 4.2572 1.0000 - 4.6667 1.0000 - 5.6659 1.0000 - 5.9462 1.0000 - 6.5416 1.0000 - 9.7701 0.0000 - 11.0159 0.0000 - 13.7528 0.0000 - 15.5596 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7379 1.0000 - -30.0390 1.0000 - -30.0331 1.0000 - -30.0080 1.0000 - 2.7831 1.0000 - 3.7889 1.0000 - 4.0361 1.0000 - 5.0350 1.0000 - 5.6638 1.0000 - 5.9246 1.0000 - 6.1048 1.0000 - 9.7327 0.0000 - 10.2984 0.0000 - 13.3147 0.0000 - 15.4211 0.0000 - - - -91.8812 1.0000 - -91.4262 1.0000 - -91.2912 1.0000 - -65.7378 1.0000 - -30.0434 1.0000 - -30.0328 1.0000 - -30.0078 1.0000 - 3.0626 1.0000 - 3.7463 1.0000 - 3.8683 1.0000 - 5.4341 1.0000 - 5.6823 1.0000 - 5.7756 1.0000 - 5.9556 1.0000 - 9.4675 0.0000 - 10.0217 0.0000 - 13.3491 0.0000 - 16.1206 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7397 1.0000 - -30.0332 1.0000 - -29.9970 1.0000 - -29.9635 1.0000 - 0.5736 1.0000 - 2.1119 1.0000 - 4.5165 1.0000 - 4.5676 1.0000 - 4.7863 1.0000 - 8.6168 0.0000 - 10.8092 0.0000 - 11.1222 0.0000 - 11.2007 0.0000 - 14.0197 0.0000 - 39.2698 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7395 1.0000 - -30.0330 1.0000 - -29.9991 1.0000 - -29.9633 1.0000 - 0.6291 1.0000 - 2.0977 1.0000 - 4.5093 1.0000 - 4.5944 1.0000 - 4.8096 1.0000 - 8.4094 0.0000 - 10.7035 0.0000 - 11.1656 0.0000 - 11.6529 0.0000 - 14.1405 0.0000 - 41.5789 0.0000 - - - -91.8796 1.0000 - -91.4247 1.0000 - -91.2896 1.0000 - -65.7394 1.0000 - -30.0326 1.0000 - -30.0053 1.0000 - -29.9627 1.0000 - 0.7865 1.0000 - 2.0532 1.0000 - 4.5078 1.0000 - 4.6507 1.0000 - 4.8773 1.0000 - 7.9670 0.1168 - 10.4342 0.0000 - 11.1229 0.0000 - 12.2041 0.0000 - 12.2648 0.0000 - 14.3078 0.0000 - - - -91.8795 1.0000 - -91.4245 1.0000 - -91.2895 1.0000 - -65.7392 1.0000 - -30.0322 1.0000 - -30.0144 1.0000 - -29.9619 1.0000 - 1.0275 1.0000 - 1.9962 1.0000 - 4.5159 1.0000 - 4.7211 1.0000 - 4.9818 1.0000 - 7.4959 1.0000 - 10.0943 0.0000 - 11.0206 0.0000 - 11.8767 0.0000 - 13.0219 0.0000 - 14.6524 0.0000 - - - -91.8795 1.0000 - -91.4245 1.0000 - -91.2895 1.0000 - -65.7390 1.0000 - -30.0316 1.0000 - -30.0249 1.0000 - -29.9609 1.0000 - 1.3090 1.0000 - 1.9542 1.0000 - 4.5205 1.0000 - 4.7985 1.0000 - 5.1102 1.0000 - 7.0804 1.0000 - 9.7491 0.0000 - 10.7814 0.0000 - 12.7825 0.0000 - 14.2666 0.0000 - 40.5060 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7388 1.0000 - -30.0349 1.0000 - -30.0311 1.0000 - -29.9600 1.0000 - 1.5312 1.0000 - 1.9991 1.0000 - 4.5052 1.0000 - 4.8754 1.0000 - 5.2431 1.0000 - 6.7527 1.0000 - 9.4493 0.0000 - 10.4582 0.0000 - 11.6293 0.0000 - 12.3813 0.0000 - 15.5445 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7387 1.0000 - -30.0428 1.0000 - -30.0307 1.0000 - -29.9593 1.0000 - 1.5968 1.0000 - 2.1802 1.0000 - 4.4669 1.0000 - 4.9394 1.0000 - 5.3556 1.0000 - 6.5274 1.0000 - 9.2375 0.0000 - 10.2067 0.0000 - 12.0084 0.0000 - 14.2385 0.0000 - 36.2448 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2901 1.0000 - -65.7386 1.0000 - -30.0470 1.0000 - -30.0305 1.0000 - -29.9589 1.0000 - 1.5982 1.0000 - 2.3352 1.0000 - 4.4290 1.0000 - 4.9767 1.0000 - 5.4211 1.0000 - 6.4124 1.0000 - 9.1302 0.0000 - 10.0506 0.0000 - 11.6269 0.0000 - 11.8418 0.0000 - 15.0676 0.0000 - - - -91.8800 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7395 1.0000 - -30.0330 1.0000 - -29.9966 1.0000 - -29.9665 1.0000 - 0.6330 1.0000 - 2.1018 1.0000 - 4.5271 1.0000 - 4.5956 1.0000 - 4.7951 1.0000 - 8.3518 0.0000 - 11.1089 0.0000 - 11.1684 0.0000 - 13.7806 0.0000 - 14.1363 0.0000 - 19.9386 0.0000 - - - -91.8801 1.0000 - -91.4251 1.0000 - -91.2900 1.0000 - -65.7395 1.0000 - -30.0328 1.0000 - -29.9988 1.0000 - -29.9664 1.0000 - 0.6878 1.0000 - 2.0898 1.0000 - 4.5140 1.0000 - 4.6007 1.0000 - 4.8434 1.0000 - 8.1649 0.0000 - 10.9818 0.0000 - 11.1274 0.0000 - 11.4259 0.0000 - 13.4427 0.0000 - 14.6883 0.0000 - - - -91.8794 1.0000 - -91.4244 1.0000 - -91.2894 1.0000 - -65.7393 1.0000 - -30.0325 1.0000 - -30.0049 1.0000 - -29.9658 1.0000 - 0.8465 1.0000 - 2.0591 1.0000 - 4.4969 1.0000 - 4.6223 1.0000 - 4.9548 1.0000 - 7.7541 0.9656 - 10.6858 0.0000 - 11.0717 0.0000 - 11.8125 0.0000 - 12.3245 0.0000 - 14.7406 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2898 1.0000 - -65.7392 1.0000 - -30.0320 1.0000 - -30.0142 1.0000 - -29.9650 1.0000 - 1.0875 1.0000 - 2.0159 1.0000 - 4.4997 1.0000 - 4.6561 1.0000 - 5.0929 1.0000 - 7.3100 1.0000 - 10.3059 0.0000 - 10.8388 0.0000 - 11.7195 0.0000 - 13.5031 0.0000 - 14.7149 0.0000 - - - -91.8797 1.0000 - -91.4247 1.0000 - -91.2896 1.0000 - -65.7389 1.0000 - -30.0315 1.0000 - -30.0246 1.0000 - -29.9641 1.0000 - 1.3668 1.0000 - 1.9926 1.0000 - 4.5154 1.0000 - 4.6963 1.0000 - 5.2390 1.0000 - 6.9228 1.0000 - 9.9077 0.0000 - 10.4464 0.0000 - 11.5965 0.0000 - 13.3203 0.0000 - 14.3775 0.0000 - - - -91.8799 1.0000 - -91.4249 1.0000 - -91.2899 1.0000 - -65.7388 1.0000 - -30.0347 1.0000 - -30.0310 1.0000 - -29.9632 1.0000 - 1.5777 1.0000 - 2.0640 1.0000 - 4.5124 1.0000 - 4.7455 1.0000 - 5.3763 1.0000 - 6.6315 1.0000 - 9.5524 0.0000 - 10.0473 0.0000 - 12.1279 0.0000 - 14.4175 0.0000 - 15.1742 0.0000 - - - -91.8801 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7386 1.0000 - -30.0425 1.0000 - -30.0306 1.0000 - -29.9625 1.0000 - 1.6379 1.0000 - 2.2630 1.0000 - 4.4722 1.0000 - 4.7995 1.0000 - 5.4863 1.0000 - 6.4480 1.0000 - 9.2884 0.0000 - 9.7273 0.0000 - 11.6147 0.0000 - 12.5272 0.0000 - 15.4126 0.0000 - - - -91.8798 1.0000 - -91.4248 1.0000 - -91.2898 1.0000 - -65.7385 1.0000 - -30.0468 1.0000 - -30.0303 1.0000 - -29.9621 1.0000 - 1.6405 1.0000 - 2.4253 1.0000 - 4.4262 1.0000 - 4.8365 1.0000 - 5.5489 1.0000 - 6.3631 1.0000 - 9.1487 0.0000 - 9.5497 0.0000 - 11.6341 0.0000 - 12.3538 0.0000 - 15.2479 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2908 1.0000 - -65.7394 1.0000 - -30.0325 1.0000 - -29.9959 1.0000 - -29.9755 1.0000 - 0.8009 1.0000 - 2.0701 1.0000 - 4.5572 1.0000 - 4.6768 1.0000 - 4.8227 1.0000 - 7.8284 0.7789 - 10.7722 0.0000 - 11.2548 0.0000 - 12.1273 0.0000 - 13.8872 0.0000 - 19.3208 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7393 1.0000 - -30.0324 1.0000 - -29.9980 1.0000 - -29.9752 1.0000 - 0.8570 1.0000 - 2.0712 1.0000 - 4.5273 1.0000 - 4.6328 1.0000 - 4.9304 1.0000 - 7.6670 0.9989 - 10.9814 0.0000 - 11.0519 0.0000 - 11.6948 0.0000 - 14.0784 0.0000 - 42.2456 0.0000 - - - -91.8797 1.0000 - -91.4247 1.0000 - -91.2896 1.0000 - -65.7391 1.0000 - -30.0320 1.0000 - -30.0042 1.0000 - -29.9747 1.0000 - 1.0176 1.0000 - 2.0713 1.0000 - 4.4474 1.0000 - 4.6405 1.0000 - 5.1016 1.0000 - 7.2990 1.0000 - 10.7764 0.0000 - 11.1820 0.0000 - 11.3580 0.0000 - 12.3963 0.0000 - 14.3579 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2899 1.0000 - -65.7390 1.0000 - -30.0316 1.0000 - -30.0134 1.0000 - -29.9739 1.0000 - 1.2586 1.0000 - 2.0756 1.0000 - 4.3961 1.0000 - 4.6691 1.0000 - 5.2775 1.0000 - 6.8932 1.0000 - 10.2551 0.0000 - 10.7808 0.0000 - 11.4976 0.0000 - 12.8877 0.0000 - 15.8667 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7388 1.0000 - -30.0310 1.0000 - -30.0239 1.0000 - -29.9730 1.0000 - 1.5255 1.0000 - 2.1140 1.0000 - 4.3949 1.0000 - 4.6822 1.0000 - 5.4431 1.0000 - 6.5515 1.0000 - 9.6939 0.0000 - 10.3186 0.0000 - 11.5514 0.0000 - 13.6887 0.0000 - 13.9888 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2903 1.0000 - -65.7386 1.0000 - -30.0340 1.0000 - -30.0305 1.0000 - -29.9721 1.0000 - 1.7053 1.0000 - 2.2618 1.0000 - 4.4314 1.0000 - 4.6508 1.0000 - 5.5873 1.0000 - 6.3317 1.0000 - 9.2060 0.0000 - 9.8463 0.0000 - 11.5922 0.0000 - 13.7036 0.0000 - 15.4834 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7384 1.0000 - -30.0418 1.0000 - -30.0301 1.0000 - -29.9715 1.0000 - 1.7590 1.0000 - 2.5073 1.0000 - 4.4571 1.0000 - 4.5923 1.0000 - 5.6986 1.0000 - 6.2426 1.0000 - 8.8451 0.0000 - 9.4436 0.0000 - 11.9279 0.0000 - 13.5539 0.0000 - 15.7128 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7384 1.0000 - -30.0461 1.0000 - -30.0299 1.0000 - -29.9711 1.0000 - 1.7660 1.0000 - 2.6912 1.0000 - 4.4142 1.0000 - 4.5895 1.0000 - 5.7615 1.0000 - 6.2306 1.0000 - 8.6509 0.0000 - 9.2035 0.0000 - 11.6476 0.0000 - 14.2805 0.0000 - 19.5232 0.0000 - - - -91.8815 1.0000 - -91.4265 1.0000 - -91.2914 1.0000 - -65.7392 1.0000 - -30.0318 1.0000 - -29.9947 1.0000 - -29.9885 1.0000 - 1.0577 1.0000 - 2.0304 1.0000 - 4.6009 1.0000 - 4.8033 1.0000 - 4.8693 1.0000 - 7.2978 1.0000 - 10.4120 0.0000 - 10.9345 0.0000 - 11.8493 0.0000 - 12.9361 0.0000 - 14.3082 0.0000 - - - -91.8811 1.0000 - -91.4262 1.0000 - -91.2911 1.0000 - -65.7391 1.0000 - -30.0317 1.0000 - -29.9968 1.0000 - -29.9883 1.0000 - 1.1137 1.0000 - 2.0461 1.0000 - 4.5591 1.0000 - 4.6899 1.0000 - 5.0505 1.0000 - 7.1547 1.0000 - 10.5597 0.0000 - 10.7725 0.0000 - 11.6641 0.0000 - 12.9304 0.0000 - 41.7172 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2904 1.0000 - -65.7389 1.0000 - -30.0313 1.0000 - -30.0030 1.0000 - -29.9878 1.0000 - 1.2740 1.0000 - 2.0929 1.0000 - 4.4116 1.0000 - 4.7042 1.0000 - 5.2624 1.0000 - 6.8170 1.0000 - 10.1893 0.0000 - 11.0104 0.0000 - 11.7700 0.0000 - 13.5929 0.0000 - 14.2934 0.0000 - - - -91.8800 1.0000 - -91.4250 1.0000 - -91.2900 1.0000 - -65.7387 1.0000 - -30.0309 1.0000 - -30.0122 1.0000 - -29.9870 1.0000 - 1.5073 1.0000 - 2.1781 1.0000 - 4.2861 1.0000 - 4.7582 1.0000 - 5.4598 1.0000 - 6.4336 1.0000 - 9.5343 0.0000 - 11.2013 0.0000 - 11.3387 0.0000 - 13.1060 0.0000 - 38.3097 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7385 1.0000 - -30.0304 1.0000 - -30.0228 1.0000 - -29.9861 1.0000 - 1.7426 1.0000 - 2.3312 1.0000 - 4.2213 1.0000 - 4.7949 1.0000 - 5.6281 1.0000 - 6.1217 1.0000 - 8.8998 0.0000 - 10.7235 0.0000 - 11.4983 0.0000 - 13.3139 0.0000 - 14.5418 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2905 1.0000 - -65.7383 1.0000 - -30.0329 1.0000 - -30.0299 1.0000 - -29.9853 1.0000 - 1.8915 1.0000 - 2.5903 1.0000 - 4.2222 1.0000 - 4.7435 1.0000 - 5.7550 1.0000 - 5.9846 1.0000 - 8.3534 0.0000 - 10.1446 0.0000 - 11.5765 0.0000 - 14.0941 0.0000 - 31.5297 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7382 1.0000 - -30.0408 1.0000 - -30.0295 1.0000 - -29.9846 1.0000 - 1.9545 1.0000 - 2.8962 1.0000 - 4.2674 1.0000 - 4.5842 1.0000 - 5.8671 1.0000 - 6.0058 1.0000 - 7.9444 0.1919 - 9.6138 0.0000 - 12.3662 0.0000 - 14.4968 0.0000 - 35.5494 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7381 1.0000 - -30.0451 1.0000 - -30.0292 1.0000 - -29.9843 1.0000 - 1.9749 1.0000 - 3.1170 1.0000 - 4.3238 1.0000 - 4.4181 1.0000 - 5.9578 1.0000 - 6.0552 1.0000 - 7.7216 0.9887 - 9.2780 0.0000 - 11.6484 0.0000 - 14.1912 0.0000 - 15.2729 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2906 1.0000 - -65.7387 1.0000 - -30.0309 1.0000 - -30.0033 1.0000 - -29.9932 1.0000 - 1.3568 1.0000 - 2.0050 1.0000 - 4.6470 1.0000 - 4.9310 1.0000 - 4.9604 1.0000 - 6.8399 1.0000 - 10.0603 0.0000 - 10.6095 0.0000 - 11.6789 0.0000 - 12.7079 0.0000 - 14.2313 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2910 1.0000 - -65.7387 1.0000 - -30.0309 1.0000 - -30.0032 1.0000 - -29.9955 1.0000 - 1.4097 1.0000 - 2.0396 1.0000 - 4.6145 1.0000 - 4.7530 1.0000 - 5.1891 1.0000 - 6.7162 1.0000 - 10.1096 0.0000 - 10.3876 0.0000 - 11.6000 0.0000 - 13.1316 0.0000 - 37.6273 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7386 1.0000 - -30.0305 1.0000 - -30.0027 1.0000 - -30.0017 1.0000 - 1.5583 1.0000 - 2.1490 1.0000 - 4.4268 1.0000 - 4.7673 1.0000 - 5.4207 1.0000 - 6.4119 1.0000 - 9.5620 0.0000 - 10.6052 0.0000 - 11.5431 0.0000 - 13.8192 0.0000 - 14.7273 0.0000 - - - -91.8807 1.0000 - -91.4258 1.0000 - -91.2907 1.0000 - -65.7384 1.0000 - -30.0301 1.0000 - -30.0110 1.0000 - -30.0020 1.0000 - 1.7596 1.0000 - 2.3479 1.0000 - 4.2353 1.0000 - 4.8561 1.0000 - 5.6156 1.0000 - 6.0522 1.0000 - 8.8319 0.0000 - 10.9690 0.0000 - 11.4301 0.0000 - 13.3676 0.0000 - 14.5676 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2905 1.0000 - -65.7382 1.0000 - -30.0296 1.0000 - -30.0216 1.0000 - -30.0011 1.0000 - 1.9573 1.0000 - 2.6478 1.0000 - 4.0985 1.0000 - 4.9571 1.0000 - 5.6139 1.0000 - 5.8909 1.0000 - 8.1389 0.0001 - 10.9883 0.0000 - 11.3423 0.0000 - 13.7094 0.0000 - 15.7553 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2906 1.0000 - -65.7380 1.0000 - -30.0317 1.0000 - -30.0291 1.0000 - -30.0003 1.0000 - 2.1129 1.0000 - 3.0175 1.0000 - 4.0379 1.0000 - 4.9190 1.0000 - 5.5211 1.0000 - 5.9990 1.0000 - 7.5405 1.0000 - 10.3988 0.0000 - 11.4577 0.0000 - 13.7122 0.0000 - 15.9308 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2911 1.0000 - -65.7379 1.0000 - -30.0397 1.0000 - -30.0287 1.0000 - -29.9997 1.0000 - 2.2149 1.0000 - 3.3832 1.0000 - 4.0564 1.0000 - 4.6690 1.0000 - 5.6796 1.0000 - 6.0916 1.0000 - 7.0870 1.0000 - 9.7752 0.0000 - 11.5424 0.0000 - 14.3066 0.0000 - 15.5761 0.0000 - - - -91.8814 1.0000 - -91.4264 1.0000 - -91.2914 1.0000 - -65.7378 1.0000 - -30.0440 1.0000 - -30.0285 1.0000 - -29.9994 1.0000 - 2.2640 1.0000 - 3.6435 1.0000 - 4.1382 1.0000 - 4.4048 1.0000 - 5.8558 1.0000 - 6.1352 1.0000 - 6.8387 1.0000 - 9.3618 0.0000 - 11.5772 0.0000 - 14.3099 0.0000 - 14.9653 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2907 1.0000 - -65.7384 1.0000 - -30.0302 1.0000 - -30.0174 1.0000 - -29.9919 1.0000 - 1.5922 1.0000 - 2.0622 1.0000 - 4.6783 1.0000 - 4.9977 1.0000 - 5.1255 1.0000 - 6.4823 1.0000 - 9.7866 0.0000 - 10.2382 0.0000 - 11.6423 0.0000 - 12.1724 0.0000 - 15.1696 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7384 1.0000 - -30.0300 1.0000 - -30.0172 1.0000 - -29.9941 1.0000 - 1.6356 1.0000 - 2.1225 1.0000 - 4.6697 1.0000 - 4.8109 1.0000 - 5.3294 1.0000 - 6.3879 1.0000 - 9.7035 0.0000 - 10.0257 0.0000 - 11.6040 0.0000 - 12.6587 0.0000 - 14.9940 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2901 1.0000 - -65.7382 1.0000 - -30.0297 1.0000 - -30.0168 1.0000 - -30.0004 1.0000 - 1.7553 1.0000 - 2.3064 1.0000 - 4.4915 1.0000 - 4.7800 1.0000 - 5.5639 1.0000 - 6.1473 1.0000 - 9.0130 0.0000 - 10.2004 0.0000 - 11.5878 0.0000 - 13.4966 0.0000 - 14.8358 0.0000 - - - -91.8807 1.0000 - -91.4258 1.0000 - -91.2907 1.0000 - -65.7381 1.0000 - -30.0293 1.0000 - -30.0162 1.0000 - -30.0097 1.0000 - 1.9268 1.0000 - 2.6143 1.0000 - 4.2587 1.0000 - 4.8639 1.0000 - 5.7056 1.0000 - 5.8972 1.0000 - 8.2193 0.0000 - 10.4809 0.0000 - 11.5381 0.0000 - 13.9612 0.0000 - 14.5546 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2908 1.0000 - -65.7379 1.0000 - -30.0288 1.0000 - -30.0204 1.0000 - -30.0154 1.0000 - 2.1305 1.0000 - 3.0221 1.0000 - 4.0628 1.0000 - 5.0039 1.0000 - 5.4474 1.0000 - 5.9945 1.0000 - 7.4712 1.0000 - 10.6874 0.0000 - 11.3421 0.0000 - 13.4783 0.0000 - 15.3783 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2909 1.0000 - -65.7377 1.0000 - -30.0306 1.0000 - -30.0283 1.0000 - -30.0147 1.0000 - 2.3416 1.0000 - 3.4734 1.0000 - 3.9279 1.0000 - 5.1088 1.0000 - 5.2297 1.0000 - 6.1260 1.0000 - 6.8189 1.0000 - 10.4946 0.0000 - 11.1842 0.0000 - 13.1952 0.0000 - 15.7397 0.0000 - - - -91.8812 1.0000 - -91.4262 1.0000 - -91.2912 1.0000 - -65.7376 1.0000 - -30.0385 1.0000 - -30.0280 1.0000 - -30.0141 1.0000 - 2.5238 1.0000 - 3.8199 1.0000 - 3.9375 1.0000 - 4.8268 1.0000 - 5.4778 1.0000 - 6.2123 1.0000 - 6.3224 1.0000 - 9.8991 0.0000 - 11.2407 0.0000 - 13.1926 0.0000 - 15.5369 0.0000 - - - -91.8814 1.0000 - -91.4264 1.0000 - -91.2914 1.0000 - -65.7375 1.0000 - -30.0429 1.0000 - -30.0278 1.0000 - -30.0137 1.0000 - 2.6290 1.0000 - 3.8380 1.0000 - 4.2279 1.0000 - 4.5865 1.0000 - 5.6574 1.0000 - 6.0663 1.0000 - 6.2635 1.0000 - 9.4409 0.0000 - 11.2887 0.0000 - 13.2397 0.0000 - 15.7505 0.0000 - - - -91.8809 1.0000 - -91.4259 1.0000 - -91.2908 1.0000 - -65.7382 1.0000 - -30.0295 1.0000 - -30.0285 1.0000 - -29.9909 1.0000 - 1.6678 1.0000 - 2.2476 1.0000 - 4.6819 1.0000 - 5.0573 1.0000 - 5.2677 1.0000 - 6.2372 1.0000 - 9.6320 0.0000 - 9.9258 0.0000 - 11.6498 0.0000 - 11.7641 0.0000 - 15.1177 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2910 1.0000 - -65.7382 1.0000 - -30.0294 1.0000 - -30.0284 1.0000 - -29.9931 1.0000 - 1.7064 1.0000 - 2.3241 1.0000 - 4.6780 1.0000 - 4.8714 1.0000 - 5.4482 1.0000 - 6.1821 1.0000 - 9.3944 0.0000 - 9.7662 0.0000 - 11.6283 0.0000 - 12.2592 0.0000 - 15.0447 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7380 1.0000 - -30.0291 1.0000 - -30.0279 1.0000 - -29.9994 1.0000 - 1.8197 1.0000 - 2.5512 1.0000 - 4.5747 1.0000 - 4.7174 1.0000 - 5.6795 1.0000 - 6.0408 1.0000 - 8.5996 0.0000 - 9.8664 0.0000 - 11.6305 0.0000 - 13.1616 0.0000 - 14.9422 0.0000 - - - -91.8802 1.0000 - -91.4252 1.0000 - -91.2902 1.0000 - -65.7378 1.0000 - -30.0287 1.0000 - -30.0272 1.0000 - -30.0087 1.0000 - 2.0020 1.0000 - 2.9149 1.0000 - 4.3358 1.0000 - 4.7172 1.0000 - 5.7999 1.0000 - 5.9420 1.0000 - 7.7512 0.9686 - 10.0198 0.0000 - 11.6232 0.0000 - 14.2345 0.0000 - 15.3681 0.0000 - - - -91.8805 1.0000 - -91.4255 1.0000 - -91.2905 1.0000 - -65.7376 1.0000 - -30.0283 1.0000 - -30.0265 1.0000 - -30.0194 1.0000 - 2.2449 1.0000 - 3.3771 1.0000 - 4.1205 1.0000 - 4.7396 1.0000 - 5.6457 1.0000 - 6.0882 1.0000 - 6.9514 1.0000 - 10.1586 0.0000 - 11.4369 0.0000 - 13.6407 0.0000 - 15.4695 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7374 1.0000 - -30.0297 1.0000 - -30.0278 1.0000 - -30.0258 1.0000 - 2.5344 1.0000 - 3.8121 1.0000 - 3.9855 1.0000 - 4.8087 1.0000 - 5.5213 1.0000 - 6.1981 1.0000 - 6.2633 1.0000 - 10.2073 0.0000 - 11.0454 0.0000 - 13.0519 0.0000 - 15.5984 0.0000 - - - -91.8811 1.0000 - -91.4261 1.0000 - -91.2911 1.0000 - -65.7373 1.0000 - -30.0377 1.0000 - -30.0274 1.0000 - -30.0252 1.0000 - 2.8336 1.0000 - 3.8000 1.0000 - 4.1712 1.0000 - 4.9751 1.0000 - 5.5168 1.0000 - 5.6776 1.0000 - 6.3079 1.0000 - 9.9354 0.0000 - 10.7127 0.0000 - 12.8003 0.0000 - 15.8356 0.0000 - - - -91.8814 1.0000 - -91.4264 1.0000 - -91.2914 1.0000 - -65.7372 1.0000 - -30.0421 1.0000 - -30.0272 1.0000 - -30.0249 1.0000 - 3.0541 1.0000 - 3.7465 1.0000 - 4.2239 1.0000 - 5.1222 1.0000 - 5.2997 1.0000 - 5.6922 1.0000 - 6.3453 1.0000 - 9.5016 0.0000 - 10.6605 0.0000 - 12.7227 0.0000 - 15.5675 0.0000 - - - -91.8803 1.0000 - -91.4253 1.0000 - -91.2903 1.0000 - -65.7380 1.0000 - -30.0345 1.0000 - -30.0292 1.0000 - -29.9902 1.0000 - 1.6740 1.0000 - 2.4018 1.0000 - 4.6707 1.0000 - 5.0946 1.0000 - 5.3522 1.0000 - 6.1117 1.0000 - 9.6010 0.0000 - 9.7207 0.0000 - 11.5419 0.0000 - 11.6546 0.0000 - 14.9372 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7380 1.0000 - -30.0344 1.0000 - -30.0291 1.0000 - -29.9926 1.0000 - 1.7129 1.0000 - 2.4847 1.0000 - 4.6554 1.0000 - 4.9171 1.0000 - 5.5191 1.0000 - 6.0879 1.0000 - 9.2253 0.0000 - 9.6369 0.0000 - 11.6608 0.0000 - 12.0478 0.0000 - 14.9557 0.0000 - - - -91.8807 1.0000 - -91.4257 1.0000 - -91.2907 1.0000 - -65.7379 1.0000 - -30.0339 1.0000 - -30.0288 1.0000 - -29.9989 1.0000 - 1.8315 1.0000 - 2.7302 1.0000 - 4.6082 1.0000 - 4.6655 1.0000 - 5.7492 1.0000 - 6.0255 1.0000 - 8.3737 0.0000 - 9.6738 0.0000 - 11.6583 0.0000 - 12.9796 0.0000 - 15.0184 0.0000 - - - -91.8808 1.0000 - -91.4258 1.0000 - -91.2908 1.0000 - -65.7377 1.0000 - -30.0333 1.0000 - -30.0284 1.0000 - -30.0082 1.0000 - 2.0272 1.0000 - 3.1247 1.0000 - 4.4101 1.0000 - 4.5557 1.0000 - 5.9249 1.0000 - 5.9750 1.0000 - 7.4900 1.0000 - 9.7287 0.0000 - 11.6418 0.0000 - 13.9974 0.0000 - 15.0437 0.0000 - - - -91.8804 1.0000 - -91.4254 1.0000 - -91.2904 1.0000 - -65.7375 1.0000 - -30.0326 1.0000 - -30.0279 1.0000 - -30.0189 1.0000 - 2.2989 1.0000 - 3.6250 1.0000 - 4.2181 1.0000 - 4.4835 1.0000 - 5.8518 1.0000 - 6.1331 1.0000 - 6.6571 1.0000 - 9.7868 0.0000 - 11.4865 0.0000 - 14.5147 0.0000 - 15.4164 0.0000 - - - -91.8806 1.0000 - -91.4256 1.0000 - -91.2905 1.0000 - -65.7373 1.0000 - -30.0318 1.0000 - -30.0291 1.0000 - -30.0275 1.0000 - 2.6408 1.0000 - 3.9091 1.0000 - 4.2522 1.0000 - 4.5325 1.0000 - 5.7034 1.0000 - 5.9787 1.0000 - 6.2621 1.0000 - 9.8299 0.0000 - 11.0556 0.0000 - 13.0395 0.0000 - 15.4657 0.0000 - - - -91.8810 1.0000 - -91.4260 1.0000 - -91.2910 1.0000 - -65.7372 1.0000 - -30.0372 1.0000 - -30.0313 1.0000 - -30.0271 1.0000 - 3.0409 1.0000 - 3.8298 1.0000 - 4.2195 1.0000 - 5.0235 1.0000 - 5.2301 1.0000 - 5.8071 1.0000 - 6.3436 1.0000 - 9.8006 0.0000 - 10.3862 0.0000 - 12.6747 0.0000 - 15.4656 0.0000 - - - -91.8812 1.0000 - -91.4262 1.0000 - -91.2911 1.0000 - -65.7371 1.0000 - -30.0416 1.0000 - -30.0310 1.0000 - -30.0269 1.0000 - 3.4531 1.0000 - 3.7372 1.0000 - 4.0740 1.0000 - 4.7709 1.0000 - 5.5707 1.0000 - 5.7646 1.0000 - 6.3738 1.0000 - 9.5306 0.0000 - 10.0845 0.0000 - 12.5702 0.0000 - 15.4251 0.0000 - - - - - - - 0.00000000 0.00000000 0.00000000 - - - 7.88278638 - - - gridpoints - spin - energy - total - integrated - - - -98.7492 0.0000 0.0000 - -98.2456 0.0000 0.0000 - -97.7420 0.0000 0.0000 - -97.2383 0.0000 0.0000 - -96.7347 0.0000 0.0000 - -96.2311 0.0000 0.0000 - -95.7275 0.0000 0.0000 - -95.2239 0.0000 0.0000 - -94.7203 0.0000 0.0000 - -94.2166 0.0000 0.0000 - -93.7130 0.0000 0.0000 - -93.2094 0.0000 0.0000 - -92.7058 0.0000 0.0000 - -92.2022 0.0000 0.0000 - -91.6986 3.9514 1.9900 - -91.1949 7.6087 5.8219 - -90.6913 0.3536 6.0000 - -90.1877 0.0000 6.0000 - -89.6841 0.0000 6.0000 - -89.1805 0.0000 6.0000 - -88.6769 0.0000 6.0000 - -88.1732 0.0000 6.0000 - -87.6696 0.0000 6.0000 - -87.1660 0.0000 6.0000 - -86.6624 0.0000 6.0000 - -86.1588 0.0000 6.0000 - -85.6552 0.0000 6.0000 - -85.1515 0.0000 6.0000 - -84.6479 0.0000 6.0000 - -84.1443 0.0000 6.0000 - -83.6407 0.0000 6.0000 - -83.1371 0.0000 6.0000 - -82.6335 0.0000 6.0000 - -82.1299 0.0000 6.0000 - -81.6262 0.0000 6.0000 - -81.1226 0.0000 6.0000 - -80.6190 0.0000 6.0000 - -80.1154 0.0000 6.0000 - -79.6118 0.0000 6.0000 - -79.1082 0.0000 6.0000 - -78.6045 0.0000 6.0000 - -78.1009 0.0000 6.0000 - -77.5973 0.0000 6.0000 - -77.0937 0.0000 6.0000 - -76.5901 0.0000 6.0000 - -76.0865 0.0000 6.0000 - -75.5828 0.0000 6.0000 - -75.0792 0.0000 6.0000 - -74.5756 0.0000 6.0000 - -74.0720 0.0000 6.0000 - -73.5684 0.0000 6.0000 - -73.0648 0.0000 6.0000 - -72.5611 0.0000 6.0000 - -72.0575 0.0000 6.0000 - -71.5539 0.0000 6.0000 - -71.0503 0.0000 6.0000 - -70.5467 0.0000 6.0000 - -70.0431 0.0000 6.0000 - -69.5394 0.0000 6.0000 - -69.0358 0.0000 6.0000 - -68.5322 0.0000 6.0000 - -68.0286 0.0000 6.0000 - -67.5250 0.0000 6.0000 - -67.0214 0.0000 6.0000 - -66.5178 0.0000 6.0000 - -66.0141 0.0002 6.0001 - -65.5105 3.9689 7.9989 - -65.0069 0.0021 8.0000 - -64.5033 0.0000 8.0000 - -63.9997 0.0000 8.0000 - -63.4961 0.0000 8.0000 - -62.9924 0.0000 8.0000 - -62.4888 0.0000 8.0000 - -61.9852 0.0000 8.0000 - -61.4816 0.0000 8.0000 - -60.9780 0.0000 8.0000 - -60.4744 0.0000 8.0000 - -59.9707 0.0000 8.0000 - -59.4671 0.0000 8.0000 - -58.9635 0.0000 8.0000 - -58.4599 0.0000 8.0000 - -57.9563 0.0000 8.0000 - -57.4527 0.0000 8.0000 - -56.9490 0.0000 8.0000 - -56.4454 0.0000 8.0000 - -55.9418 0.0000 8.0000 - -55.4382 0.0000 8.0000 - -54.9346 0.0000 8.0000 - -54.4310 0.0000 8.0000 - -53.9273 0.0000 8.0000 - -53.4237 0.0000 8.0000 - -52.9201 0.0000 8.0000 - -52.4165 0.0000 8.0000 - -51.9129 0.0000 8.0000 - -51.4093 0.0000 8.0000 - -50.9057 0.0000 8.0000 - -50.4020 0.0000 8.0000 - -49.8984 0.0000 8.0000 - -49.3948 0.0000 8.0000 - -48.8912 0.0000 8.0000 - -48.3876 0.0000 8.0000 - -47.8840 0.0000 8.0000 - -47.3803 0.0000 8.0000 - -46.8767 0.0000 8.0000 - -46.3731 0.0000 8.0000 - -45.8695 0.0000 8.0000 - -45.3659 0.0000 8.0000 - -44.8623 0.0000 8.0000 - -44.3586 0.0000 8.0000 - -43.8550 0.0000 8.0000 - -43.3514 0.0000 8.0000 - -42.8478 0.0000 8.0000 - -42.3442 0.0000 8.0000 - -41.8406 0.0000 8.0000 - -41.3369 0.0000 8.0000 - -40.8333 0.0000 8.0000 - -40.3297 0.0000 8.0000 - -39.8261 0.0000 8.0000 - -39.3225 0.0000 8.0000 - -38.8189 0.0000 8.0000 - -38.3152 0.0000 8.0000 - -37.8116 0.0000 8.0000 - -37.3080 0.0000 8.0000 - -36.8044 0.0000 8.0000 - -36.3008 0.0000 8.0000 - -35.7972 0.0000 8.0000 - -35.2936 0.0000 8.0000 - -34.7899 0.0000 8.0000 - -34.2863 0.0000 8.0000 - -33.7827 0.0000 8.0000 - -33.2791 0.0000 8.0000 - -32.7755 0.0000 8.0000 - -32.2719 0.0000 8.0000 - -31.7682 0.0000 8.0000 - -31.2646 0.0000 8.0000 - -30.7610 0.0000 8.0000 - -30.2574 0.0062 8.0031 - -29.7538 11.6675 13.8791 - -29.2502 0.2401 14.0000 - -28.7465 0.0000 14.0000 - -28.2429 0.0000 14.0000 - -27.7393 0.0000 14.0000 - -27.2357 0.0000 14.0000 - -26.7321 0.0000 14.0000 - -26.2285 0.0000 14.0000 - -25.7248 0.0000 14.0000 - -25.2212 0.0000 14.0000 - -24.7176 0.0000 14.0000 - -24.2140 0.0000 14.0000 - -23.7104 0.0000 14.0000 - -23.2068 0.0000 14.0000 - -22.7031 0.0000 14.0000 - -22.1995 0.0000 14.0000 - -21.6959 0.0000 14.0000 - -21.1923 0.0000 14.0000 - -20.6887 0.0000 14.0000 - -20.1851 0.0000 14.0000 - -19.6815 0.0000 14.0000 - -19.1778 0.0000 14.0000 - -18.6742 0.0000 14.0000 - -18.1706 0.0000 14.0000 - -17.6670 0.0000 14.0000 - -17.1634 0.0000 14.0000 - -16.6598 0.0000 14.0000 - -16.1561 0.0000 14.0000 - -15.6525 0.0000 14.0000 - -15.1489 0.0000 14.0000 - -14.6453 0.0000 14.0000 - -14.1417 0.0000 14.0000 - -13.6381 0.0000 14.0000 - -13.1344 0.0000 14.0000 - -12.6308 0.0000 14.0000 - -12.1272 0.0000 14.0000 - -11.6236 0.0000 14.0000 - -11.1200 0.0000 14.0000 - -10.6164 0.0000 14.0000 - -10.1127 0.0000 14.0000 - -9.6091 0.0000 14.0000 - -9.1055 0.0000 14.0000 - -8.6019 0.0000 14.0000 - -8.0983 0.0000 14.0000 - -7.5947 0.0000 14.0000 - -7.0910 0.0000 14.0000 - -6.5874 0.0000 14.0000 - -6.0838 0.0000 14.0000 - -5.5802 0.0000 14.0000 - -5.0766 0.0000 14.0000 - -4.5730 0.0000 14.0000 - -4.0694 0.0000 14.0000 - -3.5657 0.0000 14.0000 - -3.0621 0.0000 14.0000 - -2.5585 0.0000 14.0000 - -2.0549 0.0009 14.0005 - -1.5513 0.1132 14.0574 - -1.0477 0.2483 14.1825 - -0.5440 0.3448 14.3561 - -0.0404 0.4543 14.5849 - 0.4632 0.5588 14.8664 - 0.9668 0.6103 15.1737 - 1.4704 0.8493 15.6014 - 1.9740 1.0615 16.1360 - 2.4777 1.1259 16.7031 - 2.9813 0.9778 17.1955 - 3.4849 0.7572 17.5768 - 3.9885 0.9446 18.0526 - 4.4921 2.2831 19.2023 - 4.9957 3.6694 21.0503 - 5.4994 2.8044 22.4627 - 6.0030 2.3933 23.6680 - 6.5066 1.9045 24.6271 - 7.0102 1.3513 25.3077 - 7.5138 0.8062 25.7137 - 8.0174 0.7272 26.0799 - 8.5211 0.8382 26.5020 - 9.0247 1.4316 27.2230 - 9.5283 1.9155 28.1877 - 10.0319 1.7300 29.0590 - 10.5355 1.5459 29.8375 - 11.0391 1.1419 30.4126 - 11.5427 1.3555 31.0952 - 12.0464 1.2953 31.7476 - 12.5500 0.5429 32.0210 - 13.0536 0.4473 32.2462 - 13.5572 0.8282 32.6634 - 14.0608 1.1877 33.2615 - 14.5644 1.1003 33.8156 - 15.0681 1.3090 34.4749 - 15.5717 1.4011 35.1805 - 16.0753 0.7368 35.5516 - 16.5789 0.3354 35.7205 - 17.0825 0.2344 35.8385 - 17.5861 0.0350 35.8561 - 18.0898 0.0355 35.8740 - 18.5934 0.0265 35.8874 - 19.0970 0.0000 35.8874 - 19.6006 0.0175 35.8962 - 20.1042 0.0059 35.8992 - 20.6078 0.0000 35.8993 - 21.1115 0.0000 35.8993 - 21.6151 0.0004 35.8995 - 22.1187 0.0043 35.9016 - 22.6223 0.0000 35.9016 - 23.1259 0.0000 35.9016 - 23.6295 0.0000 35.9016 - 24.1332 0.0047 35.9040 - 24.6368 0.0000 35.9040 - 25.1404 0.0000 35.9040 - 25.6440 0.0000 35.9040 - 26.1476 0.0000 35.9040 - 26.6512 0.0000 35.9040 - 27.1548 0.0000 35.9040 - 27.6585 0.0000 35.9040 - 28.1621 0.0000 35.9040 - 28.6657 0.0000 35.9040 - 29.1693 0.0000 35.9040 - 29.6729 0.0000 35.9040 - 30.1765 0.0000 35.9040 - 30.6802 0.0000 35.9040 - 31.1838 0.0001 35.9040 - 31.6874 0.0186 35.9134 - 32.1910 0.0092 35.9180 - 32.6946 0.0003 35.9182 - 33.1982 0.0094 35.9230 - 33.7019 0.0000 35.9230 - 34.2055 0.0107 35.9284 - 34.7091 0.0081 35.9324 - 35.2127 0.0000 35.9324 - 35.7163 0.0223 35.9437 - 36.2199 0.0077 35.9475 - 36.7236 0.0030 35.9490 - 37.2272 0.0047 35.9514 - 37.7308 0.0088 35.9558 - 38.2344 0.0020 35.9568 - 38.7380 0.0269 35.9704 - 39.2416 0.0102 35.9755 - 39.7453 0.0015 35.9763 - 40.2489 0.0000 35.9763 - 40.7525 0.0047 35.9787 - 41.2561 0.0000 35.9787 - 41.7597 0.0178 35.9876 - 42.2633 0.0114 35.9934 - 42.7670 0.0038 35.9953 - 43.2706 0.0000 35.9953 - 43.7742 0.0000 35.9953 - 44.2778 0.0000 35.9953 - 44.7814 0.0000 35.9953 - 45.2850 0.0000 35.9953 - 45.7886 0.0094 36.0000 - 46.2923 0.0000 36.0000 - 46.7959 0.0000 36.0000 - 47.2995 0.0000 36.0000 - 47.8031 0.0000 36.0000 - 48.3067 0.0000 36.0000 - 48.8103 0.0000 36.0000 - 49.3140 0.0000 36.0000 - 49.8176 0.0000 36.0000 - 50.3212 0.0000 36.0000 - 50.8248 0.0000 36.0000 - 51.3284 0.0000 36.0000 - 51.8320 0.0000 36.0000 - 52.3357 0.0000 36.0000 - - - - - - - - - - 3.66961100 0.00000000 0.00000000 - 0.00000000 3.55744000 0.00000000 - 0.00000000 0.00000000 3.17678100 - - 41.47103646 - - 0.27250845 0.00000000 0.00000000 - 0.00000000 0.28110102 0.00000000 - 0.00000000 0.00000000 0.31478405 - - - - 0.00000000 0.00000000 0.00000000 - 0.00000000 0.50000000 0.50000000 - 0.50000000 0.00000000 0.50000000 - 0.50000000 0.50000000 0.00000000 - - - diff --git a/examples/PACKAGES/dielectric/data.confined b/examples/PACKAGES/dielectric/data.confined index 2e166151bb..8145c829d1 100644 --- a/examples/PACKAGES/dielectric/data.confined +++ b/examples/PACKAGES/dielectric/data.confined @@ -1,4 +1,4 @@ -LAMMPS data file: two oppositely charged ions confined between two walls +LAMMPS data file: two oppositely charged ions confined between two walls epsilon1=2 | epsilon2=10 | epsilon1=2 4002 atoms 3 atom types @@ -4015,5 +4015,5 @@ Atoms # dielectric: id mol type q x y z normx normy normz area_per_patch ed em e 3998 0 1 0 38.5078 42.4438 30.002 0 0 -1 0.866 8 6 6 0 3999 0 1 0 39.0079 41.5776 30.002 0 0 -1 0.866 8 6 6 0 4000 0 1 0 39.508 42.4438 30.002 0 0 -1 0.866 8 6 6 0 -4001 0 2 1 15 20 15 0 0 1 0.866 8 6 10 0 -4002 0 3 -1 25 20 25 0 0 1 0.866 8 6 10 0 +4001 0 2 1 15 20 15 0 0 1 1.0 8 6 10 0 +4002 0 3 -1 25 20 25 0 0 1 1.0 8 6 10 0 diff --git a/examples/PACKAGES/dielectric/in.confined b/examples/PACKAGES/dielectric/in.confined index c9ae6d712a..beb5b9a2b0 100644 --- a/examples/PACKAGES/dielectric/in.confined +++ b/examples/PACKAGES/dielectric/in.confined @@ -4,6 +4,8 @@ # top interface: n = (0, 0, -1) # so that ed's are the same for both interfaces +# Dielectric constants can be set to be different from the input data file + variable epsilon1 index 20 variable epsilon2 index 8 @@ -21,6 +23,8 @@ variable method index gmres # gmres = BEM/GMRES # dof = Direct optimization of the functional # none +# compute the relevant values for the interface particles + variable ed equal "v_epsilon2 - v_epsilon1" variable em equal "(v_epsilon2 + v_epsilon1)/2" variable epsilon equal 1.0 # epsilon at the patch, not used for now @@ -34,12 +38,10 @@ group ions type 2 3 group cations type 2 group anions type 3 -# 1.0 = q * epsilon2 = qreal for cations -# -1.0 = q * epsilon2 = qreal for anions -variable qscale equal "1.0 / v_epsilon2" -set group cations charge ${qscale} -variable qscale equal "-1.0 / v_epsilon2" -set group anions charge ${qscale} +# set the dielectric constant of the medium where the ions reside + +set group cations epsilon ${epsilon2} +set group anions epsilon ${epsilon2} pair_style lj/cut/coul/long/dielectric 1.122 10.0 pair_coeff * * 1.0 1.0 @@ -59,6 +61,8 @@ dump 3 ions custom 100 ions.dump id mol type q x y z fx fy fz #c_ef[1 fix 1 ions nve +# fix modify is used to set the properties of the interface particle group + if "${method} == gmres" then & "fix 3 interface polarize/bem/gmres 1 1.0e-4" & "fix_modify 3 itr_max 50 dielectrics ${ed} ${em} ${epsilon} ${area} NULL" & diff --git a/examples/PACKAGES/dpd-basic/README b/examples/PACKAGES/dpd-basic/README index 43d66c4bd3..aec19f4fcb 100644 --- a/examples/PACKAGES/dpd-basic/README +++ b/examples/PACKAGES/dpd-basic/README @@ -1,10 +1,16 @@ -Examples for Extended Dissipative Particle Dynamics (DPD) ---------------------------------------------------------- -This directory contains examples for extended DPD simulations +Examples for Basic Dissipative Particle Dynamics (DPD) +------------------------------------------------------ +This directory contains examples for DPD simulations using +pair styles from the DPD-BASIC package. -1) 'dpdext' - test case (DPD fluid) for 'dpdext' pair style (in.dpdext) and an initial - configuration (dpdext.data) +1) 'dpd' - simple example (DPD fluid) for 'dpd' pair style (in.dpd) -2) 'dpdext_tstat' - test case (coarse-grained SPC/E water) for 'dpdext/tstat' pair style - (in.cg_spce), an initial configuration (dpdext.data) and tabulated potential +2) 'dpd_tstat' - coarse-grained SPC/E water example for 'dpd/tstat' pair style + (in.dpd_tstat), an initial configuration (dpdext.data) and tabulated potential + (cg_spce_table.pot) obtained by bottom-up coarse-graining of the atomistic SPC/E water. + +3) 'dpdext' - simple example (DPD fluid) for 'dpd/ext' pair style (in.dpdext) + +4) 'dpdext_tstat' - coarse-grained SPC/E water example for 'dpd/ext/tstat' pair style + (in.dpdext_tstat), an initial configuration (dpdext.data) and tabulated potential (cg_spce_table.pot) obtained by bottom-up coarse-graining of the atomistic SPC/E water. diff --git a/examples/PACKAGES/dpd-basic/dpd/in.dpd b/examples/PACKAGES/dpd-basic/dpd/in.dpd new file mode 100644 index 0000000000..14612e49a2 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd/in.dpd @@ -0,0 +1,43 @@ +# DPD Fluid + +variable T equal 1.0 +variable rc equal 1.0 +variable rcD equal 1.2 + +units lj +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +### create box and configuration +variable L equal 5.0 +lattice fcc 3.0 +region simBox block 0 ${L} 0 ${L} 0 ${L} +create_box 2 simBox +#create_atoms 1 region simBox +create_atoms 1 random 100 12456 simBox +create_atoms 2 random 100 13245 simBox +mass 1 1.0 +mass 2 2.0 +### + +pair_style dpd ${T} ${rc} 3854262 + +pair_coeff 1 1 25.0 4.5 1.2 +pair_coeff 1 2 25.1 4.51 1.21 +pair_coeff 2 2 25.2 4.52 1.22 + +timestep 0.01 +run_style verlet + +velocity all create ${T} 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 5000 + diff --git a/examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.1 b/examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.1 new file mode 100644 index 0000000000..4d514c90a6 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.1 @@ -0,0 +1,154 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# DPD Fluid + +variable T equal 1.0 +variable rc equal 1.0 +variable rcD equal 1.2 + +units lj +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +### create box and configuration +variable L equal 5.0 +lattice fcc 3.0 +Lattice spacing in x,y,z = 1.1006424 1.1006424 1.1006424 +region simBox block 0 ${L} 0 ${L} 0 ${L} +region simBox block 0 5 0 ${L} 0 ${L} +region simBox block 0 5 0 5 0 ${L} +region simBox block 0 5 0 5 0 5 +create_box 2 simBox +Created orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + 1 by 1 by 1 MPI processor grid +#create_atoms 1 region simBox +create_atoms 1 random 100 12456 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +create_atoms 2 random 100 13245 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +mass 1 1.0 +mass 2 2.0 +### + +pair_style dpd ${T} ${rc} 3854262 +pair_style dpd 1 ${rc} 3854262 +pair_style dpd 1 1 3854262 + +pair_coeff 1 1 25.0 4.5 1.2 +pair_coeff 1 2 25.1 4.51 1.21 +pair_coeff 2 2 25.2 4.52 1.22 + +timestep 0.01 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 1 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 5000 + generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.52 + ghost atom cutoff = 1.52 + binsize = 0.76, bins = 8 8 8 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair dpd, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.083 | 3.083 | 3.083 Mbytes + Step Time Temp Press + 0 0 1 9.5226009 + 100 1 1.9913643 9.2036029 + 200 2 1.6321732 9.2787957 + 300 3 1.3533438 8.3081433 + 400 4 1.2125884 8.0809065 + 500 5 1.0682216 8.0877925 + 600 6 0.99100473 8.1100319 + 700 7 0.99731243 7.8225195 + 800 8 1.0597693 7.8368218 + 900 9 0.99038588 7.9450569 + 1000 10 1.077129 7.5857015 + 1100 11 0.99070336 7.5138128 + 1200 12 1.013894 7.2794857 + 1300 13 1.0433203 7.7439871 + 1400 14 1.0285528 7.5662235 + 1500 15 0.99180601 7.8376313 + 1600 16 0.98059071 8.0243735 + 1700 17 1.0070947 8.3186893 + 1800 18 0.99507569 7.0786393 + 1900 19 1.0040168 7.8120389 + 2000 20 0.98636164 7.472185 + 2100 21 0.95811165 7.7085985 + 2200 22 0.93568327 6.9424246 + 2300 23 0.92804144 8.1239435 + 2400 24 0.94940276 7.6108611 + 2500 25 1.0535153 8.0772721 + 2600 26 1.0902144 7.5609768 + 2700 27 1.0737336 7.8706755 + 2800 28 0.93074581 7.3699993 + 2900 29 1.0440705 7.6454988 + 3000 30 0.93868164 7.841168 + 3100 31 1.0172025 7.6856163 + 3200 32 1.0405368 7.5325735 + 3300 33 0.96721201 7.8262809 + 3400 34 0.90430758 7.1693921 + 3500 35 0.89938433 7.865845 + 3600 36 0.9907178 7.3462971 + 3700 37 1.0311879 7.8876401 + 3800 38 0.98339132 7.3413929 + 3900 39 1.2111264 8.0968408 + 4000 40 1.062489 7.7315959 + 4100 41 0.94737492 7.3386028 + 4200 42 1.0453816 8.2017304 + 4300 43 0.97024897 7.7379624 + 4400 44 0.9553861 7.8047635 + 4500 45 1.043252 7.7486215 + 4600 46 0.98611474 8.1237053 + 4700 47 0.98624285 8.5801642 + 4800 48 0.97176754 7.1540299 + 4900 49 1.0165401 7.3853841 + 5000 50 0.88359115 7.5541592 +Loop time of 0.359916 on 1 procs for 5000 steps with 200 atoms + +Performance: 12002788.048 tau/day, 13892.116 timesteps/s +99.5% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.24932 | 0.24932 | 0.24932 | 0.0 | 69.27 +Neigh | 0.068726 | 0.068726 | 0.068726 | 0.0 | 19.10 +Comm | 0.028691 | 0.028691 | 0.028691 | 0.0 | 7.97 +Output | 0.00066318 | 0.00066318 | 0.00066318 | 0.0 | 0.18 +Modify | 0.0078062 | 0.0078062 | 0.0078062 | 0.0 | 2.17 +Other | | 0.004713 | | | 1.31 + +Nlocal: 200 ave 200 max 200 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 546 ave 546 max 546 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1649 ave 1649 max 1649 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1649 +Ave neighs/atom = 8.245 +Neighbor list builds = 500 +Dangerous builds = 500 + +Total wall time: 0:00:00 diff --git a/examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.4 b/examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.4 new file mode 100644 index 0000000000..69f849b9d7 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd/log.5Apr22.dpd.g++.4 @@ -0,0 +1,154 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# DPD Fluid + +variable T equal 1.0 +variable rc equal 1.0 +variable rcD equal 1.2 + +units lj +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +### create box and configuration +variable L equal 5.0 +lattice fcc 3.0 +Lattice spacing in x,y,z = 1.1006424 1.1006424 1.1006424 +region simBox block 0 ${L} 0 ${L} 0 ${L} +region simBox block 0 5 0 ${L} 0 ${L} +region simBox block 0 5 0 5 0 ${L} +region simBox block 0 5 0 5 0 5 +create_box 2 simBox +Created orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + 1 by 2 by 2 MPI processor grid +#create_atoms 1 region simBox +create_atoms 1 random 100 12456 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +create_atoms 2 random 100 13245 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +mass 1 1.0 +mass 2 2.0 +### + +pair_style dpd ${T} ${rc} 3854262 +pair_style dpd 1 ${rc} 3854262 +pair_style dpd 1 1 3854262 + +pair_coeff 1 1 25.0 4.5 1.2 +pair_coeff 1 2 25.1 4.51 1.21 +pair_coeff 2 2 25.2 4.52 1.22 + +timestep 0.01 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 1 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 5000 + generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.52 + ghost atom cutoff = 1.52 + binsize = 0.76, bins = 8 8 8 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair dpd, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.064 | 3.064 | 3.064 Mbytes + Step Time Temp Press + 0 0 1 8.603339 + 100 1 1.8691059 8.9058297 + 200 2 1.4500635 8.7420141 + 300 3 1.3089453 8.3985981 + 400 4 1.1647803 8.2948808 + 500 5 1.1399445 7.7421817 + 600 6 1.0297918 7.2040397 + 700 7 1.046713 7.6115758 + 800 8 0.93523712 7.6885563 + 900 9 0.94701493 7.9662712 + 1000 10 0.99302416 7.7606189 + 1100 11 0.98975674 7.5207427 + 1200 12 0.98661662 7.3565222 + 1300 13 1.0289377 7.6110453 + 1400 14 0.9982501 7.8065701 + 1500 15 1.0043888 7.3957185 + 1600 16 1.0175816 7.7885955 + 1700 17 1.0252117 7.5076258 + 1800 18 1.0275139 8.1052823 + 1900 19 1.0021054 7.0385989 + 2000 20 1.0489009 7.7138149 + 2100 21 0.91250488 7.3540839 + 2200 22 0.92470996 7.9600233 + 2300 23 0.96932725 7.3106045 + 2400 24 0.93443088 7.4594635 + 2500 25 0.95596038 7.2544715 + 2600 26 1.0368594 7.6229263 + 2700 27 0.94639332 7.4869636 + 2800 28 0.99917354 7.9806636 + 2900 29 0.95048071 7.0086404 + 3000 30 0.95226181 7.7807205 + 3100 31 0.95864429 7.8059442 + 3200 32 0.85678761 7.3416027 + 3300 33 0.95951096 7.3467158 + 3400 34 0.97665772 8.2900991 + 3500 35 0.92885927 7.5385993 + 3600 36 1.0455015 8.0627999 + 3700 37 0.91911809 8.0371736 + 3800 38 0.92022241 7.5803999 + 3900 39 1.0465522 7.6920189 + 4000 40 0.98568475 7.4529825 + 4100 41 1.0389372 7.2273346 + 4200 42 1.0257545 7.6081878 + 4300 43 1.0937573 8.2158237 + 4400 44 1.0908817 7.5021567 + 4500 45 1.0482874 7.5924368 + 4600 46 1.1468439 8.0285157 + 4700 47 1.119683 8.3365123 + 4800 48 1.0963877 7.51772 + 4900 49 1.0766762 7.3137035 + 5000 50 1.0359203 7.7354572 +Loop time of 0.148597 on 4 procs for 5000 steps with 200 atoms + +Performance: 29071936.422 tau/day, 33648.075 timesteps/s +98.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.059602 | 0.063397 | 0.068622 | 1.3 | 42.66 +Neigh | 0.017747 | 0.018193 | 0.018698 | 0.3 | 12.24 +Comm | 0.055145 | 0.061014 | 0.065369 | 1.5 | 41.06 +Output | 0.00042708 | 0.00050725 | 0.00071024 | 0.0 | 0.34 +Modify | 0.0023494 | 0.002532 | 0.0026434 | 0.2 | 1.70 +Other | | 0.002953 | | | 1.99 + +Nlocal: 50 ave 52 max 48 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Nghost: 292.75 ave 299 max 287 min +Histogram: 1 0 1 0 0 0 1 0 0 1 +Neighs: 413.5 ave 441 max 399 min +Histogram: 2 0 0 1 0 0 0 0 0 1 + +Total # of neighbors = 1654 +Ave neighs/atom = 8.27 +Neighbor list builds = 500 +Dangerous builds = 500 + +Total wall time: 0:00:00 diff --git a/examples/PACKAGES/dpd-basic/dpdext/dpdext.data b/examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce.data similarity index 99% rename from examples/PACKAGES/dpd-basic/dpdext/dpdext.data rename to examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce.data index dddbf6ad6c..d487e2c73c 100644 --- a/examples/PACKAGES/dpd-basic/dpdext/dpdext.data +++ b/examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce.data @@ -1,4 +1,4 @@ - DPD Fluid + Coarse-Grained SPC/E Water 2180 atoms diff --git a/examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce_table.pot b/examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce_table.pot new file mode 100644 index 0000000000..853ff4bec0 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd_tstat/cg_spce_table.pot @@ -0,0 +1,354 @@ +VOTCA +N 351 R 2.0 9.0 + +1 2.000000E+00 2.190202E+01 7.229762E+01 +2 2.020000E+00 2.048957E+01 6.887333E+01 +3 2.040000E+00 1.915004E+01 6.500604E+01 +4 2.060000E+00 1.789228E+01 6.069573E+01 +5 2.080000E+00 1.672516E+01 5.594242E+01 +6 2.100000E+00 1.565754E+01 5.074609E+01 +7 2.120000E+00 1.467088E+01 4.787307E+01 +8 2.140000E+00 1.374450E+01 4.471740E+01 +9 2.160000E+00 1.288407E+01 4.127908E+01 +10 2.180000E+00 1.209522E+01 3.755811E+01 +11 2.200000E+00 1.138363E+01 3.355449E+01 +12 2.220000E+00 1.072913E+01 3.188695E+01 +13 2.240000E+00 1.010845E+01 3.017359E+01 +14 2.260000E+00 9.522496E+00 2.841440E+01 +15 2.280000E+00 8.972182E+00 2.660938E+01 +16 2.300000E+00 8.458426E+00 2.475854E+01 +17 2.320000E+00 8.014166E+00 2.006698E+01 +18 2.340000E+00 7.639767E+00 1.777244E+01 +19 2.360000E+00 7.287288E+00 1.787493E+01 +20 2.380000E+00 6.908790E+00 2.037445E+01 +21 2.400000E+00 6.456330E+00 2.527099E+01 +22 2.420000E+00 5.858025E+00 3.384695E+01 +23 2.440000E+00 5.130955E+00 3.814748E+01 +24 2.460000E+00 4.360629E+00 3.817257E+01 +25 2.480000E+00 3.632555E+00 3.392224E+01 +26 2.500000E+00 3.032242E+00 2.539647E+01 +27 2.520000E+00 2.547993E+00 2.297813E+01 +28 2.540000E+00 2.115131E+00 2.025763E+01 +29 2.560000E+00 1.739702E+00 1.723497E+01 +30 2.580000E+00 1.427747E+00 1.391013E+01 +31 2.600000E+00 1.185311E+00 1.028314E+01 +32 2.620000E+00 9.860176E-01 9.578245E+00 +33 2.640000E+00 8.048986E-01 8.465708E+00 +34 2.660000E+00 6.501069E-01 6.945526E+00 +35 2.680000E+00 5.297952E-01 5.017699E+00 +36 2.700000E+00 4.521166E-01 2.682227E+00 +37 2.720000E+00 3.986447E-01 2.615311E+00 +38 2.740000E+00 3.494900E-01 2.250522E+00 +39 2.760000E+00 3.106097E-01 1.587859E+00 +40 2.780000E+00 2.879614E-01 6.273237E-01 +41 2.800000E+00 2.875026E-01 -6.310851E-01 +42 2.820000E+00 3.002733E-01 -6.543549E-01 +43 2.840000E+00 3.140112E-01 -7.277911E-01 +44 2.860000E+00 3.297194E-01 -8.513935E-01 +45 2.880000E+00 3.484014E-01 -1.025162E+00 +46 2.900000E+00 3.710604E-01 -1.249097E+00 +47 2.920000E+00 3.974884E-01 -1.380483E+00 +48 2.940000E+00 4.257507E-01 -1.432530E+00 +49 2.960000E+00 4.542607E-01 -1.405240E+00 +50 2.980000E+00 4.814314E-01 -1.298611E+00 +51 3.000000E+00 5.056762E-01 -1.112645E+00 +52 3.020000E+00 5.266502E-01 -9.832894E-01 +53 3.040000E+00 5.449492E-01 -8.451544E-01 +54 3.060000E+00 5.603978E-01 -6.982396E-01 +55 3.080000E+00 5.728203E-01 -5.425450E-01 +56 3.100000E+00 5.820411E-01 -3.780706E-01 +57 3.120000E+00 5.882509E-01 -2.409307E-01 +58 3.140000E+00 5.915991E-01 -9.190908E-02 +59 3.160000E+00 5.918481E-01 6.899430E-02 +60 3.180000E+00 5.887601E-01 2.417794E-01 +61 3.200000E+00 5.820977E-01 4.264463E-01 +62 3.220000E+00 5.733491E-01 4.528343E-01 +63 3.240000E+00 5.638075E-01 5.057356E-01 +64 3.260000E+00 5.529429E-01 5.851503E-01 +65 3.280000E+00 5.402248E-01 6.910784E-01 +66 3.300000E+00 5.251230E-01 8.235199E-01 +67 3.320000E+00 5.086524E-01 8.236482E-01 +68 3.340000E+00 4.921725E-01 8.244583E-01 +69 3.360000E+00 4.756696E-01 8.259503E-01 +70 3.380000E+00 4.591299E-01 8.281240E-01 +71 3.400000E+00 4.425400E-01 8.309796E-01 +72 3.420000E+00 4.259181E-01 8.311861E-01 +73 3.440000E+00 4.092937E-01 8.312292E-01 +74 3.460000E+00 3.926700E-01 8.311089E-01 +75 3.480000E+00 3.760504E-01 8.308252E-01 +76 3.500000E+00 3.594381E-01 8.303781E-01 +77 3.520000E+00 3.428394E-01 8.295412E-01 +78 3.540000E+00 3.262547E-01 8.289646E-01 +79 3.560000E+00 3.096790E-01 8.286483E-01 +80 3.580000E+00 2.931071E-01 8.285923E-01 +81 3.600000E+00 2.765336E-01 8.287966E-01 +82 3.620000E+00 2.599901E-01 8.254306E-01 +83 3.640000E+00 2.435212E-01 8.213359E-01 +84 3.660000E+00 2.271415E-01 8.165124E-01 +85 3.680000E+00 2.108656E-01 8.109603E-01 +86 3.700000E+00 1.947080E-01 8.046794E-01 +87 3.720000E+00 1.790243E-01 7.653050E-01 +88 3.740000E+00 1.640312E-01 7.356166E-01 +89 3.760000E+00 1.495351E-01 7.156143E-01 +90 3.780000E+00 1.353421E-01 7.052980E-01 +91 3.800000E+00 1.212586E-01 7.046676E-01 +92 3.820000E+00 1.072429E-01 6.965706E-01 +93 3.840000E+00 9.340878E-02 6.865180E-01 +94 3.860000E+00 7.979524E-02 6.745098E-01 +95 3.880000E+00 6.644142E-02 6.605462E-01 +96 3.900000E+00 5.338643E-02 6.446270E-01 +97 3.920000E+00 4.067486E-02 6.268536E-01 +98 3.940000E+00 2.829935E-02 6.110218E-01 +99 3.960000E+00 1.622105E-02 5.971317E-01 +100 3.980000E+00 4.401131E-03 5.851833E-01 +101 4.000000E+00 -7.199230E-03 5.751764E-01 +102 4.020000E+00 -1.856170E-02 5.611971E-01 +103 4.040000E+00 -2.965216E-02 5.479743E-01 +104 4.060000E+00 -4.048572E-02 5.355079E-01 +105 4.080000E+00 -5.107752E-02 5.237981E-01 +106 4.100000E+00 -6.144268E-02 5.128447E-01 +107 4.120000E+00 -7.151117E-02 4.939504E-01 +108 4.140000E+00 -8.119856E-02 4.747353E-01 +109 4.160000E+00 -9.049845E-02 4.551994E-01 +110 4.180000E+00 -9.940440E-02 4.353427E-01 +111 4.200000E+00 -1.079100E-01 4.151651E-01 +112 4.220000E+00 -1.159565E-01 3.900062E-01 +113 4.240000E+00 -1.235312E-01 3.679865E-01 +114 4.260000E+00 -1.306969E-01 3.491061E-01 +115 4.280000E+00 -1.375164E-01 3.333651E-01 +116 4.300000E+00 -1.440524E-01 3.207633E-01 +117 4.320000E+00 -1.503014E-01 3.040292E-01 +118 4.340000E+00 -1.562092E-01 2.866389E-01 +119 4.360000E+00 -1.617626E-01 2.685925E-01 +120 4.380000E+00 -1.669485E-01 2.498899E-01 +121 4.400000E+00 -1.717538E-01 2.305311E-01 +122 4.420000E+00 -1.760941E-01 2.036400E-01 +123 4.440000E+00 -1.799054E-01 1.776469E-01 +124 4.460000E+00 -1.832059E-01 1.525518E-01 +125 4.480000E+00 -1.860135E-01 1.283546E-01 +126 4.500000E+00 -1.883461E-01 1.050554E-01 +127 4.520000E+00 -1.902569E-01 8.558005E-02 +128 4.540000E+00 -1.917515E-01 6.344105E-02 +129 4.560000E+00 -1.927768E-01 3.863842E-02 +130 4.580000E+00 -1.932793E-01 1.117216E-02 +131 4.600000E+00 -1.932059E-01 -1.895774E-02 +132 4.620000E+00 -1.926829E-01 -3.331832E-02 +133 4.640000E+00 -1.918741E-01 -4.753697E-02 +134 4.660000E+00 -1.907824E-01 -6.161370E-02 +135 4.680000E+00 -1.894105E-01 -7.554851E-02 +136 4.700000E+00 -1.877614E-01 -8.934140E-02 +137 4.720000E+00 -1.859159E-01 -9.580751E-02 +138 4.740000E+00 -1.839049E-01 -1.058976E-01 +139 4.760000E+00 -1.816559E-01 -1.196116E-01 +140 4.780000E+00 -1.790963E-01 -1.369495E-01 +141 4.800000E+00 -1.761537E-01 -1.579114E-01 +142 4.820000E+00 -1.728280E-01 -1.744216E-01 +143 4.840000E+00 -1.691864E-01 -1.895036E-01 +144 4.860000E+00 -1.652574E-01 -2.031575E-01 +145 4.880000E+00 -1.610696E-01 -2.153832E-01 +146 4.900000E+00 -1.566516E-01 -2.261808E-01 +147 4.920000E+00 -1.521084E-01 -2.290714E-01 +148 4.940000E+00 -1.474515E-01 -2.375453E-01 +149 4.960000E+00 -1.425693E-01 -2.516026E-01 +150 4.980000E+00 -1.373502E-01 -2.712432E-01 +151 5.000000E+00 -1.316824E-01 -2.964672E-01 +152 5.020000E+00 -1.257009E-01 -3.016666E-01 +153 5.040000E+00 -1.196162E-01 -3.067953E-01 +154 5.060000E+00 -1.134296E-01 -3.118535E-01 +155 5.080000E+00 -1.071425E-01 -3.168409E-01 +156 5.100000E+00 -1.007564E-01 -3.217577E-01 +157 5.120000E+00 -9.430843E-02 -3.230025E-01 +158 5.140000E+00 -8.783782E-02 -3.240216E-01 +159 5.160000E+00 -8.134907E-02 -3.248150E-01 +160 5.180000E+00 -7.484672E-02 -3.253827E-01 +161 5.200000E+00 -6.833527E-02 -3.257248E-01 +162 5.220000E+00 -6.171989E-02 -3.350608E-01 +163 5.240000E+00 -5.496291E-02 -3.398853E-01 +164 5.260000E+00 -4.815456E-02 -3.401983E-01 +165 5.280000E+00 -4.138506E-02 -3.359997E-01 +166 5.300000E+00 -3.474465E-02 -3.272895E-01 +167 5.320000E+00 -2.866480E-02 -2.819209E-01 +168 5.340000E+00 -2.341879E-02 -2.439062E-01 +169 5.360000E+00 -1.885953E-02 -2.132454E-01 +170 5.380000E+00 -1.483994E-02 -1.899386E-01 +171 5.400000E+00 -1.121296E-02 -1.739857E-01 +172 5.420000E+00 -7.974056E-03 -1.497398E-01 +173 5.440000E+00 -5.229953E-03 -1.245058E-01 +174 5.460000E+00 -3.000413E-03 -9.828350E-02 +175 5.480000E+00 -1.305201E-03 -7.107305E-02 +176 5.500000E+00 -1.640790E-04 -4.287441E-02 +177 5.520000E+00 6.371635E-04 -3.612657E-02 +178 5.540000E+00 1.236053E-03 -2.263906E-02 +179 5.560000E+00 1.497795E-03 -2.411882E-03 +180 5.580000E+00 1.287597E-03 2.455496E-02 +181 5.600000E+00 4.706651E-04 5.826147E-02 +182 5.620000E+00 -7.026386E-04 5.910929E-02 +183 5.640000E+00 -1.895322E-03 6.019943E-02 +184 5.660000E+00 -3.112231E-03 6.153190E-02 +185 5.680000E+00 -4.358213E-03 6.310668E-02 +186 5.700000E+00 -5.638114E-03 6.492378E-02 +187 5.720000E+00 -6.949688E-03 6.610584E-02 +188 5.740000E+00 -8.277238E-03 6.652145E-02 +189 5.760000E+00 -9.605436E-03 6.617062E-02 +190 5.780000E+00 -1.091895E-02 6.505335E-02 +191 5.800000E+00 -1.220246E-02 6.316963E-02 +192 5.820000E+00 -1.341489E-02 5.820182E-02 +193 5.840000E+00 -1.453566E-02 5.400257E-02 +194 5.860000E+00 -1.558012E-02 5.057189E-02 +195 5.880000E+00 -1.656366E-02 4.790978E-02 +196 5.900000E+00 -1.750164E-02 4.601622E-02 +197 5.920000E+00 -1.840088E-02 4.358369E-02 +198 5.940000E+00 -1.923199E-02 3.920163E-02 +199 5.960000E+00 -1.995595E-02 3.287003E-02 +200 5.980000E+00 -2.053379E-02 2.458889E-02 +201 6.000000E+00 -2.092651E-02 1.435822E-02 +202 6.020000E+00 -2.120502E-02 1.352840E-02 +203 6.040000E+00 -2.146907E-02 1.291186E-02 +204 6.060000E+00 -2.172292E-02 1.250861E-02 +205 6.080000E+00 -2.197084E-02 1.231865E-02 +206 6.100000E+00 -2.221709E-02 1.234198E-02 +207 6.120000E+00 -2.246474E-02 1.237271E-02 +208 6.140000E+00 -2.270998E-02 1.210114E-02 +209 6.160000E+00 -2.294677E-02 1.152726E-02 +210 6.180000E+00 -2.316905E-02 1.065107E-02 +211 6.200000E+00 -2.337079E-02 9.472569E-03 +212 6.220000E+00 -2.332237E-02 -1.276224E-02 +213 6.240000E+00 -2.292243E-02 -2.567822E-02 +214 6.260000E+00 -2.235736E-02 -2.927535E-02 +215 6.280000E+00 -2.181354E-02 -2.355364E-02 +216 6.300000E+00 -2.147734E-02 -8.513096E-03 +217 6.320000E+00 -2.141633E-02 1.466366E-03 +218 6.340000E+00 -2.149820E-02 5.775798E-03 +219 6.360000E+00 -2.160956E-02 4.415202E-03 +220 6.380000E+00 -2.163701E-02 -2.615423E-03 +221 6.400000E+00 -2.146714E-02 -1.531608E-02 +222 6.420000E+00 -2.107402E-02 -2.337955E-02 +223 6.440000E+00 -2.055660E-02 -2.774728E-02 +224 6.460000E+00 -1.998877E-02 -2.841924E-02 +225 6.480000E+00 -1.944446E-02 -2.539546E-02 +226 6.500000E+00 -1.899759E-02 -1.867591E-02 +227 6.520000E+00 -1.869042E-02 -1.259095E-02 +228 6.540000E+00 -1.847196E-02 -9.804901E-03 +229 6.560000E+00 -1.827623E-02 -1.031775E-02 +230 6.580000E+00 -1.803726E-02 -1.412951E-02 +231 6.600000E+00 -1.768906E-02 -2.124018E-02 +232 6.620000E+00 -1.710949E-02 -3.551655E-02 +233 6.640000E+00 -1.631641E-02 -4.259122E-02 +234 6.660000E+00 -1.545385E-02 -4.246419E-02 +235 6.680000E+00 -1.466585E-02 -3.513545E-02 +236 6.700000E+00 -1.409644E-02 -2.060502E-02 +237 6.720000E+00 -1.374966E-02 -1.461056E-02 +238 6.740000E+00 -1.349054E-02 -1.183851E-02 +239 6.760000E+00 -1.325464E-02 -1.228886E-02 +240 6.780000E+00 -1.297750E-02 -1.596163E-02 +241 6.800000E+00 -1.259469E-02 -2.285680E-02 +242 6.820000E+00 -1.213049E-02 -2.349903E-02 +243 6.840000E+00 -1.165728E-02 -2.375897E-02 +244 6.860000E+00 -1.118268E-02 -2.363664E-02 +245 6.880000E+00 -1.071436E-02 -2.313203E-02 +246 6.900000E+00 -1.025995E-02 -2.224514E-02 +247 6.920000E+00 -9.817276E-03 -2.203990E-02 +248 6.940000E+00 -9.377653E-03 -2.193988E-02 +249 6.960000E+00 -8.938979E-03 -2.194508E-02 +250 6.980000E+00 -8.499148E-03 -2.205550E-02 +251 7.000000E+00 -8.056057E-03 -2.227113E-02 +252 7.020000E+00 -7.597830E-03 -2.345789E-02 +253 7.040000E+00 -7.121492E-03 -2.408210E-02 +254 7.060000E+00 -6.638296E-03 -2.414376E-02 +255 7.080000E+00 -6.159492E-03 -2.364288E-02 +256 7.100000E+00 -5.696331E-03 -2.257946E-02 +257 7.120000E+00 -5.301441E-03 -1.729553E-02 +258 7.140000E+00 -4.989070E-03 -1.432759E-02 +259 7.160000E+00 -4.712898E-03 -1.367562E-02 +260 7.180000E+00 -4.426605E-03 -1.533964E-02 +261 7.200000E+00 -4.083872E-03 -1.931964E-02 +262 7.220000E+00 -3.631995E-03 -2.538390E-02 +263 7.240000E+00 -3.087883E-03 -2.854317E-02 +264 7.260000E+00 -2.509635E-03 -2.879748E-02 +265 7.280000E+00 -1.955351E-03 -2.614680E-02 +266 7.300000E+00 -1.483130E-03 -2.059115E-02 +267 7.320000E+00 -1.113389E-03 -1.639767E-02 +268 7.340000E+00 -8.266321E-04 -1.229279E-02 +269 7.360000E+00 -6.210869E-04 -8.276492E-03 +270 7.380000E+00 -4.949818E-04 -4.348786E-03 +271 7.400000E+00 -4.465449E-04 -5.096684E-04 +272 7.420000E+00 -5.304321E-04 8.162452E-03 +273 7.440000E+00 -7.436056E-04 1.241897E-02 +274 7.460000E+00 -9.977534E-04 1.225988E-02 +275 7.480000E+00 -1.204563E-03 7.685191E-03 +276 7.500000E+00 -1.275724E-03 -1.305104E-03 +277 7.520000E+00 -1.199415E-03 -5.916706E-03 +278 7.540000E+00 -1.055417E-03 -8.074089E-03 +279 7.560000E+00 -8.928131E-04 -7.777253E-03 +280 7.580000E+00 -7.606883E-04 -5.026198E-03 +281 7.600000E+00 -7.081267E-04 1.790768E-04 +282 7.620000E+00 -7.213835E-04 1.157786E-03 +283 7.640000E+00 -7.548855E-04 2.203601E-03 +284 7.660000E+00 -8.099749E-04 3.316523E-03 +285 7.680000E+00 -8.879938E-04 4.496550E-03 +286 7.700000E+00 -9.902843E-04 5.743685E-03 +287 7.720000E+00 -1.122403E-03 7.421734E-03 +288 7.740000E+00 -1.285295E-03 8.820936E-03 +289 7.760000E+00 -1.473382E-03 9.941291E-03 +290 7.780000E+00 -1.681087E-03 1.078280E-02 +291 7.800000E+00 -1.902835E-03 1.134546E-02 +292 7.820000E+00 -2.225281E-03 2.008573E-02 +293 7.840000E+00 -2.673724E-03 2.394500E-02 +294 7.860000E+00 -3.150542E-03 2.292328E-02 +295 7.880000E+00 -3.558115E-03 1.702056E-02 +296 7.900000E+00 -3.798824E-03 6.236836E-03 +297 7.920000E+00 -3.844315E-03 -1.142168E-03 +298 7.940000E+00 -3.774961E-03 -5.247538E-03 +299 7.960000E+00 -3.656237E-03 -6.079274E-03 +300 7.980000E+00 -3.553615E-03 -3.637376E-03 +301 8.000000E+00 -3.532566E-03 2.078155E-03 +302 8.020000E+00 -3.611956E-03 5.494873E-03 +303 8.040000E+00 -3.737724E-03 6.716053E-03 +304 8.060000E+00 -3.865961E-03 5.741694E-03 +305 8.080000E+00 -3.952755E-03 2.571796E-03 +306 8.100000E+00 -3.954196E-03 -2.793640E-03 +307 8.120000E+00 -3.873685E-03 -5.086591E-03 +308 8.140000E+00 -3.757567E-03 -6.354313E-03 +309 8.160000E+00 -3.626347E-03 -6.596805E-03 +310 8.180000E+00 -3.500530E-03 -5.814068E-03 +311 8.200000E+00 -3.400620E-03 -4.006101E-03 +312 8.220000E+00 -3.334411E-03 -2.730570E-03 +313 8.240000E+00 -3.286762E-03 -2.150229E-03 +314 8.260000E+00 -3.243768E-03 -2.265076E-03 +315 8.280000E+00 -3.191524E-03 -3.075114E-03 +316 8.300000E+00 -3.116129E-03 -4.580340E-03 +317 8.320000E+00 -2.964210E-03 -1.014102E-02 +318 8.340000E+00 -2.729309E-03 -1.287854E-02 +319 8.360000E+00 -2.467889E-03 -1.279292E-02 +320 8.380000E+00 -2.236413E-03 -9.884157E-03 +321 8.400000E+00 -2.091344E-03 -4.152240E-03 +322 8.420000E+00 -2.034875E-03 -1.692189E-03 +323 8.440000E+00 -2.015752E-03 -4.177491E-04 +324 8.460000E+00 -2.010261E-03 -3.289192E-04 +325 8.480000E+00 -1.994691E-03 -1.425700E-03 +326 8.500000E+00 -1.945329E-03 -3.708091E-03 +327 8.520000E+00 -1.867098E-03 -4.115259E-03 +328 8.540000E+00 -1.780711E-03 -4.523663E-03 +329 8.560000E+00 -1.686143E-03 -4.933304E-03 +330 8.580000E+00 -1.583370E-03 -5.344181E-03 +331 8.600000E+00 -1.472368E-03 -5.756296E-03 +332 8.620000E+00 -1.328792E-03 -8.394009E-03 +333 8.640000E+00 -1.144899E-03 -9.787974E-03 +334 8.660000E+00 -9.455644E-04 -9.938189E-03 +335 8.680000E+00 -7.556630E-04 -8.844656E-03 +336 8.700000E+00 -6.000698E-04 -6.507373E-03 +337 8.720000E+00 -5.364035E-04 -3.286769E-04 +338 8.740000E+00 -5.681458E-04 3.033482E-03 +339 8.760000E+00 -6.389659E-04 3.579102E-03 +340 8.780000E+00 -6.925330E-04 1.308185E-03 +341 8.800000E+00 -6.725164E-04 -3.779270E-03 +342 8.820000E+00 -5.113768E-04 -1.169180E-02 +343 8.840000E+00 -2.305599E-04 -1.574700E-02 +344 8.860000E+00 9.278768E-05 -1.594487E-02 +345 8.880000E+00 3.815195E-04 -1.228542E-02 +346 8.900000E+00 5.584889E-04 -4.768636E-03 +347 8.920000E+00 6.079481E-04 -2.335309E-04 +348 8.940000E+00 5.700798E-04 3.964121E-03 +349 8.960000E+00 4.516330E-04 7.824320E-03 +350 8.980000E+00 2.593567E-04 1.134707E-02 +351 9.000000E+00 0.000000E+00 1.453236E-02 diff --git a/examples/PACKAGES/dpd-basic/dpd_tstat/in.dpd_tstat b/examples/PACKAGES/dpd-basic/dpd_tstat/in.dpd_tstat new file mode 100644 index 0000000000..a7fff24a23 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd_tstat/in.dpd_tstat @@ -0,0 +1,31 @@ +# Coarse-Grained SPC/E Water + +variable T equal 300.0 +variable rc equal 9.0 +variable rcD equal 10.0 + +units real +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +read_data cg_spce.data + +pair_style hybrid/overlay table spline 1000 dpd/tstat ${T} ${T} ${rc} 385262 + +pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} +pair_coeff 1 1 dpd/tstat 10.0 ${rcD} + +timestep 1.0 +run_style verlet + +velocity all create ${T} 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 1000 diff --git a/examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.1 b/examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.1 new file mode 100644 index 0000000000..428ee4651a --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.1 @@ -0,0 +1,106 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Coarse-Grained SPC/E Water + +variable T equal 300.0 +variable rc equal 9.0 +variable rcD equal 10.0 + +units real +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +read_data cg_spce.data +Reading data file ... + orthogonal box = (0 0 0) to (40.31 40.31 40.31) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 2180 atoms + read_data CPU = 0.003 seconds + +pair_style hybrid/overlay table spline 1000 dpd/tstat ${T} ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/tstat 300 ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/tstat 300 300 ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/tstat 300 300 9 385262 + +pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} +pair_coeff 1 1 table cg_spce_table.pot VOTCA 9 +WARNING: 16 of 351 force values in table VOTCA are inconsistent with -dE/dr. +WARNING: Should only be flagged at inflection points (src/pair_table.cpp:465) +pair_coeff 1 1 dpd/tstat 10.0 ${rcD} +pair_coeff 1 1 dpd/tstat 10.0 10 + +timestep 1.0 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 300 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 1000 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 7 7 7 + 2 neighbor lists, perpetual/occasional/extra = 2 0 0 + (1) pair table, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard + (2) pair dpd/tstat, perpetual, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +Per MPI rank memory allocation (min/avg/max) = 5.38 | 5.38 | 5.38 Mbytes + Step Time Temp Press + 0 0 300 7459.7935 + 100 100 309.27219 6997.2438 + 200 200 311.23318 9940.3922 + 300 300 300.14145 7970.3486 + 400 400 293.17924 8390.7272 + 500 500 285.9647 7304.1147 + 600 600 291.15512 6605.1675 + 700 700 294.54557 7708.3815 + 800 800 288.72442 8641.2675 + 900 900 294.83288 7145.1684 + 1000 1000 291.12446 8525.4556 +Loop time of 10.1894 on 1 procs for 1000 steps with 2180 atoms + +Performance: 8.479 ns/day, 2.830 hours/ns, 98.141 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 10.02 | 10.02 | 10.02 | 0.0 | 98.34 +Neigh | 0.087623 | 0.087623 | 0.087623 | 0.0 | 0.86 +Comm | 0.055526 | 0.055526 | 0.055526 | 0.0 | 0.54 +Output | 0.00026505 | 0.00026505 | 0.00026505 | 0.0 | 0.00 +Modify | 0.013958 | 0.013958 | 0.013958 | 0.0 | 0.14 +Other | | 0.01163 | | | 0.11 + +Nlocal: 2180 ave 2180 max 2180 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 6741 ave 6741 max 6741 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 261567 ave 261567 max 261567 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 261567 +Ave neighs/atom = 119.98486 +Neighbor list builds = 14 +Dangerous builds = 0 +Total wall time: 0:00:10 diff --git a/examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.4 b/examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.4 new file mode 100644 index 0000000000..f20bde0e6b --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpd_tstat/log.5Apr22.dpd_tstat.g++.4 @@ -0,0 +1,106 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Coarse-Grained SPC/E Water + +variable T equal 300.0 +variable rc equal 9.0 +variable rcD equal 10.0 + +units real +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +read_data cg_spce.data +Reading data file ... + orthogonal box = (0 0 0) to (40.31 40.31 40.31) + 1 by 2 by 2 MPI processor grid + reading atoms ... + 2180 atoms + read_data CPU = 0.003 seconds + +pair_style hybrid/overlay table spline 1000 dpd/tstat ${T} ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/tstat 300 ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/tstat 300 300 ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/tstat 300 300 9 385262 + +pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} +pair_coeff 1 1 table cg_spce_table.pot VOTCA 9 +WARNING: 16 of 351 force values in table VOTCA are inconsistent with -dE/dr. +WARNING: Should only be flagged at inflection points (src/pair_table.cpp:465) +pair_coeff 1 1 dpd/tstat 10.0 ${rcD} +pair_coeff 1 1 dpd/tstat 10.0 10 + +timestep 1.0 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 300 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 1000 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 7 7 7 + 2 neighbor lists, perpetual/occasional/extra = 2 0 0 + (1) pair table, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard + (2) pair dpd/tstat, perpetual, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +Per MPI rank memory allocation (min/avg/max) = 3.695 | 3.696 | 3.697 Mbytes + Step Time Temp Press + 0 0 300 7929.9249 + 100 100 305.51763 8531.8105 + 200 200 304.43334 8697.989 + 300 300 292.42805 6865.4712 + 400 400 300.66447 7606.6995 + 500 500 298.43456 8713.2403 + 600 600 298.10981 6913.5475 + 700 700 297.39737 9121.8642 + 800 800 298.23888 7833.1307 + 900 900 293.91793 8423.8417 + 1000 1000 299.65933 7974.9976 +Loop time of 2.82436 on 4 procs for 1000 steps with 2180 atoms + +Performance: 30.591 ns/day, 0.785 hours/ns, 354.062 timesteps/s +99.7% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.6238 | 2.644 | 2.6909 | 1.7 | 93.61 +Neigh | 0.021524 | 0.021958 | 0.022778 | 0.3 | 0.78 +Comm | 0.10035 | 0.1479 | 0.16842 | 7.2 | 5.24 +Output | 0.00019058 | 0.00021173 | 0.00026852 | 0.0 | 0.01 +Modify | 0.0041395 | 0.0041846 | 0.0042798 | 0.1 | 0.15 +Other | | 0.006091 | | | 0.22 + +Nlocal: 545 ave 559 max 536 min +Histogram: 1 0 1 1 0 0 0 0 0 1 +Nghost: 3613.5 ave 3634 max 3604 min +Histogram: 1 2 0 0 0 0 0 0 0 1 +Neighs: 65402 ave 68101 max 63621 min +Histogram: 1 1 0 0 1 0 0 0 0 1 + +Total # of neighbors = 261608 +Ave neighs/atom = 120.00367 +Neighbor list builds = 14 +Dangerous builds = 0 +Total wall time: 0:00:02 diff --git a/examples/PACKAGES/dpd-basic/dpdext/in.dpdext b/examples/PACKAGES/dpd-basic/dpdext/in.dpdext index 726f3a7b39..9f87743fed 100644 --- a/examples/PACKAGES/dpd-basic/dpdext/in.dpdext +++ b/examples/PACKAGES/dpd-basic/dpdext/in.dpdext @@ -4,9 +4,9 @@ variable T equal 1.0 variable rc equal 1.0 variable rcD equal 1.2 -units lj +units lj boundary p p p -atom_style atomic +atom_style atomic dimension 3 newton on comm_modify vel yes @@ -16,29 +16,27 @@ variable L equal 5.0 lattice fcc 3.0 region simBox block 0 ${L} 0 ${L} 0 ${L} create_box 2 simBox -#create_atoms 1 region simBox -create_atoms 1 random 100 132456 simBox -create_atoms 2 random 100 132456 simBox +create_atoms 1 random 100 12456 simBox +create_atoms 2 random 100 13245 simBox mass 1 1.0 mass 2 2.0 ### -pair_style dpd/ext ${T} ${rc} 3854262 +pair_style dpd/ext ${T} ${rc} 3854262 pair_coeff 1 1 25.0 4.5 4.53 0.5 0.53 1.2 #${rcD} pair_coeff 1 2 25.1 4.51 4.54 0.51 0.54 1.21 #${rcD} pair_coeff 2 2 25.2 4.52 4.55 0.52 0.55 1.22 #${rcD} -timestep 0.01 +timestep 0.01 run_style verlet velocity all create ${T} 68768932 thermo_style custom step time temp press -thermo 500 +thermo 100 fix 1 all nve -run 50000 +run 5000 -write_data final.data pair ij \ No newline at end of file diff --git a/examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.1 b/examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.1 new file mode 100644 index 0000000000..660b4f464d --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.1 @@ -0,0 +1,153 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# DPD Fluid + +variable T equal 1.0 +variable rc equal 1.0 +variable rcD equal 1.2 + +units lj +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +### create box and configuration +variable L equal 5.0 +lattice fcc 3.0 +Lattice spacing in x,y,z = 1.1006424 1.1006424 1.1006424 +region simBox block 0 ${L} 0 ${L} 0 ${L} +region simBox block 0 5 0 ${L} 0 ${L} +region simBox block 0 5 0 5 0 ${L} +region simBox block 0 5 0 5 0 5 +create_box 2 simBox +Created orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + 1 by 1 by 1 MPI processor grid +create_atoms 1 random 100 12456 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +create_atoms 2 random 100 13245 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +mass 1 1.0 +mass 2 2.0 +### + +pair_style dpd/ext ${T} ${rc} 3854262 +pair_style dpd/ext 1 ${rc} 3854262 +pair_style dpd/ext 1 1 3854262 + +pair_coeff 1 1 25.0 4.5 4.53 0.5 0.53 1.2 #${rcD} +pair_coeff 1 2 25.1 4.51 4.54 0.51 0.54 1.21 #${rcD} +pair_coeff 2 2 25.2 4.52 4.55 0.52 0.55 1.22 #${rcD} + +timestep 0.01 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 1 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 5000 + generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.52 + ghost atom cutoff = 1.52 + binsize = 0.76, bins = 8 8 8 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair dpd/ext, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.083 | 3.083 | 3.083 Mbytes + Step Time Temp Press + 0 0 1 10.864186 + 100 1 1.1314376 7.1955963 + 200 2 1.0058948 8.4574538 + 300 3 0.93292241 7.7033353 + 400 4 0.93599378 7.9649888 + 500 5 1.0390423 7.9498546 + 600 6 1.0750333 7.3594973 + 700 7 1.119325 7.1843859 + 800 8 0.96727219 6.8327896 + 900 9 0.98826001 8.1974994 + 1000 10 1.105819 7.8830702 + 1100 11 0.99559202 7.8295372 + 1200 12 0.9210428 8.2045593 + 1300 13 0.96628584 8.6531905 + 1400 14 1.1808689 7.7659964 + 1500 15 0.96208743 7.9977415 + 1600 16 1.0080123 7.6254557 + 1700 17 0.96910957 8.3643075 + 1800 18 1.0562621 7.5966268 + 1900 19 0.93109173 7.7944606 + 2000 20 1.1126085 9.3753501 + 2100 21 1.1328553 7.6293793 + 2200 22 0.8964042 7.5985061 + 2300 23 1.0043044 8.0016943 + 2400 24 1.0319521 8.1249684 + 2500 25 0.95913468 7.2383318 + 2600 26 0.99480311 7.6491295 + 2700 27 0.9735191 7.5004628 + 2800 28 0.96145308 8.222045 + 2900 29 1.0131071 6.6390842 + 3000 30 0.99463836 7.0147693 + 3100 31 0.96803993 8.2738796 + 3200 32 0.94066026 9.476403 + 3300 33 0.97401823 6.409563 + 3400 34 1.0548493 7.7301555 + 3500 35 0.98567796 8.2949868 + 3600 36 0.86621746 7.4759028 + 3700 37 0.94934175 8.1189998 + 3800 38 0.9626774 7.7986715 + 3900 39 0.95728518 6.8669836 + 4000 40 1.0866412 7.41281 + 4100 41 0.98873564 6.4612262 + 4200 42 0.9109925 7.1806331 + 4300 43 1.0344723 8.4617679 + 4400 44 0.98920584 7.3622901 + 4500 45 0.99386139 6.8002442 + 4600 46 1.0947487 6.8868352 + 4700 47 0.98789482 7.8428621 + 4800 48 1.0035907 8.3878628 + 4900 49 1.0336467 8.1592349 + 5000 50 1.0870964 8.217988 +Loop time of 0.907286 on 1 procs for 5000 steps with 200 atoms + +Performance: 4761453.941 tau/day, 5510.942 timesteps/s +99.5% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.79672 | 0.79672 | 0.79672 | 0.0 | 87.81 +Neigh | 0.066416 | 0.066416 | 0.066416 | 0.0 | 7.32 +Comm | 0.029801 | 0.029801 | 0.029801 | 0.0 | 3.28 +Output | 0.0010415 | 0.0010415 | 0.0010415 | 0.0 | 0.11 +Modify | 0.0078915 | 0.0078915 | 0.0078915 | 0.0 | 0.87 +Other | | 0.005414 | | | 0.60 + +Nlocal: 200 ave 200 max 200 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 563 ave 563 max 563 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1624 ave 1624 max 1624 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1624 +Ave neighs/atom = 8.12 +Neighbor list builds = 500 +Dangerous builds = 500 + +Total wall time: 0:00:00 diff --git a/examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.4 b/examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.4 new file mode 100644 index 0000000000..3b505741a8 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpdext/log.5Apr22.dpdext.g++.4 @@ -0,0 +1,153 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# DPD Fluid + +variable T equal 1.0 +variable rc equal 1.0 +variable rcD equal 1.2 + +units lj +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +### create box and configuration +variable L equal 5.0 +lattice fcc 3.0 +Lattice spacing in x,y,z = 1.1006424 1.1006424 1.1006424 +region simBox block 0 ${L} 0 ${L} 0 ${L} +region simBox block 0 5 0 ${L} 0 ${L} +region simBox block 0 5 0 5 0 ${L} +region simBox block 0 5 0 5 0 5 +create_box 2 simBox +Created orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + 1 by 2 by 2 MPI processor grid +create_atoms 1 random 100 12456 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +create_atoms 2 random 100 13245 simBox +Created 100 atoms + using lattice units in orthogonal box = (0 0 0) to (5.5032121 5.5032121 5.5032121) + create_atoms CPU = 0.000 seconds +mass 1 1.0 +mass 2 2.0 +### + +pair_style dpd/ext ${T} ${rc} 3854262 +pair_style dpd/ext 1 ${rc} 3854262 +pair_style dpd/ext 1 1 3854262 + +pair_coeff 1 1 25.0 4.5 4.53 0.5 0.53 1.2 #${rcD} +pair_coeff 1 2 25.1 4.51 4.54 0.51 0.54 1.21 #${rcD} +pair_coeff 2 2 25.2 4.52 4.55 0.52 0.55 1.22 #${rcD} + +timestep 0.01 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 1 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 5000 + generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.52 + ghost atom cutoff = 1.52 + binsize = 0.76, bins = 8 8 8 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair dpd/ext, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.064 | 3.064 | 3.064 Mbytes + Step Time Temp Press + 0 0 1 9.2729849 + 100 1 1.1416138 7.7058466 + 200 2 0.91696292 8.1601454 + 300 3 0.96358166 6.7987934 + 400 4 0.94726377 7.6196059 + 500 5 1.0941462 7.5974711 + 600 6 0.91469027 8.3921536 + 700 7 1.0912559 7.362721 + 800 8 0.96537861 9.2089379 + 900 9 0.9986577 8.0072887 + 1000 10 0.9580071 7.2399027 + 1100 11 0.94763774 7.8075521 + 1200 12 0.9942368 7.5215461 + 1300 13 1.0312465 8.2684258 + 1400 14 0.95133276 7.2734722 + 1500 15 0.97273431 7.1831939 + 1600 16 1.0052028 7.929104 + 1700 17 0.93909435 8.2831308 + 1800 18 1.0647294 8.850861 + 1900 19 1.0268112 7.2828461 + 2000 20 0.91293528 8.208191 + 2100 21 0.94719411 8.3353929 + 2200 22 0.90507637 9.1708397 + 2300 23 1.0663386 7.1415871 + 2400 24 1.0132089 9.2210634 + 2500 25 1.0633849 8.3368039 + 2600 26 0.95803955 8.8247976 + 2700 27 0.95264552 7.3204561 + 2800 28 0.93548595 7.290555 + 2900 29 0.96876322 7.4969147 + 3000 30 0.99554648 8.2055023 + 3100 31 1.0190751 7.907751 + 3200 32 1.0887502 7.7247246 + 3300 33 1.0059692 7.4039814 + 3400 34 1.0055991 7.3469353 + 3500 35 1.0067689 7.2161248 + 3600 36 1.1103667 8.4373236 + 3700 37 1.0668979 7.1922528 + 3800 38 0.97902043 5.5426601 + 3900 39 1.0268733 6.7786635 + 4000 40 1.0036613 7.8078466 + 4100 41 1.0714377 7.4129166 + 4200 42 0.99168608 6.0096099 + 4300 43 1.084818 7.4932992 + 4400 44 0.98348896 8.9950057 + 4500 45 1.045253 6.1309568 + 4600 46 1.0266723 6.3227645 + 4700 47 1.0183525 8.1505786 + 4800 48 1.0527309 8.2824928 + 4900 49 0.96877903 7.6341751 + 5000 50 1.0178917 7.5037327 +Loop time of 0.320182 on 4 procs for 5000 steps with 200 atoms + +Performance: 13492326.176 tau/day, 15616.118 timesteps/s +98.4% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.20185 | 0.21019 | 0.2166 | 1.4 | 65.65 +Neigh | 0.017652 | 0.018339 | 0.019085 | 0.5 | 5.73 +Comm | 0.076802 | 0.084707 | 0.094197 | 2.6 | 26.46 +Output | 0.00057039 | 0.00066408 | 0.00093301 | 0.0 | 0.21 +Modify | 0.0025036 | 0.0027709 | 0.0030403 | 0.5 | 0.87 +Other | | 0.003508 | | | 1.10 + +Nlocal: 50 ave 53 max 45 min +Histogram: 1 0 0 0 0 0 1 0 1 1 +Nghost: 288.5 ave 300 max 279 min +Histogram: 1 1 0 0 0 0 1 0 0 1 +Neighs: 418.25 ave 438 max 384 min +Histogram: 1 0 0 0 0 1 0 0 0 2 + +Total # of neighbors = 1673 +Ave neighs/atom = 8.365 +Neighbor list builds = 500 +Dangerous builds = 500 + +Total wall time: 0:00:00 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data b/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data deleted file mode 100644 index d487e2c73c..0000000000 --- a/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data +++ /dev/null @@ -1,2196 +0,0 @@ - Coarse-Grained SPC/E Water - - 2180 atoms - - 1 atom types - - 0.0000000E+00 40.310000000000 xlo xhi - 0.0000000E+00 40.310000000000 ylo yhi - 0.0000000E+00 40.310000000000 zlo zhi - - Masses - -1 18.01540 - - Atoms - -1 1 2.815000E+01 5.430000E+00 2.370000E+00 -2 1 1.890000E+00 2.957000E+01 1.761000E+01 -3 1 8.920000E+00 3.556000E+01 8.240000E+00 -4 1 2.307000E+01 9.600000E+00 4.710000E+00 -5 1 1.688000E+01 8.940000E+00 3.880000E+00 -6 1 2.571000E+01 1.277000E+01 1.056000E+01 -7 1 2.788000E+01 3.328000E+01 1.300000E-01 -8 1 3.287000E+01 2.050000E+00 1.368000E+01 -9 1 4.900000E+00 2.183000E+01 1.751000E+01 -10 1 9.670000E+00 3.108000E+01 1.843000E+01 -11 1 1.233000E+01 3.490000E+00 1.091000E+01 -12 1 6.630000E+00 1.581000E+01 3.455000E+01 -13 1 3.951000E+01 2.047000E+01 2.288000E+01 -14 1 3.977000E+01 3.173000E+01 9.060000E+00 -15 1 5.370000E+00 8.940000E+00 3.646000E+01 -16 1 2.129000E+01 3.853000E+01 3.468000E+01 -17 1 1.987000E+01 2.677000E+01 3.762000E+01 -18 1 2.658000E+01 3.167000E+01 2.280000E+00 -19 1 1.231000E+01 3.336000E+01 1.098000E+01 -20 1 7.310000E+00 1.410000E+01 1.654000E+01 -21 1 3.388000E+01 2.584000E+01 1.677000E+01 -22 1 1.115000E+01 3.070000E+00 3.992000E+01 -23 1 3.171000E+01 3.195000E+01 2.267000E+01 -24 1 5.960000E+00 3.507000E+01 1.230000E+01 -25 1 2.904000E+01 1.740000E+00 9.460000E+00 -26 1 1.539000E+01 2.686000E+01 2.030000E+00 -27 1 3.890000E+00 2.148000E+01 2.877000E+01 -28 1 4.550000E+00 2.800000E+01 2.431000E+01 -29 1 9.680000E+00 3.992000E+01 2.964000E+01 -30 1 2.560000E+00 3.939000E+01 2.987000E+01 -31 1 4.960000E+00 2.280000E+01 6.230000E+00 -32 1 2.795000E+01 3.511000E+01 9.810000E+00 -33 1 3.254000E+01 3.032000E+01 3.025000E+01 -34 1 2.292000E+01 3.033000E+01 1.730000E+01 -35 1 2.190000E+00 2.025000E+01 3.929000E+01 -36 1 9.460000E+00 3.815000E+01 6.950000E+00 -37 1 2.409000E+01 2.885000E+01 7.730000E+00 -38 1 3.711000E+01 3.888000E+01 3.314000E+01 -39 1 3.492000E+01 1.987000E+01 8.240000E+00 -40 1 1.350000E+00 3.799000E+01 3.885000E+01 -41 1 3.289000E+01 3.289000E+01 1.859000E+01 -42 1 3.337000E+01 1.603000E+01 3.141000E+01 -43 1 5.120000E+00 6.540000E+00 3.231000E+01 -44 1 5.080000E+00 3.640000E+00 2.178000E+01 -45 1 7.090000E+00 1.072000E+01 1.911000E+01 -46 1 2.804000E+01 1.444000E+01 2.027000E+01 -47 1 2.972000E+01 3.928000E+01 2.997000E+01 -48 1 2.170000E+01 3.263000E+01 3.100000E+01 -49 1 3.063000E+01 8.940000E+00 3.410000E+00 -50 1 2.400000E+00 1.484000E+01 2.534000E+01 -51 1 2.128000E+01 3.944000E+01 1.892000E+01 -52 1 3.616000E+01 3.993000E+01 1.443000E+01 -53 1 2.416000E+01 2.414000E+01 1.280000E+01 -54 1 3.177000E+01 1.047000E+01 1.568000E+01 -55 1 4.024000E+01 1.188000E+01 3.343000E+01 -56 1 6.040000E+00 1.367000E+01 4.028000E+01 -57 1 1.537000E+01 3.589000E+01 6.930000E+00 -58 1 1.231000E+01 2.220000E+00 1.471000E+01 -59 1 3.450000E+00 4.810000E+00 2.487000E+01 -60 1 1.589000E+01 2.520000E+00 1.705000E+01 -61 1 3.705000E+01 3.620000E+01 6.730000E+00 -62 1 3.777000E+01 2.710000E+01 4.029000E+01 -63 1 8.260000E+00 2.033000E+01 4.030000E+01 -64 1 8.210000E+00 3.558000E+01 1.717000E+01 -65 1 3.338000E+01 1.389000E+01 2.210000E+01 -66 1 1.454000E+01 1.650000E+00 1.300000E+01 -67 1 1.977000E+01 3.489000E+01 1.751000E+01 -68 1 5.630000E+00 4.220000E+00 3.875000E+01 -69 1 7.570000E+00 2.576000E+01 1.371000E+01 -70 1 9.340000E+00 3.392000E+01 3.538000E+01 -71 1 2.116000E+01 8.590000E+00 1.475000E+01 -72 1 2.328000E+01 4.022000E+01 1.138000E+01 -73 1 1.298000E+01 3.479000E+01 2.338000E+01 -74 1 2.232000E+01 3.339000E+01 5.320000E+00 -75 1 3.290000E+00 3.240000E+01 2.024000E+01 -76 1 3.794000E+01 3.982000E+01 1.790000E+00 -77 1 1.111000E+01 1.440000E+01 2.301000E+01 -78 1 2.556000E+01 1.714000E+01 1.684000E+01 -79 1 2.500000E+00 2.474000E+01 2.028000E+01 -80 1 1.692000E+01 3.837000E+01 1.303000E+01 -81 1 6.310000E+00 2.551000E+01 3.960000E+01 -82 1 2.402000E+01 1.966000E+01 2.905000E+01 -83 1 2.216000E+01 9.500000E+00 2.543000E+01 -84 1 2.006000E+01 3.431000E+01 4.260000E+00 -85 1 2.198000E+01 8.670000E+00 2.806000E+01 -86 1 1.465000E+01 2.763000E+01 8.340000E+00 -87 1 3.975000E+01 3.870000E+00 3.701000E+01 -88 1 2.952000E+01 7.340000E+00 5.310000E+00 -89 1 2.759000E+01 1.589000E+01 3.402000E+01 -90 1 3.746000E+01 3.945000E+01 2.486000E+01 -91 1 2.370000E+01 2.429000E+01 2.803000E+01 -92 1 1.270000E+01 1.653000E+01 2.314000E+01 -93 1 1.653000E+01 2.786000E+01 2.885000E+01 -94 1 3.146000E+01 2.340000E+00 8.320000E+00 -95 1 3.406000E+01 2.124000E+01 2.389000E+01 -96 1 5.130000E+00 1.574000E+01 8.360000E+00 -97 1 3.087000E+01 6.020000E+00 2.295000E+01 -98 1 3.607000E+01 3.674000E+01 9.200000E+00 -99 1 2.507000E+01 2.107000E+01 3.778000E+01 -100 1 3.351000E+01 4.870000E+00 1.301000E+01 -101 1 2.978000E+01 1.879000E+01 1.277000E+01 -102 1 2.496000E+01 1.400000E-01 3.900000E+01 -103 1 3.761000E+01 3.179000E+01 2.540000E+00 -104 1 2.600000E+00 6.800000E+00 3.347000E+01 -105 1 2.570000E+01 3.173000E+01 1.831000E+01 -106 1 9.460000E+00 1.524000E+01 2.542000E+01 -107 1 2.255000E+01 2.515000E+01 2.190000E+00 -108 1 1.902000E+01 1.988000E+01 3.138000E+01 -109 1 9.450000E+00 3.164000E+01 2.652000E+01 -110 1 6.810000E+00 9.420000E+00 1.463000E+01 -111 1 1.651000E+01 5.200000E+00 2.836000E+01 -112 1 2.234000E+01 2.475000E+01 3.956000E+01 -113 1 3.805000E+01 2.946000E+01 9.080000E+00 -114 1 3.553000E+01 1.590000E+01 1.032000E+01 -115 1 2.565000E+01 3.402000E+01 1.062000E+01 -116 1 1.554000E+01 5.410000E+00 3.926000E+01 -117 1 2.449000E+01 1.282000E+01 1.305000E+01 -118 1 1.590000E+00 3.743000E+01 3.398000E+01 -119 1 1.954000E+01 9.570000E+00 1.179000E+01 -120 1 9.870000E+00 1.497000E+01 1.872000E+01 -121 1 2.925000E+01 3.397000E+01 7.650000E+00 -122 1 2.738000E+01 3.514000E+01 2.980000E+01 -123 1 3.704000E+01 2.310000E+00 2.189000E+01 -124 1 1.988000E+01 1.471000E+01 1.600000E-01 -125 1 1.118000E+01 1.476000E+01 3.354000E+01 -126 1 3.100000E-01 2.588000E+01 3.313000E+01 -127 1 3.437000E+01 2.586000E+01 2.337000E+01 -128 1 3.931000E+01 3.398000E+01 3.424000E+01 -129 1 7.070000E+00 3.063000E+01 2.188000E+01 -130 1 1.840000E+00 1.104000E+01 1.974000E+01 -131 1 1.924000E+01 3.244000E+01 3.670000E+01 -132 1 1.675000E+01 3.463000E+01 1.524000E+01 -133 1 1.670000E+01 3.557000E+01 2.765000E+01 -134 1 3.999000E+01 3.970000E+01 2.385000E+01 -135 1 3.096000E+01 5.990000E+00 1.962000E+01 -136 1 2.357000E+01 1.297000E+01 2.012000E+01 -137 1 5.010000E+00 1.524000E+01 3.843000E+01 -138 1 6.180000E+00 1.152000E+01 2.331000E+01 -139 1 1.200000E+00 2.550000E+01 2.334000E+01 -140 1 4.210000E+00 2.882000E+01 1.460000E+00 -141 1 5.750000E+00 2.729000E+01 7.300000E+00 -142 1 2.792000E+01 6.980000E+00 2.345000E+01 -143 1 9.150000E+00 1.540000E+00 3.415000E+01 -144 1 3.475000E+01 3.229000E+01 2.751000E+01 -145 1 2.668000E+01 2.350000E+00 2.394000E+01 -146 1 3.942000E+01 8.270000E+00 2.016000E+01 -147 1 7.790000E+00 9.330000E+00 2.277000E+01 -148 1 3.106000E+01 3.520000E+01 1.946000E+01 -149 1 1.154000E+01 4.670000E+00 2.609000E+01 -150 1 3.318000E+01 3.935000E+01 3.181000E+01 -151 1 3.033000E+01 3.290000E+00 1.594000E+01 -152 1 2.314000E+01 1.230000E+00 6.300000E-01 -153 1 2.688000E+01 1.040000E+01 1.937000E+01 -154 1 2.805000E+01 3.313000E+01 1.849000E+01 -155 1 3.801000E+01 1.582000E+01 2.545000E+01 -156 1 2.225000E+01 3.680000E+00 9.400000E-01 -157 1 3.259000E+01 2.797000E+01 1.170000E+01 -158 1 1.934000E+01 1.035000E+01 4.000000E-02 -159 1 2.211000E+01 1.586000E+01 4.280000E+00 -160 1 2.636000E+01 2.283000E+01 3.116000E+01 -161 1 3.060000E+00 1.832000E+01 3.778000E+01 -162 1 4.009000E+01 3.503000E+01 8.480000E+00 -163 1 2.116000E+01 3.349000E+01 2.047000E+01 -164 1 2.972000E+01 2.068000E+01 8.160000E+00 -165 1 2.669000E+01 9.500000E-01 7.660000E+00 -166 1 4.360000E+00 6.290000E+00 2.123000E+01 -167 1 3.325000E+01 3.367000E+01 1.095000E+01 -168 1 3.761000E+01 3.190000E+00 1.278000E+01 -169 1 3.670000E+00 2.074000E+01 1.536000E+01 -170 1 1.508000E+01 1.371000E+01 3.257000E+01 -171 1 3.460000E+00 2.393000E+01 2.349000E+01 -172 1 1.095000E+01 1.959000E+01 1.153000E+01 -173 1 2.578000E+01 2.144000E+01 3.342000E+01 -174 1 1.847000E+01 6.670000E+00 6.450000E+00 -175 1 3.564000E+01 3.459000E+01 1.988000E+01 -176 1 1.759000E+01 1.536000E+01 2.579000E+01 -177 1 1.543000E+01 4.010000E+00 1.133000E+01 -178 1 5.270000E+00 8.170000E+00 2.305000E+01 -179 1 7.670000E+00 2.964000E+01 3.700000E-01 -180 1 8.700000E-01 2.032000E+01 3.475000E+01 -181 1 6.880000E+00 3.688000E+01 5.760000E+00 -182 1 2.034000E+01 2.438000E+01 7.170000E+00 -183 1 2.680000E+01 2.198000E+01 1.000000E-02 -184 1 1.444000E+01 2.689000E+01 1.594000E+01 -185 1 3.904000E+01 2.121000E+01 9.920000E+00 -186 1 9.170000E+00 3.546000E+01 4.400000E-01 -187 1 1.350000E+01 1.685000E+01 5.530000E+00 -188 1 7.110000E+00 2.915000E+01 1.820000E+01 -189 1 3.826000E+01 1.259000E+01 2.531000E+01 -190 1 1.024000E+01 1.480000E+00 1.877000E+01 -191 1 3.318000E+01 2.380000E+00 1.160000E+00 -192 1 1.620000E+01 2.425000E+01 2.638000E+01 -193 1 3.329000E+01 1.363000E+01 1.299000E+01 -194 1 2.751000E+01 2.008000E+01 1.454000E+01 -195 1 6.290000E+00 2.970000E+01 6.260000E+00 -196 1 2.577000E+01 1.073000E+01 1.675000E+01 -197 1 1.178000E+01 2.553000E+01 2.947000E+01 -198 1 1.227000E+01 2.341000E+01 1.374000E+01 -199 1 3.420000E+00 3.994000E+01 3.429000E+01 -200 1 7.020000E+00 3.270000E+00 1.405000E+01 -201 1 3.130000E+01 8.500000E-01 3.230000E+01 -202 1 3.793000E+01 6.070000E+00 2.987000E+01 -203 1 5.770000E+00 2.558000E+01 2.327000E+01 -204 1 3.144000E+01 3.996000E+01 2.539000E+01 -205 1 2.692000E+01 2.118000E+01 2.730000E+00 -206 1 1.698000E+01 1.947000E+01 3.821000E+01 -207 1 2.264000E+01 3.201000E+01 3.543000E+01 -208 1 3.579000E+01 8.900000E-01 2.210000E+00 -209 1 2.386000E+01 9.300000E-01 7.290000E+00 -210 1 1.831000E+01 2.571000E+01 8.400000E-01 -211 1 1.325000E+01 1.549000E+01 1.296000E+01 -212 1 2.693000E+01 3.916000E+01 3.400000E-01 -213 1 2.757000E+01 1.330000E+01 1.579000E+01 -214 1 3.146000E+01 2.151000E+01 2.460000E+01 -215 1 5.010000E+00 2.472000E+01 1.316000E+01 -216 1 3.586000E+01 7.470000E+00 1.382000E+01 -217 1 2.176000E+01 1.877000E+01 1.732000E+01 -218 1 7.300000E+00 1.480000E+01 7.050000E+00 -219 1 8.680000E+00 2.746000E+01 7.610000E+00 -220 1 3.326000E+01 3.281000E+01 1.580000E+01 -221 1 2.980000E+00 1.509000E+01 2.820000E+01 -222 1 3.621000E+01 1.533000E+01 1.612000E+01 -223 1 8.640000E+00 9.260000E+00 1.227000E+01 -224 1 2.920000E+01 1.315000E+01 2.229000E+01 -225 1 1.842000E+01 3.040000E+00 2.652000E+01 -226 1 6.990000E+00 1.572000E+01 3.156000E+01 -227 1 9.330000E+00 4.450000E+00 3.682000E+01 -228 1 3.521000E+01 1.321000E+01 9.970000E+00 -229 1 1.032000E+01 1.774000E+01 3.277000E+01 -230 1 3.870000E+01 2.491000E+01 3.721000E+01 -231 1 2.480000E+00 3.320000E+01 3.706000E+01 -232 1 3.795000E+01 5.200000E+00 2.095000E+01 -233 1 1.240000E+00 1.685000E+01 1.170000E+01 -234 1 2.528000E+01 3.293000E+01 3.957000E+01 -235 1 3.658000E+01 3.679000E+01 1.689000E+01 -236 1 1.325000E+01 2.419000E+01 4.700000E+00 -237 1 1.819000E+01 4.320000E+00 0.000000E+00 -238 1 3.282000E+01 7.330000E+00 3.172000E+01 -239 1 5.030000E+00 3.222000E+01 1.552000E+01 -240 1 6.640000E+00 3.435000E+01 1.538000E+01 -241 1 7.250000E+00 8.860000E+00 3.137000E+01 -242 1 2.514000E+01 5.190000E+00 5.740000E+00 -243 1 1.975000E+01 2.949000E+01 2.054000E+01 -244 1 2.737000E+01 2.537000E+01 9.950000E+00 -245 1 1.586000E+01 1.974000E+01 9.550000E+00 -246 1 3.506000E+01 2.875000E+01 3.141000E+01 -247 1 2.802000E+01 2.129000E+01 1.900000E+01 -248 1 3.022000E+01 2.140000E+01 3.370000E+01 -249 1 7.530000E+00 1.148000E+01 1.661000E+01 -250 1 2.137000E+01 2.405000E+01 1.341000E+01 -251 1 8.940000E+00 1.907000E+01 2.363000E+01 -252 1 2.814000E+01 3.540000E+01 1.704000E+01 -253 1 2.201000E+01 1.323000E+01 5.790000E+00 -254 1 3.282000E+01 1.123000E+01 2.798000E+01 -255 1 3.007000E+01 3.075000E+01 3.564000E+01 -256 1 2.144000E+01 2.451000E+01 3.577000E+01 -257 1 2.238000E+01 2.254000E+01 6.560000E+00 -258 1 2.965000E+01 3.416000E+01 2.582000E+01 -259 1 3.839000E+01 3.504000E+01 3.685000E+01 -260 1 3.415000E+01 1.119000E+01 3.936000E+01 -261 1 3.310000E+01 1.422000E+01 2.646000E+01 -262 1 1.370000E+01 3.952000E+01 1.585000E+01 -263 1 1.279000E+01 2.395000E+01 2.746000E+01 -264 1 1.760000E+00 3.403000E+01 1.054000E+01 -265 1 1.049000E+01 7.180000E+00 2.963000E+01 -266 1 1.886000E+01 4.200000E+00 1.764000E+01 -267 1 7.570000E+00 1.001000E+01 8.850000E+00 -268 1 2.180000E+01 2.746000E+01 3.128000E+01 -269 1 3.308000E+01 2.905000E+01 1.539000E+01 -270 1 3.186000E+01 2.445000E+01 6.800000E+00 -271 1 3.047000E+01 2.204000E+01 6.050000E+00 -272 1 1.734000E+01 2.366000E+01 3.421000E+01 -273 1 1.277000E+01 2.862000E+01 2.138000E+01 -274 1 9.830000E+00 2.602000E+01 1.516000E+01 -275 1 3.661000E+01 1.411000E+01 2.375000E+01 -276 1 1.343000E+01 1.414000E+01 2.735000E+01 -277 1 1.653000E+01 2.172000E+01 2.870000E+00 -278 1 2.107000E+01 2.185000E+01 3.690000E+01 -279 1 3.664000E+01 3.410000E+01 2.809000E+01 -280 1 3.016000E+01 2.572000E+01 2.045000E+01 -281 1 1.800000E+00 1.859000E+01 6.690000E+00 -282 1 9.300000E-01 2.920000E+00 3.291000E+01 -283 1 1.215000E+01 2.864000E+01 5.550000E+00 -284 1 1.697000E+01 3.419000E+01 1.006000E+01 -285 1 1.210000E+00 4.930000E+00 4.830000E+00 -286 1 1.177000E+01 4.940000E+00 1.829000E+01 -287 1 2.625000E+01 7.380000E+00 2.798000E+01 -288 1 9.000000E-01 9.530000E+00 2.272000E+01 -289 1 1.592000E+01 1.530000E+01 1.692000E+01 -290 1 2.390000E+00 1.613000E+01 6.940000E+00 -291 1 3.898000E+01 7.710000E+00 8.020000E+00 -292 1 3.644000E+01 2.475000E+01 3.385000E+01 -293 1 2.802000E+01 3.480000E+00 4.028000E+01 -294 1 3.279000E+01 2.458000E+01 2.784000E+01 -295 1 1.913000E+01 3.837000E+01 2.331000E+01 -296 1 2.613000E+01 3.081000E+01 2.674000E+01 -297 1 2.532000E+01 3.771000E+01 1.013000E+01 -298 1 1.711000E+01 2.262000E+01 1.300000E+01 -299 1 2.871000E+01 1.246000E+01 1.832000E+01 -300 1 1.272000E+01 4.620000E+00 1.570000E+01 -301 1 2.197000E+01 2.425000E+01 2.139000E+01 -302 1 8.500000E+00 3.999000E+01 2.546000E+01 -303 1 4.070000E+00 3.246000E+01 4.270000E+00 -304 1 4.013000E+01 2.952000E+01 1.460000E+01 -305 1 5.930000E+00 3.346000E+01 2.326000E+01 -306 1 1.439000E+01 9.140000E+00 2.484000E+01 -307 1 9.330000E+00 6.640000E+00 2.131000E+01 -308 1 1.420000E+00 3.616000E+01 1.303000E+01 -309 1 2.305000E+01 2.713000E+01 1.359000E+01 -310 1 1.925000E+01 2.965000E+01 3.961000E+01 -311 1 2.497000E+01 6.660000E+00 1.485000E+01 -312 1 2.556000E+01 2.865000E+01 2.880000E+01 -313 1 7.550000E+00 2.085000E+01 3.045000E+01 -314 1 1.802000E+01 2.925000E+01 3.721000E+01 -315 1 1.246000E+01 3.098000E+01 2.556000E+01 -316 1 2.276000E+01 1.251000E+01 2.868000E+01 -317 1 3.486000E+01 2.344000E+01 3.855000E+01 -318 1 6.280000E+00 3.151000E+01 3.906000E+01 -319 1 3.735000E+01 2.264000E+01 3.812000E+01 -320 1 1.332000E+01 8.980000E+00 7.770000E+00 -321 1 7.600000E+00 3.136000E+01 7.920000E+00 -322 1 3.200000E+00 2.920000E+00 5.280000E+00 -323 1 8.170000E+00 3.254000E+01 2.026000E+01 -324 1 3.333000E+01 1.170000E+00 1.636000E+01 -325 1 6.700000E+00 2.234000E+01 2.669000E+01 -326 1 6.900000E+00 1.025000E+01 1.160000E+00 -327 1 2.358000E+01 5.690000E+00 2.170000E+01 -328 1 6.430000E+00 2.517000E+01 1.905000E+01 -329 1 2.326000E+01 8.260000E+00 2.295000E+01 -330 1 2.460000E+01 5.410000E+00 4.700000E-01 -331 1 1.027000E+01 3.768000E+01 9.570000E+00 -332 1 9.450000E+00 1.871000E+01 3.017000E+01 -333 1 2.388000E+01 3.240000E+01 3.140000E+00 -334 1 1.889000E+01 2.567000E+01 1.466000E+01 -335 1 2.108000E+01 3.427000E+01 3.588000E+01 -336 1 3.488000E+01 3.803000E+01 2.242000E+01 -337 1 3.365000E+01 1.929000E+01 1.290000E+01 -338 1 1.810000E+01 3.344000E+01 1.303000E+01 -339 1 2.758000E+01 1.885000E+01 3.407000E+01 -340 1 3.829000E+01 2.758000E+01 7.120000E+00 -341 1 2.168000E+01 3.619000E+01 2.075000E+01 -342 1 5.040000E+00 2.573000E+01 5.050000E+00 -343 1 1.410000E+00 3.445000E+01 2.788000E+01 -344 1 2.773000E+01 1.125000E+01 3.333000E+01 -345 1 2.771000E+01 2.476000E+01 3.514000E+01 -346 1 2.428000E+01 1.029000E+01 2.774000E+01 -347 1 3.090000E+00 2.826000E+01 2.660000E+01 -348 1 3.362000E+01 1.246000E+01 1.582000E+01 -349 1 3.486000E+01 7.960000E+00 2.133000E+01 -350 1 8.200000E-01 3.203000E+01 2.350000E+01 -351 1 3.545000E+01 3.597000E+01 2.943000E+01 -352 1 8.600000E-01 1.621000E+01 1.422000E+01 -353 1 3.739000E+01 3.666000E+01 1.962000E+01 -354 1 2.228000E+01 2.954000E+01 3.150000E+00 -355 1 2.835000E+01 5.820000E+00 7.670000E+00 -356 1 9.200000E-01 2.790000E+00 3.912000E+01 -357 1 3.029000E+01 1.368000E+01 1.318000E+01 -358 1 9.330000E+00 2.945000E+01 3.619000E+01 -359 1 2.842000E+01 4.110000E+00 2.477000E+01 -360 1 3.226000E+01 3.613000E+01 3.814000E+01 -361 1 1.100000E+01 1.278000E+01 1.770000E+00 -362 1 4.630000E+00 2.791000E+01 1.784000E+01 -363 1 1.707000E+01 6.750000E+00 2.289000E+01 -364 1 1.461000E+01 2.572000E+01 2.945000E+01 -365 1 3.159000E+01 2.440000E+01 3.511000E+01 -366 1 3.020000E+01 1.310000E+00 1.446000E+01 -367 1 3.759000E+01 2.400000E+00 6.600000E+00 -368 1 2.129000E+01 3.053000E+01 3.711000E+01 -369 1 3.927000E+01 3.698000E+01 3.886000E+01 -370 1 2.680000E+01 1.916000E+01 2.140000E+01 -371 1 1.641000E+01 3.931000E+01 2.595000E+01 -372 1 9.690000E+00 2.920000E+01 1.350000E+01 -373 1 2.753000E+01 3.731000E+01 1.496000E+01 -374 1 3.919000E+01 3.481000E+01 2.686000E+01 -375 1 4.580000E+00 3.495000E+01 3.575000E+01 -376 1 1.669000E+01 3.878000E+01 1.774000E+01 -377 1 3.577000E+01 2.542000E+01 8.300000E-01 -378 1 2.120000E+00 7.530000E+00 1.505000E+01 -379 1 2.696000E+01 1.639000E+01 2.185000E+01 -380 1 1.869000E+01 2.578000E+01 3.481000E+01 -381 1 3.108000E+01 2.050000E+00 1.130000E+01 -382 1 2.538000E+01 2.567000E+01 1.472000E+01 -383 1 1.538000E+01 3.608000E+01 4.100000E+00 -384 1 1.799000E+01 1.564000E+01 7.600000E+00 -385 1 1.348000E+01 2.671000E+01 3.384000E+01 -386 1 2.680000E+01 1.150000E+01 2.732000E+01 -387 1 1.540000E+00 1.068000E+01 6.000000E+00 -388 1 4.023000E+01 1.474000E+01 5.400000E+00 -389 1 3.603000E+01 1.044000E+01 1.040000E+00 -390 1 4.027000E+01 2.082000E+01 1.968000E+01 -391 1 8.140000E+00 7.470000E+00 1.017000E+01 -392 1 2.301000E+01 2.329000E+01 2.513000E+01 -393 1 2.445000E+01 3.558000E+01 3.913000E+01 -394 1 1.612000E+01 7.370000E+00 3.142000E+01 -395 1 5.760000E+00 3.391000E+01 1.460000E+00 -396 1 3.129000E+01 8.290000E+00 2.114000E+01 -397 1 2.631000E+01 3.050000E+00 2.120000E+00 -398 1 9.910000E+00 1.148000E+01 4.270000E+00 -399 1 3.146000E+01 1.048000E+01 9.000000E-02 -400 1 3.029000E+01 2.582000E+01 3.696000E+01 -401 1 9.700000E-01 3.600000E-01 6.090000E+00 -402 1 3.565000E+01 1.051000E+01 3.233000E+01 -403 1 1.931000E+01 3.769000E+01 1.438000E+01 -404 1 3.355000E+01 3.627000E+01 1.898000E+01 -405 1 1.822000E+01 3.092000E+01 1.960000E+00 -406 1 2.619000E+01 2.340000E+01 4.470000E+00 -407 1 3.452000E+01 1.894000E+01 1.873000E+01 -408 1 1.800000E+01 1.734000E+01 2.255000E+01 -409 1 2.946000E+01 3.888000E+01 3.664000E+01 -410 1 2.969000E+01 3.251000E+01 2.916000E+01 -411 1 3.049000E+01 3.154000E+01 1.894000E+01 -412 1 9.580000E+00 2.081000E+01 1.784000E+01 -413 1 6.710000E+00 3.164000E+01 1.056000E+01 -414 1 2.241000E+01 2.598000E+01 2.520000E+01 -415 1 9.400000E-01 3.714000E+01 7.120000E+00 -416 1 1.092000E+01 3.565000E+01 1.807000E+01 -417 1 3.221000E+01 3.286000E+01 2.858000E+01 -418 1 1.093000E+01 2.681000E+01 2.706000E+01 -419 1 3.190000E+00 3.247000E+01 3.307000E+01 -420 1 3.676000E+01 3.171000E+01 1.952000E+01 -421 1 2.035000E+01 1.811000E+01 2.446000E+01 -422 1 2.091000E+01 6.640000E+00 2.509000E+01 -423 1 1.010000E+01 1.037000E+01 1.606000E+01 -424 1 2.802000E+01 5.650000E+00 3.563000E+01 -425 1 3.514000E+01 3.759000E+01 3.460000E+01 -426 1 1.331000E+01 6.790000E+00 2.066000E+01 -427 1 3.670000E+01 3.280000E+00 1.023000E+01 -428 1 2.502000E+01 1.631000E+01 4.016000E+01 -429 1 3.680000E+01 3.883000E+01 3.693000E+01 -430 1 2.102000E+01 2.652000E+01 2.284000E+01 -431 1 3.128000E+01 1.447000E+01 3.730000E+01 -432 1 3.794000E+01 2.310000E+01 8.370000E+00 -433 1 5.030000E+00 3.022000E+01 2.741000E+01 -434 1 2.962000E+01 1.390000E+00 2.630000E+00 -435 1 7.470000E+00 1.300000E-01 8.060000E+00 -436 1 3.823000E+01 5.110000E+00 4.540000E+00 -437 1 3.993000E+01 2.487000E+01 2.555000E+01 -438 1 3.419000E+01 2.951000E+01 2.442000E+01 -439 1 2.047000E+01 2.120000E+00 1.372000E+01 -440 1 3.523000E+01 2.256000E+01 8.270000E+00 -441 1 2.551000E+01 3.081000E+01 9.110000E+00 -442 1 1.465000E+01 2.800000E+00 2.347000E+01 -443 1 2.903000E+01 1.144000E+01 1.204000E+01 -444 1 2.534000E+01 9.610000E+00 6.210000E+00 -445 1 3.062000E+01 7.070000E+00 2.967000E+01 -446 1 2.014000E+01 2.659000E+01 1.931000E+01 -447 1 2.399000E+01 1.880000E+01 3.480000E+01 -448 1 5.950000E+00 4.015000E+01 2.619000E+01 -449 1 1.404000E+01 3.854000E+01 3.780000E+00 -450 1 2.456000E+01 3.041000E+01 1.332000E+01 -451 1 2.196000E+01 1.540000E+01 3.747000E+01 -452 1 1.775000E+01 2.995000E+01 1.391000E+01 -453 1 3.000000E+01 2.423000E+01 1.001000E+01 -454 1 2.089000E+01 1.681000E+01 1.216000E+01 -455 1 1.788000E+01 2.556000E+01 7.570000E+00 -456 1 4.270000E+00 3.488000E+01 2.894000E+01 -457 1 2.754000E+01 3.101000E+01 2.264000E+01 -458 1 3.745000E+01 1.266000E+01 1.446000E+01 -459 1 1.948000E+01 8.000000E-02 3.541000E+01 -460 1 2.737000E+01 1.305000E+01 7.530000E+00 -461 1 3.302000E+01 2.540000E+01 2.041000E+01 -462 1 1.480000E+00 1.862000E+01 3.188000E+01 -463 1 7.900000E+00 1.395000E+01 1.408000E+01 -464 1 2.880000E+00 2.228000E+01 2.579000E+01 -465 1 3.848000E+01 3.161000E+01 2.994000E+01 -466 1 2.209000E+01 5.990000E+00 3.548000E+01 -467 1 2.863000E+01 3.632000E+01 3.624000E+01 -468 1 3.886000E+01 6.300000E+00 5.500000E-01 -469 1 3.331000E+01 1.047000E+01 4.380000E+00 -470 1 1.915000E+01 3.204000E+01 1.581000E+01 -471 1 8.850000E+00 2.500000E+01 2.963000E+01 -472 1 8.900000E+00 2.761000E+01 2.023000E+01 -473 1 1.218000E+01 1.500000E+01 2.970000E+00 -474 1 3.538000E+01 2.514000E+01 2.735000E+01 -475 1 3.498000E+01 3.620000E+00 1.695000E+01 -476 1 2.180000E+00 2.672000E+01 3.022000E+01 -477 1 2.349000E+01 3.983000E+01 1.417000E+01 -478 1 2.961000E+01 2.362000E+01 1.624000E+01 -479 1 1.777000E+01 4.920000E+00 3.195000E+01 -480 1 2.344000E+01 3.231000E+01 2.207000E+01 -481 1 3.998000E+01 9.400000E+00 3.494000E+01 -482 1 2.316000E+01 2.077000E+01 2.094000E+01 -483 1 3.072000E+01 3.947000E+01 1.320000E+00 -484 1 3.821000E+01 3.383000E+01 6.130000E+00 -485 1 2.503000E+01 2.028000E+01 5.030000E+00 -486 1 8.130000E+00 2.060000E+00 2.800000E-01 -487 1 2.430000E+01 2.911000E+01 4.990000E+00 -488 1 2.613000E+01 2.770000E+00 2.049000E+01 -489 1 3.885000E+01 2.315000E+01 1.970000E+01 -490 1 3.372000E+01 2.897000E+01 3.922000E+01 -491 1 1.540000E+01 3.012000E+01 2.314000E+01 -492 1 2.695000E+01 2.389000E+01 1.219000E+01 -493 1 3.379000E+01 3.924000E+01 2.480000E+00 -494 1 3.960000E+00 2.416000E+01 3.545000E+01 -495 1 1.618000E+01 2.350000E+01 3.071000E+01 -496 1 2.070000E+00 1.474000E+01 3.868000E+01 -497 1 3.018000E+01 2.268000E+01 1.230000E+01 -498 1 2.320000E+01 2.918000E+01 2.774000E+01 -499 1 1.001000E+01 3.753000E+01 2.846000E+01 -500 1 2.132000E+01 2.645000E+01 1.565000E+01 -501 1 2.124000E+01 4.000000E-01 1.562000E+01 -502 1 2.089000E+01 3.840000E+00 3.390000E+00 -503 1 9.170000E+00 2.348000E+01 1.682000E+01 -504 1 3.598000E+01 1.163000E+01 1.901000E+01 -505 1 6.180000E+00 2.294000E+01 3.150000E+01 -506 1 2.943000E+01 2.030000E+01 1.530000E+00 -507 1 3.094000E+01 1.106000E+01 1.918000E+01 -508 1 7.800000E-01 2.906000E+01 2.530000E+01 -509 1 2.225000E+01 3.673000E+01 1.809000E+01 -510 1 2.905000E+01 3.090000E+01 4.890000E+00 -511 1 2.936000E+01 2.555000E+01 1.342000E+01 -512 1 3.532000E+01 3.460000E+00 3.339000E+01 -513 1 1.160000E+00 1.028000E+01 3.751000E+01 -514 1 2.057000E+01 3.865000E+01 2.644000E+01 -515 1 3.607000E+01 2.724000E+01 2.521000E+01 -516 1 2.070000E+00 2.438000E+01 1.330000E+01 -517 1 3.426000E+01 1.288000E+01 3.510000E+00 -518 1 1.031000E+01 1.441000E+01 1.237000E+01 -519 1 9.380000E+00 3.884000E+01 1.909000E+01 -520 1 1.407000E+01 8.440000E+00 4.290000E+00 -521 1 1.541000E+01 2.054000E+01 1.640000E+01 -522 1 2.758000E+01 1.626000E+01 1.016000E+01 -523 1 2.593000E+01 1.352000E+01 3.500000E+01 -524 1 1.201000E+01 2.840000E+00 2.228000E+01 -525 1 2.295000E+01 1.030000E+00 2.891000E+01 -526 1 1.343000E+01 3.535000E+01 1.220000E+00 -527 1 1.510000E+00 1.070000E+01 3.078000E+01 -528 1 1.510000E+00 3.334000E+01 1.352000E+01 -529 1 1.523000E+01 2.434000E+01 1.679000E+01 -530 1 7.270000E+00 1.314000E+01 3.473000E+01 -531 1 7.970000E+00 3.660000E+00 2.739000E+01 -532 1 1.714000E+01 3.790000E+01 3.372000E+01 -533 1 1.506000E+01 3.911000E+01 2.845000E+01 -534 1 1.887000E+01 1.030000E+01 1.960000E+01 -535 1 1.438000E+01 2.701000E+01 1.312000E+01 -536 1 8.390000E+00 3.570000E+00 2.481000E+01 -537 1 3.839000E+01 2.238000E+01 2.579000E+01 -538 1 1.575000E+01 1.470000E+00 2.340000E+00 -539 1 3.519000E+01 5.500000E-01 2.541000E+01 -540 1 2.842000E+01 2.741000E+01 3.819000E+01 -541 1 5.460000E+00 1.297000E+01 6.280000E+00 -542 1 8.890000E+00 2.460000E+00 8.160000E+00 -543 1 2.594000E+01 3.498000E+01 2.231000E+01 -544 1 1.479000E+01 2.808000E+01 5.580000E+00 -545 1 6.030000E+00 1.235000E+01 2.913000E+01 -546 1 3.869000E+01 3.718000E+01 1.300000E+01 -547 1 1.380000E+00 3.164000E+01 3.510000E+00 -548 1 3.547000E+01 2.438000E+01 6.340000E+00 -549 1 3.259000E+01 5.000000E-01 2.295000E+01 -550 1 1.518000E+01 6.600000E-01 1.028000E+01 -551 1 3.941000E+01 9.710000E+00 6.370000E+00 -552 1 2.449000E+01 2.411000E+01 2.216000E+01 -553 1 2.358000E+01 3.512000E+01 2.349000E+01 -554 1 2.868000E+01 2.597000E+01 2.906000E+01 -555 1 1.977000E+01 3.606000E+01 3.134000E+01 -556 1 1.723000E+01 2.773000E+01 1.903000E+01 -557 1 9.900000E+00 7.220000E+00 4.900000E-01 -558 1 3.167000E+01 3.729000E+01 1.212000E+01 -559 1 1.327000E+01 1.870000E+01 3.987000E+01 -560 1 7.720000E+00 2.210000E+01 1.457000E+01 -561 1 3.201000E+01 3.360000E+01 4.220000E+00 -562 1 2.924000E+01 1.310000E+00 2.747000E+01 -563 1 3.574000E+01 3.101000E+01 1.548000E+01 -564 1 2.924000E+01 3.047000E+01 3.831000E+01 -565 1 1.850000E+00 8.130000E+00 3.932000E+01 -566 1 1.161000E+01 2.185000E+01 8.210000E+00 -567 1 3.442000E+01 6.840000E+00 2.270000E+00 -568 1 3.389000E+01 1.524000E+01 3.643000E+01 -569 1 1.774000E+01 1.401000E+01 1.280000E+01 -570 1 1.943000E+01 2.805000E+01 8.920000E+00 -571 1 3.791000E+01 3.482000E+01 3.156000E+01 -572 1 9.810000E+00 6.760000E+00 1.259000E+01 -573 1 1.101000E+01 1.849000E+01 2.777000E+01 -574 1 3.854000E+01 2.472000E+01 2.208000E+01 -575 1 5.050000E+00 1.827000E+01 1.847000E+01 -576 1 3.709000E+01 3.437000E+01 2.310000E+00 -577 1 1.735000E+01 3.308000E+01 9.600000E-01 -578 1 2.036000E+01 1.672000E+01 8.720000E+00 -579 1 2.025000E+01 1.720000E+00 3.060000E+01 -580 1 2.330000E+01 3.287000E+01 1.820000E+01 -581 1 2.037000E+01 1.620000E+01 2.636000E+01 -582 1 2.366000E+01 3.854000E+01 3.295000E+01 -583 1 1.795000E+01 3.777000E+01 2.290000E+00 -584 1 3.894000E+01 1.893000E+01 3.680000E+01 -585 1 1.733000E+01 1.950000E+00 1.934000E+01 -586 1 2.097000E+01 2.876000E+01 1.299000E+01 -587 1 1.085000E+01 1.202000E+01 2.193000E+01 -588 1 1.420000E+01 1.297000E+01 7.240000E+00 -589 1 3.595000E+01 3.720000E+01 2.476000E+01 -590 1 2.613000E+01 3.840000E+00 3.338000E+01 -591 1 2.638000E+01 1.730000E+01 1.315000E+01 -592 1 3.991000E+01 3.899000E+01 3.256000E+01 -593 1 3.695000E+01 3.579000E+01 4.020000E+01 -594 1 1.289000E+01 3.423000E+01 2.926000E+01 -595 1 2.269000E+01 2.160000E+01 3.927000E+01 -596 1 9.350000E+00 1.344000E+01 3.833000E+01 -597 1 1.540000E+01 5.170000E+00 2.454000E+01 -598 1 2.038000E+01 2.065000E+01 2.232000E+01 -599 1 1.578000E+01 3.991000E+01 2.335000E+01 -600 1 5.790000E+00 1.380000E+00 3.840000E+00 -601 1 3.080000E+00 8.560000E+00 3.132000E+01 -602 1 1.149000E+01 3.351000E+01 3.040000E+00 -603 1 2.710000E+00 6.500000E-01 2.371000E+01 -604 1 1.380000E+00 1.240000E+00 2.604000E+01 -605 1 2.461000E+01 1.463000E+01 2.216000E+01 -606 1 3.489000E+01 3.560000E+01 1.214000E+01 -607 1 2.110000E+01 1.130000E+01 3.203000E+01 -608 1 2.710000E+00 2.171000E+01 1.921000E+01 -609 1 2.371000E+01 2.064000E+01 1.711000E+01 -610 1 2.608000E+01 3.770000E+01 2.926000E+01 -611 1 9.100000E-01 3.790000E+00 2.455000E+01 -612 1 1.232000E+01 3.946000E+01 2.822000E+01 -613 1 7.920000E+00 3.155000E+01 3.494000E+01 -614 1 8.640000E+00 1.228000E+01 3.600000E-01 -615 1 1.209000E+01 1.765000E+01 1.449000E+01 -616 1 9.430000E+00 3.682000E+01 2.133000E+01 -617 1 3.655000E+01 3.211000E+01 1.296000E+01 -618 1 8.400000E+00 3.299000E+01 2.640000E+00 -619 1 3.150000E+01 1.270000E+00 2.872000E+01 -620 1 2.434000E+01 2.294000E+01 9.930000E+00 -621 1 7.010000E+00 3.645000E+01 2.206000E+01 -622 1 2.411000E+01 7.500000E+00 7.340000E+00 -623 1 3.769000E+01 2.512000E+01 1.061000E+01 -624 1 2.642000E+01 2.827000E+01 1.392000E+01 -625 1 1.534000E+01 2.490000E+00 3.676000E+01 -626 1 3.848000E+01 1.350000E+00 9.000000E+00 -627 1 2.170000E+01 3.500000E+01 9.420000E+00 -628 1 3.720000E+00 3.177000E+01 2.306000E+01 -629 1 1.584000E+01 9.150000E+00 2.081000E+01 -630 1 3.619000E+01 2.571000E+01 3.644000E+01 -631 1 5.290000E+00 4.017000E+01 3.818000E+01 -632 1 2.045000E+01 3.980000E+00 3.903000E+01 -633 1 2.976000E+01 1.756000E+01 6.560000E+00 -634 1 2.771000E+01 2.528000E+01 1.758000E+01 -635 1 2.285000E+01 2.420000E+00 3.632000E+01 -636 1 3.797000E+01 1.128000E+01 8.220000E+00 -637 1 1.619000E+01 3.179000E+01 2.109000E+01 -638 1 1.248000E+01 2.994000E+01 1.643000E+01 -639 1 3.304000E+01 1.518000E+01 4.690000E+00 -640 1 1.678000E+01 2.830000E+01 1.621000E+01 -641 1 1.230000E+01 3.206000E+01 1.360000E+01 -642 1 3.749000E+01 1.930000E+01 8.980000E+00 -643 1 3.385000E+01 2.638000E+01 1.406000E+01 -644 1 1.365000E+01 3.490000E+00 3.058000E+01 -645 1 6.730000E+00 2.010000E+01 1.255000E+01 -646 1 3.550000E+01 3.928000E+01 1.700000E+01 -647 1 3.594000E+01 6.490000E+00 4.005000E+01 -648 1 3.877000E+01 3.043000E+01 1.877000E+01 -649 1 9.340000E+00 2.314000E+01 3.499000E+01 -650 1 3.007000E+01 2.930000E+01 1.071000E+01 -651 1 3.420000E+01 1.243000E+01 3.417000E+01 -652 1 6.270000E+00 3.567000E+01 3.941000E+01 -653 1 3.647000E+01 2.536000E+01 2.990000E+01 -654 1 3.468000E+01 8.800000E-01 3.509000E+01 -655 1 3.280000E+01 2.184000E+01 1.227000E+01 -656 1 1.615000E+01 1.291000E+01 1.584000E+01 -657 1 3.990000E+01 3.177000E+01 1.626000E+01 -658 1 5.200000E+00 2.090000E+01 3.293000E+01 -659 1 3.609000E+01 7.970000E+00 3.355000E+01 -660 1 2.126000E+01 1.560000E+00 1.093000E+01 -661 1 3.862000E+01 1.842000E+01 1.982000E+01 -662 1 1.861000E+01 1.123000E+01 2.674000E+01 -663 1 2.391000E+01 1.732000E+01 3.061000E+01 -664 1 6.350000E+00 1.859000E+01 2.796000E+01 -665 1 3.644000E+01 6.380000E+00 1.109000E+01 -666 1 1.520000E+00 2.203000E+01 1.682000E+01 -667 1 3.213000E+01 1.863000E+01 5.570000E+00 -668 1 3.212000E+01 2.800000E+01 8.050000E+00 -669 1 3.344000E+01 1.076000E+01 1.339000E+01 -670 1 1.797000E+01 3.840000E+00 3.663000E+01 -671 1 7.730000E+00 5.790000E+00 3.015000E+01 -672 1 2.891000E+01 2.616000E+01 2.630000E+01 -673 1 1.781000E+01 1.785000E+01 4.280000E+00 -674 1 2.327000E+01 2.643000E+01 3.553000E+01 -675 1 8.190000E+00 3.984000E+01 3.549000E+01 -676 1 3.472000E+01 2.874000E+01 2.162000E+01 -677 1 2.685000E+01 2.769000E+01 8.010000E+00 -678 1 1.593000E+01 1.886000E+01 3.164000E+01 -679 1 1.452000E+01 6.930000E+00 1.527000E+01 -680 1 1.704000E+01 2.665000E+01 2.424000E+01 -681 1 3.051000E+01 2.600000E-01 2.126000E+01 -682 1 3.610000E+00 1.666000E+01 4.260000E+00 -683 1 1.560000E+00 2.023000E+01 2.785000E+01 -684 1 7.960000E+00 6.270000E+00 1.879000E+01 -685 1 1.494000E+01 2.269000E+01 2.395000E+01 -686 1 3.239000E+01 3.789000E+01 1.615000E+01 -687 1 2.933000E+01 3.430000E+01 1.219000E+01 -688 1 3.053000E+01 3.060000E+01 1.596000E+01 -689 1 3.924000E+01 4.960000E+00 1.373000E+01 -690 1 3.640000E+00 7.120000E+00 3.330000E+00 -691 1 1.567000E+01 3.612000E+01 4.030000E+01 -692 1 1.589000E+01 1.675000E+01 1.275000E+01 -693 1 2.139000E+01 2.311000E+01 1.618000E+01 -694 1 2.488000E+01 2.183000E+01 1.498000E+01 -695 1 3.215000E+01 3.492000E+01 2.542000E+01 -696 1 2.819000E+01 1.378000E+01 3.237000E+01 -697 1 3.815000E+01 1.373000E+01 3.633000E+01 -698 1 4.340000E+00 3.811000E+01 5.780000E+00 -699 1 4.390000E+00 3.276000E+01 3.068000E+01 -700 1 2.930000E+01 4.008000E+01 1.894000E+01 -701 1 1.313000E+01 1.999000E+01 9.970000E+00 -702 1 3.142000E+01 3.774000E+01 2.725000E+01 -703 1 2.779000E+01 3.169000E+01 8.130000E+00 -704 1 5.340000E+00 3.398000E+01 9.790000E+00 -705 1 2.602000E+01 6.270000E+00 9.090000E+00 -706 1 2.247000E+01 2.886000E+01 1.950000E+01 -707 1 4.650000E+00 3.260000E+00 8.180000E+00 -708 1 3.039000E+01 3.515000E+01 2.966000E+01 -709 1 2.434000E+01 7.210000E+00 3.155000E+01 -710 1 1.250000E+00 5.230000E+00 3.544000E+01 -711 1 1.390000E+01 2.491000E+01 2.517000E+01 -712 1 3.581000E+01 1.145000E+01 2.867000E+01 -713 1 5.800000E-01 1.696000E+01 3.703000E+01 -714 1 2.303000E+01 3.198000E+01 1.486000E+01 -715 1 2.135000E+01 1.115000E+01 1.687000E+01 -716 1 3.806000E+01 3.995000E+01 1.678000E+01 -717 1 4.140000E+00 3.313000E+01 1.790000E+01 -718 1 3.480000E+01 3.762000E+01 6.200000E-01 -719 1 3.188000E+01 1.792000E+01 2.097000E+01 -720 1 2.350000E+00 1.273000E+01 2.318000E+01 -721 1 2.728000E+01 1.889000E+01 9.160000E+00 -722 1 3.408000E+01 3.084000E+01 3.294000E+01 -723 1 3.240000E+00 1.244000E+01 2.943000E+01 -724 1 2.051000E+01 1.324000E+01 1.061000E+01 -725 1 3.179000E+01 2.032000E+01 3.777000E+01 -726 1 1.300000E+00 3.036000E+01 3.260000E+01 -727 1 5.810000E+00 3.539000E+01 2.529000E+01 -728 1 1.356000E+01 4.050000E+00 7.980000E+00 -729 1 1.280000E+00 1.406000E+01 3.084000E+01 -730 1 3.751000E+01 9.910000E+00 1.419000E+01 -731 1 3.560000E+00 2.043000E+01 3.572000E+01 -732 1 2.807000E+01 1.272000E+01 2.957000E+01 -733 1 1.030000E+01 3.771000E+01 3.320000E+00 -734 1 2.519000E+01 3.108000E+01 3.485000E+01 -735 1 4.210000E+00 1.015000E+01 1.481000E+01 -736 1 3.297000E+01 3.553000E+01 3.800000E-01 -737 1 1.391000E+01 4.250000E+00 2.798000E+01 -738 1 3.163000E+01 3.147000E+01 2.522000E+01 -739 1 6.800000E-01 9.000000E+00 9.580000E+00 -740 1 3.693000E+01 1.269000E+01 2.138000E+01 -741 1 3.779000E+01 1.676000E+01 2.900000E+00 -742 1 3.409000E+01 3.193000E+01 3.230000E+00 -743 1 2.104000E+01 1.530000E+00 3.802000E+01 -744 1 3.698000E+01 8.310000E+00 2.317000E+01 -745 1 1.636000E+01 3.968000E+01 2.039000E+01 -746 1 1.718000E+01 2.280000E+01 1.567000E+01 -747 1 2.872000E+01 3.545000E+01 2.363000E+01 -748 1 1.478000E+01 2.706000E+01 1.992000E+01 -749 1 2.920000E+00 2.723000E+01 4.320000E+00 -750 1 9.980000E+00 3.424000E+01 2.143000E+01 -751 1 3.957000E+01 3.017000E+01 3.709000E+01 -752 1 4.000000E+00 3.655000E+01 7.970000E+00 -753 1 3.551000E+01 4.002000E+01 2.020000E+01 -754 1 3.830000E+00 3.087000E+01 6.520000E+00 -755 1 2.354000E+01 2.238000E+01 4.140000E+00 -756 1 1.044000E+01 3.541000E+01 5.160000E+00 -757 1 2.194000E+01 3.613000E+01 3.780000E+01 -758 1 2.092000E+01 2.245000E+01 1.115000E+01 -759 1 3.496000E+01 1.040000E+00 1.250000E+01 -760 1 3.112000E+01 2.356000E+01 2.265000E+01 -761 1 4.018000E+01 2.631000E+01 1.422000E+01 -762 1 3.725000E+01 2.257000E+01 4.990000E+00 -763 1 4.260000E+00 7.250000E+00 5.800000E-01 -764 1 1.535000E+01 2.568000E+01 4.500000E+00 -765 1 2.280000E+00 7.200000E+00 2.548000E+01 -766 1 1.892000E+01 2.767000E+01 3.048000E+01 -767 1 3.965000E+01 2.569000E+01 8.820000E+00 -768 1 3.997000E+01 2.795000E+01 1.922000E+01 -769 1 3.916000E+01 2.240000E+01 1.647000E+01 -770 1 2.000000E-02 1.028000E+01 2.766000E+01 -771 1 8.010000E+00 6.310000E+00 2.720000E+00 -772 1 1.906000E+01 3.198000E+01 2.144000E+01 -773 1 2.095000E+01 2.715000E+01 3.392000E+01 -774 1 3.462000E+01 2.642000E+01 3.263000E+01 -775 1 1.301000E+01 2.714000E+01 1.069000E+01 -776 1 1.523000E+01 2.320000E+00 6.840000E+00 -777 1 5.620000E+00 1.000000E-01 2.002000E+01 -778 1 5.430000E+00 8.100000E+00 8.940000E+00 -779 1 1.961000E+01 2.385000E+01 4.008000E+01 -780 1 1.642000E+01 1.774000E+01 3.617000E+01 -781 1 1.140000E+00 2.459000E+01 3.976000E+01 -782 1 6.360000E+00 7.020000E+00 3.485000E+01 -783 1 3.050000E+00 3.680000E+01 3.114000E+01 -784 1 3.819000E+01 3.930000E+01 1.971000E+01 -785 1 3.449000E+01 5.310000E+00 7.490000E+00 -786 1 2.447000E+01 2.977000E+01 2.104000E+01 -787 1 1.216000E+01 2.083000E+01 1.964000E+01 -788 1 3.000000E-02 1.740000E+01 3.406000E+01 -789 1 1.061000E+01 6.600000E-01 1.321000E+01 -790 1 6.150000E+00 1.853000E+01 3.426000E+01 -791 1 3.316000E+01 1.856000E+01 3.208000E+01 -792 1 9.170000E+00 1.165000E+01 1.375000E+01 -793 1 7.100000E+00 2.260000E+00 3.753000E+01 -794 1 3.203000E+01 8.540000E+00 2.772000E+01 -795 1 3.570000E+01 1.662000E+01 1.270000E+00 -796 1 1.294000E+01 1.035000E+01 2.984000E+01 -797 1 2.190000E+00 3.980000E+01 7.100000E-01 -798 1 3.700000E+01 1.581000E+01 3.798000E+01 -799 1 7.490000E+00 1.611000E+01 2.699000E+01 -800 1 1.770000E+01 3.511000E+01 2.850000E+00 -801 1 3.115000E+01 2.188000E+01 1.933000E+01 -802 1 1.725000E+01 7.210000E+00 2.589000E+01 -803 1 2.056000E+01 2.099000E+01 4.240000E+00 -804 1 9.800000E+00 8.470000E+00 4.960000E+00 -805 1 3.926000E+01 1.310000E+00 3.630000E+01 -806 1 1.438000E+01 1.603000E+01 3.682000E+01 -807 1 3.647000E+01 2.067000E+01 3.631000E+01 -808 1 6.610000E+00 2.971000E+01 3.295000E+01 -809 1 2.104000E+01 7.710000E+00 3.731000E+01 -810 1 1.582000E+01 3.212000E+01 1.447000E+01 -811 1 1.030000E+00 1.449000E+01 2.940000E+00 -812 1 9.300000E-01 5.000000E-01 3.422000E+01 -813 1 2.733000E+01 3.544000E+01 2.021000E+01 -814 1 1.997000E+01 8.780000E+00 3.361000E+01 -815 1 1.831000E+01 1.683000E+01 1.128000E+01 -816 1 4.900000E+00 9.750000E+00 2.688000E+01 -817 1 2.096000E+01 9.670000E+00 6.390000E+00 -818 1 8.240000E+00 2.498000E+01 3.239000E+01 -819 1 2.763000E+01 1.116000E+01 9.470000E+00 -820 1 3.852000E+01 3.052000E+01 1.193000E+01 -821 1 3.237000E+01 2.209000E+01 1.608000E+01 -822 1 3.000000E+01 2.932000E+01 2.511000E+01 -823 1 3.354000E+01 3.845000E+01 1.356000E+01 -824 1 1.186000E+01 2.160000E+00 3.527000E+01 -825 1 3.336000E+01 2.013000E+01 2.136000E+01 -826 1 3.470000E+01 1.719000E+01 3.890000E+00 -827 1 3.460000E+00 3.257000E+01 9.700000E-01 -828 1 1.512000E+01 3.043000E+01 1.635000E+01 -829 1 1.564000E+01 1.436000E+01 3.110000E+00 -830 1 1.960000E+00 3.510000E+00 2.854000E+01 -831 1 3.933000E+01 1.727000E+01 2.233000E+01 -832 1 6.770000E+00 2.061000E+01 1.888000E+01 -833 1 1.690000E+01 3.100000E+00 8.990000E+00 -834 1 7.920000E+00 1.209000E+01 2.119000E+01 -835 1 8.140000E+00 1.669000E+01 1.654000E+01 -836 1 1.356000E+01 3.261000E+01 1.777000E+01 -837 1 1.916000E+01 2.254000E+01 2.240000E+00 -838 1 8.200000E-01 1.630000E+00 9.600000E+00 -839 1 4.230000E+00 7.800000E-01 1.595000E+01 -840 1 3.256000E+01 3.110000E+01 1.334000E+01 -841 1 2.620000E+00 3.921000E+01 1.443000E+01 -842 1 2.916000E+01 2.898000E+01 2.530000E+00 -843 1 4.006000E+01 2.917000E+01 3.966000E+01 -844 1 9.600000E+00 3.287000E+01 1.425000E+01 -845 1 7.700000E+00 4.030000E+01 2.270000E+00 -846 1 2.284000E+01 1.328000E+01 3.290000E+01 -847 1 1.866000E+01 2.900000E-01 2.668000E+01 -848 1 5.620000E+00 1.563000E+01 2.383000E+01 -849 1 2.584000E+01 1.075000E+01 1.414000E+01 -850 1 3.147000E+01 3.050000E+00 5.580000E+00 -851 1 2.520000E+01 3.040000E+01 1.900000E-01 -852 1 2.617000E+01 2.138000E+01 2.898000E+01 -853 1 3.771000E+01 1.780000E+01 4.010000E+01 -854 1 1.203000E+01 3.870000E+01 1.346000E+01 -855 1 6.580000E+00 2.261000E+01 4.900000E-01 -856 1 2.727000E+01 3.260000E+00 1.314000E+01 -857 1 3.430000E+00 1.018000E+01 2.242000E+01 -858 1 1.162000E+01 2.183000E+01 2.590000E+00 -859 1 2.840000E+01 2.584000E+01 4.910000E+00 -860 1 2.730000E+00 1.896000E+01 1.988000E+01 -861 1 2.209000E+01 3.577000E+01 1.290000E+01 -862 1 2.057000E+01 6.120000E+00 1.587000E+01 -863 1 2.596000E+01 9.010000E+00 9.880000E+00 -864 1 1.852000E+01 1.698000E+01 1.500000E+01 -865 1 7.580000E+00 9.280000E+00 2.879000E+01 -866 1 2.592000E+01 1.074000E+01 1.900000E-01 -867 1 1.295000E+01 5.200000E+00 4.022000E+01 -868 1 2.274000E+01 1.780000E+01 2.731000E+01 -869 1 3.434000E+01 4.240000E+00 2.660000E+01 -870 1 1.378000E+01 3.530000E+01 2.066000E+01 -871 1 3.765000E+01 9.920000E+00 2.705000E+01 -872 1 3.754000E+01 2.837000E+01 3.605000E+01 -873 1 5.760000E+00 3.360000E+00 3.454000E+01 -874 1 3.029000E+01 2.226000E+01 2.898000E+01 -875 1 3.327000E+01 1.732000E+01 7.840000E+00 -876 1 3.632000E+01 1.310000E+01 6.250000E+00 -877 1 3.194000E+01 2.590000E+01 2.524000E+01 -878 1 1.028000E+01 1.960000E+00 4.490000E+00 -879 1 3.579000E+01 2.290000E+00 2.966000E+01 -880 1 3.942000E+01 3.196000E+01 6.600000E-01 -881 1 3.678000E+01 3.858000E+01 5.240000E+00 -882 1 1.144000E+01 3.168000E+01 3.634000E+01 -883 1 1.450000E+01 2.814000E+01 3.868000E+01 -884 1 3.402000E+01 1.046000E+01 2.060000E+01 -885 1 1.743000E+01 3.810000E+01 3.998000E+01 -886 1 3.809000E+01 3.529000E+01 2.441000E+01 -887 1 3.648000E+01 2.244000E+01 1.856000E+01 -888 1 3.363000E+01 1.148000E+01 2.301000E+01 -889 1 1.700000E+00 2.129000E+01 9.050000E+00 -890 1 7.440000E+00 2.906000E+01 2.745000E+01 -891 1 2.516000E+01 1.413000E+01 3.209000E+01 -892 1 1.770000E+00 1.710000E+00 2.115000E+01 -893 1 3.475000E+01 4.018000E+01 3.987000E+01 -894 1 3.282000E+01 3.888000E+01 3.845000E+01 -895 1 2.771000E+01 2.233000E+01 2.152000E+01 -896 1 1.500000E-01 3.264000E+01 6.430000E+00 -897 1 3.724000E+01 1.184000E+01 3.794000E+01 -898 1 1.817000E+01 3.143000E+01 2.934000E+01 -899 1 3.997000E+01 7.000000E+00 2.259000E+01 -900 1 1.854000E+01 1.541000E+01 1.812000E+01 -901 1 1.820000E+00 2.583000E+01 3.519000E+01 -902 1 3.299000E+01 2.158000E+01 2.852000E+01 -903 1 3.254000E+01 2.840000E+01 2.650000E+01 -904 1 2.985000E+01 1.900000E+01 1.933000E+01 -905 1 3.170000E+00 1.346000E+01 8.600000E+00 -906 1 1.997000E+01 3.786000E+01 8.920000E+00 -907 1 3.431000E+01 1.089000E+01 7.990000E+00 -908 1 2.038000E+01 7.980000E+00 3.979000E+01 -909 1 4.080000E+00 2.395000E+01 3.035000E+01 -910 1 3.444000E+01 9.670000E+00 3.008000E+01 -911 1 1.583000E+01 1.467000E+01 2.227000E+01 -912 1 1.431000E+01 1.500000E+01 3.947000E+01 -913 1 4.670000E+00 2.058000E+01 3.000000E-01 -914 1 9.300000E+00 2.344000E+01 5.290000E+00 -915 1 2.399000E+01 2.950000E+01 2.521000E+01 -916 1 2.265000E+01 5.580000E+00 3.851000E+01 -917 1 2.574000E+01 2.662000E+01 3.447000E+01 -918 1 2.933000E+01 2.029000E+01 2.288000E+01 -919 1 2.541000E+01 9.850000E+00 2.358000E+01 -920 1 5.910000E+00 3.300000E+00 5.750000E+00 -921 1 1.326000E+01 7.000000E-02 2.430000E+01 -922 1 3.950000E+00 2.194000E+01 2.171000E+01 -923 1 3.333000E+01 3.333000E+01 3.166000E+01 -924 1 1.750000E+00 1.349000E+01 1.146000E+01 -925 1 3.112000E+01 2.539000E+01 1.787000E+01 -926 1 1.868000E+01 1.020000E+00 1.011000E+01 -927 1 1.286000E+01 2.967000E+01 1.190000E+01 -928 1 7.900000E+00 3.319000E+01 5.760000E+00 -929 1 3.152000E+01 1.395000E+01 1.066000E+01 -930 1 1.509000E+01 3.071000E+01 1.065000E+01 -931 1 2.109000E+01 1.130000E+01 8.650000E+00 -932 1 3.999000E+01 2.953000E+01 2.270000E+01 -933 1 1.099000E+01 3.969000E+01 2.321000E+01 -934 1 1.117000E+01 3.025000E+01 3.283000E+01 -935 1 3.573000E+01 2.144000E+01 3.377000E+01 -936 1 3.968000E+01 2.056000E+01 3.883000E+01 -937 1 3.883000E+01 2.733000E+01 2.522000E+01 -938 1 3.058000E+01 3.023000E+01 3.197000E+01 -939 1 1.682000E+01 3.112000E+01 3.195000E+01 -940 1 5.210000E+00 1.511000E+01 2.270000E+00 -941 1 2.484000E+01 3.855000E+01 1.900000E+01 -942 1 1.251000E+01 8.200000E-01 6.010000E+00 -943 1 1.945000E+01 2.246000E+01 2.716000E+01 -944 1 3.236000E+01 2.477000E+01 4.090000E+00 -945 1 3.575000E+01 2.625000E+01 2.092000E+01 -946 1 3.212000E+01 3.182000E+01 8.550000E+00 -947 1 8.700000E+00 3.527000E+01 2.976000E+01 -948 1 3.505000E+01 1.031000E+01 3.573000E+01 -949 1 1.260000E+00 1.847000E+01 3.270000E+00 -950 1 2.692000E+01 3.179000E+01 3.059000E+01 -951 1 1.983000E+01 3.155000E+01 1.247000E+01 -952 1 2.251000E+01 2.447000E+01 3.282000E+01 -953 1 3.023000E+01 1.924000E+01 3.172000E+01 -954 1 1.474000E+01 3.618000E+01 2.940000E+01 -955 1 5.110000E+00 5.140000E+00 1.415000E+01 -956 1 1.730000E+01 2.116000E+01 1.800000E-01 -957 1 1.817000E+01 3.470000E+00 2.967000E+01 -958 1 1.196000E+01 3.108000E+01 2.941000E+01 -959 1 3.782000E+01 2.364000E+01 1.930000E+00 -960 1 1.775000E+01 1.363000E+01 2.943000E+01 -961 1 1.126000E+01 4.530000E+00 1.315000E+01 -962 1 1.827000E+01 3.255000E+01 2.395000E+01 -963 1 1.220000E+01 9.900000E-01 2.410000E+00 -964 1 2.614000E+01 3.974000E+01 1.483000E+01 -965 1 1.964000E+01 3.425000E+01 2.586000E+01 -966 1 2.316000E+01 5.030000E+00 2.602000E+01 -967 1 2.478000E+01 3.461000E+01 2.617000E+01 -968 1 3.113000E+01 1.817000E+01 2.240000E+00 -969 1 8.710000E+00 3.614000E+01 1.418000E+01 -970 1 1.900000E-01 3.677000E+01 3.071000E+01 -971 1 3.538000E+01 5.140000E+00 2.318000E+01 -972 1 9.790000E+00 2.135000E+01 2.544000E+01 -973 1 1.234000E+01 3.592000E+01 1.006000E+01 -974 1 2.808000E+01 2.346000E+01 6.350000E+00 -975 1 1.086000E+01 3.276000E+01 2.368000E+01 -976 1 3.010000E+01 1.223000E+01 2.699000E+01 -977 1 1.798000E+01 3.060000E+00 4.020000E+00 -978 1 9.390000E+00 1.377000E+01 5.800000E+00 -979 1 9.450000E+00 9.490000E+00 2.509000E+01 -980 1 1.634000E+01 2.181000E+01 2.177000E+01 -981 1 2.499000E+01 2.674000E+01 4.900000E-01 -982 1 7.580000E+00 1.520000E+01 3.701000E+01 -983 1 3.193000E+01 1.752000E+01 1.411000E+01 -984 1 3.935000E+01 5.860000E+00 1.126000E+01 -985 1 4.690000E+00 2.804000E+01 1.205000E+01 -986 1 1.666000E+01 4.480000E+00 5.880000E+00 -987 1 1.574000E+01 1.277000E+01 2.425000E+01 -988 1 3.410000E+00 5.510000E+00 9.080000E+00 -989 1 3.154000E+01 1.890000E+00 1.838000E+01 -990 1 9.200000E-01 1.946000E+01 1.111000E+01 -991 1 1.300000E-01 3.681000E+01 1.547000E+01 -992 1 2.851000E+01 3.912000E+01 2.277000E+01 -993 1 1.302000E+01 3.893000E+01 3.916000E+01 -994 1 2.523000E+01 2.550000E+01 2.880000E+00 -995 1 1.403000E+01 2.277000E+01 1.031000E+01 -996 1 9.250000E+00 3.892000E+01 1.171000E+01 -997 1 2.110000E+00 4.720000E+00 1.958000E+01 -998 1 3.144000E+01 3.505000E+01 3.586000E+01 -999 1 8.950000E+00 3.743000E+01 3.477000E+01 -1000 1 3.336000E+01 2.864000E+01 3.608000E+01 -1001 1 8.380000E+00 6.150000E+00 3.305000E+01 -1002 1 4.015000E+01 3.770000E+01 4.670000E+00 -1003 1 2.169000E+01 8.000000E+00 8.710000E+00 -1004 1 3.218000E+01 8.590000E+00 3.414000E+01 -1005 1 1.451000E+01 1.921000E+01 2.655000E+01 -1006 1 3.070000E+01 5.380000E+00 1.411000E+01 -1007 1 1.231000E+01 1.584000E+01 1.988000E+01 -1008 1 1.339000E+01 1.660000E+00 2.670000E+01 -1009 1 1.676000E+01 3.086000E+01 5.210000E+00 -1010 1 1.886000E+01 4.200000E+00 1.443000E+01 -1011 1 4.390000E+00 2.058000E+01 7.710000E+00 -1012 1 1.980000E+00 1.848000E+01 1.524000E+01 -1013 1 8.270000E+00 4.710000E+00 1.614000E+01 -1014 1 3.172000E+01 1.239000E+01 2.488000E+01 -1015 1 5.750000E+00 1.411000E+01 1.242000E+01 -1016 1 3.544000E+01 3.200000E+01 9.300000E-01 -1017 1 3.444000E+01 2.616000E+01 3.838000E+01 -1018 1 2.259000E+01 3.158000E+01 7.330000E+00 -1019 1 1.400000E+01 3.055000E+01 3.491000E+01 -1020 1 2.852000E+01 2.002000E+01 2.953000E+01 -1021 1 3.060000E+01 1.624000E+01 9.080000E+00 -1022 1 1.561000E+01 1.068000E+01 1.044000E+01 -1023 1 2.138000E+01 2.543000E+01 2.883000E+01 -1024 1 1.760000E+00 2.414000E+01 4.110000E+00 -1025 1 1.033000E+01 2.356000E+01 3.815000E+01 -1026 1 1.698000E+01 1.150000E+01 2.182000E+01 -1027 1 1.922000E+01 1.262000E+01 3.896000E+01 -1028 1 3.953000E+01 1.910000E+00 2.334000E+01 -1029 1 9.940000E+00 2.793000E+01 3.256000E+01 -1030 1 4.600000E-01 1.283000E+01 3.671000E+01 -1031 1 1.190000E+00 7.660000E+00 1.186000E+01 -1032 1 1.931000E+01 1.312000E+01 4.800000E+00 -1033 1 3.352000E+01 2.255000E+01 3.626000E+01 -1034 1 1.631000E+01 7.100000E+00 8.830000E+00 -1035 1 1.934000E+01 7.420000E+00 2.788000E+01 -1036 1 2.025000E+01 2.075000E+01 4.015000E+01 -1037 1 2.824000E+01 9.520000E+00 1.630000E+01 -1038 1 3.989000E+01 3.390000E+01 2.986000E+01 -1039 1 2.294000E+01 4.790000E+00 1.448000E+01 -1040 1 4.019000E+01 2.327000E+01 3.411000E+01 -1041 1 3.940000E+00 2.697000E+01 2.054000E+01 -1042 1 1.789000E+01 9.490000E+00 6.520000E+00 -1043 1 2.719000E+01 3.389000E+01 3.250000E+01 -1044 1 2.649000E+01 2.743000E+01 4.230000E+00 -1045 1 1.330000E+00 2.940000E+01 3.013000E+01 -1046 1 3.535000E+01 7.110000E+00 2.989000E+01 -1047 1 2.787000E+01 2.802000E+01 1.162000E+01 -1048 1 1.347000E+01 1.450000E+00 2.050000E+01 -1049 1 3.466000E+01 4.150000E+00 2.072000E+01 -1050 1 2.759000E+01 3.805000E+01 1.863000E+01 -1051 1 2.095000E+01 6.790000E+00 3.055000E+01 -1052 1 2.306000E+01 4.640000E+00 2.881000E+01 -1053 1 1.007000E+01 4.480000E+00 9.390000E+00 -1054 1 1.015000E+01 1.046000E+01 3.502000E+01 -1055 1 3.088000E+01 3.307000E+01 3.856000E+01 -1056 1 2.231000E+01 1.040000E+01 1.146000E+01 -1057 1 2.929000E+01 3.853000E+01 3.949000E+01 -1058 1 1.854000E+01 1.947000E+01 6.520000E+00 -1059 1 2.403000E+01 2.653000E+01 1.121000E+01 -1060 1 3.800000E+01 2.400000E+00 3.421000E+01 -1061 1 6.580000E+00 2.857000E+01 9.530000E+00 -1062 1 4.490000E+00 3.065000E+01 3.451000E+01 -1063 1 3.653000E+01 3.394000E+01 1.567000E+01 -1064 1 2.440000E+00 9.340000E+00 3.483000E+01 -1065 1 3.460000E+00 1.150000E+01 3.806000E+01 -1066 1 2.549000E+01 2.264000E+01 2.415000E+01 -1067 1 1.379000E+01 1.752000E+01 9.020000E+00 -1068 1 2.549000E+01 5.930000E+00 3.170000E+00 -1069 1 2.217000E+01 2.260000E+01 1.850000E+00 -1070 1 6.090000E+00 2.440000E+00 1.047000E+01 -1071 1 1.302000E+01 5.270000E+00 4.540000E+00 -1072 1 5.730000E+00 3.967000E+01 3.079000E+01 -1073 1 3.165000E+01 3.579000E+01 7.390000E+00 -1074 1 1.633000E+01 3.326000E+01 2.629000E+01 -1075 1 2.980000E+01 1.057000E+01 2.904000E+01 -1076 1 3.549000E+01 3.290000E+00 1.411000E+01 -1077 1 8.450000E+00 1.779000E+01 1.943000E+01 -1078 1 1.337000E+01 3.361000E+01 3.931000E+01 -1079 1 2.140000E+01 1.651000E+01 3.171000E+01 -1080 1 1.546000E+01 1.432000E+01 1.942000E+01 -1081 1 2.476000E+01 6.300000E+00 1.785000E+01 -1082 1 4.200000E+00 1.800000E+01 2.192000E+01 -1083 1 1.934000E+01 3.368000E+01 9.130000E+00 -1084 1 3.580000E+00 1.281000E+01 1.377000E+01 -1085 1 3.595000E+01 1.280000E+00 3.766000E+01 -1086 1 2.502000E+01 3.406000E+01 3.411000E+01 -1087 1 3.642000E+01 2.752000E+01 1.059000E+01 -1088 1 2.228000E+01 3.248000E+01 1.165000E+01 -1089 1 1.361000E+01 1.065000E+01 2.154000E+01 -1090 1 4.050000E+00 2.082000E+01 2.820000E+00 -1091 1 3.283000E+01 7.500000E+00 3.904000E+01 -1092 1 3.332000E+01 3.896000E+01 2.900000E+01 -1093 1 1.987000E+01 1.390000E+00 1.983000E+01 -1094 1 2.039000E+01 3.180000E+01 3.345000E+01 -1095 1 1.746000E+01 6.920000E+00 2.017000E+01 -1096 1 1.084000E+01 2.573000E+01 2.256000E+01 -1097 1 2.710000E+01 2.340000E+01 1.489000E+01 -1098 1 1.000000E-01 4.290000E+00 2.696000E+01 -1099 1 6.400000E+00 1.850000E+01 4.014000E+01 -1100 1 2.334000E+01 2.521000E+01 1.682000E+01 -1101 1 2.029000E+01 1.331000E+01 2.654000E+01 -1102 1 3.414000E+01 1.391000E+01 1.841000E+01 -1103 1 2.984000E+01 3.839000E+01 4.600000E+00 -1104 1 2.570000E+01 1.898000E+01 2.920000E+00 -1105 1 3.812000E+01 3.690000E+01 2.990000E+00 -1106 1 3.477000E+01 1.278000E+01 3.741000E+01 -1107 1 2.619000E+01 8.990000E+00 3.811000E+01 -1108 1 2.288000E+01 3.753000E+01 1.554000E+01 -1109 1 9.580000E+00 1.119000E+01 2.883000E+01 -1110 1 2.885000E+01 3.501000E+01 3.864000E+01 -1111 1 3.804000E+01 2.327000E+01 1.392000E+01 -1112 1 3.221000E+01 1.475000E+01 4.019000E+01 -1113 1 2.298000E+01 3.750000E+00 2.336000E+01 -1114 1 3.079000E+01 2.918000E+01 2.843000E+01 -1115 1 2.192000E+01 3.333000E+01 2.466000E+01 -1116 1 3.105000E+01 1.491000E+01 2.302000E+01 -1117 1 1.463000E+01 1.740000E+01 1.902000E+01 -1118 1 5.160000E+00 1.431000E+01 1.833000E+01 -1119 1 3.748000E+01 3.474000E+01 1.228000E+01 -1120 1 1.928000E+01 2.761000E+01 1.711000E+01 -1121 1 3.456000E+01 2.111000E+01 1.480000E+01 -1122 1 3.947000E+01 1.284000E+01 2.774000E+01 -1123 1 3.109000E+01 1.864000E+01 1.692000E+01 -1124 1 1.101000E+01 3.502000E+01 2.637000E+01 -1125 1 6.450000E+00 8.300000E+00 3.935000E+01 -1126 1 1.102000E+01 3.965000E+01 3.741000E+01 -1127 1 3.034000E+01 2.946000E+01 1.600000E-01 -1128 1 5.820000E+00 2.265000E+01 3.620000E+00 -1129 1 1.668000E+01 3.081000E+01 2.721000E+01 -1130 1 3.337000E+01 3.333000E+01 3.704000E+01 -1131 1 8.670000E+00 1.893000E+01 3.462000E+01 -1132 1 5.250000E+00 2.861000E+01 3.655000E+01 -1133 1 3.401000E+01 2.099000E+01 3.105000E+01 -1134 1 1.878000E+01 6.930000E+00 3.430000E+00 -1135 1 1.820000E+01 2.042000E+01 1.970000E+01 -1136 1 3.604000E+01 1.869000E+01 2.686000E+01 -1137 1 7.900000E-01 2.344000E+01 7.790000E+00 -1138 1 1.429000E+01 2.965000E+01 2.851000E+01 -1139 1 2.285000E+01 2.852000E+01 6.800000E-01 -1140 1 1.117000E+01 3.682000E+01 2.353000E+01 -1141 1 2.882000E+01 3.799000E+01 9.160000E+00 -1142 1 4.028000E+01 9.430000E+00 1.387000E+01 -1143 1 5.200000E+00 2.358000E+01 3.807000E+01 -1144 1 1.787000E+01 1.770000E+00 3.866000E+01 -1145 1 5.650000E+00 3.737000E+01 2.922000E+01 -1146 1 2.560000E+00 3.544000E+01 1.994000E+01 -1147 1 3.677000E+01 2.009000E+01 2.316000E+01 -1148 1 1.355000E+01 1.968000E+01 5.330000E+00 -1149 1 1.637000E+01 2.384000E+01 9.270000E+00 -1150 1 3.193000E+01 4.010000E+01 3.606000E+01 -1151 1 3.170000E+01 3.120000E+01 5.860000E+00 -1152 1 2.779000E+01 1.944000E+01 6.280000E+00 -1153 1 2.472000E+01 3.992000E+01 2.727000E+01 -1154 1 2.030000E+01 2.963000E+01 2.512000E+01 -1155 1 3.187000E+01 3.400000E+00 3.720000E+01 -1156 1 2.517000E+01 8.650000E+00 1.247000E+01 -1157 1 1.124000E+01 1.631000E+01 3.400000E-01 -1158 1 1.664000E+01 1.285000E+01 2.707000E+01 -1159 1 4.510000E+00 2.920000E+01 2.199000E+01 -1160 1 5.080000E+00 3.390000E+00 3.060000E+01 -1161 1 2.670000E+01 2.982000E+01 3.829000E+01 -1162 1 2.712000E+01 2.265000E+01 9.090000E+00 -1163 1 3.638000E+01 3.170000E+01 5.510000E+00 -1164 1 2.496000E+01 1.438000E+01 1.584000E+01 -1165 1 1.659000E+01 3.052000E+01 1.874000E+01 -1166 1 1.083000E+01 2.998000E+01 2.351000E+01 -1167 1 3.754000E+01 3.751000E+01 3.049000E+01 -1168 1 3.229000E+01 2.187000E+01 3.982000E+01 -1169 1 3.652000E+01 2.556000E+01 1.345000E+01 -1170 1 3.551000E+01 4.010000E+01 1.011000E+01 -1171 1 2.740000E+00 1.585000E+01 3.276000E+01 -1172 1 3.376000E+01 2.291000E+01 1.852000E+01 -1173 1 2.598000E+01 3.266000E+01 2.092000E+01 -1174 1 3.882000E+01 1.360000E+00 1.439000E+01 -1175 1 2.282000E+01 1.660000E+01 2.088000E+01 -1176 1 1.938000E+01 7.990000E+00 2.275000E+01 -1177 1 1.095000E+01 1.666000E+01 4.800000E+00 -1178 1 3.468000E+01 1.184000E+01 2.623000E+01 -1179 1 3.108000E+01 2.838000E+01 1.891000E+01 -1180 1 3.415000E+01 7.750000E+00 1.679000E+01 -1181 1 3.713000E+01 1.988000E+01 5.110000E+00 -1182 1 2.110000E+00 3.913000E+01 3.360000E+00 -1183 1 2.311000E+01 3.560000E+01 6.700000E+00 -1184 1 2.552000E+01 3.364000E+01 7.380000E+00 -1185 1 1.535000E+01 1.344000E+01 1.084000E+01 -1186 1 6.340000E+00 1.187000E+01 1.055000E+01 -1187 1 1.725000E+01 1.950000E+01 1.471000E+01 -1188 1 4.015000E+01 1.317000E+01 1.957000E+01 -1189 1 3.513000E+01 3.980000E+00 3.989000E+01 -1190 1 2.488000E+01 2.747000E+01 3.122000E+01 -1191 1 9.150000E+00 2.214000E+01 3.258000E+01 -1192 1 2.424000E+01 1.200000E+01 6.930000E+00 -1193 1 3.965000E+01 1.413000E+01 1.342000E+01 -1194 1 3.927000E+01 1.600000E-01 4.270000E+00 -1195 1 2.271000E+01 3.680000E+00 1.178000E+01 -1196 1 2.294000E+01 7.560000E+00 1.360000E+00 -1197 1 1.907000E+01 1.235000E+01 1.466000E+01 -1198 1 1.544000E+01 5.110000E+00 1.966000E+01 -1199 1 2.580000E+01 2.601000E+01 2.841000E+01 -1200 1 4.280000E+00 3.770000E+01 2.640000E+01 -1201 1 2.765000E+01 2.761000E+01 5.000000E-01 -1202 1 3.100000E+01 2.392000E+01 3.257000E+01 -1203 1 3.931000E+01 2.020000E+01 2.697000E+01 -1204 1 2.428000E+01 2.482000E+01 3.084000E+01 -1205 1 1.408000E+01 1.666000E+01 1.350000E+00 -1206 1 1.547000E+01 3.540000E+01 3.676000E+01 -1207 1 3.507000E+01 2.395000E+01 1.057000E+01 -1208 1 3.648000E+01 8.430000E+00 9.010000E+00 -1209 1 2.923000E+01 1.604000E+01 1.253000E+01 -1210 1 1.365000E+01 9.500000E-01 1.787000E+01 -1211 1 1.272000E+01 2.981000E+01 7.750000E+00 -1212 1 1.840000E+00 2.728000E+01 3.907000E+01 -1213 1 1.120000E+00 1.518000E+01 1.694000E+01 -1214 1 3.563000E+01 9.240000E+00 3.370000E+00 -1215 1 1.424000E+01 2.757000E+01 2.428000E+01 -1216 1 5.890000E+00 1.033000E+01 5.660000E+00 -1217 1 9.570000E+00 3.371000E+01 3.266000E+01 -1218 1 2.773000E+01 1.012000E+01 2.509000E+01 -1219 1 3.792000E+01 3.945000E+01 2.844000E+01 -1220 1 5.150000E+00 1.463000E+01 2.636000E+01 -1221 1 3.328000E+01 3.381000E+01 2.108000E+01 -1222 1 8.140000E+00 2.831000E+01 2.295000E+01 -1223 1 1.308000E+01 3.189000E+01 3.179000E+01 -1224 1 4.870000E+00 3.625000E+01 1.928000E+01 -1225 1 1.535000E+01 3.519000E+01 1.842000E+01 -1226 1 1.529000E+01 1.635000E+01 2.662000E+01 -1227 1 1.112000E+01 2.849000E+01 1.917000E+01 -1228 1 1.693000E+01 8.820000E+00 3.693000E+01 -1229 1 3.550000E+00 8.000000E-02 4.940000E+00 -1230 1 1.206000E+01 3.431000E+01 3.570000E+01 -1231 1 5.870000E+00 5.960000E+00 4.430000E+00 -1232 1 3.294000E+01 1.180000E+00 3.710000E+00 -1233 1 2.256000E+01 7.940000E+00 1.246000E+01 -1234 1 1.547000E+01 2.903000E+01 3.290000E+01 -1235 1 7.720000E+00 1.020000E+00 2.322000E+01 -1236 1 2.902000E+01 2.914000E+01 8.300000E+00 -1237 1 1.436000E+01 3.453000E+01 3.256000E+01 -1238 1 2.781000E+01 3.972000E+01 3.000000E+00 -1239 1 2.858000E+01 2.193000E+01 3.591000E+01 -1240 1 2.391000E+01 2.270000E+01 1.922000E+01 -1241 1 1.600000E-01 2.370000E+00 3.034000E+01 -1242 1 2.127000E+01 3.586000E+01 3.348000E+01 -1243 1 2.298000E+01 1.863000E+01 2.466000E+01 -1244 1 2.380000E+00 1.022000E+01 2.573000E+01 -1245 1 2.251000E+01 1.543000E+01 1.045000E+01 -1246 1 1.938000E+01 3.690000E+00 7.760000E+00 -1247 1 1.976000E+01 6.120000E+00 3.336000E+01 -1248 1 2.334000E+01 3.926000E+01 2.133000E+01 -1249 1 3.026000E+01 2.779000E+01 5.850000E+00 -1250 1 2.347000E+01 8.300000E-01 3.432000E+01 -1251 1 3.707000E+01 4.440000E+00 2.697000E+01 -1252 1 1.840000E+01 2.950000E+00 2.370000E+01 -1253 1 2.758000E+01 3.078000E+01 1.500000E+01 -1254 1 3.211000E+01 1.728000E+01 2.356000E+01 -1255 1 1.314000E+01 1.152000E+01 2.412000E+01 -1256 1 5.890000E+00 2.665000E+01 3.327000E+01 -1257 1 1.501000E+01 2.282000E+01 2.825000E+01 -1258 1 1.249000E+01 3.631000E+01 7.180000E+00 -1259 1 5.500000E+00 2.406000E+01 9.120000E+00 -1260 1 1.059000E+01 4.300000E-01 3.199000E+01 -1261 1 3.132000E+01 3.683000E+01 2.740000E+00 -1262 1 1.165000E+01 2.439000E+01 1.650000E+00 -1263 1 1.434000E+01 6.550000E+00 6.850000E+00 -1264 1 7.480000E+00 2.303000E+01 7.160000E+00 -1265 1 3.002000E+01 2.488000E+01 2.780000E+00 -1266 1 4.010000E+01 2.802000E+01 3.485000E+01 -1267 1 1.400000E+00 2.684000E+01 1.046000E+01 -1268 1 2.590000E+01 2.991000E+01 3.237000E+01 -1269 1 2.170000E+01 3.797000E+01 2.319000E+01 -1270 1 3.904000E+01 1.949000E+01 2.990000E+00 -1271 1 2.555000E+01 4.360000E+00 1.111000E+01 -1272 1 2.977000E+01 2.702000E+01 1.584000E+01 -1273 1 1.501000E+01 3.299000E+01 2.369000E+01 -1274 1 1.219000E+01 2.916000E+01 3.926000E+01 -1275 1 2.820000E+01 3.847000E+01 2.768000E+01 -1276 1 2.101000E+01 1.450000E+01 2.000000E+01 -1277 1 5.330000E+00 1.646000E+01 2.920000E+01 -1278 1 3.312000E+01 3.543000E+01 2.790000E+01 -1279 1 1.800000E+01 1.098000E+01 1.700000E+01 -1280 1 7.030000E+00 3.831000E+01 1.719000E+01 -1281 1 1.319000E+01 9.240000E+00 1.075000E+01 -1282 1 3.920000E+00 7.200000E+00 1.115000E+01 -1283 1 3.650000E+00 2.979000E+01 1.546000E+01 -1284 1 3.500000E+00 3.072000E+01 3.912000E+01 -1285 1 3.430000E+00 1.000000E+00 2.804000E+01 -1286 1 3.679000E+01 8.930000E+00 1.675000E+01 -1287 1 3.414000E+01 7.190000E+00 2.456000E+01 -1288 1 6.710000E+00 1.730000E+01 1.122000E+01 -1289 1 1.709000E+01 2.770000E+01 1.262000E+01 -1290 1 3.694000E+01 1.546000E+01 1.331000E+01 -1291 1 2.718000E+01 2.792000E+01 1.645000E+01 -1292 1 2.908000E+01 3.329000E+01 3.528000E+01 -1293 1 3.268000E+01 2.537000E+01 3.058000E+01 -1294 1 1.485000E+01 1.259000E+01 1.325000E+01 -1295 1 8.820000E+00 3.261000E+01 4.007000E+01 -1296 1 3.998000E+01 1.613000E+01 2.972000E+01 -1297 1 3.139000E+01 2.758000E+01 3.560000E+00 -1298 1 3.836000E+01 3.975000E+01 3.901000E+01 -1299 1 1.090000E+00 4.980000E+00 1.548000E+01 -1300 1 1.421000E+01 3.173000E+01 5.250000E+00 -1301 1 3.944000E+01 1.907000E+01 6.630000E+00 -1302 1 1.319000E+01 2.388000E+01 3.310000E+01 -1303 1 1.448000E+01 2.150000E+01 1.276000E+01 -1304 1 2.870000E+01 1.075000E+01 3.650000E+00 -1305 1 6.410000E+00 1.970000E+01 9.590000E+00 -1306 1 1.254000E+01 3.653000E+01 3.732000E+01 -1307 1 3.622000E+01 3.267000E+01 3.146000E+01 -1308 1 3.814000E+01 3.510000E+00 2.927000E+01 -1309 1 3.172000E+01 1.006000E+01 3.114000E+01 -1310 1 4.270000E+00 3.802000E+01 1.210000E+01 -1311 1 2.905000E+01 3.354000E+01 4.750000E+00 -1312 1 2.541000E+01 1.406000E+01 2.628000E+01 -1313 1 1.076000E+01 4.920000E+00 3.349000E+01 -1314 1 2.420000E+01 1.290000E+00 3.290000E+00 -1315 1 2.271000E+01 3.960000E+01 2.526000E+01 -1316 1 2.240000E+00 3.942000E+01 8.460000E+00 -1317 1 2.018000E+01 1.189000E+01 2.936000E+01 -1318 1 6.670000E+00 3.647000E+01 3.150000E+00 -1319 1 1.217000E+01 3.813000E+01 1.310000E+00 -1320 1 2.958000E+01 8.560000E+00 2.654000E+01 -1321 1 6.460000E+00 1.124000E+01 3.265000E+01 -1322 1 3.173000E+01 4.810000E+00 3.261000E+01 -1323 1 1.022000E+01 7.550000E+00 2.677000E+01 -1324 1 1.739000E+01 1.514000E+01 4.980000E+00 -1325 1 1.226000E+01 2.119000E+01 2.735000E+01 -1326 1 3.404000E+01 6.900000E+00 3.635000E+01 -1327 1 2.650000E+01 3.732000E+01 5.370000E+00 -1328 1 3.277000E+01 4.990000E+00 1.680000E+01 -1329 1 1.502000E+01 1.545000E+01 7.820000E+00 -1330 1 7.740000E+00 2.527000E+01 3.585000E+01 -1331 1 1.992000E+01 3.187000E+01 1.825000E+01 -1332 1 3.401000E+01 6.910000E+00 2.720000E+01 -1333 1 2.875000E+01 2.100000E+00 2.223000E+01 -1334 1 2.556000E+01 2.718000E+01 2.141000E+01 -1335 1 4.860000E+00 3.796000E+01 4.027000E+01 -1336 1 4.010000E+00 2.570000E+01 1.649000E+01 -1337 1 2.580000E+00 2.737000E+01 1.471000E+01 -1338 1 2.040000E+01 4.770000E+00 2.774000E+01 -1339 1 2.217000E+01 2.430000E+01 8.960000E+00 -1340 1 2.120000E+01 1.712000E+01 1.479000E+01 -1341 1 2.385000E+01 1.226000E+01 1.738000E+01 -1342 1 2.168000E+01 3.595000E+01 2.633000E+01 -1343 1 3.779000E+01 2.744000E+01 2.254000E+01 -1344 1 3.197000E+01 8.010000E+00 1.350000E+00 -1345 1 1.345000E+01 1.666000E+01 2.972000E+01 -1346 1 2.106000E+01 1.860000E+01 5.840000E+00 -1347 1 2.651000E+01 1.600000E-01 3.379000E+01 -1348 1 1.457000E+01 4.990000E+00 3.677000E+01 -1349 1 2.559000E+01 1.070000E+01 3.575000E+01 -1350 1 3.456000E+01 3.082000E+01 1.151000E+01 -1351 1 2.127000E+01 6.240000E+00 6.000000E+00 -1352 1 6.170000E+00 3.078000E+01 3.640000E+00 -1353 1 1.606000E+01 2.608000E+01 3.980000E+01 -1354 1 2.043000E+01 3.960000E+00 2.226000E+01 -1355 1 3.570000E+00 1.118000E+01 1.740000E+01 -1356 1 2.415000E+01 3.418000E+01 1.358000E+01 -1357 1 2.250000E+01 1.542000E+01 7.510000E+00 -1358 1 2.400000E-01 2.390000E+00 1.615000E+01 -1359 1 1.864000E+01 3.642000E+01 2.140000E+01 -1360 1 3.561000E+01 2.350000E+00 1.924000E+01 -1361 1 1.393000E+01 2.400000E+01 4.011000E+01 -1362 1 2.980000E+01 5.650000E+00 3.999000E+01 -1363 1 6.930000E+00 2.818000E+01 2.740000E+00 -1364 1 2.728000E+01 8.100000E-01 3.012000E+01 -1365 1 2.297000E+01 3.893000E+01 3.844000E+01 -1366 1 1.987000E+01 3.658000E+01 5.510000E+00 -1367 1 1.177000E+01 2.127000E+01 3.189000E+01 -1368 1 3.160000E+01 1.245000E+01 3.217000E+01 -1369 1 3.270000E+01 1.684000E+01 1.796000E+01 -1370 1 2.535000E+01 2.905000E+01 1.800000E+01 -1371 1 2.630000E+00 4.370000E+00 1.343000E+01 -1372 1 1.124000E+01 1.275000E+01 1.044000E+01 -1373 1 1.947000E+01 1.880000E+01 2.250000E+00 -1374 1 3.409000E+01 4.040000E+00 5.220000E+00 -1375 1 1.379000E+01 1.329000E+01 4.620000E+00 -1376 1 1.963000E+01 1.086000E+01 3.570000E+00 -1377 1 1.305000E+01 1.861000E+01 3.700000E+01 -1378 1 5.910000E+00 3.479000E+01 7.090000E+00 -1379 1 2.664000E+01 3.274000E+01 1.313000E+01 -1380 1 3.940000E+00 3.429000E+01 3.908000E+01 -1381 1 4.960000E+00 1.359000E+01 3.255000E+01 -1382 1 2.380000E+01 1.574000E+01 3.517000E+01 -1383 1 9.930000E+00 1.304000E+01 3.540000E+01 -1384 1 8.350000E+00 2.658000E+01 1.746000E+01 -1385 1 2.680000E+01 1.073000E+01 3.069000E+01 -1386 1 2.992000E+01 1.538000E+01 2.555000E+01 -1387 1 2.805000E+01 1.774000E+01 3.190000E+00 -1388 1 3.191000E+01 3.929000E+01 6.120000E+00 -1389 1 3.335000E+01 1.971000E+01 1.050000E+00 -1390 1 2.216000E+01 1.137000E+01 2.750000E+00 -1391 1 2.882000E+01 1.110000E+01 7.400000E-01 -1392 1 7.640000E+00 3.850000E+01 3.779000E+01 -1393 1 3.707000E+01 2.949000E+01 3.358000E+01 -1394 1 2.828000E+01 9.070000E+00 1.356000E+01 -1395 1 1.108000E+01 6.850000E+00 8.000000E+00 -1396 1 1.787000E+01 1.364000E+01 9.840000E+00 -1397 1 2.900000E+01 3.620000E+01 1.090000E+00 -1398 1 9.170000E+00 3.214000E+01 1.168000E+01 -1399 1 1.810000E+01 9.150000E+00 9.360000E+00 -1400 1 2.430000E+00 2.545000E+01 1.760000E+00 -1401 1 2.090000E+00 3.653000E+01 1.733000E+01 -1402 1 9.260000E+00 2.339000E+01 4.100000E-01 -1403 1 3.103000E+01 5.880000E+00 8.890000E+00 -1404 1 3.511000E+01 2.325000E+01 1.322000E+01 -1405 1 1.774000E+01 2.442000E+01 4.870000E+00 -1406 1 3.054000E+01 1.328000E+01 1.581000E+01 -1407 1 3.084000E+01 2.721000E+01 3.022000E+01 -1408 1 3.960000E+00 3.703000E+01 3.776000E+01 -1409 1 2.184000E+01 1.208000E+01 3.655000E+01 -1410 1 2.615000E+01 1.950000E+01 1.868000E+01 -1411 1 3.420000E+00 7.500000E-01 3.176000E+01 -1412 1 3.223000E+01 2.681000E+01 3.401000E+01 -1413 1 2.986000E+01 2.995000E+01 2.098000E+01 -1414 1 2.076000E+01 2.310000E+01 2.351000E+01 -1415 1 2.757000E+01 1.960000E+00 1.832000E+01 -1416 1 2.290000E+01 1.656000E+01 1.825000E+01 -1417 1 3.730000E+00 3.849000E+01 2.385000E+01 -1418 1 2.070000E+00 3.006000E+01 3.690000E+01 -1419 1 2.486000E+01 3.901000E+01 3.640000E+00 -1420 1 6.690000E+00 1.080000E+00 1.762000E+01 -1421 1 2.810000E+01 3.061000E+01 2.849000E+01 -1422 1 1.667000E+01 2.217000E+01 3.643000E+01 -1423 1 1.246000E+01 3.921000E+01 3.348000E+01 -1424 1 1.620000E+00 1.527000E+01 2.182000E+01 -1425 1 8.390000E+00 2.229000E+01 2.910000E+00 -1426 1 4.960000E+00 1.722000E+01 3.227000E+01 -1427 1 1.097000E+01 3.120000E+00 3.136000E+01 -1428 1 1.470000E+00 3.810000E+01 2.636000E+01 -1429 1 9.630000E+00 1.670000E+00 3.791000E+01 -1430 1 1.733000E+01 9.980000E+00 3.389000E+01 -1431 1 1.300000E-01 1.829000E+01 5.300000E-01 -1432 1 1.720000E+01 2.888000E+01 3.760000E+00 -1433 1 3.608000E+01 1.331000E+01 1.390000E+00 -1434 1 3.466000E+01 2.952000E+01 2.841000E+01 -1435 1 2.257000E+01 9.070000E+00 3.054000E+01 -1436 1 8.100000E+00 2.772000E+01 3.451000E+01 -1437 1 1.917000E+01 2.970000E+01 3.244000E+01 -1438 1 2.160000E+00 9.940000E+00 1.380000E+00 -1439 1 1.853000E+01 1.426000E+01 2.321000E+01 -1440 1 2.528000E+01 3.675000E+01 3.157000E+01 -1441 1 2.960000E+00 2.813000E+01 3.537000E+01 -1442 1 5.020000E+00 4.000000E-01 1.215000E+01 -1443 1 1.564000E+01 3.659000E+01 2.433000E+01 -1444 1 3.000000E+00 3.658000E+01 1.670000E+00 -1445 1 3.501000E+01 1.470000E+01 3.992000E+01 -1446 1 2.720000E+01 3.610000E+00 6.250000E+00 -1447 1 3.294000E+01 3.124000E+01 3.537000E+01 -1448 1 5.810000E+00 2.759000E+01 1.464000E+01 -1449 1 3.810000E+01 3.890000E+01 8.600000E+00 -1450 1 4.022000E+01 5.010000E+00 7.200000E+00 -1451 1 2.377000E+01 3.116000E+01 3.824000E+01 -1452 1 3.817000E+01 1.637000E+01 5.570000E+00 -1453 1 3.050000E+00 2.772000E+01 3.266000E+01 -1454 1 3.022000E+01 3.328000E+01 1.495000E+01 -1455 1 6.080000E+00 1.196000E+01 2.602000E+01 -1456 1 2.198000E+01 3.821000E+01 6.410000E+00 -1457 1 3.644000E+01 7.460000E+00 3.733000E+01 -1458 1 1.589000E+01 3.311000E+01 3.883000E+01 -1459 1 3.532000E+01 1.931000E+01 2.946000E+01 -1460 1 2.519000E+01 1.542000E+01 1.105000E+01 -1461 1 7.320000E+00 1.694000E+01 1.880000E+00 -1462 1 1.205000E+01 2.463000E+01 1.075000E+01 -1463 1 1.325000E+01 2.868000E+01 1.600000E+00 -1464 1 2.294000E+01 2.149000E+01 3.254000E+01 -1465 1 1.392000E+01 7.080000E+00 2.761000E+01 -1466 1 3.159000E+01 3.295000E+01 3.362000E+01 -1467 1 1.675000E+01 6.980000E+00 1.550000E+00 -1468 1 4.680000E+00 4.700000E-01 8.310000E+00 -1469 1 2.746000E+01 3.543000E+01 3.680000E+00 -1470 1 2.042000E+01 2.320000E+01 3.005000E+01 -1471 1 3.860000E+01 1.418000E+01 1.530000E+00 -1472 1 2.749000E+01 3.548000E+01 2.641000E+01 -1473 1 1.658000E+01 2.845000E+01 1.001000E+01 -1474 1 2.232000E+01 3.803000E+01 2.870000E+00 -1475 1 2.061000E+01 3.710000E+00 3.526000E+01 -1476 1 9.570000E+00 1.493000E+01 3.136000E+01 -1477 1 4.630000E+00 1.600000E+00 1.140000E+00 -1478 1 3.290000E+00 7.150000E+00 3.688000E+01 -1479 1 5.330000E+00 3.326000E+01 2.706000E+01 -1480 1 1.874000E+01 2.017000E+01 3.637000E+01 -1481 1 1.154000E+01 1.770000E+00 8.630000E+00 -1482 1 2.200000E-01 1.175000E+01 9.020000E+00 -1483 1 1.778000E+01 1.796000E+01 8.780000E+00 -1484 1 8.550000E+00 1.950000E+01 1.572000E+01 -1485 1 1.368000E+01 9.410000E+00 3.781000E+01 -1486 1 5.060000E+00 2.528000E+01 1.760000E+00 -1487 1 1.348000E+01 7.750000E+00 3.034000E+01 -1488 1 1.100000E-01 3.838000E+01 1.051000E+01 -1489 1 7.400000E-01 2.262000E+01 2.198000E+01 -1490 1 1.359000E+01 1.589000E+01 3.418000E+01 -1491 1 2.760000E+01 5.130000E+00 3.155000E+01 -1492 1 8.070000E+00 3.178000E+01 1.642000E+01 -1493 1 3.561000E+01 2.099000E+01 4.011000E+01 -1494 1 1.933000E+01 1.870000E+00 3.318000E+01 -1495 1 3.815000E+01 2.150000E+01 5.100000E-01 -1496 1 1.389000E+01 3.694000E+01 1.196000E+01 -1497 1 9.190000E+00 2.380000E+01 1.214000E+01 -1498 1 1.472000E+01 2.570000E+01 2.248000E+01 -1499 1 9.430000E+00 6.980000E+00 1.543000E+01 -1500 1 3.500000E+01 1.781000E+01 3.705000E+01 -1501 1 3.357000E+01 1.549000E+01 1.559000E+01 -1502 1 1.196000E+01 3.850000E+01 5.740000E+00 -1503 1 9.320000E+00 2.848000E+01 2.568000E+01 -1504 1 1.820000E+00 8.920000E+00 3.910000E+00 -1505 1 6.640000E+00 1.783000E+01 4.430000E+00 -1506 1 1.285000E+01 3.971000E+01 9.180000E+00 -1507 1 8.750000E+00 3.740000E+00 5.670000E+00 -1508 1 1.418000E+01 1.894000E+01 1.328000E+01 -1509 1 3.084000E+01 1.262000E+01 3.479000E+01 -1510 1 3.272000E+01 2.918000E+01 1.780000E+00 -1511 1 2.370000E+00 1.336000E+01 5.600000E+00 -1512 1 2.893000E+01 6.660000E+00 1.092000E+01 -1513 1 4.600000E-01 1.000000E-01 1.299000E+01 -1514 1 1.375000E+01 2.610000E+00 4.080000E+00 -1515 1 2.833000E+01 3.156000E+01 2.518000E+01 -1516 1 1.641000E+01 2.219000E+01 5.640000E+00 -1517 1 3.764000E+01 9.750000E+00 3.632000E+01 -1518 1 1.009000E+01 3.697000E+01 3.843000E+01 -1519 1 1.439000E+01 3.326000E+01 3.508000E+01 -1520 1 4.320000E+00 4.370000E+00 2.500000E+00 -1521 1 9.200000E+00 2.266000E+01 9.410000E+00 -1522 1 8.290000E+00 2.166000E+01 3.791000E+01 -1523 1 2.775000E+01 1.574000E+01 7.580000E+00 -1524 1 3.112000E+01 1.926000E+01 1.035000E+01 -1525 1 2.905000E+01 1.047000E+01 2.138000E+01 -1526 1 2.190000E+01 9.510000E+00 3.525000E+01 -1527 1 3.581000E+01 2.896000E+01 1.660000E+00 -1528 1 9.700000E-01 3.178000E+01 1.872000E+01 -1529 1 7.040000E+00 5.100000E+00 9.470000E+00 -1530 1 3.515000E+01 1.636000E+01 2.275000E+01 -1531 1 1.136000E+01 2.126000E+01 3.580000E+01 -1532 1 2.387000E+01 1.600000E+00 2.197000E+01 -1533 1 1.347000E+01 8.830000E+00 5.600000E-01 -1534 1 3.177000E+01 1.369000E+01 2.890000E+01 -1535 1 1.407000E+01 2.034000E+01 2.640000E+00 -1536 1 3.052000E+01 1.010000E+01 8.730000E+00 -1537 1 3.484000E+01 1.526000E+01 3.368000E+01 -1538 1 2.878000E+01 1.497000E+01 3.620000E+01 -1539 1 1.971000E+01 2.704000E+01 1.131000E+01 -1540 1 6.930000E+00 3.917000E+01 1.046000E+01 -1541 1 2.469000E+01 1.259000E+01 2.390000E+01 -1542 1 1.780000E+00 2.473000E+01 1.754000E+01 -1543 1 3.880000E+01 5.180000E+00 1.822000E+01 -1544 1 1.251000E+01 3.104000E+01 3.040000E+00 -1545 1 2.450000E+01 2.044000E+01 2.614000E+01 -1546 1 1.047000E+01 3.333000E+01 7.610000E+00 -1547 1 7.280000E+00 7.750000E+00 5.920000E+00 -1548 1 2.830000E+00 2.413000E+01 3.270000E+01 -1549 1 1.217000E+01 2.309000E+01 2.254000E+01 -1550 1 2.141000E+01 3.446000E+01 2.861000E+01 -1551 1 3.979000E+01 1.027000E+01 2.290000E+00 -1552 1 7.000000E-01 2.459000E+01 2.969000E+01 -1553 1 1.352000E+01 1.136000E+01 2.727000E+01 -1554 1 3.741000E+01 3.061000E+01 2.193000E+01 -1555 1 2.734000E+01 2.234000E+01 2.685000E+01 -1556 1 2.172000E+01 2.230000E+00 8.240000E+00 -1557 1 3.788000E+01 1.843000E+01 2.492000E+01 -1558 1 6.350000E+00 3.578000E+01 3.374000E+01 -1559 1 2.286000E+01 2.200000E+00 3.186000E+01 -1560 1 3.322000E+01 4.590000E+00 2.710000E+00 -1561 1 1.315000E+01 1.466000E+01 1.008000E+01 -1562 1 2.883000E+01 2.383000E+01 3.093000E+01 -1563 1 1.278000E+01 1.185000E+01 3.666000E+01 -1564 1 4.220000E+00 1.916000E+01 5.310000E+00 -1565 1 2.612000E+01 6.230000E+00 2.050000E+01 -1566 1 1.400000E+00 1.401000E+01 3.426000E+01 -1567 1 5.210000E+00 2.573000E+01 2.616000E+01 -1568 1 1.423000E+01 1.097000E+01 3.458000E+01 -1569 1 1.777000E+01 2.522000E+01 1.154000E+01 -1570 1 3.381000E+01 6.400000E+00 1.077000E+01 -1571 1 1.508000E+01 4.400000E-01 3.908000E+01 -1572 1 6.730000E+00 3.688000E+01 9.070000E+00 -1573 1 2.040000E+01 2.065000E+01 1.584000E+01 -1574 1 1.844000E+01 9.810000E+00 2.893000E+01 -1575 1 1.950000E+00 6.940000E+00 2.815000E+01 -1576 1 9.500000E+00 2.587000E+01 9.680000E+00 -1577 1 3.990000E+00 2.400000E+00 1.982000E+01 -1578 1 2.900000E+01 3.571000E+01 3.371000E+01 -1579 1 3.817000E+01 1.882000E+01 2.905000E+01 -1580 1 1.229000E+01 1.288000E+01 1.493000E+01 -1581 1 2.226000E+01 1.038000E+01 2.000000E-01 -1582 1 8.750000E+00 1.312000E+01 2.703000E+01 -1583 1 9.670000E+00 3.071000E+01 1.930000E+00 -1584 1 1.697000E+01 2.436000E+01 2.133000E+01 -1585 1 3.249000E+01 3.746000E+01 3.428000E+01 -1586 1 2.899000E+01 3.809000E+01 1.194000E+01 -1587 1 3.445000E+01 2.889000E+01 9.390000E+00 -1588 1 1.401000E+01 2.116000E+01 3.661000E+01 -1589 1 8.700000E-01 2.382000E+01 3.668000E+01 -1590 1 3.915000E+01 7.480000E+00 1.593000E+01 -1591 1 1.036000E+01 1.030000E+01 3.190000E+01 -1592 1 4.220000E+00 1.625000E+01 1.119000E+01 -1593 1 3.389000E+01 1.780000E+00 2.755000E+01 -1594 1 1.246000E+01 8.160000E+00 3.565000E+01 -1595 1 3.811000E+01 1.320000E+01 4.170000E+00 -1596 1 2.947000E+01 6.310000E+00 3.321000E+01 -1597 1 1.444000E+01 2.160000E+01 7.480000E+00 -1598 1 3.360000E+01 2.825000E+01 1.814000E+01 -1599 1 6.400000E-01 3.160000E+01 2.619000E+01 -1600 1 2.477000E+01 2.643000E+01 1.880000E+01 -1601 1 1.755000E+01 2.823000E+01 3.460000E+01 -1602 1 3.945000E+01 2.520000E+01 1.824000E+01 -1603 1 3.013000E+01 2.077000E+01 1.514000E+01 -1604 1 2.459000E+01 3.660000E+01 3.478000E+01 -1605 1 2.318000E+01 9.770000E+00 3.799000E+01 -1606 1 3.523000E+01 9.760000E+00 1.120000E+01 -1607 1 3.625000E+01 3.149000E+01 8.750000E+00 -1608 1 3.202000E+01 7.500000E+00 7.090000E+00 -1609 1 1.357000E+01 3.376000E+01 2.663000E+01 -1610 1 2.101000E+01 1.504000E+01 1.717000E+01 -1611 1 2.895000E+01 4.980000E+00 2.930000E+01 -1612 1 3.817000E+01 2.899000E+01 3.097000E+01 -1613 1 3.765000E+01 3.460000E+00 3.898000E+01 -1614 1 2.575000E+01 4.890000E+00 2.528000E+01 -1615 1 3.599000E+01 1.568000E+01 1.927000E+01 -1616 1 2.431000E+01 5.700000E+00 3.397000E+01 -1617 1 2.130000E+00 2.891000E+01 6.330000E+00 -1618 1 3.190000E+00 5.440000E+00 3.909000E+01 -1619 1 2.340000E+00 3.554000E+01 2.575000E+01 -1620 1 1.124000E+01 7.820000E+00 3.241000E+01 -1621 1 5.200000E-01 5.850000E+00 3.887000E+01 -1622 1 8.370000E+00 6.440000E+00 3.862000E+01 -1623 1 1.790000E+00 3.708000E+01 2.244000E+01 -1624 1 1.278000E+01 2.651000E+01 1.812000E+01 -1625 1 2.391000E+01 2.164000E+01 1.222000E+01 -1626 1 2.356000E+01 1.921000E+01 7.060000E+00 -1627 1 3.853000E+01 3.246000E+01 3.819000E+01 -1628 1 6.430000E+00 2.372000E+01 3.407000E+01 -1629 1 1.055000E+01 2.012000E+01 5.500000E+00 -1630 1 2.635000E+01 1.908000E+01 3.655000E+01 -1631 1 1.615000E+01 5.330000E+00 1.680000E+01 -1632 1 2.050000E+01 2.713000E+01 2.675000E+01 -1633 1 2.450000E+00 1.850000E+00 1.185000E+01 -1634 1 3.842000E+01 1.927000E+01 1.340000E+01 -1635 1 3.560000E+01 2.991000E+01 3.746000E+01 -1636 1 1.205000E+01 1.955000E+01 3.382000E+01 -1637 1 3.346000E+01 1.793000E+01 3.918000E+01 -1638 1 1.804000E+01 1.845000E+01 2.919000E+01 -1639 1 2.013000E+01 3.484000E+01 1.485000E+01 -1640 1 1.857000E+01 2.674000E+01 2.141000E+01 -1641 1 1.780000E+00 3.457000E+01 3.455000E+01 -1642 1 1.133000E+01 5.160000E+00 2.104000E+01 -1643 1 8.710000E+00 2.148000E+01 2.817000E+01 -1644 1 2.564000E+01 2.289000E+01 3.583000E+01 -1645 1 1.795000E+01 2.480000E+01 3.808000E+01 -1646 1 2.110000E+00 2.141000E+01 3.274000E+01 -1647 1 3.600000E+01 1.830000E+01 2.078000E+01 -1648 1 1.551000E+01 4.011000E+01 5.650000E+00 -1649 1 3.445000E+01 3.825000E+01 6.640000E+00 -1650 1 2.430000E+00 3.178000E+01 2.884000E+01 -1651 1 3.040000E+01 1.860000E+00 3.503000E+01 -1652 1 2.811000E+01 8.440000E+00 2.985000E+01 -1653 1 1.467000E+01 1.845000E+01 3.386000E+01 -1654 1 3.925000E+01 6.950000E+00 3.398000E+01 -1655 1 3.377000E+01 2.648000E+01 6.800000E+00 -1656 1 4.520000E+00 2.755000E+01 3.924000E+01 -1657 1 2.454000E+01 3.519000E+01 2.140000E+00 -1658 1 3.307000E+01 3.625000E+01 4.980000E+00 -1659 1 3.070000E+00 3.100000E+00 1.713000E+01 -1660 1 3.759000E+01 1.688000E+01 3.333000E+01 -1661 1 9.100000E+00 3.988000E+01 4.560000E+00 -1662 1 2.423000E+01 8.630000E+00 3.409000E+01 -1663 1 3.720000E+01 2.865000E+01 2.818000E+01 -1664 1 9.920000E+00 1.170000E+00 2.153000E+01 -1665 1 5.900000E+00 1.950000E+00 2.841000E+01 -1666 1 3.709000E+01 1.570000E+01 2.824000E+01 -1667 1 3.722000E+01 7.380000E+00 2.617000E+01 -1668 1 3.050000E+00 2.716000E+01 8.050000E+00 -1669 1 1.669000E+01 3.698000E+01 1.056000E+01 -1670 1 3.190000E+00 9.160000E+00 7.780000E+00 -1671 1 2.651000E+01 2.454000E+01 1.986000E+01 -1672 1 2.637000E+01 1.740000E+00 2.675000E+01 -1673 1 2.998000E+01 3.964000E+01 1.620000E+01 -1674 1 1.909000E+01 1.974000E+01 2.647000E+01 -1675 1 1.444000E+01 2.134000E+01 3.925000E+01 -1676 1 6.450000E+00 3.316000E+01 3.692000E+01 -1677 1 1.319000E+01 2.623000E+01 3.686000E+01 -1678 1 2.803000E+01 2.920000E+01 3.413000E+01 -1679 1 2.336000E+01 1.011000E+01 1.954000E+01 -1680 1 2.556000E+01 1.220000E+01 3.832000E+01 -1681 1 2.229000E+01 2.916000E+01 2.311000E+01 -1682 1 3.942000E+01 3.332000E+01 1.121000E+01 -1683 1 2.733000E+01 1.537000E+01 2.445000E+01 -1684 1 1.812000E+01 3.589000E+01 3.707000E+01 -1685 1 1.044000E+01 2.163000E+01 1.333000E+01 -1686 1 2.497000E+01 1.248000E+01 2.150000E+00 -1687 1 2.822000E+01 2.474000E+01 8.800000E-01 -1688 1 2.875000E+01 1.143000E+01 3.599000E+01 -1689 1 1.142000E+01 2.230000E+00 2.508000E+01 -1690 1 2.919000E+01 1.269000E+01 5.180000E+00 -1691 1 3.500000E+00 2.240000E+00 3.905000E+01 -1692 1 2.187000E+01 1.219000E+01 2.446000E+01 -1693 1 1.705000E+01 5.650000E+00 1.264000E+01 -1694 1 1.888000E+01 3.955000E+01 2.936000E+01 -1695 1 1.288000E+01 8.860000E+00 1.602000E+01 -1696 1 1.724000E+01 1.053000E+01 1.660000E+00 -1697 1 2.829000E+01 6.300000E-01 1.257000E+01 -1698 1 2.346000E+01 1.376000E+01 3.924000E+01 -1699 1 2.246000E+01 3.885000E+01 3.055000E+01 -1700 1 9.180000E+00 2.009000E+01 9.260000E+00 -1701 1 3.654000E+01 2.511000E+01 1.799000E+01 -1702 1 1.297000E+01 2.850000E+01 2.644000E+01 -1703 1 2.678000E+01 8.660000E+00 2.131000E+01 -1704 1 1.525000E+01 1.230000E+01 6.700000E-01 -1705 1 4.003000E+01 6.860000E+00 2.565000E+01 -1706 1 2.540000E+00 2.277000E+01 3.831000E+01 -1707 1 3.055000E+01 4.690000E+00 1.134000E+01 -1708 1 9.390000E+00 8.790000E+00 1.818000E+01 -1709 1 2.059000E+01 4.900000E-01 1.360000E+00 -1710 1 2.695000E+01 3.643000E+01 1.245000E+01 -1711 1 2.780000E+00 2.471000E+01 6.670000E+00 -1712 1 3.233000E+01 4.870000E+00 3.930000E+01 -1713 1 3.906000E+01 1.200000E+00 2.692000E+01 -1714 1 2.170000E+01 1.590000E+00 2.602000E+01 -1715 1 1.250000E+01 6.840000E+00 2.030000E+00 -1716 1 2.013000E+01 2.539000E+01 3.270000E+00 -1717 1 2.575000E+01 2.447000E+01 3.931000E+01 -1718 1 2.806000E+01 3.913000E+01 6.600000E+00 -1719 1 3.321000E+01 1.275000E+01 6.310000E+00 -1720 1 1.335000E+01 1.245000E+01 1.926000E+01 -1721 1 2.568000E+01 3.640000E+01 7.660000E+00 -1722 1 9.700000E-01 1.674000E+01 2.402000E+01 -1723 1 3.637000E+01 1.364000E+01 3.056000E+01 -1724 1 1.406000E+01 3.772000E+01 3.148000E+01 -1725 1 3.019000E+01 2.769000E+01 3.261000E+01 -1726 1 3.516000E+01 3.715000E+01 3.827000E+01 -1727 1 1.748000E+01 1.960000E+01 1.160000E+01 -1728 1 1.846000E+01 2.165000E+01 9.830000E+00 -1729 1 2.400000E+01 1.108000E+01 9.510000E+00 -1730 1 2.802000E+01 2.607000E+01 2.209000E+01 -1731 1 1.259000E+01 1.397000E+01 3.003000E+01 -1732 1 2.862000E+01 4.430000E+00 2.085000E+01 -1733 1 4.460000E+00 3.632000E+01 1.409000E+01 -1734 1 3.450000E+01 2.260000E+00 2.344000E+01 -1735 1 1.382000E+01 1.144000E+01 1.661000E+01 -1736 1 5.300000E-01 2.182000E+01 3.018000E+01 -1737 1 4.340000E+00 3.899000E+01 1.785000E+01 -1738 1 1.810000E+00 3.137000E+01 1.155000E+01 -1739 1 1.918000E+01 1.017000E+01 3.683000E+01 -1740 1 9.850000E+00 1.740000E+01 2.490000E+00 -1741 1 1.590000E+01 2.014000E+01 2.892000E+01 -1742 1 3.247000E+01 3.502000E+01 1.348000E+01 -1743 1 4.860000E+00 2.190000E+00 2.418000E+01 -1744 1 3.659000E+01 7.050000E+00 5.770000E+00 -1745 1 2.973000E+01 3.784000E+01 2.522000E+01 -1746 1 2.486000E+01 1.655000E+01 6.790000E+00 -1747 1 6.670000E+00 4.340000E+00 9.500000E-01 -1748 1 1.712000E+01 1.086000E+01 1.260000E+01 -1749 1 6.540000E+00 3.900000E-01 1.445000E+01 -1750 1 3.619000E+01 1.766000E+01 1.223000E+01 -1751 1 1.913000E+01 1.603000E+01 2.980000E+01 -1752 1 1.849000E+01 3.419000E+01 2.948000E+01 -1753 1 2.348000E+01 3.249000E+01 2.717000E+01 -1754 1 2.548000E+01 5.370000E+00 2.971000E+01 -1755 1 2.172000E+01 3.547000E+01 2.350000E+00 -1756 1 1.574000E+01 8.970000E+00 2.768000E+01 -1757 1 2.262000E+01 1.982000E+01 9.520000E+00 -1758 1 2.746000E+01 1.683000E+01 1.884000E+01 -1759 1 1.144000E+01 3.645000E+01 3.426000E+01 -1760 1 3.298000E+01 2.106000E+01 3.349000E+01 -1761 1 5.250000E+00 1.928000E+01 3.035000E+01 -1762 1 6.300000E-01 1.250000E+01 2.530000E+01 -1763 1 9.400000E-01 1.665000E+01 1.941000E+01 -1764 1 1.082000E+01 2.477000E+01 2.503000E+01 -1765 1 2.280000E+00 2.330000E+00 2.390000E+00 -1766 1 4.002000E+01 4.001000E+01 2.991000E+01 -1767 1 1.660000E+01 3.330000E+00 2.148000E+01 -1768 1 1.935000E+01 6.840000E+00 1.167000E+01 -1769 1 1.072000E+01 1.611000E+01 2.903000E+01 -1770 1 2.711000E+01 3.258000E+01 3.736000E+01 -1771 1 2.850000E+01 7.330000E+00 3.782000E+01 -1772 1 2.094000E+01 3.183000E+01 2.010000E+00 -1773 1 1.675000E+01 1.975000E+01 2.478000E+01 -1774 1 7.740000E+00 1.220000E+00 3.048000E+01 -1775 1 1.595000E+01 4.029000E+01 1.457000E+01 -1776 1 3.644000E+01 1.568000E+01 7.500000E+00 -1777 1 3.895000E+01 2.472000E+01 4.001000E+01 -1778 1 1.380000E+00 1.794000E+01 2.928000E+01 -1779 1 3.220000E+00 3.290000E+01 8.260000E+00 -1780 1 3.617000E+01 3.785000E+01 1.173000E+01 -1781 1 1.069000E+01 1.774000E+01 2.524000E+01 -1782 1 1.614000E+01 1.690000E+00 2.742000E+01 -1783 1 2.514000E+01 1.900000E+01 3.252000E+01 -1784 1 1.745000E+01 2.930000E+01 2.496000E+01 -1785 1 3.321000E+01 4.022000E+01 8.670000E+00 -1786 1 2.966000E+01 3.301000E+01 3.181000E+01 -1787 1 1.331000E+01 1.131000E+01 2.400000E+00 -1788 1 8.890000E+00 1.479000E+01 2.137000E+01 -1789 1 3.566000E+01 3.528000E+01 3.652000E+01 -1790 1 3.735000E+01 1.192000E+01 1.096000E+01 -1791 1 3.360000E+01 2.954000E+01 4.820000E+00 -1792 1 1.115000E+01 2.559000E+01 3.225000E+01 -1793 1 3.132000E+01 2.833000E+01 3.790000E+01 -1794 1 1.190000E+00 1.581000E+01 7.000000E-01 -1795 1 1.856000E+01 2.268000E+01 1.798000E+01 -1796 1 3.294000E+01 4.810000E+00 3.516000E+01 -1797 1 3.802000E+01 1.726000E+01 1.693000E+01 -1798 1 2.040000E+01 3.594000E+01 4.023000E+01 -1799 1 9.300000E+00 2.855000E+01 3.863000E+01 -1800 1 9.360000E+00 1.686000E+01 3.854000E+01 -1801 1 1.280000E+01 6.540000E+00 2.445000E+01 -1802 1 2.370000E+00 4.027000E+01 1.901000E+01 -1803 1 2.906000E+01 1.402000E+01 5.900000E-01 -1804 1 1.776000E+01 1.308000E+01 1.941000E+01 -1805 1 2.507000E+01 2.350000E+00 3.028000E+01 -1806 1 3.982000E+01 2.348000E+01 1.195000E+01 -1807 1 3.519000E+01 2.357000E+01 2.474000E+01 -1808 1 3.429000E+01 8.730000E+00 6.230000E+00 -1809 1 1.530000E+00 2.867000E+01 1.236000E+01 -1810 1 6.780000E+00 3.438000E+01 3.128000E+01 -1811 1 2.726000E+01 1.453000E+01 3.880000E+01 -1812 1 1.550000E+01 1.497000E+01 3.016000E+01 -1813 1 8.100000E+00 1.239000E+01 3.094000E+01 -1814 1 2.568000E+01 3.996000E+01 2.365000E+01 -1815 1 1.689000E+01 3.979000E+01 3.122000E+01 -1816 1 5.090000E+00 1.760000E+01 1.576000E+01 -1817 1 1.208000E+01 7.970000E+00 1.855000E+01 -1818 1 3.058000E+01 1.607000E+01 3.210000E+01 -1819 1 2.125000E+01 1.535000E+01 3.423000E+01 -1820 1 3.765000E+01 2.319000E+01 3.189000E+01 -1821 1 3.334000E+01 8.090000E+00 1.414000E+01 -1822 1 1.188000E+01 2.877000E+01 3.491000E+01 -1823 1 3.550000E+01 3.490000E+01 4.560000E+00 -1824 1 3.913000E+01 3.114000E+01 3.342000E+01 -1825 1 1.413000E+01 6.370000E+00 1.086000E+01 -1826 1 3.283000E+01 3.270000E+01 2.100000E-01 -1827 1 1.939000E+01 3.919000E+01 1.671000E+01 -1828 1 2.796000E+01 7.160000E+00 1.817000E+01 -1829 1 3.993000E+01 7.720000E+00 2.884000E+01 -1830 1 2.421000E+01 1.850000E+01 2.216000E+01 -1831 1 2.020000E+01 2.950000E+01 6.580000E+00 -1832 1 2.442000E+01 1.847000E+01 1.490000E+01 -1833 1 1.147000E+01 3.184000E+01 3.898000E+01 -1834 1 4.028000E+01 8.290000E+00 3.143000E+01 -1835 1 2.108000E+01 2.404000E+01 1.882000E+01 -1836 1 3.810000E+01 1.056000E+01 4.260000E+00 -1837 1 3.573000E+01 1.000000E+00 5.380000E+00 -1838 1 2.222000E+01 2.716000E+01 9.020000E+00 -1839 1 3.159000E+01 3.808000E+01 9.170000E+00 -1840 1 3.800000E-01 3.962000E+01 1.735000E+01 -1841 1 1.787000E+01 3.647000E+01 1.850000E+01 -1842 1 2.036000E+01 3.717000E+01 2.874000E+01 -1843 1 2.341000E+01 8.270000E+00 1.640000E+01 -1844 1 3.000000E-02 3.900000E+00 1.260000E+00 -1845 1 2.710000E+01 8.220000E+00 4.250000E+00 -1846 1 2.366000E+01 1.866000E+01 8.300000E-01 -1847 1 1.576000E+01 8.180000E+00 3.938000E+01 -1848 1 3.188000E+01 3.540000E+00 2.061000E+01 -1849 1 1.290000E+01 1.954000E+01 3.000000E+01 -1850 1 1.485000E+01 1.040000E+00 2.991000E+01 -1851 1 1.851000E+01 3.678000E+01 2.594000E+01 -1852 1 2.624000E+01 3.060000E+00 1.558000E+01 -1853 1 3.924000E+01 3.449000E+01 1.527000E+01 -1854 1 3.210000E+00 6.620000E+00 6.430000E+00 -1855 1 5.410000E+00 1.136000E+01 3.553000E+01 -1856 1 3.661000E+01 3.311000E+01 2.536000E+01 -1857 1 5.570000E+00 8.200000E-01 3.565000E+01 -1858 1 1.049000E+01 3.328000E+01 3.019000E+01 -1859 1 7.730000E+00 1.702000E+01 2.246000E+01 -1860 1 3.585000E+01 1.798000E+01 6.350000E+00 -1861 1 2.886000E+01 3.490000E+00 4.270000E+00 -1862 1 2.747000E+01 3.870000E+01 3.198000E+01 -1863 1 1.700000E+00 3.540000E+01 4.007000E+01 -1864 1 5.500000E-01 1.921000E+01 1.775000E+01 -1865 1 2.096000E+01 3.016000E+01 1.527000E+01 -1866 1 1.844000E+01 1.621000E+01 3.494000E+01 -1867 1 3.465000E+01 3.493000E+01 2.428000E+01 -1868 1 1.211000E+01 2.377000E+01 1.886000E+01 -1869 1 3.870000E+01 3.101000E+01 2.706000E+01 -1870 1 3.814000E+01 1.502000E+01 2.090000E+01 -1871 1 2.744000E+01 6.160000E+00 1.375000E+01 -1872 1 3.002000E+01 3.709000E+01 3.162000E+01 -1873 1 1.150000E+00 2.778000E+01 2.136000E+01 -1874 1 3.644000E+01 1.673000E+01 3.066000E+01 -1875 1 1.287000E+01 2.362000E+01 3.770000E+01 -1876 1 1.185000E+01 3.817000E+01 1.808000E+01 -1877 1 2.347000E+01 3.306000E+01 9.350000E+00 -1878 1 1.964000E+01 9.700000E-01 4.610000E+00 -1879 1 7.420000E+00 3.815000E+01 3.236000E+01 -1880 1 2.014000E+01 3.887000E+01 1.179000E+01 -1881 1 3.820000E+00 5.500000E+00 2.936000E+01 -1882 1 9.780000E+00 1.925000E+01 3.726000E+01 -1883 1 3.490000E+00 2.258000E+01 1.048000E+01 -1884 1 2.490000E+00 4.002000E+01 3.716000E+01 -1885 1 2.331000E+01 3.465000E+01 3.216000E+01 -1886 1 3.424000E+01 3.044000E+01 7.240000E+00 -1887 1 3.263000E+01 2.463000E+01 9.450000E+00 -1888 1 1.900000E+01 3.387000E+01 3.913000E+01 -1889 1 1.298000E+01 2.100000E+01 2.478000E+01 -1890 1 4.660000E+00 1.164000E+01 2.001000E+01 -1891 1 8.660000E+00 1.968000E+01 3.490000E+00 -1892 1 3.391000E+01 3.492000E+01 8.690000E+00 -1893 1 1.517000E+01 3.302000E+01 1.216000E+01 -1894 1 6.180000E+00 3.916000E+01 2.259000E+01 -1895 1 1.852000E+01 2.288000E+01 3.203000E+01 -1896 1 1.905000E+01 3.223000E+01 6.490000E+00 -1897 1 9.770000E+00 1.761000E+01 1.277000E+01 -1898 1 2.610000E+01 3.758000E+01 2.540000E+01 -1899 1 2.390000E+00 3.675000E+01 1.053000E+01 -1900 1 8.360000E+00 1.743000E+01 6.530000E+00 -1901 1 2.823000E+01 1.711000E+01 2.806000E+01 -1902 1 5.350000E+00 6.730000E+00 2.541000E+01 -1903 1 3.550000E+01 1.965000E+01 2.970000E+00 -1904 1 3.121000E+01 2.204000E+01 1.890000E+00 -1905 1 1.863000E+01 9.320000E+00 1.485000E+01 -1906 1 2.233000E+01 3.000000E-02 4.780000E+00 -1907 1 2.608000E+01 3.149000E+01 5.060000E+00 -1908 1 3.112000E+01 1.725000E+01 2.705000E+01 -1909 1 1.776000E+01 3.282000E+01 3.413000E+01 -1910 1 2.572000E+01 7.650000E+00 2.505000E+01 -1911 1 6.210000E+00 6.950000E+00 2.819000E+01 -1912 1 4.017000E+01 1.496000E+01 1.018000E+01 -1913 1 1.221000E+01 1.925000E+01 1.672000E+01 -1914 1 2.248000E+01 3.717000E+01 1.079000E+01 -1915 1 1.144000E+01 3.481000E+01 1.522000E+01 -1916 1 1.109000E+01 3.150000E+01 9.400000E+00 -1917 1 7.050000E+00 1.754000E+01 1.385000E+01 -1918 1 1.539000E+01 3.066000E+01 3.746000E+01 -1919 1 9.780000E+00 2.493000E+01 1.945000E+01 -1920 1 2.155000E+01 2.014000E+01 3.036000E+01 -1921 1 2.627000E+01 1.994000E+01 1.207000E+01 -1922 1 1.927000E+01 7.270000E+00 1.826000E+01 -1923 1 1.879000E+01 3.570000E+01 3.430000E+01 -1924 1 2.097000E+01 1.404000E+01 2.410000E+00 -1925 1 7.430000E+00 3.211000E+01 2.874000E+01 -1926 1 3.223000E+01 2.498000E+01 1.243000E+01 -1927 1 3.034000E+01 2.710000E+01 2.332000E+01 -1928 1 2.535000E+01 2.886000E+01 1.108000E+01 -1929 1 2.469000E+01 1.790000E+01 9.410000E+00 -1930 1 2.729000E+01 1.739000E+01 3.872000E+01 -1931 1 1.462000E+01 1.766000E+01 1.618000E+01 -1932 1 2.636000E+01 2.520000E+00 3.791000E+01 -1933 1 3.723000E+01 1.258000E+01 3.390000E+01 -1934 1 2.390000E+00 3.449000E+01 6.190000E+00 -1935 1 3.512000E+01 2.505000E+01 3.450000E+00 -1936 1 1.540000E+01 1.715000E+01 3.580000E+00 -1937 1 2.794000E+01 4.620000E+00 1.701000E+01 -1938 1 3.736000E+01 2.940000E+01 4.100000E+00 -1939 1 8.540000E+00 3.099000E+01 3.167000E+01 -1940 1 3.295000E+01 9.760000E+00 3.737000E+01 -1941 1 3.131000E+01 1.453000E+01 2.660000E+00 -1942 1 3.097000E+01 2.230000E+00 4.007000E+01 -1943 1 2.284000E+01 1.487000E+01 1.404000E+01 -1944 1 1.652000E+01 7.380000E+00 3.470000E+01 -1945 1 3.885000E+01 1.276000E+01 3.047000E+01 -1946 1 2.190000E+01 3.253000E+01 3.989000E+01 -1947 1 9.730000E+00 2.930000E+01 2.916000E+01 -1948 1 9.940000E+00 2.907000E+01 4.120000E+00 -1949 1 1.190000E+00 1.979000E+01 2.460000E+01 -1950 1 9.110000E+00 3.736000E+01 2.585000E+01 -1951 1 1.398000E+01 3.498000E+01 1.410000E+01 -1952 1 2.461000E+01 4.540000E+00 3.690000E+01 -1953 1 2.442000E+01 1.181000E+01 3.066000E+01 -1954 1 1.450000E+01 3.678000E+01 1.617000E+01 -1955 1 4.290000E+00 3.034000E+01 1.083000E+01 -1956 1 3.091000E+01 3.558000E+01 1.665000E+01 -1957 1 3.978000E+01 2.183000E+01 5.820000E+00 -1958 1 2.088000E+01 1.798000E+01 6.000000E-02 -1959 1 1.122000E+01 1.952000E+01 1.430000E+00 -1960 1 2.802000E+01 7.800000E-01 3.607000E+01 -1961 1 4.170000E+00 1.698000E+01 5.000000E-02 -1962 1 2.842000E+01 1.480000E+01 3.340000E+00 -1963 1 2.181000E+01 7.510000E+00 3.770000E+00 -1964 1 3.611000E+01 2.040000E+01 1.695000E+01 -1965 1 3.023000E+01 3.286000E+01 1.530000E+00 -1966 1 4.480000E+00 2.643000E+01 2.905000E+01 -1967 1 1.683000E+01 3.526000E+01 3.156000E+01 -1968 1 1.940000E+00 5.440000E+00 2.230000E+01 -1969 1 9.040000E+00 3.510000E+01 1.158000E+01 -1970 1 1.770000E+01 2.642000E+01 2.703000E+01 -1971 1 3.857000E+01 2.051000E+01 3.124000E+01 -1972 1 7.100000E+00 2.992000E+01 1.491000E+01 -1973 1 5.650000E+00 3.046000E+01 2.999000E+01 -1974 1 1.350000E+01 5.300000E-01 3.686000E+01 -1975 1 3.550000E+01 9.410000E+00 2.492000E+01 -1976 1 3.505000E+01 2.131000E+01 2.675000E+01 -1977 1 1.567000E+01 1.046000E+01 3.034000E+01 -1978 1 1.478000E+01 3.745000E+01 2.196000E+01 -1979 1 3.800000E-01 3.909000E+01 2.115000E+01 -1980 1 2.131000E+01 9.730000E+00 2.169000E+01 -1981 1 1.924000E+01 2.112000E+01 1.348000E+01 -1982 1 1.861000E+01 3.049000E+01 1.008000E+01 -1983 1 3.514000E+01 5.950000E+00 1.891000E+01 -1984 1 3.828000E+01 1.015000E+01 3.113000E+01 -1985 1 2.987000E+01 9.100000E+00 3.284000E+01 -1986 1 3.806000E+01 1.669000E+01 9.930000E+00 -1987 1 3.625000E+01 3.150000E+00 3.690000E+00 -1988 1 1.120000E+01 1.831000E+01 1.908000E+01 -1989 1 1.729000E+01 1.204000E+01 3.186000E+01 -1990 1 2.065000E+01 1.251000E+01 2.196000E+01 -1991 1 3.660000E+00 1.325000E+01 3.220000E+00 -1992 1 3.760000E+01 4.830000E+00 8.060000E+00 -1993 1 3.707000E+01 5.360000E+00 3.269000E+01 -1994 1 2.071000E+01 2.979000E+01 2.930000E+01 -1995 1 5.900000E-01 3.394000E+01 1.640000E+00 -1996 1 3.053000E+01 7.920000E+00 1.475000E+01 -1997 1 1.812000E+01 1.180000E+00 1.559000E+01 -1998 1 1.635000E+01 2.170000E+00 3.428000E+01 -1999 1 3.770000E+01 1.321000E+01 1.713000E+01 -2000 1 1.345000E+01 3.422000E+01 4.590000E+00 -2001 1 6.390000E+00 7.100000E+00 1.604000E+01 -2002 1 2.936000E+01 2.284000E+01 3.840000E+01 -2003 1 2.132000E+01 1.267000E+01 1.311000E+01 -2004 1 3.830000E+00 1.482000E+01 3.601000E+01 -2005 1 3.017000E+01 3.080000E+00 3.063000E+01 -2006 1 5.670000E+00 2.356000E+01 1.549000E+01 -2007 1 2.568000E+01 1.509000E+01 2.150000E+00 -2008 1 3.750000E+01 5.240000E+00 3.576000E+01 -2009 1 4.020000E+01 6.800000E+00 3.420000E+00 -2010 1 7.520000E+00 4.850000E+00 2.242000E+01 -2011 1 9.120000E+00 1.100000E+00 1.607000E+01 -2012 1 3.420000E+01 3.660000E+00 9.460000E+00 -2013 1 1.500000E+00 4.630000E+00 1.097000E+01 -2014 1 8.710000E+00 3.340000E+00 1.196000E+01 -2015 1 1.524000E+01 4.090000E+00 3.273000E+01 -2016 1 3.619000E+01 2.718000E+01 5.430000E+00 -2017 1 3.464000E+01 3.084000E+01 1.802000E+01 -2018 1 3.812000E+01 2.797000E+01 1.283000E+01 -2019 1 1.100000E+01 3.628000E+01 3.115000E+01 -2020 1 1.196000E+01 4.770000E+00 3.605000E+01 -2021 1 2.456000E+01 1.463000E+01 2.922000E+01 -2022 1 3.370000E+00 1.203000E+01 3.398000E+01 -2023 1 2.095000E+01 1.951000E+01 1.167000E+01 -2024 1 7.290000E+00 3.550000E+00 3.223000E+01 -2025 1 1.255000E+01 2.448000E+01 7.530000E+00 -2026 1 8.020000E+00 3.410000E+00 1.872000E+01 -2027 1 1.272000E+01 2.208000E+01 1.634000E+01 -2028 1 2.495000E+01 7.100000E-01 1.731000E+01 -2029 1 1.877000E+01 6.440000E+00 3.718000E+01 -2030 1 1.307000E+01 3.171000E+01 2.130000E+01 -2031 1 7.780000E+00 2.693000E+01 4.990000E+00 -2032 1 2.468000E+01 1.657000E+01 4.060000E+00 -2033 1 1.011000E+01 2.092000E+01 2.196000E+01 -2034 1 1.853000E+01 2.212000E+01 7.060000E+00 -2035 1 1.012000E+01 5.650000E+00 4.570000E+00 -2036 1 3.418000E+01 1.482000E+01 2.907000E+01 -2037 1 3.052000E+01 1.917000E+01 2.514000E+01 -2038 1 3.050000E+01 8.230000E+00 1.743000E+01 -2039 1 3.790000E+00 1.501000E+01 1.572000E+01 -2040 1 6.640000E+00 4.770000E+00 3.640000E+01 -2041 1 7.250000E+00 1.136000E+01 3.650000E+00 -2042 1 3.843000E+01 1.134000E+01 2.400000E-01 -2043 1 1.824000E+01 2.348000E+01 2.447000E+01 -2044 1 3.782000E+01 4.890000E+00 2.427000E+01 -2045 1 1.455000E+01 3.351000E+01 8.510000E+00 -2046 1 1.213000E+01 1.013000E+01 5.290000E+00 -2047 1 1.491000E+01 3.854000E+01 7.660000E+00 -2048 1 3.424000E+01 1.661000E+01 2.545000E+01 -2049 1 6.710000E+00 3.793000E+01 1.432000E+01 -2050 1 3.840000E+00 1.933000E+01 2.429000E+01 -2051 1 5.700000E-01 3.471000E+01 2.379000E+01 -2052 1 3.556000E+01 3.795000E+01 2.740000E+01 -2053 1 6.480000E+00 1.991000E+01 2.495000E+01 -2054 1 3.000000E+01 2.298000E+01 2.647000E+01 -2055 1 1.057000E+01 1.534000E+01 1.510000E+01 -2056 1 6.830000E+00 1.818000E+01 3.757000E+01 -2057 1 1.961000E+01 2.792000E+01 4.360000E+00 -2058 1 1.999000E+01 1.749000E+01 3.711000E+01 -2059 1 6.520000E+00 3.406000E+01 1.856000E+01 -2060 1 2.003000E+01 4.008000E+01 7.370000E+00 -2061 1 1.647000E+01 1.287000E+01 3.846000E+01 -2062 1 1.188000E+01 2.675000E+01 3.140000E+00 -2063 1 3.070000E+01 8.620000E+00 1.174000E+01 -2064 1 7.650000E+00 2.423000E+01 2.152000E+01 -2065 1 3.066000E+01 1.515000E+01 1.777000E+01 -2066 1 9.030000E+00 2.920000E+01 1.074000E+01 -2067 1 2.170000E+01 5.990000E+00 1.078000E+01 -2068 1 2.112000E+01 6.610000E+00 2.084000E+01 -2069 1 1.844000E+01 1.560000E+01 3.228000E+01 -2070 1 8.050000E+00 2.401000E+01 2.487000E+01 -2071 1 1.931000E+01 1.304000E+01 3.612000E+01 -2072 1 3.055000E+01 3.181000E+01 1.144000E+01 -2073 1 2.670000E+01 3.999000E+01 1.013000E+01 -2074 1 3.010000E+00 3.455000E+01 1.576000E+01 -2075 1 1.197000E+01 3.352000E+01 1.999000E+01 -2076 1 7.530000E+00 3.550000E+01 2.745000E+01 -2077 1 6.260000E+00 2.133000E+01 3.595000E+01 -2078 1 3.640000E+00 1.123000E+01 1.010000E+01 -2079 1 3.208000E+01 3.646000E+01 2.263000E+01 -2080 1 2.974000E+01 3.693000E+01 2.101000E+01 -2081 1 3.843000E+01 1.063000E+01 1.834000E+01 -2082 1 1.259000E+01 1.919000E+01 2.240000E+01 -2083 1 1.861000E+01 3.866000E+01 3.746000E+01 -2084 1 3.072000E+01 2.510000E+00 2.531000E+01 -2085 1 1.811000E+01 3.599000E+01 7.630000E+00 -2086 1 1.513000E+01 4.009000E+01 3.336000E+01 -2087 1 1.111000E+01 1.203000E+01 7.930000E+00 -2088 1 1.400000E+01 2.710000E+00 4.600000E-01 -2089 1 8.820000E+00 7.960000E+00 3.614000E+01 -2090 1 2.054000E+01 3.935000E+01 3.947000E+01 -2091 1 4.016000E+01 3.491000E+01 4.170000E+00 -2092 1 5.450000E+00 7.670000E+00 1.850000E+01 -2093 1 2.836000E+01 1.260000E+01 2.475000E+01 -2094 1 3.201000E+01 2.872000E+01 2.179000E+01 -2095 1 3.032000E+01 1.611000E+01 2.945000E+01 -2096 1 2.493000E+01 2.700000E+01 2.410000E+01 -2097 1 2.096000E+01 3.122000E+01 2.710000E+01 -2098 1 1.995000E+01 1.826000E+01 3.333000E+01 -2099 1 1.625000E+01 3.130000E+01 8.000000E+00 -2100 1 1.063000E+01 1.206000E+01 1.804000E+01 -2101 1 1.247000E+01 1.196000E+01 3.214000E+01 -2102 1 3.433000E+01 3.517000E+01 1.640000E+01 -2103 1 2.322000E+01 3.050000E+00 1.655000E+01 -2104 1 3.519000E+01 8.700000E-01 3.234000E+01 -2105 1 1.722000E+01 1.723000E+01 1.978000E+01 -2106 1 2.480000E+01 3.750000E+01 6.700000E-01 -2107 1 3.973000E+01 3.731000E+01 2.819000E+01 -2108 1 1.546000E+01 1.690000E+01 2.411000E+01 -2109 1 1.067000E+01 1.007000E+01 1.075000E+01 -2110 1 3.864000E+01 1.058000E+01 2.272000E+01 -2111 1 3.115000E+01 9.980000E+00 2.317000E+01 -2112 1 2.253000E+01 1.992000E+01 1.380000E+01 -2113 1 1.176000E+01 1.405000E+01 3.903000E+01 -2114 1 1.018000E+01 9.280000E+00 8.030000E+00 -2115 1 1.445000E+01 2.184000E+01 3.200000E+01 -2116 1 1.692000E+01 2.470000E+01 1.871000E+01 -2117 1 2.841000E+01 2.090000E+01 1.081000E+01 -2118 1 1.582000E+01 9.670000E+00 1.823000E+01 -2119 1 3.260000E+00 4.080000E+00 3.358000E+01 -2120 1 3.262000E+01 2.107000E+01 3.990000E+00 -2121 1 1.652000E+01 1.218000E+01 3.564000E+01 -2122 1 2.648000E+01 2.505000E+01 2.501000E+01 -2123 1 3.168000E+01 8.160000E+00 2.482000E+01 -2124 1 1.468000E+01 1.968000E+01 2.087000E+01 -2125 1 1.103000E+01 2.608000E+01 6.010000E+00 -2126 1 1.102000E+01 1.184000E+01 2.603000E+01 -2127 1 3.776000E+01 3.770000E+00 1.490000E+00 -2128 1 2.031000E+01 2.734000E+01 6.700000E-01 -2129 1 3.770000E+00 3.563000E+01 4.170000E+00 -2130 1 4.490000E+00 2.167000E+01 1.302000E+01 -2131 1 3.730000E+00 2.565000E+01 1.098000E+01 -2132 1 3.893000E+01 2.628000E+01 3.085000E+01 -2133 1 1.716000E+01 7.780000E+00 1.678000E+01 -2134 1 3.330000E+01 3.916000E+01 1.899000E+01 -2135 1 3.264000E+01 4.210000E+00 2.427000E+01 -2136 1 1.114000E+01 8.100000E+00 2.329000E+01 -2137 1 1.026000E+01 8.900000E-01 2.724000E+01 -2138 1 2.257000E+01 2.754000E+01 3.789000E+01 -2139 1 2.495000E+01 2.840000E+01 3.687000E+01 -2140 1 3.977000E+01 2.981000E+01 5.800000E+00 -2141 1 2.256000E+01 3.840000E+00 6.270000E+00 -2142 1 7.580000E+00 1.410000E+01 3.520000E+00 -2143 1 1.702000E+01 3.918000E+01 9.200000E+00 -2144 1 2.898000E+01 1.973000E+01 3.924000E+01 -2145 1 4.020000E+01 1.529000E+01 2.723000E+01 -2146 1 7.220000E+00 2.652000E+01 2.819000E+01 -2147 1 1.020000E+01 4.510000E+00 2.913000E+01 -2148 1 1.075000E+01 1.786000E+01 8.600000E+00 -2149 1 2.851000E+01 6.170000E+00 2.682000E+01 -2150 1 1.450000E+00 2.132000E+01 4.020000E+00 -2151 1 4.360000E+00 1.142000E+01 4.500000E-01 -2152 1 6.800000E+00 2.136000E+01 2.166000E+01 -2153 1 1.803000E+01 3.907000E+01 4.900000E+00 -2154 1 3.187000E+01 1.368000E+01 1.983000E+01 -2155 1 3.040000E+01 9.820000E+00 3.786000E+01 -2156 1 3.694000E+01 5.550000E+00 1.614000E+01 -2157 1 1.520000E+00 2.840000E+00 7.180000E+00 -2158 1 7.550000E+00 3.788000E+01 1.150000E+00 -2159 1 3.262000E+01 8.680000E+00 1.004000E+01 -2160 1 9.400000E+00 1.616000E+01 1.029000E+01 -2161 1 5.980000E+00 1.628000E+01 2.001000E+01 -2162 1 1.590000E+00 2.898000E+01 2.510000E+00 -2163 1 2.260000E+00 2.503000E+01 2.702000E+01 -2164 1 3.725000E+01 2.886000E+01 1.681000E+01 -2165 1 1.751000E+01 3.490000E+01 2.327000E+01 -2166 1 2.729000E+01 1.952000E+01 2.661000E+01 -2167 1 8.190000E+00 3.201000E+01 2.417000E+01 -2168 1 7.080000E+00 2.577000E+01 1.091000E+01 -2169 1 3.065000E+01 6.030000E+00 2.910000E+00 -2170 1 2.078000E+01 1.994000E+01 1.970000E+01 -2171 1 7.100000E-01 7.250000E+00 1.784000E+01 -2172 1 3.287000E+01 8.740000E+00 1.891000E+01 -2173 1 1.178000E+01 2.800000E+01 1.470000E+01 -2174 1 2.178000E+01 2.015000E+01 3.462000E+01 -2175 1 3.874000E+01 1.992000E+01 1.613000E+01 -2176 1 3.554000E+01 3.239000E+01 3.856000E+01 -2177 1 1.772000E+01 4.020000E+01 1.210000E+00 -2178 1 2.093000E+01 1.558000E+01 2.323000E+01 -2179 1 8.900000E+00 2.592000E+01 3.849000E+01 -2180 1 1.428000E+01 6.460000E+00 3.351000E+01 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data b/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data new file mode 120000 index 0000000000..da2da72a38 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce.data @@ -0,0 +1 @@ +../dpd_tstat/cg_spce.data \ No newline at end of file diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot b/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot deleted file mode 100644 index 853ff4bec0..0000000000 --- a/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot +++ /dev/null @@ -1,354 +0,0 @@ -VOTCA -N 351 R 2.0 9.0 - -1 2.000000E+00 2.190202E+01 7.229762E+01 -2 2.020000E+00 2.048957E+01 6.887333E+01 -3 2.040000E+00 1.915004E+01 6.500604E+01 -4 2.060000E+00 1.789228E+01 6.069573E+01 -5 2.080000E+00 1.672516E+01 5.594242E+01 -6 2.100000E+00 1.565754E+01 5.074609E+01 -7 2.120000E+00 1.467088E+01 4.787307E+01 -8 2.140000E+00 1.374450E+01 4.471740E+01 -9 2.160000E+00 1.288407E+01 4.127908E+01 -10 2.180000E+00 1.209522E+01 3.755811E+01 -11 2.200000E+00 1.138363E+01 3.355449E+01 -12 2.220000E+00 1.072913E+01 3.188695E+01 -13 2.240000E+00 1.010845E+01 3.017359E+01 -14 2.260000E+00 9.522496E+00 2.841440E+01 -15 2.280000E+00 8.972182E+00 2.660938E+01 -16 2.300000E+00 8.458426E+00 2.475854E+01 -17 2.320000E+00 8.014166E+00 2.006698E+01 -18 2.340000E+00 7.639767E+00 1.777244E+01 -19 2.360000E+00 7.287288E+00 1.787493E+01 -20 2.380000E+00 6.908790E+00 2.037445E+01 -21 2.400000E+00 6.456330E+00 2.527099E+01 -22 2.420000E+00 5.858025E+00 3.384695E+01 -23 2.440000E+00 5.130955E+00 3.814748E+01 -24 2.460000E+00 4.360629E+00 3.817257E+01 -25 2.480000E+00 3.632555E+00 3.392224E+01 -26 2.500000E+00 3.032242E+00 2.539647E+01 -27 2.520000E+00 2.547993E+00 2.297813E+01 -28 2.540000E+00 2.115131E+00 2.025763E+01 -29 2.560000E+00 1.739702E+00 1.723497E+01 -30 2.580000E+00 1.427747E+00 1.391013E+01 -31 2.600000E+00 1.185311E+00 1.028314E+01 -32 2.620000E+00 9.860176E-01 9.578245E+00 -33 2.640000E+00 8.048986E-01 8.465708E+00 -34 2.660000E+00 6.501069E-01 6.945526E+00 -35 2.680000E+00 5.297952E-01 5.017699E+00 -36 2.700000E+00 4.521166E-01 2.682227E+00 -37 2.720000E+00 3.986447E-01 2.615311E+00 -38 2.740000E+00 3.494900E-01 2.250522E+00 -39 2.760000E+00 3.106097E-01 1.587859E+00 -40 2.780000E+00 2.879614E-01 6.273237E-01 -41 2.800000E+00 2.875026E-01 -6.310851E-01 -42 2.820000E+00 3.002733E-01 -6.543549E-01 -43 2.840000E+00 3.140112E-01 -7.277911E-01 -44 2.860000E+00 3.297194E-01 -8.513935E-01 -45 2.880000E+00 3.484014E-01 -1.025162E+00 -46 2.900000E+00 3.710604E-01 -1.249097E+00 -47 2.920000E+00 3.974884E-01 -1.380483E+00 -48 2.940000E+00 4.257507E-01 -1.432530E+00 -49 2.960000E+00 4.542607E-01 -1.405240E+00 -50 2.980000E+00 4.814314E-01 -1.298611E+00 -51 3.000000E+00 5.056762E-01 -1.112645E+00 -52 3.020000E+00 5.266502E-01 -9.832894E-01 -53 3.040000E+00 5.449492E-01 -8.451544E-01 -54 3.060000E+00 5.603978E-01 -6.982396E-01 -55 3.080000E+00 5.728203E-01 -5.425450E-01 -56 3.100000E+00 5.820411E-01 -3.780706E-01 -57 3.120000E+00 5.882509E-01 -2.409307E-01 -58 3.140000E+00 5.915991E-01 -9.190908E-02 -59 3.160000E+00 5.918481E-01 6.899430E-02 -60 3.180000E+00 5.887601E-01 2.417794E-01 -61 3.200000E+00 5.820977E-01 4.264463E-01 -62 3.220000E+00 5.733491E-01 4.528343E-01 -63 3.240000E+00 5.638075E-01 5.057356E-01 -64 3.260000E+00 5.529429E-01 5.851503E-01 -65 3.280000E+00 5.402248E-01 6.910784E-01 -66 3.300000E+00 5.251230E-01 8.235199E-01 -67 3.320000E+00 5.086524E-01 8.236482E-01 -68 3.340000E+00 4.921725E-01 8.244583E-01 -69 3.360000E+00 4.756696E-01 8.259503E-01 -70 3.380000E+00 4.591299E-01 8.281240E-01 -71 3.400000E+00 4.425400E-01 8.309796E-01 -72 3.420000E+00 4.259181E-01 8.311861E-01 -73 3.440000E+00 4.092937E-01 8.312292E-01 -74 3.460000E+00 3.926700E-01 8.311089E-01 -75 3.480000E+00 3.760504E-01 8.308252E-01 -76 3.500000E+00 3.594381E-01 8.303781E-01 -77 3.520000E+00 3.428394E-01 8.295412E-01 -78 3.540000E+00 3.262547E-01 8.289646E-01 -79 3.560000E+00 3.096790E-01 8.286483E-01 -80 3.580000E+00 2.931071E-01 8.285923E-01 -81 3.600000E+00 2.765336E-01 8.287966E-01 -82 3.620000E+00 2.599901E-01 8.254306E-01 -83 3.640000E+00 2.435212E-01 8.213359E-01 -84 3.660000E+00 2.271415E-01 8.165124E-01 -85 3.680000E+00 2.108656E-01 8.109603E-01 -86 3.700000E+00 1.947080E-01 8.046794E-01 -87 3.720000E+00 1.790243E-01 7.653050E-01 -88 3.740000E+00 1.640312E-01 7.356166E-01 -89 3.760000E+00 1.495351E-01 7.156143E-01 -90 3.780000E+00 1.353421E-01 7.052980E-01 -91 3.800000E+00 1.212586E-01 7.046676E-01 -92 3.820000E+00 1.072429E-01 6.965706E-01 -93 3.840000E+00 9.340878E-02 6.865180E-01 -94 3.860000E+00 7.979524E-02 6.745098E-01 -95 3.880000E+00 6.644142E-02 6.605462E-01 -96 3.900000E+00 5.338643E-02 6.446270E-01 -97 3.920000E+00 4.067486E-02 6.268536E-01 -98 3.940000E+00 2.829935E-02 6.110218E-01 -99 3.960000E+00 1.622105E-02 5.971317E-01 -100 3.980000E+00 4.401131E-03 5.851833E-01 -101 4.000000E+00 -7.199230E-03 5.751764E-01 -102 4.020000E+00 -1.856170E-02 5.611971E-01 -103 4.040000E+00 -2.965216E-02 5.479743E-01 -104 4.060000E+00 -4.048572E-02 5.355079E-01 -105 4.080000E+00 -5.107752E-02 5.237981E-01 -106 4.100000E+00 -6.144268E-02 5.128447E-01 -107 4.120000E+00 -7.151117E-02 4.939504E-01 -108 4.140000E+00 -8.119856E-02 4.747353E-01 -109 4.160000E+00 -9.049845E-02 4.551994E-01 -110 4.180000E+00 -9.940440E-02 4.353427E-01 -111 4.200000E+00 -1.079100E-01 4.151651E-01 -112 4.220000E+00 -1.159565E-01 3.900062E-01 -113 4.240000E+00 -1.235312E-01 3.679865E-01 -114 4.260000E+00 -1.306969E-01 3.491061E-01 -115 4.280000E+00 -1.375164E-01 3.333651E-01 -116 4.300000E+00 -1.440524E-01 3.207633E-01 -117 4.320000E+00 -1.503014E-01 3.040292E-01 -118 4.340000E+00 -1.562092E-01 2.866389E-01 -119 4.360000E+00 -1.617626E-01 2.685925E-01 -120 4.380000E+00 -1.669485E-01 2.498899E-01 -121 4.400000E+00 -1.717538E-01 2.305311E-01 -122 4.420000E+00 -1.760941E-01 2.036400E-01 -123 4.440000E+00 -1.799054E-01 1.776469E-01 -124 4.460000E+00 -1.832059E-01 1.525518E-01 -125 4.480000E+00 -1.860135E-01 1.283546E-01 -126 4.500000E+00 -1.883461E-01 1.050554E-01 -127 4.520000E+00 -1.902569E-01 8.558005E-02 -128 4.540000E+00 -1.917515E-01 6.344105E-02 -129 4.560000E+00 -1.927768E-01 3.863842E-02 -130 4.580000E+00 -1.932793E-01 1.117216E-02 -131 4.600000E+00 -1.932059E-01 -1.895774E-02 -132 4.620000E+00 -1.926829E-01 -3.331832E-02 -133 4.640000E+00 -1.918741E-01 -4.753697E-02 -134 4.660000E+00 -1.907824E-01 -6.161370E-02 -135 4.680000E+00 -1.894105E-01 -7.554851E-02 -136 4.700000E+00 -1.877614E-01 -8.934140E-02 -137 4.720000E+00 -1.859159E-01 -9.580751E-02 -138 4.740000E+00 -1.839049E-01 -1.058976E-01 -139 4.760000E+00 -1.816559E-01 -1.196116E-01 -140 4.780000E+00 -1.790963E-01 -1.369495E-01 -141 4.800000E+00 -1.761537E-01 -1.579114E-01 -142 4.820000E+00 -1.728280E-01 -1.744216E-01 -143 4.840000E+00 -1.691864E-01 -1.895036E-01 -144 4.860000E+00 -1.652574E-01 -2.031575E-01 -145 4.880000E+00 -1.610696E-01 -2.153832E-01 -146 4.900000E+00 -1.566516E-01 -2.261808E-01 -147 4.920000E+00 -1.521084E-01 -2.290714E-01 -148 4.940000E+00 -1.474515E-01 -2.375453E-01 -149 4.960000E+00 -1.425693E-01 -2.516026E-01 -150 4.980000E+00 -1.373502E-01 -2.712432E-01 -151 5.000000E+00 -1.316824E-01 -2.964672E-01 -152 5.020000E+00 -1.257009E-01 -3.016666E-01 -153 5.040000E+00 -1.196162E-01 -3.067953E-01 -154 5.060000E+00 -1.134296E-01 -3.118535E-01 -155 5.080000E+00 -1.071425E-01 -3.168409E-01 -156 5.100000E+00 -1.007564E-01 -3.217577E-01 -157 5.120000E+00 -9.430843E-02 -3.230025E-01 -158 5.140000E+00 -8.783782E-02 -3.240216E-01 -159 5.160000E+00 -8.134907E-02 -3.248150E-01 -160 5.180000E+00 -7.484672E-02 -3.253827E-01 -161 5.200000E+00 -6.833527E-02 -3.257248E-01 -162 5.220000E+00 -6.171989E-02 -3.350608E-01 -163 5.240000E+00 -5.496291E-02 -3.398853E-01 -164 5.260000E+00 -4.815456E-02 -3.401983E-01 -165 5.280000E+00 -4.138506E-02 -3.359997E-01 -166 5.300000E+00 -3.474465E-02 -3.272895E-01 -167 5.320000E+00 -2.866480E-02 -2.819209E-01 -168 5.340000E+00 -2.341879E-02 -2.439062E-01 -169 5.360000E+00 -1.885953E-02 -2.132454E-01 -170 5.380000E+00 -1.483994E-02 -1.899386E-01 -171 5.400000E+00 -1.121296E-02 -1.739857E-01 -172 5.420000E+00 -7.974056E-03 -1.497398E-01 -173 5.440000E+00 -5.229953E-03 -1.245058E-01 -174 5.460000E+00 -3.000413E-03 -9.828350E-02 -175 5.480000E+00 -1.305201E-03 -7.107305E-02 -176 5.500000E+00 -1.640790E-04 -4.287441E-02 -177 5.520000E+00 6.371635E-04 -3.612657E-02 -178 5.540000E+00 1.236053E-03 -2.263906E-02 -179 5.560000E+00 1.497795E-03 -2.411882E-03 -180 5.580000E+00 1.287597E-03 2.455496E-02 -181 5.600000E+00 4.706651E-04 5.826147E-02 -182 5.620000E+00 -7.026386E-04 5.910929E-02 -183 5.640000E+00 -1.895322E-03 6.019943E-02 -184 5.660000E+00 -3.112231E-03 6.153190E-02 -185 5.680000E+00 -4.358213E-03 6.310668E-02 -186 5.700000E+00 -5.638114E-03 6.492378E-02 -187 5.720000E+00 -6.949688E-03 6.610584E-02 -188 5.740000E+00 -8.277238E-03 6.652145E-02 -189 5.760000E+00 -9.605436E-03 6.617062E-02 -190 5.780000E+00 -1.091895E-02 6.505335E-02 -191 5.800000E+00 -1.220246E-02 6.316963E-02 -192 5.820000E+00 -1.341489E-02 5.820182E-02 -193 5.840000E+00 -1.453566E-02 5.400257E-02 -194 5.860000E+00 -1.558012E-02 5.057189E-02 -195 5.880000E+00 -1.656366E-02 4.790978E-02 -196 5.900000E+00 -1.750164E-02 4.601622E-02 -197 5.920000E+00 -1.840088E-02 4.358369E-02 -198 5.940000E+00 -1.923199E-02 3.920163E-02 -199 5.960000E+00 -1.995595E-02 3.287003E-02 -200 5.980000E+00 -2.053379E-02 2.458889E-02 -201 6.000000E+00 -2.092651E-02 1.435822E-02 -202 6.020000E+00 -2.120502E-02 1.352840E-02 -203 6.040000E+00 -2.146907E-02 1.291186E-02 -204 6.060000E+00 -2.172292E-02 1.250861E-02 -205 6.080000E+00 -2.197084E-02 1.231865E-02 -206 6.100000E+00 -2.221709E-02 1.234198E-02 -207 6.120000E+00 -2.246474E-02 1.237271E-02 -208 6.140000E+00 -2.270998E-02 1.210114E-02 -209 6.160000E+00 -2.294677E-02 1.152726E-02 -210 6.180000E+00 -2.316905E-02 1.065107E-02 -211 6.200000E+00 -2.337079E-02 9.472569E-03 -212 6.220000E+00 -2.332237E-02 -1.276224E-02 -213 6.240000E+00 -2.292243E-02 -2.567822E-02 -214 6.260000E+00 -2.235736E-02 -2.927535E-02 -215 6.280000E+00 -2.181354E-02 -2.355364E-02 -216 6.300000E+00 -2.147734E-02 -8.513096E-03 -217 6.320000E+00 -2.141633E-02 1.466366E-03 -218 6.340000E+00 -2.149820E-02 5.775798E-03 -219 6.360000E+00 -2.160956E-02 4.415202E-03 -220 6.380000E+00 -2.163701E-02 -2.615423E-03 -221 6.400000E+00 -2.146714E-02 -1.531608E-02 -222 6.420000E+00 -2.107402E-02 -2.337955E-02 -223 6.440000E+00 -2.055660E-02 -2.774728E-02 -224 6.460000E+00 -1.998877E-02 -2.841924E-02 -225 6.480000E+00 -1.944446E-02 -2.539546E-02 -226 6.500000E+00 -1.899759E-02 -1.867591E-02 -227 6.520000E+00 -1.869042E-02 -1.259095E-02 -228 6.540000E+00 -1.847196E-02 -9.804901E-03 -229 6.560000E+00 -1.827623E-02 -1.031775E-02 -230 6.580000E+00 -1.803726E-02 -1.412951E-02 -231 6.600000E+00 -1.768906E-02 -2.124018E-02 -232 6.620000E+00 -1.710949E-02 -3.551655E-02 -233 6.640000E+00 -1.631641E-02 -4.259122E-02 -234 6.660000E+00 -1.545385E-02 -4.246419E-02 -235 6.680000E+00 -1.466585E-02 -3.513545E-02 -236 6.700000E+00 -1.409644E-02 -2.060502E-02 -237 6.720000E+00 -1.374966E-02 -1.461056E-02 -238 6.740000E+00 -1.349054E-02 -1.183851E-02 -239 6.760000E+00 -1.325464E-02 -1.228886E-02 -240 6.780000E+00 -1.297750E-02 -1.596163E-02 -241 6.800000E+00 -1.259469E-02 -2.285680E-02 -242 6.820000E+00 -1.213049E-02 -2.349903E-02 -243 6.840000E+00 -1.165728E-02 -2.375897E-02 -244 6.860000E+00 -1.118268E-02 -2.363664E-02 -245 6.880000E+00 -1.071436E-02 -2.313203E-02 -246 6.900000E+00 -1.025995E-02 -2.224514E-02 -247 6.920000E+00 -9.817276E-03 -2.203990E-02 -248 6.940000E+00 -9.377653E-03 -2.193988E-02 -249 6.960000E+00 -8.938979E-03 -2.194508E-02 -250 6.980000E+00 -8.499148E-03 -2.205550E-02 -251 7.000000E+00 -8.056057E-03 -2.227113E-02 -252 7.020000E+00 -7.597830E-03 -2.345789E-02 -253 7.040000E+00 -7.121492E-03 -2.408210E-02 -254 7.060000E+00 -6.638296E-03 -2.414376E-02 -255 7.080000E+00 -6.159492E-03 -2.364288E-02 -256 7.100000E+00 -5.696331E-03 -2.257946E-02 -257 7.120000E+00 -5.301441E-03 -1.729553E-02 -258 7.140000E+00 -4.989070E-03 -1.432759E-02 -259 7.160000E+00 -4.712898E-03 -1.367562E-02 -260 7.180000E+00 -4.426605E-03 -1.533964E-02 -261 7.200000E+00 -4.083872E-03 -1.931964E-02 -262 7.220000E+00 -3.631995E-03 -2.538390E-02 -263 7.240000E+00 -3.087883E-03 -2.854317E-02 -264 7.260000E+00 -2.509635E-03 -2.879748E-02 -265 7.280000E+00 -1.955351E-03 -2.614680E-02 -266 7.300000E+00 -1.483130E-03 -2.059115E-02 -267 7.320000E+00 -1.113389E-03 -1.639767E-02 -268 7.340000E+00 -8.266321E-04 -1.229279E-02 -269 7.360000E+00 -6.210869E-04 -8.276492E-03 -270 7.380000E+00 -4.949818E-04 -4.348786E-03 -271 7.400000E+00 -4.465449E-04 -5.096684E-04 -272 7.420000E+00 -5.304321E-04 8.162452E-03 -273 7.440000E+00 -7.436056E-04 1.241897E-02 -274 7.460000E+00 -9.977534E-04 1.225988E-02 -275 7.480000E+00 -1.204563E-03 7.685191E-03 -276 7.500000E+00 -1.275724E-03 -1.305104E-03 -277 7.520000E+00 -1.199415E-03 -5.916706E-03 -278 7.540000E+00 -1.055417E-03 -8.074089E-03 -279 7.560000E+00 -8.928131E-04 -7.777253E-03 -280 7.580000E+00 -7.606883E-04 -5.026198E-03 -281 7.600000E+00 -7.081267E-04 1.790768E-04 -282 7.620000E+00 -7.213835E-04 1.157786E-03 -283 7.640000E+00 -7.548855E-04 2.203601E-03 -284 7.660000E+00 -8.099749E-04 3.316523E-03 -285 7.680000E+00 -8.879938E-04 4.496550E-03 -286 7.700000E+00 -9.902843E-04 5.743685E-03 -287 7.720000E+00 -1.122403E-03 7.421734E-03 -288 7.740000E+00 -1.285295E-03 8.820936E-03 -289 7.760000E+00 -1.473382E-03 9.941291E-03 -290 7.780000E+00 -1.681087E-03 1.078280E-02 -291 7.800000E+00 -1.902835E-03 1.134546E-02 -292 7.820000E+00 -2.225281E-03 2.008573E-02 -293 7.840000E+00 -2.673724E-03 2.394500E-02 -294 7.860000E+00 -3.150542E-03 2.292328E-02 -295 7.880000E+00 -3.558115E-03 1.702056E-02 -296 7.900000E+00 -3.798824E-03 6.236836E-03 -297 7.920000E+00 -3.844315E-03 -1.142168E-03 -298 7.940000E+00 -3.774961E-03 -5.247538E-03 -299 7.960000E+00 -3.656237E-03 -6.079274E-03 -300 7.980000E+00 -3.553615E-03 -3.637376E-03 -301 8.000000E+00 -3.532566E-03 2.078155E-03 -302 8.020000E+00 -3.611956E-03 5.494873E-03 -303 8.040000E+00 -3.737724E-03 6.716053E-03 -304 8.060000E+00 -3.865961E-03 5.741694E-03 -305 8.080000E+00 -3.952755E-03 2.571796E-03 -306 8.100000E+00 -3.954196E-03 -2.793640E-03 -307 8.120000E+00 -3.873685E-03 -5.086591E-03 -308 8.140000E+00 -3.757567E-03 -6.354313E-03 -309 8.160000E+00 -3.626347E-03 -6.596805E-03 -310 8.180000E+00 -3.500530E-03 -5.814068E-03 -311 8.200000E+00 -3.400620E-03 -4.006101E-03 -312 8.220000E+00 -3.334411E-03 -2.730570E-03 -313 8.240000E+00 -3.286762E-03 -2.150229E-03 -314 8.260000E+00 -3.243768E-03 -2.265076E-03 -315 8.280000E+00 -3.191524E-03 -3.075114E-03 -316 8.300000E+00 -3.116129E-03 -4.580340E-03 -317 8.320000E+00 -2.964210E-03 -1.014102E-02 -318 8.340000E+00 -2.729309E-03 -1.287854E-02 -319 8.360000E+00 -2.467889E-03 -1.279292E-02 -320 8.380000E+00 -2.236413E-03 -9.884157E-03 -321 8.400000E+00 -2.091344E-03 -4.152240E-03 -322 8.420000E+00 -2.034875E-03 -1.692189E-03 -323 8.440000E+00 -2.015752E-03 -4.177491E-04 -324 8.460000E+00 -2.010261E-03 -3.289192E-04 -325 8.480000E+00 -1.994691E-03 -1.425700E-03 -326 8.500000E+00 -1.945329E-03 -3.708091E-03 -327 8.520000E+00 -1.867098E-03 -4.115259E-03 -328 8.540000E+00 -1.780711E-03 -4.523663E-03 -329 8.560000E+00 -1.686143E-03 -4.933304E-03 -330 8.580000E+00 -1.583370E-03 -5.344181E-03 -331 8.600000E+00 -1.472368E-03 -5.756296E-03 -332 8.620000E+00 -1.328792E-03 -8.394009E-03 -333 8.640000E+00 -1.144899E-03 -9.787974E-03 -334 8.660000E+00 -9.455644E-04 -9.938189E-03 -335 8.680000E+00 -7.556630E-04 -8.844656E-03 -336 8.700000E+00 -6.000698E-04 -6.507373E-03 -337 8.720000E+00 -5.364035E-04 -3.286769E-04 -338 8.740000E+00 -5.681458E-04 3.033482E-03 -339 8.760000E+00 -6.389659E-04 3.579102E-03 -340 8.780000E+00 -6.925330E-04 1.308185E-03 -341 8.800000E+00 -6.725164E-04 -3.779270E-03 -342 8.820000E+00 -5.113768E-04 -1.169180E-02 -343 8.840000E+00 -2.305599E-04 -1.574700E-02 -344 8.860000E+00 9.278768E-05 -1.594487E-02 -345 8.880000E+00 3.815195E-04 -1.228542E-02 -346 8.900000E+00 5.584889E-04 -4.768636E-03 -347 8.920000E+00 6.079481E-04 -2.335309E-04 -348 8.940000E+00 5.700798E-04 3.964121E-03 -349 8.960000E+00 4.516330E-04 7.824320E-03 -350 8.980000E+00 2.593567E-04 1.134707E-02 -351 9.000000E+00 0.000000E+00 1.453236E-02 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot b/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot new file mode 120000 index 0000000000..9abb769be2 --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpdext_tstat/cg_spce_table.pot @@ -0,0 +1 @@ +../dpd_tstat/cg_spce_table.pot \ No newline at end of file diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/in.cg_spce b/examples/PACKAGES/dpd-basic/dpdext_tstat/in.dpdext_tstat similarity index 76% rename from examples/PACKAGES/dpd-basic/dpdext_tstat/in.cg_spce rename to examples/PACKAGES/dpd-basic/dpdext_tstat/in.dpdext_tstat index b93dc3eec5..205aef99e4 100644 --- a/examples/PACKAGES/dpd-basic/dpdext_tstat/in.cg_spce +++ b/examples/PACKAGES/dpd-basic/dpdext_tstat/in.dpdext_tstat @@ -4,7 +4,7 @@ variable T equal 300.0 variable rc equal 9.0 variable rcD equal 10.0 -units real +units real boundary p p p atom_style atomic dimension 3 @@ -13,7 +13,7 @@ comm_modify vel yes read_data cg_spce.data -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat ${T} ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat ${T} ${T} ${rc} 385262 pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 ${rcD} @@ -24,8 +24,8 @@ run_style verlet velocity all create ${T} 68768932 thermo_style custom step time temp press -thermo 10 +thermo 100 fix 1 all nve -run 2000 +run 1000 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.1 b/examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.1 deleted file mode 100644 index 8f75dfa917..0000000000 --- a/examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.1 +++ /dev/null @@ -1,293 +0,0 @@ -LAMMPS (8 Apr 2021) -# Coarse-Grained SPC/E Water - -variable T equal 300.0 -variable rc equal 9.0 -variable rcD equal 10.0 - -units real -boundary p p p -atom_style atomic -dimension 3 -newton on -comm_modify vel yes - -read_data cg_spce.data -Reading data file ... - orthogonal box = (0.0000000 0.0000000 0.0000000) to (40.310000 40.310000 40.310000) - 1 by 1 by 1 MPI processor grid - reading atoms ... - 2180 atoms - read_data CPU = 0.020 seconds - -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat ${T} ${T} ${rc} 385262 -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat 300 ${T} ${rc} 385262 -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat 300 300 ${rc} 385262 -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat 300 300 9 385262 - -pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} -pair_coeff 1 1 table cg_spce_table.pot VOTCA 9 -WARNING: 16 of 351 force values in table VOTCA are inconsistent with -dE/dr. - Should only be flagged at inflection points (../pair_table.cpp:461) -pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 ${rcD} -pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 10 - -timestep 1.0 -run_style verlet - -velocity all create ${T} 68768932 -velocity all create 300 68768932 - -thermo_style custom step time temp press -thermo 10 - -fix 1 all nve - -run 2000 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 12 - ghost atom cutoff = 12 - binsize = 6, bins = 7 7 7 - 2 neighbor lists, perpetual/occasional/extra = 2 0 0 - (1) pair table, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard - (2) pair dpd/ext/tstat, perpetual, copy from (1) - attributes: half, newton on - pair build: copy - stencil: none - bin: none -Per MPI rank memory allocation (min/avg/max) = 5.380 | 5.380 | 5.380 Mbytes -Step Time Temp Press - 0 0 300 7368.7186 - 10 10 298.34842 6443.6033 - 20 20 303.36187 9303.0158 - 30 30 301.59356 7533.7912 - 40 40 300.97217 5623.9089 - 50 50 300.31652 9105.8093 - 60 60 296.92173 9213.304 - 70 70 294.36593 12701.327 - 80 80 295.30077 6098.4732 - 90 90 296.35396 8051.719 - 100 100 293.72532 5555.983 - 110 110 290.95711 9001.8346 - 120 120 290.91972 10264.241 - 130 130 294.14911 11450.959 - 140 140 299.11994 7244.1639 - 150 150 301.20082 7675.7516 - 160 160 300.71883 9718.1901 - 170 170 295.47176 8931.1414 - 180 180 290.45284 7381.7674 - 190 190 291.66922 11028.436 - 200 200 294.0543 11897.269 - 210 210 299.17955 8939.2171 - 220 220 298.45193 8047.038 - 230 230 300.48548 10033.64 - 240 240 299.24752 6310.7247 - 250 250 304.51487 8710.5626 - 260 260 303.6513 5230.8162 - 270 270 300.76074 12164.773 - 280 280 302.60275 11145.98 - 290 290 297.22957 9521.4384 - 300 300 297.1365 7446.9006 - 310 310 292.18323 8021.8344 - 320 320 295.03958 9130.8594 - 330 330 293.9622 4647.512 - 340 340 290.77751 8001.486 - 350 350 292.34687 11887.668 - 360 360 295.95968 9262.148 - 370 370 293.50476 4181.549 - 380 380 288.69498 7632.071 - 390 390 289.63957 5130.0205 - 400 400 295.02212 5643.5024 - 410 410 296.3944 7267.235 - 420 420 299.22019 7149.9305 - 430 430 298.36689 8384.595 - 440 440 295.33149 10515.75 - 450 450 294.76959 11569.389 - 460 460 300.141 7272.4453 - 470 470 299.14431 7792.5419 - 480 480 302.3697 5837.8675 - 490 490 301.94692 6999.1059 - 500 500 300.25929 4885.3948 - 510 510 302.50013 8231.0438 - 520 520 300.76412 8445.0349 - 530 530 298.5016 9110.432 - 540 540 301.14513 9348.6421 - 550 550 297.36425 10753.314 - 560 560 296.50046 10476.823 - 570 570 300.57267 9889.7968 - 580 580 300.4868 8377.423 - 590 590 296.65103 6859.32 - 600 600 298.50013 7080.5995 - 610 610 300.28274 9502.5438 - 620 620 298.45508 8819.7846 - 630 630 300.24859 6291.4944 - 640 640 299.38719 7430.2366 - 650 650 297.91915 9435.3218 - 660 660 300.61208 6287.9931 - 670 670 303.59291 8357.7639 - 680 680 301.85511 1697.3038 - 690 690 298.96873 5210.2286 - 700 700 298.09035 7510.4359 - 710 710 303.11692 10129.526 - 720 720 302.65473 10488.388 - 730 730 300.15444 7118.5953 - 740 740 300.19245 10582.032 - 750 750 296.73618 6538.0363 - 760 760 299.72857 7588.9487 - 770 770 299.00347 6633.9983 - 780 780 301.38129 8053.5347 - 790 790 298.54819 8711.4965 - 800 800 305.54197 9717.9727 - 810 810 302.96497 7582.0444 - 820 820 306.81537 9433.6446 - 830 830 309.16373 10088.582 - 840 840 313.53881 9509.8624 - 850 850 310.82992 5366.015 - 860 860 306.49798 8499.9157 - 870 870 308.93421 5690.3242 - 880 880 302.56668 5526.3636 - 890 890 306.72501 7380.8469 - 900 900 308.87199 10388.13 - 910 910 312.7367 6613.0734 - 920 920 308.34508 5903.4291 - 930 930 306.39924 8615.6622 - 940 940 310.37544 6849.4694 - 950 950 310.13051 6188.7605 - 960 960 308.68049 7637.532 - 970 970 302.85465 6448.7926 - 980 980 307.40719 8763.0959 - 990 990 304.02815 8373.6518 - 1000 1000 300.69539 5682.6678 - 1010 1010 299.16385 6012.246 - 1020 1020 305.118 7913.4144 - 1030 1030 304.20382 10580.788 - 1040 1040 302.91134 7698.4548 - 1050 1050 298.08593 8952.6724 - 1060 1060 302.56196 10602.997 - 1070 1070 305.98211 12174.358 - 1080 1080 305.70253 12288.219 - 1090 1090 303.22805 7922.7166 - 1100 1100 301.54879 5031.3836 - 1110 1110 302.57611 8547.4189 - 1120 1120 302.00845 12966.595 - 1130 1130 296.10912 4514.1707 - 1140 1140 295.11601 6543.7239 - 1150 1150 287.29188 6453.3386 - 1160 1160 284.83881 7168.9427 - 1170 1170 289.77871 7895.7434 - 1180 1180 293.48011 7680.6885 - 1190 1190 295.69035 8609.6593 - 1200 1200 296.0653 7343.68 - 1210 1210 302.72922 6973.6048 - 1220 1220 304.11805 7322.7664 - 1230 1230 300.24647 6418.2612 - 1240 1240 293.24074 9039.1214 - 1250 1250 300.56214 7877.4055 - 1260 1260 308.03086 5644.2135 - 1270 1270 311.12289 6875.5126 - 1280 1280 307.83182 7204.9894 - 1290 1290 309.58491 9993.2255 - 1300 1300 305.36536 8626.859 - 1310 1310 304.35084 3471.1205 - 1320 1320 304.40125 2149.2701 - 1330 1330 295.74547 6252.9592 - 1340 1340 293.16034 3407.4408 - 1350 1350 298.6302 10139.977 - 1360 1360 300.46627 7312.9011 - 1370 1370 298.00367 2780.8886 - 1380 1380 300.97807 9403.3451 - 1390 1390 294.32612 12005.453 - 1400 1400 296.13403 5569.4907 - 1410 1410 297.86152 9558.6064 - 1420 1420 303.01992 8678.345 - 1430 1430 298.53849 5544.6316 - 1440 1440 293.60633 12879.765 - 1450 1450 296.28813 9312.4229 - 1460 1460 292.64466 8344.5877 - 1470 1470 295.28975 7689.9396 - 1480 1480 300.10761 7436.7346 - 1490 1490 291.6152 8909.6757 - 1500 1500 286.644 9756.5014 - 1510 1510 294.52064 10383.164 - 1520 1520 297.49618 4972.89 - 1530 1530 295.63379 6192.5729 - 1540 1540 295.04528 4987.7191 - 1550 1550 290.41403 7013.6076 - 1560 1560 295.62326 7222.5009 - 1570 1570 299.90584 4282.5688 - 1580 1580 299.04532 7885.433 - 1590 1590 300.03907 5508.0652 - 1600 1600 298.05683 9262.3744 - 1610 1610 297.50015 9544.6913 - 1620 1620 303.21217 6393.6756 - 1630 1630 304.44383 9674.6583 - 1640 1640 302.68977 9065.4408 - 1650 1650 303.62415 6851.1575 - 1660 1660 306.11103 8592.0481 - 1670 1670 300.84566 8483.551 - 1680 1680 303.92882 10113.096 - 1690 1690 305.02534 7389.9402 - 1700 1700 303.52902 5541.9256 - 1710 1710 299.27905 9547.7344 - 1720 1720 294.14366 7269.2402 - 1730 1730 299.49977 8086.0601 - 1740 1740 298.66942 7026.6067 - 1750 1750 296.94428 9595.2435 - 1760 1760 297.36921 6268.7436 - 1770 1770 299.88423 10598.189 - 1780 1780 293.76868 7405.7641 - 1790 1790 297.19444 10837.102 - 1800 1800 296.46054 8345.699 - 1810 1810 299.06801 5256.5992 - 1820 1820 294.17725 5510.7529 - 1830 1830 286.78527 6310.8881 - 1840 1840 284.89686 8249.1144 - 1850 1850 293.79389 4578.9263 - 1860 1860 298.31279 8752.305 - 1870 1870 295.31087 8401.2736 - 1880 1880 298.13297 4354.8694 - 1890 1890 298.90786 11454.088 - 1900 1900 299.1416 9121.4138 - 1910 1910 296.43134 12157.884 - 1920 1920 292.05445 8613.1522 - 1930 1930 300.3421 7898.3626 - 1940 1940 304.55746 6311.259 - 1950 1950 304.03899 8789.3537 - 1960 1960 305.08259 7243.5622 - 1970 1970 304.0858 8712.4796 - 1980 1980 299.14574 5166.3501 - 1990 1990 300.07254 10019.769 - 2000 2000 301.78176 8789.7968 -Loop time of 91.2059 on 1 procs for 2000 steps with 2180 atoms - -Performance: 1.895 ns/day, 12.667 hours/ns, 21.928 timesteps/s -99.8% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 90.668 | 90.668 | 90.668 | 0.0 | 99.41 -Neigh | 0.23231 | 0.23231 | 0.23231 | 0.0 | 0.25 -Comm | 0.20819 | 0.20819 | 0.20819 | 0.0 | 0.23 -Output | 0.0049558 | 0.0049558 | 0.0049558 | 0.0 | 0.01 -Modify | 0.052906 | 0.052906 | 0.052906 | 0.0 | 0.06 -Other | | 0.03904 | | | 0.04 - -Nlocal: 2180.00 ave 2180 max 2180 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 6693.00 ave 6693 max 6693 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 261496.0 ave 261496 max 261496 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 261496 -Ave neighs/atom = 119.95229 -Neighbor list builds = 25 -Dangerous builds = 0 -Total wall time: 0:01:31 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.4 b/examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.4 deleted file mode 100644 index 278aba0687..0000000000 --- a/examples/PACKAGES/dpd-basic/dpdext_tstat/log.10Mar21.dpdext.g++.4 +++ /dev/null @@ -1,293 +0,0 @@ -LAMMPS (8 Apr 2021) -# Coarse-Grained SPC/E Water - -variable T equal 300.0 -variable rc equal 9.0 -variable rcD equal 10.0 - -units real -boundary p p p -atom_style atomic -dimension 3 -newton on -comm_modify vel yes - -read_data cg_spce.data -Reading data file ... - orthogonal box = (0.0000000 0.0000000 0.0000000) to (40.310000 40.310000 40.310000) - 1 by 2 by 2 MPI processor grid - reading atoms ... - 2180 atoms - read_data CPU = 0.005 seconds - -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat ${T} ${T} ${rc} 385262 -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat 300 ${T} ${rc} 385262 -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat 300 300 ${rc} 385262 -pair_style hybrid/overlay table linear 1000 dpd/ext/tstat 300 300 9 385262 - -pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} -pair_coeff 1 1 table cg_spce_table.pot VOTCA 9 -WARNING: 16 of 351 force values in table VOTCA are inconsistent with -dE/dr. - Should only be flagged at inflection points (../pair_table.cpp:461) -pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 ${rcD} -pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 10 - -timestep 1.0 -run_style verlet - -velocity all create ${T} 68768932 -velocity all create 300 68768932 - -thermo_style custom step time temp press -thermo 10 - -fix 1 all nve - -run 2000 -Neighbor list info ... - update every 1 steps, delay 10 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 12 - ghost atom cutoff = 12 - binsize = 6, bins = 7 7 7 - 2 neighbor lists, perpetual/occasional/extra = 2 0 0 - (1) pair table, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard - (2) pair dpd/ext/tstat, perpetual, copy from (1) - attributes: half, newton on - pair build: copy - stencil: none - bin: none -Per MPI rank memory allocation (min/avg/max) = 3.695 | 3.696 | 3.697 Mbytes -Step Time Temp Press - 0 0 300 5965.5396 - 10 10 303.16391 8779.1574 - 20 20 306.9014 8268.573 - 30 30 305.84291 9976.0547 - 40 40 301.20527 8832.3902 - 50 50 305.72012 8041.0146 - 60 60 305.1676 7118.8042 - 70 70 305.01132 9423.9307 - 80 80 308.10236 10781.423 - 90 90 309.18703 3637.9961 - 100 100 305.11814 7726.7672 - 110 110 298.37346 8575.1602 - 120 120 304.79786 8910.8048 - 130 130 309.05401 6351.4839 - 140 140 304.28367 4805.137 - 150 150 300.28903 7412.6411 - 160 160 299.39358 10183.593 - 170 170 296.80729 5437.1054 - 180 180 295.2755 8317.0414 - 190 190 303.25949 8338.3453 - 200 200 303.24607 9636.5224 - 210 210 298.56684 10288.264 - 220 220 293.42999 9001.0482 - 230 230 293.12497 9083.5194 - 240 240 291.92847 9659.3388 - 250 250 299.2202 6328.759 - 260 260 297.45209 10405.677 - 270 270 292.12257 7273.9369 - 280 280 289.81113 8957.8747 - 290 290 299.06683 6695.3776 - 300 300 300.75468 6298.5705 - 310 310 296.26524 7432.4815 - 320 320 294.21403 9941.7038 - 330 330 293.01776 4750.2993 - 340 340 295.22553 4968.3595 - 350 350 293.95589 9224.5496 - 360 360 297.94278 8792.0395 - 370 370 298.99075 5453.7814 - 380 380 302.1188 6229.2283 - 390 390 298.48943 8517.5273 - 400 400 295.3701 11328.394 - 410 410 287.74238 4058.0382 - 420 420 288.83732 5706.6773 - 430 430 298.8242 6178.7142 - 440 440 304.42682 10138.321 - 450 450 300.28695 9731.3417 - 460 460 300.34539 9249.4691 - 470 470 303.32231 11638.718 - 480 480 301.46777 4186.402 - 490 490 292.56069 9184.8386 - 500 500 297.26162 11766.733 - 510 510 295.34018 6436.33 - 520 520 300.16314 9325.3669 - 530 530 305.00513 5947.6408 - 540 540 300.88805 5222.7384 - 550 550 301.56707 6669.1808 - 560 560 304.89854 10730.053 - 570 570 299.50424 7956.1042 - 580 580 301.23382 10192.246 - 590 590 298.81222 6017.2125 - 600 600 300.57891 4575.433 - 610 610 301.95936 6309.7515 - 620 620 301.09393 5993.6489 - 630 630 300.47565 4388.7137 - 640 640 299.31886 9535.6093 - 650 650 295.06025 7954.5811 - 660 660 298.72666 8630.7466 - 670 670 302.53833 5636.1305 - 680 680 306.32833 12539.149 - 690 690 296.1951 11345.293 - 700 700 297.00325 6352.1448 - 710 710 298.51181 6922.4379 - 720 720 293.80125 4849.4922 - 730 730 296.52677 11141.583 - 740 740 294.15306 3527.8677 - 750 750 294.74737 8454.0815 - 760 760 292.53913 8187.9032 - 770 770 294.37078 7487.5703 - 780 780 297.50085 9198.7697 - 790 790 298.37773 8969.0024 - 800 800 293.29879 6506.6479 - 810 810 296.58266 8805.7872 - 820 820 290.85616 5248.8123 - 830 830 292.29488 5123.8203 - 840 840 292.77623 8263.5675 - 850 850 297.88225 6777.7444 - 860 860 300.01913 10439.087 - 870 870 295.79578 7318.1322 - 880 880 301.5994 8242.4774 - 890 890 306.63208 8090.6106 - 900 900 303.53759 6831.2666 - 910 910 300.70481 3811.0498 - 920 920 299.96274 8351.1573 - 930 930 299.67435 7046.0534 - 940 940 310.81742 6887.6925 - 950 950 305.09984 4811.088 - 960 960 301.33039 4184.851 - 970 970 301.19205 6417.6542 - 980 980 299.6491 7738.2233 - 990 990 297.33655 9264.0874 - 1000 1000 302.33418 7166.2751 - 1010 1010 300.08402 9121.0882 - 1020 1020 302.82225 6405.7109 - 1030 1030 304.01683 6944.0839 - 1040 1040 305.82618 6160.3838 - 1050 1050 308.12518 4356.0931 - 1060 1060 307.64811 6954.7245 - 1070 1070 313.70509 5558.9804 - 1080 1080 316.09239 7250.6147 - 1090 1090 310.2845 5441.3722 - 1100 1100 300.18899 4417.8774 - 1110 1110 304.02471 5609.1668 - 1120 1120 303.46016 10355.031 - 1130 1130 305.68165 6400.913 - 1140 1140 308.78348 7235.1894 - 1150 1150 299.30025 9246.4856 - 1160 1160 302.70799 9866.9536 - 1170 1170 302.0977 8643.5532 - 1180 1180 307.15407 8866.4664 - 1190 1190 305.78146 7562.4911 - 1200 1200 302.54605 7974.9973 - 1210 1210 306.14264 9554.2381 - 1220 1220 308.89843 6219.5361 - 1230 1230 305.71844 7633.9105 - 1240 1240 306.51911 7705.4795 - 1250 1250 304.78473 8590.5595 - 1260 1260 300.82969 9281.5964 - 1270 1270 305.9271 4951.1323 - 1280 1280 310.32728 9446.3989 - 1290 1290 318.27879 9102.5544 - 1300 1300 310.45777 5931.5457 - 1310 1310 304.81268 1214.4291 - 1320 1320 307.08811 10315.961 - 1330 1330 306.86917 8584.9658 - 1340 1340 307.26912 7254.864 - 1350 1350 310.02754 8508.6256 - 1360 1360 306.12763 4912.6641 - 1370 1370 301.67924 6715.8196 - 1380 1380 298.37239 6149.8821 - 1390 1390 299.62894 8181.4761 - 1400 1400 301.60395 6714.4244 - 1410 1410 297.65752 7035.6575 - 1420 1420 297.02817 7510.2637 - 1430 1430 303.59177 10361.937 - 1440 1440 300.10771 8473.2311 - 1450 1450 291.21837 6097.9954 - 1460 1460 291.58663 7729.0841 - 1470 1470 292.52447 6555.8661 - 1480 1480 294.48264 6960.0201 - 1490 1490 298.34869 8044.2321 - 1500 1500 296.8193 11731.289 - 1510 1510 296.52073 5452.8935 - 1520 1520 294.54819 9591.7969 - 1530 1530 297.36394 5148.5383 - 1540 1540 289.08137 6057.0981 - 1550 1550 288.27007 8965.1965 - 1560 1560 294.84398 8316.9487 - 1570 1570 299.79573 8760.7322 - 1580 1580 295.66745 5045.5322 - 1590 1590 298.14356 7161.1834 - 1600 1600 297.10402 6529.9938 - 1610 1610 299.69137 7741.6027 - 1620 1620 304.93043 11222.109 - 1630 1630 302.01322 10893.107 - 1640 1640 295.47422 8400.3124 - 1650 1650 301.93122 7190.2609 - 1660 1660 305.02639 6140.5552 - 1670 1670 302.86047 8651.5366 - 1680 1680 304.82151 9909.407 - 1690 1690 300.48426 8428.8845 - 1700 1700 293.06643 5333.8144 - 1710 1710 295.43687 9103.4353 - 1720 1720 298.77208 8162.1053 - 1730 1730 300.08189 9603.4371 - 1740 1740 303.16004 10693.291 - 1750 1750 303.54199 9151.023 - 1760 1760 300.99281 4641.2985 - 1770 1770 297.36657 3888.5753 - 1780 1780 298.32969 7286.2299 - 1790 1790 297.34183 8975.8956 - 1800 1800 295.83042 6366.7607 - 1810 1810 295.92044 9308.4953 - 1820 1820 298.10087 7117.2369 - 1830 1830 296.13936 4849.3739 - 1840 1840 296.5869 8321.4011 - 1850 1850 296.74513 9530.6806 - 1860 1860 298.57398 8788.0603 - 1870 1870 299.12825 6015.4777 - 1880 1880 301.91639 11706.441 - 1890 1890 309.85968 10909.493 - 1900 1900 302.64998 8779.8967 - 1910 1910 301.62919 9176.3902 - 1920 1920 300.66238 5369.8681 - 1930 1930 297.64499 8185.09 - 1940 1940 296.47852 10188.803 - 1950 1950 297.802 6679.4466 - 1960 1960 299.78754 7316.8198 - 1970 1970 300.09083 6008.9414 - 1980 1980 297.94119 5615.6403 - 1990 1990 298.37687 9727.308 - 2000 2000 296.08394 6400.2746 -Loop time of 41.5171 on 4 procs for 2000 steps with 2180 atoms - -Performance: 4.162 ns/day, 5.766 hours/ns, 48.173 timesteps/s -99.5% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 38.667 | 38.954 | 39.453 | 4.8 | 93.83 -Neigh | 0.10947 | 0.11039 | 0.11153 | 0.3 | 0.27 -Comm | 1.8661 | 2.3644 | 2.652 | 19.6 | 5.70 -Output | 0.0082644 | 0.0094232 | 0.01281 | 2.0 | 0.02 -Modify | 0.024678 | 0.025206 | 0.025888 | 0.3 | 0.06 -Other | | 0.05335 | | | 0.13 - -Nlocal: 545.000 ave 559 max 531 min -Histogram: 1 0 0 0 1 1 0 0 0 1 -Nghost: 3619.00 ave 3655 max 3594 min -Histogram: 1 1 0 0 1 0 0 0 0 1 -Neighs: 65415.5 ave 66835 max 64310 min -Histogram: 1 0 0 2 0 0 0 0 0 1 - -Total # of neighbors = 261662 -Ave neighs/atom = 120.02844 -Neighbor list builds = 26 -Dangerous builds = 0 -Total wall time: 0:00:41 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.1 b/examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.1 new file mode 100644 index 0000000000..44bebd62ce --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.1 @@ -0,0 +1,106 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Coarse-Grained SPC/E Water + +variable T equal 300.0 +variable rc equal 9.0 +variable rcD equal 10.0 + +units real +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +read_data cg_spce.data +Reading data file ... + orthogonal box = (0 0 0) to (40.31 40.31 40.31) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 2180 atoms + read_data CPU = 0.003 seconds + +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat ${T} ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat 300 ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat 300 300 ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat 300 300 9 385262 + +pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} +pair_coeff 1 1 table cg_spce_table.pot VOTCA 9 +WARNING: 16 of 351 force values in table VOTCA are inconsistent with -dE/dr. +WARNING: Should only be flagged at inflection points (src/pair_table.cpp:465) +pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 ${rcD} +pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 10 + +timestep 1.0 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 300 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 1000 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 7 7 7 + 2 neighbor lists, perpetual/occasional/extra = 2 0 0 + (1) pair table, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard + (2) pair dpd/ext/tstat, perpetual, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +Per MPI rank memory allocation (min/avg/max) = 5.38 | 5.38 | 5.38 Mbytes + Step Time Temp Press + 0 0 300 7353.4129 + 100 100 303.74025 4964.013 + 200 200 298.35396 8007.7802 + 300 300 298.28547 6291.5807 + 400 400 298.01797 6252.1041 + 500 500 299.88984 3489.931 + 600 600 302.5718 9092.203 + 700 700 305.38722 5909.02 + 800 800 294.81401 10282.286 + 900 900 292.40724 8338.6878 + 1000 1000 293.64788 6951.569 +Loop time of 28.1058 on 1 procs for 1000 steps with 2180 atoms + +Performance: 3.074 ns/day, 7.807 hours/ns, 35.580 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 27.948 | 27.948 | 27.948 | 0.0 | 99.44 +Neigh | 0.071647 | 0.071647 | 0.071647 | 0.0 | 0.25 +Comm | 0.058215 | 0.058215 | 0.058215 | 0.0 | 0.21 +Output | 0.00026724 | 0.00026724 | 0.00026724 | 0.0 | 0.00 +Modify | 0.014429 | 0.014429 | 0.014429 | 0.0 | 0.05 +Other | | 0.01283 | | | 0.05 + +Nlocal: 2180 ave 2180 max 2180 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 6643 ave 6643 max 6643 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 261826 ave 261826 max 261826 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 261826 +Ave neighs/atom = 120.10367 +Neighbor list builds = 12 +Dangerous builds = 0 +Total wall time: 0:00:28 diff --git a/examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.4 b/examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.4 new file mode 100644 index 0000000000..fc9e1116ec --- /dev/null +++ b/examples/PACKAGES/dpd-basic/dpdext_tstat/log.5Apr22.dpdext_tstat.g++.4 @@ -0,0 +1,106 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Coarse-Grained SPC/E Water + +variable T equal 300.0 +variable rc equal 9.0 +variable rcD equal 10.0 + +units real +boundary p p p +atom_style atomic +dimension 3 +newton on +comm_modify vel yes + +read_data cg_spce.data +Reading data file ... + orthogonal box = (0 0 0) to (40.31 40.31 40.31) + 1 by 2 by 2 MPI processor grid + reading atoms ... + 2180 atoms + read_data CPU = 0.003 seconds + +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat ${T} ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat 300 ${T} ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat 300 300 ${rc} 385262 +pair_style hybrid/overlay table spline 1000 dpd/ext/tstat 300 300 9 385262 + +pair_coeff 1 1 table cg_spce_table.pot VOTCA ${rc} +pair_coeff 1 1 table cg_spce_table.pot VOTCA 9 +WARNING: 16 of 351 force values in table VOTCA are inconsistent with -dE/dr. +WARNING: Should only be flagged at inflection points (src/pair_table.cpp:465) +pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 ${rcD} +pair_coeff 1 1 dpd/ext/tstat 20.0 10.0 0.5 0.5 10 + +timestep 1.0 +run_style verlet + +velocity all create ${T} 68768932 +velocity all create 300 68768932 + +thermo_style custom step time temp press +thermo 100 + +fix 1 all nve + +run 1000 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 7 7 7 + 2 neighbor lists, perpetual/occasional/extra = 2 0 0 + (1) pair table, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard + (2) pair dpd/ext/tstat, perpetual, copy from (1) + attributes: half, newton on + pair build: copy + stencil: none + bin: none +Per MPI rank memory allocation (min/avg/max) = 3.695 | 3.696 | 3.697 Mbytes + Step Time Temp Press + 0 0 300 5950.2338 + 100 100 301.15012 9090.2244 + 200 200 301.28795 10589.557 + 300 300 293.61974 5971.7781 + 400 400 310.4217 8198.7972 + 500 500 299.89888 9140.3132 + 600 600 305.56607 7783.4481 + 700 700 295.99415 6276.9444 + 800 800 296.50051 5058.1115 + 900 900 288.68499 8637.0269 + 1000 1000 291.17292 6516.4192 +Loop time of 7.57429 on 4 procs for 1000 steps with 2180 atoms + +Performance: 11.407 ns/day, 2.104 hours/ns, 132.026 timesteps/s +99.8% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 7.2745 | 7.3674 | 7.4316 | 2.1 | 97.27 +Neigh | 0.01863 | 0.018866 | 0.019429 | 0.2 | 0.25 +Comm | 0.1123 | 0.17708 | 0.27025 | 13.8 | 2.34 +Output | 0.00019274 | 0.00021224 | 0.00026504 | 0.0 | 0.00 +Modify | 0.0041691 | 0.0042729 | 0.0043136 | 0.1 | 0.06 +Other | | 0.006464 | | | 0.09 + +Nlocal: 545 ave 552 max 531 min +Histogram: 1 0 0 0 0 0 0 0 2 1 +Nghost: 3620.5 ave 3656 max 3584 min +Histogram: 1 0 1 0 0 0 0 1 0 1 +Neighs: 65419 ave 66338 max 64104 min +Histogram: 1 0 0 0 1 0 0 0 1 1 + +Total # of neighbors = 261676 +Ave neighs/atom = 120.03486 +Neighbor list builds = 12 +Dangerous builds = 0 +Total wall time: 0:00:07 diff --git a/examples/PACKAGES/fep/README.md b/examples/PACKAGES/fep/README.md index d8f0935115..0ccf3d10c3 100644 --- a/examples/PACKAGES/fep/README.md +++ b/examples/PACKAGES/fep/README.md @@ -23,3 +23,5 @@ to the final states. * `quicktests` -- very short runs with charged Lennard-Jones atoms to test *compute fep*, *fix adapt/fep* and *pair lj/cut/coul/long/soft*. + +* `ta` -- surface tension of SPCE water without constraints. Test-area method. diff --git a/examples/PACKAGES/fep/ta/data.spce b/examples/PACKAGES/fep/ta/data.spce new file mode 100644 index 0000000000..7ed4c1cedc --- /dev/null +++ b/examples/PACKAGES/fep/ta/data.spce @@ -0,0 +1,6174 @@ +LAMMPS Description + + 3072 atoms + 2048 bonds + 1024 angles + 0 dihedrals + 0 impropers + + 2 atom types + 1 bond types + 1 angle types + + 0.0 30 xlo xhi + 0.0 30 ylo yhi + 0.0 100 zlo zhi + +Masses + +1 15.9994 # O +2 1.008 # H + +Atoms # full + +1 1 1 -0.8476 0.0 0.0 25.0 +2 1 2 0.4238 0.8164904 0.0 25.577359 +3 1 2 0.4238 -0.8164904 0.0 25.577359 +4 2 1 -0.8476 0.0 0.0 28.10342 +5 2 2 0.4238 0.8164904 0.0 28.680779 +6 2 2 0.4238 -0.8164904 0.0 28.680779 +7 3 1 -0.8476 0.0 0.0 31.20684 +8 3 2 0.4238 0.8164904 0.0 31.784199 +9 3 2 0.4238 -0.8164904 0.0 31.784199 +10 4 1 -0.8476 0.0 0.0 34.31026 +11 4 2 0.4238 0.8164904 0.0 34.887619 +12 4 2 0.4238 -0.8164904 0.0 34.887619 +13 5 1 -0.8476 0.0 0.0 37.41368 +14 5 2 0.4238 0.8164904 0.0 37.991039 +15 5 2 0.4238 -0.8164904 0.0 37.991039 +16 6 1 -0.8476 0.0 0.0 40.5171 +17 6 2 0.4238 0.8164904 0.0 41.094459 +18 6 2 0.4238 -0.8164904 0.0 41.094459 +19 7 1 -0.8476 0.0 0.0 43.62052 +20 7 2 0.4238 0.8164904 0.0 44.197879 +21 7 2 0.4238 -0.8164904 0.0 44.197879 +22 8 1 -0.8476 0.0 0.0 46.72394 +23 8 2 0.4238 0.8164904 0.0 47.301299 +24 8 2 0.4238 -0.8164904 0.0 47.301299 +25 9 1 -0.8476 0.0 0.0 49.82736 +26 9 2 0.4238 0.8164904 0.0 50.404719 +27 9 2 0.4238 -0.8164904 0.0 50.404719 +28 10 1 -0.8476 0.0 0.0 52.93078 +29 10 2 0.4238 0.8164904 0.0 53.508139 +30 10 2 0.4238 -0.8164904 0.0 53.508139 +31 11 1 -0.8476 0.0 0.0 56.0342 +32 11 2 0.4238 0.8164904 0.0 56.611559 +33 11 2 0.4238 -0.8164904 0.0 56.611559 +34 12 1 -0.8476 0.0 0.0 59.13762 +35 12 2 0.4238 0.8164904 0.0 59.714979 +36 12 2 0.4238 -0.8164904 0.0 59.714979 +37 13 1 -0.8476 0.0 0.0 62.24104 +38 13 2 0.4238 0.8164904 0.0 62.818399 +39 13 2 0.4238 -0.8164904 0.0 62.818399 +40 14 1 -0.8476 0.0 0.0 65.34446 +41 14 2 0.4238 0.8164904 0.0 65.921819 +42 14 2 0.4238 -0.8164904 0.0 65.921819 +43 15 1 -0.8476 0.0 0.0 68.44788 +44 15 2 0.4238 0.8164904 0.0 69.025239 +45 15 2 0.4238 -0.8164904 0.0 69.025239 +46 16 1 -0.8476 0.0 0.0 71.5513 +47 16 2 0.4238 0.8164904 0.0 72.128659 +48 16 2 0.4238 -0.8164904 0.0 72.128659 +49 17 1 -0.8476 0.0 3.10342 25.0 +50 17 2 0.4238 0.8164904 3.10342 25.577359 +51 17 2 0.4238 -0.8164904 3.10342 25.577359 +52 18 1 -0.8476 0.0 3.10342 28.10342 +53 18 2 0.4238 0.8164904 3.10342 28.680779 +54 18 2 0.4238 -0.8164904 3.10342 28.680779 +55 19 1 -0.8476 0.0 3.10342 31.20684 +56 19 2 0.4238 0.8164904 3.10342 31.784199 +57 19 2 0.4238 -0.8164904 3.10342 31.784199 +58 20 1 -0.8476 0.0 3.10342 34.31026 +59 20 2 0.4238 0.8164904 3.10342 34.887619 +60 20 2 0.4238 -0.8164904 3.10342 34.887619 +61 21 1 -0.8476 0.0 3.10342 37.41368 +62 21 2 0.4238 0.8164904 3.10342 37.991039 +63 21 2 0.4238 -0.8164904 3.10342 37.991039 +64 22 1 -0.8476 0.0 3.10342 40.5171 +65 22 2 0.4238 0.8164904 3.10342 41.094459 +66 22 2 0.4238 -0.8164904 3.10342 41.094459 +67 23 1 -0.8476 0.0 3.10342 43.62052 +68 23 2 0.4238 0.8164904 3.10342 44.197879 +69 23 2 0.4238 -0.8164904 3.10342 44.197879 +70 24 1 -0.8476 0.0 3.10342 46.72394 +71 24 2 0.4238 0.8164904 3.10342 47.301299 +72 24 2 0.4238 -0.8164904 3.10342 47.301299 +73 25 1 -0.8476 0.0 3.10342 49.82736 +74 25 2 0.4238 0.8164904 3.10342 50.404719 +75 25 2 0.4238 -0.8164904 3.10342 50.404719 +76 26 1 -0.8476 0.0 3.10342 52.93078 +77 26 2 0.4238 0.8164904 3.10342 53.508139 +78 26 2 0.4238 -0.8164904 3.10342 53.508139 +79 27 1 -0.8476 0.0 3.10342 56.0342 +80 27 2 0.4238 0.8164904 3.10342 56.611559 +81 27 2 0.4238 -0.8164904 3.10342 56.611559 +82 28 1 -0.8476 0.0 3.10342 59.13762 +83 28 2 0.4238 0.8164904 3.10342 59.714979 +84 28 2 0.4238 -0.8164904 3.10342 59.714979 +85 29 1 -0.8476 0.0 3.10342 62.24104 +86 29 2 0.4238 0.8164904 3.10342 62.818399 +87 29 2 0.4238 -0.8164904 3.10342 62.818399 +88 30 1 -0.8476 0.0 3.10342 65.34446 +89 30 2 0.4238 0.8164904 3.10342 65.921819 +90 30 2 0.4238 -0.8164904 3.10342 65.921819 +91 31 1 -0.8476 0.0 3.10342 68.44788 +92 31 2 0.4238 0.8164904 3.10342 69.025239 +93 31 2 0.4238 -0.8164904 3.10342 69.025239 +94 32 1 -0.8476 0.0 3.10342 71.5513 +95 32 2 0.4238 0.8164904 3.10342 72.128659 +96 32 2 0.4238 -0.8164904 3.10342 72.128659 +97 33 1 -0.8476 0.0 6.20684 25.0 +98 33 2 0.4238 0.8164904 6.20684 25.577359 +99 33 2 0.4238 -0.8164904 6.20684 25.577359 +100 34 1 -0.8476 0.0 6.20684 28.10342 +101 34 2 0.4238 0.8164904 6.20684 28.680779 +102 34 2 0.4238 -0.8164904 6.20684 28.680779 +103 35 1 -0.8476 0.0 6.20684 31.20684 +104 35 2 0.4238 0.8164904 6.20684 31.784199 +105 35 2 0.4238 -0.8164904 6.20684 31.784199 +106 36 1 -0.8476 0.0 6.20684 34.31026 +107 36 2 0.4238 0.8164904 6.20684 34.887619 +108 36 2 0.4238 -0.8164904 6.20684 34.887619 +109 37 1 -0.8476 0.0 6.20684 37.41368 +110 37 2 0.4238 0.8164904 6.20684 37.991039 +111 37 2 0.4238 -0.8164904 6.20684 37.991039 +112 38 1 -0.8476 0.0 6.20684 40.5171 +113 38 2 0.4238 0.8164904 6.20684 41.094459 +114 38 2 0.4238 -0.8164904 6.20684 41.094459 +115 39 1 -0.8476 0.0 6.20684 43.62052 +116 39 2 0.4238 0.8164904 6.20684 44.197879 +117 39 2 0.4238 -0.8164904 6.20684 44.197879 +118 40 1 -0.8476 0.0 6.20684 46.72394 +119 40 2 0.4238 0.8164904 6.20684 47.301299 +120 40 2 0.4238 -0.8164904 6.20684 47.301299 +121 41 1 -0.8476 0.0 6.20684 49.82736 +122 41 2 0.4238 0.8164904 6.20684 50.404719 +123 41 2 0.4238 -0.8164904 6.20684 50.404719 +124 42 1 -0.8476 0.0 6.20684 52.93078 +125 42 2 0.4238 0.8164904 6.20684 53.508139 +126 42 2 0.4238 -0.8164904 6.20684 53.508139 +127 43 1 -0.8476 0.0 6.20684 56.0342 +128 43 2 0.4238 0.8164904 6.20684 56.611559 +129 43 2 0.4238 -0.8164904 6.20684 56.611559 +130 44 1 -0.8476 0.0 6.20684 59.13762 +131 44 2 0.4238 0.8164904 6.20684 59.714979 +132 44 2 0.4238 -0.8164904 6.20684 59.714979 +133 45 1 -0.8476 0.0 6.20684 62.24104 +134 45 2 0.4238 0.8164904 6.20684 62.818399 +135 45 2 0.4238 -0.8164904 6.20684 62.818399 +136 46 1 -0.8476 0.0 6.20684 65.34446 +137 46 2 0.4238 0.8164904 6.20684 65.921819 +138 46 2 0.4238 -0.8164904 6.20684 65.921819 +139 47 1 -0.8476 0.0 6.20684 68.44788 +140 47 2 0.4238 0.8164904 6.20684 69.025239 +141 47 2 0.4238 -0.8164904 6.20684 69.025239 +142 48 1 -0.8476 0.0 6.20684 71.5513 +143 48 2 0.4238 0.8164904 6.20684 72.128659 +144 48 2 0.4238 -0.8164904 6.20684 72.128659 +145 49 1 -0.8476 0.0 9.31026 25.0 +146 49 2 0.4238 0.8164904 9.31026 25.577359 +147 49 2 0.4238 -0.8164904 9.31026 25.577359 +148 50 1 -0.8476 0.0 9.31026 28.10342 +149 50 2 0.4238 0.8164904 9.31026 28.680779 +150 50 2 0.4238 -0.8164904 9.31026 28.680779 +151 51 1 -0.8476 0.0 9.31026 31.20684 +152 51 2 0.4238 0.8164904 9.31026 31.784199 +153 51 2 0.4238 -0.8164904 9.31026 31.784199 +154 52 1 -0.8476 0.0 9.31026 34.31026 +155 52 2 0.4238 0.8164904 9.31026 34.887619 +156 52 2 0.4238 -0.8164904 9.31026 34.887619 +157 53 1 -0.8476 0.0 9.31026 37.41368 +158 53 2 0.4238 0.8164904 9.31026 37.991039 +159 53 2 0.4238 -0.8164904 9.31026 37.991039 +160 54 1 -0.8476 0.0 9.31026 40.5171 +161 54 2 0.4238 0.8164904 9.31026 41.094459 +162 54 2 0.4238 -0.8164904 9.31026 41.094459 +163 55 1 -0.8476 0.0 9.31026 43.62052 +164 55 2 0.4238 0.8164904 9.31026 44.197879 +165 55 2 0.4238 -0.8164904 9.31026 44.197879 +166 56 1 -0.8476 0.0 9.31026 46.72394 +167 56 2 0.4238 0.8164904 9.31026 47.301299 +168 56 2 0.4238 -0.8164904 9.31026 47.301299 +169 57 1 -0.8476 0.0 9.31026 49.82736 +170 57 2 0.4238 0.8164904 9.31026 50.404719 +171 57 2 0.4238 -0.8164904 9.31026 50.404719 +172 58 1 -0.8476 0.0 9.31026 52.93078 +173 58 2 0.4238 0.8164904 9.31026 53.508139 +174 58 2 0.4238 -0.8164904 9.31026 53.508139 +175 59 1 -0.8476 0.0 9.31026 56.0342 +176 59 2 0.4238 0.8164904 9.31026 56.611559 +177 59 2 0.4238 -0.8164904 9.31026 56.611559 +178 60 1 -0.8476 0.0 9.31026 59.13762 +179 60 2 0.4238 0.8164904 9.31026 59.714979 +180 60 2 0.4238 -0.8164904 9.31026 59.714979 +181 61 1 -0.8476 0.0 9.31026 62.24104 +182 61 2 0.4238 0.8164904 9.31026 62.818399 +183 61 2 0.4238 -0.8164904 9.31026 62.818399 +184 62 1 -0.8476 0.0 9.31026 65.34446 +185 62 2 0.4238 0.8164904 9.31026 65.921819 +186 62 2 0.4238 -0.8164904 9.31026 65.921819 +187 63 1 -0.8476 0.0 9.31026 68.44788 +188 63 2 0.4238 0.8164904 9.31026 69.025239 +189 63 2 0.4238 -0.8164904 9.31026 69.025239 +190 64 1 -0.8476 0.0 9.31026 71.5513 +191 64 2 0.4238 0.8164904 9.31026 72.128659 +192 64 2 0.4238 -0.8164904 9.31026 72.128659 +193 65 1 -0.8476 0.0 12.41368 25.0 +194 65 2 0.4238 0.8164904 12.41368 25.577359 +195 65 2 0.4238 -0.8164904 12.41368 25.577359 +196 66 1 -0.8476 0.0 12.41368 28.10342 +197 66 2 0.4238 0.8164904 12.41368 28.680779 +198 66 2 0.4238 -0.8164904 12.41368 28.680779 +199 67 1 -0.8476 0.0 12.41368 31.20684 +200 67 2 0.4238 0.8164904 12.41368 31.784199 +201 67 2 0.4238 -0.8164904 12.41368 31.784199 +202 68 1 -0.8476 0.0 12.41368 34.31026 +203 68 2 0.4238 0.8164904 12.41368 34.887619 +204 68 2 0.4238 -0.8164904 12.41368 34.887619 +205 69 1 -0.8476 0.0 12.41368 37.41368 +206 69 2 0.4238 0.8164904 12.41368 37.991039 +207 69 2 0.4238 -0.8164904 12.41368 37.991039 +208 70 1 -0.8476 0.0 12.41368 40.5171 +209 70 2 0.4238 0.8164904 12.41368 41.094459 +210 70 2 0.4238 -0.8164904 12.41368 41.094459 +211 71 1 -0.8476 0.0 12.41368 43.62052 +212 71 2 0.4238 0.8164904 12.41368 44.197879 +213 71 2 0.4238 -0.8164904 12.41368 44.197879 +214 72 1 -0.8476 0.0 12.41368 46.72394 +215 72 2 0.4238 0.8164904 12.41368 47.301299 +216 72 2 0.4238 -0.8164904 12.41368 47.301299 +217 73 1 -0.8476 0.0 12.41368 49.82736 +218 73 2 0.4238 0.8164904 12.41368 50.404719 +219 73 2 0.4238 -0.8164904 12.41368 50.404719 +220 74 1 -0.8476 0.0 12.41368 52.93078 +221 74 2 0.4238 0.8164904 12.41368 53.508139 +222 74 2 0.4238 -0.8164904 12.41368 53.508139 +223 75 1 -0.8476 0.0 12.41368 56.0342 +224 75 2 0.4238 0.8164904 12.41368 56.611559 +225 75 2 0.4238 -0.8164904 12.41368 56.611559 +226 76 1 -0.8476 0.0 12.41368 59.13762 +227 76 2 0.4238 0.8164904 12.41368 59.714979 +228 76 2 0.4238 -0.8164904 12.41368 59.714979 +229 77 1 -0.8476 0.0 12.41368 62.24104 +230 77 2 0.4238 0.8164904 12.41368 62.818399 +231 77 2 0.4238 -0.8164904 12.41368 62.818399 +232 78 1 -0.8476 0.0 12.41368 65.34446 +233 78 2 0.4238 0.8164904 12.41368 65.921819 +234 78 2 0.4238 -0.8164904 12.41368 65.921819 +235 79 1 -0.8476 0.0 12.41368 68.44788 +236 79 2 0.4238 0.8164904 12.41368 69.025239 +237 79 2 0.4238 -0.8164904 12.41368 69.025239 +238 80 1 -0.8476 0.0 12.41368 71.5513 +239 80 2 0.4238 0.8164904 12.41368 72.128659 +240 80 2 0.4238 -0.8164904 12.41368 72.128659 +241 81 1 -0.8476 0.0 15.5171 25.0 +242 81 2 0.4238 0.8164904 15.5171 25.577359 +243 81 2 0.4238 -0.8164904 15.5171 25.577359 +244 82 1 -0.8476 0.0 15.5171 28.10342 +245 82 2 0.4238 0.8164904 15.5171 28.680779 +246 82 2 0.4238 -0.8164904 15.5171 28.680779 +247 83 1 -0.8476 0.0 15.5171 31.20684 +248 83 2 0.4238 0.8164904 15.5171 31.784199 +249 83 2 0.4238 -0.8164904 15.5171 31.784199 +250 84 1 -0.8476 0.0 15.5171 34.31026 +251 84 2 0.4238 0.8164904 15.5171 34.887619 +252 84 2 0.4238 -0.8164904 15.5171 34.887619 +253 85 1 -0.8476 0.0 15.5171 37.41368 +254 85 2 0.4238 0.8164904 15.5171 37.991039 +255 85 2 0.4238 -0.8164904 15.5171 37.991039 +256 86 1 -0.8476 0.0 15.5171 40.5171 +257 86 2 0.4238 0.8164904 15.5171 41.094459 +258 86 2 0.4238 -0.8164904 15.5171 41.094459 +259 87 1 -0.8476 0.0 15.5171 43.62052 +260 87 2 0.4238 0.8164904 15.5171 44.197879 +261 87 2 0.4238 -0.8164904 15.5171 44.197879 +262 88 1 -0.8476 0.0 15.5171 46.72394 +263 88 2 0.4238 0.8164904 15.5171 47.301299 +264 88 2 0.4238 -0.8164904 15.5171 47.301299 +265 89 1 -0.8476 0.0 15.5171 49.82736 +266 89 2 0.4238 0.8164904 15.5171 50.404719 +267 89 2 0.4238 -0.8164904 15.5171 50.404719 +268 90 1 -0.8476 0.0 15.5171 52.93078 +269 90 2 0.4238 0.8164904 15.5171 53.508139 +270 90 2 0.4238 -0.8164904 15.5171 53.508139 +271 91 1 -0.8476 0.0 15.5171 56.0342 +272 91 2 0.4238 0.8164904 15.5171 56.611559 +273 91 2 0.4238 -0.8164904 15.5171 56.611559 +274 92 1 -0.8476 0.0 15.5171 59.13762 +275 92 2 0.4238 0.8164904 15.5171 59.714979 +276 92 2 0.4238 -0.8164904 15.5171 59.714979 +277 93 1 -0.8476 0.0 15.5171 62.24104 +278 93 2 0.4238 0.8164904 15.5171 62.818399 +279 93 2 0.4238 -0.8164904 15.5171 62.818399 +280 94 1 -0.8476 0.0 15.5171 65.34446 +281 94 2 0.4238 0.8164904 15.5171 65.921819 +282 94 2 0.4238 -0.8164904 15.5171 65.921819 +283 95 1 -0.8476 0.0 15.5171 68.44788 +284 95 2 0.4238 0.8164904 15.5171 69.025239 +285 95 2 0.4238 -0.8164904 15.5171 69.025239 +286 96 1 -0.8476 0.0 15.5171 71.5513 +287 96 2 0.4238 0.8164904 15.5171 72.128659 +288 96 2 0.4238 -0.8164904 15.5171 72.128659 +289 97 1 -0.8476 0.0 18.62052 25.0 +290 97 2 0.4238 0.8164904 18.62052 25.577359 +291 97 2 0.4238 -0.8164904 18.62052 25.577359 +292 98 1 -0.8476 0.0 18.62052 28.10342 +293 98 2 0.4238 0.8164904 18.62052 28.680779 +294 98 2 0.4238 -0.8164904 18.62052 28.680779 +295 99 1 -0.8476 0.0 18.62052 31.20684 +296 99 2 0.4238 0.8164904 18.62052 31.784199 +297 99 2 0.4238 -0.8164904 18.62052 31.784199 +298 100 1 -0.8476 0.0 18.62052 34.31026 +299 100 2 0.4238 0.8164904 18.62052 34.887619 +300 100 2 0.4238 -0.8164904 18.62052 34.887619 +301 101 1 -0.8476 0.0 18.62052 37.41368 +302 101 2 0.4238 0.8164904 18.62052 37.991039 +303 101 2 0.4238 -0.8164904 18.62052 37.991039 +304 102 1 -0.8476 0.0 18.62052 40.5171 +305 102 2 0.4238 0.8164904 18.62052 41.094459 +306 102 2 0.4238 -0.8164904 18.62052 41.094459 +307 103 1 -0.8476 0.0 18.62052 43.62052 +308 103 2 0.4238 0.8164904 18.62052 44.197879 +309 103 2 0.4238 -0.8164904 18.62052 44.197879 +310 104 1 -0.8476 0.0 18.62052 46.72394 +311 104 2 0.4238 0.8164904 18.62052 47.301299 +312 104 2 0.4238 -0.8164904 18.62052 47.301299 +313 105 1 -0.8476 0.0 18.62052 49.82736 +314 105 2 0.4238 0.8164904 18.62052 50.404719 +315 105 2 0.4238 -0.8164904 18.62052 50.404719 +316 106 1 -0.8476 0.0 18.62052 52.93078 +317 106 2 0.4238 0.8164904 18.62052 53.508139 +318 106 2 0.4238 -0.8164904 18.62052 53.508139 +319 107 1 -0.8476 0.0 18.62052 56.0342 +320 107 2 0.4238 0.8164904 18.62052 56.611559 +321 107 2 0.4238 -0.8164904 18.62052 56.611559 +322 108 1 -0.8476 0.0 18.62052 59.13762 +323 108 2 0.4238 0.8164904 18.62052 59.714979 +324 108 2 0.4238 -0.8164904 18.62052 59.714979 +325 109 1 -0.8476 0.0 18.62052 62.24104 +326 109 2 0.4238 0.8164904 18.62052 62.818399 +327 109 2 0.4238 -0.8164904 18.62052 62.818399 +328 110 1 -0.8476 0.0 18.62052 65.34446 +329 110 2 0.4238 0.8164904 18.62052 65.921819 +330 110 2 0.4238 -0.8164904 18.62052 65.921819 +331 111 1 -0.8476 0.0 18.62052 68.44788 +332 111 2 0.4238 0.8164904 18.62052 69.025239 +333 111 2 0.4238 -0.8164904 18.62052 69.025239 +334 112 1 -0.8476 0.0 18.62052 71.5513 +335 112 2 0.4238 0.8164904 18.62052 72.128659 +336 112 2 0.4238 -0.8164904 18.62052 72.128659 +337 113 1 -0.8476 0.0 21.72394 25.0 +338 113 2 0.4238 0.8164904 21.72394 25.577359 +339 113 2 0.4238 -0.8164904 21.72394 25.577359 +340 114 1 -0.8476 0.0 21.72394 28.10342 +341 114 2 0.4238 0.8164904 21.72394 28.680779 +342 114 2 0.4238 -0.8164904 21.72394 28.680779 +343 115 1 -0.8476 0.0 21.72394 31.20684 +344 115 2 0.4238 0.8164904 21.72394 31.784199 +345 115 2 0.4238 -0.8164904 21.72394 31.784199 +346 116 1 -0.8476 0.0 21.72394 34.31026 +347 116 2 0.4238 0.8164904 21.72394 34.887619 +348 116 2 0.4238 -0.8164904 21.72394 34.887619 +349 117 1 -0.8476 0.0 21.72394 37.41368 +350 117 2 0.4238 0.8164904 21.72394 37.991039 +351 117 2 0.4238 -0.8164904 21.72394 37.991039 +352 118 1 -0.8476 0.0 21.72394 40.5171 +353 118 2 0.4238 0.8164904 21.72394 41.094459 +354 118 2 0.4238 -0.8164904 21.72394 41.094459 +355 119 1 -0.8476 0.0 21.72394 43.62052 +356 119 2 0.4238 0.8164904 21.72394 44.197879 +357 119 2 0.4238 -0.8164904 21.72394 44.197879 +358 120 1 -0.8476 0.0 21.72394 46.72394 +359 120 2 0.4238 0.8164904 21.72394 47.301299 +360 120 2 0.4238 -0.8164904 21.72394 47.301299 +361 121 1 -0.8476 0.0 21.72394 49.82736 +362 121 2 0.4238 0.8164904 21.72394 50.404719 +363 121 2 0.4238 -0.8164904 21.72394 50.404719 +364 122 1 -0.8476 0.0 21.72394 52.93078 +365 122 2 0.4238 0.8164904 21.72394 53.508139 +366 122 2 0.4238 -0.8164904 21.72394 53.508139 +367 123 1 -0.8476 0.0 21.72394 56.0342 +368 123 2 0.4238 0.8164904 21.72394 56.611559 +369 123 2 0.4238 -0.8164904 21.72394 56.611559 +370 124 1 -0.8476 0.0 21.72394 59.13762 +371 124 2 0.4238 0.8164904 21.72394 59.714979 +372 124 2 0.4238 -0.8164904 21.72394 59.714979 +373 125 1 -0.8476 0.0 21.72394 62.24104 +374 125 2 0.4238 0.8164904 21.72394 62.818399 +375 125 2 0.4238 -0.8164904 21.72394 62.818399 +376 126 1 -0.8476 0.0 21.72394 65.34446 +377 126 2 0.4238 0.8164904 21.72394 65.921819 +378 126 2 0.4238 -0.8164904 21.72394 65.921819 +379 127 1 -0.8476 0.0 21.72394 68.44788 +380 127 2 0.4238 0.8164904 21.72394 69.025239 +381 127 2 0.4238 -0.8164904 21.72394 69.025239 +382 128 1 -0.8476 0.0 21.72394 71.5513 +383 128 2 0.4238 0.8164904 21.72394 72.128659 +384 128 2 0.4238 -0.8164904 21.72394 72.128659 +385 129 1 -0.8476 3.10342 0.0 25.0 +386 129 2 0.4238 3.9199104 0.0 25.577359 +387 129 2 0.4238 2.2869295999999997 0.0 25.577359 +388 130 1 -0.8476 3.10342 0.0 28.10342 +389 130 2 0.4238 3.9199104 0.0 28.680779 +390 130 2 0.4238 2.2869295999999997 0.0 28.680779 +391 131 1 -0.8476 3.10342 0.0 31.20684 +392 131 2 0.4238 3.9199104 0.0 31.784199 +393 131 2 0.4238 2.2869295999999997 0.0 31.784199 +394 132 1 -0.8476 3.10342 0.0 34.31026 +395 132 2 0.4238 3.9199104 0.0 34.887619 +396 132 2 0.4238 2.2869295999999997 0.0 34.887619 +397 133 1 -0.8476 3.10342 0.0 37.41368 +398 133 2 0.4238 3.9199104 0.0 37.991039 +399 133 2 0.4238 2.2869295999999997 0.0 37.991039 +400 134 1 -0.8476 3.10342 0.0 40.5171 +401 134 2 0.4238 3.9199104 0.0 41.094459 +402 134 2 0.4238 2.2869295999999997 0.0 41.094459 +403 135 1 -0.8476 3.10342 0.0 43.62052 +404 135 2 0.4238 3.9199104 0.0 44.197879 +405 135 2 0.4238 2.2869295999999997 0.0 44.197879 +406 136 1 -0.8476 3.10342 0.0 46.72394 +407 136 2 0.4238 3.9199104 0.0 47.301299 +408 136 2 0.4238 2.2869295999999997 0.0 47.301299 +409 137 1 -0.8476 3.10342 0.0 49.82736 +410 137 2 0.4238 3.9199104 0.0 50.404719 +411 137 2 0.4238 2.2869295999999997 0.0 50.404719 +412 138 1 -0.8476 3.10342 0.0 52.93078 +413 138 2 0.4238 3.9199104 0.0 53.508139 +414 138 2 0.4238 2.2869295999999997 0.0 53.508139 +415 139 1 -0.8476 3.10342 0.0 56.0342 +416 139 2 0.4238 3.9199104 0.0 56.611559 +417 139 2 0.4238 2.2869295999999997 0.0 56.611559 +418 140 1 -0.8476 3.10342 0.0 59.13762 +419 140 2 0.4238 3.9199104 0.0 59.714979 +420 140 2 0.4238 2.2869295999999997 0.0 59.714979 +421 141 1 -0.8476 3.10342 0.0 62.24104 +422 141 2 0.4238 3.9199104 0.0 62.818399 +423 141 2 0.4238 2.2869295999999997 0.0 62.818399 +424 142 1 -0.8476 3.10342 0.0 65.34446 +425 142 2 0.4238 3.9199104 0.0 65.921819 +426 142 2 0.4238 2.2869295999999997 0.0 65.921819 +427 143 1 -0.8476 3.10342 0.0 68.44788 +428 143 2 0.4238 3.9199104 0.0 69.025239 +429 143 2 0.4238 2.2869295999999997 0.0 69.025239 +430 144 1 -0.8476 3.10342 0.0 71.5513 +431 144 2 0.4238 3.9199104 0.0 72.128659 +432 144 2 0.4238 2.2869295999999997 0.0 72.128659 +433 145 1 -0.8476 3.10342 3.10342 25.0 +434 145 2 0.4238 3.9199104 3.10342 25.577359 +435 145 2 0.4238 2.2869295999999997 3.10342 25.577359 +436 146 1 -0.8476 3.10342 3.10342 28.10342 +437 146 2 0.4238 3.9199104 3.10342 28.680779 +438 146 2 0.4238 2.2869295999999997 3.10342 28.680779 +439 147 1 -0.8476 3.10342 3.10342 31.20684 +440 147 2 0.4238 3.9199104 3.10342 31.784199 +441 147 2 0.4238 2.2869295999999997 3.10342 31.784199 +442 148 1 -0.8476 3.10342 3.10342 34.31026 +443 148 2 0.4238 3.9199104 3.10342 34.887619 +444 148 2 0.4238 2.2869295999999997 3.10342 34.887619 +445 149 1 -0.8476 3.10342 3.10342 37.41368 +446 149 2 0.4238 3.9199104 3.10342 37.991039 +447 149 2 0.4238 2.2869295999999997 3.10342 37.991039 +448 150 1 -0.8476 3.10342 3.10342 40.5171 +449 150 2 0.4238 3.9199104 3.10342 41.094459 +450 150 2 0.4238 2.2869295999999997 3.10342 41.094459 +451 151 1 -0.8476 3.10342 3.10342 43.62052 +452 151 2 0.4238 3.9199104 3.10342 44.197879 +453 151 2 0.4238 2.2869295999999997 3.10342 44.197879 +454 152 1 -0.8476 3.10342 3.10342 46.72394 +455 152 2 0.4238 3.9199104 3.10342 47.301299 +456 152 2 0.4238 2.2869295999999997 3.10342 47.301299 +457 153 1 -0.8476 3.10342 3.10342 49.82736 +458 153 2 0.4238 3.9199104 3.10342 50.404719 +459 153 2 0.4238 2.2869295999999997 3.10342 50.404719 +460 154 1 -0.8476 3.10342 3.10342 52.93078 +461 154 2 0.4238 3.9199104 3.10342 53.508139 +462 154 2 0.4238 2.2869295999999997 3.10342 53.508139 +463 155 1 -0.8476 3.10342 3.10342 56.0342 +464 155 2 0.4238 3.9199104 3.10342 56.611559 +465 155 2 0.4238 2.2869295999999997 3.10342 56.611559 +466 156 1 -0.8476 3.10342 3.10342 59.13762 +467 156 2 0.4238 3.9199104 3.10342 59.714979 +468 156 2 0.4238 2.2869295999999997 3.10342 59.714979 +469 157 1 -0.8476 3.10342 3.10342 62.24104 +470 157 2 0.4238 3.9199104 3.10342 62.818399 +471 157 2 0.4238 2.2869295999999997 3.10342 62.818399 +472 158 1 -0.8476 3.10342 3.10342 65.34446 +473 158 2 0.4238 3.9199104 3.10342 65.921819 +474 158 2 0.4238 2.2869295999999997 3.10342 65.921819 +475 159 1 -0.8476 3.10342 3.10342 68.44788 +476 159 2 0.4238 3.9199104 3.10342 69.025239 +477 159 2 0.4238 2.2869295999999997 3.10342 69.025239 +478 160 1 -0.8476 3.10342 3.10342 71.5513 +479 160 2 0.4238 3.9199104 3.10342 72.128659 +480 160 2 0.4238 2.2869295999999997 3.10342 72.128659 +481 161 1 -0.8476 3.10342 6.20684 25.0 +482 161 2 0.4238 3.9199104 6.20684 25.577359 +483 161 2 0.4238 2.2869295999999997 6.20684 25.577359 +484 162 1 -0.8476 3.10342 6.20684 28.10342 +485 162 2 0.4238 3.9199104 6.20684 28.680779 +486 162 2 0.4238 2.2869295999999997 6.20684 28.680779 +487 163 1 -0.8476 3.10342 6.20684 31.20684 +488 163 2 0.4238 3.9199104 6.20684 31.784199 +489 163 2 0.4238 2.2869295999999997 6.20684 31.784199 +490 164 1 -0.8476 3.10342 6.20684 34.31026 +491 164 2 0.4238 3.9199104 6.20684 34.887619 +492 164 2 0.4238 2.2869295999999997 6.20684 34.887619 +493 165 1 -0.8476 3.10342 6.20684 37.41368 +494 165 2 0.4238 3.9199104 6.20684 37.991039 +495 165 2 0.4238 2.2869295999999997 6.20684 37.991039 +496 166 1 -0.8476 3.10342 6.20684 40.5171 +497 166 2 0.4238 3.9199104 6.20684 41.094459 +498 166 2 0.4238 2.2869295999999997 6.20684 41.094459 +499 167 1 -0.8476 3.10342 6.20684 43.62052 +500 167 2 0.4238 3.9199104 6.20684 44.197879 +501 167 2 0.4238 2.2869295999999997 6.20684 44.197879 +502 168 1 -0.8476 3.10342 6.20684 46.72394 +503 168 2 0.4238 3.9199104 6.20684 47.301299 +504 168 2 0.4238 2.2869295999999997 6.20684 47.301299 +505 169 1 -0.8476 3.10342 6.20684 49.82736 +506 169 2 0.4238 3.9199104 6.20684 50.404719 +507 169 2 0.4238 2.2869295999999997 6.20684 50.404719 +508 170 1 -0.8476 3.10342 6.20684 52.93078 +509 170 2 0.4238 3.9199104 6.20684 53.508139 +510 170 2 0.4238 2.2869295999999997 6.20684 53.508139 +511 171 1 -0.8476 3.10342 6.20684 56.0342 +512 171 2 0.4238 3.9199104 6.20684 56.611559 +513 171 2 0.4238 2.2869295999999997 6.20684 56.611559 +514 172 1 -0.8476 3.10342 6.20684 59.13762 +515 172 2 0.4238 3.9199104 6.20684 59.714979 +516 172 2 0.4238 2.2869295999999997 6.20684 59.714979 +517 173 1 -0.8476 3.10342 6.20684 62.24104 +518 173 2 0.4238 3.9199104 6.20684 62.818399 +519 173 2 0.4238 2.2869295999999997 6.20684 62.818399 +520 174 1 -0.8476 3.10342 6.20684 65.34446 +521 174 2 0.4238 3.9199104 6.20684 65.921819 +522 174 2 0.4238 2.2869295999999997 6.20684 65.921819 +523 175 1 -0.8476 3.10342 6.20684 68.44788 +524 175 2 0.4238 3.9199104 6.20684 69.025239 +525 175 2 0.4238 2.2869295999999997 6.20684 69.025239 +526 176 1 -0.8476 3.10342 6.20684 71.5513 +527 176 2 0.4238 3.9199104 6.20684 72.128659 +528 176 2 0.4238 2.2869295999999997 6.20684 72.128659 +529 177 1 -0.8476 3.10342 9.31026 25.0 +530 177 2 0.4238 3.9199104 9.31026 25.577359 +531 177 2 0.4238 2.2869295999999997 9.31026 25.577359 +532 178 1 -0.8476 3.10342 9.31026 28.10342 +533 178 2 0.4238 3.9199104 9.31026 28.680779 +534 178 2 0.4238 2.2869295999999997 9.31026 28.680779 +535 179 1 -0.8476 3.10342 9.31026 31.20684 +536 179 2 0.4238 3.9199104 9.31026 31.784199 +537 179 2 0.4238 2.2869295999999997 9.31026 31.784199 +538 180 1 -0.8476 3.10342 9.31026 34.31026 +539 180 2 0.4238 3.9199104 9.31026 34.887619 +540 180 2 0.4238 2.2869295999999997 9.31026 34.887619 +541 181 1 -0.8476 3.10342 9.31026 37.41368 +542 181 2 0.4238 3.9199104 9.31026 37.991039 +543 181 2 0.4238 2.2869295999999997 9.31026 37.991039 +544 182 1 -0.8476 3.10342 9.31026 40.5171 +545 182 2 0.4238 3.9199104 9.31026 41.094459 +546 182 2 0.4238 2.2869295999999997 9.31026 41.094459 +547 183 1 -0.8476 3.10342 9.31026 43.62052 +548 183 2 0.4238 3.9199104 9.31026 44.197879 +549 183 2 0.4238 2.2869295999999997 9.31026 44.197879 +550 184 1 -0.8476 3.10342 9.31026 46.72394 +551 184 2 0.4238 3.9199104 9.31026 47.301299 +552 184 2 0.4238 2.2869295999999997 9.31026 47.301299 +553 185 1 -0.8476 3.10342 9.31026 49.82736 +554 185 2 0.4238 3.9199104 9.31026 50.404719 +555 185 2 0.4238 2.2869295999999997 9.31026 50.404719 +556 186 1 -0.8476 3.10342 9.31026 52.93078 +557 186 2 0.4238 3.9199104 9.31026 53.508139 +558 186 2 0.4238 2.2869295999999997 9.31026 53.508139 +559 187 1 -0.8476 3.10342 9.31026 56.0342 +560 187 2 0.4238 3.9199104 9.31026 56.611559 +561 187 2 0.4238 2.2869295999999997 9.31026 56.611559 +562 188 1 -0.8476 3.10342 9.31026 59.13762 +563 188 2 0.4238 3.9199104 9.31026 59.714979 +564 188 2 0.4238 2.2869295999999997 9.31026 59.714979 +565 189 1 -0.8476 3.10342 9.31026 62.24104 +566 189 2 0.4238 3.9199104 9.31026 62.818399 +567 189 2 0.4238 2.2869295999999997 9.31026 62.818399 +568 190 1 -0.8476 3.10342 9.31026 65.34446 +569 190 2 0.4238 3.9199104 9.31026 65.921819 +570 190 2 0.4238 2.2869295999999997 9.31026 65.921819 +571 191 1 -0.8476 3.10342 9.31026 68.44788 +572 191 2 0.4238 3.9199104 9.31026 69.025239 +573 191 2 0.4238 2.2869295999999997 9.31026 69.025239 +574 192 1 -0.8476 3.10342 9.31026 71.5513 +575 192 2 0.4238 3.9199104 9.31026 72.128659 +576 192 2 0.4238 2.2869295999999997 9.31026 72.128659 +577 193 1 -0.8476 3.10342 12.41368 25.0 +578 193 2 0.4238 3.9199104 12.41368 25.577359 +579 193 2 0.4238 2.2869295999999997 12.41368 25.577359 +580 194 1 -0.8476 3.10342 12.41368 28.10342 +581 194 2 0.4238 3.9199104 12.41368 28.680779 +582 194 2 0.4238 2.2869295999999997 12.41368 28.680779 +583 195 1 -0.8476 3.10342 12.41368 31.20684 +584 195 2 0.4238 3.9199104 12.41368 31.784199 +585 195 2 0.4238 2.2869295999999997 12.41368 31.784199 +586 196 1 -0.8476 3.10342 12.41368 34.31026 +587 196 2 0.4238 3.9199104 12.41368 34.887619 +588 196 2 0.4238 2.2869295999999997 12.41368 34.887619 +589 197 1 -0.8476 3.10342 12.41368 37.41368 +590 197 2 0.4238 3.9199104 12.41368 37.991039 +591 197 2 0.4238 2.2869295999999997 12.41368 37.991039 +592 198 1 -0.8476 3.10342 12.41368 40.5171 +593 198 2 0.4238 3.9199104 12.41368 41.094459 +594 198 2 0.4238 2.2869295999999997 12.41368 41.094459 +595 199 1 -0.8476 3.10342 12.41368 43.62052 +596 199 2 0.4238 3.9199104 12.41368 44.197879 +597 199 2 0.4238 2.2869295999999997 12.41368 44.197879 +598 200 1 -0.8476 3.10342 12.41368 46.72394 +599 200 2 0.4238 3.9199104 12.41368 47.301299 +600 200 2 0.4238 2.2869295999999997 12.41368 47.301299 +601 201 1 -0.8476 3.10342 12.41368 49.82736 +602 201 2 0.4238 3.9199104 12.41368 50.404719 +603 201 2 0.4238 2.2869295999999997 12.41368 50.404719 +604 202 1 -0.8476 3.10342 12.41368 52.93078 +605 202 2 0.4238 3.9199104 12.41368 53.508139 +606 202 2 0.4238 2.2869295999999997 12.41368 53.508139 +607 203 1 -0.8476 3.10342 12.41368 56.0342 +608 203 2 0.4238 3.9199104 12.41368 56.611559 +609 203 2 0.4238 2.2869295999999997 12.41368 56.611559 +610 204 1 -0.8476 3.10342 12.41368 59.13762 +611 204 2 0.4238 3.9199104 12.41368 59.714979 +612 204 2 0.4238 2.2869295999999997 12.41368 59.714979 +613 205 1 -0.8476 3.10342 12.41368 62.24104 +614 205 2 0.4238 3.9199104 12.41368 62.818399 +615 205 2 0.4238 2.2869295999999997 12.41368 62.818399 +616 206 1 -0.8476 3.10342 12.41368 65.34446 +617 206 2 0.4238 3.9199104 12.41368 65.921819 +618 206 2 0.4238 2.2869295999999997 12.41368 65.921819 +619 207 1 -0.8476 3.10342 12.41368 68.44788 +620 207 2 0.4238 3.9199104 12.41368 69.025239 +621 207 2 0.4238 2.2869295999999997 12.41368 69.025239 +622 208 1 -0.8476 3.10342 12.41368 71.5513 +623 208 2 0.4238 3.9199104 12.41368 72.128659 +624 208 2 0.4238 2.2869295999999997 12.41368 72.128659 +625 209 1 -0.8476 3.10342 15.5171 25.0 +626 209 2 0.4238 3.9199104 15.5171 25.577359 +627 209 2 0.4238 2.2869295999999997 15.5171 25.577359 +628 210 1 -0.8476 3.10342 15.5171 28.10342 +629 210 2 0.4238 3.9199104 15.5171 28.680779 +630 210 2 0.4238 2.2869295999999997 15.5171 28.680779 +631 211 1 -0.8476 3.10342 15.5171 31.20684 +632 211 2 0.4238 3.9199104 15.5171 31.784199 +633 211 2 0.4238 2.2869295999999997 15.5171 31.784199 +634 212 1 -0.8476 3.10342 15.5171 34.31026 +635 212 2 0.4238 3.9199104 15.5171 34.887619 +636 212 2 0.4238 2.2869295999999997 15.5171 34.887619 +637 213 1 -0.8476 3.10342 15.5171 37.41368 +638 213 2 0.4238 3.9199104 15.5171 37.991039 +639 213 2 0.4238 2.2869295999999997 15.5171 37.991039 +640 214 1 -0.8476 3.10342 15.5171 40.5171 +641 214 2 0.4238 3.9199104 15.5171 41.094459 +642 214 2 0.4238 2.2869295999999997 15.5171 41.094459 +643 215 1 -0.8476 3.10342 15.5171 43.62052 +644 215 2 0.4238 3.9199104 15.5171 44.197879 +645 215 2 0.4238 2.2869295999999997 15.5171 44.197879 +646 216 1 -0.8476 3.10342 15.5171 46.72394 +647 216 2 0.4238 3.9199104 15.5171 47.301299 +648 216 2 0.4238 2.2869295999999997 15.5171 47.301299 +649 217 1 -0.8476 3.10342 15.5171 49.82736 +650 217 2 0.4238 3.9199104 15.5171 50.404719 +651 217 2 0.4238 2.2869295999999997 15.5171 50.404719 +652 218 1 -0.8476 3.10342 15.5171 52.93078 +653 218 2 0.4238 3.9199104 15.5171 53.508139 +654 218 2 0.4238 2.2869295999999997 15.5171 53.508139 +655 219 1 -0.8476 3.10342 15.5171 56.0342 +656 219 2 0.4238 3.9199104 15.5171 56.611559 +657 219 2 0.4238 2.2869295999999997 15.5171 56.611559 +658 220 1 -0.8476 3.10342 15.5171 59.13762 +659 220 2 0.4238 3.9199104 15.5171 59.714979 +660 220 2 0.4238 2.2869295999999997 15.5171 59.714979 +661 221 1 -0.8476 3.10342 15.5171 62.24104 +662 221 2 0.4238 3.9199104 15.5171 62.818399 +663 221 2 0.4238 2.2869295999999997 15.5171 62.818399 +664 222 1 -0.8476 3.10342 15.5171 65.34446 +665 222 2 0.4238 3.9199104 15.5171 65.921819 +666 222 2 0.4238 2.2869295999999997 15.5171 65.921819 +667 223 1 -0.8476 3.10342 15.5171 68.44788 +668 223 2 0.4238 3.9199104 15.5171 69.025239 +669 223 2 0.4238 2.2869295999999997 15.5171 69.025239 +670 224 1 -0.8476 3.10342 15.5171 71.5513 +671 224 2 0.4238 3.9199104 15.5171 72.128659 +672 224 2 0.4238 2.2869295999999997 15.5171 72.128659 +673 225 1 -0.8476 3.10342 18.62052 25.0 +674 225 2 0.4238 3.9199104 18.62052 25.577359 +675 225 2 0.4238 2.2869295999999997 18.62052 25.577359 +676 226 1 -0.8476 3.10342 18.62052 28.10342 +677 226 2 0.4238 3.9199104 18.62052 28.680779 +678 226 2 0.4238 2.2869295999999997 18.62052 28.680779 +679 227 1 -0.8476 3.10342 18.62052 31.20684 +680 227 2 0.4238 3.9199104 18.62052 31.784199 +681 227 2 0.4238 2.2869295999999997 18.62052 31.784199 +682 228 1 -0.8476 3.10342 18.62052 34.31026 +683 228 2 0.4238 3.9199104 18.62052 34.887619 +684 228 2 0.4238 2.2869295999999997 18.62052 34.887619 +685 229 1 -0.8476 3.10342 18.62052 37.41368 +686 229 2 0.4238 3.9199104 18.62052 37.991039 +687 229 2 0.4238 2.2869295999999997 18.62052 37.991039 +688 230 1 -0.8476 3.10342 18.62052 40.5171 +689 230 2 0.4238 3.9199104 18.62052 41.094459 +690 230 2 0.4238 2.2869295999999997 18.62052 41.094459 +691 231 1 -0.8476 3.10342 18.62052 43.62052 +692 231 2 0.4238 3.9199104 18.62052 44.197879 +693 231 2 0.4238 2.2869295999999997 18.62052 44.197879 +694 232 1 -0.8476 3.10342 18.62052 46.72394 +695 232 2 0.4238 3.9199104 18.62052 47.301299 +696 232 2 0.4238 2.2869295999999997 18.62052 47.301299 +697 233 1 -0.8476 3.10342 18.62052 49.82736 +698 233 2 0.4238 3.9199104 18.62052 50.404719 +699 233 2 0.4238 2.2869295999999997 18.62052 50.404719 +700 234 1 -0.8476 3.10342 18.62052 52.93078 +701 234 2 0.4238 3.9199104 18.62052 53.508139 +702 234 2 0.4238 2.2869295999999997 18.62052 53.508139 +703 235 1 -0.8476 3.10342 18.62052 56.0342 +704 235 2 0.4238 3.9199104 18.62052 56.611559 +705 235 2 0.4238 2.2869295999999997 18.62052 56.611559 +706 236 1 -0.8476 3.10342 18.62052 59.13762 +707 236 2 0.4238 3.9199104 18.62052 59.714979 +708 236 2 0.4238 2.2869295999999997 18.62052 59.714979 +709 237 1 -0.8476 3.10342 18.62052 62.24104 +710 237 2 0.4238 3.9199104 18.62052 62.818399 +711 237 2 0.4238 2.2869295999999997 18.62052 62.818399 +712 238 1 -0.8476 3.10342 18.62052 65.34446 +713 238 2 0.4238 3.9199104 18.62052 65.921819 +714 238 2 0.4238 2.2869295999999997 18.62052 65.921819 +715 239 1 -0.8476 3.10342 18.62052 68.44788 +716 239 2 0.4238 3.9199104 18.62052 69.025239 +717 239 2 0.4238 2.2869295999999997 18.62052 69.025239 +718 240 1 -0.8476 3.10342 18.62052 71.5513 +719 240 2 0.4238 3.9199104 18.62052 72.128659 +720 240 2 0.4238 2.2869295999999997 18.62052 72.128659 +721 241 1 -0.8476 3.10342 21.72394 25.0 +722 241 2 0.4238 3.9199104 21.72394 25.577359 +723 241 2 0.4238 2.2869295999999997 21.72394 25.577359 +724 242 1 -0.8476 3.10342 21.72394 28.10342 +725 242 2 0.4238 3.9199104 21.72394 28.680779 +726 242 2 0.4238 2.2869295999999997 21.72394 28.680779 +727 243 1 -0.8476 3.10342 21.72394 31.20684 +728 243 2 0.4238 3.9199104 21.72394 31.784199 +729 243 2 0.4238 2.2869295999999997 21.72394 31.784199 +730 244 1 -0.8476 3.10342 21.72394 34.31026 +731 244 2 0.4238 3.9199104 21.72394 34.887619 +732 244 2 0.4238 2.2869295999999997 21.72394 34.887619 +733 245 1 -0.8476 3.10342 21.72394 37.41368 +734 245 2 0.4238 3.9199104 21.72394 37.991039 +735 245 2 0.4238 2.2869295999999997 21.72394 37.991039 +736 246 1 -0.8476 3.10342 21.72394 40.5171 +737 246 2 0.4238 3.9199104 21.72394 41.094459 +738 246 2 0.4238 2.2869295999999997 21.72394 41.094459 +739 247 1 -0.8476 3.10342 21.72394 43.62052 +740 247 2 0.4238 3.9199104 21.72394 44.197879 +741 247 2 0.4238 2.2869295999999997 21.72394 44.197879 +742 248 1 -0.8476 3.10342 21.72394 46.72394 +743 248 2 0.4238 3.9199104 21.72394 47.301299 +744 248 2 0.4238 2.2869295999999997 21.72394 47.301299 +745 249 1 -0.8476 3.10342 21.72394 49.82736 +746 249 2 0.4238 3.9199104 21.72394 50.404719 +747 249 2 0.4238 2.2869295999999997 21.72394 50.404719 +748 250 1 -0.8476 3.10342 21.72394 52.93078 +749 250 2 0.4238 3.9199104 21.72394 53.508139 +750 250 2 0.4238 2.2869295999999997 21.72394 53.508139 +751 251 1 -0.8476 3.10342 21.72394 56.0342 +752 251 2 0.4238 3.9199104 21.72394 56.611559 +753 251 2 0.4238 2.2869295999999997 21.72394 56.611559 +754 252 1 -0.8476 3.10342 21.72394 59.13762 +755 252 2 0.4238 3.9199104 21.72394 59.714979 +756 252 2 0.4238 2.2869295999999997 21.72394 59.714979 +757 253 1 -0.8476 3.10342 21.72394 62.24104 +758 253 2 0.4238 3.9199104 21.72394 62.818399 +759 253 2 0.4238 2.2869295999999997 21.72394 62.818399 +760 254 1 -0.8476 3.10342 21.72394 65.34446 +761 254 2 0.4238 3.9199104 21.72394 65.921819 +762 254 2 0.4238 2.2869295999999997 21.72394 65.921819 +763 255 1 -0.8476 3.10342 21.72394 68.44788 +764 255 2 0.4238 3.9199104 21.72394 69.025239 +765 255 2 0.4238 2.2869295999999997 21.72394 69.025239 +766 256 1 -0.8476 3.10342 21.72394 71.5513 +767 256 2 0.4238 3.9199104 21.72394 72.128659 +768 256 2 0.4238 2.2869295999999997 21.72394 72.128659 +769 257 1 -0.8476 6.20684 0.0 25.0 +770 257 2 0.4238 7.0233304 0.0 25.577359 +771 257 2 0.4238 5.3903495999999995 0.0 25.577359 +772 258 1 -0.8476 6.20684 0.0 28.10342 +773 258 2 0.4238 7.0233304 0.0 28.680779 +774 258 2 0.4238 5.3903495999999995 0.0 28.680779 +775 259 1 -0.8476 6.20684 0.0 31.20684 +776 259 2 0.4238 7.0233304 0.0 31.784199 +777 259 2 0.4238 5.3903495999999995 0.0 31.784199 +778 260 1 -0.8476 6.20684 0.0 34.31026 +779 260 2 0.4238 7.0233304 0.0 34.887619 +780 260 2 0.4238 5.3903495999999995 0.0 34.887619 +781 261 1 -0.8476 6.20684 0.0 37.41368 +782 261 2 0.4238 7.0233304 0.0 37.991039 +783 261 2 0.4238 5.3903495999999995 0.0 37.991039 +784 262 1 -0.8476 6.20684 0.0 40.5171 +785 262 2 0.4238 7.0233304 0.0 41.094459 +786 262 2 0.4238 5.3903495999999995 0.0 41.094459 +787 263 1 -0.8476 6.20684 0.0 43.62052 +788 263 2 0.4238 7.0233304 0.0 44.197879 +789 263 2 0.4238 5.3903495999999995 0.0 44.197879 +790 264 1 -0.8476 6.20684 0.0 46.72394 +791 264 2 0.4238 7.0233304 0.0 47.301299 +792 264 2 0.4238 5.3903495999999995 0.0 47.301299 +793 265 1 -0.8476 6.20684 0.0 49.82736 +794 265 2 0.4238 7.0233304 0.0 50.404719 +795 265 2 0.4238 5.3903495999999995 0.0 50.404719 +796 266 1 -0.8476 6.20684 0.0 52.93078 +797 266 2 0.4238 7.0233304 0.0 53.508139 +798 266 2 0.4238 5.3903495999999995 0.0 53.508139 +799 267 1 -0.8476 6.20684 0.0 56.0342 +800 267 2 0.4238 7.0233304 0.0 56.611559 +801 267 2 0.4238 5.3903495999999995 0.0 56.611559 +802 268 1 -0.8476 6.20684 0.0 59.13762 +803 268 2 0.4238 7.0233304 0.0 59.714979 +804 268 2 0.4238 5.3903495999999995 0.0 59.714979 +805 269 1 -0.8476 6.20684 0.0 62.24104 +806 269 2 0.4238 7.0233304 0.0 62.818399 +807 269 2 0.4238 5.3903495999999995 0.0 62.818399 +808 270 1 -0.8476 6.20684 0.0 65.34446 +809 270 2 0.4238 7.0233304 0.0 65.921819 +810 270 2 0.4238 5.3903495999999995 0.0 65.921819 +811 271 1 -0.8476 6.20684 0.0 68.44788 +812 271 2 0.4238 7.0233304 0.0 69.025239 +813 271 2 0.4238 5.3903495999999995 0.0 69.025239 +814 272 1 -0.8476 6.20684 0.0 71.5513 +815 272 2 0.4238 7.0233304 0.0 72.128659 +816 272 2 0.4238 5.3903495999999995 0.0 72.128659 +817 273 1 -0.8476 6.20684 3.10342 25.0 +818 273 2 0.4238 7.0233304 3.10342 25.577359 +819 273 2 0.4238 5.3903495999999995 3.10342 25.577359 +820 274 1 -0.8476 6.20684 3.10342 28.10342 +821 274 2 0.4238 7.0233304 3.10342 28.680779 +822 274 2 0.4238 5.3903495999999995 3.10342 28.680779 +823 275 1 -0.8476 6.20684 3.10342 31.20684 +824 275 2 0.4238 7.0233304 3.10342 31.784199 +825 275 2 0.4238 5.3903495999999995 3.10342 31.784199 +826 276 1 -0.8476 6.20684 3.10342 34.31026 +827 276 2 0.4238 7.0233304 3.10342 34.887619 +828 276 2 0.4238 5.3903495999999995 3.10342 34.887619 +829 277 1 -0.8476 6.20684 3.10342 37.41368 +830 277 2 0.4238 7.0233304 3.10342 37.991039 +831 277 2 0.4238 5.3903495999999995 3.10342 37.991039 +832 278 1 -0.8476 6.20684 3.10342 40.5171 +833 278 2 0.4238 7.0233304 3.10342 41.094459 +834 278 2 0.4238 5.3903495999999995 3.10342 41.094459 +835 279 1 -0.8476 6.20684 3.10342 43.62052 +836 279 2 0.4238 7.0233304 3.10342 44.197879 +837 279 2 0.4238 5.3903495999999995 3.10342 44.197879 +838 280 1 -0.8476 6.20684 3.10342 46.72394 +839 280 2 0.4238 7.0233304 3.10342 47.301299 +840 280 2 0.4238 5.3903495999999995 3.10342 47.301299 +841 281 1 -0.8476 6.20684 3.10342 49.82736 +842 281 2 0.4238 7.0233304 3.10342 50.404719 +843 281 2 0.4238 5.3903495999999995 3.10342 50.404719 +844 282 1 -0.8476 6.20684 3.10342 52.93078 +845 282 2 0.4238 7.0233304 3.10342 53.508139 +846 282 2 0.4238 5.3903495999999995 3.10342 53.508139 +847 283 1 -0.8476 6.20684 3.10342 56.0342 +848 283 2 0.4238 7.0233304 3.10342 56.611559 +849 283 2 0.4238 5.3903495999999995 3.10342 56.611559 +850 284 1 -0.8476 6.20684 3.10342 59.13762 +851 284 2 0.4238 7.0233304 3.10342 59.714979 +852 284 2 0.4238 5.3903495999999995 3.10342 59.714979 +853 285 1 -0.8476 6.20684 3.10342 62.24104 +854 285 2 0.4238 7.0233304 3.10342 62.818399 +855 285 2 0.4238 5.3903495999999995 3.10342 62.818399 +856 286 1 -0.8476 6.20684 3.10342 65.34446 +857 286 2 0.4238 7.0233304 3.10342 65.921819 +858 286 2 0.4238 5.3903495999999995 3.10342 65.921819 +859 287 1 -0.8476 6.20684 3.10342 68.44788 +860 287 2 0.4238 7.0233304 3.10342 69.025239 +861 287 2 0.4238 5.3903495999999995 3.10342 69.025239 +862 288 1 -0.8476 6.20684 3.10342 71.5513 +863 288 2 0.4238 7.0233304 3.10342 72.128659 +864 288 2 0.4238 5.3903495999999995 3.10342 72.128659 +865 289 1 -0.8476 6.20684 6.20684 25.0 +866 289 2 0.4238 7.0233304 6.20684 25.577359 +867 289 2 0.4238 5.3903495999999995 6.20684 25.577359 +868 290 1 -0.8476 6.20684 6.20684 28.10342 +869 290 2 0.4238 7.0233304 6.20684 28.680779 +870 290 2 0.4238 5.3903495999999995 6.20684 28.680779 +871 291 1 -0.8476 6.20684 6.20684 31.20684 +872 291 2 0.4238 7.0233304 6.20684 31.784199 +873 291 2 0.4238 5.3903495999999995 6.20684 31.784199 +874 292 1 -0.8476 6.20684 6.20684 34.31026 +875 292 2 0.4238 7.0233304 6.20684 34.887619 +876 292 2 0.4238 5.3903495999999995 6.20684 34.887619 +877 293 1 -0.8476 6.20684 6.20684 37.41368 +878 293 2 0.4238 7.0233304 6.20684 37.991039 +879 293 2 0.4238 5.3903495999999995 6.20684 37.991039 +880 294 1 -0.8476 6.20684 6.20684 40.5171 +881 294 2 0.4238 7.0233304 6.20684 41.094459 +882 294 2 0.4238 5.3903495999999995 6.20684 41.094459 +883 295 1 -0.8476 6.20684 6.20684 43.62052 +884 295 2 0.4238 7.0233304 6.20684 44.197879 +885 295 2 0.4238 5.3903495999999995 6.20684 44.197879 +886 296 1 -0.8476 6.20684 6.20684 46.72394 +887 296 2 0.4238 7.0233304 6.20684 47.301299 +888 296 2 0.4238 5.3903495999999995 6.20684 47.301299 +889 297 1 -0.8476 6.20684 6.20684 49.82736 +890 297 2 0.4238 7.0233304 6.20684 50.404719 +891 297 2 0.4238 5.3903495999999995 6.20684 50.404719 +892 298 1 -0.8476 6.20684 6.20684 52.93078 +893 298 2 0.4238 7.0233304 6.20684 53.508139 +894 298 2 0.4238 5.3903495999999995 6.20684 53.508139 +895 299 1 -0.8476 6.20684 6.20684 56.0342 +896 299 2 0.4238 7.0233304 6.20684 56.611559 +897 299 2 0.4238 5.3903495999999995 6.20684 56.611559 +898 300 1 -0.8476 6.20684 6.20684 59.13762 +899 300 2 0.4238 7.0233304 6.20684 59.714979 +900 300 2 0.4238 5.3903495999999995 6.20684 59.714979 +901 301 1 -0.8476 6.20684 6.20684 62.24104 +902 301 2 0.4238 7.0233304 6.20684 62.818399 +903 301 2 0.4238 5.3903495999999995 6.20684 62.818399 +904 302 1 -0.8476 6.20684 6.20684 65.34446 +905 302 2 0.4238 7.0233304 6.20684 65.921819 +906 302 2 0.4238 5.3903495999999995 6.20684 65.921819 +907 303 1 -0.8476 6.20684 6.20684 68.44788 +908 303 2 0.4238 7.0233304 6.20684 69.025239 +909 303 2 0.4238 5.3903495999999995 6.20684 69.025239 +910 304 1 -0.8476 6.20684 6.20684 71.5513 +911 304 2 0.4238 7.0233304 6.20684 72.128659 +912 304 2 0.4238 5.3903495999999995 6.20684 72.128659 +913 305 1 -0.8476 6.20684 9.31026 25.0 +914 305 2 0.4238 7.0233304 9.31026 25.577359 +915 305 2 0.4238 5.3903495999999995 9.31026 25.577359 +916 306 1 -0.8476 6.20684 9.31026 28.10342 +917 306 2 0.4238 7.0233304 9.31026 28.680779 +918 306 2 0.4238 5.3903495999999995 9.31026 28.680779 +919 307 1 -0.8476 6.20684 9.31026 31.20684 +920 307 2 0.4238 7.0233304 9.31026 31.784199 +921 307 2 0.4238 5.3903495999999995 9.31026 31.784199 +922 308 1 -0.8476 6.20684 9.31026 34.31026 +923 308 2 0.4238 7.0233304 9.31026 34.887619 +924 308 2 0.4238 5.3903495999999995 9.31026 34.887619 +925 309 1 -0.8476 6.20684 9.31026 37.41368 +926 309 2 0.4238 7.0233304 9.31026 37.991039 +927 309 2 0.4238 5.3903495999999995 9.31026 37.991039 +928 310 1 -0.8476 6.20684 9.31026 40.5171 +929 310 2 0.4238 7.0233304 9.31026 41.094459 +930 310 2 0.4238 5.3903495999999995 9.31026 41.094459 +931 311 1 -0.8476 6.20684 9.31026 43.62052 +932 311 2 0.4238 7.0233304 9.31026 44.197879 +933 311 2 0.4238 5.3903495999999995 9.31026 44.197879 +934 312 1 -0.8476 6.20684 9.31026 46.72394 +935 312 2 0.4238 7.0233304 9.31026 47.301299 +936 312 2 0.4238 5.3903495999999995 9.31026 47.301299 +937 313 1 -0.8476 6.20684 9.31026 49.82736 +938 313 2 0.4238 7.0233304 9.31026 50.404719 +939 313 2 0.4238 5.3903495999999995 9.31026 50.404719 +940 314 1 -0.8476 6.20684 9.31026 52.93078 +941 314 2 0.4238 7.0233304 9.31026 53.508139 +942 314 2 0.4238 5.3903495999999995 9.31026 53.508139 +943 315 1 -0.8476 6.20684 9.31026 56.0342 +944 315 2 0.4238 7.0233304 9.31026 56.611559 +945 315 2 0.4238 5.3903495999999995 9.31026 56.611559 +946 316 1 -0.8476 6.20684 9.31026 59.13762 +947 316 2 0.4238 7.0233304 9.31026 59.714979 +948 316 2 0.4238 5.3903495999999995 9.31026 59.714979 +949 317 1 -0.8476 6.20684 9.31026 62.24104 +950 317 2 0.4238 7.0233304 9.31026 62.818399 +951 317 2 0.4238 5.3903495999999995 9.31026 62.818399 +952 318 1 -0.8476 6.20684 9.31026 65.34446 +953 318 2 0.4238 7.0233304 9.31026 65.921819 +954 318 2 0.4238 5.3903495999999995 9.31026 65.921819 +955 319 1 -0.8476 6.20684 9.31026 68.44788 +956 319 2 0.4238 7.0233304 9.31026 69.025239 +957 319 2 0.4238 5.3903495999999995 9.31026 69.025239 +958 320 1 -0.8476 6.20684 9.31026 71.5513 +959 320 2 0.4238 7.0233304 9.31026 72.128659 +960 320 2 0.4238 5.3903495999999995 9.31026 72.128659 +961 321 1 -0.8476 6.20684 12.41368 25.0 +962 321 2 0.4238 7.0233304 12.41368 25.577359 +963 321 2 0.4238 5.3903495999999995 12.41368 25.577359 +964 322 1 -0.8476 6.20684 12.41368 28.10342 +965 322 2 0.4238 7.0233304 12.41368 28.680779 +966 322 2 0.4238 5.3903495999999995 12.41368 28.680779 +967 323 1 -0.8476 6.20684 12.41368 31.20684 +968 323 2 0.4238 7.0233304 12.41368 31.784199 +969 323 2 0.4238 5.3903495999999995 12.41368 31.784199 +970 324 1 -0.8476 6.20684 12.41368 34.31026 +971 324 2 0.4238 7.0233304 12.41368 34.887619 +972 324 2 0.4238 5.3903495999999995 12.41368 34.887619 +973 325 1 -0.8476 6.20684 12.41368 37.41368 +974 325 2 0.4238 7.0233304 12.41368 37.991039 +975 325 2 0.4238 5.3903495999999995 12.41368 37.991039 +976 326 1 -0.8476 6.20684 12.41368 40.5171 +977 326 2 0.4238 7.0233304 12.41368 41.094459 +978 326 2 0.4238 5.3903495999999995 12.41368 41.094459 +979 327 1 -0.8476 6.20684 12.41368 43.62052 +980 327 2 0.4238 7.0233304 12.41368 44.197879 +981 327 2 0.4238 5.3903495999999995 12.41368 44.197879 +982 328 1 -0.8476 6.20684 12.41368 46.72394 +983 328 2 0.4238 7.0233304 12.41368 47.301299 +984 328 2 0.4238 5.3903495999999995 12.41368 47.301299 +985 329 1 -0.8476 6.20684 12.41368 49.82736 +986 329 2 0.4238 7.0233304 12.41368 50.404719 +987 329 2 0.4238 5.3903495999999995 12.41368 50.404719 +988 330 1 -0.8476 6.20684 12.41368 52.93078 +989 330 2 0.4238 7.0233304 12.41368 53.508139 +990 330 2 0.4238 5.3903495999999995 12.41368 53.508139 +991 331 1 -0.8476 6.20684 12.41368 56.0342 +992 331 2 0.4238 7.0233304 12.41368 56.611559 +993 331 2 0.4238 5.3903495999999995 12.41368 56.611559 +994 332 1 -0.8476 6.20684 12.41368 59.13762 +995 332 2 0.4238 7.0233304 12.41368 59.714979 +996 332 2 0.4238 5.3903495999999995 12.41368 59.714979 +997 333 1 -0.8476 6.20684 12.41368 62.24104 +998 333 2 0.4238 7.0233304 12.41368 62.818399 +999 333 2 0.4238 5.3903495999999995 12.41368 62.818399 +1000 334 1 -0.8476 6.20684 12.41368 65.34446 +1001 334 2 0.4238 7.0233304 12.41368 65.921819 +1002 334 2 0.4238 5.3903495999999995 12.41368 65.921819 +1003 335 1 -0.8476 6.20684 12.41368 68.44788 +1004 335 2 0.4238 7.0233304 12.41368 69.025239 +1005 335 2 0.4238 5.3903495999999995 12.41368 69.025239 +1006 336 1 -0.8476 6.20684 12.41368 71.5513 +1007 336 2 0.4238 7.0233304 12.41368 72.128659 +1008 336 2 0.4238 5.3903495999999995 12.41368 72.128659 +1009 337 1 -0.8476 6.20684 15.5171 25.0 +1010 337 2 0.4238 7.0233304 15.5171 25.577359 +1011 337 2 0.4238 5.3903495999999995 15.5171 25.577359 +1012 338 1 -0.8476 6.20684 15.5171 28.10342 +1013 338 2 0.4238 7.0233304 15.5171 28.680779 +1014 338 2 0.4238 5.3903495999999995 15.5171 28.680779 +1015 339 1 -0.8476 6.20684 15.5171 31.20684 +1016 339 2 0.4238 7.0233304 15.5171 31.784199 +1017 339 2 0.4238 5.3903495999999995 15.5171 31.784199 +1018 340 1 -0.8476 6.20684 15.5171 34.31026 +1019 340 2 0.4238 7.0233304 15.5171 34.887619 +1020 340 2 0.4238 5.3903495999999995 15.5171 34.887619 +1021 341 1 -0.8476 6.20684 15.5171 37.41368 +1022 341 2 0.4238 7.0233304 15.5171 37.991039 +1023 341 2 0.4238 5.3903495999999995 15.5171 37.991039 +1024 342 1 -0.8476 6.20684 15.5171 40.5171 +1025 342 2 0.4238 7.0233304 15.5171 41.094459 +1026 342 2 0.4238 5.3903495999999995 15.5171 41.094459 +1027 343 1 -0.8476 6.20684 15.5171 43.62052 +1028 343 2 0.4238 7.0233304 15.5171 44.197879 +1029 343 2 0.4238 5.3903495999999995 15.5171 44.197879 +1030 344 1 -0.8476 6.20684 15.5171 46.72394 +1031 344 2 0.4238 7.0233304 15.5171 47.301299 +1032 344 2 0.4238 5.3903495999999995 15.5171 47.301299 +1033 345 1 -0.8476 6.20684 15.5171 49.82736 +1034 345 2 0.4238 7.0233304 15.5171 50.404719 +1035 345 2 0.4238 5.3903495999999995 15.5171 50.404719 +1036 346 1 -0.8476 6.20684 15.5171 52.93078 +1037 346 2 0.4238 7.0233304 15.5171 53.508139 +1038 346 2 0.4238 5.3903495999999995 15.5171 53.508139 +1039 347 1 -0.8476 6.20684 15.5171 56.0342 +1040 347 2 0.4238 7.0233304 15.5171 56.611559 +1041 347 2 0.4238 5.3903495999999995 15.5171 56.611559 +1042 348 1 -0.8476 6.20684 15.5171 59.13762 +1043 348 2 0.4238 7.0233304 15.5171 59.714979 +1044 348 2 0.4238 5.3903495999999995 15.5171 59.714979 +1045 349 1 -0.8476 6.20684 15.5171 62.24104 +1046 349 2 0.4238 7.0233304 15.5171 62.818399 +1047 349 2 0.4238 5.3903495999999995 15.5171 62.818399 +1048 350 1 -0.8476 6.20684 15.5171 65.34446 +1049 350 2 0.4238 7.0233304 15.5171 65.921819 +1050 350 2 0.4238 5.3903495999999995 15.5171 65.921819 +1051 351 1 -0.8476 6.20684 15.5171 68.44788 +1052 351 2 0.4238 7.0233304 15.5171 69.025239 +1053 351 2 0.4238 5.3903495999999995 15.5171 69.025239 +1054 352 1 -0.8476 6.20684 15.5171 71.5513 +1055 352 2 0.4238 7.0233304 15.5171 72.128659 +1056 352 2 0.4238 5.3903495999999995 15.5171 72.128659 +1057 353 1 -0.8476 6.20684 18.62052 25.0 +1058 353 2 0.4238 7.0233304 18.62052 25.577359 +1059 353 2 0.4238 5.3903495999999995 18.62052 25.577359 +1060 354 1 -0.8476 6.20684 18.62052 28.10342 +1061 354 2 0.4238 7.0233304 18.62052 28.680779 +1062 354 2 0.4238 5.3903495999999995 18.62052 28.680779 +1063 355 1 -0.8476 6.20684 18.62052 31.20684 +1064 355 2 0.4238 7.0233304 18.62052 31.784199 +1065 355 2 0.4238 5.3903495999999995 18.62052 31.784199 +1066 356 1 -0.8476 6.20684 18.62052 34.31026 +1067 356 2 0.4238 7.0233304 18.62052 34.887619 +1068 356 2 0.4238 5.3903495999999995 18.62052 34.887619 +1069 357 1 -0.8476 6.20684 18.62052 37.41368 +1070 357 2 0.4238 7.0233304 18.62052 37.991039 +1071 357 2 0.4238 5.3903495999999995 18.62052 37.991039 +1072 358 1 -0.8476 6.20684 18.62052 40.5171 +1073 358 2 0.4238 7.0233304 18.62052 41.094459 +1074 358 2 0.4238 5.3903495999999995 18.62052 41.094459 +1075 359 1 -0.8476 6.20684 18.62052 43.62052 +1076 359 2 0.4238 7.0233304 18.62052 44.197879 +1077 359 2 0.4238 5.3903495999999995 18.62052 44.197879 +1078 360 1 -0.8476 6.20684 18.62052 46.72394 +1079 360 2 0.4238 7.0233304 18.62052 47.301299 +1080 360 2 0.4238 5.3903495999999995 18.62052 47.301299 +1081 361 1 -0.8476 6.20684 18.62052 49.82736 +1082 361 2 0.4238 7.0233304 18.62052 50.404719 +1083 361 2 0.4238 5.3903495999999995 18.62052 50.404719 +1084 362 1 -0.8476 6.20684 18.62052 52.93078 +1085 362 2 0.4238 7.0233304 18.62052 53.508139 +1086 362 2 0.4238 5.3903495999999995 18.62052 53.508139 +1087 363 1 -0.8476 6.20684 18.62052 56.0342 +1088 363 2 0.4238 7.0233304 18.62052 56.611559 +1089 363 2 0.4238 5.3903495999999995 18.62052 56.611559 +1090 364 1 -0.8476 6.20684 18.62052 59.13762 +1091 364 2 0.4238 7.0233304 18.62052 59.714979 +1092 364 2 0.4238 5.3903495999999995 18.62052 59.714979 +1093 365 1 -0.8476 6.20684 18.62052 62.24104 +1094 365 2 0.4238 7.0233304 18.62052 62.818399 +1095 365 2 0.4238 5.3903495999999995 18.62052 62.818399 +1096 366 1 -0.8476 6.20684 18.62052 65.34446 +1097 366 2 0.4238 7.0233304 18.62052 65.921819 +1098 366 2 0.4238 5.3903495999999995 18.62052 65.921819 +1099 367 1 -0.8476 6.20684 18.62052 68.44788 +1100 367 2 0.4238 7.0233304 18.62052 69.025239 +1101 367 2 0.4238 5.3903495999999995 18.62052 69.025239 +1102 368 1 -0.8476 6.20684 18.62052 71.5513 +1103 368 2 0.4238 7.0233304 18.62052 72.128659 +1104 368 2 0.4238 5.3903495999999995 18.62052 72.128659 +1105 369 1 -0.8476 6.20684 21.72394 25.0 +1106 369 2 0.4238 7.0233304 21.72394 25.577359 +1107 369 2 0.4238 5.3903495999999995 21.72394 25.577359 +1108 370 1 -0.8476 6.20684 21.72394 28.10342 +1109 370 2 0.4238 7.0233304 21.72394 28.680779 +1110 370 2 0.4238 5.3903495999999995 21.72394 28.680779 +1111 371 1 -0.8476 6.20684 21.72394 31.20684 +1112 371 2 0.4238 7.0233304 21.72394 31.784199 +1113 371 2 0.4238 5.3903495999999995 21.72394 31.784199 +1114 372 1 -0.8476 6.20684 21.72394 34.31026 +1115 372 2 0.4238 7.0233304 21.72394 34.887619 +1116 372 2 0.4238 5.3903495999999995 21.72394 34.887619 +1117 373 1 -0.8476 6.20684 21.72394 37.41368 +1118 373 2 0.4238 7.0233304 21.72394 37.991039 +1119 373 2 0.4238 5.3903495999999995 21.72394 37.991039 +1120 374 1 -0.8476 6.20684 21.72394 40.5171 +1121 374 2 0.4238 7.0233304 21.72394 41.094459 +1122 374 2 0.4238 5.3903495999999995 21.72394 41.094459 +1123 375 1 -0.8476 6.20684 21.72394 43.62052 +1124 375 2 0.4238 7.0233304 21.72394 44.197879 +1125 375 2 0.4238 5.3903495999999995 21.72394 44.197879 +1126 376 1 -0.8476 6.20684 21.72394 46.72394 +1127 376 2 0.4238 7.0233304 21.72394 47.301299 +1128 376 2 0.4238 5.3903495999999995 21.72394 47.301299 +1129 377 1 -0.8476 6.20684 21.72394 49.82736 +1130 377 2 0.4238 7.0233304 21.72394 50.404719 +1131 377 2 0.4238 5.3903495999999995 21.72394 50.404719 +1132 378 1 -0.8476 6.20684 21.72394 52.93078 +1133 378 2 0.4238 7.0233304 21.72394 53.508139 +1134 378 2 0.4238 5.3903495999999995 21.72394 53.508139 +1135 379 1 -0.8476 6.20684 21.72394 56.0342 +1136 379 2 0.4238 7.0233304 21.72394 56.611559 +1137 379 2 0.4238 5.3903495999999995 21.72394 56.611559 +1138 380 1 -0.8476 6.20684 21.72394 59.13762 +1139 380 2 0.4238 7.0233304 21.72394 59.714979 +1140 380 2 0.4238 5.3903495999999995 21.72394 59.714979 +1141 381 1 -0.8476 6.20684 21.72394 62.24104 +1142 381 2 0.4238 7.0233304 21.72394 62.818399 +1143 381 2 0.4238 5.3903495999999995 21.72394 62.818399 +1144 382 1 -0.8476 6.20684 21.72394 65.34446 +1145 382 2 0.4238 7.0233304 21.72394 65.921819 +1146 382 2 0.4238 5.3903495999999995 21.72394 65.921819 +1147 383 1 -0.8476 6.20684 21.72394 68.44788 +1148 383 2 0.4238 7.0233304 21.72394 69.025239 +1149 383 2 0.4238 5.3903495999999995 21.72394 69.025239 +1150 384 1 -0.8476 6.20684 21.72394 71.5513 +1151 384 2 0.4238 7.0233304 21.72394 72.128659 +1152 384 2 0.4238 5.3903495999999995 21.72394 72.128659 +1153 385 1 -0.8476 9.31026 0.0 25.0 +1154 385 2 0.4238 10.126750399999999 0.0 25.577359 +1155 385 2 0.4238 8.4937696 0.0 25.577359 +1156 386 1 -0.8476 9.31026 0.0 28.10342 +1157 386 2 0.4238 10.126750399999999 0.0 28.680779 +1158 386 2 0.4238 8.4937696 0.0 28.680779 +1159 387 1 -0.8476 9.31026 0.0 31.20684 +1160 387 2 0.4238 10.126750399999999 0.0 31.784199 +1161 387 2 0.4238 8.4937696 0.0 31.784199 +1162 388 1 -0.8476 9.31026 0.0 34.31026 +1163 388 2 0.4238 10.126750399999999 0.0 34.887619 +1164 388 2 0.4238 8.4937696 0.0 34.887619 +1165 389 1 -0.8476 9.31026 0.0 37.41368 +1166 389 2 0.4238 10.126750399999999 0.0 37.991039 +1167 389 2 0.4238 8.4937696 0.0 37.991039 +1168 390 1 -0.8476 9.31026 0.0 40.5171 +1169 390 2 0.4238 10.126750399999999 0.0 41.094459 +1170 390 2 0.4238 8.4937696 0.0 41.094459 +1171 391 1 -0.8476 9.31026 0.0 43.62052 +1172 391 2 0.4238 10.126750399999999 0.0 44.197879 +1173 391 2 0.4238 8.4937696 0.0 44.197879 +1174 392 1 -0.8476 9.31026 0.0 46.72394 +1175 392 2 0.4238 10.126750399999999 0.0 47.301299 +1176 392 2 0.4238 8.4937696 0.0 47.301299 +1177 393 1 -0.8476 9.31026 0.0 49.82736 +1178 393 2 0.4238 10.126750399999999 0.0 50.404719 +1179 393 2 0.4238 8.4937696 0.0 50.404719 +1180 394 1 -0.8476 9.31026 0.0 52.93078 +1181 394 2 0.4238 10.126750399999999 0.0 53.508139 +1182 394 2 0.4238 8.4937696 0.0 53.508139 +1183 395 1 -0.8476 9.31026 0.0 56.0342 +1184 395 2 0.4238 10.126750399999999 0.0 56.611559 +1185 395 2 0.4238 8.4937696 0.0 56.611559 +1186 396 1 -0.8476 9.31026 0.0 59.13762 +1187 396 2 0.4238 10.126750399999999 0.0 59.714979 +1188 396 2 0.4238 8.4937696 0.0 59.714979 +1189 397 1 -0.8476 9.31026 0.0 62.24104 +1190 397 2 0.4238 10.126750399999999 0.0 62.818399 +1191 397 2 0.4238 8.4937696 0.0 62.818399 +1192 398 1 -0.8476 9.31026 0.0 65.34446 +1193 398 2 0.4238 10.126750399999999 0.0 65.921819 +1194 398 2 0.4238 8.4937696 0.0 65.921819 +1195 399 1 -0.8476 9.31026 0.0 68.44788 +1196 399 2 0.4238 10.126750399999999 0.0 69.025239 +1197 399 2 0.4238 8.4937696 0.0 69.025239 +1198 400 1 -0.8476 9.31026 0.0 71.5513 +1199 400 2 0.4238 10.126750399999999 0.0 72.128659 +1200 400 2 0.4238 8.4937696 0.0 72.128659 +1201 401 1 -0.8476 9.31026 3.10342 25.0 +1202 401 2 0.4238 10.126750399999999 3.10342 25.577359 +1203 401 2 0.4238 8.4937696 3.10342 25.577359 +1204 402 1 -0.8476 9.31026 3.10342 28.10342 +1205 402 2 0.4238 10.126750399999999 3.10342 28.680779 +1206 402 2 0.4238 8.4937696 3.10342 28.680779 +1207 403 1 -0.8476 9.31026 3.10342 31.20684 +1208 403 2 0.4238 10.126750399999999 3.10342 31.784199 +1209 403 2 0.4238 8.4937696 3.10342 31.784199 +1210 404 1 -0.8476 9.31026 3.10342 34.31026 +1211 404 2 0.4238 10.126750399999999 3.10342 34.887619 +1212 404 2 0.4238 8.4937696 3.10342 34.887619 +1213 405 1 -0.8476 9.31026 3.10342 37.41368 +1214 405 2 0.4238 10.126750399999999 3.10342 37.991039 +1215 405 2 0.4238 8.4937696 3.10342 37.991039 +1216 406 1 -0.8476 9.31026 3.10342 40.5171 +1217 406 2 0.4238 10.126750399999999 3.10342 41.094459 +1218 406 2 0.4238 8.4937696 3.10342 41.094459 +1219 407 1 -0.8476 9.31026 3.10342 43.62052 +1220 407 2 0.4238 10.126750399999999 3.10342 44.197879 +1221 407 2 0.4238 8.4937696 3.10342 44.197879 +1222 408 1 -0.8476 9.31026 3.10342 46.72394 +1223 408 2 0.4238 10.126750399999999 3.10342 47.301299 +1224 408 2 0.4238 8.4937696 3.10342 47.301299 +1225 409 1 -0.8476 9.31026 3.10342 49.82736 +1226 409 2 0.4238 10.126750399999999 3.10342 50.404719 +1227 409 2 0.4238 8.4937696 3.10342 50.404719 +1228 410 1 -0.8476 9.31026 3.10342 52.93078 +1229 410 2 0.4238 10.126750399999999 3.10342 53.508139 +1230 410 2 0.4238 8.4937696 3.10342 53.508139 +1231 411 1 -0.8476 9.31026 3.10342 56.0342 +1232 411 2 0.4238 10.126750399999999 3.10342 56.611559 +1233 411 2 0.4238 8.4937696 3.10342 56.611559 +1234 412 1 -0.8476 9.31026 3.10342 59.13762 +1235 412 2 0.4238 10.126750399999999 3.10342 59.714979 +1236 412 2 0.4238 8.4937696 3.10342 59.714979 +1237 413 1 -0.8476 9.31026 3.10342 62.24104 +1238 413 2 0.4238 10.126750399999999 3.10342 62.818399 +1239 413 2 0.4238 8.4937696 3.10342 62.818399 +1240 414 1 -0.8476 9.31026 3.10342 65.34446 +1241 414 2 0.4238 10.126750399999999 3.10342 65.921819 +1242 414 2 0.4238 8.4937696 3.10342 65.921819 +1243 415 1 -0.8476 9.31026 3.10342 68.44788 +1244 415 2 0.4238 10.126750399999999 3.10342 69.025239 +1245 415 2 0.4238 8.4937696 3.10342 69.025239 +1246 416 1 -0.8476 9.31026 3.10342 71.5513 +1247 416 2 0.4238 10.126750399999999 3.10342 72.128659 +1248 416 2 0.4238 8.4937696 3.10342 72.128659 +1249 417 1 -0.8476 9.31026 6.20684 25.0 +1250 417 2 0.4238 10.126750399999999 6.20684 25.577359 +1251 417 2 0.4238 8.4937696 6.20684 25.577359 +1252 418 1 -0.8476 9.31026 6.20684 28.10342 +1253 418 2 0.4238 10.126750399999999 6.20684 28.680779 +1254 418 2 0.4238 8.4937696 6.20684 28.680779 +1255 419 1 -0.8476 9.31026 6.20684 31.20684 +1256 419 2 0.4238 10.126750399999999 6.20684 31.784199 +1257 419 2 0.4238 8.4937696 6.20684 31.784199 +1258 420 1 -0.8476 9.31026 6.20684 34.31026 +1259 420 2 0.4238 10.126750399999999 6.20684 34.887619 +1260 420 2 0.4238 8.4937696 6.20684 34.887619 +1261 421 1 -0.8476 9.31026 6.20684 37.41368 +1262 421 2 0.4238 10.126750399999999 6.20684 37.991039 +1263 421 2 0.4238 8.4937696 6.20684 37.991039 +1264 422 1 -0.8476 9.31026 6.20684 40.5171 +1265 422 2 0.4238 10.126750399999999 6.20684 41.094459 +1266 422 2 0.4238 8.4937696 6.20684 41.094459 +1267 423 1 -0.8476 9.31026 6.20684 43.62052 +1268 423 2 0.4238 10.126750399999999 6.20684 44.197879 +1269 423 2 0.4238 8.4937696 6.20684 44.197879 +1270 424 1 -0.8476 9.31026 6.20684 46.72394 +1271 424 2 0.4238 10.126750399999999 6.20684 47.301299 +1272 424 2 0.4238 8.4937696 6.20684 47.301299 +1273 425 1 -0.8476 9.31026 6.20684 49.82736 +1274 425 2 0.4238 10.126750399999999 6.20684 50.404719 +1275 425 2 0.4238 8.4937696 6.20684 50.404719 +1276 426 1 -0.8476 9.31026 6.20684 52.93078 +1277 426 2 0.4238 10.126750399999999 6.20684 53.508139 +1278 426 2 0.4238 8.4937696 6.20684 53.508139 +1279 427 1 -0.8476 9.31026 6.20684 56.0342 +1280 427 2 0.4238 10.126750399999999 6.20684 56.611559 +1281 427 2 0.4238 8.4937696 6.20684 56.611559 +1282 428 1 -0.8476 9.31026 6.20684 59.13762 +1283 428 2 0.4238 10.126750399999999 6.20684 59.714979 +1284 428 2 0.4238 8.4937696 6.20684 59.714979 +1285 429 1 -0.8476 9.31026 6.20684 62.24104 +1286 429 2 0.4238 10.126750399999999 6.20684 62.818399 +1287 429 2 0.4238 8.4937696 6.20684 62.818399 +1288 430 1 -0.8476 9.31026 6.20684 65.34446 +1289 430 2 0.4238 10.126750399999999 6.20684 65.921819 +1290 430 2 0.4238 8.4937696 6.20684 65.921819 +1291 431 1 -0.8476 9.31026 6.20684 68.44788 +1292 431 2 0.4238 10.126750399999999 6.20684 69.025239 +1293 431 2 0.4238 8.4937696 6.20684 69.025239 +1294 432 1 -0.8476 9.31026 6.20684 71.5513 +1295 432 2 0.4238 10.126750399999999 6.20684 72.128659 +1296 432 2 0.4238 8.4937696 6.20684 72.128659 +1297 433 1 -0.8476 9.31026 9.31026 25.0 +1298 433 2 0.4238 10.126750399999999 9.31026 25.577359 +1299 433 2 0.4238 8.4937696 9.31026 25.577359 +1300 434 1 -0.8476 9.31026 9.31026 28.10342 +1301 434 2 0.4238 10.126750399999999 9.31026 28.680779 +1302 434 2 0.4238 8.4937696 9.31026 28.680779 +1303 435 1 -0.8476 9.31026 9.31026 31.20684 +1304 435 2 0.4238 10.126750399999999 9.31026 31.784199 +1305 435 2 0.4238 8.4937696 9.31026 31.784199 +1306 436 1 -0.8476 9.31026 9.31026 34.31026 +1307 436 2 0.4238 10.126750399999999 9.31026 34.887619 +1308 436 2 0.4238 8.4937696 9.31026 34.887619 +1309 437 1 -0.8476 9.31026 9.31026 37.41368 +1310 437 2 0.4238 10.126750399999999 9.31026 37.991039 +1311 437 2 0.4238 8.4937696 9.31026 37.991039 +1312 438 1 -0.8476 9.31026 9.31026 40.5171 +1313 438 2 0.4238 10.126750399999999 9.31026 41.094459 +1314 438 2 0.4238 8.4937696 9.31026 41.094459 +1315 439 1 -0.8476 9.31026 9.31026 43.62052 +1316 439 2 0.4238 10.126750399999999 9.31026 44.197879 +1317 439 2 0.4238 8.4937696 9.31026 44.197879 +1318 440 1 -0.8476 9.31026 9.31026 46.72394 +1319 440 2 0.4238 10.126750399999999 9.31026 47.301299 +1320 440 2 0.4238 8.4937696 9.31026 47.301299 +1321 441 1 -0.8476 9.31026 9.31026 49.82736 +1322 441 2 0.4238 10.126750399999999 9.31026 50.404719 +1323 441 2 0.4238 8.4937696 9.31026 50.404719 +1324 442 1 -0.8476 9.31026 9.31026 52.93078 +1325 442 2 0.4238 10.126750399999999 9.31026 53.508139 +1326 442 2 0.4238 8.4937696 9.31026 53.508139 +1327 443 1 -0.8476 9.31026 9.31026 56.0342 +1328 443 2 0.4238 10.126750399999999 9.31026 56.611559 +1329 443 2 0.4238 8.4937696 9.31026 56.611559 +1330 444 1 -0.8476 9.31026 9.31026 59.13762 +1331 444 2 0.4238 10.126750399999999 9.31026 59.714979 +1332 444 2 0.4238 8.4937696 9.31026 59.714979 +1333 445 1 -0.8476 9.31026 9.31026 62.24104 +1334 445 2 0.4238 10.126750399999999 9.31026 62.818399 +1335 445 2 0.4238 8.4937696 9.31026 62.818399 +1336 446 1 -0.8476 9.31026 9.31026 65.34446 +1337 446 2 0.4238 10.126750399999999 9.31026 65.921819 +1338 446 2 0.4238 8.4937696 9.31026 65.921819 +1339 447 1 -0.8476 9.31026 9.31026 68.44788 +1340 447 2 0.4238 10.126750399999999 9.31026 69.025239 +1341 447 2 0.4238 8.4937696 9.31026 69.025239 +1342 448 1 -0.8476 9.31026 9.31026 71.5513 +1343 448 2 0.4238 10.126750399999999 9.31026 72.128659 +1344 448 2 0.4238 8.4937696 9.31026 72.128659 +1345 449 1 -0.8476 9.31026 12.41368 25.0 +1346 449 2 0.4238 10.126750399999999 12.41368 25.577359 +1347 449 2 0.4238 8.4937696 12.41368 25.577359 +1348 450 1 -0.8476 9.31026 12.41368 28.10342 +1349 450 2 0.4238 10.126750399999999 12.41368 28.680779 +1350 450 2 0.4238 8.4937696 12.41368 28.680779 +1351 451 1 -0.8476 9.31026 12.41368 31.20684 +1352 451 2 0.4238 10.126750399999999 12.41368 31.784199 +1353 451 2 0.4238 8.4937696 12.41368 31.784199 +1354 452 1 -0.8476 9.31026 12.41368 34.31026 +1355 452 2 0.4238 10.126750399999999 12.41368 34.887619 +1356 452 2 0.4238 8.4937696 12.41368 34.887619 +1357 453 1 -0.8476 9.31026 12.41368 37.41368 +1358 453 2 0.4238 10.126750399999999 12.41368 37.991039 +1359 453 2 0.4238 8.4937696 12.41368 37.991039 +1360 454 1 -0.8476 9.31026 12.41368 40.5171 +1361 454 2 0.4238 10.126750399999999 12.41368 41.094459 +1362 454 2 0.4238 8.4937696 12.41368 41.094459 +1363 455 1 -0.8476 9.31026 12.41368 43.62052 +1364 455 2 0.4238 10.126750399999999 12.41368 44.197879 +1365 455 2 0.4238 8.4937696 12.41368 44.197879 +1366 456 1 -0.8476 9.31026 12.41368 46.72394 +1367 456 2 0.4238 10.126750399999999 12.41368 47.301299 +1368 456 2 0.4238 8.4937696 12.41368 47.301299 +1369 457 1 -0.8476 9.31026 12.41368 49.82736 +1370 457 2 0.4238 10.126750399999999 12.41368 50.404719 +1371 457 2 0.4238 8.4937696 12.41368 50.404719 +1372 458 1 -0.8476 9.31026 12.41368 52.93078 +1373 458 2 0.4238 10.126750399999999 12.41368 53.508139 +1374 458 2 0.4238 8.4937696 12.41368 53.508139 +1375 459 1 -0.8476 9.31026 12.41368 56.0342 +1376 459 2 0.4238 10.126750399999999 12.41368 56.611559 +1377 459 2 0.4238 8.4937696 12.41368 56.611559 +1378 460 1 -0.8476 9.31026 12.41368 59.13762 +1379 460 2 0.4238 10.126750399999999 12.41368 59.714979 +1380 460 2 0.4238 8.4937696 12.41368 59.714979 +1381 461 1 -0.8476 9.31026 12.41368 62.24104 +1382 461 2 0.4238 10.126750399999999 12.41368 62.818399 +1383 461 2 0.4238 8.4937696 12.41368 62.818399 +1384 462 1 -0.8476 9.31026 12.41368 65.34446 +1385 462 2 0.4238 10.126750399999999 12.41368 65.921819 +1386 462 2 0.4238 8.4937696 12.41368 65.921819 +1387 463 1 -0.8476 9.31026 12.41368 68.44788 +1388 463 2 0.4238 10.126750399999999 12.41368 69.025239 +1389 463 2 0.4238 8.4937696 12.41368 69.025239 +1390 464 1 -0.8476 9.31026 12.41368 71.5513 +1391 464 2 0.4238 10.126750399999999 12.41368 72.128659 +1392 464 2 0.4238 8.4937696 12.41368 72.128659 +1393 465 1 -0.8476 9.31026 15.5171 25.0 +1394 465 2 0.4238 10.126750399999999 15.5171 25.577359 +1395 465 2 0.4238 8.4937696 15.5171 25.577359 +1396 466 1 -0.8476 9.31026 15.5171 28.10342 +1397 466 2 0.4238 10.126750399999999 15.5171 28.680779 +1398 466 2 0.4238 8.4937696 15.5171 28.680779 +1399 467 1 -0.8476 9.31026 15.5171 31.20684 +1400 467 2 0.4238 10.126750399999999 15.5171 31.784199 +1401 467 2 0.4238 8.4937696 15.5171 31.784199 +1402 468 1 -0.8476 9.31026 15.5171 34.31026 +1403 468 2 0.4238 10.126750399999999 15.5171 34.887619 +1404 468 2 0.4238 8.4937696 15.5171 34.887619 +1405 469 1 -0.8476 9.31026 15.5171 37.41368 +1406 469 2 0.4238 10.126750399999999 15.5171 37.991039 +1407 469 2 0.4238 8.4937696 15.5171 37.991039 +1408 470 1 -0.8476 9.31026 15.5171 40.5171 +1409 470 2 0.4238 10.126750399999999 15.5171 41.094459 +1410 470 2 0.4238 8.4937696 15.5171 41.094459 +1411 471 1 -0.8476 9.31026 15.5171 43.62052 +1412 471 2 0.4238 10.126750399999999 15.5171 44.197879 +1413 471 2 0.4238 8.4937696 15.5171 44.197879 +1414 472 1 -0.8476 9.31026 15.5171 46.72394 +1415 472 2 0.4238 10.126750399999999 15.5171 47.301299 +1416 472 2 0.4238 8.4937696 15.5171 47.301299 +1417 473 1 -0.8476 9.31026 15.5171 49.82736 +1418 473 2 0.4238 10.126750399999999 15.5171 50.404719 +1419 473 2 0.4238 8.4937696 15.5171 50.404719 +1420 474 1 -0.8476 9.31026 15.5171 52.93078 +1421 474 2 0.4238 10.126750399999999 15.5171 53.508139 +1422 474 2 0.4238 8.4937696 15.5171 53.508139 +1423 475 1 -0.8476 9.31026 15.5171 56.0342 +1424 475 2 0.4238 10.126750399999999 15.5171 56.611559 +1425 475 2 0.4238 8.4937696 15.5171 56.611559 +1426 476 1 -0.8476 9.31026 15.5171 59.13762 +1427 476 2 0.4238 10.126750399999999 15.5171 59.714979 +1428 476 2 0.4238 8.4937696 15.5171 59.714979 +1429 477 1 -0.8476 9.31026 15.5171 62.24104 +1430 477 2 0.4238 10.126750399999999 15.5171 62.818399 +1431 477 2 0.4238 8.4937696 15.5171 62.818399 +1432 478 1 -0.8476 9.31026 15.5171 65.34446 +1433 478 2 0.4238 10.126750399999999 15.5171 65.921819 +1434 478 2 0.4238 8.4937696 15.5171 65.921819 +1435 479 1 -0.8476 9.31026 15.5171 68.44788 +1436 479 2 0.4238 10.126750399999999 15.5171 69.025239 +1437 479 2 0.4238 8.4937696 15.5171 69.025239 +1438 480 1 -0.8476 9.31026 15.5171 71.5513 +1439 480 2 0.4238 10.126750399999999 15.5171 72.128659 +1440 480 2 0.4238 8.4937696 15.5171 72.128659 +1441 481 1 -0.8476 9.31026 18.62052 25.0 +1442 481 2 0.4238 10.126750399999999 18.62052 25.577359 +1443 481 2 0.4238 8.4937696 18.62052 25.577359 +1444 482 1 -0.8476 9.31026 18.62052 28.10342 +1445 482 2 0.4238 10.126750399999999 18.62052 28.680779 +1446 482 2 0.4238 8.4937696 18.62052 28.680779 +1447 483 1 -0.8476 9.31026 18.62052 31.20684 +1448 483 2 0.4238 10.126750399999999 18.62052 31.784199 +1449 483 2 0.4238 8.4937696 18.62052 31.784199 +1450 484 1 -0.8476 9.31026 18.62052 34.31026 +1451 484 2 0.4238 10.126750399999999 18.62052 34.887619 +1452 484 2 0.4238 8.4937696 18.62052 34.887619 +1453 485 1 -0.8476 9.31026 18.62052 37.41368 +1454 485 2 0.4238 10.126750399999999 18.62052 37.991039 +1455 485 2 0.4238 8.4937696 18.62052 37.991039 +1456 486 1 -0.8476 9.31026 18.62052 40.5171 +1457 486 2 0.4238 10.126750399999999 18.62052 41.094459 +1458 486 2 0.4238 8.4937696 18.62052 41.094459 +1459 487 1 -0.8476 9.31026 18.62052 43.62052 +1460 487 2 0.4238 10.126750399999999 18.62052 44.197879 +1461 487 2 0.4238 8.4937696 18.62052 44.197879 +1462 488 1 -0.8476 9.31026 18.62052 46.72394 +1463 488 2 0.4238 10.126750399999999 18.62052 47.301299 +1464 488 2 0.4238 8.4937696 18.62052 47.301299 +1465 489 1 -0.8476 9.31026 18.62052 49.82736 +1466 489 2 0.4238 10.126750399999999 18.62052 50.404719 +1467 489 2 0.4238 8.4937696 18.62052 50.404719 +1468 490 1 -0.8476 9.31026 18.62052 52.93078 +1469 490 2 0.4238 10.126750399999999 18.62052 53.508139 +1470 490 2 0.4238 8.4937696 18.62052 53.508139 +1471 491 1 -0.8476 9.31026 18.62052 56.0342 +1472 491 2 0.4238 10.126750399999999 18.62052 56.611559 +1473 491 2 0.4238 8.4937696 18.62052 56.611559 +1474 492 1 -0.8476 9.31026 18.62052 59.13762 +1475 492 2 0.4238 10.126750399999999 18.62052 59.714979 +1476 492 2 0.4238 8.4937696 18.62052 59.714979 +1477 493 1 -0.8476 9.31026 18.62052 62.24104 +1478 493 2 0.4238 10.126750399999999 18.62052 62.818399 +1479 493 2 0.4238 8.4937696 18.62052 62.818399 +1480 494 1 -0.8476 9.31026 18.62052 65.34446 +1481 494 2 0.4238 10.126750399999999 18.62052 65.921819 +1482 494 2 0.4238 8.4937696 18.62052 65.921819 +1483 495 1 -0.8476 9.31026 18.62052 68.44788 +1484 495 2 0.4238 10.126750399999999 18.62052 69.025239 +1485 495 2 0.4238 8.4937696 18.62052 69.025239 +1486 496 1 -0.8476 9.31026 18.62052 71.5513 +1487 496 2 0.4238 10.126750399999999 18.62052 72.128659 +1488 496 2 0.4238 8.4937696 18.62052 72.128659 +1489 497 1 -0.8476 9.31026 21.72394 25.0 +1490 497 2 0.4238 10.126750399999999 21.72394 25.577359 +1491 497 2 0.4238 8.4937696 21.72394 25.577359 +1492 498 1 -0.8476 9.31026 21.72394 28.10342 +1493 498 2 0.4238 10.126750399999999 21.72394 28.680779 +1494 498 2 0.4238 8.4937696 21.72394 28.680779 +1495 499 1 -0.8476 9.31026 21.72394 31.20684 +1496 499 2 0.4238 10.126750399999999 21.72394 31.784199 +1497 499 2 0.4238 8.4937696 21.72394 31.784199 +1498 500 1 -0.8476 9.31026 21.72394 34.31026 +1499 500 2 0.4238 10.126750399999999 21.72394 34.887619 +1500 500 2 0.4238 8.4937696 21.72394 34.887619 +1501 501 1 -0.8476 9.31026 21.72394 37.41368 +1502 501 2 0.4238 10.126750399999999 21.72394 37.991039 +1503 501 2 0.4238 8.4937696 21.72394 37.991039 +1504 502 1 -0.8476 9.31026 21.72394 40.5171 +1505 502 2 0.4238 10.126750399999999 21.72394 41.094459 +1506 502 2 0.4238 8.4937696 21.72394 41.094459 +1507 503 1 -0.8476 9.31026 21.72394 43.62052 +1508 503 2 0.4238 10.126750399999999 21.72394 44.197879 +1509 503 2 0.4238 8.4937696 21.72394 44.197879 +1510 504 1 -0.8476 9.31026 21.72394 46.72394 +1511 504 2 0.4238 10.126750399999999 21.72394 47.301299 +1512 504 2 0.4238 8.4937696 21.72394 47.301299 +1513 505 1 -0.8476 9.31026 21.72394 49.82736 +1514 505 2 0.4238 10.126750399999999 21.72394 50.404719 +1515 505 2 0.4238 8.4937696 21.72394 50.404719 +1516 506 1 -0.8476 9.31026 21.72394 52.93078 +1517 506 2 0.4238 10.126750399999999 21.72394 53.508139 +1518 506 2 0.4238 8.4937696 21.72394 53.508139 +1519 507 1 -0.8476 9.31026 21.72394 56.0342 +1520 507 2 0.4238 10.126750399999999 21.72394 56.611559 +1521 507 2 0.4238 8.4937696 21.72394 56.611559 +1522 508 1 -0.8476 9.31026 21.72394 59.13762 +1523 508 2 0.4238 10.126750399999999 21.72394 59.714979 +1524 508 2 0.4238 8.4937696 21.72394 59.714979 +1525 509 1 -0.8476 9.31026 21.72394 62.24104 +1526 509 2 0.4238 10.126750399999999 21.72394 62.818399 +1527 509 2 0.4238 8.4937696 21.72394 62.818399 +1528 510 1 -0.8476 9.31026 21.72394 65.34446 +1529 510 2 0.4238 10.126750399999999 21.72394 65.921819 +1530 510 2 0.4238 8.4937696 21.72394 65.921819 +1531 511 1 -0.8476 9.31026 21.72394 68.44788 +1532 511 2 0.4238 10.126750399999999 21.72394 69.025239 +1533 511 2 0.4238 8.4937696 21.72394 69.025239 +1534 512 1 -0.8476 9.31026 21.72394 71.5513 +1535 512 2 0.4238 10.126750399999999 21.72394 72.128659 +1536 512 2 0.4238 8.4937696 21.72394 72.128659 +1537 513 1 -0.8476 12.41368 0.0 25.0 +1538 513 2 0.4238 13.230170399999999 0.0 25.577359 +1539 513 2 0.4238 11.5971896 0.0 25.577359 +1540 514 1 -0.8476 12.41368 0.0 28.10342 +1541 514 2 0.4238 13.230170399999999 0.0 28.680779 +1542 514 2 0.4238 11.5971896 0.0 28.680779 +1543 515 1 -0.8476 12.41368 0.0 31.20684 +1544 515 2 0.4238 13.230170399999999 0.0 31.784199 +1545 515 2 0.4238 11.5971896 0.0 31.784199 +1546 516 1 -0.8476 12.41368 0.0 34.31026 +1547 516 2 0.4238 13.230170399999999 0.0 34.887619 +1548 516 2 0.4238 11.5971896 0.0 34.887619 +1549 517 1 -0.8476 12.41368 0.0 37.41368 +1550 517 2 0.4238 13.230170399999999 0.0 37.991039 +1551 517 2 0.4238 11.5971896 0.0 37.991039 +1552 518 1 -0.8476 12.41368 0.0 40.5171 +1553 518 2 0.4238 13.230170399999999 0.0 41.094459 +1554 518 2 0.4238 11.5971896 0.0 41.094459 +1555 519 1 -0.8476 12.41368 0.0 43.62052 +1556 519 2 0.4238 13.230170399999999 0.0 44.197879 +1557 519 2 0.4238 11.5971896 0.0 44.197879 +1558 520 1 -0.8476 12.41368 0.0 46.72394 +1559 520 2 0.4238 13.230170399999999 0.0 47.301299 +1560 520 2 0.4238 11.5971896 0.0 47.301299 +1561 521 1 -0.8476 12.41368 0.0 49.82736 +1562 521 2 0.4238 13.230170399999999 0.0 50.404719 +1563 521 2 0.4238 11.5971896 0.0 50.404719 +1564 522 1 -0.8476 12.41368 0.0 52.93078 +1565 522 2 0.4238 13.230170399999999 0.0 53.508139 +1566 522 2 0.4238 11.5971896 0.0 53.508139 +1567 523 1 -0.8476 12.41368 0.0 56.0342 +1568 523 2 0.4238 13.230170399999999 0.0 56.611559 +1569 523 2 0.4238 11.5971896 0.0 56.611559 +1570 524 1 -0.8476 12.41368 0.0 59.13762 +1571 524 2 0.4238 13.230170399999999 0.0 59.714979 +1572 524 2 0.4238 11.5971896 0.0 59.714979 +1573 525 1 -0.8476 12.41368 0.0 62.24104 +1574 525 2 0.4238 13.230170399999999 0.0 62.818399 +1575 525 2 0.4238 11.5971896 0.0 62.818399 +1576 526 1 -0.8476 12.41368 0.0 65.34446 +1577 526 2 0.4238 13.230170399999999 0.0 65.921819 +1578 526 2 0.4238 11.5971896 0.0 65.921819 +1579 527 1 -0.8476 12.41368 0.0 68.44788 +1580 527 2 0.4238 13.230170399999999 0.0 69.025239 +1581 527 2 0.4238 11.5971896 0.0 69.025239 +1582 528 1 -0.8476 12.41368 0.0 71.5513 +1583 528 2 0.4238 13.230170399999999 0.0 72.128659 +1584 528 2 0.4238 11.5971896 0.0 72.128659 +1585 529 1 -0.8476 12.41368 3.10342 25.0 +1586 529 2 0.4238 13.230170399999999 3.10342 25.577359 +1587 529 2 0.4238 11.5971896 3.10342 25.577359 +1588 530 1 -0.8476 12.41368 3.10342 28.10342 +1589 530 2 0.4238 13.230170399999999 3.10342 28.680779 +1590 530 2 0.4238 11.5971896 3.10342 28.680779 +1591 531 1 -0.8476 12.41368 3.10342 31.20684 +1592 531 2 0.4238 13.230170399999999 3.10342 31.784199 +1593 531 2 0.4238 11.5971896 3.10342 31.784199 +1594 532 1 -0.8476 12.41368 3.10342 34.31026 +1595 532 2 0.4238 13.230170399999999 3.10342 34.887619 +1596 532 2 0.4238 11.5971896 3.10342 34.887619 +1597 533 1 -0.8476 12.41368 3.10342 37.41368 +1598 533 2 0.4238 13.230170399999999 3.10342 37.991039 +1599 533 2 0.4238 11.5971896 3.10342 37.991039 +1600 534 1 -0.8476 12.41368 3.10342 40.5171 +1601 534 2 0.4238 13.230170399999999 3.10342 41.094459 +1602 534 2 0.4238 11.5971896 3.10342 41.094459 +1603 535 1 -0.8476 12.41368 3.10342 43.62052 +1604 535 2 0.4238 13.230170399999999 3.10342 44.197879 +1605 535 2 0.4238 11.5971896 3.10342 44.197879 +1606 536 1 -0.8476 12.41368 3.10342 46.72394 +1607 536 2 0.4238 13.230170399999999 3.10342 47.301299 +1608 536 2 0.4238 11.5971896 3.10342 47.301299 +1609 537 1 -0.8476 12.41368 3.10342 49.82736 +1610 537 2 0.4238 13.230170399999999 3.10342 50.404719 +1611 537 2 0.4238 11.5971896 3.10342 50.404719 +1612 538 1 -0.8476 12.41368 3.10342 52.93078 +1613 538 2 0.4238 13.230170399999999 3.10342 53.508139 +1614 538 2 0.4238 11.5971896 3.10342 53.508139 +1615 539 1 -0.8476 12.41368 3.10342 56.0342 +1616 539 2 0.4238 13.230170399999999 3.10342 56.611559 +1617 539 2 0.4238 11.5971896 3.10342 56.611559 +1618 540 1 -0.8476 12.41368 3.10342 59.13762 +1619 540 2 0.4238 13.230170399999999 3.10342 59.714979 +1620 540 2 0.4238 11.5971896 3.10342 59.714979 +1621 541 1 -0.8476 12.41368 3.10342 62.24104 +1622 541 2 0.4238 13.230170399999999 3.10342 62.818399 +1623 541 2 0.4238 11.5971896 3.10342 62.818399 +1624 542 1 -0.8476 12.41368 3.10342 65.34446 +1625 542 2 0.4238 13.230170399999999 3.10342 65.921819 +1626 542 2 0.4238 11.5971896 3.10342 65.921819 +1627 543 1 -0.8476 12.41368 3.10342 68.44788 +1628 543 2 0.4238 13.230170399999999 3.10342 69.025239 +1629 543 2 0.4238 11.5971896 3.10342 69.025239 +1630 544 1 -0.8476 12.41368 3.10342 71.5513 +1631 544 2 0.4238 13.230170399999999 3.10342 72.128659 +1632 544 2 0.4238 11.5971896 3.10342 72.128659 +1633 545 1 -0.8476 12.41368 6.20684 25.0 +1634 545 2 0.4238 13.230170399999999 6.20684 25.577359 +1635 545 2 0.4238 11.5971896 6.20684 25.577359 +1636 546 1 -0.8476 12.41368 6.20684 28.10342 +1637 546 2 0.4238 13.230170399999999 6.20684 28.680779 +1638 546 2 0.4238 11.5971896 6.20684 28.680779 +1639 547 1 -0.8476 12.41368 6.20684 31.20684 +1640 547 2 0.4238 13.230170399999999 6.20684 31.784199 +1641 547 2 0.4238 11.5971896 6.20684 31.784199 +1642 548 1 -0.8476 12.41368 6.20684 34.31026 +1643 548 2 0.4238 13.230170399999999 6.20684 34.887619 +1644 548 2 0.4238 11.5971896 6.20684 34.887619 +1645 549 1 -0.8476 12.41368 6.20684 37.41368 +1646 549 2 0.4238 13.230170399999999 6.20684 37.991039 +1647 549 2 0.4238 11.5971896 6.20684 37.991039 +1648 550 1 -0.8476 12.41368 6.20684 40.5171 +1649 550 2 0.4238 13.230170399999999 6.20684 41.094459 +1650 550 2 0.4238 11.5971896 6.20684 41.094459 +1651 551 1 -0.8476 12.41368 6.20684 43.62052 +1652 551 2 0.4238 13.230170399999999 6.20684 44.197879 +1653 551 2 0.4238 11.5971896 6.20684 44.197879 +1654 552 1 -0.8476 12.41368 6.20684 46.72394 +1655 552 2 0.4238 13.230170399999999 6.20684 47.301299 +1656 552 2 0.4238 11.5971896 6.20684 47.301299 +1657 553 1 -0.8476 12.41368 6.20684 49.82736 +1658 553 2 0.4238 13.230170399999999 6.20684 50.404719 +1659 553 2 0.4238 11.5971896 6.20684 50.404719 +1660 554 1 -0.8476 12.41368 6.20684 52.93078 +1661 554 2 0.4238 13.230170399999999 6.20684 53.508139 +1662 554 2 0.4238 11.5971896 6.20684 53.508139 +1663 555 1 -0.8476 12.41368 6.20684 56.0342 +1664 555 2 0.4238 13.230170399999999 6.20684 56.611559 +1665 555 2 0.4238 11.5971896 6.20684 56.611559 +1666 556 1 -0.8476 12.41368 6.20684 59.13762 +1667 556 2 0.4238 13.230170399999999 6.20684 59.714979 +1668 556 2 0.4238 11.5971896 6.20684 59.714979 +1669 557 1 -0.8476 12.41368 6.20684 62.24104 +1670 557 2 0.4238 13.230170399999999 6.20684 62.818399 +1671 557 2 0.4238 11.5971896 6.20684 62.818399 +1672 558 1 -0.8476 12.41368 6.20684 65.34446 +1673 558 2 0.4238 13.230170399999999 6.20684 65.921819 +1674 558 2 0.4238 11.5971896 6.20684 65.921819 +1675 559 1 -0.8476 12.41368 6.20684 68.44788 +1676 559 2 0.4238 13.230170399999999 6.20684 69.025239 +1677 559 2 0.4238 11.5971896 6.20684 69.025239 +1678 560 1 -0.8476 12.41368 6.20684 71.5513 +1679 560 2 0.4238 13.230170399999999 6.20684 72.128659 +1680 560 2 0.4238 11.5971896 6.20684 72.128659 +1681 561 1 -0.8476 12.41368 9.31026 25.0 +1682 561 2 0.4238 13.230170399999999 9.31026 25.577359 +1683 561 2 0.4238 11.5971896 9.31026 25.577359 +1684 562 1 -0.8476 12.41368 9.31026 28.10342 +1685 562 2 0.4238 13.230170399999999 9.31026 28.680779 +1686 562 2 0.4238 11.5971896 9.31026 28.680779 +1687 563 1 -0.8476 12.41368 9.31026 31.20684 +1688 563 2 0.4238 13.230170399999999 9.31026 31.784199 +1689 563 2 0.4238 11.5971896 9.31026 31.784199 +1690 564 1 -0.8476 12.41368 9.31026 34.31026 +1691 564 2 0.4238 13.230170399999999 9.31026 34.887619 +1692 564 2 0.4238 11.5971896 9.31026 34.887619 +1693 565 1 -0.8476 12.41368 9.31026 37.41368 +1694 565 2 0.4238 13.230170399999999 9.31026 37.991039 +1695 565 2 0.4238 11.5971896 9.31026 37.991039 +1696 566 1 -0.8476 12.41368 9.31026 40.5171 +1697 566 2 0.4238 13.230170399999999 9.31026 41.094459 +1698 566 2 0.4238 11.5971896 9.31026 41.094459 +1699 567 1 -0.8476 12.41368 9.31026 43.62052 +1700 567 2 0.4238 13.230170399999999 9.31026 44.197879 +1701 567 2 0.4238 11.5971896 9.31026 44.197879 +1702 568 1 -0.8476 12.41368 9.31026 46.72394 +1703 568 2 0.4238 13.230170399999999 9.31026 47.301299 +1704 568 2 0.4238 11.5971896 9.31026 47.301299 +1705 569 1 -0.8476 12.41368 9.31026 49.82736 +1706 569 2 0.4238 13.230170399999999 9.31026 50.404719 +1707 569 2 0.4238 11.5971896 9.31026 50.404719 +1708 570 1 -0.8476 12.41368 9.31026 52.93078 +1709 570 2 0.4238 13.230170399999999 9.31026 53.508139 +1710 570 2 0.4238 11.5971896 9.31026 53.508139 +1711 571 1 -0.8476 12.41368 9.31026 56.0342 +1712 571 2 0.4238 13.230170399999999 9.31026 56.611559 +1713 571 2 0.4238 11.5971896 9.31026 56.611559 +1714 572 1 -0.8476 12.41368 9.31026 59.13762 +1715 572 2 0.4238 13.230170399999999 9.31026 59.714979 +1716 572 2 0.4238 11.5971896 9.31026 59.714979 +1717 573 1 -0.8476 12.41368 9.31026 62.24104 +1718 573 2 0.4238 13.230170399999999 9.31026 62.818399 +1719 573 2 0.4238 11.5971896 9.31026 62.818399 +1720 574 1 -0.8476 12.41368 9.31026 65.34446 +1721 574 2 0.4238 13.230170399999999 9.31026 65.921819 +1722 574 2 0.4238 11.5971896 9.31026 65.921819 +1723 575 1 -0.8476 12.41368 9.31026 68.44788 +1724 575 2 0.4238 13.230170399999999 9.31026 69.025239 +1725 575 2 0.4238 11.5971896 9.31026 69.025239 +1726 576 1 -0.8476 12.41368 9.31026 71.5513 +1727 576 2 0.4238 13.230170399999999 9.31026 72.128659 +1728 576 2 0.4238 11.5971896 9.31026 72.128659 +1729 577 1 -0.8476 12.41368 12.41368 25.0 +1730 577 2 0.4238 13.230170399999999 12.41368 25.577359 +1731 577 2 0.4238 11.5971896 12.41368 25.577359 +1732 578 1 -0.8476 12.41368 12.41368 28.10342 +1733 578 2 0.4238 13.230170399999999 12.41368 28.680779 +1734 578 2 0.4238 11.5971896 12.41368 28.680779 +1735 579 1 -0.8476 12.41368 12.41368 31.20684 +1736 579 2 0.4238 13.230170399999999 12.41368 31.784199 +1737 579 2 0.4238 11.5971896 12.41368 31.784199 +1738 580 1 -0.8476 12.41368 12.41368 34.31026 +1739 580 2 0.4238 13.230170399999999 12.41368 34.887619 +1740 580 2 0.4238 11.5971896 12.41368 34.887619 +1741 581 1 -0.8476 12.41368 12.41368 37.41368 +1742 581 2 0.4238 13.230170399999999 12.41368 37.991039 +1743 581 2 0.4238 11.5971896 12.41368 37.991039 +1744 582 1 -0.8476 12.41368 12.41368 40.5171 +1745 582 2 0.4238 13.230170399999999 12.41368 41.094459 +1746 582 2 0.4238 11.5971896 12.41368 41.094459 +1747 583 1 -0.8476 12.41368 12.41368 43.62052 +1748 583 2 0.4238 13.230170399999999 12.41368 44.197879 +1749 583 2 0.4238 11.5971896 12.41368 44.197879 +1750 584 1 -0.8476 12.41368 12.41368 46.72394 +1751 584 2 0.4238 13.230170399999999 12.41368 47.301299 +1752 584 2 0.4238 11.5971896 12.41368 47.301299 +1753 585 1 -0.8476 12.41368 12.41368 49.82736 +1754 585 2 0.4238 13.230170399999999 12.41368 50.404719 +1755 585 2 0.4238 11.5971896 12.41368 50.404719 +1756 586 1 -0.8476 12.41368 12.41368 52.93078 +1757 586 2 0.4238 13.230170399999999 12.41368 53.508139 +1758 586 2 0.4238 11.5971896 12.41368 53.508139 +1759 587 1 -0.8476 12.41368 12.41368 56.0342 +1760 587 2 0.4238 13.230170399999999 12.41368 56.611559 +1761 587 2 0.4238 11.5971896 12.41368 56.611559 +1762 588 1 -0.8476 12.41368 12.41368 59.13762 +1763 588 2 0.4238 13.230170399999999 12.41368 59.714979 +1764 588 2 0.4238 11.5971896 12.41368 59.714979 +1765 589 1 -0.8476 12.41368 12.41368 62.24104 +1766 589 2 0.4238 13.230170399999999 12.41368 62.818399 +1767 589 2 0.4238 11.5971896 12.41368 62.818399 +1768 590 1 -0.8476 12.41368 12.41368 65.34446 +1769 590 2 0.4238 13.230170399999999 12.41368 65.921819 +1770 590 2 0.4238 11.5971896 12.41368 65.921819 +1771 591 1 -0.8476 12.41368 12.41368 68.44788 +1772 591 2 0.4238 13.230170399999999 12.41368 69.025239 +1773 591 2 0.4238 11.5971896 12.41368 69.025239 +1774 592 1 -0.8476 12.41368 12.41368 71.5513 +1775 592 2 0.4238 13.230170399999999 12.41368 72.128659 +1776 592 2 0.4238 11.5971896 12.41368 72.128659 +1777 593 1 -0.8476 12.41368 15.5171 25.0 +1778 593 2 0.4238 13.230170399999999 15.5171 25.577359 +1779 593 2 0.4238 11.5971896 15.5171 25.577359 +1780 594 1 -0.8476 12.41368 15.5171 28.10342 +1781 594 2 0.4238 13.230170399999999 15.5171 28.680779 +1782 594 2 0.4238 11.5971896 15.5171 28.680779 +1783 595 1 -0.8476 12.41368 15.5171 31.20684 +1784 595 2 0.4238 13.230170399999999 15.5171 31.784199 +1785 595 2 0.4238 11.5971896 15.5171 31.784199 +1786 596 1 -0.8476 12.41368 15.5171 34.31026 +1787 596 2 0.4238 13.230170399999999 15.5171 34.887619 +1788 596 2 0.4238 11.5971896 15.5171 34.887619 +1789 597 1 -0.8476 12.41368 15.5171 37.41368 +1790 597 2 0.4238 13.230170399999999 15.5171 37.991039 +1791 597 2 0.4238 11.5971896 15.5171 37.991039 +1792 598 1 -0.8476 12.41368 15.5171 40.5171 +1793 598 2 0.4238 13.230170399999999 15.5171 41.094459 +1794 598 2 0.4238 11.5971896 15.5171 41.094459 +1795 599 1 -0.8476 12.41368 15.5171 43.62052 +1796 599 2 0.4238 13.230170399999999 15.5171 44.197879 +1797 599 2 0.4238 11.5971896 15.5171 44.197879 +1798 600 1 -0.8476 12.41368 15.5171 46.72394 +1799 600 2 0.4238 13.230170399999999 15.5171 47.301299 +1800 600 2 0.4238 11.5971896 15.5171 47.301299 +1801 601 1 -0.8476 12.41368 15.5171 49.82736 +1802 601 2 0.4238 13.230170399999999 15.5171 50.404719 +1803 601 2 0.4238 11.5971896 15.5171 50.404719 +1804 602 1 -0.8476 12.41368 15.5171 52.93078 +1805 602 2 0.4238 13.230170399999999 15.5171 53.508139 +1806 602 2 0.4238 11.5971896 15.5171 53.508139 +1807 603 1 -0.8476 12.41368 15.5171 56.0342 +1808 603 2 0.4238 13.230170399999999 15.5171 56.611559 +1809 603 2 0.4238 11.5971896 15.5171 56.611559 +1810 604 1 -0.8476 12.41368 15.5171 59.13762 +1811 604 2 0.4238 13.230170399999999 15.5171 59.714979 +1812 604 2 0.4238 11.5971896 15.5171 59.714979 +1813 605 1 -0.8476 12.41368 15.5171 62.24104 +1814 605 2 0.4238 13.230170399999999 15.5171 62.818399 +1815 605 2 0.4238 11.5971896 15.5171 62.818399 +1816 606 1 -0.8476 12.41368 15.5171 65.34446 +1817 606 2 0.4238 13.230170399999999 15.5171 65.921819 +1818 606 2 0.4238 11.5971896 15.5171 65.921819 +1819 607 1 -0.8476 12.41368 15.5171 68.44788 +1820 607 2 0.4238 13.230170399999999 15.5171 69.025239 +1821 607 2 0.4238 11.5971896 15.5171 69.025239 +1822 608 1 -0.8476 12.41368 15.5171 71.5513 +1823 608 2 0.4238 13.230170399999999 15.5171 72.128659 +1824 608 2 0.4238 11.5971896 15.5171 72.128659 +1825 609 1 -0.8476 12.41368 18.62052 25.0 +1826 609 2 0.4238 13.230170399999999 18.62052 25.577359 +1827 609 2 0.4238 11.5971896 18.62052 25.577359 +1828 610 1 -0.8476 12.41368 18.62052 28.10342 +1829 610 2 0.4238 13.230170399999999 18.62052 28.680779 +1830 610 2 0.4238 11.5971896 18.62052 28.680779 +1831 611 1 -0.8476 12.41368 18.62052 31.20684 +1832 611 2 0.4238 13.230170399999999 18.62052 31.784199 +1833 611 2 0.4238 11.5971896 18.62052 31.784199 +1834 612 1 -0.8476 12.41368 18.62052 34.31026 +1835 612 2 0.4238 13.230170399999999 18.62052 34.887619 +1836 612 2 0.4238 11.5971896 18.62052 34.887619 +1837 613 1 -0.8476 12.41368 18.62052 37.41368 +1838 613 2 0.4238 13.230170399999999 18.62052 37.991039 +1839 613 2 0.4238 11.5971896 18.62052 37.991039 +1840 614 1 -0.8476 12.41368 18.62052 40.5171 +1841 614 2 0.4238 13.230170399999999 18.62052 41.094459 +1842 614 2 0.4238 11.5971896 18.62052 41.094459 +1843 615 1 -0.8476 12.41368 18.62052 43.62052 +1844 615 2 0.4238 13.230170399999999 18.62052 44.197879 +1845 615 2 0.4238 11.5971896 18.62052 44.197879 +1846 616 1 -0.8476 12.41368 18.62052 46.72394 +1847 616 2 0.4238 13.230170399999999 18.62052 47.301299 +1848 616 2 0.4238 11.5971896 18.62052 47.301299 +1849 617 1 -0.8476 12.41368 18.62052 49.82736 +1850 617 2 0.4238 13.230170399999999 18.62052 50.404719 +1851 617 2 0.4238 11.5971896 18.62052 50.404719 +1852 618 1 -0.8476 12.41368 18.62052 52.93078 +1853 618 2 0.4238 13.230170399999999 18.62052 53.508139 +1854 618 2 0.4238 11.5971896 18.62052 53.508139 +1855 619 1 -0.8476 12.41368 18.62052 56.0342 +1856 619 2 0.4238 13.230170399999999 18.62052 56.611559 +1857 619 2 0.4238 11.5971896 18.62052 56.611559 +1858 620 1 -0.8476 12.41368 18.62052 59.13762 +1859 620 2 0.4238 13.230170399999999 18.62052 59.714979 +1860 620 2 0.4238 11.5971896 18.62052 59.714979 +1861 621 1 -0.8476 12.41368 18.62052 62.24104 +1862 621 2 0.4238 13.230170399999999 18.62052 62.818399 +1863 621 2 0.4238 11.5971896 18.62052 62.818399 +1864 622 1 -0.8476 12.41368 18.62052 65.34446 +1865 622 2 0.4238 13.230170399999999 18.62052 65.921819 +1866 622 2 0.4238 11.5971896 18.62052 65.921819 +1867 623 1 -0.8476 12.41368 18.62052 68.44788 +1868 623 2 0.4238 13.230170399999999 18.62052 69.025239 +1869 623 2 0.4238 11.5971896 18.62052 69.025239 +1870 624 1 -0.8476 12.41368 18.62052 71.5513 +1871 624 2 0.4238 13.230170399999999 18.62052 72.128659 +1872 624 2 0.4238 11.5971896 18.62052 72.128659 +1873 625 1 -0.8476 12.41368 21.72394 25.0 +1874 625 2 0.4238 13.230170399999999 21.72394 25.577359 +1875 625 2 0.4238 11.5971896 21.72394 25.577359 +1876 626 1 -0.8476 12.41368 21.72394 28.10342 +1877 626 2 0.4238 13.230170399999999 21.72394 28.680779 +1878 626 2 0.4238 11.5971896 21.72394 28.680779 +1879 627 1 -0.8476 12.41368 21.72394 31.20684 +1880 627 2 0.4238 13.230170399999999 21.72394 31.784199 +1881 627 2 0.4238 11.5971896 21.72394 31.784199 +1882 628 1 -0.8476 12.41368 21.72394 34.31026 +1883 628 2 0.4238 13.230170399999999 21.72394 34.887619 +1884 628 2 0.4238 11.5971896 21.72394 34.887619 +1885 629 1 -0.8476 12.41368 21.72394 37.41368 +1886 629 2 0.4238 13.230170399999999 21.72394 37.991039 +1887 629 2 0.4238 11.5971896 21.72394 37.991039 +1888 630 1 -0.8476 12.41368 21.72394 40.5171 +1889 630 2 0.4238 13.230170399999999 21.72394 41.094459 +1890 630 2 0.4238 11.5971896 21.72394 41.094459 +1891 631 1 -0.8476 12.41368 21.72394 43.62052 +1892 631 2 0.4238 13.230170399999999 21.72394 44.197879 +1893 631 2 0.4238 11.5971896 21.72394 44.197879 +1894 632 1 -0.8476 12.41368 21.72394 46.72394 +1895 632 2 0.4238 13.230170399999999 21.72394 47.301299 +1896 632 2 0.4238 11.5971896 21.72394 47.301299 +1897 633 1 -0.8476 12.41368 21.72394 49.82736 +1898 633 2 0.4238 13.230170399999999 21.72394 50.404719 +1899 633 2 0.4238 11.5971896 21.72394 50.404719 +1900 634 1 -0.8476 12.41368 21.72394 52.93078 +1901 634 2 0.4238 13.230170399999999 21.72394 53.508139 +1902 634 2 0.4238 11.5971896 21.72394 53.508139 +1903 635 1 -0.8476 12.41368 21.72394 56.0342 +1904 635 2 0.4238 13.230170399999999 21.72394 56.611559 +1905 635 2 0.4238 11.5971896 21.72394 56.611559 +1906 636 1 -0.8476 12.41368 21.72394 59.13762 +1907 636 2 0.4238 13.230170399999999 21.72394 59.714979 +1908 636 2 0.4238 11.5971896 21.72394 59.714979 +1909 637 1 -0.8476 12.41368 21.72394 62.24104 +1910 637 2 0.4238 13.230170399999999 21.72394 62.818399 +1911 637 2 0.4238 11.5971896 21.72394 62.818399 +1912 638 1 -0.8476 12.41368 21.72394 65.34446 +1913 638 2 0.4238 13.230170399999999 21.72394 65.921819 +1914 638 2 0.4238 11.5971896 21.72394 65.921819 +1915 639 1 -0.8476 12.41368 21.72394 68.44788 +1916 639 2 0.4238 13.230170399999999 21.72394 69.025239 +1917 639 2 0.4238 11.5971896 21.72394 69.025239 +1918 640 1 -0.8476 12.41368 21.72394 71.5513 +1919 640 2 0.4238 13.230170399999999 21.72394 72.128659 +1920 640 2 0.4238 11.5971896 21.72394 72.128659 +1921 641 1 -0.8476 15.5171 0.0 25.0 +1922 641 2 0.4238 16.3335904 0.0 25.577359 +1923 641 2 0.4238 14.7006096 0.0 25.577359 +1924 642 1 -0.8476 15.5171 0.0 28.10342 +1925 642 2 0.4238 16.3335904 0.0 28.680779 +1926 642 2 0.4238 14.7006096 0.0 28.680779 +1927 643 1 -0.8476 15.5171 0.0 31.20684 +1928 643 2 0.4238 16.3335904 0.0 31.784199 +1929 643 2 0.4238 14.7006096 0.0 31.784199 +1930 644 1 -0.8476 15.5171 0.0 34.31026 +1931 644 2 0.4238 16.3335904 0.0 34.887619 +1932 644 2 0.4238 14.7006096 0.0 34.887619 +1933 645 1 -0.8476 15.5171 0.0 37.41368 +1934 645 2 0.4238 16.3335904 0.0 37.991039 +1935 645 2 0.4238 14.7006096 0.0 37.991039 +1936 646 1 -0.8476 15.5171 0.0 40.5171 +1937 646 2 0.4238 16.3335904 0.0 41.094459 +1938 646 2 0.4238 14.7006096 0.0 41.094459 +1939 647 1 -0.8476 15.5171 0.0 43.62052 +1940 647 2 0.4238 16.3335904 0.0 44.197879 +1941 647 2 0.4238 14.7006096 0.0 44.197879 +1942 648 1 -0.8476 15.5171 0.0 46.72394 +1943 648 2 0.4238 16.3335904 0.0 47.301299 +1944 648 2 0.4238 14.7006096 0.0 47.301299 +1945 649 1 -0.8476 15.5171 0.0 49.82736 +1946 649 2 0.4238 16.3335904 0.0 50.404719 +1947 649 2 0.4238 14.7006096 0.0 50.404719 +1948 650 1 -0.8476 15.5171 0.0 52.93078 +1949 650 2 0.4238 16.3335904 0.0 53.508139 +1950 650 2 0.4238 14.7006096 0.0 53.508139 +1951 651 1 -0.8476 15.5171 0.0 56.0342 +1952 651 2 0.4238 16.3335904 0.0 56.611559 +1953 651 2 0.4238 14.7006096 0.0 56.611559 +1954 652 1 -0.8476 15.5171 0.0 59.13762 +1955 652 2 0.4238 16.3335904 0.0 59.714979 +1956 652 2 0.4238 14.7006096 0.0 59.714979 +1957 653 1 -0.8476 15.5171 0.0 62.24104 +1958 653 2 0.4238 16.3335904 0.0 62.818399 +1959 653 2 0.4238 14.7006096 0.0 62.818399 +1960 654 1 -0.8476 15.5171 0.0 65.34446 +1961 654 2 0.4238 16.3335904 0.0 65.921819 +1962 654 2 0.4238 14.7006096 0.0 65.921819 +1963 655 1 -0.8476 15.5171 0.0 68.44788 +1964 655 2 0.4238 16.3335904 0.0 69.025239 +1965 655 2 0.4238 14.7006096 0.0 69.025239 +1966 656 1 -0.8476 15.5171 0.0 71.5513 +1967 656 2 0.4238 16.3335904 0.0 72.128659 +1968 656 2 0.4238 14.7006096 0.0 72.128659 +1969 657 1 -0.8476 15.5171 3.10342 25.0 +1970 657 2 0.4238 16.3335904 3.10342 25.577359 +1971 657 2 0.4238 14.7006096 3.10342 25.577359 +1972 658 1 -0.8476 15.5171 3.10342 28.10342 +1973 658 2 0.4238 16.3335904 3.10342 28.680779 +1974 658 2 0.4238 14.7006096 3.10342 28.680779 +1975 659 1 -0.8476 15.5171 3.10342 31.20684 +1976 659 2 0.4238 16.3335904 3.10342 31.784199 +1977 659 2 0.4238 14.7006096 3.10342 31.784199 +1978 660 1 -0.8476 15.5171 3.10342 34.31026 +1979 660 2 0.4238 16.3335904 3.10342 34.887619 +1980 660 2 0.4238 14.7006096 3.10342 34.887619 +1981 661 1 -0.8476 15.5171 3.10342 37.41368 +1982 661 2 0.4238 16.3335904 3.10342 37.991039 +1983 661 2 0.4238 14.7006096 3.10342 37.991039 +1984 662 1 -0.8476 15.5171 3.10342 40.5171 +1985 662 2 0.4238 16.3335904 3.10342 41.094459 +1986 662 2 0.4238 14.7006096 3.10342 41.094459 +1987 663 1 -0.8476 15.5171 3.10342 43.62052 +1988 663 2 0.4238 16.3335904 3.10342 44.197879 +1989 663 2 0.4238 14.7006096 3.10342 44.197879 +1990 664 1 -0.8476 15.5171 3.10342 46.72394 +1991 664 2 0.4238 16.3335904 3.10342 47.301299 +1992 664 2 0.4238 14.7006096 3.10342 47.301299 +1993 665 1 -0.8476 15.5171 3.10342 49.82736 +1994 665 2 0.4238 16.3335904 3.10342 50.404719 +1995 665 2 0.4238 14.7006096 3.10342 50.404719 +1996 666 1 -0.8476 15.5171 3.10342 52.93078 +1997 666 2 0.4238 16.3335904 3.10342 53.508139 +1998 666 2 0.4238 14.7006096 3.10342 53.508139 +1999 667 1 -0.8476 15.5171 3.10342 56.0342 +2000 667 2 0.4238 16.3335904 3.10342 56.611559 +2001 667 2 0.4238 14.7006096 3.10342 56.611559 +2002 668 1 -0.8476 15.5171 3.10342 59.13762 +2003 668 2 0.4238 16.3335904 3.10342 59.714979 +2004 668 2 0.4238 14.7006096 3.10342 59.714979 +2005 669 1 -0.8476 15.5171 3.10342 62.24104 +2006 669 2 0.4238 16.3335904 3.10342 62.818399 +2007 669 2 0.4238 14.7006096 3.10342 62.818399 +2008 670 1 -0.8476 15.5171 3.10342 65.34446 +2009 670 2 0.4238 16.3335904 3.10342 65.921819 +2010 670 2 0.4238 14.7006096 3.10342 65.921819 +2011 671 1 -0.8476 15.5171 3.10342 68.44788 +2012 671 2 0.4238 16.3335904 3.10342 69.025239 +2013 671 2 0.4238 14.7006096 3.10342 69.025239 +2014 672 1 -0.8476 15.5171 3.10342 71.5513 +2015 672 2 0.4238 16.3335904 3.10342 72.128659 +2016 672 2 0.4238 14.7006096 3.10342 72.128659 +2017 673 1 -0.8476 15.5171 6.20684 25.0 +2018 673 2 0.4238 16.3335904 6.20684 25.577359 +2019 673 2 0.4238 14.7006096 6.20684 25.577359 +2020 674 1 -0.8476 15.5171 6.20684 28.10342 +2021 674 2 0.4238 16.3335904 6.20684 28.680779 +2022 674 2 0.4238 14.7006096 6.20684 28.680779 +2023 675 1 -0.8476 15.5171 6.20684 31.20684 +2024 675 2 0.4238 16.3335904 6.20684 31.784199 +2025 675 2 0.4238 14.7006096 6.20684 31.784199 +2026 676 1 -0.8476 15.5171 6.20684 34.31026 +2027 676 2 0.4238 16.3335904 6.20684 34.887619 +2028 676 2 0.4238 14.7006096 6.20684 34.887619 +2029 677 1 -0.8476 15.5171 6.20684 37.41368 +2030 677 2 0.4238 16.3335904 6.20684 37.991039 +2031 677 2 0.4238 14.7006096 6.20684 37.991039 +2032 678 1 -0.8476 15.5171 6.20684 40.5171 +2033 678 2 0.4238 16.3335904 6.20684 41.094459 +2034 678 2 0.4238 14.7006096 6.20684 41.094459 +2035 679 1 -0.8476 15.5171 6.20684 43.62052 +2036 679 2 0.4238 16.3335904 6.20684 44.197879 +2037 679 2 0.4238 14.7006096 6.20684 44.197879 +2038 680 1 -0.8476 15.5171 6.20684 46.72394 +2039 680 2 0.4238 16.3335904 6.20684 47.301299 +2040 680 2 0.4238 14.7006096 6.20684 47.301299 +2041 681 1 -0.8476 15.5171 6.20684 49.82736 +2042 681 2 0.4238 16.3335904 6.20684 50.404719 +2043 681 2 0.4238 14.7006096 6.20684 50.404719 +2044 682 1 -0.8476 15.5171 6.20684 52.93078 +2045 682 2 0.4238 16.3335904 6.20684 53.508139 +2046 682 2 0.4238 14.7006096 6.20684 53.508139 +2047 683 1 -0.8476 15.5171 6.20684 56.0342 +2048 683 2 0.4238 16.3335904 6.20684 56.611559 +2049 683 2 0.4238 14.7006096 6.20684 56.611559 +2050 684 1 -0.8476 15.5171 6.20684 59.13762 +2051 684 2 0.4238 16.3335904 6.20684 59.714979 +2052 684 2 0.4238 14.7006096 6.20684 59.714979 +2053 685 1 -0.8476 15.5171 6.20684 62.24104 +2054 685 2 0.4238 16.3335904 6.20684 62.818399 +2055 685 2 0.4238 14.7006096 6.20684 62.818399 +2056 686 1 -0.8476 15.5171 6.20684 65.34446 +2057 686 2 0.4238 16.3335904 6.20684 65.921819 +2058 686 2 0.4238 14.7006096 6.20684 65.921819 +2059 687 1 -0.8476 15.5171 6.20684 68.44788 +2060 687 2 0.4238 16.3335904 6.20684 69.025239 +2061 687 2 0.4238 14.7006096 6.20684 69.025239 +2062 688 1 -0.8476 15.5171 6.20684 71.5513 +2063 688 2 0.4238 16.3335904 6.20684 72.128659 +2064 688 2 0.4238 14.7006096 6.20684 72.128659 +2065 689 1 -0.8476 15.5171 9.31026 25.0 +2066 689 2 0.4238 16.3335904 9.31026 25.577359 +2067 689 2 0.4238 14.7006096 9.31026 25.577359 +2068 690 1 -0.8476 15.5171 9.31026 28.10342 +2069 690 2 0.4238 16.3335904 9.31026 28.680779 +2070 690 2 0.4238 14.7006096 9.31026 28.680779 +2071 691 1 -0.8476 15.5171 9.31026 31.20684 +2072 691 2 0.4238 16.3335904 9.31026 31.784199 +2073 691 2 0.4238 14.7006096 9.31026 31.784199 +2074 692 1 -0.8476 15.5171 9.31026 34.31026 +2075 692 2 0.4238 16.3335904 9.31026 34.887619 +2076 692 2 0.4238 14.7006096 9.31026 34.887619 +2077 693 1 -0.8476 15.5171 9.31026 37.41368 +2078 693 2 0.4238 16.3335904 9.31026 37.991039 +2079 693 2 0.4238 14.7006096 9.31026 37.991039 +2080 694 1 -0.8476 15.5171 9.31026 40.5171 +2081 694 2 0.4238 16.3335904 9.31026 41.094459 +2082 694 2 0.4238 14.7006096 9.31026 41.094459 +2083 695 1 -0.8476 15.5171 9.31026 43.62052 +2084 695 2 0.4238 16.3335904 9.31026 44.197879 +2085 695 2 0.4238 14.7006096 9.31026 44.197879 +2086 696 1 -0.8476 15.5171 9.31026 46.72394 +2087 696 2 0.4238 16.3335904 9.31026 47.301299 +2088 696 2 0.4238 14.7006096 9.31026 47.301299 +2089 697 1 -0.8476 15.5171 9.31026 49.82736 +2090 697 2 0.4238 16.3335904 9.31026 50.404719 +2091 697 2 0.4238 14.7006096 9.31026 50.404719 +2092 698 1 -0.8476 15.5171 9.31026 52.93078 +2093 698 2 0.4238 16.3335904 9.31026 53.508139 +2094 698 2 0.4238 14.7006096 9.31026 53.508139 +2095 699 1 -0.8476 15.5171 9.31026 56.0342 +2096 699 2 0.4238 16.3335904 9.31026 56.611559 +2097 699 2 0.4238 14.7006096 9.31026 56.611559 +2098 700 1 -0.8476 15.5171 9.31026 59.13762 +2099 700 2 0.4238 16.3335904 9.31026 59.714979 +2100 700 2 0.4238 14.7006096 9.31026 59.714979 +2101 701 1 -0.8476 15.5171 9.31026 62.24104 +2102 701 2 0.4238 16.3335904 9.31026 62.818399 +2103 701 2 0.4238 14.7006096 9.31026 62.818399 +2104 702 1 -0.8476 15.5171 9.31026 65.34446 +2105 702 2 0.4238 16.3335904 9.31026 65.921819 +2106 702 2 0.4238 14.7006096 9.31026 65.921819 +2107 703 1 -0.8476 15.5171 9.31026 68.44788 +2108 703 2 0.4238 16.3335904 9.31026 69.025239 +2109 703 2 0.4238 14.7006096 9.31026 69.025239 +2110 704 1 -0.8476 15.5171 9.31026 71.5513 +2111 704 2 0.4238 16.3335904 9.31026 72.128659 +2112 704 2 0.4238 14.7006096 9.31026 72.128659 +2113 705 1 -0.8476 15.5171 12.41368 25.0 +2114 705 2 0.4238 16.3335904 12.41368 25.577359 +2115 705 2 0.4238 14.7006096 12.41368 25.577359 +2116 706 1 -0.8476 15.5171 12.41368 28.10342 +2117 706 2 0.4238 16.3335904 12.41368 28.680779 +2118 706 2 0.4238 14.7006096 12.41368 28.680779 +2119 707 1 -0.8476 15.5171 12.41368 31.20684 +2120 707 2 0.4238 16.3335904 12.41368 31.784199 +2121 707 2 0.4238 14.7006096 12.41368 31.784199 +2122 708 1 -0.8476 15.5171 12.41368 34.31026 +2123 708 2 0.4238 16.3335904 12.41368 34.887619 +2124 708 2 0.4238 14.7006096 12.41368 34.887619 +2125 709 1 -0.8476 15.5171 12.41368 37.41368 +2126 709 2 0.4238 16.3335904 12.41368 37.991039 +2127 709 2 0.4238 14.7006096 12.41368 37.991039 +2128 710 1 -0.8476 15.5171 12.41368 40.5171 +2129 710 2 0.4238 16.3335904 12.41368 41.094459 +2130 710 2 0.4238 14.7006096 12.41368 41.094459 +2131 711 1 -0.8476 15.5171 12.41368 43.62052 +2132 711 2 0.4238 16.3335904 12.41368 44.197879 +2133 711 2 0.4238 14.7006096 12.41368 44.197879 +2134 712 1 -0.8476 15.5171 12.41368 46.72394 +2135 712 2 0.4238 16.3335904 12.41368 47.301299 +2136 712 2 0.4238 14.7006096 12.41368 47.301299 +2137 713 1 -0.8476 15.5171 12.41368 49.82736 +2138 713 2 0.4238 16.3335904 12.41368 50.404719 +2139 713 2 0.4238 14.7006096 12.41368 50.404719 +2140 714 1 -0.8476 15.5171 12.41368 52.93078 +2141 714 2 0.4238 16.3335904 12.41368 53.508139 +2142 714 2 0.4238 14.7006096 12.41368 53.508139 +2143 715 1 -0.8476 15.5171 12.41368 56.0342 +2144 715 2 0.4238 16.3335904 12.41368 56.611559 +2145 715 2 0.4238 14.7006096 12.41368 56.611559 +2146 716 1 -0.8476 15.5171 12.41368 59.13762 +2147 716 2 0.4238 16.3335904 12.41368 59.714979 +2148 716 2 0.4238 14.7006096 12.41368 59.714979 +2149 717 1 -0.8476 15.5171 12.41368 62.24104 +2150 717 2 0.4238 16.3335904 12.41368 62.818399 +2151 717 2 0.4238 14.7006096 12.41368 62.818399 +2152 718 1 -0.8476 15.5171 12.41368 65.34446 +2153 718 2 0.4238 16.3335904 12.41368 65.921819 +2154 718 2 0.4238 14.7006096 12.41368 65.921819 +2155 719 1 -0.8476 15.5171 12.41368 68.44788 +2156 719 2 0.4238 16.3335904 12.41368 69.025239 +2157 719 2 0.4238 14.7006096 12.41368 69.025239 +2158 720 1 -0.8476 15.5171 12.41368 71.5513 +2159 720 2 0.4238 16.3335904 12.41368 72.128659 +2160 720 2 0.4238 14.7006096 12.41368 72.128659 +2161 721 1 -0.8476 15.5171 15.5171 25.0 +2162 721 2 0.4238 16.3335904 15.5171 25.577359 +2163 721 2 0.4238 14.7006096 15.5171 25.577359 +2164 722 1 -0.8476 15.5171 15.5171 28.10342 +2165 722 2 0.4238 16.3335904 15.5171 28.680779 +2166 722 2 0.4238 14.7006096 15.5171 28.680779 +2167 723 1 -0.8476 15.5171 15.5171 31.20684 +2168 723 2 0.4238 16.3335904 15.5171 31.784199 +2169 723 2 0.4238 14.7006096 15.5171 31.784199 +2170 724 1 -0.8476 15.5171 15.5171 34.31026 +2171 724 2 0.4238 16.3335904 15.5171 34.887619 +2172 724 2 0.4238 14.7006096 15.5171 34.887619 +2173 725 1 -0.8476 15.5171 15.5171 37.41368 +2174 725 2 0.4238 16.3335904 15.5171 37.991039 +2175 725 2 0.4238 14.7006096 15.5171 37.991039 +2176 726 1 -0.8476 15.5171 15.5171 40.5171 +2177 726 2 0.4238 16.3335904 15.5171 41.094459 +2178 726 2 0.4238 14.7006096 15.5171 41.094459 +2179 727 1 -0.8476 15.5171 15.5171 43.62052 +2180 727 2 0.4238 16.3335904 15.5171 44.197879 +2181 727 2 0.4238 14.7006096 15.5171 44.197879 +2182 728 1 -0.8476 15.5171 15.5171 46.72394 +2183 728 2 0.4238 16.3335904 15.5171 47.301299 +2184 728 2 0.4238 14.7006096 15.5171 47.301299 +2185 729 1 -0.8476 15.5171 15.5171 49.82736 +2186 729 2 0.4238 16.3335904 15.5171 50.404719 +2187 729 2 0.4238 14.7006096 15.5171 50.404719 +2188 730 1 -0.8476 15.5171 15.5171 52.93078 +2189 730 2 0.4238 16.3335904 15.5171 53.508139 +2190 730 2 0.4238 14.7006096 15.5171 53.508139 +2191 731 1 -0.8476 15.5171 15.5171 56.0342 +2192 731 2 0.4238 16.3335904 15.5171 56.611559 +2193 731 2 0.4238 14.7006096 15.5171 56.611559 +2194 732 1 -0.8476 15.5171 15.5171 59.13762 +2195 732 2 0.4238 16.3335904 15.5171 59.714979 +2196 732 2 0.4238 14.7006096 15.5171 59.714979 +2197 733 1 -0.8476 15.5171 15.5171 62.24104 +2198 733 2 0.4238 16.3335904 15.5171 62.818399 +2199 733 2 0.4238 14.7006096 15.5171 62.818399 +2200 734 1 -0.8476 15.5171 15.5171 65.34446 +2201 734 2 0.4238 16.3335904 15.5171 65.921819 +2202 734 2 0.4238 14.7006096 15.5171 65.921819 +2203 735 1 -0.8476 15.5171 15.5171 68.44788 +2204 735 2 0.4238 16.3335904 15.5171 69.025239 +2205 735 2 0.4238 14.7006096 15.5171 69.025239 +2206 736 1 -0.8476 15.5171 15.5171 71.5513 +2207 736 2 0.4238 16.3335904 15.5171 72.128659 +2208 736 2 0.4238 14.7006096 15.5171 72.128659 +2209 737 1 -0.8476 15.5171 18.62052 25.0 +2210 737 2 0.4238 16.3335904 18.62052 25.577359 +2211 737 2 0.4238 14.7006096 18.62052 25.577359 +2212 738 1 -0.8476 15.5171 18.62052 28.10342 +2213 738 2 0.4238 16.3335904 18.62052 28.680779 +2214 738 2 0.4238 14.7006096 18.62052 28.680779 +2215 739 1 -0.8476 15.5171 18.62052 31.20684 +2216 739 2 0.4238 16.3335904 18.62052 31.784199 +2217 739 2 0.4238 14.7006096 18.62052 31.784199 +2218 740 1 -0.8476 15.5171 18.62052 34.31026 +2219 740 2 0.4238 16.3335904 18.62052 34.887619 +2220 740 2 0.4238 14.7006096 18.62052 34.887619 +2221 741 1 -0.8476 15.5171 18.62052 37.41368 +2222 741 2 0.4238 16.3335904 18.62052 37.991039 +2223 741 2 0.4238 14.7006096 18.62052 37.991039 +2224 742 1 -0.8476 15.5171 18.62052 40.5171 +2225 742 2 0.4238 16.3335904 18.62052 41.094459 +2226 742 2 0.4238 14.7006096 18.62052 41.094459 +2227 743 1 -0.8476 15.5171 18.62052 43.62052 +2228 743 2 0.4238 16.3335904 18.62052 44.197879 +2229 743 2 0.4238 14.7006096 18.62052 44.197879 +2230 744 1 -0.8476 15.5171 18.62052 46.72394 +2231 744 2 0.4238 16.3335904 18.62052 47.301299 +2232 744 2 0.4238 14.7006096 18.62052 47.301299 +2233 745 1 -0.8476 15.5171 18.62052 49.82736 +2234 745 2 0.4238 16.3335904 18.62052 50.404719 +2235 745 2 0.4238 14.7006096 18.62052 50.404719 +2236 746 1 -0.8476 15.5171 18.62052 52.93078 +2237 746 2 0.4238 16.3335904 18.62052 53.508139 +2238 746 2 0.4238 14.7006096 18.62052 53.508139 +2239 747 1 -0.8476 15.5171 18.62052 56.0342 +2240 747 2 0.4238 16.3335904 18.62052 56.611559 +2241 747 2 0.4238 14.7006096 18.62052 56.611559 +2242 748 1 -0.8476 15.5171 18.62052 59.13762 +2243 748 2 0.4238 16.3335904 18.62052 59.714979 +2244 748 2 0.4238 14.7006096 18.62052 59.714979 +2245 749 1 -0.8476 15.5171 18.62052 62.24104 +2246 749 2 0.4238 16.3335904 18.62052 62.818399 +2247 749 2 0.4238 14.7006096 18.62052 62.818399 +2248 750 1 -0.8476 15.5171 18.62052 65.34446 +2249 750 2 0.4238 16.3335904 18.62052 65.921819 +2250 750 2 0.4238 14.7006096 18.62052 65.921819 +2251 751 1 -0.8476 15.5171 18.62052 68.44788 +2252 751 2 0.4238 16.3335904 18.62052 69.025239 +2253 751 2 0.4238 14.7006096 18.62052 69.025239 +2254 752 1 -0.8476 15.5171 18.62052 71.5513 +2255 752 2 0.4238 16.3335904 18.62052 72.128659 +2256 752 2 0.4238 14.7006096 18.62052 72.128659 +2257 753 1 -0.8476 15.5171 21.72394 25.0 +2258 753 2 0.4238 16.3335904 21.72394 25.577359 +2259 753 2 0.4238 14.7006096 21.72394 25.577359 +2260 754 1 -0.8476 15.5171 21.72394 28.10342 +2261 754 2 0.4238 16.3335904 21.72394 28.680779 +2262 754 2 0.4238 14.7006096 21.72394 28.680779 +2263 755 1 -0.8476 15.5171 21.72394 31.20684 +2264 755 2 0.4238 16.3335904 21.72394 31.784199 +2265 755 2 0.4238 14.7006096 21.72394 31.784199 +2266 756 1 -0.8476 15.5171 21.72394 34.31026 +2267 756 2 0.4238 16.3335904 21.72394 34.887619 +2268 756 2 0.4238 14.7006096 21.72394 34.887619 +2269 757 1 -0.8476 15.5171 21.72394 37.41368 +2270 757 2 0.4238 16.3335904 21.72394 37.991039 +2271 757 2 0.4238 14.7006096 21.72394 37.991039 +2272 758 1 -0.8476 15.5171 21.72394 40.5171 +2273 758 2 0.4238 16.3335904 21.72394 41.094459 +2274 758 2 0.4238 14.7006096 21.72394 41.094459 +2275 759 1 -0.8476 15.5171 21.72394 43.62052 +2276 759 2 0.4238 16.3335904 21.72394 44.197879 +2277 759 2 0.4238 14.7006096 21.72394 44.197879 +2278 760 1 -0.8476 15.5171 21.72394 46.72394 +2279 760 2 0.4238 16.3335904 21.72394 47.301299 +2280 760 2 0.4238 14.7006096 21.72394 47.301299 +2281 761 1 -0.8476 15.5171 21.72394 49.82736 +2282 761 2 0.4238 16.3335904 21.72394 50.404719 +2283 761 2 0.4238 14.7006096 21.72394 50.404719 +2284 762 1 -0.8476 15.5171 21.72394 52.93078 +2285 762 2 0.4238 16.3335904 21.72394 53.508139 +2286 762 2 0.4238 14.7006096 21.72394 53.508139 +2287 763 1 -0.8476 15.5171 21.72394 56.0342 +2288 763 2 0.4238 16.3335904 21.72394 56.611559 +2289 763 2 0.4238 14.7006096 21.72394 56.611559 +2290 764 1 -0.8476 15.5171 21.72394 59.13762 +2291 764 2 0.4238 16.3335904 21.72394 59.714979 +2292 764 2 0.4238 14.7006096 21.72394 59.714979 +2293 765 1 -0.8476 15.5171 21.72394 62.24104 +2294 765 2 0.4238 16.3335904 21.72394 62.818399 +2295 765 2 0.4238 14.7006096 21.72394 62.818399 +2296 766 1 -0.8476 15.5171 21.72394 65.34446 +2297 766 2 0.4238 16.3335904 21.72394 65.921819 +2298 766 2 0.4238 14.7006096 21.72394 65.921819 +2299 767 1 -0.8476 15.5171 21.72394 68.44788 +2300 767 2 0.4238 16.3335904 21.72394 69.025239 +2301 767 2 0.4238 14.7006096 21.72394 69.025239 +2302 768 1 -0.8476 15.5171 21.72394 71.5513 +2303 768 2 0.4238 16.3335904 21.72394 72.128659 +2304 768 2 0.4238 14.7006096 21.72394 72.128659 +2305 769 1 -0.8476 18.62052 0.0 25.0 +2306 769 2 0.4238 19.4370104 0.0 25.577359 +2307 769 2 0.4238 17.8040296 0.0 25.577359 +2308 770 1 -0.8476 18.62052 0.0 28.10342 +2309 770 2 0.4238 19.4370104 0.0 28.680779 +2310 770 2 0.4238 17.8040296 0.0 28.680779 +2311 771 1 -0.8476 18.62052 0.0 31.20684 +2312 771 2 0.4238 19.4370104 0.0 31.784199 +2313 771 2 0.4238 17.8040296 0.0 31.784199 +2314 772 1 -0.8476 18.62052 0.0 34.31026 +2315 772 2 0.4238 19.4370104 0.0 34.887619 +2316 772 2 0.4238 17.8040296 0.0 34.887619 +2317 773 1 -0.8476 18.62052 0.0 37.41368 +2318 773 2 0.4238 19.4370104 0.0 37.991039 +2319 773 2 0.4238 17.8040296 0.0 37.991039 +2320 774 1 -0.8476 18.62052 0.0 40.5171 +2321 774 2 0.4238 19.4370104 0.0 41.094459 +2322 774 2 0.4238 17.8040296 0.0 41.094459 +2323 775 1 -0.8476 18.62052 0.0 43.62052 +2324 775 2 0.4238 19.4370104 0.0 44.197879 +2325 775 2 0.4238 17.8040296 0.0 44.197879 +2326 776 1 -0.8476 18.62052 0.0 46.72394 +2327 776 2 0.4238 19.4370104 0.0 47.301299 +2328 776 2 0.4238 17.8040296 0.0 47.301299 +2329 777 1 -0.8476 18.62052 0.0 49.82736 +2330 777 2 0.4238 19.4370104 0.0 50.404719 +2331 777 2 0.4238 17.8040296 0.0 50.404719 +2332 778 1 -0.8476 18.62052 0.0 52.93078 +2333 778 2 0.4238 19.4370104 0.0 53.508139 +2334 778 2 0.4238 17.8040296 0.0 53.508139 +2335 779 1 -0.8476 18.62052 0.0 56.0342 +2336 779 2 0.4238 19.4370104 0.0 56.611559 +2337 779 2 0.4238 17.8040296 0.0 56.611559 +2338 780 1 -0.8476 18.62052 0.0 59.13762 +2339 780 2 0.4238 19.4370104 0.0 59.714979 +2340 780 2 0.4238 17.8040296 0.0 59.714979 +2341 781 1 -0.8476 18.62052 0.0 62.24104 +2342 781 2 0.4238 19.4370104 0.0 62.818399 +2343 781 2 0.4238 17.8040296 0.0 62.818399 +2344 782 1 -0.8476 18.62052 0.0 65.34446 +2345 782 2 0.4238 19.4370104 0.0 65.921819 +2346 782 2 0.4238 17.8040296 0.0 65.921819 +2347 783 1 -0.8476 18.62052 0.0 68.44788 +2348 783 2 0.4238 19.4370104 0.0 69.025239 +2349 783 2 0.4238 17.8040296 0.0 69.025239 +2350 784 1 -0.8476 18.62052 0.0 71.5513 +2351 784 2 0.4238 19.4370104 0.0 72.128659 +2352 784 2 0.4238 17.8040296 0.0 72.128659 +2353 785 1 -0.8476 18.62052 3.10342 25.0 +2354 785 2 0.4238 19.4370104 3.10342 25.577359 +2355 785 2 0.4238 17.8040296 3.10342 25.577359 +2356 786 1 -0.8476 18.62052 3.10342 28.10342 +2357 786 2 0.4238 19.4370104 3.10342 28.680779 +2358 786 2 0.4238 17.8040296 3.10342 28.680779 +2359 787 1 -0.8476 18.62052 3.10342 31.20684 +2360 787 2 0.4238 19.4370104 3.10342 31.784199 +2361 787 2 0.4238 17.8040296 3.10342 31.784199 +2362 788 1 -0.8476 18.62052 3.10342 34.31026 +2363 788 2 0.4238 19.4370104 3.10342 34.887619 +2364 788 2 0.4238 17.8040296 3.10342 34.887619 +2365 789 1 -0.8476 18.62052 3.10342 37.41368 +2366 789 2 0.4238 19.4370104 3.10342 37.991039 +2367 789 2 0.4238 17.8040296 3.10342 37.991039 +2368 790 1 -0.8476 18.62052 3.10342 40.5171 +2369 790 2 0.4238 19.4370104 3.10342 41.094459 +2370 790 2 0.4238 17.8040296 3.10342 41.094459 +2371 791 1 -0.8476 18.62052 3.10342 43.62052 +2372 791 2 0.4238 19.4370104 3.10342 44.197879 +2373 791 2 0.4238 17.8040296 3.10342 44.197879 +2374 792 1 -0.8476 18.62052 3.10342 46.72394 +2375 792 2 0.4238 19.4370104 3.10342 47.301299 +2376 792 2 0.4238 17.8040296 3.10342 47.301299 +2377 793 1 -0.8476 18.62052 3.10342 49.82736 +2378 793 2 0.4238 19.4370104 3.10342 50.404719 +2379 793 2 0.4238 17.8040296 3.10342 50.404719 +2380 794 1 -0.8476 18.62052 3.10342 52.93078 +2381 794 2 0.4238 19.4370104 3.10342 53.508139 +2382 794 2 0.4238 17.8040296 3.10342 53.508139 +2383 795 1 -0.8476 18.62052 3.10342 56.0342 +2384 795 2 0.4238 19.4370104 3.10342 56.611559 +2385 795 2 0.4238 17.8040296 3.10342 56.611559 +2386 796 1 -0.8476 18.62052 3.10342 59.13762 +2387 796 2 0.4238 19.4370104 3.10342 59.714979 +2388 796 2 0.4238 17.8040296 3.10342 59.714979 +2389 797 1 -0.8476 18.62052 3.10342 62.24104 +2390 797 2 0.4238 19.4370104 3.10342 62.818399 +2391 797 2 0.4238 17.8040296 3.10342 62.818399 +2392 798 1 -0.8476 18.62052 3.10342 65.34446 +2393 798 2 0.4238 19.4370104 3.10342 65.921819 +2394 798 2 0.4238 17.8040296 3.10342 65.921819 +2395 799 1 -0.8476 18.62052 3.10342 68.44788 +2396 799 2 0.4238 19.4370104 3.10342 69.025239 +2397 799 2 0.4238 17.8040296 3.10342 69.025239 +2398 800 1 -0.8476 18.62052 3.10342 71.5513 +2399 800 2 0.4238 19.4370104 3.10342 72.128659 +2400 800 2 0.4238 17.8040296 3.10342 72.128659 +2401 801 1 -0.8476 18.62052 6.20684 25.0 +2402 801 2 0.4238 19.4370104 6.20684 25.577359 +2403 801 2 0.4238 17.8040296 6.20684 25.577359 +2404 802 1 -0.8476 18.62052 6.20684 28.10342 +2405 802 2 0.4238 19.4370104 6.20684 28.680779 +2406 802 2 0.4238 17.8040296 6.20684 28.680779 +2407 803 1 -0.8476 18.62052 6.20684 31.20684 +2408 803 2 0.4238 19.4370104 6.20684 31.784199 +2409 803 2 0.4238 17.8040296 6.20684 31.784199 +2410 804 1 -0.8476 18.62052 6.20684 34.31026 +2411 804 2 0.4238 19.4370104 6.20684 34.887619 +2412 804 2 0.4238 17.8040296 6.20684 34.887619 +2413 805 1 -0.8476 18.62052 6.20684 37.41368 +2414 805 2 0.4238 19.4370104 6.20684 37.991039 +2415 805 2 0.4238 17.8040296 6.20684 37.991039 +2416 806 1 -0.8476 18.62052 6.20684 40.5171 +2417 806 2 0.4238 19.4370104 6.20684 41.094459 +2418 806 2 0.4238 17.8040296 6.20684 41.094459 +2419 807 1 -0.8476 18.62052 6.20684 43.62052 +2420 807 2 0.4238 19.4370104 6.20684 44.197879 +2421 807 2 0.4238 17.8040296 6.20684 44.197879 +2422 808 1 -0.8476 18.62052 6.20684 46.72394 +2423 808 2 0.4238 19.4370104 6.20684 47.301299 +2424 808 2 0.4238 17.8040296 6.20684 47.301299 +2425 809 1 -0.8476 18.62052 6.20684 49.82736 +2426 809 2 0.4238 19.4370104 6.20684 50.404719 +2427 809 2 0.4238 17.8040296 6.20684 50.404719 +2428 810 1 -0.8476 18.62052 6.20684 52.93078 +2429 810 2 0.4238 19.4370104 6.20684 53.508139 +2430 810 2 0.4238 17.8040296 6.20684 53.508139 +2431 811 1 -0.8476 18.62052 6.20684 56.0342 +2432 811 2 0.4238 19.4370104 6.20684 56.611559 +2433 811 2 0.4238 17.8040296 6.20684 56.611559 +2434 812 1 -0.8476 18.62052 6.20684 59.13762 +2435 812 2 0.4238 19.4370104 6.20684 59.714979 +2436 812 2 0.4238 17.8040296 6.20684 59.714979 +2437 813 1 -0.8476 18.62052 6.20684 62.24104 +2438 813 2 0.4238 19.4370104 6.20684 62.818399 +2439 813 2 0.4238 17.8040296 6.20684 62.818399 +2440 814 1 -0.8476 18.62052 6.20684 65.34446 +2441 814 2 0.4238 19.4370104 6.20684 65.921819 +2442 814 2 0.4238 17.8040296 6.20684 65.921819 +2443 815 1 -0.8476 18.62052 6.20684 68.44788 +2444 815 2 0.4238 19.4370104 6.20684 69.025239 +2445 815 2 0.4238 17.8040296 6.20684 69.025239 +2446 816 1 -0.8476 18.62052 6.20684 71.5513 +2447 816 2 0.4238 19.4370104 6.20684 72.128659 +2448 816 2 0.4238 17.8040296 6.20684 72.128659 +2449 817 1 -0.8476 18.62052 9.31026 25.0 +2450 817 2 0.4238 19.4370104 9.31026 25.577359 +2451 817 2 0.4238 17.8040296 9.31026 25.577359 +2452 818 1 -0.8476 18.62052 9.31026 28.10342 +2453 818 2 0.4238 19.4370104 9.31026 28.680779 +2454 818 2 0.4238 17.8040296 9.31026 28.680779 +2455 819 1 -0.8476 18.62052 9.31026 31.20684 +2456 819 2 0.4238 19.4370104 9.31026 31.784199 +2457 819 2 0.4238 17.8040296 9.31026 31.784199 +2458 820 1 -0.8476 18.62052 9.31026 34.31026 +2459 820 2 0.4238 19.4370104 9.31026 34.887619 +2460 820 2 0.4238 17.8040296 9.31026 34.887619 +2461 821 1 -0.8476 18.62052 9.31026 37.41368 +2462 821 2 0.4238 19.4370104 9.31026 37.991039 +2463 821 2 0.4238 17.8040296 9.31026 37.991039 +2464 822 1 -0.8476 18.62052 9.31026 40.5171 +2465 822 2 0.4238 19.4370104 9.31026 41.094459 +2466 822 2 0.4238 17.8040296 9.31026 41.094459 +2467 823 1 -0.8476 18.62052 9.31026 43.62052 +2468 823 2 0.4238 19.4370104 9.31026 44.197879 +2469 823 2 0.4238 17.8040296 9.31026 44.197879 +2470 824 1 -0.8476 18.62052 9.31026 46.72394 +2471 824 2 0.4238 19.4370104 9.31026 47.301299 +2472 824 2 0.4238 17.8040296 9.31026 47.301299 +2473 825 1 -0.8476 18.62052 9.31026 49.82736 +2474 825 2 0.4238 19.4370104 9.31026 50.404719 +2475 825 2 0.4238 17.8040296 9.31026 50.404719 +2476 826 1 -0.8476 18.62052 9.31026 52.93078 +2477 826 2 0.4238 19.4370104 9.31026 53.508139 +2478 826 2 0.4238 17.8040296 9.31026 53.508139 +2479 827 1 -0.8476 18.62052 9.31026 56.0342 +2480 827 2 0.4238 19.4370104 9.31026 56.611559 +2481 827 2 0.4238 17.8040296 9.31026 56.611559 +2482 828 1 -0.8476 18.62052 9.31026 59.13762 +2483 828 2 0.4238 19.4370104 9.31026 59.714979 +2484 828 2 0.4238 17.8040296 9.31026 59.714979 +2485 829 1 -0.8476 18.62052 9.31026 62.24104 +2486 829 2 0.4238 19.4370104 9.31026 62.818399 +2487 829 2 0.4238 17.8040296 9.31026 62.818399 +2488 830 1 -0.8476 18.62052 9.31026 65.34446 +2489 830 2 0.4238 19.4370104 9.31026 65.921819 +2490 830 2 0.4238 17.8040296 9.31026 65.921819 +2491 831 1 -0.8476 18.62052 9.31026 68.44788 +2492 831 2 0.4238 19.4370104 9.31026 69.025239 +2493 831 2 0.4238 17.8040296 9.31026 69.025239 +2494 832 1 -0.8476 18.62052 9.31026 71.5513 +2495 832 2 0.4238 19.4370104 9.31026 72.128659 +2496 832 2 0.4238 17.8040296 9.31026 72.128659 +2497 833 1 -0.8476 18.62052 12.41368 25.0 +2498 833 2 0.4238 19.4370104 12.41368 25.577359 +2499 833 2 0.4238 17.8040296 12.41368 25.577359 +2500 834 1 -0.8476 18.62052 12.41368 28.10342 +2501 834 2 0.4238 19.4370104 12.41368 28.680779 +2502 834 2 0.4238 17.8040296 12.41368 28.680779 +2503 835 1 -0.8476 18.62052 12.41368 31.20684 +2504 835 2 0.4238 19.4370104 12.41368 31.784199 +2505 835 2 0.4238 17.8040296 12.41368 31.784199 +2506 836 1 -0.8476 18.62052 12.41368 34.31026 +2507 836 2 0.4238 19.4370104 12.41368 34.887619 +2508 836 2 0.4238 17.8040296 12.41368 34.887619 +2509 837 1 -0.8476 18.62052 12.41368 37.41368 +2510 837 2 0.4238 19.4370104 12.41368 37.991039 +2511 837 2 0.4238 17.8040296 12.41368 37.991039 +2512 838 1 -0.8476 18.62052 12.41368 40.5171 +2513 838 2 0.4238 19.4370104 12.41368 41.094459 +2514 838 2 0.4238 17.8040296 12.41368 41.094459 +2515 839 1 -0.8476 18.62052 12.41368 43.62052 +2516 839 2 0.4238 19.4370104 12.41368 44.197879 +2517 839 2 0.4238 17.8040296 12.41368 44.197879 +2518 840 1 -0.8476 18.62052 12.41368 46.72394 +2519 840 2 0.4238 19.4370104 12.41368 47.301299 +2520 840 2 0.4238 17.8040296 12.41368 47.301299 +2521 841 1 -0.8476 18.62052 12.41368 49.82736 +2522 841 2 0.4238 19.4370104 12.41368 50.404719 +2523 841 2 0.4238 17.8040296 12.41368 50.404719 +2524 842 1 -0.8476 18.62052 12.41368 52.93078 +2525 842 2 0.4238 19.4370104 12.41368 53.508139 +2526 842 2 0.4238 17.8040296 12.41368 53.508139 +2527 843 1 -0.8476 18.62052 12.41368 56.0342 +2528 843 2 0.4238 19.4370104 12.41368 56.611559 +2529 843 2 0.4238 17.8040296 12.41368 56.611559 +2530 844 1 -0.8476 18.62052 12.41368 59.13762 +2531 844 2 0.4238 19.4370104 12.41368 59.714979 +2532 844 2 0.4238 17.8040296 12.41368 59.714979 +2533 845 1 -0.8476 18.62052 12.41368 62.24104 +2534 845 2 0.4238 19.4370104 12.41368 62.818399 +2535 845 2 0.4238 17.8040296 12.41368 62.818399 +2536 846 1 -0.8476 18.62052 12.41368 65.34446 +2537 846 2 0.4238 19.4370104 12.41368 65.921819 +2538 846 2 0.4238 17.8040296 12.41368 65.921819 +2539 847 1 -0.8476 18.62052 12.41368 68.44788 +2540 847 2 0.4238 19.4370104 12.41368 69.025239 +2541 847 2 0.4238 17.8040296 12.41368 69.025239 +2542 848 1 -0.8476 18.62052 12.41368 71.5513 +2543 848 2 0.4238 19.4370104 12.41368 72.128659 +2544 848 2 0.4238 17.8040296 12.41368 72.128659 +2545 849 1 -0.8476 18.62052 15.5171 25.0 +2546 849 2 0.4238 19.4370104 15.5171 25.577359 +2547 849 2 0.4238 17.8040296 15.5171 25.577359 +2548 850 1 -0.8476 18.62052 15.5171 28.10342 +2549 850 2 0.4238 19.4370104 15.5171 28.680779 +2550 850 2 0.4238 17.8040296 15.5171 28.680779 +2551 851 1 -0.8476 18.62052 15.5171 31.20684 +2552 851 2 0.4238 19.4370104 15.5171 31.784199 +2553 851 2 0.4238 17.8040296 15.5171 31.784199 +2554 852 1 -0.8476 18.62052 15.5171 34.31026 +2555 852 2 0.4238 19.4370104 15.5171 34.887619 +2556 852 2 0.4238 17.8040296 15.5171 34.887619 +2557 853 1 -0.8476 18.62052 15.5171 37.41368 +2558 853 2 0.4238 19.4370104 15.5171 37.991039 +2559 853 2 0.4238 17.8040296 15.5171 37.991039 +2560 854 1 -0.8476 18.62052 15.5171 40.5171 +2561 854 2 0.4238 19.4370104 15.5171 41.094459 +2562 854 2 0.4238 17.8040296 15.5171 41.094459 +2563 855 1 -0.8476 18.62052 15.5171 43.62052 +2564 855 2 0.4238 19.4370104 15.5171 44.197879 +2565 855 2 0.4238 17.8040296 15.5171 44.197879 +2566 856 1 -0.8476 18.62052 15.5171 46.72394 +2567 856 2 0.4238 19.4370104 15.5171 47.301299 +2568 856 2 0.4238 17.8040296 15.5171 47.301299 +2569 857 1 -0.8476 18.62052 15.5171 49.82736 +2570 857 2 0.4238 19.4370104 15.5171 50.404719 +2571 857 2 0.4238 17.8040296 15.5171 50.404719 +2572 858 1 -0.8476 18.62052 15.5171 52.93078 +2573 858 2 0.4238 19.4370104 15.5171 53.508139 +2574 858 2 0.4238 17.8040296 15.5171 53.508139 +2575 859 1 -0.8476 18.62052 15.5171 56.0342 +2576 859 2 0.4238 19.4370104 15.5171 56.611559 +2577 859 2 0.4238 17.8040296 15.5171 56.611559 +2578 860 1 -0.8476 18.62052 15.5171 59.13762 +2579 860 2 0.4238 19.4370104 15.5171 59.714979 +2580 860 2 0.4238 17.8040296 15.5171 59.714979 +2581 861 1 -0.8476 18.62052 15.5171 62.24104 +2582 861 2 0.4238 19.4370104 15.5171 62.818399 +2583 861 2 0.4238 17.8040296 15.5171 62.818399 +2584 862 1 -0.8476 18.62052 15.5171 65.34446 +2585 862 2 0.4238 19.4370104 15.5171 65.921819 +2586 862 2 0.4238 17.8040296 15.5171 65.921819 +2587 863 1 -0.8476 18.62052 15.5171 68.44788 +2588 863 2 0.4238 19.4370104 15.5171 69.025239 +2589 863 2 0.4238 17.8040296 15.5171 69.025239 +2590 864 1 -0.8476 18.62052 15.5171 71.5513 +2591 864 2 0.4238 19.4370104 15.5171 72.128659 +2592 864 2 0.4238 17.8040296 15.5171 72.128659 +2593 865 1 -0.8476 18.62052 18.62052 25.0 +2594 865 2 0.4238 19.4370104 18.62052 25.577359 +2595 865 2 0.4238 17.8040296 18.62052 25.577359 +2596 866 1 -0.8476 18.62052 18.62052 28.10342 +2597 866 2 0.4238 19.4370104 18.62052 28.680779 +2598 866 2 0.4238 17.8040296 18.62052 28.680779 +2599 867 1 -0.8476 18.62052 18.62052 31.20684 +2600 867 2 0.4238 19.4370104 18.62052 31.784199 +2601 867 2 0.4238 17.8040296 18.62052 31.784199 +2602 868 1 -0.8476 18.62052 18.62052 34.31026 +2603 868 2 0.4238 19.4370104 18.62052 34.887619 +2604 868 2 0.4238 17.8040296 18.62052 34.887619 +2605 869 1 -0.8476 18.62052 18.62052 37.41368 +2606 869 2 0.4238 19.4370104 18.62052 37.991039 +2607 869 2 0.4238 17.8040296 18.62052 37.991039 +2608 870 1 -0.8476 18.62052 18.62052 40.5171 +2609 870 2 0.4238 19.4370104 18.62052 41.094459 +2610 870 2 0.4238 17.8040296 18.62052 41.094459 +2611 871 1 -0.8476 18.62052 18.62052 43.62052 +2612 871 2 0.4238 19.4370104 18.62052 44.197879 +2613 871 2 0.4238 17.8040296 18.62052 44.197879 +2614 872 1 -0.8476 18.62052 18.62052 46.72394 +2615 872 2 0.4238 19.4370104 18.62052 47.301299 +2616 872 2 0.4238 17.8040296 18.62052 47.301299 +2617 873 1 -0.8476 18.62052 18.62052 49.82736 +2618 873 2 0.4238 19.4370104 18.62052 50.404719 +2619 873 2 0.4238 17.8040296 18.62052 50.404719 +2620 874 1 -0.8476 18.62052 18.62052 52.93078 +2621 874 2 0.4238 19.4370104 18.62052 53.508139 +2622 874 2 0.4238 17.8040296 18.62052 53.508139 +2623 875 1 -0.8476 18.62052 18.62052 56.0342 +2624 875 2 0.4238 19.4370104 18.62052 56.611559 +2625 875 2 0.4238 17.8040296 18.62052 56.611559 +2626 876 1 -0.8476 18.62052 18.62052 59.13762 +2627 876 2 0.4238 19.4370104 18.62052 59.714979 +2628 876 2 0.4238 17.8040296 18.62052 59.714979 +2629 877 1 -0.8476 18.62052 18.62052 62.24104 +2630 877 2 0.4238 19.4370104 18.62052 62.818399 +2631 877 2 0.4238 17.8040296 18.62052 62.818399 +2632 878 1 -0.8476 18.62052 18.62052 65.34446 +2633 878 2 0.4238 19.4370104 18.62052 65.921819 +2634 878 2 0.4238 17.8040296 18.62052 65.921819 +2635 879 1 -0.8476 18.62052 18.62052 68.44788 +2636 879 2 0.4238 19.4370104 18.62052 69.025239 +2637 879 2 0.4238 17.8040296 18.62052 69.025239 +2638 880 1 -0.8476 18.62052 18.62052 71.5513 +2639 880 2 0.4238 19.4370104 18.62052 72.128659 +2640 880 2 0.4238 17.8040296 18.62052 72.128659 +2641 881 1 -0.8476 18.62052 21.72394 25.0 +2642 881 2 0.4238 19.4370104 21.72394 25.577359 +2643 881 2 0.4238 17.8040296 21.72394 25.577359 +2644 882 1 -0.8476 18.62052 21.72394 28.10342 +2645 882 2 0.4238 19.4370104 21.72394 28.680779 +2646 882 2 0.4238 17.8040296 21.72394 28.680779 +2647 883 1 -0.8476 18.62052 21.72394 31.20684 +2648 883 2 0.4238 19.4370104 21.72394 31.784199 +2649 883 2 0.4238 17.8040296 21.72394 31.784199 +2650 884 1 -0.8476 18.62052 21.72394 34.31026 +2651 884 2 0.4238 19.4370104 21.72394 34.887619 +2652 884 2 0.4238 17.8040296 21.72394 34.887619 +2653 885 1 -0.8476 18.62052 21.72394 37.41368 +2654 885 2 0.4238 19.4370104 21.72394 37.991039 +2655 885 2 0.4238 17.8040296 21.72394 37.991039 +2656 886 1 -0.8476 18.62052 21.72394 40.5171 +2657 886 2 0.4238 19.4370104 21.72394 41.094459 +2658 886 2 0.4238 17.8040296 21.72394 41.094459 +2659 887 1 -0.8476 18.62052 21.72394 43.62052 +2660 887 2 0.4238 19.4370104 21.72394 44.197879 +2661 887 2 0.4238 17.8040296 21.72394 44.197879 +2662 888 1 -0.8476 18.62052 21.72394 46.72394 +2663 888 2 0.4238 19.4370104 21.72394 47.301299 +2664 888 2 0.4238 17.8040296 21.72394 47.301299 +2665 889 1 -0.8476 18.62052 21.72394 49.82736 +2666 889 2 0.4238 19.4370104 21.72394 50.404719 +2667 889 2 0.4238 17.8040296 21.72394 50.404719 +2668 890 1 -0.8476 18.62052 21.72394 52.93078 +2669 890 2 0.4238 19.4370104 21.72394 53.508139 +2670 890 2 0.4238 17.8040296 21.72394 53.508139 +2671 891 1 -0.8476 18.62052 21.72394 56.0342 +2672 891 2 0.4238 19.4370104 21.72394 56.611559 +2673 891 2 0.4238 17.8040296 21.72394 56.611559 +2674 892 1 -0.8476 18.62052 21.72394 59.13762 +2675 892 2 0.4238 19.4370104 21.72394 59.714979 +2676 892 2 0.4238 17.8040296 21.72394 59.714979 +2677 893 1 -0.8476 18.62052 21.72394 62.24104 +2678 893 2 0.4238 19.4370104 21.72394 62.818399 +2679 893 2 0.4238 17.8040296 21.72394 62.818399 +2680 894 1 -0.8476 18.62052 21.72394 65.34446 +2681 894 2 0.4238 19.4370104 21.72394 65.921819 +2682 894 2 0.4238 17.8040296 21.72394 65.921819 +2683 895 1 -0.8476 18.62052 21.72394 68.44788 +2684 895 2 0.4238 19.4370104 21.72394 69.025239 +2685 895 2 0.4238 17.8040296 21.72394 69.025239 +2686 896 1 -0.8476 18.62052 21.72394 71.5513 +2687 896 2 0.4238 19.4370104 21.72394 72.128659 +2688 896 2 0.4238 17.8040296 21.72394 72.128659 +2689 897 1 -0.8476 21.72394 0.0 25.0 +2690 897 2 0.4238 22.540430399999998 0.0 25.577359 +2691 897 2 0.4238 20.9074496 0.0 25.577359 +2692 898 1 -0.8476 21.72394 0.0 28.10342 +2693 898 2 0.4238 22.540430399999998 0.0 28.680779 +2694 898 2 0.4238 20.9074496 0.0 28.680779 +2695 899 1 -0.8476 21.72394 0.0 31.20684 +2696 899 2 0.4238 22.540430399999998 0.0 31.784199 +2697 899 2 0.4238 20.9074496 0.0 31.784199 +2698 900 1 -0.8476 21.72394 0.0 34.31026 +2699 900 2 0.4238 22.540430399999998 0.0 34.887619 +2700 900 2 0.4238 20.9074496 0.0 34.887619 +2701 901 1 -0.8476 21.72394 0.0 37.41368 +2702 901 2 0.4238 22.540430399999998 0.0 37.991039 +2703 901 2 0.4238 20.9074496 0.0 37.991039 +2704 902 1 -0.8476 21.72394 0.0 40.5171 +2705 902 2 0.4238 22.540430399999998 0.0 41.094459 +2706 902 2 0.4238 20.9074496 0.0 41.094459 +2707 903 1 -0.8476 21.72394 0.0 43.62052 +2708 903 2 0.4238 22.540430399999998 0.0 44.197879 +2709 903 2 0.4238 20.9074496 0.0 44.197879 +2710 904 1 -0.8476 21.72394 0.0 46.72394 +2711 904 2 0.4238 22.540430399999998 0.0 47.301299 +2712 904 2 0.4238 20.9074496 0.0 47.301299 +2713 905 1 -0.8476 21.72394 0.0 49.82736 +2714 905 2 0.4238 22.540430399999998 0.0 50.404719 +2715 905 2 0.4238 20.9074496 0.0 50.404719 +2716 906 1 -0.8476 21.72394 0.0 52.93078 +2717 906 2 0.4238 22.540430399999998 0.0 53.508139 +2718 906 2 0.4238 20.9074496 0.0 53.508139 +2719 907 1 -0.8476 21.72394 0.0 56.0342 +2720 907 2 0.4238 22.540430399999998 0.0 56.611559 +2721 907 2 0.4238 20.9074496 0.0 56.611559 +2722 908 1 -0.8476 21.72394 0.0 59.13762 +2723 908 2 0.4238 22.540430399999998 0.0 59.714979 +2724 908 2 0.4238 20.9074496 0.0 59.714979 +2725 909 1 -0.8476 21.72394 0.0 62.24104 +2726 909 2 0.4238 22.540430399999998 0.0 62.818399 +2727 909 2 0.4238 20.9074496 0.0 62.818399 +2728 910 1 -0.8476 21.72394 0.0 65.34446 +2729 910 2 0.4238 22.540430399999998 0.0 65.921819 +2730 910 2 0.4238 20.9074496 0.0 65.921819 +2731 911 1 -0.8476 21.72394 0.0 68.44788 +2732 911 2 0.4238 22.540430399999998 0.0 69.025239 +2733 911 2 0.4238 20.9074496 0.0 69.025239 +2734 912 1 -0.8476 21.72394 0.0 71.5513 +2735 912 2 0.4238 22.540430399999998 0.0 72.128659 +2736 912 2 0.4238 20.9074496 0.0 72.128659 +2737 913 1 -0.8476 21.72394 3.10342 25.0 +2738 913 2 0.4238 22.540430399999998 3.10342 25.577359 +2739 913 2 0.4238 20.9074496 3.10342 25.577359 +2740 914 1 -0.8476 21.72394 3.10342 28.10342 +2741 914 2 0.4238 22.540430399999998 3.10342 28.680779 +2742 914 2 0.4238 20.9074496 3.10342 28.680779 +2743 915 1 -0.8476 21.72394 3.10342 31.20684 +2744 915 2 0.4238 22.540430399999998 3.10342 31.784199 +2745 915 2 0.4238 20.9074496 3.10342 31.784199 +2746 916 1 -0.8476 21.72394 3.10342 34.31026 +2747 916 2 0.4238 22.540430399999998 3.10342 34.887619 +2748 916 2 0.4238 20.9074496 3.10342 34.887619 +2749 917 1 -0.8476 21.72394 3.10342 37.41368 +2750 917 2 0.4238 22.540430399999998 3.10342 37.991039 +2751 917 2 0.4238 20.9074496 3.10342 37.991039 +2752 918 1 -0.8476 21.72394 3.10342 40.5171 +2753 918 2 0.4238 22.540430399999998 3.10342 41.094459 +2754 918 2 0.4238 20.9074496 3.10342 41.094459 +2755 919 1 -0.8476 21.72394 3.10342 43.62052 +2756 919 2 0.4238 22.540430399999998 3.10342 44.197879 +2757 919 2 0.4238 20.9074496 3.10342 44.197879 +2758 920 1 -0.8476 21.72394 3.10342 46.72394 +2759 920 2 0.4238 22.540430399999998 3.10342 47.301299 +2760 920 2 0.4238 20.9074496 3.10342 47.301299 +2761 921 1 -0.8476 21.72394 3.10342 49.82736 +2762 921 2 0.4238 22.540430399999998 3.10342 50.404719 +2763 921 2 0.4238 20.9074496 3.10342 50.404719 +2764 922 1 -0.8476 21.72394 3.10342 52.93078 +2765 922 2 0.4238 22.540430399999998 3.10342 53.508139 +2766 922 2 0.4238 20.9074496 3.10342 53.508139 +2767 923 1 -0.8476 21.72394 3.10342 56.0342 +2768 923 2 0.4238 22.540430399999998 3.10342 56.611559 +2769 923 2 0.4238 20.9074496 3.10342 56.611559 +2770 924 1 -0.8476 21.72394 3.10342 59.13762 +2771 924 2 0.4238 22.540430399999998 3.10342 59.714979 +2772 924 2 0.4238 20.9074496 3.10342 59.714979 +2773 925 1 -0.8476 21.72394 3.10342 62.24104 +2774 925 2 0.4238 22.540430399999998 3.10342 62.818399 +2775 925 2 0.4238 20.9074496 3.10342 62.818399 +2776 926 1 -0.8476 21.72394 3.10342 65.34446 +2777 926 2 0.4238 22.540430399999998 3.10342 65.921819 +2778 926 2 0.4238 20.9074496 3.10342 65.921819 +2779 927 1 -0.8476 21.72394 3.10342 68.44788 +2780 927 2 0.4238 22.540430399999998 3.10342 69.025239 +2781 927 2 0.4238 20.9074496 3.10342 69.025239 +2782 928 1 -0.8476 21.72394 3.10342 71.5513 +2783 928 2 0.4238 22.540430399999998 3.10342 72.128659 +2784 928 2 0.4238 20.9074496 3.10342 72.128659 +2785 929 1 -0.8476 21.72394 6.20684 25.0 +2786 929 2 0.4238 22.540430399999998 6.20684 25.577359 +2787 929 2 0.4238 20.9074496 6.20684 25.577359 +2788 930 1 -0.8476 21.72394 6.20684 28.10342 +2789 930 2 0.4238 22.540430399999998 6.20684 28.680779 +2790 930 2 0.4238 20.9074496 6.20684 28.680779 +2791 931 1 -0.8476 21.72394 6.20684 31.20684 +2792 931 2 0.4238 22.540430399999998 6.20684 31.784199 +2793 931 2 0.4238 20.9074496 6.20684 31.784199 +2794 932 1 -0.8476 21.72394 6.20684 34.31026 +2795 932 2 0.4238 22.540430399999998 6.20684 34.887619 +2796 932 2 0.4238 20.9074496 6.20684 34.887619 +2797 933 1 -0.8476 21.72394 6.20684 37.41368 +2798 933 2 0.4238 22.540430399999998 6.20684 37.991039 +2799 933 2 0.4238 20.9074496 6.20684 37.991039 +2800 934 1 -0.8476 21.72394 6.20684 40.5171 +2801 934 2 0.4238 22.540430399999998 6.20684 41.094459 +2802 934 2 0.4238 20.9074496 6.20684 41.094459 +2803 935 1 -0.8476 21.72394 6.20684 43.62052 +2804 935 2 0.4238 22.540430399999998 6.20684 44.197879 +2805 935 2 0.4238 20.9074496 6.20684 44.197879 +2806 936 1 -0.8476 21.72394 6.20684 46.72394 +2807 936 2 0.4238 22.540430399999998 6.20684 47.301299 +2808 936 2 0.4238 20.9074496 6.20684 47.301299 +2809 937 1 -0.8476 21.72394 6.20684 49.82736 +2810 937 2 0.4238 22.540430399999998 6.20684 50.404719 +2811 937 2 0.4238 20.9074496 6.20684 50.404719 +2812 938 1 -0.8476 21.72394 6.20684 52.93078 +2813 938 2 0.4238 22.540430399999998 6.20684 53.508139 +2814 938 2 0.4238 20.9074496 6.20684 53.508139 +2815 939 1 -0.8476 21.72394 6.20684 56.0342 +2816 939 2 0.4238 22.540430399999998 6.20684 56.611559 +2817 939 2 0.4238 20.9074496 6.20684 56.611559 +2818 940 1 -0.8476 21.72394 6.20684 59.13762 +2819 940 2 0.4238 22.540430399999998 6.20684 59.714979 +2820 940 2 0.4238 20.9074496 6.20684 59.714979 +2821 941 1 -0.8476 21.72394 6.20684 62.24104 +2822 941 2 0.4238 22.540430399999998 6.20684 62.818399 +2823 941 2 0.4238 20.9074496 6.20684 62.818399 +2824 942 1 -0.8476 21.72394 6.20684 65.34446 +2825 942 2 0.4238 22.540430399999998 6.20684 65.921819 +2826 942 2 0.4238 20.9074496 6.20684 65.921819 +2827 943 1 -0.8476 21.72394 6.20684 68.44788 +2828 943 2 0.4238 22.540430399999998 6.20684 69.025239 +2829 943 2 0.4238 20.9074496 6.20684 69.025239 +2830 944 1 -0.8476 21.72394 6.20684 71.5513 +2831 944 2 0.4238 22.540430399999998 6.20684 72.128659 +2832 944 2 0.4238 20.9074496 6.20684 72.128659 +2833 945 1 -0.8476 21.72394 9.31026 25.0 +2834 945 2 0.4238 22.540430399999998 9.31026 25.577359 +2835 945 2 0.4238 20.9074496 9.31026 25.577359 +2836 946 1 -0.8476 21.72394 9.31026 28.10342 +2837 946 2 0.4238 22.540430399999998 9.31026 28.680779 +2838 946 2 0.4238 20.9074496 9.31026 28.680779 +2839 947 1 -0.8476 21.72394 9.31026 31.20684 +2840 947 2 0.4238 22.540430399999998 9.31026 31.784199 +2841 947 2 0.4238 20.9074496 9.31026 31.784199 +2842 948 1 -0.8476 21.72394 9.31026 34.31026 +2843 948 2 0.4238 22.540430399999998 9.31026 34.887619 +2844 948 2 0.4238 20.9074496 9.31026 34.887619 +2845 949 1 -0.8476 21.72394 9.31026 37.41368 +2846 949 2 0.4238 22.540430399999998 9.31026 37.991039 +2847 949 2 0.4238 20.9074496 9.31026 37.991039 +2848 950 1 -0.8476 21.72394 9.31026 40.5171 +2849 950 2 0.4238 22.540430399999998 9.31026 41.094459 +2850 950 2 0.4238 20.9074496 9.31026 41.094459 +2851 951 1 -0.8476 21.72394 9.31026 43.62052 +2852 951 2 0.4238 22.540430399999998 9.31026 44.197879 +2853 951 2 0.4238 20.9074496 9.31026 44.197879 +2854 952 1 -0.8476 21.72394 9.31026 46.72394 +2855 952 2 0.4238 22.540430399999998 9.31026 47.301299 +2856 952 2 0.4238 20.9074496 9.31026 47.301299 +2857 953 1 -0.8476 21.72394 9.31026 49.82736 +2858 953 2 0.4238 22.540430399999998 9.31026 50.404719 +2859 953 2 0.4238 20.9074496 9.31026 50.404719 +2860 954 1 -0.8476 21.72394 9.31026 52.93078 +2861 954 2 0.4238 22.540430399999998 9.31026 53.508139 +2862 954 2 0.4238 20.9074496 9.31026 53.508139 +2863 955 1 -0.8476 21.72394 9.31026 56.0342 +2864 955 2 0.4238 22.540430399999998 9.31026 56.611559 +2865 955 2 0.4238 20.9074496 9.31026 56.611559 +2866 956 1 -0.8476 21.72394 9.31026 59.13762 +2867 956 2 0.4238 22.540430399999998 9.31026 59.714979 +2868 956 2 0.4238 20.9074496 9.31026 59.714979 +2869 957 1 -0.8476 21.72394 9.31026 62.24104 +2870 957 2 0.4238 22.540430399999998 9.31026 62.818399 +2871 957 2 0.4238 20.9074496 9.31026 62.818399 +2872 958 1 -0.8476 21.72394 9.31026 65.34446 +2873 958 2 0.4238 22.540430399999998 9.31026 65.921819 +2874 958 2 0.4238 20.9074496 9.31026 65.921819 +2875 959 1 -0.8476 21.72394 9.31026 68.44788 +2876 959 2 0.4238 22.540430399999998 9.31026 69.025239 +2877 959 2 0.4238 20.9074496 9.31026 69.025239 +2878 960 1 -0.8476 21.72394 9.31026 71.5513 +2879 960 2 0.4238 22.540430399999998 9.31026 72.128659 +2880 960 2 0.4238 20.9074496 9.31026 72.128659 +2881 961 1 -0.8476 21.72394 12.41368 25.0 +2882 961 2 0.4238 22.540430399999998 12.41368 25.577359 +2883 961 2 0.4238 20.9074496 12.41368 25.577359 +2884 962 1 -0.8476 21.72394 12.41368 28.10342 +2885 962 2 0.4238 22.540430399999998 12.41368 28.680779 +2886 962 2 0.4238 20.9074496 12.41368 28.680779 +2887 963 1 -0.8476 21.72394 12.41368 31.20684 +2888 963 2 0.4238 22.540430399999998 12.41368 31.784199 +2889 963 2 0.4238 20.9074496 12.41368 31.784199 +2890 964 1 -0.8476 21.72394 12.41368 34.31026 +2891 964 2 0.4238 22.540430399999998 12.41368 34.887619 +2892 964 2 0.4238 20.9074496 12.41368 34.887619 +2893 965 1 -0.8476 21.72394 12.41368 37.41368 +2894 965 2 0.4238 22.540430399999998 12.41368 37.991039 +2895 965 2 0.4238 20.9074496 12.41368 37.991039 +2896 966 1 -0.8476 21.72394 12.41368 40.5171 +2897 966 2 0.4238 22.540430399999998 12.41368 41.094459 +2898 966 2 0.4238 20.9074496 12.41368 41.094459 +2899 967 1 -0.8476 21.72394 12.41368 43.62052 +2900 967 2 0.4238 22.540430399999998 12.41368 44.197879 +2901 967 2 0.4238 20.9074496 12.41368 44.197879 +2902 968 1 -0.8476 21.72394 12.41368 46.72394 +2903 968 2 0.4238 22.540430399999998 12.41368 47.301299 +2904 968 2 0.4238 20.9074496 12.41368 47.301299 +2905 969 1 -0.8476 21.72394 12.41368 49.82736 +2906 969 2 0.4238 22.540430399999998 12.41368 50.404719 +2907 969 2 0.4238 20.9074496 12.41368 50.404719 +2908 970 1 -0.8476 21.72394 12.41368 52.93078 +2909 970 2 0.4238 22.540430399999998 12.41368 53.508139 +2910 970 2 0.4238 20.9074496 12.41368 53.508139 +2911 971 1 -0.8476 21.72394 12.41368 56.0342 +2912 971 2 0.4238 22.540430399999998 12.41368 56.611559 +2913 971 2 0.4238 20.9074496 12.41368 56.611559 +2914 972 1 -0.8476 21.72394 12.41368 59.13762 +2915 972 2 0.4238 22.540430399999998 12.41368 59.714979 +2916 972 2 0.4238 20.9074496 12.41368 59.714979 +2917 973 1 -0.8476 21.72394 12.41368 62.24104 +2918 973 2 0.4238 22.540430399999998 12.41368 62.818399 +2919 973 2 0.4238 20.9074496 12.41368 62.818399 +2920 974 1 -0.8476 21.72394 12.41368 65.34446 +2921 974 2 0.4238 22.540430399999998 12.41368 65.921819 +2922 974 2 0.4238 20.9074496 12.41368 65.921819 +2923 975 1 -0.8476 21.72394 12.41368 68.44788 +2924 975 2 0.4238 22.540430399999998 12.41368 69.025239 +2925 975 2 0.4238 20.9074496 12.41368 69.025239 +2926 976 1 -0.8476 21.72394 12.41368 71.5513 +2927 976 2 0.4238 22.540430399999998 12.41368 72.128659 +2928 976 2 0.4238 20.9074496 12.41368 72.128659 +2929 977 1 -0.8476 21.72394 15.5171 25.0 +2930 977 2 0.4238 22.540430399999998 15.5171 25.577359 +2931 977 2 0.4238 20.9074496 15.5171 25.577359 +2932 978 1 -0.8476 21.72394 15.5171 28.10342 +2933 978 2 0.4238 22.540430399999998 15.5171 28.680779 +2934 978 2 0.4238 20.9074496 15.5171 28.680779 +2935 979 1 -0.8476 21.72394 15.5171 31.20684 +2936 979 2 0.4238 22.540430399999998 15.5171 31.784199 +2937 979 2 0.4238 20.9074496 15.5171 31.784199 +2938 980 1 -0.8476 21.72394 15.5171 34.31026 +2939 980 2 0.4238 22.540430399999998 15.5171 34.887619 +2940 980 2 0.4238 20.9074496 15.5171 34.887619 +2941 981 1 -0.8476 21.72394 15.5171 37.41368 +2942 981 2 0.4238 22.540430399999998 15.5171 37.991039 +2943 981 2 0.4238 20.9074496 15.5171 37.991039 +2944 982 1 -0.8476 21.72394 15.5171 40.5171 +2945 982 2 0.4238 22.540430399999998 15.5171 41.094459 +2946 982 2 0.4238 20.9074496 15.5171 41.094459 +2947 983 1 -0.8476 21.72394 15.5171 43.62052 +2948 983 2 0.4238 22.540430399999998 15.5171 44.197879 +2949 983 2 0.4238 20.9074496 15.5171 44.197879 +2950 984 1 -0.8476 21.72394 15.5171 46.72394 +2951 984 2 0.4238 22.540430399999998 15.5171 47.301299 +2952 984 2 0.4238 20.9074496 15.5171 47.301299 +2953 985 1 -0.8476 21.72394 15.5171 49.82736 +2954 985 2 0.4238 22.540430399999998 15.5171 50.404719 +2955 985 2 0.4238 20.9074496 15.5171 50.404719 +2956 986 1 -0.8476 21.72394 15.5171 52.93078 +2957 986 2 0.4238 22.540430399999998 15.5171 53.508139 +2958 986 2 0.4238 20.9074496 15.5171 53.508139 +2959 987 1 -0.8476 21.72394 15.5171 56.0342 +2960 987 2 0.4238 22.540430399999998 15.5171 56.611559 +2961 987 2 0.4238 20.9074496 15.5171 56.611559 +2962 988 1 -0.8476 21.72394 15.5171 59.13762 +2963 988 2 0.4238 22.540430399999998 15.5171 59.714979 +2964 988 2 0.4238 20.9074496 15.5171 59.714979 +2965 989 1 -0.8476 21.72394 15.5171 62.24104 +2966 989 2 0.4238 22.540430399999998 15.5171 62.818399 +2967 989 2 0.4238 20.9074496 15.5171 62.818399 +2968 990 1 -0.8476 21.72394 15.5171 65.34446 +2969 990 2 0.4238 22.540430399999998 15.5171 65.921819 +2970 990 2 0.4238 20.9074496 15.5171 65.921819 +2971 991 1 -0.8476 21.72394 15.5171 68.44788 +2972 991 2 0.4238 22.540430399999998 15.5171 69.025239 +2973 991 2 0.4238 20.9074496 15.5171 69.025239 +2974 992 1 -0.8476 21.72394 15.5171 71.5513 +2975 992 2 0.4238 22.540430399999998 15.5171 72.128659 +2976 992 2 0.4238 20.9074496 15.5171 72.128659 +2977 993 1 -0.8476 21.72394 18.62052 25.0 +2978 993 2 0.4238 22.540430399999998 18.62052 25.577359 +2979 993 2 0.4238 20.9074496 18.62052 25.577359 +2980 994 1 -0.8476 21.72394 18.62052 28.10342 +2981 994 2 0.4238 22.540430399999998 18.62052 28.680779 +2982 994 2 0.4238 20.9074496 18.62052 28.680779 +2983 995 1 -0.8476 21.72394 18.62052 31.20684 +2984 995 2 0.4238 22.540430399999998 18.62052 31.784199 +2985 995 2 0.4238 20.9074496 18.62052 31.784199 +2986 996 1 -0.8476 21.72394 18.62052 34.31026 +2987 996 2 0.4238 22.540430399999998 18.62052 34.887619 +2988 996 2 0.4238 20.9074496 18.62052 34.887619 +2989 997 1 -0.8476 21.72394 18.62052 37.41368 +2990 997 2 0.4238 22.540430399999998 18.62052 37.991039 +2991 997 2 0.4238 20.9074496 18.62052 37.991039 +2992 998 1 -0.8476 21.72394 18.62052 40.5171 +2993 998 2 0.4238 22.540430399999998 18.62052 41.094459 +2994 998 2 0.4238 20.9074496 18.62052 41.094459 +2995 999 1 -0.8476 21.72394 18.62052 43.62052 +2996 999 2 0.4238 22.540430399999998 18.62052 44.197879 +2997 999 2 0.4238 20.9074496 18.62052 44.197879 +2998 1000 1 -0.8476 21.72394 18.62052 46.72394 +2999 1000 2 0.4238 22.540430399999998 18.62052 47.301299 +3000 1000 2 0.4238 20.9074496 18.62052 47.301299 +3001 1001 1 -0.8476 21.72394 18.62052 49.82736 +3002 1001 2 0.4238 22.540430399999998 18.62052 50.404719 +3003 1001 2 0.4238 20.9074496 18.62052 50.404719 +3004 1002 1 -0.8476 21.72394 18.62052 52.93078 +3005 1002 2 0.4238 22.540430399999998 18.62052 53.508139 +3006 1002 2 0.4238 20.9074496 18.62052 53.508139 +3007 1003 1 -0.8476 21.72394 18.62052 56.0342 +3008 1003 2 0.4238 22.540430399999998 18.62052 56.611559 +3009 1003 2 0.4238 20.9074496 18.62052 56.611559 +3010 1004 1 -0.8476 21.72394 18.62052 59.13762 +3011 1004 2 0.4238 22.540430399999998 18.62052 59.714979 +3012 1004 2 0.4238 20.9074496 18.62052 59.714979 +3013 1005 1 -0.8476 21.72394 18.62052 62.24104 +3014 1005 2 0.4238 22.540430399999998 18.62052 62.818399 +3015 1005 2 0.4238 20.9074496 18.62052 62.818399 +3016 1006 1 -0.8476 21.72394 18.62052 65.34446 +3017 1006 2 0.4238 22.540430399999998 18.62052 65.921819 +3018 1006 2 0.4238 20.9074496 18.62052 65.921819 +3019 1007 1 -0.8476 21.72394 18.62052 68.44788 +3020 1007 2 0.4238 22.540430399999998 18.62052 69.025239 +3021 1007 2 0.4238 20.9074496 18.62052 69.025239 +3022 1008 1 -0.8476 21.72394 18.62052 71.5513 +3023 1008 2 0.4238 22.540430399999998 18.62052 72.128659 +3024 1008 2 0.4238 20.9074496 18.62052 72.128659 +3025 1009 1 -0.8476 21.72394 21.72394 25.0 +3026 1009 2 0.4238 22.540430399999998 21.72394 25.577359 +3027 1009 2 0.4238 20.9074496 21.72394 25.577359 +3028 1010 1 -0.8476 21.72394 21.72394 28.10342 +3029 1010 2 0.4238 22.540430399999998 21.72394 28.680779 +3030 1010 2 0.4238 20.9074496 21.72394 28.680779 +3031 1011 1 -0.8476 21.72394 21.72394 31.20684 +3032 1011 2 0.4238 22.540430399999998 21.72394 31.784199 +3033 1011 2 0.4238 20.9074496 21.72394 31.784199 +3034 1012 1 -0.8476 21.72394 21.72394 34.31026 +3035 1012 2 0.4238 22.540430399999998 21.72394 34.887619 +3036 1012 2 0.4238 20.9074496 21.72394 34.887619 +3037 1013 1 -0.8476 21.72394 21.72394 37.41368 +3038 1013 2 0.4238 22.540430399999998 21.72394 37.991039 +3039 1013 2 0.4238 20.9074496 21.72394 37.991039 +3040 1014 1 -0.8476 21.72394 21.72394 40.5171 +3041 1014 2 0.4238 22.540430399999998 21.72394 41.094459 +3042 1014 2 0.4238 20.9074496 21.72394 41.094459 +3043 1015 1 -0.8476 21.72394 21.72394 43.62052 +3044 1015 2 0.4238 22.540430399999998 21.72394 44.197879 +3045 1015 2 0.4238 20.9074496 21.72394 44.197879 +3046 1016 1 -0.8476 21.72394 21.72394 46.72394 +3047 1016 2 0.4238 22.540430399999998 21.72394 47.301299 +3048 1016 2 0.4238 20.9074496 21.72394 47.301299 +3049 1017 1 -0.8476 21.72394 21.72394 49.82736 +3050 1017 2 0.4238 22.540430399999998 21.72394 50.404719 +3051 1017 2 0.4238 20.9074496 21.72394 50.404719 +3052 1018 1 -0.8476 21.72394 21.72394 52.93078 +3053 1018 2 0.4238 22.540430399999998 21.72394 53.508139 +3054 1018 2 0.4238 20.9074496 21.72394 53.508139 +3055 1019 1 -0.8476 21.72394 21.72394 56.0342 +3056 1019 2 0.4238 22.540430399999998 21.72394 56.611559 +3057 1019 2 0.4238 20.9074496 21.72394 56.611559 +3058 1020 1 -0.8476 21.72394 21.72394 59.13762 +3059 1020 2 0.4238 22.540430399999998 21.72394 59.714979 +3060 1020 2 0.4238 20.9074496 21.72394 59.714979 +3061 1021 1 -0.8476 21.72394 21.72394 62.24104 +3062 1021 2 0.4238 22.540430399999998 21.72394 62.818399 +3063 1021 2 0.4238 20.9074496 21.72394 62.818399 +3064 1022 1 -0.8476 21.72394 21.72394 65.34446 +3065 1022 2 0.4238 22.540430399999998 21.72394 65.921819 +3066 1022 2 0.4238 20.9074496 21.72394 65.921819 +3067 1023 1 -0.8476 21.72394 21.72394 68.44788 +3068 1023 2 0.4238 22.540430399999998 21.72394 69.025239 +3069 1023 2 0.4238 20.9074496 21.72394 69.025239 +3070 1024 1 -0.8476 21.72394 21.72394 71.5513 +3071 1024 2 0.4238 22.540430399999998 21.72394 72.128659 +3072 1024 2 0.4238 20.9074496 21.72394 72.128659 + +Bonds + +1 1 1 2 +2 1 1 3 +3 1 4 5 +4 1 4 6 +5 1 7 8 +6 1 7 9 +7 1 10 11 +8 1 10 12 +9 1 13 14 +10 1 13 15 +11 1 16 17 +12 1 16 18 +13 1 19 20 +14 1 19 21 +15 1 22 23 +16 1 22 24 +17 1 25 26 +18 1 25 27 +19 1 28 29 +20 1 28 30 +21 1 31 32 +22 1 31 33 +23 1 34 35 +24 1 34 36 +25 1 37 38 +26 1 37 39 +27 1 40 41 +28 1 40 42 +29 1 43 44 +30 1 43 45 +31 1 46 47 +32 1 46 48 +33 1 49 50 +34 1 49 51 +35 1 52 53 +36 1 52 54 +37 1 55 56 +38 1 55 57 +39 1 58 59 +40 1 58 60 +41 1 61 62 +42 1 61 63 +43 1 64 65 +44 1 64 66 +45 1 67 68 +46 1 67 69 +47 1 70 71 +48 1 70 72 +49 1 73 74 +50 1 73 75 +51 1 76 77 +52 1 76 78 +53 1 79 80 +54 1 79 81 +55 1 82 83 +56 1 82 84 +57 1 85 86 +58 1 85 87 +59 1 88 89 +60 1 88 90 +61 1 91 92 +62 1 91 93 +63 1 94 95 +64 1 94 96 +65 1 97 98 +66 1 97 99 +67 1 100 101 +68 1 100 102 +69 1 103 104 +70 1 103 105 +71 1 106 107 +72 1 106 108 +73 1 109 110 +74 1 109 111 +75 1 112 113 +76 1 112 114 +77 1 115 116 +78 1 115 117 +79 1 118 119 +80 1 118 120 +81 1 121 122 +82 1 121 123 +83 1 124 125 +84 1 124 126 +85 1 127 128 +86 1 127 129 +87 1 130 131 +88 1 130 132 +89 1 133 134 +90 1 133 135 +91 1 136 137 +92 1 136 138 +93 1 139 140 +94 1 139 141 +95 1 142 143 +96 1 142 144 +97 1 145 146 +98 1 145 147 +99 1 148 149 +100 1 148 150 +101 1 151 152 +102 1 151 153 +103 1 154 155 +104 1 154 156 +105 1 157 158 +106 1 157 159 +107 1 160 161 +108 1 160 162 +109 1 163 164 +110 1 163 165 +111 1 166 167 +112 1 166 168 +113 1 169 170 +114 1 169 171 +115 1 172 173 +116 1 172 174 +117 1 175 176 +118 1 175 177 +119 1 178 179 +120 1 178 180 +121 1 181 182 +122 1 181 183 +123 1 184 185 +124 1 184 186 +125 1 187 188 +126 1 187 189 +127 1 190 191 +128 1 190 192 +129 1 193 194 +130 1 193 195 +131 1 196 197 +132 1 196 198 +133 1 199 200 +134 1 199 201 +135 1 202 203 +136 1 202 204 +137 1 205 206 +138 1 205 207 +139 1 208 209 +140 1 208 210 +141 1 211 212 +142 1 211 213 +143 1 214 215 +144 1 214 216 +145 1 217 218 +146 1 217 219 +147 1 220 221 +148 1 220 222 +149 1 223 224 +150 1 223 225 +151 1 226 227 +152 1 226 228 +153 1 229 230 +154 1 229 231 +155 1 232 233 +156 1 232 234 +157 1 235 236 +158 1 235 237 +159 1 238 239 +160 1 238 240 +161 1 241 242 +162 1 241 243 +163 1 244 245 +164 1 244 246 +165 1 247 248 +166 1 247 249 +167 1 250 251 +168 1 250 252 +169 1 253 254 +170 1 253 255 +171 1 256 257 +172 1 256 258 +173 1 259 260 +174 1 259 261 +175 1 262 263 +176 1 262 264 +177 1 265 266 +178 1 265 267 +179 1 268 269 +180 1 268 270 +181 1 271 272 +182 1 271 273 +183 1 274 275 +184 1 274 276 +185 1 277 278 +186 1 277 279 +187 1 280 281 +188 1 280 282 +189 1 283 284 +190 1 283 285 +191 1 286 287 +192 1 286 288 +193 1 289 290 +194 1 289 291 +195 1 292 293 +196 1 292 294 +197 1 295 296 +198 1 295 297 +199 1 298 299 +200 1 298 300 +201 1 301 302 +202 1 301 303 +203 1 304 305 +204 1 304 306 +205 1 307 308 +206 1 307 309 +207 1 310 311 +208 1 310 312 +209 1 313 314 +210 1 313 315 +211 1 316 317 +212 1 316 318 +213 1 319 320 +214 1 319 321 +215 1 322 323 +216 1 322 324 +217 1 325 326 +218 1 325 327 +219 1 328 329 +220 1 328 330 +221 1 331 332 +222 1 331 333 +223 1 334 335 +224 1 334 336 +225 1 337 338 +226 1 337 339 +227 1 340 341 +228 1 340 342 +229 1 343 344 +230 1 343 345 +231 1 346 347 +232 1 346 348 +233 1 349 350 +234 1 349 351 +235 1 352 353 +236 1 352 354 +237 1 355 356 +238 1 355 357 +239 1 358 359 +240 1 358 360 +241 1 361 362 +242 1 361 363 +243 1 364 365 +244 1 364 366 +245 1 367 368 +246 1 367 369 +247 1 370 371 +248 1 370 372 +249 1 373 374 +250 1 373 375 +251 1 376 377 +252 1 376 378 +253 1 379 380 +254 1 379 381 +255 1 382 383 +256 1 382 384 +257 1 385 386 +258 1 385 387 +259 1 388 389 +260 1 388 390 +261 1 391 392 +262 1 391 393 +263 1 394 395 +264 1 394 396 +265 1 397 398 +266 1 397 399 +267 1 400 401 +268 1 400 402 +269 1 403 404 +270 1 403 405 +271 1 406 407 +272 1 406 408 +273 1 409 410 +274 1 409 411 +275 1 412 413 +276 1 412 414 +277 1 415 416 +278 1 415 417 +279 1 418 419 +280 1 418 420 +281 1 421 422 +282 1 421 423 +283 1 424 425 +284 1 424 426 +285 1 427 428 +286 1 427 429 +287 1 430 431 +288 1 430 432 +289 1 433 434 +290 1 433 435 +291 1 436 437 +292 1 436 438 +293 1 439 440 +294 1 439 441 +295 1 442 443 +296 1 442 444 +297 1 445 446 +298 1 445 447 +299 1 448 449 +300 1 448 450 +301 1 451 452 +302 1 451 453 +303 1 454 455 +304 1 454 456 +305 1 457 458 +306 1 457 459 +307 1 460 461 +308 1 460 462 +309 1 463 464 +310 1 463 465 +311 1 466 467 +312 1 466 468 +313 1 469 470 +314 1 469 471 +315 1 472 473 +316 1 472 474 +317 1 475 476 +318 1 475 477 +319 1 478 479 +320 1 478 480 +321 1 481 482 +322 1 481 483 +323 1 484 485 +324 1 484 486 +325 1 487 488 +326 1 487 489 +327 1 490 491 +328 1 490 492 +329 1 493 494 +330 1 493 495 +331 1 496 497 +332 1 496 498 +333 1 499 500 +334 1 499 501 +335 1 502 503 +336 1 502 504 +337 1 505 506 +338 1 505 507 +339 1 508 509 +340 1 508 510 +341 1 511 512 +342 1 511 513 +343 1 514 515 +344 1 514 516 +345 1 517 518 +346 1 517 519 +347 1 520 521 +348 1 520 522 +349 1 523 524 +350 1 523 525 +351 1 526 527 +352 1 526 528 +353 1 529 530 +354 1 529 531 +355 1 532 533 +356 1 532 534 +357 1 535 536 +358 1 535 537 +359 1 538 539 +360 1 538 540 +361 1 541 542 +362 1 541 543 +363 1 544 545 +364 1 544 546 +365 1 547 548 +366 1 547 549 +367 1 550 551 +368 1 550 552 +369 1 553 554 +370 1 553 555 +371 1 556 557 +372 1 556 558 +373 1 559 560 +374 1 559 561 +375 1 562 563 +376 1 562 564 +377 1 565 566 +378 1 565 567 +379 1 568 569 +380 1 568 570 +381 1 571 572 +382 1 571 573 +383 1 574 575 +384 1 574 576 +385 1 577 578 +386 1 577 579 +387 1 580 581 +388 1 580 582 +389 1 583 584 +390 1 583 585 +391 1 586 587 +392 1 586 588 +393 1 589 590 +394 1 589 591 +395 1 592 593 +396 1 592 594 +397 1 595 596 +398 1 595 597 +399 1 598 599 +400 1 598 600 +401 1 601 602 +402 1 601 603 +403 1 604 605 +404 1 604 606 +405 1 607 608 +406 1 607 609 +407 1 610 611 +408 1 610 612 +409 1 613 614 +410 1 613 615 +411 1 616 617 +412 1 616 618 +413 1 619 620 +414 1 619 621 +415 1 622 623 +416 1 622 624 +417 1 625 626 +418 1 625 627 +419 1 628 629 +420 1 628 630 +421 1 631 632 +422 1 631 633 +423 1 634 635 +424 1 634 636 +425 1 637 638 +426 1 637 639 +427 1 640 641 +428 1 640 642 +429 1 643 644 +430 1 643 645 +431 1 646 647 +432 1 646 648 +433 1 649 650 +434 1 649 651 +435 1 652 653 +436 1 652 654 +437 1 655 656 +438 1 655 657 +439 1 658 659 +440 1 658 660 +441 1 661 662 +442 1 661 663 +443 1 664 665 +444 1 664 666 +445 1 667 668 +446 1 667 669 +447 1 670 671 +448 1 670 672 +449 1 673 674 +450 1 673 675 +451 1 676 677 +452 1 676 678 +453 1 679 680 +454 1 679 681 +455 1 682 683 +456 1 682 684 +457 1 685 686 +458 1 685 687 +459 1 688 689 +460 1 688 690 +461 1 691 692 +462 1 691 693 +463 1 694 695 +464 1 694 696 +465 1 697 698 +466 1 697 699 +467 1 700 701 +468 1 700 702 +469 1 703 704 +470 1 703 705 +471 1 706 707 +472 1 706 708 +473 1 709 710 +474 1 709 711 +475 1 712 713 +476 1 712 714 +477 1 715 716 +478 1 715 717 +479 1 718 719 +480 1 718 720 +481 1 721 722 +482 1 721 723 +483 1 724 725 +484 1 724 726 +485 1 727 728 +486 1 727 729 +487 1 730 731 +488 1 730 732 +489 1 733 734 +490 1 733 735 +491 1 736 737 +492 1 736 738 +493 1 739 740 +494 1 739 741 +495 1 742 743 +496 1 742 744 +497 1 745 746 +498 1 745 747 +499 1 748 749 +500 1 748 750 +501 1 751 752 +502 1 751 753 +503 1 754 755 +504 1 754 756 +505 1 757 758 +506 1 757 759 +507 1 760 761 +508 1 760 762 +509 1 763 764 +510 1 763 765 +511 1 766 767 +512 1 766 768 +513 1 769 770 +514 1 769 771 +515 1 772 773 +516 1 772 774 +517 1 775 776 +518 1 775 777 +519 1 778 779 +520 1 778 780 +521 1 781 782 +522 1 781 783 +523 1 784 785 +524 1 784 786 +525 1 787 788 +526 1 787 789 +527 1 790 791 +528 1 790 792 +529 1 793 794 +530 1 793 795 +531 1 796 797 +532 1 796 798 +533 1 799 800 +534 1 799 801 +535 1 802 803 +536 1 802 804 +537 1 805 806 +538 1 805 807 +539 1 808 809 +540 1 808 810 +541 1 811 812 +542 1 811 813 +543 1 814 815 +544 1 814 816 +545 1 817 818 +546 1 817 819 +547 1 820 821 +548 1 820 822 +549 1 823 824 +550 1 823 825 +551 1 826 827 +552 1 826 828 +553 1 829 830 +554 1 829 831 +555 1 832 833 +556 1 832 834 +557 1 835 836 +558 1 835 837 +559 1 838 839 +560 1 838 840 +561 1 841 842 +562 1 841 843 +563 1 844 845 +564 1 844 846 +565 1 847 848 +566 1 847 849 +567 1 850 851 +568 1 850 852 +569 1 853 854 +570 1 853 855 +571 1 856 857 +572 1 856 858 +573 1 859 860 +574 1 859 861 +575 1 862 863 +576 1 862 864 +577 1 865 866 +578 1 865 867 +579 1 868 869 +580 1 868 870 +581 1 871 872 +582 1 871 873 +583 1 874 875 +584 1 874 876 +585 1 877 878 +586 1 877 879 +587 1 880 881 +588 1 880 882 +589 1 883 884 +590 1 883 885 +591 1 886 887 +592 1 886 888 +593 1 889 890 +594 1 889 891 +595 1 892 893 +596 1 892 894 +597 1 895 896 +598 1 895 897 +599 1 898 899 +600 1 898 900 +601 1 901 902 +602 1 901 903 +603 1 904 905 +604 1 904 906 +605 1 907 908 +606 1 907 909 +607 1 910 911 +608 1 910 912 +609 1 913 914 +610 1 913 915 +611 1 916 917 +612 1 916 918 +613 1 919 920 +614 1 919 921 +615 1 922 923 +616 1 922 924 +617 1 925 926 +618 1 925 927 +619 1 928 929 +620 1 928 930 +621 1 931 932 +622 1 931 933 +623 1 934 935 +624 1 934 936 +625 1 937 938 +626 1 937 939 +627 1 940 941 +628 1 940 942 +629 1 943 944 +630 1 943 945 +631 1 946 947 +632 1 946 948 +633 1 949 950 +634 1 949 951 +635 1 952 953 +636 1 952 954 +637 1 955 956 +638 1 955 957 +639 1 958 959 +640 1 958 960 +641 1 961 962 +642 1 961 963 +643 1 964 965 +644 1 964 966 +645 1 967 968 +646 1 967 969 +647 1 970 971 +648 1 970 972 +649 1 973 974 +650 1 973 975 +651 1 976 977 +652 1 976 978 +653 1 979 980 +654 1 979 981 +655 1 982 983 +656 1 982 984 +657 1 985 986 +658 1 985 987 +659 1 988 989 +660 1 988 990 +661 1 991 992 +662 1 991 993 +663 1 994 995 +664 1 994 996 +665 1 997 998 +666 1 997 999 +667 1 1000 1001 +668 1 1000 1002 +669 1 1003 1004 +670 1 1003 1005 +671 1 1006 1007 +672 1 1006 1008 +673 1 1009 1010 +674 1 1009 1011 +675 1 1012 1013 +676 1 1012 1014 +677 1 1015 1016 +678 1 1015 1017 +679 1 1018 1019 +680 1 1018 1020 +681 1 1021 1022 +682 1 1021 1023 +683 1 1024 1025 +684 1 1024 1026 +685 1 1027 1028 +686 1 1027 1029 +687 1 1030 1031 +688 1 1030 1032 +689 1 1033 1034 +690 1 1033 1035 +691 1 1036 1037 +692 1 1036 1038 +693 1 1039 1040 +694 1 1039 1041 +695 1 1042 1043 +696 1 1042 1044 +697 1 1045 1046 +698 1 1045 1047 +699 1 1048 1049 +700 1 1048 1050 +701 1 1051 1052 +702 1 1051 1053 +703 1 1054 1055 +704 1 1054 1056 +705 1 1057 1058 +706 1 1057 1059 +707 1 1060 1061 +708 1 1060 1062 +709 1 1063 1064 +710 1 1063 1065 +711 1 1066 1067 +712 1 1066 1068 +713 1 1069 1070 +714 1 1069 1071 +715 1 1072 1073 +716 1 1072 1074 +717 1 1075 1076 +718 1 1075 1077 +719 1 1078 1079 +720 1 1078 1080 +721 1 1081 1082 +722 1 1081 1083 +723 1 1084 1085 +724 1 1084 1086 +725 1 1087 1088 +726 1 1087 1089 +727 1 1090 1091 +728 1 1090 1092 +729 1 1093 1094 +730 1 1093 1095 +731 1 1096 1097 +732 1 1096 1098 +733 1 1099 1100 +734 1 1099 1101 +735 1 1102 1103 +736 1 1102 1104 +737 1 1105 1106 +738 1 1105 1107 +739 1 1108 1109 +740 1 1108 1110 +741 1 1111 1112 +742 1 1111 1113 +743 1 1114 1115 +744 1 1114 1116 +745 1 1117 1118 +746 1 1117 1119 +747 1 1120 1121 +748 1 1120 1122 +749 1 1123 1124 +750 1 1123 1125 +751 1 1126 1127 +752 1 1126 1128 +753 1 1129 1130 +754 1 1129 1131 +755 1 1132 1133 +756 1 1132 1134 +757 1 1135 1136 +758 1 1135 1137 +759 1 1138 1139 +760 1 1138 1140 +761 1 1141 1142 +762 1 1141 1143 +763 1 1144 1145 +764 1 1144 1146 +765 1 1147 1148 +766 1 1147 1149 +767 1 1150 1151 +768 1 1150 1152 +769 1 1153 1154 +770 1 1153 1155 +771 1 1156 1157 +772 1 1156 1158 +773 1 1159 1160 +774 1 1159 1161 +775 1 1162 1163 +776 1 1162 1164 +777 1 1165 1166 +778 1 1165 1167 +779 1 1168 1169 +780 1 1168 1170 +781 1 1171 1172 +782 1 1171 1173 +783 1 1174 1175 +784 1 1174 1176 +785 1 1177 1178 +786 1 1177 1179 +787 1 1180 1181 +788 1 1180 1182 +789 1 1183 1184 +790 1 1183 1185 +791 1 1186 1187 +792 1 1186 1188 +793 1 1189 1190 +794 1 1189 1191 +795 1 1192 1193 +796 1 1192 1194 +797 1 1195 1196 +798 1 1195 1197 +799 1 1198 1199 +800 1 1198 1200 +801 1 1201 1202 +802 1 1201 1203 +803 1 1204 1205 +804 1 1204 1206 +805 1 1207 1208 +806 1 1207 1209 +807 1 1210 1211 +808 1 1210 1212 +809 1 1213 1214 +810 1 1213 1215 +811 1 1216 1217 +812 1 1216 1218 +813 1 1219 1220 +814 1 1219 1221 +815 1 1222 1223 +816 1 1222 1224 +817 1 1225 1226 +818 1 1225 1227 +819 1 1228 1229 +820 1 1228 1230 +821 1 1231 1232 +822 1 1231 1233 +823 1 1234 1235 +824 1 1234 1236 +825 1 1237 1238 +826 1 1237 1239 +827 1 1240 1241 +828 1 1240 1242 +829 1 1243 1244 +830 1 1243 1245 +831 1 1246 1247 +832 1 1246 1248 +833 1 1249 1250 +834 1 1249 1251 +835 1 1252 1253 +836 1 1252 1254 +837 1 1255 1256 +838 1 1255 1257 +839 1 1258 1259 +840 1 1258 1260 +841 1 1261 1262 +842 1 1261 1263 +843 1 1264 1265 +844 1 1264 1266 +845 1 1267 1268 +846 1 1267 1269 +847 1 1270 1271 +848 1 1270 1272 +849 1 1273 1274 +850 1 1273 1275 +851 1 1276 1277 +852 1 1276 1278 +853 1 1279 1280 +854 1 1279 1281 +855 1 1282 1283 +856 1 1282 1284 +857 1 1285 1286 +858 1 1285 1287 +859 1 1288 1289 +860 1 1288 1290 +861 1 1291 1292 +862 1 1291 1293 +863 1 1294 1295 +864 1 1294 1296 +865 1 1297 1298 +866 1 1297 1299 +867 1 1300 1301 +868 1 1300 1302 +869 1 1303 1304 +870 1 1303 1305 +871 1 1306 1307 +872 1 1306 1308 +873 1 1309 1310 +874 1 1309 1311 +875 1 1312 1313 +876 1 1312 1314 +877 1 1315 1316 +878 1 1315 1317 +879 1 1318 1319 +880 1 1318 1320 +881 1 1321 1322 +882 1 1321 1323 +883 1 1324 1325 +884 1 1324 1326 +885 1 1327 1328 +886 1 1327 1329 +887 1 1330 1331 +888 1 1330 1332 +889 1 1333 1334 +890 1 1333 1335 +891 1 1336 1337 +892 1 1336 1338 +893 1 1339 1340 +894 1 1339 1341 +895 1 1342 1343 +896 1 1342 1344 +897 1 1345 1346 +898 1 1345 1347 +899 1 1348 1349 +900 1 1348 1350 +901 1 1351 1352 +902 1 1351 1353 +903 1 1354 1355 +904 1 1354 1356 +905 1 1357 1358 +906 1 1357 1359 +907 1 1360 1361 +908 1 1360 1362 +909 1 1363 1364 +910 1 1363 1365 +911 1 1366 1367 +912 1 1366 1368 +913 1 1369 1370 +914 1 1369 1371 +915 1 1372 1373 +916 1 1372 1374 +917 1 1375 1376 +918 1 1375 1377 +919 1 1378 1379 +920 1 1378 1380 +921 1 1381 1382 +922 1 1381 1383 +923 1 1384 1385 +924 1 1384 1386 +925 1 1387 1388 +926 1 1387 1389 +927 1 1390 1391 +928 1 1390 1392 +929 1 1393 1394 +930 1 1393 1395 +931 1 1396 1397 +932 1 1396 1398 +933 1 1399 1400 +934 1 1399 1401 +935 1 1402 1403 +936 1 1402 1404 +937 1 1405 1406 +938 1 1405 1407 +939 1 1408 1409 +940 1 1408 1410 +941 1 1411 1412 +942 1 1411 1413 +943 1 1414 1415 +944 1 1414 1416 +945 1 1417 1418 +946 1 1417 1419 +947 1 1420 1421 +948 1 1420 1422 +949 1 1423 1424 +950 1 1423 1425 +951 1 1426 1427 +952 1 1426 1428 +953 1 1429 1430 +954 1 1429 1431 +955 1 1432 1433 +956 1 1432 1434 +957 1 1435 1436 +958 1 1435 1437 +959 1 1438 1439 +960 1 1438 1440 +961 1 1441 1442 +962 1 1441 1443 +963 1 1444 1445 +964 1 1444 1446 +965 1 1447 1448 +966 1 1447 1449 +967 1 1450 1451 +968 1 1450 1452 +969 1 1453 1454 +970 1 1453 1455 +971 1 1456 1457 +972 1 1456 1458 +973 1 1459 1460 +974 1 1459 1461 +975 1 1462 1463 +976 1 1462 1464 +977 1 1465 1466 +978 1 1465 1467 +979 1 1468 1469 +980 1 1468 1470 +981 1 1471 1472 +982 1 1471 1473 +983 1 1474 1475 +984 1 1474 1476 +985 1 1477 1478 +986 1 1477 1479 +987 1 1480 1481 +988 1 1480 1482 +989 1 1483 1484 +990 1 1483 1485 +991 1 1486 1487 +992 1 1486 1488 +993 1 1489 1490 +994 1 1489 1491 +995 1 1492 1493 +996 1 1492 1494 +997 1 1495 1496 +998 1 1495 1497 +999 1 1498 1499 +1000 1 1498 1500 +1001 1 1501 1502 +1002 1 1501 1503 +1003 1 1504 1505 +1004 1 1504 1506 +1005 1 1507 1508 +1006 1 1507 1509 +1007 1 1510 1511 +1008 1 1510 1512 +1009 1 1513 1514 +1010 1 1513 1515 +1011 1 1516 1517 +1012 1 1516 1518 +1013 1 1519 1520 +1014 1 1519 1521 +1015 1 1522 1523 +1016 1 1522 1524 +1017 1 1525 1526 +1018 1 1525 1527 +1019 1 1528 1529 +1020 1 1528 1530 +1021 1 1531 1532 +1022 1 1531 1533 +1023 1 1534 1535 +1024 1 1534 1536 +1025 1 1537 1538 +1026 1 1537 1539 +1027 1 1540 1541 +1028 1 1540 1542 +1029 1 1543 1544 +1030 1 1543 1545 +1031 1 1546 1547 +1032 1 1546 1548 +1033 1 1549 1550 +1034 1 1549 1551 +1035 1 1552 1553 +1036 1 1552 1554 +1037 1 1555 1556 +1038 1 1555 1557 +1039 1 1558 1559 +1040 1 1558 1560 +1041 1 1561 1562 +1042 1 1561 1563 +1043 1 1564 1565 +1044 1 1564 1566 +1045 1 1567 1568 +1046 1 1567 1569 +1047 1 1570 1571 +1048 1 1570 1572 +1049 1 1573 1574 +1050 1 1573 1575 +1051 1 1576 1577 +1052 1 1576 1578 +1053 1 1579 1580 +1054 1 1579 1581 +1055 1 1582 1583 +1056 1 1582 1584 +1057 1 1585 1586 +1058 1 1585 1587 +1059 1 1588 1589 +1060 1 1588 1590 +1061 1 1591 1592 +1062 1 1591 1593 +1063 1 1594 1595 +1064 1 1594 1596 +1065 1 1597 1598 +1066 1 1597 1599 +1067 1 1600 1601 +1068 1 1600 1602 +1069 1 1603 1604 +1070 1 1603 1605 +1071 1 1606 1607 +1072 1 1606 1608 +1073 1 1609 1610 +1074 1 1609 1611 +1075 1 1612 1613 +1076 1 1612 1614 +1077 1 1615 1616 +1078 1 1615 1617 +1079 1 1618 1619 +1080 1 1618 1620 +1081 1 1621 1622 +1082 1 1621 1623 +1083 1 1624 1625 +1084 1 1624 1626 +1085 1 1627 1628 +1086 1 1627 1629 +1087 1 1630 1631 +1088 1 1630 1632 +1089 1 1633 1634 +1090 1 1633 1635 +1091 1 1636 1637 +1092 1 1636 1638 +1093 1 1639 1640 +1094 1 1639 1641 +1095 1 1642 1643 +1096 1 1642 1644 +1097 1 1645 1646 +1098 1 1645 1647 +1099 1 1648 1649 +1100 1 1648 1650 +1101 1 1651 1652 +1102 1 1651 1653 +1103 1 1654 1655 +1104 1 1654 1656 +1105 1 1657 1658 +1106 1 1657 1659 +1107 1 1660 1661 +1108 1 1660 1662 +1109 1 1663 1664 +1110 1 1663 1665 +1111 1 1666 1667 +1112 1 1666 1668 +1113 1 1669 1670 +1114 1 1669 1671 +1115 1 1672 1673 +1116 1 1672 1674 +1117 1 1675 1676 +1118 1 1675 1677 +1119 1 1678 1679 +1120 1 1678 1680 +1121 1 1681 1682 +1122 1 1681 1683 +1123 1 1684 1685 +1124 1 1684 1686 +1125 1 1687 1688 +1126 1 1687 1689 +1127 1 1690 1691 +1128 1 1690 1692 +1129 1 1693 1694 +1130 1 1693 1695 +1131 1 1696 1697 +1132 1 1696 1698 +1133 1 1699 1700 +1134 1 1699 1701 +1135 1 1702 1703 +1136 1 1702 1704 +1137 1 1705 1706 +1138 1 1705 1707 +1139 1 1708 1709 +1140 1 1708 1710 +1141 1 1711 1712 +1142 1 1711 1713 +1143 1 1714 1715 +1144 1 1714 1716 +1145 1 1717 1718 +1146 1 1717 1719 +1147 1 1720 1721 +1148 1 1720 1722 +1149 1 1723 1724 +1150 1 1723 1725 +1151 1 1726 1727 +1152 1 1726 1728 +1153 1 1729 1730 +1154 1 1729 1731 +1155 1 1732 1733 +1156 1 1732 1734 +1157 1 1735 1736 +1158 1 1735 1737 +1159 1 1738 1739 +1160 1 1738 1740 +1161 1 1741 1742 +1162 1 1741 1743 +1163 1 1744 1745 +1164 1 1744 1746 +1165 1 1747 1748 +1166 1 1747 1749 +1167 1 1750 1751 +1168 1 1750 1752 +1169 1 1753 1754 +1170 1 1753 1755 +1171 1 1756 1757 +1172 1 1756 1758 +1173 1 1759 1760 +1174 1 1759 1761 +1175 1 1762 1763 +1176 1 1762 1764 +1177 1 1765 1766 +1178 1 1765 1767 +1179 1 1768 1769 +1180 1 1768 1770 +1181 1 1771 1772 +1182 1 1771 1773 +1183 1 1774 1775 +1184 1 1774 1776 +1185 1 1777 1778 +1186 1 1777 1779 +1187 1 1780 1781 +1188 1 1780 1782 +1189 1 1783 1784 +1190 1 1783 1785 +1191 1 1786 1787 +1192 1 1786 1788 +1193 1 1789 1790 +1194 1 1789 1791 +1195 1 1792 1793 +1196 1 1792 1794 +1197 1 1795 1796 +1198 1 1795 1797 +1199 1 1798 1799 +1200 1 1798 1800 +1201 1 1801 1802 +1202 1 1801 1803 +1203 1 1804 1805 +1204 1 1804 1806 +1205 1 1807 1808 +1206 1 1807 1809 +1207 1 1810 1811 +1208 1 1810 1812 +1209 1 1813 1814 +1210 1 1813 1815 +1211 1 1816 1817 +1212 1 1816 1818 +1213 1 1819 1820 +1214 1 1819 1821 +1215 1 1822 1823 +1216 1 1822 1824 +1217 1 1825 1826 +1218 1 1825 1827 +1219 1 1828 1829 +1220 1 1828 1830 +1221 1 1831 1832 +1222 1 1831 1833 +1223 1 1834 1835 +1224 1 1834 1836 +1225 1 1837 1838 +1226 1 1837 1839 +1227 1 1840 1841 +1228 1 1840 1842 +1229 1 1843 1844 +1230 1 1843 1845 +1231 1 1846 1847 +1232 1 1846 1848 +1233 1 1849 1850 +1234 1 1849 1851 +1235 1 1852 1853 +1236 1 1852 1854 +1237 1 1855 1856 +1238 1 1855 1857 +1239 1 1858 1859 +1240 1 1858 1860 +1241 1 1861 1862 +1242 1 1861 1863 +1243 1 1864 1865 +1244 1 1864 1866 +1245 1 1867 1868 +1246 1 1867 1869 +1247 1 1870 1871 +1248 1 1870 1872 +1249 1 1873 1874 +1250 1 1873 1875 +1251 1 1876 1877 +1252 1 1876 1878 +1253 1 1879 1880 +1254 1 1879 1881 +1255 1 1882 1883 +1256 1 1882 1884 +1257 1 1885 1886 +1258 1 1885 1887 +1259 1 1888 1889 +1260 1 1888 1890 +1261 1 1891 1892 +1262 1 1891 1893 +1263 1 1894 1895 +1264 1 1894 1896 +1265 1 1897 1898 +1266 1 1897 1899 +1267 1 1900 1901 +1268 1 1900 1902 +1269 1 1903 1904 +1270 1 1903 1905 +1271 1 1906 1907 +1272 1 1906 1908 +1273 1 1909 1910 +1274 1 1909 1911 +1275 1 1912 1913 +1276 1 1912 1914 +1277 1 1915 1916 +1278 1 1915 1917 +1279 1 1918 1919 +1280 1 1918 1920 +1281 1 1921 1922 +1282 1 1921 1923 +1283 1 1924 1925 +1284 1 1924 1926 +1285 1 1927 1928 +1286 1 1927 1929 +1287 1 1930 1931 +1288 1 1930 1932 +1289 1 1933 1934 +1290 1 1933 1935 +1291 1 1936 1937 +1292 1 1936 1938 +1293 1 1939 1940 +1294 1 1939 1941 +1295 1 1942 1943 +1296 1 1942 1944 +1297 1 1945 1946 +1298 1 1945 1947 +1299 1 1948 1949 +1300 1 1948 1950 +1301 1 1951 1952 +1302 1 1951 1953 +1303 1 1954 1955 +1304 1 1954 1956 +1305 1 1957 1958 +1306 1 1957 1959 +1307 1 1960 1961 +1308 1 1960 1962 +1309 1 1963 1964 +1310 1 1963 1965 +1311 1 1966 1967 +1312 1 1966 1968 +1313 1 1969 1970 +1314 1 1969 1971 +1315 1 1972 1973 +1316 1 1972 1974 +1317 1 1975 1976 +1318 1 1975 1977 +1319 1 1978 1979 +1320 1 1978 1980 +1321 1 1981 1982 +1322 1 1981 1983 +1323 1 1984 1985 +1324 1 1984 1986 +1325 1 1987 1988 +1326 1 1987 1989 +1327 1 1990 1991 +1328 1 1990 1992 +1329 1 1993 1994 +1330 1 1993 1995 +1331 1 1996 1997 +1332 1 1996 1998 +1333 1 1999 2000 +1334 1 1999 2001 +1335 1 2002 2003 +1336 1 2002 2004 +1337 1 2005 2006 +1338 1 2005 2007 +1339 1 2008 2009 +1340 1 2008 2010 +1341 1 2011 2012 +1342 1 2011 2013 +1343 1 2014 2015 +1344 1 2014 2016 +1345 1 2017 2018 +1346 1 2017 2019 +1347 1 2020 2021 +1348 1 2020 2022 +1349 1 2023 2024 +1350 1 2023 2025 +1351 1 2026 2027 +1352 1 2026 2028 +1353 1 2029 2030 +1354 1 2029 2031 +1355 1 2032 2033 +1356 1 2032 2034 +1357 1 2035 2036 +1358 1 2035 2037 +1359 1 2038 2039 +1360 1 2038 2040 +1361 1 2041 2042 +1362 1 2041 2043 +1363 1 2044 2045 +1364 1 2044 2046 +1365 1 2047 2048 +1366 1 2047 2049 +1367 1 2050 2051 +1368 1 2050 2052 +1369 1 2053 2054 +1370 1 2053 2055 +1371 1 2056 2057 +1372 1 2056 2058 +1373 1 2059 2060 +1374 1 2059 2061 +1375 1 2062 2063 +1376 1 2062 2064 +1377 1 2065 2066 +1378 1 2065 2067 +1379 1 2068 2069 +1380 1 2068 2070 +1381 1 2071 2072 +1382 1 2071 2073 +1383 1 2074 2075 +1384 1 2074 2076 +1385 1 2077 2078 +1386 1 2077 2079 +1387 1 2080 2081 +1388 1 2080 2082 +1389 1 2083 2084 +1390 1 2083 2085 +1391 1 2086 2087 +1392 1 2086 2088 +1393 1 2089 2090 +1394 1 2089 2091 +1395 1 2092 2093 +1396 1 2092 2094 +1397 1 2095 2096 +1398 1 2095 2097 +1399 1 2098 2099 +1400 1 2098 2100 +1401 1 2101 2102 +1402 1 2101 2103 +1403 1 2104 2105 +1404 1 2104 2106 +1405 1 2107 2108 +1406 1 2107 2109 +1407 1 2110 2111 +1408 1 2110 2112 +1409 1 2113 2114 +1410 1 2113 2115 +1411 1 2116 2117 +1412 1 2116 2118 +1413 1 2119 2120 +1414 1 2119 2121 +1415 1 2122 2123 +1416 1 2122 2124 +1417 1 2125 2126 +1418 1 2125 2127 +1419 1 2128 2129 +1420 1 2128 2130 +1421 1 2131 2132 +1422 1 2131 2133 +1423 1 2134 2135 +1424 1 2134 2136 +1425 1 2137 2138 +1426 1 2137 2139 +1427 1 2140 2141 +1428 1 2140 2142 +1429 1 2143 2144 +1430 1 2143 2145 +1431 1 2146 2147 +1432 1 2146 2148 +1433 1 2149 2150 +1434 1 2149 2151 +1435 1 2152 2153 +1436 1 2152 2154 +1437 1 2155 2156 +1438 1 2155 2157 +1439 1 2158 2159 +1440 1 2158 2160 +1441 1 2161 2162 +1442 1 2161 2163 +1443 1 2164 2165 +1444 1 2164 2166 +1445 1 2167 2168 +1446 1 2167 2169 +1447 1 2170 2171 +1448 1 2170 2172 +1449 1 2173 2174 +1450 1 2173 2175 +1451 1 2176 2177 +1452 1 2176 2178 +1453 1 2179 2180 +1454 1 2179 2181 +1455 1 2182 2183 +1456 1 2182 2184 +1457 1 2185 2186 +1458 1 2185 2187 +1459 1 2188 2189 +1460 1 2188 2190 +1461 1 2191 2192 +1462 1 2191 2193 +1463 1 2194 2195 +1464 1 2194 2196 +1465 1 2197 2198 +1466 1 2197 2199 +1467 1 2200 2201 +1468 1 2200 2202 +1469 1 2203 2204 +1470 1 2203 2205 +1471 1 2206 2207 +1472 1 2206 2208 +1473 1 2209 2210 +1474 1 2209 2211 +1475 1 2212 2213 +1476 1 2212 2214 +1477 1 2215 2216 +1478 1 2215 2217 +1479 1 2218 2219 +1480 1 2218 2220 +1481 1 2221 2222 +1482 1 2221 2223 +1483 1 2224 2225 +1484 1 2224 2226 +1485 1 2227 2228 +1486 1 2227 2229 +1487 1 2230 2231 +1488 1 2230 2232 +1489 1 2233 2234 +1490 1 2233 2235 +1491 1 2236 2237 +1492 1 2236 2238 +1493 1 2239 2240 +1494 1 2239 2241 +1495 1 2242 2243 +1496 1 2242 2244 +1497 1 2245 2246 +1498 1 2245 2247 +1499 1 2248 2249 +1500 1 2248 2250 +1501 1 2251 2252 +1502 1 2251 2253 +1503 1 2254 2255 +1504 1 2254 2256 +1505 1 2257 2258 +1506 1 2257 2259 +1507 1 2260 2261 +1508 1 2260 2262 +1509 1 2263 2264 +1510 1 2263 2265 +1511 1 2266 2267 +1512 1 2266 2268 +1513 1 2269 2270 +1514 1 2269 2271 +1515 1 2272 2273 +1516 1 2272 2274 +1517 1 2275 2276 +1518 1 2275 2277 +1519 1 2278 2279 +1520 1 2278 2280 +1521 1 2281 2282 +1522 1 2281 2283 +1523 1 2284 2285 +1524 1 2284 2286 +1525 1 2287 2288 +1526 1 2287 2289 +1527 1 2290 2291 +1528 1 2290 2292 +1529 1 2293 2294 +1530 1 2293 2295 +1531 1 2296 2297 +1532 1 2296 2298 +1533 1 2299 2300 +1534 1 2299 2301 +1535 1 2302 2303 +1536 1 2302 2304 +1537 1 2305 2306 +1538 1 2305 2307 +1539 1 2308 2309 +1540 1 2308 2310 +1541 1 2311 2312 +1542 1 2311 2313 +1543 1 2314 2315 +1544 1 2314 2316 +1545 1 2317 2318 +1546 1 2317 2319 +1547 1 2320 2321 +1548 1 2320 2322 +1549 1 2323 2324 +1550 1 2323 2325 +1551 1 2326 2327 +1552 1 2326 2328 +1553 1 2329 2330 +1554 1 2329 2331 +1555 1 2332 2333 +1556 1 2332 2334 +1557 1 2335 2336 +1558 1 2335 2337 +1559 1 2338 2339 +1560 1 2338 2340 +1561 1 2341 2342 +1562 1 2341 2343 +1563 1 2344 2345 +1564 1 2344 2346 +1565 1 2347 2348 +1566 1 2347 2349 +1567 1 2350 2351 +1568 1 2350 2352 +1569 1 2353 2354 +1570 1 2353 2355 +1571 1 2356 2357 +1572 1 2356 2358 +1573 1 2359 2360 +1574 1 2359 2361 +1575 1 2362 2363 +1576 1 2362 2364 +1577 1 2365 2366 +1578 1 2365 2367 +1579 1 2368 2369 +1580 1 2368 2370 +1581 1 2371 2372 +1582 1 2371 2373 +1583 1 2374 2375 +1584 1 2374 2376 +1585 1 2377 2378 +1586 1 2377 2379 +1587 1 2380 2381 +1588 1 2380 2382 +1589 1 2383 2384 +1590 1 2383 2385 +1591 1 2386 2387 +1592 1 2386 2388 +1593 1 2389 2390 +1594 1 2389 2391 +1595 1 2392 2393 +1596 1 2392 2394 +1597 1 2395 2396 +1598 1 2395 2397 +1599 1 2398 2399 +1600 1 2398 2400 +1601 1 2401 2402 +1602 1 2401 2403 +1603 1 2404 2405 +1604 1 2404 2406 +1605 1 2407 2408 +1606 1 2407 2409 +1607 1 2410 2411 +1608 1 2410 2412 +1609 1 2413 2414 +1610 1 2413 2415 +1611 1 2416 2417 +1612 1 2416 2418 +1613 1 2419 2420 +1614 1 2419 2421 +1615 1 2422 2423 +1616 1 2422 2424 +1617 1 2425 2426 +1618 1 2425 2427 +1619 1 2428 2429 +1620 1 2428 2430 +1621 1 2431 2432 +1622 1 2431 2433 +1623 1 2434 2435 +1624 1 2434 2436 +1625 1 2437 2438 +1626 1 2437 2439 +1627 1 2440 2441 +1628 1 2440 2442 +1629 1 2443 2444 +1630 1 2443 2445 +1631 1 2446 2447 +1632 1 2446 2448 +1633 1 2449 2450 +1634 1 2449 2451 +1635 1 2452 2453 +1636 1 2452 2454 +1637 1 2455 2456 +1638 1 2455 2457 +1639 1 2458 2459 +1640 1 2458 2460 +1641 1 2461 2462 +1642 1 2461 2463 +1643 1 2464 2465 +1644 1 2464 2466 +1645 1 2467 2468 +1646 1 2467 2469 +1647 1 2470 2471 +1648 1 2470 2472 +1649 1 2473 2474 +1650 1 2473 2475 +1651 1 2476 2477 +1652 1 2476 2478 +1653 1 2479 2480 +1654 1 2479 2481 +1655 1 2482 2483 +1656 1 2482 2484 +1657 1 2485 2486 +1658 1 2485 2487 +1659 1 2488 2489 +1660 1 2488 2490 +1661 1 2491 2492 +1662 1 2491 2493 +1663 1 2494 2495 +1664 1 2494 2496 +1665 1 2497 2498 +1666 1 2497 2499 +1667 1 2500 2501 +1668 1 2500 2502 +1669 1 2503 2504 +1670 1 2503 2505 +1671 1 2506 2507 +1672 1 2506 2508 +1673 1 2509 2510 +1674 1 2509 2511 +1675 1 2512 2513 +1676 1 2512 2514 +1677 1 2515 2516 +1678 1 2515 2517 +1679 1 2518 2519 +1680 1 2518 2520 +1681 1 2521 2522 +1682 1 2521 2523 +1683 1 2524 2525 +1684 1 2524 2526 +1685 1 2527 2528 +1686 1 2527 2529 +1687 1 2530 2531 +1688 1 2530 2532 +1689 1 2533 2534 +1690 1 2533 2535 +1691 1 2536 2537 +1692 1 2536 2538 +1693 1 2539 2540 +1694 1 2539 2541 +1695 1 2542 2543 +1696 1 2542 2544 +1697 1 2545 2546 +1698 1 2545 2547 +1699 1 2548 2549 +1700 1 2548 2550 +1701 1 2551 2552 +1702 1 2551 2553 +1703 1 2554 2555 +1704 1 2554 2556 +1705 1 2557 2558 +1706 1 2557 2559 +1707 1 2560 2561 +1708 1 2560 2562 +1709 1 2563 2564 +1710 1 2563 2565 +1711 1 2566 2567 +1712 1 2566 2568 +1713 1 2569 2570 +1714 1 2569 2571 +1715 1 2572 2573 +1716 1 2572 2574 +1717 1 2575 2576 +1718 1 2575 2577 +1719 1 2578 2579 +1720 1 2578 2580 +1721 1 2581 2582 +1722 1 2581 2583 +1723 1 2584 2585 +1724 1 2584 2586 +1725 1 2587 2588 +1726 1 2587 2589 +1727 1 2590 2591 +1728 1 2590 2592 +1729 1 2593 2594 +1730 1 2593 2595 +1731 1 2596 2597 +1732 1 2596 2598 +1733 1 2599 2600 +1734 1 2599 2601 +1735 1 2602 2603 +1736 1 2602 2604 +1737 1 2605 2606 +1738 1 2605 2607 +1739 1 2608 2609 +1740 1 2608 2610 +1741 1 2611 2612 +1742 1 2611 2613 +1743 1 2614 2615 +1744 1 2614 2616 +1745 1 2617 2618 +1746 1 2617 2619 +1747 1 2620 2621 +1748 1 2620 2622 +1749 1 2623 2624 +1750 1 2623 2625 +1751 1 2626 2627 +1752 1 2626 2628 +1753 1 2629 2630 +1754 1 2629 2631 +1755 1 2632 2633 +1756 1 2632 2634 +1757 1 2635 2636 +1758 1 2635 2637 +1759 1 2638 2639 +1760 1 2638 2640 +1761 1 2641 2642 +1762 1 2641 2643 +1763 1 2644 2645 +1764 1 2644 2646 +1765 1 2647 2648 +1766 1 2647 2649 +1767 1 2650 2651 +1768 1 2650 2652 +1769 1 2653 2654 +1770 1 2653 2655 +1771 1 2656 2657 +1772 1 2656 2658 +1773 1 2659 2660 +1774 1 2659 2661 +1775 1 2662 2663 +1776 1 2662 2664 +1777 1 2665 2666 +1778 1 2665 2667 +1779 1 2668 2669 +1780 1 2668 2670 +1781 1 2671 2672 +1782 1 2671 2673 +1783 1 2674 2675 +1784 1 2674 2676 +1785 1 2677 2678 +1786 1 2677 2679 +1787 1 2680 2681 +1788 1 2680 2682 +1789 1 2683 2684 +1790 1 2683 2685 +1791 1 2686 2687 +1792 1 2686 2688 +1793 1 2689 2690 +1794 1 2689 2691 +1795 1 2692 2693 +1796 1 2692 2694 +1797 1 2695 2696 +1798 1 2695 2697 +1799 1 2698 2699 +1800 1 2698 2700 +1801 1 2701 2702 +1802 1 2701 2703 +1803 1 2704 2705 +1804 1 2704 2706 +1805 1 2707 2708 +1806 1 2707 2709 +1807 1 2710 2711 +1808 1 2710 2712 +1809 1 2713 2714 +1810 1 2713 2715 +1811 1 2716 2717 +1812 1 2716 2718 +1813 1 2719 2720 +1814 1 2719 2721 +1815 1 2722 2723 +1816 1 2722 2724 +1817 1 2725 2726 +1818 1 2725 2727 +1819 1 2728 2729 +1820 1 2728 2730 +1821 1 2731 2732 +1822 1 2731 2733 +1823 1 2734 2735 +1824 1 2734 2736 +1825 1 2737 2738 +1826 1 2737 2739 +1827 1 2740 2741 +1828 1 2740 2742 +1829 1 2743 2744 +1830 1 2743 2745 +1831 1 2746 2747 +1832 1 2746 2748 +1833 1 2749 2750 +1834 1 2749 2751 +1835 1 2752 2753 +1836 1 2752 2754 +1837 1 2755 2756 +1838 1 2755 2757 +1839 1 2758 2759 +1840 1 2758 2760 +1841 1 2761 2762 +1842 1 2761 2763 +1843 1 2764 2765 +1844 1 2764 2766 +1845 1 2767 2768 +1846 1 2767 2769 +1847 1 2770 2771 +1848 1 2770 2772 +1849 1 2773 2774 +1850 1 2773 2775 +1851 1 2776 2777 +1852 1 2776 2778 +1853 1 2779 2780 +1854 1 2779 2781 +1855 1 2782 2783 +1856 1 2782 2784 +1857 1 2785 2786 +1858 1 2785 2787 +1859 1 2788 2789 +1860 1 2788 2790 +1861 1 2791 2792 +1862 1 2791 2793 +1863 1 2794 2795 +1864 1 2794 2796 +1865 1 2797 2798 +1866 1 2797 2799 +1867 1 2800 2801 +1868 1 2800 2802 +1869 1 2803 2804 +1870 1 2803 2805 +1871 1 2806 2807 +1872 1 2806 2808 +1873 1 2809 2810 +1874 1 2809 2811 +1875 1 2812 2813 +1876 1 2812 2814 +1877 1 2815 2816 +1878 1 2815 2817 +1879 1 2818 2819 +1880 1 2818 2820 +1881 1 2821 2822 +1882 1 2821 2823 +1883 1 2824 2825 +1884 1 2824 2826 +1885 1 2827 2828 +1886 1 2827 2829 +1887 1 2830 2831 +1888 1 2830 2832 +1889 1 2833 2834 +1890 1 2833 2835 +1891 1 2836 2837 +1892 1 2836 2838 +1893 1 2839 2840 +1894 1 2839 2841 +1895 1 2842 2843 +1896 1 2842 2844 +1897 1 2845 2846 +1898 1 2845 2847 +1899 1 2848 2849 +1900 1 2848 2850 +1901 1 2851 2852 +1902 1 2851 2853 +1903 1 2854 2855 +1904 1 2854 2856 +1905 1 2857 2858 +1906 1 2857 2859 +1907 1 2860 2861 +1908 1 2860 2862 +1909 1 2863 2864 +1910 1 2863 2865 +1911 1 2866 2867 +1912 1 2866 2868 +1913 1 2869 2870 +1914 1 2869 2871 +1915 1 2872 2873 +1916 1 2872 2874 +1917 1 2875 2876 +1918 1 2875 2877 +1919 1 2878 2879 +1920 1 2878 2880 +1921 1 2881 2882 +1922 1 2881 2883 +1923 1 2884 2885 +1924 1 2884 2886 +1925 1 2887 2888 +1926 1 2887 2889 +1927 1 2890 2891 +1928 1 2890 2892 +1929 1 2893 2894 +1930 1 2893 2895 +1931 1 2896 2897 +1932 1 2896 2898 +1933 1 2899 2900 +1934 1 2899 2901 +1935 1 2902 2903 +1936 1 2902 2904 +1937 1 2905 2906 +1938 1 2905 2907 +1939 1 2908 2909 +1940 1 2908 2910 +1941 1 2911 2912 +1942 1 2911 2913 +1943 1 2914 2915 +1944 1 2914 2916 +1945 1 2917 2918 +1946 1 2917 2919 +1947 1 2920 2921 +1948 1 2920 2922 +1949 1 2923 2924 +1950 1 2923 2925 +1951 1 2926 2927 +1952 1 2926 2928 +1953 1 2929 2930 +1954 1 2929 2931 +1955 1 2932 2933 +1956 1 2932 2934 +1957 1 2935 2936 +1958 1 2935 2937 +1959 1 2938 2939 +1960 1 2938 2940 +1961 1 2941 2942 +1962 1 2941 2943 +1963 1 2944 2945 +1964 1 2944 2946 +1965 1 2947 2948 +1966 1 2947 2949 +1967 1 2950 2951 +1968 1 2950 2952 +1969 1 2953 2954 +1970 1 2953 2955 +1971 1 2956 2957 +1972 1 2956 2958 +1973 1 2959 2960 +1974 1 2959 2961 +1975 1 2962 2963 +1976 1 2962 2964 +1977 1 2965 2966 +1978 1 2965 2967 +1979 1 2968 2969 +1980 1 2968 2970 +1981 1 2971 2972 +1982 1 2971 2973 +1983 1 2974 2975 +1984 1 2974 2976 +1985 1 2977 2978 +1986 1 2977 2979 +1987 1 2980 2981 +1988 1 2980 2982 +1989 1 2983 2984 +1990 1 2983 2985 +1991 1 2986 2987 +1992 1 2986 2988 +1993 1 2989 2990 +1994 1 2989 2991 +1995 1 2992 2993 +1996 1 2992 2994 +1997 1 2995 2996 +1998 1 2995 2997 +1999 1 2998 2999 +2000 1 2998 3000 +2001 1 3001 3002 +2002 1 3001 3003 +2003 1 3004 3005 +2004 1 3004 3006 +2005 1 3007 3008 +2006 1 3007 3009 +2007 1 3010 3011 +2008 1 3010 3012 +2009 1 3013 3014 +2010 1 3013 3015 +2011 1 3016 3017 +2012 1 3016 3018 +2013 1 3019 3020 +2014 1 3019 3021 +2015 1 3022 3023 +2016 1 3022 3024 +2017 1 3025 3026 +2018 1 3025 3027 +2019 1 3028 3029 +2020 1 3028 3030 +2021 1 3031 3032 +2022 1 3031 3033 +2023 1 3034 3035 +2024 1 3034 3036 +2025 1 3037 3038 +2026 1 3037 3039 +2027 1 3040 3041 +2028 1 3040 3042 +2029 1 3043 3044 +2030 1 3043 3045 +2031 1 3046 3047 +2032 1 3046 3048 +2033 1 3049 3050 +2034 1 3049 3051 +2035 1 3052 3053 +2036 1 3052 3054 +2037 1 3055 3056 +2038 1 3055 3057 +2039 1 3058 3059 +2040 1 3058 3060 +2041 1 3061 3062 +2042 1 3061 3063 +2043 1 3064 3065 +2044 1 3064 3066 +2045 1 3067 3068 +2046 1 3067 3069 +2047 1 3070 3071 +2048 1 3070 3072 + +Angles + +1 1 2 1 3 +2 1 5 4 6 +3 1 8 7 9 +4 1 11 10 12 +5 1 14 13 15 +6 1 17 16 18 +7 1 20 19 21 +8 1 23 22 24 +9 1 26 25 27 +10 1 29 28 30 +11 1 32 31 33 +12 1 35 34 36 +13 1 38 37 39 +14 1 41 40 42 +15 1 44 43 45 +16 1 47 46 48 +17 1 50 49 51 +18 1 53 52 54 +19 1 56 55 57 +20 1 59 58 60 +21 1 62 61 63 +22 1 65 64 66 +23 1 68 67 69 +24 1 71 70 72 +25 1 74 73 75 +26 1 77 76 78 +27 1 80 79 81 +28 1 83 82 84 +29 1 86 85 87 +30 1 89 88 90 +31 1 92 91 93 +32 1 95 94 96 +33 1 98 97 99 +34 1 101 100 102 +35 1 104 103 105 +36 1 107 106 108 +37 1 110 109 111 +38 1 113 112 114 +39 1 116 115 117 +40 1 119 118 120 +41 1 122 121 123 +42 1 125 124 126 +43 1 128 127 129 +44 1 131 130 132 +45 1 134 133 135 +46 1 137 136 138 +47 1 140 139 141 +48 1 143 142 144 +49 1 146 145 147 +50 1 149 148 150 +51 1 152 151 153 +52 1 155 154 156 +53 1 158 157 159 +54 1 161 160 162 +55 1 164 163 165 +56 1 167 166 168 +57 1 170 169 171 +58 1 173 172 174 +59 1 176 175 177 +60 1 179 178 180 +61 1 182 181 183 +62 1 185 184 186 +63 1 188 187 189 +64 1 191 190 192 +65 1 194 193 195 +66 1 197 196 198 +67 1 200 199 201 +68 1 203 202 204 +69 1 206 205 207 +70 1 209 208 210 +71 1 212 211 213 +72 1 215 214 216 +73 1 218 217 219 +74 1 221 220 222 +75 1 224 223 225 +76 1 227 226 228 +77 1 230 229 231 +78 1 233 232 234 +79 1 236 235 237 +80 1 239 238 240 +81 1 242 241 243 +82 1 245 244 246 +83 1 248 247 249 +84 1 251 250 252 +85 1 254 253 255 +86 1 257 256 258 +87 1 260 259 261 +88 1 263 262 264 +89 1 266 265 267 +90 1 269 268 270 +91 1 272 271 273 +92 1 275 274 276 +93 1 278 277 279 +94 1 281 280 282 +95 1 284 283 285 +96 1 287 286 288 +97 1 290 289 291 +98 1 293 292 294 +99 1 296 295 297 +100 1 299 298 300 +101 1 302 301 303 +102 1 305 304 306 +103 1 308 307 309 +104 1 311 310 312 +105 1 314 313 315 +106 1 317 316 318 +107 1 320 319 321 +108 1 323 322 324 +109 1 326 325 327 +110 1 329 328 330 +111 1 332 331 333 +112 1 335 334 336 +113 1 338 337 339 +114 1 341 340 342 +115 1 344 343 345 +116 1 347 346 348 +117 1 350 349 351 +118 1 353 352 354 +119 1 356 355 357 +120 1 359 358 360 +121 1 362 361 363 +122 1 365 364 366 +123 1 368 367 369 +124 1 371 370 372 +125 1 374 373 375 +126 1 377 376 378 +127 1 380 379 381 +128 1 383 382 384 +129 1 386 385 387 +130 1 389 388 390 +131 1 392 391 393 +132 1 395 394 396 +133 1 398 397 399 +134 1 401 400 402 +135 1 404 403 405 +136 1 407 406 408 +137 1 410 409 411 +138 1 413 412 414 +139 1 416 415 417 +140 1 419 418 420 +141 1 422 421 423 +142 1 425 424 426 +143 1 428 427 429 +144 1 431 430 432 +145 1 434 433 435 +146 1 437 436 438 +147 1 440 439 441 +148 1 443 442 444 +149 1 446 445 447 +150 1 449 448 450 +151 1 452 451 453 +152 1 455 454 456 +153 1 458 457 459 +154 1 461 460 462 +155 1 464 463 465 +156 1 467 466 468 +157 1 470 469 471 +158 1 473 472 474 +159 1 476 475 477 +160 1 479 478 480 +161 1 482 481 483 +162 1 485 484 486 +163 1 488 487 489 +164 1 491 490 492 +165 1 494 493 495 +166 1 497 496 498 +167 1 500 499 501 +168 1 503 502 504 +169 1 506 505 507 +170 1 509 508 510 +171 1 512 511 513 +172 1 515 514 516 +173 1 518 517 519 +174 1 521 520 522 +175 1 524 523 525 +176 1 527 526 528 +177 1 530 529 531 +178 1 533 532 534 +179 1 536 535 537 +180 1 539 538 540 +181 1 542 541 543 +182 1 545 544 546 +183 1 548 547 549 +184 1 551 550 552 +185 1 554 553 555 +186 1 557 556 558 +187 1 560 559 561 +188 1 563 562 564 +189 1 566 565 567 +190 1 569 568 570 +191 1 572 571 573 +192 1 575 574 576 +193 1 578 577 579 +194 1 581 580 582 +195 1 584 583 585 +196 1 587 586 588 +197 1 590 589 591 +198 1 593 592 594 +199 1 596 595 597 +200 1 599 598 600 +201 1 602 601 603 +202 1 605 604 606 +203 1 608 607 609 +204 1 611 610 612 +205 1 614 613 615 +206 1 617 616 618 +207 1 620 619 621 +208 1 623 622 624 +209 1 626 625 627 +210 1 629 628 630 +211 1 632 631 633 +212 1 635 634 636 +213 1 638 637 639 +214 1 641 640 642 +215 1 644 643 645 +216 1 647 646 648 +217 1 650 649 651 +218 1 653 652 654 +219 1 656 655 657 +220 1 659 658 660 +221 1 662 661 663 +222 1 665 664 666 +223 1 668 667 669 +224 1 671 670 672 +225 1 674 673 675 +226 1 677 676 678 +227 1 680 679 681 +228 1 683 682 684 +229 1 686 685 687 +230 1 689 688 690 +231 1 692 691 693 +232 1 695 694 696 +233 1 698 697 699 +234 1 701 700 702 +235 1 704 703 705 +236 1 707 706 708 +237 1 710 709 711 +238 1 713 712 714 +239 1 716 715 717 +240 1 719 718 720 +241 1 722 721 723 +242 1 725 724 726 +243 1 728 727 729 +244 1 731 730 732 +245 1 734 733 735 +246 1 737 736 738 +247 1 740 739 741 +248 1 743 742 744 +249 1 746 745 747 +250 1 749 748 750 +251 1 752 751 753 +252 1 755 754 756 +253 1 758 757 759 +254 1 761 760 762 +255 1 764 763 765 +256 1 767 766 768 +257 1 770 769 771 +258 1 773 772 774 +259 1 776 775 777 +260 1 779 778 780 +261 1 782 781 783 +262 1 785 784 786 +263 1 788 787 789 +264 1 791 790 792 +265 1 794 793 795 +266 1 797 796 798 +267 1 800 799 801 +268 1 803 802 804 +269 1 806 805 807 +270 1 809 808 810 +271 1 812 811 813 +272 1 815 814 816 +273 1 818 817 819 +274 1 821 820 822 +275 1 824 823 825 +276 1 827 826 828 +277 1 830 829 831 +278 1 833 832 834 +279 1 836 835 837 +280 1 839 838 840 +281 1 842 841 843 +282 1 845 844 846 +283 1 848 847 849 +284 1 851 850 852 +285 1 854 853 855 +286 1 857 856 858 +287 1 860 859 861 +288 1 863 862 864 +289 1 866 865 867 +290 1 869 868 870 +291 1 872 871 873 +292 1 875 874 876 +293 1 878 877 879 +294 1 881 880 882 +295 1 884 883 885 +296 1 887 886 888 +297 1 890 889 891 +298 1 893 892 894 +299 1 896 895 897 +300 1 899 898 900 +301 1 902 901 903 +302 1 905 904 906 +303 1 908 907 909 +304 1 911 910 912 +305 1 914 913 915 +306 1 917 916 918 +307 1 920 919 921 +308 1 923 922 924 +309 1 926 925 927 +310 1 929 928 930 +311 1 932 931 933 +312 1 935 934 936 +313 1 938 937 939 +314 1 941 940 942 +315 1 944 943 945 +316 1 947 946 948 +317 1 950 949 951 +318 1 953 952 954 +319 1 956 955 957 +320 1 959 958 960 +321 1 962 961 963 +322 1 965 964 966 +323 1 968 967 969 +324 1 971 970 972 +325 1 974 973 975 +326 1 977 976 978 +327 1 980 979 981 +328 1 983 982 984 +329 1 986 985 987 +330 1 989 988 990 +331 1 992 991 993 +332 1 995 994 996 +333 1 998 997 999 +334 1 1001 1000 1002 +335 1 1004 1003 1005 +336 1 1007 1006 1008 +337 1 1010 1009 1011 +338 1 1013 1012 1014 +339 1 1016 1015 1017 +340 1 1019 1018 1020 +341 1 1022 1021 1023 +342 1 1025 1024 1026 +343 1 1028 1027 1029 +344 1 1031 1030 1032 +345 1 1034 1033 1035 +346 1 1037 1036 1038 +347 1 1040 1039 1041 +348 1 1043 1042 1044 +349 1 1046 1045 1047 +350 1 1049 1048 1050 +351 1 1052 1051 1053 +352 1 1055 1054 1056 +353 1 1058 1057 1059 +354 1 1061 1060 1062 +355 1 1064 1063 1065 +356 1 1067 1066 1068 +357 1 1070 1069 1071 +358 1 1073 1072 1074 +359 1 1076 1075 1077 +360 1 1079 1078 1080 +361 1 1082 1081 1083 +362 1 1085 1084 1086 +363 1 1088 1087 1089 +364 1 1091 1090 1092 +365 1 1094 1093 1095 +366 1 1097 1096 1098 +367 1 1100 1099 1101 +368 1 1103 1102 1104 +369 1 1106 1105 1107 +370 1 1109 1108 1110 +371 1 1112 1111 1113 +372 1 1115 1114 1116 +373 1 1118 1117 1119 +374 1 1121 1120 1122 +375 1 1124 1123 1125 +376 1 1127 1126 1128 +377 1 1130 1129 1131 +378 1 1133 1132 1134 +379 1 1136 1135 1137 +380 1 1139 1138 1140 +381 1 1142 1141 1143 +382 1 1145 1144 1146 +383 1 1148 1147 1149 +384 1 1151 1150 1152 +385 1 1154 1153 1155 +386 1 1157 1156 1158 +387 1 1160 1159 1161 +388 1 1163 1162 1164 +389 1 1166 1165 1167 +390 1 1169 1168 1170 +391 1 1172 1171 1173 +392 1 1175 1174 1176 +393 1 1178 1177 1179 +394 1 1181 1180 1182 +395 1 1184 1183 1185 +396 1 1187 1186 1188 +397 1 1190 1189 1191 +398 1 1193 1192 1194 +399 1 1196 1195 1197 +400 1 1199 1198 1200 +401 1 1202 1201 1203 +402 1 1205 1204 1206 +403 1 1208 1207 1209 +404 1 1211 1210 1212 +405 1 1214 1213 1215 +406 1 1217 1216 1218 +407 1 1220 1219 1221 +408 1 1223 1222 1224 +409 1 1226 1225 1227 +410 1 1229 1228 1230 +411 1 1232 1231 1233 +412 1 1235 1234 1236 +413 1 1238 1237 1239 +414 1 1241 1240 1242 +415 1 1244 1243 1245 +416 1 1247 1246 1248 +417 1 1250 1249 1251 +418 1 1253 1252 1254 +419 1 1256 1255 1257 +420 1 1259 1258 1260 +421 1 1262 1261 1263 +422 1 1265 1264 1266 +423 1 1268 1267 1269 +424 1 1271 1270 1272 +425 1 1274 1273 1275 +426 1 1277 1276 1278 +427 1 1280 1279 1281 +428 1 1283 1282 1284 +429 1 1286 1285 1287 +430 1 1289 1288 1290 +431 1 1292 1291 1293 +432 1 1295 1294 1296 +433 1 1298 1297 1299 +434 1 1301 1300 1302 +435 1 1304 1303 1305 +436 1 1307 1306 1308 +437 1 1310 1309 1311 +438 1 1313 1312 1314 +439 1 1316 1315 1317 +440 1 1319 1318 1320 +441 1 1322 1321 1323 +442 1 1325 1324 1326 +443 1 1328 1327 1329 +444 1 1331 1330 1332 +445 1 1334 1333 1335 +446 1 1337 1336 1338 +447 1 1340 1339 1341 +448 1 1343 1342 1344 +449 1 1346 1345 1347 +450 1 1349 1348 1350 +451 1 1352 1351 1353 +452 1 1355 1354 1356 +453 1 1358 1357 1359 +454 1 1361 1360 1362 +455 1 1364 1363 1365 +456 1 1367 1366 1368 +457 1 1370 1369 1371 +458 1 1373 1372 1374 +459 1 1376 1375 1377 +460 1 1379 1378 1380 +461 1 1382 1381 1383 +462 1 1385 1384 1386 +463 1 1388 1387 1389 +464 1 1391 1390 1392 +465 1 1394 1393 1395 +466 1 1397 1396 1398 +467 1 1400 1399 1401 +468 1 1403 1402 1404 +469 1 1406 1405 1407 +470 1 1409 1408 1410 +471 1 1412 1411 1413 +472 1 1415 1414 1416 +473 1 1418 1417 1419 +474 1 1421 1420 1422 +475 1 1424 1423 1425 +476 1 1427 1426 1428 +477 1 1430 1429 1431 +478 1 1433 1432 1434 +479 1 1436 1435 1437 +480 1 1439 1438 1440 +481 1 1442 1441 1443 +482 1 1445 1444 1446 +483 1 1448 1447 1449 +484 1 1451 1450 1452 +485 1 1454 1453 1455 +486 1 1457 1456 1458 +487 1 1460 1459 1461 +488 1 1463 1462 1464 +489 1 1466 1465 1467 +490 1 1469 1468 1470 +491 1 1472 1471 1473 +492 1 1475 1474 1476 +493 1 1478 1477 1479 +494 1 1481 1480 1482 +495 1 1484 1483 1485 +496 1 1487 1486 1488 +497 1 1490 1489 1491 +498 1 1493 1492 1494 +499 1 1496 1495 1497 +500 1 1499 1498 1500 +501 1 1502 1501 1503 +502 1 1505 1504 1506 +503 1 1508 1507 1509 +504 1 1511 1510 1512 +505 1 1514 1513 1515 +506 1 1517 1516 1518 +507 1 1520 1519 1521 +508 1 1523 1522 1524 +509 1 1526 1525 1527 +510 1 1529 1528 1530 +511 1 1532 1531 1533 +512 1 1535 1534 1536 +513 1 1538 1537 1539 +514 1 1541 1540 1542 +515 1 1544 1543 1545 +516 1 1547 1546 1548 +517 1 1550 1549 1551 +518 1 1553 1552 1554 +519 1 1556 1555 1557 +520 1 1559 1558 1560 +521 1 1562 1561 1563 +522 1 1565 1564 1566 +523 1 1568 1567 1569 +524 1 1571 1570 1572 +525 1 1574 1573 1575 +526 1 1577 1576 1578 +527 1 1580 1579 1581 +528 1 1583 1582 1584 +529 1 1586 1585 1587 +530 1 1589 1588 1590 +531 1 1592 1591 1593 +532 1 1595 1594 1596 +533 1 1598 1597 1599 +534 1 1601 1600 1602 +535 1 1604 1603 1605 +536 1 1607 1606 1608 +537 1 1610 1609 1611 +538 1 1613 1612 1614 +539 1 1616 1615 1617 +540 1 1619 1618 1620 +541 1 1622 1621 1623 +542 1 1625 1624 1626 +543 1 1628 1627 1629 +544 1 1631 1630 1632 +545 1 1634 1633 1635 +546 1 1637 1636 1638 +547 1 1640 1639 1641 +548 1 1643 1642 1644 +549 1 1646 1645 1647 +550 1 1649 1648 1650 +551 1 1652 1651 1653 +552 1 1655 1654 1656 +553 1 1658 1657 1659 +554 1 1661 1660 1662 +555 1 1664 1663 1665 +556 1 1667 1666 1668 +557 1 1670 1669 1671 +558 1 1673 1672 1674 +559 1 1676 1675 1677 +560 1 1679 1678 1680 +561 1 1682 1681 1683 +562 1 1685 1684 1686 +563 1 1688 1687 1689 +564 1 1691 1690 1692 +565 1 1694 1693 1695 +566 1 1697 1696 1698 +567 1 1700 1699 1701 +568 1 1703 1702 1704 +569 1 1706 1705 1707 +570 1 1709 1708 1710 +571 1 1712 1711 1713 +572 1 1715 1714 1716 +573 1 1718 1717 1719 +574 1 1721 1720 1722 +575 1 1724 1723 1725 +576 1 1727 1726 1728 +577 1 1730 1729 1731 +578 1 1733 1732 1734 +579 1 1736 1735 1737 +580 1 1739 1738 1740 +581 1 1742 1741 1743 +582 1 1745 1744 1746 +583 1 1748 1747 1749 +584 1 1751 1750 1752 +585 1 1754 1753 1755 +586 1 1757 1756 1758 +587 1 1760 1759 1761 +588 1 1763 1762 1764 +589 1 1766 1765 1767 +590 1 1769 1768 1770 +591 1 1772 1771 1773 +592 1 1775 1774 1776 +593 1 1778 1777 1779 +594 1 1781 1780 1782 +595 1 1784 1783 1785 +596 1 1787 1786 1788 +597 1 1790 1789 1791 +598 1 1793 1792 1794 +599 1 1796 1795 1797 +600 1 1799 1798 1800 +601 1 1802 1801 1803 +602 1 1805 1804 1806 +603 1 1808 1807 1809 +604 1 1811 1810 1812 +605 1 1814 1813 1815 +606 1 1817 1816 1818 +607 1 1820 1819 1821 +608 1 1823 1822 1824 +609 1 1826 1825 1827 +610 1 1829 1828 1830 +611 1 1832 1831 1833 +612 1 1835 1834 1836 +613 1 1838 1837 1839 +614 1 1841 1840 1842 +615 1 1844 1843 1845 +616 1 1847 1846 1848 +617 1 1850 1849 1851 +618 1 1853 1852 1854 +619 1 1856 1855 1857 +620 1 1859 1858 1860 +621 1 1862 1861 1863 +622 1 1865 1864 1866 +623 1 1868 1867 1869 +624 1 1871 1870 1872 +625 1 1874 1873 1875 +626 1 1877 1876 1878 +627 1 1880 1879 1881 +628 1 1883 1882 1884 +629 1 1886 1885 1887 +630 1 1889 1888 1890 +631 1 1892 1891 1893 +632 1 1895 1894 1896 +633 1 1898 1897 1899 +634 1 1901 1900 1902 +635 1 1904 1903 1905 +636 1 1907 1906 1908 +637 1 1910 1909 1911 +638 1 1913 1912 1914 +639 1 1916 1915 1917 +640 1 1919 1918 1920 +641 1 1922 1921 1923 +642 1 1925 1924 1926 +643 1 1928 1927 1929 +644 1 1931 1930 1932 +645 1 1934 1933 1935 +646 1 1937 1936 1938 +647 1 1940 1939 1941 +648 1 1943 1942 1944 +649 1 1946 1945 1947 +650 1 1949 1948 1950 +651 1 1952 1951 1953 +652 1 1955 1954 1956 +653 1 1958 1957 1959 +654 1 1961 1960 1962 +655 1 1964 1963 1965 +656 1 1967 1966 1968 +657 1 1970 1969 1971 +658 1 1973 1972 1974 +659 1 1976 1975 1977 +660 1 1979 1978 1980 +661 1 1982 1981 1983 +662 1 1985 1984 1986 +663 1 1988 1987 1989 +664 1 1991 1990 1992 +665 1 1994 1993 1995 +666 1 1997 1996 1998 +667 1 2000 1999 2001 +668 1 2003 2002 2004 +669 1 2006 2005 2007 +670 1 2009 2008 2010 +671 1 2012 2011 2013 +672 1 2015 2014 2016 +673 1 2018 2017 2019 +674 1 2021 2020 2022 +675 1 2024 2023 2025 +676 1 2027 2026 2028 +677 1 2030 2029 2031 +678 1 2033 2032 2034 +679 1 2036 2035 2037 +680 1 2039 2038 2040 +681 1 2042 2041 2043 +682 1 2045 2044 2046 +683 1 2048 2047 2049 +684 1 2051 2050 2052 +685 1 2054 2053 2055 +686 1 2057 2056 2058 +687 1 2060 2059 2061 +688 1 2063 2062 2064 +689 1 2066 2065 2067 +690 1 2069 2068 2070 +691 1 2072 2071 2073 +692 1 2075 2074 2076 +693 1 2078 2077 2079 +694 1 2081 2080 2082 +695 1 2084 2083 2085 +696 1 2087 2086 2088 +697 1 2090 2089 2091 +698 1 2093 2092 2094 +699 1 2096 2095 2097 +700 1 2099 2098 2100 +701 1 2102 2101 2103 +702 1 2105 2104 2106 +703 1 2108 2107 2109 +704 1 2111 2110 2112 +705 1 2114 2113 2115 +706 1 2117 2116 2118 +707 1 2120 2119 2121 +708 1 2123 2122 2124 +709 1 2126 2125 2127 +710 1 2129 2128 2130 +711 1 2132 2131 2133 +712 1 2135 2134 2136 +713 1 2138 2137 2139 +714 1 2141 2140 2142 +715 1 2144 2143 2145 +716 1 2147 2146 2148 +717 1 2150 2149 2151 +718 1 2153 2152 2154 +719 1 2156 2155 2157 +720 1 2159 2158 2160 +721 1 2162 2161 2163 +722 1 2165 2164 2166 +723 1 2168 2167 2169 +724 1 2171 2170 2172 +725 1 2174 2173 2175 +726 1 2177 2176 2178 +727 1 2180 2179 2181 +728 1 2183 2182 2184 +729 1 2186 2185 2187 +730 1 2189 2188 2190 +731 1 2192 2191 2193 +732 1 2195 2194 2196 +733 1 2198 2197 2199 +734 1 2201 2200 2202 +735 1 2204 2203 2205 +736 1 2207 2206 2208 +737 1 2210 2209 2211 +738 1 2213 2212 2214 +739 1 2216 2215 2217 +740 1 2219 2218 2220 +741 1 2222 2221 2223 +742 1 2225 2224 2226 +743 1 2228 2227 2229 +744 1 2231 2230 2232 +745 1 2234 2233 2235 +746 1 2237 2236 2238 +747 1 2240 2239 2241 +748 1 2243 2242 2244 +749 1 2246 2245 2247 +750 1 2249 2248 2250 +751 1 2252 2251 2253 +752 1 2255 2254 2256 +753 1 2258 2257 2259 +754 1 2261 2260 2262 +755 1 2264 2263 2265 +756 1 2267 2266 2268 +757 1 2270 2269 2271 +758 1 2273 2272 2274 +759 1 2276 2275 2277 +760 1 2279 2278 2280 +761 1 2282 2281 2283 +762 1 2285 2284 2286 +763 1 2288 2287 2289 +764 1 2291 2290 2292 +765 1 2294 2293 2295 +766 1 2297 2296 2298 +767 1 2300 2299 2301 +768 1 2303 2302 2304 +769 1 2306 2305 2307 +770 1 2309 2308 2310 +771 1 2312 2311 2313 +772 1 2315 2314 2316 +773 1 2318 2317 2319 +774 1 2321 2320 2322 +775 1 2324 2323 2325 +776 1 2327 2326 2328 +777 1 2330 2329 2331 +778 1 2333 2332 2334 +779 1 2336 2335 2337 +780 1 2339 2338 2340 +781 1 2342 2341 2343 +782 1 2345 2344 2346 +783 1 2348 2347 2349 +784 1 2351 2350 2352 +785 1 2354 2353 2355 +786 1 2357 2356 2358 +787 1 2360 2359 2361 +788 1 2363 2362 2364 +789 1 2366 2365 2367 +790 1 2369 2368 2370 +791 1 2372 2371 2373 +792 1 2375 2374 2376 +793 1 2378 2377 2379 +794 1 2381 2380 2382 +795 1 2384 2383 2385 +796 1 2387 2386 2388 +797 1 2390 2389 2391 +798 1 2393 2392 2394 +799 1 2396 2395 2397 +800 1 2399 2398 2400 +801 1 2402 2401 2403 +802 1 2405 2404 2406 +803 1 2408 2407 2409 +804 1 2411 2410 2412 +805 1 2414 2413 2415 +806 1 2417 2416 2418 +807 1 2420 2419 2421 +808 1 2423 2422 2424 +809 1 2426 2425 2427 +810 1 2429 2428 2430 +811 1 2432 2431 2433 +812 1 2435 2434 2436 +813 1 2438 2437 2439 +814 1 2441 2440 2442 +815 1 2444 2443 2445 +816 1 2447 2446 2448 +817 1 2450 2449 2451 +818 1 2453 2452 2454 +819 1 2456 2455 2457 +820 1 2459 2458 2460 +821 1 2462 2461 2463 +822 1 2465 2464 2466 +823 1 2468 2467 2469 +824 1 2471 2470 2472 +825 1 2474 2473 2475 +826 1 2477 2476 2478 +827 1 2480 2479 2481 +828 1 2483 2482 2484 +829 1 2486 2485 2487 +830 1 2489 2488 2490 +831 1 2492 2491 2493 +832 1 2495 2494 2496 +833 1 2498 2497 2499 +834 1 2501 2500 2502 +835 1 2504 2503 2505 +836 1 2507 2506 2508 +837 1 2510 2509 2511 +838 1 2513 2512 2514 +839 1 2516 2515 2517 +840 1 2519 2518 2520 +841 1 2522 2521 2523 +842 1 2525 2524 2526 +843 1 2528 2527 2529 +844 1 2531 2530 2532 +845 1 2534 2533 2535 +846 1 2537 2536 2538 +847 1 2540 2539 2541 +848 1 2543 2542 2544 +849 1 2546 2545 2547 +850 1 2549 2548 2550 +851 1 2552 2551 2553 +852 1 2555 2554 2556 +853 1 2558 2557 2559 +854 1 2561 2560 2562 +855 1 2564 2563 2565 +856 1 2567 2566 2568 +857 1 2570 2569 2571 +858 1 2573 2572 2574 +859 1 2576 2575 2577 +860 1 2579 2578 2580 +861 1 2582 2581 2583 +862 1 2585 2584 2586 +863 1 2588 2587 2589 +864 1 2591 2590 2592 +865 1 2594 2593 2595 +866 1 2597 2596 2598 +867 1 2600 2599 2601 +868 1 2603 2602 2604 +869 1 2606 2605 2607 +870 1 2609 2608 2610 +871 1 2612 2611 2613 +872 1 2615 2614 2616 +873 1 2618 2617 2619 +874 1 2621 2620 2622 +875 1 2624 2623 2625 +876 1 2627 2626 2628 +877 1 2630 2629 2631 +878 1 2633 2632 2634 +879 1 2636 2635 2637 +880 1 2639 2638 2640 +881 1 2642 2641 2643 +882 1 2645 2644 2646 +883 1 2648 2647 2649 +884 1 2651 2650 2652 +885 1 2654 2653 2655 +886 1 2657 2656 2658 +887 1 2660 2659 2661 +888 1 2663 2662 2664 +889 1 2666 2665 2667 +890 1 2669 2668 2670 +891 1 2672 2671 2673 +892 1 2675 2674 2676 +893 1 2678 2677 2679 +894 1 2681 2680 2682 +895 1 2684 2683 2685 +896 1 2687 2686 2688 +897 1 2690 2689 2691 +898 1 2693 2692 2694 +899 1 2696 2695 2697 +900 1 2699 2698 2700 +901 1 2702 2701 2703 +902 1 2705 2704 2706 +903 1 2708 2707 2709 +904 1 2711 2710 2712 +905 1 2714 2713 2715 +906 1 2717 2716 2718 +907 1 2720 2719 2721 +908 1 2723 2722 2724 +909 1 2726 2725 2727 +910 1 2729 2728 2730 +911 1 2732 2731 2733 +912 1 2735 2734 2736 +913 1 2738 2737 2739 +914 1 2741 2740 2742 +915 1 2744 2743 2745 +916 1 2747 2746 2748 +917 1 2750 2749 2751 +918 1 2753 2752 2754 +919 1 2756 2755 2757 +920 1 2759 2758 2760 +921 1 2762 2761 2763 +922 1 2765 2764 2766 +923 1 2768 2767 2769 +924 1 2771 2770 2772 +925 1 2774 2773 2775 +926 1 2777 2776 2778 +927 1 2780 2779 2781 +928 1 2783 2782 2784 +929 1 2786 2785 2787 +930 1 2789 2788 2790 +931 1 2792 2791 2793 +932 1 2795 2794 2796 +933 1 2798 2797 2799 +934 1 2801 2800 2802 +935 1 2804 2803 2805 +936 1 2807 2806 2808 +937 1 2810 2809 2811 +938 1 2813 2812 2814 +939 1 2816 2815 2817 +940 1 2819 2818 2820 +941 1 2822 2821 2823 +942 1 2825 2824 2826 +943 1 2828 2827 2829 +944 1 2831 2830 2832 +945 1 2834 2833 2835 +946 1 2837 2836 2838 +947 1 2840 2839 2841 +948 1 2843 2842 2844 +949 1 2846 2845 2847 +950 1 2849 2848 2850 +951 1 2852 2851 2853 +952 1 2855 2854 2856 +953 1 2858 2857 2859 +954 1 2861 2860 2862 +955 1 2864 2863 2865 +956 1 2867 2866 2868 +957 1 2870 2869 2871 +958 1 2873 2872 2874 +959 1 2876 2875 2877 +960 1 2879 2878 2880 +961 1 2882 2881 2883 +962 1 2885 2884 2886 +963 1 2888 2887 2889 +964 1 2891 2890 2892 +965 1 2894 2893 2895 +966 1 2897 2896 2898 +967 1 2900 2899 2901 +968 1 2903 2902 2904 +969 1 2906 2905 2907 +970 1 2909 2908 2910 +971 1 2912 2911 2913 +972 1 2915 2914 2916 +973 1 2918 2917 2919 +974 1 2921 2920 2922 +975 1 2924 2923 2925 +976 1 2927 2926 2928 +977 1 2930 2929 2931 +978 1 2933 2932 2934 +979 1 2936 2935 2937 +980 1 2939 2938 2940 +981 1 2942 2941 2943 +982 1 2945 2944 2946 +983 1 2948 2947 2949 +984 1 2951 2950 2952 +985 1 2954 2953 2955 +986 1 2957 2956 2958 +987 1 2960 2959 2961 +988 1 2963 2962 2964 +989 1 2966 2965 2967 +990 1 2969 2968 2970 +991 1 2972 2971 2973 +992 1 2975 2974 2976 +993 1 2978 2977 2979 +994 1 2981 2980 2982 +995 1 2984 2983 2985 +996 1 2987 2986 2988 +997 1 2990 2989 2991 +998 1 2993 2992 2994 +999 1 2996 2995 2997 +1000 1 2999 2998 3000 +1001 1 3002 3001 3003 +1002 1 3005 3004 3006 +1003 1 3008 3007 3009 +1004 1 3011 3010 3012 +1005 1 3014 3013 3015 +1006 1 3017 3016 3018 +1007 1 3020 3019 3021 +1008 1 3023 3022 3024 +1009 1 3026 3025 3027 +1010 1 3029 3028 3030 +1011 1 3032 3031 3033 +1012 1 3035 3034 3036 +1013 1 3038 3037 3039 +1014 1 3041 3040 3042 +1015 1 3044 3043 3045 +1016 1 3047 3046 3048 +1017 1 3050 3049 3051 +1018 1 3053 3052 3054 +1019 1 3056 3055 3057 +1020 1 3059 3058 3060 +1021 1 3062 3061 3063 +1022 1 3065 3064 3066 +1023 1 3068 3067 3069 +1024 1 3071 3070 3072 + diff --git a/examples/PACKAGES/fep/ta/in.spce.lmp b/examples/PACKAGES/fep/ta/in.spce.lmp new file mode 100644 index 0000000000..a9464cc7be --- /dev/null +++ b/examples/PACKAGES/fep/ta/in.spce.lmp @@ -0,0 +1,49 @@ + +units real +boundary p p p + +atom_style full +bond_style harmonic +angle_style harmonic + +special_bonds lj/coul 0.0 0.0 0.5 + +pair_style lj/cut/coul/long 12.0 12.0 +pair_modify tail no +kspace_style pppm 1.0e-5 + +read_data data.spce # 8x8x16 SPCE molecules in a 30x30x100 box + +bond_coeff 1 517.630258 1.0 +angle_coeff 1 37.950526 109.47 +pair_coeff 1 1 0.1553 3.166 # O O +pair_coeff 1 2 0.0 1.0 # O H +pair_coeff 2 2 0.0 1.0 # H H + +# don't use fix shake with compute fep/ta +# fix SHAKE all shake 0.0001 20 0 b 1 + +neighbor 2.0 bin +# neigh_modify delay 0 every 1 check yes + +timestep 1.0 + +variable TK equal 300.0 +compute TA all fep/ta ${TK} xy 1.0005 + +velocity all create ${TK} 12345 + +thermo_style custom step temp press etotal pe c_TA[*] +thermo 5000 + +fix NVT all nvt temp ${TK} ${TK} 100 +run 300000 + +reset_timestep 0 + +variable gamma_v equal 100*(pzz-0.5*(pxx+pyy))/2/100 # surface tension via the mechanical route + +fix FEP all ave/time 100 1000 100000 c_TA[*] v_gamma_v ave running file spce.fep.ta + +run 2000000 + diff --git a/examples/PACKAGES/fep/ta/log.spce b/examples/PACKAGES/fep/ta/log.spce new file mode 100644 index 0000000000..96bb1bd351 --- /dev/null +++ b/examples/PACKAGES/fep/ta/log.spce @@ -0,0 +1,689 @@ +LAMMPS (17 Feb 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +package gpu 0 + +units real +boundary p p p + +atom_style full +bond_style harmonic +angle_style harmonic + +special_bonds lj/coul 0.0 0.0 0.5 + +pair_style lj/cut/coul/long 12.0 12.0 +pair_modify tail no +kspace_style pppm 1.0e-5 + +read_data data.spce # 8x8x16 SPCE molecules in a 30x30x100 box +Reading data file ... + orthogonal box = (0 0 0) to (30 30 100) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 3072 atoms + scanning bonds ... + 2 = max bonds/atom + scanning angles ... + 1 = max angles/atom + reading bonds ... + 2048 bonds + reading angles ... + 1024 angles +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0.5 + special bond factors coul: 0 0 0.5 + 2 = max # of 1-2 neighbors + 1 = max # of 1-3 neighbors + 1 = max # of 1-4 neighbors + 2 = max # of special neighbors + special bonds CPU = 0.001 seconds + read_data CPU = 0.006 seconds + +bond_coeff 1 517.630258 1.0 +angle_coeff 1 37.950526 109.47 +pair_coeff 1 1 0.1553 3.166 # O O +pair_coeff 1 2 0.0 1.0 # O H +pair_coeff 2 2 0.0 1.0 # H H + +# don't use fix shake with compute fep/ta +# fix SHAKE all shake 0.0001 20 0 b 1 + +neighbor 2.0 bin +# neigh_modify delay 0 every 1 check yes + +timestep 1.0 + +variable TK equal 300.0 +compute TA all fep/ta ${TK} xy 1.0005 +compute TA all fep/ta 300 xy 1.0005 + +velocity all create ${TK} 12345 +velocity all create 300 12345 + +thermo_style custom step temp press etotal pe c_TA[*] +thermo 5000 + +fix NVT all nvt temp ${TK} ${TK} 100 +fix NVT all nvt temp 300 ${TK} 100 +fix NVT all nvt temp 300 300 100 +run 300000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- GPU package (short-range, long-range and three-body potentials): + +@Article{Brown11, + author = {W. M. Brown, P. Wang, S. J. Plimpton, A. N. Tharrington}, + title = {Implementing Molecular Dynamics on Hybrid High Performance Computers - Short Range Forces}, + journal = {Comp.~Phys.~Comm.}, + year = 2011, + volume = 182, + pages = {898--911} +} + +@Article{Brown12, + author = {W. M. Brown, A. Kohlmeyer, S. J. Plimpton, A. N. Tharrington}, + title = {Implementing Molecular Dynamics on Hybrid High Performance Computers - Particle-Particle Particle-Mesh}, + journal = {Comp.~Phys.~Comm.}, + year = 2012, + volume = 183, + pages = {449--459} +} + +@Article{Brown13, + author = {W. M. Brown, Y. Masako}, + title = {Implementing Molecular Dynamics on Hybrid High Performance Computers – Three-Body Potentials}, + journal = {Comp.~Phys.~Comm.}, + year = 2013, + volume = 184, + pages = {2785--2793} +} + +@Article{Trung15, + author = {T. D. Nguyen, S. J. Plimpton}, + title = {Accelerating dissipative particle dynamics simulations for soft matter systems}, + journal = {Comput.~Mater.~Sci.}, + year = 2015, + volume = 100, + pages = {173--180} +} + +@Article{Trung17, + author = {T. D. Nguyen}, + title = {GPU-accelerated Tersoff potentials for massively parallel Molecular Dynamics simulations}, + journal = {Comp.~Phys.~Comm.}, + year = 2017, + volume = 212, + pages = {113--122} +} + +@Article{Nikolskiy19, + author = {V. Nikolskiy, V. Stegailov}, + title = {GPU acceleration of four-site water models in LAMMPS}, + journal = {Proceeding of the International Conference on Parallel Computing (ParCo 2019), Prague, Czech Republic}, + year = 2019 +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +PPPM initialization ... + using 12-bit tables for long-range coulomb (src/kspace.cpp:340) + G vector (1/distance) = 0.24270009 + grid = 20 20 50 + stencil order = 5 + estimated absolute RMS force accuracy = 0.0037271514 + estimated relative force accuracy = 1.1224206e-05 + using double precision FFTW3 + 3d grid and FFT values/proc = 40824 20000 + generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +FEP/TA settings ... + temperature = 300.000000 + scale factor = 1.000500 + tail no +Per MPI rank memory allocation (min/avg/max) = 10.59 | 10.59 | 10.59 Mbytes + Step Temp Press TotEng PotEng c_TA[1] c_TA[2] c_TA[3] + 0 300 5742.8831 8061.6965 5315.4762 -10.940045 93249708 0.45 + 5000 301.43029 -118.64017 -7888.4723 -10647.786 -0.13617205 1.2566061 0.45 + 10000 294.49018 -301.44062 -8063.3808 -10759.164 -0.14897537 1.2838851 0.45 + 15000 294.36123 -407.07728 -8189.2912 -10883.894 0.34568257 0.55998421 0.45 + 20000 300.95171 111.50248 -8104.1193 -10859.052 0.11293291 0.82742794 0.45 + 25000 300.28473 388.00598 -8147.8655 -10896.692 0.11270184 0.82774872 0.45 + 30000 306.62229 -113.93849 -8191.7529 -10998.594 0.26068823 0.6457922 0.45 + 35000 303.66349 -426.81556 -8269.8364 -11049.593 0.78191631 0.26939311 0.45 + 40000 291.70214 -50.50854 -8368.0775 -11038.339 0.20120788 0.71354814 0.45 + 45000 299.74326 -289.18081 -8346.2716 -11090.142 0.4163404 0.49739645 0.45 + 50000 300.53193 36.834691 -8367.5726 -11118.662 0.20517137 0.70881996 0.45 + 55000 298.20207 -107.76906 -8274.386 -11004.148 0.7409946 0.2885342 0.45 + 60000 298.32558 -65.20542 -8433.4884 -11164.381 0.16210976 0.76191344 0.45 + 65000 297.3149 -102.87381 -8379.2515 -11100.892 0.21193701 0.70082127 0.45 + 70000 300.78423 -463.75811 -8381.3317 -11134.731 0.32109349 0.58356406 0.45 + 75000 299.53099 -53.264996 -8495.159 -11237.086 0.44828935 0.47144212 0.45 + 80000 295.55879 -590.1244 -8432.3435 -11137.909 0.28788374 0.61699451 0.45 + 85000 298.73289 -234.73297 -8473.8721 -11208.493 -0.11723275 1.2173128 0.45 + 90000 307.02709 -264.9035 -8303.7625 -11114.309 -0.098959935 1.1805672 0.45 + 95000 304.79112 199.8891 -8364.2553 -11154.334 0.036986735 0.93984396 0.45 + 100000 295.49748 -743.18974 -8453.8066 -11158.811 0.249981 0.65749559 0.45 + 105000 303.11352 -163.70166 -8324.4846 -11099.206 -0.012286442 1.0208231 0.45 + 110000 294.30278 -33.731015 -8512.8168 -11206.884 -0.0129379 1.0219392 0.45 + 115000 293.65421 393.24871 -8481.1933 -11169.324 0.75255277 0.28299408 0.45 + 120000 300.56448 16.832298 -8507.3819 -11258.769 0.13389897 0.79883437 0.45 + 125000 297.92506 -398.77893 -8576.4403 -11303.666 0.07292658 0.88485917 0.45 + 130000 303.007 -589.11865 -8560.7259 -11334.472 0.42876446 0.48713794 0.45 + 135000 310.82674 -203.4991 -8565.3181 -11410.647 0.075268046 0.88139064 0.45 + 140000 303.68345 -710.20709 -8570.895 -11350.834 -0.1023741 1.1873476 0.45 + 145000 293.86825 129.05781 -8457.0747 -11147.165 0.39475138 0.51573896 0.45 + 150000 296.93136 -734.03863 -8577.2763 -11295.406 0.73600373 0.29095985 0.45 + 155000 296.67522 -290.20206 -8631.0579 -11346.843 -0.30049664 1.6554154 0.45 + 160000 301.5685 -656.03394 -8646.3196 -11406.898 0.08494101 0.86720512 0.45 + 165000 295.8808 342.45206 -8602.0309 -11310.544 -0.30873864 1.6784606 0.45 + 170000 303.33048 -64.144957 -8580.8446 -11357.552 0.13622456 0.79572423 0.45 + 175000 300.75245 -908.44969 -8566.8005 -11319.909 0.15795135 0.76724659 0.45 + 180000 301.34603 -350.00512 -8489.0111 -11247.553 0.21089487 0.70204744 0.45 + 185000 305.96254 62.840515 -8458.0542 -11258.856 -0.050029338 1.0875408 0.45 + 190000 300.14392 256.935 -8684.6591 -11432.197 0.40144188 0.50998337 0.45 + 195000 299.32366 -218.70113 -8505.3328 -11245.362 -0.19428451 1.3852659 0.45 + 200000 307.89424 -569.89954 -8615.1541 -11433.639 0.55121888 0.39668508 0.45 + 205000 299.34873 334.69765 -8657.6353 -11397.894 0.17751997 0.74247109 0.45 + 210000 298.54619 -261.12193 -8601.2439 -11334.156 0.74219016 0.28795615 0.45 + 215000 304.02395 -306.81112 -8531.9913 -11315.047 0.86987192 0.23244073 0.45 + 220000 299.95916 278.60921 -8682.394 -11428.24 -0.26474202 1.559051 0.45 + 225000 302.839 -226.36906 -8515.0815 -11287.29 0.060381353 0.90367684 0.45 + 230000 299.54085 240.08589 -8636.8991 -11378.916 -0.46699438 2.1887589 0.45 + 235000 297.62792 -138.20813 -8627.0888 -11351.595 -0.035013312 1.0604901 0.45 + 240000 299.15558 442.88999 -8749.2731 -11487.763 0.14696819 0.78151268 0.45 + 245000 291.76323 174.70322 -8597.8808 -11268.701 -0.3979188 1.9492946 0.45 + 250000 308.21961 37.282506 -8603.7127 -11425.176 0.021882894 0.96395922 0.45 + 255000 307.18484 -493.77408 -8459.5942 -11271.585 0.16914044 0.75298079 0.45 + 260000 294.17364 -238.05366 -8677.8379 -11370.723 -0.35710078 1.8202968 0.45 + 265000 289.14461 -304.12454 -8727.2613 -11374.111 0.18045129 0.73882932 0.45 + 270000 301.51228 -255.75558 -8640.9577 -11401.022 0.49252861 0.43772444 0.45 + 275000 294.98349 -351.00974 -8678.3965 -11378.695 -0.31576914 1.6983718 0.45 + 280000 294.37376 279.87325 -8668.9575 -11363.675 0.26328091 0.64298978 0.45 + 285000 295.68351 249.3086 -8748.533 -11455.24 0.6820904 0.31849899 0.45 + 290000 298.74266 -749.43024 -8583.8679 -11318.578 0.030414997 0.95026156 0.45 + 295000 292.67215 -573.39647 -8713.3223 -11392.463 0.25656615 0.65027291 0.45 + 300000 302.48853 186.71329 -8655.8918 -11424.892 0.20319721 0.71117107 0.45 +Loop time of 706.805 on 1 procs for 300000 steps with 3072 atoms + +Performance: 36.672 ns/day, 0.654 hours/ns, 424.445 timesteps/s +95.4% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 149.88 | 149.88 | 149.88 | 0.0 | 21.21 +Bond | 17.824 | 17.824 | 17.824 | 0.0 | 2.52 +Kspace | 517.46 | 517.46 | 517.46 | 0.0 | 73.21 +Neigh | 1.3789 | 1.3789 | 1.3789 | 0.0 | 0.20 +Comm | 9.412 | 9.412 | 9.412 | 0.0 | 1.33 +Output | 0.092 | 0.092 | 0.092 | 0.0 | 0.01 +Modify | 8.3026 | 8.3026 | 8.3026 | 0.0 | 1.17 +Other | | 2.458 | | | 0.35 + +Nlocal: 3072 ave 3072 max 3072 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 8370 ave 8370 max 8370 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = -1 +Ave neighs/atom = -0.00032552083 +Ave special neighs/atom = 2 +Neighbor list builds = 14698 +Dangerous builds = 21 + +reset_timestep 0 + +variable gamma_v equal 100*(pzz-0.5*(pxx+pyy))/2/100 # surface tension via the mechanical route + +fix FEP all ave/time 100 1000 100000 c_TA[*] v_gamma_v ave running file spce.fep.ta + +run 2000000 +PPPM initialization ... + using 12-bit tables for long-range coulomb (src/kspace.cpp:340) + G vector (1/distance) = 0.24270009 + grid = 20 20 50 + stencil order = 5 + estimated absolute RMS force accuracy = 0.0037271514 + estimated relative force accuracy = 1.1224206e-05 + using double precision FFTW3 + 3d grid and FFT values/proc = 40824 20000 + generated 0 of 1 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 10.61 | 10.61 | 10.61 Mbytes + Step Temp Press TotEng PotEng c_TA[1] c_TA[2] c_TA[3] + 0 302.48853 186.71327 -8655.8918 -11424.892 0.20325452 0.71110271 0.45 + 5000 296.71986 -573.544 -8510.0832 -11226.277 0.43636365 0.48096787 0.45 + 10000 302.58189 314.36295 -8636.8139 -11406.669 0.005932853 0.99009761 0.45 + 15000 296.98096 -950.66627 -8635.9066 -11354.49 0.48058674 0.44658101 0.45 + 20000 297.11923 -474.65836 -8666.9864 -11386.836 0.27933535 0.62590536 0.45 + 25000 302.26474 -621.83271 -8655.4227 -11422.375 0.01931686 0.96811729 0.45 + 30000 300.37645 -358.95128 -8568.7732 -11318.44 0.25415456 0.65290873 0.45 + 35000 296.5436 179.71411 -8665.0335 -11379.614 0.1911473 0.72569185 0.45 + 40000 300.79459 92.193193 -8617.7807 -11371.275 0.27587113 0.629553 0.45 + 45000 298.87827 220.06674 -8695.83 -11431.782 0.28715816 0.61774591 0.45 + 50000 304.4095 -375.31266 -8614.4396 -11401.025 -0.18683272 1.3680584 0.45 + 55000 305.11287 128.51602 -8559.8245 -11352.848 0.24122754 0.66722084 0.45 + 60000 296.56241 302.30371 -8725.6357 -11440.388 -0.27104279 1.5756158 0.45 + 65000 295.78468 -393.18931 -8716.4616 -11424.095 0.39132466 0.51871194 0.45 + 70000 297.67504 155.75977 -8641.2451 -11366.182 0.031194864 0.94901929 0.45 + 75000 298.81381 -207.51201 -8622.9859 -11358.348 -0.11330086 1.2093106 0.45 + 80000 296.17928 -360.65589 -8679.0048 -11390.25 0.68794433 0.31538684 0.45 + 85000 303.90294 488.01134 -8643.2028 -11425.151 0.41330713 0.49993365 0.45 + 90000 296.49425 14.901201 -8636.0539 -11350.182 -0.21538319 1.4351695 0.45 + 95000 308.63505 137.10659 -8570.395 -11395.661 0.51407684 0.42218544 0.45 + 100000 302.56638 -402.80803 -8635.0157 -11404.729 0.1552006 0.77079493 0.45 + 105000 293.79289 -417.74599 -8626.2538 -11315.654 -0.13491963 1.253969 0.45 + 110000 293.52504 -808.94658 -8684.9259 -11371.874 0.20573374 0.70815164 0.45 + 115000 307.6821 132.78071 -8639.817 -11456.36 -0.67060193 3.0798018 0.45 + 120000 303.22974 121.87128 -8714.7295 -11490.515 0.3675961 0.5397742 0.45 + 125000 303.8202 -34.518279 -8625.1384 -11406.329 0.17151619 0.74998608 0.45 + 130000 294.5718 -508.86133 -8684.9608 -11381.491 0.23323323 0.67622827 0.45 + 135000 302.79866 -445.99091 -8627.6163 -11399.456 0.3300839 0.57482965 0.45 + 140000 297.84052 -78.442467 -8621.5234 -11347.976 0.39157424 0.51849484 0.45 + 145000 303.64247 463.89678 -8673.8591 -11453.423 0.39692857 0.51385891 0.45 + 150000 288.38239 28.567607 -8789.6464 -11429.518 -0.045509865 1.0793274 0.45 + 155000 296.02581 -111.35664 -8674.295 -11384.135 0.23313764 0.67633671 0.45 + 160000 307.72004 -410.73956 -8578.8169 -11395.707 0.28485416 0.62013794 0.45 + 165000 300.42279 -483.56039 -8598.0354 -11348.126 0.38342507 0.52563101 0.45 + 170000 302.51326 -150.99512 -8626.2426 -11395.469 0.2439355 0.66419697 0.45 + 175000 295.41161 -554.9058 -8760.0201 -11464.238 0.38186652 0.52700696 0.45 + 180000 296.21987 -194.97724 -8645.4143 -11357.031 0.098453456 0.84777037 0.45 + 185000 296.52352 -186.85833 -8690.0538 -11404.45 0.6348999 0.34473516 0.45 + 190000 304.72799 -60.2868 -8667.2005 -11456.701 0.1885985 0.72880108 0.45 + 195000 306.65221 -871.17267 -8679.3434 -11486.458 0.56138735 0.38997638 0.45 + 200000 301.07509 362.96369 -8616.9867 -11373.048 -0.53126323 2.4379049 0.45 + 205000 303.65587 -216.8767 -8564.3182 -11344.005 0.11046546 0.83085967 0.45 + 210000 296.20891 -474.08356 -8698.3778 -11409.894 -0.11237476 1.2074335 0.45 + 215000 295.37276 422.46284 -8714.4636 -11418.326 0.042757549 0.93079022 0.45 + 220000 301.20663 -202.20616 -8577.1827 -11334.449 0.30387837 0.60066105 0.45 + 225000 306.20481 -90.566175 -8503.5134 -11306.533 0.29188403 0.6128683 0.45 + 230000 303.54253 -24.255163 -8641.8724 -11420.521 -0.38522168 1.9082173 0.45 + 235000 300.29265 -572.08074 -8664.2779 -11413.177 0.48055356 0.44660587 0.45 + 240000 302.90712 -226.88617 -8636.6962 -11409.528 -0.15295452 1.2924832 0.45 + 245000 305.05222 -68.241521 -8591.0885 -11383.557 -0.19850824 1.3951152 0.45 + 250000 300.27784 -46.680162 -8746.7288 -11495.492 -0.0098493376 1.0166585 0.45 + 255000 308.23091 -424.64171 -8573.7405 -11395.307 0.1366107 0.79520901 0.45 + 260000 296.11619 4.6901264 -8742.1916 -11452.859 -0.12450429 1.2322516 0.45 + 265000 301.62359 134.42152 -8565.5323 -11326.615 -0.028534957 1.0490284 0.45 + 270000 306.71999 -62.484213 -8690.7983 -11498.534 0.28432443 0.62068922 0.45 + 275000 292.91982 532.15442 -8779.2684 -11460.676 -0.40898808 1.9858264 0.45 + 280000 306.88024 -339.05165 -8557.2761 -11366.479 0.12573772 0.80984534 0.45 + 285000 303.38798 617.66326 -8630.5787 -11407.813 -0.1310487 1.2458532 0.45 + 290000 299.66094 302.90333 -8692.267 -11435.383 0.65063395 0.33575584 0.45 + 295000 304.49009 656.72392 -8710.7918 -11498.115 -0.16849302 1.3266137 0.45 + 300000 303.80861 -221.66912 -8688.9465 -11470.031 -0.24985266 1.5205954 0.45 + 305000 300.67136 -498.92059 -8669.6648 -11422.031 0.19219443 0.72441833 0.45 + 310000 305.7021 -521.59218 -8505.6751 -11304.093 0.52013748 0.4179152 0.45 + 315000 302.66313 -359.25677 -8682.4925 -11453.091 -0.26135382 1.5502155 0.45 + 320000 304.5646 441.04962 -8610.9569 -11398.962 0.41662005 0.49716319 0.45 + 325000 300.04934 -142.59053 -8698.3246 -11444.997 -0.23029219 1.4715132 0.45 + 330000 305.55522 -212.47771 -8576.3678 -11373.441 0.091594168 0.85758093 0.45 + 335000 294.79439 -151.62761 -8762.4565 -11461.024 0.14345357 0.78613362 0.45 + 340000 302.4373 463.41717 -8643.2588 -11411.79 0.36279978 0.54413438 0.45 + 345000 295.91624 -272.3623 -8678.9725 -11387.81 0.1032874 0.84092407 0.45 + 350000 300.60829 62.418773 -8633.2343 -11385.023 -0.040578988 1.0704371 0.45 + 355000 301.41802 -860.82496 -8573.5867 -11332.788 0.04947461 0.9203617 0.45 + 360000 298.03103 -265.05516 -8619.4232 -11347.619 -0.20903224 1.4199617 0.45 + 365000 298.08727 -359.76277 -8612.4898 -11341.201 0.040109682 0.93493354 0.45 + 370000 301.55162 -339.05976 -8687.3746 -11447.799 0.1705358 0.75122045 0.45 + 375000 299.3933 -290.38029 -8723.9515 -11464.618 -0.1476 1.2809266 0.45 + 380000 303.02442 -1104.7914 -8626.7252 -11400.631 0.3211992 0.58346059 0.45 + 385000 301.49421 -613.53228 -8662.2479 -11422.146 -0.42642873 2.0447796 0.45 + 390000 302.01134 -351.23257 -8662.4664 -11427.099 0.23747904 0.67142935 0.45 + 395000 307.32962 -443.86959 -8624.8646 -11438.181 0.17359502 0.74737541 0.45 + 400000 301.67955 -253.92045 -8690.6143 -11452.209 -0.43779134 2.0841261 0.45 + 405000 302.60773 -97.544471 -8646.8281 -11416.92 0.071259831 0.88733652 0.45 + 410000 302.48853 -630.99507 -8710.4497 -11479.45 0.28763517 0.61725182 0.45 + 415000 296.46562 -443.33457 -8763.0661 -11476.932 0.088532948 0.86199583 0.45 + 420000 295.37803 -70.515081 -8720.0027 -11423.913 0.06359365 0.89882065 0.45 + 425000 299.31069 -48.284153 -8678.6115 -11418.522 0.063520704 0.89893064 0.45 + 430000 296.37918 -651.48627 -8784.4246 -11497.5 -0.0094249768 1.0159351 0.45 + 435000 303.07145 -284.10404 -8558.3149 -11332.651 0.034731239 0.94340646 0.45 + 440000 293.1823 -280.18182 -8707.2432 -11391.054 0.14151034 0.78870025 0.45 + 445000 305.55617 -286.4858 -8646.9315 -11444.013 0.26166889 0.64473078 0.45 + 450000 300.67206 102.89156 -8705.2376 -11457.61 0.88202179 0.2277515 0.45 + 455000 304.23258 9.5792632 -8571.8771 -11356.843 -0.42835558 2.0513992 0.45 + 460000 292.30355 265.8009 -8707.4453 -11383.212 0.20592758 0.70792142 0.45 + 465000 297.62746 193.66269 -8716.5132 -11441.015 0.36938368 0.53815813 0.45 + 470000 292.53483 -75.549804 -8728.3188 -11406.202 0.49993961 0.43231669 0.45 + 475000 296.10181 -202.26042 -8657.5804 -11368.116 -0.29829888 1.6493239 0.45 + 480000 300.24953 249.20038 -8688.6705 -11437.175 0.4372485 0.48025452 0.45 + 485000 296.41241 -73.46156 -8558.9344 -11272.314 -0.15947631 1.3067001 0.45 + 490000 302.51379 -654.60188 -8571.28 -11340.512 0.36608136 0.54114742 0.45 + 495000 300.50497 -127.55361 -8724.7069 -11475.55 0.029571506 0.95160701 0.45 + 500000 303.60879 183.79306 -8568.3539 -11347.609 0.050255275 0.91915729 0.45 + 505000 303.19721 -181.45226 -8614.403 -11389.891 0.32941264 0.57547725 0.45 + 510000 296.74554 -22.844257 -8659.5977 -11376.026 0.017555998 0.97098101 0.45 + 515000 304.94785 184.89151 -8657.5502 -11449.063 0.36892431 0.53857296 0.45 + 520000 297.55996 -618.66865 -8737.5039 -11461.388 0.0057510291 0.99039963 0.45 + 525000 301.79028 298.59479 -8629.0889 -11391.698 0.34316268 0.56235619 0.45 + 530000 309.73127 127.43322 -8551.5448 -11386.846 0.76278829 0.27817682 0.45 + 535000 296.10155 231.50902 -8700.9183 -11411.452 0.44398766 0.47485618 0.45 + 540000 299.71005 -102.1096 -8655.905 -11399.471 0.76085637 0.27907974 0.45 + 545000 300.14982 -206.19313 -8714.8486 -11462.44 0.22627441 0.68416793 0.45 + 550000 294.79885 -643.7432 -8605.2486 -11303.857 -0.057557071 1.1013603 0.45 + 555000 294.17638 -19.930168 -8726.0381 -11418.949 0.40954478 0.50309869 0.45 + 560000 297.03199 -369.45853 -8470.404 -11189.455 -0.6540448 2.9954437 0.45 + 565000 291.48707 -349.3956 -8714.1576 -11382.45 0.16175418 0.76236802 0.45 + 570000 310.66906 -63.356318 -8637.4971 -11481.383 0.025729917 0.95775884 0.45 + 575000 300.62447 -741.10788 -8620.5725 -11372.509 0.16003059 0.76457532 0.45 + 580000 303.7169 -69.625554 -8649.3106 -11429.556 0.13011667 0.80391862 0.45 + 585000 296.8583 22.033506 -8781.0388 -11498.5 0.05826221 0.9068948 0.45 + 590000 295.12104 251.36802 -8661.2354 -11362.793 0.0042041083 0.99297285 0.45 + 595000 291.91551 264.01646 -8784.286 -11456.5 -0.3176707 1.7037977 0.45 + 600000 299.51751 -425.6209 -8680.4016 -11422.205 0.063170047 0.89945954 0.45 + 605000 296.04489 -702.56187 -8648.8336 -11358.848 0.44150563 0.47683729 0.45 + 610000 293.08062 387.21018 -8636.9022 -11319.782 0.430424 0.48578377 0.45 + 615000 300.1062 -406.07366 -8651.5383 -11398.731 0.16393273 0.75958719 0.45 + 620000 304.45492 -717.77411 -8466.6335 -11253.634 0.14754207 0.78076073 0.45 + 625000 300.25467 394.44177 -8545.7468 -11294.298 -0.098814662 1.1802796 0.45 + 630000 301.25687 315.97468 -8555.4413 -11313.167 -0.30209606 1.6598626 0.45 + 635000 296.62552 -313.8236 -8661.4264 -11376.756 0.82351209 0.25123759 0.45 + 640000 300.49659 458.65236 -8648.2545 -11399.021 -0.2575 1.5402266 0.45 + 645000 299.08458 -40.905776 -8589.4621 -11327.303 0.07180479 0.88652576 0.45 + 650000 299.78807 286.71966 -8663.8862 -11408.166 -0.10586303 1.1943167 0.45 + 655000 300.2646 175.76273 -8685.9588 -11434.601 -0.4131303 1.9996722 0.45 + 660000 296.01304 69.482635 -8722.0849 -11431.808 0.65234529 0.33479341 0.45 + 665000 307.08179 -192.78965 -8554.9636 -11366.011 0.37228163 0.53554848 0.45 + 670000 298.81489 46.512873 -8651.3386 -11386.71 -0.34071772 1.7709545 0.45 + 675000 298.09695 -320.42123 -8744.4868 -11473.286 0.21787637 0.6938739 0.45 + 680000 291.73582 -346.08326 -8809.3602 -11479.93 0.35114775 0.55487414 0.45 + 685000 299.8583 -53.573198 -8742.9543 -11487.877 -0.032502983 1.056034 0.45 + 690000 299.56857 -129.53024 -8600.751 -11343.022 0.11604588 0.82311864 0.45 + 695000 287.63895 77.534045 -8889.5114 -11522.578 0.16150699 0.76268419 0.45 + 700000 294.71917 -187.77101 -8824.4116 -11522.291 0.33093056 0.57401387 0.45 + 705000 301.78978 -269.32554 -8594.7858 -11357.39 -0.098783804 1.1802185 0.45 + 710000 305.58313 -214.43945 -8518.1241 -11315.453 -0.03149037 1.0542418 0.45 + 715000 306.30354 -121.41526 -8617.5112 -11421.435 0.10640694 0.83653526 0.45 + 720000 304.94559 91.460869 -8587.9126 -11379.405 -0.4078455 1.982024 0.45 + 725000 295.36839 -505.69412 -8724.4826 -11428.305 0.71800645 0.29987744 0.45 + 730000 298.79826 -9.9970862 -8716.023 -11451.242 0.59730469 0.36717499 0.45 + 735000 300.95964 286.58072 -8641.7744 -11396.779 0.23910326 0.66960256 0.45 + 740000 298.32007 -198.81619 -8685.7142 -11416.556 0.16840724 0.75390743 0.45 + 745000 296.06461 157.22083 -8605.3591 -11315.555 0.3149783 0.58958082 0.45 + 750000 297.27956 -277.36948 -8673.9548 -11395.272 0.058965185 0.90582605 0.45 + 755000 296.79569 203.4854 -8671.4835 -11388.371 0.097863507 0.84860972 0.45 + 760000 296.34981 -296.05791 -8699.7009 -11412.507 0.34644945 0.55926433 0.45 + 765000 302.19536 -657.32604 -8674.9726 -11441.289 -0.25940717 1.5451618 0.45 + 770000 301.91884 -775.45423 -8695.1619 -11458.947 -0.12199652 1.227079 0.45 + 775000 299.9563 -211.10367 -8637.8471 -11383.667 0.3478892 0.55791532 0.45 + 780000 296.00862 -396.64708 -8721.8097 -11431.493 0.25358512 0.65353267 0.45 + 785000 295.12431 -24.44772 -8734.6065 -11436.194 -0.19904079 1.396362 0.45 + 790000 308.18585 -171.55104 -8659.2474 -11480.402 0.30853408 0.59598847 0.45 + 795000 296.45675 -137.73831 -8648.3419 -11362.127 -0.32469954 1.7240046 0.45 + 800000 301.11214 53.405034 -8663.3832 -11419.784 0.1323728 0.800882 0.45 + 805000 305.74305 -320.69662 -8642.7722 -11441.565 0.15136393 0.77577146 0.45 + 810000 305.37725 -264.53003 -8671.4307 -11466.875 0.3113551 0.59317494 0.45 + 815000 304.38239 -240.94118 -8474.7091 -11261.046 -0.080564405 1.1446952 0.45 + 820000 296.05915 -369.13085 -8698.3399 -11408.485 -0.028085872 1.0482385 0.45 + 825000 299.79549 123.66824 -8712.0882 -11456.436 -0.36082461 1.8317026 0.45 + 830000 296.0201 231.08408 -8726.975 -11436.763 -0.22224484 1.4517833 0.45 + 835000 294.90197 -293.4635 -8750.8202 -11450.373 -0.13935283 1.2633285 0.45 + 840000 301.79184 -18.424101 -8689.643 -11452.266 0.19065717 0.72628873 0.45 + 845000 303.63406 232.88156 -8607.7816 -11387.268 0.16521847 0.75795075 0.45 + 850000 300.78823 -301.92537 -8697.521 -11450.957 0.043047914 0.93033698 0.45 + 855000 300.26171 -407.09613 -8617.7866 -11366.403 0.30989277 0.59463173 0.45 + 860000 303.77064 192.13208 -8630.0944 -11410.831 0.44012319 0.47794432 0.45 + 865000 300.12867 323.6738 -8735.2213 -11482.619 0.098660075 0.8474766 0.45 + 870000 299.40232 -213.89349 -8642.3645 -11383.114 0.1478115 0.78040795 0.45 + 875000 300.46794 23.703316 -8624.9835 -11375.487 0.021260277 0.96496648 0.45 + 880000 298.40697 20.053507 -8834.9602 -11566.598 0.25906036 0.647558 0.45 + 885000 299.89193 -56.830889 -8726.8039 -11472.035 -0.14632707 1.2781945 0.45 + 890000 297.49341 -718.63083 -8683.0987 -11406.373 0.017721028 0.97071226 0.45 + 895000 293.34825 -483.14011 -8698.5638 -11383.894 -0.34844876 1.7940698 0.45 + 900000 303.8984 71.405143 -8703.2466 -11485.153 -0.0040127852 1.0067537 0.45 + 905000 296.96955 99.337161 -8644.502 -11362.981 0.29986926 0.60471403 0.45 + 910000 294.13396 -276.63831 -8661.5829 -11354.105 -0.24102928 1.4982558 0.45 + 915000 303.26417 -43.876545 -8575.252 -11351.353 0.013417579 0.97774479 0.45 + 920000 305.27911 -346.57544 -8582.8329 -11377.379 -0.20901843 1.4199288 0.45 + 925000 307.27639 482.10278 -8628.8226 -11441.652 -0.26779925 1.5670667 0.45 + 930000 305.11633 324.47709 -8579.3587 -11372.414 0.68253083 0.31826378 0.45 + 935000 300.11916 -9.8766723 -8780.2986 -11527.61 -0.13402188 1.2520821 0.45 + 940000 295.78408 -67.021801 -8735.3706 -11442.998 0.46658388 0.45719462 0.45 + 945000 300.211 161.55245 -8703.5002 -11451.652 0.062310593 0.90075717 0.45 + 950000 302.51856 -145.81508 -8539.9241 -11309.199 0.019344642 0.96807218 0.45 + 955000 297.23872 14.140867 -8682.9686 -11403.912 -0.30285941 1.6619893 0.45 + 960000 296.19195 158.66375 -8772.8876 -11484.249 0.3298895 0.57501712 0.45 + 965000 293.56726 -302.80176 -8807.9639 -11495.298 0.16057514 0.76387726 0.45 + 970000 307.76289 234.82705 -8569.0805 -11386.363 0.40582434 0.50624817 0.45 + 975000 302.4391 -372.66289 -8569.3448 -11337.893 1.1335506 0.14935733 0.45 + 980000 292.59861 191.50447 -8796.4307 -11474.898 0.82080866 0.25237947 0.45 + 985000 301.61407 97.625218 -8720.889 -11481.885 0.12835918 0.80629208 0.45 + 990000 303.38224 -380.86284 -8666.6015 -11443.783 0.29943962 0.60514999 0.45 + 995000 299.25364 -139.10643 -8631.5948 -11370.983 0.033070141 0.94603876 0.45 + 1000000 295.67561 -191.48596 -8566.021 -11272.656 0.34200535 0.56344895 0.45 + 1005000 304.80384 39.665031 -8603.3665 -11393.562 0.75244137 0.28304697 0.45 + 1010000 298.87735 -181.49155 -8699.7359 -11435.679 0.23524427 0.67395098 0.45 + 1015000 289.92007 -182.58369 -8652.9669 -11306.915 -0.61857139 2.8224052 0.45 + 1020000 300.13923 106.07213 -8618.1949 -11365.69 0.15241071 0.77441051 0.45 + 1025000 307.39589 -312.91975 -8613.3088 -11427.232 0.44069144 0.47748897 0.45 + 1030000 298.41225 441.04111 -8696.1929 -11427.879 -0.1456028 1.2766425 0.45 + 1035000 306.71758 -95.739338 -8471.0526 -11278.766 0.69089513 0.31382964 0.45 + 1040000 302.24132 -415.80447 -8608.0891 -11374.827 0.0090309238 0.98496572 0.45 + 1045000 305.58772 -150.58406 -8563.9959 -11361.367 0.062478239 0.90050391 0.45 + 1050000 303.60025 21.785837 -8623.6613 -11402.839 0.18503623 0.73316896 0.45 + 1055000 293.38734 613.83617 -8606.7635 -11292.451 -0.2195833 1.4453164 0.45 + 1060000 305.11418 -29.208186 -8589.4319 -11382.468 -0.095889014 1.1745016 0.45 + 1065000 294.13176 470.07703 -8724.8028 -11417.305 0.28934127 0.61548789 0.45 + 1070000 309.64471 -634.00961 -8534.3395 -11368.848 -0.048186981 1.0841851 0.45 + 1075000 300.56742 -209.29645 -8615.1904 -11366.605 -0.26336339 1.5554498 0.45 + 1080000 297.94855 218.48741 -8697.7569 -11425.198 -0.0401787 1.0697186 0.45 + 1085000 308.40523 -177.4101 -8681.0198 -11504.182 0.32537753 0.57938558 0.45 + 1090000 295.63403 117.27818 -8609.1285 -11315.382 0.27576906 0.62966079 0.45 + 1095000 300.09566 635.58958 -8552.5989 -11299.695 -0.056458656 1.0993329 0.45 + 1100000 300.68272 375.84619 -8709.6822 -11462.152 0.28519281 0.61978578 0.45 + 1105000 303.34279 -980.64631 -8585.6781 -11362.499 0.34352221 0.56201715 0.45 + 1110000 304.45088 84.082657 -8606.3018 -11393.266 0.019454666 0.96789353 0.45 + 1115000 296.03894 543.18998 -8568.9408 -11278.901 0.38977572 0.5200614 0.45 + 1120000 307.38628 -200.46817 -8619.8059 -11433.641 -0.21765351 1.4406454 0.45 + 1125000 303.36463 -96.322086 -8596.6485 -11373.669 -0.050201944 1.0878558 0.45 + 1130000 295.03081 19.554539 -8820.2191 -11520.951 0.24816885 0.65949722 0.45 + 1135000 297.2534 -452.18389 -8614.3296 -11335.407 0.47102824 0.45379893 0.45 + 1140000 298.03519 -102.40026 -8663.5539 -11391.788 0.42591169 0.48947459 0.45 + 1145000 295.38879 -444.99161 -8629.1445 -11333.153 0.39655669 0.51417955 0.45 + 1150000 303.8409 -236.98919 -8595.3972 -11376.777 0.64097267 0.34124136 0.45 + 1155000 306.07517 -215.50846 -8588.4969 -11390.33 0.036055871 0.94131261 0.45 + 1160000 294.9636 -931.69596 -8675.0022 -11375.119 0.19752892 0.71796511 0.45 + 1165000 294.72276 -192.71028 -8637.3451 -11335.257 -0.00048188528 1.0008086 0.45 + 1170000 301.23614 -213.88646 -8482.7135 -11240.25 0.71933969 0.29920755 0.45 + 1175000 300.44993 375.9896 -8633.2248 -11383.564 0.30232015 0.60223308 0.45 + 1180000 300.16377 118.10917 -8654.5233 -11402.243 0.12296714 0.81361774 0.45 + 1185000 293.70358 210.30955 -8646.4181 -11335.001 0.30210616 0.6024493 0.45 + 1190000 304.75915 -651.08053 -8575.2958 -11365.082 -0.02759447 1.0473748 0.45 + 1195000 297.70391 95.378065 -8731.319 -11456.521 0.52250206 0.41626089 0.45 + 1200000 293.90642 -733.78695 -8697.185 -11387.624 0.13079675 0.80300207 0.45 + 1205000 303.05224 -511.38179 -8632.6207 -11406.781 -0.20143249 1.4019752 0.45 + 1210000 293.80664 245.08881 -8756.1441 -11445.67 0.37969913 0.52892642 0.45 + 1215000 296.59811 308.46776 -8624.2865 -11339.366 0.14440905 0.78487467 0.45 + 1220000 303.74266 188.84272 -8605.9211 -11386.402 -0.092746405 1.1683266 0.45 + 1225000 299.9013 -466.73438 -8576.203 -11321.52 0.27417371 0.63134804 0.45 + 1230000 299.66611 -174.43092 -8604.5105 -11347.674 0.47991062 0.44708777 0.45 + 1235000 295.89844 394.40733 -8789.3714 -11498.046 0.088629157 0.86185673 0.45 + 1240000 298.78384 419.34789 -8688.5635 -11423.651 0.22218371 0.68887865 0.45 + 1245000 299.90866 183.59906 -8698.2559 -11443.64 1.1590193 0.143111 0.45 + 1250000 296.01051 196.22426 -8831.5506 -11541.251 -0.04226137 1.0734621 0.45 + 1255000 292.09199 -163.44863 -8711.8649 -11385.695 0.57648767 0.38022263 0.45 + 1260000 298.83471 -194.96215 -8646.8698 -11382.423 0.10966149 0.83198091 0.45 + 1265000 302.24158 163.34413 -8653.0984 -11419.838 0.51878502 0.41886437 0.45 + 1270000 298.29186 -765.77064 -8697.9423 -11428.526 -0.40185995 1.9622238 0.45 + 1275000 300.55952 -162.42423 -8614.8996 -11366.242 -0.43706076 2.0815736 0.45 + 1280000 294.52892 156.17026 -8718.8337 -11414.971 0.010263439 0.98293149 0.45 + 1285000 301.40565 -778.44393 -8670.527 -11429.615 0.025111338 0.95875312 0.45 + 1290000 294.20057 -918.07774 -8683.4672 -11376.599 0.046386022 0.92514227 0.45 + 1295000 301.09196 -665.75324 -8687.0149 -11443.231 0.11169829 0.82914327 0.45 + 1300000 294.16167 -297.06724 -8708.7055 -11401.481 0.11765896 0.82089447 0.45 + 1305000 303.07886 -538.32897 -8514.6586 -11289.063 -0.047420749 1.0827925 0.45 + 1310000 302.36674 -40.952458 -8536.8784 -11304.764 -0.42539639 2.0412418 0.45 + 1315000 302.05477 -60.391628 -8662.9591 -11427.989 0.13452485 0.79799615 0.45 + 1320000 303.48158 71.63406 -8661.3057 -11439.397 -0.039130791 1.0678399 0.45 + 1325000 296.35737 -261.05768 -8561.6568 -11274.532 0.44670407 0.47269742 0.45 + 1330000 296.29207 -147.71061 -8543.8084 -11256.086 0.2909439 0.61383553 0.45 + 1335000 301.48737 453.77169 -8648.236 -11408.072 0.078354877 0.87683873 0.45 + 1340000 300.90975 -596.76946 -8621.8298 -11376.378 0.49429189 0.43643168 0.45 + 1345000 295.08431 -540.90158 -8694.8895 -11396.111 0.17025999 0.75156807 0.45 + 1350000 296.63006 -197.97304 -8632.9441 -11348.316 -0.29504955 1.6403589 0.45 + 1355000 305.25857 -242.97453 -8473.9923 -11268.35 0.069838933 0.88945392 0.45 + 1360000 296.22833 -151.24398 -8660.529 -11372.223 -0.28031505 1.6003133 0.45 + 1365000 301.25457 -383.71973 -8610.3716 -11368.076 -0.18330657 1.3599906 0.45 + 1370000 300.8142 -179.49364 -8641.5538 -11395.227 0.23629239 0.67276715 0.45 + 1375000 307.62118 -82.315057 -8464.9289 -11280.914 0.024560511 0.95963938 0.45 + 1380000 303.12816 -335.58742 -8512.0211 -11286.877 0.30238814 0.60216441 0.45 + 1385000 304.36118 711.2159 -8577.0597 -11363.203 0.34444857 0.56114453 0.45 + 1390000 294.15072 406.74931 -8678.8526 -11371.528 0.29195829 0.61279196 0.45 + 1395000 300.50629 -164.22554 -8592.1543 -11343.009 0.098759052 0.84733591 0.45 + 1400000 297.37345 -98.001104 -8741.5121 -11463.689 0.27444766 0.63105799 0.45 + 1405000 294.17572 -86.526127 -8712.3447 -11405.249 0.4297415 0.48634023 0.45 + 1410000 310.48104 141.84417 -8647.4854 -11489.65 0.86645808 0.23377559 0.45 + 1415000 310.06801 -433.29574 -8486.7744 -11325.158 -0.21510676 1.4345042 0.45 + 1420000 303.98547 -69.701496 -8551.8036 -11334.507 0.16419779 0.75924955 0.45 + 1425000 301.40096 -115.67827 -8639.4818 -11398.527 0.20161321 0.71306316 0.45 + 1430000 299.1258 -79.769416 -8721.6844 -11459.902 0.36298014 0.54396978 0.45 + 1435000 298.45349 180.92871 -8700.7025 -11432.766 0.43843749 0.47929766 0.45 + 1440000 299.14006 146.72026 -8675.5643 -11413.913 0.50244279 0.43050527 0.45 + 1445000 299.98035 -404.81666 -8725.6961 -11471.737 0.49995597 0.43230482 0.45 + 1450000 295.10222 59.166328 -8728.5327 -11429.918 0.04154017 0.93269286 0.45 + 1455000 292.52514 144.30376 -8743.1245 -11420.919 0.04910241 0.92093649 0.45 + 1460000 303.68948 -264.34132 -8631.6334 -11411.627 0.23528019 0.67391039 0.45 + 1465000 302.97467 98.874471 -8689.2883 -11462.739 0.21805801 0.69366252 0.45 + 1470000 294.50716 133.30708 -8625.4721 -11321.411 0.98143982 0.19276882 0.45 + 1475000 302.04729 -120.74445 -8637.7677 -11402.729 0.4707242 0.45403042 0.45 + 1480000 305.16876 -436.598 -8614.8793 -11408.415 0.27111226 0.63459852 0.45 + 1485000 297.20205 -166.62152 -8598.691 -11319.299 -0.24681532 1.5128679 0.45 + 1490000 299.73617 -126.47006 -8649.4834 -11393.289 0.47833671 0.44826968 0.45 + 1495000 295.64416 481.3869 -8697.4378 -11403.784 0.1128182 0.82758717 0.45 + 1500000 301.34876 -64.948239 -8570.0291 -11328.596 0.10524924 0.83816132 0.45 + 1505000 297.45753 538.92423 -8678.9073 -11401.854 0.15764246 0.76764423 0.45 + 1510000 304.47978 -609.79308 -8491.9652 -11279.194 0.40940159 0.50321953 0.45 + 1515000 301.26466 -130.2245 -8572.0691 -11329.866 0.89811777 0.22168463 0.45 + 1520000 306.33064 472.83128 -8553.0557 -11357.227 -0.3949103 1.9394824 0.45 + 1525000 303.77309 446.96086 -8658.8797 -11439.639 0.23907939 0.66962936 0.45 + 1530000 305.94257 -462.96121 -8683.4501 -11484.069 -0.29365623 1.6365296 0.45 + 1535000 296.45268 -725.6647 -8564.4464 -11278.194 0.031785638 0.94807932 0.45 + 1540000 297.90338 -418.20316 -8566.3092 -11293.337 0.50491901 0.42872083 0.45 + 1545000 304.3796 -281.11491 -8571.3965 -11357.708 0.26286914 0.64343405 0.45 + 1550000 296.71481 -62.772449 -8680.9078 -11397.055 0.15669974 0.76885909 0.45 + 1555000 297.50225 148.74592 -8754.0913 -11477.447 0.14286636 0.78690833 0.45 + 1560000 300.52393 373.85791 -8638.4601 -11389.477 0.089292836 0.8608978 0.45 + 1565000 295.18741 -197.82529 -8603.6291 -11305.795 0.36113621 0.54565489 0.45 + 1570000 295.50662 -297.43989 -8727.7936 -11432.881 0.24895806 0.65862474 0.45 + 1575000 306.12787 745.92559 -8609.3706 -11411.686 0.42705392 0.48853767 0.45 + 1580000 300.84367 544.00229 -8635.6029 -11389.546 -0.20268104 1.4049145 0.45 + 1585000 293.01964 208.25986 -8624.1146 -11306.436 -0.013645123 1.0231522 0.45 + 1590000 304.09 110.80761 -8602.177 -11385.837 -0.39136115 1.9279703 0.45 + 1595000 289.74205 -521.57012 -8666.417 -11318.735 0.30601242 0.59851474 0.45 + 1600000 297.3494 368.04946 -8684.986 -11406.943 0.079346518 0.87538143 0.45 + 1605000 301.19957 -293.44562 -8521.9202 -11279.121 0.49408391 0.43658396 0.45 + 1610000 299.66627 -592.72965 -8750.1489 -11493.314 -0.20726596 1.415761 0.45 + 1615000 301.32181 329.96166 -8575.077 -11333.397 0.21514479 0.69706049 0.45 + 1620000 297.46259 -575.7077 -8604.3396 -11327.332 0.051950054 0.91654801 0.45 + 1625000 301.143 -578.27016 -8622.6936 -11379.377 0.33929754 0.566014 0.45 + 1630000 301.9449 119.02272 -8744.8752 -11508.899 0.25690123 0.64990753 0.45 + 1635000 292.31769 -256.96526 -8729.3974 -11405.293 0.2041501 0.71003527 0.45 + 1640000 305.17316 -224.04815 -8619.2426 -11412.818 0.61612842 0.35576261 0.45 + 1645000 299.82547 -453.0871 -8601.8345 -11346.457 0.44515417 0.47392794 0.45 + 1650000 300.70213 -184.15313 -8604.5269 -11357.175 0.40413562 0.50768423 0.45 + 1655000 298.34797 241.12842 -8736.9407 -11468.038 0.2219039 0.68920205 0.45 + 1660000 305.65546 522.2866 -8702.2765 -11500.267 -0.093142651 1.1691034 0.45 + 1665000 296.92311 -22.202256 -8648.9808 -11367.035 0.21695848 0.69494306 0.45 + 1670000 293.71721 -216.98365 -8726.8596 -11415.567 0.062675713 0.90020567 0.45 + 1675000 302.06866 69.039243 -8665.567 -11430.724 0.0012561112 0.99789522 0.45 + 1680000 292.51483 -764.83087 -8759.3069 -11437.007 0.0022259364 0.99627318 0.45 + 1685000 300.70748 -239.98915 -8682.5295 -11435.226 0.21854685 0.69309397 0.45 + 1690000 303.31754 36.443117 -8554.7105 -11331.3 0.18904617 0.72825402 0.45 + 1695000 300.96783 -365.40002 -8606.9996 -11362.08 0.21317894 0.69936284 0.45 + 1700000 301.78038 -460.56572 -8703.0763 -11465.594 -0.074311844 1.1327524 0.45 + 1705000 299.08328 224.74817 -8680.6969 -11418.526 0.14954235 0.77814547 0.45 + 1710000 303.24064 298.73582 -8637.4191 -11413.304 -0.11628651 1.2153822 0.45 + 1715000 299.1988 535.86954 -8722.2318 -11461.118 0.51289768 0.42302132 0.45 + 1720000 300.88716 -11.654893 -8624.0905 -11378.432 0.62281958 0.35179195 0.45 + 1725000 306.59581 -286.69581 -8574.7957 -11381.394 0.3964476 0.51427364 0.45 + 1730000 302.58784 590.55523 -8670.9964 -11440.906 -0.28655798 1.6171597 0.45 + 1735000 295.17235 -60.036989 -8631.671 -11333.699 0.72231294 0.29771902 0.45 + 1740000 290.06228 -254.79282 -8715.6619 -11370.912 0.35583392 0.55052961 0.45 + 1745000 306.47487 418.58552 -8590.4226 -11395.914 -0.04975774 1.0870455 0.45 + 1750000 296.74674 -73.367187 -8727.0183 -11443.458 -0.27066543 1.5746188 0.45 + 1755000 299.03541 551.77198 -8712.6905 -11450.081 -0.35865936 1.8250619 0.45 + 1760000 288.98684 -380.17132 -8775.8546 -11421.26 -0.17754854 1.3469184 0.45 + 1765000 300.76459 -662.80282 -8671.5414 -11424.761 0.078118597 0.87718632 0.45 + 1770000 301.47287 -498.34628 -8675.582 -11435.285 0.57886218 0.37871122 0.45 + 1775000 307.18565 -70.676548 -8554.9531 -11366.951 0.38766498 0.52190597 0.45 + 1780000 302.58164 -329.49774 -8638.9781 -11408.831 0.53149245 0.41003059 0.45 + 1785000 307.4086 294.59322 -8586.4793 -11400.518 0.34963097 0.55628768 0.45 + 1790000 295.81491 -366.57154 -8756.8143 -11464.724 0.61653346 0.35552098 0.45 + 1795000 296.46712 18.92361 -8640.9928 -11354.873 0.21158778 0.70123194 0.45 + 1800000 290.9851 -805.74081 -8636.1049 -11299.802 0.36361854 0.54338759 0.45 + 1805000 291.6313 -58.207903 -8707.0768 -11376.689 0.2659117 0.6401586 0.45 + 1810000 299.14324 327.45026 -8613.3385 -11351.716 0.58264334 0.37631684 0.45 + 1815000 295.3441 37.594139 -8747.5577 -11451.158 0.10312363 0.84115511 0.45 + 1820000 297.19616 596.87014 -8601.4315 -11321.985 0.11690702 0.82193051 0.45 + 1825000 305.23709 -229.45704 -8586.9328 -11381.094 -0.070794327 1.1260885 0.45 + 1830000 308.48265 -50.225625 -8595.8609 -11419.732 0.28577292 0.61918297 0.45 + 1835000 301.67215 30.600339 -8561.9509 -11323.478 0.67464985 0.32249901 0.45 + 1840000 297.44022 -46.915689 -8760.5329 -11483.321 0.20308399 0.71130615 0.45 + 1845000 294.56439 121.7989 -8819.2766 -11515.739 -0.13859762 1.2617292 0.45 + 1850000 303.92475 63.511256 -8655.7131 -11437.861 -0.064617898 1.1144821 0.45 + 1855000 302.36347 -403.0262 -8663.1963 -11431.052 0.63223295 0.34628081 0.45 + 1860000 292.88227 124.53259 -8622.4528 -11303.517 0.21782313 0.69393587 0.45 + 1865000 299.49141 1.3922328 -8592.8243 -11334.389 0.024359522 0.95996296 0.45 + 1870000 295.36403 -1.848842 -8534.7607 -11238.543 0.53331666 0.40877784 0.45 + 1875000 299.5254 -303.35635 -8642.4199 -11384.296 0.12049946 0.8169925 0.45 + 1880000 302.15027 -233.4192 -8607.1984 -11373.102 0.42967343 0.48639576 0.45 + 1885000 293.78387 -312.31798 -8576.6303 -11265.948 0.62050206 0.35316217 0.45 + 1890000 296.33987 227.42925 -8675.0988 -11387.814 -0.2387251 1.4924762 0.45 + 1895000 296.4116 -297.41585 -8695.6693 -11409.041 0.1899345 0.72716967 0.45 + 1900000 305.04631 -744.8928 -8495.6073 -11288.022 -0.092917858 1.1686627 0.45 + 1905000 299.13767 -233.05542 -8771.8955 -11510.222 -0.053515786 1.0939196 0.45 + 1910000 301.18529 391.32364 -8594.238 -11351.309 0.17761387 0.74235415 0.45 + 1915000 304.53139 -205.26743 -8615.1863 -11402.887 -0.65441918 2.9973254 0.45 + 1920000 304.46794 75.506851 -8696.0461 -11483.166 0.28757039 0.6173189 0.45 + 1925000 295.83229 -40.226799 -8677.0683 -11385.137 0.34338584 0.56214572 0.45 + 1930000 298.91694 72.305481 -8662.7622 -11399.068 -0.45255095 2.1363683 0.45 + 1935000 297.28693 -277.78411 -8678.223 -11399.608 0.32165864 0.58301111 0.45 + 1940000 295.22194 -153.48885 -8737.0529 -11439.534 0.47753767 0.4488709 0.45 + 1945000 298.41366 0.98105216 -8615.733 -11347.432 0.061208942 0.90242323 0.45 + 1950000 298.47932 -461.39566 -8587.8993 -11320.199 0.41883297 0.49532116 0.45 + 1955000 293.30456 -530.72887 -8712.242 -11397.172 -0.052983042 1.0929425 0.45 + 1960000 307.27812 -609.68084 -8563.1295 -11375.974 0.10863685 0.83341209 0.45 + 1965000 309.21876 -661.65884 -8619.5376 -11450.147 -0.00074060514 1.0012431 0.45 + 1970000 294.16474 130.9219 -8662.5966 -11355.4 -0.048761848 1.0852311 0.45 + 1975000 293.87023 -652.42226 -8587.2681 -11277.376 -0.42701916 2.0468057 0.45 + 1980000 302.66906 -396.94893 -8576.3291 -11346.982 0.55938449 0.39128874 0.45 + 1985000 304.00863 167.22102 -8525.9503 -11308.866 -0.12417188 1.2315647 0.45 + 1990000 299.53376 -234.11494 -8528.8821 -11270.834 0.58392743 0.37550715 0.45 + 1995000 296.20959 -99.022727 -8599.3854 -11310.908 0.10920765 0.83261451 0.45 + 2000000 307.40367 -179.44965 -8545.6064 -11359.6 0.485016 0.44327537 0.45 +Loop time of 4787.7 on 1 procs for 2000000 steps with 3072 atoms + +Performance: 36.092 ns/day, 0.665 hours/ns, 417.737 timesteps/s +95.4% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1015.1 | 1015.1 | 1015.1 | 0.0 | 21.20 +Bond | 121.19 | 121.19 | 121.19 | 0.0 | 2.53 +Kspace | 3455.1 | 3455.1 | 3455.1 | 0.0 | 72.17 +Neigh | 8.7475 | 8.7475 | 8.7475 | 0.0 | 0.18 +Comm | 58.679 | 58.679 | 58.679 | 0.0 | 1.23 +Output | 0.60209 | 0.60209 | 0.60209 | 0.0 | 0.01 +Modify | 81.328 | 81.328 | 81.328 | 0.0 | 1.70 +Other | | 46.88 | | | 0.98 + +Nlocal: 3072 ave 3072 max 3072 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 8395 ave 8395 max 8395 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = -1 +Ave neighs/atom = -0.00032552083 +Ave special neighs/atom = 2 +Neighbor list builds = 93794 +Dangerous builds = 0 + +Total wall time: 1:31:34 diff --git a/examples/PACKAGES/fep/ta/spce.fep.ta b/examples/PACKAGES/fep/ta/spce.fep.ta new file mode 100644 index 0000000000..7ed4013d65 --- /dev/null +++ b/examples/PACKAGES/fep/ta/spce.fep.ta @@ -0,0 +1,22 @@ +# Time-averaged data for fix FEP +# TimeStep c_TA[1] c_TA[2] c_TA[3] v_gamma_v +100000 0.168677 0.863546 0.45 65.7437 +200000 0.169722 0.861354 0.45 66.6859 +300000 0.165507 0.868407 0.45 63.1899 +400000 0.162311 0.875704 0.45 60.7859 +500000 0.165468 0.872729 0.45 63.2053 +600000 0.165267 0.873825 0.45 63.1828 +700000 0.167824 0.869356 0.45 65.1722 +800000 0.170332 0.866538 0.45 67.0749 +900000 0.164396 0.875043 0.45 62.4639 +1000000 0.164738 0.87663 0.45 62.5659 +1100000 0.168395 0.870496 0.45 65.415 +1200000 0.170147 0.867104 0.45 66.7132 +1300000 0.170509 0.866709 0.45 66.9833 +1400000 0.171152 0.865294 0.45 67.5598 +1500000 0.172363 0.863433 0.45 68.547 +1600000 0.171538 0.864062 0.45 67.8359 +1700000 0.171662 0.864029 0.45 67.9145 +1800000 0.170202 0.866069 0.45 66.7697 +1900000 0.171403 0.864162 0.45 67.6313 +2000000 0.170962 0.864753 0.45 67.2314 diff --git a/examples/PACKAGES/tmd/data.peptide b/examples/PACKAGES/tmd/data.peptide new file mode 120000 index 0000000000..47dd25a04b --- /dev/null +++ b/examples/PACKAGES/tmd/data.peptide @@ -0,0 +1 @@ +../../peptide/data.peptide \ No newline at end of file diff --git a/examples/PACKAGES/tmd/in.tmd b/examples/PACKAGES/tmd/in.tmd new file mode 100644 index 0000000000..6cbf57b951 --- /dev/null +++ b/examples/PACKAGES/tmd/in.tmd @@ -0,0 +1,45 @@ +# Solvated 5-mer peptide + +units real +atom_style full + +pair_style lj/charmm/coul/long 8.0 10.0 10.0 +bond_style harmonic +angle_style charmm +dihedral_style charmm +improper_style harmonic +kspace_style pppm 0.0001 + +read_data data.peptide + +neighbor 2.0 bin +neigh_modify delay 5 + +timestep 2.0 + +thermo_style multi +thermo 50 + +group tmd id 1:6 + +fix 1 all nvt temp 275.0 275.0 100.0 tchain 1 +fix 0 tmd tmd 0.1 tmd.target 100 tmd.log +fix 2 all shake 0.0001 10 100 b 4 6 8 10 12 14 18 a 31 + +group peptide type <= 12 + +#dump 1 peptide atom 10 dump.peptide + +#dump 2 peptide image 25 image.*.jpg type type & +# axes yes 0.8 0.02 view 60 -30 bond atom 0.5 +#dump_modify 2 pad 3 + +#dump 3 peptide movie 25 movie.mpg type type & +# axes yes 0.8 0.02 view 60 -30 bond atom 0.5 +#dump_modify 3 pad 3 + +#compute bnd all property/local btype batom1 batom2 +#dump 2 peptide local 300 dump.bond index c_bnd[1] c_bnd[2] c_bnd[3] + +run 300 + diff --git a/examples/PACKAGES/tmd/log.31Mar22.tmd.g++.1 b/examples/PACKAGES/tmd/log.31Mar22.tmd.g++.1 new file mode 100644 index 0000000000..ff290e55c6 --- /dev/null +++ b/examples/PACKAGES/tmd/log.31Mar22.tmd.g++.1 @@ -0,0 +1,210 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Solvated 5-mer peptide + +units real +atom_style full + +pair_style lj/charmm/coul/long 8.0 10.0 10.0 +bond_style harmonic +angle_style charmm +dihedral_style charmm +improper_style harmonic +kspace_style pppm 0.0001 + +read_data data.peptide +Reading data file ... + orthogonal box = (36.840194 41.013691 29.768095) to (64.21156 68.385058 57.139462) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 2004 atoms + reading velocities ... + 2004 velocities + scanning bonds ... + 3 = max bonds/atom + scanning angles ... + 6 = max angles/atom + scanning dihedrals ... + 14 = max dihedrals/atom + scanning impropers ... + 1 = max impropers/atom + reading bonds ... + 1365 bonds + reading angles ... + 786 angles + reading dihedrals ... + 207 dihedrals + reading impropers ... + 12 impropers +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 4 = max # of 1-2 neighbors + 7 = max # of 1-3 neighbors + 14 = max # of 1-4 neighbors + 18 = max # of special neighbors + special bonds CPU = 0.001 seconds + read_data CPU = 0.011 seconds + +neighbor 2.0 bin +neigh_modify delay 5 + +timestep 2.0 + +thermo_style multi +thermo 50 + +group tmd id 1:6 +6 atoms in group tmd + +fix 1 all nvt temp 275.0 275.0 100.0 tchain 1 +fix 0 tmd tmd 0.1 tmd.target 100 tmd.log +Reading TMD target file tmd.target ... +fix 2 all shake 0.0001 10 100 b 4 6 8 10 12 14 18 a 31 + 19 = # of size 2 clusters + 6 = # of size 3 clusters + 3 = # of size 4 clusters + 640 = # of frozen angles + find clusters CPU = 0.000 seconds + +group peptide type <= 12 +84 atoms in group peptide + +#dump 1 peptide atom 10 dump.peptide + +#dump 2 peptide image 25 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 bond atom 0.5 +#dump_modify 2 pad 3 + +#dump 3 peptide movie 25 movie.mpg type type # axes yes 0.8 0.02 view 60 -30 bond atom 0.5 +#dump_modify 3 pad 3 + +#compute bnd all property/local btype batom1 batom2 +#dump 2 peptide local 300 dump.bond index c_bnd[1] c_bnd[2] c_bnd[3] + +run 300 +PPPM initialization ... + using 12-bit tables for long-range coulomb (src/kspace.cpp:340) + G vector (1/distance) = 0.26872465 + grid = 15 15 15 + stencil order = 5 + estimated absolute RMS force accuracy = 0.022820853 + estimated relative force accuracy = 6.872432e-05 + using double precision FFTW3 + 3d grid and FFT values/proc = 10648 3375 + generated 91 of 91 mixed pair_coeff terms from arithmetic mixing rule +Neighbor list info ... + update every 1 steps, delay 5 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 5 5 5 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/charmm/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +SHAKE stats (type/ave/delta/count) on step 0 +Bond: 4 1.111 1.44264e-05 9 +Bond: 6 0.996998 7.26967e-06 6 +Bond: 8 1.08 1.32536e-05 9 +Bond: 10 1.111 1.22749e-05 8 +Bond: 12 1.08 1.11767e-05 9 +Bond: 14 0.96 0 1 +Bond: 18 0.957206 4.37979e-05 1280 +Angle: 31 104.519 0.00396029 640 +Per MPI rank memory allocation (min/avg/max) = 19.78 | 19.78 | 19.78 Mbytes +------------ Step 0 ----- CPU = 0 (sec) ------------- +TotEng = -5237.4580 KinEng = 1134.9186 Temp = 282.1005 +PotEng = -6372.3766 E_bond = 16.5572 E_angle = 36.3726 +E_dihed = 15.5190 E_impro = 1.9426 E_vdwl = 692.8945 +E_coul = 26772.2646 E_long = -33907.9271 Press = -837.0112 +------------ Step 50 ----- CPU = 0.6301453 (sec) ------------- +TotEng = -5001.6799 KinEng = 1319.3760 Temp = 327.9501 +PotEng = -6321.0559 E_bond = 17.4415 E_angle = 42.4509 +E_dihed = 25.0839 E_impro = 4.4025 E_vdwl = 725.7619 +E_coul = 26771.0015 E_long = -33907.1980 Press = -1.1409 +SHAKE stats (type/ave/delta/count) on step 100 +Bond: 4 1.11096 0.000146572 9 +Bond: 6 0.996997 7.55911e-06 6 +Bond: 8 1.08 8.22449e-06 9 +Bond: 10 1.11099 3.00424e-05 8 +Bond: 12 1.08 6.53505e-06 9 +Bond: 14 0.95999 0 1 +Bond: 18 0.957195 4.74892e-05 1280 +Angle: 31 104.52 0.00446577 640 +------------ Step 100 ----- CPU = 1.251267 (sec) ------------- +TotEng = -5114.3221 KinEng = 1168.2996 Temp = 290.3979 +PotEng = -6282.6217 E_bond = 45.5470 E_angle = 87.5725 +E_dihed = 26.1332 E_impro = 1.8662 E_vdwl = 791.5291 +E_coul = 26670.6791 E_long = -33905.9488 Press = -29.3446 +------------ Step 150 ----- CPU = 1.869158 (sec) ------------- +TotEng = -5302.3058 KinEng = 1211.4300 Temp = 301.1186 +PotEng = -6513.7358 E_bond = 51.4069 E_angle = 82.5752 +E_dihed = 31.1298 E_impro = 4.3390 E_vdwl = 764.0550 +E_coul = 26461.8974 E_long = -33909.1392 Press = -1204.2714 +SHAKE stats (type/ave/delta/count) on step 200 +Bond: 4 1.11094 0.000292869 9 +Bond: 6 0.996989 3.13206e-05 6 +Bond: 8 1.07999 4.4723e-05 9 +Bond: 10 1.111 1.08895e-05 8 +Bond: 12 1.07999 1.42694e-05 9 +Bond: 14 0.959976 0 1 +Bond: 18 0.957195 8.58256e-05 1280 +Angle: 31 104.52 0.00597861 640 +------------ Step 200 ----- CPU = 2.48933 (sec) ------------- +TotEng = -5785.4658 KinEng = 1048.7220 Temp = 260.6751 +PotEng = -6834.1879 E_bond = 21.7304 E_angle = 48.3249 +E_dihed = 20.5973 E_impro = 2.0603 E_vdwl = 818.9175 +E_coul = 26165.9672 E_long = -33911.7854 Press = -1228.5741 +------------ Step 250 ----- CPU = 3.119859 (sec) ------------- +TotEng = -6108.4578 KinEng = 828.5247 Temp = 205.9419 +PotEng = -6936.9825 E_bond = 26.5971 E_angle = 68.2771 +E_dihed = 36.1232 E_impro = 5.2092 E_vdwl = 884.1147 +E_coul = 25955.7300 E_long = -33913.0338 Press = -1365.4744 +SHAKE stats (type/ave/delta/count) on step 300 +Bond: 4 1.11174 0.0109853 9 +Bond: 6 0.996999 1.94772e-06 6 +Bond: 8 1.08 3.97091e-06 9 +Bond: 10 1.111 2.52635e-06 8 +Bond: 12 1.08 1.24444e-06 9 +Bond: 14 0.96 0 1 +Bond: 18 0.9572 1.22873e-05 1280 +Angle: 31 104.52 0.00134864 640 +------------ Step 300 ----- CPU = 3.74524 (sec) ------------- +TotEng = -5492.5012 KinEng = 1315.6902 Temp = 327.0339 +PotEng = -6808.1914 E_bond = 88.7967 E_angle = 104.4231 +E_dihed = 28.2383 E_impro = 43.5062 E_vdwl = 992.5311 +E_coul = 25849.1502 E_long = -33914.8370 Press = 268.8004 +Loop time of 3.74527 on 1 procs for 300 steps with 2004 atoms + +Performance: 13.841 ns/day, 1.734 hours/ns, 80.101 timesteps/s +99.9% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.9399 | 2.9399 | 2.9399 | 0.0 | 78.50 +Bond | 0.0069522 | 0.0069522 | 0.0069522 | 0.0 | 0.19 +Kspace | 0.25203 | 0.25203 | 0.25203 | 0.0 | 6.73 +Neigh | 0.48624 | 0.48624 | 0.48624 | 0.0 | 12.98 +Comm | 0.016948 | 0.016948 | 0.016948 | 0.0 | 0.45 +Output | 0.00023689 | 0.00023689 | 0.00023689 | 0.0 | 0.01 +Modify | 0.039476 | 0.039476 | 0.039476 | 0.0 | 1.05 +Other | | 0.003502 | | | 0.09 + +Nlocal: 2004 ave 2004 max 2004 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 11242 ave 11242 max 11242 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 710782 ave 710782 max 710782 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 710782 +Ave neighs/atom = 354.68164 +Ave special neighs/atom = 2.3403194 +Neighbor list builds = 32 +Dangerous builds = 1 + +Total wall time: 0:00:03 diff --git a/examples/PACKAGES/tmd/log.31Mar22.tmd.g++.4 b/examples/PACKAGES/tmd/log.31Mar22.tmd.g++.4 new file mode 100644 index 0000000000..c38f5ae7bb --- /dev/null +++ b/examples/PACKAGES/tmd/log.31Mar22.tmd.g++.4 @@ -0,0 +1,210 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# Solvated 5-mer peptide + +units real +atom_style full + +pair_style lj/charmm/coul/long 8.0 10.0 10.0 +bond_style harmonic +angle_style charmm +dihedral_style charmm +improper_style harmonic +kspace_style pppm 0.0001 + +read_data data.peptide +Reading data file ... + orthogonal box = (36.840194 41.013691 29.768095) to (64.21156 68.385058 57.139462) + 1 by 2 by 2 MPI processor grid + reading atoms ... + 2004 atoms + reading velocities ... + 2004 velocities + scanning bonds ... + 3 = max bonds/atom + scanning angles ... + 6 = max angles/atom + scanning dihedrals ... + 14 = max dihedrals/atom + scanning impropers ... + 1 = max impropers/atom + reading bonds ... + 1365 bonds + reading angles ... + 786 angles + reading dihedrals ... + 207 dihedrals + reading impropers ... + 12 impropers +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 0 0 + special bond factors coul: 0 0 0 + 4 = max # of 1-2 neighbors + 7 = max # of 1-3 neighbors + 14 = max # of 1-4 neighbors + 18 = max # of special neighbors + special bonds CPU = 0.000 seconds + read_data CPU = 0.017 seconds + +neighbor 2.0 bin +neigh_modify delay 5 + +timestep 2.0 + +thermo_style multi +thermo 50 + +group tmd id 1:6 +6 atoms in group tmd + +fix 1 all nvt temp 275.0 275.0 100.0 tchain 1 +fix 0 tmd tmd 0.1 tmd.target 100 tmd.log +Reading TMD target file tmd.target ... +fix 2 all shake 0.0001 10 100 b 4 6 8 10 12 14 18 a 31 + 19 = # of size 2 clusters + 6 = # of size 3 clusters + 3 = # of size 4 clusters + 640 = # of frozen angles + find clusters CPU = 0.000 seconds + +group peptide type <= 12 +84 atoms in group peptide + +#dump 1 peptide atom 10 dump.peptide + +#dump 2 peptide image 25 image.*.jpg type type # axes yes 0.8 0.02 view 60 -30 bond atom 0.5 +#dump_modify 2 pad 3 + +#dump 3 peptide movie 25 movie.mpg type type # axes yes 0.8 0.02 view 60 -30 bond atom 0.5 +#dump_modify 3 pad 3 + +#compute bnd all property/local btype batom1 batom2 +#dump 2 peptide local 300 dump.bond index c_bnd[1] c_bnd[2] c_bnd[3] + +run 300 +PPPM initialization ... + using 12-bit tables for long-range coulomb (src/kspace.cpp:340) + G vector (1/distance) = 0.26872465 + grid = 15 15 15 + stencil order = 5 + estimated absolute RMS force accuracy = 0.022820853 + estimated relative force accuracy = 6.872432e-05 + using double precision FFTW3 + 3d grid and FFT values/proc = 4312 960 + generated 91 of 91 mixed pair_coeff terms from arithmetic mixing rule +Neighbor list info ... + update every 1 steps, delay 5 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 12 + ghost atom cutoff = 12 + binsize = 6, bins = 5 5 5 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/charmm/coul/long, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +SHAKE stats (type/ave/delta/count) on step 0 +Bond: 4 1.111 1.44264e-05 9 +Bond: 6 0.996998 7.26967e-06 6 +Bond: 8 1.08 1.32536e-05 6 +Bond: 10 1.111 1.22749e-05 8 +Bond: 12 1.08 1.11767e-05 9 +Bond: 14 0.96 0 1 +Bond: 18 0.957206 4.37979e-05 1280 +Angle: 31 104.519 0.00396029 640 +Per MPI rank memory allocation (min/avg/max) = 16.78 | 16.97 | 17.16 Mbytes +------------ Step 0 ----- CPU = 0 (sec) ------------- +TotEng = -5237.4580 KinEng = 1134.9186 Temp = 282.1005 +PotEng = -6372.3766 E_bond = 16.5572 E_angle = 36.3726 +E_dihed = 15.5190 E_impro = 1.9426 E_vdwl = 692.8945 +E_coul = 26772.2646 E_long = -33907.9271 Press = -837.0112 +------------ Step 50 ----- CPU = 0.1916178 (sec) ------------- +TotEng = -5001.6799 KinEng = 1319.3760 Temp = 327.9501 +PotEng = -6321.0559 E_bond = 17.4415 E_angle = 42.4509 +E_dihed = 25.0839 E_impro = 4.4025 E_vdwl = 725.7619 +E_coul = 26771.0015 E_long = -33907.1980 Press = -1.1409 +SHAKE stats (type/ave/delta/count) on step 100 +Bond: 4 1.11096 0.000146572 9 +Bond: 6 0.996997 7.55911e-06 6 +Bond: 8 1.08 8.22449e-06 6 +Bond: 10 1.11099 3.00424e-05 8 +Bond: 12 1.08 6.53505e-06 9 +Bond: 14 0.95999 0 1 +Bond: 18 0.957195 4.74892e-05 1280 +Angle: 31 104.52 0.00446577 640 +------------ Step 100 ----- CPU = 0.3672111 (sec) ------------- +TotEng = -5114.3221 KinEng = 1168.2996 Temp = 290.3979 +PotEng = -6282.6217 E_bond = 45.5470 E_angle = 87.5725 +E_dihed = 26.1332 E_impro = 1.8662 E_vdwl = 791.5291 +E_coul = 26670.6792 E_long = -33905.9488 Press = -29.3446 +------------ Step 150 ----- CPU = 0.5543252 (sec) ------------- +TotEng = -5302.3058 KinEng = 1211.4300 Temp = 301.1186 +PotEng = -6513.7358 E_bond = 51.4069 E_angle = 82.5752 +E_dihed = 31.1298 E_impro = 4.3390 E_vdwl = 764.0550 +E_coul = 26461.8975 E_long = -33909.1392 Press = -1204.2714 +SHAKE stats (type/ave/delta/count) on step 200 +Bond: 4 1.11094 0.000292869 9 +Bond: 6 0.996989 3.13206e-05 6 +Bond: 8 1.07999 4.4723e-05 6 +Bond: 10 1.111 1.08895e-05 8 +Bond: 12 1.07999 1.42694e-05 9 +Bond: 14 0.959976 0 1 +Bond: 18 0.957195 8.58257e-05 1280 +Angle: 31 104.52 0.00597861 640 +------------ Step 200 ----- CPU = 0.7449468 (sec) ------------- +TotEng = -5785.4658 KinEng = 1048.7220 Temp = 260.6751 +PotEng = -6834.1878 E_bond = 21.7304 E_angle = 48.3249 +E_dihed = 20.5973 E_impro = 2.0603 E_vdwl = 818.9173 +E_coul = 26165.9673 E_long = -33911.7854 Press = -1228.5754 +------------ Step 250 ----- CPU = 0.9417257 (sec) ------------- +TotEng = -6108.4577 KinEng = 828.5246 Temp = 205.9418 +PotEng = -6936.9823 E_bond = 26.5971 E_angle = 68.2771 +E_dihed = 36.1232 E_impro = 5.2092 E_vdwl = 884.1146 +E_coul = 25955.7302 E_long = -33913.0338 Press = -1365.4736 +SHAKE stats (type/ave/delta/count) on step 300 +Bond: 4 1.11174 0.0109854 9 +Bond: 6 0.996999 1.94775e-06 6 +Bond: 8 1.08 3.97089e-06 6 +Bond: 10 1.111 2.52634e-06 8 +Bond: 12 1.08 1.24445e-06 9 +Bond: 14 0.96 0 1 +Bond: 18 0.9572 1.22873e-05 1280 +Angle: 31 104.52 0.0013486 640 +------------ Step 300 ----- CPU = 1.137003 (sec) ------------- +TotEng = -5492.5016 KinEng = 1315.6899 Temp = 327.0339 +PotEng = -6808.1915 E_bond = 88.7968 E_angle = 104.4228 +E_dihed = 28.2384 E_impro = 43.5061 E_vdwl = 992.5315 +E_coul = 25849.1499 E_long = -33914.8370 Press = 268.8010 +Loop time of 1.13706 on 4 procs for 300 steps with 2004 atoms + +Performance: 45.591 ns/day, 0.526 hours/ns, 263.838 timesteps/s +99.5% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.75407 | 0.80373 | 0.84144 | 3.6 | 70.68 +Bond | 0.0010088 | 0.0024668 | 0.0045274 | 2.6 | 0.22 +Kspace | 0.095468 | 0.13434 | 0.18276 | 8.9 | 11.81 +Neigh | 0.13509 | 0.13515 | 0.13522 | 0.0 | 11.89 +Comm | 0.024217 | 0.025086 | 0.026404 | 0.5 | 2.21 +Output | 0.00020952 | 0.00023591 | 0.00031389 | 0.0 | 0.02 +Modify | 0.033319 | 0.033374 | 0.033436 | 0.0 | 2.94 +Other | | 0.00268 | | | 0.24 + +Nlocal: 501 ave 530 max 459 min +Histogram: 1 0 0 0 0 0 1 1 0 1 +Nghost: 6562.75 ave 6755 max 6370 min +Histogram: 1 0 0 0 1 1 0 0 0 1 +Neighs: 177696 ave 195050 max 158403 min +Histogram: 1 0 0 1 0 0 0 1 0 1 + +Total # of neighbors = 710782 +Ave neighs/atom = 354.68164 +Ave special neighs/atom = 2.3403194 +Neighbor list builds = 32 +Dangerous builds = 1 + +Total wall time: 0:00:01 diff --git a/examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.1 b/examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.1 new file mode 100644 index 0000000000..6b1732cb2a --- /dev/null +++ b/examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.1 @@ -0,0 +1,4 @@ +# Step rho_target rho_old gamma_back gamma_forward lambda work_lambda work_analytical +100 11.580338717125848 11.637740410711476 0.00432656530431019 -0.0006058453921097923 1295.0393774041895 -7808.460018545273 562.4687334224966 +200 5.840169358562925 5.897571052148553 0.009256742629063092 -0.0004765379201060169 1404.114149312145 -15441.509720360129 1352.9255849946983 +300 0.10000000000000142 0.15740169358562994 -0.030035833473071705 -0.5643261296323345 -121.59623659080042 -22929.738462520727 2299.6676396746325 diff --git a/examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.4 b/examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.4 new file mode 100644 index 0000000000..17188a756a --- /dev/null +++ b/examples/PACKAGES/tmd/tmd.log.31Mar22.tmd.g++.4 @@ -0,0 +1,4 @@ +# Step rho_target rho_old gamma_back gamma_forward lambda work_lambda work_analytical +100 11.580338717125848 11.637740410711476 0.004326565303381905 -0.0006058453930379918 1295.0393771263327 -7808.46001855425 562.4687334073235 +200 5.840169358562925 5.897571052148553 0.009256742652188668 -0.0004765378969710561 1404.114152819961 -15441.50972264099 1352.9255825827688 +300 0.10000000000000142 0.15740169358562994 -0.03003651537895091 -0.5643268572640833 -121.59899719968097 -22929.73877163682 2299.6674130478946 diff --git a/examples/PACKAGES/tmd/tmd.target b/examples/PACKAGES/tmd/tmd.target new file mode 100644 index 0000000000..e83cebb32c --- /dev/null +++ b/examples/PACKAGES/tmd/tmd.target @@ -0,0 +1,13 @@ +# pull a few peptide atoms across the box + 36.840194 64.211560 xlo xhi + 41.013691 68.385058 ylo yhi + 29.768095 57.139462 zlo zhi # comment +# comment + 1 53.99993 48.52678 46.78550 0 0 0 + 2 55.10395 48.23499 45.86693 0 0 0 + 3 53.81519 49.54928 47.43995 0 0 0 + 4 55.71714 47.34797 46.13434 0 0 0 + 5 55.72261 49.13657 45.67007 0 0 0 + 6 54.66624 48.09539 44.85538 0 0 0 + 7 53.28193 47.47427 46.91953 0 0 0 + 8 52.07157 47.45486 47.62418 0 0 0 diff --git a/examples/README b/examples/README index f0396730a6..8d0d7cf1c9 100644 --- a/examples/README +++ b/examples/README @@ -83,9 +83,9 @@ indent: spherical indenter into a 2d solid kim: use of potentials in Knowledge Base for Interatomic Models (KIM) latte: use of LATTE density-functional tight-binding quantum code mc: MC package models: GCMC, Widom, fix mol/swap +mdi: use of the MDI package and MolSSI MDI code coupling library meam: MEAM test for SiC and shear (same as shear examples) melt: rapid melt of 3d LJ system -message: client/server coupling of 2 codes micelle: self-assembly of small lipid-like molecules into 2d bilayers min: energy minimization of 2d LJ melt mliap: examples for using several bundled MLIAP potentials @@ -118,6 +118,7 @@ ttm: two-temeperature model examples vashishta: models using the Vashishta potential voronoi: Voronoi tesselation via compute voronoi/atom command wall: use of reflective walls with different stochastic models +yaml: demonstrates use of yaml thermo and dump styles Here is how you might run and visualize one of the sample problems: diff --git a/examples/bpm/impact/brokenDump b/examples/bpm/impact/brokenDump new file mode 100644 index 0000000000..ef78518c91 --- /dev/null +++ b/examples/bpm/impact/brokenDump @@ -0,0 +1,3173 @@ +276 5469 5471 +288 1815 1931 +290 1810 1815 +293 1815 1816 +295 5350 5351 +300 1813 1815 +288 1815 1931 +276 5469 5471 +278 5475 5477 +283 5349 5350 +287 5470 5477 +290 5472 5477 +292 5350 5352 +294 5477 5478 +295 5350 5351 +305 1702 1704 +308 1705 5351 +313 1699 1704 +324 1820 5471 +327 1813 1814 +332 1937 1938 +339 5228 5349 +350 1811 1818 +353 1817 5348 +361 1588 1700 +362 1700 5348 +364 1817 5469 +368 1700 5228 +368 1704 1819 +372 1817 5467 +373 5351 5470 +374 1701 1818 +374 1817 5468 +377 1584 1694 +380 5231 5349 +383 1588 5349 +383 5231 5350 +386 1458 1574 +388 1811 1812 +399 1464 1580 +399 1817 1822 +306 1938 5471 +308 1928 1933 +309 1933 1934 +310 1933 2048 +311 5712 5830 +313 1931 1933 +332 1937 1938 +333 1938 1939 +333 2056 2171 +338 1938 1940 +340 2172 2174 +352 2172 5712 +353 2056 2057 +355 2056 2172 +359 5712 5831 +362 2057 2169 +367 1932 1938 +368 2052 5709 +372 2052 2053 +375 5712 5713 +375 2172 2173 +377 2174 2286 +385 5711 5712 +385 2169 5709 +386 1935 1936 +387 2054 2055 +387 2169 5829 +398 2277 2278 +399 2057 2171 +303 5232 5350 +303 5477 5595 +304 5352 5470 +306 1938 5471 +306 5483 5484 +312 5350 5355 +312 5481 5483 +312 5471 5591 +316 5471 5590 +318 5357 5470 +324 1820 5471 +330 5470 5475 +331 5354 5473 +332 5476 5481 +332 5471 5589 +332 5483 5601 +339 5228 5349 +341 5473 5474 +343 5358 5476 +346 5349 5352 +346 5355 5357 +347 5237 5350 +350 5357 5358 +351 5354 5467 +353 1817 5348 +358 5348 5467 +362 1700 5348 +362 5601 5602 +366 5470 5471 +367 5472 5475 +371 5476 5477 +372 1817 5467 +372 5480 5593 +373 5351 5470 +373 5601 5603 +374 1817 5468 +380 5231 5349 +383 1588 5349 +383 5231 5350 +387 5478 5481 +388 5234 5353 +389 5596 5601 +397 5484 5486 +400 5593 5601 +303 5477 5595 +311 5712 5830 +312 5471 5591 +316 5471 5590 +319 5717 5719 +325 5831 5833 +332 5471 5589 +349 5603 5604 +355 5717 5722 +359 5712 5831 +368 2052 5709 +370 5720 5722 +372 5480 5593 +372 5600 5603 +373 5600 5604 +373 5601 5603 +374 5587 5594 +375 5712 5713 +379 5588 5708 +381 5600 5714 +383 5720 5721 +385 5711 5712 +385 2169 5709 +387 2169 5829 +388 5722 5723 +391 5828 5829 +394 5833 5948 +398 5710 5712 +400 5593 5601 +401 1820 1822 +403 1817 1819 +404 1586 1588 +405 1569 1685 +410 1821 1938 +411 1822 5469 +412 1568 1575 +413 1822 1937 +421 1699 1819 +421 5232 5349 +422 1704 1814 +423 1582 1584 +431 1565 1572 +431 1578 1688 +431 1812 1929 +433 5469 5472 +435 1467 1585 +442 1809 1810 +448 1685 1692 +448 1698 1808 +451 1703 5349 +454 1563 1679 +454 1935 1937 +455 1703 5351 +457 1582 1694 +458 1813 1816 +459 1695 1805 +460 1926 1927 +461 1699 1814 +468 1810 1816 +471 1814 1819 +476 1701 1819 +478 1566 1682 +480 1818 1929 +481 1920 1925 +482 1580 1587 +485 5468 5469 +486 1689 1805 +490 1457 1464 +490 1806 1810 +493 1587 1588 +493 1814 1816 +497 1682 1689 +498 1699 1816 +500 1688 1805 +500 1689 1695 +402 2049 2051 +402 2054 2057 +410 1821 1938 +416 2052 5588 +417 2055 2056 +420 1939 2049 +423 1923 1930 +423 2161 2271 +426 2050 2160 +431 1812 1929 +431 2044 2154 +437 2284 2393 +441 1940 2054 +441 2174 5832 +442 2166 2173 +448 1927 1928 +449 2286 5949 +451 2163 2170 +452 2037 2038 +457 2396 2397 +460 1926 1927 +461 1936 2046 +461 2406 2513 +464 1930 1934 +465 2055 5712 +471 1931 1934 +473 1940 5710 +474 2154 2159 +475 2274 2275 +477 1933 2049 +478 1923 2040 +479 2037 2039 +479 2399 2400 +480 1818 1929 +481 1920 1925 +482 1930 2048 +482 2039 2042 +482 2164 2280 +482 2174 5830 +485 1930 1931 +486 1930 1936 +486 2046 2053 +487 1928 1930 +488 2167 2283 +495 2156 2159 +498 1928 1934 +403 5368 5369 +407 5484 5601 +409 5601 5604 +412 5232 5352 +414 5476 5596 +416 5123 5236 +419 5484 5602 +421 5232 5349 +421 5472 5595 +422 5129 5242 +425 5362 5363 +426 5347 5354 +426 5352 5355 +430 5246 5359 +433 5469 5472 +434 5481 5484 +437 5135 5248 +438 5365 5366 +439 5358 5478 +439 5483 5596 +441 5362 5369 +450 5363 5482 +450 5484 5487 +456 5484 5607 +458 5480 5599 +459 5242 5243 +461 5235 5236 +463 5479 5486 +464 5482 5483 +467 5234 5347 +467 5361 5362 +469 5232 5355 +470 5474 5475 +474 5116 5117 +475 5356 5363 +480 5234 5240 +481 5485 5487 +484 5480 5484 +485 5468 5469 +488 5476 5478 +493 5233 5238 +494 5356 5361 +495 5118 5238 +496 5363 5483 +497 5018 5128 +498 5233 5240 +500 5370 5488 +406 5591 5711 +406 5722 5724 +406 5969 5976 +407 5721 5725 +408 5600 5720 +409 5601 5604 +413 5597 5717 +419 5970 6089 +421 5472 5595 +421 6074 6081 +425 5719 5722 +425 5964 6083 +426 5594 5598 +426 5831 5838 +429 5840 5841 +436 5833 5838 +437 5724 5843 +439 5593 5595 +441 5951 5958 +444 5830 5831 +446 5713 5831 +449 5831 5951 +449 2286 5949 +453 5722 5725 +453 5709 5829 +454 5599 5600 +454 5591 5710 +455 5834 5842 +458 5480 5599 +459 5724 5837 +462 5589 5592 +462 6084 6202 +464 5598 5603 +465 2055 5712 +472 5954 5955 +473 1940 5710 +476 5594 5708 +477 5856 5975 +482 2174 5830 +482 5844 5963 +484 5714 5721 +488 5592 5708 +490 6083 6090 +501 1802 1807 +503 1805 1807 +504 1689 1806 +507 1569 1679 +507 1693 1805 +510 1688 1693 +511 1575 1690 +518 1799 1807 +520 1227 1340 +521 1803 1804 +522 1347 1463 +525 1575 1691 +528 1804 1925 +529 1581 1697 +531 1446 1562 +531 1573 1576 +535 1574 1575 +536 1802 1809 +548 1692 1693 +552 1693 1807 +553 1575 1692 +553 1819 1821 +555 1699 1813 +560 1922 1925 +569 5109 5111 +569 1705 1819 +576 1570 1690 +580 1808 1809 +584 1581 1696 +586 1471 5111 +589 1459 1576 +599 1702 1705 +502 2160 2167 +503 1922 1924 +503 2036 2037 +504 1922 2037 +504 2169 5830 +505 2057 2174 +505 2168 2283 +507 1924 2040 +507 2281 2390 +514 2162 2167 +514 2167 2168 +515 1929 1934 +515 2044 2159 +524 1929 1936 +530 2165 2167 +536 2167 2282 +549 2158 2274 +549 2519 2520 +560 1922 1925 +560 2035 2039 +560 2158 2276 +561 2289 5832 +562 1932 1939 +562 2263 2372 +567 2041 2157 +567 2381 2382 +581 1920 2037 +583 1920 1927 +583 5950 5953 +586 2042 2045 +593 5951 5952 +596 5833 5950 +600 2158 2159 +502 5254 5255 +507 5232 5237 +508 5473 5478 +511 5239 5240 +512 5111 5112 +513 5233 5353 +519 4901 5011 +519 5012 5122 +522 5235 5238 +522 5240 5241 +523 5260 5261 +523 5364 5369 +525 5490 5608 +528 5237 5238 +538 5479 5480 +542 5488 5493 +553 5611 5613 +555 5246 5365 +555 5489 5608 +557 4895 5005 +561 5481 5601 +564 5140 5141 +569 5109 5111 +571 5114 5235 +572 5488 5495 +573 5230 5237 +582 5490 5492 +584 5024 5134 +586 1471 5111 +587 5244 5367 +587 5352 5354 +587 5490 5495 +591 5486 5599 +594 5347 5348 +502 5959 6077 +504 2169 5830 +507 5606 5726 +519 5835 5948 +521 5967 6086 +523 5733 5852 +524 5719 5842 +529 5609 5728 +529 5833 5836 +541 5956 5958 +541 5968 5971 +547 5717 5723 +549 5961 6074 +551 6071 6190 +553 5611 5613 +554 5588 5710 +558 5594 5714 +559 5592 5713 +561 5481 5601 +564 5970 6083 +568 5853 5972 +569 5592 5716 +574 5606 5727 +574 5835 5955 +579 5592 5710 +583 5950 5953 +590 5855 5862 +591 5486 5599 +591 5718 5831 +593 5951 5952 +596 5605 5726 +596 5833 5950 +602 1820 1821 +603 1461 1571 +606 1683 1793 +607 1808 1815 +609 1322 1329 +610 1583 1585 +615 1576 1579 +616 1699 1811 +621 1557 1673 +622 1583 5229 +630 1468 1470 +634 1470 1471 +634 5111 5229 +635 1469 1471 +635 1469 1586 +639 1572 1576 +639 1698 1814 +639 1809 1926 +644 5229 5230 +645 1588 1702 +649 1690 1693 +652 1696 1813 +656 1574 1579 +657 1693 1813 +658 1819 1820 +659 1467 1577 +661 1455 1565 +669 1695 1811 +677 1100 1107 +678 1221 1334 +679 1433 1440 +679 1688 1696 +680 1687 1807 +682 1812 1816 +683 1689 1799 +689 1585 5229 +690 1701 1811 +692 1007 1014 +693 1466 1471 +696 1328 1335 +699 1582 1585 +601 1928 2048 +606 2619 2620 +610 2162 2165 +613 2387 2388 +615 2040 2047 +615 2266 2375 +619 2039 2159 +622 2053 2057 +624 2151 2156 +626 2053 2171 +627 2169 2174 +627 2287 2402 +628 2172 5830 +629 2291 2402 +634 2619 2621 +637 2034 2042 +639 1809 1926 +641 2613 2614 +646 1924 2034 +649 2145 2152 +649 2136 2137 +652 2626 2730 +653 2148 2155 +654 1932 1933 +655 1934 2048 +656 2501 2502 +660 2274 2276 +662 2253 2254 +672 1934 1937 +673 2369 2370 +675 2146 2262 +678 1917 1924 +685 2052 2054 +689 1929 1930 +697 1917 2034 +700 2057 5709 +604 5611 5618 +605 4907 5017 +611 5244 5359 +628 5245 5252 +634 5111 5229 +644 5229 5230 +647 5023 5024 +648 5012 5128 +651 4897 4898 +658 5111 5230 +659 5267 5380 +660 5608 5613 +661 5602 5603 +667 5236 5238 +675 5159 5272 +675 5247 5250 +681 5604 5607 +684 5386 5387 +684 5475 5478 +603 5953 5956 +604 5611 5618 +605 6076 6078 +617 6440 6447 +622 5716 5717 +625 5966 5973 +627 5956 6076 +628 2172 5830 +631 6071 6078 +634 5610 5612 +640 5592 5598 +643 5595 5598 +645 5599 5604 +646 5987 5994 +647 5610 5615 +648 5959 6076 +658 5605 5606 +658 5729 5734 +660 5608 5613 +661 5602 5603 +662 5593 5598 +664 6331 6338 +676 5615 5734 +681 5604 5607 +689 5726 5727 +690 5603 5723 +690 5604 5723 +690 5833 5953 +691 5867 5874 +694 5598 5717 +697 5714 5716 +700 2057 5709 +701 1448 1449 +710 1810 1813 +711 1467 1583 +714 1574 1581 +727 1459 1573 +749 1453 1459 +753 1571 1573 +755 1442 1449 +755 1799 1806 +759 1661 1668 +759 1685 1690 +762 1453 1456 +764 1804 1920 +770 1571 1572 +772 1442 1448 +774 1581 1691 +778 1319 1326 +778 1699 1702 +778 1698 1813 +784 1587 1697 +788 1570 1576 +789 1684 1690 +791 1796 1803 +792 1106 1113 +794 1583 1586 +797 1335 1445 +797 5107 5109 +799 1451 1452 +800 1806 1809 +702 5829 5948 +704 1919 1920 +708 2376 2483 +711 2291 5949 +716 2037 2044 +721 2160 2162 +724 2489 2490 +728 1918 1919 +728 1927 2042 +730 2496 2601 +731 5832 5950 +732 1928 1931 +734 2279 2281 +738 2020 2130 +750 1918 2034 +752 2055 5710 +757 2608 2712 +764 1804 1920 +772 2276 2277 +773 2153 2156 +775 2275 2390 +783 2401 2403 +787 2286 5829 +791 1929 1937 +792 2035 2151 +798 1932 1934 +708 4793 4900 +709 5036 5146 +711 5243 5356 +724 5152 5153 +726 5239 5246 +733 5483 5602 +746 5245 5253 +754 5236 5243 +756 5245 5250 +758 5230 5232 +762 4919 5029 +764 5607 5610 +770 5347 5355 +771 5364 5487 +787 5234 5235 +789 5125 5132 +791 5364 5484 +797 5107 5109 +702 5829 5948 +703 5732 5734 +710 6227 6343 +711 2291 5949 +711 6221 6337 +719 5597 5711 +719 5846 5847 +725 5753 5760 +730 5618 5732 +731 5832 5950 +734 5853 5966 +734 6080 6081 +745 5958 6071 +751 6101 6108 +752 2055 5710 +754 5598 5601 +755 5721 5834 +755 6107 6114 +759 5965 6088 +764 5607 5610 +770 5725 5728 +771 5954 6074 +772 5963 5965 +774 5965 6082 +775 5845 5848 +793 6199 6200 +793 6446 6453 +795 5727 5840 +795 5961 6082 +799 5734 5737 +804 1454 1455 +805 1098 1211 +807 1687 1689 +809 1331 1332 +810 984 1094 +817 1332 1450 +820 1326 1442 +826 1442 1444 +827 1221 1333 +834 1911 1918 +846 1095 1208 +846 1821 1822 +851 1691 1692 +855 1800 1804 +858 1574 1580 +865 1338 1448 +867 995 1002 +871 1703 1704 +872 1196 1203 +872 1687 1799 +876 1819 1822 +880 1197 1310 +882 1332 1333 +883 881 989 +883 1687 1801 +886 1082 1089 +887 1587 1704 +887 1689 1807 +888 1704 5351 +890 1818 1937 +897 1690 1691 +804 1919 1922 +809 2149 2265 +824 1921 2037 +825 2052 5710 +834 1911 1918 +834 2041 2158 +835 2041 2045 +849 1921 2031 +856 2037 2042 +872 1917 1919 +888 5950 5952 +890 1818 1937 +803 5467 5468 +807 5011 5018 +808 5130 5250 +808 5254 5261 +813 5130 5253 +819 5131 5132 +819 5485 5492 +819 5488 5490 +834 4882 4883 +842 5364 5370 +845 5352 5467 +847 5227 5234 +848 5370 5490 +853 5125 5131 +855 5485 5493 +862 5020 5021 +863 5228 5348 +871 5599 5601 +874 5108 5114 +876 5366 5370 +878 5008 5015 +878 5369 5488 +879 5015 5133 +885 5021 5131 +888 1704 5351 +890 5125 5133 +890 5366 5485 +812 6081 6085 +814 5850 5968 +818 6452 6459 +819 5725 5730 +820 5723 5725 +825 2052 5710 +826 5604 5728 +832 5725 5842 +837 6102 6220 +846 5959 6082 +846 5973 6086 +861 6084 6201 +870 5598 5716 +871 5599 5601 +871 5725 5845 +871 6085 6201 +887 6233 6349 +892 6077 6196 +899 6337 6344 +903 1576 1578 +904 1336 1339 +909 1704 1705 +909 1806 1917 +913 1218 1325 +913 1700 1705 +923 1470 1586 +924 1304 1311 +929 880 887 +929 978 1088 +931 875 983 +934 1325 1330 +936 1459 1574 +940 1571 1576 +948 1695 1813 +950 1325 1332 +955 1821 1937 +962 1212 1325 +968 1421 1428 +970 1336 1450 +972 1816 1821 +974 1817 1818 +978 1076 1083 +980 1806 1807 +986 1577 1579 +987 1325 1333 +994 1457 1458 +995 1216 1328 +999 1214 1215 +1000 1810 1925 +904 2162 2277 +907 1923 1924 +907 2172 5832 +909 1806 1917 +909 2396 2403 +916 2291 6070 +917 2391 2504 +918 5829 5830 +919 2157 2158 +921 2405 5952 +923 1915 1916 +923 2259 2266 +940 2043 2050 +948 1913 1916 +951 2040 2048 +952 2279 2398 +955 1821 1937 +955 2405 2519 +964 2276 2282 +964 2498 2505 +967 2256 2263 +973 2043 2160 +979 1932 1937 +984 2390 2392 +998 2392 2395 +1000 1810 1925 +902 5132 5251 +904 5131 5251 +911 4786 4787 +922 5242 5249 +934 5360 5479 +939 5136 5138 +946 5488 5489 +969 5249 5362 +976 5364 5367 +979 5257 5259 +979 5257 5264 +981 5249 5368 +983 5243 5362 +988 5393 5506 +994 5248 5255 +906 5966 5974 +907 2172 5832 +916 2291 6070 +918 5829 5830 +926 6092 6093 +936 5600 5722 +936 5963 5968 +937 5963 5964 +940 5853 5974 +941 5851 5856 +946 5966 5971 +948 5858 5859 +951 5840 5960 +963 5847 5960 +966 5605 5612 +973 5838 5951 +979 5852 5857 +987 5851 5974 +988 5730 5843 +993 5841 5845 +994 6355 6362 +996 5851 5854 +997 5965 5968 +1007 1683 1801 +1015 1575 1581 +1016 1693 1696 +1017 1465 1582 +1018 1676 1677 +1019 1332 1336 +1024 1464 1574 +1026 1532 1539 +1027 1212 1319 +1036 1442 1559 +1042 1087 1090 +1043 1790 1797 +1044 1678 1681 +1044 1804 1919 +1059 1330 1444 +1059 1458 1568 +1066 1690 1692 +1071 1792 1905 +1073 1692 1807 +1074 1212 1216 +1077 1690 1807 +1080 1071 1184 +1083 1326 1436 +1090 1705 5469 +1098 1681 1684 +1003 2505 2610 +1004 2168 2288 +1013 2257 2372 +1029 2372 2373 +1037 2154 2161 +1037 2162 2168 +1040 2279 2282 +1044 1804 1919 +1050 1933 1939 +1055 2276 2279 +1064 2389 2506 +1071 1792 1905 +1073 2162 2282 +1078 2278 2392 +1084 2156 2161 +1085 6072 6190 +1089 2719 2820 +1014 5512 5513 +1019 5370 5487 +1026 5010 5013 +1032 5228 5347 +1032 5244 5362 +1033 5130 5135 +1059 5009 5013 +1064 5240 5244 +1070 5488 5608 +1076 5480 5481 +1078 5015 5016 +1085 5029 5030 +1088 5252 5253 +1089 5130 5133 +1090 5127 5128 +1090 1705 5469 +1091 5118 5241 +1094 5487 5490 +1096 5235 5237 +1002 6081 6199 +1004 5962 5964 +1008 5955 5956 +1010 5841 5847 +1011 5968 5969 +1014 5961 6080 +1015 5954 5961 +1016 6206 6316 +1018 5948 5956 +1020 6671 6678 +1022 5844 5845 +1023 5714 5715 +1023 5841 5842 +1032 5843 5844 +1032 5841 5844 +1033 5967 5968 +1038 5963 5969 +1039 5972 5973 +1041 6238 6245 +1044 5844 5962 +1048 5966 5968 +1052 5839 5841 +1053 6428 6435 +1054 5953 5958 +1056 5961 5967 +1060 6076 6079 +1071 6083 6084 +1071 6322 6323 +1072 5839 5954 +1082 6433 6435 +1085 6072 6190 +1088 5754 5873 +1088 5834 5841 +1097 5728 5729 +1098 5843 5849 +1102 1336 1456 +1113 1688 1695 +1117 1801 1802 +1118 731 738 +1118 1696 1698 +1121 1335 1450 +1132 1327 1330 +1136 1453 1455 +1139 1330 1442 +1139 1686 1801 +1142 646 653 +1149 1802 1803 +1155 1327 1444 +1157 953 960 +1158 1216 1327 +1169 1341 1451 +1173 643 650 +1176 1806 1923 +1178 1696 1699 +1181 552 652 +1184 1216 1330 +1185 1330 1335 +1186 1686 1796 +1198 640 647 +1101 2839 2937 +1102 2044 2160 +1107 2274 2279 +1112 6069 6073 +1114 2152 2268 +1128 1912 2028 +1131 2165 2168 +1144 2043 2048 +1148 2402 6068 +1152 2269 2384 +1156 2051 2171 +1159 2150 2270 +1174 2269 2378 +1176 1806 1923 +1176 2269 2386 +1181 2385 2492 +1193 2404 2407 +1194 2516 2521 +1198 1930 2046 +1199 2384 2385 +1103 5611 5616 +1105 5015 5019 +1111 5014 5021 +1113 5493 5496 +1114 4892 5010 +1115 5250 5253 +1127 4891 4892 +1128 5248 5250 +1131 5132 5245 +1133 5136 5259 +1133 5256 5371 +1135 5253 5256 +1139 5495 5496 +1142 4890 4892 +1144 4880 4884 +1146 5014 5022 +1156 5014 5016 +1157 5244 5249 +1159 5011 5128 +1163 5258 5377 +1164 4483 4582 +1174 4360 4361 +1174 5015 5131 +1176 5014 5019 +1178 5239 5247 +1179 5262 5265 +1181 5247 5249 +1187 4772 4885 +1187 5016 5019 +1187 5130 5248 +1190 4588 4589 +1194 4476 4477 +1200 5247 5248 +1103 5611 5616 +1103 6107 6108 +1105 6204 6207 +1111 6201 6202 +1112 6069 6073 +1112 6210 6324 +1114 5739 5860 +1128 5597 5716 +1135 5852 5858 +1141 6084 6090 +1148 2402 6068 +1148 6200 6204 +1150 5865 5978 +1150 6206 6323 +1152 5720 5727 +1157 5854 5857 +1160 5833 5951 +1168 5604 5606 +1168 5849 5850 +1173 6074 6075 +1175 5743 5860 +1180 5959 5962 +1181 5610 5728 +1190 5960 5967 +1195 5951 5956 +1195 6204 6318 +1212 641 743 +1212 1692 1808 +1213 1680 1796 +1215 557 564 +1216 664 671 +1216 737 744 +1220 1098 1205 +1231 1680 1681 +1234 1451 1457 +1237 1681 1795 +1245 1179 1292 +1247 1576 1690 +1249 1092 1199 +1249 1324 1436 +1254 473 480 +1260 468 563 +1260 551 558 +1260 1695 1696 +1265 1211 1212 +1265 1693 1695 +1269 1332 1442 +1272 1808 1810 +1277 1670 1677 +1280 1178 1185 +1287 1320 1430 +1289 1679 1685 +1291 1694 1696 +1294 1212 1218 +1294 1564 1678 +1296 844 851 +1297 549 649 +1298 1324 1438 +1298 1670 1675 +1210 2165 2171 +1211 2500 2506 +1214 2279 2284 +1227 6068 6069 +1233 2269 2273 +1233 2492 2499 +1235 2153 2270 +1248 2385 2498 +1258 2263 2378 +1267 2516 6187 +1268 2050 2166 +1268 2146 2264 +1268 3111 3198 +1269 1906 1907 +1272 2500 2501 +1273 2493 2604 +1277 2497 2499 +1277 2521 6306 +1280 2395 2398 +1283 2054 2171 +1283 2501 2508 +1292 2401 2407 +1295 2800 2898 +1299 3034 3125 +1201 5258 5379 +1203 4902 5014 +1204 5256 5258 +1207 5248 5249 +1209 4595 4698 +1213 5242 5362 +1214 4704 4705 +1214 4784 4897 +1216 5131 5133 +1220 4367 4464 +1222 5359 5360 +1231 5467 5475 +1232 5244 5361 +1234 4373 4470 +1234 5500 5501 +1235 4168 4255 +1239 5490 5613 +1244 5129 5247 +1254 5607 5608 +1255 5131 5136 +1260 4261 4262 +1262 5124 5241 +1262 5260 5262 +1271 5611 5612 +1272 5124 5129 +1273 5120 5241 +1281 5128 5129 +1282 5020 5027 +1283 5264 5265 +1286 5262 5267 +1293 4370 4467 +1296 4363 4364 +1299 4711 4816 +1202 5957 5958 +1203 5723 5728 +1214 5969 5971 +1215 6329 6437 +1217 5837 5842 +1220 5730 5848 +1221 5610 5731 +1221 5853 5854 +1227 5957 5959 +1227 6068 6069 +1228 6684 6791 +1230 6379 6386 +1230 6477 6590 +1230 6902 6909 +1236 5849 5851 +1239 5490 5613 +1243 5729 5736 +1245 6077 6078 +1253 5610 5734 +1257 5609 5723 +1265 5963 6083 +1267 2516 6187 +1271 5611 5612 +1273 5956 5959 +1278 5745 5858 +1278 5863 5866 +1279 5962 5965 +1279 6079 6082 +1279 6262 6269 +1281 6690 6797 +1284 5840 5847 +1285 6992 7088 +1288 5966 5967 +1288 6584 6591 +1288 6579 6689 +1290 6090 6202 +1293 6780 6884 +1296 5721 5840 +1297 5597 5598 +1297 5853 5857 +1300 5745 5749 +1302 1235 1236 +1303 1455 1573 +1304 1222 1333 +1311 1678 1679 +1313 1210 1216 +1324 548 555 +1328 1796 1797 +1329 1329 1439 +1331 1670 1671 +1341 1210 1213 +1342 1584 1700 +1344 1678 1680 +1356 4995 5109 +1361 1801 1804 +1366 1807 1808 +1367 459 554 +1374 1314 1424 +1374 1287 1403 +1376 1215 1322 +1377 750 856 +1382 1328 1330 +1388 647 749 +1395 1096 1207 +1399 1330 1445 +1307 2689 2790 +1308 2497 2612 +1315 2154 2156 +1316 2521 6188 +1318 2171 2173 +1320 2264 2267 +1325 2695 2796 +1326 2898 2899 +1328 3028 3119 +1329 2799 2800 +1331 3138 3225 +1332 2908 3003 +1334 2045 2048 +1334 2045 2047 +1337 2500 2503 +1338 2161 2277 +1343 2261 2380 +1343 2910 2911 +1349 2045 2051 +1352 2264 2270 +1353 1922 2042 +1353 2565 2566 +1356 2454 2559 +1356 2676 2677 +1358 1917 1918 +1358 2803 2901 +1360 2057 2172 +1364 2577 2578 +1366 2815 2913 +1370 3131 3132 +1374 2707 2808 +1384 2229 2230 +1397 3031 3122 +1399 2162 2274 +1302 4473 4474 +1304 5370 5493 +1305 4364 4461 +1307 4271 4363 +1308 4990 4995 +1310 5263 5270 +1311 4592 4695 +1316 5122 5129 +1316 5133 5136 +1317 5072 5182 +1317 5256 5261 +1318 4274 4366 +1320 4701 4702 +1320 4828 4829 +1321 5375 5493 +1325 4480 4579 +1326 5489 5490 +1330 5241 5242 +1330 5374 5375 +1333 4717 4822 +1333 5024 5141 +1350 4364 4368 +1352 4262 4360 +1355 4363 4368 +1356 4995 5109 +1357 4585 4586 +1362 5370 5373 +1367 5496 5613 +1369 4155 4156 +1369 5239 5241 +1375 5473 5480 +1375 5617 5622 +1376 4708 4813 +1377 4835 4942 +1380 4585 4695 +1388 5132 5138 +1389 4162 4249 +1389 4265 4357 +1393 5241 5247 +1398 5107 5114 +1309 6327 6330 +1310 5898 6017 +1314 6578 6585 +1319 5725 5848 +1321 5717 5718 +1324 5739 5745 +1333 6208 6209 +1341 6322 6437 +1343 5832 5951 +1354 5590 5595 +1363 5957 5964 +1367 5496 5613 +1368 5604 5722 +1374 5745 5866 +1375 5617 5622 +1380 5732 5852 +1380 5839 5845 +1387 5839 5956 +1388 5594 5595 +1393 5749 5866 +1395 5751 5864 +1395 6443 6444 +1401 1286 1293 +1403 1096 1205 +1404 1205 1213 +1407 554 561 +1407 1327 1328 +1410 474 569 +1411 1800 1801 +1420 1575 1576 +1422 1328 1333 +1422 1397 1404 +1426 1448 1450 +1433 1458 1573 +1448 1327 1329 +1451 1070 1077 +1454 560 567 +1454 850 857 +1463 1564 1684 +1464 1684 1687 +1467 1664 1781 +1479 1453 1458 +1481 1324 1326 +1481 1585 1588 +1486 1587 1702 +1489 1468 1471 +1497 1564 1569 +1405 2919 2920 +1407 2157 2162 +1413 2393 2399 +1418 2700 2707 +1435 3021 3022 +1436 2809 2907 +1437 2375 2380 +1442 2391 2392 +1454 2925 2926 +1461 2598 2605 +1463 2157 2164 +1465 2034 2041 +1483 2259 2265 +1483 2393 2395 +1483 2497 2502 +1493 2393 2400 +1405 5246 5250 +1434 5253 5255 +1436 5107 5115 +1449 5373 5493 +1458 5254 5374 +1470 4367 4368 +1476 5467 5469 +1476 5372 5491 +1483 4899 4902 +1485 5116 5123 +1493 5263 5264 +1496 4790 4903 +1499 4707 4708 +1409 5743 5861 +1415 6333 6445 +1419 5616 5737 +1421 5742 5855 +1422 5970 6088 +1434 6367 6374 +1435 6330 6445 +1441 5739 5858 +1451 5856 5969 +1456 5618 5740 +1459 5624 5744 +1459 5739 5852 +1460 5731 5851 +1469 5971 5974 +1473 6356 6470 +1480 5999 6006 +1484 5993 6000 +1486 5840 5842 +1491 5737 5740 +1492 5844 5957 +1496 5871 5984 +1498 5732 5737 +1500 5829 5833 +1502 1450 1451 +1514 1227 1334 +1514 1324 1329 +1515 1464 1465 +1518 1085 1086 +1518 1448 1453 +1532 1085 1087 +1537 1081 1084 +1537 1552 1672 +1543 1093 1096 +1546 1693 1808 +1551 1800 1911 +1556 973 1087 +1559 1676 1683 +1563 1096 1101 +1563 1329 1444 +1566 1086 1087 +1571 1101 1208 +1576 1090 1093 +1576 1466 5108 +1577 985 1099 +1580 1094 1101 +1581 1085 1199 +1583 974 975 +1587 1082 1084 +1600 983 990 +1505 2379 2380 +1506 2049 2056 +1512 3128 3129 +1516 2383 2385 +1519 2700 2701 +1521 2155 2271 +1526 2384 2391 +1532 2606 2609 +1534 2156 2270 +1535 2402 5949 +1536 2170 2286 +1537 2053 2169 +1538 2036 2039 +1539 2507 2508 +1551 1800 1911 +1553 2604 2606 +1555 2498 2500 +1560 2931 2932 +1561 2599 2709 +1562 2035 2041 +1568 2713 2814 +1571 2389 2500 +1577 2694 2701 +1597 2383 2492 +1598 2701 2808 +1503 5491 5493 +1505 5260 5380 +1510 5013 5127 +1526 4889 4999 +1530 5376 5491 +1531 5118 5124 +1532 5142 5259 +1536 4897 4904 +1548 5131 5138 +1550 5246 5367 +1553 4706 4708 +1566 5136 5142 +1571 5371 5379 +1576 1466 5108 +1579 5165 5278 +1580 5352 5475 +1580 5382 5385 +1582 5478 5483 +1501 5977 6094 +1506 6005 6012 +1515 5869 5872 +1526 5954 5959 +1535 2402 5949 +1536 5842 5845 +1537 5871 5991 +1543 5766 5885 +1548 5965 5967 +1550 5849 5856 +1576 5632 5633 +1585 5875 5992 +1590 5844 5850 +1590 6244 6251 +1595 5742 5861 +1595 5990 5991 +1596 5748 5861 +1605 1207 1208 +1614 1235 1237 +1618 1088 1090 +1621 1210 1215 +1652 1088 1095 +1652 1330 1332 +1653 979 981 +1665 1208 1210 +1668 1092 1205 +1672 876 988 +1689 1683 1799 +1700 1451 1453 +1605 2256 2261 +1613 2045 2165 +1625 2155 2272 +1629 2389 2498 +1632 2038 2039 +1644 2381 2388 +1654 2493 2606 +1660 2144 2261 +1660 2279 2392 +1679 2278 2279 +1683 2151 2159 +1689 2254 2255 +1700 2261 2264 +1609 5136 5139 +1612 4789 4796 +1620 5123 5124 +1622 5232 5234 +1645 5237 5355 +1646 4902 5022 +1675 5255 5373 +1679 4905 4908 +1693 5255 5256 +1695 4889 4890 +1609 5621 5735 +1620 5750 5752 +1631 6074 6082 +1632 6098 6099 +1633 5855 5857 +1638 5743 5866 +1639 5725 5727 +1653 5854 5856 +1667 5960 5961 +1670 5977 6092 +1672 5749 5751 +1698 5970 5971 +1699 6080 6085 +1704 979 982 +1707 1106 1108 +1746 1002 1113 +1756 1227 1339 +1759 1685 1686 +1764 1793 1800 +1765 1122 1236 +1771 866 968 +1774 1216 1333 +1779 1689 1693 +1792 1187 1188 +1702 2250 2257 +1704 2387 2394 +1716 2153 2154 +1729 2258 2261 +1744 1903 2013 +1755 2517 2622 +1757 2039 2153 +1759 2045 2050 +1762 2521 2628 +1770 2251 2366 +1772 2265 2272 +1774 2151 2153 +1780 2395 2397 +1786 1922 2036 +1793 2593 2703 +1800 2631 2632 +1702 5251 5252 +1707 5504 5510 +1710 5384 5390 +1711 5254 5256 +1715 5390 5503 +1724 5258 5371 +1726 5503 5504 +1727 5018 5134 +1728 4905 5022 +1728 5121 5124 +1739 5503 5505 +1740 4544 4647 +1759 4996 5004 +1759 5384 5503 +1765 5256 5374 +1767 4431 4432 +1767 4896 5010 +1769 4772 4886 +1778 5384 5504 +1785 5114 5115 +1787 5470 5472 +1790 5149 5150 +1790 5267 5385 +1794 5119 5121 +1795 4886 4890 +1799 5123 5241 +1704 5839 5962 +1716 6217 6218 +1722 5960 5968 +1723 6084 6085 +1726 6080 6088 +1738 6078 6195 +1738 6317 6318 +1741 5720 5725 +1753 6077 6083 +1761 6317 6321 +1763 6090 6091 +1764 6092 6094 +1765 5965 6080 +1771 5974 5975 +1776 6097 6100 +1782 5737 5742 +1789 5967 5973 +1789 6092 6097 +1796 5976 5977 +1796 6215 6325 +1806 1100 1102 +1814 1354 5109 +1825 1324 1327 +1825 1570 1685 +1829 1798 1800 +1832 1575 1685 +1834 1563 1678 +1843 1352 4994 +1844 1576 1581 +1844 1799 1801 +1849 1208 1209 +1851 1579 1582 +1856 1339 1341 +1860 1198 1203 +1860 1218 1333 +1865 1122 1237 +1868 1210 1327 +1877 1554 1670 +1892 1230 1345 +1894 1670 1678 +1898 973 976 +1900 1222 1339 +1807 6305 6306 +1814 2616 2617 +1815 2011 2017 +1816 2034 2035 +1820 2625 2632 +1824 2015 2017 +1833 2264 2266 +1833 2282 2284 +1840 2017 2018 +1841 2017 2133 +1847 2016 2017 +1848 2603 2608 +1851 2010 2018 +1857 2377 2380 +1858 2017 2135 +1859 2603 2717 +1863 2742 6308 +1869 2164 2168 +1871 2608 2717 +1871 2626 2735 +1881 2375 2382 +1890 2150 2153 +1890 2606 2607 +1898 2133 2134 +1804 5266 5268 +1805 5265 5268 +1810 5352 5357 +1813 5259 5260 +1814 1354 5109 +1814 5257 5262 +1814 5377 5379 +1821 5006 5122 +1824 4895 5010 +1831 4759 4760 +1837 5268 5271 +1843 1352 4994 +1843 5270 5271 +1848 4663 4768 +1850 5269 5276 +1850 5268 5273 +1852 5629 5634 +1867 5251 5258 +1877 4992 4995 +1881 5267 5268 +1883 5510 5631 +1884 5256 5373 +1887 5271 5274 +1888 5386 5506 +1889 5635 5636 +1894 5112 5114 +1894 5114 5233 +1803 5977 6097 +1807 6305 6306 +1811 6090 6207 +1812 5972 5974 +1814 6073 6187 +1830 6426 6430 +1833 6331 6332 +1834 6099 6211 +1836 6088 6090 +1837 6093 6094 +1846 6089 6090 +1847 6223 6224 +1848 5630 5750 +1852 5629 5634 +1857 6309 6419 +1860 5960 5965 +1860 6085 6207 +1867 6310 6318 +1872 5865 5986 +1872 5973 5974 +1872 6218 6328 +1874 6444 6448 +1875 6211 6219 +1875 6216 6219 +1880 6310 6311 +1883 5510 5631 +1889 5635 5636 +1889 6230 6340 +1894 6311 6419 +1896 6311 6427 +1897 6098 6105 +1910 1349 4991 +1915 975 1086 +1915 1115 1120 +1922 1463 1464 +1923 1350 4991 +1925 989 990 +1926 990 1094 +1938 1084 1087 +1942 1085 1090 +1942 1089 1196 +1945 1570 1575 +1946 1466 5109 +1950 1213 1215 +1979 860 962 +1980 1095 1202 +1997 1096 1208 +1999 1332 1449 +1918 2168 2282 +1921 2384 2386 +1923 2134 2252 +1923 2520 2631 +1931 2260 2376 +1932 1918 2028 +1933 2255 2374 +1936 2156 2276 +1938 2625 2627 +1939 2519 6189 +1951 2496 2607 +1951 2515 2630 +1955 6191 6307 +1959 2163 2164 +1962 2152 2270 +1967 2056 5712 +1974 2516 2518 +1975 2377 2489 +1977 2028 2035 +1988 2605 2715 +1992 2626 2736 +1994 2493 2598 +1998 2238 2245 +1906 5119 5120 +1910 1349 4991 +1910 5274 5389 +1915 5156 5275 +1920 4760 4761 +1923 1350 4991 +1925 5388 5505 +1929 5017 5024 +1929 5117 5236 +1931 4874 4992 +1931 5508 5511 +1933 5233 5235 +1937 5375 5494 +1943 5011 5012 +1946 1466 5109 +1951 5385 5505 +1953 5386 5393 +1964 5154 5274 +1967 4873 4881 +1976 5508 5513 +1980 5113 5120 +1989 5266 5273 +1991 4886 4996 +1994 5269 5270 +1995 5371 5373 +1904 6434 6441 +1905 6339 6451 +1906 6222 6225 +1906 6445 6446 +1910 5719 5724 +1922 5985 6104 +1924 6085 6090 +1925 6325 6332 +1935 6448 6559 +1937 5867 5868 +1937 6107 6109 +1948 6217 6222 +1955 6191 6307 +1956 5959 5961 +1962 6081 6082 +1965 6456 6563 +1966 6236 6346 +1966 6310 6315 +1979 5730 5849 +1979 6446 6447 +1985 6228 6231 +2002 984 990 +2009 1216 1325 +2019 984 1088 +2024 1081 1195 +2025 1091 1092 +2038 1080 1081 +2039 1078 1189 +2046 1565 1570 +2047 864 970 +2048 752 753 +2057 1079 1080 +2062 1329 1445 +2064 968 976 +2070 1331 1338 +2075 1802 1804 +2076 1073 1074 +2083 974 979 +2088 980 981 +2098 1224 1331 +2014 2389 2394 +2015 2601 2608 +2017 2255 2371 +2017 2379 2494 +2022 2711 2714 +2026 2609 2612 +2034 2709 2716 +2038 2249 2368 +2044 2140 2144 +2044 2156 2271 +2052 2251 2368 +2054 2613 2615 +2056 2282 2398 +2056 2710 2817 +2058 2155 2270 +2059 2489 2495 +2060 2369 2371 +2063 2379 2486 +2067 2028 2034 +2074 2486 2487 +2074 2496 2497 +2086 2491 2494 +2088 2371 2374 +2092 2260 2375 +2092 2374 2375 +2100 2390 2391 +2004 5277 5280 +2006 5386 5392 +2007 5014 5015 +2008 5382 5384 +2021 5138 5259 +2023 5259 5262 +2027 5269 5274 +2027 5490 5493 +2030 5155 5162 +2033 5122 5128 +2040 5378 5379 +2043 5009 5119 +2046 5271 5272 +2061 5277 5279 +2064 5268 5391 +2073 4996 5003 +2074 5162 5163 +2076 5160 5283 +2080 5274 5277 +2089 5233 5234 +2094 4993 5000 +2098 5268 5385 +2014 5850 5969 +2016 6203 6318 +2018 6557 6558 +2021 5849 5854 +2028 5721 5842 +2032 5729 5849 +2034 6449 6450 +2045 5731 5854 +2060 6203 6204 +2070 6663 6764 +2090 6559 6560 +2098 5730 5736 +2099 6210 6325 +2099 6327 6329 +2102 1082 1083 +2105 1330 1450 +2114 1093 1094 +2129 971 976 +2132 1088 1093 +2138 1336 1338 +2159 863 864 +2162 1067 1068 +2166 977 978 +2168 759 859 +2173 861 864 +2173 1076 1078 +2188 869 971 +2198 861 867 +2199 1090 1095 +2103 2704 2811 +2105 2602 2712 +2106 2285 2398 +2107 2503 2615 +2108 2607 2612 +2114 2259 2261 +2117 2368 2369 +2123 2615 2618 +2128 2282 2285 +2129 2255 2369 +2130 2377 2382 +2135 2706 2713 +2136 2382 2495 +2136 2611 2721 +2156 2150 2264 +2159 2255 2368 +2172 2604 2605 +2182 2805 2812 +2195 2708 2819 +2196 2811 2817 +2199 2262 2264 +2103 5153 5272 +2108 5045 5161 +2109 4878 4993 +2110 5278 5285 +2111 5256 5379 +2112 5160 5275 +2113 5161 5162 +2118 5629 5636 +2121 4648 4759 +2121 5044 5051 +2139 5159 5277 +2148 5163 5166 +2156 5273 5392 +2159 5386 5388 +2165 5168 5281 +2176 5166 5169 +2179 5158 5278 +2180 4907 5023 +2185 4794 4911 +2196 5164 5166 +2198 4880 4998 +2114 6353 6461 +2118 5629 5636 +2123 6079 6201 +2125 6327 6332 +2130 6454 6565 +2131 5610 5726 +2137 6564 6668 +2150 6569 6570 +2154 6558 6559 +2158 6234 6237 +2162 5846 5848 +2168 5882 5883 +2172 6322 6324 +2177 6453 6560 +2177 6558 6564 +2184 5964 5965 +2184 6202 6207 +2187 6199 6201 +2187 6562 6670 +2192 6203 6209 +2194 6557 6564 +2196 6207 6209 +2197 6685 6796 +2203 1803 1920 +2206 981 1091 +2211 62 63 +2220 757 861 +2223 860 861 +2223 1079 1086 +2228 1088 1094 +2231 976 978 +2233 859 866 +2233 1095 1207 +2238 419 420 +2239 1321 1327 +2240 1074 1075 +2251 335 419 +2257 413 414 +2258 757 859 +2262 751 754 +2266 1073 1080 +2267 420 509 +2270 145 146 +2271 1319 1327 +2273 414 503 +2273 650 746 +2274 329 413 +2274 979 1093 +2275 328 329 +2275 1797 1914 +2278 1322 1327 +2290 648 650 +2294 753 853 +2202 2265 2267 +2203 1803 1920 +2206 2811 2818 +2207 2621 2729 +2227 2377 2494 +2230 2814 2819 +2234 2602 2713 +2236 2360 2367 +2240 2033 2150 +2243 2609 2723 +2244 2813 2816 +2254 2806 2910 +2256 2361 2474 +2261 2812 2816 +2263 1918 2036 +2265 1916 2030 +2271 2817 2818 +2275 1797 1914 +2281 2373 2379 +2285 2609 2614 +2288 2810 2918 +2291 2148 2150 +2294 2145 2150 +2295 2383 2388 +2201 5159 5278 +2214 5165 5166 +2214 5373 5376 +2224 5165 5284 +2230 5000 5115 +2233 5154 5277 +2234 5465 5578 +2235 5007 5121 +2235 5504 5508 +2238 5168 5287 +2244 5578 5580 +2247 5165 5283 +2247 5168 5289 +2253 4906 4913 +2253 5464 5465 +2254 5273 5391 +2255 4438 4543 +2268 4995 5000 +2273 4990 4991 +2273 5268 5383 +2276 4875 4877 +2280 5003 5113 +2285 5162 5281 +2295 5160 5278 +2297 5173 5180 +2212 6445 6448 +2220 6209 6210 +2226 6080 6082 +2231 6582 6686 +2232 6448 6560 +2232 6568 6571 +2248 5705 5825 +2248 6562 6671 +2261 6580 6582 +2262 6688 6691 +2263 6205 6206 +2265 6575 6576 +2273 6676 6679 +2276 6574 6682 +2277 6557 6559 +2284 5730 5731 +2285 6562 6567 +2286 6582 6694 +2289 6202 6203 +2295 6325 6330 +2296 6451 6565 +2302 1075 1078 +2304 324 327 +2305 859 867 +2307 1092 1207 +2309 1210 1212 +2310 975 1085 +2312 1072 1075 +2317 752 859 +2325 746 751 +2326 1072 1189 +2328 330 418 +2331 1072 1078 +2336 1326 1444 +2340 1576 1688 +2346 757 867 +2348 325 326 +2354 1658 1665 +2355 864 867 +2355 1087 1089 +2356 421 424 +2359 326 410 +2360 1067 1074 +2363 247 325 +2365 756 856 +2371 418 420 +2385 416 417 +2386 420 421 +2396 864 866 +2397 521 522 +2398 975 1079 +2301 3570 3572 +2303 2733 2740 +2303 2814 2821 +2306 2810 2816 +2307 2904 2911 +2315 2261 2266 +2315 2382 2388 +2315 2824 2922 +2325 2922 2930 +2328 2816 2918 +2336 2256 2257 +2340 2804 2912 +2343 3606 3613 +2344 2494 2497 +2352 2147 2150 +2353 2929 3024 +2359 2918 2921 +2373 1942 1948 +2375 2366 2372 +2379 2383 2389 +2383 2264 2265 +2383 2700 2808 +2385 2494 2495 +2389 1942 1947 +2392 1942 1946 +2392 2273 2386 +2395 2267 2272 +2396 2918 2920 +2397 3500 3505 +2398 1948 2064 +2400 2703 2709 +2304 4764 4881 +2304 5167 5174 +2307 5141 5260 +2311 5172 5289 +2323 5170 5171 +2335 5608 5609 +2340 5001 5116 +2346 5287 5288 +2362 5118 5236 +2364 5172 5295 +2365 5372 5485 +2371 5463 5465 +2383 5458 5465 +2384 5276 5277 +2385 5054 5171 +2392 5154 5271 +2395 5290 5297 +2397 4790 4796 +2399 5459 5465 +2304 6329 6443 +2306 6204 6319 +2309 6680 6681 +2319 6204 6321 +2322 6567 6671 +2328 6447 6448 +2335 5608 5609 +2337 7478 7479 +2339 6676 6784 +2344 6332 6440 +2349 6443 6445 +2350 6675 6776 +2351 6448 6450 +2351 6568 6682 +2354 2057 5830 +2361 6570 6574 +2373 7289 7361 +2376 6447 6560 +2378 6444 6557 +2379 6322 6327 +2380 6580 6688 +2390 6077 6082 +2393 6449 6563 +2393 6673 6676 +2396 6680 6685 +2400 6206 6210 +2404 1334 1336 +2410 862 863 +2424 427 520 +2453 421 514 +2456 527 528 +2457 324 412 +2459 861 862 +2464 1181 1188 +2477 749 750 +2488 1183 1186 +2493 326 330 +2497 748 749 +2497 753 754 +2497 1205 1206 +2407 2257 2366 +2408 3430 3500 +2413 3505 3568 +2421 2909 3014 +2422 2496 2608 +2423 2383 2500 +2423 3484 3546 +2439 2468 2475 +2444 3599 3600 +2449 3341 3343 +2451 1954 2064 +2452 2703 2710 +2457 1831 1946 +2464 2711 2712 +2479 3478 3546 +2482 2263 2267 +2483 3702 7498 +2485 2708 2713 +2494 2711 2713 +2413 5272 5279 +2418 5175 5295 +2426 5578 5583 +2434 4684 4795 +2434 5175 5178 +2435 5155 5161 +2435 5272 5274 +2437 5334 5452 +2444 5141 5259 +2451 5452 5459 +2460 4794 4799 +2467 5164 5171 +2469 5451 5452 +2480 5453 5566 +2482 5290 5291 +2482 5605 5613 +2494 4905 4906 +2496 4906 4912 +2499 5127 5129 +2500 5049 5169 +2403 6450 6565 +2408 6674 6680 +2412 6082 6083 +2412 6554 6560 +2434 6329 6445 +2434 6679 6784 +2439 6573 6677 +2444 7144 7230 +2445 6561 6665 +2449 7252 7253 +2451 5833 5956 +2452 6557 6565 +2455 6206 6322 +2461 5592 5711 +2461 7144 7145 +2462 6450 6557 +2463 6668 6675 +2467 6680 6682 +2468 6562 6568 +2468 7221 7222 +2477 7379 7380 +2478 7204 7282 +2478 7416 7472 +2479 7253 7325 +2480 6640 6642 +2482 5605 5613 +2482 6668 6676 +2496 7434 7490 +2502 523 526 +2504 1182 1295 +2512 331 332 +2513 979 984 +2519 648 651 +2535 1199 1205 +2543 425 426 +2544 432 521 +2546 1235 4874 +2556 1074 1187 +2560 864 976 +2562 507 601 +2563 426 520 +2565 427 523 +2568 1079 1084 +2569 644 740 +2573 424 426 +2578 1379 1380 +2582 1092 1096 +2587 751 756 +2594 1573 1574 +2600 648 754 +2513 3702 3703 +2518 2383 2495 +2522 2599 2710 +2527 2808 2810 +2531 2812 2916 +2544 3506 3570 +2551 2703 2811 +2573 2603 2712 +2585 3701 3702 +2587 3504 3511 +2598 2606 2608 +2505 5452 5457 +2510 5583 5586 +2512 5447 5560 +2522 4544 4653 +2524 5446 5447 +2526 5292 5295 +2528 4789 4797 +2542 5243 5361 +2546 1235 4874 +2551 5019 5139 +2555 5119 5126 +2561 5290 5292 +2565 4684 4688 +2567 5008 5014 +2567 5446 5448 +2569 4903 4904 +2572 5440 5447 +2583 5459 5460 +2589 5446 5453 +2590 4647 4654 +2590 5289 5290 +2594 5295 5296 +2597 5445 5447 +2501 5843 5845 +2505 6532 6642 +2508 7307 7379 +2513 5860 5863 +2513 6794 6795 +2515 6562 6676 +2515 7409 7410 +2516 6669 6776 +2517 7264 7265 +2524 6316 6317 +2539 5615 5735 +2539 6554 6561 +2548 6670 6673 +2550 7475 7477 +2556 6562 6668 +2568 5717 5724 +2568 6531 6642 +2568 6782 6783 +2569 7343 7344 +2571 7414 7416 +2572 6784 6785 +2581 6776 6782 +2581 7479 7480 +2585 6321 6324 +2591 6559 6561 +2592 7345 7414 +2592 7480 7526 +2594 5855 5860 +2598 6199 6204 +2607 1289 1296 +2609 601 602 +2616 417 421 +2619 1072 1077 +2621 245 327 +2627 1730 1731 +2628 1180 1186 +2629 512 513 +2629 534 628 +2631 330 333 +2632 1183 1297 +2633 1180 1297 +2641 529 627 +2643 1077 1184 +2644 746 754 +2644 1485 1602 +2647 1731 1842 +2650 547 651 +2658 326 327 +2661 653 755 +2668 1183 1184 +2668 1291 1294 +2669 1290 1406 +2686 653 749 +2695 1731 1848 +2607 2611 2715 +2612 2386 2500 +2612 3437 3509 +2615 3600 3607 +2619 2822 2825 +2628 2497 2604 +2630 2905 3006 +2631 3257 3340 +2635 2614 2723 +2640 3540 3547 +2647 1731 1842 +2653 2822 2827 +2654 2391 2395 +2667 2492 2500 +2668 3567 3570 +2683 2815 2919 +2695 1731 1848 +2615 5460 5575 +2617 5328 5451 +2620 5440 5441 +2631 4103 4110 +2631 5281 5287 +2631 5333 5451 +2634 4462 4567 +2638 4794 4797 +2643 5018 5019 +2658 5440 5442 +2661 5434 5435 +2662 5442 5445 +2665 5260 5267 +2666 5008 5013 +2666 5330 5451 +2669 5233 5241 +2678 5459 5572 +2678 5465 5583 +2679 4902 5016 +2679 5270 5389 +2679 5292 5297 +2682 5328 5445 +2684 5147 5267 +2685 5337 5339 +2687 4682 4797 +2687 5322 5445 +2687 5327 5445 +2688 5122 5127 +2690 5460 5577 +2692 5164 5170 +2694 5324 5445 +2698 5294 5407 +2609 6787 6895 +2618 7436 7437 +2625 7320 7391 +2640 7371 7436 +2643 7435 7437 +2646 6788 6789 +2647 6782 6784 +2654 6890 6897 +2659 6330 6332 +2663 7375 7443 +2665 6781 6889 +2666 6684 6790 +2672 6638 6640 +2674 7409 7414 +2676 6082 6085 +2678 7416 7478 +2692 6638 6642 +2705 645 651 +2710 553 652 +2712 332 416 +2713 1731 1847 +2717 1072 1184 +2722 93 157 +2726 1400 1407 +2731 645 648 +2740 896 1004 +2740 1400 1401 +2744 421 512 +2744 753 757 +2745 546 646 +2748 328 330 +2748 336 424 +2749 553 657 +2750 1290 1296 +2754 422 423 +2755 634 635 +2756 112 113 +2756 429 518 +2762 325 328 +2763 1730 1737 +2767 528 622 +2769 1205 1207 +2770 113 179 +2770 1088 1089 +2771 864 869 +2775 552 651 +2775 1081 1083 +2776 1092 1093 +2786 330 336 +2787 553 649 +2791 111 181 +2791 1078 1083 +2792 1208 1213 +2798 1076 1077 +2800 1288 1408 +2703 2721 2722 +2712 2497 2607 +2714 1916 1918 +2723 2152 2153 +2737 2372 2377 +2744 2052 2057 +2750 2912 2915 +2752 3501 3508 +2793 2495 2502 +2702 5135 5254 +2708 4904 5020 +2716 4683 4690 +2717 5454 5457 +2719 5440 5445 +2728 5251 5259 +2732 5578 5579 +2737 5320 5321 +2739 4891 4898 +2742 5339 5452 +2745 5435 5554 +2748 5137 5138 +2749 5298 5415 +2755 5054 5170 +2756 4685 4688 +2756 4794 4796 +2757 4684 4796 +2759 4684 4797 +2778 5466 5583 +2779 5052 5169 +2783 5460 5462 +2786 4573 4580 +2786 5454 5456 +2787 5300 5413 +2790 5257 5258 +2796 5052 5055 +2797 4903 4910 +2798 5454 5572 +2704 6678 6785 +2707 6206 6324 +2725 7411 7414 +2731 7337 7339 +2733 6684 6785 +2747 6770 6777 +2761 6570 6674 +2763 6784 6787 +2770 6677 6678 +2770 6667 6778 +2771 6085 6202 +2776 5843 5848 +2777 7344 7414 +2788 6691 6694 +2793 7343 7350 +2799 6562 6565 +2806 1189 1192 +2810 111 113 +2810 528 629 +2818 433 526 +2820 250 328 +2821 553 555 +2822 111 114 +2825 1075 1077 +2834 1078 1081 +2841 113 187 +2854 1718 1720 +2858 642 740 +2861 556 559 +2869 640 641 +2872 554 556 +2873 1484 1491 +2874 555 556 +2874 1182 1186 +2890 556 657 +2894 463 554 +2813 2146 2150 +2855 2810 2913 +2869 2257 2374 +2898 2814 2816 +2809 5251 5256 +2809 5583 5584 +2813 5263 5268 +2818 5320 5322 +2826 5294 5415 +2828 4898 5016 +2828 5297 5410 +2837 5275 5282 +2841 5457 5460 +2846 5448 5451 +2846 5460 5465 +2848 5315 5434 +2852 5454 5571 +2852 5582 5583 +2855 4677 4683 +2864 5294 5413 +2871 5171 5290 +2875 4574 4683 +2883 5386 5391 +2884 5243 5244 +2890 5462 5583 +2801 6332 6445 +2812 7339 7342 +2814 6685 6688 +2815 7480 7485 +2832 6692 6693 +2832 6882 6976 +2836 7259 7337 +2842 6982 6983 +2844 6562 6564 +2849 5681 5801 +2849 7406 7414 +2851 6556 6561 +2866 6786 6890 +2866 7265 7266 +2868 7480 7483 +2875 6686 6688 +2876 6670 6778 +2877 7263 7265 +2889 7265 7343 +2891 6881 6889 +2893 7417 7477 +2899 7260 7265 +2901 638 734 +2904 1289 1294 +2910 1183 1185 +2911 1288 1405 +2917 463 562 +2918 1397 1402 +2919 1188 1189 +2926 1212 1213 +2927 1073 1078 +2929 647 743 +2934 1485 1600 +2937 462 557 +2937 1400 1405 +2938 157 164 +2941 1282 1402 +2943 1187 1194 +2953 1205 1210 +2968 642 648 +2969 1399 1402 +2984 1184 1186 +2988 648 748 +2990 1278 1394 +2994 1596 1712 +2994 1718 1725 +2919 2361 2476 +2922 1921 1922 +2927 2262 2263 +2938 2810 2912 +2979 2255 2366 +2985 2809 2913 +2901 4578 4691 +2905 4474 4579 +2905 5277 5278 +2907 5259 5261 +2917 5161 5166 +2921 5419 5420 +2924 5460 5583 +2936 5454 5460 +2938 5560 5567 +2944 4474 4478 +2948 5436 5439 +2950 5273 5386 +2958 5434 5439 +2959 5554 5555 +2963 5436 5554 +2965 5326 5446 +2970 5436 5553 +2973 5333 5446 +2974 5438 5439 +2980 5436 5438 +2982 5428 5435 +2989 5265 5267 +2989 5435 5548 +2993 5431 5436 +2999 5431 5439 +2909 6570 6681 +2909 6772 6775 +2909 6776 6783 +2909 7180 7258 +2922 6783 6889 +2922 7262 7265 +2928 7258 7263 +2934 6675 6784 +2943 7265 7342 +2953 6204 6206 +2954 6665 6672 +2961 6883 6886 +2964 6673 6675 +2973 7260 7336 +2975 6558 6562 +2978 6668 6673 +2981 7256 7260 +2984 6880 6886 +2989 6786 6884 +2990 5957 5962 +2993 5954 5962 +3002 1181 1186 +3005 1290 1408 +3029 1403 1404 +3030 981 1093 +3030 1182 1297 +3034 157 162 +3036 642 647 +3062 981 985 +3063 1085 1092 +3067 756 863 +3067 1723 1725 +3075 1078 1195 +3077 1597 1712 +3080 645 646 +3090 467 468 +3096 469 568 +3006 2909 3009 +3009 2806 2912 +3029 2153 2155 +3039 1800 1919 +3064 2812 2813 +3065 2914 3015 +3006 5298 5413 +3010 5318 5438 +3016 4904 5022 +3020 5452 5453 +3021 5441 5447 +3027 4904 4908 +3031 5321 5322 +3033 5130 5247 +3033 5296 5297 +3034 5241 5244 +3037 5169 5171 +3038 5431 5438 +3048 5453 5454 +3056 5327 5440 +3069 5419 5426 +3073 5166 5168 +3083 5418 5421 +3085 5256 5259 +3085 5419 5424 +3093 5306 5425 +3001 7079 7080 +3026 7339 7414 +3037 6667 6670 +3047 7083 7089 +3053 7422 7478 +3057 6764 6771 +3072 6662 6670 +3073 6881 6883 +3078 7476 7480 +3082 6886 6984 +3084 6085 6088 +3089 6982 6984 +3089 7480 7525 +3091 6884 6886 +3092 6878 6883 +3093 6667 6669 +3099 6777 6883 +3100 5839 5842 +3133 469 563 +3135 560 562 +3139 1607 1614 +3152 464 471 +3152 465 560 +3156 1723 1726 +3157 1597 1717 +3164 1080 1193 +3166 471 560 +3171 472 568 +3174 465 471 +3190 1292 1299 +3103 2709 2710 +3121 2793 2898 +3132 2904 2905 +3149 3000 3007 +3176 2804 2906 +3106 5287 5292 +3106 5421 5423 +3127 4904 4905 +3135 5421 5424 +3137 5304 5424 +3146 5420 5421 +3157 5156 5162 +3157 5295 5297 +3167 5427 5428 +3101 6780 6878 +3107 6775 6878 +3107 6882 6883 +3110 6663 6770 +3113 6878 6880 +3114 6884 6891 +3116 6775 6875 +3119 6875 6878 +3124 6987 7081 +3126 6671 6672 +3126 6880 6883 +3128 6780 6883 +3147 6877 6878 +3149 7480 7527 +3152 7477 7480 +3156 6678 6679 +3191 6986 7082 +3197 6885 6886 +3203 1289 1297 +3205 1180 1185 +3215 552 646 +3215 642 742 +3246 553 651 +3246 631 632 +3249 1290 1294 +3255 636 639 +3264 1404 1405 +3280 756 861 +3284 1520 1521 +3218 2055 2057 +3280 2034 2036 +3220 5419 5425 +3222 5310 5425 +3224 5318 5437 +3236 5266 5267 +3251 5377 5378 +3253 5304 5427 +3254 5276 5280 +3265 5431 5432 +3274 5432 5433 +3285 5312 5425 +3290 5309 5427 +3297 5298 5416 +3298 5160 5162 +3248 6981 6987 +3257 6560 6561 +3273 5837 5844 +3285 6785 6786 +3300 6769 6869 +3303 464 472 +3318 463 557 +3318 636 638 +3318 1083 1196 +3322 380 464 +3338 638 742 +3341 966 1070 +3347 1402 1404 +3366 1077 1190 +3377 469 475 +3377 1640 1647 +3380 1284 1394 +3395 1402 1519 +3397 961 1069 +3302 5592 5594 +3301 5416 5421 +3310 5271 5273 +3314 5306 5427 +3314 5428 5429 +3321 5303 5422 +3324 5310 5427 +3327 5303 5416 +3350 5310 5433 +3358 5174 5287 +3364 5312 5433 +3369 5171 5172 +3302 5592 5594 +3304 6671 6676 +3305 6976 6984 +3309 6983 6987 +3311 6882 6982 +3319 6869 6877 +3335 6769 6877 +3347 7170 7171 +3366 6987 7079 +3367 7080 7084 +3376 6881 6888 +3387 6874 6877 +3389 7080 7170 +3392 6890 6891 +3397 7172 7174 +3402 647 748 +3410 373 374 +3415 1069 1075 +3430 373 375 +3438 647 750 +3441 1399 1519 +3456 1388 1395 +3463 633 639 +3467 1277 1278 +3469 1282 1285 +3471 465 554 +3471 642 645 +3475 961 1072 +3480 535 633 +3482 1168 1279 +3419 2362 2363 +3430 5304 5422 +3456 5421 5422 +3457 5437 5438 +3409 6783 6887 +3434 7255 7256 +3454 7262 7334 +3459 6787 6790 +3459 6984 6986 +3490 6559 6562 +3496 6783 6787 +3501 1164 1271 +3518 1173 1280 +3523 1286 1287 +3527 957 1061 +3532 540 634 +3537 749 754 +3546 1291 1293 +3565 1180 1292 +3569 958 1069 +3589 955 958 +3592 531 625 +3502 2005 2115 +3507 5258 5259 +3529 5316 5439 +3562 5318 5439 +3581 5275 5276 +3597 5293 5294 +3505 6787 6789 +3511 6884 6889 +3524 5622 5624 +3541 7169 7172 +3549 5593 5594 +3561 6983 7079 +3571 6985 6986 +3598 7076 7083 +3604 1280 1286 +3608 533 634 +3639 533 534 +3655 1288 1402 +3658 1162 1271 +3665 1388 1393 +3677 642 743 +3681 1265 1382 +3685 1167 1279 +3625 5462 5575 +3634 5316 5433 +3637 5204 5323 +3646 5508 5510 +3652 5324 5443 +3697 5503 5508 +3674 5839 5844 +3711 529 532 +3718 1167 1274 +3720 1162 1273 +3728 1277 1282 +3730 950 951 +3752 1157 1158 +3759 1067 1069 +3766 527 529 +3795 641 737 +3703 5596 5598 +3714 6581 6582 +3812 1044 1151 +3816 642 748 +3840 1293 1409 +3843 643 648 +3873 1186 1189 +3878 1230 1337 +3830 5593 5600 +3812 5271 5277 +3840 5304 5421 +3827 5598 5600 +3830 5593 5600 +3903 1403 1408 +3910 957 1067 +3918 978 1082 +3960 646 651 +3965 1283 1284 +3968 958 961 +3978 646 647 +3909 5303 5421 +3967 5154 5272 +3974 5459 5578 +3981 5309 5422 +3995 5275 5280 +3979 7252 7259 +4028 1463 1468 +4040 1260 1370 +4064 1071 1072 +4070 1184 1190 +4057 2922 2923 +4038 5321 5440 +4013 7337 7344 +4023 7344 7409 +4041 5968 5970 +4047 7342 7344 +4061 7344 7415 +4129 944 945 +4131 851 958 +4154 1250 1251 +4169 1143 1250 +4171 918 1022 +4186 1138 1250 +4191 1244 1250 +4197 1072 1074 +4122 2614 2718 +4144 1818 1822 +4171 5596 5603 +4114 5434 5441 +4122 5172 5287 +4173 5434 5436 +4178 5453 5572 +4110 7174 7252 +4112 7260 7342 +4171 5596 5603 +4183 7257 7260 +4222 1250 1255 +4280 1229 1237 +4294 1233 1340 +4299 1344 1460 +4218 2139 2140 +4244 2140 2250 +4255 2010 2011 +4202 5171 5289 +4209 5572 5577 +4221 5448 5566 +4242 5178 5295 +4254 5415 5417 +4262 5297 5298 +4280 5417 5418 +4289 5177 5295 +4292 5445 5446 +4211 7413 7477 +4216 7416 7477 +4239 6328 6335 +4245 7409 7416 +4263 7411 7416 +4269 7472 7477 +4272 7417 7475 +4296 7483 7485 +4307 1003 1109 +4317 1149 1256 +4325 1265 1266 +4329 1256 1257 +4336 1137 1244 +4347 999 1109 +4359 1189 1190 +4360 1116 1120 +4365 1228 1339 +4393 1265 1273 +4349 2055 5591 +4377 6078 6079 +4386 2822 2922 +4376 5425 5433 +4381 5442 5447 +4392 5430 5433 +4301 7417 7422 +4304 7416 7417 +4343 7260 7263 +4356 6787 6887 +4367 6578 6689 +4377 6078 6079 +4385 7341 7406 +4425 1224 1230 +4431 1265 1270 +4484 2138 2253 +4427 5439 5442 +4433 5298 5421 +4444 4878 4880 +4449 5433 5553 +4455 4877 4878 +4457 4878 4990 +4464 4880 4883 +4473 4880 4881 +4499 5444 5557 +4452 7413 7469 +4566 1035 1142 +4547 5450 5563 +4614 1136 1137 +4666 1023 1130 +4623 2920 3021 +4626 1887 1888 +4655 1818 1935 +4656 2137 2247 +4665 1770 1881 +4626 5428 5430 +4666 5439 5559 +4703 2808 2815 +4729 1894 2004 +4731 2135 2137 +4750 1897 2007 +4775 1891 2001 +4701 5444 5448 +4731 5456 5569 +4752 5448 5453 +4758 5454 5569 +4733 7082 7089 +4736 6676 6678 +4819 2397 2504 +4822 1886 1891 +4844 2013 2014 +4854 1891 2006 +4825 5444 5563 +4895 5450 5569 +4819 6985 6992 +4957 1532 1533 +4959 1579 1580 +4991 1469 1470 +5003 461 468 +5019 524 525 +5019 1082 1087 +5042 955 960 +5008 5615 5729 +5041 7349 7350 +5046 7258 7265 +5112 960 1064 +5115 846 952 +5145 650 753 +5180 1284 1400 +5183 1398 1514 +5188 973 975 +5197 851 953 +5127 1799 1805 +5167 1937 1940 +5223 518 524 +5226 836 938 +5228 646 648 +5265 1515 1631 +5272 862 864 +5290 421 426 +5257 3001 3098 +5231 6991 6998 +5319 537 631 +5320 1396 1399 +5321 1284 1285 +5336 524 529 +5340 543 643 +5342 530 531 +5360 644 748 +5392 975 976 +5372 5054 5164 +5392 5047 5054 +5401 524 526 +5403 419 424 +5410 429 526 +5410 974 981 +5425 1085 1093 +5431 638 740 +5470 648 653 +5490 973 978 +5447 5272 5277 +5427 6893 6894 +5453 6981 7081 +5523 631 636 +5582 524 531 +5583 427 518 +5503 5585 5698 +5555 4936 4937 +5566 4934 5050 +5573 5052 5053 +5586 5203 5210 +5504 6698 6699 +5563 6984 6987 +5602 631 638 +5607 423 512 +5627 427 432 +5644 427 521 +5646 427 526 +5646 4820 4933 +5673 4933 4934 +5697 5586 5701 +5704 529 531 +5733 416 512 +5740 1920 1921 +5716 4934 4938 +5764 5096 5212 +5772 5212 5219 +5776 5089 5096 +5789 5094 5096 +5800 5212 5214 +5850 535 538 +5853 526 527 +5859 1799 1804 +5802 5091 5096 +5814 5096 5102 +5816 5049 5054 +5862 5101 5106 +5865 5206 5213 +5887 6878 6885 +5901 431 432 +5932 633 634 +5970 341 432 +5992 529 534 +5932 5102 5218 +5966 5103 5223 +6089 2051 2166 +6092 5217 5220 +6574 418 419 +6597 4707 4714 +6640 334 335 +6664 4701 4708 +6773 4713 4720 +6791 4477 4582 +6753 5984 5991 +6773 5991 6110 +6845 534 635 +6812 4689 4696 +6824 4576 4583 +6828 4476 4483 +6854 4586 4695 +6953 6882 6886 +7017 522 616 +7051 2397 2401 +7009 7262 7340 +7033 5865 5866 +7050 6984 6985 +7092 5608 5615 +7114 1282 1399 +7170 5852 5860 +7249 426 427 +7296 979 1087 +7247 5864 5871 +7399 2401 2406 +7387 5048 5054 +7448 1406 1407 +7427 2400 2406 +7443 2406 2518 +7442 4938 5052 +7496 4823 4930 diff --git a/examples/bpm/impact/in.bpm.impact.rotational b/examples/bpm/impact/in.bpm.impact.rotational new file mode 100644 index 0000000000..698fa22fb8 --- /dev/null +++ b/examples/bpm/impact/in.bpm.impact.rotational @@ -0,0 +1,51 @@ +units lj +dimension 3 +boundary f f f +atom_style bpm/sphere +special_bonds lj 0.0 1.0 1.0 coul 0.0 1.0 1.0 +newton on off +comm_modify vel yes cutoff 2.6 +lattice fcc 1.0 +region box block -25 15 -22 22 -22 22 +create_box 1 box bond/types 2 extra/bond/per/atom 20 extra/special/per/atom 50 + +region disk cylinder x 0.0 0.0 20.0 -0.5 0.5 +create_atoms 1 region disk +group plate region disk + +region ball sphere 8.0 0.0 0.0 6.0 +create_atoms 1 region ball +group projectile region ball + +displace_atoms all random 0.1 0.1 0.1 134598738 + +neighbor 1.0 bin +pair_style gran/hooke/history 1.0 NULL 0.5 NULL 0.1 1 +pair_coeff 1 1 + +fix 1 all nve/bpm/sphere + +create_bonds many plate plate 1 0.0 1.5 +create_bonds many projectile projectile 2 0.0 1.5 + +neighbor 0.3 bin +special_bonds lj 0.0 1.0 1.0 coul 1.0 1.0 1.0 + +bond_style bpm/rotational store/local brkbond 100 time id1 id2 +bond_coeff 1 1.0 0.2 0.02 0.02 0.05 0.01 0.01 0.01 0.1 0.2 0.002 0.002 +bond_coeff 2 1.0 0.2 0.02 0.02 0.20 0.04 0.04 0.04 0.1 0.2 0.002 0.002 + +velocity projectile set -0.05 0.0 0.0 +compute nbond all nbond/atom +compute tbond all reduce sum c_nbond + +timestep 0.05 +thermo_style custom step ke pe pxx pyy pzz c_tbond +thermo 100 +thermo_modify lost ignore lost/bond ignore +#dump 1 all custom 100 atomDump id radius x y z c_nbond + +dump 2 all local 100 brokenDump f_brkbond[1] f_brkbond[2] f_brkbond[3] +dump_modify 2 header no + +run 7500 diff --git a/examples/bpm/impact/in.bpm.impact.spring b/examples/bpm/impact/in.bpm.impact.spring new file mode 100644 index 0000000000..7c5c56841b --- /dev/null +++ b/examples/bpm/impact/in.bpm.impact.spring @@ -0,0 +1,53 @@ +units lj +dimension 3 +boundary f f f +atom_style bond +special_bonds lj 0.0 1.0 1.0 coul 0.0 1.0 1.0 +newton on off +comm_modify vel yes cutoff 2.6 +lattice fcc 1.0 +region box block -25 15 -22 22 -22 22 +create_box 1 box bond/types 2 extra/bond/per/atom 20 extra/special/per/atom 50 + +region disk cylinder x 0.0 0.0 20.0 -0.5 0.5 +create_atoms 1 region disk +group plate region disk + +region ball sphere 8.0 0.0 0.0 6.0 +create_atoms 1 region ball +group projectile region ball + +displace_atoms all random 0.1 0.1 0.1 134598738 + +mass 1 1.0 + +neighbor 1.0 bin +pair_style bpm/spring +pair_coeff 1 1 1.0 1.0 1.0 + +fix 1 all nve + +create_bonds many plate plate 1 0.0 1.5 +create_bonds many projectile projectile 2 0.0 1.5 + +neighbor 0.3 bin +special_bonds lj 0.0 1.0 1.0 coul 1.0 1.0 1.0 + +bond_style bpm/spring store/local brkbond 100 time id1 id2 +bond_coeff 1 1.0 0.04 1.0 +bond_coeff 2 1.0 0.20 1.0 + +velocity projectile set -0.05 0.0 0.0 +compute nbond all nbond/atom +compute tbond all reduce sum c_nbond + +timestep 0.1 +thermo_style custom step ke pe pxx pyy pzz c_tbond +thermo 100 +thermo_modify lost ignore lost/bond ignore +#dump 1 all custom 100 atomDump id x y z c_nbond + +dump 2 all local 100 brokenDump f_brkbond[1] f_brkbond[2] f_brkbond[3] +dump_modify 2 header no + +run 7500 diff --git a/examples/bpm/impact/log.17Feb2022.impact.rotational.g++.4 b/examples/bpm/impact/log.17Feb2022.impact.rotational.g++.4 new file mode 100644 index 0000000000..b76854d5d9 --- /dev/null +++ b/examples/bpm/impact/log.17Feb2022.impact.rotational.g++.4 @@ -0,0 +1,219 @@ +LAMMPS (17 Feb 2022) +units lj +dimension 3 +boundary f f f +atom_style bpm/sphere +special_bonds lj 0.0 1.0 1.0 coul 0.0 1.0 1.0 +newton on off +comm_modify vel yes cutoff 2.6 +lattice fcc 1.0 +Lattice spacing in x,y,z = 1.5874011 1.5874011 1.5874011 +region box block -25 15 -22 22 -22 22 +create_box 1 box bond/types 2 extra/bond/per/atom 20 extra/special/per/atom 50 +Created orthogonal box = (-39.685026 -34.922823 -34.922823) to (23.811016 34.922823 34.922823) + 1 by 2 by 2 MPI processor grid + +region disk cylinder x 0.0 0.0 20.0 -0.5 0.5 +create_atoms 1 region disk +Created 7529 atoms + using lattice units in orthogonal box = (-39.685026 -34.922823 -34.922823) to (23.811016 34.922823 34.922823) + create_atoms CPU = 0.002 seconds +group plate region disk +7529 atoms in group plate + +region ball sphere 8.0 0.0 0.0 6.0 +create_atoms 1 region ball +Created 3589 atoms + using lattice units in orthogonal box = (-39.685026 -34.922823 -34.922823) to (23.811016 34.922823 34.922823) + create_atoms CPU = 0.001 seconds +group projectile region ball +3589 atoms in group projectile + +displace_atoms all random 0.1 0.1 0.1 134598738 +Displacing atoms ... + +neighbor 1.0 bin +pair_style gran/hooke/history 1.0 NULL 0.5 NULL 0.1 1 +pair_coeff 1 1 + +fix 1 all nve/bpm/sphere + +create_bonds many plate plate 1 0.0 1.5 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2 + ghost atom cutoff = 2.6 + binsize = 1, bins = 64 70 70 + 2 neighbor lists, perpetual/occasional/extra = 1 1 0 + (1) command create_bonds, occasional + attributes: full, newton on + pair build: full/bin + stencil: full/bin/3d + bin: standard + (2) pair gran/hooke/history, perpetual + attributes: half, newton on, size, history + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Added 38559 bonds, new total = 38559 +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 1 1 + special bond factors coul: 0 1 1 + 15 = max # of 1-2 neighbors + 101 = max # of special neighbors + special bonds CPU = 0.001 seconds +create_bonds many projectile projectile 2 0.0 1.5 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +WARNING: Bonds are defined but no bond style is set (../force.cpp:192) +WARNING: Likewise 1-2 special neighbor interactions != 1.0 (../force.cpp:194) +Added 21869 bonds, new total = 60428 +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 1 1 + special bond factors coul: 0 1 1 + 16 = max # of 1-2 neighbors + 101 = max # of special neighbors + special bonds CPU = 0.001 seconds + +neighbor 0.3 bin +special_bonds lj 0.0 1.0 1.0 coul 1.0 1.0 1.0 + +bond_style bpm/rotational store/local brkbond 100 time id1 id2 +bond_coeff 1 1.0 0.2 0.02 0.02 0.05 0.01 0.01 0.01 0.1 0.2 0.002 0.002 +bond_coeff 2 1.0 0.2 0.02 0.02 0.20 0.04 0.04 0.04 0.1 0.2 0.002 0.002 + +velocity projectile set -0.05 0.0 0.0 +compute nbond all nbond/atom +compute tbond all reduce sum c_nbond + +timestep 0.05 +thermo_style custom step ke pe pxx pyy pzz c_tbond +thermo 100 +thermo_modify lost ignore lost/bond ignore +#dump 1 all custom 100 atomDump id radius x y z c_nbond + +dump 2 all local 100 brokenDump f_brkbond[1] f_brkbond[2] f_brkbond[3] +dump_modify 2 header no + +run 7500 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.3 + ghost atom cutoff = 2.6 + binsize = 0.65, bins = 98 108 108 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hooke/history, perpetual + attributes: half, newton on, size, history + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 33.34 | 33.34 | 33.35 Mbytes +Step KinEng PotEng Pxx Pyy Pzz c_tbond + 0 0.00053238861 0 3.8217307e-05 0 0 10.8703 + 100 0.00053238861 0 3.8217307e-05 1.2166373e-20 1.2308212e-20 10.8703 + 200 0.00053238861 0 3.8217307e-05 1.2454467e-20 1.2479589e-20 10.8703 + 300 0.00053238861 0 3.8217307e-05 1.2256702e-20 1.2621091e-20 10.8703 + 400 0.00053238861 0 3.8217307e-05 1.2170534e-20 1.2751666e-20 10.8703 + 500 0.00053093549 0 3.8484194e-05 7.645531e-08 1.4861825e-07 10.8703 + 600 0.00051485902 0 4.0340751e-05 3.8615876e-07 4.8663463e-07 10.869221 + 700 0.00049942978 0 3.8684008e-05 4.5363318e-07 4.4560229e-07 10.85501 + 800 0.00049465262 0 3.6604612e-05 1.4755468e-07 2.0062093e-07 10.820651 + 900 0.00048784775 0 3.5333139e-05 3.5118328e-07 6.6697625e-07 10.769563 + 1000 0.00048345699 0 3.4702137e-05 7.0312998e-07 4.0218318e-07 10.730347 + 1100 0.00047945073 0 3.5065961e-05 6.2813891e-07 7.4640359e-07 10.703184 + 1200 0.00047512604 0 3.4833144e-05 8.5208604e-07 8.7277583e-07 10.686634 + 1300 0.00047401428 0 3.4236869e-05 1.0321827e-06 7.4545242e-07 10.678 + 1400 0.00047619121 0 3.4416549e-05 8.7518021e-07 7.3979503e-07 10.671704 + 1500 0.0004668728 0 3.4495751e-05 1.4077823e-06 1.517373e-06 10.666127 + 1600 0.00045088371 0 3.3264301e-05 1.8499661e-06 1.9842415e-06 10.66073 + 1700 0.00044275099 0 3.2471064e-05 1.9028747e-06 2.2248947e-06 10.6458 + 1800 0.0004424362 0 3.1846336e-05 1.6208492e-06 1.9291602e-06 10.620615 + 1900 0.00043678957 0 3.1260936e-05 1.4673956e-06 1.6120523e-06 10.603166 + 2000 0.00042747562 0 3.0652107e-05 1.6455486e-06 1.53127e-06 10.576003 + 2100 0.0004214344 0 3.0240727e-05 1.8873967e-06 1.5258622e-06 10.539845 + 2200 0.00041712779 0 3.0329566e-05 1.8846152e-06 1.4971471e-06 10.49937 + 2300 0.00041095769 0 3.0000572e-05 2.3585924e-06 1.6773177e-06 10.471668 + 2400 0.00040883568 0 2.9625158e-05 1.9105554e-06 1.8720763e-06 10.45116 + 2500 0.00040762685 0 2.9441541e-05 1.6848938e-06 1.8877532e-06 10.437309 + 2600 0.00040579873 0 2.9255988e-05 1.7523874e-06 1.636423e-06 10.422378 + 2700 0.00040340975 0 2.9035693e-05 1.673158e-06 1.9038932e-06 10.410505 + 2800 0.00040170914 0 2.8829361e-05 1.6711978e-06 1.9776001e-06 10.400792 + 2900 0.00040015113 0 2.8614186e-05 1.5982427e-06 1.7994733e-06 10.393416 + 3000 0.00040029253 0 2.8470718e-05 1.5589166e-06 1.6682302e-06 10.385321 + 3100 0.00040037329 0 2.8483376e-05 1.2831526e-06 1.4788005e-06 10.378485 + 3200 0.00040142612 0 2.8481287e-05 1.1577988e-06 1.3495778e-06 10.373988 + 3300 0.00040105092 0 2.8547009e-05 1.2155138e-06 1.2633439e-06 10.370031 + 3400 0.00039950673 0 2.8340939e-05 1.1182251e-06 1.1624668e-06 10.364274 + 3500 0.00039715236 0 2.824813e-05 1.3086462e-06 1.2029185e-06 10.360496 + 3600 0.00039446552 0 2.8112283e-05 1.1232321e-06 1.0077217e-06 10.353121 + 3700 0.00039263296 0 2.7927975e-05 1.1083636e-06 1.2091857e-06 10.346645 + 3800 0.00039061341 0 2.7819957e-05 1.1836841e-06 1.3566272e-06 10.341069 + 3900 0.00038985051 0 2.7681947e-05 1.3588359e-06 1.4099727e-06 10.329196 + 4000 0.00038815347 0 2.7492102e-05 1.1111719e-06 1.1700718e-06 10.318043 + 4100 0.00038651302 0 2.7444105e-05 9.9563429e-07 1.4085969e-06 10.311027 + 4200 0.00038565809 0 2.7177341e-05 9.5736307e-07 1.0404482e-06 10.299155 + 4300 0.0003847255 0 2.7029216e-05 9.6204756e-07 1.140804e-06 10.292319 + 4400 0.0003844421 0 2.6841047e-05 9.6570404e-07 1.2319818e-06 10.286203 + 4500 0.0003842788 0 2.6633558e-05 9.6452478e-07 1.1954945e-06 10.278287 + 4600 0.00038365139 0 2.6514403e-05 9.6185846e-07 1.2002452e-06 10.270732 + 4700 0.00038271503 0 2.6374349e-05 9.4061833e-07 1.1774211e-06 10.264796 + 4800 0.00038233688 0 2.638398e-05 1.1644119e-06 1.3746239e-06 10.25742 + 4900 0.00038223496 0 2.6279821e-05 1.1345508e-06 1.4709213e-06 10.246987 + 5000 0.00038219402 0 2.6188871e-05 1.0115151e-06 1.2024203e-06 10.240511 + 5100 0.00038195153 0 2.6137945e-05 1.009856e-06 1.1961088e-06 10.236014 + 5200 0.00038170903 0 2.6103563e-05 1.0046761e-06 1.1881008e-06 10.232236 + 5300 0.00038194303 0 2.6111938e-05 1.0533375e-06 1.2621634e-06 10.230617 + 5400 0.00038147407 0 2.6078641e-05 1.082228e-06 1.2915223e-06 10.230098 + 5500 0.00038156894 0 2.6084488e-05 1.1395485e-06 1.3592644e-06 10.227759 + 5600 0.00038169434 0 2.6085704e-05 1.1173618e-06 1.3003599e-06 10.2256 + 5700 0.00038219734 0 2.6095279e-05 1.1026614e-06 1.280455e-06 10.223621 + 5800 0.00038268758 0 2.6113437e-05 1.1096198e-06 1.2565503e-06 10.222902 + 5900 0.00038300658 0 2.6131709e-05 1.1123595e-06 1.235992e-06 10.222182 + 6000 0.00038250316 0 2.606995e-05 1.1590744e-06 1.2888416e-06 10.221123 + 6100 0.0003821526 0 2.6025605e-05 1.1434025e-06 1.3141861e-06 10.219503 + 6200 0.00038185711 0 2.5991255e-05 1.1471391e-06 1.3427373e-06 10.219503 + 6300 0.00038197679 0 2.5996965e-05 1.1338082e-06 1.3315258e-06 10.218604 + 6400 0.00038232311 0 2.6035805e-05 1.1353407e-06 1.3306683e-06 10.217884 + 6500 0.00038255543 0 2.6091572e-05 1.1768703e-06 1.3629611e-06 10.217704 + 6600 0.00038251887 0 2.6068968e-05 1.1808094e-06 1.3969697e-06 10.217344 + 6700 0.00038177389 0 2.6004288e-05 1.1659866e-06 1.423638e-06 10.218084 + 6800 0.00038096291 0 2.5969494e-05 1.1377343e-06 1.4348787e-06 10.218103 + 6900 0.00038090601 0 2.5951546e-05 1.1327767e-06 1.4311663e-06 10.217024 + 7000 0.00038088094 0 2.5946255e-05 1.1652568e-06 1.4567559e-06 10.215944 + 7100 0.00038094624 0 2.5972593e-05 1.1558871e-06 1.4692935e-06 10.214684 + 7200 0.00038168738 0 2.6002e-05 1.1562707e-06 1.4881081e-06 10.212705 + 7300 0.00038200854 0 2.6038768e-05 1.1339903e-06 1.4808455e-06 10.212345 + 7400 0.00038187543 0 2.6044759e-05 1.101743e-06 1.4758679e-06 10.213084 + 7500 0.00038165297 0 2.6004536e-05 1.0892731e-06 1.4872621e-06 10.214742 +Loop time of 28.804 on 4 procs for 7500 steps with 11111 atoms + +Performance: 1124843.305 tau/day, 260.380 timesteps/s +97.5% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.26977 | 0.28058 | 0.2866 | 1.3 | 0.97 +Bond | 22.742 | 23.598 | 24.671 | 16.6 | 81.92 +Neigh | 0.54555 | 0.5728 | 0.60272 | 3.2 | 1.99 +Comm | 1.4024 | 2.5619 | 3.5079 | 54.8 | 8.89 +Output | 0.025307 | 0.025833 | 0.027022 | 0.4 | 0.09 +Modify | 1.592 | 1.6506 | 1.7059 | 4.0 | 5.73 +Other | | 0.1147 | | | 0.40 + +Nlocal: 2777.75 ave 2887 max 2682 min +Histogram: 1 0 0 0 2 0 0 0 0 1 +Nghost: 1152.5 ave 1189 max 1125 min +Histogram: 1 0 1 0 0 1 0 0 0 1 +Neighs: 11515.5 ave 12520 max 10831 min +Histogram: 1 1 0 0 1 0 0 0 0 1 + +Total # of neighbors = 46062 +Ave neighs/atom = 4.1456215 +Ave special neighs/atom = 10.214742 +Neighbor list builds = 408 +Dangerous builds = 0 +Total wall time: 0:00:28 diff --git a/examples/bpm/impact/log.17Feb2022.impact.spring.g++.4 b/examples/bpm/impact/log.17Feb2022.impact.spring.g++.4 new file mode 100644 index 0000000000..9b11f62b88 --- /dev/null +++ b/examples/bpm/impact/log.17Feb2022.impact.spring.g++.4 @@ -0,0 +1,221 @@ +LAMMPS (17 Feb 2022) +units lj +dimension 3 +boundary f f f +atom_style bond +special_bonds lj 0.0 1.0 1.0 coul 0.0 1.0 1.0 +newton on off +comm_modify vel yes cutoff 2.6 +lattice fcc 1.0 +Lattice spacing in x,y,z = 1.5874011 1.5874011 1.5874011 +region box block -25 15 -22 22 -22 22 +create_box 1 box bond/types 2 extra/bond/per/atom 20 extra/special/per/atom 50 +Created orthogonal box = (-39.685026 -34.922823 -34.922823) to (23.811016 34.922823 34.922823) + 1 by 2 by 2 MPI processor grid + +region disk cylinder x 0.0 0.0 20.0 -0.5 0.5 +create_atoms 1 region disk +Created 7529 atoms + using lattice units in orthogonal box = (-39.685026 -34.922823 -34.922823) to (23.811016 34.922823 34.922823) + create_atoms CPU = 0.001 seconds +group plate region disk +7529 atoms in group plate + +region ball sphere 8.0 0.0 0.0 6.0 +create_atoms 1 region ball +Created 3589 atoms + using lattice units in orthogonal box = (-39.685026 -34.922823 -34.922823) to (23.811016 34.922823 34.922823) + create_atoms CPU = 0.000 seconds +group projectile region ball +3589 atoms in group projectile + +displace_atoms all random 0.1 0.1 0.1 134598738 +Displacing atoms ... + +mass 1 1.0 + +neighbor 1.0 bin +pair_style bpm/spring +pair_coeff 1 1 1.0 1.0 1.0 + +fix 1 all nve + +create_bonds many plate plate 1 0.0 1.5 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2 + ghost atom cutoff = 2.6 + binsize = 1, bins = 64 70 70 + 2 neighbor lists, perpetual/occasional/extra = 1 1 0 + (1) command create_bonds, occasional + attributes: full, newton on + pair build: full/bin + stencil: full/bin/3d + bin: standard + (2) pair bpm/spring, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Added 38559 bonds, new total = 38559 +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 1 1 + special bond factors coul: 0 1 1 + 15 = max # of 1-2 neighbors + 101 = max # of special neighbors + special bonds CPU = 0.001 seconds +create_bonds many projectile projectile 2 0.0 1.5 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +WARNING: Bonds are defined but no bond style is set (../force.cpp:192) +WARNING: Likewise 1-2 special neighbor interactions != 1.0 (../force.cpp:194) +Added 21869 bonds, new total = 60428 +Finding 1-2 1-3 1-4 neighbors ... + special bond factors lj: 0 1 1 + special bond factors coul: 0 1 1 + 16 = max # of 1-2 neighbors + 101 = max # of special neighbors + special bonds CPU = 0.001 seconds + +neighbor 0.3 bin +special_bonds lj 0.0 1.0 1.0 coul 1.0 1.0 1.0 + +bond_style bpm/spring store/local brkbond 100 time id1 id2 +bond_coeff 1 1.0 0.04 1.0 +bond_coeff 2 1.0 0.20 1.0 + +velocity projectile set -0.05 0.0 0.0 +compute nbond all nbond/atom +compute tbond all reduce sum c_nbond + +timestep 0.1 +thermo_style custom step ke pe pxx pyy pzz c_tbond +thermo 100 +thermo_modify lost ignore lost/bond ignore +#dump 1 all custom 100 atomDump id x y z c_nbond + +dump 2 all local 100 brokenDump f_brkbond[1] f_brkbond[2] f_brkbond[3] +dump_modify 2 header no + +run 7500 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.3 + ghost atom cutoff = 2.6 + binsize = 0.65, bins = 98 108 108 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair bpm/spring, perpetual + attributes: half, newton on + pair build: half/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 17.74 | 17.74 | 17.74 Mbytes +Step KinEng PotEng Pxx Pyy Pzz c_tbond + 0 0.0010167873 0 7.298968e-05 0 0 10.8703 + 100 0.0010167873 0 7.298968e-05 -8.7429897e-20 -8.8470837e-20 10.8703 + 200 0.0010167873 0 7.298968e-05 -7.2809565e-20 -8.0915788e-20 10.8703 + 300 0.0009951439 0 9.9273671e-05 8.1569216e-06 8.0922512e-06 10.868142 + 400 0.00095142792 0 0.00012669557 -1.3413721e-05 -1.4800745e-05 10.849793 + 500 0.00092272662 0 8.1708784e-05 -9.7488701e-06 -1.3603634e-05 10.819752 + 600 0.00088967612 0 6.2587266e-05 -5.1954127e-06 -6.781587e-06 10.797985 + 700 0.00086070919 0 8.8529902e-05 -9.9431205e-06 -7.9905211e-06 10.776579 + 800 0.00083543943 0 7.5920357e-05 3.6381024e-07 3.7747551e-06 10.759309 + 900 0.00081190799 0 6.3678219e-05 5.4158243e-06 1.2751247e-05 10.744199 + 1000 0.00078828988 0 7.3079869e-05 -6.6410613e-06 -1.198683e-06 10.728368 + 1100 0.00075664718 0 6.2976995e-05 -4.7863299e-06 -3.9814556e-06 10.711819 + 1200 0.00072472205 0 4.9680233e-05 9.3093553e-06 4.4426393e-06 10.69401 + 1300 0.00070176532 0 5.4048176e-05 1.3051954e-05 7.5448558e-06 10.671164 + 1400 0.00068599319 0 5.4062404e-05 9.9930199e-06 1.0353154e-05 10.650117 + 1500 0.0006786164 0 4.5038593e-05 8.067571e-06 9.8825461e-06 10.636266 + 1600 0.00067466823 0 4.6733251e-05 9.8595584e-06 1.1551081e-05 10.621335 + 1700 0.00066847126 0 5.1472453e-05 2.1569974e-07 6.0070599e-06 10.6127 + 1800 0.00065711827 0 5.0355189e-05 -8.030203e-06 -3.1395588e-06 10.599568 + 1900 0.00063882539 0 4.7146888e-05 -2.0596242e-05 -1.6494542e-05 10.581939 + 2000 0.00061717894 0 4.6698781e-05 -2.5473048e-05 -2.7703615e-05 10.567188 + 2100 0.00059261327 0 3.7701055e-05 -2.4637803e-05 -3.3919162e-05 10.552617 + 2200 0.00056527158 0 3.2239421e-05 -1.8786685e-05 -2.4202734e-05 10.538406 + 2300 0.00054054919 0 2.7410334e-05 -6.701111e-06 -7.4354974e-06 10.520777 + 2400 0.00051820065 0 2.2997206e-05 1.5623767e-05 1.8687824e-05 10.501889 + 2500 0.00049647925 0 1.746693e-05 2.8814144e-05 3.5569425e-05 10.487498 + 2600 0.00047837258 0 1.4127067e-05 3.4245611e-05 4.0208577e-05 10.472387 + 2700 0.00046626924 0 1.3714876e-05 3.7922196e-05 4.1550346e-05 10.456377 + 2800 0.0004560167 0 1.5260976e-05 3.5632577e-05 3.7885738e-05 10.440007 + 2900 0.00045331059 0 1.5194832e-05 3.1036124e-05 2.8633755e-05 10.427955 + 3000 0.00045227799 0 1.4877378e-05 1.9327028e-05 2.1189487e-05 10.414283 + 3100 0.00044866178 0 2.0424612e-05 -2.7242288e-06 7.7121438e-06 10.40349 + 3200 0.00044336453 0 2.3276121e-05 -1.979069e-05 -4.2311089e-06 10.395575 + 3300 0.00043526526 0 2.3338132e-05 -2.834945e-05 -1.7302033e-05 10.389998 + 3400 0.00042817758 0 2.4374527e-05 -2.9870076e-05 -3.0623264e-05 10.382803 + 3500 0.00042182658 0 2.6120627e-05 -2.9449521e-05 -3.787776e-05 10.378126 + 3600 0.00041794291 0 2.4736957e-05 -2.4098172e-05 -3.0529166e-05 10.373628 + 3700 0.0004156005 0 2.7543305e-05 -1.2431749e-05 -1.8626096e-05 10.37075 + 3800 0.0004141461 0 2.4630482e-05 -6.345489e-06 -1.7375803e-05 10.368771 + 3900 0.00041328832 0 2.2220142e-05 4.1471034e-07 -1.3339476e-05 10.366972 + 4000 0.00041121725 0 2.3491321e-05 1.1284551e-05 -5.8651834e-06 10.364634 + 4100 0.00040761876 0 2.6688248e-05 1.9721625e-05 3.7536871e-06 10.362655 + 4200 0.00040301362 0 2.7601916e-05 1.9212118e-05 9.7175996e-06 10.359417 + 4300 0.00040001545 0 2.7243769e-05 1.6889359e-05 1.1857147e-05 10.3551 + 4400 0.00039654521 0 2.561083e-05 1.3863551e-05 1.0593597e-05 10.351142 + 4500 0.00039435924 0 2.4366458e-05 1.2545563e-05 1.1323962e-05 10.348804 + 4600 0.00039250006 0 2.3719127e-05 1.1015167e-05 8.5964046e-06 10.348444 + 4700 0.00039145496 0 2.2943915e-05 8.7824224e-06 5.0397129e-06 10.346825 + 4800 0.00039105331 0 2.4005757e-05 7.5899773e-06 9.033741e-07 10.344846 + 4900 0.0003898798 0 2.3819433e-05 4.9673894e-06 -2.3466459e-06 10.343587 + 5000 0.00038747508 0 2.3605028e-05 -1.1717437e-06 -6.1096657e-06 10.343047 + 5100 0.00038549022 0 2.3453798e-05 -9.9256693e-06 -9.3584148e-06 10.341788 + 5200 0.00038283936 0 2.5243567e-05 -1.5877598e-05 -9.9474447e-06 10.340169 + 5300 0.00038140888 0 2.5522223e-05 -1.9331435e-05 -1.1067039e-05 10.33873 + 5400 0.00037916674 0 2.5181488e-05 -2.1581255e-05 -1.1252641e-05 10.336931 + 5500 0.00037782932 0 2.691805e-05 -1.5768241e-05 -5.6704695e-06 10.334952 + 5600 0.00037628832 0 2.5851445e-05 -1.4239811e-05 -1.9122536e-06 10.333153 + 5700 0.00037451913 0 2.4758416e-05 -1.3252284e-05 -1.9222041e-06 10.331714 + 5800 0.00037328662 0 2.2507032e-05 -9.6704092e-06 -7.5470215e-06 10.330095 + 5900 0.00037253111 0 2.3303086e-05 -4.2828034e-06 -7.888056e-06 10.328476 + 6000 0.00037171133 0 2.4042456e-05 -4.7684985e-06 -6.5164336e-06 10.327397 + 6100 0.00036986726 0 2.4938695e-05 -4.8738316e-06 -4.5380007e-06 10.327037 + 6200 0.0003675822 0 2.3322229e-05 -4.6333093e-06 -5.7086464e-06 10.327037 + 6300 0.00036552389 0 2.1435354e-05 -4.8971566e-06 -3.5935426e-06 10.327037 + 6400 0.00036488091 0 2.0813994e-05 -3.8333319e-06 -3.6595059e-06 10.327037 + 6500 0.00036447973 0 2.2241876e-05 8.7797361e-08 -4.141203e-06 10.327037 + 6600 0.00036383343 0 2.269485e-05 4.9364593e-06 1.3062133e-06 10.326677 + 6700 0.00036305076 0 2.1838759e-05 6.4587048e-06 4.7758772e-06 10.326318 + 6800 0.00036226601 0 2.2916622e-05 6.044926e-06 5.0291597e-06 10.325598 + 6900 0.00036175279 0 2.2691667e-05 6.9998847e-06 5.8988637e-06 10.324699 + 7000 0.00036143633 0 2.1725813e-05 8.1268152e-06 5.0390503e-06 10.324519 + 7100 0.0003610248 0 2.1799675e-05 8.65795e-06 3.1360368e-06 10.323439 + 7200 0.00036086259 0 2.2198029e-05 5.1764734e-06 5.4798783e-07 10.32308 + 7300 0.00036099757 0 2.4160496e-05 1.0310325e-06 -5.115075e-07 10.32254 + 7400 0.00036129334 0 2.5325018e-05 -9.4918158e-07 -1.7064957e-06 10.32218 + 7500 0.00036136655 0 2.3513198e-05 -3.8618451e-06 -4.4344772e-06 10.321281 +Loop time of 4.51074 on 4 procs for 7500 steps with 11118 atoms + +Performance: 14365719.597 tau/day, 1662.699 timesteps/s +93.8% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.25733 | 0.26952 | 0.28068 | 1.6 | 5.98 +Bond | 1.9391 | 2.0128 | 2.0851 | 3.7 | 44.62 +Neigh | 0.56308 | 0.5941 | 0.62077 | 2.8 | 13.17 +Comm | 0.68282 | 0.80856 | 0.94406 | 10.7 | 17.93 +Output | 0.19287 | 0.1933 | 0.19426 | 0.1 | 4.29 +Modify | 0.53239 | 0.55343 | 0.57349 | 2.0 | 12.27 +Other | | 0.07902 | | | 1.75 + +Nlocal: 2779.5 ave 2862 max 2686 min +Histogram: 1 0 0 0 0 1 1 0 0 1 +Nghost: 1183.25 ave 1220 max 1134 min +Histogram: 1 0 0 0 1 0 0 0 1 1 +Neighs: 11828.8 ave 12387 max 11053 min +Histogram: 1 0 0 0 1 0 0 0 1 1 + +Total # of neighbors = 47315 +Ave neighs/atom = 4.2557115 +Ave special neighs/atom = 10.321461 +Neighbor list builds = 421 +Dangerous builds = 11 +Total wall time: 0:00:04 diff --git a/examples/bpm/pour/in.bpm.pour b/examples/bpm/pour/in.bpm.pour new file mode 100644 index 0000000000..e4cc8557a3 --- /dev/null +++ b/examples/bpm/pour/in.bpm.pour @@ -0,0 +1,35 @@ +units lj +dimension 3 +boundary m m m +atom_style bpm/sphere +special_bonds lj 0.0 1.0 1.0 coul 1.0 1.0 1.0 +newton on off +comm_modify vel yes cutoff 3.3 +region box block -15 15 -15 15 0 60.0 +create_box 1 box bond/types 1 extra/bond/per/atom 15 extra/special/per/atom 50 + +molecule my_mol "rect.mol" +region wall_cyl cylinder z 0.0 0.0 10.0 EDGE EDGE side in +region dropzone cylinder z 0.0 0.0 10.0 40.0 50.0 side in + +pair_style gran/hertz/history 1.0 NULL 0.5 NULL 0.1 1 +bond_style bpm/rotational +pair_coeff 1 1 +bond_coeff 1 1.0 0.2 0.01 0.01 2.0 0.4 0.02 0.02 0.2 0.04 0.002 0.002 + +compute nbond all nbond/atom +compute tbond all reduce sum c_nbond +compute_modify thermo_temp dynamic/dof yes + +fix 1 all wall/gran hertz/history 1.0 NULL 0.5 NULL 0.1 1 zplane 0.0 NULL +fix 2 all wall/gran/region hertz/history 1.0 NULL 0.5 NULL 0.1 1 region wall_cyl +fix 3 all gravity 1e-4 vector 0 0 -1 +fix 4 all deposit 40 0 1500 712511343 mol my_mol region dropzone near 2.0 vz -0.05 -0.05 +fix 5 all nve/bpm/sphere + +timestep 0.05 +thermo_style custom step ke pe pxx pyy pzz c_tbond +thermo 100 +#dump 1 all custom 500 atomDump id radius x y z c_nbond mol + +run 100000 diff --git a/examples/bpm/pour/log.17Feb2022.pour.g++.4 b/examples/bpm/pour/log.17Feb2022.pour.g++.4 new file mode 100644 index 0000000000..a61c0f1181 --- /dev/null +++ b/examples/bpm/pour/log.17Feb2022.pour.g++.4 @@ -0,0 +1,1091 @@ +LAMMPS (17 Feb 2022) +units lj +dimension 3 +boundary m m m +atom_style bpm/sphere +special_bonds lj 0.0 1.0 1.0 coul 1.0 1.0 1.0 +newton on off +comm_modify vel yes cutoff 3.3 +region box block -15 15 -15 15 0 60.0 +create_box 1 box bond/types 1 extra/bond/per/atom 15 extra/special/per/atom 50 +Created orthogonal box = (-15 -15 0) to (15 15 60) + 1 by 1 by 4 MPI processor grid + +molecule my_mol "rect.mol" +Read molecule template my_mol: + 1 molecules + 0 fragments + 63 atoms with max type 1 + 297 bonds with max type 1 + 0 angles with max type 0 + 0 dihedrals with max type 0 + 0 impropers with max type 0 +region wall_cyl cylinder z 0.0 0.0 10.0 EDGE EDGE side in +region dropzone cylinder z 0.0 0.0 10.0 40.0 50.0 side in + +pair_style gran/hertz/history 1.0 NULL 0.5 NULL 0.1 1 +bond_style bpm/rotational +pair_coeff 1 1 +bond_coeff 1 1.0 0.2 0.01 0.01 2.0 0.4 0.02 0.02 0.2 0.04 0.002 0.002 + +compute nbond all nbond/atom +compute tbond all reduce sum c_nbond +compute_modify thermo_temp dynamic/dof yes + +fix 1 all wall/gran hertz/history 1.0 NULL 0.5 NULL 0.1 1 zplane 0.0 NULL +fix 2 all wall/gran/region hertz/history 1.0 NULL 0.5 NULL 0.1 1 region wall_cyl +fix 3 all gravity 1e-4 vector 0 0 -1 +fix 4 all deposit 40 0 1500 712511343 mol my_mol region dropzone near 2.0 vz -0.05 -0.05 +fix 5 all nve/bpm/sphere + +timestep 0.05 +thermo_style custom step ke pe pxx pyy pzz c_tbond +thermo 100 +#dump 1 all custom 500 atomDump id radius x y z c_nbond mol + +run 100000 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 1 steps, delay 10 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 1.3 + ghost atom cutoff = 3.3 + binsize = 0.65, bins = 47 47 93 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair gran/hertz/history, perpetual + attributes: half, newton on, size, history + pair build: half/size/bin/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 6.515 | 6.515 | 6.515 Mbytes +Step KinEng PotEng Pxx Pyy Pzz c_tbond + 0 -0 0 0 0 0 0 + 100 0.0018331948 0 2.0050936e-07 1.2082282e-06 2.8712165e-06 9.4285714 + 200 0.0025933558 0 7.3469794e-07 2.0155735e-06 3.3061759e-06 9.4285714 + 300 0.0036964813 0 3.7946479e-07 5.3005435e-06 2.9691719e-06 9.4285714 + 400 0.0060104433 0 1.5778321e-06 8.4396021e-06 4.0232206e-06 9.4285714 + 500 0.0074435972 0 1.6102287e-06 1.1551491e-05 4.2257246e-06 9.4285714 + 600 0.0077862298 0 1.048357e-06 1.3758458e-05 3.3770448e-06 9.4285714 + 700 0.0075577591 0 1.1527593e-06 1.2533681e-05 3.9545936e-06 9.4285714 + 800 0.0073958844 0 1.1164823e-06 1.2917327e-05 3.2263757e-06 9.4285714 + 900 0.007553697 0 1.190904e-06 1.3294768e-05 3.1421027e-06 9.4285714 + 1000 0.0075815901 0 1.0181785e-06 1.3265265e-05 3.4107996e-06 9.4285714 + 1100 0.0075277384 0 2.0708356e-06 1.2219251e-05 3.2773337e-06 9.4285714 + 1200 0.0075026507 0 1.8286317e-06 1.2395764e-05 3.2819583e-06 9.4285714 + 1300 0.0075665473 0 1.8498736e-06 1.2455125e-05 3.3519775e-06 9.4285714 + 1400 0.0076224701 0 3.1234422e-06 1.0777609e-05 3.8865172e-06 9.4285714 + 1500 0.007603467 0 2.8536732e-06 1.1077739e-05 3.8107558e-06 9.4285714 + 1600 0.0059810407 0 4.3809396e-06 1.6996767e-05 6.5539764e-06 9.4285714 + 1700 0.0080230318 0 5.7884097e-06 2.4435559e-05 7.2370109e-06 9.4285714 + 1800 0.0087482398 0 5.9323986e-06 2.7190078e-05 7.7151041e-06 9.4285714 + 1900 0.0086877574 0 6.1023555e-06 2.6625737e-05 7.8193078e-06 9.4285714 + 2000 0.0086771118 0 6.1635853e-06 2.633267e-05 8.0008845e-06 9.4285714 + 2100 0.0084670091 0 6.7873752e-06 2.5434046e-05 9.0971224e-06 9.4285714 + 2200 0.0083650907 0 8.1704442e-06 2.3699108e-05 8.4515642e-06 9.4285714 + 2300 0.0083549595 0 8.2648511e-06 2.2510949e-05 8.2508581e-06 9.4285714 + 2400 0.0083151535 0 7.7718631e-06 2.2224878e-05 8.8086351e-06 9.4285714 + 2500 0.0083898757 0 7.1987828e-06 2.2855932e-05 9.1000336e-06 9.4285714 + 2600 0.0084145705 0 6.968992e-06 2.3030741e-05 9.2694955e-06 9.4285714 + 2700 0.0082712696 0 7.5971438e-06 2.3186553e-05 1.026296e-05 9.4285714 + 2800 0.0073688706 0 1.0092165e-05 1.6341178e-05 1.0496887e-05 9.4285714 + 2900 0.0072732669 0 8.9857642e-06 1.454313e-05 1.0637501e-05 9.4285714 + 3000 0.0072225948 0 8.5616417e-06 1.4225089e-05 1.0924921e-05 9.4285714 + 3100 0.0048244969 0 6.912522e-06 1.30395e-05 1.3824006e-05 9.4285714 + 3200 0.0045717035 0 5.7159512e-06 1.1181938e-05 1.5108391e-05 9.4285714 + 3300 0.0047679567 0 6.0163783e-06 1.1603014e-05 1.5759942e-05 9.4285714 + 3400 0.0048448212 0 6.3252851e-06 1.2378054e-05 1.5212593e-05 9.4285714 + 3500 0.0048364711 0 6.4847771e-06 1.2719874e-05 1.4888067e-05 9.4285714 + 3600 0.0047125947 0 7.5131511e-06 1.375252e-05 1.5244253e-05 9.4285714 + 3700 0.0045641049 0 7.3441262e-06 1.2981907e-05 1.5049034e-05 9.4285714 + 3800 0.0045540235 0 6.8443099e-06 1.1748155e-05 1.4685806e-05 9.4285714 + 3900 0.0047271202 0 6.7919886e-06 1.2153009e-05 1.4801772e-05 9.4285714 + 4000 0.0049115261 0 6.9084016e-06 1.2385892e-05 1.5231153e-05 9.4285714 + 4100 0.0046819157 0 6.4190119e-06 1.1228312e-05 1.5132413e-05 9.4285714 + 4200 0.0035133816 0 3.6896921e-06 6.5442286e-06 1.4368405e-05 9.4285714 + 4300 0.0031933917 0 1.9641761e-06 3.4983806e-06 1.6912795e-05 9.4285714 + 4400 0.0033515272 0 2.3967939e-06 4.0160705e-06 1.7056596e-05 9.4285714 + 4500 0.0034928951 0 3.0724834e-06 4.4355514e-06 1.6962392e-05 9.4285714 + 4600 0.0029992338 0 3.319899e-06 4.3436095e-06 2.0334274e-05 9.4285714 + 4700 0.0030650658 0 3.9633397e-06 5.6588274e-06 1.8991224e-05 9.4285714 + 4800 0.0031180382 0 4.925768e-06 6.3708181e-06 1.7810728e-05 9.4285714 + 4900 0.0030365003 0 4.6849771e-06 5.6291872e-06 1.8029418e-05 9.4285714 + 5000 0.0030259714 0 5.1846803e-06 5.5730554e-06 1.7488984e-05 9.4285714 + 5100 0.0030499975 0 5.6322417e-06 5.9148203e-06 1.6923105e-05 9.4285714 + 5200 0.003005436 0 5.6903188e-06 5.6637593e-06 1.6700127e-05 9.4285714 + 5300 0.0030000941 0 5.7591855e-06 5.3398134e-06 1.6904108e-05 9.4285714 + 5400 0.0031465827 0 6.1148362e-06 6.2148373e-06 1.7041724e-05 9.4285714 + 5500 0.0031981585 0 5.8718482e-06 5.9970835e-06 1.7984043e-05 9.4285714 + 5600 0.0031525115 0 5.3390747e-06 5.1610119e-06 1.8924721e-05 9.4285714 + 5700 0.0032128781 0 5.6775112e-06 5.2023225e-06 1.9109577e-05 9.4285714 + 5800 0.0030092855 0 5.7676512e-06 4.4808095e-06 2.1160289e-05 9.4285714 + 5900 0.0025015767 0 6.5110611e-06 5.0853279e-06 2.290709e-05 9.4285714 + 6000 0.0024438438 0 6.4803568e-06 4.9314657e-06 2.1450483e-05 9.4285714 + 6100 0.0023816456 0 4.2004621e-06 4.3412206e-06 2.3366694e-05 9.4285714 + 6200 0.0024459343 0 3.4052114e-06 2.3122757e-06 2.3018902e-05 9.4285714 + 6300 0.0025205884 0 3.0607555e-06 2.7404005e-06 2.3612151e-05 9.4285714 + 6400 0.0033754198 0 5.4041464e-06 1.0129204e-05 2.3881911e-05 9.4285714 + 6500 0.0037812296 0 6.9287106e-06 1.2845513e-05 2.4385157e-05 9.4285714 + 6600 0.0038043567 0 4.4366794e-06 1.559564e-05 2.4372156e-05 9.4285714 + 6700 0.0038213959 0 5.6461713e-06 1.6081939e-05 2.556403e-05 9.4285714 + 6800 0.0036977776 0 6.1083638e-06 1.3260883e-05 2.8030458e-05 9.4285714 + 6900 0.0034769765 0 4.281986e-06 1.4287795e-05 2.803258e-05 9.4285714 + 7000 0.0031526409 0 4.8687091e-06 1.1290097e-05 2.9635973e-05 9.4285714 + 7100 0.00317737 0 4.866629e-06 9.8108506e-06 3.1076433e-05 9.4285714 + 7200 0.0034448361 0 4.6533797e-06 1.15597e-05 3.0195614e-05 9.4285714 + 7300 0.0036147362 0 3.4867601e-06 1.2192841e-05 3.0431851e-05 9.4285714 + 7400 0.0035651675 0 2.812314e-06 1.0900977e-05 2.9422055e-05 9.4285714 + 7500 0.0036394064 0 2.6684242e-06 1.038371e-05 2.9650533e-05 9.4285714 + 7600 0.0033086177 0 2.6357178e-06 1.0363505e-05 3.3327311e-05 9.4285714 + 7700 0.0033410425 0 3.9955363e-06 9.2059943e-06 3.3580724e-05 9.4285714 + 7800 0.0035764747 0 7.127102e-06 8.9311151e-06 3.402089e-05 9.4285714 + 7900 0.0039500913 0 1.1222589e-05 9.0137729e-06 3.5074285e-05 9.4285714 + 8000 0.0042963353 0 1.5982303e-05 8.4904673e-06 3.5704562e-05 9.4285714 + 8100 0.0048297614 0 2.2809259e-05 7.6782291e-06 3.714467e-05 9.4285714 + 8200 0.0052301447 0 2.8015774e-05 6.9131186e-06 3.8310186e-05 9.4285714 + 8300 0.005169511 0 2.8580467e-05 6.1476914e-06 3.7651259e-05 9.4285714 + 8400 0.005224324 0 2.9402221e-05 5.0117679e-06 3.873174e-05 9.4285714 + 8500 0.0053049309 0 3.0666777e-05 4.125785e-06 3.9482985e-05 9.4285714 + 8600 0.0052459952 0 3.0525628e-05 4.1952646e-06 3.8726938e-05 9.4285714 + 8700 0.0052955657 0 3.0177531e-05 5.0224986e-06 3.8941323e-05 9.4285714 + 8800 0.0053972257 0 3.1021226e-05 5.261711e-06 3.9283466e-05 9.4285714 + 8900 0.0053679679 0 3.1133172e-05 4.9109387e-06 3.9111316e-05 9.4285714 + 9000 0.0053793586 0 3.0629197e-05 5.8147275e-06 3.8870113e-05 9.4285714 + 9100 0.0048447626 0 3.0571485e-05 6.6542996e-06 4.1908678e-05 9.4285714 + 9200 0.0048688926 0 3.0874982e-05 6.5780749e-06 4.2143302e-05 9.4285714 + 9300 0.0048538957 0 3.0564193e-05 8.1762092e-06 4.2503239e-05 9.4285714 + 9400 0.0046986454 0 2.8378911e-05 1.0639019e-05 4.4317403e-05 9.4285714 + 9500 0.0046145139 0 2.513485e-05 1.036053e-05 4.5570422e-05 9.4285714 + 9600 0.0045277961 0 2.056713e-05 9.8647996e-06 4.5858869e-05 9.4285714 + 9700 0.0043935298 0 1.8390341e-05 9.0322729e-06 4.6271482e-05 9.4285714 + 9800 0.0045363488 0 2.0469706e-05 9.7216528e-06 4.5805899e-05 9.4285714 + 9900 0.0046509978 0 1.9525081e-05 9.5233466e-06 4.862056e-05 9.4285714 + 10000 0.0046493894 0 1.7602305e-05 9.4408537e-06 5.0053515e-05 9.4285714 + 10100 0.0046514856 0 1.6724832e-05 9.9699479e-06 4.928713e-05 9.4285714 + 10200 0.0046209533 0 1.4889196e-05 1.0767419e-05 4.9829248e-05 9.4285714 + 10300 0.0044651031 0 1.0578209e-05 1.1339471e-05 5.1024934e-05 9.4285714 + 10400 0.0041834162 0 6.5253227e-06 1.099852e-05 5.0813498e-05 9.4285714 + 10500 0.0043218845 0 7.2170142e-06 1.2622523e-05 5.0759877e-05 9.4285714 + 10600 0.0045795722 0 1.0140572e-05 2.1058806e-05 5.4332689e-05 9.4285714 + 10700 0.0053833569 0 1.2245942e-05 3.2705455e-05 5.5584298e-05 9.4285714 + 10800 0.0056805981 0 9.642689e-06 4.0045088e-05 5.6378884e-05 9.4285714 + 10900 0.0057157307 0 9.8421383e-06 3.9670248e-05 5.7196914e-05 9.4285714 + 11000 0.005696424 0 1.1871435e-05 3.7351501e-05 5.7130853e-05 9.4285714 + 11100 0.0052078884 0 9.5005747e-06 3.612037e-05 5.1606236e-05 9.4285714 + 11200 0.0052849159 0 1.433919e-05 3.596257e-05 4.8371986e-05 9.4285714 + 11300 0.0054074494 0 1.2828165e-05 3.7628808e-05 5.0495681e-05 9.4285714 + 11400 0.0055432168 0 1.1770167e-05 3.7223129e-05 5.4498301e-05 9.4285714 + 11500 0.0054679467 0 1.1215128e-05 3.5612418e-05 5.5880978e-05 9.4285714 + 11600 0.0052706441 0 1.0611988e-05 3.5785457e-05 5.8094083e-05 9.4285714 + 11700 0.0053724243 0 1.1867616e-05 3.484887e-05 5.7967416e-05 9.4285714 + 11800 0.0054759961 0 9.3774866e-06 3.3307362e-05 6.0256027e-05 9.4285714 + 11900 0.0051146604 0 9.5582838e-06 3.1092749e-05 5.4847298e-05 9.4285714 + 12000 0.0049723565 0 8.4734692e-06 3.1240602e-05 5.3118854e-05 9.4285714 + 12100 0.0046920113 0 8.8947651e-06 3.3402795e-05 5.6254952e-05 9.4285714 + 12200 0.0049570244 0 1.0006616e-05 3.306729e-05 6.1049649e-05 9.4285714 + 12300 0.0049181458 0 8.1394364e-06 3.2634327e-05 6.2527089e-05 9.4285714 + 12400 0.0049245342 0 8.1971979e-06 3.3145464e-05 6.2091332e-05 9.4285714 + 12500 0.0049753042 0 8.9911646e-06 3.4018861e-05 6.1487068e-05 9.4285714 + 12600 0.0048148791 0 8.560766e-06 2.9647432e-05 6.2929427e-05 9.4285714 + 12700 0.0043852178 0 7.5889296e-06 1.8576839e-05 6.5947945e-05 9.4285714 + 12800 0.0041967317 0 8.6473249e-06 1.3892779e-05 6.6599779e-05 9.4285714 + 12900 0.0041911278 0 9.3489002e-06 1.8180223e-05 6.3308096e-05 9.4285714 + 13000 0.0043107924 0 8.5274073e-06 2.2286145e-05 5.9964925e-05 9.4285714 + 13100 0.0043976521 0 8.2741734e-06 2.4530103e-05 5.9567889e-05 9.4285714 + 13200 0.0043474635 0 9.2173493e-06 2.7514155e-05 5.4579308e-05 9.4285714 + 13300 0.0044593969 0 9.3356325e-06 3.0558484e-05 5.3771437e-05 9.4285714 + 13400 0.0044814342 0 9.2387466e-06 2.8998024e-05 5.5887559e-05 9.4285714 + 13500 0.0043982498 0 9.4867492e-06 2.5493297e-05 5.7396094e-05 9.4285714 + 13600 0.0039378503 0 1.0789003e-05 1.9448677e-05 6.1667698e-05 9.4285714 + 13700 0.0036474735 0 1.0885233e-05 1.5729573e-05 5.8520214e-05 9.4285714 + 13800 0.0038236277 0 1.3819358e-05 2.0470733e-05 5.4960098e-05 9.4285714 + 13900 0.0040574402 0 1.6741444e-05 2.391221e-05 5.4045411e-05 9.4285714 + 14000 0.0046440817 0 2.2494809e-05 2.9264007e-05 5.6648145e-05 9.4285714 + 14100 0.0048045755 0 2.2568279e-05 3.260884e-05 5.6960992e-05 9.4285714 + 14200 0.004634799 0 2.2650329e-05 2.7912328e-05 5.7597129e-05 9.4285714 + 14300 0.0046822822 0 2.3142295e-05 2.8536673e-05 5.7795199e-05 9.4285714 + 14400 0.0048282958 0 2.2560586e-05 3.2744704e-05 5.8133575e-05 9.4285714 + 14500 0.004799276 0 2.1374014e-05 3.1342428e-05 6.0569089e-05 9.4285714 + 14600 0.0046554419 0 2.0804876e-05 2.8534311e-05 6.0800428e-05 9.4285714 + 14700 0.0045262414 0 2.1835372e-05 2.8168699e-05 6.2901651e-05 9.4285714 + 14800 0.0043347498 0 1.9615887e-05 3.1686326e-05 6.4194237e-05 9.4285714 + 14900 0.0040641791 0 1.8621801e-05 2.7440899e-05 6.4602045e-05 9.4285714 + 15000 0.0040014911 0 1.6461776e-05 2.5832508e-05 6.08965e-05 9.4285714 + 15100 0.0040015198 0 2.2331361e-05 2.6108777e-05 5.9319862e-05 9.4285714 + 15200 0.004656209 0 3.5268101e-05 3.0082568e-05 5.958373e-05 9.4285714 + 15300 0.0047390215 0 4.1830227e-05 2.7233725e-05 5.8274008e-05 9.4285714 + 15400 0.0047219857 0 4.2798722e-05 2.8282959e-05 5.786682e-05 9.4285714 + 15500 0.0049597215 0 4.5190515e-05 2.9504603e-05 6.2435065e-05 9.4285714 + 15600 0.0049081505 0 4.3186089e-05 2.9977425e-05 6.1726635e-05 9.4285714 + 15700 0.0047978977 0 4.1446883e-05 2.7814159e-05 5.7947919e-05 9.4285714 + 15800 0.0048176861 0 3.9941014e-05 2.6548461e-05 5.9246093e-05 9.4285714 + 15900 0.0049895331 0 4.0485733e-05 2.8703855e-05 6.3382653e-05 9.4285714 + 16000 0.0049288669 0 3.892315e-05 2.9191325e-05 6.2118616e-05 9.4285714 + 16100 0.0048010252 0 3.7199431e-05 2.7134167e-05 6.1752588e-05 9.4285714 + 16200 0.0047925554 0 3.5806262e-05 2.5024463e-05 6.3068301e-05 9.4285714 + 16300 0.0047652048 0 3.3940221e-05 2.6543134e-05 6.7111166e-05 9.4285714 + 16400 0.0043495894 0 3.4655351e-05 1.8892916e-05 6.5825804e-05 9.4285714 + 16500 0.0042677893 0 3.4188541e-05 1.7570016e-05 6.3850178e-05 9.4285714 + 16600 0.0039924053 0 3.2417741e-05 1.7848282e-05 6.5817879e-05 9.4285714 + 16700 0.004110225 0 3.3539186e-05 1.9943078e-05 6.4568545e-05 9.4285714 + 16800 0.0041003344 0 3.6503679e-05 2.0546394e-05 6.2227252e-05 9.4285714 + 16900 0.0040916821 0 3.7342085e-05 2.384663e-05 6.0859481e-05 9.4285714 + 17000 0.0039812122 0 3.671505e-05 2.4137888e-05 5.6933083e-05 9.4285714 + 17100 0.0042480582 0 3.9654732e-05 2.4691844e-05 5.8210554e-05 9.4285714 + 17200 0.0044450353 0 4.0933677e-05 3.019578e-05 5.5604765e-05 9.4285714 + 17300 0.0045016689 0 4.0563484e-05 3.4710888e-05 5.2933625e-05 9.4285714 + 17400 0.0044798864 0 4.0768397e-05 3.3076261e-05 5.2287655e-05 9.4285714 + 17500 0.0044624458 0 3.8361144e-05 3.4320802e-05 5.4620342e-05 9.4285714 + 17600 0.0044477024 0 3.6643486e-05 3.6449296e-05 5.4759028e-05 9.4285714 + 17700 0.0044103517 0 3.8319719e-05 3.7509764e-05 5.0738749e-05 9.4285714 + 17800 0.004341948 0 3.8052635e-05 3.6850602e-05 5.0481977e-05 9.4285714 + 17900 0.0042623319 0 3.5909432e-05 3.5619615e-05 5.2184073e-05 9.4285714 + 18000 0.003726239 0 1.8245827e-05 3.791319e-05 5.0575431e-05 9.4285714 + 18100 0.0034893305 0 1.7957847e-05 3.6788428e-05 5.281228e-05 9.4285714 + 18200 0.0035481187 0 2.2513253e-05 3.461697e-05 5.1791689e-05 9.4285714 + 18300 0.0036251402 0 2.5159661e-05 3.4782379e-05 5.0946509e-05 9.4285714 + 18400 0.0036369749 0 2.4150699e-05 3.6305943e-05 5.0273557e-05 9.4285714 + 18500 0.0034279849 0 2.050142e-05 3.3762641e-05 5.0772554e-05 9.4285714 + 18600 0.0033615572 0 1.8397654e-05 3.3183402e-05 5.2215005e-05 9.4285714 + 18700 0.003406225 0 1.9609619e-05 3.4353871e-05 5.1091792e-05 9.4285714 + 18800 0.0034922323 0 1.9330569e-05 3.4176016e-05 5.2688824e-05 9.4285714 + 18900 0.0034820625 0 1.9280274e-05 3.3807796e-05 5.372272e-05 9.4285714 + 19000 0.0033272524 0 1.6873326e-05 3.594881e-05 5.3862535e-05 9.4285714 + 19100 0.0034010912 0 1.8030816e-05 3.582088e-05 5.4236353e-05 9.4285714 + 19200 0.0030932535 0 1.4863995e-05 2.7793367e-05 5.3934101e-05 9.4285714 + 19300 0.002624051 0 1.210198e-05 1.6467088e-05 5.2583223e-05 9.4285714 + 19400 0.0027583806 0 1.2008108e-05 2.1017092e-05 5.309485e-05 9.4285714 + 19500 0.0029775174 0 1.3352592e-05 2.4636522e-05 5.4043107e-05 9.4285714 + 19600 0.0028689969 0 1.3488363e-05 2.4373881e-05 5.7585286e-05 9.4285714 + 19700 0.0026399127 0 1.4002066e-05 2.7370388e-05 5.4220539e-05 9.4285714 + 19800 0.0025439904 0 1.668679e-05 2.7178009e-05 5.3083248e-05 9.4285714 + 19900 0.0027074939 0 1.5155901e-05 2.5194957e-05 5.3757244e-05 9.4285714 + 20000 0.0027181793 0 1.2268581e-05 2.5236301e-05 5.1395997e-05 9.4285714 + 20100 0.0027315362 0 1.2532955e-05 2.4069296e-05 5.2648391e-05 9.4285714 + 20200 0.0027204191 0 1.2457637e-05 2.419839e-05 5.2229242e-05 9.4285714 + 20300 0.0026457344 0 1.3573924e-05 2.3628429e-05 4.9330286e-05 9.4285714 + 20400 0.0026592475 0 1.3439645e-05 2.4469429e-05 5.1570429e-05 9.4285714 + 20500 0.0026129298 0 1.3261647e-05 2.4468607e-05 5.1163936e-05 9.4285714 + 20600 0.0026532045 0 1.5275975e-05 2.3494207e-05 5.0569472e-05 9.4285714 + 20700 0.0026172433 0 1.4720887e-05 2.1839292e-05 5.0769214e-05 9.4285714 + 20800 0.0025282343 0 1.3852135e-05 2.0845003e-05 4.9690546e-05 9.4285714 + 20900 0.0025383322 0 1.353444e-05 2.2097076e-05 5.1303519e-05 9.4285714 + 21000 0.0024848857 0 1.4032657e-05 2.1964185e-05 5.3050324e-05 9.4285714 + 21100 0.0025091105 0 1.5334232e-05 2.1760041e-05 5.508965e-05 9.4285714 + 21200 0.0027229411 0 1.9418427e-05 2.2335523e-05 5.5657372e-05 9.4285714 + 21300 0.0028888226 0 2.3631969e-05 2.2967648e-05 5.5948438e-05 9.4285714 + 21400 0.0029336429 0 2.5044169e-05 2.2567194e-05 5.5413722e-05 9.4285714 + 21500 0.0029354446 0 2.4712642e-05 2.2624219e-05 5.5920832e-05 9.4285714 + 21600 0.0029270648 0 2.3842417e-05 2.3011885e-05 5.6087719e-05 9.4285714 + 21700 0.0029288781 0 2.3942959e-05 2.2810041e-05 5.7045772e-05 9.4285714 + 21800 0.002884005 0 2.4455829e-05 2.3081577e-05 5.6212968e-05 9.4285714 + 21900 0.0028362206 0 2.3350532e-05 2.49708e-05 5.3642917e-05 9.4285714 + 22000 0.0027784436 0 2.3311918e-05 2.3033334e-05 5.4359393e-05 9.4285714 + 22100 0.0027479829 0 2.4623514e-05 2.0287924e-05 5.3550114e-05 9.4285714 + 22200 0.0027598842 0 2.6073037e-05 2.1629185e-05 5.3119193e-05 9.4285714 + 22300 0.0026078138 0 2.6348246e-05 2.3093425e-05 5.4029431e-05 9.4285714 + 22400 0.0026057112 0 2.7316001e-05 2.4771567e-05 5.3484921e-05 9.4285714 + 22500 0.0026641722 0 2.6434166e-05 2.5849367e-05 5.2175653e-05 9.4285714 + 22600 0.0023728105 0 2.4436322e-05 2.4147316e-05 5.3971034e-05 9.4285714 + 22700 0.0021999097 0 2.4191892e-05 2.2725939e-05 5.3125105e-05 9.4285714 + 22800 0.002178124 0 2.4122577e-05 2.0194755e-05 5.3468522e-05 9.4285714 + 22900 0.0022903704 0 2.1332487e-05 1.8921598e-05 5.4657879e-05 9.4285714 + 23000 0.0022114595 0 1.930828e-05 1.4423335e-05 5.5387271e-05 9.4285714 + 23100 0.0022473179 0 2.0911663e-05 1.3467616e-05 5.4325686e-05 9.4285714 + 23200 0.0022787302 0 2.1538492e-05 1.5779872e-05 5.3591578e-05 9.4285714 + 23300 0.002254193 0 2.0552374e-05 1.7158208e-05 5.201196e-05 9.4285714 + 23400 0.0022032528 0 2.0514024e-05 1.6045426e-05 5.1691057e-05 9.4285714 + 23500 0.0022103262 0 2.2570839e-05 1.4990595e-05 5.0102702e-05 9.4285714 + 23600 0.0022767949 0 2.153875e-05 1.5934866e-05 4.9843486e-05 9.4285714 + 23700 0.002283034 0 2.0348727e-05 1.5852737e-05 4.9211887e-05 9.4285714 + 23800 0.0022293403 0 2.045052e-05 1.3951752e-05 4.9265994e-05 9.4285714 + 23900 0.0022421499 0 2.0541393e-05 1.3873188e-05 4.9783702e-05 9.4285714 + 24000 0.0022708179 0 2.0733448e-05 1.4464939e-05 5.0156761e-05 9.4285714 + 24100 0.0022311644 0 2.1753043e-05 1.4644732e-05 5.3630645e-05 9.4285714 + 24200 0.0022566051 0 2.3030277e-05 1.4212031e-05 5.3868685e-05 9.4285714 + 24300 0.0022547585 0 2.3946322e-05 1.331734e-05 5.2948407e-05 9.4285714 + 24400 0.0022901257 0 2.552016e-05 1.4594528e-05 5.3067402e-05 9.4285714 + 24500 0.0023537103 0 2.9369007e-05 1.5861923e-05 5.3200721e-05 9.4285714 + 24600 0.0023613708 0 2.9444021e-05 1.3691716e-05 5.4296289e-05 9.4285714 + 24700 0.0023237992 0 2.8805716e-05 1.1616027e-05 5.4142589e-05 9.4285714 + 24800 0.0024221927 0 3.1070958e-05 1.2059146e-05 5.406912e-05 9.4285714 + 24900 0.0025882547 0 3.7453428e-05 1.2082125e-05 5.4439426e-05 9.4285714 + 25000 0.0027152266 0 4.2549028e-05 1.1637136e-05 5.4292043e-05 9.4285714 + 25100 0.0028201154 0 4.6710609e-05 1.2903782e-05 5.3790595e-05 9.4285714 + 25200 0.0029086169 0 4.756645e-05 1.3260261e-05 5.7165687e-05 9.4285714 + 25300 0.0028528211 0 4.8705176e-05 1.1918164e-05 5.632163e-05 9.4285714 + 25400 0.0027655631 0 4.7538544e-05 1.186744e-05 5.3917832e-05 9.4285714 + 25500 0.0027631455 0 4.7296868e-05 1.2125391e-05 5.2651056e-05 9.4285714 + 25600 0.0027455338 0 4.8477007e-05 1.2403172e-05 5.7029384e-05 9.4285714 + 25700 0.0027314337 0 4.8377711e-05 1.254263e-05 5.7035789e-05 9.4285714 + 25800 0.0026789336 0 4.9232002e-05 1.1749936e-05 5.7580068e-05 9.4285714 + 25900 0.0026686904 0 5.0376929e-05 1.2811492e-05 5.9087927e-05 9.4285714 + 26000 0.0026703643 0 5.0974299e-05 1.3064292e-05 5.7801118e-05 9.4285714 + 26100 0.0026825353 0 4.9500137e-05 1.1676376e-05 5.695664e-05 9.4285714 + 26200 0.0026825174 0 4.972182e-05 1.0546822e-05 5.7622991e-05 9.4285714 + 26300 0.0025517718 0 4.36237e-05 1.082888e-05 5.8496458e-05 9.4285714 + 26400 0.002448155 0 3.6914303e-05 1.1208368e-05 6.0071981e-05 9.4285714 + 26500 0.0023334395 0 3.2968743e-05 1.0745176e-05 6.0011765e-05 9.4285714 + 26600 0.0023097701 0 3.0179184e-05 1.1497687e-05 5.9980393e-05 9.4285714 + 26700 0.0023614287 0 3.1929774e-05 1.4076482e-05 5.767606e-05 9.4285714 + 26800 0.0023955623 0 3.1551792e-05 1.7121208e-05 5.8187883e-05 9.4285714 + 26900 0.0019993736 0 1.8807723e-05 1.6770089e-05 5.7954922e-05 9.4285714 + 27000 0.0019497677 0 1.7354388e-05 1.6608976e-05 5.6225802e-05 9.4285714 + 27100 0.0020363076 0 2.1348268e-05 1.6918233e-05 5.7949239e-05 9.4285714 + 27200 0.0021974785 0 2.5205825e-05 2.0142198e-05 5.5376701e-05 9.4285714 + 27300 0.002350289 0 2.8900121e-05 2.3754068e-05 5.5263555e-05 9.4285714 + 27400 0.0026460053 0 3.2553147e-05 3.227333e-05 5.7954104e-05 9.4285714 + 27500 0.0027599044 0 3.2851254e-05 3.674649e-05 5.6341966e-05 9.4285714 + 27600 0.0026660556 0 3.2389038e-05 3.4626306e-05 5.5414375e-05 9.4285714 + 27700 0.0026060398 0 3.3223431e-05 3.2391399e-05 5.3340397e-05 9.4285714 + 27800 0.002724511 0 3.372415e-05 3.4485846e-05 5.4707128e-05 9.4285714 + 27900 0.0027318479 0 3.3234708e-05 3.5304313e-05 5.5589046e-05 9.4285714 + 28000 0.0026231478 0 3.2741313e-05 3.3225541e-05 5.398932e-05 9.4285714 + 28100 0.0025508556 0 3.3833477e-05 3.1513842e-05 5.4023598e-05 9.4285714 + 28200 0.0025807152 0 3.4548289e-05 3.3420009e-05 5.5627424e-05 9.4285714 + 28300 0.0024074206 0 3.0461599e-05 3.4140994e-05 5.6820341e-05 9.4285714 + 28400 0.0021292859 0 2.3624321e-05 3.4194604e-05 5.3656462e-05 9.4285714 + 28500 0.0022172558 0 1.8989998e-05 3.8241372e-05 5.0308571e-05 9.4285714 + 28600 0.0022653927 0 2.0006228e-05 4.1839298e-05 5.3834698e-05 9.4285714 + 28700 0.0025914898 0 2.4417865e-05 5.4161998e-05 5.2309701e-05 9.4285714 + 28800 0.0028276024 0 2.7173934e-05 5.9987722e-05 5.1277434e-05 9.4285714 + 28900 0.0029326653 0 2.9972273e-05 5.9404465e-05 5.3442041e-05 9.4285714 + 29000 0.002965493 0 3.0732118e-05 5.8813779e-05 5.4010354e-05 9.4285714 + 29100 0.0029096903 0 2.789911e-05 5.6948857e-05 5.3811328e-05 9.4285714 + 29200 0.0028604262 0 2.8541368e-05 5.5433392e-05 5.5266978e-05 9.4285714 + 29300 0.0028093312 0 3.1626568e-05 5.2793462e-05 5.9393321e-05 9.4285714 + 29400 0.0026786162 0 2.6580766e-05 4.1761109e-05 6.3731211e-05 9.4285714 + 29500 0.0025387867 0 2.4586262e-05 3.1439522e-05 6.5207101e-05 9.4285714 + 29600 0.0026569564 0 2.658665e-05 3.344894e-05 6.5578568e-05 9.4285714 + 29700 0.0027207144 0 2.4629031e-05 3.1640582e-05 7.3229358e-05 9.4285714 + 29800 0.0026892821 0 2.0092233e-05 2.9124688e-05 8.0756571e-05 9.4285714 + 29900 0.002643369 0 2.0481401e-05 3.0183662e-05 7.7273404e-05 9.4285714 + 30000 0.0026484998 0 1.9889243e-05 3.0560067e-05 7.7261634e-05 9.4285714 + 30100 0.0028058509 0 2.6399165e-05 3.004015e-05 8.3212623e-05 9.4285714 + 30200 0.0030353215 0 3.6921703e-05 3.4899864e-05 7.8543173e-05 9.4285714 + 30300 0.0030244988 0 4.0706399e-05 3.6091245e-05 7.4921988e-05 9.4285714 + 30400 0.0030855053 0 4.2502388e-05 3.8438853e-05 7.6268037e-05 9.4285714 + 30500 0.0031141819 0 4.3996743e-05 4.3726389e-05 6.8459715e-05 9.4285714 + 30600 0.0030115458 0 4.436657e-05 4.2288168e-05 6.5970726e-05 9.4285714 + 30700 0.0029700178 0 4.2448638e-05 4.1066034e-05 6.7905919e-05 9.4285714 + 30800 0.0029985358 0 4.3581039e-05 4.2782359e-05 6.616813e-05 9.4285714 + 30900 0.0029689517 0 4.3664983e-05 4.0341198e-05 6.6701993e-05 9.4285714 + 31000 0.0029622718 0 4.3233863e-05 3.8109114e-05 6.615517e-05 9.4285714 + 31100 0.0029693917 0 4.3443429e-05 3.6045147e-05 6.6807218e-05 9.4285714 + 31200 0.0027246348 0 3.8812502e-05 2.5969873e-05 6.9745525e-05 9.4285714 + 31300 0.0025368424 0 3.4331267e-05 2.1427734e-05 6.9565964e-05 9.4285714 + 31400 0.0023736698 0 3.2043786e-05 1.9880875e-05 6.6817156e-05 9.4285714 + 31500 0.0023946514 0 3.3170726e-05 1.9958211e-05 7.0242984e-05 9.4285714 + 31600 0.0025648037 0 3.5948214e-05 2.4022282e-05 7.8512704e-05 9.4285714 + 31700 0.0026956511 0 3.9195772e-05 3.3270216e-05 7.4223245e-05 9.4285714 + 31800 0.002677722 0 3.8651034e-05 3.4084086e-05 7.3747643e-05 9.4285714 + 31900 0.0026705496 0 3.8515991e-05 3.3258169e-05 7.4757118e-05 9.4285714 + 32000 0.0026466417 0 4.2241836e-05 3.449171e-05 7.0551161e-05 9.4285714 + 32100 0.0026464292 0 4.0974715e-05 3.6570061e-05 6.5387411e-05 9.4285714 + 32200 0.0023705665 0 2.951869e-05 3.011444e-05 6.6589524e-05 9.4285714 + 32300 0.0023183595 0 2.2729207e-05 3.0010044e-05 7.2706128e-05 9.4285714 + 32400 0.0023882969 0 2.372595e-05 3.1302357e-05 7.3782281e-05 9.4285714 + 32500 0.0023801754 0 2.2337455e-05 3.0476386e-05 7.5659736e-05 9.4285714 + 32600 0.0024127958 0 2.5510841e-05 3.0854572e-05 7.4410799e-05 9.4285714 + 32700 0.0024031675 0 2.7736693e-05 3.1958346e-05 7.1486437e-05 9.4285714 + 32800 0.0023770089 0 2.6385534e-05 3.3252416e-05 7.2822578e-05 9.4285714 + 32900 0.0023568819 0 2.8634678e-05 3.3258031e-05 6.7686839e-05 9.4285714 + 33000 0.0023407285 0 2.6769773e-05 3.2579304e-05 6.6690925e-05 9.4285714 + 33100 0.002327332 0 2.6645781e-05 3.4007498e-05 6.9628993e-05 9.4285714 + 33200 0.0023912585 0 2.3830565e-05 3.3441643e-05 7.4913813e-05 9.4285714 + 33300 0.0022984153 0 2.4483639e-05 3.2969557e-05 7.7726941e-05 9.4285714 + 33400 0.0022416368 0 2.3898793e-05 3.1031269e-05 7.686001e-05 9.4285714 + 33500 0.0022470637 0 2.0975902e-05 3.0084834e-05 7.570705e-05 9.4285714 + 33600 0.002256129 0 2.0520324e-05 2.8645032e-05 7.7384366e-05 9.4285714 + 33700 0.0022125246 0 1.9872713e-05 2.9850887e-05 7.5881174e-05 9.4285714 + 33800 0.0021842197 0 1.9711523e-05 2.983205e-05 7.3213854e-05 9.4285714 + 33900 0.0021690567 0 1.8055303e-05 2.828677e-05 7.3059722e-05 9.4285714 + 34000 0.0022206311 0 1.8792994e-05 2.8714121e-05 7.5766963e-05 9.4285714 + 34100 0.0022494061 0 2.1426406e-05 2.9683277e-05 7.5164305e-05 9.4285714 + 34200 0.0022085859 0 2.1896897e-05 2.8930132e-05 7.2805525e-05 9.4285714 + 34300 0.0021855633 0 2.0480867e-05 2.9992196e-05 7.2354191e-05 9.4285714 + 34400 0.0021798298 0 2.1236448e-05 3.2053048e-05 7.283282e-05 9.4285714 + 34500 0.0021267289 0 2.2129794e-05 2.8881701e-05 7.1551685e-05 9.4285714 + 34600 0.0020466804 0 2.3010184e-05 2.7531882e-05 7.2523946e-05 9.4285714 + 34700 0.0020969555 0 2.1337061e-05 3.0266865e-05 7.0863423e-05 9.4285714 + 34800 0.0022946237 0 2.2123517e-05 3.8911524e-05 7.2703415e-05 9.4285714 + 34900 0.0024490201 0 2.8420828e-05 5.0378173e-05 7.1772848e-05 9.4285714 + 35000 0.0023320217 0 2.8176618e-05 5.1789577e-05 6.8023074e-05 9.4285714 + 35100 0.0021890324 0 2.4442013e-05 5.2547725e-05 6.1661973e-05 9.4285714 + 35200 0.0022124553 0 2.4530724e-05 5.096875e-05 6.5186855e-05 9.4285714 + 35300 0.0022584165 0 2.7542443e-05 5.427333e-05 6.7536963e-05 9.4285714 + 35400 0.0022737238 0 2.504131e-05 5.4367041e-05 6.7123718e-05 9.4285714 + 35500 0.0021537481 0 2.1567488e-05 4.8699315e-05 6.7335416e-05 9.4285714 + 35600 0.0019831613 0 1.8746091e-05 4.3656184e-05 6.3180625e-05 9.4285714 + 35700 0.0019041909 0 1.9945089e-05 4.3868252e-05 5.8115913e-05 9.4285714 + 35800 0.0018216502 0 2.2392614e-05 4.2188069e-05 5.7629004e-05 9.4285714 + 35900 0.0018071574 0 2.1141753e-05 4.1327783e-05 5.630057e-05 9.4285714 + 36000 0.0018645267 0 2.2735521e-05 4.4296822e-05 5.4259075e-05 9.4285714 + 36100 0.0018474198 0 2.5295637e-05 4.6128849e-05 5.7469914e-05 9.4285714 + 36200 0.0017366166 0 2.6021589e-05 4.5563756e-05 5.5296808e-05 9.4285714 + 36300 0.0016630877 0 2.4135763e-05 4.58324e-05 5.2179718e-05 9.4285714 + 36400 0.0016809967 0 2.3427379e-05 4.7533202e-05 4.714932e-05 9.4285714 + 36500 0.0017478488 0 2.4021161e-05 4.6508842e-05 4.3949519e-05 9.4285714 + 36600 0.0017244649 0 2.3504871e-05 4.3628584e-05 4.3171518e-05 9.4285714 + 36700 0.001694793 0 2.2302323e-05 4.2349904e-05 4.396766e-05 9.4285714 + 36800 0.0016321204 0 2.1042421e-05 3.6396346e-05 4.4901304e-05 9.4285714 + 36900 0.0015208954 0 2.0456403e-05 2.7850556e-05 4.5155127e-05 9.4285714 + 37000 0.0014068755 0 2.0241724e-05 2.1785718e-05 4.5528636e-05 9.4285714 + 37100 0.0013361229 0 1.675977e-05 2.1314381e-05 4.6611487e-05 9.4285714 + 37200 0.001331474 0 1.6204509e-05 2.3621819e-05 5.0433204e-05 9.4285714 + 37300 0.0013895388 0 1.6721652e-05 3.0265014e-05 5.0091541e-05 9.4285714 + 37400 0.001407333 0 1.738976e-05 2.8850978e-05 5.1334019e-05 9.4285714 + 37500 0.0013815772 0 1.6241641e-05 3.0837468e-05 4.6825094e-05 9.4285714 + 37600 0.001367937 0 1.1983552e-05 2.9613642e-05 5.0754355e-05 9.4285714 + 37700 0.0013781896 0 1.1915379e-05 2.9242244e-05 4.8777649e-05 9.4285714 + 37800 0.0013938097 0 1.1529951e-05 3.1628776e-05 4.7715639e-05 9.4285714 + 37900 0.0013788852 0 1.2561324e-05 3.1951817e-05 4.7999073e-05 9.4285714 + 38000 0.0013409916 0 1.2473952e-05 3.1146722e-05 4.8401798e-05 9.4285714 + 38100 0.0013548793 0 1.1004651e-05 2.7320574e-05 4.9651495e-05 9.4285714 + 38200 0.0013619894 0 1.2229314e-05 2.574689e-05 4.9387883e-05 9.4285714 + 38300 0.0013593654 0 1.3392954e-05 2.427172e-05 5.1848635e-05 9.4285714 + 38400 0.0013488508 0 1.256534e-05 2.449982e-05 5.4623064e-05 9.4285714 + 38500 0.0013399961 0 1.2037162e-05 2.0814078e-05 5.6078474e-05 9.4285714 + 38600 0.0013473117 0 1.1744489e-05 1.6853428e-05 5.7231621e-05 9.4285714 + 38700 0.0013275262 0 1.093468e-05 1.4795508e-05 5.769577e-05 9.4285714 + 38800 0.001304838 0 1.1068283e-05 1.3115698e-05 6.0324982e-05 9.4285714 + 38900 0.0012981525 0 1.1709325e-05 1.3131645e-05 5.9760468e-05 9.4285714 + 39000 0.0013241474 0 1.261896e-05 1.4616086e-05 6.0256213e-05 9.4285714 + 39100 0.0013302715 0 1.1838509e-05 1.5600129e-05 6.432053e-05 9.4285714 + 39200 0.0013338793 0 1.2403697e-05 1.6279003e-05 6.2961888e-05 9.4285714 + 39300 0.001337749 0 1.3137034e-05 1.6207867e-05 6.0627848e-05 9.4285714 + 39400 0.0014184127 0 1.6180184e-05 1.8165982e-05 5.8887905e-05 9.4285714 + 39500 0.0015076229 0 1.9522159e-05 1.9795428e-05 5.910332e-05 9.4285714 + 39600 0.001584196 0 2.4027089e-05 2.0838917e-05 5.7603421e-05 9.4285714 + 39700 0.0016673141 0 2.9500045e-05 2.3045542e-05 5.5891462e-05 9.4285714 + 39800 0.0016983633 0 3.0305739e-05 2.4453535e-05 5.5981899e-05 9.4285714 + 39900 0.001721388 0 3.1340689e-05 2.4975831e-05 5.5548483e-05 9.4285714 + 40000 0.0016511866 0 3.370998e-05 2.6328206e-05 5.671433e-05 9.4285714 + 40100 0.0015902117 0 3.3681877e-05 2.5663116e-05 5.3013557e-05 9.4285714 + 40200 0.0016248457 0 3.0865269e-05 2.5397352e-05 5.1452424e-05 9.4285714 + 40300 0.001639017 0 3.1973896e-05 2.5525448e-05 5.4813301e-05 9.4285714 + 40400 0.0015947128 0 3.5965857e-05 2.5225505e-05 5.6385827e-05 9.4285714 + 40500 0.0014886812 0 3.7017265e-05 2.4882355e-05 5.2995469e-05 9.4285714 + 40600 0.001483951 0 3.4221499e-05 2.1479298e-05 5.4046331e-05 9.4285714 + 40700 0.0014877422 0 3.362595e-05 1.8839863e-05 5.5203171e-05 9.4285714 + 40800 0.0014974798 0 3.6392277e-05 1.7485578e-05 5.7247772e-05 9.4285714 + 40900 0.0014499802 0 3.3431089e-05 1.9674968e-05 5.6160238e-05 9.4285714 + 41000 0.001395913 0 2.9658496e-05 1.8273286e-05 5.6527772e-05 9.4285714 + 41100 0.0014079985 0 2.9771219e-05 1.6179289e-05 5.9153644e-05 9.4285714 + 41200 0.0014187083 0 2.7845336e-05 1.9035184e-05 5.7573549e-05 9.4285714 + 41300 0.0014072972 0 2.4886378e-05 2.0795562e-05 5.4986012e-05 9.4285714 + 41400 0.0014168981 0 2.358191e-05 2.1908287e-05 5.4674995e-05 9.4285714 + 41500 0.0014248439 0 2.3385735e-05 2.3170658e-05 5.3269277e-05 9.4285714 + 41600 0.0014225044 0 2.376616e-05 2.5694883e-05 5.2138491e-05 9.4285714 + 41700 0.0014075811 0 2.2374247e-05 2.7567814e-05 5.1299283e-05 9.4285714 + 41800 0.0012680617 0 2.2171263e-05 2.5019906e-05 5.4594068e-05 9.4285714 + 41900 0.0010587818 0 1.5440824e-05 2.093143e-05 5.3361822e-05 9.4285714 + 42000 0.0010007004 0 1.2044875e-05 1.7303459e-05 5.3021476e-05 9.4285714 + 42100 0.0011304402 0 1.2464466e-05 1.9304071e-05 5.5030158e-05 9.4285714 + 42200 0.0012833154 0 1.6978814e-05 2.4344322e-05 5.4664913e-05 9.4285714 + 42300 0.0013573853 0 1.8276863e-05 2.7764513e-05 5.4832226e-05 9.4285714 + 42400 0.0013330633 0 1.7445663e-05 2.5994427e-05 5.6219048e-05 9.4285714 + 42500 0.0012896373 0 1.7549999e-05 2.4461263e-05 5.5316804e-05 9.4285714 + 42600 0.001296775 0 1.7579818e-05 2.4729094e-05 5.4786174e-05 9.4285714 + 42700 0.0013193969 0 1.7589942e-05 2.6653321e-05 5.5601741e-05 9.4285714 + 42800 0.0013144903 0 1.7344148e-05 2.7396405e-05 5.6063261e-05 9.4285714 + 42900 0.0013053554 0 1.812017e-05 2.4357577e-05 5.5400672e-05 9.4285714 + 43000 0.0013061323 0 1.7976023e-05 2.5672617e-05 5.5591174e-05 9.4285714 + 43100 0.0013149372 0 1.8049252e-05 2.7694066e-05 5.7517507e-05 9.4285714 + 43200 0.0013063189 0 1.8000018e-05 2.5312637e-05 5.7758611e-05 9.4285714 + 43300 0.0012669853 0 1.7756679e-05 2.3718058e-05 5.7316755e-05 9.4285714 + 43400 0.0012238388 0 2.0194584e-05 2.1983277e-05 5.5573072e-05 9.4285714 + 43500 0.0012053096 0 2.0662764e-05 2.2371854e-05 5.3240833e-05 9.4285714 + 43600 0.001243323 0 2.3521544e-05 2.3272124e-05 5.4438848e-05 9.4285714 + 43700 0.001354992 0 2.8388806e-05 2.6835727e-05 5.1695181e-05 9.4285714 + 43800 0.0015252788 0 3.4452462e-05 3.2972955e-05 5.1148386e-05 9.4285714 + 43900 0.0016845587 0 3.7891883e-05 3.7259267e-05 5.3712665e-05 9.4285714 + 44000 0.0016987088 0 3.794299e-05 3.9188564e-05 5.22906e-05 9.4285714 + 44100 0.0016663634 0 3.6807094e-05 3.9253716e-05 5.2294244e-05 9.4285714 + 44200 0.0016642734 0 3.7043503e-05 3.9518624e-05 5.2702041e-05 9.4285714 + 44300 0.0016877933 0 3.8179716e-05 4.0630461e-05 5.3339506e-05 9.4285714 + 44400 0.0016937941 0 3.7131293e-05 4.1066259e-05 5.432841e-05 9.4285714 + 44500 0.001658184 0 3.5564842e-05 3.9986051e-05 5.4994687e-05 9.4285714 + 44600 0.0016202756 0 3.6182348e-05 4.0514972e-05 5.4343097e-05 9.4285714 + 44700 0.0012624519 0 3.6496068e-05 3.330838e-05 6.0193182e-05 9.4285714 + 44800 0.0012148648 0 3.7546572e-05 2.4531512e-05 6.0795743e-05 9.4285714 + 44900 0.0012565599 0 2.9767991e-05 2.3526786e-05 5.730112e-05 9.4285714 + 45000 0.0012298496 0 3.3326423e-05 2.2497973e-05 5.3986547e-05 9.4285714 + 45100 0.0012274205 0 3.310721e-05 2.2786466e-05 5.5167469e-05 9.4285714 + 45200 0.0012389066 0 3.4925053e-05 2.3497387e-05 5.4884661e-05 9.4285714 + 45300 0.0012251609 0 3.615161e-05 2.3152279e-05 5.3650078e-05 9.4285714 + 45400 0.0012814774 0 3.746516e-05 2.4153096e-05 5.1029288e-05 9.4285714 + 45500 0.0013450626 0 3.9489551e-05 2.6213973e-05 5.0267505e-05 9.4285714 + 45600 0.0013741472 0 4.2751714e-05 2.6741902e-05 4.9140966e-05 9.4285714 + 45700 0.0014351223 0 4.3930849e-05 2.6748326e-05 4.9411273e-05 9.4285714 + 45800 0.0015284371 0 4.6485067e-05 2.8704517e-05 4.9999511e-05 9.4285714 + 45900 0.001575355 0 4.5717321e-05 3.011393e-05 5.1143199e-05 9.4285714 + 46000 0.0015147792 0 4.1325851e-05 3.0384448e-05 5.1923e-05 9.4285714 + 46100 0.0014504182 0 3.9540594e-05 3.1635289e-05 5.0948968e-05 9.4285714 + 46200 0.0014410639 0 3.965176e-05 3.0362005e-05 4.8786102e-05 9.4285714 + 46300 0.0014810525 0 4.1568241e-05 3.0756475e-05 4.8680363e-05 9.4285714 + 46400 0.0014640215 0 4.309465e-05 2.985089e-05 4.9009517e-05 9.4285714 + 46500 0.0014424933 0 4.2309209e-05 2.9280621e-05 4.8629444e-05 9.4285714 + 46600 0.001441165 0 4.2539286e-05 3.0934085e-05 4.9784857e-05 9.4285714 + 46700 0.0015025344 0 4.4979228e-05 3.1000179e-05 4.8462809e-05 9.4285714 + 46800 0.0015582176 0 4.7282405e-05 3.2706414e-05 4.5724526e-05 9.4285714 + 46900 0.0015803324 0 4.7650091e-05 3.4907217e-05 4.4832148e-05 9.4285714 + 47000 0.001675143 0 5.1693701e-05 3.6882816e-05 4.6006875e-05 9.4285714 + 47100 0.0017769921 0 5.6400585e-05 3.9830957e-05 4.6950937e-05 9.4285714 + 47200 0.0018358006 0 5.9232345e-05 4.3665585e-05 4.6768506e-05 9.4285714 + 47300 0.0017951326 0 5.6422198e-05 4.3944608e-05 4.8336201e-05 9.4285714 + 47400 0.0017057371 0 5.4710398e-05 3.9941549e-05 4.7652027e-05 9.4285714 + 47500 0.0016744493 0 5.2852149e-05 3.7232824e-05 4.5384467e-05 9.4285714 + 47600 0.0014031951 0 4.1326626e-05 3.0025176e-05 4.3875657e-05 9.4285714 + 47700 0.0013373039 0 3.7514245e-05 2.9655038e-05 4.316088e-05 9.4285714 + 47800 0.0014704003 0 4.1417238e-05 3.4940895e-05 4.447442e-05 9.4285714 + 47900 0.0014934525 0 4.3132757e-05 3.7137359e-05 4.4062556e-05 9.4285714 + 48000 0.0014895856 0 4.6046202e-05 3.6927333e-05 4.3726122e-05 9.4285714 + 48100 0.00146967 0 4.6872982e-05 3.9649234e-05 4.597459e-05 9.4285714 + 48200 0.0015682986 0 4.8924923e-05 4.738992e-05 4.3767565e-05 9.4285714 + 48300 0.0017163505 0 5.2171663e-05 5.3787554e-05 4.4084292e-05 9.4285714 + 48400 0.0014261936 0 4.3093196e-05 5.6810791e-05 5.4178929e-05 9.4285714 + 48500 0.0014236361 0 3.9093573e-05 4.8266345e-05 5.346877e-05 9.4285714 + 48600 0.0014562257 0 4.0734834e-05 4.2323892e-05 4.8295024e-05 9.4285714 + 48700 0.0013758282 0 3.6847543e-05 3.5139344e-05 4.8073535e-05 9.4285714 + 48800 0.0014316476 0 3.7554019e-05 3.5556116e-05 4.7370089e-05 9.4285714 + 48900 0.0014805023 0 3.5226264e-05 3.3817592e-05 5.2499511e-05 9.4285714 + 49000 0.0013776549 0 3.2439848e-05 2.997493e-05 5.3101978e-05 9.4285714 + 49100 0.0013617488 0 3.2279492e-05 3.0772411e-05 5.1632538e-05 9.4285714 + 49200 0.0013342401 0 2.8600175e-05 3.2651245e-05 5.3349695e-05 9.4285714 + 49300 0.001276486 0 2.7777544e-05 2.96306e-05 5.4374435e-05 9.4285714 + 49400 0.0011795288 0 2.2827442e-05 2.8085944e-05 5.2012108e-05 9.4285714 + 49500 0.0011435859 0 2.2873378e-05 2.7199584e-05 4.8565744e-05 9.4285714 + 49600 0.001247689 0 2.5002038e-05 3.0378272e-05 5.4987332e-05 9.4285714 + 49700 0.0013371245 0 2.6349724e-05 3.4033827e-05 5.8350385e-05 9.4285714 + 49800 0.001301722 0 2.4983049e-05 3.3355962e-05 5.7259996e-05 9.4285714 + 49900 0.0012728363 0 2.4271773e-05 3.366383e-05 5.4969958e-05 9.4285714 + 50000 0.0013286836 0 2.4626397e-05 3.4888455e-05 5.6333036e-05 9.4285714 + 50100 0.0013460063 0 2.5626025e-05 3.4617082e-05 5.8834535e-05 9.4285714 + 50200 0.0012868089 0 2.3749355e-05 3.3262754e-05 5.7555068e-05 9.4285714 + 50300 0.0012765172 0 2.3286644e-05 3.285494e-05 5.6753429e-05 9.4285714 + 50400 0.0012703222 0 2.2664849e-05 3.2123476e-05 5.8001158e-05 9.4285714 + 50500 0.0011906512 0 1.8988144e-05 2.5734872e-05 6.0360828e-05 9.4285714 + 50600 0.0011537339 0 1.7108695e-05 2.2700119e-05 6.3433107e-05 9.4285714 + 50700 0.0011267336 0 1.7970895e-05 2.4672948e-05 5.8568632e-05 9.4285714 + 50800 0.0011753482 0 1.9468991e-05 2.5939765e-05 5.9862885e-05 9.4285714 + 50900 0.0011919232 0 2.0208188e-05 2.7321787e-05 5.9048906e-05 9.4285714 + 51000 0.0011838525 0 2.1827961e-05 2.9118892e-05 5.2803692e-05 9.4285714 + 51100 0.0011883954 0 2.2709257e-05 2.8506733e-05 5.4654615e-05 9.4285714 + 51200 0.0012349694 0 2.5890907e-05 2.8698467e-05 5.7896353e-05 9.4285714 + 51300 0.0012337432 0 2.7687089e-05 2.7653507e-05 5.9917212e-05 9.4285714 + 51400 0.0011577306 0 2.8378044e-05 2.3224364e-05 5.8057014e-05 9.4285714 + 51500 0.0011811724 0 2.8435714e-05 2.1929674e-05 5.9722575e-05 9.4285714 + 51600 0.0012159313 0 3.1521829e-05 2.2796335e-05 5.924849e-05 9.4285714 + 51700 0.0011936762 0 3.4012729e-05 2.3864808e-05 5.7265759e-05 9.4285714 + 51800 0.00119466 0 3.5158377e-05 2.5231988e-05 5.8412082e-05 9.4285714 + 51900 0.0012013641 0 3.3334001e-05 2.6816388e-05 5.861301e-05 9.4285714 + 52000 0.0011652185 0 3.0940041e-05 2.6655324e-05 5.7090011e-05 9.4285714 + 52100 0.0011222289 0 3.1077905e-05 2.4541748e-05 5.5666069e-05 9.4285714 + 52200 0.0011223637 0 3.2939544e-05 2.5096815e-05 5.6416173e-05 9.4285714 + 52300 0.00108781 0 3.4613486e-05 2.7303053e-05 5.6746437e-05 9.4285714 + 52400 0.0010329114 0 3.6196201e-05 2.8068523e-05 5.2439815e-05 9.4285714 + 52500 0.0010414794 0 3.673215e-05 2.7272718e-05 5.143023e-05 9.4285714 + 52600 0.0011160581 0 3.5468006e-05 2.7495373e-05 5.401667e-05 9.4285714 + 52700 0.0011365494 0 3.6522651e-05 2.8130517e-05 5.1952685e-05 9.4285714 + 52800 0.0011528486 0 3.8067909e-05 3.2231442e-05 4.9590134e-05 9.4285714 + 52900 0.001215765 0 4.2804899e-05 3.6927536e-05 5.1170177e-05 9.4285714 + 53000 0.0013368124 0 4.5592002e-05 4.1563931e-05 5.4427869e-05 9.4285714 + 53100 0.0013407312 0 4.5591201e-05 4.3600841e-05 4.9047373e-05 9.4285714 + 53200 0.0013326843 0 4.4821382e-05 4.1764227e-05 4.6186223e-05 9.4285714 + 53300 0.0013239729 0 4.3827862e-05 4.4020784e-05 4.3852213e-05 9.4285714 + 53400 0.0013217143 0 4.3572994e-05 4.7084118e-05 4.3149657e-05 9.4285714 + 53500 0.0012781803 0 4.460572e-05 4.8061498e-05 4.2708059e-05 9.4285714 + 53600 0.001268382 0 4.458824e-05 4.5673787e-05 4.1230488e-05 9.4285714 + 53700 0.0012069904 0 4.1562438e-05 4.2697726e-05 4.1986265e-05 9.4285714 + 53800 0.0011968988 0 4.5963049e-05 4.0317052e-05 4.3564542e-05 9.4285714 + 53900 0.0011731954 0 4.5626132e-05 3.9016561e-05 4.2699438e-05 9.4285714 + 54000 0.0011606061 0 4.2734103e-05 3.8922865e-05 4.2063758e-05 9.4285714 + 54100 0.0011658982 0 3.9764581e-05 3.672962e-05 4.7476053e-05 9.4285714 + 54200 0.0011195165 0 3.5569124e-05 3.3590873e-05 4.8421311e-05 9.4285714 + 54300 0.0010220393 0 3.2252593e-05 3.0968164e-05 4.987935e-05 9.4285714 + 54400 0.0010086172 0 3.6631232e-05 3.0359237e-05 5.1629214e-05 9.4285714 + 54500 0.0010183988 0 3.7406525e-05 2.632072e-05 5.1823266e-05 9.4285714 + 54600 0.0010068716 0 3.6673782e-05 2.3899354e-05 4.883163e-05 9.4285714 + 54700 0.00099012603 0 3.3975738e-05 2.2165277e-05 4.788027e-05 9.4285714 + 54800 0.0009683722 0 3.235553e-05 2.2982659e-05 5.0112286e-05 9.4285714 + 54900 0.00097629715 0 3.2268492e-05 2.5601046e-05 4.8627644e-05 9.4285714 + 55000 0.00095157382 0 3.1040046e-05 2.437472e-05 4.637034e-05 9.4285714 + 55100 0.00090688968 0 2.9340275e-05 2.1953227e-05 4.3141384e-05 9.4285714 + 55200 0.00088813057 0 2.8284065e-05 2.1733676e-05 4.2934237e-05 9.4285714 + 55300 0.00092557007 0 2.8620339e-05 2.3675426e-05 4.3885475e-05 9.4285714 + 55400 0.00091327263 0 2.762239e-05 2.641616e-05 4.4396082e-05 9.4285714 + 55500 0.00079921186 0 2.9224842e-05 2.5168399e-05 4.3290943e-05 9.4285714 + 55600 0.00081947901 0 2.8418244e-05 2.2268749e-05 4.9968371e-05 9.4285714 + 55700 0.00084804465 0 2.1646302e-05 2.3720621e-05 5.205521e-05 9.4285714 + 55800 0.00085118568 0 2.2504085e-05 2.2872302e-05 4.9963437e-05 9.4285714 + 55900 0.00079015144 0 2.1456661e-05 1.9796776e-05 4.8884464e-05 9.4285714 + 56000 0.00077424122 0 2.2875959e-05 1.721853e-05 4.7217244e-05 9.4285714 + 56100 0.00078729859 0 2.750101e-05 1.8189823e-05 4.7065369e-05 9.4285714 + 56200 0.00073803593 0 2.8848488e-05 1.8153302e-05 4.571796e-05 9.4285714 + 56300 0.00072042566 0 2.842146e-05 1.5690166e-05 4.4828579e-05 9.4285714 + 56400 0.00072618636 0 2.7559372e-05 1.5504007e-05 4.399204e-05 9.4285714 + 56500 0.00072889383 0 2.7924251e-05 1.6823511e-05 4.2305183e-05 9.4285714 + 56600 0.00071687768 0 2.9101443e-05 1.6332857e-05 4.2086891e-05 9.4285714 + 56700 0.00070767909 0 3.0080534e-05 1.532979e-05 4.2661404e-05 9.4285714 + 56800 0.0007079533 0 2.8817943e-05 1.6206535e-05 4.2253735e-05 9.4285714 + 56900 0.00068006672 0 2.7371942e-05 1.7051153e-05 3.9711699e-05 9.4285714 + 57000 0.000671041 0 2.6892964e-05 1.5542748e-05 3.8373488e-05 9.4285714 + 57100 0.00074371147 0 2.8066609e-05 1.8321889e-05 3.9806125e-05 9.4285714 + 57200 0.00081400221 0 2.8670502e-05 2.8899856e-05 4.0663376e-05 9.4285714 + 57300 0.000917037 0 2.7824502e-05 3.9014624e-05 4.2174406e-05 9.4285714 + 57400 0.00094626663 0 2.5794485e-05 4.1535293e-05 4.2086614e-05 9.4285714 + 57500 0.00093346301 0 2.5487117e-05 4.0862488e-05 4.1990151e-05 9.4285714 + 57600 0.00093999622 0 2.6720752e-05 4.0748175e-05 4.3650361e-05 9.4285714 + 57700 0.00094337314 0 2.639701e-05 4.0729782e-05 4.5121665e-05 9.4285714 + 57800 0.00092645123 0 2.6909739e-05 4.0150191e-05 4.3822005e-05 9.4285714 + 57900 0.00091253668 0 2.5642193e-05 3.6671075e-05 4.4028328e-05 9.4285714 + 58000 0.0009262852 0 2.4409205e-05 3.4409346e-05 4.4000636e-05 9.4285714 + 58100 0.00093298888 0 2.3677747e-05 3.2551966e-05 4.3694114e-05 9.4285714 + 58200 0.00093354721 0 2.2375814e-05 3.2117822e-05 4.4639312e-05 9.4285714 + 58300 0.00093283167 0 2.2884257e-05 3.090895e-05 4.5086768e-05 9.4285714 + 58400 0.00093485322 0 2.3712272e-05 3.0236548e-05 4.5930955e-05 9.4285714 + 58500 0.00092566721 0 2.405659e-05 2.87637e-05 4.8903625e-05 9.4285714 + 58600 0.00093205032 0 2.3525309e-05 2.8285934e-05 5.2291285e-05 9.4285714 + 58700 0.00094034992 0 2.4008311e-05 2.5804337e-05 5.3505489e-05 9.4285714 + 58800 0.00096489026 0 2.4355825e-05 2.8532919e-05 5.3761099e-05 9.4285714 + 58900 0.00097781296 0 2.6084526e-05 3.1039765e-05 5.2910774e-05 9.4285714 + 59000 0.00095088201 0 2.7035865e-05 3.1452129e-05 5.3165727e-05 9.4285714 + 59100 0.00092096092 0 2.6786706e-05 3.382956e-05 5.0768712e-05 9.4285714 + 59200 0.0009112309 0 2.5867113e-05 3.4359567e-05 4.9291183e-05 9.4285714 + 59300 0.00090372653 0 2.5622941e-05 3.7144276e-05 4.7289805e-05 9.4285714 + 59400 0.00086115007 0 2.2280155e-05 3.5823023e-05 4.6830658e-05 9.4285714 + 59500 0.00078451189 0 2.2220981e-05 2.6156784e-05 4.6914457e-05 9.4285714 + 59600 0.00078587175 0 2.3370931e-05 2.5032607e-05 4.9704371e-05 9.4285714 + 59700 0.00080103949 0 2.387346e-05 2.8536648e-05 4.7938414e-05 9.4285714 + 59800 0.00078782591 0 2.319423e-05 2.8210585e-05 4.7677072e-05 9.4285714 + 59900 0.00077243837 0 2.3631843e-05 2.8691006e-05 4.7228518e-05 9.4285714 + 60000 0.00075159859 0 2.3775193e-05 2.9335754e-05 4.5277107e-05 9.4285714 + 60100 0.00072169229 0 2.1979779e-05 3.0104074e-05 4.5923405e-05 9.4285714 + 60200 0.00067937954 0 2.0306575e-05 2.8735522e-05 4.5275658e-05 9.4285714 + 60300 0.00067260226 0 2.0810173e-05 2.6609433e-05 4.3648953e-05 9.4285714 + 60400 0.00069286984 0 2.4253823e-05 2.5126495e-05 4.258699e-05 9.4285714 + 60500 0.00069736312 0 2.7101459e-05 2.4283276e-05 4.2346847e-05 9.4285714 + 60600 0.00069858614 0 2.5781332e-05 2.4087945e-05 4.2183121e-05 9.4285714 + 60700 0.00069821214 0 2.4965653e-05 2.080958e-05 4.1576529e-05 9.4285714 + 60800 0.0007035508 0 2.5136105e-05 1.82106e-05 4.2416771e-05 9.4285714 + 60900 0.00070770846 0 2.4339709e-05 1.7024772e-05 4.3565509e-05 9.4285714 + 61000 0.00070195965 0 2.4160978e-05 1.561415e-05 4.4516846e-05 9.4285714 + 61100 0.00067865064 0 2.4754436e-05 1.6095324e-05 4.5917833e-05 9.4285714 + 61200 0.00063690893 0 2.2652857e-05 1.7060397e-05 4.715524e-05 9.4285714 + 61300 0.00064194236 0 2.2650362e-05 1.4267909e-05 4.3531168e-05 9.4285714 + 61400 0.00063121847 0 2.1529461e-05 1.2841701e-05 4.0585367e-05 9.4285714 + 61500 0.00065356029 0 2.3536414e-05 1.3344947e-05 4.1167487e-05 9.4285714 + 61600 0.00066743886 0 2.4866121e-05 1.3946269e-05 4.176316e-05 9.4285714 + 61700 0.00064876312 0 2.3723161e-05 1.3749913e-05 4.2058416e-05 9.4285714 + 61800 0.00063251553 0 2.3037843e-05 1.2308212e-05 4.1311007e-05 9.4285714 + 61900 0.00065196202 0 2.371008e-05 1.2119818e-05 4.1136972e-05 9.4285714 + 62000 0.00066211487 0 2.4305587e-05 1.3415536e-05 4.1013521e-05 9.4285714 + 62100 0.00063838911 0 2.3294318e-05 1.377487e-05 4.0954053e-05 9.4285714 + 62200 0.00062154839 0 2.1558175e-05 1.3359191e-05 4.1245046e-05 9.4285714 + 62300 0.00063042258 0 2.1018073e-05 1.3643859e-05 4.2295629e-05 9.4285714 + 62400 0.00064307282 0 2.2417944e-05 1.3691778e-05 4.3440168e-05 9.4285714 + 62500 0.00062261967 0 2.2993973e-05 1.3754566e-05 4.4100385e-05 9.4285714 + 62600 0.00053916399 0 1.5362019e-05 1.2502815e-05 4.4138039e-05 9.4285714 + 62700 0.00057010612 0 1.5796506e-05 1.2697622e-05 4.4452456e-05 9.4285714 + 62800 0.00057237373 0 1.5874305e-05 1.325341e-05 4.3827972e-05 9.4285714 + 62900 0.00056115858 0 1.6555148e-05 1.3080646e-05 4.434918e-05 9.4285714 + 63000 0.0005691916 0 1.7337274e-05 1.3018716e-05 4.5966666e-05 9.4285714 + 63100 0.00056814223 0 1.8372705e-05 1.3213928e-05 4.5013147e-05 9.4285714 + 63200 0.00055359969 0 1.7755667e-05 1.226889e-05 4.4263871e-05 9.4285714 + 63300 0.00053663894 0 1.6493197e-05 1.0859989e-05 4.3835591e-05 9.4285714 + 63400 0.00055318219 0 1.7265416e-05 1.2265785e-05 4.2879248e-05 9.4285714 + 63500 0.0005601025 0 1.7295499e-05 1.4239119e-05 4.3011721e-05 9.4285714 + 63600 0.00054583913 0 1.6525634e-05 1.4678843e-05 4.2469934e-05 9.4285714 + 63700 0.00053483868 0 1.6625875e-05 1.5078172e-05 4.2493824e-05 9.4285714 + 63800 0.00055522493 0 1.7480604e-05 1.5374684e-05 4.272595e-05 9.4285714 + 63900 0.00056121598 0 1.7772973e-05 1.5172133e-05 4.2798662e-05 9.4285714 + 64000 0.00054407633 0 1.6885044e-05 1.413276e-05 4.2546454e-05 9.4285714 + 64100 0.00053661653 0 1.6234338e-05 1.403684e-05 4.2825695e-05 9.4285714 + 64200 0.00055006192 0 1.6649951e-05 1.4056747e-05 4.3482046e-05 9.4285714 + 64300 0.00055163304 0 1.6461598e-05 1.3167903e-05 4.3726787e-05 9.4285714 + 64400 0.00053078787 0 1.6251525e-05 1.19464e-05 4.3358318e-05 9.4285714 + 64500 0.00052058058 0 1.6643557e-05 1.2630836e-05 4.3429169e-05 9.4285714 + 64600 0.00052834957 0 1.7353655e-05 1.364227e-05 4.2400392e-05 9.4285714 + 64700 0.00051311026 0 1.758087e-05 1.4884436e-05 4.228116e-05 9.4285714 + 64800 0.00048606856 0 1.8167314e-05 1.5185881e-05 4.1313198e-05 9.4285714 + 64900 0.00047345864 0 1.8776746e-05 1.5164217e-05 3.998748e-05 9.4285714 + 65000 0.00048454696 0 1.8995386e-05 1.4818088e-05 3.9244802e-05 9.4285714 + 65100 0.00048928041 0 1.8341025e-05 1.3978549e-05 3.9434274e-05 9.4285714 + 65200 0.00047037779 0 1.7440302e-05 1.2970355e-05 3.8631037e-05 9.4285714 + 65300 0.000474477 0 1.7730462e-05 1.2778417e-05 3.8374171e-05 9.4285714 + 65400 0.00047558993 0 1.8645893e-05 1.303845e-05 3.9299974e-05 9.4285714 + 65500 0.00046258212 0 1.8683635e-05 1.2737042e-05 3.99647e-05 9.4285714 + 65600 0.00044433429 0 1.6571796e-05 1.2754279e-05 3.8518715e-05 9.4285714 + 65700 0.00045238336 0 1.5273478e-05 1.2923777e-05 3.6940008e-05 9.4285714 + 65800 0.00045926142 0 1.5338149e-05 1.2009407e-05 3.6438821e-05 9.4285714 + 65900 0.00045814994 0 1.5980648e-05 1.1749036e-05 3.6297575e-05 9.4285714 + 66000 0.00045395179 0 1.7924167e-05 1.2624087e-05 3.7065746e-05 9.4285714 + 66100 0.00044097892 0 1.9034226e-05 1.356976e-05 3.8933851e-05 9.4285714 + 66200 0.00041508101 0 1.8402026e-05 1.4705713e-05 3.8748663e-05 9.4285714 + 66300 0.00041227685 0 1.908236e-05 1.6649716e-05 3.7753553e-05 9.4285714 + 66400 0.00039539458 0 1.8057048e-05 1.6143874e-05 3.7074006e-05 9.4285714 + 66500 0.00038647539 0 1.698015e-05 1.3801339e-05 3.5358951e-05 9.4285714 + 66600 0.00037432719 0 1.7509843e-05 1.4033428e-05 3.5206119e-05 9.4285714 + 66700 0.00035679642 0 1.8373478e-05 1.412795e-05 3.2664378e-05 9.4285714 + 66800 0.00034618795 0 1.9514845e-05 1.4608894e-05 3.2352472e-05 9.4285714 + 66900 0.00032906055 0 1.8736605e-05 1.523461e-05 3.3161408e-05 9.4285714 + 67000 0.00031945785 0 1.6984612e-05 1.4969242e-05 3.3142807e-05 9.4285714 + 67100 0.00031672216 0 1.7483062e-05 1.5927363e-05 3.3297451e-05 9.4285714 + 67200 0.00030445379 0 1.7092794e-05 1.5979956e-05 3.3953736e-05 9.4285714 + 67300 0.00028386109 0 1.6371034e-05 1.4946504e-05 3.3294272e-05 9.4285714 + 67400 0.00028463754 0 1.6562782e-05 1.522773e-05 3.3193414e-05 9.4285714 + 67500 0.00028212316 0 1.7000058e-05 1.688192e-05 3.0305767e-05 9.4285714 + 67600 0.00027447589 0 1.7252228e-05 1.7793217e-05 2.7940287e-05 9.4285714 + 67700 0.00026388856 0 1.788708e-05 1.7737963e-05 2.7767523e-05 9.4285714 + 67800 0.00024769801 0 1.7986182e-05 1.6911674e-05 2.6242072e-05 9.4285714 + 67900 0.00024192231 0 1.8117237e-05 1.6810584e-05 2.5489128e-05 9.4285714 + 68000 0.00023732277 0 1.7792025e-05 1.6237435e-05 2.3955138e-05 9.4285714 + 68100 0.0002230537 0 1.8040504e-05 1.509807e-05 2.4258324e-05 9.4285714 + 68200 0.00020295655 0 1.7396258e-05 1.432954e-05 2.2297953e-05 9.4285714 + 68300 0.0002040692 0 1.4709241e-05 1.3357816e-05 1.9379008e-05 9.4285714 + 68400 0.0001928169 0 1.3319281e-05 1.3285272e-05 1.9247674e-05 9.4285714 + 68500 0.00019326451 0 1.3554406e-05 1.3433023e-05 2.0649044e-05 9.4285714 + 68600 0.00019061041 0 1.3385102e-05 1.3584385e-05 1.9332432e-05 9.4285714 + 68700 0.00017904605 0 1.3288304e-05 1.3807963e-05 1.7099578e-05 9.4285714 + 68800 0.00017200167 0 1.4014515e-05 1.3305447e-05 1.6005157e-05 9.4285714 + 68900 0.00016728354 0 1.4358398e-05 1.4318143e-05 1.7530654e-05 9.4285714 + 69000 0.00015703321 0 1.5503927e-05 1.5119926e-05 1.7369909e-05 9.4285714 + 69100 0.00014835113 0 1.6646462e-05 1.3971022e-05 1.6344915e-05 9.4285714 + 69200 0.00014631648 0 1.5954987e-05 1.2795675e-05 1.6309035e-05 9.4285714 + 69300 0.00014587978 0 1.5293418e-05 1.2677732e-05 1.7233536e-05 9.4285714 + 69400 0.0001418924 0 1.5258493e-05 1.3019793e-05 1.7515483e-05 9.4285714 + 69500 0.00013332024 0 1.4812384e-05 1.303409e-05 1.7383204e-05 9.4285714 + 69600 0.00013320187 0 1.4156146e-05 1.3180657e-05 1.7662244e-05 9.4285714 + 69700 0.00013039836 0 1.3247552e-05 1.2811783e-05 1.6799406e-05 9.4285714 + 69800 0.00012003394 0 1.2945301e-05 1.2559804e-05 1.5746066e-05 9.4285714 + 69900 0.00011651147 0 1.2355239e-05 1.2393181e-05 1.4350427e-05 9.4285714 + 70000 0.00012197106 0 1.1842768e-05 1.3044816e-05 1.4170863e-05 9.4285714 + 70100 0.00011813389 0 1.1625743e-05 1.3313213e-05 1.5063448e-05 9.4285714 + 70200 0.00011097253 0 1.1590401e-05 1.2554923e-05 1.4597134e-05 9.4285714 + 70300 0.00010887364 0 1.1158154e-05 1.1895927e-05 1.31874e-05 9.4285714 + 70400 0.00010916786 0 1.0956876e-05 1.180273e-05 1.2846539e-05 9.4285714 + 70500 0.00010031774 0 1.0360778e-05 1.1514343e-05 1.2521203e-05 9.4285714 + 70600 9.1002834e-05 0 1.0300514e-05 1.117085e-05 1.1527003e-05 9.4285714 + 70700 8.9186179e-05 0 1.0609829e-05 1.0737094e-05 1.0837865e-05 9.4285714 + 70800 9.1206485e-05 0 1.0401734e-05 9.9843249e-06 1.0249157e-05 9.4285714 + 70900 9.2333335e-05 0 1.0193791e-05 9.0808065e-06 9.8992907e-06 9.4285714 + 71000 9.1646266e-05 0 1.0160677e-05 8.7435373e-06 9.7169582e-06 9.4285714 + 71100 8.9976882e-05 0 1.0153135e-05 9.1409494e-06 9.5718498e-06 9.4285714 + 71200 8.7702811e-05 0 9.8902233e-06 9.1879521e-06 9.8218671e-06 9.4285714 + 71300 8.6905185e-05 0 9.5383545e-06 8.7211783e-06 1.0499374e-05 9.4285714 + 71400 8.5684023e-05 0 9.253314e-06 8.3885129e-06 1.0606272e-05 9.4285714 + 71500 8.303695e-05 0 8.8819413e-06 8.3461936e-06 1.0273368e-05 9.4285714 + 71600 8.0199459e-05 0 8.9747038e-06 8.2066881e-06 9.9704252e-06 9.4285714 + 71700 7.8917712e-05 0 9.0271304e-06 7.7429742e-06 9.9361512e-06 9.4285714 + 71800 8.006745e-05 0 8.8187404e-06 7.4107567e-06 9.9020703e-06 9.4285714 + 71900 7.8740588e-05 0 8.5325535e-06 7.4640436e-06 9.6978695e-06 9.4285714 + 72000 7.758597e-05 0 8.4232259e-06 7.4096936e-06 1.0295265e-05 9.4285714 + 72100 7.7221401e-05 0 8.2221646e-06 7.0735469e-06 1.0729758e-05 9.4285714 + 72200 7.6375029e-05 0 7.8256335e-06 6.6839282e-06 1.0036496e-05 9.4285714 + 72300 7.2834947e-05 0 7.3129398e-06 6.5549375e-06 9.3647818e-06 9.4285714 + 72400 7.2648265e-05 0 7.1756961e-06 6.6155121e-06 9.9549307e-06 9.4285714 + 72500 7.3708292e-05 0 7.2472933e-06 6.3958474e-06 1.0123332e-05 9.4285714 + 72600 7.1153221e-05 0 7.3278587e-06 6.1367701e-06 9.7342661e-06 9.4285714 + 72700 6.9093949e-05 0 7.4363962e-06 5.9533119e-06 9.7560578e-06 9.4285714 + 72800 7.0003138e-05 0 7.5425112e-06 5.8275253e-06 1.0368232e-05 9.4285714 + 72900 7.097186e-05 0 7.4852771e-06 5.9091762e-06 1.0469988e-05 9.4285714 + 73000 6.9754446e-05 0 7.1428704e-06 6.0128613e-06 9.845617e-06 9.4285714 + 73100 6.8919462e-05 0 6.8577848e-06 6.0078752e-06 9.5062768e-06 9.4285714 + 73200 7.0813485e-05 0 6.915193e-06 5.8464766e-06 9.5542243e-06 9.4285714 + 73300 7.2448906e-05 0 7.202029e-06 5.9255145e-06 9.366303e-06 9.4285714 + 73400 7.1636811e-05 0 7.3658376e-06 6.0353436e-06 9.0035204e-06 9.4285714 + 73500 7.0735739e-05 0 7.3378932e-06 5.9233113e-06 9.2103137e-06 9.4285714 + 73600 7.103569e-05 0 7.4016369e-06 5.7191072e-06 9.590302e-06 9.4285714 + 73700 7.1516165e-05 0 7.5406525e-06 5.5544712e-06 9.2023549e-06 9.4285714 + 73800 7.0454708e-05 0 7.349261e-06 5.3580841e-06 8.44158e-06 9.4285714 + 73900 7.0921505e-05 0 7.0116409e-06 5.019628e-06 8.392926e-06 9.4285714 + 74000 7.3462894e-05 0 6.8708293e-06 4.6604305e-06 8.6159539e-06 9.4285714 + 74100 7.3200399e-05 0 6.760504e-06 4.5172181e-06 8.6590907e-06 9.4285714 + 74200 7.1848724e-05 0 6.598806e-06 4.5142909e-06 8.9015449e-06 9.4285714 + 74300 7.2382347e-05 0 6.4910604e-06 4.55638e-06 9.5190459e-06 9.4285714 + 74400 7.3931763e-05 0 6.5463337e-06 4.557173e-06 9.9812236e-06 9.4285714 + 74500 7.4402751e-05 0 6.7422317e-06 4.5967137e-06 9.9997382e-06 9.4285714 + 74600 7.3859362e-05 0 6.7302615e-06 4.5719524e-06 9.8667104e-06 9.4285714 + 74700 7.5361374e-05 0 6.6009004e-06 4.5572386e-06 9.8530775e-06 9.4285714 + 74800 7.7630509e-05 0 6.5656345e-06 4.6832234e-06 9.892975e-06 9.4285714 + 74900 7.7455142e-05 0 6.6195469e-06 4.8215952e-06 9.8988386e-06 9.4285714 + 75000 7.6480769e-05 0 6.6957621e-06 4.8937859e-06 1.0118373e-05 9.4285714 + 75100 7.7275693e-05 0 6.8416988e-06 5.0008953e-06 1.0508524e-05 9.4285714 + 75200 7.8822667e-05 0 7.0137661e-06 5.114046e-06 1.0681512e-05 9.4285714 + 75300 7.923137e-05 0 7.0852228e-06 5.2313082e-06 1.088256e-05 9.4285714 + 75400 7.9015035e-05 0 7.0293657e-06 5.2742411e-06 1.1348177e-05 9.4285714 + 75500 8.0621162e-05 0 6.8467092e-06 5.2679705e-06 1.1831246e-05 9.4285714 + 75600 8.2299447e-05 0 6.6752346e-06 5.2465333e-06 1.1929829e-05 9.4285714 + 75700 8.1993378e-05 0 6.6903556e-06 5.2647445e-06 1.1895978e-05 9.4285714 + 75800 8.1758987e-05 0 6.8566142e-06 5.3086877e-06 1.1919614e-05 9.4285714 + 75900 8.3084215e-05 0 7.0165672e-06 5.385502e-06 1.2070322e-05 9.4285714 + 76000 8.197148e-05 0 7.2302761e-06 5.8394738e-06 1.2278973e-05 9.4285714 + 76100 7.3534139e-05 0 7.7489979e-06 6.0492251e-06 1.2550083e-05 9.4285714 + 76200 6.8283079e-05 0 7.2365372e-06 6.0007678e-06 1.2602817e-05 9.4285714 + 76300 7.8227289e-05 0 6.526694e-06 6.0271465e-06 1.2329383e-05 9.4285714 + 76400 8.2994806e-05 0 6.1815571e-06 5.9430881e-06 1.1701935e-05 9.4285714 + 76500 8.3014892e-05 0 6.1364257e-06 5.9854633e-06 1.1722691e-05 9.4285714 + 76600 8.4226362e-05 0 6.1828506e-06 6.107284e-06 1.1920214e-05 9.4285714 + 76700 8.6131526e-05 0 6.3343928e-06 6.350283e-06 1.228658e-05 9.4285714 + 76800 8.5731394e-05 0 6.4776958e-06 6.4683255e-06 1.249724e-05 9.4285714 + 76900 8.5941781e-05 0 6.4853553e-06 6.4244197e-06 1.2593229e-05 9.4285714 + 77000 8.8001094e-05 0 6.5171523e-06 6.6329655e-06 1.2912514e-05 9.4285714 + 77100 8.7224729e-05 0 6.8494875e-06 7.3872568e-06 1.3297612e-05 9.4285714 + 77200 8.4102799e-05 0 7.0894804e-06 7.3299263e-06 1.367949e-05 9.4285714 + 77300 8.0313409e-05 0 7.4098021e-06 7.2858555e-06 1.3836101e-05 9.4285714 + 77400 7.9230413e-05 0 8.2603924e-06 7.7732932e-06 1.3810185e-05 9.4285714 + 77500 7.811033e-05 0 8.7674355e-06 7.5406409e-06 1.4227076e-05 9.4285714 + 77600 7.7683573e-05 0 9.0788292e-06 7.8133163e-06 1.471022e-05 9.4285714 + 77700 7.5680467e-05 0 8.9108768e-06 8.317342e-06 1.4999553e-05 9.4285714 + 77800 7.3449559e-05 0 8.9694781e-06 8.6900526e-06 1.5086204e-05 9.4285714 + 77900 7.3292429e-05 0 9.139058e-06 8.6084679e-06 1.492615e-05 9.4285714 + 78000 7.2392133e-05 0 9.6080208e-06 8.4852396e-06 1.4857893e-05 9.4285714 + 78100 7.0315679e-05 0 9.945291e-06 8.3218765e-06 1.4719636e-05 9.4285714 + 78200 7.1047062e-05 0 9.8105393e-06 8.1347429e-06 1.4828339e-05 9.4285714 + 78300 6.8370248e-05 0 9.9255038e-06 7.8989844e-06 1.558545e-05 9.4285714 + 78400 6.5550877e-05 0 1.0372272e-05 7.8133098e-06 1.6112e-05 9.4285714 + 78500 6.1683926e-05 0 1.0744202e-05 7.939033e-06 1.6539381e-05 9.4285714 + 78600 6.024047e-05 0 1.0791202e-05 7.9498532e-06 1.6361859e-05 9.4285714 + 78700 5.8543178e-05 0 1.0974316e-05 7.8193457e-06 1.5667857e-05 9.4285714 + 78800 5.5383435e-05 0 1.0534755e-05 7.6453258e-06 1.4396004e-05 9.4285714 + 78900 5.6871546e-05 0 1.0546809e-05 7.6401983e-06 1.380849e-05 9.4285714 + 79000 5.7192958e-05 0 1.0550826e-05 8.0833789e-06 1.3441933e-05 9.4285714 + 79100 4.9998926e-05 0 1.0683768e-05 7.9938172e-06 1.3882479e-05 9.4285714 + 79200 4.9597887e-05 0 1.0901088e-05 7.7919421e-06 1.273575e-05 9.4285714 + 79300 4.8603326e-05 0 1.0971813e-05 8.0875397e-06 1.2027443e-05 9.4285714 + 79400 4.7839304e-05 0 1.0874179e-05 8.144737e-06 1.1956832e-05 9.4285714 + 79500 4.5739018e-05 0 1.076245e-05 8.3910868e-06 1.1534616e-05 9.4285714 + 79600 4.2632104e-05 0 1.0609664e-05 8.6397142e-06 1.1473552e-05 9.4285714 + 79700 4.2716432e-05 0 1.0262604e-05 8.711707e-06 1.0969998e-05 9.4285714 + 79800 4.3345358e-05 0 9.9282847e-06 8.9481901e-06 1.0983222e-05 9.4285714 + 79900 4.2476967e-05 0 9.7375039e-06 9.2548149e-06 1.1285625e-05 9.4285714 + 80000 4.0478442e-05 0 9.558123e-06 8.9295053e-06 1.0784448e-05 9.4285714 + 80100 3.7842198e-05 0 9.0334781e-06 8.2704782e-06 1.0278932e-05 9.4285714 + 80200 2.8735215e-05 0 7.9350731e-06 7.8543447e-06 1.0121553e-05 9.4285714 + 80300 2.5008575e-05 0 7.4613405e-06 7.3076318e-06 9.699202e-06 9.4285714 + 80400 2.7560228e-05 0 7.839602e-06 7.0844901e-06 9.4586824e-06 9.4285714 + 80500 3.0888649e-05 0 8.1838091e-06 6.9204111e-06 9.2656765e-06 9.4285714 + 80600 3.2512804e-05 0 8.4973372e-06 6.7089195e-06 9.1713286e-06 9.4285714 + 80700 3.0635649e-05 0 8.6601613e-06 6.5637472e-06 8.8278453e-06 9.4285714 + 80800 2.7803874e-05 0 8.6135955e-06 6.4140616e-06 8.6556889e-06 9.4285714 + 80900 2.7488104e-05 0 8.7028796e-06 6.3379797e-06 8.3509842e-06 9.4285714 + 81000 2.5760367e-05 0 9.2034736e-06 6.7611736e-06 8.6536526e-06 9.4285714 + 81100 2.0516969e-05 0 9.0513498e-06 6.8144281e-06 9.1119465e-06 9.4285714 + 81200 1.7005384e-05 0 8.916831e-06 6.7768397e-06 9.5240286e-06 9.4285714 + 81300 1.8000969e-05 0 8.7376342e-06 6.8615088e-06 9.6206194e-06 9.4285714 + 81400 1.8404948e-05 0 8.2208204e-06 6.7371396e-06 9.0504462e-06 9.4285714 + 81500 1.7001638e-05 0 8.0003097e-06 6.7725682e-06 8.8647013e-06 9.4285714 + 81600 1.718853e-05 0 7.6914646e-06 6.9104324e-06 8.8869789e-06 9.4285714 + 81700 1.7653551e-05 0 7.3471225e-06 6.8867378e-06 8.8253446e-06 9.4285714 + 81800 1.60697e-05 0 7.0404737e-06 6.8479859e-06 8.5427076e-06 9.4285714 + 81900 1.5286837e-05 0 7.0172686e-06 6.9297068e-06 8.2722832e-06 9.4285714 + 82000 1.6023107e-05 0 7.0983015e-06 6.9736613e-06 8.1332821e-06 9.4285714 + 82100 1.5242285e-05 0 7.0688546e-06 6.8167975e-06 7.6908928e-06 9.4285714 + 82200 1.3697011e-05 0 7.0223727e-06 6.4952373e-06 7.3342404e-06 9.4285714 + 82300 1.3126258e-05 0 7.1571217e-06 6.3810604e-06 7.2195212e-06 9.4285714 + 82400 1.3101796e-05 0 7.2890863e-06 6.3506356e-06 6.9818415e-06 9.4285714 + 82500 1.2930812e-05 0 7.151416e-06 6.216239e-06 6.5772477e-06 9.4285714 + 82600 1.2105591e-05 0 6.7542664e-06 6.1120283e-06 6.3663068e-06 9.4285714 + 82700 1.1430058e-05 0 6.5788951e-06 6.0514089e-06 6.4433754e-06 9.4285714 + 82800 1.1220674e-05 0 6.5791612e-06 6.0531604e-06 6.6770698e-06 9.4285714 + 82900 1.0833337e-05 0 6.47818e-06 6.0122996e-06 6.8321143e-06 9.4285714 + 83000 9.6966107e-06 0 6.2531746e-06 5.9309876e-06 6.8402408e-06 9.4285714 + 83100 9.7912048e-06 0 6.1233799e-06 5.8467558e-06 6.8017122e-06 9.4285714 + 83200 1.0342776e-05 0 6.1812546e-06 5.7996644e-06 6.7456475e-06 9.4285714 + 83300 9.1053605e-06 0 6.2862234e-06 5.7715058e-06 6.6864541e-06 9.4285714 + 83400 8.1376574e-06 0 6.3534217e-06 5.8081229e-06 6.6544011e-06 9.4285714 + 83500 8.3013823e-06 0 6.4049353e-06 5.8627471e-06 6.6442675e-06 9.4285714 + 83600 7.5747246e-06 0 6.3101238e-06 5.9294619e-06 6.6505997e-06 9.4285714 + 83700 6.7051973e-06 0 6.1464953e-06 5.8827036e-06 6.6813364e-06 9.4285714 + 83800 6.7732855e-06 0 6.1039107e-06 5.7663207e-06 6.7463747e-06 9.4285714 + 83900 6.455146e-06 0 6.191176e-06 5.719103e-06 6.7193618e-06 9.4285714 + 84000 6.033363e-06 0 6.1987406e-06 5.6639744e-06 6.7404074e-06 9.4285714 + 84100 6.1544361e-06 0 6.1093662e-06 5.4981158e-06 6.9178146e-06 9.4285714 + 84200 5.8120515e-06 0 5.8682237e-06 5.4078594e-06 7.1748608e-06 9.4285714 + 84300 5.5925414e-06 0 5.8299675e-06 5.4425557e-06 7.3447739e-06 9.4285714 + 84400 5.9495987e-06 0 5.8440449e-06 5.5318695e-06 7.3677152e-06 9.4285714 + 84500 5.7713446e-06 0 5.8137185e-06 5.672038e-06 7.2420253e-06 9.4285714 + 84600 5.2346414e-06 0 5.7724697e-06 5.8135669e-06 7.089944e-06 9.4285714 + 84700 5.3677312e-06 0 5.7932199e-06 5.8900538e-06 6.986661e-06 9.4285714 + 84800 5.5545452e-06 0 5.8402198e-06 5.8520541e-06 6.892677e-06 9.4285714 + 84900 5.35857e-06 0 5.8265347e-06 5.8000233e-06 6.8516545e-06 9.4285714 + 85000 5.4081539e-06 0 5.783936e-06 5.7703706e-06 6.8630043e-06 9.4285714 + 85100 5.6686315e-06 0 5.7695537e-06 5.7106213e-06 6.8449127e-06 9.4285714 + 85200 5.6470622e-06 0 5.8250423e-06 5.6629171e-06 6.774264e-06 9.4285714 + 85300 5.4542991e-06 0 5.9016498e-06 5.6655349e-06 6.7281738e-06 9.4285714 + 85400 5.5974388e-06 0 5.9646597e-06 5.6947162e-06 6.6806947e-06 9.4285714 + 85500 5.9109345e-06 0 5.967179e-06 5.6810561e-06 6.6036521e-06 9.4285714 + 85600 5.8895141e-06 0 5.9638498e-06 5.6150965e-06 6.5709969e-06 9.4285714 + 85700 5.8470051e-06 0 6.0226793e-06 5.5476887e-06 6.650327e-06 9.4285714 + 85800 6.060997e-06 0 6.0805171e-06 5.5114717e-06 6.7408394e-06 9.4285714 + 85900 6.1217894e-06 0 6.1343577e-06 5.5394005e-06 6.8609753e-06 9.4285714 + 86000 5.7550467e-06 0 6.1710899e-06 5.6424943e-06 6.9634617e-06 9.4285714 + 86100 5.6513685e-06 0 6.1564873e-06 5.8517272e-06 6.9818339e-06 9.4285714 + 86200 5.7555479e-06 0 6.1071953e-06 5.9846538e-06 6.9607131e-06 9.4285714 + 86300 5.7587322e-06 0 6.1027542e-06 6.0234009e-06 6.969152e-06 9.4285714 + 86400 5.8389333e-06 0 6.1697397e-06 6.0477528e-06 7.0119472e-06 9.4285714 + 86500 5.9431034e-06 0 6.2597537e-06 6.0475988e-06 7.0667343e-06 9.4285714 + 86600 5.9655129e-06 0 6.2896528e-06 6.0010507e-06 7.0437962e-06 9.4285714 + 86700 6.042955e-06 0 6.2709737e-06 5.8440573e-06 6.9441762e-06 9.4285714 + 86800 6.2666413e-06 0 6.1964071e-06 5.6894309e-06 6.8811779e-06 9.4285714 + 86900 6.5118003e-06 0 6.1051139e-06 5.6557711e-06 6.8722493e-06 9.4285714 + 87000 6.7509257e-06 0 6.0291493e-06 5.6830661e-06 6.916898e-06 9.4285714 + 87100 6.9118143e-06 0 6.0183397e-06 5.6796551e-06 7.0011007e-06 9.4285714 + 87200 6.9983412e-06 0 6.040127e-06 5.6529434e-06 7.127229e-06 9.4285714 + 87300 7.2267392e-06 0 6.0286797e-06 5.6230076e-06 7.2573882e-06 9.4285714 + 87400 7.3928522e-06 0 6.0129878e-06 5.5947139e-06 7.4524445e-06 9.4285714 + 87500 7.1675783e-06 0 6.0469379e-06 5.7445703e-06 7.5694621e-06 9.4285714 + 87600 6.9310557e-06 0 6.1331355e-06 5.8982521e-06 7.5787155e-06 9.4285714 + 87700 6.8020949e-06 0 6.312632e-06 5.9646e-06 7.5159198e-06 9.4285714 + 87800 6.7871509e-06 0 6.4438446e-06 5.8625717e-06 7.4014079e-06 9.4285714 + 87900 7.1459737e-06 0 6.5483239e-06 5.7458287e-06 7.3742373e-06 9.4285714 + 88000 7.4791665e-06 0 6.6494489e-06 5.7733829e-06 7.5763999e-06 9.4285714 + 88100 7.4418527e-06 0 6.7353307e-06 5.903551e-06 7.7655167e-06 9.4285714 + 88200 6.8171325e-06 0 6.9359356e-06 6.0764899e-06 8.0003945e-06 9.4285714 + 88300 5.9535317e-06 0 7.0673476e-06 6.2127209e-06 8.2558166e-06 9.4285714 + 88400 5.8054385e-06 0 7.0393025e-06 6.295728e-06 8.3249618e-06 9.4285714 + 88500 5.7381974e-06 0 6.986322e-06 6.3150237e-06 8.3161166e-06 9.4285714 + 88600 5.8193958e-06 0 6.9610838e-06 6.2643723e-06 8.3456298e-06 9.4285714 + 88700 5.7843884e-06 0 7.025256e-06 6.1780449e-06 8.4360622e-06 9.4285714 + 88800 5.36122e-06 0 7.1886768e-06 6.1335975e-06 8.6566218e-06 9.4285714 + 88900 4.9662584e-06 0 7.2896286e-06 6.1156834e-06 8.7588271e-06 9.4285714 + 89000 5.0244565e-06 0 7.2730496e-06 6.083749e-06 8.7659659e-06 9.4285714 + 89100 5.2140172e-06 0 7.1617638e-06 6.0498839e-06 8.7631514e-06 9.4285714 + 89200 5.4241028e-06 0 7.0779466e-06 6.0064798e-06 8.7654482e-06 9.4285714 + 89300 5.354843e-06 0 7.0385405e-06 5.9746409e-06 8.8526601e-06 9.4285714 + 89400 4.9583346e-06 0 6.9725874e-06 5.9883731e-06 8.8784101e-06 9.4285714 + 89500 4.7804845e-06 0 6.8896169e-06 6.0555358e-06 8.7411283e-06 9.4285714 + 89600 4.5353969e-06 0 6.8441433e-06 6.1441445e-06 8.5998496e-06 9.4285714 + 89700 4.3528727e-06 0 6.9096594e-06 6.2696259e-06 8.4806368e-06 9.4285714 + 89800 4.0677397e-06 0 7.0681849e-06 6.3600745e-06 8.3821485e-06 9.4285714 + 89900 3.4743886e-06 0 7.208934e-06 6.2417154e-06 8.2590362e-06 9.4285714 + 90000 2.9448035e-06 0 7.2648444e-06 6.1025056e-06 8.1567217e-06 9.4285714 + 90100 2.8584378e-06 0 7.2361844e-06 6.0292519e-06 8.1323675e-06 9.4285714 + 90200 3.0154097e-06 0 7.1912833e-06 5.9880227e-06 8.1509776e-06 9.4285714 + 90300 3.0998012e-06 0 7.1621354e-06 5.9387681e-06 8.1447795e-06 9.4285714 + 90400 3.0622205e-06 0 7.1346468e-06 5.8551087e-06 8.0849875e-06 9.4285714 + 90500 2.8987354e-06 0 7.0808755e-06 5.7480505e-06 8.0655448e-06 9.4285714 + 90600 2.6710434e-06 0 7.0205199e-06 5.7165534e-06 8.0846444e-06 9.4285714 + 90700 2.4095074e-06 0 6.9439805e-06 5.7493599e-06 8.0259105e-06 9.4285714 + 90800 2.202904e-06 0 6.9317463e-06 5.8100449e-06 7.9027214e-06 9.4285714 + 90900 2.3181295e-06 0 7.0034101e-06 5.8778489e-06 7.7654197e-06 9.4285714 + 91000 2.3141951e-06 0 7.0766754e-06 5.9435646e-06 7.6679494e-06 9.4285714 + 91100 2.0683071e-06 0 7.0355929e-06 5.9830977e-06 7.5547272e-06 9.4285714 + 91200 1.8857219e-06 0 6.886975e-06 5.9803391e-06 7.3843659e-06 9.4285714 + 91300 1.8327584e-06 0 6.7232199e-06 5.8972482e-06 7.172749e-06 9.4285714 + 91400 1.804747e-06 0 6.6658239e-06 5.7775933e-06 6.9879557e-06 9.4285714 + 91500 1.6349771e-06 0 6.6744755e-06 5.6582742e-06 6.8615206e-06 9.4285714 + 91600 1.5216476e-06 0 6.6865456e-06 5.5795361e-06 6.7883528e-06 9.4285714 + 91700 1.6141413e-06 0 6.68539e-06 5.5586295e-06 6.7422583e-06 9.4285714 + 91800 1.6435107e-06 0 6.6317895e-06 5.6102143e-06 6.7060043e-06 9.4285714 + 91900 1.5649292e-06 0 6.5474777e-06 5.6787362e-06 6.6783459e-06 9.4285714 + 92000 1.5598003e-06 0 6.4984086e-06 5.7448839e-06 6.6563568e-06 9.4285714 + 92100 1.5645521e-06 0 6.502615e-06 5.7854556e-06 6.6299693e-06 9.4285714 + 92200 1.5384794e-06 0 6.5324855e-06 5.791917e-06 6.5998087e-06 9.4285714 + 92300 1.5428705e-06 0 6.5828146e-06 5.7573607e-06 6.564701e-06 9.4285714 + 92400 1.5481835e-06 0 6.6310796e-06 5.6780865e-06 6.551415e-06 9.4285714 + 92500 1.5193765e-06 0 6.6560684e-06 5.5916813e-06 6.568409e-06 9.4285714 + 92600 1.4779648e-06 0 6.6374647e-06 5.5138194e-06 6.605645e-06 9.4285714 + 92700 1.4401385e-06 0 6.5783557e-06 5.466179e-06 6.6343577e-06 9.4285714 + 92800 1.4263884e-06 0 6.5032532e-06 5.4548714e-06 6.6667781e-06 9.4285714 + 92900 1.4318392e-06 0 6.4100939e-06 5.475169e-06 6.7074201e-06 9.4285714 + 93000 1.4336111e-06 0 6.3386325e-06 5.5075916e-06 6.7333938e-06 9.4285714 + 93100 1.4541758e-06 0 6.3430387e-06 5.5366002e-06 6.7522163e-06 9.4285714 + 93200 1.4657669e-06 0 6.4329416e-06 5.581062e-06 6.8176723e-06 9.4285714 + 93300 1.4040886e-06 0 6.5434258e-06 5.6428482e-06 6.9238384e-06 9.4285714 + 93400 1.2988064e-06 0 6.6210628e-06 5.7043118e-06 7.0589134e-06 9.4285714 + 93500 1.2005872e-06 0 6.6510605e-06 5.7583138e-06 7.1470838e-06 9.4285714 + 93600 1.1148329e-06 0 6.6739621e-06 5.8031724e-06 7.198744e-06 9.4285714 + 93700 1.0710007e-06 0 6.7180944e-06 5.8357751e-06 7.2627754e-06 9.4285714 + 93800 1.0923979e-06 0 6.7838026e-06 5.857069e-06 7.3553254e-06 9.4285714 + 93900 1.1070785e-06 0 6.8474162e-06 5.8724205e-06 7.4260353e-06 9.4285714 + 94000 1.0836182e-06 0 6.9184593e-06 5.9063218e-06 7.4593908e-06 9.4285714 + 94100 1.0712532e-06 0 6.9659007e-06 5.9417663e-06 7.4976223e-06 9.4285714 + 94200 1.1089242e-06 0 6.9714436e-06 5.970624e-06 7.55674e-06 9.4285714 + 94300 1.1709624e-06 0 6.9375714e-06 5.9802014e-06 7.6084264e-06 9.4285714 + 94400 1.1698851e-06 0 6.8899943e-06 5.96701e-06 7.6232022e-06 9.4285714 + 94500 1.1331311e-06 0 6.8607818e-06 5.9576831e-06 7.6330828e-06 9.4285714 + 94600 1.1611176e-06 0 6.8775071e-06 5.9659895e-06 7.6539239e-06 9.4285714 + 94700 1.2014763e-06 0 6.9225704e-06 5.978896e-06 7.6602657e-06 9.4285714 + 94800 1.1833928e-06 0 6.9903173e-06 5.9981741e-06 7.6474584e-06 9.4285714 + 94900 1.1648449e-06 0 7.0650539e-06 6.0150496e-06 7.633387e-06 9.4285714 + 95000 1.1252279e-06 0 7.1072978e-06 6.0184786e-06 7.6094493e-06 9.4285714 + 95100 1.0516851e-06 0 7.1142631e-06 6.0065025e-06 7.5761571e-06 9.4285714 + 95200 1.0245214e-06 0 7.1018948e-06 5.993948e-06 7.5486922e-06 9.4285714 + 95300 1.0235812e-06 0 7.0867307e-06 6.0211446e-06 7.52964e-06 9.4285714 + 95400 9.6956254e-07 0 7.0870353e-06 6.072303e-06 7.5090138e-06 9.4285714 + 95500 8.9262312e-07 0 7.0987772e-06 6.1168082e-06 7.5033557e-06 9.4285714 + 95600 8.6064987e-07 0 7.1067297e-06 6.1317068e-06 7.4962696e-06 9.4285714 + 95700 8.7096432e-07 0 7.0919507e-06 6.1268237e-06 7.4461295e-06 9.4285714 + 95800 8.5278957e-07 0 7.0664924e-06 6.1151121e-06 7.3946799e-06 9.4285714 + 95900 7.9717781e-07 0 7.0485109e-06 6.0993542e-06 7.3743405e-06 9.4285714 + 96000 7.7875968e-07 0 7.0534076e-06 6.0721804e-06 7.38935e-06 9.4285714 + 96100 7.8525813e-07 0 7.0843748e-06 6.0420863e-06 7.4393684e-06 9.4285714 + 96200 7.7518366e-07 0 7.1238098e-06 6.028226e-06 7.5045929e-06 9.4285714 + 96300 7.6015915e-07 0 7.1481733e-06 6.0364027e-06 7.5368435e-06 9.4285714 + 96400 7.4067407e-07 0 7.1459565e-06 6.041338e-06 7.4989132e-06 9.4285714 + 96500 7.0061605e-07 0 7.1268071e-06 6.029068e-06 7.4151813e-06 9.4285714 + 96600 6.6164038e-07 0 7.098925e-06 6.0009667e-06 7.3139003e-06 9.4285714 + 96700 6.5255615e-07 0 7.0627067e-06 5.9576708e-06 7.2100844e-06 9.4285714 + 96800 6.5992528e-07 0 7.023092e-06 5.8964071e-06 7.1287006e-06 9.4285714 + 96900 6.618124e-07 0 6.9850613e-06 5.8360203e-06 7.0798167e-06 9.4285714 + 97000 6.7139818e-07 0 6.9588277e-06 5.8062928e-06 7.0552706e-06 9.4285714 + 97100 6.8703272e-07 0 6.9537175e-06 5.8222057e-06 7.0414456e-06 9.4285714 + 97200 6.9368757e-07 0 6.9628009e-06 5.8702813e-06 7.0384753e-06 9.4285714 + 97300 6.9652913e-07 0 6.9734824e-06 5.9290926e-06 7.0544858e-06 9.4285714 + 97400 6.9671901e-07 0 6.9846061e-06 6.0012529e-06 7.083092e-06 9.4285714 + 97500 6.891306e-07 0 6.9869142e-06 6.0395379e-06 7.0939696e-06 9.4285714 + 97600 6.76426e-07 0 6.9788679e-06 6.0215323e-06 7.0606545e-06 9.4285714 + 97700 6.5763751e-07 0 6.9653816e-06 5.9723094e-06 7.0096441e-06 9.4285714 + 97800 6.4854556e-07 0 6.9554426e-06 5.9303617e-06 6.9747745e-06 9.4285714 + 97900 6.5336861e-07 0 6.9405484e-06 5.9124736e-06 6.9578336e-06 9.4285714 + 98000 6.6394525e-07 0 6.9149722e-06 5.9089903e-06 6.9531064e-06 9.4285714 + 98100 6.8885885e-07 0 6.8891311e-06 5.9064849e-06 6.9546779e-06 9.4285714 + 98200 7.2201864e-07 0 6.8704207e-06 5.8899045e-06 6.9512899e-06 9.4285714 + 98300 7.3816538e-07 0 6.8523223e-06 5.8601846e-06 6.9459414e-06 9.4285714 + 98400 7.3631403e-07 0 6.8416192e-06 5.8365194e-06 6.9566027e-06 9.4285714 + 98500 7.2568853e-07 0 6.8359315e-06 5.8202579e-06 6.9826678e-06 9.4285714 + 98600 7.0490905e-07 0 6.8305302e-06 5.8023655e-06 7.0037387e-06 9.4285714 + 98700 6.8484202e-07 0 6.8328514e-06 5.7856688e-06 7.0152903e-06 9.4285714 + 98800 6.6994522e-07 0 6.8665586e-06 5.776709e-06 7.0248186e-06 9.4285714 + 98900 6.2867752e-07 0 6.922678e-06 5.7832988e-06 7.0496494e-06 9.4285714 + 99000 5.6999626e-07 0 6.9604759e-06 5.803298e-06 7.0910089e-06 9.4285714 + 99100 5.2675078e-07 0 6.9689516e-06 5.8313501e-06 7.1326482e-06 9.4285714 + 99200 4.9993032e-07 0 6.9639452e-06 5.8639097e-06 7.1679106e-06 9.4285714 + 99300 4.8034362e-07 0 6.9673566e-06 5.8886473e-06 7.2061899e-06 9.4285714 + 99400 4.633455e-07 0 6.9801545e-06 5.9075721e-06 7.2565116e-06 9.4285714 + 99500 4.423417e-07 0 6.9834282e-06 5.9253367e-06 7.3084834e-06 9.4285714 + 99600 4.2336865e-07 0 6.967599e-06 5.9390331e-06 7.3503483e-06 9.4285714 + 99700 4.0950396e-07 0 6.9366188e-06 5.9452518e-06 7.3763135e-06 9.4285714 + 99800 3.8946719e-07 0 6.9087461e-06 5.9409744e-06 7.3965059e-06 9.4285714 + 99900 3.5789226e-07 0 6.9005219e-06 5.9283255e-06 7.4220159e-06 9.4285714 + 100000 3.23165e-07 0 6.8942094e-06 5.9113196e-06 7.4570026e-06 9.4285714 +Loop time of 178.804 on 4 procs for 100000 steps with 2520 atoms + +Performance: 2416052.451 tau/day, 559.271 timesteps/s +99.5% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.068905 | 1.0142 | 3.632 | 150.2 | 0.57 +Bond | 2.4179 | 45.255 | 152.45 | 922.4 | 25.31 +Neigh | 2.7318 | 2.7504 | 2.7587 | 0.7 | 1.54 +Comm | 2.2428 | 62.076 | 153.59 | 708.9 | 34.72 +Output | 0.14703 | 1.3253 | 2.7063 | 102.7 | 0.74 +Modify | 0.66661 | 4.887 | 15.428 | 276.1 | 2.73 +Other | | 61.5 | | | 34.39 + +Nlocal: 630 ave 2513 max 0 min +Histogram: 3 0 0 0 0 0 0 0 0 1 +Nghost: 39.25 ave 150 max 0 min +Histogram: 3 0 0 0 0 0 0 0 0 1 +Neighs: 2458 ave 9821 max 0 min +Histogram: 3 0 0 0 0 0 0 0 0 1 + +Total # of neighbors = 9832 +Ave neighs/atom = 3.9015873 +Ave special neighs/atom = 36.31746 +Neighbor list builds = 5178 +Dangerous builds = 314 +Total wall time: 0:02:58 diff --git a/examples/bpm/pour/rect.mol b/examples/bpm/pour/rect.mol new file mode 100644 index 0000000000..16edb17682 --- /dev/null +++ b/examples/bpm/pour/rect.mol @@ -0,0 +1,568 @@ +#Made with create_mol.py + +63 atoms +297 bonds + +Coords +#ID x y z +1 0.0 0.0 0.0 +2 0.7348518971806154 0.7348518971806154 0.0 +3 0.7348518971806154 0.0 0.7348518971806154 +4 0.0 0.7348518971806154 0.7348518971806154 +5 1.4697037943612308 0.0 0.0 +6 1.4697037943612308 0.7348518971806154 0.7348518971806154 +7 0.0 1.4697037943612308 0.0 +8 0.7348518971806154 1.4697037943612308 0.7348518971806154 +9 1.4697037943612308 1.4697037943612308 0.0 +10 0.0 0.0 1.4697037943612308 +11 0.7348518971806154 0.7348518971806154 1.4697037943612308 +12 0.7348518971806154 0.0 2.204555691541846 +13 0.0 0.7348518971806154 2.204555691541846 +14 1.4697037943612308 0.0 1.4697037943612308 +15 1.4697037943612308 0.7348518971806154 2.204555691541846 +16 0.0 1.4697037943612308 1.4697037943612308 +17 0.7348518971806154 1.4697037943612308 2.204555691541846 +18 1.4697037943612308 1.4697037943612308 1.4697037943612308 +19 0.0 0.0 2.9394075887224616 +20 0.7348518971806154 0.7348518971806154 2.9394075887224616 +21 0.7348518971806154 0.0 3.674259485903077 +22 0.0 0.7348518971806154 3.674259485903077 +23 1.4697037943612308 0.0 2.9394075887224616 +24 1.4697037943612308 0.7348518971806154 3.674259485903077 +25 0.0 1.4697037943612308 2.9394075887224616 +26 0.7348518971806154 1.4697037943612308 3.674259485903077 +27 1.4697037943612308 1.4697037943612308 2.9394075887224616 +28 0.0 0.0 4.409111383083692 +29 0.7348518971806154 0.7348518971806154 4.409111383083692 +30 0.7348518971806154 0.0 5.143963280264308 +31 0.0 0.7348518971806154 5.143963280264308 +32 1.4697037943612308 0.0 4.409111383083692 +33 1.4697037943612308 0.7348518971806154 5.143963280264308 +34 0.0 1.4697037943612308 4.409111383083692 +35 0.7348518971806154 1.4697037943612308 5.143963280264308 +36 1.4697037943612308 1.4697037943612308 4.409111383083692 +37 0.0 0.0 5.878815177444923 +38 0.7348518971806154 0.7348518971806154 5.878815177444923 +39 0.7348518971806154 0.0 6.613667074625538 +40 0.0 0.7348518971806154 6.613667074625538 +41 1.4697037943612308 0.0 5.878815177444923 +42 1.4697037943612308 0.7348518971806154 6.613667074625538 +43 0.0 1.4697037943612308 5.878815177444923 +44 0.7348518971806154 1.4697037943612308 6.613667074625538 +45 1.4697037943612308 1.4697037943612308 5.878815177444923 +46 0.0 0.0 7.348518971806154 +47 0.7348518971806154 0.7348518971806154 7.348518971806154 +48 0.7348518971806154 0.0 8.08337086898677 +49 0.0 0.7348518971806154 8.08337086898677 +50 1.4697037943612308 0.0 7.348518971806154 +51 1.4697037943612308 0.7348518971806154 8.08337086898677 +52 0.0 1.4697037943612308 7.348518971806154 +53 0.7348518971806154 1.4697037943612308 8.08337086898677 +54 1.4697037943612308 1.4697037943612308 7.348518971806154 +55 0.0 0.0 8.818222766167384 +56 0.7348518971806154 0.7348518971806154 8.818222766167384 +57 0.7348518971806154 0.0 9.553074663348 +58 0.0 0.7348518971806154 9.553074663348 +59 1.4697037943612308 0.0 8.818222766167384 +60 1.4697037943612308 0.7348518971806154 9.553074663348 +61 0.0 1.4697037943612308 8.818222766167384 +62 0.7348518971806154 1.4697037943612308 9.553074663348 +63 1.4697037943612308 1.4697037943612308 8.818222766167384 + +Types +#ID type +1 1 +2 1 +3 1 +4 1 +5 1 +6 1 +7 1 +8 1 +9 1 +10 1 +11 1 +12 1 +13 1 +14 1 +15 1 +16 1 +17 1 +18 1 +19 1 +20 1 +21 1 +22 1 +23 1 +24 1 +25 1 +26 1 +27 1 +28 1 +29 1 +30 1 +31 1 +32 1 +33 1 +34 1 +35 1 +36 1 +37 1 +38 1 +39 1 +40 1 +41 1 +42 1 +43 1 +44 1 +45 1 +46 1 +47 1 +48 1 +49 1 +50 1 +51 1 +52 1 +53 1 +54 1 +55 1 +56 1 +57 1 +58 1 +59 1 +60 1 +61 1 +62 1 +63 1 + +Diameters +#ID diameter +1 1 +2 1 +3 1 +4 1 +5 1 +6 1 +7 1 +8 1 +9 1 +10 1 +11 1 +12 1 +13 1 +14 1 +15 1 +16 1 +17 1 +18 1 +19 1 +20 1 +21 1 +22 1 +23 1 +24 1 +25 1 +26 1 +27 1 +28 1 +29 1 +30 1 +31 1 +32 1 +33 1 +34 1 +35 1 +36 1 +37 1 +38 1 +39 1 +40 1 +41 1 +42 1 +43 1 +44 1 +45 1 +46 1 +47 1 +48 1 +49 1 +50 1 +51 1 +52 1 +53 1 +54 1 +55 1 +56 1 +57 1 +58 1 +59 1 +60 1 +61 1 +62 1 +63 1 + +Masses +#ID mass +1 1 +2 1 +3 1 +4 1 +5 1 +6 1 +7 1 +8 1 +9 1 +10 1 +11 1 +12 1 +13 1 +14 1 +15 1 +16 1 +17 1 +18 1 +19 1 +20 1 +21 1 +22 1 +23 1 +24 1 +25 1 +26 1 +27 1 +28 1 +29 1 +30 1 +31 1 +32 1 +33 1 +34 1 +35 1 +36 1 +37 1 +38 1 +39 1 +40 1 +41 1 +42 1 +43 1 +44 1 +45 1 +46 1 +47 1 +48 1 +49 1 +50 1 +51 1 +52 1 +53 1 +54 1 +55 1 +56 1 +57 1 +58 1 +59 1 +60 1 +61 1 +62 1 +63 1 + +Bonds +#ID type atom1 atom2 +1 1 1 2 +2 1 1 3 +3 1 1 4 +4 1 1 5 +5 1 1 7 +6 1 1 10 +7 1 2 3 +8 1 2 4 +9 1 2 5 +10 1 2 6 +11 1 2 7 +12 1 2 8 +13 1 2 9 +14 1 2 11 +15 1 3 4 +16 1 3 5 +17 1 3 6 +18 1 3 8 +19 1 3 10 +20 1 3 11 +21 1 3 12 +22 1 3 14 +23 1 4 6 +24 1 4 7 +25 1 4 8 +26 1 4 10 +27 1 4 11 +28 1 4 13 +29 1 4 16 +30 1 5 6 +31 1 5 9 +32 1 5 14 +33 1 6 8 +34 1 6 9 +35 1 6 11 +36 1 6 14 +37 1 6 18 +38 1 7 8 +39 1 7 9 +40 1 7 16 +41 1 8 9 +42 1 8 11 +43 1 8 16 +44 1 8 17 +45 1 8 18 +46 1 9 18 +47 1 10 11 +48 1 10 12 +49 1 10 13 +50 1 10 14 +51 1 10 16 +52 1 10 19 +53 1 11 12 +54 1 11 13 +55 1 11 14 +56 1 11 15 +57 1 11 16 +58 1 11 17 +59 1 11 18 +60 1 12 13 +61 1 12 14 +62 1 12 15 +63 1 12 17 +64 1 12 19 +65 1 12 20 +66 1 12 21 +67 1 12 23 +68 1 13 15 +69 1 13 16 +70 1 13 17 +71 1 13 19 +72 1 13 20 +73 1 13 22 +74 1 13 25 +75 1 14 15 +76 1 14 18 +77 1 14 23 +78 1 15 17 +79 1 15 18 +80 1 15 20 +81 1 15 23 +82 1 15 27 +83 1 16 17 +84 1 16 18 +85 1 16 25 +86 1 17 18 +87 1 17 20 +88 1 17 25 +89 1 17 27 +90 1 18 27 +91 1 19 20 +92 1 19 21 +93 1 19 22 +94 1 19 23 +95 1 19 25 +96 1 19 28 +97 1 20 21 +98 1 20 22 +99 1 20 23 +100 1 20 24 +101 1 20 25 +102 1 20 26 +103 1 20 27 +104 1 20 29 +105 1 21 22 +106 1 21 23 +107 1 21 24 +108 1 21 26 +109 1 21 28 +110 1 21 29 +111 1 21 30 +112 1 21 32 +113 1 22 24 +114 1 22 25 +115 1 22 26 +116 1 22 28 +117 1 22 29 +118 1 22 34 +119 1 23 24 +120 1 23 27 +121 1 23 32 +122 1 24 26 +123 1 24 27 +124 1 24 29 +125 1 24 32 +126 1 24 36 +127 1 25 26 +128 1 25 27 +129 1 25 34 +130 1 26 27 +131 1 26 29 +132 1 26 34 +133 1 26 35 +134 1 26 36 +135 1 27 36 +136 1 28 29 +137 1 28 30 +138 1 28 31 +139 1 28 32 +140 1 28 34 +141 1 28 37 +142 1 29 30 +143 1 29 31 +144 1 29 32 +145 1 29 33 +146 1 29 34 +147 1 29 35 +148 1 29 36 +149 1 29 38 +150 1 30 31 +151 1 30 32 +152 1 30 33 +153 1 30 35 +154 1 30 37 +155 1 30 38 +156 1 30 41 +157 1 31 33 +158 1 31 34 +159 1 31 35 +160 1 31 37 +161 1 31 38 +162 1 31 40 +163 1 31 43 +164 1 32 33 +165 1 32 36 +166 1 32 41 +167 1 33 35 +168 1 33 36 +169 1 33 38 +170 1 33 41 +171 1 33 42 +172 1 33 45 +173 1 34 35 +174 1 34 36 +175 1 34 43 +176 1 35 36 +177 1 35 38 +178 1 35 43 +179 1 35 45 +180 1 36 45 +181 1 37 38 +182 1 37 39 +183 1 37 40 +184 1 37 41 +185 1 37 43 +186 1 37 46 +187 1 38 39 +188 1 38 40 +189 1 38 41 +190 1 38 42 +191 1 38 43 +192 1 38 44 +193 1 38 45 +194 1 38 47 +195 1 39 40 +196 1 39 41 +197 1 39 42 +198 1 39 44 +199 1 39 46 +200 1 39 47 +201 1 39 50 +202 1 40 42 +203 1 40 43 +204 1 40 44 +205 1 40 46 +206 1 40 47 +207 1 40 52 +208 1 41 42 +209 1 41 45 +210 1 41 50 +211 1 42 44 +212 1 42 45 +213 1 42 47 +214 1 42 50 +215 1 42 51 +216 1 42 54 +217 1 43 44 +218 1 43 45 +219 1 43 52 +220 1 44 45 +221 1 44 47 +222 1 44 52 +223 1 44 53 +224 1 44 54 +225 1 45 54 +226 1 46 47 +227 1 46 48 +228 1 46 49 +229 1 46 50 +230 1 46 52 +231 1 46 55 +232 1 47 48 +233 1 47 49 +234 1 47 50 +235 1 47 51 +236 1 47 52 +237 1 47 53 +238 1 47 54 +239 1 47 56 +240 1 48 49 +241 1 48 50 +242 1 48 51 +243 1 48 53 +244 1 48 55 +245 1 48 56 +246 1 48 57 +247 1 48 59 +248 1 49 51 +249 1 49 52 +250 1 49 53 +251 1 49 55 +252 1 49 56 +253 1 49 58 +254 1 49 61 +255 1 50 51 +256 1 50 54 +257 1 50 59 +258 1 51 53 +259 1 51 54 +260 1 51 56 +261 1 51 59 +262 1 51 63 +263 1 52 53 +264 1 52 54 +265 1 52 61 +266 1 53 54 +267 1 53 56 +268 1 53 61 +269 1 53 62 +270 1 53 63 +271 1 54 63 +272 1 55 56 +273 1 55 57 +274 1 55 58 +275 1 55 59 +276 1 55 61 +277 1 56 57 +278 1 56 58 +279 1 56 59 +280 1 56 60 +281 1 56 61 +282 1 56 62 +283 1 56 63 +284 1 57 58 +285 1 57 59 +286 1 57 60 +287 1 57 62 +288 1 58 60 +289 1 58 61 +290 1 58 62 +291 1 59 60 +292 1 59 63 +293 1 60 62 +294 1 60 63 +295 1 61 62 +296 1 61 63 +297 1 62 63 diff --git a/examples/kim/plugin/CMakeLists.txt b/examples/kim/plugin/CMakeLists.txt new file mode 100644 index 0000000000..f4cb5f598d --- /dev/null +++ b/examples/kim/plugin/CMakeLists.txt @@ -0,0 +1,99 @@ +########################################## +# CMake build system for plugin examples. +# The is meant to be used as a template for plugins that are +# distributed independent from the LAMMPS package. +########################################## + +cmake_minimum_required(VERSION 3.10) + +# enforce out-of-source build +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) + message(FATAL_ERROR "In-source builds are not allowed. You must create and use a build directory. " + "Please remove CMakeCache.txt and CMakeFiles first.") +endif() + +project(kimplugin VERSION 1.0 LANGUAGES CXX) + +set(LAMMPS_SOURCE_DIR "" CACHE PATH "Location of LAMMPS sources folder") +if(NOT LAMMPS_SOURCE_DIR) + message(FATAL_ERROR "Must set LAMMPS_SOURCE_DIR") +endif() + +# by default, install into $HOME/.local (not /usr/local), +# so that no root access (and sudo) is needed +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "Default install path" FORCE) +endif() + +# ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro +# and prints lots of pointless warnings about "unsafe" functions +if(MSVC) + add_compile_options(/Zc:__cplusplus) + add_compile_options(/wd4244) + add_compile_options(/wd4267) + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) +endif() + +# C++11 is required +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# Need -restrict with Intel compilers +if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict") +endif() + +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +include(CheckIncludeFileCXX) +include(LAMMPSInterfaceCXX) + +########################## +# building the plugins + +add_library(kimplugin MODULE kimplugin.cpp ${LAMMPS_SOURCE_DIR}/KIM/pair_kim.cpp + ${LAMMPS_SOURCE_DIR}/KIM/fix_store_kim.cpp ${LAMMPS_SOURCE_DIR}/KIM/kim_command.cpp + ${LAMMPS_SOURCE_DIR}/KIM/kim_init.cpp ${LAMMPS_SOURCE_DIR}/KIM/kim_interactions.cpp + ${LAMMPS_SOURCE_DIR}/KIM/kim_param.cpp ${LAMMPS_SOURCE_DIR}/KIM/kim_property.cpp + ${LAMMPS_SOURCE_DIR}/KIM/kim_query.cpp ${LAMMPS_SOURCE_DIR}/KIM/kim_units.cpp) +target_link_libraries(kimplugin PRIVATE lammps) +target_include_directories(kimplugin PRIVATE ${LAMMPS_SOURCE_DIR}/KIM) +set_target_properties(kimplugin PROPERTIES PREFIX "" SUFFIX ".so") + +find_package(KIM-API 2.2.0 CONFIG REQUIRED) +target_link_libraries(kimplugin PRIVATE KIM-API::kim-api) + +########################## +# need libcurl +find_package(CURL) +if(CURL_FOUND) + if(CMAKE_VERSION VERSION_LESS 3.12) + target_include_directories(kimplugin PRIVATE ${CURL_INCLUDE_DIRS}) + target_link_libraries(kimplugin PRIVATE ${CURL_LIBRARIES}) + else() + target_link_libraries(kimplugin PRIVATE CURL::libcurl) + endif() + target_compile_definitions(kimplugin PRIVATE -DLMP_KIM_CURL) + set(LMP_DEBUG_CURL OFF CACHE STRING "Set libcurl verbose mode on/off. If on, it displays a lot of verbose information about its operations.") + mark_as_advanced(LMP_DEBUG_CURL) + if(LMP_DEBUG_CURL) + target_compile_definitions(kimplugin PRIVATE -DLMP_DEBUG_CURL) + endif() + set(LMP_NO_SSL_CHECK OFF CACHE STRING "Tell libcurl to not verify the peer. If on, the connection succeeds regardless of the names in the certificate. Insecure - Use with caution!") + mark_as_advanced(LMP_NO_SSL_CHECK) + if(LMP_NO_SSL_CHECK) + target_compile_definitions(kimplugin PRIVATE -DLMP_NO_SSL_CHECK) + endif() +endif() + +# MacOS seems to need this +if(CMAKE_SYSTEM_NAME STREQUAL Darwin) + set_target_properties(kimplugin PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") +# tell CMake to export all symbols to a .dll on Windows with special case for MinGW cross-compilers + set_target_properties(kimplugin.so PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + if(CMAKE_CROSSCOMPILING) + set_target_properties(kimplugin PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols") + endif() +else() + set_target_properties(kimplugin PROPERTIES LINK_FLAGS "-rdynamic") +endif() diff --git a/examples/kim/plugin/LAMMPSInterfaceCXX.cmake b/examples/kim/plugin/LAMMPSInterfaceCXX.cmake new file mode 100644 index 0000000000..dfbd77e28a --- /dev/null +++ b/examples/kim/plugin/LAMMPSInterfaceCXX.cmake @@ -0,0 +1,88 @@ +# Cmake script code to define the LAMMPS C++ interface +# settings required for building LAMMPS plugins + +################################################################################ +# helper function +function(validate_option name values) + string(TOLOWER ${${name}} needle_lower) + string(TOUPPER ${${name}} needle_upper) + list(FIND ${values} ${needle_lower} IDX_LOWER) + list(FIND ${values} ${needle_upper} IDX_UPPER) + if(${IDX_LOWER} LESS 0 AND ${IDX_UPPER} LESS 0) + list_to_bulletpoints(POSSIBLE_VALUE_LIST ${${values}}) + message(FATAL_ERROR "\n########################################################################\n" + "Invalid value '${${name}}' for option ${name}\n" + "\n" + "Possible values are:\n" + "${POSSIBLE_VALUE_LIST}" + "########################################################################") + endif() +endfunction(validate_option) + +################################################################################# +# LAMMPS C++ interface. We only need the header related parts. +add_library(lammps INTERFACE) +target_include_directories(lammps INTERFACE ${LAMMPS_SOURCE_DIR}) +if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING) + target_link_libraries(lammps INTERFACE ${CMAKE_BINARY_DIR}/../liblammps.dll.a) +endif() +################################################################################ +# MPI configuration +if(NOT CMAKE_CROSSCOMPILING) + set(MPI_CXX_SKIP_MPICXX TRUE) + find_package(MPI QUIET) + option(BUILD_MPI "Build MPI version" ${MPI_FOUND}) +else() + option(BUILD_MPI "Build MPI version" OFF) +endif() + +if(BUILD_MPI) + find_package(MPI REQUIRED) + option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF) + if(LAMMPS_LONGLONG_TO_LONG) + target_compile_definitions(lammps INTERFACE -DLAMMPS_LONGLONG_TO_LONG) + endif() + target_link_libraries(lammps INTERFACE MPI::MPI_CXX) +else() + target_include_directories(lammps INTERFACE "${LAMMPS_SOURCE_DIR}/STUBS") +endif() + +set(LAMMPS_SIZES "smallbig" CACHE STRING "LAMMPS integer sizes (smallsmall: all 32-bit, smallbig: 64-bit #atoms #timesteps, bigbig: also 64-bit imageint, 64-bit atom ids)") +set(LAMMPS_SIZES_VALUES smallbig bigbig smallsmall) +set_property(CACHE LAMMPS_SIZES PROPERTY STRINGS ${LAMMPS_SIZES_VALUES}) +validate_option(LAMMPS_SIZES LAMMPS_SIZES_VALUES) +string(TOUPPER ${LAMMPS_SIZES} LAMMPS_SIZES) +target_compile_definitions(lammps INTERFACE -DLAMMPS_${LAMMPS_SIZES}) + +################################################################################ +# detect if we may enable OpenMP support by default +set(BUILD_OMP_DEFAULT OFF) +find_package(OpenMP QUIET) +if(OpenMP_FOUND) + check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE) + if(HAVE_OMP_H_INCLUDE) + set(BUILD_OMP_DEFAULT ON) + endif() +endif() + +option(BUILD_OMP "Build with OpenMP support" ${BUILD_OMP_DEFAULT}) + +if(BUILD_OMP) + find_package(OpenMP REQUIRED) + check_include_file_cxx(omp.h HAVE_OMP_H_INCLUDE) + if(NOT HAVE_OMP_H_INCLUDE) + message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support") + endif() + + if (((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)) OR + (CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR + ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR + ((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0))) + # GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts. + # Intel 18.0 was tested to support both, so we switch to OpenMP 4+ from 19.x onward to be safe. + target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=4) + else() + target_compile_definitions(lammps INTERFACE -DLAMMPS_OMP_COMPAT=3) + endif() + target_link_libraries(lammps INTERFACE OpenMP::OpenMP_CXX) +endif() diff --git a/examples/kim/plugin/kimplugin.cpp b/examples/kim/plugin/kimplugin.cpp new file mode 100644 index 0000000000..45b1f75681 --- /dev/null +++ b/examples/kim/plugin/kimplugin.cpp @@ -0,0 +1,54 @@ + +#include "lammpsplugin.h" +#include "version.h" + +#include "pair_kim.h" +#include "fix_store_kim.h" +#include "kim_command.h" + +using namespace LAMMPS_NS; + +static Pair *pair_kim_creator(LAMMPS *lmp) +{ + return new PairKIM(lmp); +} + +static Fix *fix_store_kim_creator(LAMMPS *lmp, int argc, char **argv) +{ + return new FixStoreKIM(lmp, argc, argv); +} + +static Command *kim_command_creator(LAMMPS *lmp) +{ + return new KimCommand(lmp); +} + +extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc) +{ + lammpsplugin_t plugin; + lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc; + + // register kim pair style + plugin.version = LAMMPS_VERSION; + plugin.style = "pair"; + plugin.name = "kim"; + plugin.info = "KIM plugin pair style v1.0"; + plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)"; + plugin.creator.v1 = (lammpsplugin_factory1 *) &pair_kim_creator; + plugin.handle = handle; + (*register_plugin)(&plugin, lmp); + + // register fix STORE/KIM only need to update changed fields + plugin.style = "fix"; + plugin.name = "STORE/KIM"; + plugin.info = "Internal settings storage for KIM fix style v1.0"; + plugin.creator.v2 = (lammpsplugin_factory2 *) &fix_store_kim_creator; + (*register_plugin)(&plugin, lmp); + + // register KIM command + plugin.style = "command"; + plugin.name = "kim"; + plugin.info = "kim command style v1.0"; + plugin.creator.v1 = (lammpsplugin_factory1 *) &kim_command_creator; + (*register_plugin)(&plugin, lmp); +} diff --git a/examples/mdi/README b/examples/mdi/README new file mode 100644 index 0000000000..fd459e6670 --- /dev/null +++ b/examples/mdi/README @@ -0,0 +1,228 @@ +These are examples that work the MDI package in LAMMPS which uses the +MolSSI MDI library for coupling codes together and communicating +between them with MDI messages. + +In MDI lingo, one code is the driver and another code is the engine. +The 2 codes can be written in any language; C++ (LAMMPS) and Python +are illustrated here. The 2 codes can each be stand-alone codes, in +which case they can be run on different numbers of processors. The 2 +codes can communicate either via TCP (sockets) or via MPI. For the +TCP case, the driver and engine need to be launched separately, +e.g. in 2 windows on your desktop machine. For the MPI case, a single +mpirun command launches both codes. + +Alternatively the engine code can be a plugin library which the driver +code loads, in which case the driver and engine run on the same +processors. + +LAMMPS supports operating in all these MDI modes. It can be an engine +operating either as a stand-alone code or as a plugin. It can also be +a driver and couple to an engine that is either a stand-alone code or +a plugin. Examples for all these use cases are in this directory. +The example commands below illustrate how to run all the variants. + +To use LAMMPS as a plugin engine, you must build it as a shared library. +Something like this, which also builds the normal LAMMPS executable +lmp_mpi: + +cd src +make yes-mdi +make mode=shlib mpi + +To use the serial_driver.py example you will need Python 3 with Numpy +and mpi4py available in your Python. Make sure LAMMPS and Python are +using same the same version of MPI. + +------------------------------------------------- +------------------------------------------------- + +* Example #1 = run ab inito MD (AIMD) + Two instances of LAMMPS operate as a driver and engine + As an engine, LAMMPS is a surrogate for a quantum code + +Note that the 2 input scripts in.aimd.alone and in.aimd.driver +have an option for running in NVE vs NPT mode. Comment in/out +the appropriate line to change modes. Nothing needs to be +changed in the in.aimd.engine or in.aimd.engine.plugin scripts. + +--- + +Run the entire calculation with a single instance of LAMMPS by itself + results should be identical to running this example with MDI + +% lmp_mpi < in.aimd.alone + +With MDI, the thermo output of the driver should match the thermo +output of the in.aimd.alone script. + +--- + +Run with TCP: 1 proc each + +% lmp_mpi -mdi "-name aimd -role DRIVER -method TCP -port 8021" -log log.aimd.driver -in in.aimd.driver + +% lmp_mpi -mdi "-name LAMMPS -role ENGINE -method TCP -port 8021 -hostname localhost" -log log.aimd.engine -in in.aimd.engine + +--- + +Run with TCP: 3 procs + 4 procs + +% mpirun -np 3 lmp_mpi -mdi "-name aimd -role DRIVER -method TCP -port 8021" -log log.aimd.driver -in in.aimd.driver + +% mpirun -np 4 lmp_mpi -mdi "-name LAMMPS -role ENGINE -method TCP -port 8021 -hostname localhost" -log log.aimd.engine -in in.aimd.engine + +--- + +Run with MPI: 1 proc each + +% mpirun -np 1 lmp_mpi -mdi "-name aimd -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 1 lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine + +--- + +Run with MPI: 3 procs + 4 procs + +% mpirun -np 3 lmp_mpi -mdi "-name aimd -role DRIVER -method MPI" -log log.aimd.driver -in in.aimd.driver : -np 4 lmp_mpi -mdi "-name LAMMPS -role ENGINE -method MPI" -log log.aimd.engine -in in.aimd.engine + +--- + +Run in plugin mode: 1 proc + +% lmp_mpi -mdi "-name aimd -role DRIVER -method LINK -plugin_path /home/sjplimp/lammps/git/src" -log log.aimd.driver.plugin -in in.aimd.driver.plugin + +--- + +Run in plugin mode: 3 procs + +% mpirun -np 3 lmp_mpi -mdi "-name aimd -role DRIVER -method LINK -plugin_path /home/sjplimp/lammps/git/src" -log log.aimd.driver.plugin -in in.aimd.driver.plugin + +------------------------------------------------- +------------------------------------------------- + +* Example #2 = Python driver runs a sequence of unrelated LAMMPS calculations + Each calculation can be a single-point evaluation, MD run, or minimization + +The sequence_driver.py code allows for optional switches in addition +to -mdi (required) and the -plugin and -plugin_args switches which are +used to link to an engine as a plugin library. The example run +commands below just use the default values of the optional switches. +The switches are also explained at the top of the file; the info is +copied here: + +# -n 3 +# number of calculations to perform, default = 3 +# -mode eval/run/min +# style of calculations: single snapshot evals, dynamics, minimization +# default = run +# -size Nx Ny Nz +# cubic lattice, default = 2 2 2 +# -rho 0.75 0.1 +# reduced density and random variation thereof, default = 0.75 0.1 +# -delta 0.1 +# randomly perturb atoms initially by this distance, default 0.1 +# -nsteps 100 +# number of timesteps in dynamics runs, default = 100 +# -temp 1.0 +# initial temperature in dynamics runs, default = 1.0 +# -tol 0.001 +# tolerance for minimizations, default = 0.001 +# -seed 12345 +# random number seed > 0, default = 12345 + +--- + +Run with TCP: 1 proc each + +% python3 sequence_driver.py -mdi "-role DRIVER -name sequence -method TCP -port 8021" + +% lmp_mpi -mdi "-role ENGINE -name LAMMPS -method TCP -port 8021 -hostname localhost" -log log.sequence -in in.sequence + +--- + +Run with TCP: 2 proc + 4 procs + +% mpirun -np 2 python3 sequence_driver.py -mdi "-role DRIVER -name sequence -method TCP -port 8021" + +% mpirun -np 4 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method TCP -port 8021 -hostname localhost" -log log.sequence -in in.sequence + +--- + +Run with MPI: 1 proc each + +% mpirun -np 1 python3 sequence_driver.py -mdi "-role DRIVER -name sequence -method MPI" : -np 1 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.sequence -in in.sequence + +--- + +Run with MPI: 2 procs + 4 procs + +% mpirun -np 2 python3 sequence_driver.py -mdi "-role DRIVER -name sequence -method MPI" : -np 4 lmp_mpi -mdi "-role ENGINE -name LAMMPS -method MPI" -log log.sequence -in in.sequence + +--- + +Run in plugin mode: 1 proc + +% python3 sequence_driver.py -plugin lammps -mdi "-role DRIVER -name sequence -method LINK -plugin_path /home/sjplimp/lammps/git/src" -plugin_args "-log log.sequence -in in.sequence" + +--- + +Run in plugin mode: 3 procs + +% mpirun -np 3 python3 sequence_driver.py -plugin lammps -mdi "-role DRIVER -name sequence -method LINK -plugin_path /home/sjplimp/lammps/git/src" -plugin_args "-log log.sequence -in in.sequence" + +------------------------------------------------- +------------------------------------------------- + +* Example #3 = run AIMD with Python driver code and 2 LAMMPS instances as engines + First LAMMPS instance performs the MD timestepping + Second LAMMPS instance is surrogate QM = computes forces + +The aimd_driver.py code allows for an optional switch in addition to +-mdi (required) and the -plugin and -plugin_args swiches which are +used to link to the 2 engines as a plugin libraries. The example run +commands below use the default values of the optional switch. The +switch is also explained the top of the file; the info is copied +here: + +# -nsteps 5 +# number of timesteps in dynamics runs, default = 5 + +--- + +Run the entire calculation with a single instance of LAMMPS by itself + results should be identical to running this example with MDI + +% lmp_mpi < in.aimd.alone + +With MDI, the driver prints the QM and Total energies. These should +match the PotEng and TotEng output of the in.aimd.alone script. + +--- + +Run with TCP: 1 proc each + +% python3 aimd_driver.py -mdi "-role DRIVER -name aimd -method TCP -port 8021" + +% lmp_mpi -mdi "-role ENGINE -name MM -method TCP -port 8021 -hostname localhost" -log log.aimd.mm -in in.aimd.mm + +% lmp_mpi -mdi "-role ENGINE -name QM -method TCP -port 8021 -hostname localhost" -log log.aimd.qm -in in.aimd.qm + +--- + +Run with TCP: 2 procs + 2 procs + 3 procs + +% mpirun -np 2 python3 aimd_driver.py -mdi "-role DRIVER -name aimd -method TCP -port 8021" + +% mpirun -np 2 lmp_mpi -mdi "-role ENGINE -name MM -method TCP -port 8021 -hostname localhost" -log log.aimd.mm -in in.aimd.mm + +% mpirun -np 3 lmp_mpi -mdi "-role ENGINE -name QM -method TCP -port 8021 -hostname localhost" -log log.aimd.qm -in in.aimd.qm + +--- + +Run with MPI: 1 proc each + +% mpirun -np 1 python3 aimd_driver.py -mdi "-role DRIVER -name aimd -method MPI" : -np 1 lmp_mpi -mdi "-role ENGINE -name MM -method MPI" -log log.aimd.mm -in in.aimd.mm : -np 1 lmp_mpi -mdi "-role ENGINE -name QM -method MPI" -log log.aimd.qm -in in.aimd.qm + +--- + +Run with MPI: 2 procs + 2 procs + 3 procs + +% mpirun -np 2 python3 aimd_driver.py -mdi "-role DRIVER -name aimd -method MPI" : -np 2 lmp_mpi -mdi "-role ENGINE -name MM -method MPI" -log log.aimd.mm -in in.aimd.mm : -np 3 lmp_mpi -mdi "-role ENGINE -name QM -method MPI" -log log.aimd.qm -in in.aimd.qm diff --git a/examples/mdi/aimd_driver.py b/examples/mdi/aimd_driver.py new file mode 100644 index 0000000000..2d8fe10c1a --- /dev/null +++ b/examples/mdi/aimd_driver.py @@ -0,0 +1,255 @@ +# MDI driver to perform an AIMD simulation +# using one instance of LAMMPS as the MD timestepper +# using second instance of LAMMPS as a QM surrogate to compute forces + +# NOTE: this script is derived from the MDI_AIMD_Driver.cpp code +# included in the MDI distribution +# it alters the timestepping to match a velocity Verlet algorithm +# forces are computed once before timestepping beings +# both the @COORDS and @FORCES nodes are triggered in the MM code +# as the appropriate places to extract COORDS and provide FORCES + +# Syntax: python3 aimd_driver.py switch arg switch arg ... +# possible switches: +# -mdi "-role DRIVER ..." +# required switch +# example for stand-alone mode: +# -mdi "-role DRIVER -name sequence -method TCP -port 8021" +# example for plugin mode: +# -mdi "-role DRIVER -name sequemce -method LINK +# -plugin_path /home/sjplimp/lammps/src/" +# -plugin name +# name of plugin library, only when using plugin mode +# -plugin_args arglist +# args to add when launching plugin library, only when using plugin mode +# enclose arglist in quotes if multiple words +# -nsteps 5 +# number of timesteps, default = 5 + +import sys,math,random +import mdi +import numpy as np +from mpi4py import MPI + +# error message + +def error(txt=None): + if txt: raise Exception(txt) + raise Exception("Syntax: python3 aimd_driver.py switch arg switch arg ...") + +# run an AIMD simulation + +def perform_aimd(world,mm_comm,qm_comm): + + me = world.Get_rank() + nprocs = world.Get_size() + + # receive number of atoms from the MM engine + + mdi.MDI_Send_command("COORDS",qm_comm) + mdi.MDI_Send(coords,3*natoms,mdi.MDI_DOUBLE,qm_comm) + + # get QM potential energy + + mdi.MDI_Send_command("FORCES",mm_comm) + mdi.MDI_Send(forces,3*natoms,mdi.MDI_DOUBLE,mm_comm) + + # get MM kinetic energy + + mdi.MDI_Send_command("COORDS",qm_comm) + mdi.MDI_Send(coords,3*natoms,mdi.MDI_DOUBLE,qm_comm) + + # get QM potential energy + + mdi.MDI_Send_command("FORCES",mm_comm) + mdi.MDI_Send(forces,3*natoms,mdi.MDI_DOUBLE,mm_comm) + + # MM engine proceeds to @ENDSTEP node + # so that KE will be for fully updated velocity + + mdi.MDI_Send_command("@ENDSTEP",mm_comm) + + # get MM kinetic energy + + mdi.MDI_Send_command(" narg: error() + mdiarg = args[iarg+1] + iarg += 2 + elif args[iarg] == "-plugin": + if iarg+2 > narg: error() + plugin = args[iarg+1] + iarg += 2 + elif args[iarg] == "-plugin_args": + if iarg+2 > narg: error() + plugin_args = args[iarg+1] + iarg += 2 + elif args[iarg] == "-nsteps": + if iarg+2 > narg: error() + nsteps = int(args[iarg+1]) + if nsteps < 0: error() + iarg += 2 + else: error() + +if not mdiarg: error() + +# LAMMPS engines are stand-alone codes +# world = MPI communicator for just this driver +# invoke perform_tasks() directly + +if not plugin: + mdi.MDI_Init(mdiarg) + world = mdi.MDI_MPI_get_world_comm() + + # connect to 2 engines, determine which is MM vs QM + + mdicomm1 = mdi.MDI_Accept_Communicator() + mdicomm2 = mdi.MDI_Accept_Communicator() + + mdi.MDI_Send_command(" 0, default = 12345 + +import sys,math,random +import mdi +import numpy as np +from mpi4py import MPI + +# error message + +def error(txt=None): + if txt: raise Exception(txt) + raise Exception("Syntax: python3 series_driver.py switch arg switch arg ...") + +# loop over all the tasks to exchange MDI Sends/Receives with the engine +# for standalone mode, this is called by main program below +# for plugin mode, this is a callback function invoked by MDI + +def perform_tasks(world,mdicomm,dummy): + + me = world.Get_rank() + nprocs = world.Get_size() + + # allocate vectors for per-atom types, coords, vels, forces + + natoms = nx * ny * nz + atypes = np.zeros(natoms,dtype=np.int) + coords = np.zeros(3*natoms,dtype=np.float64) + vels = np.zeros(3*natoms,dtype=np.float64) + forces = np.zeros(3*natoms,dtype=np.float64) + + atypes[:] = 1 + + # initialize RN generator + + random.seed(seed) + + # loop over sequence of calculations + + for icalc in range(ncalc): + + # define simulation box + + onerho = rho + (random.random()-0.5)*rhodelta; + sigma = pow(1.0/onerho,1.0/3.0) + + xlo = ylo = zlo = 0.0 + xhi = nx * sigma + yhi = ny * sigma + zhi = nz * sigma + + # send simulation box to engine + + vec = [xhi-xlo,0.0,0.0] + [0.0,yhi-ylo,0.0] + [0.0,0.0,zhi-zlo] + mdi.MDI_Send_command(">CELL",mdicomm) + mdi.MDI_Send(vec,9,mdi.MDI_DOUBLE,mdicomm) + + # create atoms on perfect lattice + + m = 0 + for k in range(nz): + for j in range(ny): + for i in range(nx): + coords[m] = i * sigma + coords[m+1] = j * sigma + coords[m+2] = k * sigma + m += 3 + + # perturb lattice + + for m in range(3*natoms): + coords[m] += 2.0*random.random()*delta - delta + + # define initial velocities + + for m in range(3*natoms): + vels[m] = random.random() - 0.5 + + tcurrent = 0.0 + for m in range(3*natoms): + tcurrent += vels[m]*vels[m] + tcurrent /= 3*(natoms-1) + + factor = math.sqrt(tinitial/tcurrent) + + for m in range(3*natoms): + vels[m] *= factor + + # send atoms and their properties to engine + + mdi.MDI_Send_command(">NATOMS",mdicomm) + mdi.MDI_Send(natoms,1,mdi.MDI_INT,mdicomm) + mdi.MDI_Send_command(">TYPES",mdicomm) + mdi.MDI_Send(atypes,natoms,mdi.MDI_INT,mdicomm) + mdi.MDI_Send_command(">COORDS",mdicomm) + mdi.MDI_Send(coords,3*natoms,mdi.MDI_DOUBLE,mdicomm) + mdi.MDI_Send_command(">VELOCITIES",mdicomm) + mdi.MDI_Send(vels,3*natoms,mdi.MDI_DOUBLE,mdicomm) + + # eval or run or minimize + + if mode == "eval": + pass + elif mode == "run": + mdi.MDI_Send_command(">NSTEPS",mdicomm) + mdi.MDI_Send(nsteps,1,mdi.MDI_INT,mdicomm) + mdi.MDI_Send_command("MD",mdicomm) + elif mode == "min": + mdi.MDI_Send_command(">TOLERANCE",mdicomm) + params = [tol,tol,1000.0,1000.0] + mdi.MDI_Send(params,4,mdi.MDI_DOUBLE,mdicomm) + mdi.MDI_Send_command("OPTG",mdicomm) + + # request potential energy + + mdi.MDI_Send_command(" narg: error() + mdiarg = args[iarg+1] + iarg += 2 + elif args[iarg] == "-plugin": + if iarg+2 > narg: error() + plugin = args[iarg+1] + iarg += 2 + elif args[iarg] == "-plugin_args": + if iarg+2 > narg: error() + plugin_args = args[iarg+1] + iarg += 2 + elif args[iarg] == "-n": + if iarg+2 > narg: error() + ncalc = int(args[iarg+1]) + iarg += 2 + elif args[iarg] == "-mode": + if iarg+2 > narg: error() + mode = args[iarg+1] + if mode != "eval" and mode != "run" and mode != "min": error() + iarg += 2 + elif args[iarg] == "-size": + if iarg+4 > narg: error() + nx = int(args[iarg+1]) + ny = int(args[iarg+2]) + nz = int(args[iarg+3]) + if nx <= 0 or ny <= 0 or nz <= 0: error() + iarg += 4 + elif args[iarg] == "-rho": + if iarg+3 > narg: error() + rho = float(args[iarg+1]) + rhodelta = float(args[iarg+2]) + if rho-rhodelta <= 0.0: error() + iarg += 3 + elif args[iarg] == "-delta": + if iarg+2 > narg: error() + delta = float(args[iarg+1]) + if delta < 0.0: error() + iarg += 2 + elif args[iarg] == "-nsteps": + if iarg+2 > narg: error() + nsteps = int(args[iarg+1]) + if nsteps < 0: error() + iarg += 2 + elif args[iarg] == "-temp": + if iarg+2 > narg: error() + tinitial = float(args[iarg+1]) + if tinitial < 0.0: error() + iarg += 2 + elif args[iarg] == "-tol": + if iarg+2 > narg: error() + tol = float(args[iarg+1]) + if tol < 0.0: error() + iarg += 2 + elif args[iarg] == "-seed": + if iarg+2 > narg: error() + seed = int(args[iarg+1]) + if seed <= 0: error() + iarg += 2 + else: error() + +if not mdiarg: error() + +mdi.MDI_Init(mdiarg) + +# LAMMPS engine is a stand-alone code +# world = MPI communicator for just this driver +# invoke perform_tasks() directly + +if not plugin: + world = mdi.MDI_MPI_get_world_comm() + mdicomm = mdi.MDI_Accept_Communicator() + perform_tasks(world,mdicomm,None) + +# LAMMPS engine is a plugin library +# launch plugin +# MDI will call back to perform_tasks() + +if plugin: + world = MPI.COMM_WORLD + plugin_args += " -mdi \"-role ENGINE -name lammps -method LINK\"" + mdi.MDI_Launch_plugin(plugin,plugin_args,world,perform_tasks,None) diff --git a/examples/message/README b/examples/message/README deleted file mode 100644 index 6db735803e..0000000000 --- a/examples/message/README +++ /dev/null @@ -1,116 +0,0 @@ -This dir contains scripts that demonstrate how to use LAMMPS as both a -client and server code to run a simple MD simulation. LAMMPS as a -client performs the MD timestepping. LAMMPS as a server provides the -energy and forces between interacting particles. Every timestep the -LAMMPS client sends a message to the LAMMPS server and receives a -response message in return. - -Another code could replace LAMMPS as the client, e.g. another MD code -which wants to use a LAMMPS potential. Another code could replace -LAMMPS as the server, e.g. a quantum code computing quantum forces, so -that ab initio MD could be performed. See an example of the latter in -examples/COUPLE/lammps_vasp. - -See the MESSAGE package documentation Build_extras.html#message -and Build_extras.html#message for more details on how client/server -coupling works in LAMMPS. - --------------- - -Note that you can adjust the problem size run by these scripts by -setting "x,y,z" variables when you run LAMMPS. The default problem size -is x = y = z = 5, which is 500 particles. - -lmp_mpi -v x 10 -v y 10 -v z 20 # 8000 particles - -This applies to either in.message or in.message.client - -You can also run the in.message scripts with an NPT integrator -instead of NVE, if you comment/uncomment the correct lines. - -The client and server script define a "mode" variable -which can be set to file, zmq, mpi/one, or mpi/two, -as illustrated below. - --------------- - -To run this problem in the traditional way (no client/server coupling) -do one of these: - -% lmp_serial -in in.message -% mpirun -np 4 lmp_mpi -in in.message - -Or run with in.message.tilt. - --------------- - -To run in client/server mode: - -Both the client and server script must use the same messaging mode. -This can be selected by setting the "mode" variable when you run -LAMMPS. The default mode = file. The other options for the mode -variable are zmq, mpione, mpitwo. - -Here we assume LAMMPS was built to run in parallel, and the MESSAGE -package was installed with socket (ZMQ) support. This means any of -the 4 messaging modes can be used. - -The next sections illustrate how to launch LAMMPS twice, once as a -client, once as a server, for each of the messaging modes. - -In all cases, the client should print out thermodynamic info for 50 -steps. The server should print out setup info, print nothing until -the client exits, at which point the server should also exit. - -The examples below show launching LAMMPS twice from the same window -(or batch script), using the "&" character to launch the first time in -the background. For all modes except {mpi/one}, you could also launch -twice in separate windows on your desktop machine. It does not matter -whether you launch the client or server first. - -In these examples either the client or server can be run on one or -more processors. If running in a non-MPI mode (file or zmq) you can -launch LAMMPS on a single processor without using mpirun. - -IMPORTANT: If you run in mpi/two mode, you must launch LAMMPS both -times via mpirun, even if one or both of them runs on a single -processor. This is so that MPI can figure out how to connect both MPI -processes together to exchange MPI messages between them. - --------------- - -NOTE: the Script.sh file has comands to perform all the -runs listed below. - --------------- - -File or ZMQ or mpi/two modes of messaging: - -% mpirun -np 1 lmp_mpi -v mode file -log log.client -in in.message.client & -% mpirun -np 2 lmp_mpi -v mode file -log log.server -in in.message.server - -% mpirun -np 4 lmp_mpi -v mode zmq -log log.client -in in.message.client & -% mpirun -np 1 lmp_mpi -v mode zmq -log log.server -in in.message.server - -% mpirun -np 2 lmp_mpi -v mode mpitwo -log log.client -in in.message.client & -% mpirun -np 4 lmp_mpi -v mode mpitwo -log log.server -in in.message.server - -Or run with in.message.tilt.client/server. -Don't run the tilt files with the "file" mode; they run too slow. - --------------- - -Mpi/one mode of messaging: - -Launch LAMMPS twice in a single mpirun command: - -% mpirun -np 2 lmp_mpi -mpicolor 0 -in in.message.client -v mode mpione -log log.client : -np 4 lmp_mpi -mpicolor 1 -in in.message.server -v mode mpione -log log.server - -Or run with in.message.tilt.client/server. - -The two -np values determine how many procs the client and the server -run on. - -A LAMMPS executable run in this manner must use the -mpicolor color -command-line option as its first option, where color is set to one -integer value for the 1st app, and another value for the 2nd app. diff --git a/examples/message/Script.sh b/examples/message/Script.sh deleted file mode 100644 index fdcd6f1188..0000000000 --- a/examples/message/Script.sh +++ /dev/null @@ -1,55 +0,0 @@ -# sample launch script - -# message on 1 proc each - -mpirun -np 1 lmp_mpi -log log.message.g++.1 < in.message - -mpirun -np 1 lmp_mpi -v mode file -log log.message.client.file.g++.1 < in.message.client & -mpirun -np 1 lmp_mpi -v mode file -log log.message.server.file.g++.1 < in.message.server - -mpirun -np 1 lmp_mpi -v mode zmq -log log.message.client.zmq.g++.1 < in.message.client & -mpirun -np 1 lmp_mpi -v mode zmq -log log.message.server.zmq.g++.1 < in.message.server - -mpirun -np 1 lmp_mpi -v mode mpitwo -log log.message.client.mpitwo.g++.1 < in.message.client & -mpirun -np 1 lmp_mpi -v mode mpitwo -log log.message.server.mpitwo.g++.1 < in.message.server - -mpirun -np 1 lmp_mpi -m 0 -in in.message.client -v mode mpione -log log.message.client.mpione.g++.1 : -np 1 lmp_mpi -m 1 -in in.message.server -v mode mpione -log log.message.server.mpione.g++.1 - -# message on 2/4 procs each - -mpirun -np 4 lmp_mpi -log log.message.g++.4 < in.message - -mpirun -np 2 lmp_mpi -v mode file -log log.message.client.file.g++.2 < in.message.client & -mpirun -np 4 lmp_mpi -v mode file -log log.message.server.file.g++.4 < in.message.server - -mpirun -np 2 lmp_mpi -v mode zmq -log log.message.client.zmq.g++.2 < in.message.client & -mpirun -np 4 lmp_mpi -v mode zmq -log log.message.server.zmq.g++.4 < in.message.server - -mpirun -np 2 lmp_mpi -v mode mpitwo -log log.message.client.mpitwo.g++.2 < in.message.client & -mpirun -np 4 lmp_mpi -v mode mpitwo -log log.message.server.mpitwo.g++.4 < in.message.server - -mpirun -np 2 lmp_mpi -m 0 -in in.message.client -v mode mpione -log log.message.client.mpione.g++.2 : -np 4 lmp_mpi -m 1 -in in.message.server -v mode mpione -log log.message.server.mpione.g++.4 - -# message.tilt on 1 proc each - -mpirun -np 1 lmp_mpi -log log.message.tilt.g++.1 < in.message.tilt - -mpirun -np 1 lmp_mpi -v mode zmq -log log.message.tilt.client.zmq.g++.1 < in.message.tilt.client & -mpirun -np 1 lmp_mpi -v mode zmq -log log.message.tilt.server.zmq.g++.1 < in.message.tilt.server - -mpirun -np 1 lmp_mpi -v mode mpitwo -log log.message.tilt.client.mpitwo.g++.1 < in.message.tilt.client & -mpirun -np 1 lmp_mpi -v mode mpitwo -log log.message.tilt.server.mpitwo.g++.1 < in.message.tilt.server - -mpirun -np 1 lmp_mpi -m 0 -in in.message.tilt.client -v mode mpione -log log.message.tilt.client.mpione.g++.1 : -np 1 lmp_mpi -m 1 -in in.message.tilt.server -v mode mpione -log log.message.tilt.server.mpione.g++.1 - -# message.tilt on 2/4 procs each - -mpirun -np 1 lmp_mpi -log log.message.tilt.g++.4 < in.message.tilt - -mpirun -np 2 lmp_mpi -v mode zmq -log log.message.tilt.client.zmq.g++.2 < in.message.tilt.client & -mpirun -np 4 lmp_mpi -v mode zmq -log log.message.tilt.server.zmq.g++.4 < in.message.tilt.server - -mpirun -np 2 lmp_mpi -v mode mpitwo -log log.message.tilt.client.mpitwo.g++.2 < in.message.tilt.client & -mpirun -np 4 lmp_mpi -v mode mpitwo -log log.message.tilt.server.mpitwo.g++.4 < in.message.tilt.server - -mpirun -np 2 lmp_mpi -m 0 -in in.message.tilt.client -v mode mpione -log log.message.tilt.client.mpione.g++.2 : -np 4 lmp_mpi -m 1 -in in.message.tilt.server -v mode mpione -log log.message.tilt.server.mpione.g++.4 diff --git a/examples/message/in.message.client b/examples/message/in.message.client deleted file mode 100644 index cd0a40367a..0000000000 --- a/examples/message/in.message.client +++ /dev/null @@ -1,43 +0,0 @@ -# 3d Lennard-Jones melt - client script - -variable mode index file - -if "${mode} == file" then & - "message client md file tmp.couple" & -elif "${mode} == zmq" & - "message client md zmq localhost:5555" & -elif "${mode} == mpione" & - "message client md mpi/one" & -elif "${mode} == mpitwo" & - "message client md mpi/two tmp.couple" - -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify sort 0 0.0 map yes - -lattice fcc 0.8442 -region box block 0 $x 0 $y 0 $z -create_box 1 box -create_atoms 1 box -mass 1 1.0 - -velocity all create 1.44 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -# same with NPT -#fix 1 all npt temp 1.0 1.0 0.1 iso 1 1 1.0 - -fix 2 all client/md -fix_modify 2 energy yes - -thermo 10 -run 50 - -message quit diff --git a/examples/message/in.message.server b/examples/message/in.message.server deleted file mode 100644 index 2fedd2ae00..0000000000 --- a/examples/message/in.message.server +++ /dev/null @@ -1,29 +0,0 @@ -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then & - "message server md file tmp.couple" & -elif "${mode} == zmq" & - "message server md zmq *:5555" & -elif "${mode} == mpione" & - "message server md mpi/one" & -elif "${mode} == mpitwo" & - "message server md mpi/two tmp.couple" - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -region box block 0 1 0 1 0 1 -create_box 1 box -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md diff --git a/examples/message/in.message.tilt b/examples/message/in.message.tilt deleted file mode 100644 index 51126eae1e..0000000000 --- a/examples/message/in.message.tilt +++ /dev/null @@ -1,30 +0,0 @@ -# 2d NEMD simulation - no client/server mode - -units lj -atom_style atomic -dimension 2 - -lattice sq2 0.8442 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -create_atoms 1 box -mass * 1.0 - -velocity all create 1.44 87287 loop geom - -region slice block 4 6 INF INF INF INF -set region slice type 2 - -pair_style lj/cut 2.5 -pair_coeff * * 1.0 1.0 1.0 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nvt/sllod temp 1.0 1.0 1.0 tchain 1 -fix 2 all deform 1 xy erate 0.01 remap v - -thermo_style custom step temp epair etotal press xy - -thermo 1000 -run 50000 diff --git a/examples/message/in.message.tilt.client b/examples/message/in.message.tilt.client deleted file mode 100644 index d178c801f5..0000000000 --- a/examples/message/in.message.tilt.client +++ /dev/null @@ -1,44 +0,0 @@ -# 2d NEMD simulation - client script - -variable mode index file - -if "${mode} == file" then & - "message client md file tmp.couple" & -elif "${mode} == zmq" & - "message client md zmq localhost:5555" & -elif "${mode} == mpione" & - "message client md mpi/one" & -elif "${mode} == mpitwo" & - "message client md mpi/two tmp.couple" - -units lj -atom_style atomic -dimension 2 -atom_modify sort 0 0.0 map yes - -lattice sq2 0.8442 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -create_atoms 1 box -mass * 1.0 - -velocity all create 1.44 87287 loop geom - -region slice block 4 6 INF INF INF INF -set region slice type 2 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nvt/sllod temp 1.0 1.0 1.0 tchain 1 -fix 2 all deform 1 xy erate 0.01 remap v - -fix 3 all client/md -fix_modify 3 energy yes - -thermo_style custom step temp epair etotal press xy - -thermo 1000 -run 50000 - -message quit diff --git a/examples/message/in.message.tilt.server b/examples/message/in.message.tilt.server deleted file mode 100644 index ba211ed15f..0000000000 --- a/examples/message/in.message.tilt.server +++ /dev/null @@ -1,31 +0,0 @@ -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then & - "message server md file tmp.couple" & -elif "${mode} == zmq" & - "message server md zmq *:5555" & -elif "${mode} == mpione" & - "message server md mpi/one" & -elif "${mode} == mpitwo" & - "message server md mpi/two tmp.couple" - -units lj -atom_style atomic -dimension 2 -atom_modify map yes - -lattice sq2 0.8442 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -create_atoms 1 box -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff * * 1.0 1.0 1.0 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md diff --git a/examples/message/log.28Aug18.message.client.file.g++.1 b/examples/message/log.28Aug18.message.client.file.g++.1 deleted file mode 100644 index bca1d37dd5..0000000000 --- a/examples/message/log.28Aug18.message.client.file.g++.1 +++ /dev/null @@ -1,79 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md file tmp.couple - -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify sort 0 0.0 map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000752926 secs -mass 1 1.0 - -velocity all create 1.44 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -# same with NPT -#fix 1 all npt temp 1.0 1.0 0.1 iso 1 1 1.0 - -fix 2 all client/md -fix_modify 2 energy yes - -thermo 10 -run 50 -Per MPI rank memory allocation (min/avg/max) = 2.303 | 2.303 | 2.303 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 0 0 -4.6176881 -5.0221006 - 10 1.1347688 0 0 -4.6166043 -2.6072847 - 20 0.628166 0 0 -4.62213 1.0186262 - 30 0.73767593 0 0 -4.6254647 0.49629637 - 40 0.69517962 0 0 -4.6253506 0.69303877 - 50 0.70150496 0 0 -4.6259832 0.59551518 -Loop time of 5.0251 on 1 procs for 50 steps with 500 atoms - -Performance: 4298.421 tau/day, 9.950 timesteps/s -0.1% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 9.7752e-06 | 9.7752e-06 | 9.7752e-06 | 0.0 | 0.00 -Comm | 0.00014925 | 0.00014925 | 0.00014925 | 0.0 | 0.00 -Output | 0.00023127 | 0.00023127 | 0.00023127 | 0.0 | 0.00 -Modify | 5.0242 | 5.0242 | 5.0242 | 0.0 | 99.98 -Other | | 0.0004668 | | | 0.01 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 4 -Dangerous builds = 0 -Total wall time: 0:00:05 diff --git a/examples/message/log.28Aug18.message.client.file.g++.2 b/examples/message/log.28Aug18.message.client.file.g++.2 deleted file mode 100644 index 1c868dde37..0000000000 --- a/examples/message/log.28Aug18.message.client.file.g++.2 +++ /dev/null @@ -1,79 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md file tmp.couple - -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify sort 0 0.0 map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 1 by 2 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000613928 secs -mass 1 1.0 - -velocity all create 1.44 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -# same with NPT -#fix 1 all npt temp 1.0 1.0 0.1 iso 1 1 1.0 - -fix 2 all client/md -fix_modify 2 energy yes - -thermo 10 -run 50 -Per MPI rank memory allocation (min/avg/max) = 2.302 | 2.302 | 2.302 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 0 0 -4.6176881 -5.0221006 - 10 1.1347688 0 0 -4.6166043 -2.6072847 - 20 0.628166 0 0 -4.62213 1.0186262 - 30 0.73767593 0 0 -4.6254647 0.49629637 - 40 0.69517962 0 0 -4.6253506 0.69303877 - 50 0.70150496 0 0 -4.6259832 0.59551518 -Loop time of 5.02384 on 2 procs for 50 steps with 500 atoms - -Performance: 4299.499 tau/day, 9.953 timesteps/s -50.1% CPU use with 2 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 1.9073e-06 | 3.3379e-06 | 4.7684e-06 | 0.0 | 0.00 -Comm | 0.00020742 | 0.00021136 | 0.00021529 | 0.0 | 0.00 -Output | 0.00026989 | 0.00048053 | 0.00069118 | 0.0 | 0.01 -Modify | 5.0171 | 5.0199 | 5.0228 | 0.1 | 99.92 -Other | | 0.003203 | | | 0.06 - -Nlocal: 250 ave 255 max 245 min -Histogram: 1 0 0 0 0 0 0 0 0 1 -Nghost: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 4 -Dangerous builds = 0 -Total wall time: 0:00:05 diff --git a/examples/message/log.28Aug18.message.client.mpione.g++.1 b/examples/message/log.28Aug18.message.client.mpione.g++.1 deleted file mode 100644 index 78bee72fdf..0000000000 --- a/examples/message/log.28Aug18.message.client.mpione.g++.1 +++ /dev/null @@ -1,79 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md mpi/one - -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify sort 0 0.0 map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000540018 secs -mass 1 1.0 - -velocity all create 1.44 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -# same with NPT -#fix 1 all npt temp 1.0 1.0 0.1 iso 1 1 1.0 - -fix 2 all client/md -fix_modify 2 energy yes - -thermo 10 -run 50 -Per MPI rank memory allocation (min/avg/max) = 2.303 | 2.303 | 2.303 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 0 0 -4.6176881 -5.0221006 - 10 1.1347688 0 0 -4.6166043 -2.6072847 - 20 0.628166 0 0 -4.62213 1.0186262 - 30 0.73767593 0 0 -4.6254647 0.49629637 - 40 0.69517962 0 0 -4.6253506 0.69303877 - 50 0.70150496 0 0 -4.6259832 0.59551518 -Loop time of 0.0403891 on 1 procs for 50 steps with 500 atoms - -Performance: 534798.272 tau/day, 1237.959 timesteps/s -99.9% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 4.7684e-06 | 4.7684e-06 | 4.7684e-06 | 0.0 | 0.01 -Comm | 6.3181e-05 | 6.3181e-05 | 6.3181e-05 | 0.0 | 0.16 -Output | 9.5367e-05 | 9.5367e-05 | 9.5367e-05 | 0.0 | 0.24 -Modify | 0.040053 | 0.040053 | 0.040053 | 0.0 | 99.17 -Other | | 0.0001726 | | | 0.43 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 4 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.client.mpione.g++.2 b/examples/message/log.28Aug18.message.client.mpione.g++.2 deleted file mode 100644 index 7d7af866e3..0000000000 --- a/examples/message/log.28Aug18.message.client.mpione.g++.2 +++ /dev/null @@ -1,79 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md mpi/one - -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify sort 0 0.0 map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 1 by 2 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000475883 secs -mass 1 1.0 - -velocity all create 1.44 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -# same with NPT -#fix 1 all npt temp 1.0 1.0 0.1 iso 1 1 1.0 - -fix 2 all client/md -fix_modify 2 energy yes - -thermo 10 -run 50 -Per MPI rank memory allocation (min/avg/max) = 2.302 | 2.302 | 2.302 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 0 0 -4.6176881 -5.0221006 - 10 1.1347688 0 0 -4.6166043 -2.6072847 - 20 0.628166 0 0 -4.62213 1.0186262 - 30 0.73767593 0 0 -4.6254647 0.49629637 - 40 0.69517962 0 0 -4.6253506 0.69303877 - 50 0.70150496 0 0 -4.6259832 0.59551518 -Loop time of 0.0208495 on 2 procs for 50 steps with 500 atoms - -Performance: 1035997.740 tau/day, 2398.143 timesteps/s -99.1% CPU use with 2 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 3.0994e-06 | 4.53e-06 | 5.9605e-06 | 0.0 | 0.02 -Comm | 0.00012422 | 0.00012457 | 0.00012493 | 0.0 | 0.60 -Output | 5.7697e-05 | 7.987e-05 | 0.00010204 | 0.0 | 0.38 -Modify | 0.020463 | 0.020464 | 0.020466 | 0.0 | 98.15 -Other | | 0.0001761 | | | 0.84 - -Nlocal: 250 ave 255 max 245 min -Histogram: 1 0 0 0 0 0 0 0 0 1 -Nghost: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 4 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.client.mpitwo.g++.1 b/examples/message/log.28Aug18.message.client.mpitwo.g++.1 deleted file mode 100644 index ee97e7bd1a..0000000000 --- a/examples/message/log.28Aug18.message.client.mpitwo.g++.1 +++ /dev/null @@ -1,79 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md mpi/two tmp.couple - -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify sort 0 0.0 map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000603914 secs -mass 1 1.0 - -velocity all create 1.44 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -# same with NPT -#fix 1 all npt temp 1.0 1.0 0.1 iso 1 1 1.0 - -fix 2 all client/md -fix_modify 2 energy yes - -thermo 10 -run 50 -Per MPI rank memory allocation (min/avg/max) = 2.303 | 2.303 | 2.303 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 0 0 -4.6176881 -5.0221006 - 10 1.1347688 0 0 -4.6166043 -2.6072847 - 20 0.628166 0 0 -4.62213 1.0186262 - 30 0.73767593 0 0 -4.6254647 0.49629637 - 40 0.69517962 0 0 -4.6253506 0.69303877 - 50 0.70150496 0 0 -4.6259832 0.59551518 -Loop time of 0.069119 on 1 procs for 50 steps with 500 atoms - -Performance: 312504.627 tau/day, 723.390 timesteps/s -42.0% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 7.1526e-06 | 7.1526e-06 | 7.1526e-06 | 0.0 | 0.01 -Comm | 0.0001049 | 0.0001049 | 0.0001049 | 0.0 | 0.15 -Output | 0.00014019 | 0.00014019 | 0.00014019 | 0.0 | 0.20 -Modify | 0.068602 | 0.068602 | 0.068602 | 0.0 | 99.25 -Other | | 0.0002651 | | | 0.38 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 4 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.client.mpitwo.g++.2 b/examples/message/log.28Aug18.message.client.mpitwo.g++.2 deleted file mode 100644 index 72db0198d5..0000000000 --- a/examples/message/log.28Aug18.message.client.mpitwo.g++.2 +++ /dev/null @@ -1,79 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md mpi/two tmp.couple - -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify sort 0 0.0 map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 1 by 2 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000667095 secs -mass 1 1.0 - -velocity all create 1.44 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -# same with NPT -#fix 1 all npt temp 1.0 1.0 0.1 iso 1 1 1.0 - -fix 2 all client/md -fix_modify 2 energy yes - -thermo 10 -run 50 -Per MPI rank memory allocation (min/avg/max) = 2.302 | 2.302 | 2.302 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 0 0 -4.6176881 -5.0221006 - 10 1.1347688 0 0 -4.6166043 -2.6072847 - 20 0.628166 0 0 -4.62213 1.0186262 - 30 0.73767593 0 0 -4.6254647 0.49629637 - 40 0.69517962 0 0 -4.6253506 0.69303877 - 50 0.70150496 0 0 -4.6259832 0.59551518 -Loop time of 0.0190214 on 2 procs for 50 steps with 500 atoms - -Performance: 1135563.588 tau/day, 2628.619 timesteps/s -58.5% CPU use with 2 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 1.9073e-06 | 2.861e-06 | 3.8147e-06 | 0.0 | 0.02 -Comm | 0.00017238 | 0.00017989 | 0.0001874 | 0.0 | 0.95 -Output | 0.00012803 | 0.00015497 | 0.00018191 | 0.0 | 0.81 -Modify | 0.018065 | 0.018181 | 0.018297 | 0.1 | 95.58 -Other | | 0.0005029 | | | 2.64 - -Nlocal: 250 ave 255 max 245 min -Histogram: 1 0 0 0 0 0 0 0 0 1 -Nghost: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 4 -Dangerous builds = 0 -Total wall time: 0:00:01 diff --git a/examples/message/log.28Aug18.message.client.zmq.g++.1 b/examples/message/log.28Aug18.message.client.zmq.g++.1 deleted file mode 100644 index 23fa70c1be..0000000000 --- a/examples/message/log.28Aug18.message.client.zmq.g++.1 +++ /dev/null @@ -1,79 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md zmq localhost:5555 - -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify sort 0 0.0 map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000734091 secs -mass 1 1.0 - -velocity all create 1.44 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -# same with NPT -#fix 1 all npt temp 1.0 1.0 0.1 iso 1 1 1.0 - -fix 2 all client/md -fix_modify 2 energy yes - -thermo 10 -run 50 -Per MPI rank memory allocation (min/avg/max) = 2.303 | 2.303 | 2.303 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 0 0 -4.6176881 -5.0221006 - 10 1.1347688 0 0 -4.6166043 -2.6072847 - 20 0.628166 0 0 -4.62213 1.0186262 - 30 0.73767593 0 0 -4.6254647 0.49629637 - 40 0.69517962 0 0 -4.6253506 0.69303877 - 50 0.70150496 0 0 -4.6259832 0.59551518 -Loop time of 0.0778341 on 1 procs for 50 steps with 500 atoms - -Performance: 277513.222 tau/day, 642.392 timesteps/s -11.4% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 7.8678e-06 | 7.8678e-06 | 7.8678e-06 | 0.0 | 0.01 -Comm | 8.3685e-05 | 8.3685e-05 | 8.3685e-05 | 0.0 | 0.11 -Output | 0.00011373 | 0.00011373 | 0.00011373 | 0.0 | 0.15 -Modify | 0.07734 | 0.07734 | 0.07734 | 0.0 | 99.37 -Other | | 0.0002885 | | | 0.37 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 4 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.client.zmq.g++.2 b/examples/message/log.28Aug18.message.client.zmq.g++.2 deleted file mode 100644 index 7833befd21..0000000000 --- a/examples/message/log.28Aug18.message.client.zmq.g++.2 +++ /dev/null @@ -1,79 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md zmq localhost:5555 - -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic -atom_modify sort 0 0.0 map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 1 by 2 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000570059 secs -mass 1 1.0 - -velocity all create 1.44 87287 loop geom - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -# same with NPT -#fix 1 all npt temp 1.0 1.0 0.1 iso 1 1 1.0 - -fix 2 all client/md -fix_modify 2 energy yes - -thermo 10 -run 50 -Per MPI rank memory allocation (min/avg/max) = 2.302 | 2.302 | 2.302 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 0 0 -4.6176881 -5.0221006 - 10 1.1347688 0 0 -4.6166043 -2.6072847 - 20 0.628166 0 0 -4.62213 1.0186262 - 30 0.73767593 0 0 -4.6254647 0.49629637 - 40 0.69517962 0 0 -4.6253506 0.69303877 - 50 0.70150496 0 0 -4.6259832 0.59551518 -Loop time of 0.0416595 on 2 procs for 50 steps with 500 atoms - -Performance: 518489.499 tau/day, 1200.207 timesteps/s -56.5% CPU use with 2 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 2.861e-06 | 3.3379e-06 | 3.8147e-06 | 0.0 | 0.01 -Comm | 0.00013399 | 0.00013685 | 0.00013971 | 0.0 | 0.33 -Output | 8.6784e-05 | 0.00011206 | 0.00013733 | 0.0 | 0.27 -Modify | 0.040948 | 0.04103 | 0.041112 | 0.0 | 98.49 -Other | | 0.0003769 | | | 0.90 - -Nlocal: 250 ave 255 max 245 min -Histogram: 1 0 0 0 0 0 0 0 0 1 -Nghost: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 4 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.g++.1 b/examples/message/log.28Aug18.message.g++.1 deleted file mode 100644 index c06af4e0d1..0000000000 --- a/examples/message/log.28Aug18.message.g++.1 +++ /dev/null @@ -1,85 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - no client/server mode - -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000682831 secs -mass 1 1.0 - -velocity all create 1.44 87287 loop geom - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -# same with NPT -#fix 1 all npt temp 1.0 1.0 0.1 iso 1 1 1.0 - -thermo 10 -run 50 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 3.143 | 3.143 | 3.143 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7733681 0 -4.6176881 -5.0221006 - 10 1.1347688 -6.3153532 0 -4.6166043 -2.6072847 - 20 0.628166 -5.5624945 0 -4.62213 1.0186262 - 30 0.73767593 -5.7297655 0 -4.6254647 0.49629637 - 40 0.69517962 -5.6660345 0 -4.6253506 0.69303877 - 50 0.70150496 -5.6761362 0 -4.6259832 0.59551518 -Loop time of 0.039681 on 1 procs for 50 steps with 500 atoms - -Performance: 544341.699 tau/day, 1260.050 timesteps/s -99.2% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.029993 | 0.029993 | 0.029993 | 0.0 | 75.59 -Neigh | 0.0073051 | 0.0073051 | 0.0073051 | 0.0 | 18.41 -Comm | 0.0012736 | 0.0012736 | 0.0012736 | 0.0 | 3.21 -Output | 0.00012803 | 0.00012803 | 0.00012803 | 0.0 | 0.32 -Modify | 0.00053287 | 0.00053287 | 0.00053287 | 0.0 | 1.34 -Other | | 0.000448 | | | 1.13 - -Nlocal: 500 ave 500 max 500 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 1946 ave 1946 max 1946 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 18820 ave 18820 max 18820 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 18820 -Ave neighs/atom = 37.64 -Neighbor list builds = 4 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.g++.4 b/examples/message/log.28Aug18.message.g++.4 deleted file mode 100644 index 695b51f166..0000000000 --- a/examples/message/log.28Aug18.message.g++.4 +++ /dev/null @@ -1,85 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - no client/server mode - -variable x index 5 -variable y index 5 -variable z index 5 - -units lj -atom_style atomic - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 $x 0 $y 0 $z -region box block 0 5 0 $y 0 $z -region box block 0 5 0 5 0 $z -region box block 0 5 0 5 0 5 -create_box 1 box -Created orthogonal box = (0 0 0) to (8.39798 8.39798 8.39798) - 1 by 2 by 2 MPI processor grid -create_atoms 1 box -Created 500 atoms - Time spent = 0.000656843 secs -mass 1 1.0 - -velocity all create 1.44 87287 loop geom - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nve -# same with NPT -#fix 1 all npt temp 1.0 1.0 0.1 iso 1 1 1.0 - -thermo 10 -run 50 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Per MPI rank memory allocation (min/avg/max) = 3.109 | 3.109 | 3.109 Mbytes -Step Temp E_pair E_mol TotEng Press - 0 1.44 -6.7733681 0 -4.6176881 -5.0221006 - 10 1.1347688 -6.3153532 0 -4.6166043 -2.6072847 - 20 0.628166 -5.5624945 0 -4.62213 1.0186262 - 30 0.73767593 -5.7297655 0 -4.6254647 0.49629637 - 40 0.69517962 -5.6660345 0 -4.6253506 0.69303877 - 50 0.70150496 -5.6761362 0 -4.6259832 0.59551518 -Loop time of 0.0131519 on 4 procs for 50 steps with 500 atoms - -Performance: 1642350.242 tau/day, 3801.737 timesteps/s -97.9% CPU use with 4 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.006074 | 0.0065379 | 0.0072589 | 0.6 | 49.71 -Neigh | 0.0014219 | 0.0015552 | 0.0017018 | 0.3 | 11.82 -Comm | 0.003546 | 0.0043943 | 0.0049584 | 0.8 | 33.41 -Output | 0.000108 | 0.00012845 | 0.00016999 | 0.0 | 0.98 -Modify | 0.00014353 | 0.00014949 | 0.00015569 | 0.0 | 1.14 -Other | | 0.0003865 | | | 2.94 - -Nlocal: 125 ave 128 max 121 min -Histogram: 1 0 0 0 1 0 0 0 1 1 -Nghost: 1091 ave 1094 max 1089 min -Histogram: 1 0 1 0 1 0 0 0 0 1 -Neighs: 4705 ave 4849 max 4648 min -Histogram: 2 1 0 0 0 0 0 0 0 1 - -Total # of neighbors = 18820 -Ave neighs/atom = 37.64 -Neighbor list builds = 4 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.server.file.g++.1 b/examples/message/log.28Aug18.message.server.file.g++.1 deleted file mode 100644 index cf1418d3c5..0000000000 --- a/examples/message/log.28Aug18.message.server.file.g++.1 +++ /dev/null @@ -1,44 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md file tmp.couple - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 1 0 1 0 1 -create_box 1 box -Created orthogonal box = (0 0 0) to (1.6796 1.6796 1.6796) - 1 by 1 by 1 MPI processor grid -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 1 by 1 by 1 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Server MD calls = 51 -Server MD reneighborings 5 -Total wall time: 0:00:05 diff --git a/examples/message/log.28Aug18.message.server.file.g++.4 b/examples/message/log.28Aug18.message.server.file.g++.4 deleted file mode 100644 index c233bad692..0000000000 --- a/examples/message/log.28Aug18.message.server.file.g++.4 +++ /dev/null @@ -1,44 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md file tmp.couple - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 1 0 1 0 1 -create_box 1 box -Created orthogonal box = (0 0 0) to (1.6796 1.6796 1.6796) - 1 by 2 by 2 MPI processor grid -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 1 by 2 by 2 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Server MD calls = 51 -Server MD reneighborings 5 -Total wall time: 0:00:05 diff --git a/examples/message/log.28Aug18.message.server.mpione.g++.1 b/examples/message/log.28Aug18.message.server.mpione.g++.1 deleted file mode 100644 index 81e04aa923..0000000000 --- a/examples/message/log.28Aug18.message.server.mpione.g++.1 +++ /dev/null @@ -1,44 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md mpi/one - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 1 0 1 0 1 -create_box 1 box -Created orthogonal box = (0 0 0) to (1.6796 1.6796 1.6796) - 1 by 1 by 1 MPI processor grid -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 1 by 1 by 1 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Server MD calls = 51 -Server MD reneighborings 5 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.server.mpione.g++.4 b/examples/message/log.28Aug18.message.server.mpione.g++.4 deleted file mode 100644 index a185cb1c29..0000000000 --- a/examples/message/log.28Aug18.message.server.mpione.g++.4 +++ /dev/null @@ -1,44 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md mpi/one - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 1 0 1 0 1 -create_box 1 box -Created orthogonal box = (0 0 0) to (1.6796 1.6796 1.6796) - 1 by 2 by 2 MPI processor grid -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 1 by 2 by 2 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Server MD calls = 51 -Server MD reneighborings 5 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.server.mpitwo.g++.1 b/examples/message/log.28Aug18.message.server.mpitwo.g++.1 deleted file mode 100644 index 973a08eb6a..0000000000 --- a/examples/message/log.28Aug18.message.server.mpitwo.g++.1 +++ /dev/null @@ -1,44 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md mpi/two tmp.couple - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 1 0 1 0 1 -create_box 1 box -Created orthogonal box = (0 0 0) to (1.6796 1.6796 1.6796) - 1 by 1 by 1 MPI processor grid -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 1 by 1 by 1 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Server MD calls = 51 -Server MD reneighborings 5 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.server.mpitwo.g++.4 b/examples/message/log.28Aug18.message.server.mpitwo.g++.4 deleted file mode 100644 index 9e76e52d90..0000000000 --- a/examples/message/log.28Aug18.message.server.mpitwo.g++.4 +++ /dev/null @@ -1,44 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md mpi/two tmp.couple - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 1 0 1 0 1 -create_box 1 box -Created orthogonal box = (0 0 0) to (1.6796 1.6796 1.6796) - 1 by 2 by 2 MPI processor grid -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 1 by 2 by 2 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Server MD calls = 51 -Server MD reneighborings 5 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.server.zmq.g++.1 b/examples/message/log.28Aug18.message.server.zmq.g++.1 deleted file mode 100644 index ce5729878b..0000000000 --- a/examples/message/log.28Aug18.message.server.zmq.g++.1 +++ /dev/null @@ -1,44 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md zmq *:5555 - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 1 0 1 0 1 -create_box 1 box -Created orthogonal box = (0 0 0) to (1.6796 1.6796 1.6796) - 1 by 1 by 1 MPI processor grid -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 1 by 1 by 1 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Server MD calls = 51 -Server MD reneighborings 5 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.server.zmq.g++.4 b/examples/message/log.28Aug18.message.server.zmq.g++.4 deleted file mode 100644 index b3201da4da..0000000000 --- a/examples/message/log.28Aug18.message.server.zmq.g++.4 +++ /dev/null @@ -1,44 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md zmq *:5555 - -units lj -atom_style atomic -atom_modify map yes - -lattice fcc 0.8442 -Lattice spacing in x,y,z = 1.6796 1.6796 1.6796 -region box block 0 1 0 1 0 1 -create_box 1 box -Created orthogonal box = (0 0 0) to (1.6796 1.6796 1.6796) - 1 by 2 by 2 MPI processor grid -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff 1 1 1.0 1.0 2.5 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 1 by 2 by 2 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 2.8 - ghost atom cutoff = 2.8 - binsize = 1.4, bins = 6 6 6 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/atomonly/newton - stencil: half/bin/3d/newton - bin: standard -Server MD calls = 51 -Server MD reneighborings 5 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.tilt.client.mpione.g++.1 b/examples/message/log.28Aug18.message.tilt.client.mpione.g++.1 deleted file mode 100644 index a290ec307b..0000000000 --- a/examples/message/log.28Aug18.message.tilt.client.mpione.g++.1 +++ /dev/null @@ -1,130 +0,0 @@ -LAMMPS (22 Aug 2018) -# 2d NEMD simulation - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md mpi/one - -units lj -atom_style atomic -dimension 2 -atom_modify sort 0 0.0 map yes - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000485897 secs -mass * 1.0 - -velocity all create 1.44 87287 loop geom - -region slice block 4 6 INF INF INF INF -set region slice type 2 - 40 settings made for type - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nvt/sllod temp 1.0 1.0 1.0 tchain 1 -fix 2 all deform 1 xy erate 0.01 remap v - -fix 3 all client/md -fix_modify 3 energy yes - -thermo_style custom step temp epair etotal press xy - -thermo 1000 -run 50000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 15.3919, bins = 1 1 1 - 0 neighbor lists, perpetual/occasional/extra = 0 0 0 -Per MPI rank memory allocation (min/avg/max) = 2.308 | 2.308 | 2.308 Mbytes -Step Temp E_pair TotEng Press Xy - 0 1.44 0 1.431 1.2080502 0 - 1000 1.0086399 0 1.3760711 6.8772078 0.61567613 - 2000 1.0707188 0 1.3744107 6.628097 1.2313523 - 3000 1.0627515 0 1.310096 6.1647179 1.8470284 - 4000 0.94091054 0 1.268976 6.4723215 2.4627045 - 5000 1.0218949 0 1.2430242 5.6945977 3.0783806 - 6000 0.98649481 0 1.1997565 5.2870413 3.6940568 - 7000 0.9047957 0 1.1461262 5.9291636 4.3097329 - 8000 0.85697614 0 1.0437412 5.0652097 4.925409 - 9000 0.84208329 0 1.109218 6.1749808 5.5410852 - 10000 0.86418108 0 1.1594773 6.2581867 6.1567613 - 11000 0.95136356 0 1.1650901 5.8389085 6.7724374 - 12000 0.94571583 0 1.2210342 6.2498816 7.3881135 - 13000 0.95994288 0 1.2172042 5.9608165 -7.3881135 - 14000 0.99053999 0 1.2925597 6.9994446 -6.7724374 - 15000 1.0316726 0 1.3346023 6.6902672 -6.1567613 - 16000 0.99537481 0 1.3227696 7.0301123 -5.5410852 - 17000 1.0306843 0 1.3101457 6.4750102 -4.925409 - 18000 1.071154 0 1.2947547 5.695888 -4.3097329 - 19000 0.97120752 0 1.3035465 7.3945362 -3.6940568 - 20000 0.97198994 0 1.2244663 6.0047605 -3.0783806 - 21000 0.97943545 0 1.2393394 6.3871012 -2.4627045 - 22000 0.98550707 0 1.1768148 5.019967 -1.8470284 - 23000 0.96920052 0 1.1730698 5.7944947 -1.2313523 - 24000 0.94069959 0 1.184119 5.8434876 -0.61567613 - 25000 0.91569312 0 1.1642118 5.668997 0 - 26000 0.98882932 0 1.1999248 5.0115507 0.61567613 - 27000 0.8972608 0 1.2556546 7.0837158 1.2313523 - 28000 0.93554756 0 1.2221911 5.9302841 1.8470284 - 29000 0.97894608 0 1.2168736 5.5766766 2.4627045 - 30000 0.97877055 0 1.2575839 6.4308887 3.0783806 - 31000 1.0002387 0 1.2338069 5.3873124 3.6940568 - 32000 0.89608618 0 1.2382021 6.7892204 4.3097329 - 33000 0.87439302 0 1.2252635 7.078134 4.925409 - 34000 1.076102 0 1.2991393 5.5556892 5.5410852 - 35000 1.0018689 0 1.272105 6.1320483 6.1567613 - 36000 0.93327214 0 1.2428039 7.0030867 6.7724374 - 37000 1.0770236 0 1.3002931 5.4996076 7.3881135 - 38000 0.98715132 0 1.215562 5.5958335 -7.3881135 - 39000 0.95028417 0 1.2566706 6.4133713 -6.7724374 - 40000 1.0445585 0 1.241151 5.3589806 -6.1567613 - 41000 0.93799713 0 1.2109086 6.4957845 -5.5410852 - 42000 0.99231038 0 1.2228781 5.9363471 -4.925409 - 43000 0.97913815 0 1.1854842 5.8837987 -4.3097329 - 44000 0.86748838 0 1.1616201 6.8991278 -3.6940568 - 45000 0.96284421 0 1.1549383 5.1226785 -3.0783806 - 46000 0.98701623 0 1.170581 4.9719567 -2.4627045 - 47000 0.92618683 0 1.2146576 6.7100075 -1.8470284 - 48000 1.0092593 0 1.2523988 5.7067864 -1.2313523 - 49000 1.0187472 0 1.271608 5.3355092 -0.61567613 - 50000 1.0194881 0 1.2831094 6.2449759 0 -Loop time of 1.74559 on 1 procs for 50000 steps with 160 atoms - -Performance: 12374053.445 tau/day, 28643.642 timesteps/s -100.0% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0020533 | 0.0020533 | 0.0020533 | 0.0 | 0.12 -Comm | 0.015517 | 0.015517 | 0.015517 | 0.0 | 0.89 -Output | 0.00052404 | 0.00052404 | 0.00052404 | 0.0 | 0.03 -Modify | 1.6784 | 1.6784 | 1.6784 | 0.0 | 96.15 -Other | | 0.04905 | | | 2.81 - -Nlocal: 160 ave 160 max 160 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 5270 -Dangerous builds = 0 -Total wall time: 0:00:01 diff --git a/examples/message/log.28Aug18.message.tilt.client.mpione.g++.2 b/examples/message/log.28Aug18.message.tilt.client.mpione.g++.2 deleted file mode 100644 index 0089732355..0000000000 --- a/examples/message/log.28Aug18.message.tilt.client.mpione.g++.2 +++ /dev/null @@ -1,130 +0,0 @@ -LAMMPS (22 Aug 2018) -# 2d NEMD simulation - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md mpi/one - -units lj -atom_style atomic -dimension 2 -atom_modify sort 0 0.0 map yes - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 2 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000453949 secs -mass * 1.0 - -velocity all create 1.44 87287 loop geom - -region slice block 4 6 INF INF INF INF -set region slice type 2 - 40 settings made for type - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nvt/sllod temp 1.0 1.0 1.0 tchain 1 -fix 2 all deform 1 xy erate 0.01 remap v - -fix 3 all client/md -fix_modify 3 energy yes - -thermo_style custom step temp epair etotal press xy - -thermo 1000 -run 50000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 15.3919, bins = 1 1 1 - 0 neighbor lists, perpetual/occasional/extra = 0 0 0 -Per MPI rank memory allocation (min/avg/max) = 2.308 | 2.308 | 2.308 Mbytes -Step Temp E_pair TotEng Press Xy - 0 1.44 0 1.431 1.2080502 0 - 1000 1.0876599 0 1.3637783 6.063363 0.61567613 - 2000 1.0722996 0 1.4108622 7.0518942 1.2313523 - 3000 1.0580774 0 1.3845895 6.0395275 1.8470284 - 4000 1.0068006 0 1.3804387 7.0944598 2.4627045 - 5000 0.95391814 0 1.2578438 6.1878831 3.0783806 - 6000 0.93492945 0 1.2711287 7.0440517 3.6940568 - 7000 0.94107853 0 1.2384371 6.1438077 4.3097329 - 8000 0.89711744 0 1.145748 6.3558305 4.925409 - 9000 0.90190304 0 1.0860684 4.957098 5.5410852 - 10000 0.84255749 0 1.0376892 5.2351795 6.1567613 - 11000 0.90250882 0 1.0497695 4.3844838 6.7724374 - 12000 0.83461274 0 1.0281949 5.1534361 7.3881135 - 13000 0.80315331 0 1.0226333 5.757222 -7.3881135 - 14000 0.81820939 0 0.99276466 4.6943725 -6.7724374 - 15000 0.8239631 0 1.0408289 5.1669006 -6.1567613 - 16000 0.88908894 0 1.1554855 6.3510278 -5.5410852 - 17000 0.98268136 0 1.2086981 5.6302847 -4.925409 - 18000 1.0098162 0 1.3687676 7.5243587 -4.3097329 - 19000 1.0795086 0 1.4562691 7.639418 -3.6940568 - 20000 1.1932155 0 1.5278988 7.0668432 -3.0783806 - 21000 1.2424296 0 1.6048792 7.959585 -2.4627045 - 22000 1.297169 0 1.7421262 8.9432388 -1.8470284 - 23000 1.2863494 0 1.7236774 8.3584973 -1.2313523 - 24000 1.4084347 0 1.7370339 7.2729078 -0.61567613 - 25000 1.3339728 0 1.6883255 7.529098 0 - 26000 1.1483243 0 1.5155578 7.3869994 0.61567613 - 27000 1.1372606 0 1.4368323 7.0580136 1.2313523 - 28000 1.0518579 0 1.355311 6.478857 1.8470284 - 29000 1.0581145 0 1.2535509 5.3697479 2.4627045 - 30000 0.93612564 0 1.185532 5.5520142 3.0783806 - 31000 0.94387516 0 1.1716454 5.8655485 3.6940568 - 32000 0.83953515 0 1.0737746 5.5551953 4.3097329 - 33000 0.84862926 0 1.0564042 5.7795428 4.925409 - 34000 0.83621877 0 1.079387 5.7514243 5.5410852 - 35000 0.86938506 0 1.031783 4.5897825 6.1567613 - 36000 0.88990609 0 1.0807597 5.3751744 6.7724374 - 37000 0.89534631 0 1.1238882 5.2400355 7.3881135 - 38000 0.98545003 0 1.2121125 5.7783854 -7.3881135 - 39000 0.96737778 0 1.2472934 6.1139 -6.7724374 - 40000 1.0664194 0 1.2956811 5.7353661 -6.1567613 - 41000 1.0681494 0 1.3269435 6.3102722 -5.5410852 - 42000 1.0875422 0 1.3963739 7.1208066 -4.925409 - 43000 1.0968173 0 1.3388062 6.1704339 -4.3097329 - 44000 1.1182109 0 1.3773214 7.0872686 -3.6940568 - 45000 1.1243261 0 1.432186 6.884782 -3.0783806 - 46000 1.039713 0 1.4389721 7.5585257 -2.4627045 - 47000 1.0816108 0 1.4100361 6.4611126 -1.8470284 - 48000 0.97637127 0 1.3605389 7.3992744 -1.2313523 - 49000 1.0361978 0 1.2721873 5.8166109 -0.61567613 - 50000 0.92367087 0 1.1875669 6.4685214 0 -Loop time of 2.82785 on 2 procs for 50000 steps with 160 atoms - -Performance: 7638300.565 tau/day, 17681.251 timesteps/s -100.0% CPU use with 2 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0011888 | 0.0012611 | 0.0013335 | 0.2 | 0.04 -Comm | 0.024838 | 0.025075 | 0.025312 | 0.1 | 0.89 -Output | 0.0003581 | 0.00052559 | 0.00069308 | 0.0 | 0.02 -Modify | 2.7209 | 2.7263 | 2.7318 | 0.3 | 96.41 -Other | | 0.07465 | | | 2.64 - -Nlocal: 80 ave 80 max 80 min -Histogram: 2 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 5257 -Dangerous builds = 0 -Total wall time: 0:00:02 diff --git a/examples/message/log.28Aug18.message.tilt.client.mpitwo.g++.1 b/examples/message/log.28Aug18.message.tilt.client.mpitwo.g++.1 deleted file mode 100644 index 814b3df1aa..0000000000 --- a/examples/message/log.28Aug18.message.tilt.client.mpitwo.g++.1 +++ /dev/null @@ -1,130 +0,0 @@ -LAMMPS (22 Aug 2018) -# 2d NEMD simulation - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md mpi/two tmp.couple - -units lj -atom_style atomic -dimension 2 -atom_modify sort 0 0.0 map yes - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000543118 secs -mass * 1.0 - -velocity all create 1.44 87287 loop geom - -region slice block 4 6 INF INF INF INF -set region slice type 2 - 40 settings made for type - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nvt/sllod temp 1.0 1.0 1.0 tchain 1 -fix 2 all deform 1 xy erate 0.01 remap v - -fix 3 all client/md -fix_modify 3 energy yes - -thermo_style custom step temp epair etotal press xy - -thermo 1000 -run 50000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 15.3919, bins = 1 1 1 - 0 neighbor lists, perpetual/occasional/extra = 0 0 0 -Per MPI rank memory allocation (min/avg/max) = 2.308 | 2.308 | 2.308 Mbytes -Step Temp E_pair TotEng Press Xy - 0 1.44 0 1.431 1.2080502 0 - 1000 1.0086399 0 1.3760711 6.8772078 0.61567613 - 2000 1.0707188 0 1.3744107 6.628097 1.2313523 - 3000 1.0627515 0 1.310096 6.1647179 1.8470284 - 4000 0.94091054 0 1.268976 6.4723215 2.4627045 - 5000 1.0218949 0 1.2430242 5.6945977 3.0783806 - 6000 0.98649481 0 1.1997565 5.2870413 3.6940568 - 7000 0.9047957 0 1.1461262 5.9291636 4.3097329 - 8000 0.85697614 0 1.0437412 5.0652097 4.925409 - 9000 0.84208329 0 1.109218 6.1749808 5.5410852 - 10000 0.86418108 0 1.1594773 6.2581867 6.1567613 - 11000 0.95136356 0 1.1650901 5.8389085 6.7724374 - 12000 0.94571583 0 1.2210342 6.2498816 7.3881135 - 13000 0.95994288 0 1.2172042 5.9608165 -7.3881135 - 14000 0.99053999 0 1.2925597 6.9994446 -6.7724374 - 15000 1.0316726 0 1.3346023 6.6902672 -6.1567613 - 16000 0.99537481 0 1.3227696 7.0301123 -5.5410852 - 17000 1.0306843 0 1.3101457 6.4750102 -4.925409 - 18000 1.071154 0 1.2947547 5.695888 -4.3097329 - 19000 0.97120752 0 1.3035465 7.3945362 -3.6940568 - 20000 0.97198994 0 1.2244663 6.0047605 -3.0783806 - 21000 0.97943545 0 1.2393394 6.3871012 -2.4627045 - 22000 0.98550707 0 1.1768148 5.019967 -1.8470284 - 23000 0.96920052 0 1.1730698 5.7944947 -1.2313523 - 24000 0.94069959 0 1.184119 5.8434876 -0.61567613 - 25000 0.91569312 0 1.1642118 5.668997 0 - 26000 0.98882932 0 1.1999248 5.0115507 0.61567613 - 27000 0.8972608 0 1.2556546 7.0837158 1.2313523 - 28000 0.93554756 0 1.2221911 5.9302841 1.8470284 - 29000 0.97894608 0 1.2168736 5.5766766 2.4627045 - 30000 0.97877055 0 1.2575839 6.4308887 3.0783806 - 31000 1.0002387 0 1.2338069 5.3873124 3.6940568 - 32000 0.89608618 0 1.2382021 6.7892204 4.3097329 - 33000 0.87439302 0 1.2252635 7.078134 4.925409 - 34000 1.076102 0 1.2991393 5.5556892 5.5410852 - 35000 1.0018689 0 1.272105 6.1320483 6.1567613 - 36000 0.93327214 0 1.2428039 7.0030867 6.7724374 - 37000 1.0770236 0 1.3002931 5.4996076 7.3881135 - 38000 0.98715132 0 1.215562 5.5958335 -7.3881135 - 39000 0.95028417 0 1.2566706 6.4133713 -6.7724374 - 40000 1.0445585 0 1.241151 5.3589806 -6.1567613 - 41000 0.93799713 0 1.2109086 6.4957845 -5.5410852 - 42000 0.99231038 0 1.2228781 5.9363471 -4.925409 - 43000 0.97913815 0 1.1854842 5.8837987 -4.3097329 - 44000 0.86748838 0 1.1616201 6.8991278 -3.6940568 - 45000 0.96284421 0 1.1549383 5.1226785 -3.0783806 - 46000 0.98701623 0 1.170581 4.9719567 -2.4627045 - 47000 0.92618683 0 1.2146576 6.7100075 -1.8470284 - 48000 1.0092593 0 1.2523988 5.7067864 -1.2313523 - 49000 1.0187472 0 1.271608 5.3355092 -0.61567613 - 50000 1.0194881 0 1.2831094 6.2449759 0 -Loop time of 4.80282 on 1 procs for 50000 steps with 160 atoms - -Performance: 4497356.047 tau/day, 10410.546 timesteps/s -50.2% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0032325 | 0.0032325 | 0.0032325 | 0.0 | 0.07 -Comm | 0.033613 | 0.033613 | 0.033613 | 0.0 | 0.70 -Output | 0.00089812 | 0.00089812 | 0.00089812 | 0.0 | 0.02 -Modify | 4.6706 | 4.6706 | 4.6706 | 0.0 | 97.25 -Other | | 0.09449 | | | 1.97 - -Nlocal: 160 ave 160 max 160 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 5270 -Dangerous builds = 0 -Total wall time: 0:00:04 diff --git a/examples/message/log.28Aug18.message.tilt.client.mpitwo.g++.2 b/examples/message/log.28Aug18.message.tilt.client.mpitwo.g++.2 deleted file mode 100644 index 7c172d3727..0000000000 --- a/examples/message/log.28Aug18.message.tilt.client.mpitwo.g++.2 +++ /dev/null @@ -1,130 +0,0 @@ -LAMMPS (22 Aug 2018) -# 2d NEMD simulation - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md mpi/two tmp.couple - -units lj -atom_style atomic -dimension 2 -atom_modify sort 0 0.0 map yes - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 2 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000574827 secs -mass * 1.0 - -velocity all create 1.44 87287 loop geom - -region slice block 4 6 INF INF INF INF -set region slice type 2 - 40 settings made for type - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nvt/sllod temp 1.0 1.0 1.0 tchain 1 -fix 2 all deform 1 xy erate 0.01 remap v - -fix 3 all client/md -fix_modify 3 energy yes - -thermo_style custom step temp epair etotal press xy - -thermo 1000 -run 50000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 15.3919, bins = 1 1 1 - 0 neighbor lists, perpetual/occasional/extra = 0 0 0 -Per MPI rank memory allocation (min/avg/max) = 2.308 | 2.308 | 2.308 Mbytes -Step Temp E_pair TotEng Press Xy - 0 1.44 0 1.431 1.2080502 0 - 1000 1.0876599 0 1.3637783 6.063363 0.61567613 - 2000 1.0722996 0 1.4108622 7.0518942 1.2313523 - 3000 1.0580774 0 1.3845895 6.0395275 1.8470284 - 4000 1.0068006 0 1.3804387 7.0944598 2.4627045 - 5000 0.95391814 0 1.2578438 6.1878831 3.0783806 - 6000 0.93492945 0 1.2711287 7.0440517 3.6940568 - 7000 0.94107853 0 1.2384371 6.1438077 4.3097329 - 8000 0.89711744 0 1.145748 6.3558305 4.925409 - 9000 0.90190304 0 1.0860684 4.957098 5.5410852 - 10000 0.84255749 0 1.0376892 5.2351795 6.1567613 - 11000 0.90250882 0 1.0497695 4.3844838 6.7724374 - 12000 0.83461274 0 1.0281949 5.1534361 7.3881135 - 13000 0.80315331 0 1.0226333 5.757222 -7.3881135 - 14000 0.81820939 0 0.99276466 4.6943725 -6.7724374 - 15000 0.8239631 0 1.0408289 5.1669006 -6.1567613 - 16000 0.88908894 0 1.1554855 6.3510278 -5.5410852 - 17000 0.98268136 0 1.2086981 5.6302847 -4.925409 - 18000 1.0098162 0 1.3687676 7.5243587 -4.3097329 - 19000 1.0795086 0 1.4562691 7.639418 -3.6940568 - 20000 1.1932155 0 1.5278988 7.0668432 -3.0783806 - 21000 1.2424296 0 1.6048792 7.959585 -2.4627045 - 22000 1.297169 0 1.7421262 8.9432388 -1.8470284 - 23000 1.2863494 0 1.7236774 8.3584973 -1.2313523 - 24000 1.4084347 0 1.7370339 7.2729078 -0.61567613 - 25000 1.3339728 0 1.6883255 7.529098 0 - 26000 1.1483243 0 1.5155578 7.3869994 0.61567613 - 27000 1.1372606 0 1.4368323 7.0580136 1.2313523 - 28000 1.0518579 0 1.355311 6.478857 1.8470284 - 29000 1.0581145 0 1.2535509 5.3697479 2.4627045 - 30000 0.93612564 0 1.185532 5.5520142 3.0783806 - 31000 0.94387516 0 1.1716454 5.8655485 3.6940568 - 32000 0.83953515 0 1.0737746 5.5551953 4.3097329 - 33000 0.84862926 0 1.0564042 5.7795428 4.925409 - 34000 0.83621877 0 1.079387 5.7514243 5.5410852 - 35000 0.86938506 0 1.031783 4.5897825 6.1567613 - 36000 0.88990609 0 1.0807597 5.3751744 6.7724374 - 37000 0.89534631 0 1.1238882 5.2400355 7.3881135 - 38000 0.98545003 0 1.2121125 5.7783854 -7.3881135 - 39000 0.96737778 0 1.2472934 6.1139 -6.7724374 - 40000 1.0664194 0 1.2956811 5.7353661 -6.1567613 - 41000 1.0681494 0 1.3269435 6.3102722 -5.5410852 - 42000 1.0875422 0 1.3963739 7.1208066 -4.925409 - 43000 1.0968173 0 1.3388062 6.1704339 -4.3097329 - 44000 1.1182109 0 1.3773214 7.0872686 -3.6940568 - 45000 1.1243261 0 1.432186 6.884782 -3.0783806 - 46000 1.039713 0 1.4389721 7.5585257 -2.4627045 - 47000 1.0816108 0 1.4100361 6.4611126 -1.8470284 - 48000 0.97637127 0 1.3605389 7.3992744 -1.2313523 - 49000 1.0361978 0 1.2721873 5.8166109 -0.61567613 - 50000 0.92367087 0 1.1875669 6.4685214 0 -Loop time of 5.66536 on 2 procs for 50000 steps with 160 atoms - -Performance: 3812643.232 tau/day, 8825.563 timesteps/s -48.1% CPU use with 2 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0012836 | 0.0015377 | 0.0017917 | 0.6 | 0.03 -Comm | 0.037211 | 0.037922 | 0.038633 | 0.4 | 0.67 -Output | 0.00052023 | 0.00073683 | 0.00095344 | 0.0 | 0.01 -Modify | 5.5101 | 5.5105 | 5.511 | 0.0 | 97.27 -Other | | 0.1146 | | | 2.02 - -Nlocal: 80 ave 80 max 80 min -Histogram: 2 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 5257 -Dangerous builds = 0 -Total wall time: 0:00:06 diff --git a/examples/message/log.28Aug18.message.tilt.client.zmq.g++.1 b/examples/message/log.28Aug18.message.tilt.client.zmq.g++.1 deleted file mode 100644 index f5e2f220cd..0000000000 --- a/examples/message/log.28Aug18.message.tilt.client.zmq.g++.1 +++ /dev/null @@ -1,130 +0,0 @@ -LAMMPS (22 Aug 2018) -# 2d NEMD simulation - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md zmq localhost:5555 - -units lj -atom_style atomic -dimension 2 -atom_modify sort 0 0.0 map yes - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000530005 secs -mass * 1.0 - -velocity all create 1.44 87287 loop geom - -region slice block 4 6 INF INF INF INF -set region slice type 2 - 40 settings made for type - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nvt/sllod temp 1.0 1.0 1.0 tchain 1 -fix 2 all deform 1 xy erate 0.01 remap v - -fix 3 all client/md -fix_modify 3 energy yes - -thermo_style custom step temp epair etotal press xy - -thermo 1000 -run 50000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 15.3919, bins = 1 1 1 - 0 neighbor lists, perpetual/occasional/extra = 0 0 0 -Per MPI rank memory allocation (min/avg/max) = 2.308 | 2.308 | 2.308 Mbytes -Step Temp E_pair TotEng Press Xy - 0 1.44 0 1.431 1.2080502 0 - 1000 1.0086399 0 1.3760711 6.8772078 0.61567613 - 2000 1.0707188 0 1.3744107 6.628097 1.2313523 - 3000 1.0627515 0 1.310096 6.1647179 1.8470284 - 4000 0.94091054 0 1.268976 6.4723215 2.4627045 - 5000 1.0218949 0 1.2430242 5.6945977 3.0783806 - 6000 0.98649481 0 1.1997565 5.2870413 3.6940568 - 7000 0.9047957 0 1.1461262 5.9291636 4.3097329 - 8000 0.85697614 0 1.0437412 5.0652097 4.925409 - 9000 0.84208329 0 1.109218 6.1749808 5.5410852 - 10000 0.86418108 0 1.1594773 6.2581867 6.1567613 - 11000 0.95136356 0 1.1650901 5.8389085 6.7724374 - 12000 0.94571583 0 1.2210342 6.2498816 7.3881135 - 13000 0.95994288 0 1.2172042 5.9608165 -7.3881135 - 14000 0.99053999 0 1.2925597 6.9994446 -6.7724374 - 15000 1.0316726 0 1.3346023 6.6902672 -6.1567613 - 16000 0.99537481 0 1.3227696 7.0301123 -5.5410852 - 17000 1.0306843 0 1.3101457 6.4750102 -4.925409 - 18000 1.071154 0 1.2947547 5.695888 -4.3097329 - 19000 0.97120752 0 1.3035465 7.3945362 -3.6940568 - 20000 0.97198994 0 1.2244663 6.0047605 -3.0783806 - 21000 0.97943545 0 1.2393394 6.3871012 -2.4627045 - 22000 0.98550707 0 1.1768148 5.019967 -1.8470284 - 23000 0.96920052 0 1.1730698 5.7944947 -1.2313523 - 24000 0.94069959 0 1.184119 5.8434876 -0.61567613 - 25000 0.91569312 0 1.1642118 5.668997 0 - 26000 0.98882932 0 1.1999248 5.0115507 0.61567613 - 27000 0.8972608 0 1.2556546 7.0837158 1.2313523 - 28000 0.93554756 0 1.2221911 5.9302841 1.8470284 - 29000 0.97894608 0 1.2168736 5.5766766 2.4627045 - 30000 0.97877055 0 1.2575839 6.4308887 3.0783806 - 31000 1.0002387 0 1.2338069 5.3873124 3.6940568 - 32000 0.89608618 0 1.2382021 6.7892204 4.3097329 - 33000 0.87439302 0 1.2252635 7.078134 4.925409 - 34000 1.076102 0 1.2991393 5.5556892 5.5410852 - 35000 1.0018689 0 1.272105 6.1320483 6.1567613 - 36000 0.93327214 0 1.2428039 7.0030867 6.7724374 - 37000 1.0770236 0 1.3002931 5.4996076 7.3881135 - 38000 0.98715132 0 1.215562 5.5958335 -7.3881135 - 39000 0.95028417 0 1.2566706 6.4133713 -6.7724374 - 40000 1.0445585 0 1.241151 5.3589806 -6.1567613 - 41000 0.93799713 0 1.2109086 6.4957845 -5.5410852 - 42000 0.99231038 0 1.2228781 5.9363471 -4.925409 - 43000 0.97913815 0 1.1854842 5.8837987 -4.3097329 - 44000 0.86748838 0 1.1616201 6.8991278 -3.6940568 - 45000 0.96284421 0 1.1549383 5.1226785 -3.0783806 - 46000 0.98701623 0 1.170581 4.9719567 -2.4627045 - 47000 0.92618683 0 1.2146576 6.7100075 -1.8470284 - 48000 1.0092593 0 1.2523988 5.7067864 -1.2313523 - 49000 1.0187472 0 1.271608 5.3355092 -0.61567613 - 50000 1.0194881 0 1.2831094 6.2449759 0 -Loop time of 12.9652 on 1 procs for 50000 steps with 160 atoms - -Performance: 1666000.147 tau/day, 3856.482 timesteps/s -23.2% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0018659 | 0.0018659 | 0.0018659 | 0.0 | 0.01 -Comm | 0.020679 | 0.020679 | 0.020679 | 0.0 | 0.16 -Output | 0.00052547 | 0.00052547 | 0.00052547 | 0.0 | 0.00 -Modify | 12.871 | 12.871 | 12.871 | 0.0 | 99.28 -Other | | 0.07062 | | | 0.54 - -Nlocal: 160 ave 160 max 160 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 5270 -Dangerous builds = 0 -Total wall time: 0:00:12 diff --git a/examples/message/log.28Aug18.message.tilt.client.zmq.g++.2 b/examples/message/log.28Aug18.message.tilt.client.zmq.g++.2 deleted file mode 100644 index 8fc570f5da..0000000000 --- a/examples/message/log.28Aug18.message.tilt.client.zmq.g++.2 +++ /dev/null @@ -1,130 +0,0 @@ -LAMMPS (22 Aug 2018) -# 2d NEMD simulation - client script - -variable mode index file - -if "${mode} == file" then "message client md file tmp.couple" elif "${mode} == zmq" "message client md zmq localhost:5555" elif "${mode} == mpione" "message client md mpi/one" elif "${mode} == mpitwo" "message client md mpi/two tmp.couple" -message client md zmq localhost:5555 - -units lj -atom_style atomic -dimension 2 -atom_modify sort 0 0.0 map yes - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 2 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000673056 secs -mass * 1.0 - -velocity all create 1.44 87287 loop geom - -region slice block 4 6 INF INF INF INF -set region slice type 2 - 40 settings made for type - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nvt/sllod temp 1.0 1.0 1.0 tchain 1 -fix 2 all deform 1 xy erate 0.01 remap v - -fix 3 all client/md -fix_modify 3 energy yes - -thermo_style custom step temp epair etotal press xy - -thermo 1000 -run 50000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 0 - ghost atom cutoff = 0 - binsize = 15.3919, bins = 1 1 1 - 0 neighbor lists, perpetual/occasional/extra = 0 0 0 -Per MPI rank memory allocation (min/avg/max) = 2.308 | 2.308 | 2.308 Mbytes -Step Temp E_pair TotEng Press Xy - 0 1.44 0 1.431 1.2080502 0 - 1000 1.0876599 0 1.3637783 6.063363 0.61567613 - 2000 1.0722996 0 1.4108622 7.0518942 1.2313523 - 3000 1.0580774 0 1.3845895 6.0395275 1.8470284 - 4000 1.0068006 0 1.3804387 7.0944598 2.4627045 - 5000 0.95391814 0 1.2578438 6.1878831 3.0783806 - 6000 0.93492945 0 1.2711287 7.0440517 3.6940568 - 7000 0.94107853 0 1.2384371 6.1438077 4.3097329 - 8000 0.89711744 0 1.145748 6.3558305 4.925409 - 9000 0.90190304 0 1.0860684 4.957098 5.5410852 - 10000 0.84255749 0 1.0376892 5.2351795 6.1567613 - 11000 0.90250882 0 1.0497695 4.3844838 6.7724374 - 12000 0.83461274 0 1.0281949 5.1534361 7.3881135 - 13000 0.80315331 0 1.0226333 5.757222 -7.3881135 - 14000 0.81820939 0 0.99276466 4.6943725 -6.7724374 - 15000 0.8239631 0 1.0408289 5.1669006 -6.1567613 - 16000 0.88908894 0 1.1554855 6.3510278 -5.5410852 - 17000 0.98268136 0 1.2086981 5.6302847 -4.925409 - 18000 1.0098162 0 1.3687676 7.5243587 -4.3097329 - 19000 1.0795086 0 1.4562691 7.639418 -3.6940568 - 20000 1.1932155 0 1.5278988 7.0668432 -3.0783806 - 21000 1.2424296 0 1.6048792 7.959585 -2.4627045 - 22000 1.297169 0 1.7421262 8.9432388 -1.8470284 - 23000 1.2863494 0 1.7236774 8.3584973 -1.2313523 - 24000 1.4084347 0 1.7370339 7.2729078 -0.61567613 - 25000 1.3339728 0 1.6883255 7.529098 0 - 26000 1.1483243 0 1.5155578 7.3869994 0.61567613 - 27000 1.1372606 0 1.4368323 7.0580136 1.2313523 - 28000 1.0518579 0 1.355311 6.478857 1.8470284 - 29000 1.0581145 0 1.2535509 5.3697479 2.4627045 - 30000 0.93612564 0 1.185532 5.5520142 3.0783806 - 31000 0.94387516 0 1.1716454 5.8655485 3.6940568 - 32000 0.83953515 0 1.0737746 5.5551953 4.3097329 - 33000 0.84862926 0 1.0564042 5.7795428 4.925409 - 34000 0.83621877 0 1.079387 5.7514243 5.5410852 - 35000 0.86938506 0 1.031783 4.5897825 6.1567613 - 36000 0.88990609 0 1.0807597 5.3751744 6.7724374 - 37000 0.89534631 0 1.1238882 5.2400355 7.3881135 - 38000 0.98545003 0 1.2121125 5.7783854 -7.3881135 - 39000 0.96737778 0 1.2472934 6.1139 -6.7724374 - 40000 1.0664194 0 1.2956811 5.7353661 -6.1567613 - 41000 1.0681494 0 1.3269435 6.3102722 -5.5410852 - 42000 1.0875422 0 1.3963739 7.1208066 -4.925409 - 43000 1.0968173 0 1.3388062 6.1704339 -4.3097329 - 44000 1.1182109 0 1.3773214 7.0872686 -3.6940568 - 45000 1.1243261 0 1.432186 6.884782 -3.0783806 - 46000 1.039713 0 1.4389721 7.5585257 -2.4627045 - 47000 1.0816108 0 1.4100361 6.4611126 -1.8470284 - 48000 0.97637127 0 1.3605389 7.3992744 -1.2313523 - 49000 1.0361978 0 1.2721873 5.8166109 -0.61567613 - 50000 0.92367087 0 1.1875669 6.4685214 0 -Loop time of 13.6129 on 2 procs for 50000 steps with 160 atoms - -Performance: 1586733.497 tau/day, 3672.994 timesteps/s -59.3% CPU use with 2 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0 | 0 | 0 | 0.0 | 0.00 -Neigh | 0.0015125 | 0.0015551 | 0.0015976 | 0.1 | 0.01 -Comm | 0.026598 | 0.028413 | 0.030227 | 1.1 | 0.21 -Output | 0.00046492 | 0.00063884 | 0.00081277 | 0.0 | 0.00 -Modify | 13.465 | 13.483 | 13.501 | 0.5 | 99.04 -Other | | 0.0994 | | | 0.73 - -Nlocal: 80 ave 80 max 80 min -Histogram: 2 0 0 0 0 0 0 0 0 0 -Nghost: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 -Neighs: 0 ave 0 max 0 min -Histogram: 2 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 0 -Ave neighs/atom = 0 -Neighbor list builds = 5257 -Dangerous builds = 0 -Total wall time: 0:00:13 diff --git a/examples/message/log.28Aug18.message.tilt.g++.1 b/examples/message/log.28Aug18.message.tilt.g++.1 deleted file mode 100644 index 3f7cfc9da0..0000000000 --- a/examples/message/log.28Aug18.message.tilt.g++.1 +++ /dev/null @@ -1,129 +0,0 @@ -LAMMPS (22 Aug 2018) -# 2d NEMD simulation - no client/server mode - -units lj -atom_style atomic -dimension 2 - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000437021 secs -mass * 1.0 - -velocity all create 1.44 87287 loop geom - -region slice block 4 6 INF INF INF INF -set region slice type 2 - 40 settings made for type - -pair_style lj/cut 2.5 -pair_coeff * * 1.0 1.0 1.0 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nvt/sllod temp 1.0 1.0 1.0 tchain 1 -fix 2 all deform 1 xy erate 0.01 remap v - -thermo_style custom step temp epair etotal press xy - -thermo 1000 -run 50000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 24 19 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/newton/tri - stencil: half/bin/2d/newton/tri - bin: standard -Per MPI rank memory allocation (min/avg/max) = 3.065 | 3.065 | 3.065 Mbytes -Step Temp E_pair TotEng Press Xy - 0 1.44 0 1.431 1.2080502 0 - 1000 1.1326992 0.25863754 1.3842573 6.0588079 0.61567613 - 2000 1.0158438 0.33502643 1.3445212 7.2638652 1.2313523 - 3000 1.0968167 0.3149227 1.4048843 7.0653223 1.8470284 - 4000 1.0070993 0.40611915 1.4069241 7.7283521 2.4627045 - 5000 1.1153133 0.2674828 1.3758254 6.2949171 3.0783806 - 6000 1.0170665 0.25843673 1.2691466 6.049412 3.6940568 - 7000 1.0224605 0.20974914 1.2258193 5.5104976 4.3097329 - 8000 0.96149374 0.24035439 1.1958388 5.4179146 4.925409 - 9000 0.87759014 0.2590493 1.1311545 5.8711239 5.5410852 - 10000 0.83791968 0.23477897 1.0674617 5.666904 6.1567613 - 11000 0.87702487 0.22958877 1.1011322 5.9068062 6.7724374 - 12000 0.81507294 0.26375817 1.0737369 5.9166925 7.3881135 - 13000 0.85655284 0.24676491 1.0979643 5.6918734 -7.3881135 - 14000 0.84369293 0.27818471 1.1166046 6.4146184 -6.7724374 - 15000 0.90052173 0.19836095 1.0932544 5.2690913 -6.1567613 - 16000 0.83836874 0.26921637 1.1023453 5.9579526 -5.5410852 - 17000 0.90492897 0.21933098 1.1186041 5.6042194 -4.925409 - 18000 0.90113412 0.24880908 1.1443111 6.0634846 -4.3097329 - 19000 1.0160445 0.17252962 1.1822239 5.3149334 -3.6940568 - 20000 0.96217234 0.2414377 1.1975965 5.476653 -3.0783806 - 21000 0.98229664 0.27569118 1.2518485 5.9340174 -2.4627045 - 22000 1.0551763 0.26997615 1.3185576 6.2094112 -1.8470284 - 23000 1.051999 0.34076639 1.3861904 7.082385 -1.2313523 - 24000 1.1350071 0.23701844 1.3649317 6.1829742 -0.61567613 - 25000 1.0946409 0.33366032 1.4214597 7.1907559 0 - 26000 1.1511799 0.24626808 1.3902531 5.8469984 0.61567613 - 27000 1.1009203 0.25653085 1.3505704 6.1504287 1.2313523 - 28000 1.0521302 0.2876798 1.3332342 5.9906187 1.8470284 - 29000 1.0518465 0.21853 1.2638025 5.6577549 2.4627045 - 30000 0.97264625 0.28758145 1.2541487 6.5769804 3.0783806 - 31000 1.0133579 0.31575837 1.3227828 6.6650893 3.6940568 - 32000 1.0714324 0.28757036 1.3523063 6.2682059 4.3097329 - 33000 1.0739451 0.28062459 1.3478575 6.6862746 4.925409 - 34000 1.0056867 0.38289586 1.382297 7.1120131 5.5410852 - 35000 1.0911349 0.26370939 1.3480247 6.1476048 6.1567613 - 36000 1.0618618 0.28269593 1.3379211 6.9414608 6.7724374 - 37000 1.0704991 0.29974994 1.3635585 7.0834346 7.3881135 - 38000 1.1087507 0.2682201 1.3700411 5.8506019 -7.3881135 - 39000 1.1303733 0.22362416 1.3469326 5.2500269 -6.7724374 - 40000 1.0174248 0.28956571 1.3006316 6.4491571 -6.1567613 - 41000 0.95981887 0.29162143 1.2454414 6.4658646 -5.5410852 - 42000 0.88302144 0.30432252 1.1818251 6.7401923 -4.925409 - 43000 0.93164419 0.25110308 1.1769245 5.9067383 -4.3097329 - 44000 0.98352598 0.23322873 1.2106077 5.5606585 -3.6940568 - 45000 1.0247245 0.26503082 1.2833508 6.533394 -3.0783806 - 46000 0.93004532 0.32277782 1.2470104 6.4689179 -2.4627045 - 47000 1.0653176 0.29185413 1.3505135 6.9534569 -1.8470284 - 48000 1.0401524 0.3420245 1.3756759 6.8016042 -1.2313523 - 49000 1.0023407 0.31833091 1.314407 6.7385662 -0.61567613 - 50000 1.0566272 0.28657142 1.3365947 6.261203 0 -Loop time of 1.15672 on 1 procs for 50000 steps with 160 atoms - -Performance: 18673426.371 tau/day, 43225.524 timesteps/s -99.8% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.19267 | 0.19267 | 0.19267 | 0.0 | 16.66 -Neigh | 0.15156 | 0.15156 | 0.15156 | 0.0 | 13.10 -Comm | 0.044569 | 0.044569 | 0.044569 | 0.0 | 3.85 -Output | 0.00057936 | 0.00057936 | 0.00057936 | 0.0 | 0.05 -Modify | 0.71051 | 0.71051 | 0.71051 | 0.0 | 61.42 -Other | | 0.05684 | | | 4.91 - -Nlocal: 160 ave 160 max 160 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 71 ave 71 max 71 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 362 ave 362 max 362 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 362 -Ave neighs/atom = 2.2625 -Neighbor list builds = 5256 -Dangerous builds = 0 -Total wall time: 0:00:01 diff --git a/examples/message/log.28Aug18.message.tilt.g++.4 b/examples/message/log.28Aug18.message.tilt.g++.4 deleted file mode 100644 index 74061463f6..0000000000 --- a/examples/message/log.28Aug18.message.tilt.g++.4 +++ /dev/null @@ -1,129 +0,0 @@ -LAMMPS (22 Aug 2018) -# 2d NEMD simulation - no client/server mode - -units lj -atom_style atomic -dimension 2 - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000396967 secs -mass * 1.0 - -velocity all create 1.44 87287 loop geom - -region slice block 4 6 INF INF INF INF -set region slice type 2 - 40 settings made for type - -pair_style lj/cut 2.5 -pair_coeff * * 1.0 1.0 1.0 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -fix 1 all nvt/sllod temp 1.0 1.0 1.0 tchain 1 -fix 2 all deform 1 xy erate 0.01 remap v - -thermo_style custom step temp epair etotal press xy - -thermo 1000 -run 50000 -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 24 19 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/newton/tri - stencil: half/bin/2d/newton/tri - bin: standard -Per MPI rank memory allocation (min/avg/max) = 3.065 | 3.065 | 3.065 Mbytes -Step Temp E_pair TotEng Press Xy - 0 1.44 0 1.431 1.2080502 0 - 1000 1.1326992 0.25863754 1.3842573 6.0588079 0.61567613 - 2000 1.0158438 0.33502643 1.3445212 7.2638652 1.2313523 - 3000 1.0968167 0.3149227 1.4048843 7.0653223 1.8470284 - 4000 1.0070993 0.40611915 1.4069241 7.7283521 2.4627045 - 5000 1.1153133 0.2674828 1.3758254 6.2949171 3.0783806 - 6000 1.0170665 0.25843673 1.2691466 6.049412 3.6940568 - 7000 1.0224605 0.20974914 1.2258193 5.5104976 4.3097329 - 8000 0.96149374 0.24035439 1.1958388 5.4179146 4.925409 - 9000 0.87759014 0.2590493 1.1311545 5.8711239 5.5410852 - 10000 0.83791968 0.23477897 1.0674617 5.666904 6.1567613 - 11000 0.87702487 0.22958877 1.1011322 5.9068062 6.7724374 - 12000 0.81507294 0.26375817 1.0737369 5.9166925 7.3881135 - 13000 0.85655284 0.24676491 1.0979643 5.6918734 -7.3881135 - 14000 0.84369293 0.27818471 1.1166046 6.4146184 -6.7724374 - 15000 0.90052173 0.19836095 1.0932544 5.2690913 -6.1567613 - 16000 0.83836874 0.26921637 1.1023453 5.9579526 -5.5410852 - 17000 0.90492897 0.21933098 1.1186041 5.6042194 -4.925409 - 18000 0.90113412 0.24880908 1.1443111 6.0634846 -4.3097329 - 19000 1.0160445 0.17252962 1.1822239 5.3149334 -3.6940568 - 20000 0.96217234 0.2414377 1.1975965 5.476653 -3.0783806 - 21000 0.98229664 0.27569118 1.2518485 5.9340174 -2.4627045 - 22000 1.0551763 0.26997615 1.3185576 6.2094112 -1.8470284 - 23000 1.051999 0.34076639 1.3861904 7.082385 -1.2313523 - 24000 1.1350071 0.23701844 1.3649317 6.1829742 -0.61567613 - 25000 1.0946409 0.33366032 1.4214597 7.1907559 0 - 26000 1.1511799 0.24626808 1.3902531 5.8469984 0.61567613 - 27000 1.1009203 0.25653085 1.3505704 6.1504287 1.2313523 - 28000 1.0521302 0.2876798 1.3332342 5.9906187 1.8470284 - 29000 1.0518465 0.21853 1.2638025 5.6577549 2.4627045 - 30000 0.97264625 0.28758145 1.2541487 6.5769804 3.0783806 - 31000 1.0133579 0.31575837 1.3227828 6.6650893 3.6940568 - 32000 1.0714324 0.28757036 1.3523063 6.2682059 4.3097329 - 33000 1.0739451 0.28062459 1.3478575 6.6862746 4.925409 - 34000 1.0056867 0.38289586 1.382297 7.1120131 5.5410852 - 35000 1.0911349 0.26370939 1.3480247 6.1476048 6.1567613 - 36000 1.0618618 0.28269593 1.3379211 6.9414608 6.7724374 - 37000 1.0704991 0.29974994 1.3635585 7.0834346 7.3881135 - 38000 1.1087507 0.2682201 1.3700411 5.8506019 -7.3881135 - 39000 1.1303733 0.22362416 1.3469326 5.2500269 -6.7724374 - 40000 1.0174248 0.28956571 1.3006316 6.4491571 -6.1567613 - 41000 0.95981887 0.29162143 1.2454414 6.4658646 -5.5410852 - 42000 0.88302144 0.30432252 1.1818251 6.7401923 -4.925409 - 43000 0.93164419 0.25110308 1.1769245 5.9067383 -4.3097329 - 44000 0.98352598 0.23322873 1.2106077 5.5606585 -3.6940568 - 45000 1.0247245 0.26503082 1.2833508 6.533394 -3.0783806 - 46000 0.93004532 0.32277782 1.2470104 6.4689179 -2.4627045 - 47000 1.0653176 0.29185413 1.3505135 6.9534569 -1.8470284 - 48000 1.0401524 0.3420245 1.3756759 6.8016042 -1.2313523 - 49000 1.0023407 0.31833091 1.314407 6.7385662 -0.61567613 - 50000 1.0566272 0.28657142 1.3365947 6.261203 0 -Loop time of 0.92653 on 1 procs for 50000 steps with 160 atoms - -Performance: 23312793.646 tau/day, 53964.800 timesteps/s -100.0% CPU use with 1 MPI tasks x no OpenMP threads - -MPI task timing breakdown: -Section | min time | avg time | max time |%varavg| %total ---------------------------------------------------------------- -Pair | 0.15063 | 0.15063 | 0.15063 | 0.0 | 16.26 -Neigh | 0.11869 | 0.11869 | 0.11869 | 0.0 | 12.81 -Comm | 0.035839 | 0.035839 | 0.035839 | 0.0 | 3.87 -Output | 0.00064468 | 0.00064468 | 0.00064468 | 0.0 | 0.07 -Modify | 0.57422 | 0.57422 | 0.57422 | 0.0 | 61.98 -Other | | 0.0465 | | | 5.02 - -Nlocal: 160 ave 160 max 160 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Nghost: 71 ave 71 max 71 min -Histogram: 1 0 0 0 0 0 0 0 0 0 -Neighs: 362 ave 362 max 362 min -Histogram: 1 0 0 0 0 0 0 0 0 0 - -Total # of neighbors = 362 -Ave neighs/atom = 2.2625 -Neighbor list builds = 5256 -Dangerous builds = 0 -Total wall time: 0:00:00 diff --git a/examples/message/log.28Aug18.message.tilt.server.mpione.g++.1 b/examples/message/log.28Aug18.message.tilt.server.mpione.g++.1 deleted file mode 100644 index 428ff346ad..0000000000 --- a/examples/message/log.28Aug18.message.tilt.server.mpione.g++.1 +++ /dev/null @@ -1,48 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md mpi/one - -units lj -atom_style atomic -dimension 2 -atom_modify map yes - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000438929 secs -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff * * 1.0 1.0 1.0 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 1 by 1 by 1 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 24 19 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/newton/tri - stencil: half/bin/2d/newton/tri - bin: standard -Server MD calls = 50001 -Server MD reneighborings 5073 -Total wall time: 0:00:01 diff --git a/examples/message/log.28Aug18.message.tilt.server.mpione.g++.4 b/examples/message/log.28Aug18.message.tilt.server.mpione.g++.4 deleted file mode 100644 index 3da50163ed..0000000000 --- a/examples/message/log.28Aug18.message.tilt.server.mpione.g++.4 +++ /dev/null @@ -1,48 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md mpi/one - -units lj -atom_style atomic -dimension 2 -atom_modify map yes - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 2 by 2 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000455141 secs -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff * * 1.0 1.0 1.0 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 2 by 2 by 1 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 24 19 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/newton/tri - stencil: half/bin/2d/newton/tri - bin: standard -Server MD calls = 50001 -Server MD reneighborings 5066 -Total wall time: 0:00:02 diff --git a/examples/message/log.28Aug18.message.tilt.server.mpitwo.g++.1 b/examples/message/log.28Aug18.message.tilt.server.mpitwo.g++.1 deleted file mode 100644 index fc29a6da63..0000000000 --- a/examples/message/log.28Aug18.message.tilt.server.mpitwo.g++.1 +++ /dev/null @@ -1,48 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md mpi/two tmp.couple - -units lj -atom_style atomic -dimension 2 -atom_modify map yes - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000521898 secs -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff * * 1.0 1.0 1.0 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 1 by 1 by 1 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 24 19 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/newton/tri - stencil: half/bin/2d/newton/tri - bin: standard -Server MD calls = 50001 -Server MD reneighborings 5073 -Total wall time: 0:00:04 diff --git a/examples/message/log.28Aug18.message.tilt.server.mpitwo.g++.4 b/examples/message/log.28Aug18.message.tilt.server.mpitwo.g++.4 deleted file mode 100644 index 758b84fe9d..0000000000 --- a/examples/message/log.28Aug18.message.tilt.server.mpitwo.g++.4 +++ /dev/null @@ -1,48 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md mpi/two tmp.couple - -units lj -atom_style atomic -dimension 2 -atom_modify map yes - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 2 by 2 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000378847 secs -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff * * 1.0 1.0 1.0 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 2 by 2 by 1 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 24 19 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/newton/tri - stencil: half/bin/2d/newton/tri - bin: standard -Server MD calls = 50001 -Server MD reneighborings 5066 -Total wall time: 0:00:06 diff --git a/examples/message/log.28Aug18.message.tilt.server.zmq.g++.1 b/examples/message/log.28Aug18.message.tilt.server.zmq.g++.1 deleted file mode 100644 index 78526ba748..0000000000 --- a/examples/message/log.28Aug18.message.tilt.server.zmq.g++.1 +++ /dev/null @@ -1,48 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md zmq *:5555 - -units lj -atom_style atomic -dimension 2 -atom_modify map yes - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 1 by 1 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000557184 secs -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff * * 1.0 1.0 1.0 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 1 by 1 by 1 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 24 19 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/newton/tri - stencil: half/bin/2d/newton/tri - bin: standard -Server MD calls = 50001 -Server MD reneighborings 5073 -Total wall time: 0:00:12 diff --git a/examples/message/log.28Aug18.message.tilt.server.zmq.g++.4 b/examples/message/log.28Aug18.message.tilt.server.zmq.g++.4 deleted file mode 100644 index b1ad768470..0000000000 --- a/examples/message/log.28Aug18.message.tilt.server.zmq.g++.4 +++ /dev/null @@ -1,48 +0,0 @@ -LAMMPS (22 Aug 2018) -# 3d Lennard-Jones melt - server script - -variable mode index file - -if "${mode} == file" then "message server md file tmp.couple" elif "${mode} == zmq" "message server md zmq *:5555" elif "${mode} == mpione" "message server md mpi/one" elif "${mode} == mpitwo" "message server md mpi/two tmp.couple" -message server md zmq *:5555 - -units lj -atom_style atomic -dimension 2 -atom_modify map yes - -lattice sq2 0.8442 -Lattice spacing in x,y,z = 1.53919 1.53919 1.53919 -region box prism 0 10 0 8 -0.5 0.5 0 0 0 -create_box 2 box -Created triclinic box = (0 0 -0.769595) to (15.3919 12.3135 0.769595) with tilt (0 0 0) - 2 by 2 by 1 MPI processor grid -create_atoms 1 box -Created 160 atoms - Time spent = 0.000586987 secs -mass * 1.0 # masses not used by server - -pair_style lj/cut 2.5 -pair_coeff * * 1.0 1.0 1.0 - -neighbor 0.3 bin -neigh_modify delay 0 every 1 check yes - -server md - 2 by 2 by 1 MPI processor grid -WARNING: No fixes defined, atoms won't move (../verlet.cpp:55) -Neighbor list info ... - update every 1 steps, delay 0 steps, check yes - max neighbors/atom: 2000, page size: 100000 - master list distance cutoff = 1.3 - ghost atom cutoff = 1.3 - binsize = 0.65, bins = 24 19 3 - 1 neighbor lists, perpetual/occasional/extra = 1 0 0 - (1) pair lj/cut, perpetual - attributes: half, newton on - pair build: half/bin/newton/tri - stencil: half/bin/2d/newton/tri - bin: standard -Server MD calls = 50001 -Server MD reneighborings 5066 -Total wall time: 0:00:13 diff --git a/examples/ttm/Si.sw b/examples/ttm/Si.sw new file mode 120000 index 0000000000..812023f52d --- /dev/null +++ b/examples/ttm/Si.sw @@ -0,0 +1 @@ +../../potentials/Si.sw \ No newline at end of file diff --git a/examples/ttm/Si.ttm_mod b/examples/ttm/Si.ttm_mod new file mode 100644 index 0000000000..6e047857ff --- /dev/null +++ b/examples/ttm/Si.ttm_mod @@ -0,0 +1,44 @@ +a_0, energy/(temperature*electron) units +-0.00012899 +a_1, energy/(temperature^2*electron) units +-0.0000000293276 +a_2, energy/(temperature^3*electron) units +-0.0000229991 +a_3, energy/(temperature^4*electron) units +-0.000000927036 +a_4, energy/(temperature^5*electron) units +-0.0000011747 +C_0, energy/(temperature*electron) units +0.000129 +A, 1/temperature units +0.180501 +rho_e, electrons/volume units +0.05 +D_e, length^2/time units +20000 +gamma_p, mass/time units +39.235 +gamma_s, mass/time units +24.443 +v_0, length/time units +79.76 +I_0, energy/(time*length^2) units +0 +lsurface, electron grid units (positive integer) +0 +rsurface, electron grid units (positive integer) +1 +l_skin, length units +1 +tau, time units +0 +B, dimensionless +0 +lambda, length units +0 +n_ion, ions/volume units +0.05 +surface_movement: 0 to disable tracking of surface motion, 1 to enable +0 +T_e_min, temperature units +0 diff --git a/examples/ttm/in.ttm.mod b/examples/ttm/in.ttm.mod new file mode 100644 index 0000000000..93552ad310 --- /dev/null +++ b/examples/ttm/in.ttm.mod @@ -0,0 +1,29 @@ +units metal +atom_style atomic +boundary p p p + +lattice diamond 5.4309 +region box block 0 10 0 10 0 10 +create_box 1 box +mass 1 28.0855 +create_atoms 1 box basis 1 1 basis 2 1 basis 3 1 basis 4 1 basis 5 1 basis 6 1 basis 7 1 basis 8 1 + +pair_style sw +pair_coeff * * Si.sw Si + +neighbor 2.0 bin +neigh_modify every 5 delay 0 check yes + +fix 1 all nve +fix twotemp all ttm/mod 1354684 Si.ttm_mod 10 10 10 set 1000.0 # outfile 100 T_out.txt + +compute pe all pe/atom +compute ke all ke/atom + +timestep 0.0001 +thermo 100 + +thermo_style custom step temp etotal f_twotemp[1] f_twotemp[2] + thermo_modify format float "%20.16g" + +run 1000 diff --git a/examples/ttm/log.20Apr22.ttm.mod.g++.1 b/examples/ttm/log.20Apr22.ttm.mod.g++.1 new file mode 100644 index 0000000000..6c0470617b --- /dev/null +++ b/examples/ttm/log.20Apr22.ttm.mod.g++.1 @@ -0,0 +1,122 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +units metal +atom_style atomic +boundary p p p + +lattice diamond 5.4309 +Lattice spacing in x,y,z = 5.4309 5.4309 5.4309 +region box block 0 10 0 10 0 10 +create_box 1 box +Created orthogonal box = (0 0 0) to (54.309 54.309 54.309) + 1 by 1 by 1 MPI processor grid +mass 1 28.0855 +create_atoms 1 box basis 1 1 basis 2 1 basis 3 1 basis 4 1 basis 5 1 basis 6 1 basis 7 1 basis 8 1 +Created 8000 atoms + using lattice units in orthogonal box = (0 0 0) to (54.309 54.309 54.309) + create_atoms CPU = 0.001 seconds + +pair_style sw +pair_coeff * * Si.sw Si +Reading sw potential file Si.sw with DATE: 2007-06-11 + +neighbor 2.0 bin +neigh_modify every 5 delay 0 check yes + +fix 1 all nve +fix twotemp all ttm/mod 1354684 Si.ttm_mod 10 10 10 set 1000.0 # outfile 100 T_out.txt + +compute pe all pe/atom +compute ke all ke/atom + +timestep 0.0001 +thermo 100 + +thermo_style custom step temp etotal f_twotemp[1] f_twotemp[2] + thermo_modify format float "%20.16g" + +run 1000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- fix ttm/mod command: + +@article{Pisarev2014, +author = {Pisarev, V. V. and Starikov, S. V.}, +title = {{Atomistic simulation of ion track formation in UO2.}}, +journal = {J.~Phys.:~Condens.~Matter}, +volume = {26}, +number = {47}, +pages = {475401}, +year = {2014} +} + +@article{Norman2013, +author = {Norman, G. E. and Starikov, S. V. and Stegailov, V. V. and Saitov, I. M. and Zhilyaev, P. A.}, +title = {{Atomistic Modeling of Warm Dense Matter in the Two-Temperature State}}, +journal = {Contrib.~Plasm.~Phys.}, +number = {2}, +volume = {53}, +pages = {129--139}, +year = {2013} +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Neighbor list info ... + update every 5 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 5.77118 + ghost atom cutoff = 5.77118 + binsize = 2.88559, bins = 19 19 19 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair sw, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 4.433 | 4.433 | 4.433 Mbytes + Step Temp TotEng f_twotemp[1] f_twotemp[2] + 0 0 -34692.79996100604 -52.79390940511979 0 + 100 2.004897156140836 -34690.27961013186 -55.34997305431884 0.01301140393178354 + 200 2.837118035232607 -34687.74741132015 -57.93445748841878 0.02696025968760173 + 300 4.263087164947482 -34684.98084093686 -60.75945453846786 0.02175636603841567 + 400 5.568003854939066 -34682.25271040963 -63.56896518300501 0.0300061848347275 + 500 6.225602451570786 -34679.49948952029 -66.40897551884576 0.02768827702656702 + 600 7.608847536264781 -34676.69728436362 -69.32060611557266 0.05579466731854093 + 700 9.049471241531297 -34674.00093206036 -72.10055094219446 0.004335980559879027 + 800 9.826796099683211 -34671.27720242751 -74.9501061086213 0.02371649678091513 + 900 11.8609224958918 -34668.35091308811 -77.98544170794551 0.004658649791374929 + 1000 13.88037467640968 -34665.35025858006 -81.16445160194114 0.07684078334464739 +Loop time of 4.85247 on 1 procs for 1000 steps with 8000 atoms + +Performance: 1.781 ns/day, 13.479 hours/ns, 206.081 timesteps/s +99.8% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 4.1286 | 4.1286 | 4.1286 | 0.0 | 85.08 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.030972 | 0.030972 | 0.030972 | 0.0 | 0.64 +Output | 0.0026351 | 0.0026351 | 0.0026351 | 0.0 | 0.05 +Modify | 0.67848 | 0.67848 | 0.67848 | 0.0 | 13.98 +Other | | 0.01182 | | | 0.24 + +Nlocal: 8000 ave 8000 max 8000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 6725 ave 6725 max 6725 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 272000 ave 272000 max 272000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 272000 +Ave neighs/atom = 34 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:04 diff --git a/examples/ttm/log.20Apr22.ttm.mod.g++.4 b/examples/ttm/log.20Apr22.ttm.mod.g++.4 new file mode 100644 index 0000000000..fdf9b0cfb5 --- /dev/null +++ b/examples/ttm/log.20Apr22.ttm.mod.g++.4 @@ -0,0 +1,122 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +units metal +atom_style atomic +boundary p p p + +lattice diamond 5.4309 +Lattice spacing in x,y,z = 5.4309 5.4309 5.4309 +region box block 0 10 0 10 0 10 +create_box 1 box +Created orthogonal box = (0 0 0) to (54.309 54.309 54.309) + 1 by 2 by 2 MPI processor grid +mass 1 28.0855 +create_atoms 1 box basis 1 1 basis 2 1 basis 3 1 basis 4 1 basis 5 1 basis 6 1 basis 7 1 basis 8 1 +Created 8000 atoms + using lattice units in orthogonal box = (0 0 0) to (54.309 54.309 54.309) + create_atoms CPU = 0.000 seconds + +pair_style sw +pair_coeff * * Si.sw Si +Reading sw potential file Si.sw with DATE: 2007-06-11 + +neighbor 2.0 bin +neigh_modify every 5 delay 0 check yes + +fix 1 all nve +fix twotemp all ttm/mod 1354684 Si.ttm_mod 10 10 10 set 1000.0 # outfile 100 T_out.txt + +compute pe all pe/atom +compute ke all ke/atom + +timestep 0.0001 +thermo 100 + +thermo_style custom step temp etotal f_twotemp[1] f_twotemp[2] + thermo_modify format float "%20.16g" + +run 1000 + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Your simulation uses code contributions which should be cited: + +- fix ttm/mod command: + +@article{Pisarev2014, +author = {Pisarev, V. V. and Starikov, S. V.}, +title = {{Atomistic simulation of ion track formation in UO2.}}, +journal = {J.~Phys.:~Condens.~Matter}, +volume = {26}, +number = {47}, +pages = {475401}, +year = {2014} +} + +@article{Norman2013, +author = {Norman, G. E. and Starikov, S. V. and Stegailov, V. V. and Saitov, I. M. and Zhilyaev, P. A.}, +title = {{Atomistic Modeling of Warm Dense Matter in the Two-Temperature State}}, +journal = {Contrib.~Plasm.~Phys.}, +number = {2}, +volume = {53}, +pages = {129--139}, +year = {2013} +} + +CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE + +Neighbor list info ... + update every 5 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 5.77118 + ghost atom cutoff = 5.77118 + binsize = 2.88559, bins = 19 19 19 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair sw, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 3.436 | 3.436 | 3.436 Mbytes + Step Temp TotEng f_twotemp[1] f_twotemp[2] + 0 0 -34692.79996100361 -52.79390940511979 0 + 100 1.852689977101411 -34690.49204900486 -55.14271612882062 0.027261886765771 + 200 2.735750477179192 -34688.11139028054 -57.57110998717796 0.03387986355513582 + 300 3.931848271449558 -34685.54667417785 -60.18684521127226 0.02261256315262404 + 400 5.462009198576365 -34682.74455105668 -63.05420336037231 0.002402241637719583 + 500 6.267811692893873 -34679.96493887379 -65.93304222280049 0.02448378880218699 + 600 7.21148216150661 -34677.41455784726 -68.58391420045932 0.04114045759945373 + 700 8.84660534187052 -34674.40610468235 -71.68798344296847 0.0237298402743454 + 800 10.1748456457686 -34671.08749605772 -75.11943618276236 0.007538225788030298 + 900 11.27479036162859 -34668.4118066423 -77.92921692176769 0.02537529314475071 + 1000 13.26881394868076 -34665.56617589539 -80.91544540266329 0.03112665440209921 +Loop time of 1.60214 on 4 procs for 1000 steps with 8000 atoms + +Performance: 5.393 ns/day, 4.450 hours/ns, 624.165 timesteps/s +99.7% CPU use with 4 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.0424 | 1.0558 | 1.0696 | 1.0 | 65.90 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.05072 | 0.063773 | 0.079458 | 4.9 | 3.98 +Output | 0.0024362 | 0.0024703 | 0.0025297 | 0.1 | 0.15 +Modify | 0.47018 | 0.47332 | 0.48004 | 0.6 | 29.54 +Other | | 0.006786 | | | 0.42 + +Nlocal: 2000 ave 2000 max 2000 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 3165 ave 3165 max 3165 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 0 ave 0 max 0 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 68000 ave 68000 max 68000 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 272000 +Ave neighs/atom = 34 +Neighbor list builds = 0 +Dangerous builds = 0 +Total wall time: 0:00:01 diff --git a/examples/yaml/in.yaml b/examples/yaml/in.yaml new file mode 100644 index 0000000000..f682f39776 --- /dev/null +++ b/examples/yaml/in.yaml @@ -0,0 +1,37 @@ +# 3d Lennard-Jones melt + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable yy equal 20*$y +variable zz equal 20*$z + +units lj +atom_style atomic + +lattice fcc 0.8442 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +create_box 1 box +create_atoms 1 box +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 20 check no + +fix 1 all nve +thermo_style yaml +thermo 10 + +#dump 1 all yaml 25 dump.yaml id type x y z ix iy iz vx vy vz +#dump_modify 1 sort id thermo yes units yes time yes format 1 %5d format float "% 12.8e" format int %2d + +run 100 post no + +run 100 post no diff --git a/examples/yaml/log.7Apr22.yaml.g++.1 b/examples/yaml/log.7Apr22.yaml.g++.1 new file mode 100644 index 0000000000..0c39dbe6a3 --- /dev/null +++ b/examples/yaml/log.7Apr22.yaml.g++.1 @@ -0,0 +1,151 @@ +LAMMPS (24 Mar 2022) +OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:98) + using 1 OpenMP thread(s) per MPI task +# 3d Lennard-Jones melt + +variable x index 1 +variable y index 1 +variable z index 1 + +variable xx equal 20*$x +variable xx equal 20*1 +variable yy equal 20*$y +variable yy equal 20*1 +variable zz equal 20*$z +variable zz equal 20*1 + +units lj +atom_style atomic + +lattice fcc 0.8442 +Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962 +region box block 0 ${xx} 0 ${yy} 0 ${zz} +region box block 0 20 0 ${yy} 0 ${zz} +region box block 0 20 0 20 0 ${zz} +region box block 0 20 0 20 0 20 +create_box 1 box +Created orthogonal box = (0 0 0) to (33.591924 33.591924 33.591924) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 32000 atoms + using lattice units in orthogonal box = (0 0 0) to (33.591924 33.591924 33.591924) + create_atoms CPU = 0.003 seconds +mass 1 1.0 + +velocity all create 1.44 87287 loop geom + +pair_style lj/cut 2.5 +pair_coeff 1 1 1.0 1.0 2.5 + +neighbor 0.3 bin +neigh_modify delay 0 every 20 check no + +fix 1 all nve +thermo_style yaml +thermo 10 + +dump 1 all yaml 25 dump.yaml id type x y z ix iy iz vx vy vz +dump_modify 1 sort id thermo yes units yes time yes format 1 %5d format float "% 12.8e" format int %2d + +run 100 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Neighbor list info ... + update every 20 steps, delay 0 steps, check no + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 2.8 + ghost atom cutoff = 2.8 + binsize = 1.4, bins = 24 24 24 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair lj/cut, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d + bin: standard +Per MPI rank memory allocation (min/avg/max) = 20.56 | 20.56 | 20.56 Mbytes +--- +keywords: [Step, Temp, KinEng, PotEng, E_bond, E_angle, E_dihed, E_impro, E_vdwl, E_coul, E_long, Press, ] +data: + - [0, 1.44000000000001, 2.15993250000001, -6.77336805323422, 0, 0, 0, 0, -6.77336805323422, 0, 0, -5.01970725908556, ] + - [10, 1.12539487029313, 1.68803955255514, -6.30005271976029, 0, 0, 0, 0, -6.30005271976029, 0, 0, -2.55968522600129, ] + - [20, 0.625793798302192, 0.938661363368992, -5.55655653922756, 0, 0, 0, 0, -5.55655653922756, 0, 0, 0.973517658007722, ] + - [30, 0.745927295413064, 1.11885597777762, -5.73951278150759, 0, 0, 0, 0, -5.73951278150759, 0, 0, 0.339284096694852, ] + - [40, 0.731026217827733, 1.09650505988764, -5.71764564663628, 0, 0, 0, 0, -5.71764564663628, 0, 0, 0.388973418756238, ] + - [50, 0.740091517740786, 1.11010258482128, -5.73150426762886, 0, 0, 0, 0, -5.73150426762886, 0, 0, 0.335273324523691, ] + - [60, 0.750500641591031, 1.12571578266897, -5.74713299283555, 0, 0, 0, 0, -5.74713299283555, 0, 0, 0.26343139026926, ] + - [70, 0.755436366857812, 1.13311913920702, -5.75480059117447, 0, 0, 0, 0, -5.75480059117447, 0, 0, 0.224276619217515, ] + - [80, 0.759974280364828, 1.13992579675285, -5.76187162670983, 0, 0, 0, 0, -5.76187162670983, 0, 0, 0.191626237124102, ] + - [90, 0.760464250735042, 1.14066072934081, -5.76280209529731, 0, 0, 0, 0, -5.76280209529731, 0, 0, 0.189478083345243, ] + - [100, 0.757453103239936, 1.13614414924569, -5.75850548601596, 0, 0, 0, 0, -5.75850548601596, 0, 0, 0.207261053624723, ] +... +Loop time of 1.89046 on 1 procs for 100 steps with 32000 atoms + +Performance: 22851.622 tau/day, 52.897 timesteps/s +99.6% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.2896 | 1.2896 | 1.2896 | 0.0 | 68.22 +Neigh | 0.17687 | 0.17687 | 0.17687 | 0.0 | 9.36 +Comm | 0.014543 | 0.014543 | 0.014543 | 0.0 | 0.77 +Output | 0.37678 | 0.37678 | 0.37678 | 0.0 | 19.93 +Modify | 0.028638 | 0.028638 | 0.028638 | 0.0 | 1.51 +Other | | 0.003975 | | | 0.21 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19657 ave 19657 max 19657 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1.20283e+06 ave 1.20283e+06 max 1.20283e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1202833 +Ave neighs/atom = 37.588531 +Neighbor list builds = 5 +Dangerous builds not checked + +run 100 + generated 0 of 0 mixed pair_coeff terms from geometric mixing rule +Per MPI rank memory allocation (min/avg/max) = 20.57 | 20.57 | 20.57 Mbytes +--- +keywords: [Step, Temp, KinEng, PotEng, E_bond, E_angle, E_dihed, E_impro, E_vdwl, E_coul, E_long, Press, ] +data: + - [100, 0.757453103239935, 1.13614414924569, -5.7585054860159, 0, 0, 0, 0, -5.7585054860159, 0, 0, 0.207261053624721, ] + - [110, 0.759322359337036, 1.13894794576996, -5.7614668389562, 0, 0, 0, 0, -5.7614668389562, 0, 0, 0.194314975399602, ] + - [120, 0.759372342462676, 1.13902291811546, -5.76149365656489, 0, 0, 0, 0, -5.76149365656489, 0, 0, 0.191600048851267, ] + - [130, 0.756833027516501, 1.13521406472659, -5.75777334823494, 0, 0, 0, 0, -5.75777334823494, 0, 0, 0.208792327853067, ] + - [140, 0.759725426691298, 1.13955252790757, -5.76208910746081, 0, 0, 0, 0, -5.76208910746081, 0, 0, 0.193895435346637, ] + - [150, 0.760545839455106, 1.14078310859643, -5.7633284876011, 0, 0, 0, 0, -5.7633284876011, 0, 0, 0.187959630462945, ] + - [160, 0.758404626168493, 1.13757138903589, -5.76023198892283, 0, 0, 0, 0, -5.76023198892283, 0, 0, 0.19692107984108, ] + - [170, 0.758880300638885, 1.13828487844424, -5.76103232235402, 0, 0, 0, 0, -5.76103232235402, 0, 0, 0.197653518549842, ] + - [180, 0.753691827878246, 1.13050241251294, -5.75304767384283, 0, 0, 0, 0, -5.75304767384283, 0, 0, 0.237041776410937, ] + - [190, 0.757361226563721, 1.13600633853809, -5.75852399133222, 0, 0, 0, 0, -5.75852399133222, 0, 0, 0.219529562657488, ] + - [200, 0.759531750132731, 1.13926202214831, -5.76188923485725, 0, 0, 0, 0, -5.76188923485725, 0, 0, 0.209105747192796, ] +... +Loop time of 1.93916 on 1 procs for 100 steps with 32000 atoms + +Performance: 22277.687 tau/day, 51.569 timesteps/s +99.4% CPU use with 1 MPI tasks x 1 OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.3292 | 1.3292 | 1.3292 | 0.0 | 68.55 +Neigh | 0.18317 | 0.18317 | 0.18317 | 0.0 | 9.45 +Comm | 0.013626 | 0.013626 | 0.013626 | 0.0 | 0.70 +Output | 0.38206 | 0.38206 | 0.38206 | 0.0 | 19.70 +Modify | 0.027034 | 0.027034 | 0.027034 | 0.0 | 1.39 +Other | | 0.004028 | | | 0.21 + +Nlocal: 32000 ave 32000 max 32000 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 19570 ave 19570 max 19570 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 1.19982e+06 ave 1.19982e+06 max 1.19982e+06 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 1199821 +Ave neighs/atom = 37.494406 +Neighbor list builds = 5 +Dangerous builds not checked +Total wall time: 0:00:04 diff --git a/lib/README b/lib/README index dc25053cec..ab71e6763c 100644 --- a/lib/README +++ b/lib/README @@ -35,8 +35,8 @@ kokkos Kokkos package for GPU and many-core acceleration from Kokkos development team (Sandia) linalg set of BLAS and LAPACK routines needed by ATC package from Axel Kohlmeyer (Temple U) -message client/server communication library via MPI, sockets, files - from Steve Plimpton (Sandia) +mdi hooks to the MDI library, used by MDI package + from Taylor Barnes (MolSSI at Virginia Tech) molfile hooks to VMD molfile plugins, used by the MOLFILE package from Axel Kohlmeyer (Temple U) and the VMD development team mscg hooks to the MSCG library, used by fix_mscg command diff --git a/lib/atc/ATC_Coupling.cpp b/lib/atc/ATC_Coupling.cpp index 381e9fee90..188c1b04f2 100644 --- a/lib/atc/ATC_Coupling.cpp +++ b/lib/atc/ATC_Coupling.cpp @@ -775,7 +775,7 @@ namespace ATC { //-------------------------------------------------- /** allow FE_Engine to construct data manager after mesh is constructed */ - void ATC_Coupling::construct_prescribed_data_manager (void) { + void ATC_Coupling::construct_prescribed_data_manager () { prescribedDataMgr_ = new PrescribedDataManager(feEngine_,fieldSizes_); } @@ -1704,7 +1704,7 @@ namespace ATC { //-------------------------------------------------------------- /** method to trigger construction of mesh data after mesh construction */ //-------------------------------------------------------------- - void ATC_Coupling::initialize_mesh_data(void) + void ATC_Coupling::initialize_mesh_data() { int nelts = feEngine_->fe_mesh()->num_elements(); elementToMaterialMap_.reset(nelts); @@ -1715,7 +1715,7 @@ namespace ATC { } //-------------------------------------------------------- - void ATC_Coupling::reset_flux_mask(void) + void ATC_Coupling::reset_flux_mask() { int i; // this is exact only for uniform meshes and certain types of atomic weights diff --git a/lib/atc/ATC_CouplingMomentum.cpp b/lib/atc/ATC_CouplingMomentum.cpp index 9b16efc159..86de830b55 100644 --- a/lib/atc/ATC_CouplingMomentum.cpp +++ b/lib/atc/ATC_CouplingMomentum.cpp @@ -357,7 +357,7 @@ namespace ATC { // compute_scalar : added energy // this is used in the line search //-------------------------------------------------------------------- - double ATC_CouplingMomentum::compute_scalar(void) + double ATC_CouplingMomentum::compute_scalar() { double energy = extrinsicModelManager_.compute_scalar(); return energy; diff --git a/lib/atc/ATC_CouplingMomentumEnergy.cpp b/lib/atc/ATC_CouplingMomentumEnergy.cpp index 08206ba6db..c3b36fb30a 100644 --- a/lib/atc/ATC_CouplingMomentumEnergy.cpp +++ b/lib/atc/ATC_CouplingMomentumEnergy.cpp @@ -327,7 +327,7 @@ namespace ATC { //-------------------------------------------------------------------- // compute_scalar : added energy //-------------------------------------------------------------------- - double ATC_CouplingMomentumEnergy::compute_scalar(void) + double ATC_CouplingMomentumEnergy::compute_scalar() { double energy = 0.0; energy += extrinsicModelManager_.compute_scalar(); @@ -337,7 +337,7 @@ namespace ATC { //-------------------------------------------------------------------- // total kinetic energy //-------------------------------------------------------------------- - double ATC_CouplingMomentumEnergy::kinetic_energy(void) + double ATC_CouplingMomentumEnergy::kinetic_energy() { const MATRIX & M = massMats_[VELOCITY].quantity(); @@ -355,7 +355,7 @@ namespace ATC { //-------------------------------------------------------------------- // total potential energy //-------------------------------------------------------------------- - double ATC_CouplingMomentumEnergy::potential_energy(void) + double ATC_CouplingMomentumEnergy::potential_energy() { Array mask(1); mask(0) = VELOCITY; diff --git a/lib/atc/ATC_Error.h b/lib/atc/ATC_Error.h index 62c22158cf..f4f3f84c24 100644 --- a/lib/atc/ATC_Error.h +++ b/lib/atc/ATC_Error.h @@ -3,6 +3,7 @@ #ifndef ATC_ERROR #define ATC_ERROR +#include #include // the following two convert __LINE__ to a string @@ -23,7 +24,7 @@ namespace ATC { * @brief Base class for throwing run-time errors with descriptions */ -class ATC_Error { +class ATC_Error : public std::exception { public: // constructor @@ -31,17 +32,21 @@ class ATC_Error { { errorDescription_ = "ERROR: " + errorDescription; ERROR_FOR_BACKTRACE - }; + } ATC_Error(std::string location, std::string errorDescription) { errorDescription_ = "ERROR: " + location + ": "+ errorDescription; ERROR_FOR_BACKTRACE - }; + } std::string error_description() { return errorDescription_; - }; + } + + const char *what() const noexcept override { + return errorDescription_.c_str(); + } private: // string describing the type of error diff --git a/lib/atc/ATC_Method.cpp b/lib/atc/ATC_Method.cpp index 6fc8d51aa7..1236c93b2d 100644 --- a/lib/atc/ATC_Method.cpp +++ b/lib/atc/ATC_Method.cpp @@ -1674,7 +1674,7 @@ pecified } //------------------------------------------------------------------- - void ATC_Method::set_reference_potential_energy(void) + void ATC_Method::set_reference_potential_energy() { if (setRefPE_) { if (setRefPEvalue_) { @@ -2170,7 +2170,7 @@ pecified // } } //-------------------------------------------------------- - void ATC_Method::compute_nodeset_output(void) + void ATC_Method::compute_nodeset_output() { map< pair , NodesetOperationType >::const_iterator iter; for (iter = nsetData_.begin(); iter != nsetData_.end();iter++){ @@ -2194,7 +2194,7 @@ pecified } } //-------------------------------------------------------- - void ATC_Method::compute_faceset_output(void) + void ATC_Method::compute_faceset_output() { map < pair, FacesetIntegralType >::const_iterator iter; DENS_MAT values; @@ -2223,7 +2223,7 @@ pecified } } //-------------------------------------------------------- - void ATC_Method::compute_elementset_output(void) + void ATC_Method::compute_elementset_output() { map< pair , ElementsetOperationType >::const_iterator iter; for (iter = esetData_.begin(); iter != esetData_.end();iter++){ @@ -2379,7 +2379,7 @@ pecified } //-------------------------------------------------------- - void ATC_Method::remap_ghost_ref_positions(void) + void ATC_Method::remap_ghost_ref_positions() { int nlocal = lammpsInterface_->nlocal(); diff --git a/lib/atc/ATC_Transfer.cpp b/lib/atc/ATC_Transfer.cpp index 5ea7f1233a..edaa060ab3 100644 --- a/lib/atc/ATC_Transfer.cpp +++ b/lib/atc/ATC_Transfer.cpp @@ -916,12 +916,12 @@ namespace ATC { } //------------------------------------------------------------------- - void ATC_Transfer::compute_bond_matrix(void) + void ATC_Transfer::compute_bond_matrix() { bondMatrix_->reset(); } //------------------------------------------------------------------- - void ATC_Transfer::compute_fields(void) + void ATC_Transfer::compute_fields() { // keep per-atom computes fresh. JAZ and REJ not sure why; diff --git a/lib/atc/ATC_TransferKernel.cpp b/lib/atc/ATC_TransferKernel.cpp index e09139f92c..61dd8fbade 100644 --- a/lib/atc/ATC_TransferKernel.cpp +++ b/lib/atc/ATC_TransferKernel.cpp @@ -83,7 +83,7 @@ using ATC_Utility::to_string; } //------------------------------------------------------------------- - void ATC_TransferKernel::compute_kernel_matrix_molecule(void) // KKM add + void ATC_TransferKernel::compute_kernel_matrix_molecule() // KKM add { int nLocalMol = smallMoleculeSet_->local_molecule_count(); if (nLocal_>0) { diff --git a/lib/atc/AtomicRegulator.cpp b/lib/atc/AtomicRegulator.cpp index 1d2b5d1d85..8f67bdbe34 100644 --- a/lib/atc/AtomicRegulator.cpp +++ b/lib/atc/AtomicRegulator.cpp @@ -688,7 +688,7 @@ namespace ATC { // compute_sparsity // - creates sparsity template //-------------------------------------------------------- - void RegulatorShapeFunction::compute_sparsity(void) + void RegulatorShapeFunction::compute_sparsity() { // first get local pattern from N N^T diff --git a/lib/atc/ChargeRegulator.cpp b/lib/atc/ChargeRegulator.cpp index f0f0423e9a..101ec3f7e7 100644 --- a/lib/atc/ChargeRegulator.cpp +++ b/lib/atc/ChargeRegulator.cpp @@ -198,7 +198,7 @@ namespace ATC { // nomenclature might be a bit backwark: control --> nodes that exert the control, & influence --> atoms that feel the influence - void ChargeRegulatorMethod::initialize(void) + void ChargeRegulatorMethod::initialize() { interscaleManager_ = &(atc_->interscale_manager()); @@ -220,7 +220,7 @@ namespace ATC { int ChargeRegulatorMethod::nlocal() { return atc_->nlocal(); } - void ChargeRegulatorMethod::set_greens_functions(void) + void ChargeRegulatorMethod::set_greens_functions() { // set up Green's function per node for (int i = 0; i < nNodes_; i++) { @@ -272,7 +272,7 @@ namespace ATC { //-------------------------------------------------------- // Initialize //-------------------------------------------------------- - void ChargeRegulatorMethodFeedback::initialize(void) + void ChargeRegulatorMethodFeedback::initialize() { ChargeRegulatorMethod::initialize(); if (surfaceType_ != ChargeRegulator::CONDUCTOR) @@ -284,7 +284,7 @@ namespace ATC { //-------------------------------------------------------- // Initialize //-------------------------------------------------------- - void ChargeRegulatorMethodFeedback::construct_transfers(void) + void ChargeRegulatorMethodFeedback::construct_transfers() { ChargeRegulatorMethod::construct_transfers(); @@ -301,7 +301,7 @@ namespace ATC { //-------------------------------------------------------- // find measurement atoms and nodes //-------------------------------------------------------- - void ChargeRegulatorMethodFeedback::set_influence(void) + void ChargeRegulatorMethodFeedback::set_influence() { // get nodes that overlap influence atoms & compact list of influence atoms @@ -321,7 +321,7 @@ namespace ATC { //-------------------------------------------------------- // constuct a Green's submatrix //-------------------------------------------------------- - void ChargeRegulatorMethodFeedback::set_influence_matrix(void) + void ChargeRegulatorMethodFeedback::set_influence_matrix() { // construct control-influence matrix bar{G}^-1: ds{p} = G{p,m}^-1 dphi{m} @@ -434,7 +434,7 @@ namespace ATC { //-------------------------------------------------------- // Initialize //-------------------------------------------------------- - void ChargeRegulatorMethodImageCharge::initialize(void) + void ChargeRegulatorMethodImageCharge::initialize() { ChargeRegulatorMethod::initialize(); if (surfaceType_ != ChargeRegulator::DIELECTRIC) throw ATC_Error("currently image charge can only mimic a dielectric"); diff --git a/lib/atc/ConcentrationRegulator.cpp b/lib/atc/ConcentrationRegulator.cpp index b6aa6c5265..77796176bc 100644 --- a/lib/atc/ConcentrationRegulator.cpp +++ b/lib/atc/ConcentrationRegulator.cpp @@ -224,7 +224,7 @@ const double kMinScale_ = 10000.; //-------------------------------------------------------- // Initialize //-------------------------------------------------------- - void ConcentrationRegulatorMethodTransition::initialize(void) + void ConcentrationRegulatorMethodTransition::initialize() { #ifdef ATC_VERBOSE lammpsInterface_->print_msg_once( @@ -289,7 +289,7 @@ const double kMinScale_ = 10000.; //-------------------------------------------------------- // pre exchange //-------------------------------------------------------- - void ConcentrationRegulatorMethodTransition::pre_exchange(void) + void ConcentrationRegulatorMethodTransition::pre_exchange() { // return if should not be called on this timestep if ( ! lammpsInterface_->now(frequency_)) return; @@ -312,7 +312,7 @@ const double kMinScale_ = 10000.; //-------------------------------------------------------- // pre force //-------------------------------------------------------- - void ConcentrationRegulatorMethodTransition::pre_force(void) + void ConcentrationRegulatorMethodTransition::pre_force() { transition(); } @@ -353,7 +353,7 @@ const double kMinScale_ = 10000.; //-------------------------------------------------------- // excess //-------------------------------------------------------- - int ConcentrationRegulatorMethodTransition::excess(void) const + int ConcentrationRegulatorMethodTransition::excess() const { int nexcess = count()-targetCount_; nexcess = max(min(nexcess,maxExchanges_),-maxExchanges_); @@ -362,7 +362,7 @@ const double kMinScale_ = 10000.; //-------------------------------------------------------- // count //-------------------------------------------------------- - int ConcentrationRegulatorMethodTransition::count(void) const + int ConcentrationRegulatorMethodTransition::count() const { // integrate concentration over region const DENS_MAT & c = (atc_->field(SPECIES_CONCENTRATION)).quantity(); diff --git a/lib/atc/ExtrinsicModel.cpp b/lib/atc/ExtrinsicModel.cpp index 8dc8b71539..802f3edb90 100644 --- a/lib/atc/ExtrinsicModel.cpp +++ b/lib/atc/ExtrinsicModel.cpp @@ -181,7 +181,7 @@ namespace ATC { //-------------------------------------------------------- // compute_scalar //-------------------------------------------------------- - double ExtrinsicModelManager::compute_scalar(void) + double ExtrinsicModelManager::compute_scalar() { double value = 0.; vector::iterator imodel; @@ -360,7 +360,7 @@ namespace ATC { //-------------------------------------------------------- // initialize //-------------------------------------------------------- - void ExtrinsicModel::initialize(void) + void ExtrinsicModel::initialize() { physicsModel_->initialize(); } diff --git a/lib/atc/ExtrinsicModelElectrostatic.cpp b/lib/atc/ExtrinsicModelElectrostatic.cpp index 73a94b8192..c061b4184c 100644 --- a/lib/atc/ExtrinsicModelElectrostatic.cpp +++ b/lib/atc/ExtrinsicModelElectrostatic.cpp @@ -483,7 +483,7 @@ namespace ATC { //-------------------------------------------------------- // compute_scalar : added energy = - f.x //-------------------------------------------------------- - double ExtrinsicModelElectrostatic::compute_scalar(void) + double ExtrinsicModelElectrostatic::compute_scalar() { //((atc_->interscale_manager()).fundamental_atom_quantity(LammpsInterface::ATOM_POSITION))->force_reset(); const DENS_MAT & atomPosition = ((atc_->interscale_manager()).fundamental_atom_quantity(LammpsInterface::ATOM_POSITION))->quantity(); diff --git a/lib/atc/FE_Engine.cpp b/lib/atc/FE_Engine.cpp index fc07b5e638..382b1257e1 100644 --- a/lib/atc/FE_Engine.cpp +++ b/lib/atc/FE_Engine.cpp @@ -430,7 +430,7 @@ namespace ATC{ //----------------------------------------------------------------- // write geometry //----------------------------------------------------------------- - void FE_Engine::write_geometry(void) + void FE_Engine::write_geometry() { outputManager_.write_geometry(feMesh_->coordinates(), feMesh_->connectivity()); @@ -2373,7 +2373,7 @@ namespace ATC{ feMesh_->face_shape_function(face, _fN_, _fdN_, _nN_, _fweights_); feMesh_->element_coordinates(elem, xCoords); - MultAB(xCoords,_fN_,xAtIPs,0,1); //xAtIPs = xCoords*(N.transpose()); + MultAB(xCoords,_fN_,xAtIPs,false,true); //xAtIPs = xCoords*(N.transpose()); // interpolate prescribed flux at ips of this element diff --git a/lib/atc/FE_Mesh.cpp b/lib/atc/FE_Mesh.cpp index a516dbfee8..6845c975d9 100644 --- a/lib/atc/FE_Mesh.cpp +++ b/lib/atc/FE_Mesh.cpp @@ -404,7 +404,7 @@ namespace ATC { // ------------------------------------------------------------- // initialize // ------------------------------------------------------------- - void FE_Mesh::initialize(void) + void FE_Mesh::initialize() { bool aligned = is_aligned(); @@ -469,7 +469,7 @@ namespace ATC { // ------------------------------------------------------------- // test whether almost structured // ------------------------------------------------------------- - bool FE_Mesh::is_aligned(void) const + bool FE_Mesh::is_aligned() const { vector foundBestMatch(nSD_,false); vector tangents(nSD_); @@ -518,7 +518,7 @@ namespace ATC { // ------------------------------------------------------------- // element_type // ------------------------------------------------------------- - string FE_Mesh::element_type(void) const { + string FE_Mesh::element_type() const { int npe = feElement_->num_elt_nodes(); if (npe == 4) { return "TET4"; } else if (npe == 8) { return "HEX8"; } @@ -1915,7 +1915,7 @@ namespace ATC { return true; } - void FE_3DMesh::set_unique_connectivity(void) + void FE_3DMesh::set_unique_connectivity() { int numEltNodes = feElement_->num_elt_nodes(); connectivityUnique_.reset(numEltNodes, nElts_); diff --git a/lib/atc/LammpsInterface.cpp b/lib/atc/LammpsInterface.cpp index 02ace08416..8f7d20361c 100644 --- a/lib/atc/LammpsInterface.cpp +++ b/lib/atc/LammpsInterface.cpp @@ -483,7 +483,7 @@ void LammpsInterface::periodicity_correction(double * x) const } } -void LammpsInterface::set_reference_box(void) const +void LammpsInterface::set_reference_box() const { double * hi = lammps_->domain->boxhi; double * lo = lammps_->domain->boxlo; @@ -570,7 +570,7 @@ void LammpsInterface::closest_image(const double * const xi, const double * cons // ----------------------------------------------------------------- // update interface methods // ----------------------------------------------------------------- -LammpsInterface::UnitsType LammpsInterface::units_style(void) const +LammpsInterface::UnitsType LammpsInterface::units_style() const { if (strcmp(lammps_->update->unit_style,"lj") == 0) return LJ; else if (strcmp(lammps_->update->unit_style,"real") == 0) return REAL; @@ -655,7 +655,7 @@ void LammpsInterface::basis_vectors(double **basis) const } //* gets the (max) lattice constant -double LammpsInterface::max_lattice_constant(void) const +double LammpsInterface::max_lattice_constant() const { double a1[3], a2[3], a3[3]; unit_cell(a1,a2,a3); @@ -666,7 +666,7 @@ double LammpsInterface::max_lattice_constant(void) const } //* computes a cutoff distance halfway between 1st and 2nd nearest neighbors -double LammpsInterface::near_neighbor_cutoff(void) const +double LammpsInterface::near_neighbor_cutoff() const { double cutoff; double alat = LammpsInterface::max_lattice_constant(); @@ -716,7 +716,7 @@ void LammpsInterface::unit_cell(double *a1, double *a2, double *a3) const } //* gets number of atoms in a unit cell -int LammpsInterface::num_atoms_per_cell(void) const +int LammpsInterface::num_atoms_per_cell() const { int naCell = 0; LatticeType type = lattice_style(); @@ -733,7 +733,7 @@ int LammpsInterface::num_atoms_per_cell(void) const } //* gets tributary volume for an atom -double LammpsInterface::volume_per_atom(void) const +double LammpsInterface::volume_per_atom() const { double naCell = num_atoms_per_cell(); double volPerAtom = @@ -1468,7 +1468,7 @@ LAMMPS_NS::Compute * LammpsInterface::const_to_active(COMPUTE_POINTER computePoi // compute pe/atom interface methods // - the only compute "owned" by ATC // ----------------------------------------------------------------- -int LammpsInterface::create_compute_pe_peratom(void) const +int LammpsInterface::create_compute_pe_peratom() const { char **list = new char*[4]; string atomPeName = compute_pe_name(); @@ -1493,7 +1493,7 @@ int LammpsInterface::create_compute_pe_peratom(void) const return icompute; } -double * LammpsInterface::compute_pe_peratom(void) const +double * LammpsInterface::compute_pe_peratom() const { if (atomPE_) { atomPE_->compute_peratom(); diff --git a/lib/atc/LinearSolver.cpp b/lib/atc/LinearSolver.cpp index 06683981e7..48fd6c049e 100644 --- a/lib/atc/LinearSolver.cpp +++ b/lib/atc/LinearSolver.cpp @@ -84,7 +84,7 @@ LinearSolver::LinearSolver( // -------------------------------------------------------------------- // Setup // -------------------------------------------------------------------- -void LinearSolver::setup(void) +void LinearSolver::setup() { tol_ = kTol; nVariables_ = matrix_.nRows(); @@ -113,7 +113,7 @@ void LinearSolver::setup(void) // -------------------------------------------------------------------- // Initialize // -------------------------------------------------------------------- -void LinearSolver::allow_reinitialization(void) +void LinearSolver::allow_reinitialization() { if (constraintHandlerType_ == PENALIZE_CONSTRAINTS) { if (matrixModified_ ) throw ATC_Error("LinearSolver: can't allow reinitialization after matrix has been modified"); @@ -157,7 +157,7 @@ void LinearSolver::initialize(const BC_SET * bcs) // -------------------------------------------------------------------- // initialize_matrix // -------------------------------------------------------------------- -void LinearSolver::initialize_matrix(void) +void LinearSolver::initialize_matrix() { if ( initializedMatrix_ ) return; if (constraintHandlerType_ == PENALIZE_CONSTRAINTS) { @@ -172,7 +172,7 @@ void LinearSolver::initialize_matrix(void) // -------------------------------------------------------------------- // initialize_inverse // -------------------------------------------------------------------- -void LinearSolver::initialize_inverse(void) +void LinearSolver::initialize_inverse() { if ( initializedInverse_ ) return; if (solverType_ == ITERATIVE_SOLVE_SYMMETRIC @@ -196,7 +196,7 @@ void LinearSolver::initialize_inverse(void) // -------------------------------------------------------------------- // initialize_rhs // -------------------------------------------------------------------- -void LinearSolver::initialize_rhs(void) +void LinearSolver::initialize_rhs() { if (! rhs_ ) return; if (! bcs_ ) { @@ -215,7 +215,7 @@ void LinearSolver::initialize_rhs(void) // add matrix penalty // - change matrix for Dirichlet conditions: add penalty // -------------------------------------------------------------------- -void LinearSolver::add_matrix_penalty(void) +void LinearSolver::add_matrix_penalty() { penalty_ = kPenalty; // relative to matrix diagonal SPAR_MAT & A = matrixCopy_; @@ -233,7 +233,7 @@ void LinearSolver::add_matrix_penalty(void) // partition matrix // - partition matrix based on Dirichlet constraints // -------------------------------------------------------------------- -void LinearSolver::partition_matrix(void) +void LinearSolver::partition_matrix() { fixedSet_.clear(); BC_SET::const_iterator itr; diff --git a/lib/atc/OutputManager.cpp b/lib/atc/OutputManager.cpp index d66fb0e8dd..6a57bceac1 100644 --- a/lib/atc/OutputManager.cpp +++ b/lib/atc/OutputManager.cpp @@ -172,7 +172,7 @@ void OutputManager::read_restart_file(string fileName, RESTART_LIST *data) //----------------------------------------------------------------------------- //* //----------------------------------------------------------------------------- -void OutputManager::write_globals(void) +void OutputManager::write_globals() { if ( outputPrefix_ == "NULL") return; string file = outputPrefix_ + ".GLOBALS"; @@ -224,7 +224,7 @@ void OutputManager::write_geometry(const MATRIX *coordinates, //----------------------------------------------------------------------------- //* //----------------------------------------------------------------------------- -void OutputManager::write_geometry_ensight(void) +void OutputManager::write_geometry_ensight() { // geometry based on a reference configuration string geom_file_name = outputPrefix_ + ".geo"; @@ -327,7 +327,7 @@ void OutputManager::write_geometry_ensight(void) //----------------------------------------------------------------------------- //* //----------------------------------------------------------------------------- -void OutputManager::write_geometry_text(void) +void OutputManager::write_geometry_text() { if ( outputPrefix_ == "NULL") return; // geometry based on a reference configuration diff --git a/lib/atc/PerPairQuantity.cpp b/lib/atc/PerPairQuantity.cpp index 164c387643..d95c6e42bd 100644 --- a/lib/atc/PerPairQuantity.cpp +++ b/lib/atc/PerPairQuantity.cpp @@ -18,7 +18,7 @@ PairMap::PairMap(LammpsInterface * lammpsInterface, int groupbit ): nPairs_(0), nBonds_(0) { }; -PairMap::~PairMap(void) +PairMap::~PairMap() { }; //========================================================== @@ -27,7 +27,7 @@ PairMapNeighbor::PairMapNeighbor(LammpsInterface * lammpsInterface, int groupbit { }; -void PairMapNeighbor::reset(void) const +void PairMapNeighbor::reset() const { int inum = lammpsInterface_->neighbor_list_inum(); int *ilist = lammpsInterface_->neighbor_list_ilist(); @@ -90,7 +90,7 @@ PairVirialEulerian::PairVirialEulerian(LammpsInterface * lammpsInterface, }; -void PairVirialEulerian::reset(void) const +void PairVirialEulerian::reset() const { int nPairs = pairMap_.size(); quantity_.reset(nPairs,nCols_); @@ -129,7 +129,7 @@ PairVirialLagrangian::PairVirialLagrangian(LammpsInterface * lammpsInterface, }; -void PairVirialLagrangian::reset(void) const +void PairVirialLagrangian::reset() const { int nPairs = pairMap_.size(); quantity_.reset(nPairs,nCols_); @@ -181,7 +181,7 @@ PairPotentialHeatFluxEulerian::PairPotentialHeatFluxEulerian(LammpsInterface * l }; -void PairPotentialHeatFluxEulerian::reset(void) const +void PairPotentialHeatFluxEulerian::reset() const { int nPairs = pairMap_.size(); quantity_.reset(nPairs,nCols_); @@ -217,7 +217,7 @@ PairPotentialHeatFluxLagrangian::PairPotentialHeatFluxLagrangian(LammpsInterface }; -void PairPotentialHeatFluxLagrangian::reset(void) const +void PairPotentialHeatFluxLagrangian::reset() const { int nPairs = pairMap_.size(); quantity_.reset(nPairs,nCols_); @@ -275,7 +275,7 @@ BondMatrixKernel::BondMatrixKernel(LammpsInterface * lammpsInterface, if (kernelFunction_ == nullptr) throw ATC_Error("No AtC kernel function initialized"); }; -void BondMatrixKernel::reset(void) const +void BondMatrixKernel::reset() const { int nPairs = pairMap_.size(); // needs to come after quantity for reset int nNodes = feMesh_->num_nodes_unique(); @@ -328,7 +328,7 @@ BondMatrixPartitionOfUnity::BondMatrixPartitionOfUnity(LammpsInterface * lammpsI lineWg_[i] *= 0.5; } }; -void BondMatrixPartitionOfUnity::reset(void) const +void BondMatrixPartitionOfUnity::reset() const { int nNodes = feMesh_->num_nodes_unique(); int nPairs = pairMap_.size(); diff --git a/lib/atc/PhysicsModel.cpp b/lib/atc/PhysicsModel.cpp index 0cef920e88..0720d86be2 100644 --- a/lib/atc/PhysicsModel.cpp +++ b/lib/atc/PhysicsModel.cpp @@ -108,7 +108,7 @@ void PhysicsModel::parse_material_file(string fileName) fileId.close(); } -void PhysicsModel::initialize(void) +void PhysicsModel::initialize() { // initialize materials vector< Material* >::const_iterator iter; diff --git a/lib/atc/PoissonSolver.cpp b/lib/atc/PoissonSolver.cpp index 3d644e6c58..51b1604c91 100644 --- a/lib/atc/PoissonSolver.cpp +++ b/lib/atc/PoissonSolver.cpp @@ -111,7 +111,7 @@ PoissonSolver::~PoissonSolver() // -------------------------------------------------------------------- // Initialize // -------------------------------------------------------------------- -void PoissonSolver::initialize(void) +void PoissonSolver::initialize() { nNodes_ = feEngine_->num_nodes(); diff --git a/lib/atc/PrescribedDataManager.cpp b/lib/atc/PrescribedDataManager.cpp index 72f6c75e79..aed3ecd281 100644 --- a/lib/atc/PrescribedDataManager.cpp +++ b/lib/atc/PrescribedDataManager.cpp @@ -523,7 +523,7 @@ namespace ATC { // print //------------------------------------------------------------------------- - void PrescribedDataManager::print(void) + void PrescribedDataManager::print() { // print and check consistency enum dataType {FREE=0,FIELD,SOURCE}; diff --git a/lib/atc/SchrodingerSolver.cpp b/lib/atc/SchrodingerSolver.cpp index a59191a229..37680d7578 100644 --- a/lib/atc/SchrodingerSolver.cpp +++ b/lib/atc/SchrodingerSolver.cpp @@ -735,7 +735,7 @@ double fermi_dirac(const double E, const double T) else ATC_Error("schrodinger-poisson solver:too many fixed"); } - GlobalSliceSchrodingerPoissonSolver::~GlobalSliceSchrodingerPoissonSolver(void) { + GlobalSliceSchrodingerPoissonSolver::~GlobalSliceSchrodingerPoissonSolver() { if (solver_) delete solver_; } //-------------------------------------------------------------------------- diff --git a/lib/atc/Stress.cpp b/lib/atc/Stress.cpp index 90608dad15..10ec3ca329 100644 --- a/lib/atc/Stress.cpp +++ b/lib/atc/Stress.cpp @@ -237,7 +237,7 @@ StressCubicElastic::StressCubicElastic(fstream &fileId) } } -void StressCubicElastic::set_tangent(void) +void StressCubicElastic::set_tangent() { C_.reset(6,6); C_(0,0)=C_(1,1)=C_(2,2) =c11_; @@ -374,7 +374,7 @@ StressCauchyBorn::~StressCauchyBorn() //============================================================================== // initialize //============================================================================== -void StressCauchyBorn::initialize(void) +void StressCauchyBorn::initialize() { if (!initialized_) { if (makeLinear_) linearize(); @@ -393,7 +393,7 @@ void StressCauchyBorn::initialize(void) //============================================================================== // compute the bond stiffness consistent with the einstein freq //============================================================================== -double StressCauchyBorn::stiffness(void) const +double StressCauchyBorn::stiffness() const { AtomCluster vac; cblattice_->atom_cluster(eye(3,3), potential_->cutoff_radius(), vac); diff --git a/lib/atc/WeakEquationChargeDiffusion.cpp b/lib/atc/WeakEquationChargeDiffusion.cpp index 246edb0f6e..2384dd246c 100644 --- a/lib/atc/WeakEquationChargeDiffusion.cpp +++ b/lib/atc/WeakEquationChargeDiffusion.cpp @@ -19,7 +19,7 @@ WeakEquationChargeDiffusion::WeakEquationChargeDiffusion() //-------------------------------------------------------------- // Destructor //-------------------------------------------------------------- -WeakEquationChargeDiffusion::~WeakEquationChargeDiffusion(void) +WeakEquationChargeDiffusion::~WeakEquationChargeDiffusion() {} //--------------------------------------------------------------------- // compute capacity diff --git a/lib/atc/WeakEquationDiffusion.cpp b/lib/atc/WeakEquationDiffusion.cpp index 643b7956ba..23393ebdec 100644 --- a/lib/atc/WeakEquationDiffusion.cpp +++ b/lib/atc/WeakEquationDiffusion.cpp @@ -19,7 +19,7 @@ WeakEquationDiffusion::WeakEquationDiffusion() //-------------------------------------------------------------- // Destructor //-------------------------------------------------------------- -WeakEquationDiffusion::~WeakEquationDiffusion(void) +WeakEquationDiffusion::~WeakEquationDiffusion() {} //--------------------------------------------------------------------- // compute capacity diff --git a/lib/atc/WeakEquationElectronContinuity.cpp b/lib/atc/WeakEquationElectronContinuity.cpp index 4c5024c1b1..28b2abd84a 100644 --- a/lib/atc/WeakEquationElectronContinuity.cpp +++ b/lib/atc/WeakEquationElectronContinuity.cpp @@ -18,7 +18,7 @@ WeakEquationElectronContinuity::WeakEquationElectronContinuity() //-------------------------------------------------------------- // Destructor //--------------------------------------------------------------------- -WeakEquationElectronContinuity::~WeakEquationElectronContinuity(void) +WeakEquationElectronContinuity::~WeakEquationElectronContinuity() {} //--------------------------------------------------------------------- @@ -66,7 +66,7 @@ WeakEquationElectronEquilibrium::WeakEquationElectronEquilibrium() //-------------------------------------------------------------- // Destructor //--------------------------------------------------------------------- -WeakEquationElectronEquilibrium::~WeakEquationElectronEquilibrium(void) +WeakEquationElectronEquilibrium::~WeakEquationElectronEquilibrium() {} //--------------------------------------------------------------------- diff --git a/lib/atc/WeakEquationElectronTemperature.cpp b/lib/atc/WeakEquationElectronTemperature.cpp index 368db1005e..975def6486 100644 --- a/lib/atc/WeakEquationElectronTemperature.cpp +++ b/lib/atc/WeakEquationElectronTemperature.cpp @@ -18,7 +18,7 @@ WeakEquationElectronTemperature::WeakEquationElectronTemperature() //-------------------------------------------------------------- // Destructor //--------------------------------------------------------------------- -WeakEquationElectronTemperature::~WeakEquationElectronTemperature(void) +WeakEquationElectronTemperature::~WeakEquationElectronTemperature() {} //--------------------------------------------------------------------- @@ -93,7 +93,7 @@ WeakEquationElectronTemperatureJouleHeating::WeakEquationElectronTemperatureJoul //-------------------------------------------------------------- // Destructor //--------------------------------------------------------------------- -WeakEquationElectronTemperatureJouleHeating::~WeakEquationElectronTemperatureJouleHeating(void) +WeakEquationElectronTemperatureJouleHeating::~WeakEquationElectronTemperatureJouleHeating() {} //--------------------------------------------------------------------- @@ -162,7 +162,7 @@ WeakEquationElectronTemperatureConvection::WeakEquationElectronTemperatureConvec //-------------------------------------------------------------- // Destructor //--------------------------------------------------------------------- -WeakEquationElectronTemperatureConvection::~WeakEquationElectronTemperatureConvection(void) +WeakEquationElectronTemperatureConvection::~WeakEquationElectronTemperatureConvection() { // do nothing } diff --git a/lib/atc/WeakEquationMassDiffusion.cpp b/lib/atc/WeakEquationMassDiffusion.cpp index 122d3ee891..bb079087c3 100644 --- a/lib/atc/WeakEquationMassDiffusion.cpp +++ b/lib/atc/WeakEquationMassDiffusion.cpp @@ -19,7 +19,7 @@ WeakEquationMassDiffusion::WeakEquationMassDiffusion() //-------------------------------------------------------------- // Destructor //-------------------------------------------------------------- -WeakEquationMassDiffusion::~WeakEquationMassDiffusion(void) +WeakEquationMassDiffusion::~WeakEquationMassDiffusion() {} //--------------------------------------------------------------------- // compute capacity diff --git a/lib/atc/WeakEquationPhononTemperature.cpp b/lib/atc/WeakEquationPhononTemperature.cpp index aec735deea..7441ab2ea9 100644 --- a/lib/atc/WeakEquationPhononTemperature.cpp +++ b/lib/atc/WeakEquationPhononTemperature.cpp @@ -19,7 +19,7 @@ WeakEquationPhononTemperature::WeakEquationPhononTemperature() //-------------------------------------------------------------- // Destructor //-------------------------------------------------------------- -WeakEquationPhononTemperature::~WeakEquationPhononTemperature(void) +WeakEquationPhononTemperature::~WeakEquationPhononTemperature() {} //--------------------------------------------------------------------- // compute total energy @@ -67,7 +67,7 @@ WeakEquationPhononTemperatureExchange::WeakEquationPhononTemperatureExchange() //-------------------------------------------------------------- // Destructor //--------------------------------------------------------------------- -WeakEquationPhononTemperatureExchange::~WeakEquationPhononTemperatureExchange(void) +WeakEquationPhononTemperatureExchange::~WeakEquationPhononTemperatureExchange() {} //--------------------------------------------------------------------- diff --git a/lib/atc/WeakEquationSchrodinger.cpp b/lib/atc/WeakEquationSchrodinger.cpp index 07497b1fd5..b4cc3970b3 100644 --- a/lib/atc/WeakEquationSchrodinger.cpp +++ b/lib/atc/WeakEquationSchrodinger.cpp @@ -18,7 +18,7 @@ WeakEquationSchrodinger::WeakEquationSchrodinger() //-------------------------------------------------------------- // Destructor //--------------------------------------------------------------------- -WeakEquationSchrodinger::~WeakEquationSchrodinger(void) +WeakEquationSchrodinger::~WeakEquationSchrodinger() {} //--------------------------------------------------------------------- diff --git a/lib/gpu/Makefile.hip b/lib/gpu/Makefile.hip index d5391f7d6b..9b6087bcc3 100644 --- a/lib/gpu/Makefile.hip +++ b/lib/gpu/Makefile.hip @@ -28,6 +28,11 @@ HIP_HOST_INCLUDE += -I./ # path to hipcub HIP_HOST_INCLUDE += -I$(HIP_PATH)/../include +ifeq (amd,$(HIP_PLATFORM)) + # newer version of ROCm (5.1+) require c++14 for rocprim + HIP_OPTS += -std=c++14 +endif + # use mpi HIP_HOST_OPTS += -DMPI_GERYON -DUCL_NO_EXIT # this settings should match LAMMPS Makefile diff --git a/lib/gpu/Makefile.linux_multi b/lib/gpu/Makefile.linux_multi index f3d89fd9f0..fda640221f 100644 --- a/lib/gpu/Makefile.linux_multi +++ b/lib/gpu/Makefile.linux_multi @@ -13,14 +13,6 @@ endif NVCC = nvcc -# obsolete hardware. not supported by current drivers anymore. -#CUDA_ARCH = -arch=sm_13 -#CUDA_ARCH = -arch=sm_10 -DCUDA_PRE_THREE - -# Fermi hardware -#CUDA_ARCH = -arch=sm_20 -#CUDA_ARCH = -arch=sm_21 - # Kepler hardware #CUDA_ARCH = -arch=sm_30 #CUDA_ARCH = -arch=sm_32 @@ -45,6 +37,9 @@ CUDA_ARCH = -arch=sm_50 #CUDA_ARCH = -arch=sm_80 #CUDA_ARCH = -arch=sm_86 +# Hopper hardware +#CUDA_ARCH = -arch=sm_90 + CUDA_CODE = -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] \ -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61] \ -gencode arch=compute_70,code=[sm_70,compute_70] -gencode arch=compute_75,code=[sm_75,compute_75] \ diff --git a/lib/gpu/README b/lib/gpu/README index 3185db3af6..100179feca 100644 --- a/lib/gpu/README +++ b/lib/gpu/README @@ -171,7 +171,13 @@ NOTE: when compiling with CMake, all of the considerations listed below are considered within the CMake configuration process, so no separate compilation of the gpu library is required. Also this will build in support for all compute architecture that are supported by the CUDA toolkit version -used to build the gpu library. +used to build the gpu library. A similar setup is possible using +Makefile.linux_multi after adjusting the settings for the CUDA toolkit in use. + +Only CUDA toolkit version 8.0 and later and only GPU architecture 3.0 +(aka Kepler) and later are supported by this version of LAMMPS. If you want +to use older hard- or software you have to compile for OpenCL or use an older +version of LAMMPS. If you do not want to use a fat binary, that supports multiple CUDA architectures, the CUDA_ARCH must be set to match the GPU architecture. This @@ -225,7 +231,8 @@ If GERYON_NUMA_FISSION is defined at build time, LAMMPS will consider separate NUMA nodes on GPUs or accelerators as separate devices. For example, a 2-socket CPU would appear as two separate devices for OpenCL (and LAMMPS would require two MPI processes to use both sockets with the GPU library - each with its -own device ID as output by ocl_get_devices). +own device ID as output by ocl_get_devices). OpenCL version 1.2 or later is +required. For a debug build, use "-DUCL_DEBUG -DGERYON_KERNEL_DUMP" and remove "-DUCL_NO_EXIT" and "-DMPI_GERYON" from the build options. diff --git a/lib/gpu/geryon/hip_device.h b/lib/gpu/geryon/hip_device.h index 456a03b180..fadeec8711 100644 --- a/lib/gpu/geryon/hip_device.h +++ b/lib/gpu/geryon/hip_device.h @@ -379,18 +379,9 @@ UCL_Device::UCL_Device() { prop.regsPerBlock = hip_prop.regsPerBlock; prop.clockRate = hip_prop.clockRate; prop.computeMode = hip_prop.computeMode; - //CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.memPitch, CU_DEVICE_ATTRIBUTE_MAX_PITCH, dev)); - //CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.textureAlign, CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT, dev)); - //#if CUDA_VERSION >= 2020 - //CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.kernelExecTimeoutEnabled, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT,dev)); CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.integrated, hipDeviceAttributeIntegrated, dev)); - //CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.canMapHostMemory, CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, dev)); - //#endif - //#if CUDA_VERSION >= 3010 prop.concurrentKernels = hip_prop.concurrentKernels; - //CU_SAFE_CALL_NS(hipDeviceGetAttribute(&prop.ECCEnabled, CU_DEVICE_ATTRIBUTE_ECC_ENABLED, dev)); - //#endif _properties.push_back(prop); } @@ -447,13 +438,11 @@ void UCL_Device::clear() { // List all devices along with all properties void UCL_Device::print_all(std::ostream &out) { - //#if CUDA_VERSION >= 2020 int driver_version; hipDriverGetVersion(&driver_version); out << "Driver Version: " << driver_version/1000 << "." << driver_version%100 << std::endl; - //#endif if (num_devices() == 0) out << "There is no device supporting HIP\n"; @@ -470,12 +459,10 @@ void UCL_Device::print_all(std::ostream &out) { out << "No\n"; out << " Total amount of global memory: " << gigabytes(i) << " GB\n"; - //#if CUDA_VERSION >= 2000 out << " Number of compute units/multiprocessors: " << _properties[i].multiProcessorCount << std::endl; out << " Number of cores: " << cores(i) << std::endl; - //#endif out << " Total amount of constant memory: " << _properties[i].totalConstantMemory << " bytes\n"; out << " Total amount of local/shared memory per block: " @@ -494,58 +481,29 @@ void UCL_Device::print_all(std::ostream &out) { << _properties[i].maxGridSize[0] << " x " << _properties[i].maxGridSize[1] << " x " << _properties[i].maxGridSize[2] << std::endl; - //out << " Maximum memory pitch: " - // << max_pitch(i) << " bytes\n"; - //out << " Texture alignment: " - // << _properties[i].textureAlign << " bytes\n"; out << " Clock rate: " << clock_rate(i) << " GHz\n"; - //#if CUDA_VERSION >= 2020 - //out << " Run time limit on kernels: "; - //if (_properties[i].kernelExecTimeoutEnabled) - // out << "Yes\n"; - //else - // out << "No\n"; out << " Integrated: "; if (_properties[i].integrated) out << "Yes\n"; else out << "No\n"; - //out << " Support host page-locked memory mapping: "; - //if (_properties[i].canMapHostMemory) - // out << "Yes\n"; - //else - // out << "No\n"; out << " Compute mode: "; if (_properties[i].computeMode == hipComputeModeDefault) out << "Default\n"; // multiple threads can use device -//#if CUDA_VERSION >= 8000 -// else if (_properties[i].computeMode == hipComputeModeExclusiveProcess) -//#else else if (_properties[i].computeMode == hipComputeModeExclusive) -//#endif out << "Exclusive\n"; // only thread can use device else if (_properties[i].computeMode == hipComputeModeProhibited) out << "Prohibited\n"; // no thread can use device - //#if CUDART_VERSION >= 4000 else if (_properties[i].computeMode == hipComputeModeExclusiveProcess) out << "Exclusive Process\n"; // multiple threads 1 process - //#endif else out << "Unknown\n"; - //#endif - //#if CUDA_VERSION >= 3010 out << " Concurrent kernel execution: "; if (_properties[i].concurrentKernels) out << "Yes\n"; else out << "No\n"; - //out << " Device has ECC support enabled: "; - //if (_properties[i].ECCEnabled) - // out << "Yes\n"; - //else - // out << "No\n"; - //#endif } } diff --git a/lib/gpu/geryon/hip_macros.h b/lib/gpu/geryon/hip_macros.h index 9c9971b896..96313ec87e 100644 --- a/lib/gpu/geryon/hip_macros.h +++ b/lib/gpu/geryon/hip_macros.h @@ -5,11 +5,7 @@ #include #include -//#if CUDA_VERSION >= 3020 #define CUDA_INT_TYPE size_t -//#else -//#define CUDA_INT_TYPE unsigned -//#endif #ifdef MPI_GERYON #include "mpi.h" diff --git a/lib/gpu/geryon/hip_texture.h b/lib/gpu/geryon/hip_texture.h index eb27c7a1ed..3e8c56a4e4 100644 --- a/lib/gpu/geryon/hip_texture.h +++ b/lib/gpu/geryon/hip_texture.h @@ -71,9 +71,6 @@ class UCL_Texture { /// Make a texture reference available to kernel inline void allow(UCL_Kernel &) { - //#if CUDA_VERSION < 4000 - //CU_SAFE_CALL(cuParamSetTexRef(kernel._kernel, CU_PARAM_TR_DEFAULT, _tex)); - //#endif } private: diff --git a/lib/gpu/geryon/nvd_device.h b/lib/gpu/geryon/nvd_device.h index d5963fd39f..80414c9873 100644 --- a/lib/gpu/geryon/nvd_device.h +++ b/lib/gpu/geryon/nvd_device.h @@ -320,6 +320,9 @@ class UCL_Device { // Grabs the properties for all devices UCL_Device::UCL_Device() { +#if CUDA_VERSION < 8000 +#error CUDA Toolkit version 8 or later required +#endif CU_SAFE_CALL_NS(cuInit(0)); CU_SAFE_CALL_NS(cuDeviceGetCount(&_num_devices)); for (int i=0; i<_num_devices; ++i) { @@ -358,16 +361,12 @@ UCL_Device::UCL_Device() { CU_SAFE_CALL_NS(cuDeviceGetAttribute(&prop.clockRate, CU_DEVICE_ATTRIBUTE_CLOCK_RATE, dev)); CU_SAFE_CALL_NS(cuDeviceGetAttribute(&prop.textureAlign, CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT, dev)); - #if CUDA_VERSION >= 2020 CU_SAFE_CALL_NS(cuDeviceGetAttribute(&prop.kernelExecTimeoutEnabled, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT,dev)); CU_SAFE_CALL_NS(cuDeviceGetAttribute(&prop.integrated, CU_DEVICE_ATTRIBUTE_INTEGRATED, dev)); CU_SAFE_CALL_NS(cuDeviceGetAttribute(&prop.canMapHostMemory, CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, dev)); CU_SAFE_CALL_NS(cuDeviceGetAttribute(&prop.computeMode, CU_DEVICE_ATTRIBUTE_COMPUTE_MODE,dev)); - #endif - #if CUDA_VERSION >= 3010 CU_SAFE_CALL_NS(cuDeviceGetAttribute(&prop.concurrentKernels, CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS, dev)); CU_SAFE_CALL_NS(cuDeviceGetAttribute(&prop.ECCEnabled, CU_DEVICE_ATTRIBUTE_ECC_ENABLED, dev)); - #endif _properties.push_back(prop); } @@ -415,13 +414,10 @@ void UCL_Device::clear() { // List all devices along with all properties void UCL_Device::print_all(std::ostream &out) { - #if CUDA_VERSION >= 2020 int driver_version; cuDriverGetVersion(&driver_version); out << "CUDA Driver Version: " - << driver_version/1000 << "." << driver_version%100 - << std::endl; - #endif + << driver_version/1000 << "." << driver_version%100 << std::endl; if (num_devices() == 0) out << "There is no device supporting CUDA\n"; @@ -438,12 +434,10 @@ void UCL_Device::print_all(std::ostream &out) { out << "No\n"; out << " Total amount of global memory: " << gigabytes(i) << " GB\n"; - #if CUDA_VERSION >= 2000 out << " Number of compute units/multiprocessors: " << _properties[i].multiProcessorCount << std::endl; out << " Number of cores: " << cores(i) << std::endl; - #endif out << " Total amount of constant memory: " << _properties[i].totalConstantMemory << " bytes\n"; out << " Total amount of local/shared memory per block: " @@ -468,7 +462,6 @@ void UCL_Device::print_all(std::ostream &out) { << _properties[i].textureAlign << " bytes\n"; out << " Clock rate: " << clock_rate(i) << " GHz\n"; - #if CUDA_VERSION >= 2020 out << " Run time limit on kernels: "; if (_properties[i].kernelExecTimeoutEnabled) out << "Yes\n"; @@ -487,22 +480,14 @@ void UCL_Device::print_all(std::ostream &out) { out << " Compute mode: "; if (_properties[i].computeMode == CU_COMPUTEMODE_DEFAULT) out << "Default\n"; // multiple threads can use device -#if CUDA_VERSION >= 8000 else if (_properties[i].computeMode == CU_COMPUTEMODE_EXCLUSIVE_PROCESS) -#else - else if (_properties[i].computeMode == CU_COMPUTEMODE_EXCLUSIVE) -#endif out << "Exclusive\n"; // only thread can use device else if (_properties[i].computeMode == CU_COMPUTEMODE_PROHIBITED) out << "Prohibited\n"; // no thread can use device - #if CUDART_VERSION >= 4000 else if (_properties[i].computeMode == CU_COMPUTEMODE_EXCLUSIVE_PROCESS) out << "Exclusive Process\n"; // multiple threads 1 process - #endif else out << "Unknown\n"; - #endif - #if CUDA_VERSION >= 3010 out << " Concurrent kernel execution: "; if (_properties[i].concurrentKernels) out << "Yes\n"; @@ -513,7 +498,6 @@ void UCL_Device::print_all(std::ostream &out) { out << "Yes\n"; else out << "No\n"; - #endif } } diff --git a/lib/gpu/geryon/nvd_kernel.h b/lib/gpu/geryon/nvd_kernel.h index 798b12e53c..55ba5a8f47 100644 --- a/lib/gpu/geryon/nvd_kernel.h +++ b/lib/gpu/geryon/nvd_kernel.h @@ -165,17 +165,11 @@ class UCL_Program { class UCL_Kernel { public: UCL_Kernel() : _dimensions(1), _num_args(0) { - #if CUDA_VERSION < 4000 - _param_size=0; - #endif _num_blocks[0]=0; } UCL_Kernel(UCL_Program &program, const char *function) : _dimensions(1), _num_args(0) { - #if CUDA_VERSION < 4000 - _param_size=0; - #endif _num_blocks[0]=0; set_function(program,function); _cq=program._cq; @@ -211,11 +205,7 @@ class UCL_Kernel { if (index==_num_args) add_arg(arg); else if (index<_num_args) - #if CUDA_VERSION >= 4000 _kernel_args[index]=arg; - #else - CU_SAFE_CALL(cuParamSetv(_kernel, _offsets[index], arg, sizeof(dtype))); - #endif else assert(0==1); // Must add kernel parameters in sequential order } @@ -242,15 +232,7 @@ class UCL_Kernel { /// Add a kernel argument. inline void add_arg(const CUdeviceptr* const arg) { - #if CUDA_VERSION >= 4000 _kernel_args[_num_args]=(void *)arg; - #else - void* ptr = (void*)(size_t)(*arg); - _param_size = (_param_size + __alignof(ptr) - 1) & ~(__alignof(ptr) - 1); - CU_SAFE_CALL(cuParamSetv(_kernel, _param_size, &ptr, sizeof(ptr))); - _offsets.push_back(_param_size); - _param_size+=sizeof(ptr); - #endif _num_args++; if (_num_args>UCL_MAX_KERNEL_ARGS) assert(0==1); } @@ -258,14 +240,7 @@ class UCL_Kernel { /// Add a kernel argument. template inline void add_arg(const dtype* const arg) { - #if CUDA_VERSION >= 4000 _kernel_args[_num_args]=const_cast(arg); - #else - _param_size = (_param_size+__alignof(dtype)-1) & ~(__alignof(dtype)-1); - CU_SAFE_CALL(cuParamSetv(_kernel,_param_size,(void*)arg,sizeof(dtype))); - _offsets.push_back(_param_size); - _param_size+=sizeof(dtype); - #endif _num_args++; if (_num_args>UCL_MAX_KERNEL_ARGS) assert(0==1); } @@ -298,13 +273,9 @@ class UCL_Kernel { _num_blocks[0]=num_blocks; _num_blocks[1]=1; _num_blocks[2]=1; - #if CUDA_VERSION >= 4000 _block_size[0]=block_size; _block_size[1]=1; _block_size[2]=1; - #else - CU_SAFE_CALL(cuFuncSetBlockShape(_kernel,block_size,1,1)); - #endif } /// Set the number of thread blocks and the number of threads in each block @@ -323,13 +294,9 @@ class UCL_Kernel { _num_blocks[0]=num_blocks_x; _num_blocks[1]=num_blocks_y; _num_blocks[2]=1; - #if CUDA_VERSION >= 4000 _block_size[0]=block_size_x; _block_size[1]=block_size_y; _block_size[2]=1; - #else - CU_SAFE_CALL(cuFuncSetBlockShape(_kernel,block_size_x,block_size_y,1)); - #endif } /// Set the number of thread blocks and the number of threads in each block @@ -350,14 +317,9 @@ class UCL_Kernel { _num_blocks[0]=num_blocks_x; _num_blocks[1]=num_blocks_y; _num_blocks[2]=1; - #if CUDA_VERSION >= 4000 _block_size[0]=block_size_x; _block_size[1]=block_size_y; _block_size[2]=block_size_z; - #else - CU_SAFE_CALL(cuFuncSetBlockShape(_kernel,block_size_x,block_size_y, - block_size_z)); - #endif } /// Set the number of thread blocks and the number of threads in each block @@ -373,23 +335,14 @@ class UCL_Kernel { /// Run the kernel in the default command queue inline void run() { - #if CUDA_VERSION >= 4000 CU_SAFE_CALL(cuLaunchKernel(_kernel,_num_blocks[0],_num_blocks[1], _num_blocks[2],_block_size[0],_block_size[1], _block_size[2],0,_cq,_kernel_args,nullptr)); - #else - CU_SAFE_CALL(cuParamSetSize(_kernel,_param_size)); - CU_SAFE_CALL(cuLaunchGridAsync(_kernel,_num_blocks[0],_num_blocks[1],_cq)); - #endif } /// Clear any arguments associated with the kernel inline void clear_args() { _num_args=0; - #if CUDA_VERSION < 4000 - _offsets.clear(); - _param_size=0; - #endif } /// Return the default command queue/stream associated with this data @@ -406,13 +359,8 @@ class UCL_Kernel { unsigned _num_args; friend class UCL_Texture; - #if CUDA_VERSION >= 4000 unsigned _block_size[3]; void * _kernel_args[UCL_MAX_KERNEL_ARGS]; - #else - std::vector _offsets; - unsigned _param_size; - #endif }; } // namespace diff --git a/lib/gpu/geryon/nvd_macros.h b/lib/gpu/geryon/nvd_macros.h index 08ff84991a..5c1f7f25d5 100644 --- a/lib/gpu/geryon/nvd_macros.h +++ b/lib/gpu/geryon/nvd_macros.h @@ -5,11 +5,7 @@ #include #include -#if CUDA_VERSION >= 3020 #define CUDA_INT_TYPE size_t -#else -#define CUDA_INT_TYPE unsigned -#endif #ifdef MPI_GERYON #include "mpi.h" diff --git a/lib/gpu/geryon/nvd_texture.h b/lib/gpu/geryon/nvd_texture.h index d7d65da903..96e1991859 100644 --- a/lib/gpu/geryon/nvd_texture.h +++ b/lib/gpu/geryon/nvd_texture.h @@ -69,9 +69,6 @@ class UCL_Texture { /// Make a texture reference available to kernel inline void allow(UCL_Kernel &kernel) { - #if CUDA_VERSION < 4000 - CU_SAFE_CALL(cuParamSetTexRef(kernel._kernel, CU_PARAM_TR_DEFAULT, _tex)); - #endif } private: diff --git a/lib/gpu/geryon/ucl_get_devices.cpp b/lib/gpu/geryon/ucl_get_devices.cpp index 994554a252..0982e96680 100644 --- a/lib/gpu/geryon/ucl_get_devices.cpp +++ b/lib/gpu/geryon/ucl_get_devices.cpp @@ -41,7 +41,7 @@ using namespace ucl_cudart; using namespace ucl_hip; #endif -int main(int argc, char** argv) { +int main(int /*argc*/, char** /*argv*/) { UCL_Device cop; std::cout << "Found " << cop.num_platforms() << " platform(s).\n"; if (cop.num_platforms()>0) diff --git a/lib/gpu/geryon/ucl_nv_kernel.h b/lib/gpu/geryon/ucl_nv_kernel.h index 437631ec3a..99cd640627 100644 --- a/lib/gpu/geryon/ucl_nv_kernel.h +++ b/lib/gpu/geryon/ucl_nv_kernel.h @@ -25,21 +25,8 @@ #ifndef UCL_NV_KERNEL_H #define UCL_NV_KERNEL_H -#if (__CUDA_ARCH__ < 200) -#define mul24 __mul24 -#define MEM_THREADS 16 -#else #define mul24(X,Y) (X)*(Y) #define MEM_THREADS 32 -#endif - -#ifdef CUDA_PRE_THREE -struct __builtin_align__(16) _double4 -{ - double x, y, z, w; -}; -typedef struct _double4 double4; -#endif #define GLOBAL_ID_X threadIdx.x+mul24(blockIdx.x,blockDim.x) #define GLOBAL_ID_Y threadIdx.y+mul24(blockIdx.y,blockDim.y) diff --git a/lib/gpu/lal_answer.cpp b/lib/gpu/lal_answer.cpp index e3d4e71b15..361c340ec7 100644 --- a/lib/gpu/lal_answer.cpp +++ b/lib/gpu/lal_answer.cpp @@ -94,13 +94,13 @@ bool AnswerT::init(const int inum, const bool charge, const bool rot, template bool AnswerT::add_fields(const bool charge, const bool rot) { bool realloc=false; - if (charge && _charge==false) { + if (charge && !_charge) { _charge=true; _e_fields++; _ev_fields++; realloc=true; } - if (rot && _rot==false) { + if (rot && !_rot) { _rot=true; realloc=true; } @@ -163,10 +163,8 @@ void AnswerT::copy_answers(const bool eflag, const bool vflag, #endif int csize=_ev_fields; - if (!eflag) - csize-=_e_fields; - if (!vflag) - csize-=6; + if (!eflag) csize-=_e_fields; + if (!vflag) csize-=6; if (csize>0) engv.update_host(_ev_stride*csize,true); @@ -192,8 +190,7 @@ void AnswerT::copy_answers(const bool eflag, const bool vflag, template double AnswerT::energy_virial(double *eatom, double **vatom, double *virial) { - if (_eflag==false && _vflag==false) - return 0.0; + if (!_eflag && !_vflag) return 0.0; double evdwl=0.0; int vstart=0; @@ -241,11 +238,9 @@ double AnswerT::energy_virial(double *eatom, double **vatom, template double AnswerT::energy_virial(double *eatom, double **vatom, double *virial, double &ecoul) { - if (_eflag==false && _vflag==false) - return 0.0; + if (!_eflag && !_vflag) return 0.0; - if (_charge==false) - return energy_virial(eatom,vatom,virial); + if (!_charge) return energy_virial(eatom,vatom,virial); double evdwl=0.0; int vstart=0, iend=_ev_stride; @@ -305,8 +300,8 @@ void AnswerT::get_answers(double **f, double **tor) { if (_ilist==nullptr) { typedef struct { double x,y,z; } vec3d; typedef struct { acctyp x,y,z,w; } vec4d_t; - vec3d *fp=reinterpret_cast(&(f[0][0])); - vec4d_t *forcep=reinterpret_cast(&(force[0])); + auto fp=reinterpret_cast(&(f[0][0])); + auto forcep=reinterpret_cast(&(force[0])); #if (LAL_USE_OMP == 1) #pragma omp parallel @@ -329,8 +324,8 @@ void AnswerT::get_answers(double **f, double **tor) { fp[i].z+=forcep[i].z; } if (_rot) { - vec3d *torp=reinterpret_cast(&(tor[0][0])); - vec4d_t *torquep=reinterpret_cast(&(force[_inum*4])); + auto torp=reinterpret_cast(&(tor[0][0])); + auto torquep=reinterpret_cast(&(force[_inum*4])); for (int i=ifrom; i0) { success=success && (dev_tag.alloc(_max_atoms,*dev, diff --git a/lib/gpu/lal_device.cpp b/lib/gpu/lal_device.cpp index 93c2f4e469..7bf2caaa74 100644 --- a/lib/gpu/lal_device.cpp +++ b/lib/gpu/lal_device.cpp @@ -101,7 +101,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu, // Get the names of all nodes int name_length; char node_name[MPI_MAX_PROCESSOR_NAME]; - char *node_names = new char[MPI_MAX_PROCESSOR_NAME*_world_size]; + auto node_names = new char[MPI_MAX_PROCESSOR_NAME*_world_size]; MPI_Get_processor_name(node_name,&name_length); MPI_Allgather(&node_name,MPI_MAX_PROCESSOR_NAME,MPI_CHAR,&node_names[0], MPI_MAX_PROCESSOR_NAME,MPI_CHAR,_comm_world); @@ -201,9 +201,9 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu, unsigned best_cus = gpu->cus(0); bool type_match = (gpu->device_type(0) == type); for (int i = 1; i < gpu->num_devices(); i++) { - if (type_match==true && gpu->device_type(i)!=type) + if (type_match && gpu->device_type(i)!=type) continue; - if (type_match == false && gpu->device_type(i) == type) { + if (type_match && gpu->device_type(i) == type) { type_match = true; best_cus = gpu->cus(i); best_device = i; @@ -280,7 +280,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int ngpu, MPI_Comm_rank(_comm_gpu,&_gpu_rank); #if !defined(CUDA_PROXY) && !defined(CUDA_MPS_SUPPORT) - if (_procs_per_gpu>1 && gpu->sharing_supported(my_gpu)==false) + if (_procs_per_gpu>1 && !gpu->sharing_supported(my_gpu)) return -7; #endif @@ -400,7 +400,7 @@ int DeviceT::set_ocl_params(std::string s_config, const std::string &extra_args) _ocl_compile_string += " -DCONFIG_ID="+params[0]+ " -DSIMD_SIZE="+params[1]+ " -DMEM_THREADS="+params[2]; - if (gpu->has_shuffle_support()==false) + if (!gpu->has_shuffle_support()) _ocl_compile_string+=" -DSHUFFLE_AVAIL=0"; else _ocl_compile_string+=" -DSHUFFLE_AVAIL="+params[3]; @@ -443,7 +443,7 @@ int DeviceT::init(Answer &ans, const bool charge, const bool vel) { if (!_device_init) return -1; - if (sizeof(acctyp)==sizeof(double) && gpu->double_precision()==false) + if (sizeof(acctyp)==sizeof(double) && !gpu->double_precision()) return -5; // Counts of data transfers for timing overhead estimates @@ -480,11 +480,11 @@ int DeviceT::init(Answer &ans, const bool charge, if (vel) _data_in_estimate++; } else { - if (atom.charge()==false && charge) + if (!atom.charge() && charge) _data_in_estimate++; - if (atom.quaternion()==false && rot) + if (!atom.quaternion() && rot) _data_in_estimate++; - if (atom.velocity()==false && vel) + if (!atom.velocity() && vel) _data_in_estimate++; if (!atom.add_fields(charge,rot,gpu_nbor,gpu_nbor>0 && maxspecial,vel)) return -3; @@ -502,7 +502,7 @@ int DeviceT::init(Answer &ans, const int nlocal, const int nall) { if (!_device_init) return -1; - if (sizeof(acctyp)==sizeof(double) && gpu->double_precision()==false) + if (sizeof(acctyp)==sizeof(double) && !gpu->double_precision()) return -5; if (_init_count==0) { diff --git a/lib/gpu/lal_neighbor.cpp b/lib/gpu/lal_neighbor.cpp index 4060b13491..58476a173b 100644 --- a/lib/gpu/lal_neighbor.cpp +++ b/lib/gpu/lal_neighbor.cpp @@ -113,7 +113,7 @@ bool Neighbor::init(NeighborShared *shared, const int inum, if (!success) return false; - if (_use_packing==false) { + if (!_use_packing) { #ifndef LAL_USE_OLD_NEIGHBOR _shared->compile_kernels(devi, gpu_nbor, compile_flags+ " -DMAX_SUBGROUPS_PER_BLOCK="+toa(_block_nbor_build/_simd_size)); @@ -153,7 +153,7 @@ void Neighbor::alloc(bool &success) { int nt=_max_atoms+_max_host; if (_max_nbors) _max_nbors = ((_max_nbors-1)/_threads_per_atom+1)*_threads_per_atom; - if (_use_packing==false || _gpu_nbor>0) { + if (!_use_packing || _gpu_nbor>0) { if (_max_nbors) success=success && (dev_nbor.alloc((_max_nbors+2)*_max_atoms,*dev)==UCL_SUCCESS); @@ -166,7 +166,7 @@ void Neighbor::alloc(bool &success) { _c_bytes=dev_nbor.row_bytes(); if (_alloc_packed) { - if (_use_packing==false) { + if (!_use_packing) { dev_packed_begin.clear(); success=success && (dev_packed_begin.alloc(_max_atoms,*dev, _packed_permissions)==UCL_SUCCESS); @@ -373,7 +373,7 @@ void Neighbor::get_host(const int inum, int *ilist, int *numj, time_nbor.stop(); - if (_use_packing==false) { + if (!_use_packing) { time_kernel.start(); int GX=static_cast(ceil(static_cast(inum)*_threads_per_atom/ block_size)); @@ -450,7 +450,7 @@ void Neighbor::get_host3(const int inum, const int nlist, int *ilist, int *numj, } time_nbor.stop(); - if (_use_packing==false) { + if (!_use_packing) { time_kernel.start(); int GX=static_cast(ceil(static_cast(inum)*_threads_per_atom/ block_size)); @@ -564,7 +564,7 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum, #endif } - const numtyp cutoff_cast=static_cast(_cutoff); + const auto cutoff_cast=static_cast(_cutoff); if (_maxspecial>0) { time_nbor.start(); @@ -741,12 +741,12 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum, // If binning on GPU, do this now if (_gpu_nbor==1) { mn = _max_nbors; - const numtyp i_cell_size=static_cast(1.0/_cell_size); + const auto i_cell_size=static_cast(1.0/_cell_size); const int neigh_block=_block_cell_id; const int GX=(int)ceil((double)nall/neigh_block); - const numtyp sublo0=static_cast(sublo[0]); - const numtyp sublo1=static_cast(sublo[1]); - const numtyp sublo2=static_cast(sublo[2]); + const auto sublo0=static_cast(sublo[0]); + const auto sublo1=static_cast(sublo[1]); + const auto sublo2=static_cast(sublo[2]); _shared->k_cell_id.set_size(GX,neigh_block); _shared->k_cell_id.run(&atom.x, &atom.dev_cell_id, &atom.dev_particle_id, &sublo0, &sublo1, diff --git a/lib/gpu/lal_pppm.cpp b/lib/gpu/lal_pppm.cpp index 8f95d38532..911efe69f8 100644 --- a/lib/gpu/lal_pppm.cpp +++ b/lib/gpu/lal_pppm.cpp @@ -303,7 +303,7 @@ int PPPMT::spread(const int ago, const int nlocal, const int nall, double *host_q, double *boxlo, const double delxinv, const double delyinv, const double delzinv) { - if (_precompute_done==false) { + if (!_precompute_done) { atom->acc_timers(); _precompute(ago,nlocal,nall,host_x,host_type,success,host_q,boxlo,delxinv, delyinv,delzinv); @@ -359,7 +359,7 @@ void PPPMT::interp(const grdtyp qqrd2e_scale) { time_interp.stop(); ans->copy_answers(false,false,false,false,0); - if (_kspace_split==false) + if (!_kspace_split) device->add_ans_object(ans); } diff --git a/lib/gpu/lal_pppm_ext.cpp b/lib/gpu/lal_pppm_ext.cpp index d548b94be1..cf009b4479 100644 --- a/lib/gpu/lal_pppm_ext.cpp +++ b/lib/gpu/lal_pppm_ext.cpp @@ -101,7 +101,7 @@ float * pppm_gpu_init_f(const int nlocal, const int nall, FILE *screen, float *b=pppm_gpu_init(PPPMF,nlocal,nall,screen,order,nxlo_out,nylo_out, nzlo_out,nxhi_out,nyhi_out,nzhi_out,rho_coeff,vd_brick, slab_volfactor,nx_pppm,ny_pppm,nz_pppm,split,success); - if (split==false && respa==false) + if (!split && !respa) PPPMF.device->set_single_precompute(&PPPMF); return b; } @@ -146,7 +146,7 @@ double * pppm_gpu_init_d(const int nlocal, const int nall, FILE *screen, nzlo_out,nxhi_out,nyhi_out,nzhi_out,rho_coeff, vd_brick,slab_volfactor,nx_pppm,ny_pppm,nz_pppm, split,success); - if (split==false && respa==false) + if (!split && !respa) PPPMD.device->set_double_precompute(&PPPMD); return b; } diff --git a/lib/gpu/lal_pre_cuda_hip.h b/lib/gpu/lal_pre_cuda_hip.h index dfb6229bed..47a005b998 100644 --- a/lib/gpu/lal_pre_cuda_hip.h +++ b/lib/gpu/lal_pre_cuda_hip.h @@ -58,49 +58,6 @@ #define MAX_BIO_SHARED_TYPES 128 #define PPPM_MAX_SPLINE 8 -// ------------------------------------------------------------------------- -// LEGACY DEVICE CONFIGURATION -// ------------------------------------------------------------------------- - -#ifdef __CUDA_ARCH__ - -#if (__CUDA_ARCH__ < 200) - -#undef CONFIG_ID -#define CONFIG_ID 101 -#define MEM_THREADS 16 -#undef THREADS_PER_ATOM -#define THREADS_PER_ATOM 1 -#undef THREADS_PER_CHARGE -#define THREADS_PER_CHARGE 16 -#undef BLOCK_PAIR -#define BLOCK_PAIR 64 -#undef BLOCK_BIO_PAIR -#define BLOCK_BIO_PAIR 64 -#undef BLOCK_NBOR_BUILD -#define BLOCK_NBOR_BUILD 64 -#undef MAX_SHARED_TYPES -#define MAX_SHARED_TYPES 8 -#undef SHUFFLE_AVAIL -#define SHUFFLE_AVAIL 0 - -#elseif (__CUDA_ARCH__ < 300) - -#undef CONFIG_ID -#define CONFIG_ID 102 -#undef BLOCK_PAIR -#define BLOCK_PAIR 128 -#undef BLOCK_BIO_PAIR -#define BLOCK_BIO_PAIR 128 -#undef MAX_SHARED_TYPES -#define MAX_SHARED_TYPES 8 -#undef SHUFFLE_AVAIL -#define SHUFFLE_AVAIL 0 - -#endif - -#endif - // ------------------------------------------------------------------------- // KERNEL MACROS // ------------------------------------------------------------------------- @@ -111,12 +68,6 @@ #define fast_mul(X,Y) (X)*(Y) -#ifdef __CUDA_ARCH__ -#if (__CUDA_ARCH__ < 200) -#define fast_mul __mul24 -#endif -#endif - #define EVFLAG 1 #define NOUNROLL #define GLOBAL_ID_X threadIdx.x+fast_mul(blockIdx.x,blockDim.x) @@ -220,14 +171,6 @@ // KERNEL MACROS - MATH // ------------------------------------------------------------------------- -#ifdef CUDA_PRE_THREE -struct __builtin_align__(16) _double4 -{ - double x, y, z, w; -}; -typedef struct _double4 double4; -#endif - #ifdef _DOUBLE_DOUBLE #define ucl_exp exp diff --git a/lib/gpu/lal_yukawa_colloid.cpp b/lib/gpu/lal_yukawa_colloid.cpp index a447bb3889..e73a72c79e 100644 --- a/lib/gpu/lal_yukawa_colloid.cpp +++ b/lib/gpu/lal_yukawa_colloid.cpp @@ -69,7 +69,7 @@ int YukawaColloidT::init(const int ntypes, _max_rad_size=static_cast(static_cast(ef_nall)*1.10); - if (_shared_view==false) + if (!_shared_view) c_rad.alloc(_max_rad_size,*(this->ucl_device),UCL_WRITE_ONLY,UCL_READ_ONLY); rad_tex.get_texture(*(this->pair_program),"rad_tex"); @@ -157,7 +157,7 @@ void YukawaColloidT::compute(const int f_ago, const int inum_full, if (nall>_max_rad_size) { _max_rad_size=static_cast(static_cast(nall)*1.10); - if (_shared_view==false) { + if (!_shared_view) { c_rad.resize(_max_rad_size); rad_tex.bind_float(c_rad,1); } @@ -229,7 +229,7 @@ int** YukawaColloidT::compute(const int ago, const int inum_full, if (nall>_max_rad_size) { _max_rad_size=static_cast(static_cast(nall)*1.10); - if (_shared_view==false) { + if (!_shared_view) { c_rad.resize(_max_rad_size); rad_tex.bind_float(c_rad,1); } diff --git a/lib/mdi/Install.py b/lib/mdi/Install.py index d67437d0ce..a439da34d2 100644 --- a/lib/mdi/Install.py +++ b/lib/mdi/Install.py @@ -34,13 +34,12 @@ make lib-meam args="-m ifort" # build MEAM lib with custom Makefile.ifort (usi # settings -version = "1.2.9" +version = "1.3.2" url = "https://github.com/MolSSI-MDI/MDI_Library/archive/v%s.tar.gz" % version # known checksums for different MDI versions. used to validate the download. checksums = { \ - '1.2.7' : '2f3177b30ccdbd6ae28ea3bdd5fed0db', \ - '1.2.9' : 'ddfa46d6ee15b4e59cfd527ec7212184', \ + '1.3.2' : '836f5da400d8cff0f0e4435640f9454f', \ } # print error message or help diff --git a/lib/message/Install.py b/lib/message/Install.py deleted file mode 100644 index 0aa433d6ec..0000000000 --- a/lib/message/Install.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python - -""" -Install.py tool to build the CSlib library -used to automate the steps described in the README file in this dir -""" - -from __future__ import print_function -import sys, os, subprocess, shutil -from argparse import ArgumentParser - -sys.path.append('..') -from install_helpers import fullpath - -parser = ArgumentParser(prog='Install.py', - description="LAMMPS library build wrapper script") - -# help message - -HELP = """ -Syntax from src dir: make lib-message args="-m" - or: make lib-message args="-s -z" -Syntax from lib dir: python Install.py -m - or: python Install.py -s -z - -Example: - -make lib-message args="-m -z" # build parallel CSlib with ZMQ support -make lib-message args="-s" # build serial CSlib with no ZMQ support -""" - -pgroup = parser.add_mutually_exclusive_group() -pgroup.add_argument("-m", "--mpi", action="store_true", - help="parallel build of CSlib with MPI") -pgroup.add_argument("-s", "--serial", action="store_true", - help="serial build of CSlib") -parser.add_argument("-z", "--zmq", default=False, action="store_true", - help="build CSlib with ZMQ socket support, default ()") - -args = parser.parse_args() - -# print help message and exit, if neither build nor path options are given -if not args.mpi and not args.serial: - parser.print_help() - sys.exit(HELP) - -mpiflag = args.mpi -serialflag = args.serial -zmqflag = args.zmq - -# build CSlib -# copy resulting lib to cslib/src/libmessage.a -# copy appropriate Makefile.lammps.* to Makefile.lammps - -print("Building CSlib ...") -srcdir = fullpath(os.path.join("cslib", "src")) - -if mpiflag and zmqflag: - cmd = "make -C %s lib_parallel" % srcdir -elif mpiflag and not zmqflag: - cmd = "make -C %s lib_parallel zmq=no" % srcdir -elif not mpiflag and zmqflag: - cmd = "make -C %s lib_serial" % srcdir -elif not mpiflag and not zmqflag: - cmd = "make -C %s lib_serial zmq=no" % srcdir - -print(cmd) -try: - txt = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) - print(txt.decode('UTF-8')) -except subprocess.CalledProcessError as e: - print("Make failed with:\n %s" % e.output.decode('UTF-8')) - sys.exit(1) - -slb = os.path.join(srcdir, "libcsnompi.a") -if mpiflag: - slb = os.path.join(srcdir, "libcsmpi.a") -shutil.copyfile(slb, os.path.join(srcdir, "libmessage.a")) - -smk = "Makefile.lammps.nozmq" -if zmqflag: - smk = "Makefile.lammps.zmq" -shutil.copyfile(smk, "Makefile.lammps") -print("Using %s for Makefile.lammps" % smk) diff --git a/lib/message/Makefile.lammps.nozmq b/lib/message/Makefile.lammps.nozmq deleted file mode 100644 index 1bb10cc988..0000000000 --- a/lib/message/Makefile.lammps.nozmq +++ /dev/null @@ -1,5 +0,0 @@ -# Settings that the LAMMPS build will import when this package library is used - -message_SYSINC = -message_SYSLIB = -message_SYSPATH = diff --git a/lib/message/Makefile.lammps.zmq b/lib/message/Makefile.lammps.zmq deleted file mode 100644 index 759f2ce04b..0000000000 --- a/lib/message/Makefile.lammps.zmq +++ /dev/null @@ -1,5 +0,0 @@ -# Settings that the LAMMPS build will import when this package library is used - -message_SYSINC = -message_SYSLIB = -lzmq -message_SYSPATH = diff --git a/lib/message/README b/lib/message/README deleted file mode 100644 index e6e7d2103d..0000000000 --- a/lib/message/README +++ /dev/null @@ -1,51 +0,0 @@ -This directory contains the CSlib library which is required -to use the MESSAGE package and its client/server commands -in a LAMMPS input script. - -The CSlib library is included in the LAMMPS distribution. A fuller -version including documentation and test programs is available at -http://cslib.sandia.gov. It was developed by Steve Plimpton at Sandia -National Laboratories. - -You can type "make lib-message" from the src directory to see help on -how to build this library via make commands, or you can do the same -thing by typing "python Install.py" from within this directory, or you -can do it manually by following the instructions below. - -The CSlib can be optionally built with support for sockets using -the open-source ZeroMQ (ZMQ) library. If it is not installed -on your system, it is easy to download and install. - -Go to the ZMQ website for details: http://zeromq.org - ------------------ - -Instructions: - -1. Compile CSlib from within cslib/src with one of the following: - % make lib_parallel # build parallel library with ZMQ socket support - % make lib_serial # build serial library with ZMQ support - % make lib_parallel zmq=no # build parallel lib with no ZMQ support - % make lib_serial zmq=no # build serial lib with no ZMQ support - -2. Copy the produced cslib/src/libcsmpi.a or libscnompi.a file to - cslib/src/libmessage.a - -3. Copy either lib/message/Makefile.lammps.zmq or Makefile.lammps.nozmq - to lib/message/Makefile.lammps, depending on whether you - build the library with ZMQ support or not. - If your ZMQ library is not in a place your shell path finds, - you can set the INCLUDE and PATH variables in Makefile.lammps - to point to the dirs where the ZMQ include and library files are. - ------------------ - -When these steps are complete you can build LAMMPS -with the MESSAGAE package installed: - -% cd lammps/src -% make yes-message -% make mpi (or whatever target you wish) - -Note that if you download and unpack a new LAMMPS tarball, you will -need to re-build the CSlib in this dir. diff --git a/lib/message/cslib/LICENSE b/lib/message/cslib/LICENSE deleted file mode 100644 index 7a36e21daf..0000000000 --- a/lib/message/cslib/LICENSE +++ /dev/null @@ -1,32 +0,0 @@ -Program: CSlib client/server coupling library - -Copyright 2018 National Technology & Engineering Solutions of Sandia, -LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the -U.S. Government retains certain rights in this software. This -software is distributed under the modified Berkeley Software -Distribution (BSD) License. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of Sandia Corporation nor the names of contributors - to this software may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/message/cslib/README b/lib/message/cslib/README deleted file mode 100644 index 37f4a97d54..0000000000 --- a/lib/message/cslib/README +++ /dev/null @@ -1,23 +0,0 @@ -This is the the Client/Server messaging library (CSlib). - -Only the source directory and license file are included here as part -of the LAMMPS distribution. The full CSlib distribution, including -documentation and test codes, can be found at the website: -http://cslib.sandia.gov (as of Aug 2018). - -The contact author is - -Steve Plimpton -Sandia National Laboratories -sjplimp@sandia.gov -http://www.sandia.gov/~sjplimp - -The CSlib is distributed as open-source code under the modified -Berkeley Software Distribution (BSD) License. See the accompanying -LICENSE file. - -This directory contains the following: - -README this file -LICENSE GNU LGPL license -src source files for library diff --git a/lib/message/cslib/src/Makefile b/lib/message/cslib/src/Makefile deleted file mode 100644 index 83cf902220..0000000000 --- a/lib/message/cslib/src/Makefile +++ /dev/null @@ -1,107 +0,0 @@ -# Makefile for CSlib = client/server messaging library -# type "make help" for options - -SHELL = /bin/sh - -# ---------------------------------------- -# should only need to change this section -# compiler/linker settings -# ---------------------------------------- - -CC = g++ -CCFLAGS = -g -O3 -DZMQ_$(ZMQ) -DMPI_$(MPI) -SHFLAGS = -fPIC -ARCHIVE = ar -ARCHFLAGS = -rc -SHLIBFLAGS = -shared - -# files - -LIB = libcsmpi.a -SHLIB = libcsmpi.so -SRC = $(wildcard *.cpp) -INC = $(wildcard *.h) -OBJ = $(SRC:.cpp=.o) - -# build with ZMQ support or not - -zmq = yes -ZMQ = $(shell echo $(zmq) | tr a-z A-Z) - -ifeq ($(ZMQ),YES) - ZMQLIB = -lzmq -else - CCFLAGS += -I./STUBS_ZMQ -endif - -# build with MPI support or not - -mpi = yes -MPI = $(shell echo $(mpi) | tr a-z A-Z) - -ifeq ($(MPI),YES) - CC = mpicxx -else - CCFLAGS += -I./STUBS_MPI - LIB = libcsnompi.a - SHLIB = libcsnompi.so -endif - -# targets - -shlib: shlib_parallel shlib_serial - -lib: lib_parallel lib_serial - -all: shlib lib - -help: - @echo 'make default = shlib' - @echo 'make shlib build 2 shared CSlibs: parallel & serial' - @echo 'make lib build 2 static CSlibs: parallel & serial' - @echo 'make all build 4 CSlibs: shlib and lib' - @echo 'make shlib_parallel build shared parallel CSlib' - @echo 'make shlib_serial build shared serial CSlib' - @echo 'make lib_parallel build static parallel CSlib' - @echo 'make lib_serial build static serial CSlib' - @echo 'make ... zmq=no build w/out ZMQ support' - @echo 'make clean remove all *.o files' - @echo 'make clean-all remove *.o and lib files' - @echo 'make tar create a tarball, 2 levels up' - -shlib_parallel: - $(MAKE) clean - $(MAKE) shared zmq=$(zmq) mpi=yes - -shlib_serial: - $(MAKE) clean - $(MAKE) shared zmq=$(zmq) mpi=no - -lib_parallel: - $(MAKE) clean - $(MAKE) static zmq=$(zmq) mpi=yes - -lib_serial: - $(MAKE) clean - $(MAKE) static zmq=$(zmq) mpi=no - -static: $(OBJ) - $(ARCHIVE) $(ARCHFLAGS) $(LIB) $(OBJ) - -shared: $(OBJ) - $(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) -o $(SHLIB) $(OBJ) $(ZMQLIB) - -clean: - @rm -f *.o *.pyc - -clean-all: - @rm -f *.o *.pyc lib*.a lib*.so - -tar: - cd ../..; tar cvf cslib.tar cslib/README cslib/LICENSE \ - cslib/doc cslib/src cslib/test - -# rules - -%.o:%.cpp - $(CC) $(CCFLAGS) $(SHFLAGS) -c $< diff --git a/lib/message/cslib/src/STUBS_MPI/mpi_dummy.h b/lib/message/cslib/src/STUBS_MPI/mpi_dummy.h deleted file mode 100644 index 0c18c97d28..0000000000 --- a/lib/message/cslib/src/STUBS_MPI/mpi_dummy.h +++ /dev/null @@ -1,96 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - http://cslib.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -// MPI constants and dummy functions - -#ifndef MPI_DUMMY_H -#define MPI_DUMMY_H - -#include -#include -#include - -namespace CSLIB_NS { - -typedef int MPI_Comm; -typedef int MPI_Fint; -typedef int MPI_Datatype; -typedef int MPI_Status; -typedef int MPI_Op; -typedef int MPI_Info; - -#define MPI_COMM_WORLD 0 -#define MPI_MAX_PORT_NAME 0 -#define MPI_INFO_NULL 0 -#define MPI_INT 1 -#define MPI_LONG_LONG 2 -#define MPI_FLOAT 3 -#define MPI_DOUBLE 4 -#define MPI_CHAR 5 -#define MPI_SUM 0 - -static void MPI_Init(int *, char ***) {} -static MPI_Comm MPI_Comm_f2c(MPI_Comm world) {return world;} -static void MPI_Comm_rank(MPI_Comm, int *) {} -static void MPI_Comm_size(MPI_Comm, int *) {} - -static void MPI_Open_port(MPI_Info, char *) {} -static void MPI_Close_port(const char *) {} -static void MPI_Comm_accept(const char *, MPI_Info, int, - MPI_Comm, MPI_Comm *) {} -static void MPI_Comm_connect(const char *, MPI_Info, int, - MPI_Comm, MPI_Comm *) {} - -static void MPI_Comm_split(MPI_Comm, int, int, MPI_Comm *) {} -static void MPI_Comm_free(MPI_Comm *) {} - -static void MPI_Send(const void *, int, MPI_Datatype, int, int, MPI_Comm) {} -static void MPI_Recv(void *, int, MPI_Datatype, int, int, - MPI_Comm, MPI_Status *) {} - -static void MPI_Allreduce(const void *in, void *out, int, MPI_Datatype type, - MPI_Op op, MPI_Comm) -{ - if (type == MPI_INT) *((int *) out) = *((int *) in); -} -static void MPI_Scan(const void *in, void *out, int, MPI_Datatype intype, - MPI_Op op,MPI_Comm) -{ - if (intype == MPI_INT) *((int *) out) = *((int *) in); -} - -static void MPI_Bcast(void *, int, MPI_Datatype, int, MPI_Comm) {} -static void MPI_Allgather(const void *in, int incount, MPI_Datatype intype, - void *out, int, MPI_Datatype, MPI_Comm) -{ - // assuming incount = 1 - if (intype == MPI_INT) *((int *) out) = *((int *) in); -} -static void MPI_Allgatherv(const void *in, int incount, MPI_Datatype intype, - void *out, const int *, const int *, - MPI_Datatype, MPI_Comm) -{ - if (intype == MPI_INT) memcpy(out,in,incount*sizeof(int)); - else if (intype == MPI_LONG_LONG) memcpy(out,in,incount*sizeof(int64_t)); - else if (intype == MPI_FLOAT) memcpy(out,in,incount*sizeof(float)); - else if (intype == MPI_DOUBLE) memcpy(out,in,incount*sizeof(double)); - else if (intype == MPI_CHAR) memcpy(out,in,incount*sizeof(char)); -} - -static void MPI_Abort(MPI_Comm, int) {exit(1);} -static void MPI_Finalize() {} - -} - -#endif diff --git a/lib/message/cslib/src/STUBS_ZMQ/zmq.h b/lib/message/cslib/src/STUBS_ZMQ/zmq.h deleted file mode 100644 index 98cb937ed1..0000000000 --- a/lib/message/cslib/src/STUBS_ZMQ/zmq.h +++ /dev/null @@ -1,38 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - http://cslib.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -// ZMQ constants and dummy functions - -#ifndef ZMQ_DUMMY_H -#define ZMQ_DUMMY_H - -#include - -namespace CSLIB_NS { - -#define ZMQ_REQ 0 -#define ZMQ_REP 0 - -static void *zmq_ctx_new() {return nullptr;} -static void *zmq_connect(void *, char *) {return nullptr;} -static int zmq_bind(void *, char *) {return 0;} -static void *zmq_socket(void *,int) {return nullptr;} -static void zmq_close(void *) {} -static void zmq_ctx_destroy(void *) {} -static void zmq_send(void *, void *, int, int) {} -static void zmq_recv(void *, void *, int, int) {} - -}; - -#endif diff --git a/lib/message/cslib/src/cslib.cpp b/lib/message/cslib/src/cslib.cpp deleted file mode 100644 index 7e19c83f6b..0000000000 --- a/lib/message/cslib/src/cslib.cpp +++ /dev/null @@ -1,773 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - https://cslib.sandia.gov/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -#ifdef MPI_YES -#include -#else -#include -#endif -#include -#include -#include -#include - -#include "cslib.h" -#include "msg_file.h" -#include "msg_zmq.h" -#include "msg_mpi_one.h" -#include "msg_mpi_two.h" - -using namespace CSLIB_NS; - -#define MAXTYPE 5 // # of defined field data types - -/* ---------------------------------------------------------------------- */ - -CSlib::CSlib(int csflag, const char *mode, const void *ptr, const void *pcomm) -{ - if (pcomm) myworld = (uint64_t) *((MPI_Comm *) pcomm); - else myworld = 0; - -#ifdef MPI_NO - if (pcomm) - error_all("constructor(): CSlib invoked with MPI_Comm " - "but built w/out MPI support"); -#endif -#ifdef MPI_YES // NOTE: this could be OK to allow ?? - // would allow a parallel app to invoke CSlib - // in parallel and/or in serial - if (!pcomm) - error_all("constructor(): CSlib invoked w/out MPI_Comm " - "but built with MPI support"); -#endif - - client = server = 0; - if (csflag == 0) client = 1; - else if (csflag == 1) server = 1; - else error_all("constructor(): Invalid client/server arg"); - - if (pcomm == nullptr) { - me = 0; - nprocs = 1; - - if (strcmp(mode,"file") == 0) msg = new MsgFile(csflag,ptr); - else if (strcmp(mode,"zmq") == 0) msg = new MsgZMQ(csflag,ptr); - else if (strcmp(mode,"mpi/one") == 0) - error_all("constructor(): No mpi/one mode for serial lib usage"); - else if (strcmp(mode,"mpi/two") == 0) - error_all("constructor(): No mpi/two mode for serial lib usage"); - else error_all("constructor(): Unknown mode"); - - } else if (pcomm) { - MPI_Comm world = (MPI_Comm) myworld; - MPI_Comm_rank(world,&me); - MPI_Comm_size(world,&nprocs); - - if (strcmp(mode,"file") == 0) msg = new MsgFile(csflag,ptr,world); - else if (strcmp(mode,"zmq") == 0) msg = new MsgZMQ(csflag,ptr,world); - else if (strcmp(mode,"mpi/one") == 0) msg = new MsgMPIOne(csflag,ptr,world); - else if (strcmp(mode,"mpi/two") == 0) msg = new MsgMPITwo(csflag,ptr,world); - else error_all("constructor(): Unknown mode"); - } - - maxfield = 0; - fieldID = fieldtype = fieldlen = fieldoffset = nullptr; - maxheader = 0; - header = nullptr; - maxbuf = 0; - buf = nullptr; - - recvcounts = displs = nullptr; - maxglobal = 0; - allids = nullptr; - maxfieldbytes = 0; - fielddata = nullptr; - - pad = "\0\0\0\0\0\0\0"; // just length 7 since will have trailing nullptr - - nsend = nrecv = 0; -} - -/* ---------------------------------------------------------------------- */ - -CSlib::~CSlib() -{ - deallocate_fields(); - sfree(header); - sfree(buf); - - sfree(recvcounts); - sfree(displs); - sfree(allids); - sfree(fielddata); - - delete msg; -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::send(int msgID_caller, int nfield_caller) -{ - if (nfield_caller < 0) error_all("send(): Invalid nfield"); - - msgID = msgID_caller; - nfield = nfield_caller; - allocate_fields(); - - fieldcount = 0; - nbuf = 0; - - if (fieldcount == nfield) send_message(); -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::pack_int(int id, int value) -{ - pack(id,1,1,&value); -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::pack_int64(int id, int64_t value) -{ - pack(id,2,1,&value); -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::pack_float(int id, float value) -{ - pack(id,3,1,&value); -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::pack_double(int id, double value) -{ - pack(id,4,1,&value); -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::pack_string(int id, char *value) -{ - pack(id,5,strlen(value)+1,value); -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::pack(int id, int ftype, int flen, void *data) -{ - if (find_field(id,fieldcount) >= 0) - error_all("pack(): Reuse of field ID"); - if (ftype < 1 || ftype > MAXTYPE) error_all("pack(): Invalid ftype"); - if (flen < 0) error_all("pack(): Invalid flen"); - - fieldID[fieldcount] = id; - fieldtype[fieldcount] = ftype; - fieldlen[fieldcount] = flen; - - int nbytes,nbytesround; - onefield(ftype,flen,nbytes,nbytesround); - - memcpy(&buf[nbuf],data,nbytes); - memcpy(&buf[nbuf+nbytes],pad,nbytesround-nbytes); - nbuf += nbytesround; - - fieldcount++; - if (fieldcount == nfield) send_message(); -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::pack_parallel(int id, int ftype, - int nlocal, int *ids, int nper, void *data) -{ - int i,j,k,m; - - if (find_field(id,fieldcount) >= 0) - error_all("pack_parallel(): Reuse of field ID"); - if (ftype < 1 || ftype > MAXTYPE) error_all("pack_parallel(): Invalid ftype"); - if (nlocal < 0) error_all("pack_parallel(): Invalid nlocal"); - if (nper < 1) error_all("pack_parallel(): Invalid nper"); - - MPI_Comm world = (MPI_Comm) myworld; - - // NOTE: check for overflow of maxglobal and flen - - int nglobal; - MPI_Allreduce(&nlocal,&nglobal,1,MPI_INT,MPI_SUM,world); - int flen = nper*nglobal; - - fieldID[fieldcount] = id; - fieldtype[fieldcount] = ftype; - fieldlen[fieldcount] = flen; - - // nlocal datums, each of nper length, from all procs - // final data in buf = datums for all natoms, ordered by ids - - if (recvcounts == nullptr) { - recvcounts = (int *) smalloc(nprocs*sizeof(int)); - displs = (int *) smalloc(nprocs*sizeof(int)); - } - - MPI_Allgather(&nlocal,1,MPI_INT,recvcounts,1,MPI_INT,world); - - displs[0] = 0; - for (int iproc = 1; iproc < nprocs; iproc++) - displs[iproc] = displs[iproc-1] + recvcounts[iproc-1]; - - if (ids && nglobal > maxglobal) { - sfree(allids); - maxglobal = nglobal; - // NOTE: maxglobal*sizeof(int) could overflow int - allids = (int *) smalloc(maxglobal*sizeof(int)); - } - - MPI_Allgatherv(ids,nlocal,MPI_INT,allids, - recvcounts,displs,MPI_INT,world); - - int nlocalsize = nper*nlocal; - MPI_Allgather(&nlocalsize,1,MPI_INT,recvcounts,1,MPI_INT,world); - - displs[0] = 0; - for (int iproc = 1; iproc < nprocs; iproc++) - displs[iproc] = displs[iproc-1] + recvcounts[iproc-1]; - - int nbytes,nbytesround; - onefield(ftype,flen,nbytes,nbytesround); - - if (ftype == 1) { - int *alldata; - if (ids) { - if (nbytes > maxfieldbytes) { - sfree(fielddata); - maxfieldbytes = nbytes; - fielddata = (char *) smalloc(maxfieldbytes); - } - alldata = (int *) fielddata; - } else alldata = (int *) &buf[nbuf]; - MPI_Allgatherv(data,nlocalsize,MPI_INT,alldata, - recvcounts,displs,MPI_INT,world); - if (ids) { - int *bufptr = (int *) &buf[nbuf]; - m = 0; - for (i = 0; i < nglobal; i++) { - j = (allids[i]-1) * nper; - if (nper == 1) bufptr[j] = alldata[m++]; - else - for (k = 0; k < nper; k++) - bufptr[j++] = alldata[m++]; - } - } - - } else if (ftype == 2) { - int64_t *alldata; - if (ids) { - if (nbytes > maxfieldbytes) { - sfree(fielddata); - maxfieldbytes = nbytes; - fielddata = (char *) smalloc(maxfieldbytes); - } - alldata = (int64_t *) fielddata; - } else alldata = (int64_t *) &buf[nbuf]; - // NOTE: may be just MPI_LONG on some machines - MPI_Allgatherv(data,nlocalsize,MPI_LONG_LONG,alldata, - recvcounts,displs,MPI_LONG_LONG,world); - if (ids) { - int64_t *bufptr = (int64_t *) &buf[nbuf]; - m = 0; - for (i = 0; i < nglobal; i++) { - j = (allids[i]-1) * nper; - if (nper == 1) bufptr[j] = alldata[m++]; - else - for (k = 0; k < nper; k++) - bufptr[j++] = alldata[m++]; - } - } - - } else if (ftype == 3) { - float *alldata; - if (ids) { - if (nbytes > maxfieldbytes) { - sfree(fielddata); - maxfieldbytes = nbytes; - fielddata = (char *) smalloc(maxfieldbytes); - } - alldata = (float *) fielddata; - } else alldata = (float *) &buf[nbuf]; - MPI_Allgatherv(data,nlocalsize,MPI_FLOAT,alldata, - recvcounts,displs,MPI_FLOAT,world); - if (ids) { - float *bufptr = (float *) &buf[nbuf]; - m = 0; - for (i = 0; i < nglobal; i++) { - j = (allids[i]-1) * nper; - if (nper == 1) bufptr[j] = alldata[m++]; - else - for (k = 0; k < nper; k++) - bufptr[j++] = alldata[m++]; - } - } - - } else if (ftype == 4) { - double *alldata; - if (ids) { - if (nbytes > maxfieldbytes) { - sfree(fielddata); - maxfieldbytes = nbytes; - fielddata = (char *) smalloc(maxfieldbytes); - } - alldata = (double *) fielddata; - } else alldata = (double *) &buf[nbuf]; - MPI_Allgatherv(data,nlocalsize,MPI_DOUBLE,alldata, - recvcounts,displs,MPI_DOUBLE,world); - if (ids) { - double *bufptr = (double *) &buf[nbuf]; - m = 0; - for (i = 0; i < nglobal; i++) { - j = (allids[i]-1) * nper; - if (nper == 1) bufptr[j] = alldata[m++]; - else - for (k = 0; k < nper; k++) - bufptr[j++] = alldata[m++]; - } - } - - /* eventually ftype = BYTE, but not yet - } else if (ftype == 5) { - char *alldata; - if (ids) { - if (nbytes > maxfieldbytes) { - sfree(fielddata); - maxfieldbytes = nbytes; - fielddata = (char *) smalloc(maxfieldbytes); - } - alldata = (char *) fielddata; - } else alldata = (char *) &buf[nbuf]; - MPI_Allgatherv(data,nlocalsize,MPI_CHAR,alldata, - recvcounts,displs,MPI_CHAR,world); - if (ids) { - char *bufptr = (char *) &buf[nbuf]; - m = 0; - for (i = 0; i < nglobal; i++) { - j = (allids[i]-1) * nper; - memcpy(&bufptr[j],&alldata[m],nper); - m += nper; - } - } - */ - } - - memcpy(&buf[nbuf+nbytes],pad,nbytesround-nbytes); - nbuf += nbytesround; - - fieldcount++; - if (fieldcount == nfield) send_message(); -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::send_message() -{ - // setup header message - - int m = 0; - header[m++] = msgID; - header[m++] = nfield; - for (int ifield = 0; ifield < nfield; ifield++) { - header[m++] = fieldID[ifield]; - header[m++] = fieldtype[ifield]; - header[m++] = fieldlen[ifield]; - } - - msg->send(nheader,header,nbuf,buf); - nsend++; -} - -/* ---------------------------------------------------------------------- */ - -int CSlib::recv(int &nfield_caller, int *&fieldID_caller, - int *&fieldtype_caller, int *&fieldlen_caller) -{ - msg->recv(maxheader,header,maxbuf,buf); - nrecv++; - - // unpack header message - - int m = 0; - msgID = header[m++]; - nfield = header[m++]; - allocate_fields(); - - int nbytes,nbytesround; - - nbuf = 0; - for (int ifield = 0; ifield < nfield; ifield++) { - fieldID[ifield] = header[m++]; - fieldtype[ifield] = header[m++]; - fieldlen[ifield] = header[m++]; - fieldoffset[ifield] = nbuf; - onefield(fieldtype[ifield],fieldlen[ifield],nbytes,nbytesround); - nbuf += nbytesround; - } - - // return message parameters - - nfield_caller = nfield; - fieldID_caller = fieldID; - fieldtype_caller = fieldtype; - fieldlen_caller = fieldlen; - - return msgID; -} - -/* ---------------------------------------------------------------------- */ - -int CSlib::unpack_int(int id) -{ - int ifield = find_field(id,nfield); - if (ifield < 0) error_all("unpack_int(): Unknown field ID"); - if (fieldtype[ifield] != 1) error_all("unpack_int(): Mis-match of ftype"); - if (fieldlen[ifield] != 1) error_all("unpack_int(): Flen is not 1"); - - int *ptr = (int *) unpack(id); - return *ptr; -} - -/* ---------------------------------------------------------------------- */ - -int64_t CSlib::unpack_int64(int id) -{ - int ifield = find_field(id,nfield); - if (ifield < 0) error_all("unpack_int64(): Unknown field ID"); - if (fieldtype[ifield] != 2) error_all("unpack_int64(): Mis-match of ftype"); - if (fieldlen[ifield] != 1) error_all("unpack_int64(): Flen is not 1"); - - int64_t *ptr = (int64_t *) unpack(id); - return *ptr; -} - -/* ---------------------------------------------------------------------- */ - -float CSlib::unpack_float(int id) -{ - int ifield = find_field(id,nfield); - if (ifield < 0) error_all("unpack_float(): Unknown field ID"); - if (fieldtype[ifield] != 3) error_all("unpack_float(): Mis-match of ftype"); - if (fieldlen[ifield] != 1) error_all("unpack_float(): Flen is not 1"); - - float *ptr = (float *) unpack(id); - return *ptr; -} - -/* ---------------------------------------------------------------------- */ - -double CSlib::unpack_double(int id) -{ - int ifield = find_field(id,nfield); - if (ifield < 0) error_all("unpack_double(): Unknown field ID"); - if (fieldtype[ifield] != 4) error_all("unpack_double(): Mis-match of ftype"); - if (fieldlen[ifield] != 1) error_all("unpack_double(): Flen is not 1"); - - double *ptr = (double *) unpack(id); - return *ptr; -} - -/* ---------------------------------------------------------------------- */ - -char *CSlib::unpack_string(int id) -{ - int ifield = find_field(id,nfield); - if (ifield < 0) error_all("unpack_string(): Unknown field ID"); - if (fieldtype[ifield] != 5) error_all("unpack_string(): Mis-match of ftype"); - - char *ptr = (char *) unpack(id); - return ptr; -} - -/* ---------------------------------------------------------------------- */ - -void *CSlib::unpack(int id) -{ - int ifield = find_field(id,nfield); - if (ifield < 0) error_all("unpack(): Unknown field ID"); - return &buf[fieldoffset[ifield]]; -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::unpack(int id, void *data) -{ - int ifield = find_field(id,nfield); - if (ifield < 0) error_all("unpack(): Unknown field ID"); - - int ftype = fieldtype[ifield]; - int nbytes = fieldlen[ifield]; - if (ftype == 1) nbytes *= sizeof(int); - else if (ftype == 2) nbytes *= sizeof(int64_t); - else if (ftype == 3) nbytes *= sizeof(float); - else if (ftype == 4) nbytes *= sizeof(double); - memcpy(data,&buf[fieldoffset[ifield]],nbytes); -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::unpack_parallel(int id, int nlocal, int *ids, int nper, void *data) -{ - int i,j,k,m; - - int ifield = find_field(id,nfield); - if (ifield < 0) error_all("unpack_parallel(): Unknown field ID"); - if (nlocal < 0) error_all("unpack_parallel(): Invalid nlocal"); - if (nper < 1) error_all("pack_parallel(): Invalid nper"); - - MPI_Comm world = (MPI_Comm) myworld; - - int upto; - if (!ids) { - MPI_Scan(&nlocal,&upto,1,MPI_INT,MPI_SUM,world); - upto -= nlocal; - } - - if (fieldtype[ifield] == 1) { - int *local = (int *) data; - int *global = (int *) &buf[fieldoffset[ifield]]; - if (!ids) memcpy(local,&global[nper*upto],nper*nlocal*sizeof(int)); - else { - m = 0; - for (i = 0; i < nlocal; i++) { - j = (ids[i]-1) * nper; - if (nper == 1) local[m++] = global[j]; - else - for (k = 0; k < nper; k++) - local[m++] = global[j++]; - } - } - - } else if (fieldtype[ifield] == 2) { - int64_t *local = (int64_t *) data; - int64_t *global = (int64_t *) &buf[fieldoffset[ifield]]; - if (!ids) memcpy(local,&global[nper*upto],nper*nlocal*sizeof(int64_t)); - else { - m = 0; - for (i = 0; i < nlocal; i++) { - j = (ids[i]-1) * nper; - if (nper == 1) local[m++] = global[j]; - else - for (k = 0; k < nper; k++) - local[m++] = global[j++]; - } - } - - } else if (fieldtype[ifield] == 3) { - float *local = (float *) data; - float *global = (float *) &buf[fieldoffset[ifield]]; - if (!ids) memcpy(local,&global[nper*upto],nper*nlocal*sizeof(float)); - else { - m = 0; - for (i = 0; i < nlocal; i++) { - j = (ids[i]-1) * nper; - if (nper == 1) local[m++] = global[j]; - else - for (k = 0; k < nper; k++) - local[m++] = global[j++]; - } - } - - } else if (fieldtype[ifield] == 4) { - double *local = (double *) data; - double *global = (double *) &buf[fieldoffset[ifield]]; - if (!ids) memcpy(local,&global[nper*upto],nper*nlocal*sizeof(double)); - else { - m = 0; - for (i = 0; i < nlocal; i++) { - j = (ids[i]-1) * nper; - if (nper == 1) local[m++] = global[j]; - else - for (k = 0; k < nper; k++) - local[m++] = global[j++]; - } - } - - /* eventually ftype = BYTE, but not yet - } else if (fieldtype[ifield] == 5) { - char *local = (char *) data; - char *global = (char *) &buf[fieldoffset[ifield]]; - if (!ids) memcpy(local,&global[nper*upto],nper*nlocal*sizeof(char)); - else { - m = 0; - for (i = 0; i < nlocal; i++) { - j = (ids[i]-1) * nper; - memcpy(&local[m],&global[j],nper); - m += nper; - } - } - */ - } -} - -/* ---------------------------------------------------------------------- */ - -int CSlib::extract(int flag) -{ - if (flag == 1) return nsend; - if (flag == 2) return nrecv; - error_all("extract(): Invalid flag"); - return 0; -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::onefield(int ftype, int flen, int &nbytes, int &nbytesround) -{ - int64_t bigbytes,bigbytesround; - int64_t biglen = flen; - - if (ftype == 1) bigbytes = biglen * sizeof(int); - else if (ftype == 2) bigbytes = biglen * sizeof(int64_t); - else if (ftype == 3) bigbytes = biglen * sizeof(float); - else if (ftype == 4) bigbytes = biglen * sizeof(double); - else if (ftype == 5) bigbytes = biglen * sizeof(char); - else bigbytes = 0; - bigbytesround = roundup(bigbytes,8); - - if (nbuf + bigbytesround > INT_MAX) - error_all("pack(): Message size exceeds 32-bit integer limit"); - - nbytes = (int) bigbytes; - nbytesround = (int) bigbytesround; - if (nbuf + nbytesround > maxbuf) { - maxbuf = nbuf + nbytesround; - buf = (char *) srealloc(buf,maxbuf); - } -} - -/* ---------------------------------------------------------------------- */ - -int CSlib::find_field(int id, int n) -{ - int ifield; - for (ifield = 0; ifield < n; ifield++) - if (id == fieldID[ifield]) return ifield; - return -1; -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::allocate_fields() -{ - int64_t bigbytes = (2 + 3*((int64_t) nfield)) * sizeof(int); - if (bigbytes > INT_MAX) - error_all("send(): Message header size exceeds 32-bit integer limit"); - - nheader = 2; - nheader += 3 * nfield; - - if (nfield > maxfield) { - deallocate_fields(); - maxfield = nfield; - fieldID = new int[maxfield]; - fieldtype = new int[maxfield]; - fieldlen = new int[maxfield]; - fieldoffset = new int[maxfield]; - } - - if (nheader > maxheader) { - sfree(header); - maxheader = nheader; - header = (int *) smalloc(maxheader*sizeof(int)); - } -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::deallocate_fields() -{ - delete [] fieldID; - delete [] fieldtype; - delete [] fieldlen; - delete [] fieldoffset; -} - -/* ---------------------------------------------------------------------- */ - -void *CSlib::smalloc(int nbytes) -{ - if (nbytes == 0) return nullptr; - void *ptr = malloc(nbytes); - if (ptr == nullptr) { - char str[128]; - sprintf(str,"malloc(): Failed to allocate %d bytes",nbytes); - error_one(str); - } - return ptr; -} - -/* ---------------------------------------------------------------------- */ - -void *CSlib::srealloc(void *ptr, int nbytes) -{ - if (nbytes == 0) { - sfree(ptr); - return nullptr; - } - - ptr = realloc(ptr,nbytes); - if (ptr == nullptr) { - char str[128]; - sprintf(str,"realloc(): Failed to reallocate %d bytes",nbytes); - error_one(str); - } - return ptr; -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::sfree(void *ptr) -{ - if (ptr == nullptr) return; - free(ptr); -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::error_all(const char *str) -{ - if (me == 0) printf("CSlib ERROR: %s\n",str); - MPI_Comm world = (MPI_Comm) myworld; - MPI_Abort(world,1); -} - -/* ---------------------------------------------------------------------- */ - -void CSlib::error_one(const char *str) -{ - printf("CSlib ERROR: %s\n",str); - MPI_Comm world = (MPI_Comm) myworld; - MPI_Abort(world,1); -} - -/* ---------------------------------------------------------------------- - round N up to multiple of nalign and return it - NOTE: see mapreduce/src/keyvalue.cpp for doing this as uint64_t -------------------------------------------------------------------------- */ - -int64_t CSlib::roundup(int64_t n, int nalign) -{ - if (n % nalign == 0) return n; - n = (n/nalign + 1) * nalign; - return n; -} diff --git a/lib/message/cslib/src/cslib.h b/lib/message/cslib/src/cslib.h deleted file mode 100644 index ad7c853344..0000000000 --- a/lib/message/cslib/src/cslib.h +++ /dev/null @@ -1,91 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - http://cslib.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -#ifndef CSLIB_H -#define CSLIB_H - -#include - -#if defined(LAMMPS_BIGBIG) -#error CSlib is not compatible with -DLAMMPS_BIGBIG -#endif - -namespace CSLIB_NS { - -class CSlib { - public: - int nsend,nrecv; - - CSlib(int, const char *, const void *, const void *); - ~CSlib(); - - void send(int, int); - - void pack_int(int, int); - void pack_int64(int, int64_t); - void pack_float(int, float); - void pack_double(int, double); - void pack_string(int, char *); - void pack(int, int, int, void *); - void pack_parallel(int, int, int, int *, int, void *); - - int recv(int &, int *&, int *&, int *&); - - int unpack_int(int); - int64_t unpack_int64(int); - float unpack_float(int); - double unpack_double(int); - char *unpack_string(int); - void *unpack(int); - void unpack(int, void *); - void unpack_parallel(int, int, int *, int, void *); - - int extract(int); - - private: - uint64_t myworld; // really MPI_Comm, but avoids use of mpi.h in this file - // so apps can include this file w/ no MPI on system - int me,nprocs; - int client,server; - int nfield,maxfield; - int msgID,fieldcount; - int nheader,maxheader; - int nbuf,maxbuf; - int maxglobal,maxfieldbytes; - int *fieldID,*fieldtype,*fieldlen,*fieldoffset; - int *header; - int *recvcounts,*displs; // nprocs size for Allgathers - int *allids; // nglobal size for pack_parallel() - char *buf; // maxbuf size for msg with all fields - char *fielddata; // maxfieldbytes size for one global field - const char *pad; - - class Msg *msg; - - void send_message(); - void onefield(int, int, int &, int &); - int find_field(int, int); - void allocate_fields(); - void deallocate_fields(); - int64_t roundup(int64_t, int); - void *smalloc(int); - void *srealloc(void *, int); - void sfree(void *); - void error_all(const char *); - void error_one(const char *); -}; - -} - -#endif diff --git a/lib/message/cslib/src/cslib.py b/lib/message/cslib/src/cslib.py deleted file mode 100644 index 673c524a3f..0000000000 --- a/lib/message/cslib/src/cslib.py +++ /dev/null @@ -1,362 +0,0 @@ -# ------------------------------------------------------------------------ -# CSlib - Client/server library for code coupling -# http://cslib.sandia.gov, Sandia National Laboratories -# Steve Plimpton, sjplimp@sandia.gov -# -# Copyright 2018 National Technology & Engineering Solutions of -# Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with -# NTESS, the U.S. Government retains certain rights in this software. -# This software is distributed under the modified Berkeley Software -# Distribution (BSD) License. -# -# See the README file in the top-level CSlib directory. -# ------------------------------------------------------------------------- - -# Python wrapper on CSlib library via ctypes - -# ctypes and Numpy data types: -# 32-bit int = c_int = np.intc = np.int32 -# 64-bit int = c_longlong = np.int64 -# 32-bit floating point = c_float = np.float32 -# 64-bit floating point = c_double = np.float = np.float64 - -import sys,traceback -from ctypes import * - -# Numpy and mpi4py packages may not exist - -try: - import numpy as np - numpyflag = 1 -except: - numpyflag = 0 - -try: - from mpi4py import MPI - mpi4pyflag = 1 -except: - mpi4pyflag = 0 - -# wrapper class - -class CSlib: - - # instantiate CSlib thru its C-interface - - def __init__(self,csflag,mode,ptr,comm): - - # load libcslib.so - - try: - if comm: self.lib = CDLL("libcsmpi.so",RTLD_GLOBAL) - else: self.lib = CDLL("libcsnompi.so",RTLD_GLOBAL) - except: - etype,value,tb = sys.exc_info() - traceback.print_exception(etype,value,tb) - raise OSError,"Could not load CSlib dynamic library" - - # define ctypes API for each library method - - self.lib.cslib_open.argtypes = [c_int,c_char_p,c_void_p,c_void_p, - POINTER(c_void_p)] - self.lib.cslib_open.restype = None - - self.lib.cslib_close.argtypes = [c_void_p] - self.lib.cslib_close.restype = None - - self.lib.cslib_send.argtypes = [c_void_p,c_int,c_int] - self.lib.cslib_send.restype = None - - self.lib.cslib_pack_int.argtypes = [c_void_p,c_int,c_int] - self.lib.cslib_pack_int.restype = None - - self.lib.cslib_pack_int64.argtypes = [c_void_p,c_int,c_longlong] - self.lib.cslib_pack_int64.restype = None - - self.lib.cslib_pack_float.argtypes = [c_void_p,c_int,c_float] - self.lib.cslib_pack_float.restype = None - - self.lib.cslib_pack_double.argtypes = [c_void_p,c_int,c_double] - self.lib.cslib_pack_double.restype = None - - self.lib.cslib_pack_string.argtypes = [c_void_p,c_int,c_char_p] - self.lib.cslib_pack_string.restype = None - - self.lib.cslib_pack.argtypes = [c_void_p,c_int,c_int,c_int,c_void_p] - self.lib.cslib_pack.restype = None - - self.lib.cslib_pack_parallel.argtypes = [c_void_p,c_int,c_int,c_int, - POINTER(c_int),c_int,c_void_p] - self.lib.cslib_pack_parallel.restype = None - - self.lib.cslib_recv.argtypes = [c_void_p,POINTER(c_int), - POINTER(POINTER(c_int)), - POINTER(POINTER(c_int)), - POINTER(POINTER(c_int))] - self.lib.cslib_recv.restype = c_int - - self.lib.cslib_unpack_int.argtypes = [c_void_p,c_int] - self.lib.cslib_unpack_int.restype = c_int - - self.lib.cslib_unpack_int64.argtypes = [c_void_p,c_int] - self.lib.cslib_unpack_int64.restype = c_longlong - - self.lib.cslib_unpack_float.argtypes = [c_void_p,c_int] - self.lib.cslib_unpack_float.restype = c_float - - self.lib.cslib_unpack_double.argtypes = [c_void_p,c_int] - self.lib.cslib_unpack_double.restype = c_double - - self.lib.cslib_unpack_string.argtypes = [c_void_p,c_int] - self.lib.cslib_unpack_string.restype = c_char_p - - # override return in unpack() - self.lib.cslib_unpack.argtypes = [c_void_p,c_int] - self.lib.cslib_unpack.restype = c_void_p - - self.lib.cslib_unpack_data.argtypes = [c_void_p,c_int,c_void_p] - self.lib.cslib_unpack_data.restype = None - - # override last arg in unpack_parallel() - self.lib.cslib_unpack_parallel.argtypes = [c_void_p,c_int,c_int, - POINTER(c_int),c_int,c_void_p] - self.lib.cslib_unpack_parallel.restype = None - - self.lib.cslib_extract.argtypes = [c_void_p,c_int] - self.lib.cslib_extract.restype = c_int - - # create an instance of CSlib with or w/out MPI communicator - - self.cs = c_void_p() - - if not comm: - self.lib.cslib_open(csflag,mode,ptr,None,byref(self.cs)) - elif not mpi4pyflag: - print "Cannot pass MPI communicator to CSlib w/out mpi4py package" - sys.exit() - else: - address = MPI._addressof(comm) - comm_ptr = c_void_p(address) - if mode == "mpi/one": - address = MPI._addressof(ptr) - ptrcopy = c_void_p(address) - else: ptrcopy = ptr - self.lib.cslib_open(csflag,mode,ptrcopy,comm_ptr,byref(self.cs)) - - # destroy instance of CSlib - - def __del__(self): - if self.cs: self.lib.cslib_close(self.cs) - - def close(self): - self.lib.cslib_close(self.cs) - self.lib = None - - # send a message - - def send(self,msgID,nfield): - self.nfield = nfield - self.lib.cslib_send(self.cs,msgID,nfield) - - # pack one field of message - - def pack_int(self,id,value): - self.lib.cslib_pack_int(self.cs,id,value) - - def pack_int64(self,id,value): - self.lib.cslib_pack_int64(self.cs,id,value) - - def pack_float(self,id,value): - self.lib.cslib_pack_float(self.cs,id,value) - - def pack_double(self,id,value): - self.lib.cslib_pack_double(self.cs,id,value) - - def pack_string(self,id,value): - self.lib.cslib_pack_string(self.cs,id,value) - - def pack(self,id,ftype,flen,data): - cdata = self.data_convert(ftype,flen,data) - self.lib.cslib_pack(self.cs,id,ftype,flen,cdata) - - def pack_parallel(self,id,ftype,nlocal,ids,nper,data): - cids = self.data_convert(1,nlocal,ids) - cdata = self.data_convert(ftype,nper*nlocal,data) - self.lib.cslib_pack_parallel(self.cs,id,ftype,nlocal,cids,nper,cdata) - - # convert input data to a ctypes vector to pass to CSlib - - def data_convert(self,ftype,flen,data): - - # tflag = type of data - # tflag = 1 if data is list or tuple - # tflag = 2 if data is Numpy array - # tflag = 3 if data is ctypes vector - # same usage of tflag as in unpack function - - txttype = str(type(data)) - if "numpy" in txttype: tflag = 2 - elif "c_" in txttype: tflag = 3 - else: tflag = 1 - - # create ctypes vector out of data to pass to lib - # cdata = ctypes vector to return - # NOTE: error check on ftype and tflag everywhere, also flen - - if ftype == 1: - if tflag == 1: cdata = (flen * c_int)(*data) - elif tflag == 2: cdata = data.ctypes.data_as(POINTER(c_int)) - elif tflag == 3: cdata = data - elif ftype == 2: - if tflag == 1: cdata = (flen * c_longlong)(*data) - elif tflag == 2: cdata = data.ctypes.data_as(POINTER(c_longlong)) - elif tflag == 3: cdata = data - elif ftype == 3: - if tflag == 1: cdata = (flen * c_float)(*data) - elif tflag == 2: cdata = data.ctypes.data_as(POINTER(c_float)) - elif tflag == 3: cdata = data - elif ftype == 4: - if tflag == 1: cdata = (flen * c_double)(*data) - elif tflag == 2: cdata = data.ctypes.data_as(POINTER(c_double)) - elif tflag == 3: cdata = data - - return cdata - - # receive a message - - def recv(self): - self.lib.cslib_recv.restype = c_int - nfield = c_int() - fieldID = POINTER(c_int)() - fieldtype = POINTER(c_int)() - fieldlen = POINTER(c_int)() - msgID = self.lib.cslib_recv(self.cs,byref(nfield), - byref(fieldID),byref(fieldtype),byref(fieldlen)) - - # copy returned C args to native Python int and lists - # store them in class so unpack() methods can access the info - - self.nfield = nfield = nfield.value - self.fieldID = fieldID[:nfield] - self.fieldtype = fieldtype[:nfield] - self.fieldlen = fieldlen[:nfield] - - return msgID,self.nfield,self.fieldID,self.fieldtype,self.fieldlen - - # unpack one field of message - # tflag = type of data to return - # 3 = ctypes vector is default, since no conversion required - - def unpack_int(self,id): - return self.lib.cslib_unpack_int(self.cs,id) - - def unpack_int64(self,id): - return self.lib.cslib_unpack_int64(self.cs,id) - - def unpack_float(self,id): - return self.lib.cslib_unpack_float(self.cs,id) - - def unpack_double(self,id): - return self.lib.cslib_unpack_double(self.cs,id) - - def unpack_string(self,id): - return self.lib.cslib_unpack_string(self.cs,id) - - def unpack(self,id,tflag=3): - index = self.fieldID.index(id) - - # reset data type of return so can morph by tflag - # cannot do this for the generic c_void_p returned by CSlib - - if self.fieldtype[index] == 1: - self.lib.cslib_unpack.restype = POINTER(c_int) - elif self.fieldtype[index] == 2: - self.lib.cslib_unpack.restype = POINTER(c_longlong) - elif self.fieldtype[index] == 3: - self.lib.cslib_unpack.restype = POINTER(c_float) - elif self.fieldtype[index] == 4: - self.lib.cslib_unpack.restype = POINTER(c_double) - #elif self.fieldtype[index] == 5: - # self.lib.cslib_unpack.restype = POINTER(c_char) - - cdata = self.lib.cslib_unpack(self.cs,id) - - # tflag = user-requested type of data to return - # tflag = 1 to return data as list - # tflag = 2 to return data as Numpy array - # tflag = 3 to return data as ctypes vector - # same usage of tflag as in pack functions - # tflag = 2,3 should NOT perform a data copy - - if tflag == 1: - data = cdata[:self.fieldlen[index]] - elif tflag == 2: - if numpyflag == 0: - print "Cannot return Numpy array w/out numpy package" - sys.exit() - data = np.ctypeslib.as_array(cdata,shape=(self.fieldlen[index],)) - elif tflag == 3: - data = cdata - - return data - - # handle data array like pack() or unpack_parallel() ?? - - def unpack_data(self,id,tflag=3): - index = self.fieldID.index(id) - - # unpack one field of message in parallel - # tflag = type of data to return - # 3 = ctypes vector is default, since no conversion required - # NOTE: allow direct use of user array (e.g. Numpy), if user provides data arg? - # as opposed to creating this cdata - # does that make any performance difference ? - # e.g. should we allow CSlib to populate an existing Numpy array's memory - - def unpack_parallel(self,id,nlocal,ids,nper,tflag=3): - cids = self.data_convert(1,nlocal,ids) - - # allocate memory for the returned data - # pass cdata ptr to the memory to CSlib unpack_parallel() - # this resets data type of last unpack_parallel() arg - - index = self.fieldID.index(id) - if self.fieldtype[index] == 1: cdata = (nper*nlocal * c_int)() - elif self.fieldtype[index] == 2: cdata = (nlocal*nper * c_longlong)() - elif self.fieldtype[index] == 3: cdata = (nlocal*nper * c_float)() - elif self.fieldtype[index] == 4: cdata = (nlocal*nper * c_double)() - #elif self.fieldtype[index] == 5: cdata = (nlocal*nper * c_char)() - - self.lib.cslib_unpack_parallel(self.cs,id,nlocal,cids,nper,cdata) - - # tflag = user-requested type of data to return - # tflag = 1 to return data as list - # tflag = 2 to return data as Numpy array - # tflag = 3 to return data as ctypes vector - # same usage of tflag as in pack functions - - if tflag == 1: - data = cdata[:nper*nlocal] - elif tflag == 2: - if numpyflag == 0: - print "Cannot return Numpy array w/out numpy package" - sys.exit() - # NOTE: next line gives ctypes warning for fieldtype = 2 = 64-bit int - # not sure why, reported as bug between ctypes and Numpy here: - # https://stackoverflow.com/questions/4964101/pep-3118- - # warning-when-using-ctypes-array-as-numpy-array - # but why not same warning when just using unpack() ?? - # in Python these lines give same warning: - # >>> import ctypes,numpy - # >>> a = (10 * ctypes.c_longlong)() - # >>> b = numpy.ctypeslib.as_array(a) - data = np.ctypeslib.as_array(cdata,shape=(nlocal*nper,)) - elif tflag == 3: - data = cdata - - return data - - # extract a library value - - def extract(self,flag): - return self.lib.cslib_extract(self.cs,flag) diff --git a/lib/message/cslib/src/cslib_wrap.cpp b/lib/message/cslib/src/cslib_wrap.cpp deleted file mode 100644 index 08a768a3ac..0000000000 --- a/lib/message/cslib/src/cslib_wrap.cpp +++ /dev/null @@ -1,243 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - https://cslib.sandia.gov/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -// C style library interface to CSlib class - -#ifdef MPI_YES -#include -#else -#include -#endif -#include -#include -#include -#include - -#include "cslib_wrap.h" -#include "cslib.h" - -using namespace CSLIB_NS; - -// ---------------------------------------------------------------------- - -void cslib_open(int csflag, const char *mode, const void *ptr, - const void *pcomm, void **csptr) -{ - CSlib *cs = new CSlib(csflag,mode,ptr,pcomm); - *csptr = (void *) cs; -} - -// ---------------------------------------------------------------------- - -void cslib_open_fortran(int csflag, const char *mode, const char *str, - const void *pcomm, void **csptr) -{ - MPI_Comm ccomm; - void *pccomm = nullptr; - - if (pcomm) { - MPI_Fint *fcomm = (MPI_Fint *) pcomm; - ccomm = MPI_Comm_f2c(*fcomm); - pccomm = &ccomm; - } - - CSlib *cs = new CSlib(csflag,mode,str,pccomm); - *csptr = (void *) cs; -} - -// ---------------------------------------------------------------------- - -void cslib_open_fortran_mpi_one(int csflag, const char *mode, - const void *pboth, const void *pcomm, - void **csptr) -{ - MPI_Comm ccomm,cboth; - void *pccomm,*pcboth; - - MPI_Fint *fcomm = (MPI_Fint *) pcomm; - ccomm = MPI_Comm_f2c(*fcomm); - pccomm = &ccomm; - - MPI_Fint *fboth = (MPI_Fint *) pboth; - cboth = MPI_Comm_f2c(*fboth); - pcboth = &cboth; - - CSlib *cs = new CSlib(csflag,mode,pcboth,pccomm); - *csptr = (void *) cs; -} - -// ---------------------------------------------------------------------- - -void cslib_close(void *ptr) -{ - CSlib *cs = (CSlib *) ptr; - delete cs; -} - -// ---------------------------------------------------------------------- - -void cslib_send(void *ptr, int msgID, int nfield) -{ - CSlib *cs = (CSlib *) ptr; - cs->send(msgID,nfield); -} - -// ---------------------------------------------------------------------- - -void cslib_pack_int(void *ptr, int id, int value) -{ - CSlib *cs = (CSlib *) ptr; - cs->pack_int(id,value); -} - -// ---------------------------------------------------------------------- - -void cslib_pack_int64(void *ptr, int id, int64_t value) -{ - CSlib *cs = (CSlib *) ptr; - cs->pack_int64(id,value); -} - -// ---------------------------------------------------------------------- - -void cslib_pack_float(void *ptr, int id, float value) -{ - CSlib *cs = (CSlib *) ptr; - cs->pack_float(id,value); -} - -// ---------------------------------------------------------------------- - -void cslib_pack_double(void *ptr, int id, double value) -{ - CSlib *cs = (CSlib *) ptr; - cs->pack_double(id,value); -} - -// ---------------------------------------------------------------------- - -void cslib_pack_string(void *ptr, int id, char *value) -{ - CSlib *cs = (CSlib *) ptr; - cs->pack_string(id,value); -} - -// ---------------------------------------------------------------------- - -void cslib_pack(void *ptr, int id, int ftype, int flen, void *data) -{ - CSlib *cs = (CSlib *) ptr; - cs->pack(id,ftype,flen,data); -} - -// ---------------------------------------------------------------------- - -void cslib_pack_parallel(void *ptr, int id, int ftype, - int nlocal, int *ids, int nper, void *data) -{ - CSlib *cs = (CSlib *) ptr; - cs->pack_parallel(id,ftype,nlocal,ids,nper,data); -} - -// ---------------------------------------------------------------------- - -int cslib_recv(void *ptr, int *nfield_caller, - int **fieldID_caller, int **fieldtype_caller, - int **fieldlen_caller) -{ - CSlib *cs = (CSlib *) ptr; - - int nfield; - int *fieldID,*fieldtype,*fieldlen; - int msgID = cs->recv(nfield,fieldID,fieldtype,fieldlen); - - *nfield_caller = nfield; - *fieldID_caller = fieldID; - *fieldtype_caller = fieldtype; - *fieldlen_caller = fieldlen; - - return msgID; -} - -// ---------------------------------------------------------------------- - -int cslib_unpack_int(void *ptr, int id) -{ - CSlib *cs = (CSlib *) ptr; - return cs->unpack_int(id); -} -// ---------------------------------------------------------------------- - -int64_t cslib_unpack_int64(void *ptr, int id) -{ - CSlib *cs = (CSlib *) ptr; - return cs->unpack_int64(id); -} - -// ---------------------------------------------------------------------- - -float cslib_unpack_float(void *ptr, int id) -{ - CSlib *cs = (CSlib *) ptr; - return cs->unpack_float(id); -} - -// ---------------------------------------------------------------------- - -double cslib_unpack_double(void *ptr, int id) -{ - CSlib *cs = (CSlib *) ptr; - return cs->unpack_double(id); -} - -// ---------------------------------------------------------------------- - -char *cslib_unpack_string(void *ptr, int id) -{ - CSlib *cs = (CSlib *) ptr; - return cs->unpack_string(id); -} - -// ---------------------------------------------------------------------- - -void *cslib_unpack(void *ptr, int id) -{ - CSlib *cs = (CSlib *) ptr; - return cs->unpack(id); -} - -// ---------------------------------------------------------------------- - -void cslib_unpack_data(void *ptr, int id, void *data) -{ - CSlib *cs = (CSlib *) ptr; - cs->unpack(id,data); -} - -// ---------------------------------------------------------------------- - -void cslib_unpack_parallel(void *ptr, int id, int nlocal, int *ids, - int nper, void *data) -{ - CSlib *cs = (CSlib *) ptr; - cs->unpack_parallel(id,nlocal,ids,nper,data); -} - -// ---------------------------------------------------------------------- - -int cslib_extract(void *ptr, int flag) -{ - CSlib *cs = (CSlib *) ptr; - return cs->extract(flag); -} diff --git a/lib/message/cslib/src/cslib_wrap.f90 b/lib/message/cslib/src/cslib_wrap.f90 deleted file mode 100644 index cd2e058b78..0000000000 --- a/lib/message/cslib/src/cslib_wrap.f90 +++ /dev/null @@ -1,147 +0,0 @@ -! ISO_C_binding wrapper on CSlib C interface - -module cslib_wrap - -interface - subroutine cslib_open_fortran(csflag,mode,str,pcomm,ptr) bind(c) - use iso_c_binding - integer(c_int), value :: csflag - character(c_char) :: mode(*),str(*) - type(c_ptr), value :: pcomm - type(c_ptr) :: ptr - end subroutine cslib_open_fortran - - subroutine cslib_open_fortran_mpi_one(csflag,mode,pboth,pcomm,ptr) bind(c) - use iso_c_binding - integer(c_int), value :: csflag - character(c_char) :: mode(*) - type(c_ptr), value :: pboth,pcomm - type(c_ptr) :: ptr - end subroutine cslib_open_fortran_mpi_one - - subroutine cslib_close(ptr) bind(c) - use iso_c_binding - type(c_ptr), value :: ptr - end subroutine cslib_close - - subroutine cslib_send(ptr,msgID,nfield) bind(c) - use iso_c_binding - type(c_ptr), value :: ptr - integer(c_int), value :: msgID,nfield - end subroutine cslib_send - - subroutine cslib_pack_int(ptr,id,value) bind(c) - use iso_c_binding - type(c_ptr), value :: ptr - integer(c_int), value :: id - integer(c_int), value :: value - end subroutine cslib_pack_int - - subroutine cslib_pack_int64(ptr,id,value) bind(c) - use iso_c_binding - type(c_ptr), value :: ptr - integer(c_int), value :: id - integer(c_int64_t), value :: value - end subroutine cslib_pack_int64 - - subroutine cslib_pack_float(ptr,id,value) bind(c) - use iso_c_binding - type(c_ptr), value :: ptr - integer(c_int), value :: id - real(c_float), value :: value - end subroutine cslib_pack_float - - subroutine cslib_pack_double(ptr,id,value) bind(c) - use iso_c_binding - type(c_ptr), value :: ptr - integer(c_int), value :: id - real(c_double), value :: value - end subroutine cslib_pack_double - - subroutine cslib_pack_string(ptr,id,value) bind(c) - use iso_c_binding - type(c_ptr), value :: ptr - integer(c_int), value :: id - character(c_char) :: value(*) - end subroutine cslib_pack_string - - subroutine cslib_pack(ptr,id,ftype,flen,data) bind(c) - use iso_c_binding - type(c_ptr), value :: ptr - integer(c_int), value :: id,ftype,flen - type(c_ptr), value :: data - end subroutine cslib_pack - - subroutine cslib_pack_parallel(ptr,id,ftype,nlocal,ids,nper,data) bind(c) - use iso_c_binding - type(c_ptr), value :: ptr - integer(c_int), value :: id,ftype,nlocal,nper - type(c_ptr), value :: ids,data - end subroutine cslib_pack_parallel - - function cslib_recv(ptr,nfield,fieldID,fieldtype,fieldlen) bind(c) - use iso_c_binding - integer(c_int) :: cslib_recv - type(c_ptr), value :: ptr - integer(c_int) :: nfield - type(c_ptr) :: fieldID,fieldtype,fieldlen - end function cslib_recv - - function cslib_unpack_int(ptr,id) bind(c) - use iso_c_binding - integer(c_int) :: cslib_unpack_int - type(c_ptr), value :: ptr - integer(c_int), value :: id - end function cslib_unpack_int - - function cslib_unpack_int64(ptr,id) bind(c) - use iso_c_binding - integer(c_int64_t) :: cslib_unpack_int64 - type(c_ptr), value :: ptr - integer(c_int), value :: id - end function cslib_unpack_int64 - - function cslib_unpack_float(ptr,id) bind(c) - use iso_c_binding - real(c_float) :: cslib_unpack_float - type(c_ptr), value :: ptr - integer(c_int), value :: id - end function cslib_unpack_float - - function cslib_unpack_double(ptr,id) bind(c) - use iso_c_binding - real(c_double) :: cslib_unpack_double - type(c_ptr), value :: ptr - integer(c_int), value :: id - end function cslib_unpack_double - - function cslib_unpack_string(ptr,id) bind(c) - use iso_c_binding - type(c_ptr) :: cslib_unpack_string - type(c_ptr), value :: ptr - integer(c_int), value :: id - end function cslib_unpack_string - - function cslib_unpack(ptr,id) bind(c) - use iso_c_binding - type(c_ptr) :: cslib_unpack - type(c_ptr), value :: ptr - integer(c_int), value :: id - end function cslib_unpack - - subroutine cslib_unpack_parallel(ptr,id,nlocal,ids,nper,data) bind(c) - use iso_c_binding - type(c_ptr), value :: ptr - integer(c_int), value :: id,nlocal,nper - type(c_ptr), value :: ids,data - end subroutine cslib_unpack_parallel - - function cslib_extract(ptr,flag) bind(c) - use iso_c_binding - integer(c_int) :: cslib_extract - type(c_ptr), value :: ptr - integer(c_int), value :: flag - end function cslib_extract -end interface - -end module cslib_wrap diff --git a/lib/message/cslib/src/cslib_wrap.h b/lib/message/cslib/src/cslib_wrap.h deleted file mode 100644 index a5a80c0fa3..0000000000 --- a/lib/message/cslib/src/cslib_wrap.h +++ /dev/null @@ -1,54 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - http://cslib.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -/* C style library interface to CSlib class - ifdefs allow this file to be included in a C program -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -void cslib_open(int, const char *, const void *, const void *, void **); -void cslib_open_fortran(int, const char *, const char *, const void *, void **); -void cslib_open_fortran_mpi_one(int, const char *, const void *, - const void *, void **); -void cslib_close(void *); - -void cslib_send(void *, int, int); - -void cslib_pack_int(void *, int, int); -void cslib_pack_int64(void *, int, int64_t); -void cslib_pack_float(void *, int, float); -void cslib_pack_double(void *, int, double); -void cslib_pack_string(void *, int, char *); -void cslib_pack(void *, int, int, int, void *); -void cslib_pack_parallel(void *, int, int, int, int *, int, void *); - -int cslib_recv(void *, int *, int **, int **, int **); - -int cslib_unpack_int(void *, int); -int64_t cslib_unpack_int64(void *, int); -float cslib_unpack_float(void *, int); -double cslib_unpack_double(void *, int); -char *cslib_unpack_string(void *, int); -void *cslib_unpack(void *, int); -void cslib_unpack_data(void *, int, void *); -void cslib_unpack_parallel(void *, int, int, int *, int, void *); - -int cslib_extract(void *, int); - -#ifdef __cplusplus -} -#endif diff --git a/lib/message/cslib/src/msg.cpp b/lib/message/cslib/src/msg.cpp deleted file mode 100644 index bd48920176..0000000000 --- a/lib/message/cslib/src/msg.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - https://cslib.sandia.gov/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -#ifdef MPI_YES -#include -#else -#include -#endif -#include -#include -#include - -#include "msg.h" - -using namespace CSLIB_NS; - -/* ---------------------------------------------------------------------- */ - -Msg::Msg(int csflag, const void * /* ptr */, MPI_Comm cworld) -{ - world = cworld; - MPI_Comm_rank(world,&me); - MPI_Comm_size(world,&nprocs); - - init(csflag); -} - -/* ---------------------------------------------------------------------- */ - -Msg::Msg(int csflag, const void * /* ptr */) -{ - world = 0; - me = 0; - nprocs = 1; - - init(csflag); -} - -/* ---------------------------------------------------------------------- */ - -void Msg::init(int csflag) -{ - client = server = 0; - if (csflag == 0) client = 1; - else if (csflag == 1) server = 1; - - nsend = nrecv = 0; -} - -/* ---------------------------------------------------------------------- */ - -void Msg::allocate(int nheader, int &maxheader, int *&header, - int nbuf, int &maxbuf, char *&buf) -{ - if (nheader > maxheader) { - sfree(header); - maxheader = nheader; - header = (int *) smalloc(maxheader*sizeof(int)); - } - - if (nbuf > maxbuf) { - sfree(buf); - maxbuf = nbuf; - buf = (char *) smalloc(maxbuf*sizeof(char)); - } -} - -/* ---------------------------------------------------------------------- */ - -void *Msg::smalloc(int nbytes) -{ - if (nbytes == 0) return nullptr; - void *ptr = (void *) malloc(nbytes); - if (ptr == nullptr) { - char str[128]; - sprintf(str,"Failed to allocate %d bytes",nbytes); - } - return ptr; -} - -/* ---------------------------------------------------------------------- */ - -void Msg::sfree(void *ptr) -{ - if (ptr == nullptr) return; - free(ptr); -} - -/* ---------------------------------------------------------------------- */ - -void Msg::error_all(const char *str) -{ - if (me == 0) printf("CSlib ERROR: %s\n",str); - MPI_Abort(world,1); -} - -/* ---------------------------------------------------------------------- */ - -void Msg::error_one(const char *str) -{ - printf("CSlib ERROR: %s\n",str); - MPI_Abort(world,1); -} diff --git a/lib/message/cslib/src/msg.h b/lib/message/cslib/src/msg.h deleted file mode 100644 index 81c2d21cb9..0000000000 --- a/lib/message/cslib/src/msg.h +++ /dev/null @@ -1,56 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - http://cslib.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -#ifndef MSG_H -#define MSG_H - -#ifdef MPI_YES -#include -#else -#include -#endif - -namespace CSLIB_NS { - -class Msg { - public: - int nsend,nrecv; - MPI_Comm world; - - Msg(int, const void *, MPI_Comm); - Msg(int, const void *); - virtual ~Msg() {} - virtual void send(int, int *, int, char *) = 0; - virtual void recv(int &, int *&, int &, char *&) = 0; - - protected: - int me,nprocs; - int client,server; - - int nfield; - int *fieldID,*fieldtype,*fieldlen; - int lengths[2]; - - void init(int); - void allocate(int, int &, int *&, int, int &, char *&); - void *smalloc(int); - void sfree(void *); - void error_all(const char *); - void error_one(const char *); -}; - - -} - -#endif diff --git a/lib/message/cslib/src/msg_file.cpp b/lib/message/cslib/src/msg_file.cpp deleted file mode 100644 index 51c3db4c1e..0000000000 --- a/lib/message/cslib/src/msg_file.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - https://cslib.sandia.gov/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -#ifdef MPI_YES -#include -#else -#include -#endif -#include -#include -#include -#include -#include - -#include "msg_file.h" - -using namespace CSLIB_NS; - -#define MAXLINE 256 -#define SLEEP 0.1 // delay in CPU secs to check for message file - -/* ---------------------------------------------------------------------- */ - -MsgFile::MsgFile(int csflag, const void *ptr, MPI_Comm cworld) : - Msg(csflag, ptr, cworld) -{ - char *filename = (char *) ptr; - init(filename); -} - -/* ---------------------------------------------------------------------- */ - -MsgFile::MsgFile(int csflag, const void *ptr) : Msg(csflag, ptr) -{ - char *filename = (char *) ptr; - init(filename); -} - -/* ---------------------------------------------------------------------- */ - -MsgFile::~MsgFile() -{ - delete [] fileroot; -} - -/* ---------------------------------------------------------------------- */ - -void MsgFile::init(char *filename) -{ - int n = strlen(filename) + 1; - fileroot = new char[n]; - strcpy(fileroot,filename); -} - -/* ---------------------------------------------------------------------- */ - -void MsgFile::send(int nheader, int *header, int nbuf, char *buf) -{ - char filename[MAXLINE]; - - lengths[0] = nheader; - lengths[1] = nbuf; - - if (me == 0) { - if (client) sprintf(filename,"%s.%s",fileroot,"client"); - else if (server) sprintf(filename,"%s.%s",fileroot,"server"); - - fp = fopen(filename,"wb"); - if (!fp) error_one("send(): Could not open send message file"); - fwrite(lengths,sizeof(int),2,fp); - fwrite(header,sizeof(int),nheader,fp); - fwrite(buf,1,nbuf,fp); - fclose(fp); - } - - // create empty signal file - - if (me == 0) { - if (client) sprintf(filename,"%s.%s",fileroot,"client.signal"); - else if (server) sprintf(filename,"%s.%s",fileroot,"server.signal"); - fp = fopen(filename,"w"); - fclose(fp); - } -} - -/* ---------------------------------------------------------------------- */ - -void MsgFile::recv(int &maxheader, int *&header, int &maxbuf, char *&buf) -{ - char filename[MAXLINE]; - - // wait until signal file exists to open message file - - if (me == 0) { - if (client) sprintf(filename,"%s.%s",fileroot,"server.signal"); - else if (server) sprintf(filename,"%s.%s",fileroot,"client.signal"); - - int delay = (int) (1000000 * SLEEP); - while (1) { - fp = fopen(filename,"r"); - if (fp) break; - usleep(delay); - } - fclose(fp); - - if (client) sprintf(filename,"%s.%s",fileroot,"server"); - else if (server) sprintf(filename,"%s.%s",fileroot,"client"); - fp = fopen(filename,"rb"); - if (!fp) error_one("recv(): Could not open recv message file"); - } - - // read and broadcast data - - if (me == 0) fread(lengths,sizeof(int),2,fp); - if (nprocs > 1) MPI_Bcast(lengths,2,MPI_INT,0,world); - - int nheader = lengths[0]; - int nbuf = lengths[1]; - allocate(nheader,maxheader,header,nbuf,maxbuf,buf); - - if (me == 0) fread(header,sizeof(int),nheader,fp); - if (nprocs > 1) MPI_Bcast(header,nheader,MPI_INT,0,world); - - if (me == 0) fread(buf,1,nbuf,fp); - if (nprocs > 1) MPI_Bcast(buf,nbuf,MPI_CHAR,0,world); - - // delete both message and signal file - - if (me == 0) { - fclose(fp); - unlink(filename); - if (client) sprintf(filename,"%s.%s",fileroot,"server.signal"); - else if (server) sprintf(filename,"%s.%s",fileroot,"client.signal"); - unlink(filename); - } -} diff --git a/lib/message/cslib/src/msg_file.h b/lib/message/cslib/src/msg_file.h deleted file mode 100644 index d6bd802607..0000000000 --- a/lib/message/cslib/src/msg_file.h +++ /dev/null @@ -1,40 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - http://cslib.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -#ifndef MSG_FILE_H -#define MSG_FILE_H - -#include -#include "msg.h" - -namespace CSLIB_NS { - -class MsgFile : public Msg { - public: - MsgFile(int, const void *, MPI_Comm); - MsgFile(int, const void *); - ~MsgFile(); - void send(int, int *, int, char *); - void recv(int &, int *&, int &, char *&); - - private: - char *fileroot; - FILE *fp; - - void init(char *); -}; - -} - -#endif diff --git a/lib/message/cslib/src/msg_mpi_one.cpp b/lib/message/cslib/src/msg_mpi_one.cpp deleted file mode 100644 index 3c9d6bab14..0000000000 --- a/lib/message/cslib/src/msg_mpi_one.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - https://cslib.sandia.gov/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -#ifdef MPI_YES -#include -#else -#include -#endif -#include -#include -#include -#include -#include - -#include "msg_mpi_one.h" - -using namespace CSLIB_NS; - -/* ---------------------------------------------------------------------- */ - -MsgMPIOne::MsgMPIOne(int csflag, const void *ptr, MPI_Comm cworld) : - Msg(csflag, ptr, cworld) -{ - // NOTE: ideally would skip this call if mpi/two - init(ptr); -} - -/* ---------------------------------------------------------------------- */ - -void MsgMPIOne::init(const void *ptr) -{ - MPI_Comm *pbothcomm = (MPI_Comm *) ptr; - bothcomm = *pbothcomm; - - if (client) { - MPI_Comm_size(world,&nprocs); - otherroot = nprocs; - } else if (server) { - otherroot = 0; - } -} - -/* ---------------------------------------------------------------------- */ - -void MsgMPIOne::send(int nheader, int *header, int nbuf, char *buf) -{ - lengths[0] = nheader; - lengths[1] = nbuf; - - if (me == 0) { - MPI_Send(lengths,2,MPI_INT,otherroot,0,bothcomm); - MPI_Send(header,nheader,MPI_INT,otherroot,0,bothcomm); - MPI_Send(buf,nbuf,MPI_CHAR,otherroot,0,bothcomm); - } -} - -/* ---------------------------------------------------------------------- */ - -void MsgMPIOne::recv(int &maxheader, int *&header, int &maxbuf, char *&buf) -{ - MPI_Status status; - - if (me == 0) MPI_Recv(lengths,2,MPI_INT,otherroot,0,bothcomm,&status); - if (nprocs > 1) MPI_Bcast(lengths,2,MPI_INT,0,world); - - int nheader = lengths[0]; - int nbuf = lengths[1]; - allocate(nheader,maxheader,header,nbuf,maxbuf,buf); - - if (me == 0) MPI_Recv(header,nheader,MPI_INT,otherroot,0,bothcomm,&status); - if (nprocs > 1) MPI_Bcast(header,nheader,MPI_INT,0,world); - - if (me == 0) MPI_Recv(buf,nbuf,MPI_CHAR,otherroot,0,bothcomm,&status); - if (nprocs > 1) MPI_Bcast(buf,nbuf,MPI_CHAR,0,world); -} diff --git a/lib/message/cslib/src/msg_mpi_one.h b/lib/message/cslib/src/msg_mpi_one.h deleted file mode 100644 index 4b4140a3f7..0000000000 --- a/lib/message/cslib/src/msg_mpi_one.h +++ /dev/null @@ -1,38 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - http://cslib.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -#ifndef MSG_MPI_ONE_H -#define MSG_MPI_ONE_H - -#include "msg.h" - -namespace CSLIB_NS { - -class MsgMPIOne : public Msg { - public: - MsgMPIOne(int, const void *, MPI_Comm); - virtual ~MsgMPIOne() {} - void send(int, int *, int, char *); - void recv(int &, int *&, int &, char *&); - - protected: - MPI_Comm bothcomm; - int otherroot; - - void init(const void *); -}; - -} - -#endif diff --git a/lib/message/cslib/src/msg_mpi_two.cpp b/lib/message/cslib/src/msg_mpi_two.cpp deleted file mode 100644 index cd70cd9f66..0000000000 --- a/lib/message/cslib/src/msg_mpi_two.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - https://cslib.sandia.gov/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -#ifdef MPI_YES -#include -#else -#include -#endif -#include -#include -#include -#include -#include - -#include "msg_mpi_two.h" - -using namespace CSLIB_NS; - -/* ---------------------------------------------------------------------- */ - -MsgMPITwo::MsgMPITwo(int csflag, const void *ptr, MPI_Comm cworld) : - MsgMPIOne(csflag, ptr, cworld) -{ - char *filename = (char *) ptr; - init(filename); -} - -/* ---------------------------------------------------------------------- */ - -MsgMPITwo::~MsgMPITwo() -{ - // free the inter comm that spans both client and server - - MPI_Comm_free(&bothcomm); - MPI_Close_port(port); -} - -/* ---------------------------------------------------------------------- */ - -void MsgMPITwo::init(char *filename) -{ - if (client) { - if (me == 0) { - FILE *fp = nullptr; - while (!fp) { - fp = fopen(filename,"r"); - if (!fp) sleep(1); - } - fgets(port,MPI_MAX_PORT_NAME,fp); - //printf("Client port: %s\n",port); - fclose(fp); - } - - MPI_Bcast(port,MPI_MAX_PORT_NAME,MPI_CHAR,0,world); - MPI_Comm_connect(port,MPI_INFO_NULL,0,world,&bothcomm); - //if (me == 0) printf("CLIENT comm connect\n"); - if (me == 0) unlink(filename); - - } else if (server) { - MPI_Open_port(MPI_INFO_NULL,port); - - if (me == 0) { - //printf("Server name: %s\n",port); - FILE *fp = fopen(filename,"w"); - fprintf(fp,"%s",port); - fclose(fp); - } - - MPI_Comm_accept(port,MPI_INFO_NULL,0,world,&bothcomm); - //if (me == 0) printf("SERVER comm accept\n"); - } - - otherroot = 0; -} diff --git a/lib/message/cslib/src/msg_mpi_two.h b/lib/message/cslib/src/msg_mpi_two.h deleted file mode 100644 index 7b31db5a63..0000000000 --- a/lib/message/cslib/src/msg_mpi_two.h +++ /dev/null @@ -1,35 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - http://cslib.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -#ifndef MSG_MPI_TWO_H -#define MSG_MPI_TWO_H - -#include "msg_mpi_one.h" - -namespace CSLIB_NS { - -class MsgMPITwo : public MsgMPIOne { - public: - MsgMPITwo(int, const void *, MPI_Comm); - ~MsgMPITwo(); - - private: - char port[MPI_MAX_PORT_NAME]; - - void init(char *); -}; - -} - -#endif diff --git a/lib/message/cslib/src/msg_zmq.cpp b/lib/message/cslib/src/msg_zmq.cpp deleted file mode 100644 index 76875e5051..0000000000 --- a/lib/message/cslib/src/msg_zmq.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - https://cslib.sandia.gov/, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -#ifdef MPI_YES -#include -#else -#include -#endif -#include -#include -#include -#include -#include - -#include "msg_zmq.h" - -using namespace CSLIB_NS; - -/* ---------------------------------------------------------------------- */ - -MsgZMQ::MsgZMQ(int csflag, const void *ptr, MPI_Comm cworld) : - Msg(csflag, ptr, cworld) -{ - char *port = (char *) ptr; - init(port); -} - -MsgZMQ::MsgZMQ(int csflag, const void *ptr) : Msg(csflag, ptr) -{ - char *port = (char *) ptr; - init(port); -} - -/* ---------------------------------------------------------------------- */ - -MsgZMQ::~MsgZMQ() -{ - if (me == 0) { - zmq_close(socket); - zmq_ctx_destroy(context); - } -} - -/* ---------------------------------------------------------------------- */ - -void MsgZMQ::init(char *port) -{ -#ifdef ZMQ_NO - error_all("constructor(): Library not built with ZMQ support"); -#endif - - if (me == 0) { - int n = strlen(port) + 8; - char *socket_name = new char[n]; - strcpy(socket_name,"tcp://"); - strcat(socket_name,port); - - if (client) { - context = zmq_ctx_new(); - socket = zmq_socket(context,ZMQ_REQ); - zmq_connect(socket,socket_name); - } else if (server) { - context = zmq_ctx_new(); - socket = zmq_socket(context,ZMQ_REP); - int rc = zmq_bind(socket,socket_name); - if (rc) error_one("constructor(): Server could not make socket connection"); - } - - delete [] socket_name; - } -} - -/* ---------------------------------------------------------------------- - client/server sockets (REQ/REP) must follow this protocol: - client sends request (REQ) which server receives - server sends response (REP) which client receives - every exchange is of this form, server cannot initiate a send - thus each ZMQ send below has a following ZMQ recv, except last one - if client calls send(), it will next call recv() - if server calls send(), it will next call recv() from its wait loop - in either case, recv() issues a ZMQ recv to match last ZMQ send here -------------------------------------------------------------------------- */ - -void MsgZMQ::send(int nheader, int *header, int nbuf, char *buf) -{ - lengths[0] = nheader; - lengths[1] = nbuf; - - if (me == 0) { - zmq_send(socket,lengths,2*sizeof(int),0); - zmq_recv(socket,nullptr,0,0); - } - - if (me == 0) { - zmq_send(socket,header,nheader*sizeof(int),0); - zmq_recv(socket,nullptr,0,0); - } - - if (me == 0) zmq_send(socket,buf,nbuf,0); -} - -/* ---------------------------------------------------------------------- - client/server sockets (REQ/REP) must follow this protocol: - client sends request (REQ) which server receives - server sends response (REP) which client receives - every exchange is of this form, server cannot initiate a send - thus each ZMQ recv below has a following ZMQ send, except last one - if client calls recv(), it will next call send() to ping server again, - if server calls recv(), it will next call send() to respond to client - in either case, send() issues a ZMQ send to match last ZMQ recv here -------------------------------------------------------------------------- */ - -void MsgZMQ::recv(int &maxheader, int *&header, int &maxbuf, char *&buf) -{ - if (me == 0) { - zmq_recv(socket,lengths,2*sizeof(int),0); - zmq_send(socket,nullptr,0,0); - } - if (nprocs > 1) MPI_Bcast(lengths,2,MPI_INT,0,world); - - int nheader = lengths[0]; - int nbuf = lengths[1]; - allocate(nheader,maxheader,header,nbuf,maxbuf,buf); - - if (me == 0) { - zmq_recv(socket,header,nheader*sizeof(int),0); - zmq_send(socket,nullptr,0,0); - } - if (nprocs > 1) MPI_Bcast(header,nheader,MPI_INT,0,world); - - if (me == 0) zmq_recv(socket,buf,nbuf,0); - if (nprocs > 1) MPI_Bcast(buf,nbuf,MPI_CHAR,0,world); -} diff --git a/lib/message/cslib/src/msg_zmq.h b/lib/message/cslib/src/msg_zmq.h deleted file mode 100644 index c0621a26ff..0000000000 --- a/lib/message/cslib/src/msg_zmq.h +++ /dev/null @@ -1,38 +0,0 @@ -/* ---------------------------------------------------------------------- - CSlib - Client/server library for code coupling - http://cslib.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright 2018 National Technology & Engineering Solutions of - Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with - NTESS, the U.S. Government retains certain rights in this software. - This software is distributed under the modified Berkeley Software - Distribution (BSD) License. - - See the README file in the top-level CSlib directory. -------------------------------------------------------------------------- */ - -#ifndef MSG_ZMQ_H -#define MSG_ZMQ_H - -#include "msg.h" - -namespace CSLIB_NS { - -class MsgZMQ : public Msg { - public: - MsgZMQ(int, const void *, MPI_Comm); - MsgZMQ(int, const void *); - ~MsgZMQ(); - void send(int, int *, int, char *); - void recv(int &, int *&, int &, char *&); - - private: - void *context,*socket; - - void init(char *); -}; - -} - -#endif diff --git a/python/lammps/formats.py b/python/lammps/formats.py index 641e17be3e..d34998f01c 100644 --- a/python/lammps/formats.py +++ b/python/lammps/formats.py @@ -14,14 +14,19 @@ ################################################################################ # LAMMPS output formats # Written by Richard Berger +# and Axel Kohlmeyer ################################################################################ -import re +import re, yaml +try: + from yaml import CSafeLoader as Loader +except ImportError: + from yaml import SafeLoader as Loader class LogFile: """Reads LAMMPS log files and extracts the thermo information - It supports both the default thermo output style (including custom) and multi. + It supports the line, multi, and yaml thermo output styles. :param filename: path to log file :type filename: str @@ -33,11 +38,13 @@ class LogFile: STYLE_DEFAULT = 0 STYLE_MULTI = 1 + STYLE_YAML = 2 def __init__(self, filename): alpha = re.compile(r'[a-df-zA-DF-Z]') # except e or E for floating-point numbers kvpairs = re.compile(r'([a-zA-Z_0-9]+)\s+=\s*([0-9\.eE\-]+)') style = LogFile.STYLE_DEFAULT + yamllog = "" self.runs = [] self.errors = [] with open(filename, 'rt') as f: @@ -46,14 +53,33 @@ class LogFile: for line in f: if "ERROR" in line or "exited on signal" in line: self.errors.append(line) - elif line.startswith('Step '): + + elif re.match(r'^ *Step ', line): in_thermo = True in_data_section = True keys = line.split() current_run = {} for k in keys: current_run[k] = [] - elif line.startswith('---------------- Step'): + + elif re.match(r'^(keywords:.*$|data:$|---$| - \[.*\]$)', line): + style = LogFile.STYLE_YAML + yamllog += line; + current_run = {} + + elif re.match(r'^\.\.\.$', line): + thermo = yaml.load(yamllog, Loader=Loader) + for k in thermo['keywords']: + current_run[k] = [] + for step in thermo['data']: + icol = 0 + for k in thermo['keywords']: + current_run[k].append(step[icol]) + icol += 1 + self.runs.append(current_run) + yamllog = "" + + elif re.match(r'^------* Step ', line): if not in_thermo: current_run = {'Step': [], 'CPU': []} in_thermo = True @@ -64,28 +90,29 @@ class LogFile: cpu = float(str_cpu.split('=')[1].split()[0]) current_run["Step"].append(step) current_run["CPU"].append(cpu) + elif line.startswith('Loop time of'): in_thermo = False - self.runs.append(current_run) + if style != LogFile.STYLE_YAML: + self.runs.append(current_run) + elif in_thermo and in_data_section: if style == LogFile.STYLE_DEFAULT: if alpha.search(line): continue - for k, v in zip(keys, map(float, line.split())): current_run[k].append(v) + elif style == LogFile.STYLE_MULTI: if '=' not in line: in_data_section = False continue - for k,v in kvpairs.findall(line): if k not in current_run: current_run[k] = [float(v)] else: current_run[k].append(float(v)) - class AvgChunkFile: """Reads files generated by fix ave/chunk diff --git a/python/lammps/mliap/__init__.py b/python/lammps/mliap/__init__.py index 0d63cc810b..57fe97d803 100644 --- a/python/lammps/mliap/__init__.py +++ b/python/lammps/mliap/__init__.py @@ -5,7 +5,14 @@ import sysconfig import ctypes library = sysconfig.get_config_vars('INSTSONAME')[0] -pylib = ctypes.CDLL(library) +try: + pylib = ctypes.CDLL(library) +except OSError as e: + if pylib.endswith(".a"): + pylib.strip(".a") + ".so" + pylib = ctypes.CDLL(library) + else: + raise e if not pylib.Py_IsInitialized(): raise RuntimeError("This interpreter is not compatible with python-based mliap for LAMMPS.") del sysconfig, ctypes, library, pylib diff --git a/python/lammps/mliap/pytorch.py b/python/lammps/mliap/pytorch.py index 7ec6c2552a..9aa2da80f4 100644 --- a/python/lammps/mliap/pytorch.py +++ b/python/lammps/mliap/pytorch.py @@ -19,10 +19,75 @@ import numpy as np import torch def calc_n_params(model): + """ + Returns the sum of two decimal numbers in binary digits. + + Parameters: + model (torch.nn.Module): Network model that maps descriptors to a per atom attribute + + Returns: + n_params (int): Number of NN model parameters + """ return sum(p.nelement() for p in model.parameters()) class TorchWrapper(torch.nn.Module): - def __init__(self, model,n_descriptors,n_elements,n_params=None,device=None,dtype=torch.float64): + """ + A class to wrap Modules to ensure lammps mliap compatability. + + ... + + Attributes + ---------- + model : torch.nn.Module + Network model that maps descriptors to a per atom attribute + + device : torch.nn.Module (None) + Accelerator device + + dtype : torch.dtype (torch.float64) + Dtype to use on device + + n_params : torch.nn.Module (None) + Number of NN model parameters + + n_descriptors : int + Max number of per atom descriptors + + n_elements : int + Max number of elements + + + Methods + ------- + forward(descriptors, elems): + Feeds descriptors to network model to produce per atom energies and forces. + """ + + def __init__(self, model, n_descriptors, n_elements, n_params=None, device=None, dtype=torch.float64): + """ + Constructs all the necessary attributes for the network module. + + Parameters + ---------- + model : torch.nn.Module + Network model that maps descriptors to a per atom attribute + + n_descriptors : int + Max number of per atom descriptors + + n_elements : int + Max number of elements + + n_params : torch.nn.Module (None) + Number of NN model parameters + + device : torch.nn.Module (None) + Accelerator device + + dtype : torch.dtype (torch.float64) + Dtype to use on device + """ + super().__init__() self.model = model @@ -40,26 +105,222 @@ class TorchWrapper(torch.nn.Module): self.n_descriptors = n_descriptors self.n_elements = n_elements - def forward(self, elems, bispectrum, beta, energy): + def forward(self, elems, descriptors, beta, energy): + """ + Takes element types and descriptors calculated via lammps and + calculates the per atom energies and forces. - bispectrum = torch.from_numpy(bispectrum).to(dtype=self.dtype, device=self.device).requires_grad_(True) + Parameters + ---------- + elems : numpy.array + Per atom element types + + descriptors : numpy.array + Per atom descriptors + + beta : numpy.array + Expired beta array to be filled with new betas + + energy : numpy.array + Expired per atom energy array to be filled with new per atom energy + (Note: This is a pointer to the lammps per atom energies) + + + Returns + ------- + None + """ + + descriptors = torch.from_numpy(descriptors).to(dtype=self.dtype, device=self.device).requires_grad_(True) elems = torch.from_numpy(elems).to(dtype=torch.long, device=self.device) - 1 with torch.autograd.enable_grad(): - energy_nn = self.model(bispectrum, elems) + energy_nn = self.model(descriptors, elems) if energy_nn.ndim > 1: energy_nn = energy_nn.flatten() - beta_nn = torch.autograd.grad(energy_nn.sum(), bispectrum)[0] + beta_nn = torch.autograd.grad(energy_nn.sum(), descriptors)[0] beta[:] = beta_nn.detach().cpu().numpy().astype(np.float64) energy[:] = energy_nn.detach().cpu().numpy().astype(np.float64) + class IgnoreElems(torch.nn.Module): - def __init__(self,subnet): + """ + A class to represent a NN model agnostic of element typing. + + ... + + Attributes + ---------- + subnet : torch.nn.Module + Network model that maps descriptors to a per atom attribute + + Methods + ------- + forward(descriptors, elems): + Feeds descriptors to network model + """ + + def __init__(self, subnet): + """ + Constructs all the necessary attributes for the network module. + + Parameters + ---------- + subnet : torch.nn.Module + Network model that maps descriptors to a per atom attribute + """ + super().__init__() self.subnet = subnet - def forward(self,bispectrum,elems): - return self.subnet(bispectrum) + def forward(self, descriptors, elems): + """ + Feeds descriptors to network model + + Parameters + ---------- + descriptors : torch.tensor + Per atom descriptors + + elems : torch.tensor + Per atom element types + + Returns + ------- + self.subnet(descriptors) : torch.tensor + Per atom attribute computed by the network model + """ + + return self.subnet(descriptors) + + +class UnpackElems(torch.nn.Module): + """ + A class to represent a NN model pseudo-agnostic of element typing for + systems with multiple element typings. + + ... + + Attributes + ---------- + subnet : torch.nn.Module + Network model that maps descriptors to a per atom attribute + + n_types : int + Number of atom types used in training the NN model. + + Methods + ------- + forward(descriptors, elems): + Feeds descriptors to network model after adding zeros into + descriptor columns relating to different atom types + """ + + def __init__(self, subnet, n_types): + """ + Constructs all the necessary attributes for the network module. + + Parameters + ---------- + subnet : torch.nn.Module + Network model that maps descriptors to a per atom attribute. + + n_types : int + Number of atom types used in training the NN model. + """ + super().__init__() + self.subnet = subnet + self.n_types = n_types + + def forward(self, descriptors, elems): + """ + Feeds descriptors to network model after adding zeros into + descriptor columns relating to different atom types + + Parameters + ---------- + descriptors : torch.tensor + Per atom descriptors + + elems : torch.tensor + Per atom element types + + Returns + ------- + self.subnet(descriptors) : torch.tensor + Per atom attribute computed by the network model + """ + + unpacked_descriptors = torch.zeros(elems.shape[0], self.n_types, descriptors.shape[1], dtype=torch.float64) + for i, ind in enumerate(elems): + unpacked_descriptors[i, ind, :] = descriptors[i] + return self.subnet(torch.reshape(unpacked_descriptors, (elems.shape[0], -1)), elems) + + +class ElemwiseModels(torch.nn.Module): + """ + A class to represent a NN model dependent on element typing. + + ... + + Attributes + ---------- + subnets : list of torch.nn.Modules + Per element type network models that maps per element type + descriptors to a per atom attribute. + + n_types : int + Number of atom types used in training the NN model. + + Methods + ------- + forward(descriptors, elems): + Feeds descriptors to network model after adding zeros into + descriptor columns relating to different atom types + """ + + def __init__(self, subnets, n_types): + """ + Constructs all the necessary attributes for the network module. + + Parameters + ---------- + subnets : list of torch.nn.Modules + Per element type network models that maps per element + type descriptors to a per atom attribute. + + n_types : int + Number of atom types used in training the NN model. + """ + + super().__init__() + self.subnets = subnets + self.n_types = n_types + + def forward(self, descriptors, elems): + """ + Feeds descriptors to network model after adding zeros into + descriptor columns relating to different atom types + + Parameters + ---------- + descriptors : torch.tensor + Per atom descriptors + + elems : torch.tensor + Per atom element types + + Returns + ------- + self.subnets(descriptors) : torch.tensor + Per atom attribute computed by the network model + """ + + per_atom_attributes = torch.zeros(elems.size[0]) + given_elems, elem_indices = torch.unique(elems, return_inverse=True) + for i, elem in enumerate(given_elems): + per_atom_attribute[elem_indices == i] = self.subnets[elem](descriptors[elem_indices == i]) + return per_atom_attributes diff --git a/src/.gitignore b/src/.gitignore index f17fbeb556..37e8b22893 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -254,6 +254,21 @@ /pair_mesont_tpm.cpp /pair_mesont_tpm.h +/atom_vec_bpm_sphere.cpp +/atom_vec_bpm_sphere.h +/bond_bpm.cpp +/bond_bpm.h +/bond_bpm_rotational.cpp +/bond_bpm_rotational.h +/bond_bpm_spring.cpp +/bond_bpm_spring.h +/compute_nbond_atom.cpp +/compute_nbond_atom.h +/fix_nve_bpm_sphere.cpp +/fix_nve_bpm_sphere.h +/pair_bpm_spring.cpp +/pair_bpm_spring.h + /compute_adf.cpp /compute_adf.h /compute_contact_atom.cpp @@ -462,6 +477,8 @@ /compute_fabric.h /compute_fep.cpp /compute_fep.h +/compute_fep_ta.cpp +/compute_fep_ta.h /compute_force_tally.cpp /compute_force_tally.h /compute_gyration_shape.cpp @@ -602,6 +619,8 @@ /dump_xyz_mpiio.h /dump_xyz_zstd.cpp /dump_xyz_zstd.h +/dump_yaml.cpp +/dump_yaml.h /dynamical_matrix.cpp /dynamical_matrix.h /ewald.cpp @@ -790,8 +809,6 @@ /fix_orient_eco.h /fix_orient_fcc.cpp /fix_orient_fcc.h -/fix_pair_tracker.cpp -/fix_pair_tracker.h /fix_peri_neigh.cpp /fix_peri_neigh.h /fix_phonon.cpp @@ -1522,3 +1539,4 @@ /pair_smtbq.h /pair_vashishta*.cpp /pair_vashishta*.h + diff --git a/src/ADIOS/adios_common.h b/src/ADIOS/adios_common.h new file mode 100644 index 0000000000..9b0fb357ea --- /dev/null +++ b/src/ADIOS/adios_common.h @@ -0,0 +1,39 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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. + + Contributed by Norbert Podhorszki (Oak Ridge National Laboratory) +------------------------------------------------------------------------- */ + +#ifndef LMP_ADIOS_COMMON_H +#define LMP_ADIOS_COMMON_H + +// common definitions for all ADIOS package classes + +static const char default_config[] = "\n" + "\n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + "\n"; + +#endif diff --git a/src/ADIOS/dump_atom_adios.cpp b/src/ADIOS/dump_atom_adios.cpp index 7265ef75f5..e6e486e096 100644 --- a/src/ADIOS/dump_atom_adios.cpp +++ b/src/ADIOS/dump_atom_adios.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -24,333 +23,294 @@ #include "memory.h" #include "universe.h" #include "update.h" + #include #include "adios2.h" +#include "adios_common.h" using namespace LAMMPS_NS; -#define MAX_TEXT_HEADER_SIZE 4096 -#define DUMP_BUF_CHUNK_SIZE 16384 -#define DUMP_BUF_INCREMENT_SIZE 4096 +namespace LAMMPS_NS { +class DumpAtomADIOSInternal { -namespace LAMMPS_NS -{ -class DumpAtomADIOSInternal -{ + public: + DumpAtomADIOSInternal(){}; + ~DumpAtomADIOSInternal() = default; -public: - DumpAtomADIOSInternal() {}; - ~DumpAtomADIOSInternal() = default; - - // name of adios group, referrable in adios2_config.xml - const std::string ioName = "atom"; - adios2::ADIOS *ad = nullptr; // adios object - adios2::IO io; // adios group of variables and attributes in this dump - adios2::Engine fh; // adios file/stream handle object - // one ADIOS output variable we need to change every step - adios2::Variable varAtoms; + // name of adios group, referrable in adios2_config.xml + const std::string ioName = "atom"; + adios2::ADIOS *ad = nullptr; // adios object + adios2::IO io; // adios group of variables and attributes in this dump + adios2::Engine fh; // adios file/stream handle object + // one ADIOS output variable we need to change every step + adios2::Variable varAtoms; }; -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS /* ---------------------------------------------------------------------- */ -DumpAtomADIOS::DumpAtomADIOS(LAMMPS *lmp, int narg, char **arg) -: DumpAtom(lmp, narg, arg) +DumpAtomADIOS::DumpAtomADIOS(LAMMPS *lmp, int narg, char **arg) : DumpAtom(lmp, narg, arg) { - internal = new DumpAtomADIOSInternal(); - try { - internal->ad = - new adios2::ADIOS("adios2_config.xml", world, adios2::DebugON); - } catch (std::ios_base::failure &e) { - char str[256]; - snprintf(str, sizeof(str), "ADIOS initialization failed with error: %s", - e.what()); - error->one(FLERR, str); - } + // create a default adios2_config.xml if it doesn't exist yet. + FILE *cfgfp = fopen("adios2_config.xml", "r"); + if (!cfgfp) { + cfgfp = fopen("adios2_config.xml", "w"); + if (cfgfp) fputs(default_config, cfgfp); + } + if (cfgfp) fclose(cfgfp); + + internal = new DumpAtomADIOSInternal(); + try { + internal->ad = new adios2::ADIOS("adios2_config.xml", world, adios2::DebugON); + } catch (std::ios_base::failure &e) { + error->all(FLERR, "ADIOS initialization failed with error: {}", e.what()); + } } /* ---------------------------------------------------------------------- */ DumpAtomADIOS::~DumpAtomADIOS() { - if (internal->fh) { - internal->fh.Close(); - } - delete internal->ad; - delete internal; + if (internal->fh) internal->fh.Close(); + delete internal->ad; + delete internal; } /* ---------------------------------------------------------------------- */ void DumpAtomADIOS::openfile() { - if (multifile) { - // if one file per timestep, replace '*' with current timestep - char *filestar = strdup(filename); - char *filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) - snprintf(filecurrent, sizeof(filecurrent), "%s" BIGINT_FORMAT "%s", - filestar, update->ntimestep, ptr + 1); - else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - snprintf(pad, sizeof(pad), "%%s%%0%d%s%%s", padflag, &bif[1]); - snprintf(filecurrent, sizeof(filecurrent), pad, filestar, - update->ntimestep, ptr + 1); - } - internal->fh = - internal->io.Open(filecurrent, adios2::Mode::Write, world); - if (!internal->fh) { - char str[128]; - snprintf(str, sizeof(str), "Cannot open dump file %s", filecurrent); - error->one(FLERR, str); - } - free(filestar); - delete[] filecurrent; - } else { - if (!singlefile_opened) { - internal->fh = - internal->io.Open(filename, adios2::Mode::Write, world); - if (!internal->fh) { - char str[128]; - snprintf(str, sizeof(str), "Cannot open dump file %s", - filename); - error->one(FLERR, str); - } - singlefile_opened = 1; - } + if (multifile) { + // if one file per timestep, replace '*' with current timestep + auto filecurrent = utils::star_subst(filename, update->ntimestep, padflag); + internal->fh = internal->io.Open(filecurrent, adios2::Mode::Write, world); + if (!internal->fh) error->one(FLERR, "Cannot open dump file {}", filecurrent); + } else { + if (!singlefile_opened) { + internal->fh = internal->io.Open(filename, adios2::Mode::Write, world); + if (!internal->fh) error->one(FLERR, "Cannot open dump file {}", filename); + singlefile_opened = 1; } + } } /* ---------------------------------------------------------------------- */ void DumpAtomADIOS::write() { - if (domain->triclinic == 0) { - boxxlo = domain->boxlo[0]; - boxxhi = domain->boxhi[0]; - boxylo = domain->boxlo[1]; - boxyhi = domain->boxhi[1]; - boxzlo = domain->boxlo[2]; - boxzhi = domain->boxhi[2]; - } else { - boxxlo = domain->boxlo_bound[0]; - boxxhi = domain->boxhi_bound[0]; - boxylo = domain->boxlo_bound[1]; - boxyhi = domain->boxhi_bound[1]; - boxzlo = domain->boxlo_bound[2]; - boxzhi = domain->boxhi_bound[2]; - boxxy = domain->xy; - boxxz = domain->xz; - boxyz = domain->yz; + if (domain->triclinic == 0) { + boxxlo = domain->boxlo[0]; + boxxhi = domain->boxhi[0]; + boxylo = domain->boxlo[1]; + boxyhi = domain->boxhi[1]; + boxzlo = domain->boxlo[2]; + boxzhi = domain->boxhi[2]; + } else { + boxxlo = domain->boxlo_bound[0]; + boxxhi = domain->boxhi_bound[0]; + boxylo = domain->boxlo_bound[1]; + boxyhi = domain->boxhi_bound[1]; + boxzlo = domain->boxlo_bound[2]; + boxzhi = domain->boxhi_bound[2]; + boxxy = domain->xy; + boxxz = domain->xz; + boxyz = domain->yz; + } + + // nme = # of dump lines this proc contributes to dump + + nme = count(); + + // ntotal = total # of atoms in snapshot + // atomOffset = sum of # of atoms up to this proc (exclusive prefix sum) + + bigint bnme = nme; + MPI_Allreduce(&bnme, &ntotal, 1, MPI_LMP_BIGINT, MPI_SUM, world); + + bigint atomOffset; // sum of all atoms on processes 0..me-1 + MPI_Scan(&bnme, &atomOffset, 1, MPI_LMP_BIGINT, MPI_SUM, world); + atomOffset -= nme; // exclusive prefix sum needed + + // Now we know the global size and the local subset size and offset + // of the atoms table + auto nAtomsGlobal = static_cast(ntotal); + auto startRow = static_cast(atomOffset); + auto nAtomsLocal = static_cast(nme); + auto nColumns = static_cast(size_one); + internal->varAtoms.SetShape({nAtomsGlobal, nColumns}); + internal->varAtoms.SetSelection({{startRow, 0}, {nAtomsLocal, nColumns}}); + + // insure buf is sized for packing + // adios does not limit per-process data size so nme*size_one is not + // constrained to int + // if sorting on IDs also request ID list from pack() + // sort buf as needed + + if (nme > maxbuf) { + maxbuf = nme; + memory->destroy(buf); + memory->create(buf, (maxbuf * size_one), "dump:buf"); + } + if (sort_flag && sortcol == 0 && nme > maxids) { + maxids = nme; + memory->destroy(ids); + memory->create(ids, maxids, "dump:ids"); + } + + if (sort_flag && sortcol == 0) + pack(ids); + else + pack(nullptr); + if (sort_flag) sort(); + + openfile(); + internal->fh.BeginStep(); + // write info on data as scalars (by me==0) + if (me == 0) { + internal->fh.Put("ntimestep", update->ntimestep); + internal->fh.Put("nprocs", nprocs); + + internal->fh.Put("boxxlo", boxxlo); + internal->fh.Put("boxxhi", boxxhi); + internal->fh.Put("boxylo", boxylo); + internal->fh.Put("boxyhi", boxyhi); + internal->fh.Put("boxzlo", boxzlo); + internal->fh.Put("boxzhi", boxzhi); + + if (domain->triclinic) { + internal->fh.Put("boxxy", boxxy); + internal->fh.Put("boxxz", boxxz); + internal->fh.Put("boxyz", boxyz); } + } + // Everyone needs to write scalar variables that are used as dimensions and + // offsets of arrays + internal->fh.Put("natoms", ntotal); + internal->fh.Put("ncolumns", size_one); + internal->fh.Put("nme", bnme); + internal->fh.Put("offset", atomOffset); + // now write the atoms + internal->fh.Put(internal->varAtoms, buf); + internal->fh.EndStep(); // I/O will happen now... - // nme = # of dump lines this proc contributes to dump - - nme = count(); - - // ntotal = total # of atoms in snapshot - // atomOffset = sum of # of atoms up to this proc (exclusive prefix sum) - - bigint bnme = nme; - MPI_Allreduce(&bnme, &ntotal, 1, MPI_LMP_BIGINT, MPI_SUM, world); - - bigint atomOffset; // sum of all atoms on processes 0..me-1 - MPI_Scan(&bnme, &atomOffset, 1, MPI_LMP_BIGINT, MPI_SUM, world); - atomOffset -= nme; // exclusive prefix sum needed - - // Now we know the global size and the local subset size and offset - // of the atoms table - size_t nAtomsGlobal = static_cast(ntotal); - size_t startRow = static_cast(atomOffset); - size_t nAtomsLocal = static_cast(nme); - size_t nColumns = static_cast(size_one); - internal->varAtoms.SetShape({nAtomsGlobal, nColumns}); - internal->varAtoms.SetSelection({{startRow, 0}, {nAtomsLocal, nColumns}}); - - // insure buf is sized for packing - // adios does not limit per-process data size so nme*size_one is not - // constrained to int - // if sorting on IDs also request ID list from pack() - // sort buf as needed - - if (nme > maxbuf) { - maxbuf = nme; - memory->destroy(buf); - memory->create(buf, (maxbuf * size_one), "dump:buf"); - } - if (sort_flag && sortcol == 0 && nme > maxids) { - maxids = nme; - memory->destroy(ids); - memory->create(ids, maxids, "dump:ids"); - } - - if (sort_flag && sortcol == 0) - pack(ids); - else - pack(nullptr); - if (sort_flag) - sort(); - - openfile(); - internal->fh.BeginStep(); - // write info on data as scalars (by me==0) - if (me == 0) { - internal->fh.Put("ntimestep", update->ntimestep); - internal->fh.Put("nprocs", nprocs); - - internal->fh.Put("boxxlo", boxxlo); - internal->fh.Put("boxxhi", boxxhi); - internal->fh.Put("boxylo", boxylo); - internal->fh.Put("boxyhi", boxyhi); - internal->fh.Put("boxzlo", boxzlo); - internal->fh.Put("boxzhi", boxzhi); - - if (domain->triclinic) { - internal->fh.Put("boxxy", boxxy); - internal->fh.Put("boxxz", boxxz); - internal->fh.Put("boxyz", boxyz); - } - } - // Everyone needs to write scalar variables that are used as dimensions and - // offsets of arrays - internal->fh.Put("natoms", ntotal); - internal->fh.Put("ncolumns", size_one); - internal->fh.Put("nme", bnme); - internal->fh.Put("offset", atomOffset); - // now write the atoms - internal->fh.Put(internal->varAtoms, buf); - internal->fh.EndStep(); // I/O will happen now... - - if (multifile) { - internal->fh.Close(); - } + if (multifile) internal->fh.Close(); } /* ---------------------------------------------------------------------- */ void DumpAtomADIOS::init_style() { - if (image_flag == 0) - size_one = 5; - else - size_one = 8; + if (image_flag == 0) + size_one = 5; + else + size_one = 8; - // setup boundary string + // setup boundary string - domain->boundary_string(boundstr); + domain->boundary_string(boundstr); - // remove % from filename since ADIOS always writes a global file with - // data/metadata - int len = strlen(filename); - char *ptr = strchr(filename, '%'); - if (ptr) { - *ptr = '\0'; - char *s = new char[len - 1]; - snprintf(s, sizeof(s), "%s%s", filename, ptr + 1); - strncpy(filename, s, len); + // remove % from filename since ADIOS always writes a global file with + // data/metadata. + char *ptr = strchr(filename, '%'); + if (ptr) { + while (*ptr) { + ptr[0] = ptr[1]; + ++ptr; } + } - // setup column string + // setup column string - std::vector columnNames; + std::vector columnNames; - if (scale_flag == 0 && image_flag == 0) { - columns = (char *)"id type x y z"; - columnNames = {"id", "type", "x", "y", "z"}; - } else if (scale_flag == 0 && image_flag == 1) { - columns = (char *)"id type x y z ix iy iz"; - columnNames = {"id", "type", "x", "y", "z", "ix", "iy", "iz"}; - } else if (scale_flag == 1 && image_flag == 0) { - columns = (char *)"id type xs ys zs"; - columnNames = {"id", "type", "xs", "ys", "zs"}; - } else if (scale_flag == 1 && image_flag == 1) { - columns = (char *)"id type xs ys zs ix iy iz"; - columnNames = {"id", "type", "xs", "ys", "zs", "ix", "iy", "iz"}; - } + if (scale_flag == 0 && image_flag == 0) { + columns = (char *) "id type x y z"; + columnNames = {"id", "type", "x", "y", "z"}; + } else if (scale_flag == 0 && image_flag == 1) { + columns = (char *) "id type x y z ix iy iz"; + columnNames = {"id", "type", "x", "y", "z", "ix", "iy", "iz"}; + } else if (scale_flag == 1 && image_flag == 0) { + columns = (char *) "id type xs ys zs"; + columnNames = {"id", "type", "xs", "ys", "zs"}; + } else if (scale_flag == 1 && image_flag == 1) { + columns = (char *) "id type xs ys zs ix iy iz"; + columnNames = {"id", "type", "xs", "ys", "zs", "ix", "iy", "iz"}; + } - // setup function ptrs + for (int icol = 0; icol < (int)columnNames.size(); ++icol) + if (keyword_user[icol].size()) columnNames[icol] = keyword_user[icol]; - if (scale_flag == 1 && image_flag == 0 && domain->triclinic == 0) - pack_choice = &DumpAtomADIOS::pack_scale_noimage; - else if (scale_flag == 1 && image_flag == 1 && domain->triclinic == 0) - pack_choice = &DumpAtomADIOS::pack_scale_image; - else if (scale_flag == 1 && image_flag == 0 && domain->triclinic == 1) - pack_choice = &DumpAtomADIOS::pack_scale_noimage_triclinic; - else if (scale_flag == 1 && image_flag == 1 && domain->triclinic == 1) - pack_choice = &DumpAtomADIOS::pack_scale_image_triclinic; - else if (scale_flag == 0 && image_flag == 0) - pack_choice = &DumpAtomADIOS::pack_noscale_noimage; - else if (scale_flag == 0 && image_flag == 1) - pack_choice = &DumpAtomADIOS::pack_noscale_image; + // setup function ptrs - /* Define the group of variables for the atom style here since it's a fixed + if (scale_flag == 1 && image_flag == 0 && domain->triclinic == 0) + pack_choice = &DumpAtomADIOS::pack_scale_noimage; + else if (scale_flag == 1 && image_flag == 1 && domain->triclinic == 0) + pack_choice = &DumpAtomADIOS::pack_scale_image; + else if (scale_flag == 1 && image_flag == 0 && domain->triclinic == 1) + pack_choice = &DumpAtomADIOS::pack_scale_noimage_triclinic; + else if (scale_flag == 1 && image_flag == 1 && domain->triclinic == 1) + pack_choice = &DumpAtomADIOS::pack_scale_image_triclinic; + else if (scale_flag == 0 && image_flag == 0) + pack_choice = &DumpAtomADIOS::pack_noscale_noimage; + else if (scale_flag == 0 && image_flag == 1) + pack_choice = &DumpAtomADIOS::pack_noscale_image; + + /* Define the group of variables for the atom style here since it's a fixed * set */ - internal->io = internal->ad->DeclareIO(internal->ioName); - if (!internal->io.InConfigFile()) { - // if not defined by user, we can change the default settings - // BPFile is the default writer - internal->io.SetEngine("BPFile"); - int num_aggregators = multiproc; - if (num_aggregators == 0) - num_aggregators = 1; - char nstreams[128]; - snprintf(nstreams, sizeof(nstreams), "%d", num_aggregators); - internal->io.SetParameters({{"substreams", nstreams}}); - if (me == 0 && screen) - fprintf( - screen, - "ADIOS method for %s is n-to-m (aggregation with %s writers)\n", - filename, nstreams); - } + internal->io = internal->ad->DeclareIO(internal->ioName); + if (!internal->io.InConfigFile()) { + // if not defined by user, we can change the default settings + // BPFile is the default writer + internal->io.SetEngine("BPFile"); + int num_aggregators = multiproc; + if (num_aggregators == 0) num_aggregators = 1; + auto nstreams = std::to_string(num_aggregators); + internal->io.SetParameters({{"substreams", nstreams}}); + if (me == 0) + utils::logmesg(lmp, "ADIOS method for {} is n-to-m (aggregation with {} writers)\n", filename, + nstreams); + } - internal->io.DefineVariable("ntimestep"); - internal->io.DefineVariable("natoms"); + internal->io.DefineVariable("ntimestep"); + internal->io.DefineVariable("natoms"); - internal->io.DefineVariable("nprocs"); - internal->io.DefineVariable("ncolumns"); + internal->io.DefineVariable("nprocs"); + internal->io.DefineVariable("ncolumns"); - internal->io.DefineVariable("boxxlo"); - internal->io.DefineVariable("boxxhi"); - internal->io.DefineVariable("boxylo"); - internal->io.DefineVariable("boxyhi"); - internal->io.DefineVariable("boxzlo"); - internal->io.DefineVariable("boxzhi"); + internal->io.DefineVariable("boxxlo"); + internal->io.DefineVariable("boxxhi"); + internal->io.DefineVariable("boxylo"); + internal->io.DefineVariable("boxyhi"); + internal->io.DefineVariable("boxzlo"); + internal->io.DefineVariable("boxzhi"); - internal->io.DefineVariable("boxxy"); - internal->io.DefineVariable("boxxz"); - internal->io.DefineVariable("boxyz"); + internal->io.DefineVariable("boxxy"); + internal->io.DefineVariable("boxxz"); + internal->io.DefineVariable("boxyz"); - internal->io.DefineAttribute("triclinic", domain->triclinic); - internal->io.DefineAttribute("scaled", scale_flag); - internal->io.DefineAttribute("image", image_flag); + internal->io.DefineAttribute("triclinic", domain->triclinic); + internal->io.DefineAttribute("scaled", scale_flag); + internal->io.DefineAttribute("image", image_flag); - int *boundaryptr = reinterpret_cast(domain->boundary); - internal->io.DefineAttribute("boundary", boundaryptr, 6); + int *boundaryptr = reinterpret_cast(domain->boundary); + internal->io.DefineAttribute("boundary", boundaryptr, 6); - size_t nColumns = static_cast(size_one); - internal->io.DefineAttribute("columns", columnNames.data(), - nColumns); - internal->io.DefineAttribute("columnstr", columns); - internal->io.DefineAttribute("boundarystr", boundstr); - internal->io.DefineAttribute("LAMMPS/dump_style", "atom"); - internal->io.DefineAttribute("LAMMPS/version", - lmp->version); - internal->io.DefineAttribute("LAMMPS/num_ver", - std::to_string(lmp->num_ver)); + auto nColumns = static_cast(size_one); + internal->io.DefineAttribute("columns", columnNames.data(), nColumns); + internal->io.DefineAttribute("columnstr", columns); + internal->io.DefineAttribute("boundarystr", boundstr); + internal->io.DefineAttribute("LAMMPS/dump_style", "atom"); + internal->io.DefineAttribute("LAMMPS/version", lmp->version); + internal->io.DefineAttribute("LAMMPS/num_ver", std::to_string(lmp->num_ver)); - internal->io.DefineVariable( - "nme", {adios2::LocalValueDim}); // local dimension variable - internal->io.DefineVariable( - "offset", {adios2::LocalValueDim}); // local dimension variable + // local dimension variables + internal->io.DefineVariable("nme", {adios2::LocalValueDim}); + internal->io.DefineVariable("offset", {adios2::LocalValueDim}); - // atom table size is not known at the moment - // it will be correctly defined at the moment of write - size_t UnknownSizeYet = 1; - internal->varAtoms = internal->io.DefineVariable( - "atoms", {UnknownSizeYet, nColumns}, {UnknownSizeYet, 0}, - {UnknownSizeYet, nColumns}); + // atom table size is not known at the moment + // it will be correctly defined at the moment of write + size_t UnknownSizeYet = 1; + internal->varAtoms = internal->io.DefineVariable( + "atoms", {UnknownSizeYet, nColumns}, {UnknownSizeYet, 0}, {UnknownSizeYet, nColumns}); } diff --git a/src/ADIOS/dump_custom_adios.cpp b/src/ADIOS/dump_custom_adios.cpp index 344c6ff6e9..40d06c15d8 100644 --- a/src/ADIOS/dump_custom_adios.cpp +++ b/src/ADIOS/dump_custom_adios.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -17,427 +16,322 @@ ------------------------------------------------------------------------- */ #include "dump_custom_adios.h" + #include "atom.h" #include "compute.h" #include "domain.h" #include "error.h" #include "fix.h" -#include "force.h" -#include "group.h" #include "input.h" #include "memory.h" #include "modify.h" -#include "region.h" -#include "universe.h" #include "update.h" #include "variable.h" + #include #include #include "adios2.h" +#include "adios_common.h" using namespace LAMMPS_NS; -#define MAX_TEXT_HEADER_SIZE 4096 -#define DUMP_BUF_CHUNK_SIZE 16384 -#define DUMP_BUF_INCREMENT_SIZE 4096 +namespace LAMMPS_NS { +class DumpCustomADIOSInternal { -enum { - ID, - MOL, - TYPE, - ELEMENT, - MASS, - X, - Y, - Z, - XS, - YS, - ZS, - XSTRI, - YSTRI, - ZSTRI, - XU, - YU, - ZU, - XUTRI, - YUTRI, - ZUTRI, - XSU, - YSU, - ZSU, - XSUTRI, - YSUTRI, - ZSUTRI, - IX, - IY, - IZ, - VX, - VY, - VZ, - FX, - FY, - FZ, - Q, - MUX, - MUY, - MUZ, - MU, - RADIUS, - DIAMETER, - OMEGAX, - OMEGAY, - OMEGAZ, - ANGMOMX, - ANGMOMY, - ANGMOMZ, - TQX, - TQY, - TQZ, - SPIN, - ERADIUS, - ERVEL, - ERFORCE, - COMPUTE, - FIX, - VARIABLE + public: + DumpCustomADIOSInternal(){}; + ~DumpCustomADIOSInternal() = default; + + // name of adios group, referrable in adios2_config.xml + const std::string ioName = "custom"; + adios2::ADIOS *ad = nullptr; // adios object + adios2::IO io; // adios group of variables and attributes in this dump + adios2::Engine fh; // adios file/stream handle object + // one ADIOS output variable we need to change every step + adios2::Variable varAtoms; + // list of column names for the atom table + // (individual list of 'columns' string) + std::vector columnNames; }; -enum { LT, LE, GT, GE, EQ, NEQ }; -enum { INT, DOUBLE, STRING, BIGINT }; // same as in DumpCustom - -namespace LAMMPS_NS -{ -class DumpCustomADIOSInternal -{ - -public: - DumpCustomADIOSInternal() {}; - ~DumpCustomADIOSInternal() = default; - - // name of adios group, referrable in adios2_config.xml - const std::string ioName = "custom"; - adios2::ADIOS *ad = nullptr; // adios object - adios2::IO io; // adios group of variables and attributes in this dump - adios2::Engine fh; // adios file/stream handle object - // one ADIOS output variable we need to change every step - adios2::Variable varAtoms; - // list of column names for the atom table - // (individual list of 'columns' string) - std::vector columnNames; -}; -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS /* ---------------------------------------------------------------------- */ -DumpCustomADIOS::DumpCustomADIOS(LAMMPS *lmp, int narg, char **arg) -: DumpCustom(lmp, narg, arg) +DumpCustomADIOS::DumpCustomADIOS(LAMMPS *lmp, int narg, char **arg) : DumpCustom(lmp, narg, arg) { - internal = new DumpCustomADIOSInternal(); - try { - internal->ad = - new adios2::ADIOS("adios2_config.xml", world, adios2::DebugON); - } catch (std::ios_base::failure &e) { - char str[256]; - snprintf(str, sizeof(str), "ADIOS initialization failed with error: %s", - e.what()); - error->one(FLERR, str); - } + // create a default adios2_config.xml if it doesn't exist yet. + FILE *cfgfp = fopen("adios2_config.xml", "r"); + if (!cfgfp) { + cfgfp = fopen("adios2_config.xml", "w"); + if (cfgfp) fputs(default_config, cfgfp); + } + if (cfgfp) fclose(cfgfp); - // if (screen) fprintf(screen, "DumpCustomADIOS constructor: nvariable=%d - // id_variable=%p, variables=%p, nfield=%d, earg=%p\n", nvariable, - // id_variable, variable, nfield, earg); - internal->columnNames.reserve(nfield); - for (int i = 0; i < nfield; ++i) { - internal->columnNames.push_back(earg[i]); - // if (screen) fprintf(screen, "earg[%d] = '%s'\n", i, earg[i]); - } + internal = new DumpCustomADIOSInternal(); + try { + internal->ad = new adios2::ADIOS("adios2_config.xml", world, adios2::DebugON); + } catch (std::ios_base::failure &e) { + error->all(FLERR, "ADIOS initialization failed with error: {}", e.what()); + } + + internal->columnNames.reserve(nfield); + for (int i = 0; i < nfield; ++i) { internal->columnNames.push_back(earg[i]); } } /* ---------------------------------------------------------------------- */ DumpCustomADIOS::~DumpCustomADIOS() { - internal->columnNames.clear(); - if (internal->fh) { - internal->fh.Close(); - } - delete internal->ad; - delete internal; + internal->columnNames.clear(); + if (internal->fh) { internal->fh.Close(); } + delete internal->ad; + delete internal; } /* ---------------------------------------------------------------------- */ void DumpCustomADIOS::openfile() { - if (multifile) { - // if one file per timestep, replace '*' with current timestep - char *filestar = strdup(filename); - char *filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, - update->ntimestep, ptr + 1); - else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); - sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); - } - internal->fh = - internal->io.Open(filecurrent, adios2::Mode::Write, world); - if (!internal->fh) { - char str[128]; - sprintf(str, "Cannot open dump file %s", filecurrent); - error->one(FLERR, str); - } - free(filestar); - delete[] filecurrent; - } else { - if (!singlefile_opened) { - internal->fh = - internal->io.Open(filename, adios2::Mode::Write, world); - if (!internal->fh) { - char str[128]; - sprintf(str, "Cannot open dump file %s", filename); - error->one(FLERR, str); - } - singlefile_opened = 1; - } + if (multifile) { + // if one file per timestep, replace '*' with current timestep + auto filecurrent = utils::star_subst(filename, update->ntimestep, padflag); + internal->fh = internal->io.Open(filecurrent, adios2::Mode::Write, world); + if (!internal->fh) error->one(FLERR, "Cannot open dump file {}", filecurrent); + } else { + if (!singlefile_opened) { + internal->fh = internal->io.Open(filename, adios2::Mode::Write, world); + if (!internal->fh) error->one(FLERR, "Cannot open dump file {}", filename); + singlefile_opened = 1; } + } } /* ---------------------------------------------------------------------- */ void DumpCustomADIOS::write() { - if (domain->triclinic == 0) { - boxxlo = domain->boxlo[0]; - boxxhi = domain->boxhi[0]; - boxylo = domain->boxlo[1]; - boxyhi = domain->boxhi[1]; - boxzlo = domain->boxlo[2]; - boxzhi = domain->boxhi[2]; - } else { - boxxlo = domain->boxlo_bound[0]; - boxxhi = domain->boxhi_bound[0]; - boxylo = domain->boxlo_bound[1]; - boxyhi = domain->boxhi_bound[1]; - boxzlo = domain->boxlo_bound[2]; - boxzhi = domain->boxhi_bound[2]; - boxxy = domain->xy; - boxxz = domain->xz; - boxyz = domain->yz; + if (domain->triclinic == 0) { + boxxlo = domain->boxlo[0]; + boxxhi = domain->boxhi[0]; + boxylo = domain->boxlo[1]; + boxyhi = domain->boxhi[1]; + boxzlo = domain->boxlo[2]; + boxzhi = domain->boxhi[2]; + } else { + boxxlo = domain->boxlo_bound[0]; + boxxhi = domain->boxhi_bound[0]; + boxylo = domain->boxlo_bound[1]; + boxyhi = domain->boxhi_bound[1]; + boxzlo = domain->boxlo_bound[2]; + boxzhi = domain->boxhi_bound[2]; + boxxy = domain->xy; + boxxz = domain->xz; + boxyz = domain->yz; + } + + // nme = # of dump lines this proc contributes to dump + + nme = count(); + + // ntotal = total # of atoms in snapshot + // atomOffset = sum of # of atoms up to this proc (exclusive prefix sum) + + bigint bnme = nme; + MPI_Allreduce(&bnme, &ntotal, 1, MPI_LMP_BIGINT, MPI_SUM, world); + + bigint atomOffset; // sum of all atoms on processes 0..me-1 + MPI_Scan(&bnme, &atomOffset, 1, MPI_LMP_BIGINT, MPI_SUM, world); + atomOffset -= nme; // exclusive prefix sum needed + + // Now we know the global size and the local subset size and offset + // of the atoms table + auto nAtomsGlobal = static_cast(ntotal); + auto startRow = static_cast(atomOffset); + auto nAtomsLocal = static_cast(nme); + auto nColumns = static_cast(size_one); + internal->varAtoms.SetShape({nAtomsGlobal, nColumns}); + internal->varAtoms.SetSelection({{startRow, 0}, {nAtomsLocal, nColumns}}); + + // insure filewriter proc can receive everyone's info + // limit nmax*size_one to int since used as arg in MPI_Rsend() below + // pack my data into buf + // if sorting on IDs also request ID list from pack() + // sort buf as needed + + if (nme > maxbuf) { + if ((bigint) nme * size_one > MAXSMALLINT) error->all(FLERR, "Too much per-proc info for dump"); + maxbuf = nme; + memory->destroy(buf); + memory->create(buf, (maxbuf * size_one), "dump:buf"); + } + if (sort_flag && sortcol == 0 && nme > maxids) { + maxids = nme; + memory->destroy(ids); + memory->create(ids, maxids, "dump:ids"); + } + + if (sort_flag && sortcol == 0) + pack(ids); + else + pack(nullptr); + if (sort_flag) sort(); + + openfile(); + internal->fh.BeginStep(); + // write info on data as scalars (by me==0) + if (me == 0) { + internal->fh.Put("ntimestep", update->ntimestep); + internal->fh.Put("nprocs", nprocs); + + internal->fh.Put("boxxlo", boxxlo); + internal->fh.Put("boxxhi", boxxhi); + internal->fh.Put("boxylo", boxylo); + internal->fh.Put("boxyhi", boxyhi); + internal->fh.Put("boxzlo", boxzlo); + internal->fh.Put("boxzhi", boxzhi); + + if (domain->triclinic) { + internal->fh.Put("boxxy", boxxy); + internal->fh.Put("boxxz", boxxz); + internal->fh.Put("boxyz", boxyz); } + } + // Everyone needs to write scalar variables that are used as dimensions and + // offsets of arrays + internal->fh.Put("natoms", ntotal); + internal->fh.Put("ncolumns", size_one); + internal->fh.Put("nme", bnme); + internal->fh.Put("offset", atomOffset); + // now write the atoms + internal->fh.Put("atoms", buf); + internal->fh.EndStep(); // I/O will happen now... - // nme = # of dump lines this proc contributes to dump - - nme = count(); - - // ntotal = total # of atoms in snapshot - // atomOffset = sum of # of atoms up to this proc (exclusive prefix sum) - - bigint bnme = nme; - MPI_Allreduce(&bnme, &ntotal, 1, MPI_LMP_BIGINT, MPI_SUM, world); - - bigint atomOffset; // sum of all atoms on processes 0..me-1 - MPI_Scan(&bnme, &atomOffset, 1, MPI_LMP_BIGINT, MPI_SUM, world); - atomOffset -= nme; // exclusive prefix sum needed - - // Now we know the global size and the local subset size and offset - // of the atoms table - size_t nAtomsGlobal = static_cast(ntotal); - size_t startRow = static_cast(atomOffset); - size_t nAtomsLocal = static_cast(nme); - size_t nColumns = static_cast(size_one); - internal->varAtoms.SetShape({nAtomsGlobal, nColumns}); - internal->varAtoms.SetSelection({{startRow, 0}, {nAtomsLocal, nColumns}}); - - // insure filewriter proc can receive everyone's info - // limit nmax*size_one to int since used as arg in MPI_Rsend() below - // pack my data into buf - // if sorting on IDs also request ID list from pack() - // sort buf as needed - - if (nme > maxbuf) { - if ((bigint)nme * size_one > MAXSMALLINT) - error->all(FLERR, "Too much per-proc info for dump"); - maxbuf = nme; - memory->destroy(buf); - memory->create(buf, (maxbuf * size_one), "dump:buf"); - } - if (sort_flag && sortcol == 0 && nme > maxids) { - maxids = nme; - memory->destroy(ids); - memory->create(ids, maxids, "dump:ids"); - } - - if (sort_flag && sortcol == 0) - pack(ids); - else - pack(nullptr); - if (sort_flag) - sort(); - - openfile(); - internal->fh.BeginStep(); - // write info on data as scalars (by me==0) - if (me == 0) { - internal->fh.Put("ntimestep", update->ntimestep); - internal->fh.Put("nprocs", nprocs); - - internal->fh.Put("boxxlo", boxxlo); - internal->fh.Put("boxxhi", boxxhi); - internal->fh.Put("boxylo", boxylo); - internal->fh.Put("boxyhi", boxyhi); - internal->fh.Put("boxzlo", boxzlo); - internal->fh.Put("boxzhi", boxzhi); - - if (domain->triclinic) { - internal->fh.Put("boxxy", boxxy); - internal->fh.Put("boxxz", boxxz); - internal->fh.Put("boxyz", boxyz); - } - } - // Everyone needs to write scalar variables that are used as dimensions and - // offsets of arrays - internal->fh.Put("natoms", ntotal); - internal->fh.Put("ncolumns", size_one); - internal->fh.Put("nme", bnme); - internal->fh.Put("offset", atomOffset); - // now write the atoms - internal->fh.Put("atoms", buf); - internal->fh.EndStep(); // I/O will happen now... - - if (multifile) { - internal->fh.Close(); - } + if (multifile) { internal->fh.Close(); } } /* ---------------------------------------------------------------------- */ void DumpCustomADIOS::init_style() { + // assemble column string from defaults and user values - // setup boundary string + delete[] columns; + std::string combined; + int icol = 0; + for (auto item : utils::split_words(columns_default)) { + if (combined.size()) combined += " "; + if (keyword_user[icol].size()) combined += keyword_user[icol]; + else combined += item; + ++icol; + } + columns = utils::strdup(combined); - domain->boundary_string(boundstr); + // setup boundary string - // remove % from filename since ADIOS always writes a global file with - // data/metadata - int len = strlen(filename); - char *ptr = strchr(filename, '%'); - if (ptr) { - *ptr = '\0'; - char *s = new char[len - 1]; - sprintf(s, "%s%s", filename, ptr + 1); - strncpy(filename, s, len); + domain->boundary_string(boundstr); + + // remove % from filename since ADIOS always writes a global file with + // data/metadata + char *ptr = strchr(filename, '%'); + if (ptr) { + while (*ptr) { + ptr[0] = ptr[1]; + ++ptr; } + } - /* The next four loops are copied from dump_custom_mpiio, but nothing is - * done with them. - * It is unclear why we need them here. - * For metadata, variable[] will be written out as an ADIOS attribute if - * nvariable>0 - */ - // find current ptr for each compute,fix,variable - // check that fix frequency is acceptable - int icompute; - for (int i = 0; i < ncompute; i++) { - icompute = modify->find_compute(id_compute[i]); - if (icompute < 0) - error->all(FLERR, "Could not find dump custom compute ID"); - compute[i] = modify->compute[icompute]; - } + /* The next four loops are copied from dump_custom_mpiio, but nothing is + * done with them. + * It is unclear why we need them here. + * For metadata, variable[] will be written out as an ADIOS attribute if + * nvariable>0 + */ + // find current ptr for each compute,fix,variable + // check that fix frequency is acceptable + int icompute; + for (int i = 0; i < ncompute; i++) { + icompute = modify->find_compute(id_compute[i]); + if (icompute < 0) error->all(FLERR, "Could not find dump custom compute ID"); + compute[i] = modify->compute[icompute]; + } - int ifix; - for (int i = 0; i < nfix; i++) { - ifix = modify->find_fix(id_fix[i]); - if (ifix < 0) - error->all(FLERR, "Could not find dump custom fix ID"); - fix[i] = modify->fix[ifix]; - if (nevery % modify->fix[ifix]->peratom_freq) - error->all(FLERR, - "Dump custom and fix not computed at compatible times"); - } + int ifix; + for (int i = 0; i < nfix; i++) { + ifix = modify->find_fix(id_fix[i]); + if (ifix < 0) error->all(FLERR, "Could not find dump custom fix ID"); + fix[i] = modify->fix[ifix]; + if (nevery % modify->fix[ifix]->peratom_freq) + error->all(FLERR, "Dump custom and fix not computed at compatible times"); + } - int ivariable; - for (int i = 0; i < nvariable; i++) { - ivariable = input->variable->find(id_variable[i]); - if (ivariable < 0) - error->all(FLERR, "Could not find dump custom variable name"); - variable[i] = ivariable; - } + int ivariable; + for (int i = 0; i < nvariable; i++) { + ivariable = input->variable->find(id_variable[i]); + if (ivariable < 0) error->all(FLERR, "Could not find dump custom variable name"); + variable[i] = ivariable; + } - // set index and check validity of region - if (iregion >= 0) { - iregion = domain->find_region(idregion); - if (iregion == -1) - error->all(FLERR, "Region ID for dump custom does not exist"); - } + // set index and check validity of region + if (iregion >= 0) { + iregion = domain->find_region(idregion); + if (iregion == -1) error->all(FLERR, "Region ID for dump custom does not exist"); + } - /* Define the group of variables for the atom style here since it's a fixed - * set */ - internal->io = internal->ad->DeclareIO(internal->ioName); - if (!internal->io.InConfigFile()) { - // if not defined by user, we can change the default settings - // BPFile is the default writer - internal->io.SetEngine("BPFile"); - int num_aggregators = multiproc; - if (num_aggregators == 0) - num_aggregators = 1; - char nstreams[128]; - sprintf(nstreams, "%d", num_aggregators); - internal->io.SetParameters({{"substreams", nstreams}}); - if (me == 0 && screen) - fprintf( - screen, - "ADIOS method for %s is n-to-m (aggregation with %s writers)\n", - filename, nstreams); - } + /* Define the group of variables for the atom style here since it's a fixed + * set */ + internal->io = internal->ad->DeclareIO(internal->ioName); + if (!internal->io.InConfigFile()) { + // if not defined by user, we can change the default settings + // BPFile is the default writer + internal->io.SetEngine("BPFile"); + int num_aggregators = multiproc; + if (num_aggregators == 0) num_aggregators = 1; + auto nstreams = std::to_string(num_aggregators); + internal->io.SetParameters({{"substreams", nstreams}}); + if (me == 0) + utils::logmesg(lmp, "ADIOS method for {} is n-to-m (aggregation with {} writers)\n", filename, + nstreams); + } - internal->io.DefineVariable("ntimestep"); - internal->io.DefineVariable("natoms"); + internal->io.DefineVariable("ntimestep"); + internal->io.DefineVariable("natoms"); - internal->io.DefineVariable("nprocs"); - internal->io.DefineVariable("ncolumns"); + internal->io.DefineVariable("nprocs"); + internal->io.DefineVariable("ncolumns"); - internal->io.DefineVariable("boxxlo"); - internal->io.DefineVariable("boxxhi"); - internal->io.DefineVariable("boxylo"); - internal->io.DefineVariable("boxyhi"); - internal->io.DefineVariable("boxzlo"); - internal->io.DefineVariable("boxzhi"); + internal->io.DefineVariable("boxxlo"); + internal->io.DefineVariable("boxxhi"); + internal->io.DefineVariable("boxylo"); + internal->io.DefineVariable("boxyhi"); + internal->io.DefineVariable("boxzlo"); + internal->io.DefineVariable("boxzhi"); - internal->io.DefineVariable("boxxy"); - internal->io.DefineVariable("boxxz"); - internal->io.DefineVariable("boxyz"); + internal->io.DefineVariable("boxxy"); + internal->io.DefineVariable("boxxz"); + internal->io.DefineVariable("boxyz"); - internal->io.DefineAttribute("triclinic", domain->triclinic); + internal->io.DefineAttribute("triclinic", domain->triclinic); - int *boundaryptr = reinterpret_cast(domain->boundary); - internal->io.DefineAttribute("boundary", boundaryptr, 6); + int *boundaryptr = reinterpret_cast(domain->boundary); + internal->io.DefineAttribute("boundary", boundaryptr, 6); - size_t nColumns = static_cast(size_one); - internal->io.DefineAttribute( - "columns", internal->columnNames.data(), nColumns); - internal->io.DefineAttribute("columnstr", columns); - internal->io.DefineAttribute("boundarystr", boundstr); - internal->io.DefineAttribute("LAMMPS/dump_style", "custom"); - internal->io.DefineAttribute("LAMMPS/version", - lmp->version); - internal->io.DefineAttribute("LAMMPS/num_ver", - std::to_string(lmp->num_ver)); + auto nColumns = static_cast(size_one); + internal->io.DefineAttribute("columns", internal->columnNames.data(), nColumns); + internal->io.DefineAttribute("columnstr", columns); + internal->io.DefineAttribute("boundarystr", boundstr); + internal->io.DefineAttribute("LAMMPS/dump_style", "custom"); + internal->io.DefineAttribute("LAMMPS/version", lmp->version); + internal->io.DefineAttribute("LAMMPS/num_ver", std::to_string(lmp->num_ver)); - internal->io.DefineVariable( - "nme", {adios2::LocalValueDim}); // local dimension variable - internal->io.DefineVariable( - "offset", {adios2::LocalValueDim}); // local dimension variable + internal->io.DefineVariable("nme", + {adios2::LocalValueDim}); // local dimension variable + internal->io.DefineVariable("offset", + {adios2::LocalValueDim}); // local dimension variable - // atom table size is not known at the moment - // it will be correctly defined at the moment of write - size_t UnknownSizeYet = 1; - internal->varAtoms = internal->io.DefineVariable( - "atoms", {UnknownSizeYet, nColumns}, {UnknownSizeYet, 0}, - {UnknownSizeYet, nColumns}); + // atom table size is not known at the moment + // it will be correctly defined at the moment of write + size_t UnknownSizeYet = 1; + internal->varAtoms = internal->io.DefineVariable( + "atoms", {UnknownSizeYet, nColumns}, {UnknownSizeYet, 0}, {UnknownSizeYet, nColumns}); } diff --git a/src/ADIOS/reader_adios.cpp b/src/ADIOS/reader_adios.cpp index 04c0fed9eb..893346ec71 100644 --- a/src/ADIOS/reader_adios.cpp +++ b/src/ADIOS/reader_adios.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -17,20 +16,20 @@ ------------------------------------------------------------------------- */ #include "reader_adios.h" + #include "comm.h" #include "error.h" #include "memory.h" + #include #include #include #include "adios2.h" -#include "math_const.h" +#include "adios_common.h" using namespace LAMMPS_NS; -using namespace MathConst; - // also in read_dump.cpp enum { ID, TYPE, X, Y, Z, VX, VY, VZ, Q, IX, IY, IZ, FX, FY, FZ }; @@ -38,78 +37,69 @@ enum { UNSET, NOSCALE_NOWRAP, NOSCALE_WRAP, SCALE_NOWRAP, SCALE_WRAP }; #define SMALL 1.0e-6 -// true if the difference between two floats is "small". -// cannot use fabsf() since it is not fully portable. -static bool is_smalldiff(const float &val1, const float &val2) -{ - return (fabs(static_cast(val1 - val2)) < SMALL); -} +namespace LAMMPS_NS { +class ReadADIOSInternal { -namespace LAMMPS_NS -{ -class ReadADIOSInternal -{ + public: + ReadADIOSInternal(){}; + ~ReadADIOSInternal() = default; -public: - ReadADIOSInternal() {}; - ~ReadADIOSInternal() = default; - - // name of adios group, referrable in adios2_config.xml - const std::string ioName = "read_dump"; - adios2::ADIOS *ad = nullptr; // adios object - adios2::IO io; // adios group of variables and attributes in this dump - adios2::Engine fh; // adios file/stream handle object - // ADIOS input variables we need to change every step - adios2::Variable varNtimestep; - adios2::Variable varNatoms; - adios2::Variable varAtoms; - // list of column names for the atom table - // (individual list of 'columns' string) - std::vector columnNames; - float timeout = 0.0; + // name of adios group, referrable in adios2_config.xml + const std::string ioName = "read_dump"; + adios2::ADIOS *ad = nullptr; // adios object + adios2::IO io; // adios group of variables and attributes in this dump + adios2::Engine fh; // adios file/stream handle object + // ADIOS input variables we need to change every step + adios2::Variable varNtimestep; + adios2::Variable varNatoms; + adios2::Variable varAtoms; + // list of column names for the atom table + // (individual list of 'columns' string) + std::vector columnNames; + float timeout = 0.0; }; -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS /* ---------------------------------------------------------------------- */ ReaderADIOS::ReaderADIOS(LAMMPS *lmp) : Reader(lmp) { - fieldindex = nullptr; - nAtoms = 0; - nAtomsTotal = 0; - atomOffset = 0; - nstep = 0; - nid = 0; - me = comm->me; + fieldindex = nullptr; + nAtoms = 0; + nAtomsTotal = 0; + atomOffset = 0; + nstep = 0; + nid = 0; + me = comm->me; - internal = new ReadADIOSInternal(); - try { - internal->ad = - new adios2::ADIOS("adios2_config.xml", world, adios2::DebugON); - } catch (std::ios_base::failure &e) { - char str[256]; - snprintf(str, sizeof(str), "ADIOS initialization failed with error: %s", - e.what()); - error->one(FLERR, str); - } + // create a default adios2_config.xml if it doesn't exist yet. + FILE *cfgfp = fopen("adios2_config.xml", "r"); + if (!cfgfp) { + cfgfp = fopen("adios2_config.xml", "w"); + if (cfgfp) fputs(default_config, cfgfp); + } + if (cfgfp) fclose(cfgfp); - /* Define the group holding all variables and attributes */ - internal->io = internal->ad->DeclareIO(internal->ioName); + internal = new ReadADIOSInternal(); + try { + internal->ad = new adios2::ADIOS("adios2_config.xml", world, adios2::DebugON); + } catch (std::ios_base::failure &e) { + error->one(FLERR, "ADIOS initialization failed with error: {}", e.what()); + } + + /* Define the group holding all variables and attributes */ + internal->io = internal->ad->DeclareIO(internal->ioName); } /* ---------------------------------------------------------------------- */ ReaderADIOS::~ReaderADIOS() { - if (me == 0) { - memory->destroy(fieldindex); - } - internal->columnNames.clear(); - if (internal->fh) { - internal->fh.Close(); - } - delete internal->ad; - delete internal; + if (me == 0) memory->destroy(fieldindex); + internal->columnNames.clear(); + if (internal->fh) internal->fh.Close(); + delete internal->ad; + delete internal; } /* ---------------------------------------------------------------------- @@ -118,23 +108,19 @@ ReaderADIOS::~ReaderADIOS() ------------------------------------------------------------------------- */ void ReaderADIOS::settings(int narg, char **arg) { - int idx = 0; - while (idx < narg) { - if (!strcmp(arg[idx], "timeout")) { - if (idx + 1 < narg) { - internal->timeout = std::stof(arg[idx + 1]); - internal->io.SetParameter("OpenTimeoutSecs", arg[idx + 1]); - ++idx; - } else { - char str[128]; - snprintf(str, sizeof(str), - "Missing value for 'timeout' option for ADIOS " - "read_dump command"); - error->one(FLERR, str); - } - } + int idx = 0; + while (idx < narg) { + if (!strcmp(arg[idx], "timeout")) { + if (idx + 1 < narg) { + internal->timeout = std::stof(arg[idx + 1]); + internal->io.SetParameter("OpenTimeoutSecs", arg[idx + 1]); ++idx; + } else { + error->one(FLERR, "Missing value for 'timeout' option for ADIOS read_dump command"); + } } + ++idx; + } } /* ---------------------------------------------------------------------- @@ -142,26 +128,17 @@ void ReaderADIOS::settings(int narg, char **arg) Every process must call this Collective operation ------------------------------------------------------------------------- */ -void ReaderADIOS::open_file(const char *file) +void ReaderADIOS::open_file(const std::string &file) { - int rv; - char str[1024]; + // close open file, if needed. + if (internal->fh) internal->fh.Close(); - // close open file, if needed. - if (internal->fh) - internal->fh.Close(); - - try { - internal->fh = internal->io.Open(file, adios2::Mode::Read, world); - } catch (std::ios_base::failure &e) { - char str[256]; - snprintf(str, sizeof(str), "%s", e.what()); - error->one(FLERR, str); - } - if (!internal->fh) { - snprintf(str, sizeof(str), "Cannot open file %s using ADIOS", file); - error->one(FLERR, str); - } + try { + internal->fh = internal->io.Open(file, adios2::Mode::Read, world); + } catch (std::ios_base::failure &e) { + error->one(FLERR, "Error opening file {}: {}", file, e.what()); + } + if (!internal->fh) error->one(FLERR, "Cannot open file {} using ADIOS", file); } /* ---------------------------------------------------------------------- @@ -171,10 +148,8 @@ void ReaderADIOS::open_file(const char *file) void ReaderADIOS::close_file() { - // close open file, if needed. - if (internal->fh) { - internal->fh.Close(); - } + // close open file, if needed. + if (internal->fh) { internal->fh.Close(); } } /* ---------------------------------------------------------------------- @@ -185,34 +160,24 @@ void ReaderADIOS::close_file() int ReaderADIOS::read_time(bigint &ntimestep) { - char str[1024]; + adios2::StepStatus status = internal->fh.BeginStep(adios2::StepMode::Read, internal->timeout); - adios2::StepStatus status = - internal->fh.BeginStep(adios2::StepMode::Read, internal->timeout); - - switch (status) { + switch (status) { case adios2::StepStatus::EndOfStream: case adios2::StepStatus::NotReady: case adios2::StepStatus::OtherError: - return 1; + return 1; default: - break; - } + break; + } - internal->varNtimestep = - internal->io.InquireVariable("ntimestep"); + internal->varNtimestep = internal->io.InquireVariable("ntimestep"); - if (!internal->varNtimestep) { - snprintf(str, sizeof(str), - "Did not find 'ntimestep' variable in ADIOS file %s", - internal->fh.Name().c_str()); - error->one(FLERR, str); - } + if (!internal->varNtimestep) + error->one(FLERR, "Did not find 'ntimestep' variable in ADIOS file {}", internal->fh.Name()); - ntimestep = static_cast(internal->varNtimestep.Max()); - // std::cerr << " **** ReaderADIOS::read_time found step " << ntimestep - // << " **** " << std::endl; - return 0; + ntimestep = static_cast(internal->varNtimestep.Max()); + return 0; } /* ---------------------------------------------------------------------- @@ -220,7 +185,10 @@ int ReaderADIOS::read_time(bigint &ntimestep) Called by all processors. ------------------------------------------------------------------------- */ -void ReaderADIOS::skip() { internal->fh.EndStep(); } +void ReaderADIOS::skip() +{ + internal->fh.EndStep(); +} /* ---------------------------------------------------------------------- read remaining header info: @@ -236,234 +204,205 @@ void ReaderADIOS::skip() { internal->fh.EndStep(); } only called by proc 0 ------------------------------------------------------------------------- */ -bigint ReaderADIOS::read_header(double box[3][3], int &boxinfo, int &triclinic, - int fieldinfo, int nfield, int *fieldtype, - char **fieldlabel, int scaleflag, int wrapflag, - int &fieldflag, int &xflag, int &yflag, - int &zflag) +bigint ReaderADIOS::read_header(double box[3][3], int &boxinfo, int &triclinic, int fieldinfo, + int nfield, int *fieldtype, char **fieldlabel, int scaleflag, + int wrapflag, int &fieldflag, int &xflag, int &yflag, int &zflag) { - char str[1024]; - nid = 0; + nid = 0; - // signal that we have no box info at all so far. + // signal that we have no box info at all so far. - internal->varNatoms = internal->io.InquireVariable("natoms"); - if (!internal->varNatoms) { - snprintf(str, sizeof(str), - "Did not find 'natoms' variable in ADIOS file %s", - internal->fh.Name().c_str()); - error->one(FLERR, str); + internal->varNatoms = internal->io.InquireVariable("natoms"); + if (!internal->varNatoms) + error->one(FLERR, "Did not find 'natoms' variable in ADIOS file {}", internal->fh.Name()); + + /* nAtoms */ + nAtomsTotal = internal->varNatoms.Max(); + uint64_t rem = nAtomsTotal % comm->nprocs; + nAtoms = nAtomsTotal / comm->nprocs; + atomOffset = comm->me * nAtoms; + if (comm->me < (int)rem) { + ++nAtoms; + atomOffset += comm->me; + } else { + atomOffset += rem; + } + + /* triclinic */ + adios2::Attribute attTriclinic = internal->io.InquireAttribute("triclinic"); + if (!attTriclinic) + error->one(FLERR, "Did not find 'triclinic' attribute in ADIOS file {}", internal->fh.Name()); + + triclinic = attTriclinic.Data()[0]; + + /* read Box */ + adios2::Variable varBoxxlo = internal->io.InquireVariable("boxxlo"); + adios2::Variable varBoxxhi = internal->io.InquireVariable("boxxhi"); + adios2::Variable varBoxylo = internal->io.InquireVariable("boxylo"); + adios2::Variable varBoxyhi = internal->io.InquireVariable("boxyhi"); + adios2::Variable varBoxzlo = internal->io.InquireVariable("boxzlo"); + adios2::Variable varBoxzhi = internal->io.InquireVariable("boxzhi"); + + box[0][0] = varBoxxlo.Max(); + box[0][1] = varBoxxhi.Max(); + box[0][2] = 0.0; + box[1][0] = varBoxylo.Max(); + box[1][1] = varBoxyhi.Max(); + box[1][2] = 0.0; + box[2][0] = varBoxzlo.Max(); + box[2][1] = varBoxzhi.Max(); + box[2][2] = 0.0; + + if (triclinic) { + adios2::Variable varBoxxy = internal->io.InquireVariable("boxxy"); + adios2::Variable varBoxxz = internal->io.InquireVariable("boxxz"); + adios2::Variable varBoxyz = internal->io.InquireVariable("boxyz"); + + box[0][2] = varBoxxy.Max(); + box[1][2] = varBoxxz.Max(); + box[2][2] = varBoxyz.Max(); + } + + boxinfo = 1; + + // if no field info requested, just return + + if (!fieldinfo) return nAtoms; + + memory->create(fieldindex, nfield, "read_dump:fieldindex"); + + /* Columns */ + adios2::Attribute attColumns = internal->io.InquireAttribute("columns"); + + std::vector labelVector = attColumns.Data(); + int nwords = labelVector.size(); + std::map labels; + for (int i = 0; i < nwords; ++i) { labels.emplace(labelVector[i], i); } + + int s_index, u_index, su_index; + xflag = UNSET; + yflag = UNSET; + zflag = UNSET; + + // copy fieldtype list for supported fields + + for (int i = 0; i < nfield; i++) { + if (fieldlabel[i]) { + fieldindex[i] = find_label(fieldlabel[i], labels); + if (fieldtype[i] == X) + xflag = 2 * scaleflag + wrapflag + 1; + else if (fieldtype[i] == Y) + yflag = 2 * scaleflag + wrapflag + 1; + else if (fieldtype[i] == Z) + zflag = 2 * scaleflag + wrapflag + 1; } - /* nAtoms */ - nAtomsTotal = internal->varNatoms.Max(); - uint64_t rem = nAtomsTotal % comm->nprocs; - nAtoms = nAtomsTotal / comm->nprocs; - atomOffset = comm->me * nAtoms; - if (comm->me < rem) { - ++nAtoms; - atomOffset += comm->me; - } else { - atomOffset += rem; - } + else if (fieldtype[i] == ID) + fieldindex[i] = find_label("id", labels); + else if (fieldtype[i] == TYPE) + fieldindex[i] = find_label("type", labels); - /* triclinic */ - adios2::Attribute attTriclinic = - internal->io.InquireAttribute("triclinic"); - if (!attTriclinic) { - snprintf(str, sizeof(str), - "Did not find 'triclinic' attribute in ADIOS file %s", - internal->fh.Name().c_str()); - error->one(FLERR, str); - } - - triclinic = attTriclinic.Data()[0]; - - /* read Box */ - adios2::Variable varBoxxlo = - internal->io.InquireVariable("boxxlo"); - adios2::Variable varBoxxhi = - internal->io.InquireVariable("boxxhi"); - adios2::Variable varBoxylo = - internal->io.InquireVariable("boxylo"); - adios2::Variable varBoxyhi = - internal->io.InquireVariable("boxyhi"); - adios2::Variable varBoxzlo = - internal->io.InquireVariable("boxzlo"); - adios2::Variable varBoxzhi = - internal->io.InquireVariable("boxzhi"); - - box[0][0] = varBoxxlo.Max(); - box[0][1] = varBoxxhi.Max(); - box[0][2] = 0.0; - box[1][0] = varBoxylo.Max(); - box[1][1] = varBoxyhi.Max(); - box[1][2] = 0.0; - box[2][0] = varBoxzlo.Max(); - box[2][1] = varBoxzhi.Max(); - box[2][2] = 0.0; - - if (triclinic) { - adios2::Variable varBoxxy = - internal->io.InquireVariable("boxxy"); - adios2::Variable varBoxxz = - internal->io.InquireVariable("boxxz"); - adios2::Variable varBoxyz = - internal->io.InquireVariable("boxyz"); - - box[0][2] = varBoxxy.Max(); - box[1][2] = varBoxxz.Max(); - box[2][2] = varBoxyz.Max(); - } - - boxinfo = 1; - - // if no field info requested, just return - - if (!fieldinfo) - return nAtoms; - - memory->create(fieldindex, nfield, "read_dump:fieldindex"); - - /* Columns */ - adios2::Attribute attColumns = - internal->io.InquireAttribute("columns"); - - std::vector labelVector = attColumns.Data(); - int nwords = labelVector.size(); - std::map labels; - for (int i = 0; i < nwords; ++i) { - labels.emplace(labelVector[i], i); - } - - int s_index, u_index, su_index; - xflag = UNSET; - yflag = UNSET; - zflag = UNSET; - - // copy fieldtype list for supported fields - - for (int i = 0; i < nfield; i++) { - if (fieldlabel[i]) { - fieldindex[i] = find_label(fieldlabel[i], labels); - if (fieldtype[i] == X) - xflag = 2 * scaleflag + wrapflag + 1; - else if (fieldtype[i] == Y) - yflag = 2 * scaleflag + wrapflag + 1; - else if (fieldtype[i] == Z) - zflag = 2 * scaleflag + wrapflag + 1; + else if (fieldtype[i] == X) { + fieldindex[i] = find_label("x", labels); + xflag = NOSCALE_WRAP; + if (fieldindex[i] < 0) { + fieldindex[i] = nwords; + s_index = find_label("xs", labels); + u_index = find_label("xu", labels); + su_index = find_label("xsu", labels); + if (s_index >= 0 && s_index < fieldindex[i]) { + fieldindex[i] = s_index; + xflag = SCALE_WRAP; } + if (u_index >= 0 && u_index < fieldindex[i]) { + fieldindex[i] = u_index; + xflag = NOSCALE_NOWRAP; + } + if (su_index >= 0 && su_index < fieldindex[i]) { + fieldindex[i] = su_index; + xflag = SCALE_NOWRAP; + } + } + if (fieldindex[i] == nwords) fieldindex[i] = -1; - else if (fieldtype[i] == ID) - fieldindex[i] = find_label("id", labels); - else if (fieldtype[i] == TYPE) - fieldindex[i] = find_label("type", labels); + } else if (fieldtype[i] == Y) { + fieldindex[i] = find_label("y", labels); + yflag = NOSCALE_WRAP; + if (fieldindex[i] < 0) { + fieldindex[i] = nwords; + s_index = find_label("ys", labels); + u_index = find_label("yu", labels); + su_index = find_label("ysu", labels); + if (s_index >= 0 && s_index < fieldindex[i]) { + fieldindex[i] = s_index; + yflag = SCALE_WRAP; + } + if (u_index >= 0 && u_index < fieldindex[i]) { + fieldindex[i] = u_index; + yflag = NOSCALE_NOWRAP; + } + if (su_index >= 0 && su_index < fieldindex[i]) { + fieldindex[i] = su_index; + yflag = SCALE_NOWRAP; + } + } + if (fieldindex[i] == nwords) fieldindex[i] = -1; - else if (fieldtype[i] == X) { - fieldindex[i] = find_label("x", labels); - xflag = NOSCALE_WRAP; - if (fieldindex[i] < 0) { - fieldindex[i] = nwords; - s_index = find_label("xs", labels); - u_index = find_label("xu", labels); - su_index = find_label("xsu", labels); - if (s_index >= 0 && s_index < fieldindex[i]) { - fieldindex[i] = s_index; - xflag = SCALE_WRAP; - } - if (u_index >= 0 && u_index < fieldindex[i]) { - fieldindex[i] = u_index; - xflag = NOSCALE_NOWRAP; - } - if (su_index >= 0 && su_index < fieldindex[i]) { - fieldindex[i] = su_index; - xflag = SCALE_NOWRAP; - } - } - if (fieldindex[i] == nwords) - fieldindex[i] = -1; + } else if (fieldtype[i] == Z) { + fieldindex[i] = find_label("z", labels); + zflag = NOSCALE_WRAP; + if (fieldindex[i] < 0) { + fieldindex[i] = nwords; + s_index = find_label("zs", labels); + u_index = find_label("zu", labels); + su_index = find_label("zsu", labels); + if (s_index >= 0 && s_index < fieldindex[i]) { + fieldindex[i] = s_index; + zflag = SCALE_WRAP; + } + if (u_index >= 0 && u_index < fieldindex[i]) { + fieldindex[i] = u_index; + zflag = NOSCALE_NOWRAP; + } + if (su_index >= 0 && su_index < fieldindex[i]) { + fieldindex[i] = su_index; + zflag = SCALE_NOWRAP; + } + } + if (fieldindex[i] == nwords) fieldindex[i] = -1; - } else if (fieldtype[i] == Y) { - fieldindex[i] = find_label("y", labels); - yflag = NOSCALE_WRAP; - if (fieldindex[i] < 0) { - fieldindex[i] = nwords; - s_index = find_label("ys", labels); - u_index = find_label("yu", labels); - su_index = find_label("ysu", labels); - if (s_index >= 0 && s_index < fieldindex[i]) { - fieldindex[i] = s_index; - yflag = SCALE_WRAP; - } - if (u_index >= 0 && u_index < fieldindex[i]) { - fieldindex[i] = u_index; - yflag = NOSCALE_NOWRAP; - } - if (su_index >= 0 && su_index < fieldindex[i]) { - fieldindex[i] = su_index; - yflag = SCALE_NOWRAP; - } - } - if (fieldindex[i] == nwords) - fieldindex[i] = -1; + } else if (fieldtype[i] == VX) + fieldindex[i] = find_label("vx", labels); + else if (fieldtype[i] == VY) + fieldindex[i] = find_label("vy", labels); + else if (fieldtype[i] == VZ) + fieldindex[i] = find_label("vz", labels); - } else if (fieldtype[i] == Z) { - fieldindex[i] = find_label("z", labels); - zflag = NOSCALE_WRAP; - if (fieldindex[i] < 0) { - fieldindex[i] = nwords; - s_index = find_label("zs", labels); - u_index = find_label("zu", labels); - su_index = find_label("zsu", labels); - if (s_index >= 0 && s_index < fieldindex[i]) { - fieldindex[i] = s_index; - zflag = SCALE_WRAP; - } - if (u_index >= 0 && u_index < fieldindex[i]) { - fieldindex[i] = u_index; - zflag = NOSCALE_NOWRAP; - } - if (su_index >= 0 && su_index < fieldindex[i]) { - fieldindex[i] = su_index; - zflag = SCALE_NOWRAP; - } - } - if (fieldindex[i] == nwords) - fieldindex[i] = -1; + else if (fieldtype[i] == FX) + fieldindex[i] = find_label("fx", labels); + else if (fieldtype[i] == FY) + fieldindex[i] = find_label("fy", labels); + else if (fieldtype[i] == FZ) + fieldindex[i] = find_label("fz", labels); - } else if (fieldtype[i] == VX) - fieldindex[i] = find_label("vx", labels); - else if (fieldtype[i] == VY) - fieldindex[i] = find_label("vy", labels); - else if (fieldtype[i] == VZ) - fieldindex[i] = find_label("vz", labels); + else if (fieldtype[i] == Q) + fieldindex[i] = find_label("q", labels); - else if (fieldtype[i] == FX) - fieldindex[i] = find_label("fx", labels); - else if (fieldtype[i] == FY) - fieldindex[i] = find_label("fy", labels); - else if (fieldtype[i] == FZ) - fieldindex[i] = find_label("fz", labels); + else if (fieldtype[i] == IX) + fieldindex[i] = find_label("ix", labels); + else if (fieldtype[i] == IY) + fieldindex[i] = find_label("iy", labels); + else if (fieldtype[i] == IZ) + fieldindex[i] = find_label("iz", labels); + } - else if (fieldtype[i] == Q) - fieldindex[i] = find_label("q", labels); + // set fieldflag = -1 if any unfound fields - else if (fieldtype[i] == IX) - fieldindex[i] = find_label("ix", labels); - else if (fieldtype[i] == IY) - fieldindex[i] = find_label("iy", labels); - else if (fieldtype[i] == IZ) - fieldindex[i] = find_label("iz", labels); - } + fieldflag = 0; + for (int i = 0; i < nfield; i++) + if (fieldindex[i] < 0) fieldflag = -1; - // set fieldflag = -1 if any unfound fields - - fieldflag = 0; - for (int i = 0; i < nfield; i++) - if (fieldindex[i] < 0) - fieldflag = -1; - - return nAtoms; + return nAtoms; } /* ---------------------------------------------------------------------- @@ -475,41 +414,33 @@ bigint ReaderADIOS::read_header(double box[3][3], int &boxinfo, int &triclinic, void ReaderADIOS::read_atoms(int n, int nfield, double **fields) { - char str[1024]; + /* Read Atoms */ + /* This is the firsts (and last) read of array data, so we + * call EndStep() here instead of PerformGets() + */ - /* Read Atoms */ - /* This is the firsts (and last) read of array data, so we - * call EndStep() here instead of PerformGets() - */ + adios2::Variable varAtoms = internal->io.InquireVariable("atoms"); - adios2::Variable varAtoms = - internal->io.InquireVariable("atoms"); + if ((uint64_t)n != nAtoms) + error->one(FLERR, + "ReaderADIOS::read_atoms() expects 'n={}' equal to the number of " + "atoms (={}) for process {} in ADIOS file {}.", + n, nAtoms, comm->me, internal->fh.Name()); - if (n != nAtoms) { - snprintf( - str, sizeof(str), - "ReaderADIOS::read_atoms() expects 'n=%d' equal to the number of " - "atoms (=%" PRIu64 ") for process %d in ADIOS file %s.", - n, nAtoms, comm->me, internal->fh.Name().c_str()); - error->one(FLERR, str); - } + size_t ncols = varAtoms.Count()[1]; + varAtoms.SetSelection({{atomOffset, 0}, {nAtoms, ncols}}); - size_t ncols = varAtoms.Count()[1]; - varAtoms.SetSelection({{atomOffset, 0}, {nAtoms, ncols}}); + std::vector table; - std::vector table; + internal->fh.Get(varAtoms, table); + // EndStep or PerformGets required to make the read happen + internal->fh.EndStep(); - internal->fh.Get(varAtoms, table); - // EndStep or PerformGets required to make the read happen - internal->fh.EndStep(); - - size_t idx; - for (int i = 0; i < nAtoms; i++) { - idx = i * ncols; - for (int m = 0; m < nfield; m++) { - fields[i][m] = table[idx + fieldindex[m]]; - } - } + size_t idx; + for (uint64_t i = 0; i < nAtoms; i++) { + idx = i * ncols; + for (int m = 0; m < nfield; m++) { fields[i][m] = table[idx + fieldindex[m]]; } + } } /* ---------------------------------------------------------------------- @@ -517,12 +448,9 @@ void ReaderADIOS::read_atoms(int n, int nfield, double **fields) return index of match or -1 if no match ------------------------------------------------------------------------- */ -int ReaderADIOS::find_label(const std::string &label, - const std::map &labels) +int ReaderADIOS::find_label(const std::string &label, const std::map &labels) { - std::map::const_iterator it = labels.find(label); - if (it != labels.end()) { - return it->second; - } - return -1; + auto it = labels.find(label); + if (it != labels.end()) { return it->second; } + return -1; } diff --git a/src/ADIOS/reader_adios.h b/src/ADIOS/reader_adios.h index e59c677489..06616d94fd 100644 --- a/src/ADIOS/reader_adios.h +++ b/src/ADIOS/reader_adios.h @@ -44,7 +44,7 @@ class ReaderADIOS : public Reader { int &, int &, int &) override; void read_atoms(int, int, double **) override; - void open_file(const char *) override; + void open_file(const std::string &) override; void close_file() override; private: diff --git a/src/ASPHERE/compute_erotate_asphere.cpp b/src/ASPHERE/compute_erotate_asphere.cpp index d2118e60ca..192b5e5ed3 100644 --- a/src/ASPHERE/compute_erotate_asphere.cpp +++ b/src/ASPHERE/compute_erotate_asphere.cpp @@ -43,9 +43,9 @@ void ComputeERotateAsphere::init() { // error check - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - avec_line = (AtomVecLine *) atom->style_match("line"); - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + avec_line = dynamic_cast( atom->style_match("line")); + avec_tri = dynamic_cast( atom->style_match("tri")); if (!avec_ellipsoid && !avec_line && !avec_tri) error->all(FLERR,"Compute erotate/asphere requires " "atom style ellipsoid or line or tri"); diff --git a/src/ASPHERE/compute_temp_asphere.cpp b/src/ASPHERE/compute_temp_asphere.cpp index abf0157f84..84581c63c1 100644 --- a/src/ASPHERE/compute_temp_asphere.cpp +++ b/src/ASPHERE/compute_temp_asphere.cpp @@ -94,7 +94,7 @@ void ComputeTempAsphere::init() { // error check - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Compute temp/asphere requires atom style ellipsoid"); diff --git a/src/ASPHERE/fix_nh_asphere.cpp b/src/ASPHERE/fix_nh_asphere.cpp index 357aee9696..11e11926e4 100644 --- a/src/ASPHERE/fix_nh_asphere.cpp +++ b/src/ASPHERE/fix_nh_asphere.cpp @@ -36,7 +36,7 @@ FixNHAsphere::FixNHAsphere(LAMMPS *lmp, int narg, char **arg) : void FixNHAsphere::init() { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR, "Compute nvt/nph/npt asphere requires atom style ellipsoid"); diff --git a/src/ASPHERE/fix_nve_asphere.cpp b/src/ASPHERE/fix_nve_asphere.cpp index cd70cce871..ee8c8d3b6e 100644 --- a/src/ASPHERE/fix_nve_asphere.cpp +++ b/src/ASPHERE/fix_nve_asphere.cpp @@ -37,7 +37,7 @@ FixNVEAsphere::FixNVEAsphere(LAMMPS *lmp, int narg, char **arg) : void FixNVEAsphere::init() { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid"); diff --git a/src/ASPHERE/fix_nve_asphere_noforce.cpp b/src/ASPHERE/fix_nve_asphere_noforce.cpp index 7a489989f1..799df8115a 100644 --- a/src/ASPHERE/fix_nve_asphere_noforce.cpp +++ b/src/ASPHERE/fix_nve_asphere_noforce.cpp @@ -37,7 +37,7 @@ void FixNVEAsphereNoforce::init() { // error check - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!atom->ellipsoid_flag) error->all(FLERR,"Fix nve/asphere/noforce requires atom style ellipsoid"); diff --git a/src/ASPHERE/fix_nve_line.cpp b/src/ASPHERE/fix_nve_line.cpp index da64444b4f..a46f6cf67b 100644 --- a/src/ASPHERE/fix_nve_line.cpp +++ b/src/ASPHERE/fix_nve_line.cpp @@ -56,7 +56,7 @@ void FixNVELine::init() { // error checks - avec = (AtomVecLine *) atom->style_match("line"); + avec = dynamic_cast( atom->style_match("line")); if (!avec) error->all(FLERR,"Fix nve/line requires atom style line"); if (domain->dimension != 2) diff --git a/src/ASPHERE/fix_nve_tri.cpp b/src/ASPHERE/fix_nve_tri.cpp index 72287a1807..d41d3ee0ef 100644 --- a/src/ASPHERE/fix_nve_tri.cpp +++ b/src/ASPHERE/fix_nve_tri.cpp @@ -50,7 +50,7 @@ void FixNVETri::init() { // error checks - avec = (AtomVecTri *) atom->style_match("tri"); + avec = dynamic_cast( atom->style_match("tri")); if (!avec) error->all(FLERR,"Fix nve/tri requires atom style tri"); if (domain->dimension != 3) diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp index d1770894e2..04fa5330f9 100644 --- a/src/ASPHERE/pair_gayberne.cpp +++ b/src/ASPHERE/pair_gayberne.cpp @@ -345,7 +345,7 @@ void PairGayBerne::coeff(int narg, char **arg) void PairGayBerne::init_style() { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Pair gayberne requires atom style ellipsoid"); neighbor->add_request(this,NeighConst::REQ_DEFAULT); diff --git a/src/ASPHERE/pair_line_lj.cpp b/src/ASPHERE/pair_line_lj.cpp index a543bac09b..ab1b81ca73 100644 --- a/src/ASPHERE/pair_line_lj.cpp +++ b/src/ASPHERE/pair_line_lj.cpp @@ -402,7 +402,7 @@ void PairLineLJ::coeff(int narg, char **arg) void PairLineLJ::init_style() { - avec = (AtomVecLine *) atom->style_match("line"); + avec = dynamic_cast( atom->style_match("line")); if (!avec) error->all(FLERR,"Pair line/lj requires atom style line"); neighbor->add_request(this,NeighConst::REQ_DEFAULT); diff --git a/src/ASPHERE/pair_resquared.cpp b/src/ASPHERE/pair_resquared.cpp index 3dfe09d801..de0771a8e7 100644 --- a/src/ASPHERE/pair_resquared.cpp +++ b/src/ASPHERE/pair_resquared.cpp @@ -317,7 +317,7 @@ void PairRESquared::coeff(int narg, char **arg) void PairRESquared::init_style() { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR, "Pair resquared requires atom style ellipsoid"); neighbor->add_request(this,NeighConst::REQ_DEFAULT); diff --git a/src/ASPHERE/pair_tri_lj.cpp b/src/ASPHERE/pair_tri_lj.cpp index 0cb08c41b3..eaec71b055 100644 --- a/src/ASPHERE/pair_tri_lj.cpp +++ b/src/ASPHERE/pair_tri_lj.cpp @@ -467,7 +467,7 @@ void PairTriLJ::coeff(int narg, char **arg) void PairTriLJ::init_style() { - avec = (AtomVecTri *) atom->style_match("tri"); + avec = dynamic_cast( atom->style_match("tri")); if (!avec) error->all(FLERR,"Pair tri/lj requires atom style tri"); neighbor->add_request(this,NeighConst::REQ_DEFAULT); diff --git a/src/AWPMD/fix_nve_awpmd.cpp b/src/AWPMD/fix_nve_awpmd.cpp index 812b573826..c37feb2ede 100644 --- a/src/AWPMD/fix_nve_awpmd.cpp +++ b/src/AWPMD/fix_nve_awpmd.cpp @@ -61,9 +61,9 @@ void FixNVEAwpmd::init() dtf = 0.5 * update->dt * force->ftm2v; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = ((Respa *) update->integrate)->step; + step_respa = (dynamic_cast( update->integrate))->step; - awpmd_pair=(PairAWPMDCut *)force->pair; + awpmd_pair=dynamic_cast(force->pair); awpmd_pair->wpmd->norm_needed=1; } diff --git a/src/AWPMD/pair_awpmd_cut.cpp b/src/AWPMD/pair_awpmd_cut.cpp index 0c95801421..fcce6006fd 100644 --- a/src/AWPMD/pair_awpmd_cut.cpp +++ b/src/AWPMD/pair_awpmd_cut.cpp @@ -95,10 +95,7 @@ struct cmp_x{ else if (d>tol) return false; d=xx[left.second][2]-xx[right.second][2]; - if (d<-tol) - return true; - else - return false; + return d < -tol; } else return left.firstnfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = ((FixDeform *) modify->fix[i])->dimflag; + int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5])) @@ -523,12 +523,12 @@ void FixBocs::init() { if (p_basis_type == BASIS_ANALYTIC) { - ((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, + (dynamic_cast(pressure))->send_cg_info(p_basis_type, N_p_match, p_match_coeffs, N_mol, vavg); } else if (p_basis_type == BASIS_LINEAR_SPLINE || p_basis_type == BASIS_CUBIC_SPLINE) { - ((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, + (dynamic_cast(pressure))->send_cg_info(p_basis_type, splines, spline_length); } } @@ -589,8 +589,8 @@ void FixBocs::init() else kspace_flag = 0; if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = ((Respa *) update->integrate)->nlevels; - step_respa = ((Respa *) update->integrate)->step; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + step_respa = (dynamic_cast( update->integrate))->step; dto = 0.5*step_respa[0]; } @@ -1452,7 +1452,7 @@ int FixBocs::pack_restart_data(double *list) void FixBocs::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; int flag = static_cast (list[n++]); if (flag) { int m = static_cast (list[n++]); @@ -1551,12 +1551,12 @@ int FixBocs::modify_param(int narg, char **arg) { if (p_basis_type == BASIS_ANALYTIC) { - ((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, N_p_match, + (dynamic_cast(pressure))->send_cg_info(p_basis_type, N_p_match, p_match_coeffs, N_mol, vavg); } else if (p_basis_type == BASIS_LINEAR_SPLINE || p_basis_type == BASIS_CUBIC_SPLINE ) { - ((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, splines, spline_length ); + (dynamic_cast(pressure))->send_cg_info(p_basis_type, splines, spline_length ); } } diff --git a/src/BODY/compute_body_local.cpp b/src/BODY/compute_body_local.cpp index d8837fa1ea..7d48b0770f 100644 --- a/src/BODY/compute_body_local.cpp +++ b/src/BODY/compute_body_local.cpp @@ -53,7 +53,7 @@ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) : } } - avec = (AtomVecBody *) atom->style_match("body"); + avec = dynamic_cast( atom->style_match("body")); if (!avec) error->all(FLERR,"Compute body/local requires atom style body"); bptr = avec->bptr; @@ -153,7 +153,7 @@ int ComputeBodyLocal::compute_body(int flag) // perform computation and fill output vector/array int m,n,ibonus; - double *values = new double[bptr->noutcol()]; + auto values = new double[bptr->noutcol()]; double **x = atom->x; tagint *tag = atom->tag; diff --git a/src/BODY/compute_temp_body.cpp b/src/BODY/compute_temp_body.cpp index d8dfc0d279..3f97c2c82f 100644 --- a/src/BODY/compute_temp_body.cpp +++ b/src/BODY/compute_temp_body.cpp @@ -87,7 +87,7 @@ void ComputeTempBody::init() { // error check - avec = (AtomVecBody *) atom->style_match("body"); + avec = dynamic_cast( atom->style_match("body")); if (!avec) error->all(FLERR,"Compute temp/body requires atom style body"); diff --git a/src/BODY/fix_nh_body.cpp b/src/BODY/fix_nh_body.cpp index e9339400cc..ba46bce2ac 100644 --- a/src/BODY/fix_nh_body.cpp +++ b/src/BODY/fix_nh_body.cpp @@ -37,7 +37,7 @@ FixNHBody::FixNHBody(LAMMPS *lmp, int narg, char **arg) : void FixNHBody::init() { - avec = (AtomVecBody *) atom->style_match("body"); + avec = dynamic_cast( atom->style_match("body")); if (!avec) error->all(FLERR, "Compute nvt/nph/npt body requires atom style body"); diff --git a/src/BODY/fix_nve_body.cpp b/src/BODY/fix_nve_body.cpp index c00356f037..f731bed81e 100644 --- a/src/BODY/fix_nve_body.cpp +++ b/src/BODY/fix_nve_body.cpp @@ -30,7 +30,7 @@ FixNVEBody::FixNVEBody(LAMMPS *lmp, int narg, char **arg) : void FixNVEBody::init() { - avec = (AtomVecBody *) atom->style_match("body"); + avec = dynamic_cast( atom->style_match("body")); if (!avec) error->all(FLERR,"Fix nve/body requires atom style body"); // check that all particles are bodies diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index e4d25e8489..47467f9d42 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -179,13 +179,13 @@ void FixWallBodyPolygon::init() { dt = update->dt; - avec = (AtomVecBody *) atom->style_match("body"); + avec = dynamic_cast( atom->style_match("body")); if (!avec) error->all(FLERR,"Pair body/rounded/polygon requires atom style body"); if (strcmp(avec->bptr->style,"rounded/polygon") != 0) error->all(FLERR,"Pair body/rounded/polygon requires " "body style rounded/polygon"); - bptr = (BodyRoundedPolygon *) avec->bptr; + bptr = dynamic_cast( avec->bptr); // set pairstyle from body/polygonular pair style diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index 522860b469..2e503640d8 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -184,13 +184,13 @@ void FixWallBodyPolyhedron::init() { dt = update->dt; - avec = (AtomVecBody *) atom->style_match("body"); + avec = dynamic_cast( atom->style_match("body")); if (!avec) error->all(FLERR,"Pair body/rounded/polyhedron requires atom style body"); if (strcmp(avec->bptr->style,"rounded/polyhedron") != 0) error->all(FLERR,"Pair body/rounded/polyhedron requires " "body style rounded/polyhedron"); - bptr = (BodyRoundedPolyhedron *) avec->bptr; + bptr = dynamic_cast( avec->bptr); // set pairstyle from body/polyhedronular pair style diff --git a/src/BODY/pair_body_nparticle.cpp b/src/BODY/pair_body_nparticle.cpp index e893350c3e..df2c6c1d23 100644 --- a/src/BODY/pair_body_nparticle.cpp +++ b/src/BODY/pair_body_nparticle.cpp @@ -416,11 +416,11 @@ void PairBodyNparticle::coeff(int narg, char **arg) void PairBodyNparticle::init_style() { - avec = (AtomVecBody *) atom->style_match("body"); + avec = dynamic_cast( atom->style_match("body")); if (!avec) error->all(FLERR,"Pair body/nparticle requires atom style body"); if (strcmp(avec->bptr->style,"nparticle") != 0) error->all(FLERR,"Pair body/nparticle requires body style nparticle"); - bptr = (BodyNparticle *) avec->bptr; + bptr = dynamic_cast( avec->bptr); neighbor->add_request(this); } diff --git a/src/BODY/pair_body_rounded_polygon.cpp b/src/BODY/pair_body_rounded_polygon.cpp index aa3a86a821..7485cf4b9c 100644 --- a/src/BODY/pair_body_rounded_polygon.cpp +++ b/src/BODY/pair_body_rounded_polygon.cpp @@ -411,13 +411,13 @@ void PairBodyRoundedPolygon::coeff(int narg, char **arg) void PairBodyRoundedPolygon::init_style() { - avec = (AtomVecBody *) atom->style_match("body"); + avec = dynamic_cast( atom->style_match("body")); if (!avec) error->all(FLERR,"Pair body/rounded/polygon requires atom style body"); if (strcmp(avec->bptr->style,"rounded/polygon") != 0) error->all(FLERR,"Pair body/rounded/polygon requires " "body style rounded/polygon"); - bptr = (BodyRoundedPolygon *) avec->bptr; + bptr = dynamic_cast( avec->bptr); if (force->newton_pair == 0) error->all(FLERR,"Pair style body/rounded/polygon requires " diff --git a/src/BODY/pair_body_rounded_polyhedron.cpp b/src/BODY/pair_body_rounded_polyhedron.cpp index 8136e82fd8..a9593b5fa2 100644 --- a/src/BODY/pair_body_rounded_polyhedron.cpp +++ b/src/BODY/pair_body_rounded_polyhedron.cpp @@ -390,13 +390,13 @@ void PairBodyRoundedPolyhedron::coeff(int narg, char **arg) void PairBodyRoundedPolyhedron::init_style() { - avec = (AtomVecBody *) atom->style_match("body"); + avec = dynamic_cast( atom->style_match("body")); if (!avec) error->all(FLERR,"Pair body/rounded/polyhedron requires " "atom style body"); if (strcmp(avec->bptr->style,"rounded/polyhedron") != 0) error->all(FLERR,"Pair body/rounded/polyhedron requires " "body style rounded/polyhedron"); - bptr = (BodyRoundedPolyhedron *) avec->bptr; + bptr = dynamic_cast( avec->bptr); if (force->newton_pair == 0) error->all(FLERR,"Pair style body/rounded/polyhedron requires " diff --git a/src/BPM/atom_vec_bpm_sphere.cpp b/src/BPM/atom_vec_bpm_sphere.cpp new file mode 100644 index 0000000000..3b775cdd83 --- /dev/null +++ b/src/BPM/atom_vec_bpm_sphere.cpp @@ -0,0 +1,245 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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_vec_bpm_sphere.h" + +#include "atom.h" +#include "error.h" +#include "fix.h" +#include "fix_adapt.h" +#include "math_const.h" +#include "modify.h" +#include "utils.h" + +#include + +using namespace LAMMPS_NS; +using MathConst::MY_PI; + +/* ---------------------------------------------------------------------- */ + +AtomVecBPMSphere::AtomVecBPMSphere(LAMMPS *_lmp) : AtomVec(_lmp) +{ + mass_type = PER_ATOM; + molecular = Atom::MOLECULAR; + bonds_allow = 1; + + atom->molecule_flag = 1; + atom->sphere_flag = 1; + atom->radius_flag = atom->rmass_flag = atom->omega_flag = atom->torque_flag = atom->quat_flag = 1; + + // strings with peratom variables to include in each AtomVec method + // strings cannot contain fields in corresponding AtomVec default strings + // order of fields in a string does not matter + // except: fields_data_atom & fields_data_vel must match data file + + // clang-format off + fields_grow = (char *) "molecule num_bond bond_type bond_atom nspecial special radius rmass " + "omega torque quat"; + fields_copy = (char *) "molecule num_bond bond_type bond_atom nspecial special radius rmass " + "omega quat"; + fields_comm = (char *) ""; + fields_comm_vel = (char *) "omega quat"; + fields_reverse = (char *) "torque"; + fields_border = (char *) "molecule radius rmass"; + fields_border_vel = (char *) "molecule radius rmass omega quat"; + fields_exchange = (char *) "molecule num_bond bond_type bond_atom nspecial special radius rmass " + "omega quat"; + fields_restart = (char *) "molecule num_bond bond_type bond_atom radius rmass omega quat"; + fields_create = (char *) "molecule num_bond nspecial radius rmass omega quat"; + fields_data_atom = (char *) "id molecule type radius rmass x"; + fields_data_vel = (char *) "id v omega"; + // clang-format on + + bond_per_atom = 0; + bond_negative = NULL; +} + +/* ---------------------------------------------------------------------- + process sub-style args + optional arg = 0/1 for static/dynamic particle radii +------------------------------------------------------------------------- */ + +void AtomVecBPMSphere::process_args(int narg, char **arg) +{ + if (narg != 0 && narg != 1) error->all(FLERR, "Illegal atom_style bpm/sphere command"); + + radvary = 0; + if (narg == 1) { + radvary = utils::numeric(FLERR, arg[0], true, lmp); + if (radvary < 0 || radvary > 1) error->all(FLERR, "Illegal atom_style bpm/sphere command"); + } + + // dynamic particle radius and mass must be communicated every step + + if (radvary) { + fields_comm = (char *) "radius rmass"; + fields_comm_vel = (char *) "radius rmass omega"; + } + + // delay setting up of fields until now + + setup_fields(); +} + +/* ---------------------------------------------------------------------- */ + +void AtomVecBPMSphere::init() +{ + AtomVec::init(); + + // check if optional radvary setting should have been set to 1 + + for (int i = 0; i < modify->nfix; i++) + if (strcmp(modify->fix[i]->style, "adapt") == 0) { + FixAdapt *fix = (FixAdapt *) modify->fix[i]; + if (fix->diamflag && radvary == 0) + error->all(FLERR, "Fix adapt changes atom radii but atom_style bpm/sphere is not dynamic"); + } +} + +/* ---------------------------------------------------------------------- + set local copies of all grow ptrs used by this class, except defaults + needed in replicate when 2 atom classes exist and it calls pack_restart() +------------------------------------------------------------------------- */ + +void AtomVecBPMSphere::grow_pointers() +{ + radius = atom->radius; + rmass = atom->rmass; + omega = atom->omega; + quat = atom->quat; + + num_bond = atom->num_bond; + bond_type = atom->bond_type; + nspecial = atom->nspecial; +} + +/* ---------------------------------------------------------------------- + initialize non-zero atom quantities +------------------------------------------------------------------------- */ + +void AtomVecBPMSphere::create_atom_post(int ilocal) +{ + radius[ilocal] = 0.5; + rmass[ilocal] = 4.0 * MY_PI / 3.0 * 0.5 * 0.5 * 0.5; + + quat[ilocal][0] = 1.0; + quat[ilocal][1] = 0.0; + quat[ilocal][2] = 0.0; + quat[ilocal][3] = 0.0; +} + +/* ---------------------------------------------------------------------- + modify values for AtomVec::pack_restart() to pack +------------------------------------------------------------------------- */ + +void AtomVecBPMSphere::pack_restart_pre(int ilocal) +{ + // insure bond_negative vector is needed length + + if (bond_per_atom < atom->bond_per_atom) { + delete[] bond_negative; + bond_per_atom = atom->bond_per_atom; + bond_negative = new int[bond_per_atom]; + } + + // flip any negative types to positive and flag which ones + + any_bond_negative = 0; + for (int m = 0; m < num_bond[ilocal]; m++) { + if (bond_type[ilocal][m] < 0) { + bond_negative[m] = 1; + bond_type[ilocal][m] = -bond_type[ilocal][m]; + any_bond_negative = 1; + } else + bond_negative[m] = 0; + } +} + +/* ---------------------------------------------------------------------- + unmodify values packed by AtomVec::pack_restart() +------------------------------------------------------------------------- */ + +void AtomVecBPMSphere::pack_restart_post(int ilocal) +{ + // restore the flagged types to their negative values + + if (any_bond_negative) { + for (int m = 0; m < num_bond[ilocal]; m++) + if (bond_negative[m]) bond_type[ilocal][m] = -bond_type[ilocal][m]; + } +} + +/* ---------------------------------------------------------------------- + initialize other atom quantities after AtomVec::unpack_restart() +------------------------------------------------------------------------- */ + +void AtomVecBPMSphere::unpack_restart_init(int ilocal) +{ + nspecial[ilocal][0] = 0; + nspecial[ilocal][1] = 0; + nspecial[ilocal][2] = 0; +} + +/* ---------------------------------------------------------------------- + modify what AtomVec::data_atom() just unpacked + or initialize other atom quantities +------------------------------------------------------------------------- */ + +void AtomVecBPMSphere::data_atom_post(int ilocal) +{ + radius_one = 0.5 * atom->radius[ilocal]; + radius[ilocal] = radius_one; + if (radius_one > 0.0) rmass[ilocal] *= 4.0 * MY_PI / 3.0 * radius_one * radius_one * radius_one; + + if (rmass[ilocal] <= 0.0) error->one(FLERR, "Invalid density in Atoms section of data file"); + + omega[ilocal][0] = 0.0; + omega[ilocal][1] = 0.0; + omega[ilocal][2] = 0.0; + + quat[ilocal][0] = 1.0; + quat[ilocal][1] = 0.0; + quat[ilocal][2] = 0.0; + quat[ilocal][3] = 0.0; + + num_bond[ilocal] = 0; + nspecial[ilocal][0] = 0; + nspecial[ilocal][1] = 0; + nspecial[ilocal][2] = 0; +} + +/* ---------------------------------------------------------------------- + modify values for AtomVec::pack_data() to pack +------------------------------------------------------------------------- */ + +void AtomVecBPMSphere::pack_data_pre(int ilocal) +{ + radius_one = radius[ilocal]; + rmass_one = rmass[ilocal]; + + radius[ilocal] *= 2.0; + if (radius_one != 0.0) + rmass[ilocal] = rmass_one / (4.0 * MY_PI / 3.0 * radius_one * radius_one * radius_one); +} + +/* ---------------------------------------------------------------------- + unmodify values packed by AtomVec::pack_data() +------------------------------------------------------------------------- */ + +void AtomVecBPMSphere::pack_data_post(int ilocal) +{ + radius[ilocal] = radius_one; + rmass[ilocal] = rmass_one; +} diff --git a/src/BPM/atom_vec_bpm_sphere.h b/src/BPM/atom_vec_bpm_sphere.h new file mode 100644 index 0000000000..e7672eeb3c --- /dev/null +++ b/src/BPM/atom_vec_bpm_sphere.h @@ -0,0 +1,82 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef ATOM_CLASS +// clang-format off +AtomStyle(bpm/sphere,AtomVecBPMSphere); +// clang-format on +#else + +#ifndef LMP_ATOM_VEC_BPM_SPHERE_H +#define LMP_ATOM_VEC_BPM_SPHERE_H + +#include "atom_vec.h" + +namespace LAMMPS_NS { + +class AtomVecBPMSphere : public AtomVec { + public: + AtomVecBPMSphere(class LAMMPS *); + void process_args(int, char **) override; + void init() override; + + void grow_pointers() override; + void create_atom_post(int) override; + void pack_restart_pre(int) override; + void pack_restart_post(int) override; + void unpack_restart_init(int) override; + void data_atom_post(int) override; + void pack_data_pre(int) override; + void pack_data_post(int) override; + + private: + int *num_bond; + int **bond_type; + int **nspecial; + + double *radius, *rmass; + double **omega, **torque, **quat; + + int any_bond_negative; + int bond_per_atom; + int *bond_negative; + + int radvary; + double radius_one, rmass_one; +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Per-processor system is too big + +The number of owned atoms plus ghost atoms on a single +processor must fit in 32-bit integer. + +E: Invalid atom type in Atoms section of data file + +Atom types must range from 1 to specified # of types. + +E: Invalid radius in Atoms section of data file + +Radius must be >= 0.0. + +E: Invalid density in Atoms section of data file + +Density value cannot be <= 0.0. + +*/ diff --git a/src/BPM/bond_bpm.cpp b/src/BPM/bond_bpm.cpp new file mode 100644 index 0000000000..b019815cfa --- /dev/null +++ b/src/BPM/bond_bpm.cpp @@ -0,0 +1,415 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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 "bond_bpm.h" + +#include "atom.h" +#include "domain.h" +#include "error.h" +#include "fix_bond_history.h" +#include "fix_store_local.h" +#include "fix_update_special_bonds.h" +#include "force.h" +#include "memory.h" +#include "modify.h" +#include "update.h" + +#include + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +BondBPM::BondBPM(LAMMPS *_lmp) : + Bond(_lmp), id_fix_dummy(nullptr), id_fix_dummy2(nullptr), id_fix_update(nullptr), + id_fix_bond_history(nullptr), id_fix_store_local(nullptr), id_fix_prop_atom(nullptr), + fix_store_local(nullptr), fix_bond_history(nullptr), fix_update_special_bonds(nullptr), + pack_choice(nullptr), output_data(nullptr) + +{ + overlay_flag = 0; + prop_atom_flag = 0; + nvalues = 0; + + r0_max_estimate = 0.0; + max_stretch = 1.0; + + // create dummy fix as placeholder for FixUpdateSpecialBonds & BondHistory + // this is so final order of Modify:fix will conform to input script + // BondHistory technically only needs this if updateflag = 1 + + id_fix_dummy = utils::strdup("BPM_DUMMY"); + modify->add_fix(fmt::format("{} all DUMMY ", id_fix_dummy)); + + id_fix_dummy2 = utils::strdup("BPM_DUMMY2"); + modify->add_fix(fmt::format("{} all DUMMY ", id_fix_dummy2)); +} + +/* ---------------------------------------------------------------------- */ + +BondBPM::~BondBPM() +{ + delete[] pack_choice; + + if (id_fix_dummy) modify->delete_fix(id_fix_dummy); + if (id_fix_dummy2) modify->delete_fix(id_fix_dummy2); + if (id_fix_update) modify->delete_fix(id_fix_update); + if (id_fix_bond_history) modify->delete_fix(id_fix_bond_history); + if (id_fix_store_local) modify->delete_fix(id_fix_store_local); + if (id_fix_prop_atom) modify->delete_fix(id_fix_prop_atom); + + delete[] id_fix_dummy; + delete[] id_fix_dummy2; + delete[] id_fix_update; + delete[] id_fix_bond_history; + delete[] id_fix_store_local; + delete[] id_fix_prop_atom; + + memory->destroy(output_data); +} + +/* ---------------------------------------------------------------------- */ + +void BondBPM::init_style() +{ + if (id_fix_store_local) { + auto ifix = modify->get_fix_by_id(id_fix_store_local); + if (!ifix) error->all(FLERR, "Cannot find fix store/local"); + if (strcmp(ifix->style, "STORE_LOCAL") != 0) + error->all(FLERR, "Incorrect fix style matched, not store/local"); + fix_store_local = dynamic_cast(ifix); + fix_store_local->nvalues = nvalues; + } + + if (overlay_flag) { + if (force->special_lj[1] != 1.0) + error->all(FLERR, + "With overlay/pair, BPM bond styles require special_bonds weight of 1.0 for " + "first neighbors"); + if (id_fix_update) { + modify->delete_fix(id_fix_update); + delete[] id_fix_update; + id_fix_update = nullptr; + } + } else { + // Require atoms know about all of their bonds and if they break + if (force->newton_bond) + error->all(FLERR, "Without overlay/pair, BPM bond styles require Newton bond off"); + + // special lj must be 0 1 1 to censor pair forces between bonded particles + // special coulomb must be 1 1 1 to ensure all pairs are included in the + // neighbor list and 1-3 and 1-4 special bond lists are skipped + if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 || force->special_lj[3] != 1.0) + error->all(FLERR, + "Without overlay/pair, BPM bond sytles requires special LJ weights = 0,1,1"); + if (force->special_coul[1] != 1.0 || force->special_coul[2] != 1.0 || + force->special_coul[3] != 1.0) + error->all(FLERR, + "Without overlay/pair, BPM bond sytles requires special Coulomb weights = 1,1,1"); + + if (id_fix_dummy) { + id_fix_update = utils::strdup("BPM_UPDATE_SPECIAL_BONDS"); + fix_update_special_bonds = dynamic_cast(modify->replace_fix( + id_fix_dummy, fmt::format("{} all UPDATE_SPECIAL_BONDS", id_fix_update), 1)); + delete[] id_fix_dummy; + id_fix_dummy = nullptr; + } + } + + if (force->angle || force->dihedral || force->improper) + error->all(FLERR, "Bond style bpm cannot be used with 3,4-body interactions"); + if (atom->molecular == 2) + error->all(FLERR, "Bond style bpm cannot be used with atom style template"); + + // special 1-3 and 1-4 weights must be 1 to prevent building 1-3 and 1-4 special bond lists + if (force->special_lj[2] != 1.0 || force->special_lj[3] != 1.0 || force->special_coul[2] != 1.0 || + force->special_coul[3] != 1.0) + error->all(FLERR, "Bond style bpm requires 1-3 and 1-4 special weights of 1.0"); +} + +/* ---------------------------------------------------------------------- + global settings + All args before store/local command are saved for potential args + for specific bond BPM substyles + All args after optional store/local command are variables stored + in the compute store/local +------------------------------------------------------------------------- */ + +void BondBPM::settings(int narg, char **arg) +{ + leftover_iarg.clear(); + + int iarg = 0; + while (iarg < narg) { + if (strcmp(arg[iarg], "store/local") == 0) { + nvalues = 0; + id_fix_store_local = utils::strdup(arg[iarg + 1]); + store_local_freq = utils::inumeric(FLERR, arg[iarg + 2], false, lmp); + pack_choice = new FnPtrPack[narg - iarg - 1]; + iarg += 3; + while (iarg < narg) { + if (strcmp(arg[iarg], "id1") == 0) { + pack_choice[nvalues++] = &BondBPM::pack_id1; + } else if (strcmp(arg[iarg], "id2") == 0) { + pack_choice[nvalues++] = &BondBPM::pack_id2; + } else if (strcmp(arg[iarg], "time") == 0) { + pack_choice[nvalues++] = &BondBPM::pack_time; + } else if (strcmp(arg[iarg], "x") == 0) { + pack_choice[nvalues++] = &BondBPM::pack_x; + } else if (strcmp(arg[iarg], "y") == 0) { + pack_choice[nvalues++] = &BondBPM::pack_y; + } else if (strcmp(arg[iarg], "z") == 0) { + pack_choice[nvalues++] = &BondBPM::pack_z; + } else if (strcmp(arg[iarg], "x/ref") == 0) { + pack_choice[nvalues++] = &BondBPM::pack_x_ref; + prop_atom_flag = 1; + } else if (strcmp(arg[iarg], "y/ref") == 0) { + pack_choice[nvalues++] = &BondBPM::pack_y_ref; + prop_atom_flag = 1; + } else if (strcmp(arg[iarg], "z/ref") == 0) { + pack_choice[nvalues++] = &BondBPM::pack_z_ref; + prop_atom_flag = 1; + } else { + break; + } + iarg++; + } + } else if (strcmp(arg[iarg], "overlay/pair") == 0) { + overlay_flag = 1; + iarg++; + } else { + leftover_iarg.push_back(iarg); + iarg++; + } + } + + if (id_fix_store_local) { + + if (nvalues == 0) + error->all(FLERR, "Storing local data must include at least one value to output"); + memory->create(output_data, nvalues, "bond/bpm:output_data"); + + auto ifix = modify->get_fix_by_id(id_fix_store_local); + if (!ifix) + ifix = modify->add_fix( + fmt::format("{} all STORE_LOCAL {} {}", id_fix_store_local, store_local_freq, nvalues)); + fix_store_local = dynamic_cast(ifix); + + // Use property/atom to save reference positions as it can transfer to ghost atoms + // This won't work for instances where bonds are added (e.g. fix pour) but in those cases + // a reference state isn't well defined + if (prop_atom_flag == 1) { + + id_fix_prop_atom = utils::strdup("BPM_property_atom"); + char *x_ref_id = utils::strdup("BPM_X_REF"); + char *y_ref_id = utils::strdup("BPM_Y_REF"); + char *z_ref_id = utils::strdup("BPM_Z_REF"); + + ifix = modify->get_fix_by_id(id_fix_prop_atom); + if (!ifix) + ifix = modify->add_fix(fmt::format("{} all property/atom {} {} {} ghost yes", + id_fix_prop_atom, x_ref_id, y_ref_id, z_ref_id)); + + int type_flag; + int col_flag; + index_x_ref = atom->find_custom(x_ref_id, type_flag, col_flag); + index_y_ref = atom->find_custom(y_ref_id, type_flag, col_flag); + index_z_ref = atom->find_custom(z_ref_id, type_flag, col_flag); + + delete[] x_ref_id; + delete[] y_ref_id; + delete[] z_ref_id; + + if (ifix->restart_reset) { + ifix->restart_reset = 0; + } else { + double *x_ref = atom->dvector[index_x_ref]; + double *y_ref = atom->dvector[index_y_ref]; + double *z_ref = atom->dvector[index_z_ref]; + + double **x = atom->x; + for (int i = 0; i < atom->nlocal; i++) { + x_ref[i] = x[i][0]; + y_ref[i] = x[i][1]; + z_ref[i] = x[i][2]; + } + } + } + } +} + +/* ---------------------------------------------------------------------- + used to check bond communiction cutoff - not perfect, estimates based on local-local only +------------------------------------------------------------------------- */ + +double BondBPM::equilibrium_distance(int /*i*/) +{ + // Ghost atoms may not yet be communicated, this may only be an estimate + if (r0_max_estimate == 0) { + int type, j; + double delx, dely, delz, r; + double **x = atom->x; + for (int i = 0; i < atom->nlocal; i++) { + for (int m = 0; m < atom->num_bond[i]; m++) { + type = atom->bond_type[i][m]; + if (type == 0) continue; + + j = atom->map(atom->bond_atom[i][m]); + if (j == -1) continue; + + delx = x[i][0] - x[j][0]; + dely = x[i][1] - x[j][1]; + delz = x[i][2] - x[j][2]; + domain->minimum_image(delx, dely, delz); + + r = sqrt(delx * delx + dely * dely + delz * delz); + if (r > r0_max_estimate) r0_max_estimate = r; + } + } + + double temp; + MPI_Allreduce(&r0_max_estimate, &temp, 1, MPI_DOUBLE, MPI_MAX, world); + r0_max_estimate = temp; + } + + // Divide out heuristic prefactor added in comm class + return max_stretch * r0_max_estimate / 1.5; +} + +/* ---------------------------------------------------------------------- */ + +void BondBPM::process_broken(int i, int j) +{ + if (fix_store_local) { + for (int n = 0; n < nvalues; n++) (this->*pack_choice[n])(n, i, j); + + fix_store_local->add_data(output_data, i, j); + } + + if (fix_update_special_bonds) fix_update_special_bonds->add_broken_bond(i, j); + + // Manually search and remove from atom arrays + // need to remove in case special bonds arrays rebuilt + int m, n; + int nlocal = atom->nlocal; + + tagint *tag = atom->tag; + tagint **bond_atom = atom->bond_atom; + int **bond_type = atom->bond_type; + int *num_bond = atom->num_bond; + + if (i < nlocal) { + for (m = 0; m < num_bond[i]; m++) { + if (bond_atom[i][m] == tag[j]) { + bond_type[i][m] = 0; + n = num_bond[i]; + bond_type[i][m] = bond_type[i][n - 1]; + bond_atom[i][m] = bond_atom[i][n - 1]; + fix_bond_history->shift_history(i, m, n - 1); + fix_bond_history->delete_history(i, n - 1); + num_bond[i]--; + break; + } + } + } + + if (j < nlocal) { + for (m = 0; m < num_bond[j]; m++) { + if (bond_atom[j][m] == tag[i]) { + bond_type[j][m] = 0; + n = num_bond[j]; + bond_type[j][m] = bond_type[j][n - 1]; + bond_atom[j][m] = bond_atom[j][n - 1]; + fix_bond_history->shift_history(j, m, n - 1); + fix_bond_history->delete_history(j, n - 1); + num_bond[j]--; + break; + } + } + } +} + +/* ---------------------------------------------------------------------- + one method for every keyword bond bpm can output + the atom property is packed into array or vector +------------------------------------------------------------------------- */ + +void BondBPM::pack_id1(int n, int i, int /*j*/) +{ + tagint *tag = atom->tag; + output_data[n] = tag[i]; +} + +/* ---------------------------------------------------------------------- */ + +void BondBPM::pack_id2(int n, int /*i*/, int j) +{ + tagint *tag = atom->tag; + output_data[n] = tag[j]; +} + +/* ---------------------------------------------------------------------- */ + +void BondBPM::pack_time(int n, int /*i*/, int /*j*/) +{ + bigint time = update->ntimestep; + output_data[n] = time; +} + +/* ---------------------------------------------------------------------- */ + +void BondBPM::pack_x(int n, int i, int j) +{ + double **x = atom->x; + output_data[n] = (x[i][0] + x[j][0]) * 0.5; +} + +/* ---------------------------------------------------------------------- */ + +void BondBPM::pack_y(int n, int i, int j) +{ + double **x = atom->x; + output_data[n] = (x[i][1] + x[j][1]) * 0.5; +} + +/* ---------------------------------------------------------------------- */ + +void BondBPM::pack_z(int n, int i, int j) +{ + double **x = atom->x; + output_data[n] = (x[i][2] + x[j][2]) * 0.5; +} + +/* ---------------------------------------------------------------------- */ + +void BondBPM::pack_x_ref(int n, int i, int j) +{ + double *x = atom->dvector[index_x_ref]; + output_data[n] = (x[i] + x[j]) * 0.5; +} + +/* ---------------------------------------------------------------------- */ + +void BondBPM::pack_y_ref(int n, int i, int j) +{ + double *y = atom->dvector[index_y_ref]; + output_data[n] = (y[i] + y[j]) * 0.5; +} + +/* ---------------------------------------------------------------------- */ + +void BondBPM::pack_z_ref(int n, int i, int j) +{ + double *z = atom->dvector[index_z_ref]; + output_data[n] = (z[i] + z[j]) * 0.5; +} diff --git a/src/BPM/bond_bpm.h b/src/BPM/bond_bpm.h new file mode 100644 index 0000000000..ca9eb4f846 --- /dev/null +++ b/src/BPM/bond_bpm.h @@ -0,0 +1,98 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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. +------------------------------------------------------------------------- */ + +#ifndef LMP_BOND_BPM_H +#define LMP_BOND_BPM_H + +#include "bond.h" + +#include + +namespace LAMMPS_NS { + +class BondBPM : public Bond { + public: + BondBPM(class LAMMPS *); + ~BondBPM() override; + void compute(int, int) override = 0; + void coeff(int, char **) override = 0; + void init_style() override; + void settings(int, char **) override; + double equilibrium_distance(int) override; + void write_restart(FILE *) override{}; + void read_restart(FILE *) override{}; + void write_data(FILE *) override{}; + double single(int, double, int, int, double &) override = 0; + + protected: + double r0_max_estimate; + double max_stretch; + int store_local_freq; + + std::vector leftover_iarg; + + char *id_fix_dummy, *id_fix_dummy2; + char *id_fix_update, *id_fix_bond_history; + char *id_fix_store_local, *id_fix_prop_atom; + class FixStoreLocal *fix_store_local; + class FixBondHistory *fix_bond_history; + class FixUpdateSpecialBonds *fix_update_special_bonds; + + void process_broken(int, int); + typedef void (BondBPM::*FnPtrPack)(int, int, int); + FnPtrPack *pack_choice; // ptrs to pack functions + double *output_data; + + int prop_atom_flag, nvalues, overlay_flag; + int index_x_ref, index_y_ref, index_z_ref; + + void pack_id1(int, int, int); + void pack_id2(int, int, int); + void pack_time(int, int, int); + void pack_x(int, int, int); + void pack_y(int, int, int); + void pack_z(int, int, int); + void pack_x_ref(int, int, int); + void pack_y_ref(int, int, int); + void pack_z_ref(int, int, int); +}; + +} // namespace LAMMPS_NS + +#endif + +/* ERROR/WARNING messages: + +E: Cannot find fix store/local + +Fix id cannot be found. + +E: Illegal bond_style command + +Self-explanatory. + +E: Bond style bpm must include at least one value to output + +Must include at least one bond property to store in fix store/local + +E: Bond style bpm cannot be used with 3,4-body interactions + +No angle, dihedral, or improper styles can be defined when using +bond style bpm. + +E: Bond style bpm cannot be used with atom style template + +This bond style can change the bond topology which is not +allowed with this atom style. + +*/ diff --git a/src/BPM/bond_bpm_rotational.cpp b/src/BPM/bond_bpm_rotational.cpp new file mode 100644 index 0000000000..a43b4c7500 --- /dev/null +++ b/src/BPM/bond_bpm_rotational.cpp @@ -0,0 +1,796 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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 "bond_bpm_rotational.h" + +#include "atom.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "fix_bond_history.h" +#include "force.h" +#include "math_const.h" +#include "math_extra.h" +#include "memory.h" +#include "modify.h" +#include "neighbor.h" + +#include + +#define EPSILON 1e-10 + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +BondBPMRotational::BondBPMRotational(LAMMPS *_lmp) : BondBPM(_lmp) +{ + Kr = nullptr; + Ks = nullptr; + Kt = nullptr; + Kb = nullptr; + Fcr = nullptr; + Fcs = nullptr; + Tct = nullptr; + Tcb = nullptr; + gnorm = nullptr; + gslide = nullptr; + groll = nullptr; + gtwist = nullptr; + partial_flag = 1; + smooth_flag = 1; +} + +/* ---------------------------------------------------------------------- */ + +BondBPMRotational::~BondBPMRotational() +{ + if (allocated) { + memory->destroy(setflag); + memory->destroy(Kr); + memory->destroy(Ks); + memory->destroy(Kt); + memory->destroy(Kb); + memory->destroy(Fcr); + memory->destroy(Fcs); + memory->destroy(Tct); + memory->destroy(Tcb); + memory->destroy(gnorm); + memory->destroy(gslide); + memory->destroy(groll); + memory->destroy(gtwist); + } +} + +/* ---------------------------------------------------------------------- */ + +double BondBPMRotational::acos_limit(double c) +{ + if (c > 1.0) c = 1.0; + if (c < -1.0) c = -1.0; + return acos(c); +} + +/* ---------------------------------------------------------------------- + Store data for a single bond - if bond added after LAMMPS init (e.g. pour) +------------------------------------------------------------------------- */ + +double BondBPMRotational::store_bond(int n, int i, int j) +{ + double delx, dely, delz, r, rinv; + double **x = atom->x; + tagint *tag = atom->tag; + double **bondstore = fix_bond_history->bondstore; + + if (tag[i] < tag[j]) { + delx = x[i][0] - x[j][0]; + dely = x[i][1] - x[j][1]; + delz = x[i][2] - x[j][2]; + } else { + delx = x[j][0] - x[i][0]; + dely = x[j][1] - x[i][1]; + delz = x[j][2] - x[i][2]; + } + + r = sqrt(delx * delx + dely * dely + delz * delz); + rinv = 1.0 / r; + + bondstore[n][0] = r; + bondstore[n][1] = delx * rinv; + bondstore[n][2] = dely * rinv; + bondstore[n][3] = delz * rinv; + + if (i < atom->nlocal) { + for (int m = 0; m < atom->num_bond[i]; m++) { + if (atom->bond_atom[i][m] == tag[j]) { + fix_bond_history->update_atom_value(i, m, 0, r); + fix_bond_history->update_atom_value(i, m, 1, delx * rinv); + fix_bond_history->update_atom_value(i, m, 2, dely * rinv); + fix_bond_history->update_atom_value(i, m, 3, delz * rinv); + } + } + } + + if (j < atom->nlocal) { + for (int m = 0; m < atom->num_bond[j]; m++) { + if (atom->bond_atom[j][m] == tag[i]) { + fix_bond_history->update_atom_value(j, m, 0, r); + fix_bond_history->update_atom_value(j, m, 1, delx * rinv); + fix_bond_history->update_atom_value(j, m, 2, dely * rinv); + fix_bond_history->update_atom_value(j, m, 3, delz * rinv); + } + } + } + + return r; +} + +/* ---------------------------------------------------------------------- + Store data for all bonds called once +------------------------------------------------------------------------- */ + +void BondBPMRotational::store_data() +{ + int i, j, m, type; + double delx, dely, delz, r, rinv; + double **x = atom->x; + int **bond_type = atom->bond_type; + tagint *tag = atom->tag; + + for (i = 0; i < atom->nlocal; i++) { + for (m = 0; m < atom->num_bond[i]; m++) { + type = bond_type[i][m]; + + //Skip if bond was turned off + if (type < 0) continue; + + // map to find index n for tag + j = atom->map(atom->bond_atom[i][m]); + if (j == -1) error->one(FLERR, "Atom missing in BPM bond"); + + // Save orientation as pointing towards small tag + if (tag[i] < tag[j]) { + delx = x[i][0] - x[j][0]; + dely = x[i][1] - x[j][1]; + delz = x[i][2] - x[j][2]; + } else { + delx = x[j][0] - x[i][0]; + dely = x[j][1] - x[i][1]; + delz = x[j][2] - x[i][2]; + } + + // Get closest image in case bonded with ghost + domain->minimum_image(delx, dely, delz); + r = sqrt(delx * delx + dely * dely + delz * delz); + rinv = 1.0 / r; + + fix_bond_history->update_atom_value(i, m, 0, r); + fix_bond_history->update_atom_value(i, m, 1, delx * rinv); + fix_bond_history->update_atom_value(i, m, 2, dely * rinv); + fix_bond_history->update_atom_value(i, m, 3, delz * rinv); + } + } + + fix_bond_history->post_neighbor(); +} + +/* ---------------------------------------------------------------------- + Calculate forces using formulation in: + 1) Y. Wang Acta Geotechnica 2009 + 2) P. Mora & Y. Wang Advances in Geomcomputing 2009 +---------------------------------------------------------------------- */ + +double BondBPMRotational::elastic_forces(int i1, int i2, int type, double &Fr, double r_mag, + double r0_mag, double r_mag_inv, double * /*rhat*/, + double *r, double *r0, double *force1on2, + double *torque1on2, double *torque2on1) +{ + double breaking, temp, r0_dot_rb, c, gamma; + double psi, theta, cos_phi, sin_phi; + double mag_in_plane, mag_out_plane; + double Fs_mag, Tt_mag, Tb_mag; + + double q1[4], q2[4]; + double q2inv[4], mq[4], mqinv[4], qp21[4], q21[4], qtmp[4]; + double rb[3], rb_x_r0[3], s[3], t[3]; + double Fs[3], Fsp[3], F_rot[3], Ftmp[3]; + double Ts[3], Tb[3], Tt[3], Tbp[3], Ttp[3], Tsp[3], T_rot[3], Ttmp[3]; + + double **quat = atom->quat; + + q1[0] = quat[i1][0]; + q1[1] = quat[i1][1]; + q1[2] = quat[i1][2]; + q1[3] = quat[i1][3]; + + q2[0] = quat[i2][0]; + q2[1] = quat[i2][1]; + q2[2] = quat[i2][2]; + q2[3] = quat[i2][3]; + + // Calculate normal forces, rb = bond vector in particle 1's frame + MathExtra::qconjugate(q2, q2inv); + MathExtra::quatrotvec(q2inv, r, rb); + Fr = Kr[type] * (r_mag - r0_mag); + + MathExtra::scale3(Fr * r_mag_inv, rb, F_rot); + + // Calculate forces due to tangential displacements (no rotation) + r0_dot_rb = MathExtra::dot3(r0, rb); + c = r0_dot_rb * r_mag_inv / r0_mag; + gamma = acos_limit(c); + + MathExtra::cross3(rb, r0, rb_x_r0); + MathExtra::cross3(rb, rb_x_r0, s); + MathExtra::norm3(s); + + MathExtra::scale3(Ks[type] * r_mag * gamma, s, Fs); + + // Calculate torque due to tangential displacements + MathExtra::cross3(r0, rb, t); + MathExtra::norm3(t); + + MathExtra::scale3(0.5 * r_mag * Ks[type] * r_mag * gamma, t, Ts); + + // Relative rotation force/torque + // Use representation of X'Y'Z' rotations from Wang, Mora 2009 + temp = r_mag + rb[2]; + if (temp < 0.0) temp = 0.0; + mq[0] = sqrt(2) * 0.5 * sqrt(temp * r_mag_inv); + + temp = sqrt(rb[0] * rb[0] + rb[1] * rb[1]); + if (temp != 0.0) { + mq[1] = -sqrt(2) * 0.5 / temp; + temp = r_mag - rb[2]; + if (temp < 0.0) temp = 0.0; + mq[1] *= sqrt(temp * r_mag_inv); + mq[2] = -mq[1]; + mq[1] *= rb[1]; + mq[2] *= rb[0]; + } else { + // If aligned along z axis, x,y terms zero (r_mag-rb[2] = 0) + mq[1] = 0.0; + mq[2] = 0.0; + } + mq[3] = 0.0; + + // qp21 = opposite of r^\circ_21 in Wang + // q21 = opposite of r_21 in Wang + MathExtra::quatquat(q2inv, q1, qp21); + MathExtra::qconjugate(mq, mqinv); + MathExtra::quatquat(mqinv, qp21, qtmp); + MathExtra::quatquat(qtmp, mq, q21); + + temp = sqrt(q21[0] * q21[0] + q21[3] * q21[3]); + if (temp != 0.0) { + c = q21[0] / temp; + psi = 2.0 * acos_limit(c); + } else { + c = 0.0; + psi = 0.0; + } + + // Map negative rotations + if (q21[3] < 0.0) // sin = q21[3]/temp + psi = -psi; + + if (q21[3] == 0.0) psi = 0.0; + + c = q21[0] * q21[0] - q21[1] * q21[1] - q21[2] * q21[2] + q21[3] * q21[3]; + theta = acos_limit(c); + + // Separately calculte magnitude of quaternion in x-y and out of x-y planes + // to avoid dividing by zero + mag_out_plane = (q21[0] * q21[0] + q21[3] * q21[3]); + mag_in_plane = (q21[1] * q21[1] + q21[2] * q21[2]); + + if (mag_in_plane == 0.0) { + // No rotation => no bending/shear torque or extra shear force + // achieve by setting cos/sin = 0 + cos_phi = 0.0; + sin_phi = 0.0; + } else if (mag_out_plane == 0.0) { + // Calculate angle in plane + cos_phi = q21[2] / sqrt(mag_in_plane); + sin_phi = -q21[1] / sqrt(mag_in_plane); + } else { + // Default equations in Mora, Wang 2009 + cos_phi = q21[1] * q21[3] + q21[0] * q21[2]; + sin_phi = q21[2] * q21[3] - q21[0] * q21[1]; + + cos_phi /= sqrt(mag_out_plane * mag_in_plane); + sin_phi /= sqrt(mag_out_plane * mag_in_plane); + } + + Tbp[0] = -Kb[type] * theta * sin_phi; + Tbp[1] = Kb[type] * theta * cos_phi; + Tbp[2] = 0.0; + + Ttp[0] = 0.0; + Ttp[1] = 0.0; + Ttp[2] = Kt[type] * psi; + + Fsp[0] = -0.5 * Ks[type] * r_mag * theta * cos_phi; + Fsp[1] = -0.5 * Ks[type] * r_mag * theta * sin_phi; + Fsp[2] = 0.0; + + Tsp[0] = 0.25 * Ks[type] * r_mag * r_mag * theta * sin_phi; + Tsp[1] = -0.25 * Ks[type] * r_mag * r_mag * theta * cos_phi; + Tsp[2] = 0.0; + + // Rotate forces/torques back to 1st particle's frame + + MathExtra::quatrotvec(mq, Fsp, Ftmp); + MathExtra::quatrotvec(mq, Tsp, Ttmp); + for (int m = 0; m < 3; m++) { + Fs[m] += Ftmp[m]; + Ts[m] += Ttmp[m]; + } + + MathExtra::quatrotvec(mq, Tbp, Tb); + MathExtra::quatrotvec(mq, Ttp, Tt); + + // Sum forces and calculate magnitudes + F_rot[0] += Fs[0]; + F_rot[1] += Fs[1]; + F_rot[2] += Fs[2]; + MathExtra::quatrotvec(q2, F_rot, force1on2); + + T_rot[0] = Ts[0] + Tt[0] + Tb[0]; + T_rot[1] = Ts[1] + Tt[1] + Tb[1]; + T_rot[2] = Ts[2] + Tt[2] + Tb[2]; + MathExtra::quatrotvec(q2, T_rot, torque1on2); + + T_rot[0] = Ts[0] - Tt[0] - Tb[0]; + T_rot[1] = Ts[1] - Tt[1] - Tb[1]; + T_rot[2] = Ts[2] - Tt[2] - Tb[2]; + MathExtra::quatrotvec(q2, T_rot, torque2on1); + + Fs_mag = MathExtra::len3(Fs); + Tt_mag = MathExtra::len3(Tt); + Tb_mag = MathExtra::len3(Tb); + + breaking = Fr / Fcr[type] + Fs_mag / Fcs[type] + Tb_mag / Tcb[type] + Tt_mag / Tct[type]; + if (breaking < 0.0) breaking = 0.0; + + return breaking; +} + +/* ---------------------------------------------------------------------- + Calculate damping using formulation in + Y. Wang, F. Alonso-Marroquin, W. Guo 2015 + Note: n points towards 1 vs pointing towards 2 +---------------------------------------------------------------------- */ + +void BondBPMRotational::damping_forces(int i1, int i2, int type, double &Fr, double *rhat, + double *r, double *force1on2, double *torque1on2, + double *torque2on1) +{ + double v1dotr, v2dotr, w1dotr, w2dotr; + double s1[3], s2[3], tdamp[3], tmp[3]; + double vn1[3], vn2[3], vt1[3], vt2[3], vroll[3]; + double wxn1[3], wxn2[3], wn1[3], wn2[3]; + + double **v = atom->v; + double **omega = atom->omega; + + // Damp normal velocity difference + v1dotr = MathExtra::dot3(v[i1], rhat); + v2dotr = MathExtra::dot3(v[i2], rhat); + + MathExtra::scale3(v1dotr, rhat, vn1); + MathExtra::scale3(v2dotr, rhat, vn2); + + MathExtra::sub3(vn1, vn2, tmp); + MathExtra::scale3(gnorm[type], tmp); + Fr = MathExtra::lensq3(tmp); + MathExtra::add3(force1on2, tmp, force1on2); + + // Damp tangential objective velocities + MathExtra::sub3(v[i1], vn1, vt1); + MathExtra::sub3(v[i2], vn2, vt2); + + MathExtra::sub3(vt2, vt1, tmp); + MathExtra::scale3(0.5, tmp); + + MathExtra::cross3(omega[i1], r, s1); + MathExtra::scale3(-0.5, s1); + MathExtra::sub3(s1, tmp, s1); // Eq 12 + + MathExtra::cross3(omega[i2], r, s2); + MathExtra::scale3(0.5, s2); + MathExtra::add3(s2, tmp, s2); // Eq 13 + + MathExtra::sub3(s1, s2, tmp); + MathExtra::scale3(gslide[type], tmp); + MathExtra::add3(force1on2, tmp, force1on2); + + // Apply corresponding torque + MathExtra::cross3(r, tmp, tdamp); + MathExtra::scale3(0.5, tdamp); + MathExtra::add3(torque1on2, tdamp, torque1on2); + MathExtra::add3(torque2on1, tdamp, torque2on1); + + // Damp rolling + MathExtra::cross3(omega[i1], rhat, wxn1); + MathExtra::cross3(omega[i2], rhat, wxn2); + MathExtra::sub3(wxn1, wxn2, vroll); // Eq. 31 + MathExtra::cross3(r, vroll, tdamp); + + MathExtra::scale3(0.5 * groll[type], tdamp); + MathExtra::add3(torque1on2, tdamp, torque1on2); + MathExtra::scale3(-1.0, tdamp); + MathExtra::add3(torque2on1, tdamp, torque2on1); + + // Damp twist + w1dotr = MathExtra::dot3(omega[i1], rhat); + w2dotr = MathExtra::dot3(omega[i2], rhat); + + MathExtra::scale3(w1dotr, rhat, wn1); + MathExtra::scale3(w2dotr, rhat, wn2); + + MathExtra::sub3(wn1, wn2, tdamp); // Eq. 38 + MathExtra::scale3(0.5 * gtwist[type], tdamp); + MathExtra::add3(torque1on2, tdamp, torque1on2); + MathExtra::scale3(-1.0, tdamp); + MathExtra::add3(torque2on1, tdamp, torque2on1); +} + +/* ---------------------------------------------------------------------- */ + +void BondBPMRotational::compute(int eflag, int vflag) +{ + + if (!fix_bond_history->stored_flag) { + fix_bond_history->stored_flag = true; + store_data(); + } + + int i1, i2, itmp, n, type; + double r[3], r0[3], rhat[3]; + double rsq, r0_mag, r_mag, r_mag_inv; + double Fr, breaking, smooth; + double force1on2[3], torque1on2[3], torque2on1[3]; + + ev_init(eflag, vflag); + + double **x = atom->x; + double **f = atom->f; + double **torque = atom->torque; + tagint *tag = atom->tag; + int **bondlist = neighbor->bondlist; + int nbondlist = neighbor->nbondlist; + int nlocal = atom->nlocal; + int newton_bond = force->newton_bond; + + double **bondstore = fix_bond_history->bondstore; + + for (n = 0; n < nbondlist; n++) { + + // skip bond if already broken + if (bondlist[n][2] <= 0) continue; + + i1 = bondlist[n][0]; + i2 = bondlist[n][1]; + type = bondlist[n][2]; + r0_mag = bondstore[n][0]; + + // Ensure pair is always ordered such that r0 points in + // a consistent direction and to ensure numerical operations + // are identical to minimize the possibility that a bond straddling + // an mpi grid (newton off) doesn't break on one proc but not the other + if (tag[i2] < tag[i1]) { + itmp = i1; + i1 = i2; + i2 = itmp; + } + + // If bond hasn't been set - should be initialized to zero + if (r0_mag < EPSILON || std::isnan(r0_mag)) r0_mag = store_bond(n, i1, i2); + + r0[0] = bondstore[n][1]; + r0[1] = bondstore[n][2]; + r0[2] = bondstore[n][3]; + MathExtra::scale3(r0_mag, r0); + + // Note this is the reverse of Mora & Wang + MathExtra::sub3(x[i1], x[i2], r); + + rsq = MathExtra::lensq3(r); + r_mag = sqrt(rsq); + r_mag_inv = 1.0 / r_mag; + MathExtra::scale3(r_mag_inv, r, rhat); + + // ------------------------------------------------------// + // Calculate forces, check if bond breaks + // ------------------------------------------------------// + + breaking = elastic_forces(i1, i2, type, Fr, r_mag, r0_mag, r_mag_inv, rhat, r, r0, force1on2, + torque1on2, torque2on1); + + if (breaking >= 1.0) { + bondlist[n][2] = 0; + process_broken(i1, i2); + continue; + } + + damping_forces(i1, i2, type, Fr, rhat, r, force1on2, torque1on2, torque2on1); + + if (smooth_flag) { + smooth = breaking * breaking; + smooth = 1.0 - smooth * smooth; + } else { + smooth = 1.0; + } + + // ------------------------------------------------------// + // Apply forces and torques to particles + // ------------------------------------------------------// + + if (newton_bond || i1 < nlocal) { + f[i1][0] -= force1on2[0] * smooth; + f[i1][1] -= force1on2[1] * smooth; + f[i1][2] -= force1on2[2] * smooth; + + torque[i1][0] += torque2on1[0] * smooth; + torque[i1][1] += torque2on1[1] * smooth; + torque[i1][2] += torque2on1[2] * smooth; + } + + if (newton_bond || i2 < nlocal) { + f[i2][0] += force1on2[0] * smooth; + f[i2][1] += force1on2[1] * smooth; + f[i2][2] += force1on2[2] * smooth; + + torque[i2][0] += torque1on2[0] * smooth; + torque[i2][1] += torque1on2[1] * smooth; + torque[i2][2] += torque1on2[2] * smooth; + } + + if (evflag) ev_tally(i1, i2, nlocal, newton_bond, 0.0, Fr * smooth, r[0], r[1], r[2]); + } +} + +/* ---------------------------------------------------------------------- */ + +void BondBPMRotational::allocate() +{ + allocated = 1; + const int np1 = atom->nbondtypes + 1; + + memory->create(Kr, np1, "bond:Kr"); + memory->create(Ks, np1, "bond:Ks"); + memory->create(Kt, np1, "bond:Kt"); + memory->create(Kb, np1, "bond:Kb"); + memory->create(Fcr, np1, "bond:Fcr"); + memory->create(Fcs, np1, "bond:Fcs"); + memory->create(Tct, np1, "bond:Tct"); + memory->create(Tcb, np1, "bond:Tcb"); + memory->create(gnorm, np1, "bond:gnorm"); + memory->create(gslide, np1, "bond:gslide"); + memory->create(groll, np1, "bond:groll"); + memory->create(gtwist, np1, "bond:gtwist"); + + memory->create(setflag, np1, "bond:setflag"); + for (int i = 1; i < np1; i++) setflag[i] = 0; +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more types +------------------------------------------------------------------------- */ + +void BondBPMRotational::coeff(int narg, char **arg) +{ + if (narg != 13) error->all(FLERR, "Incorrect args for bond coefficients"); + if (!allocated) allocate(); + + int ilo, ihi; + utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error); + + double Kr_one = utils::numeric(FLERR, arg[1], false, lmp); + double Ks_one = utils::numeric(FLERR, arg[2], false, lmp); + double Kt_one = utils::numeric(FLERR, arg[3], false, lmp); + double Kb_one = utils::numeric(FLERR, arg[4], false, lmp); + double Fcr_one = utils::numeric(FLERR, arg[5], false, lmp); + double Fcs_one = utils::numeric(FLERR, arg[6], false, lmp); + double Tct_one = utils::numeric(FLERR, arg[7], false, lmp); + double Tcb_one = utils::numeric(FLERR, arg[8], false, lmp); + double gnorm_one = utils::numeric(FLERR, arg[9], false, lmp); + double gslide_one = utils::numeric(FLERR, arg[10], false, lmp); + double groll_one = utils::numeric(FLERR, arg[11], false, lmp); + double gtwist_one = utils::numeric(FLERR, arg[12], false, lmp); + + int count = 0; + for (int i = ilo; i <= ihi; i++) { + Kr[i] = Kr_one; + Ks[i] = Ks_one; + Kt[i] = Kt_one; + Kb[i] = Kb_one; + Fcr[i] = Fcr_one; + Fcs[i] = Fcs_one; + Tct[i] = Tct_one; + Tcb[i] = Tcb_one; + gnorm[i] = gnorm_one; + gslide[i] = gslide_one; + groll[i] = groll_one; + gtwist[i] = gtwist_one; + setflag[i] = 1; + count++; + + if (Fcr[i] / Kr[i] > max_stretch) max_stretch = Fcr[i] / Kr[i]; + } + + if (count == 0) error->all(FLERR, "Incorrect args for bond coefficients"); +} + +/* ---------------------------------------------------------------------- + check for correct settings and create fix +------------------------------------------------------------------------- */ + +void BondBPMRotational::init_style() +{ + BondBPM::init_style(); + + if (!atom->quat_flag || !atom->sphere_flag) + error->all(FLERR, "Bond bpm/rotational requires atom style bpm/sphere"); + if (comm->ghost_velocity == 0) + error->all(FLERR, "Bond bpm/rotational requires ghost atoms store velocity"); + + if (domain->dimension == 2) + error->warning(FLERR, "Bond style bpm/rotational not intended for 2d use"); + + if (!id_fix_bond_history) { + id_fix_bond_history = utils::strdup("HISTORY_BPM_ROTATIONAL"); + fix_bond_history = dynamic_cast(modify->replace_fix( + id_fix_dummy2, fmt::format("{} all BOND_HISTORY 0 4", id_fix_bond_history), 1)); + delete[] id_fix_dummy2; + id_fix_dummy2 = nullptr; + } +} + +/* ---------------------------------------------------------------------- */ + +void BondBPMRotational::settings(int narg, char **arg) +{ + BondBPM::settings(narg, arg); + + int iarg; + for (std::size_t i = 0; i < leftover_iarg.size(); i++) { + iarg = leftover_iarg[i]; + if (strcmp(arg[iarg], "smooth") == 0) { + if (iarg + 1 > narg) error->all(FLERR, "Illegal bond bpm command"); + smooth_flag = utils::logical(FLERR, arg[iarg + 1], false, lmp); + i += 1; + } else { + error->all(FLERR, "Illegal bond_style command"); + } + } +} + +/* ---------------------------------------------------------------------- + proc 0 writes out coeffs to restart file +------------------------------------------------------------------------- */ + +void BondBPMRotational::write_restart(FILE *fp) +{ + fwrite(&Kr[1], sizeof(double), atom->nbondtypes, fp); + fwrite(&Ks[1], sizeof(double), atom->nbondtypes, fp); + fwrite(&Kt[1], sizeof(double), atom->nbondtypes, fp); + fwrite(&Kb[1], sizeof(double), atom->nbondtypes, fp); + fwrite(&Fcr[1], sizeof(double), atom->nbondtypes, fp); + fwrite(&Fcs[1], sizeof(double), atom->nbondtypes, fp); + fwrite(&Tct[1], sizeof(double), atom->nbondtypes, fp); + fwrite(&Tcb[1], sizeof(double), atom->nbondtypes, fp); + fwrite(&gnorm[1], sizeof(double), atom->nbondtypes, fp); + fwrite(&gslide[1], sizeof(double), atom->nbondtypes, fp); + fwrite(&groll[1], sizeof(double), atom->nbondtypes, fp); + fwrite(>wist[1], sizeof(double), atom->nbondtypes, fp); +} + +/* ---------------------------------------------------------------------- + proc 0 reads coeffs from restart file, bcasts them +------------------------------------------------------------------------- */ + +void BondBPMRotational::read_restart(FILE *fp) +{ + allocate(); + + if (comm->me == 0) { + utils::sfread(FLERR, &Kr[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, &Ks[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, &Kt[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, &Kb[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, &Fcr[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, &Fcs[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, &Tct[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, &Tcb[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, &gnorm[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, &gslide[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, &groll[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, >wist[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + } + MPI_Bcast(&Kr[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(&Ks[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(&Kt[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(&Kb[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(&Fcr[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(&Fcs[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(&Tct[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(&Tcb[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(&gnorm[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(&gslide[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(&groll[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(>wist[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 BondBPMRotational::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nbondtypes; i++) + fprintf(fp, "%d %g %g %g %g %g %g %g %g %g %g %g %g\n", i, Kr[i], Ks[i], Kt[i], Kb[i], Fcr[i], + Fcs[i], Tct[i], Tcb[i], gnorm[i], gslide[i], groll[i], gtwist[i]); +} + +/* ---------------------------------------------------------------------- */ + +double BondBPMRotational::single(int type, double rsq, int i, int j, double &fforce) +{ + // Not yet enabled + if (type <= 0) return 0.0; + + int itmp; + if (atom->tag[j] < atom->tag[i]) { + itmp = i; + i = j; + j = itmp; + } + + double r0_mag, r_mag, r_mag_inv; + double r0[3], r[3], rhat[3]; + for (int n = 0; n < atom->num_bond[i]; n++) { + if (atom->bond_atom[i][n] == atom->tag[j]) { + r0_mag = fix_bond_history->get_atom_value(i, n, 0); + r0[0] = fix_bond_history->get_atom_value(i, n, 1); + r0[1] = fix_bond_history->get_atom_value(i, n, 2); + r0[2] = fix_bond_history->get_atom_value(i, n, 3); + } + } + + double **x = atom->x; + MathExtra::scale3(r0_mag, r0); + MathExtra::sub3(x[i], x[j], r); + + r_mag = sqrt(rsq); + r_mag_inv = 1.0 / r_mag; + MathExtra::scale3(r_mag_inv, r, rhat); + + double breaking, smooth, Fr; + double force1on2[3], torque1on2[3], torque2on1[3]; + breaking = elastic_forces(i, j, type, Fr, r_mag, r0_mag, r_mag_inv, rhat, r, r0, force1on2, + torque1on2, torque2on1); + fforce = Fr; + damping_forces(i, j, type, Fr, rhat, r, force1on2, torque1on2, torque2on1); + fforce += Fr; + + if (smooth_flag) { + smooth = breaking * breaking; + smooth = 1.0 - smooth * smooth; + fforce *= smooth; + } + return 0.0; +} diff --git a/src/BPM/bond_bpm_rotational.h b/src/BPM/bond_bpm_rotational.h new file mode 100644 index 0000000000..7244afe213 --- /dev/null +++ b/src/BPM/bond_bpm_rotational.h @@ -0,0 +1,83 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef BOND_CLASS +// clang-format off +BondStyle(bpm/rotational,BondBPMRotational); +// clang-format on +#else + +#ifndef LMP_BOND_BPM_ROTATIONAL_H +#define LMP_BOND_BPM_ROTATIONAL_H + +#include "bond_bpm.h" + +namespace LAMMPS_NS { + +class BondBPMRotational : public BondBPM { + public: + BondBPMRotational(class LAMMPS *); + ~BondBPMRotational() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + void settings(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; + + protected: + double *Kr, *Ks, *Kt, *Kb, *gnorm, *gslide, *groll, *gtwist; + double *Fcr, *Fcs, *Tct, *Tcb; + int smooth_flag; + + double acos_limit(double); + + double elastic_forces(int, int, int, double &, double, double, double, double *, double *, + double *, double *, double *, double *); + void damping_forces(int, int, int, double &, double *, double *, double *, double *, double *); + + void allocate(); + void store_data(); + double store_bond(int, int, int); +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Atom missing in BPM bond + +Bonded atom cannot be found + +E: Incorrect args for bond coefficients + +Self-explanatory. Check the input script or data file. + +E: Bond bpm/rotational requires atom style bpm/sphere + +Self-explanatory. + +E: Bond style bpm requires 1-3 and 1-4 special weights of 1.0 + +Self-explanatory. + +W: Bond style bpm/rotational not intended for 2d use, may be inefficient + +This bond style will perform a lot of unnecessary calculations in 2d + +*/ diff --git a/src/BPM/bond_bpm_spring.cpp b/src/BPM/bond_bpm_spring.cpp new file mode 100644 index 0000000000..e2cbe5949e --- /dev/null +++ b/src/BPM/bond_bpm_spring.cpp @@ -0,0 +1,380 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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 "bond_bpm_spring.h" + +#include "atom.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "fix_bond_history.h" +#include "force.h" +#include "memory.h" +#include "modify.h" +#include "neighbor.h" + +#define EPSILON 1e-10 + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +BondBPMSpring::BondBPMSpring(LAMMPS *_lmp) : BondBPM(_lmp), k(nullptr), ecrit(nullptr), gamma(nullptr) +{ + partial_flag = 1; + smooth_flag = 1; +} + +/* ---------------------------------------------------------------------- */ + +BondBPMSpring::~BondBPMSpring() +{ + if (allocated) { + memory->destroy(setflag); + memory->destroy(k); + memory->destroy(ecrit); + memory->destroy(gamma); + } +} + +/* ---------------------------------------------------------------------- + Store data for a single bond - if bond added after LAMMPS init (e.g. pour) +------------------------------------------------------------------------- */ + +double BondBPMSpring::store_bond(int n, int i, int j) +{ + double delx, dely, delz, r; + double **x = atom->x; + double **bondstore = fix_bond_history->bondstore; + tagint *tag = atom->tag; + + delx = x[i][0] - x[j][0]; + dely = x[i][1] - x[j][1]; + delz = x[i][2] - x[j][2]; + + r = sqrt(delx * delx + dely * dely + delz * delz); + bondstore[n][0] = r; + + if (i < atom->nlocal) { + for (int m = 0; m < atom->num_bond[i]; m++) { + if (atom->bond_atom[i][m] == tag[j]) { fix_bond_history->update_atom_value(i, m, 0, r); } + } + } + + if (j < atom->nlocal) { + for (int m = 0; m < atom->num_bond[j]; m++) { + if (atom->bond_atom[j][m] == tag[i]) { fix_bond_history->update_atom_value(j, m, 0, r); } + } + } + + return r; +} + +/* ---------------------------------------------------------------------- + Store data for all bonds called once +------------------------------------------------------------------------- */ + +void BondBPMSpring::store_data() +{ + int i, j, m, type; + double delx, dely, delz, r; + double **x = atom->x; + int **bond_type = atom->bond_type; + + for (i = 0; i < atom->nlocal; i++) { + for (m = 0; m < atom->num_bond[i]; m++) { + type = bond_type[i][m]; + + //Skip if bond was turned off + if (type < 0) continue; + + // map to find index n + j = atom->map(atom->bond_atom[i][m]); + if (j == -1) error->one(FLERR, "Atom missing in BPM bond"); + + delx = x[i][0] - x[j][0]; + dely = x[i][1] - x[j][1]; + delz = x[i][2] - x[j][2]; + + // Get closest image in case bonded with ghost + domain->minimum_image(delx, dely, delz); + r = sqrt(delx * delx + dely * dely + delz * delz); + + fix_bond_history->update_atom_value(i, m, 0, r); + } + } + + fix_bond_history->post_neighbor(); +} + +/* ---------------------------------------------------------------------- */ + +void BondBPMSpring::compute(int eflag, int vflag) +{ + + if (!fix_bond_history->stored_flag) { + fix_bond_history->stored_flag = true; + store_data(); + } + + int i1, i2, itmp, n, type; + double delx, dely, delz, delvx, delvy, delvz; + double e, rsq, r, r0, rinv, smooth, fbond, dot; + + ev_init(eflag, vflag); + + double **x = atom->x; + double **v = atom->v; + double **f = atom->f; + tagint *tag = atom->tag; + int **bondlist = neighbor->bondlist; + int nbondlist = neighbor->nbondlist; + int nlocal = atom->nlocal; + int newton_bond = force->newton_bond; + + double **bondstore = fix_bond_history->bondstore; + + for (n = 0; n < nbondlist; n++) { + + // skip bond if already broken + if (bondlist[n][2] <= 0) continue; + + i1 = bondlist[n][0]; + i2 = bondlist[n][1]; + type = bondlist[n][2]; + r0 = bondstore[n][0]; + + // Ensure pair is always ordered to ensure numerical operations + // are identical to minimize the possibility that a bond straddling + // an mpi grid (newton off) doesn't break on one proc but not the other + if (tag[i2] < tag[i1]) { + itmp = i1; + i1 = i2; + i2 = itmp; + } + + // If bond hasn't been set - should be initialized to zero + if (r0 < EPSILON || std::isnan(r0)) r0 = store_bond(n, i1, 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; + r = sqrt(rsq); + e = (r - r0) / r0; + + if (fabs(e) > ecrit[type]) { + bondlist[n][2] = 0; + process_broken(i1, i2); + continue; + } + + rinv = 1.0 / r; + fbond = k[type] * (r0 - r); + + delvx = v[i1][0] - v[i2][0]; + delvy = v[i1][1] - v[i2][1]; + delvz = v[i1][2] - v[i2][2]; + dot = delx * delvx + dely * delvy + delz * delvz; + fbond -= gamma[type] * dot * rinv; + fbond *= rinv; + + if (smooth_flag) { + smooth = (r - r0) / (r0 * ecrit[type]); + smooth *= smooth; + smooth *= smooth; + smooth *= smooth; + smooth = 1 - smooth; + fbond *= smooth; + } + + 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, 0.0, fbond, delx, dely, delz); + } +} + +/* ---------------------------------------------------------------------- */ + +void BondBPMSpring::allocate() +{ + allocated = 1; + const int np1 = atom->nbondtypes + 1; + + memory->create(k, np1, "bond:k"); + memory->create(ecrit, np1, "bond:ecrit"); + memory->create(gamma, np1, "bond:gamma"); + + memory->create(setflag, np1, "bond:setflag"); + for (int i = 1; i < np1; i++) setflag[i] = 0; +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more types +------------------------------------------------------------------------- */ + +void BondBPMSpring::coeff(int narg, char **arg) +{ + if (narg != 4) error->all(FLERR, "Incorrect args for bond coefficients"); + if (!allocated) allocate(); + + int ilo, ihi; + utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error); + + double k_one = utils::numeric(FLERR, arg[1], false, lmp); + double ecrit_one = utils::numeric(FLERR, arg[2], false, lmp); + double gamma_one = utils::numeric(FLERR, arg[3], false, lmp); + + int count = 0; + for (int i = ilo; i <= ihi; i++) { + k[i] = k_one; + ecrit[i] = ecrit_one; + gamma[i] = gamma_one; + setflag[i] = 1; + count++; + + if (1.0 + ecrit[i] > max_stretch) max_stretch = 1.0 + ecrit[i]; + } + + if (count == 0) error->all(FLERR, "Incorrect args for bond coefficients"); +} + +/* ---------------------------------------------------------------------- + check for correct settings and create fix +------------------------------------------------------------------------- */ + +void BondBPMSpring::init_style() +{ + BondBPM::init_style(); + + if (comm->ghost_velocity == 0) + error->all(FLERR, "Bond bpm/spring requires ghost atoms store velocity"); + + if (!id_fix_bond_history) { + id_fix_bond_history = utils::strdup("HISTORY_BPM_SPRING"); + fix_bond_history = dynamic_cast(modify->replace_fix( + id_fix_dummy2, fmt::format("{} all BOND_HISTORY 0 1", id_fix_bond_history), 1)); + delete[] id_fix_dummy2; + id_fix_dummy2 = nullptr; + } +} + +/* ---------------------------------------------------------------------- */ + +void BondBPMSpring::settings(int narg, char **arg) +{ + BondBPM::settings(narg, arg); + + int iarg; + for (std::size_t i = 0; i < leftover_iarg.size(); i++) { + iarg = leftover_iarg[i]; + if (strcmp(arg[iarg], "smooth") == 0) { + if (iarg + 1 > narg) error->all(FLERR, "Illegal bond bpm command"); + smooth_flag = utils::logical(FLERR, arg[iarg + 1], false, lmp); + i += 1; + } else { + error->all(FLERR, "Illegal bond_style command"); + } + } +} + +/* ---------------------------------------------------------------------- + proc 0 writes out coeffs to restart file +------------------------------------------------------------------------- */ + +void BondBPMSpring::write_restart(FILE *fp) +{ + fwrite(&k[1], sizeof(double), atom->nbondtypes, fp); + fwrite(&ecrit[1], sizeof(double), atom->nbondtypes, fp); + fwrite(&gamma[1], sizeof(double), atom->nbondtypes, fp); +} + +/* ---------------------------------------------------------------------- + proc 0 reads coeffs from restart file, bcasts them +------------------------------------------------------------------------- */ + +void BondBPMSpring::read_restart(FILE *fp) +{ + allocate(); + + if (comm->me == 0) { + utils::sfread(FLERR, &k[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, &ecrit[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + utils::sfread(FLERR, &gamma[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); + } + MPI_Bcast(&k[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(&ecrit[1], atom->nbondtypes, MPI_DOUBLE, 0, world); + MPI_Bcast(&gamma[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 BondBPMSpring::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nbondtypes; i++) + fprintf(fp, "%d %g %g %g\n", i, k[i], ecrit[i], gamma[i]); +} + +/* ---------------------------------------------------------------------- */ + +double BondBPMSpring::single(int type, double rsq, int i, int j, double &fforce) +{ + if (type <= 0) return 0.0; + + double r0; + for (int n = 0; n < atom->num_bond[i]; n++) { + if (atom->bond_atom[i][n] == atom->tag[j]) r0 = fix_bond_history->get_atom_value(i, n, 0); + } + + double r = sqrt(rsq); + double rinv = 1.0 / r; + fforce = k[type] * (r0 - r); + + double **x = atom->x; + double **v = atom->v; + double delx = x[i][0] - x[j][0]; + double dely = x[i][1] - x[j][1]; + double delz = x[i][2] - x[j][2]; + double delvx = v[i][0] - v[j][0]; + double delvy = v[i][1] - v[j][1]; + double delvz = v[i][2] - v[j][2]; + double dot = delx * delvx + dely * delvy + delz * delvz; + fforce -= gamma[type] * dot * rinv; + fforce *= rinv; + + if (smooth_flag) { + double smooth = (r - r0) / (r0 * ecrit[type]); + smooth *= smooth; + smooth *= smooth; + smooth *= smooth; + smooth = 1 - smooth; + fforce *= smooth; + } + + return 0.0; +} diff --git a/src/BPM/bond_bpm_spring.h b/src/BPM/bond_bpm_spring.h new file mode 100644 index 0000000000..a847ed56a1 --- /dev/null +++ b/src/BPM/bond_bpm_spring.h @@ -0,0 +1,68 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef BOND_CLASS +// clang-format off +BondStyle(bpm/spring,BondBPMSpring); +// clang-format on +#else + +#ifndef LMP_BOND_BPM_SPRING_H +#define LMP_BOND_BPM_SPRING_H + +#include "bond_bpm.h" + +namespace LAMMPS_NS { + +class BondBPMSpring : public BondBPM { + public: + BondBPMSpring(class LAMMPS *); + ~BondBPMSpring() override; + void compute(int, int) override; + void coeff(int, char **) override; + void init_style() override; + void settings(int, char **) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + double single(int, double, int, int, double &) override; + + protected: + double *k, *ecrit, *gamma; + int smooth_flag; + + void allocate(); + void store_data(); + double store_bond(int, int, int); +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Atom missing in BPM bond + +Bonded atom cannot be found + +E: Incorrect args for bond coefficients + +Self-explanatory. Check the input script or data file. + +E: Bond style bpm requires 1-3 and 1-4 special weights of 1.0 + +Self-explanatory. + +*/ diff --git a/src/BPM/compute_nbond_atom.cpp b/src/BPM/compute_nbond_atom.cpp new file mode 100644 index 0000000000..cc16473767 --- /dev/null +++ b/src/BPM/compute_nbond_atom.cpp @@ -0,0 +1,145 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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 "compute_nbond_atom.h" + +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "update.h" + +#include + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +ComputeNBondAtom::ComputeNBondAtom(LAMMPS *_lmp, int narg, char **arg) : + Compute(_lmp, narg, arg), nbond(nullptr) +{ + if (narg < 3) error->all(FLERR, "Illegal compute nbond/atom command"); + + peratom_flag = 1; + size_peratom_cols = 0; + peatomflag = 1; + timeflag = 1; + comm_reverse = 1; + + nmax = 0; +} + +/* ---------------------------------------------------------------------- */ + +ComputeNBondAtom::~ComputeNBondAtom() +{ + memory->destroy(nbond); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeNBondAtom::compute_peratom() +{ + + invoked_peratom = update->ntimestep; + if (update->eflag_atom != invoked_peratom) + error->all(FLERR, "Per-atom nbond was not tallied on needed timestep"); + + // grow local nbond array if necessary + // needs to be atom->nmax in length + + if (atom->nmax > nmax) { + memory->destroy(nbond); + nmax = atom->nmax; + memory->create(nbond, nmax, "nbond/atom:nbond"); + vector_atom = nbond; + } + + // npair includes ghosts if either newton flag is set + // b/c some bonds/dihedrals call pair::ev_tally with pairwise info + // nbond includes ghosts if newton_bond is set + // ntotal includes ghosts if either newton flag is set + // KSpace includes ghosts if tip4pflag is set + + int nlocal = atom->nlocal; + tagint **bond_atom = atom->bond_atom; + int **bond_type = atom->bond_type; + + int ntotal = nlocal; + if (force->newton) ntotal += atom->nghost; + + // set local nbond array + int i, j, k; + int *num_bond = atom->num_bond; + int newton_bond = force->newton_bond; + + for (i = 0; i < ntotal; i++) nbond[i] = 0; + + for (i = 0; i < nlocal; i++) { + for (j = 0; j < num_bond[i]; j++) { + if (bond_type[i][j] <= 0) continue; + + k = atom->map(bond_atom[i][j]); + if (k < 0) continue; + + nbond[i] += 1; + if (newton_bond) nbond[k] += 1; + } + } + + // communicate ghost nbond between neighbor procs + if (force->newton) comm->reverse_comm(this); + + // zero nbond of atoms not in group + // only do this after comm since ghost contributions must be included + int *mask = atom->mask; + + for (i = 0; i < nlocal; i++) + if (!(mask[i] & groupbit)) nbond[i] = 0.0; +} + +/* ---------------------------------------------------------------------- */ + +int ComputeNBondAtom::pack_reverse_comm(int n, int first, double *buf) +{ + int i, m, last; + + m = 0; + last = first + n; + for (i = first; i < last; i++) buf[m++] = nbond[i]; + return m; +} + +/* ---------------------------------------------------------------------- */ + +void ComputeNBondAtom::unpack_reverse_comm(int n, int *list, double *buf) +{ + int i, j, m; + + m = 0; + for (i = 0; i < n; i++) { + j = list[i]; + nbond[j] += buf[m++]; + } +} + +/* ---------------------------------------------------------------------- + memory usage of local atom-based array +------------------------------------------------------------------------- */ + +double ComputeNBondAtom::memory_usage() +{ + double bytes = nmax * sizeof(double); + return bytes; +} diff --git a/src/BPM/compute_nbond_atom.h b/src/BPM/compute_nbond_atom.h new file mode 100644 index 0000000000..32a979a9e9 --- /dev/null +++ b/src/BPM/compute_nbond_atom.h @@ -0,0 +1,61 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef COMPUTE_CLASS +// clang-format off +ComputeStyle(nbond/atom,ComputeNBondAtom); +// clang-format on +#else + +#ifndef LMP_COMPUTE_NBOND_ATOM_H +#define LMP_COMPUTE_NBOND_ATOM_H + +#include "compute.h" + +namespace LAMMPS_NS { + +class ComputeNBondAtom : public Compute { + public: + ComputeNBondAtom(class LAMMPS *, int, char **); + ~ComputeNBondAtom() override; + void init() override {} + void compute_peratom() override; + int pack_reverse_comm(int, int, double *) override; + void unpack_reverse_comm(int, int *, double *) override; + double memory_usage() override; + + private: + int nmax; + double *nbond; +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Per-atom energy was not tallied on needed timestep + +You are using a thermo keyword that requires potentials to +have tallied energy, but they didn't on this timestep. See the +variable doc page for ideas on how to make this work. + +*/ diff --git a/src/BPM/fix_nve_bpm_sphere.cpp b/src/BPM/fix_nve_bpm_sphere.cpp new file mode 100644 index 0000000000..77e2441618 --- /dev/null +++ b/src/BPM/fix_nve_bpm_sphere.cpp @@ -0,0 +1,157 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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 "fix_nve_bpm_sphere.h" + +#include "atom.h" +#include "atom_vec.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "math_extra.h" + +#include +#include + +using namespace LAMMPS_NS; +using namespace FixConst; +using namespace MathExtra; + +/* ---------------------------------------------------------------------- */ + +FixNVEBPMSphere::FixNVEBPMSphere(LAMMPS *_lmp, int narg, char **arg) : FixNVE(_lmp, narg, arg) +{ + if (narg < 3) error->all(FLERR, "Illegal fix nve/bpm/sphere command"); + + time_integrate = 1; + + // process extra keywords + // inertia = moment of inertia prefactor for sphere or disc + + inertia = 0.4; + + int iarg = 3; + while (iarg < narg) { + if (strcmp(arg[iarg], "disc") == 0) { + inertia = 0.5; + if (domain->dimension != 2) + error->all(FLERR, "Fix nve/bpm/sphere disc requires 2d simulation"); + iarg++; + } else + error->all(FLERR, "Illegal fix nve/bpm/sphere command"); + } + + inv_inertia = 1.0 / inertia; + + // error checks + + if (!atom->quat_flag || !atom->sphere_flag) + error->all(FLERR, "Fix nve/bpm/sphere requires atom style bpm/sphere"); +} + +/* ---------------------------------------------------------------------- */ + +void FixNVEBPMSphere::init() +{ + FixNVE::init(); + + // check that all particles are finite-size spheres + // no point particles allowed + + double *radius = atom->radius; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) + if (radius[i] == 0.0) error->one(FLERR, "Fix nve/bpm/sphere requires extended particles"); +} + +/* ---------------------------------------------------------------------- */ + +void FixNVEBPMSphere::initial_integrate(int /*vflag*/) +{ + double dtq, dtfm, dtirotate, particle_inertia; + + double **x = atom->x; + double **v = atom->v; + double **f = atom->f; + double **omega = atom->omega; + double **torque = atom->torque; + double **quat = atom->quat; + double *radius = atom->radius; + double *rmass = atom->rmass; + int *mask = atom->mask; + int nlocal = atom->nlocal; + if (igroup == atom->firstgroup) nlocal = atom->nfirst; + + // set timestep here since dt may have changed or come via rRESPA + dtq = 0.5 * dtv; + + // update v,x,omega,quat for all particles + // d_omega/dt = torque / inertia + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + dtfm = dtf / rmass[i]; + v[i][0] += dtfm * f[i][0]; + v[i][1] += dtfm * f[i][1]; + v[i][2] += dtfm * f[i][2]; + x[i][0] += dtv * v[i][0]; + x[i][1] += dtv * v[i][1]; + x[i][2] += dtv * v[i][2]; + + particle_inertia = inertia * (radius[i] * radius[i] * rmass[i]); + dtirotate = dtf / particle_inertia; + omega[i][0] += dtirotate * torque[i][0]; + omega[i][1] += dtirotate * torque[i][1]; + omega[i][2] += dtirotate * torque[i][2]; + + MathExtra::richardson_sphere(quat[i], omega[i], dtq); + } + } +} + +/* ---------------------------------------------------------------------- */ + +void FixNVEBPMSphere::final_integrate() +{ + double dtfm, dtirotate, particle_inertia; + + double **v = atom->v; + double **f = atom->f; + double **omega = atom->omega; + double **torque = atom->torque; + double *rmass = atom->rmass; + double *radius = atom->radius; + int *mask = atom->mask; + int nlocal = atom->nlocal; + if (igroup == atom->firstgroup) nlocal = atom->nfirst; + + // update v,omega for all particles + // d_omega/dt = torque / inertia + + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + dtfm = dtf / rmass[i]; + v[i][0] += dtfm * f[i][0]; + v[i][1] += dtfm * f[i][1]; + v[i][2] += dtfm * f[i][2]; + + particle_inertia = inertia * (radius[i] * radius[i] * rmass[i]); + dtirotate = dtf / particle_inertia; + omega[i][0] += dtirotate * torque[i][0]; + omega[i][1] += dtirotate * torque[i][1]; + omega[i][2] += dtirotate * torque[i][2]; + } +} diff --git a/src/MESSAGE/fix_client_md.h b/src/BPM/fix_nve_bpm_sphere.h similarity index 59% rename from src/MESSAGE/fix_client_md.h rename to src/BPM/fix_nve_bpm_sphere.h index 2a0106fd0e..48b65eb96b 100644 --- a/src/MESSAGE/fix_client_md.h +++ b/src/BPM/fix_nve_bpm_sphere.h @@ -13,40 +13,29 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(client/md,FixClientMD); +FixStyle(nve/bpm/sphere,FixNVEBPMSphere); // clang-format on #else -#ifndef LMP_FIX_CLIENT_MD_H -#define LMP_FIX_CLIENT_MD_H +#ifndef LMP_FIX_NVE_BPM_SPHERE_H +#define LMP_FIX_NVE_BPM_SPHERE_H -#include "fix.h" +#include "fix_nve.h" namespace LAMMPS_NS { -class FixClientMD : public Fix { +class FixNVEBPMSphere : public FixNVE { public: - FixClientMD(class LAMMPS *, int, char **); - ~FixClientMD() override; - int setmask() override; + FixNVEBPMSphere(class LAMMPS *, int, char **); + void init() override; - void setup(int) override; - void min_setup(int) override; - void post_force(int) override; - void min_post_force(int) override; - double compute_scalar() override; + void initial_integrate(int) override; + void final_integrate() override; - private: - int maxatom, units, server_error; - double eng; - double inv_nprocs; - double fconvert, econvert, pconvert; - double box[3][3]; - double *xpbc; - - void pack_coords(); - void pack_box(); - void receive_fev(int); + protected: + double inertia, inv_inertia; + int extra; + int dlm; }; } // namespace LAMMPS_NS @@ -62,4 +51,21 @@ Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. +E: Fix nve/bpm/sphere disc requires 2d simulation + +UNDOCUMENTED + +E: Fix nve/bpm/sphere requires atom style bpm/sphere + +Self-explanatory. + +E: Fix nve/bpm/sphere update dipole requires atom attribute mu + +An atom style with this attribute is needed. + +E: Fix nve/bpm/sphere requires extended particles + +This fix can only be used for particles of a finite size. + + */ diff --git a/src/BPM/pair_bpm_spring.cpp b/src/BPM/pair_bpm_spring.cpp new file mode 100644 index 0000000000..0dd113e2ed --- /dev/null +++ b/src/BPM/pair_bpm_spring.cpp @@ -0,0 +1,326 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "pair_bpm_spring.h" + +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neighbor.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +PairBPMSpring::PairBPMSpring(LAMMPS *_lmp) : Pair(_lmp) +{ + writedata = 1; +} + +/* ---------------------------------------------------------------------- */ + +PairBPMSpring::~PairBPMSpring() +{ + if (allocated) { + memory->destroy(setflag); + memory->destroy(cutsq); + + memory->destroy(k); + memory->destroy(cut); + memory->destroy(gamma); + } +} + +/* ---------------------------------------------------------------------- */ + +void PairBPMSpring::compute(int eflag, int vflag) +{ + int i, j, ii, jj, inum, jnum, itype, jtype; + double xtmp, ytmp, ztmp, delx, dely, delz, evdwl, fpair; + double r, rsq, rinv, factor_lj; + int *ilist, *jlist, *numneigh, **firstneigh; + double vxtmp, vytmp, vztmp, delvx, delvy, delvz, dot, smooth; + + evdwl = 0.0; + if (eflag || vflag) + ev_setup(eflag, vflag); + else + evflag = vflag_fdotr = 0; + + double **x = atom->x; + double **v = atom->v; + double **f = atom->f; + int *type = atom->type; + int nlocal = atom->nlocal; + int newton_pair = force->newton_pair; + double *special_lj = force->special_lj; + + inum = list->inum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + + // loop over neighbors of my atoms + + for (ii = 0; ii < inum; ii++) { + i = ilist[ii]; + xtmp = x[i][0]; + ytmp = x[i][1]; + ztmp = x[i][2]; + vxtmp = v[i][0]; + vytmp = v[i][1]; + vztmp = v[i][2]; + itype = type[i]; + jlist = firstneigh[i]; + jnum = numneigh[i]; + + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + factor_lj = special_lj[sbmask(j)]; + + if (factor_lj == 0) continue; + + j &= NEIGHMASK; + + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx * delx + dely * dely + delz * delz; + jtype = type[j]; + + if (rsq < cutsq[itype][jtype]) { + r = sqrt(rsq); + + rinv = 1.0 / r; + fpair = k[itype][jtype] * (cut[itype][jtype] - r); + + smooth = rsq / cutsq[itype][jtype]; + smooth *= smooth; + smooth *= smooth; + smooth = 1.0 - smooth; + delvx = vxtmp - v[j][0]; + delvy = vytmp - v[j][1]; + delvz = vztmp - v[j][2]; + dot = delx * delvx + dely * delvy + delz * delvz; + fpair -= gamma[itype][jtype] * dot * smooth * rinv; + + fpair *= factor_lj * rinv; + if (eflag) evdwl = 0.0; + + f[i][0] += delx * fpair; + f[i][1] += dely * fpair; + f[i][2] += delz * fpair; + + if (newton_pair || j < nlocal) { + f[j][0] -= delx * fpair; + f[j][1] -= dely * fpair; + f[j][2] -= delz * fpair; + } + + if (evflag) ev_tally(i, j, nlocal, newton_pair, evdwl, 0.0, fpair, delx, dely, delz); + } + } + } + + if (vflag_fdotr) virial_fdotr_compute(); +} + +/* ---------------------------------------------------------------------- + allocate all arrays +------------------------------------------------------------------------- */ + +void PairBPMSpring::allocate() +{ + allocated = 1; + const int np1 = atom->ntypes + 1; + + memory->create(setflag, np1, np1, "pair:setflag"); + for (int i = 1; i < np1; i++) + for (int j = i; j < np1; j++) setflag[i][j] = 0; + + memory->create(cutsq, np1, np1, "pair:cutsq"); + + memory->create(k, np1, np1, "pair:k"); + memory->create(cut, np1, np1, "pair:cut"); + memory->create(gamma, np1, np1, "pair:gamma"); +} + +/* ---------------------------------------------------------------------- + global settings +------------------------------------------------------------------------- */ + +void PairBPMSpring::settings(int narg, char ** /*arg*/) +{ + if (narg != 0) error->all(FLERR, "Illegal pair_style command"); +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more type pairs +------------------------------------------------------------------------- */ + +void PairBPMSpring::coeff(int narg, char **arg) +{ + if (narg != 5) error->all(FLERR, "Incorrect args for pair coefficients"); + if (!allocated) allocate(); + + int ilo, ihi, jlo, jhi; + utils::bounds(FLERR, arg[0], 1, atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR, arg[1], 1, atom->ntypes, jlo, jhi, error); + + double k_one = utils::numeric(FLERR, arg[2], false, lmp); + double cut_one = utils::numeric(FLERR, arg[3], false, lmp); + double gamma_one = utils::numeric(FLERR, arg[4], false, lmp); + + if (cut_one <= 0.0) error->all(FLERR, "Incorrect args for pair coefficients"); + + int count = 0; + for (int i = ilo; i <= ihi; i++) { + for (int j = MAX(jlo, i); j <= jhi; j++) { + k[i][j] = k_one; + cut[i][j] = cut_one; + gamma[i][j] = gamma_one; + + setflag[i][j] = 1; + count++; + } + } + + if (count == 0) error->all(FLERR, "Incorrect args for pair coefficients"); +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +double PairBPMSpring::init_one(int i, int j) +{ + if (setflag[i][j] == 0) { + cut[i][j] = mix_distance(cut[i][i], cut[j][j]); + k[i][j] = mix_energy(k[i][i], k[j][j], cut[i][i], cut[j][j]); + gamma[i][j] = mix_energy(gamma[i][i], gamma[j][j], cut[i][i], cut[j][j]); + } + + cut[j][i] = cut[i][j]; + k[j][i] = k[i][j]; + gamma[j][i] = gamma[i][j]; + + return cut[i][j]; +} + +/* ---------------------------------------------------------------------- + proc 0 writes to restart file +------------------------------------------------------------------------- */ + +void PairBPMSpring::write_restart(FILE *fp) +{ + write_restart_settings(fp); + + int i, j; + for (i = 1; i <= atom->ntypes; i++) + for (j = i; j <= atom->ntypes; j++) { + fwrite(&setflag[i][j], sizeof(int), 1, fp); + if (setflag[i][j]) { + fwrite(&k[i][j], sizeof(double), 1, fp); + fwrite(&cut[i][j], sizeof(double), 1, fp); + fwrite(&gamma[i][j], sizeof(double), 1, fp); + } + } +} + +/* ---------------------------------------------------------------------- + proc 0 reads from restart file, bcasts +------------------------------------------------------------------------- */ + +void PairBPMSpring::read_restart(FILE *fp) +{ + read_restart_settings(fp); + allocate(); + + int i, j; + int me = comm->me; + for (i = 1; i <= atom->ntypes; i++) + for (j = i; j <= atom->ntypes; j++) { + if (me == 0) fread(&setflag[i][j], sizeof(int), 1, fp); + MPI_Bcast(&setflag[i][j], 1, MPI_INT, 0, world); + if (setflag[i][j]) { + if (me == 0) { + fread(&k[i][j], sizeof(double), 1, fp); + fread(&cut[i][j], sizeof(double), 1, fp); + fread(&gamma[i][j], sizeof(double), 1, fp); + } + MPI_Bcast(&k[i][j], 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&cut[i][j], 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&gamma[i][j], 1, MPI_DOUBLE, 0, world); + } + } +} + +/* ---------------------------------------------------------------------- + proc 0 writes to data file +------------------------------------------------------------------------- */ + +void PairBPMSpring::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->ntypes; i++) + fprintf(fp, "%d %g %g %g\n", i, k[i][i], cut[i][i], gamma[i][i]); +} + +/* ---------------------------------------------------------------------- + proc 0 writes all pairs to data file +------------------------------------------------------------------------- */ + +void PairBPMSpring::write_data_all(FILE *fp) +{ + for (int i = 1; i <= atom->ntypes; i++) + for (int j = i; j <= atom->ntypes; j++) + fprintf(fp, "%d %d %g %g %g\n", i, j, k[i][j], cut[i][j], gamma[i][j]); +} + +/* ---------------------------------------------------------------------- */ + +double PairBPMSpring::single(int i, int j, int itype, int jtype, double rsq, double /*factor_coul*/, + double factor_lj, double &fforce) +{ + double fpair, r, rinv; + double delx, dely, delz, delvx, delvy, delvz, dot, smooth; + + if (rsq > cutsq[itype][jtype]) return 0.0; + + double **x = atom->x; + double **v = atom->v; + + r = sqrt(rsq); + rinv = 1.0 / r; + + fpair = k[itype][jtype] * (cut[itype][jtype] - r); + + smooth = rsq / cutsq[itype][jtype]; + smooth *= smooth; + smooth = 1.0 - smooth; + delx = x[i][0] - x[j][0]; + dely = x[i][1] - x[j][1]; + delz = x[i][2] - x[j][2]; + delvx = v[i][0] - v[j][0]; + delvy = v[i][1] - v[j][1]; + delvz = v[i][2] - v[j][2]; + dot = delx * delvx + dely * delvy + delz * delvz; + fpair -= gamma[itype][jtype] * dot * rinv * smooth; + + fpair *= factor_lj; + fforce = fpair; + + return 0.0; +} diff --git a/src/BPM/pair_bpm_spring.h b/src/BPM/pair_bpm_spring.h new file mode 100644 index 0000000000..c868066398 --- /dev/null +++ b/src/BPM/pair_bpm_spring.h @@ -0,0 +1,64 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS +// clang-format off +PairStyle(bpm/spring,PairBPMSpring); +// clang-format on +#else + +#ifndef LMP_PAIR_BPM_SPRING_H +#define LMP_PAIR_BPM_SPRING_H + +#include "pair.h" + +namespace LAMMPS_NS { + +class PairBPMSpring : public Pair { + public: + PairBPMSpring(class LAMMPS *); + ~PairBPMSpring() override; + void compute(int, int) override; + void settings(int, char **) override; + void coeff(int, char **) override; + double init_one(int, int) override; + void write_restart(FILE *) override; + void read_restart(FILE *) override; + void write_data(FILE *) override; + void write_data_all(FILE *) override; + double single(int, int, int, int, double, double, double, double &) override; + + protected: + double **k, **cut, **gamma; + + void allocate(); +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Incorrect args for pair coefficients + +Self-explanatory. Check the input script or data file. + +*/ diff --git a/src/BROWNIAN/fix_brownian.cpp b/src/BROWNIAN/fix_brownian.cpp index d4bdefca8b..de984e3736 100644 --- a/src/BROWNIAN/fix_brownian.cpp +++ b/src/BROWNIAN/fix_brownian.cpp @@ -33,7 +33,8 @@ using namespace FixConst; FixBrownian::FixBrownian(LAMMPS *lmp, int narg, char **arg) : FixBrownianBase(lmp, narg, arg) { - if (dipole_flag || gamma_t_eigen_flag || gamma_r_eigen_flag || gamma_r_flag) { + if (dipole_flag || gamma_t_eigen_flag || gamma_r_eigen_flag || gamma_r_flag || rot_temp_flag || + planar_rot_flag) { error->all(FLERR, "Illegal fix brownian command."); } if (!gamma_t_flag) { error->all(FLERR, "Illegal fix brownian command."); } @@ -45,7 +46,7 @@ void FixBrownian::init() { FixBrownianBase::init(); g1 /= gamma_t; - g2 /= sqrt(gamma_t); + g2 *= sqrt(temp / gamma_t); } /* ---------------------------------------------------------------------- */ diff --git a/src/BROWNIAN/fix_brownian_asphere.cpp b/src/BROWNIAN/fix_brownian_asphere.cpp index c2904aea64..d25123aa54 100644 --- a/src/BROWNIAN/fix_brownian_asphere.cpp +++ b/src/BROWNIAN/fix_brownian_asphere.cpp @@ -21,6 +21,7 @@ #include "atom.h" #include "atom_vec_ellipsoid.h" +#include "comm.h" #include "domain.h" #include "error.h" #include "math_extra.h" @@ -42,13 +43,20 @@ FixBrownianAsphere::FixBrownianAsphere(LAMMPS *lmp, int narg, char **arg) : if (dipole_flag && !atom->mu_flag) error->all(FLERR, "Fix brownian/asphere dipole requires atom attribute mu"); + + if (!atom->ellipsoid_flag) + error->all(FLERR, "Fix brownian/asphere requires atom style ellipsoid"); + + if (planar_rot_flag && (comm->me == 0)) { + error->warning(FLERR, "Ignoring first two entries of gamma_r_eigen since rotation is planar."); + } } /* ---------------------------------------------------------------------- */ void FixBrownianAsphere::init() { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR, "Compute brownian/asphere requires atom style ellipsoid"); // check that all particles are finite-size ellipsoids @@ -85,6 +93,9 @@ void FixBrownianAsphere::init() } FixBrownianBase::init(); + + g4 = g2 * sqrt(rot_temp); + g2 *= sqrt(temp); } /* ---------------------------------------------------------------------- */ @@ -94,37 +105,55 @@ void FixBrownianAsphere::initial_integrate(int /*vflag */) if (domain->dimension == 2) { if (dipole_flag) { if (!noise_flag) { - initial_integrate_templated<0, 0, 1, 1>(); + initial_integrate_templated<0, 0, 1, 1, 0>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0, 1, 1, 1>(); + initial_integrate_templated<0, 1, 1, 1, 0>(); } else { - initial_integrate_templated<1, 0, 1, 1>(); + initial_integrate_templated<1, 0, 1, 1, 0>(); } } else { if (!noise_flag) { - initial_integrate_templated<0, 0, 0, 1>(); + initial_integrate_templated<0, 0, 0, 1, 0>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0, 1, 0, 1>(); + initial_integrate_templated<0, 1, 0, 1, 0>(); } else { - initial_integrate_templated<1, 0, 0, 1>(); + initial_integrate_templated<1, 0, 0, 1, 0>(); + } + } + } else if (planar_rot_flag) { + if (dipole_flag) { + if (!noise_flag) { + initial_integrate_templated<0, 0, 1, 0, 1>(); + } else if (gaussian_noise_flag) { + initial_integrate_templated<0, 1, 1, 0, 1>(); + } else { + initial_integrate_templated<1, 0, 1, 0, 1>(); + } + } else { + if (!noise_flag) { + initial_integrate_templated<0, 0, 0, 0, 1>(); + } else if (gaussian_noise_flag) { + initial_integrate_templated<0, 1, 0, 0, 1>(); + } else { + initial_integrate_templated<1, 0, 0, 0, 1>(); } } } else { if (dipole_flag) { if (!noise_flag) { - initial_integrate_templated<0, 0, 1, 0>(); + initial_integrate_templated<0, 0, 1, 0, 0>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0, 1, 1, 0>(); + initial_integrate_templated<0, 1, 1, 0, 0>(); } else { - initial_integrate_templated<1, 0, 1, 0>(); + initial_integrate_templated<1, 0, 1, 0, 0>(); } } else { if (!noise_flag) { - initial_integrate_templated<0, 0, 0, 0>(); + initial_integrate_templated<0, 0, 0, 0, 0>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0, 1, 0, 0>(); + initial_integrate_templated<0, 1, 0, 0, 0>(); } else { - initial_integrate_templated<1, 0, 0, 0>(); + initial_integrate_templated<1, 0, 0, 0, 0>(); } } } @@ -133,7 +162,7 @@ void FixBrownianAsphere::initial_integrate(int /*vflag */) /* ---------------------------------------------------------------------- */ -template +template void FixBrownianAsphere::initial_integrate_templated() { double **x = atom->x; @@ -172,21 +201,30 @@ void FixBrownianAsphere::initial_integrate_templated() if (Tp_2D) { tmp[0] = tmp[1] = 0.0; if (Tp_UNIFORM) { - tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * (rng->uniform() - 0.5) * g2; + tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * (rng->uniform() - 0.5) * g4; } else if (Tp_GAUSS) { - tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * rng->gaussian() * g2; + tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * rng->gaussian() * g4; + } else { + tmp[2] = g1 * tmp[2] * gamma_r_inv[2]; + } + } else if (Tp_2Drot) { + tmp[0] = tmp[1] = 0.0; + if (Tp_UNIFORM) { + tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * (rng->uniform() - 0.5) * g4; + } else if (Tp_GAUSS) { + tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * rng->gaussian() * g4; } else { tmp[2] = g1 * tmp[2] * gamma_r_inv[2]; } } else { if (Tp_UNIFORM) { - tmp[0] = g1 * tmp[0] * gamma_r_inv[0] + gamma_r_invsqrt[0] * (rng->uniform() - 0.5) * g2; - tmp[1] = g1 * tmp[1] * gamma_r_inv[1] + gamma_r_invsqrt[1] * (rng->uniform() - 0.5) * g2; - tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * (rng->uniform() - 0.5) * g2; + tmp[0] = g1 * tmp[0] * gamma_r_inv[0] + gamma_r_invsqrt[0] * (rng->uniform() - 0.5) * g4; + tmp[1] = g1 * tmp[1] * gamma_r_inv[1] + gamma_r_invsqrt[1] * (rng->uniform() - 0.5) * g4; + tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * (rng->uniform() - 0.5) * g4; } else if (Tp_GAUSS) { - tmp[0] = g1 * tmp[0] * gamma_r_inv[0] + gamma_r_invsqrt[0] * rng->gaussian() * g2; - tmp[1] = g1 * tmp[1] * gamma_r_inv[1] + gamma_r_invsqrt[1] * rng->gaussian() * g2; - tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * rng->gaussian() * g2; + tmp[0] = g1 * tmp[0] * gamma_r_inv[0] + gamma_r_invsqrt[0] * rng->gaussian() * g4; + tmp[1] = g1 * tmp[1] * gamma_r_inv[1] + gamma_r_invsqrt[1] * rng->gaussian() * g4; + tmp[2] = g1 * tmp[2] * gamma_r_inv[2] + gamma_r_invsqrt[2] * rng->gaussian() * g4; } else { tmp[0] = g1 * tmp[0] * gamma_r_inv[0]; tmp[1] = g1 * tmp[1] * gamma_r_inv[1]; diff --git a/src/BROWNIAN/fix_brownian_asphere.h b/src/BROWNIAN/fix_brownian_asphere.h index f20b80a5be..d41d3ae3ac 100644 --- a/src/BROWNIAN/fix_brownian_asphere.h +++ b/src/BROWNIAN/fix_brownian_asphere.h @@ -35,8 +35,9 @@ class FixBrownianAsphere : public FixBrownianBase { class AtomVecEllipsoid *avec; private: - template + template void initial_integrate_templated(); + double g4; }; } // namespace LAMMPS_NS #endif diff --git a/src/BROWNIAN/fix_brownian_base.cpp b/src/BROWNIAN/fix_brownian_base.cpp index 369d36bf70..730b9a0c41 100644 --- a/src/BROWNIAN/fix_brownian_base.cpp +++ b/src/BROWNIAN/fix_brownian_base.cpp @@ -43,6 +43,8 @@ FixBrownianBase::FixBrownianBase(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n gamma_t_flag = gamma_r_flag = 0; gamma_t_eigen_flag = gamma_r_eigen_flag = 0; dipole_flag = 0; + rot_temp_flag = 0; + planar_rot_flag = 0; g2 = 0.0; if (narg < 5) error->all(FLERR, "Illegal fix brownian command."); @@ -154,10 +156,26 @@ FixBrownianBase::FixBrownianBase(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, n if (gamma_r <= 0) error->all(FLERR, "Fix brownian gamma_r must be > 0."); iarg = iarg + 2; + } else if (strcmp(arg[iarg], "rotation_temp") == 0) { + if (narg == iarg + 1) { error->all(FLERR, "Illegal fix brownian command."); } + + rot_temp_flag = 1; + rot_temp = utils::numeric(FLERR, arg[iarg + 1], false, lmp); + if (rot_temp <= 0) error->all(FLERR, "Fix brownian rotation_temp must be > 0."); + iarg = iarg + 2; + + } else if (strcmp(arg[iarg], "planar_rotation") == 0) { + + planar_rot_flag = 1; + if (domain->dimension == 2) + error->all(FLERR, "The planar_rotation keyword is not allowed for 2D simulations"); + iarg = iarg + 1; + } else { error->all(FLERR, "Illegal fix brownian command."); } } + if (!rot_temp_flag) rot_temp = temp; // initialize Marsaglia RNG with processor-unique seed rng = new RanMars(lmp, seed + comm->me); @@ -196,14 +214,13 @@ void FixBrownianBase::init() { dt = update->dt; sqrtdt = sqrt(dt); - g1 = force->ftm2v; if (noise_flag == 0) { g2 = 0.0; } else if (gaussian_noise_flag == 1) { - g2 = sqrt(2 * force->boltz * temp / dt / force->mvv2e); + g2 = sqrt(2 * force->boltz / dt / force->mvv2e); } else { - g2 = sqrt(24 * force->boltz * temp / dt / force->mvv2e); + g2 = sqrt(24 * force->boltz / dt / force->mvv2e); } } diff --git a/src/BROWNIAN/fix_brownian_base.h b/src/BROWNIAN/fix_brownian_base.h index f26fc301b0..cc8234f080 100644 --- a/src/BROWNIAN/fix_brownian_base.h +++ b/src/BROWNIAN/fix_brownian_base.h @@ -33,6 +33,8 @@ class FixBrownianBase : public Fix { int gamma_r_flag; // 0/1 if isotropic rotational damping is unset/set int gamma_t_eigen_flag; // 0/1 if anisotropic translational damping is unset/set int gamma_r_eigen_flag; // 0/1 if anisotropic rotational damping is unset/set + int rot_temp_flag; // 0/1 if rotational temperature is unset/set + int planar_rot_flag; // 0/1 if rotation is constrained to 2D (xy) plane double gamma_t, gamma_r; // translational and rotational (isotropic) damping params double *gamma_t_inv; // anisotropic damping parameter eigenvalues @@ -47,6 +49,7 @@ class FixBrownianBase : public Fix { int gaussian_noise_flag; // 0/1 for uniform/gaussian noise double temp; // temperature + double rot_temp; // temperature double g1, g2; // prefactors in time stepping class RanMars *rng; @@ -85,4 +88,13 @@ E: Fix brownian gamma_r must be > 0. Self-explanatory. +E: Fix brownian rotation_temp must be > 0. + +Self-explanatory. + +E: Do not explicitly set planar_rotation for 2D simulation + +Self-explanatory. + + */ diff --git a/src/BROWNIAN/fix_brownian_sphere.cpp b/src/BROWNIAN/fix_brownian_sphere.cpp index c6664b18ef..ad2f5ff967 100644 --- a/src/BROWNIAN/fix_brownian_sphere.cpp +++ b/src/BROWNIAN/fix_brownian_sphere.cpp @@ -41,6 +41,7 @@ FixBrownianSphere::FixBrownianSphere(LAMMPS *lmp, int narg, char **arg) : if (!gamma_t_flag || !gamma_r_flag) { error->all(FLERR, "Illegal fix brownian command."); } if (!atom->mu_flag) error->all(FLERR, "Fix brownian/sphere requires atom attribute mu"); + if (!atom->sphere_flag) error->all(FLERR, "Fix brownian/sphere requires atom style sphere"); } /* ---------------------------------------------------------------------- */ @@ -50,9 +51,9 @@ void FixBrownianSphere::init() FixBrownianBase::init(); g3 = g1 / gamma_r; - g4 = g2 / sqrt(gamma_r); + g4 = g2 * sqrt(rot_temp / gamma_r); g1 /= gamma_t; - g2 /= sqrt(gamma_t); + g2 *= sqrt(temp / gamma_t); } /* ---------------------------------------------------------------------- */ @@ -61,19 +62,27 @@ void FixBrownianSphere::initial_integrate(int /*vflag */) { if (domain->dimension == 2) { if (!noise_flag) { - initial_integrate_templated<0, 0, 1>(); + initial_integrate_templated<0, 0, 1, 0>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0, 1, 1>(); + initial_integrate_templated<0, 1, 1, 0>(); } else { - initial_integrate_templated<1, 0, 1>(); + initial_integrate_templated<1, 0, 1, 0>(); + } + } else if (planar_rot_flag) { + if (!noise_flag) { + initial_integrate_templated<0, 0, 0, 1>(); + } else if (gaussian_noise_flag) { + initial_integrate_templated<0, 1, 0, 1>(); + } else { + initial_integrate_templated<1, 0, 0, 1>(); } } else { if (!noise_flag) { - initial_integrate_templated<0, 0, 0>(); + initial_integrate_templated<0, 0, 0, 0>(); } else if (gaussian_noise_flag) { - initial_integrate_templated<0, 1, 0>(); + initial_integrate_templated<0, 1, 0, 0>(); } else { - initial_integrate_templated<1, 0, 0>(); + initial_integrate_templated<1, 0, 0, 0>(); } } return; @@ -81,7 +90,7 @@ void FixBrownianSphere::initial_integrate(int /*vflag */) /* ---------------------------------------------------------------------- */ -template +template void FixBrownianSphere::initial_integrate_templated() { double **x = atom->x; @@ -116,6 +125,24 @@ void FixBrownianSphere::initial_integrate_templated() dy = dt * g1 * f[i][1]; wz = 0; } + } else if (Tp_2Drot) { + wx = wy = 0; + if (Tp_UNIFORM) { + dx = dt * (g1 * f[i][0] + g2 * (rng->uniform() - 0.5)); + dy = dt * (g1 * f[i][1] + g2 * (rng->uniform() - 0.5)); + dz = dt * (g1 * f[i][2] + g2 * (rng->uniform() - 0.5)); + wz = (rng->uniform() - 0.5) * g4; + } else if (Tp_GAUSS) { + dx = dt * (g1 * f[i][0] + g2 * rng->gaussian()); + dy = dt * (g1 * f[i][1] + g2 * rng->gaussian()); + dz = dt * (g1 * f[i][2] + g2 * rng->gaussian()); + wz = rng->gaussian() * g4; + } else { + dx = dt * g1 * f[i][0]; + dy = dt * g1 * f[i][1]; + dz = dt * g1 * f[i][2]; + wz = 0; + } } else { if (Tp_UNIFORM) { dx = dt * (g1 * f[i][0] + g2 * (rng->uniform() - 0.5)); diff --git a/src/BROWNIAN/fix_brownian_sphere.h b/src/BROWNIAN/fix_brownian_sphere.h index 8f2e2de568..a80f2898a1 100644 --- a/src/BROWNIAN/fix_brownian_sphere.h +++ b/src/BROWNIAN/fix_brownian_sphere.h @@ -32,7 +32,8 @@ class FixBrownianSphere : public FixBrownianBase { void initial_integrate(int) override; private: - template void initial_integrate_templated(); + template + void initial_integrate_templated(); double g3, g4; }; } // namespace LAMMPS_NS @@ -53,6 +54,10 @@ E: Compute brownian/sphere requires atom attribute mu Self-explanatory. +E: Compute brownian/sphere requires atom style sphere + +Self-explanatory. + E: Fix brownian/sphere translational viscous drag coefficient must be > 0. Self-explanatory. diff --git a/src/BROWNIAN/fix_propel_self.cpp b/src/BROWNIAN/fix_propel_self.cpp index ea7a3c6834..4df10f9ef4 100644 --- a/src/BROWNIAN/fix_propel_self.cpp +++ b/src/BROWNIAN/fix_propel_self.cpp @@ -100,7 +100,7 @@ void FixPropelSelf::init() error->all(FLERR, "Fix propel/self requires atom attribute mu with option dipole"); if (mode == QUAT) { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR, "Fix propel/self requires atom style ellipsoid with option quat"); // check that all particles are finite-size ellipsoids diff --git a/src/CG-DNA/fix_nve_dot.cpp b/src/CG-DNA/fix_nve_dot.cpp index 53b13cdbf1..3806e452c3 100644 --- a/src/CG-DNA/fix_nve_dot.cpp +++ b/src/CG-DNA/fix_nve_dot.cpp @@ -37,7 +37,7 @@ FixNVEDot::FixNVEDot(LAMMPS *lmp, int narg, char **arg) : void FixNVEDot::init() { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Compute nve/dot requires atom style ellipsoid"); diff --git a/src/CG-DNA/fix_nve_dotc_langevin.cpp b/src/CG-DNA/fix_nve_dotc_langevin.cpp index 54c1d1b545..8ca4acf510 100644 --- a/src/CG-DNA/fix_nve_dotc_langevin.cpp +++ b/src/CG-DNA/fix_nve_dotc_langevin.cpp @@ -89,7 +89,7 @@ void FixNVEDotcLangevin::init() int *mask = atom->mask; int nlocal = atom->nlocal; - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Fix nve/dotc/langevin requires atom style ellipsoid"); diff --git a/src/CG-DNA/pair_oxdna_excv.cpp b/src/CG-DNA/pair_oxdna_excv.cpp index dfc96be13e..a201a5ccf7 100644 --- a/src/CG-DNA/pair_oxdna_excv.cpp +++ b/src/CG-DNA/pair_oxdna_excv.cpp @@ -139,7 +139,7 @@ void PairOxdnaExcv::compute(int eflag, int vflag) int newton_pair = force->newton_pair; int *alist,*blist,*numneigh,**firstneigh; - AtomVecEllipsoid *avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + auto avec = dynamic_cast( atom->style_match("ellipsoid")); AtomVecEllipsoid::Bonus *bonus = avec->bonus; int *ellipsoid = atom->ellipsoid; diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp index c95b34232b..0278e5c682 100644 --- a/src/CLASS2/pair_lj_class2.cpp +++ b/src/CLASS2/pair_lj_class2.cpp @@ -484,7 +484,7 @@ void PairLJClass2::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -493,8 +493,8 @@ void PairLJClass2::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style, "^respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast( update->integrate))->cutoff; else cut_respa = nullptr; } diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index 1b1cc9c5a9..d75c7dea9c 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -672,7 +672,7 @@ void PairLJClass2CoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -683,8 +683,8 @@ void PairLJClass2CoulLong::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style, "^respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast( update->integrate))->cutoff; else cut_respa = nullptr; diff --git a/src/COLLOID/pair_brownian.cpp b/src/COLLOID/pair_brownian.cpp index 5782586654..496d7cdee7 100644 --- a/src/COLLOID/pair_brownian.cpp +++ b/src/COLLOID/pair_brownian.cpp @@ -494,7 +494,7 @@ void PairBrownian::init_style() else if (strstr(modify->fix[i]->style, "wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with pair brownian"); flagwall = 1; // Walls exist - wallfix = (FixWall *) modify->fix[i]; + wallfix = dynamic_cast( modify->fix[i]); if (wallfix->xflag) flagwall = 2; // Moving walls exist } } diff --git a/src/COLLOID/pair_brownian_poly.cpp b/src/COLLOID/pair_brownian_poly.cpp index 2edbbadc0f..d24a65a821 100644 --- a/src/COLLOID/pair_brownian_poly.cpp +++ b/src/COLLOID/pair_brownian_poly.cpp @@ -362,7 +362,7 @@ void PairBrownianPoly::init_style() error->all(FLERR, "Cannot use multiple fix wall commands with pair brownian"); flagwall = 1; // Walls exist - wallfix = (FixWall *) modify->fix[i]; + wallfix = dynamic_cast( modify->fix[i]); if (wallfix->xflag) flagwall = 2; // Moving walls exist } } diff --git a/src/COLLOID/pair_lubricate.cpp b/src/COLLOID/pair_lubricate.cpp index c2117cf1ad..1267d42f1f 100644 --- a/src/COLLOID/pair_lubricate.cpp +++ b/src/COLLOID/pair_lubricate.cpp @@ -563,7 +563,7 @@ void PairLubricate::init_style() for (int i = 0; i < modify->nfix; i++) { if (strcmp(modify->fix[i]->style,"deform") == 0) { shearing = flagdeform = 1; - if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP) + if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using pair lubricate with inconsistent " "fix deform remap option"); } @@ -572,7 +572,7 @@ void PairLubricate::init_style() error->all(FLERR, "Cannot use multiple fix wall commands with pair lubricate"); flagwall = 1; // Walls exist - wallfix = (FixWall *) modify->fix[i]; + wallfix = dynamic_cast( modify->fix[i]); if (wallfix->xflag) flagwall = 2; // Moving walls exist } } diff --git a/src/COLLOID/pair_lubricateU.cpp b/src/COLLOID/pair_lubricateU.cpp index 3d4fbcbc7d..aa83a53ce4 100644 --- a/src/COLLOID/pair_lubricateU.cpp +++ b/src/COLLOID/pair_lubricateU.cpp @@ -1801,7 +1801,7 @@ void PairLubricateU::init_style() "Cannot use multiple fix wall commands with " "pair lubricateU"); flagwall = 1; // Walls exist - wallfix = (FixWall *) modify->fix[i]; + wallfix = dynamic_cast( modify->fix[i]); if (wallfix->xflag) flagwall = 2; // Moving walls exist } } diff --git a/src/COLLOID/pair_lubricateU_poly.cpp b/src/COLLOID/pair_lubricateU_poly.cpp index 0aed0df97f..1fad75a68c 100644 --- a/src/COLLOID/pair_lubricateU_poly.cpp +++ b/src/COLLOID/pair_lubricateU_poly.cpp @@ -1165,7 +1165,7 @@ void PairLubricateUPoly::init_style() "Cannot use multiple fix wall commands with " "pair lubricateU"); flagwall = 1; // Walls exist - wallfix = (FixWall *) modify->fix[i]; + wallfix = dynamic_cast( modify->fix[i]); if (wallfix->xflag) flagwall = 2; // Moving walls exist } } diff --git a/src/COLLOID/pair_lubricate_poly.cpp b/src/COLLOID/pair_lubricate_poly.cpp index 97aa6bf6ff..38ec073f48 100644 --- a/src/COLLOID/pair_lubricate_poly.cpp +++ b/src/COLLOID/pair_lubricate_poly.cpp @@ -463,7 +463,7 @@ void PairLubricatePoly::init_style() for (int i = 0; i < modify->nfix; i++) { if (strcmp(modify->fix[i]->style,"deform") == 0) { shearing = flagdeform = 1; - if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP) + if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using pair lubricate with inconsistent " "fix deform remap option"); } @@ -473,15 +473,15 @@ void PairLubricatePoly::init_style() "Cannot use multiple fix wall commands with " "pair lubricate/poly"); flagwall = 1; // Walls exist - wallfix = (FixWall *) modify->fix[i]; + wallfix = dynamic_cast( modify->fix[i]); if (wallfix->xflag) flagwall = 2; // Moving walls exist } if (strstr(modify->fix[i]->style,"wall") != nullptr) { flagwall = 1; // Walls exist - if (((FixWall *) modify->fix[i])->xflag) { + if ((dynamic_cast( modify->fix[i]))->xflag) { flagwall = 2; // Moving walls exist - wallfix = (FixWall *) modify->fix[i]; + wallfix = dynamic_cast( modify->fix[i]); } } } @@ -539,7 +539,7 @@ void PairLubricatePoly::init_style() for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { shearing = 1; - if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP) + if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using pair lubricate/poly with inconsistent " "fix deform remap option"); } diff --git a/src/COLVARS/colvarproxy_lammps.cpp b/src/COLVARS/colvarproxy_lammps.cpp index dd1f7eb06d..09c280acf9 100644 --- a/src/COLVARS/colvarproxy_lammps.cpp +++ b/src/COLVARS/colvarproxy_lammps.cpp @@ -98,10 +98,10 @@ colvarproxy_lammps::colvarproxy_lammps(LAMMPS_NS::LAMMPS *lmp, // try to extract a restart prefix from a potential restart command. LAMMPS_NS::Output *outp = _lmp->output; - if ((outp->restart_every_single > 0) && (outp->restart1 != 0)) { + if ((outp->restart_every_single > 0) && (outp->restart1 != nullptr)) { restart_frequency_engine = outp->restart_every_single; restart_output_prefix_str = std::string(outp->restart1); - } else if ((outp->restart_every_double > 0) && (outp->restart2a != 0)) { + } else if ((outp->restart_every_double > 0) && (outp->restart2a != nullptr)) { restart_frequency_engine = outp->restart_every_double; restart_output_prefix_str = std::string(outp->restart2a); } diff --git a/src/COLVARS/ndx_group.cpp b/src/COLVARS/ndx_group.cpp index be54c5dca9..9560c41c6a 100644 --- a/src/COLVARS/ndx_group.cpp +++ b/src/COLVARS/ndx_group.cpp @@ -121,7 +121,7 @@ void Ndx2Group::command(int narg, char **arg) } else { - while (1) { + while (true) { MPI_Bcast(&len,1,MPI_INT,0,world); if (len < 0) break; if (len > 1) { diff --git a/src/COMPRESS/dump_atom_gz.cpp b/src/COMPRESS/dump_atom_gz.cpp index 8bdc025436..3e15d6240d 100644 --- a/src/COMPRESS/dump_atom_gz.cpp +++ b/src/COMPRESS/dump_atom_gz.cpp @@ -46,19 +46,7 @@ void DumpAtomGZ::openfile() if (multiproc) filecurrent = multiname; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, update->ntimestep, ptr + 1); - else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); - sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = utils::strdup(filecurrent); diff --git a/src/COMPRESS/dump_atom_zstd.cpp b/src/COMPRESS/dump_atom_zstd.cpp index aa1c161d73..453efb6972 100644 --- a/src/COMPRESS/dump_atom_zstd.cpp +++ b/src/COMPRESS/dump_atom_zstd.cpp @@ -52,19 +52,7 @@ void DumpAtomZstd::openfile() if (multiproc) filecurrent = multiname; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, update->ntimestep, ptr + 1); - else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); - sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = utils::strdup(filecurrent); diff --git a/src/COMPRESS/dump_cfg_gz.cpp b/src/COMPRESS/dump_cfg_gz.cpp index 8d85e8cf83..3b2f10ddb0 100644 --- a/src/COMPRESS/dump_cfg_gz.cpp +++ b/src/COMPRESS/dump_cfg_gz.cpp @@ -48,19 +48,7 @@ void DumpCFGGZ::openfile() if (multiproc) filecurrent = multiname; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, update->ntimestep, ptr + 1); - else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); - sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = utils::strdup(filecurrent); @@ -103,22 +91,20 @@ void DumpCFGGZ::write_header(bigint n) // so molecules are not split across periodic box boundaries double scale = 1.0; - if (atom->peri_flag) - scale = atom->pdscale; - else if (unwrapflag == 1) - scale = UNWRAPEXPAND; + if (atom->peri_flag) scale = atom->pdscale; + else if (unwrapflag == 1) scale = UNWRAPEXPAND; std::string header = fmt::format("Number of particles = {}\n", n); - header += fmt::format("A = {0:g} Angstrom (basic length-scale)\n", scale); - header += fmt::format("H0(1,1) = {0:g} A\n", domain->xprd); - header += fmt::format("H0(1,2) = 0 A \n"); - header += fmt::format("H0(1,3) = 0 A \n"); - header += fmt::format("H0(2,1) = {0:g} A \n", domain->xy); - header += fmt::format("H0(2,2) = {0:g} A\n", domain->yprd); - header += fmt::format("H0(2,3) = 0 A \n"); - header += fmt::format("H0(3,1) = {0:g} A \n", domain->xz); - header += fmt::format("H0(3,2) = {0:g} A \n", domain->yz); - header += fmt::format("H0(3,3) = {0:g} A\n", domain->zprd); + header += fmt::format("A = {:g} Angstrom (basic length-scale)\n", scale); + header += fmt::format("H0(1,1) = {:g} A\n", domain->xprd); + header += fmt::format("H0(1,2) = 0 A\n"); + header += fmt::format("H0(1,3) = 0 A\n"); + header += fmt::format("H0(2,1) = {:g} A\n", domain->xy); + header += fmt::format("H0(2,2) = {:g} A\n", domain->yprd); + header += fmt::format("H0(2,3) = 0 A\n"); + header += fmt::format("H0(3,1) = {:g} A\n", domain->xz); + header += fmt::format("H0(3,2) = {:g} A\n", domain->yz); + header += fmt::format("H0(3,3) = {:g} A\n", domain->zprd); header += fmt::format(".NO_VELOCITY.\n"); header += fmt::format("entry_count = {}\n", nfield - 2); for (int i = 0; i < nfield - 5; i++) header += fmt::format("auxiliary[{}] = {}\n", i, auxname[i]); diff --git a/src/COMPRESS/dump_cfg_zstd.cpp b/src/COMPRESS/dump_cfg_zstd.cpp index 6d70749479..865a8ccf87 100644 --- a/src/COMPRESS/dump_cfg_zstd.cpp +++ b/src/COMPRESS/dump_cfg_zstd.cpp @@ -54,19 +54,7 @@ void DumpCFGZstd::openfile() if (multiproc) filecurrent = multiname; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, update->ntimestep, ptr + 1); - else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); - sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = utils::strdup(filecurrent); @@ -117,16 +105,16 @@ void DumpCFGZstd::write_header(bigint n) scale = UNWRAPEXPAND; std::string header = fmt::format("Number of particles = {}\n", n); - header += fmt::format("A = {0:g} Angstrom (basic length-scale)\n", scale); - header += fmt::format("H0(1,1) = {0:g} A\n", domain->xprd); - header += fmt::format("H0(1,2) = 0 A \n"); - header += fmt::format("H0(1,3) = 0 A \n"); - header += fmt::format("H0(2,1) = {0:g} A \n", domain->xy); - header += fmt::format("H0(2,2) = {0:g} A\n", domain->yprd); - header += fmt::format("H0(2,3) = 0 A \n"); - header += fmt::format("H0(3,1) = {0:g} A \n", domain->xz); - header += fmt::format("H0(3,2) = {0:g} A \n", domain->yz); - header += fmt::format("H0(3,3) = {0:g} A\n", domain->zprd); + header += fmt::format("A = {:g} Angstrom (basic length-scale)\n", scale); + header += fmt::format("H0(1,1) = {:g} A\n", domain->xprd); + header += fmt::format("H0(1,2) = 0 A\n"); + header += fmt::format("H0(1,3) = 0 A\n"); + header += fmt::format("H0(2,1) = {:g} A\n", domain->xy); + header += fmt::format("H0(2,2) = {:g} A\n", domain->yprd); + header += fmt::format("H0(2,3) = 0 A\n"); + header += fmt::format("H0(3,1) = {:g} A\n", domain->xz); + header += fmt::format("H0(3,2) = {:g} A\n", domain->yz); + header += fmt::format("H0(3,3) = {:g} A\n", domain->zprd); header += fmt::format(".NO_VELOCITY.\n"); header += fmt::format("entry_count = {}\n", nfield - 2); for (int i = 0; i < nfield - 5; i++) header += fmt::format("auxiliary[{}] = {}\n", i, auxname[i]); diff --git a/src/COMPRESS/dump_custom_gz.cpp b/src/COMPRESS/dump_custom_gz.cpp index a8ef1ffe7c..42b15c4146 100644 --- a/src/COMPRESS/dump_custom_gz.cpp +++ b/src/COMPRESS/dump_custom_gz.cpp @@ -46,19 +46,7 @@ void DumpCustomGZ::openfile() if (multiproc) filecurrent = multiname; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, update->ntimestep, ptr + 1); - else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); - sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = utils::strdup(filecurrent); diff --git a/src/COMPRESS/dump_custom_zstd.cpp b/src/COMPRESS/dump_custom_zstd.cpp index c6c7e3592e..e3effe1744 100644 --- a/src/COMPRESS/dump_custom_zstd.cpp +++ b/src/COMPRESS/dump_custom_zstd.cpp @@ -56,20 +56,7 @@ void DumpCustomZstd::openfile() if (multiproc) filecurrent = multiname; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar,'*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent,"%s" BIGINT_FORMAT "%s", - filestar,update->ntimestep,ptr+1); - else { - char bif[8],pad[16]; - strcpy(bif,BIGINT_FORMAT); - sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); - sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = utils::strdup(filecurrent); diff --git a/src/COMPRESS/dump_local_gz.cpp b/src/COMPRESS/dump_local_gz.cpp index c3669e6157..9c04f0cd61 100644 --- a/src/COMPRESS/dump_local_gz.cpp +++ b/src/COMPRESS/dump_local_gz.cpp @@ -46,19 +46,7 @@ void DumpLocalGZ::openfile() if (multiproc) filecurrent = multiname; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, update->ntimestep, ptr + 1); - else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); - sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = utils::strdup(filecurrent); diff --git a/src/COMPRESS/dump_local_zstd.cpp b/src/COMPRESS/dump_local_zstd.cpp index 63af89afcc..4e65702b0e 100644 --- a/src/COMPRESS/dump_local_zstd.cpp +++ b/src/COMPRESS/dump_local_zstd.cpp @@ -52,19 +52,7 @@ void DumpLocalZstd::openfile() if (multiproc) filecurrent = multiname; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, update->ntimestep, ptr + 1); - else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); - sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = utils::strdup(filecurrent); diff --git a/src/COMPRESS/dump_xyz_gz.cpp b/src/COMPRESS/dump_xyz_gz.cpp index 06561c6d9a..4b544c0d67 100644 --- a/src/COMPRESS/dump_xyz_gz.cpp +++ b/src/COMPRESS/dump_xyz_gz.cpp @@ -45,19 +45,7 @@ void DumpXYZGZ::openfile() if (multiproc) filecurrent = multiname; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, update->ntimestep, ptr + 1); - else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); - sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = utils::strdup(filecurrent); @@ -93,11 +81,9 @@ void DumpXYZGZ::openfile() void DumpXYZGZ::write_header(bigint ndump) { if (me == 0) { - auto header = fmt::format("{}\n", ndump); - if (time_flag) { - double tcurrent = update->atime + (update->ntimestep-update->atimestep) + update->dt; - header += fmt::format(" Atoms. Timestep: {} Time: {:.6f}\n", update->ntimestep, tcurrent); - } else header += fmt::format(" Atoms. Timestep: {}\n", update->ntimestep); + auto header = fmt::format("{}\n Atoms. Timestep: {}", ndump, update->ntimestep); + if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time()); + header += "\n"; writer.write(header.c_str(), header.length()); } } diff --git a/src/COMPRESS/dump_xyz_zstd.cpp b/src/COMPRESS/dump_xyz_zstd.cpp index c4748b4ac3..ed87bb3f2c 100644 --- a/src/COMPRESS/dump_xyz_zstd.cpp +++ b/src/COMPRESS/dump_xyz_zstd.cpp @@ -51,19 +51,7 @@ void DumpXYZZstd::openfile() if (multiproc) filecurrent = multiname; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, update->ntimestep, ptr + 1); - else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); - sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = utils::strdup(filecurrent); @@ -101,11 +89,9 @@ void DumpXYZZstd::openfile() void DumpXYZZstd::write_header(bigint ndump) { if (me == 0) { - auto header = fmt::format("{}\n", ndump); - if (time_flag) { - double tcurrent = update->atime + (update->ntimestep-update->atimestep) + update->dt; - header += fmt::format(" Atoms. Timestep: {} Time: {:.6f}\n", update->ntimestep, tcurrent); - } else header += fmt::format(" Atoms. Timestep: {}\n", update->ntimestep); + auto header = fmt::format("{}\n Atoms. Timestep: {}", ndump, update->ntimestep); + if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time()); + header += "\n"; writer.write(header.c_str(), header.length()); } } diff --git a/src/CORESHELL/compute_temp_cs.cpp b/src/CORESHELL/compute_temp_cs.cpp index 9b4ca249fa..6a4a5be53f 100644 --- a/src/CORESHELL/compute_temp_cs.cpp +++ b/src/CORESHELL/compute_temp_cs.cpp @@ -74,7 +74,7 @@ ComputeTempCS::ComputeTempCS(LAMMPS *lmp, int narg, char **arg) : strcpy(id_fix,fixcmd.c_str()); fixcmd += fmt::format(" {} STORE peratom 0 1", group->names[igroup]); - fix = (FixStore *)modify->add_fix(fixcmd); + fix = dynamic_cast(modify->add_fix(fixcmd)); // set fix store values = 0 for now // fill them in via setup() once Comm::borders() has been called diff --git a/src/DIELECTRIC/atom_vec_dielectric.cpp b/src/DIELECTRIC/atom_vec_dielectric.cpp index 2d6d6d00b1..89ce8da9a6 100644 --- a/src/DIELECTRIC/atom_vec_dielectric.cpp +++ b/src/DIELECTRIC/atom_vec_dielectric.cpp @@ -38,7 +38,7 @@ static const char cite_user_dielectric_package[] = /* ---------------------------------------------------------------------- */ -AtomVecDielectric::AtomVecDielectric(LAMMPS *lmp) : AtomVec(lmp) +AtomVecDielectric::AtomVecDielectric(LAMMPS *_lmp) : AtomVec(_lmp) { if (lmp->citeme) lmp->citeme->add(cite_user_dielectric_package); @@ -47,6 +47,7 @@ AtomVecDielectric::AtomVecDielectric(LAMMPS *lmp) : AtomVec(lmp) mass_type = PER_TYPE; atom->molecule_flag = atom->q_flag = atom->mu_flag = 1; + atom->dielectric_flag = 1; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings diff --git a/src/DIELECTRIC/compute_efield_atom.cpp b/src/DIELECTRIC/compute_efield_atom.cpp index 586d858632..24c29321ed 100644 --- a/src/DIELECTRIC/compute_efield_atom.cpp +++ b/src/DIELECTRIC/compute_efield_atom.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/ Sandia National Laboratories @@ -39,10 +38,10 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -ComputeEfieldAtom::ComputeEfieldAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), efield(nullptr) +ComputeEfieldAtom::ComputeEfieldAtom(LAMMPS *_lmp, int narg, char **arg) : + Compute(_lmp, narg, arg), efield(nullptr) { - if (narg < 3) error->all(FLERR,"Illegal compute efield/atom command"); + if (narg < 3) error->all(FLERR, "Illegal compute efield/atom command"); peratom_flag = 1; size_peratom_cols = 3; @@ -58,9 +57,12 @@ ComputeEfieldAtom::ComputeEfieldAtom(LAMMPS *lmp, int narg, char **arg) : } else { int iarg = 3; while (iarg < narg) { - if (strcmp(arg[iarg],"pair") == 0) pairflag = 1; - else if (strcmp(arg[iarg],"kspace") == 0) kspaceflag = 1; - else error->all(FLERR,"Illegal compute efield/atom command"); + if (strcmp(arg[iarg], "pair") == 0) + pairflag = 1; + else if (strcmp(arg[iarg], "kspace") == 0) + kspaceflag = 1; + else + error->all(FLERR, "Illegal compute efield/atom command"); iarg++; } } @@ -81,7 +83,7 @@ ComputeEfieldAtom::~ComputeEfieldAtom() void ComputeEfieldAtom::init() { - if (!atom->q_flag) error->all(FLERR,"compute efield/atom requires atom attribute q"); + if (!atom->q_flag) error->all(FLERR, "compute efield/atom requires atom attribute q"); if (!force->kspace) kspaceflag = 0; } @@ -89,28 +91,30 @@ void ComputeEfieldAtom::init() void ComputeEfieldAtom::setup() { - if (strcmp(force->pair_style,"lj/cut/coul/long/dielectric") == 0) - efield_pair = ((PairLJCutCoulLongDielectric*)force->pair)->efield; - else if (strcmp(force->pair_style,"lj/cut/coul/long/dielectric/omp") == 0) - efield_pair = ((PairLJCutCoulMSMDielectric*)force->pair)->efield; - else if (strcmp(force->pair_style,"lj/cut/coul/msm/dielectric") == 0) - efield_pair = ((PairLJCutCoulMSMDielectric*)force->pair)->efield; - else if (strcmp(force->pair_style,"lj/cut/coul/cut/dielectric") == 0) - efield_pair = ((PairLJCutCoulCutDielectric*)force->pair)->efield; - else if (strcmp(force->pair_style,"lj/cut/coul/cut/dielectric/omp") == 0) - efield_pair = ((PairLJCutCoulCutDielectric*)force->pair)->efield; - else if (strcmp(force->pair_style,"coul/long/dielectric") == 0) - efield_pair = ((PairCoulLongDielectric*)force->pair)->efield; - else if (strcmp(force->pair_style,"coul/cut/dielectric") == 0) - efield_pair = ((PairCoulCutDielectric*)force->pair)->efield; - else error->all(FLERR,"Compute efield/atom not supported by pair style"); + if (strcmp(force->pair_style, "lj/cut/coul/long/dielectric") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; + else if (strcmp(force->pair_style, "lj/cut/coul/long/dielectric/omp") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; + else if (strcmp(force->pair_style, "lj/cut/coul/msm/dielectric") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; + else if (strcmp(force->pair_style, "lj/cut/coul/cut/dielectric") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; + else if (strcmp(force->pair_style, "lj/cut/coul/cut/dielectric/omp") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; + else if (strcmp(force->pair_style, "coul/long/dielectric") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; + else if (strcmp(force->pair_style, "coul/cut/dielectric") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; + else + error->all(FLERR, "Compute efield/atom not supported by pair style"); if (force->kspace) { - if (strcmp(force->kspace_style,"pppm/dielectric") == 0) - efield_kspace = ((PPPMDielectric*)force->kspace)->efield; - else if (strcmp(force->kspace_style,"msm/dielectric") == 0) - efield_kspace = ((MSMDielectric*)force->kspace)->efield; - else error->all(FLERR,"Compute efield/atom not supported by kspace style"); + if (strcmp(force->kspace_style, "pppm/dielectric") == 0) + efield_kspace = (dynamic_cast(force->kspace))->efield; + else if (strcmp(force->kspace_style, "msm/dielectric") == 0) + efield_kspace = (dynamic_cast(force->kspace))->efield; + else + error->all(FLERR, "Compute efield/atom not supported by kspace style"); kspaceflag = 1; } @@ -122,11 +126,11 @@ void ComputeEfieldAtom::setup() void ComputeEfieldAtom::compute_peratom() { - int i,j; + int i, j; invoked_peratom = update->ntimestep; if (update->vflag_atom != invoked_peratom) - error->all(FLERR,"Per-atom virial was not tallied on needed timestep"); + error->all(FLERR, "Per-atom virial was not tallied on needed timestep"); // grow local stress array if necessary // needs to be atom->nmax in length @@ -134,7 +138,7 @@ void ComputeEfieldAtom::compute_peratom() if (atom->nmax > nmax) { memory->destroy(efield); nmax = atom->nmax; - memory->create(efield,nmax,3,"stress/atom:efield"); + memory->create(efield, nmax, 3, "stress/atom:efield"); array_atom = efield; } @@ -144,7 +148,7 @@ void ComputeEfieldAtom::compute_peratom() // ntotal includes ghosts if either newton flag is set // KSpace includes ghosts if tip4pflag is set - double* q = atom->q; + double *q = atom->q; int nlocal = atom->nlocal; int npair = nlocal; int ntotal = nlocal; @@ -156,8 +160,7 @@ void ComputeEfieldAtom::compute_peratom() // clear local stress array for (i = 0; i < ntotal; i++) - for (j = 0; j < 3; j++) - efield[i][j] = 0.0; + for (j = 0; j < 3; j++) efield[i][j] = 0.0; // add in per-atom contributions from each force @@ -170,14 +173,12 @@ void ComputeEfieldAtom::compute_peratom() if (kspaceflag && force->kspace) { for (i = 0; i < nkspace; i++) - for (j = 0; j < 3; j++) - efield[i][j] += efield_kspace[i][j]; + for (j = 0; j < 3; j++) efield[i][j] += efield_kspace[i][j]; } // communicate ghost efield between neighbor procs - if (force->newton || (force->kspace && force->kspace->tip4pflag)) - comm->reverse_comm(this); + if (force->newton || (force->kspace && force->kspace->tip4pflag)) comm->reverse_comm(this); // zero efield of atoms not in group // only do this after comm since ghost contributions must be included @@ -192,12 +193,11 @@ void ComputeEfieldAtom::compute_peratom() } } - /* ---------------------------------------------------------------------- */ int ComputeEfieldAtom::pack_reverse_comm(int n, int first, double *buf) { - int i,m,last; + int i, m, last; m = 0; last = first + n; @@ -213,7 +213,7 @@ int ComputeEfieldAtom::pack_reverse_comm(int n, int first, double *buf) void ComputeEfieldAtom::unpack_reverse_comm(int n, int *list, double *buf) { - int i,j,m; + int i, j, m; m = 0; for (i = 0; i < n; i++) { @@ -230,6 +230,6 @@ void ComputeEfieldAtom::unpack_reverse_comm(int n, int *list, double *buf) double ComputeEfieldAtom::memory_usage() { - double bytes = nmax*3 * sizeof(double); + double bytes = nmax * 3 * sizeof(double); return bytes; } diff --git a/src/DIELECTRIC/fix_polarize_bem_gmres.cpp b/src/DIELECTRIC/fix_polarize_bem_gmres.cpp index 5d723316c0..7d29cc889c 100644 --- a/src/DIELECTRIC/fix_polarize_bem_gmres.cpp +++ b/src/DIELECTRIC/fix_polarize_bem_gmres.cpp @@ -48,6 +48,7 @@ #include "pair_coul_cut_dielectric.h" #include "pair_coul_long_dielectric.h" #include "pair_lj_cut_coul_cut_dielectric.h" +#include "pair_lj_cut_coul_debye_dielectric.h" #include "pair_lj_cut_coul_long_dielectric.h" #include "pair_lj_cut_coul_msm_dielectric.h" #include "pppm_dielectric.h" @@ -59,19 +60,17 @@ using namespace LAMMPS_NS; using namespace FixConst; -using namespace MathConst; - -//#define _POLARIZE_DEBUG +using MathConst::MY_PI; /* ---------------------------------------------------------------------- */ -FixPolarizeBEMGMRES::FixPolarizeBEMGMRES(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), q_backup(nullptr), c(nullptr), g(nullptr), h(nullptr), r(nullptr), s(nullptr), v(nullptr), - y(nullptr) +FixPolarizeBEMGMRES::FixPolarizeBEMGMRES(LAMMPS *_lmp, int narg, char **arg) : + Fix(_lmp, narg, arg), q_backup(nullptr), c(nullptr), g(nullptr), h(nullptr), r(nullptr), + s(nullptr), v(nullptr), y(nullptr) { if (narg < 5) error->all(FLERR, "Illegal fix polarize/bem/gmres command"); - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR, "Fix polarize requires atom style dielectric"); // parse required arguments @@ -211,7 +210,7 @@ void FixPolarizeBEMGMRES::init() if (randomized) { - RanPark *random = new RanPark(lmp, seed_charge + comm->me); + auto random = new RanPark(lmp, seed_charge + comm->me); for (i = 0; i < 100; i++) random->uniform(); double sum, tmp = 0; for (i = 0; i < nlocal; i++) { @@ -235,9 +234,7 @@ void FixPolarizeBEMGMRES::init() } if (comm->me == 0) - utils::logmesg(lmp, - "GMRES solver for {} induced charges " - "using maximum {} q-vectors\n", + utils::logmesg(lmp, "GMRES solver for {} induced charges using maximum {} q-vectors\n", num_induced_charges, mr); } @@ -248,34 +245,76 @@ void FixPolarizeBEMGMRES::setup(int /*vflag*/) // check if the pair styles in use are compatible if (strcmp(force->pair_style, "lj/cut/coul/long/dielectric") == 0) - efield_pair = ((PairLJCutCoulLongDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "lj/cut/coul/long/dielectric/omp") == 0) - efield_pair = ((PairLJCutCoulLongDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "lj/cut/coul/msm/dielectric") == 0) - efield_pair = ((PairLJCutCoulMSMDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "lj/cut/coul/cut/dielectric") == 0) - efield_pair = ((PairLJCutCoulCutDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "lj/cut/coul/cut/dielectric/omp") == 0) - efield_pair = ((PairLJCutCoulCutDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; + else if (strcmp(force->pair_style, "lj/cut/coul/debye/dielectric") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; + else if (strcmp(force->pair_style, "lj/cut/coul/debye/dielectric/omp") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "coul/long/dielectric") == 0) - efield_pair = ((PairCoulLongDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "coul/cut/dielectric") == 0) - efield_pair = ((PairCoulCutDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else - error->all(FLERR, "Pair style not compatible with fix polarize"); + error->all(FLERR, "Pair style not compatible with fix polarize/bem/gmres"); if (kspaceflag) { if (force->kspace) { if (strcmp(force->kspace_style, "pppm/dielectric") == 0) - efield_kspace = ((PPPMDielectric *) force->kspace)->efield; + efield_kspace = (dynamic_cast(force->kspace))->efield; else if (strcmp(force->kspace_style, "msm/dielectric") == 0) - efield_kspace = ((MSMDielectric *) force->kspace)->efield; + efield_kspace = (dynamic_cast(force->kspace))->efield; else error->all(FLERR, "Kspace style not compatible with fix polarize/bem/gmres"); } else error->all(FLERR, "No Kspace style available for fix polarize/bem/gmres"); } + // NOTE: epsilon0e2q converts (epsilon0 * efield) to the unit of (charge unit / squared distance unit) + // efield is computed by pair and kspace styles in the unit of energy unit / charge unit / distance unit + // for units real efield is in the unit of kcal/mol/e/A + // converting from (F/m) (kcal/mol/e/A) to e/A^2 (1 e = 1.6e-19 C, 1 m = 1e+10 A) + // epsilon0e2q = 8.854187812813e-12 (C^2/N/m^2) * (4184 Nm/6.023e+23) /e/A + // = 8.854187812813e-12 * (4184/6.023e+23) * (1/1.6e-19)^2 e^2 / (1e+10 A) /e/A + // = 0.000240263377163643 e/A^2 + + // for units metal efield is in the unit of eV/e/A + // converting from (F/m) (eV/e/A) to e/A^2 (1 V = 1 Nm/C) + // epsilon0e2q = 8.854187812813e-12 (C^2/N/m^2) * (1 e Nm/C) /e/A + // = 8.854187812813e-12 * 1/1.6e-19 e^2 / (1e+10 A) /e/A + // = 0.00553386738300813 e/A^2 + + // for units si efield is in the unit of J/C/m + // converting from (F/m) (J/C/m) to C/m^2 + // epsilon0e2q = 8.854187812813e-12 (C^2/N/m^2) * (1 Nm/C/m) + // = 8.854187812813e-12 C/m^2 + + // for units nano efield is in the unit of attogram nm^2/ns^2/e/nm + // converting from (F/m) (attogram nm^2/ns^2/e/nm) to e/nm^2 + // epsilon0e2q = 8.854187812813e-12 (C^2/N/m^2) * (1e-21 kg nm^2 / (1e-18s^2) / e / nm) + // = 8.854187812813e-12 (C^2/N/m^2) * (1e-21 kg 1e-9 m / (1e-18s^2) / e) + // = 8.854187812813e-12 (1/1.6e-19)^2 (1e-21 * 1e-9 / (1e-18)) e / (1e+18 nm^2) + // = 0.000345866711328125 e/nm^2 + + epsilon0e2q = 1.0; + if (strcmp(update->unit_style, "real") == 0) + epsilon0e2q = 0.000240263377163643; + else if (strcmp(update->unit_style, "metal") == 0) + epsilon0e2q = 0.00553386738300813; + else if (strcmp(update->unit_style, "si") == 0) + epsilon0e2q = 8.854187812813e-12; + else if (strcmp(update->unit_style, "nano") == 0) + epsilon0e2q = 0.000345866711328125; + else if (strcmp(update->unit_style, "lj") != 0) + error->all(FLERR, "Only unit styles 'lj', 'real', 'metal', 'si' and 'nano' are supported"); + first = 1; compute_induced_charges(); } @@ -306,7 +345,6 @@ void FixPolarizeBEMGMRES::compute_induced_charges() double *em = atom->em; double *epsilon = atom->epsilon; int nlocal = atom->nlocal; - double epsilon0 = force->dielectric; int eflag = 0; int vflag = 0; @@ -354,9 +392,9 @@ void FixPolarizeBEMGMRES::compute_induced_charges() Ey += efield_kspace[i][1]; Ez += efield_kspace[i][2]; } - double dot = (Ex * norm[i][0] + Ey * norm[i][1] + Ez * norm[i][2]) / epsilon[i]; + double ndotE = epsilon0e2q * (Ex * norm[i][0] + Ey * norm[i][1] + Ez * norm[i][2]) / epsilon[i]; double sigma_f = q_real[i] / area[i]; - buffer[idx] = (1 - em[i]) * sigma_f - epsilon0 * ed[i] * dot / (4 * MY_PI); + buffer[idx] = (1 - em[i]) * sigma_f - ed[i] * ndotE / (4 * MY_PI); } MPI_Allreduce(buffer, rhs, num_induced_charges, MPI_DOUBLE, MPI_SUM, world); @@ -519,10 +557,6 @@ void FixPolarizeBEMGMRES::gmres_solve(double *x, double *r) rho = fabs(g[k]); -#ifdef _POLARIZE_DEBUG - if (comm->me == 0) - error->warning(FLERR, "itr = {}: k = {}, norm(r) = {} norm(b) = {}", itr, k, rho, normb); -#endif if (rho <= rho_tol && rho <= tol_abs) break; } @@ -552,11 +586,6 @@ void FixPolarizeBEMGMRES::gmres_solve(double *x, double *r) rho = sqrt(vec_dot(r, r, n)); -#ifdef _POLARIZE_DEBUG - if (comm->me == 0) - error->warning(FLERR, "itr = {}: norm(r) = {} norm(b) = {}", itr, rho, normb); -#endif - // Barros et al. suggested the condition: norm(r) < EPSILON norm(b) if (rho < tol_rel * normb) break; @@ -584,7 +613,6 @@ void FixPolarizeBEMGMRES::apply_operator(double *w, double *Aw, int /*n*/) double *em = atom->em; double *epsilon = atom->epsilon; int nlocal = atom->nlocal; - double epsilon0 = force->dielectric; int eflag = 0; int vflag = 0; @@ -629,8 +657,8 @@ void FixPolarizeBEMGMRES::apply_operator(double *w, double *Aw, int /*n*/) Ey += efield_kspace[i][1]; Ez += efield_kspace[i][2]; } - double dot = (Ex * norm[i][0] + Ey * norm[i][1] + Ez * norm[i][2]) / epsilon[i]; - buffer[idx] = em[i] * w[idx] + epsilon0 * ed[i] * dot / (4 * MY_PI); + double ndotE = epsilon0e2q * (Ex * norm[i][0] + Ey * norm[i][1] + Ez * norm[i][2]) / epsilon[i]; + buffer[idx] = em[i] * w[idx] + ed[i] * ndotE / (4 * MY_PI); } MPI_Allreduce(buffer, Aw, num_induced_charges, MPI_DOUBLE, MPI_SUM, world); @@ -654,7 +682,6 @@ void FixPolarizeBEMGMRES::update_residual(double *w, double *r, int /*n*/) double *em = atom->em; double *epsilon = atom->epsilon; int nlocal = atom->nlocal; - double epsilon0 = force->dielectric; int eflag = 0; int vflag = 0; @@ -701,9 +728,10 @@ void FixPolarizeBEMGMRES::update_residual(double *w, double *r, int /*n*/) Ey += efield_kspace[i][1]; Ez += efield_kspace[i][2]; } - double dot = (Ex * norm[i][0] + Ey * norm[i][1] + Ez * norm[i][2]) / epsilon[i]; + double ndotE = epsilon0e2q * (Ex * norm[i][0] + Ey * norm[i][1] + Ez * norm[i][2]) / + epsilon[i] / (4 * MY_PI); double sigma_f = q_real[i] / area[i]; - buffer[idx] = (1 - em[i]) * sigma_f - em[i] * w[idx] - epsilon0 * ed[i] * dot / (4 * MY_PI); + buffer[idx] = (1 - em[i]) * sigma_f - em[i] * w[idx] - ed[i] * ndotE; } MPI_Allreduce(buffer, r, num_induced_charges, MPI_DOUBLE, MPI_SUM, world); diff --git a/src/DIELECTRIC/fix_polarize_bem_gmres.h b/src/DIELECTRIC/fix_polarize_bem_gmres.h index 421fe8afb9..950be39868 100644 --- a/src/DIELECTRIC/fix_polarize_bem_gmres.h +++ b/src/DIELECTRIC/fix_polarize_bem_gmres.h @@ -81,6 +81,7 @@ class FixPolarizeBEMGMRES : public Fix { int randomized; // 1 if generating random induced charges, 0 otherwise double ave_charge; // average random charge int seed_charge; + double epsilon0e2q; // convert epsilon0 times efield to unit of charge per area double *c, *g, *h, *r, *s, *v, *y; // vectors used by the solver double *rhs; // right-hand side vector of the equation Ax = b diff --git a/src/DIELECTRIC/fix_polarize_bem_icc.cpp b/src/DIELECTRIC/fix_polarize_bem_icc.cpp index da4296c1e4..3d451256ff 100644 --- a/src/DIELECTRIC/fix_polarize_bem_icc.cpp +++ b/src/DIELECTRIC/fix_polarize_bem_icc.cpp @@ -37,6 +37,7 @@ #include "pair_coul_cut_dielectric.h" #include "pair_coul_long_dielectric.h" #include "pair_lj_cut_coul_cut_dielectric.h" +#include "pair_lj_cut_coul_debye_dielectric.h" #include "pair_lj_cut_coul_long_dielectric.h" #include "pair_lj_cut_coul_msm_dielectric.h" #include "pppm_dielectric.h" @@ -48,17 +49,15 @@ using namespace LAMMPS_NS; using namespace FixConst; -using namespace MathConst; - -//#define _POLARIZE_DEBUG +using MathConst::MY_PI; /* ---------------------------------------------------------------------- */ -FixPolarizeBEMICC::FixPolarizeBEMICC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) +FixPolarizeBEMICC::FixPolarizeBEMICC(LAMMPS *_lmp, int narg, char **arg) : Fix(_lmp, narg, arg) { if (narg < 5) error->all(FLERR, "Illegal fix polarize/bem/icc command"); - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR, "Fix polarize requires atom style dielectric"); // parse required arguments @@ -116,7 +115,7 @@ void FixPolarizeBEMICC::init() int *mask = atom->mask; int nlocal = atom->nlocal; - RanPark *random = new RanPark(lmp, seed_charge + comm->me); + auto random = new RanPark(lmp, seed_charge + comm->me); for (i = 0; i < 100; i++) random->uniform(); double sum, tmp = 0; for (i = 0; i < nlocal; i++) { @@ -146,42 +145,82 @@ void FixPolarizeBEMICC::setup(int /*vflag*/) // check if the pair styles in use are compatible if (strcmp(force->pair_style, "lj/cut/coul/long/dielectric") == 0) - efield_pair = ((PairLJCutCoulLongDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "lj/cut/coul/long/dielectric/omp") == 0) - efield_pair = ((PairLJCutCoulLongDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "lj/cut/coul/msm/dielectric") == 0) - efield_pair = ((PairLJCutCoulMSMDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "lj/cut/coul/cut/dielectric") == 0) - efield_pair = ((PairLJCutCoulCutDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "lj/cut/coul/cut/dielectric/omp") == 0) - efield_pair = ((PairLJCutCoulCutDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; + else if (strcmp(force->pair_style, "lj/cut/coul/debye/dielectric") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; + else if (strcmp(force->pair_style, "lj/cut/coul/debye/dielectric/omp") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "coul/long/dielectric") == 0) - efield_pair = ((PairCoulLongDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "coul/cut/dielectric") == 0) - efield_pair = ((PairCoulCutDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else error->all(FLERR, "Pair style not compatible with fix polarize/bem/icc"); // check if kspace is used for force computation if (force->kspace) { - kspaceflag = 1; if (strcmp(force->kspace_style, "pppm/dielectric") == 0) - efield_kspace = ((PPPMDielectric *) force->kspace)->efield; + efield_kspace = (dynamic_cast(force->kspace))->efield; else if (strcmp(force->kspace_style, "msm/dielectric") == 0) - efield_kspace = ((MSMDielectric *) force->kspace)->efield; + efield_kspace = (dynamic_cast(force->kspace))->efield; else error->all(FLERR, "Kspace style not compatible with fix polarize/bem/icc"); } else { - if (kspaceflag == 1) { // users specified kspace yes error->warning(FLERR, "No Kspace style available for fix polarize/bem/icc"); kspaceflag = 0; } } + // NOTE: epsilon0e2q converts (epsilon0 * efield) to the unit of (charge unit / squared distance unit) + // efield is computed by pair and kspace styles in the unit of energy unit / charge unit / distance unit + // for units real efield is in the unit of kcal/mol/e/A + // converting from (F/m) (kcal/mol/e/A) to e/A^2 (1 e = 1.6e-19 C, 1 m = 1e+10 A) + // epsilon0e2q = 8.854187812813e-12 (C^2/N/m^2) * (4184 Nm/6.023e+23) /e/A + // = 8.854187812813e-12 * (4184/6.023e+23) * (1/1.6e-19)^2 e^2 / (1e+10 A) /e/A + // = 0.000240263377163643 e/A^2 + + // for units metal efield is in the unit of eV/e/A + // converting from (F/m) (eV/e/A) to e/A^2 (1 V = 1 Nm/C) + // epsilon0e2q = 8.854187812813e-12 (C^2/N/m^2) * (1 e Nm/C) /e/A + // = 8.854187812813e-12 * 1/1.6e-19 e^2 / (1e+10 A) /e/A + // = 0.00553386738300813 e/A^2 + + // for units si efield is in the unit of J/C/m + // converting from (F/m) (J/C/m) to C/m^2 + // epsilon0e2q = 8.854187812813e-12 (C^2/N/m^2) * (1 Nm/C/m) + // = 8.854187812813e-12 C/m^2 + + // for units nano efield is in the unit of attogram nm^2/ns^2/e/nm + // converting from (F/m) (attogram nm^2/ns^2/e/nm) to e/nm^2 + // epsilon0e2q = 8.854187812813e-12 (C^2/N/m^2) * (1e-21 kg nm^2 / (1e-18s^2) / e / nm) + // = 8.854187812813e-12 (C^2/N/m^2) * (1e-21 kg 1e-9 m / (1e-18s^2) / e) + // = 8.854187812813e-12 (1/1.6e-19)^2 (1e-21 * 1e-9 / (1e-18)) e / (1e+18 nm^2) + // = 0.000345866711328125 e/nm^2 + + epsilon0e2q = 1.0; + if (strcmp(update->unit_style, "real") == 0) + epsilon0e2q = 0.000240263377163643; + else if (strcmp(update->unit_style, "metal") == 0) + epsilon0e2q = 0.00553386738300813; + else if (strcmp(update->unit_style, "si") == 0) + epsilon0e2q = 8.854187812813e-12; + else if (strcmp(update->unit_style, "nano") == 0) + epsilon0e2q = 0.000345866711328125; + else if (strcmp(update->unit_style, "lj") != 0) + error->all(FLERR, "Only unit styles 'lj', 'real', 'metal', 'si' and 'nano' are supported"); + compute_induced_charges(); } @@ -212,7 +251,6 @@ void FixPolarizeBEMICC::compute_induced_charges() double *epsilon = atom->epsilon; int *mask = atom->mask; int nlocal = atom->nlocal; - double epsilon0 = force->dielectric; int eflag = 1; int vflag = 0; int itr; @@ -244,10 +282,11 @@ void FixPolarizeBEMICC::compute_induced_charges() } // divide (Ex,Ey,Ez) by epsilon[i] here - double dot = (Ex * norm[i][0] + Ey * norm[i][1] + Ez * norm[i][2]) / (2 * MY_PI) / epsilon[i]; + double ndotE = epsilon0e2q * (Ex * norm[i][0] + Ey * norm[i][1] + Ez * norm[i][2]) / + epsilon[i] / (2 * MY_PI); double q_free = q_real[i]; double q_bound = 0; - q_bound = (1.0 / em[i] - 1) * q_free - epsilon0 * (ed[i] / (2 * em[i])) * dot * area[i]; + q_bound = (1.0 / em[i] - 1) * q_free - (ed[i] / (2 * em[i])) * ndotE * area[i]; q[i] = q_free + q_bound; } @@ -281,10 +320,11 @@ void FixPolarizeBEMICC::compute_induced_charges() // note the area[i] is included here to ensure correct charge unit // for direct use in force/efield compute - double dot = (Ex * norm[i][0] + Ey * norm[i][1] + Ez * norm[i][2]) / (4 * MY_PI) / epsilon[i]; + double ndotE = epsilon0e2q * (Ex * norm[i][0] + Ey * norm[i][1] + Ez * norm[i][2]) / + (4 * MY_PI) / epsilon[i]; double q_bound = q[i] - q_free; q_bound = (1 - omega) * q_bound + - omega * ((1.0 / em[i] - 1) * q_free - epsilon0 * (ed[i] / em[i]) * dot * area[i]); + omega * ((1.0 / em[i] - 1) * q_free - (ed[i] / em[i]) * ndotE * area[i]); q[i] = q_free + q_bound; // Eq. (11) in Tyagi et al., with f from Eq. (6) @@ -303,18 +343,11 @@ void FixPolarizeBEMICC::compute_induced_charges() double delta = fabs(qtmp - q_bound); double r = (fabs(qtmp) > 0) ? delta / fabs(qtmp) : 0; if (tol < r) tol = r; - -#ifdef _POLARIZE_DEBUG -//printf("i = %d: q_bound = %f \n", i, q_bound); -#endif } comm->forward_comm(this); MPI_Allreduce(&tol, &rho, 1, MPI_DOUBLE, MPI_MAX, world); -#ifdef _POLARIZE_DEBUG - printf("itr = %d: rho = %f\n", itr, rho); -#endif if (itr > 0 && rho < tol_rel) break; } diff --git a/src/DIELECTRIC/fix_polarize_bem_icc.h b/src/DIELECTRIC/fix_polarize_bem_icc.h index e7af6edd08..ade1438496 100644 --- a/src/DIELECTRIC/fix_polarize_bem_icc.h +++ b/src/DIELECTRIC/fix_polarize_bem_icc.h @@ -60,6 +60,7 @@ class FixPolarizeBEMICC : public Fix { int randomized; // 1 if generating random induced charges, 0 otherwise double ave_charge; // average random charge int seed_charge; + double epsilon0e2q; // convert epsilon0 times efield to unit of charge per area }; } // namespace LAMMPS_NS diff --git a/src/DIELECTRIC/fix_polarize_functional.cpp b/src/DIELECTRIC/fix_polarize_functional.cpp index 15140e7d58..482bc001a9 100644 --- a/src/DIELECTRIC/fix_polarize_functional.cpp +++ b/src/DIELECTRIC/fix_polarize_functional.cpp @@ -44,6 +44,7 @@ #include "pair_coul_cut_dielectric.h" #include "pair_coul_long_dielectric.h" #include "pair_lj_cut_coul_cut_dielectric.h" +#include "pair_lj_cut_coul_debye_dielectric.h" #include "pair_lj_cut_coul_long_dielectric.h" #include "pair_lj_cut_coul_msm_dielectric.h" #include "pppm_dielectric.h" @@ -60,18 +61,16 @@ using namespace MathSpecial; enum { REAL2SCALED = 0, SCALED2REAL = 1 }; -#define EPSILON 1e-6 - -//#define _POLARIZE_DEBUG +static constexpr double EPSILON = 1.0e-6; /* ---------------------------------------------------------------------- */ -FixPolarizeFunctional::FixPolarizeFunctional(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) +FixPolarizeFunctional::FixPolarizeFunctional(LAMMPS *_lmp, int narg, char **arg) : + Fix(_lmp, narg, arg) { if (narg < 4) error->all(FLERR, "Illegal fix polarize/functional command"); - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR, "Fix polarize/functional requires atom style dielectric"); nevery = utils::inumeric(FLERR, arg[3], false, lmp); @@ -290,19 +289,23 @@ void FixPolarizeFunctional::setup(int /*vflag*/) // check if the pair styles in use are compatible if (strcmp(force->pair_style, "lj/cut/coul/long/dielectric") == 0) - efield_pair = ((PairLJCutCoulLongDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "lj/cut/coul/long/dielectric/omp") == 0) - efield_pair = ((PairLJCutCoulLongDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "lj/cut/coul/msm/dielectric") == 0) - efield_pair = ((PairLJCutCoulMSMDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "lj/cut/coul/cut/dielectric") == 0) - efield_pair = ((PairLJCutCoulCutDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "lj/cut/coul/cut/dielectric/omp") == 0) - efield_pair = ((PairLJCutCoulCutDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; + else if (strcmp(force->pair_style, "lj/cut/coul/debye/dielectric") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; + else if (strcmp(force->pair_style, "lj/cut/coul/debye/dielectric/omp") == 0) + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "coul/long/dielectric") == 0) - efield_pair = ((PairCoulLongDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else if (strcmp(force->pair_style, "coul/cut/dielectric") == 0) - efield_pair = ((PairCoulCutDielectric *) force->pair)->efield; + efield_pair = (dynamic_cast(force->pair))->efield; else error->all(FLERR, "Pair style not compatible with fix polarize/functional"); @@ -310,9 +313,9 @@ void FixPolarizeFunctional::setup(int /*vflag*/) kspaceflag = 1; if (strcmp(force->kspace_style, "pppm/dielectric") == 0) - efield_kspace = ((PPPMDielectric *) force->kspace)->efield; + efield_kspace = (dynamic_cast(force->kspace))->efield; else if (strcmp(force->kspace_style, "msm/dielectric") == 0) - efield_kspace = ((MSMDielectric *) force->kspace)->efield; + efield_kspace = (dynamic_cast(force->kspace))->efield; else error->all(FLERR, "Kspace style not compatible with fix polarize/functional"); @@ -804,16 +807,6 @@ void FixPolarizeFunctional::calculate_Rww_cutoff() MPI_Allreduce(buffer1[0], Rww[0], num_induced_charges * num_induced_charges, MPI_DOUBLE, MPI_SUM, world); - -#ifdef _POLARIZE_DEBUG - if (comm->me == 0) { - FILE *fp = fopen("Rww-functional.txt", "w"); - for (int i = 0; i < num_induced_charges; i++) - fprintf(fp, "%d %g %g %g\n", i, Rww[i][i], Rww[i][num_induced_charges / 2], - Rww[num_induced_charges / 2][i]); - fclose(fp); - } -#endif } /* ---------------------------------------------------------------------- */ diff --git a/src/DIELECTRIC/msm_dielectric.cpp b/src/DIELECTRIC/msm_dielectric.cpp index 329218a94f..3217c8dbad 100644 --- a/src/DIELECTRIC/msm_dielectric.cpp +++ b/src/DIELECTRIC/msm_dielectric.cpp @@ -34,7 +34,7 @@ enum{REVERSE_RHO,REVERSE_AD,REVERSE_AD_PERATOM}; enum{FORWARD_RHO,FORWARD_AD,FORWARD_AD_PERATOM}; /* ---------------------------------------------------------------------- */ -MSMDielectric::MSMDielectric(LAMMPS *lmp) : MSM(lmp) +MSMDielectric::MSMDielectric(LAMMPS *_lmp) : MSM(_lmp) { efield = nullptr; phi = nullptr; @@ -58,7 +58,7 @@ void MSMDielectric::init() { MSM::init(); - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast( atom->style_match("dielectric")); if (!avec) error->all(FLERR,"msm/dielectric requires atom style dielectric"); } diff --git a/src/DIELECTRIC/pair_coul_cut_dielectric.cpp b/src/DIELECTRIC/pair_coul_cut_dielectric.cpp index 7e3602967f..aaa39f6aea 100644 --- a/src/DIELECTRIC/pair_coul_cut_dielectric.cpp +++ b/src/DIELECTRIC/pair_coul_cut_dielectric.cpp @@ -29,13 +29,13 @@ #include using namespace LAMMPS_NS; -using namespace MathConst; +using MathConst::MY_PIS; -#define EPSILON 1e-6 +static constexpr double EPSILON = 1.0e-6; /* ---------------------------------------------------------------------- */ -PairCoulCutDielectric::PairCoulCutDielectric(LAMMPS *lmp) : PairCoulCut(lmp) +PairCoulCutDielectric::PairCoulCutDielectric(LAMMPS *_lmp) : PairCoulCut(_lmp) { efield = nullptr; nmax = 0; @@ -124,7 +124,7 @@ void PairCoulCutDielectric::compute(int eflag, int vflag) if (rsq < cutsq[itype][jtype] && rsq > EPSILON) { r2inv = 1.0 / rsq; rinv = sqrt(r2inv); - efield_i = scale[itype][jtype] * q[j] * rinv; + efield_i = qqrd2e * scale[itype][jtype] * q[j] * rinv; forcecoul = qtmp * efield_i; fpair_i = factor_coul * etmp * forcecoul * r2inv; @@ -162,7 +162,7 @@ void PairCoulCutDielectric::compute(int eflag, int vflag) void PairCoulCutDielectric::init_style() { - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR, "Pair coul/cut/dielectric requires atom style dielectric"); neighbor->add_request(this, NeighConst::REQ_FULL); diff --git a/src/DIELECTRIC/pair_coul_long_dielectric.cpp b/src/DIELECTRIC/pair_coul_long_dielectric.cpp index 66a4473bfc..620f0cca34 100644 --- a/src/DIELECTRIC/pair_coul_long_dielectric.cpp +++ b/src/DIELECTRIC/pair_coul_long_dielectric.cpp @@ -20,6 +20,7 @@ #include "atom.h" #include "atom_vec_dielectric.h" #include "error.h" +#include "ewald_const.h" #include "force.h" #include "kspace.h" #include "math_const.h" @@ -30,19 +31,12 @@ #include using namespace LAMMPS_NS; -using namespace MathConst; - -#define EWALD_F 1.12837917 -#define EWALD_P 0.3275911 -#define A1 0.254829592 -#define A2 -0.284496736 -#define A3 1.421413741 -#define A4 -1.453152027 -#define A5 1.061405429 +using namespace EwaldConst; +using MathConst::MY_PIS; /* ---------------------------------------------------------------------- */ -PairCoulLongDielectric::PairCoulLongDielectric(LAMMPS *lmp) : PairCoulLong(lmp) +PairCoulLongDielectric::PairCoulLongDielectric(LAMMPS *_lmp) : PairCoulLong(_lmp) { efield = nullptr; nmax = 0; @@ -207,7 +201,7 @@ void PairCoulLongDielectric::compute(int eflag, int vflag) void PairCoulLongDielectric::init_style() { - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR, "Pair coul/long/dielectric requires atom style dielectric"); neighbor->add_request(this, NeighConst::REQ_FULL); diff --git a/src/DIELECTRIC/pair_lj_cut_coul_cut_dielectric.cpp b/src/DIELECTRIC/pair_lj_cut_coul_cut_dielectric.cpp index 94ecdac578..517fbc481a 100644 --- a/src/DIELECTRIC/pair_lj_cut_coul_cut_dielectric.cpp +++ b/src/DIELECTRIC/pair_lj_cut_coul_cut_dielectric.cpp @@ -29,13 +29,13 @@ #include using namespace LAMMPS_NS; -using namespace MathConst; +using MathConst::MY_PIS; -#define EPSILON 1e-6 +static constexpr double EPSILON = 1.0e-6; /* ---------------------------------------------------------------------- */ -PairLJCutCoulCutDielectric::PairLJCutCoulCutDielectric(LAMMPS *lmp) : PairLJCutCoulCut(lmp) +PairLJCutCoulCutDielectric::PairLJCutCoulCutDielectric(LAMMPS *_lmp) : PairLJCutCoulCut(_lmp) { efield = nullptr; epot = nullptr; @@ -132,8 +132,8 @@ void PairLJCutCoulCutDielectric::compute(int eflag, int vflag) r2inv = 1.0 / rsq; if (rsq < cut_coulsq[itype][jtype] && rsq > EPSILON) { - efield_i = q[j] * sqrt(r2inv); - forcecoul = qqrd2e * qtmp * efield_i; + efield_i = qqrd2e * q[j] * sqrt(r2inv); + forcecoul = qtmp * efield_i; epot_i = efield_i; } else epot_i = efield_i = forcecoul = 0.0; @@ -190,7 +190,7 @@ void PairLJCutCoulCutDielectric::compute(int eflag, int vflag) void PairLJCutCoulCutDielectric::init_style() { - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR, "Pair lj/cut/coul/cut/dielectric requires atom style dielectric"); neighbor->add_request(this, NeighConst::REQ_FULL); diff --git a/src/DIELECTRIC/pair_lj_cut_coul_debye_dielectric.cpp b/src/DIELECTRIC/pair_lj_cut_coul_debye_dielectric.cpp index 8858a444a8..814215872b 100644 --- a/src/DIELECTRIC/pair_lj_cut_coul_debye_dielectric.cpp +++ b/src/DIELECTRIC/pair_lj_cut_coul_debye_dielectric.cpp @@ -29,13 +29,13 @@ #include using namespace LAMMPS_NS; -using namespace MathConst; +using MathConst::MY_PIS; -#define EPSILON 1e-6 +static constexpr double EPSILON = 1.0e-6; /* ---------------------------------------------------------------------- */ -PairLJCutCoulDebyeDielectric::PairLJCutCoulDebyeDielectric(LAMMPS *lmp) : PairLJCutCoulDebye(lmp) +PairLJCutCoulDebyeDielectric::PairLJCutCoulDebyeDielectric(LAMMPS *_lmp) : PairLJCutCoulDebye(_lmp) { efield = nullptr; epot = nullptr; @@ -75,10 +75,10 @@ void PairLJCutCoulDebyeDielectric::compute(int eflag, int vflag) double **x = atom->x; double **f = atom->f; double *q = atom->q; - double *eps = avec->epsilon; - double **norm = avec->mu; - double *curvature = avec->curvature; - double *area = avec->area; + double *eps = atom->epsilon; + double **norm = atom->mu; + double *curvature = atom->curvature; + double *area = atom->area; int *type = atom->type; int nlocal = atom->nlocal; double *special_coul = force->special_coul; @@ -140,7 +140,7 @@ void PairLJCutCoulDebyeDielectric::compute(int eflag, int vflag) forcecoul = qtmp * efield_i; epot_i = efield_i; } else - efield_i = forcecoul = 0.0; + epot_i = efield_i = forcecoul = 0.0; if (rsq < cut_ljsq[itype][jtype]) { r6inv = r2inv * r2inv * r2inv; @@ -157,7 +157,6 @@ void PairLJCutCoulDebyeDielectric::compute(int eflag, int vflag) efield[i][0] += delx * efield_i; efield[i][1] += dely * efield_i; efield[i][2] += delz * efield_i; - epot[i] += epot_i; if (newton_pair && j >= nlocal) { @@ -194,7 +193,7 @@ void PairLJCutCoulDebyeDielectric::compute(int eflag, int vflag) void PairLJCutCoulDebyeDielectric::init_style() { - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR, "Pair lj/cut/coul/debye/dielectric requires atom style dielectric"); neighbor->add_request(this, NeighConst::REQ_FULL); @@ -207,7 +206,7 @@ double PairLJCutCoulDebyeDielectric::single(int i, int j, int itype, int jtype, { double r2inv, r6inv, forcecoul, forcelj, phicoul, ei, ej, philj; double r, rinv, screening; - double *eps = avec->epsilon; + double *eps = atom->epsilon; r2inv = 1.0 / rsq; if (rsq < cut_coulsq[itype][jtype]) { diff --git a/src/DIELECTRIC/pair_lj_cut_coul_long_dielectric.cpp b/src/DIELECTRIC/pair_lj_cut_coul_long_dielectric.cpp index 22a725d045..dad8d74617 100644 --- a/src/DIELECTRIC/pair_lj_cut_coul_long_dielectric.cpp +++ b/src/DIELECTRIC/pair_lj_cut_coul_long_dielectric.cpp @@ -20,6 +20,7 @@ #include "atom.h" #include "atom_vec_dielectric.h" #include "error.h" +#include "ewald_const.h" #include "force.h" #include "kspace.h" #include "math_const.h" @@ -30,21 +31,14 @@ #include using namespace LAMMPS_NS; -using namespace MathConst; +using namespace EwaldConst; +using MathConst::MY_PIS; -#define EWALD_F 1.12837917 -#define EWALD_P 0.3275911 -#define A1 0.254829592 -#define A2 -0.284496736 -#define A3 1.421413741 -#define A4 -1.453152027 -#define A5 1.061405429 - -#define EPSILON 1e-6 +static constexpr double EPSILON = 1.0e-6; /* ---------------------------------------------------------------------- */ -PairLJCutCoulLongDielectric::PairLJCutCoulLongDielectric(LAMMPS *lmp) : PairLJCutCoulLong(lmp) +PairLJCutCoulLongDielectric::PairLJCutCoulLongDielectric(LAMMPS *_lmp) : PairLJCutCoulLong(_lmp) { respa_enable = 0; cut_respa = nullptr; @@ -158,7 +152,7 @@ void PairLJCutCoulLongDielectric::compute(int eflag, int vflag) forcecoul = prefactor * (erfc + EWALD_F * grij * expm2); if (factor_coul < 1.0) forcecoul -= (1.0 - factor_coul) * prefactor; - prefactorE = q[j] / r; + prefactorE = qqrd2e * q[j] / r; efield_i = prefactorE * (erfc + EWALD_F * grij * expm2); if (factor_coul < 1.0) efield_i -= (1.0 - factor_coul) * prefactorE; epot_i = efield_i; @@ -170,13 +164,13 @@ void PairLJCutCoulLongDielectric::compute(int eflag, int vflag) fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable]; table = ftable[itable] + fraction * dftable[itable]; forcecoul = qtmp * q[j] * table; - efield_i = q[j] * table / qqrd2e; + efield_i = q[j] * table; if (factor_coul < 1.0) { table = ctable[itable] + fraction * dctable[itable]; prefactor = qtmp * q[j] * table; forcecoul -= (1.0 - factor_coul) * prefactor; - prefactorE = q[j] * table / qqrd2e; + prefactorE = q[j] * table; efield_i -= (1.0 - factor_coul) * prefactorE; } epot_i = efield_i; @@ -244,7 +238,7 @@ void PairLJCutCoulLongDielectric::compute(int eflag, int vflag) void PairLJCutCoulLongDielectric::init_style() { - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR, "Pair lj/cut/coul/long/dielectric requires atom style dielectric"); neighbor->add_request(this, NeighConst::REQ_FULL); diff --git a/src/DIELECTRIC/pair_lj_cut_coul_msm_dielectric.cpp b/src/DIELECTRIC/pair_lj_cut_coul_msm_dielectric.cpp index 751f4d509a..0c66f52a4f 100644 --- a/src/DIELECTRIC/pair_lj_cut_coul_msm_dielectric.cpp +++ b/src/DIELECTRIC/pair_lj_cut_coul_msm_dielectric.cpp @@ -31,13 +31,13 @@ #include using namespace LAMMPS_NS; -using namespace MathConst; +using MathConst::MY_PIS; -#define EPSILON 1e-6 +static constexpr double EPSILON = 1.0e-6; /* ---------------------------------------------------------------------- */ -PairLJCutCoulMSMDielectric::PairLJCutCoulMSMDielectric(LAMMPS *lmp) : PairLJCutCoulLong(lmp) +PairLJCutCoulMSMDielectric::PairLJCutCoulMSMDielectric(LAMMPS *_lmp) : PairLJCutCoulLong(_lmp) { ewaldflag = pppmflag = 0; msmflag = 1; @@ -165,7 +165,7 @@ void PairLJCutCoulMSMDielectric::compute(int eflag, int vflag) forcecoul = prefactor * fgamma; if (factor_coul < 1.0) forcecoul -= (1.0 - factor_coul) * prefactor; - prefactorE = q[j] / r; + prefactorE = qqrd2e * q[j] / r; efield_i = prefactorE * fgamma; if (factor_coul < 1.0) efield_i -= (1.0 - factor_coul) * prefactorE; @@ -177,13 +177,13 @@ void PairLJCutCoulMSMDielectric::compute(int eflag, int vflag) fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable]; table = ftable[itable] + fraction * dftable[itable]; forcecoul = qtmp * q[j] * table; - efield_i = q[j] * table / qqrd2e; + efield_i = q[j] * table; if (factor_coul < 1.0) { table = ctable[itable] + fraction * dctable[itable]; prefactor = qtmp * q[j] * table; forcecoul -= (1.0 - factor_coul) * prefactor; - prefactorE = q[j] * table / qqrd2e; + prefactorE = q[j] * table; efield_i -= (1.0 - factor_coul) * prefactorE; } } @@ -352,7 +352,7 @@ double PairLJCutCoulMSMDielectric::single(int i, int j, int itype, int jtype, do void PairLJCutCoulMSMDielectric::init_style() { - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR, "Pair lj/cut/coul/msm/dielectric requires atom style dielectric"); neighbor->add_request(this, NeighConst::REQ_FULL); diff --git a/src/DIELECTRIC/pair_lj_long_coul_long_dielectric.cpp b/src/DIELECTRIC/pair_lj_long_coul_long_dielectric.cpp index 3fd86587e9..f99f6438ea 100644 --- a/src/DIELECTRIC/pair_lj_long_coul_long_dielectric.cpp +++ b/src/DIELECTRIC/pair_lj_long_coul_long_dielectric.cpp @@ -20,6 +20,7 @@ #include "atom.h" #include "atom_vec_dielectric.h" #include "error.h" +#include "ewald_const.h" #include "force.h" #include "math_const.h" #include "math_extra.h" @@ -31,20 +32,13 @@ #include using namespace LAMMPS_NS; -using namespace MathConst; +using namespace EwaldConst; +using MathConst::MY_PIS; using namespace MathExtra; -#define EWALD_F 1.12837917 -#define EWALD_P 0.3275911 -#define A1 0.254829592 -#define A2 -0.284496736 -#define A3 1.421413741 -#define A4 -1.453152027 -#define A5 1.061405429 - /* ---------------------------------------------------------------------- */ -PairLJLongCoulLongDielectric::PairLJLongCoulLongDielectric(LAMMPS *lmp) : PairLJLongCoulLong(lmp) +PairLJLongCoulLongDielectric::PairLJLongCoulLongDielectric(LAMMPS *_lmp) : PairLJLongCoulLong(_lmp) { respa_enable = 0; cut_respa = nullptr; @@ -71,7 +65,7 @@ void PairLJLongCoulLongDielectric::init_style() { PairLJLongCoulLong::init_style(); - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast(atom->style_match("dielectric")); if (!avec) error->all(FLERR, "Pair lj/long/coul/long/dielectric requires atom style dielectric"); neighbor->add_request(this, NeighConst::REQ_FULL); diff --git a/src/DIELECTRIC/pppm_dielectric.cpp b/src/DIELECTRIC/pppm_dielectric.cpp index 597f51010e..7f32a0a3f3 100644 --- a/src/DIELECTRIC/pppm_dielectric.cpp +++ b/src/DIELECTRIC/pppm_dielectric.cpp @@ -50,7 +50,7 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; /* ---------------------------------------------------------------------- */ -PPPMDielectric::PPPMDielectric(LAMMPS *lmp) : PPPM(lmp) +PPPMDielectric::PPPMDielectric(LAMMPS *_lmp) : PPPM(_lmp) { group_group_enable = 0; @@ -58,7 +58,7 @@ PPPMDielectric::PPPMDielectric(LAMMPS *lmp) : PPPM(lmp) phi = nullptr; potflag = 0; - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast( atom->style_match("dielectric")); if (!avec) error->all(FLERR,"pppm/dielectric requires atom style dielectric"); } diff --git a/src/DIELECTRIC/pppm_disp_dielectric.cpp b/src/DIELECTRIC/pppm_disp_dielectric.cpp index 2a7febd304..e525ba7384 100644 --- a/src/DIELECTRIC/pppm_disp_dielectric.cpp +++ b/src/DIELECTRIC/pppm_disp_dielectric.cpp @@ -58,7 +58,7 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM, /* ---------------------------------------------------------------------- */ -PPPMDispDielectric::PPPMDispDielectric(LAMMPS *lmp) : PPPMDisp(lmp) +PPPMDispDielectric::PPPMDispDielectric(LAMMPS *_lmp) : PPPMDisp(_lmp) { dipoleflag = 0; // turned off for now, until dipole works group_group_enable = 0; @@ -69,7 +69,7 @@ PPPMDispDielectric::PPPMDispDielectric(LAMMPS *lmp) : PPPMDisp(lmp) phi = nullptr; potflag = 0; - avec = (AtomVecDielectric *) atom->style_match("dielectric"); + avec = dynamic_cast( atom->style_match("dielectric")); if (!avec) error->all(FLERR,"pppm/dielectric requires atom style dielectric"); } diff --git a/src/DIFFRACTION/compute_saed.cpp b/src/DIFFRACTION/compute_saed.cpp index e2df7fe3b8..e21570d76d 100644 --- a/src/DIFFRACTION/compute_saed.cpp +++ b/src/DIFFRACTION/compute_saed.cpp @@ -348,7 +348,7 @@ void ComputeSAED::compute_vector() utils::logmesg(lmp,"-----\nComputing SAED intensities"); double t0 = platform::walltime(); - double *Fvec = new double[2*nRows]; // Strct factor (real & imaginary) + auto Fvec = new double[2*nRows]; // Strct factor (real & imaginary) // -- Note, vector entries correspond to different RELP ntypes = atom->ntypes; @@ -364,7 +364,7 @@ void ComputeSAED::compute_vector() } } - double *xlocal = new double [3*nlocalgroup]; + auto xlocal = new double [3*nlocalgroup]; int *typelocal = new int [nlocalgroup]; nlocalgroup = 0; @@ -413,7 +413,7 @@ void ComputeSAED::compute_vector() #pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(offset,ASFSAED,typelocal,xlocal,Fvec,m,frac) #endif { - double *f = new double[ntypes]; // atomic structure factor by type + auto f = new double[ntypes]; // atomic structure factor by type int typei = 0; double Fatom1 = 0.0; // structure factor per atom double Fatom2 = 0.0; // structure factor per atom (imaginary) @@ -481,7 +481,7 @@ void ComputeSAED::compute_vector() delete [] f; } - double *scratch = new double[2*nRows]; + auto scratch = new double[2*nRows]; // Sum intensity for each ang-hkl combination across processors MPI_Allreduce(Fvec,scratch,2*nRows,MPI_DOUBLE,MPI_SUM,world); diff --git a/src/DIFFRACTION/compute_xrd.cpp b/src/DIFFRACTION/compute_xrd.cpp index d798c2f4db..aef4d932a9 100644 --- a/src/DIFFRACTION/compute_xrd.cpp +++ b/src/DIFFRACTION/compute_xrd.cpp @@ -301,7 +301,7 @@ void ComputeXRD::compute_array() double t0 = platform::walltime(); - double *Fvec = new double[2*size_array_rows]; // Strct factor (real & imaginary) + auto Fvec = new double[2*size_array_rows]; // Strct factor (real & imaginary) // -- Note: array rows correspond to different RELP ntypes = atom->ntypes; @@ -317,7 +317,7 @@ void ComputeXRD::compute_array() } } - double *xlocal = new double [3*nlocalgroup]; + auto xlocal = new double [3*nlocalgroup]; int *typelocal = new int [nlocalgroup]; nlocalgroup = 0; @@ -350,7 +350,7 @@ void ComputeXRD::compute_array() #pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(typelocal,xlocal,Fvec,m,frac,ASFXRD) #endif { - double *f = new double[ntypes]; // atomic structure factor by type + auto f = new double[ntypes]; // atomic structure factor by type int n,typei = 0; double Fatom1 = 0.0; // structure factor per atom (real) @@ -486,7 +486,7 @@ void ComputeXRD::compute_array() delete [] f; } // End of pragma omp parallel region - double *scratch = new double[2*size_array_rows]; + auto scratch = new double[2*size_array_rows]; // Sum intensity for each ang-hkl combination across processors MPI_Allreduce(Fvec,scratch,2*size_array_rows,MPI_DOUBLE,MPI_SUM,world); diff --git a/src/DIFFRACTION/fix_saed_vtk.cpp b/src/DIFFRACTION/fix_saed_vtk.cpp index 89627b64ef..45b2db9743 100644 --- a/src/DIFFRACTION/fix_saed_vtk.cpp +++ b/src/DIFFRACTION/fix_saed_vtk.cpp @@ -67,7 +67,7 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute ID for fix saed/vtk does not exist"); // Check that specified compute is for SAED - compute_saed = (ComputeSAED *) modify->compute[icompute]; + compute_saed = dynamic_cast( modify->compute[icompute]); if (strcmp(compute_saed->style,"saed") != 0) error->all(FLERR,"Fix saed/vtk has invalid compute assigned"); diff --git a/src/DPD-BASIC/pair_dpd.cpp b/src/DPD-BASIC/pair_dpd.cpp index caa8161573..b16be8d212 100644 --- a/src/DPD-BASIC/pair_dpd.cpp +++ b/src/DPD-BASIC/pair_dpd.cpp @@ -46,6 +46,8 @@ PairDPD::PairDPD(LAMMPS *lmp) : Pair(lmp) PairDPD::~PairDPD() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); diff --git a/src/DPD-BASIC/pair_dpd.h b/src/DPD-BASIC/pair_dpd.h index 796228878c..2a08c60376 100644 --- a/src/DPD-BASIC/pair_dpd.h +++ b/src/DPD-BASIC/pair_dpd.h @@ -49,7 +49,7 @@ class PairDPD : public Pair { double **sigma; class RanMars *random; - void allocate(); + virtual void allocate(); }; } // namespace LAMMPS_NS diff --git a/src/DPD-BASIC/pair_dpd_ext.cpp b/src/DPD-BASIC/pair_dpd_ext.cpp index 5e45790913..19cce06d5e 100644 --- a/src/DPD-BASIC/pair_dpd_ext.cpp +++ b/src/DPD-BASIC/pair_dpd_ext.cpp @@ -47,6 +47,8 @@ PairDPDExt::PairDPDExt(LAMMPS *lmp) : Pair(lmp) PairDPDExt::~PairDPDExt() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); diff --git a/src/DPD-BASIC/pair_dpd_ext.h b/src/DPD-BASIC/pair_dpd_ext.h index 66df395406..eae8fd9f1d 100644 --- a/src/DPD-BASIC/pair_dpd_ext.h +++ b/src/DPD-BASIC/pair_dpd_ext.h @@ -45,12 +45,12 @@ class PairDPDExt : public Pair { double cut_global, temperature; int seed; double **cut; - double **a0, **gamma, **gammaII, **gammaT; + double **a0, **gamma, **gammaT; double **sigma, **sigmaT; double **ws, **wsT; class RanMars *random; - void allocate(); + virtual void allocate(); }; } // namespace LAMMPS_NS diff --git a/src/DPD-MESO/pair_tdpd.cpp b/src/DPD-MESO/pair_tdpd.cpp index 35f440426e..76f4b59108 100644 --- a/src/DPD-MESO/pair_tdpd.cpp +++ b/src/DPD-MESO/pair_tdpd.cpp @@ -279,9 +279,9 @@ void PairTDPD::coeff(int narg, char **arg) double power_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = utils::numeric(FLERR,arg[5],false,lmp); double cutcc_one = utils::numeric(FLERR,arg[6],false,lmp); - double *kappa_one = new double[cc_species]; - double *epsilon_one = new double[cc_species]; - double *powercc_one = new double[cc_species]; + auto kappa_one = new double[cc_species]; + auto epsilon_one = new double[cc_species]; + auto powercc_one = new double[cc_species]; for (int k=0; kall(FLERR,"Illegal fix dpd/energy command"); pairDPDE = nullptr; - pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); + pairDPDE = dynamic_cast( force->pair_match("dpd/fdt/energy",1)); if (pairDPDE == nullptr) - pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); + pairDPDE = dynamic_cast( force->pair_match("dpd/fdt/energy/kk",1)); if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix dpd/energy"); diff --git a/src/DPD-REACT/fix_eos_table.cpp b/src/DPD-REACT/fix_eos_table.cpp index 61b4e7501a..17158e5a51 100644 --- a/src/DPD-REACT/fix_eos_table.cpp +++ b/src/DPD-REACT/fix_eos_table.cpp @@ -349,7 +349,7 @@ void FixEOStable::spline(double *x, double *y, int n, { int i,k; double p,qn,sig,un; - double *u = new double[n]; + auto u = new double[n]; if (yp1 > 0.99e30) y2[0] = u[0] = 0.0; else { diff --git a/src/DPD-REACT/fix_eos_table_rx.cpp b/src/DPD-REACT/fix_eos_table_rx.cpp index 26defddc45..a2f8893b82 100644 --- a/src/DPD-REACT/fix_eos_table_rx.cpp +++ b/src/DPD-REACT/fix_eos_table_rx.cpp @@ -301,7 +301,7 @@ void FixEOStableRX::read_file(char *file) { int min_params_per_line = 2; int max_params_per_line = 5; - char **words = new char*[max_params_per_line+1]; + auto words = new char*[max_params_per_line+1]; // open file on proc 0 @@ -641,7 +641,7 @@ void FixEOStableRX::spline(double *x, double *y, int n, { int i,k; double p,qn,sig,un; - double *u = new double[n]; + auto u = new double[n]; if (yp1 > 0.99e30) y2[0] = u[0] = 0.0; else { diff --git a/src/DPD-REACT/fix_rx.cpp b/src/DPD-REACT/fix_rx.cpp index dd8eacccc7..9a32f39268 100644 --- a/src/DPD-REACT/fix_rx.cpp +++ b/src/DPD-REACT/fix_rx.cpp @@ -233,7 +233,7 @@ void FixRX::post_constructor() int nUniqueSpecies = 0; bool match; - char **tmpspecies = new char*[maxspecies]; + auto tmpspecies = new char*[maxspecies]; for (int jj=0; jj < maxspecies; jj++) tmpspecies[jj] = nullptr; @@ -319,9 +319,9 @@ void FixRX::post_constructor() newcmd1 += " ghost yes"; newcmd2 += " ghost yes"; - fix_species = (FixPropertyAtom *) modify->add_fix(newcmd1); + fix_species = dynamic_cast( modify->add_fix(newcmd1)); restartFlag = fix_species->restart_reset; - fix_species_old = (FixPropertyAtom *) modify->add_fix(newcmd2); + fix_species_old = dynamic_cast( modify->add_fix(newcmd2)); if (nspecies==0) error->all(FLERR,"There are no rx species specified."); @@ -579,9 +579,9 @@ int FixRX::setmask() void FixRX::init() { - pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); + pairDPDE = dynamic_cast( force->pair_match("dpd/fdt/energy",1)); if (pairDPDE == nullptr) - pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); + pairDPDE = dynamic_cast( force->pair_match("dpd/fdt/energy/kk",1)); if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix rx"); @@ -625,7 +625,7 @@ void FixRX::setup_pre_force(int /*vflag*/) userData.kFor = new double[nreactions]; userData.rxnRateLaw = new double[nreactions]; - double *rwork = new double[8*nspecies]; + auto rwork = new double[8*nspecies]; if (localTempFlag) { int count = nlocal + (newton_pair ? nghost : 0); @@ -695,7 +695,7 @@ void FixRX::pre_force(int /*vflag*/) } { - double *rwork = new double[8*nspecies]; + auto rwork = new double[8*nspecies]; UserRHSData userData; userData.kFor = new double[nreactions]; @@ -1575,7 +1575,7 @@ int FixRX::rhs(double t, const double *y, double *dydt, void *params) int FixRX::rhs_dense(double /*t*/, const double *y, double *dydt, void *params) { - UserRHSData *userData = (UserRHSData *) params; + auto userData = (UserRHSData *) params; double *rxnRateLaw = userData->rxnRateLaw; double *kFor = userData->kFor; @@ -1609,7 +1609,7 @@ int FixRX::rhs_dense(double /*t*/, const double *y, double *dydt, void *params) int FixRX::rhs_sparse(double /*t*/, const double *y, double *dydt, void *v_params) const { - UserRHSData *userData = (UserRHSData *) v_params; + auto userData = (UserRHSData *) v_params; const double VDPD = domain->xprd * domain->yprd * domain->zprd / atom->natoms; diff --git a/src/DPD-REACT/fix_shardlow.cpp b/src/DPD-REACT/fix_shardlow.cpp index 02a8af888e..7ab8c6f857 100644 --- a/src/DPD-REACT/fix_shardlow.cpp +++ b/src/DPD-REACT/fix_shardlow.cpp @@ -93,10 +93,10 @@ FixShardlow::FixShardlow(LAMMPS *lmp, int narg, char **arg) : pairDPD = nullptr; pairDPDE = nullptr; - pairDPD = (PairDPDfdt *) force->pair_match("dpd/fdt",1); - pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); + pairDPD = dynamic_cast( force->pair_match("dpd/fdt",1)); + pairDPDE = dynamic_cast( force->pair_match("dpd/fdt/energy",1)); if (pairDPDE == nullptr) - pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); + pairDPDE = dynamic_cast( force->pair_match("dpd/fdt/energy/kk",1)); maxRNG = 0; if (pairDPDE) { @@ -548,7 +548,7 @@ void FixShardlow::initial_integrate(int /*vflag*/) "Either reduce the number of processors requested, or change the cutoff/skin: " "rcut= {} bbx= {} bby= {} bbz= {}\n", rcut, bbx, bby, bbz); - NPairHalfBinNewtonSSA *np_ssa = dynamic_cast(list->np); + auto np_ssa = dynamic_cast(list->np); if (!np_ssa) error->one(FLERR, "NPair wasn't a NPairHalfBinNewtonSSA object"); int ssa_phaseCt = np_ssa->ssa_phaseCt; int *ssa_phaseLen = np_ssa->ssa_phaseLen; diff --git a/src/DPD-REACT/npair_half_bin_newton_ssa.cpp b/src/DPD-REACT/npair_half_bin_newton_ssa.cpp index 1dfeaac6bb..2f36b467e0 100644 --- a/src/DPD-REACT/npair_half_bin_newton_ssa.cpp +++ b/src/DPD-REACT/npair_half_bin_newton_ssa.cpp @@ -97,12 +97,12 @@ void NPairHalfBinNewtonSSA::build(NeighList *list) int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - NStencilSSA *ns_ssa = dynamic_cast(ns); + auto ns_ssa = dynamic_cast(ns); if (!ns_ssa) error->one(FLERR, "NStencil wasn't a NStencilSSA object"); int *nstencil_ssa = &(ns_ssa->nstencil_ssa[0]); int nstencil_full = ns_ssa->nstencil; - NBinSSA *nb_ssa = dynamic_cast(nb); + auto nb_ssa = dynamic_cast(nb); if (!nb_ssa) error->one(FLERR, "NBin wasn't a NBinSSA object"); int *bins = nb_ssa->bins; int *binhead = nb_ssa->binhead; diff --git a/src/DPD-REACT/pair_exp6_rx.cpp b/src/DPD-REACT/pair_exp6_rx.cpp index 313e9f2583..02d4e84e9e 100644 --- a/src/DPD-REACT/pair_exp6_rx.cpp +++ b/src/DPD-REACT/pair_exp6_rx.cpp @@ -705,7 +705,7 @@ double PairExp6rx::init_one(int i, int j) void PairExp6rx::read_file(char *file) { int params_per_line = 5; - char **words = new char*[params_per_line+1]; + auto words = new char*[params_per_line+1]; memory->sfree(params); params = nullptr; @@ -820,7 +820,7 @@ void PairExp6rx::read_file(char *file) void PairExp6rx::read_file2(char *file) { int params_per_line = 7; - char **words = new char*[params_per_line+1]; + auto words = new char*[params_per_line+1]; // open file on proc 0 diff --git a/src/DPD-REACT/pair_multi_lucy.cpp b/src/DPD-REACT/pair_multi_lucy.cpp index 41c9d9fb66..009ebfc21f 100644 --- a/src/DPD-REACT/pair_multi_lucy.cpp +++ b/src/DPD-REACT/pair_multi_lucy.cpp @@ -623,7 +623,7 @@ void PairMultiLucy::spline(double *x, double *y, int n, { int i,k; double p,qn,sig,un; - double *u = new double[n]; + auto u = new double[n]; if (yp1 > 0.99e30) y2[0] = u[0] = 0.0; else { diff --git a/src/DPD-REACT/pair_multi_lucy_rx.cpp b/src/DPD-REACT/pair_multi_lucy_rx.cpp index 8b348810fd..bd508707dd 100644 --- a/src/DPD-REACT/pair_multi_lucy_rx.cpp +++ b/src/DPD-REACT/pair_multi_lucy_rx.cpp @@ -763,7 +763,7 @@ void PairMultiLucyRX::spline(double *x, double *y, int n, { int i,k; double p,qn,sig,un; - double *u = new double[n]; + auto u = new double[n]; if (yp1 > 0.99e30) y2[0] = u[0] = 0.0; else { diff --git a/src/DPD-SMOOTH/fix_meso_move.cpp b/src/DPD-SMOOTH/fix_meso_move.cpp index ba32962b3c..078274416d 100644 --- a/src/DPD-SMOOTH/fix_meso_move.cpp +++ b/src/DPD-SMOOTH/fix_meso_move.cpp @@ -818,7 +818,7 @@ void FixMesoMove::write_restart (FILE *fp) { void FixMesoMove::restart (char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; time_origin = static_cast (list[n++]); } diff --git a/src/DRUDE/compute_temp_drude.cpp b/src/DRUDE/compute_temp_drude.cpp index 96344751a7..f5cfe35223 100644 --- a/src/DRUDE/compute_temp_drude.cpp +++ b/src/DRUDE/compute_temp_drude.cpp @@ -67,7 +67,7 @@ void ComputeTempDrude::init() for (ifix = 0; ifix < modify->nfix; ifix++) if (strcmp(modify->fix[ifix]->style,"drude") == 0) break; if (ifix == modify->nfix) error->all(FLERR, "compute temp/drude requires fix drude"); - fix_drude = (FixDrude *) modify->fix[ifix]; + fix_drude = dynamic_cast( modify->fix[ifix]); if (!comm->ghost_velocity) error->all(FLERR,"compute temp/drude requires ghost velocities. Use comm_modify vel yes"); diff --git a/src/DRUDE/fix_drude.cpp b/src/DRUDE/fix_drude.cpp index 20d6749c8a..70b36a63ee 100644 --- a/src/DRUDE/fix_drude.cpp +++ b/src/DRUDE/fix_drude.cpp @@ -174,7 +174,7 @@ void FixDrude::build_drudeid() { ------------------------------------------------------------------------- */ void FixDrude::ring_search_drudeid(int size, char *cbuf, void *ptr) { // Search for the drude partner of my cores - FixDrude *fdptr = (FixDrude *) ptr; + auto fdptr = (FixDrude *) ptr; Atom *atom = fdptr->atom; int nlocal = atom->nlocal; int *type = atom->type; @@ -182,7 +182,7 @@ void FixDrude::ring_search_drudeid(int size, char *cbuf, void *ptr) { tagint *drudeid = fdptr->drudeid; int *drudetype = fdptr->drudetype; - tagint *first = (tagint *) cbuf; + auto first = (tagint *) cbuf; tagint *last = first + size; std::set drude_set(first, last); std::set::iterator it; @@ -204,11 +204,11 @@ void FixDrude::ring_search_drudeid(int size, char *cbuf, void *ptr) { ------------------------------------------------------------------------- */ void FixDrude::ring_build_partner(int size, char *cbuf, void *ptr) { // Add partners from incoming list - FixDrude *fdptr = (FixDrude *) ptr; + auto fdptr = (FixDrude *) ptr; Atom *atom = fdptr->atom; int nlocal = atom->nlocal; std::set *partner_set = fdptr->partner_set; - tagint *it = (tagint *) cbuf; + auto it = (tagint *) cbuf; tagint *last = it + size; while (it < last) { @@ -375,13 +375,13 @@ void FixDrude::rebuild_special() { ------------------------------------------------------------------------- */ void FixDrude::ring_remove_drude(int size, char *cbuf, void *ptr) { // Remove all drude particles from special list - FixDrude *fdptr = (FixDrude *) ptr; + auto fdptr = (FixDrude *) ptr; Atom *atom = fdptr->atom; int nlocal = atom->nlocal; int **nspecial = atom->nspecial; tagint **special = atom->special; int *type = atom->type; - tagint *first = (tagint *) cbuf; + auto first = (tagint *) cbuf; tagint *last = first + size; std::set drude_set(first, last); int *drudetype = fdptr->drudetype; @@ -412,7 +412,7 @@ void FixDrude::ring_remove_drude(int size, char *cbuf, void *ptr) { void FixDrude::ring_add_drude(int size, char *cbuf, void *ptr) { // Assume special array size is big enough // Add all particle just after their core in the special list - FixDrude *fdptr = (FixDrude *) ptr; + auto fdptr = (FixDrude *) ptr; Atom *atom = fdptr->atom; int nlocal = atom->nlocal; int **nspecial = atom->nspecial; @@ -421,7 +421,7 @@ void FixDrude::ring_add_drude(int size, char *cbuf, void *ptr) { tagint *drudeid = fdptr->drudeid; int *drudetype = fdptr->drudetype; - tagint *first = (tagint *) cbuf; + auto first = (tagint *) cbuf; tagint *last = first + size; std::map core_drude_map; @@ -468,7 +468,7 @@ void FixDrude::ring_add_drude(int size, char *cbuf, void *ptr) { ------------------------------------------------------------------------- */ void FixDrude::ring_copy_drude(int size, char *cbuf, void *ptr) { // Copy special list of drude from its core (except itself) - FixDrude *fdptr = (FixDrude *) ptr; + auto fdptr = (FixDrude *) ptr; Atom *atom = fdptr->atom; int nlocal = atom->nlocal; int **nspecial = atom->nspecial; @@ -477,7 +477,7 @@ void FixDrude::ring_copy_drude(int size, char *cbuf, void *ptr) { tagint *drudeid = fdptr->drudeid; int *drudetype = fdptr->drudetype; - tagint *first = (tagint *) cbuf; + auto first = (tagint *) cbuf; tagint *last = first + size; std::map core_special_map; diff --git a/src/DRUDE/fix_drude_transform.cpp b/src/DRUDE/fix_drude_transform.cpp index 8f04578627..642f5aabf8 100644 --- a/src/DRUDE/fix_drude_transform.cpp +++ b/src/DRUDE/fix_drude_transform.cpp @@ -43,7 +43,7 @@ FixDrudeTransform::FixDrudeTransform(LAMMPS *lmp, int narg, char **arg) template FixDrudeTransform::~FixDrudeTransform() { - if (mcoeff) delete [] mcoeff; + delete[] mcoeff; } /* ---------------------------------------------------------------------- */ @@ -79,7 +79,7 @@ void FixDrudeTransform::setup(int) { if (!rmass) { if (!mcoeff) mcoeff = new double[ntypes+1]; - double *mcoeff_loc = new double[ntypes+1]; + auto mcoeff_loc = new double[ntypes+1]; for (int itype=0; itype<=ntypes; itype++) mcoeff_loc[itype] = 2.; // an impossible value: mcoeff is at most 1. for (int i=0; infix; ifix++) if (strcmp(modify->fix[ifix]->style,"drude") == 0) break; if (ifix == modify->nfix) error->all(FLERR, "fix langevin/drude requires fix drude"); - fix_drude = (FixDrude *) modify->fix[ifix]; + fix_drude = dynamic_cast( modify->fix[ifix]); } /* ---------------------------------------------------------------------- */ diff --git a/src/DRUDE/fix_tgnh_drude.cpp b/src/DRUDE/fix_tgnh_drude.cpp index 700f9669d8..d5de5bd67f 100644 --- a/src/DRUDE/fix_tgnh_drude.cpp +++ b/src/DRUDE/fix_tgnh_drude.cpp @@ -523,7 +523,7 @@ FixTGNHDrude::FixTGNHDrude(LAMMPS *lmp, int narg, char **arg) : for (ifix = 0; ifix < modify->nfix; ifix++) if (strcmp(modify->fix[ifix]->style,"drude") == 0) break; if (ifix == modify->nfix) error->all(FLERR, "fix tgnh/drude requires fix drude"); - fix_drude = (FixDrude *) modify->fix[ifix]; + fix_drude = dynamic_cast( modify->fix[ifix]); // make sure ghost atoms have velocity if (!comm->ghost_velocity) @@ -595,7 +595,7 @@ void FixTGNHDrude::init() if (pstat_flag) for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = ((FixDeform *) modify->fix[i])->dimflag; + int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5])) @@ -664,8 +664,8 @@ void FixTGNHDrude::init() else kspace_flag = 0; if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = ((Respa *) update->integrate)->nlevels; - step_respa = ((Respa *) update->integrate)->step; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + step_respa = (dynamic_cast( update->integrate))->step; dto = 0.5*step_respa[0]; } @@ -732,7 +732,7 @@ void FixTGNHDrude::setup_mol_mass_dof() { memory->create(v_mol_tmp, n_mol + 1, 3, "fix_tgnh_drude::v_mol_tmp"); memory->create(mass_mol, n_mol + 1, "fix_tgnh_drude::mass_mol"); - double *mass_tmp = new double[n_mol + 1]; + auto mass_tmp = new double[n_mol + 1]; memset(mass_tmp, 0, sizeof(double) * (n_mol + 1)); for (int i = 0; i < atom->nlocal; i++) { id_mol = molecule[i]; @@ -1364,7 +1364,7 @@ int FixTGNHDrude::pack_restart_data(double *list) void FixTGNHDrude::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; int flag = static_cast (list[n++]); if (flag) { int m = static_cast (list[n++]); diff --git a/src/DRUDE/pair_coul_tt.cpp b/src/DRUDE/pair_coul_tt.cpp index 1e3892c414..af8ed099c5 100644 --- a/src/DRUDE/pair_coul_tt.cpp +++ b/src/DRUDE/pair_coul_tt.cpp @@ -289,7 +289,7 @@ void PairCoulTT::init_style() for (ifix = 0; ifix < modify->nfix; ifix++) if (utils::strmatch(modify->fix[ifix]->style,"^drude")) break; if (ifix == modify->nfix) error->all(FLERR, "Pair coul/tt requires fix drude"); - fix_drude = (FixDrude *) modify->fix[ifix]; + fix_drude = dynamic_cast( modify->fix[ifix]); neighbor->add_request(this); } diff --git a/src/DRUDE/pair_lj_cut_thole_long.cpp b/src/DRUDE/pair_lj_cut_thole_long.cpp index 53e95c087e..33e1e435fa 100644 --- a/src/DRUDE/pair_lj_cut_thole_long.cpp +++ b/src/DRUDE/pair_lj_cut_thole_long.cpp @@ -364,7 +364,7 @@ void PairLJCutTholeLong::init_style() if (strcmp(modify->fix[ifix]->style,"drude") == 0) break; if (ifix == modify->nfix) error->all(FLERR, "Pair style lj/cut/thole/long requires fix drude"); - fix_drude = (FixDrude *) modify->fix[ifix]; + fix_drude = dynamic_cast( modify->fix[ifix]); neighbor->add_request(this); diff --git a/src/DRUDE/pair_thole.cpp b/src/DRUDE/pair_thole.cpp index 126e611fcf..a2f0b25e13 100644 --- a/src/DRUDE/pair_thole.cpp +++ b/src/DRUDE/pair_thole.cpp @@ -258,7 +258,7 @@ void PairThole::init_style() for (ifix = 0; ifix < modify->nfix; ifix++) if (strcmp(modify->fix[ifix]->style,"drude") == 0) break; if (ifix == modify->nfix) error->all(FLERR, "Pair thole requires fix drude"); - fix_drude = (FixDrude *) modify->fix[ifix]; + fix_drude = dynamic_cast( modify->fix[ifix]); neighbor->add_request(this); } diff --git a/src/Depend.sh b/src/Depend.sh index 5123354b1c..1de6edbb63 100755 --- a/src/Depend.sh +++ b/src/Depend.sh @@ -73,6 +73,7 @@ fi if (test $1 = "DPD-BASIC") then depend GPU + depend KOKKOS depend OPENMP depend INTEL fi diff --git a/src/EFF/compute_temp_deform_eff.cpp b/src/EFF/compute_temp_deform_eff.cpp index 6476c78039..292bf64d7b 100644 --- a/src/EFF/compute_temp_deform_eff.cpp +++ b/src/EFF/compute_temp_deform_eff.cpp @@ -74,7 +74,7 @@ void ComputeTempDeformEff::init() int i; for (i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - if (((FixDeform *) modify->fix[i])->remapflag == Domain::X_REMAP && + if ((dynamic_cast( modify->fix[i]))->remapflag == Domain::X_REMAP && comm->me == 0) error->warning(FLERR,"Using compute temp/deform/eff with inconsistent " "fix deform remap option"); diff --git a/src/EFF/fix_nve_eff.cpp b/src/EFF/fix_nve_eff.cpp index ed640990ca..6639197285 100644 --- a/src/EFF/fix_nve_eff.cpp +++ b/src/EFF/fix_nve_eff.cpp @@ -59,7 +59,7 @@ void FixNVEEff::init() dtf = 0.5 * update->dt * force->ftm2v; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = ((Respa *) update->integrate)->step; + step_respa = (dynamic_cast( update->integrate))->step; } /* ---------------------------------------------------------------------- diff --git a/src/EFF/fix_nvt_sllod_eff.cpp b/src/EFF/fix_nvt_sllod_eff.cpp index 8e3f7cd72d..c4cc2de87f 100644 --- a/src/EFF/fix_nvt_sllod_eff.cpp +++ b/src/EFF/fix_nvt_sllod_eff.cpp @@ -70,7 +70,7 @@ void FixNVTSllodEff::init() int i; for (i = 0; i < modify->nfix; i++) if (strncmp(modify->fix[i]->style,"deform",6) == 0) { - if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP) + if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod/eff with inconsistent fix deform " "remap option"); break; diff --git a/src/EXTRA-COMPUTE/compute_basal_atom.cpp b/src/EXTRA-COMPUTE/compute_basal_atom.cpp index aad949530e..a16c4f8330 100644 --- a/src/EXTRA-COMPUTE/compute_basal_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_basal_atom.cpp @@ -200,9 +200,9 @@ void ComputeBasalAtom::compute_peratom() chi[0] = chi[1] = chi[2] = chi[3] = chi[4] = chi[5] = chi[6] = chi[7] = 0; double x_ij, y_ij, z_ij, x_ik, y_ik, z_ik, xmean5, ymean5, zmean5, xmean6, ymean6, zmean6, xmean7, ymean7, zmean7; - double *x3 = new double[n0]; - double *y3 = new double[n0]; - double *z3 = new double[n0]; + auto x3 = new double[n0]; + auto y3 = new double[n0]; + auto z3 = new double[n0]; for (j = 0; j < n0; j++) { x_ij = x[i][0]-x[nearest_n0[j]][0]; y_ij = x[i][1]-x[nearest_n0[j]][1]; diff --git a/src/EXTRA-COMPUTE/compute_entropy_atom.cpp b/src/EXTRA-COMPUTE/compute_entropy_atom.cpp index 20de069d50..b2fcee7ae4 100644 --- a/src/EXTRA-COMPUTE/compute_entropy_atom.cpp +++ b/src/EXTRA-COMPUTE/compute_entropy_atom.cpp @@ -150,8 +150,8 @@ void ComputeEntropyAtom::compute_peratom() int i,j,ii,jj,inum,jnum; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; int *ilist,*jlist,*numneigh,**firstneigh; - double *rbin = new double[nbin]; - double *rbinsq = new double[nbin]; + auto rbin = new double[nbin]; + auto rbinsq = new double[nbin]; invoked_peratom = update->ntimestep; @@ -199,8 +199,8 @@ void ComputeEntropyAtom::compute_peratom() double **x = atom->x; int *mask = atom->mask; - double *gofr = new double[nbin]; - double *integrand = new double[nbin]; + auto gofr = new double[nbin]; + auto integrand = new double[nbin]; for (ii = 0; ii < inum; ii++) { i = ilist[ii]; diff --git a/src/EXTRA-COMPUTE/compute_hma.cpp b/src/EXTRA-COMPUTE/compute_hma.cpp index 23dbb07aa8..bb182de7af 100644 --- a/src/EXTRA-COMPUTE/compute_hma.cpp +++ b/src/EXTRA-COMPUTE/compute_hma.cpp @@ -90,8 +90,8 @@ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) : // our new fix's group = same as compute group id_fix = utils::strdup(std::string(id)+"_COMPUTE_STORE"); - fix = (FixStore *)modify->add_fix(fmt::format("{} {} STORE peratom 1 3", - id_fix, group->names[igroup])); + fix = dynamic_cast(modify->add_fix(fmt::format("{} {} STORE peratom 1 3", + id_fix, group->names[igroup]))); // calculate xu,yu,zu for fix store array // skip if reset from restart file @@ -190,7 +190,7 @@ void ComputeHMA::setup() int dummy=0; int ifix = modify->find_fix(id_temp); if (ifix < 0) error->all(FLERR,"Could not find compute hma temperature ID"); - double * temperat = (double *) modify->fix[ifix]->extract("t_target",dummy); + auto temperat = (double *) modify->fix[ifix]->extract("t_target",dummy); if (temperat==nullptr) error->all(FLERR,"Could not find compute hma temperature ID"); finaltemp = * temperat; @@ -198,7 +198,7 @@ void ComputeHMA::setup() int ifix2 = modify->find_fix(id_fix); if (ifix2 < 0) error->all(FLERR,"Could not find hma store fix ID"); - fix = (FixStore *) modify->fix[ifix2]; + fix = dynamic_cast( modify->fix[ifix2]); } /* ---------------------------------------------------------------------- */ diff --git a/src/EXTRA-COMPUTE/compute_msd_nongauss.cpp b/src/EXTRA-COMPUTE/compute_msd_nongauss.cpp index 99c5cee715..0f68e03ca7 100644 --- a/src/EXTRA-COMPUTE/compute_msd_nongauss.cpp +++ b/src/EXTRA-COMPUTE/compute_msd_nongauss.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -19,17 +18,17 @@ #include "compute_msd_nongauss.h" #include "atom.h" -#include "update.h" -#include "group.h" #include "domain.h" #include "fix_store.h" +#include "group.h" +#include "update.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeMSDNonGauss::ComputeMSDNonGauss(LAMMPS *lmp, int narg, char **arg) : - ComputeMSD(lmp, narg, arg) + ComputeMSD(lmp, narg, arg) { size_vector = 3; } @@ -43,8 +42,10 @@ void ComputeMSDNonGauss::compute_vector() // cm = current center of mass double cm[3]; - if (comflag) group->xcm(igroup,masstotal,cm); - else cm[0] = cm[1] = cm[2] = 0.0; + if (comflag) + group->xcm(igroup, masstotal, cm); + else + cm[0] = cm[1] = cm[2] = 0.0; // dx,dy,dz = displacement of atom from original position // original unwrapped position is stored by fix @@ -63,8 +64,8 @@ void ComputeMSDNonGauss::compute_vector() double yprd = domain->yprd; double zprd = domain->zprd; - double dx,dy,dz; - int xbox,ybox,zbox; + double dx, dy, dz; + int xbox, ybox, zbox; double msd[2]; msd[0] = msd[1] = 0.0; @@ -75,11 +76,11 @@ void ComputeMSDNonGauss::compute_vector() xbox = (image[i] & IMGMASK) - IMGMAX; ybox = (image[i] >> IMGBITS & IMGMASK) - IMGMAX; zbox = (image[i] >> IMG2BITS) - IMGMAX; - dx = x[i][0] + xbox*xprd - cm[0] - xoriginal[i][0]; - dy = x[i][1] + ybox*yprd - cm[1] - xoriginal[i][1]; - dz = x[i][2] + zbox*zprd - cm[2] - xoriginal[i][2]; - msd[0] += dx*dx + dy*dy + dz*dz; - msd[1] += (dx*dx + dy*dy + dz*dz)*(dx*dx + dy*dy + dz*dz); + dx = x[i][0] + xbox * xprd - cm[0] - xoriginal[i][0]; + dy = x[i][1] + ybox * yprd - cm[1] - xoriginal[i][1]; + dz = x[i][2] + zbox * zprd - cm[2] - xoriginal[i][2]; + msd[0] += dx * dx + dy * dy + dz * dz; + msd[1] += (dx * dx + dy * dy + dz * dz) * (dx * dx + dy * dy + dz * dz); } } else { @@ -88,19 +89,18 @@ void ComputeMSDNonGauss::compute_vector() xbox = (image[i] & IMGMASK) - IMGMAX; ybox = (image[i] >> IMGBITS & IMGMASK) - IMGMAX; zbox = (image[i] >> IMG2BITS) - IMGMAX; - dx = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox - - cm[0] - xoriginal[i][0]; - dy = x[i][1] + h[1]*ybox + h[3]*zbox - cm[1] - xoriginal[i][1]; - dz = x[i][2] + h[2]*zbox - cm[2] - xoriginal[i][2]; - msd[0] += dx*dx + dy*dy + dz*dz; - msd[1] += (dx*dx + dy*dy + dz*dz)*(dx*dx + dy*dy + dz*dz); + dx = x[i][0] + h[0] * xbox + h[5] * ybox + h[4] * zbox - cm[0] - xoriginal[i][0]; + dy = x[i][1] + h[1] * ybox + h[3] * zbox - cm[1] - xoriginal[i][1]; + dz = x[i][2] + h[2] * zbox - cm[2] - xoriginal[i][2]; + msd[0] += dx * dx + dy * dy + dz * dz; + msd[1] += (dx * dx + dy * dy + dz * dz) * (dx * dx + dy * dy + dz * dz); } } - MPI_Allreduce(msd,vector,2,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(msd, vector, 2, MPI_DOUBLE, MPI_SUM, world); if (nmsd) { vector[0] /= nmsd; vector[1] /= nmsd; - vector[2] = (3*vector[1])/(5*vector[0]*vector[0]) - 1; + vector[2] = (3 * vector[1]) / (5 * vector[0] * vector[0]) - 1; } } diff --git a/src/EXTRA-DUMP/dump_yaml.cpp b/src/EXTRA-DUMP/dump_yaml.cpp new file mode 100644 index 0000000000..d6bf27885d --- /dev/null +++ b/src/EXTRA-DUMP/dump_yaml.cpp @@ -0,0 +1,143 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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 "dump_yaml.h" + +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "output.h" +#include "thermo.h" +#include "update.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ +DumpYAML::DumpYAML(class LAMMPS *_lmp, int narg, char **args) : + DumpCustom(_lmp, narg, args), thermo(false) +{ + buffer_allow = 0; + buffer_flag = 0; +} + +/* ---------------------------------------------------------------------- */ + +void DumpYAML::init_style() +{ + if (binary) error->all(FLERR, "Dump style yaml does not support binary output"); + if (multiproc) error->all(FLERR, "Dump style yaml does not support multi-processor output"); + + DumpCustom::init_style(); +} + +/* ---------------------------------------------------------------------- */ + +void DumpYAML::write() +{ + // temporarily enable so write_header() is called + // by all MPI ranks to compute thermo data + if (thermo) filewriter = 1; + + Dump::write(); +} + +/* ---------------------------------------------------------------------- */ + +void DumpYAML::write_header(bigint ndump) +{ + std::string thermo_data; + if (thermo) { + Thermo *th = output->thermo; + thermo_data += "thermo:\n - keywords: [ "; + for (int i = 0; i < th->nfield; ++i) thermo_data += fmt::format("{}, ", th->keyword[i]); + thermo_data += "]\n - data: [ "; + + for (int i = 0; i < th->nfield; ++i) { + th->call_vfunc(i); + if (th->vtype[i] == Thermo::FLOAT) + thermo_data += fmt::format("{}, ", th->dvalue); + else if (th->vtype[i] == Thermo::INT) + thermo_data += fmt::format("{}, ", th->ivalue); + else if (th->vtype[i] == Thermo::BIGINT) + thermo_data += fmt::format("{}, ", th->bivalue); + } + thermo_data += "]\n"; + MPI_Barrier(world); + } + + if (comm->me == 0) { + const std::string boundary(boundstr); + fmt::print(fp, "---\ntimestep: {}\n", update->ntimestep); + if (unit_flag) fmt::print(fp, "units: {}\n", update->unit_style); + if (time_flag) fmt::print(fp, "time: {:.16g}\n", compute_time()); + + fmt::print(fp, "natoms: {}\n", ndump); + fputs("boundary: [ ", fp); + for (const auto bflag : boundary) { + if (bflag == ' ') continue; + fmt::print(fp, "{}, ", bflag); + } + fputs("]\n", fp); + + if (thermo) fmt::print(fp, thermo_data); + + fmt::print(fp, "box:\n - [ {}, {} ]\n", boxxlo, boxxhi); + fmt::print(fp, " - [ {}, {} ]\n", boxylo, boxyhi); + fmt::print(fp, " - [ {}, {} ]\n", boxzlo, boxzhi); + if (domain->triclinic) fmt::print(fp, " - [ {}, {}, {} ]\n", boxxy, boxxz, boxyz); + + fmt::print(fp, "keywords: [ "); + for (const auto &item : utils::split_words(columns)) fmt::print(fp, "{}, ", item); + fputs(" ]\ndata:\n", fp); + } else // reset so that the remainder of the output is not multi-proc + filewriter = 0; +} + +/* ---------------------------------------------------------------------- */ + +void DumpYAML::write_data(int n, double *mybuf) +{ + int m = 0; + for (int i = 0; i < n; i++) { + fputs(" - [ ", fp); + for (int j = 0; j < nfield; j++) { + if (vtype[j] == Dump::INT) + fprintf(fp, vformat[j], static_cast(mybuf[m])); + else if (vtype[j] == Dump::DOUBLE) + fprintf(fp, vformat[j], mybuf[m]); + else if (vtype[j] == Dump::STRING) + fprintf(fp, vformat[j], typenames[(int) mybuf[m]]); + else if (vtype[j] == Dump::BIGINT) + fprintf(fp, vformat[j], static_cast(mybuf[m])); + m++; + fputs(", ", fp); + } + fputs("]\n", fp); + } + fputs("...\n", fp); +} + +/* ---------------------------------------------------------------------- */ + +int DumpYAML::modify_param(int narg, char **arg) +{ + int n = DumpCustom::modify_param(narg, arg); + if (n > 0) return n; + + if (strcmp(arg[0], "thermo") == 0) { + if (narg < 2) error->all(FLERR, "expected 'yes' or 'no' after 'thermo' keyword."); + thermo = utils::logical(FLERR, arg[1], false, lmp) == 1; + return 2; + } else + return 0; +} diff --git a/src/EXTRA-DUMP/dump_yaml.h b/src/EXTRA-DUMP/dump_yaml.h new file mode 100644 index 0000000000..e9717ea0b3 --- /dev/null +++ b/src/EXTRA-DUMP/dump_yaml.h @@ -0,0 +1,89 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef DUMP_CLASS +// clang-format off +DumpStyle(yaml,DumpYAML); +// clang-format on +#else + +#ifndef LMP_DUMP_YAML_H +#define LMP_DUMP_YAML_H + +#include "dump_custom.h" + +namespace LAMMPS_NS { + +class DumpYAML : public DumpCustom { + public: + DumpYAML(class LAMMPS *, int, char **); + +protected: + bool thermo; + + void init_style() override; + void write() override; + void write_header(bigint) override; + void write_data(int, double *) override; + + int modify_param(int, char **) override; +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Cannot open dump file %s + +The output file for the dump command cannot be opened. Check that the +path and name are correct. + +E: Too much per-proc info for dump + +Number of local atoms times number of columns must fit in a 32-bit +integer for dump. + +E: Dump_modify format line is too short + +UNDOCUMENTED + +E: Could not find dump custom compute ID + +Self-explanatory. + +E: Could not find dump custom fix ID + +Self-explanatory. + +E: Dump custom and fix not computed at compatible times + +The fix must produce per-atom quantities on timesteps that dump custom +needs them. + +E: Could not find dump custom variable name + +Self-explanatory. + +E: Region ID for dump custom does not exist + +Self-explanatory. + +U: Dump_modify format string is too short + +There are more fields to be dumped in a line of output than your +format string specifies. + +*/ diff --git a/src/EXTRA-FIX/fix_addtorque.cpp b/src/EXTRA-FIX/fix_addtorque.cpp index 7c8e832673..eb95db52b0 100644 --- a/src/EXTRA-FIX/fix_addtorque.cpp +++ b/src/EXTRA-FIX/fix_addtorque.cpp @@ -130,7 +130,7 @@ void FixAddTorque::init() else varflag = CONSTANT; if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -142,9 +142,9 @@ void FixAddTorque::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/EXTRA-FIX/fix_ave_correlate_long.cpp b/src/EXTRA-FIX/fix_ave_correlate_long.cpp index 5dc3f01aad..3987449279 100644 --- a/src/EXTRA-FIX/fix_ave_correlate_long.cpp +++ b/src/EXTRA-FIX/fix_ave_correlate_long.cpp @@ -188,14 +188,11 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): if (icompute < 0) error->all(FLERR,"Compute ID for fix ave/correlate/long does not exist"); if (argindex[i] == 0 && modify->compute[icompute]->scalar_flag == 0) - error->all(FLERR, - "Fix ave/correlate/long compute does not calculate a scalar"); + error->all(FLERR,"Fix ave/correlate/long compute does not calculate a scalar"); if (argindex[i] && modify->compute[icompute]->vector_flag == 0) - error->all(FLERR, - "Fix ave/correlate/long compute does not calculate a vector"); + error->all(FLERR,"Fix ave/correlate/long compute does not calculate a vector"); if (argindex[i] && argindex[i] > modify->compute[icompute]->size_vector) - error->all(FLERR,"Fix ave/correlate/long compute vector " - "is accessed out-of-range"); + error->all(FLERR,"Fix ave/correlate/long compute vector is accessed out-of-range"); } else if (which[i] == ArgInfo::FIX) { int ifix = modify->find_fix(ids[i]); @@ -206,19 +203,16 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): if (argindex[i] && modify->fix[ifix]->vector_flag == 0) error->all(FLERR,"Fix ave/correlate/long fix does not calculate a vector"); if (argindex[i] && argindex[i] > modify->fix[ifix]->size_vector) - error->all(FLERR, - "Fix ave/correlate/long fix vector is accessed out-of-range"); + error->all(FLERR,"Fix ave/correlate/long fix vector is accessed out-of-range"); if (nevery % modify->fix[ifix]->global_freq) - error->all(FLERR,"Fix for fix ave/correlate/long " - "not computed at compatible time"); + error->all(FLERR,"Fix for fix ave/correlate/long not computed at compatible time"); } else if (which[i] == ArgInfo::VARIABLE) { int ivariable = input->variable->find(ids[i]); if (ivariable < 0) error->all(FLERR,"Variable name for fix ave/correlate/long does not exist"); if (input->variable->equalstyle(ivariable) == 0) - error->all(FLERR, - "Fix ave/correlate/long variable is not equal-style variable"); + error->all(FLERR,"Fix ave/correlate/long variable is not equal-style variable"); } } @@ -434,7 +428,7 @@ void FixAveCorrelateLong::end_of_step() scalar = compute->vector[argindex[i]-1]; } - // access fix fields, guaranteed to be ready + // access fix fields, guaranteed to be ready } else if (which[i] == ArgInfo::FIX) { if (argindex[i] == 0) @@ -442,7 +436,7 @@ void FixAveCorrelateLong::end_of_step() else scalar = modify->fix[m]->compute_vector(argindex[i]-1); - // evaluate equal-style variable + // evaluate equal-style variable } else if (which[i] == ArgInfo::VARIABLE) scalar = input->variable->compute_equal(m); @@ -465,13 +459,13 @@ void FixAveCorrelateLong::end_of_step() if (fp && me == 0) { if (overwrite) platform::fseek(fp,filepos); - fprintf(fp,"# Timestep: " BIGINT_FORMAT "\n", ntimestep); + fmt::print(fp,"# Timestep: {}\n", ntimestep); for (unsigned int i=0;idt*nevery); for (int j=0;j (list[n++]); int numcorrelatorsin = static_cast (list[n++]); int pin = static_cast (list[n++]); diff --git a/src/EXTRA-FIX/fix_drag.cpp b/src/EXTRA-FIX/fix_drag.cpp index 69aa104d52..48977a0cd1 100644 --- a/src/EXTRA-FIX/fix_drag.cpp +++ b/src/EXTRA-FIX/fix_drag.cpp @@ -71,7 +71,7 @@ int FixDrag::setmask() void FixDrag::init() { if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -83,9 +83,9 @@ void FixDrag::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/EXTRA-FIX/fix_electron_stopping_fit.cpp b/src/EXTRA-FIX/fix_electron_stopping_fit.cpp index 35ead3397c..0e0ccc0ebb 100644 --- a/src/EXTRA-FIX/fix_electron_stopping_fit.cpp +++ b/src/EXTRA-FIX/fix_electron_stopping_fit.cpp @@ -139,9 +139,9 @@ void FixElectronStoppingFit::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); }; }; diff --git a/src/EXTRA-FIX/fix_ffl.cpp b/src/EXTRA-FIX/fix_ffl.cpp index 9cc9d4e179..6e08ae6c79 100644 --- a/src/EXTRA-FIX/fix_ffl.cpp +++ b/src/EXTRA-FIX/fix_ffl.cpp @@ -158,8 +158,8 @@ void FixFFL::init() { } if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = ((Respa *) update->integrate)->nlevels; - step_respa = ((Respa *) update->integrate)->step; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + step_respa = (dynamic_cast( update->integrate))->step; } init_ffl(); @@ -182,9 +182,9 @@ void FixFFL::setup(int vflag) { if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/EXTRA-FIX/fix_filter_corotate.cpp b/src/EXTRA-FIX/fix_filter_corotate.cpp index 70dae45042..e2bd982617 100644 --- a/src/EXTRA-FIX/fix_filter_corotate.cpp +++ b/src/EXTRA-FIX/fix_filter_corotate.cpp @@ -19,25 +19,25 @@ #include "fix_filter_corotate.h" +#include "angle.h" +#include "atom.h" +#include "atom_vec.h" +#include "bond.h" +#include "citeme.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "math_const.h" +#include "memory.h" +#include "modify.h" +#include "respa.h" +#include "update.h" + #include #include #include -#include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "domain.h" -#include "angle.h" -#include "bond.h" -#include "math_const.h" -#include "update.h" -#include "modify.h" -#include "memory.h" -#include "error.h" -#include "force.h" -#include "respa.h" -#include "citeme.h" - using namespace LAMMPS_NS; using namespace MathConst; using namespace FixConst; @@ -279,7 +279,7 @@ void FixFilterCorotate::init() // set ptrs to rRESPA variables if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } else error->all(FLERR,"Fix filter/corotate requires rRESPA!"); @@ -359,64 +359,42 @@ void FixFilterCorotate::pre_neighbor() if (shake_flag[i] == 2) { atom1 = atom->map(shake_atom[i][0]); atom2 = atom->map(shake_atom[i][1]); - if (atom1 == -1 || atom2 == -1) { - char str[128]; - sprintf(str,"Cluster atoms " TAGINT_FORMAT " " TAGINT_FORMAT - " missing on proc %d at step " BIGINT_FORMAT, - shake_atom[i][0],shake_atom[i][1],me,update->ntimestep); - error->one(FLERR,str); - } + if (atom1 == -1 || atom2 == -1) + error->one(FLERR,"Cluster atoms {} {} missing on proc {} at step {}", + shake_atom[i][0],shake_atom[i][1],me,update->ntimestep); if (i <= atom1 && i <= atom2) list[nlist++] = i; + } else if (shake_flag[i] == 1 || shake_flag[i] == 3) { atom1 = atom->map(shake_atom[i][0]); atom2 = atom->map(shake_atom[i][1]); atom3 = atom->map(shake_atom[i][2]); - if (atom1 == -1 || atom2 == -1 || atom3 == -1) { - char str[128]; - sprintf(str,"Cluster atoms " - TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT - " missing on proc %d at step " BIGINT_FORMAT, - shake_atom[i][0],shake_atom[i][1],shake_atom[i][2], - me,update->ntimestep); - error->one(FLERR,str); - } + if (atom1 == -1 || atom2 == -1 || atom3 == -1) + error->one(FLERR,"Cluster atoms {} {} {} missing on proc {} at step {}", + shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],me,update->ntimestep); if (i <= atom1 && i <= atom2 && i <= atom3) list[nlist++] = i; + } else if (shake_flag[i] == 4) { atom1 = atom->map(shake_atom[i][0]); atom2 = atom->map(shake_atom[i][1]); atom3 = atom->map(shake_atom[i][2]); atom4 = atom->map(shake_atom[i][3]); - if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) { - char str[128]; - sprintf(str,"Cluster atoms " - TAGINT_FORMAT " " TAGINT_FORMAT " " - TAGINT_FORMAT " " TAGINT_FORMAT - " missing on proc %d at step " BIGINT_FORMAT, - shake_atom[i][0],shake_atom[i][1], - shake_atom[i][2],shake_atom[i][3], - me,update->ntimestep); - error->one(FLERR,str); - } + if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) + error->one(FLERR,"Cluster atoms {} {} {} {} missing on proc {} at step {}", + shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],shake_atom[i][3], + me,update->ntimestep); if (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4) list[nlist++] = i; + } else if (shake_flag[i] == 5) { atom1 = atom->map(shake_atom[i][0]); atom2 = atom->map(shake_atom[i][1]); atom3 = atom->map(shake_atom[i][2]); atom4 = atom->map(shake_atom[i][3]); atom5 = atom->map(shake_atom[i][4]); - if (atom1 == -1 || atom2 == -1 || atom3 == -1 || - atom4 == -1 || atom5 == -1) { - char str[128]; - sprintf(str,"Cluster atoms " - TAGINT_FORMAT " " TAGINT_FORMAT " " - TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT - " missing on proc %d at step " BIGINT_FORMAT, - shake_atom[i][0],shake_atom[i][1], - shake_atom[i][2],shake_atom[i][3],shake_atom[i][4], - me,update->ntimestep); - error->one(FLERR,str); - } + if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1 || atom5 == -1) + error->one(FLERR,"Cluster atoms {} {} {} {} {} missing on proc {} at step {}", + shake_atom[i][0],shake_atom[i][1], shake_atom[i][2],shake_atom[i][3], + shake_atom[i][4],me,update->ntimestep); if (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4 && i <= atom5) list[nlist++] = i; } @@ -432,244 +410,244 @@ void FixFilterCorotate::pre_neighbor() int *type = atom->type; for (int i=0; imap(shake_atom[m][0]), - shake_atom[m][1],shake_atom[m][2],0); + m = list[i]; + N = shake_flag[m]; + + //switch cluster type 3 to angle cluster: + if (N == 3) + { + //make it an angle cluster: + if (shake_type[m][2] == 0) + shake_type[m][2] = angletype_findset(atom->map(shake_atom[m][0]), + shake_atom[m][1],shake_atom[m][2],0); + } + + if (N == 1) N = 3; //angle cluster + + if (N == 2) //cluster of size 2: + { + atom1 = atom->map(shake_atom[m][0]); + atom2 = atom->map(shake_atom[m][1]); + + r0 = bond_distance[shake_type[m][0]]; + + m1 = mass[type[atom1]]; + m2 = mass[type[atom2]]; + m_all = m1 + m2; + + double a1 = -m2/(m1+m2)*r0; + double a2 = m1/(m1+m2)*r0; + + clist_q0[i][0] = a1; + clist_q0[i][1] = 0; + clist_q0[i][2] = 0; + + clist_q0[i][3] = a2; + clist_q0[i][4] = 0; + clist_q0[i][5] = 0; + + clist_nselect1[i] = 1; + clist_select1[i][0] = 1; + + clist_nselect2[i] = 0; + clist_select2[i][0] = 0; + } else if (N == 3) //angle cluster + { + oxy = atom->map(shake_atom[m][0]); + atom1 = atom->map(shake_atom[m][1]); + atom2 = atom->map(shake_atom[m][2]); + + r0 = bond_distance[shake_type[m][0]]; + r1 = bond_distance[shake_type[m][1]]; + + + theta0 = angle_distance[shake_type[m][2]]; + + m1 = mass[type[oxy]]; + m2 = mass[type[atom1]]; + m3 = mass[type[atom2]]; + m_all = m1 + m2 + m3; + + double alpha1 = 0.5*(MY_PI - theta0); + + double xcenter = m2/m_all*r0*sin(alpha1) + m3/m_all*r1*sin(alpha1); + double ycenter = -m2/m_all*r0*cos(alpha1)+ m3/m_all*r1*cos(alpha1); + + double q1 = -xcenter; + double q2 = -ycenter; + + double q4 = r0*sin(alpha1)-xcenter; + double q5 = r0*cos(alpha1)-ycenter; + + double q7 = r1*sin(alpha1)-xcenter; + double q8 = -r1*cos(alpha1)-ycenter; + + clist_q0[i][0] = q1; + clist_q0[i][1] = q2; + clist_q0[i][2] = 0; + + clist_q0[i][3] = q4; + clist_q0[i][4] = q5; + clist_q0[i][5] = 0; + + clist_q0[i][6] = q7; + clist_q0[i][7] = q8; + clist_q0[i][8] = 0; + + clist_nselect1[i] = 2; + clist_select1[i][0] = 1; clist_select1[i][1] = 2; + clist_nselect2[i] = 1; + clist_select2[i][0] = 1; + } else if (N == 4) + { + oxy = atom->map(shake_atom[m][0]); + atom1 = atom->map(shake_atom[m][1]); + atom2 = atom->map(shake_atom[m][2]); + atom3 = atom->map(shake_atom[m][3]); + + r0 = bond_distance[shake_type[m][0]]; + r1 = bond_distance[shake_type[m][1]]; + r2 = bond_distance[shake_type[m][2]]; + + m1 = atom->mass[atom->type[oxy]]; + m2 = atom->mass[atom->type[atom1]]; + m3 = atom->mass[atom->type[atom2]]; + m4 = atom->mass[atom->type[atom3]]; + m_all = m1 + m2 + m3 + m4; + + //how to get these angles? + double alpha1 = MY_PI/2.57; //roughly 70 degrees + double alpha2 = MY_PI/3; + //ENSURE ycenter,zcenter = 0! + //approximate xcenter, if r0 !=r1 != r2, exact if r0 = r1 = r2 + double xcenter = (m2*r0+m3*r1+m4*r2)/m_all*cos(alpha1); + + clist_q0[i][0] = -xcenter; + clist_q0[i][1] = 0.0; + clist_q0[i][2] = 0.0; + clist_q0[i][3] = r0*cos(alpha1)-xcenter; + clist_q0[i][4] = -r0*sin(alpha1); + clist_q0[i][5] = 0.0; + clist_q0[i][6] = r1*cos(alpha1)-xcenter; + clist_q0[i][7] = r1*sin(alpha1)*cos(alpha2); + clist_q0[i][8] = -r1*sin(alpha1)*sin(alpha2); + clist_q0[i][9] = r2*cos(alpha1)-xcenter; + clist_q0[i][10] = r2*sin(alpha1)*cos(alpha2); + clist_q0[i][11] = r2*sin(alpha1)*sin(alpha2); + + clist_nselect1[i] = 3; + clist_nselect2[i] = 2; + + clist_select1[i][0] = 1;clist_select1[i][1] = 2;clist_select1[i][2] = 3; + clist_select2[i][0] = 2;clist_select2[i][1] = 3; + + //signum ensures correct ordering of three satellites + //signum = sign(cross(x2-x1,x3-x1))T*(x1-x0)) + double del1[3], del2[3], del3[3]; + del1[0] = x[atom1][0]-x[oxy][0]; + del1[1] = x[atom1][1]-x[oxy][1]; + del1[2] = x[atom1][2]-x[oxy][2]; + domain->minimum_image(del1); + + del2[0] = x[atom2][0]-x[atom1][0]; + del2[1] = x[atom2][1]-x[atom1][1]; + del2[2] = x[atom2][2]-x[atom1][2]; + domain->minimum_image(del2); + + del3[0] = x[atom3][0]-x[atom1][0]; + del3[1] = x[atom3][1]-x[atom1][1]; + del3[2] = x[atom3][2]-x[atom1][2]; + domain->minimum_image(del3); + + double a = (del2[1])*(del3[2]) - (del2[2])*(del3[1]); + double b = (del2[2])*(del3[0]) - (del2[0])*(del3[2]); + double c = (del2[0])*(del3[1]) - (del2[1])*(del3[0]); + int signum = sgn(a*(del1[0]) + b*(del1[1]) + c*(del1[2])); + + if (abs(signum) != 1) + error->all(FLERR,"Wrong orientation in cluster of size 4" + "in fix filter/corotate!"); + clist_q0[i][8] *= signum; + clist_q0[i][11] *= signum; + + } else if (N == 5) { + oxy = atom->map(shake_atom[m][0]); + atom1 = atom->map(shake_atom[m][1]); + atom2 = atom->map(shake_atom[m][2]); + atom3 = atom->map(shake_atom[m][3]); + int c1 = atom->map(shake_atom[m][4]); + + r1 = bond_distance[shake_type[m][3]]; + r0 = bond_distance[shake_type[m][0]]; + theta0 = angle_distance[shake_type[m][2]]; + + m1 = atom->mass[atom->type[oxy]]; + m2 = atom->mass[atom->type[atom1]]; + m3 = atom->mass[atom->type[atom2]]; + m4 = atom->mass[atom->type[atom3]]; + m5 = atom->mass[atom->type[c1]]; + m_all = m1 + m2 + m3 + m4 + m5; + + double alpha1 = MY_PI/2.57; //roughly 70 degrees + double alpha2 = MY_PI/3; + //ENSURE ycenter,zcenter = 0! + double xcenter = -(m2+m3+m4)/m_all*r0*cos(alpha1) +r1*m5/m_all; + + clist_q0[i][0] = -xcenter; + clist_q0[i][1] = 0.0; + clist_q0[i][2] = 0.0; + clist_q0[i][3] = -r0*cos(alpha1)-xcenter; + clist_q0[i][4] = -r0*sin(alpha1); + clist_q0[i][5] = 0.0; + clist_q0[i][6] = -r0*cos(alpha1)-xcenter; + clist_q0[i][7] = r0*sin(alpha1)*cos(alpha2); + clist_q0[i][8] = r0*sin(alpha1)*sin(alpha2); + clist_q0[i][9] = -r0*cos(alpha1)-xcenter; + clist_q0[i][10] = r0*sin(alpha1)*cos(alpha2); + clist_q0[i][11] = -r0*sin(alpha1)*sin(alpha2); + clist_q0[i][12] = r1-xcenter; + clist_q0[i][13] = 0.0; + clist_q0[i][14] = 0.0; + clist_nselect1[i] = 1; + clist_nselect2[i] = 2; + + clist_select1[i][0] = 4; + clist_select2[i][0] = 2;clist_select2[i][1] = 3; + + //signum ensures correct ordering of three satellites + //signum = sign(cross(x2-x1,x3-x1))T*(x1-x0)) + double del1[3], del2[3], del3[3]; + del1[0] = x[atom1][0]-x[oxy][0]; + del1[1] = x[atom1][1]-x[oxy][1]; + del1[2] = x[atom1][2]-x[oxy][2]; + domain->minimum_image(del1); + + del2[0] = x[atom2][0]-x[atom1][0]; + del2[1] = x[atom2][1]-x[atom1][1]; + del2[2] = x[atom2][2]-x[atom1][2]; + domain->minimum_image(del2); + + del3[0] = x[atom3][0]-x[atom1][0]; + del3[1] = x[atom3][1]-x[atom1][1]; + del3[2] = x[atom3][2]-x[atom1][2]; + domain->minimum_image(del3); + + double a = (del2[1])*(del3[2]) - (del2[2])*(del3[1]); + double b = (del2[2])*(del3[0]) - (del2[0])*(del3[2]); + double c = (del2[0])*(del3[1]) - (del2[1])*(del3[0]); + int signum = sgn(a*(del1[0]) + b*(del1[1]) + c*(del1[2])); + + if (abs(signum)!= 1) + error->all(FLERR,"Wrong orientation in cluster of size 5" + "in fix filter/corotate!"); + clist_q0[i][8] *= signum; + clist_q0[i][11] *= signum; + } else { + error->all(FLERR,"Fix filter/corotate cluster with size > 5" + "not yet configured..."); + } } - - if (N == 1) N = 3; //angle cluster - - if (N == 2) //cluster of size 2: - { - atom1 = atom->map(shake_atom[m][0]); - atom2 = atom->map(shake_atom[m][1]); - - r0 = bond_distance[shake_type[m][0]]; - - m1 = mass[type[atom1]]; - m2 = mass[type[atom2]]; - m_all = m1 + m2; - - double a1 = -m2/(m1+m2)*r0; - double a2 = m1/(m1+m2)*r0; - - clist_q0[i][0] = a1; - clist_q0[i][1] = 0; - clist_q0[i][2] = 0; - - clist_q0[i][3] = a2; - clist_q0[i][4] = 0; - clist_q0[i][5] = 0; - - clist_nselect1[i] = 1; - clist_select1[i][0] = 1; - - clist_nselect2[i] = 0; - clist_select2[i][0] = 0; - } else if (N == 3) //angle cluster - { - oxy = atom->map(shake_atom[m][0]); - atom1 = atom->map(shake_atom[m][1]); - atom2 = atom->map(shake_atom[m][2]); - - r0 = bond_distance[shake_type[m][0]]; - r1 = bond_distance[shake_type[m][1]]; - - - theta0 = angle_distance[shake_type[m][2]]; - - m1 = mass[type[oxy]]; - m2 = mass[type[atom1]]; - m3 = mass[type[atom2]]; - m_all = m1 + m2 + m3; - - double alpha1 = 0.5*(MY_PI - theta0); - - double xcenter = m2/m_all*r0*sin(alpha1) + m3/m_all*r1*sin(alpha1); - double ycenter = -m2/m_all*r0*cos(alpha1)+ m3/m_all*r1*cos(alpha1); - - double q1 = -xcenter; - double q2 = -ycenter; - - double q4 = r0*sin(alpha1)-xcenter; - double q5 = r0*cos(alpha1)-ycenter; - - double q7 = r1*sin(alpha1)-xcenter; - double q8 = -r1*cos(alpha1)-ycenter; - - clist_q0[i][0] = q1; - clist_q0[i][1] = q2; - clist_q0[i][2] = 0; - - clist_q0[i][3] = q4; - clist_q0[i][4] = q5; - clist_q0[i][5] = 0; - - clist_q0[i][6] = q7; - clist_q0[i][7] = q8; - clist_q0[i][8] = 0; - - clist_nselect1[i] = 2; - clist_select1[i][0] = 1; clist_select1[i][1] = 2; - clist_nselect2[i] = 1; - clist_select2[i][0] = 1; - } else if (N == 4) - { - oxy = atom->map(shake_atom[m][0]); - atom1 = atom->map(shake_atom[m][1]); - atom2 = atom->map(shake_atom[m][2]); - atom3 = atom->map(shake_atom[m][3]); - - r0 = bond_distance[shake_type[m][0]]; - r1 = bond_distance[shake_type[m][1]]; - r2 = bond_distance[shake_type[m][2]]; - - m1 = atom->mass[atom->type[oxy]]; - m2 = atom->mass[atom->type[atom1]]; - m3 = atom->mass[atom->type[atom2]]; - m4 = atom->mass[atom->type[atom3]]; - m_all = m1 + m2 + m3 + m4; - - //how to get these angles? - double alpha1 = MY_PI/2.57; //roughly 70 degrees - double alpha2 = MY_PI/3; - //ENSURE ycenter,zcenter = 0! - //approximate xcenter, if r0 !=r1 != r2, exact if r0 = r1 = r2 - double xcenter = (m2*r0+m3*r1+m4*r2)/m_all*cos(alpha1); - - clist_q0[i][0] = -xcenter; - clist_q0[i][1] = 0.0; - clist_q0[i][2] = 0.0; - clist_q0[i][3] = r0*cos(alpha1)-xcenter; - clist_q0[i][4] = -r0*sin(alpha1); - clist_q0[i][5] = 0.0; - clist_q0[i][6] = r1*cos(alpha1)-xcenter; - clist_q0[i][7] = r1*sin(alpha1)*cos(alpha2); - clist_q0[i][8] = -r1*sin(alpha1)*sin(alpha2); - clist_q0[i][9] = r2*cos(alpha1)-xcenter; - clist_q0[i][10] = r2*sin(alpha1)*cos(alpha2); - clist_q0[i][11] = r2*sin(alpha1)*sin(alpha2); - - clist_nselect1[i] = 3; - clist_nselect2[i] = 2; - - clist_select1[i][0] = 1;clist_select1[i][1] = 2;clist_select1[i][2] = 3; - clist_select2[i][0] = 2;clist_select2[i][1] = 3; - - //signum ensures correct ordering of three satellites - //signum = sign(cross(x2-x1,x3-x1))T*(x1-x0)) - double del1[3], del2[3], del3[3]; - del1[0] = x[atom1][0]-x[oxy][0]; - del1[1] = x[atom1][1]-x[oxy][1]; - del1[2] = x[atom1][2]-x[oxy][2]; - domain->minimum_image(del1); - - del2[0] = x[atom2][0]-x[atom1][0]; - del2[1] = x[atom2][1]-x[atom1][1]; - del2[2] = x[atom2][2]-x[atom1][2]; - domain->minimum_image(del2); - - del3[0] = x[atom3][0]-x[atom1][0]; - del3[1] = x[atom3][1]-x[atom1][1]; - del3[2] = x[atom3][2]-x[atom1][2]; - domain->minimum_image(del3); - - double a = (del2[1])*(del3[2]) - (del2[2])*(del3[1]); - double b = (del2[2])*(del3[0]) - (del2[0])*(del3[2]); - double c = (del2[0])*(del3[1]) - (del2[1])*(del3[0]); - int signum = sgn(a*(del1[0]) + b*(del1[1]) + c*(del1[2])); - - if (abs(signum) != 1) - error->all(FLERR,"Wrong orientation in cluster of size 4" - "in fix filter/corotate!"); - clist_q0[i][8] *= signum; - clist_q0[i][11] *= signum; - - } else if (N == 5) { - oxy = atom->map(shake_atom[m][0]); - atom1 = atom->map(shake_atom[m][1]); - atom2 = atom->map(shake_atom[m][2]); - atom3 = atom->map(shake_atom[m][3]); - int c1 = atom->map(shake_atom[m][4]); - - r1 = bond_distance[shake_type[m][3]]; - r0 = bond_distance[shake_type[m][0]]; - theta0 = angle_distance[shake_type[m][2]]; - - m1 = atom->mass[atom->type[oxy]]; - m2 = atom->mass[atom->type[atom1]]; - m3 = atom->mass[atom->type[atom2]]; - m4 = atom->mass[atom->type[atom3]]; - m5 = atom->mass[atom->type[c1]]; - m_all = m1 + m2 + m3 + m4 + m5; - - double alpha1 = MY_PI/2.57; //roughly 70 degrees - double alpha2 = MY_PI/3; - //ENSURE ycenter,zcenter = 0! - double xcenter = -(m2+m3+m4)/m_all*r0*cos(alpha1) +r1*m5/m_all; - - clist_q0[i][0] = -xcenter; - clist_q0[i][1] = 0.0; - clist_q0[i][2] = 0.0; - clist_q0[i][3] = -r0*cos(alpha1)-xcenter; - clist_q0[i][4] = -r0*sin(alpha1); - clist_q0[i][5] = 0.0; - clist_q0[i][6] = -r0*cos(alpha1)-xcenter; - clist_q0[i][7] = r0*sin(alpha1)*cos(alpha2); - clist_q0[i][8] = r0*sin(alpha1)*sin(alpha2); - clist_q0[i][9] = -r0*cos(alpha1)-xcenter; - clist_q0[i][10] = r0*sin(alpha1)*cos(alpha2); - clist_q0[i][11] = -r0*sin(alpha1)*sin(alpha2); - clist_q0[i][12] = r1-xcenter; - clist_q0[i][13] = 0.0; - clist_q0[i][14] = 0.0; - clist_nselect1[i] = 1; - clist_nselect2[i] = 2; - - clist_select1[i][0] = 4; - clist_select2[i][0] = 2;clist_select2[i][1] = 3; - - //signum ensures correct ordering of three satellites - //signum = sign(cross(x2-x1,x3-x1))T*(x1-x0)) - double del1[3], del2[3], del3[3]; - del1[0] = x[atom1][0]-x[oxy][0]; - del1[1] = x[atom1][1]-x[oxy][1]; - del1[2] = x[atom1][2]-x[oxy][2]; - domain->minimum_image(del1); - - del2[0] = x[atom2][0]-x[atom1][0]; - del2[1] = x[atom2][1]-x[atom1][1]; - del2[2] = x[atom2][2]-x[atom1][2]; - domain->minimum_image(del2); - - del3[0] = x[atom3][0]-x[atom1][0]; - del3[1] = x[atom3][1]-x[atom1][1]; - del3[2] = x[atom3][2]-x[atom1][2]; - domain->minimum_image(del3); - - double a = (del2[1])*(del3[2]) - (del2[2])*(del3[1]); - double b = (del2[2])*(del3[0]) - (del2[0])*(del3[2]); - double c = (del2[0])*(del3[1]) - (del2[1])*(del3[0]); - int signum = sgn(a*(del1[0]) + b*(del1[1]) + c*(del1[2])); - - if (abs(signum)!= 1) - error->all(FLERR,"Wrong orientation in cluster of size 5" - "in fix filter/corotate!"); - clist_q0[i][8] *= signum; - clist_q0[i][11] *= signum; - } else { - error->all(FLERR,"Fix filter/corotate cluster with size > 5" - "not yet configured..."); - } - } } /* ---------------------------------------------------------------------- @@ -678,9 +656,9 @@ void FixFilterCorotate::pre_neighbor() void FixFilterCorotate::setup(int vflag) { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); } void FixFilterCorotate::setup_pre_force_respa(int vflag,int ilevel) { @@ -1297,7 +1275,7 @@ void FixFilterCorotate::find_clusters() void FixFilterCorotate::ring_bonds(int ndatum, char *cbuf, void *ptr) { - FixFilterCorotate *ffptr = (FixFilterCorotate *) ptr; + auto ffptr = (FixFilterCorotate *) ptr; Atom *atom = ffptr->atom; double *rmass = atom->rmass; double *mass = atom->mass; @@ -1306,7 +1284,7 @@ void FixFilterCorotate::ring_bonds(int ndatum, char *cbuf, void *ptr) int nlocal = atom->nlocal; int nmass = ffptr->nmass; - tagint *buf = (tagint *) cbuf; + auto buf = (tagint *) cbuf; int m,n; double massone; @@ -1335,13 +1313,13 @@ void FixFilterCorotate::ring_bonds(int ndatum, char *cbuf, void *ptr) void FixFilterCorotate::ring_nshake(int ndatum, char *cbuf, void *ptr) { - FixFilterCorotate *ffptr = (FixFilterCorotate *) ptr; + auto ffptr = (FixFilterCorotate *) ptr; Atom *atom = ffptr->atom; int nlocal = atom->nlocal; int *nshake = ffptr->nshake; - tagint *buf = (tagint *) cbuf; + auto buf = (tagint *) cbuf; int m; for (int i = 0; i < ndatum; i += 3) { @@ -1357,7 +1335,7 @@ void FixFilterCorotate::ring_nshake(int ndatum, char *cbuf, void *ptr) void FixFilterCorotate::ring_shake(int ndatum, char *cbuf, void *ptr) { - FixFilterCorotate *ffptr = (FixFilterCorotate *) ptr; + auto ffptr = (FixFilterCorotate *) ptr; Atom *atom = ffptr->atom; int nlocal = atom->nlocal; @@ -1365,7 +1343,7 @@ void FixFilterCorotate::ring_shake(int ndatum, char *cbuf, void *ptr) tagint **shake_atom = ffptr->shake_atom; int **shake_type = ffptr->shake_type; - tagint *buf = (tagint *) cbuf; + auto buf = (tagint *) cbuf; int m; for (int i = 0; i < ndatum; i += 11) { @@ -1421,9 +1399,9 @@ void FixFilterCorotate::general_cluster(int index, int index_in_list) int* list_cluster = new int[N]; // contains local IDs of cluster atoms, // 0 = center - double* m = new double[N]; //contains local mass - double *r = new double[N]; //contains r[i] = 1/||del[i]|| - double** del = new double*[N]; //contains del[i] = x_i-x_0 + auto m = new double[N]; //contains local mass + auto r = new double[N]; //contains r[i] = 1/||del[i]|| + auto del = new double*[N]; //contains del[i] = x_i-x_0 for (int i = 0; iintegrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -146,9 +146,9 @@ void FixFlowGauss::setup(int vflag) error->all(FLERR,"Invalid group mass in fix flow/gauss"); if (utils::strmatch(update->integrate_style,"^respa")) { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } else post_force(vflag); diff --git a/src/EXTRA-FIX/fix_gld.cpp b/src/EXTRA-FIX/fix_gld.cpp index 41585e4fd0..b183526d65 100644 --- a/src/EXTRA-FIX/fix_gld.cpp +++ b/src/EXTRA-FIX/fix_gld.cpp @@ -197,7 +197,7 @@ void FixGLD::init() dtf = 0.5 * update->dt * force->ftm2v; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = ((Respa *) update->integrate)->step; + step_respa = (dynamic_cast( update->integrate))->step; } /* ---------------------------------------------------------------------- diff --git a/src/EXTRA-FIX/fix_gle.cpp b/src/EXTRA-FIX/fix_gle.cpp index 0e19f6e58f..1d07b05d91 100644 --- a/src/EXTRA-FIX/fix_gle.cpp +++ b/src/EXTRA-FIX/fix_gle.cpp @@ -57,8 +57,8 @@ namespace GLE { //"stabilized" cholesky decomposition. does a LDL^t decomposition, then sets to zero the negative diagonal elements and gets MM^t void StabCholesky(int n, const double* MMt, double* M) { - double *L = new double[n*n]; - double *D = new double[n]; + auto L = new double[n*n]; + auto D = new double[n]; int i,j,k; for (i=0; iintegrate_style,"^respa")) { - nlevels_respa = ((Respa *) update->integrate)->nlevels; - step_respa = ((Respa *) update->integrate)->step; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + step_respa = (dynamic_cast( update->integrate))->step; } init_gle(); @@ -369,8 +369,8 @@ void FixGLE::init_gle() { // compute Langevin terms - double *tmp1 = new double[ns1sq]; - double *tmp2 = new double[ns1sq]; + auto tmp1 = new double[ns1sq]; + auto tmp2 = new double[ns1sq]; for (int i=0; idt*0.5*gle_every; @@ -406,10 +406,10 @@ void FixGLE::init_gles() int *mask = atom->mask; int nlocal = atom->nlocal; - double *rootC = new double[ns1sq]; - double *rootCT = new double[ns1sq]; - double *newg = new double[3*(ns+1)*nlocal]; - double *news = new double[3*(ns+1)*nlocal]; + auto rootC = new double[ns1sq]; + auto rootCT = new double[ns1sq]; + auto newg = new double[3*(ns+1)*nlocal]; + auto news = new double[3*(ns+1)*nlocal]; GLE::StabCholesky(ns+1, C, rootC); GLE::MyTrans(ns+1,rootC,rootCT); @@ -444,9 +444,9 @@ void FixGLE::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/EXTRA-FIX/fix_momentum_chunk.cpp b/src/EXTRA-FIX/fix_momentum_chunk.cpp index 06d2137d84..2734a4565b 100644 --- a/src/EXTRA-FIX/fix_momentum_chunk.cpp +++ b/src/EXTRA-FIX/fix_momentum_chunk.cpp @@ -110,7 +110,7 @@ void FixMomentumChunk::init() int icompute = modify->find_compute(id_chunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for fix momentum/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Fix momentum/chunk does not use chunk/atom compute"); @@ -122,7 +122,7 @@ void FixMomentumChunk::init() auto cmd = fmt::format("{} {} com/chunk {}",id_com,group->names[igroup],id_chunk); modify->add_compute(cmd); icompute = modify->find_compute(id_com); - ccom = (ComputeCOMChunk *) modify->compute[icompute]; + ccom = dynamic_cast( modify->compute[icompute]); id_vcm = id + id_chunk + "_vcm"; icompute = modify->find_compute(id_vcm); diff --git a/src/EXTRA-FIX/fix_npt_cauchy.cpp b/src/EXTRA-FIX/fix_npt_cauchy.cpp index d9a0f850db..4a1e11d963 100644 --- a/src/EXTRA-FIX/fix_npt_cauchy.cpp +++ b/src/EXTRA-FIX/fix_npt_cauchy.cpp @@ -681,7 +681,7 @@ void FixNPTCauchy::init() if (pstat_flag) for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = ((FixDeform *) modify->fix[i])->dimflag; + int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5])) @@ -754,8 +754,8 @@ void FixNPTCauchy::init() else kspace_flag = 0; if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = ((Respa *) update->integrate)->nlevels; - step_respa = ((Respa *) update->integrate)->step; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + step_respa = (dynamic_cast( update->integrate))->step; dto = 0.5*step_respa[0]; } @@ -1374,7 +1374,7 @@ int FixNPTCauchy::pack_restart_data(double *list) void FixNPTCauchy::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; int flag = static_cast (list[n++]); if (flag) { int m = static_cast (list[n++]); @@ -2466,7 +2466,7 @@ void FixNPTCauchy::CauchyStat_init() modify->add_fix(std::string(id_store) + " all STORE global 1 6"); restart_stored = modify->find_fix(id_store); } - init_store = (FixStore *)modify->fix[restart_stored]; + init_store = dynamic_cast(modify->fix[restart_stored]); initRUN = 0; initPK = 1; diff --git a/src/EXTRA-FIX/fix_numdiff.cpp b/src/EXTRA-FIX/fix_numdiff.cpp index 7265ec0b79..c092bd6375 100644 --- a/src/EXTRA-FIX/fix_numdiff.cpp +++ b/src/EXTRA-FIX/fix_numdiff.cpp @@ -122,7 +122,7 @@ void FixNumDiff::init() kspace_compute_flag = 0; if (utils::strmatch(update->integrate_style, "^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels - 1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels - 1; if (respa_level >= 0) ilevel_respa = MIN(respa_level, ilevel_respa); } } @@ -134,9 +134,9 @@ void FixNumDiff::setup(int vflag) if (utils::strmatch(update->integrate_style, "^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag, ilevel_respa, 0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/EXTRA-FIX/fix_numdiff_virial.cpp b/src/EXTRA-FIX/fix_numdiff_virial.cpp index a87be67c89..c34b3a8b1a 100644 --- a/src/EXTRA-FIX/fix_numdiff_virial.cpp +++ b/src/EXTRA-FIX/fix_numdiff_virial.cpp @@ -132,7 +132,7 @@ void FixNumDiffVirial::init() kspace_compute_flag = 0; if (utils::strmatch(update->integrate_style, "^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels - 1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels - 1; if (respa_level >= 0) ilevel_respa = MIN(respa_level, ilevel_respa); } } @@ -144,9 +144,9 @@ void FixNumDiffVirial::setup(int vflag) if (utils::strmatch(update->integrate_style, "^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag, ilevel_respa, 0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/EXTRA-FIX/fix_nvk.cpp b/src/EXTRA-FIX/fix_nvk.cpp index 1f4c76febc..168af71262 100644 --- a/src/EXTRA-FIX/fix_nvk.cpp +++ b/src/EXTRA-FIX/fix_nvk.cpp @@ -62,7 +62,7 @@ void FixNVK::init() if (utils::strmatch(update->integrate_style,"^respa")) { error->all(FLERR,"Fix nvk not yet enabled for RESPA"); - step_respa = ((Respa *) update->integrate)->step; + step_respa = (dynamic_cast( update->integrate))->step; } // compute initial kinetic energy diff --git a/src/EXTRA-FIX/fix_oneway.cpp b/src/EXTRA-FIX/fix_oneway.cpp index 5ebc535c43..465813ef57 100644 --- a/src/EXTRA-FIX/fix_oneway.cpp +++ b/src/EXTRA-FIX/fix_oneway.cpp @@ -65,7 +65,7 @@ FixOneWay::FixOneWay(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) FixOneWay::~FixOneWay() { - if (regionstr) delete[] regionstr; + delete[] regionstr; } /* ---------------------------------------------------------------------- */ diff --git a/src/EXTRA-FIX/fix_pafi.cpp b/src/EXTRA-FIX/fix_pafi.cpp index fbb6fb2971..d6ee4627c9 100644 --- a/src/EXTRA-FIX/fix_pafi.cpp +++ b/src/EXTRA-FIX/fix_pafi.cpp @@ -178,8 +178,8 @@ void FixPAFI::init() if (utils::strmatch(update->integrate_style,"^respa")) { - step_respa = ((Respa *) update->integrate)->step; // nve - nlevels_respa = ((Respa *) update->integrate)->nlevels; + step_respa = (dynamic_cast( update->integrate))->step; // nve + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; if (respa_level >= 0) ilevel_respa = MIN(respa_level,nlevels_respa-1); else ilevel_respa = nlevels_respa-1; } @@ -192,9 +192,9 @@ void FixPAFI::setup(int vflag) post_force(vflag); else for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - ((Respa *) update->integrate)->copy_flevel_f(ilevel); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); } } diff --git a/src/EXTRA-FIX/fix_rhok.cpp b/src/EXTRA-FIX/fix_rhok.cpp index 5c49878998..9bdf940a7b 100644 --- a/src/EXTRA-FIX/fix_rhok.cpp +++ b/src/EXTRA-FIX/fix_rhok.cpp @@ -96,7 +96,7 @@ void FixRhok::init() { // RESPA boilerplate if (utils::strmatch(update->integrate_style,"^respa")) - mNLevelsRESPA = ((Respa *) update->integrate)->nlevels; + mNLevelsRESPA = (dynamic_cast( update->integrate))->nlevels; // Count the number of affected particles int nThisLocal = 0; @@ -121,9 +121,9 @@ void FixRhok::setup( int inVFlag ) post_force( inVFlag ); else { - ((Respa *) update->integrate)->copy_flevel_f( mNLevelsRESPA - 1 ); + (dynamic_cast( update->integrate))->copy_flevel_f( mNLevelsRESPA - 1 ); post_force_respa( inVFlag, mNLevelsRESPA - 1,0 ); - ((Respa *) update->integrate)->copy_f_flevel( mNLevelsRESPA - 1 ); + (dynamic_cast( update->integrate))->copy_f_flevel( mNLevelsRESPA - 1 ); } } diff --git a/src/EXTRA-FIX/fix_smd.cpp b/src/EXTRA-FIX/fix_smd.cpp index 047f40c2a3..4a0a9f040f 100644 --- a/src/EXTRA-FIX/fix_smd.cpp +++ b/src/EXTRA-FIX/fix_smd.cpp @@ -161,7 +161,7 @@ void FixSMD::init() } if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -173,9 +173,9 @@ void FixSMD::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } @@ -194,7 +194,7 @@ void FixSMD::post_force(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) r_old += v_smd * update->dt; else - r_old += v_smd * ((Respa *) update->integrate)->step[ilevel_respa]; + r_old += v_smd * (dynamic_cast( update->integrate))->step[ilevel_respa]; } } @@ -207,7 +207,7 @@ void FixSMD::smd_tether() double dt = update->dt; if (utils::strmatch(update->integrate_style,"^respa")) - dt = ((Respa *) update->integrate)->step[ilevel_respa]; + dt = (dynamic_cast( update->integrate))->step[ilevel_respa]; // fx,fy,fz = components of k * (r-r0) @@ -313,7 +313,7 @@ void FixSMD::smd_couple() double dt = update->dt; if (utils::strmatch(update->integrate_style,"^respa")) - dt = ((Respa *) update->integrate)->step[ilevel_respa]; + dt = (dynamic_cast( update->integrate))->step[ilevel_respa]; // renormalize direction of spring double dx,dy,dz,r,dr; @@ -451,7 +451,7 @@ void FixSMD::write_restart(FILE *fp) void FixSMD::restart(char *buf) { - double *list = (double *)buf; + auto list = (double *)buf; r_old = list[0]; xn=list[1]; yn=list[2]; diff --git a/src/EXTRA-FIX/fix_spring_rg.cpp b/src/EXTRA-FIX/fix_spring_rg.cpp index a6bdbd3631..b955716923 100644 --- a/src/EXTRA-FIX/fix_spring_rg.cpp +++ b/src/EXTRA-FIX/fix_spring_rg.cpp @@ -79,7 +79,7 @@ void FixSpringRG::init() } if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -91,9 +91,9 @@ void FixSpringRG::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } @@ -175,7 +175,7 @@ void FixSpringRG::write_restart(FILE *fp) void FixSpringRG::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; rg0 = list[n++]; rg0_flag = 0; diff --git a/src/EXTRA-FIX/fix_temp_csld.cpp b/src/EXTRA-FIX/fix_temp_csld.cpp index f4da7a3c5b..e83eca424e 100644 --- a/src/EXTRA-FIX/fix_temp_csld.cpp +++ b/src/EXTRA-FIX/fix_temp_csld.cpp @@ -323,7 +323,7 @@ void FixTempCSLD::write_restart(FILE *fp) void FixTempCSLD::restart(char *buf) { - double *list = (double *) buf; + auto list = (double *) buf; energy = list[0]; int nprocs = (int) list[1]; diff --git a/src/EXTRA-FIX/fix_temp_csvr.cpp b/src/EXTRA-FIX/fix_temp_csvr.cpp index ca9e4b8684..0c4742018a 100644 --- a/src/EXTRA-FIX/fix_temp_csvr.cpp +++ b/src/EXTRA-FIX/fix_temp_csvr.cpp @@ -357,7 +357,7 @@ void FixTempCSVR::write_restart(FILE *fp) void FixTempCSVR::restart(char *buf) { - double *list = (double *) buf; + auto list = (double *) buf; energy = list[0]; int nprocs = (int) list[1]; diff --git a/src/EXTRA-FIX/fix_ti_spring.cpp b/src/EXTRA-FIX/fix_ti_spring.cpp index 231da9e8ee..b332c18148 100644 --- a/src/EXTRA-FIX/fix_ti_spring.cpp +++ b/src/EXTRA-FIX/fix_ti_spring.cpp @@ -143,7 +143,7 @@ int FixTISpring::setmask() void FixTISpring::init() { if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -153,9 +153,9 @@ void FixTISpring::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/EXTRA-FIX/fix_tmd.cpp b/src/EXTRA-FIX/fix_tmd.cpp index 4d85687e4d..1404682cda 100644 --- a/src/EXTRA-FIX/fix_tmd.cpp +++ b/src/EXTRA-FIX/fix_tmd.cpp @@ -27,6 +27,7 @@ #include "memory.h" #include "modify.h" #include "respa.h" +#include "tokenizer.h" #include "update.h" #include @@ -166,7 +167,7 @@ void FixTMD::init() dtv = update->dt; dtf = update->dt * force->ftm2v; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = ((Respa *) update->integrate)->step; + step_respa = (dynamic_cast( update->integrate))->step; } /* ---------------------------------------------------------------------- */ @@ -268,10 +269,8 @@ void FixTMD::initial_integrate(int /*vflag*/) work_lambda += lambda*(rho_target - rho_old); if (!(update->ntimestep % nfileevery) && (previous_stat != update->ntimestep)) { - fprintf(fp, - BIGINT_FORMAT " %g %g %g %g %g %g %g\n", - update->ntimestep,rho_target,rho_old, - gamma_back,gamma_forward,lambda,work_lambda,work_analytical); + fmt::print(fp, "{} {} {} {} {} {} {} {}\n", update->ntimestep,rho_target,rho_old, + gamma_back,gamma_forward,lambda,work_lambda,work_analytical); fflush(fp); previous_stat = update->ntimestep; } @@ -390,9 +389,9 @@ void FixTMD::readfile(char *file) int *mask = atom->mask; int nlocal = atom->nlocal; - char *buffer = new char[CHUNK*MAXLINE]; + auto buffer = new char[CHUNK*MAXLINE]; char *next,*bufptr; - int i,m,n,nlines,imageflag,ix,iy,iz; + int i,m,nlines,imageflag,ix,iy,iz; tagint itag; double x,y,z,xprd,yprd,zprd; @@ -422,53 +421,66 @@ void FixTMD::readfile(char *file) for (i = 0; i < nlines; i++) { next = strchr(bufptr,'\n'); *next = '\0'; - - if (firstline) { - if (utils::strmatch(bufptr,"^\\s*\\f+\\s+\\f+\\s+xlo\\s+xhi")) { - double lo,hi; - n = sscanf(bufptr,"%lg %lg",&lo,&hi); - if (n != 2) - error->all(FLERR,"Incorrect format in TMD target file"); - xprd = hi - lo; - bufptr = next + 1; - continue; - } else if (utils::strmatch(bufptr,"^\\s*\\f+\\s+\\f+\\s+ylo\\s+yhi")) { - double lo,hi; - n = sscanf(bufptr,"%lg %lg",&lo,&hi); - if (n != 2) - error->all(FLERR,"Incorrect format in TMD target file"); - yprd = hi - lo; - bufptr = next + 1; - continue; - } else if (utils::strmatch(bufptr,"^\\s*\\f+\\s+\\f+\\s+zlo\\s+zhi")) { - double lo,hi; - n = sscanf(bufptr,"%lg %lg",&lo,&hi); - if (n != 2) - error->all(FLERR,"Incorrect format in TMD target file"); - zprd = hi - lo; - bufptr = next + 1; - continue; - } else if (utils::trim_and_count_words(bufptr) == 4) { - if (xprd >= 0.0 || yprd >= 0.0 || zprd >= 0.0) - error->all(FLERR,"Incorrect format in TMD target file"); - imageflag = 0; - firstline = 0; - } else if (utils::trim_and_count_words(bufptr) == 7) { - if (xprd < 0.0 || yprd < 0.0 || zprd < 0.0) - error->all(FLERR,"Incorrect format in TMD target file"); - imageflag = 1; - firstline = 0; - } else error->all(FLERR,"Incorrect format in TMD target file"); + // trim comments and skip empty lines + char *comment = strchr(bufptr,'#'); + if (comment) *comment = '\0'; + if (!strlen(bufptr)) { + bufptr = next + 1; + continue; } - if (imageflag) - n = 7 - sscanf(bufptr,TAGINT_FORMAT " %lg %lg %lg %d %d %d", - &itag,&x,&y,&z,&ix,&iy,&iz); - else - n = 4 - sscanf(bufptr,TAGINT_FORMAT " %lg %lg %lg",&itag,&x,&y,&z); + if (firstline) { + try { + ValueTokenizer values(bufptr); - if (n != 0) { - error->all(FLERR,"Incorrectly formatted line in TMD target file"); + if (utils::strmatch(bufptr,"^\\s*\\f+\\s+\\f+\\s+xlo\\s+xhi")) { + auto lo = values.next_double(); + auto hi = values.next_double(); + xprd = hi - lo; + bufptr = next + 1; + continue; + } else if (utils::strmatch(bufptr,"^\\s*\\f+\\s+\\f+\\s+ylo\\s+yhi")) { + auto lo = values.next_double(); + auto hi = values.next_double(); + yprd = hi - lo; + bufptr = next + 1; + continue; + } else if (utils::strmatch(bufptr,"^\\s*\\f+\\s+\\f+\\s+zlo\\s+zhi")) { + auto lo = values.next_double(); + auto hi = values.next_double(); + zprd = hi - lo; + bufptr = next + 1; + continue; + } else if (utils::trim_and_count_words(bufptr) == 4) { + if (xprd >= 0.0 || yprd >= 0.0 || zprd >= 0.0) + throw TokenizerException("must use imageflags when providing box boundaries", bufptr); + imageflag = 0; + firstline = 0; + } else if (utils::trim_and_count_words(bufptr) == 7) { + if (xprd < 0.0 || yprd < 0.0 || zprd < 0.0) + throw TokenizerException("Invalid box boundaries",""); + imageflag = 1; + firstline = 0; + } else throw TokenizerException("unknown data", bufptr); + } + catch (std::exception &e) { + error->all(FLERR,"Incorrect format in TMD target file: {}", e.what()); + } + } + + try { + ValueTokenizer values(bufptr); + itag = values.next_tagint(); + x = values.next_double(); + y = values.next_double(); + z = values.next_double(); + if (imageflag) { + ix = values.next_int(); + iy = values.next_int(); + iz = values.next_int(); + } + } catch (std::exception &e) { + error->all(FLERR,"Incorrectly formatted line in TMD target file: {}", e.what()); bufptr = next + 1; continue; } diff --git a/src/EXTRA-FIX/fix_ttm.cpp b/src/EXTRA-FIX/fix_ttm.cpp index 752610fd08..9184983bdb 100644 --- a/src/EXTRA-FIX/fix_ttm.cpp +++ b/src/EXTRA-FIX/fix_ttm.cpp @@ -241,7 +241,7 @@ void FixTTM::init() } if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -251,9 +251,9 @@ void FixTTM::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) { post_force_setup(vflag); } else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa_setup(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); } } @@ -597,7 +597,7 @@ void FixTTM::write_restart(FILE *fp) void FixTTM::restart(char *buf) { int n = 0; - double *rlist = (double *) buf; + auto rlist = (double *) buf; // check that restart grid size is same as current grid size diff --git a/src/EXTRA-FIX/fix_ttm_grid.cpp b/src/EXTRA-FIX/fix_ttm_grid.cpp index 8890750818..4188025525 100644 --- a/src/EXTRA-FIX/fix_ttm_grid.cpp +++ b/src/EXTRA-FIX/fix_ttm_grid.cpp @@ -280,7 +280,7 @@ void FixTTMGrid::read_electron_temperatures(const std::string &filename) // read electron temperature values from file, one chunk at a time - char *buffer = new char[CHUNK * MAXLINE]; + auto buffer = new char[CHUNK * MAXLINE]; bigint ntotal = (bigint) nxgrid * nygrid * nzgrid; bigint nread = 0; @@ -372,7 +372,7 @@ void FixTTMGrid::write_electron_temperatures(const std::string &filename) void FixTTMGrid::pack_forward_grid(int /*flag*/, void *vbuf, int nlist, int *list) { - double *buf = (double *) vbuf; + auto buf = (double *) vbuf; double *src = &T_electron[nzlo_out][nylo_out][nxlo_out]; for (int i = 0; i < nlist; i++) buf[i] = src[list[i]]; @@ -384,7 +384,7 @@ void FixTTMGrid::pack_forward_grid(int /*flag*/, void *vbuf, int nlist, int *lis void FixTTMGrid::unpack_forward_grid(int /*flag*/, void *vbuf, int nlist, int *list) { - double *buf = (double *) vbuf; + auto buf = (double *) vbuf; double *dest = &T_electron[nzlo_out][nylo_out][nxlo_out]; for (int i = 0; i < nlist; i++) dest[list[i]] = buf[i]; @@ -396,7 +396,7 @@ void FixTTMGrid::unpack_forward_grid(int /*flag*/, void *vbuf, int nlist, int *l void FixTTMGrid::pack_reverse_grid(int /*flag*/, void *vbuf, int nlist, int *list) { - double *buf = (double *) vbuf; + auto buf = (double *) vbuf; double *src = &net_energy_transfer[nzlo_out][nylo_out][nxlo_out]; for (int i = 0; i < nlist; i++) buf[i] = src[list[i]]; @@ -408,7 +408,7 @@ void FixTTMGrid::pack_reverse_grid(int /*flag*/, void *vbuf, int nlist, int *lis void FixTTMGrid::unpack_reverse_grid(int /*flag*/, void *vbuf, int nlist, int *list) { - double *buf = (double *) vbuf; + auto buf = (double *) vbuf; double *dest = &net_energy_transfer[nzlo_out][nylo_out][nxlo_out]; for (int i = 0; i < nlist; i++) dest[list[i]] += buf[i]; @@ -535,7 +535,7 @@ void FixTTMGrid::restart(char *buf) int ix, iy, iz; int n = 0; - double *rlist = (double *) buf; + auto rlist = (double *) buf; // check that restart grid size is same as current grid size @@ -578,7 +578,7 @@ void FixTTMGrid::pack_gather_grid(int /*which*/, void *vbuf) { int ix, iy, iz; - double *buf = (double *) vbuf; + auto buf = (double *) vbuf; int m = 0; for (iz = nzlo_in; iz <= nzhi_in; iz++) @@ -596,8 +596,8 @@ void FixTTMGrid::unpack_gather_grid(int which, void *vbuf, void *vgbuf, int xlo, { int ix, iy, iz; - double *buf = (double *) vbuf; - double *gbuf = (double *) vgbuf; + auto buf = (double *) vbuf; + auto gbuf = (double *) vgbuf; if (which == 0) { int iglobal; diff --git a/src/EXTRA-FIX/fix_ttm_mod.cpp b/src/EXTRA-FIX/fix_ttm_mod.cpp index a2c03db762..8979a30bf4 100644 --- a/src/EXTRA-FIX/fix_ttm_mod.cpp +++ b/src/EXTRA-FIX/fix_ttm_mod.cpp @@ -271,7 +271,7 @@ void FixTTMMod::init() net_energy_transfer_all[ix][iy][iz] = 0; if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -281,9 +281,9 @@ void FixTTMMod::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) { post_force_setup(vflag); } else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa_setup(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); } } @@ -435,121 +435,146 @@ void FixTTMMod::reset_dt() void FixTTMMod::read_parameters(const std::string &filename) { - try { - PotentialFileReader reader(lmp, filename, "ttm/mod parameter"); + if (comm->me == 0) { - // C0 (metal) + try { + PotentialFileReader reader(lmp, filename, "ttm/mod parameter"); - reader.next_line(); - esheat_0 = reader.next_values(1).next_double(); + // C0 (metal) - // C1 (metal*10^3) + reader.next_line(); + esheat_0 = reader.next_values(1).next_double(); - reader.next_line(); - esheat_1 = reader.next_values(1).next_double(); + // C1 (metal*10^3) - // C2 (metal*10^6) + reader.next_line(); + esheat_1 = reader.next_values(1).next_double(); - reader.next_line(); - esheat_2 = reader.next_values(1).next_double(); + // C2 (metal*10^6) - // C3 (metal*10^9) + reader.next_line(); + esheat_2 = reader.next_values(1).next_double(); - reader.next_line(); - esheat_3 = reader.next_values(1).next_double(); + // C3 (metal*10^9) - // C4 (metal*10^12) + reader.next_line(); + esheat_3 = reader.next_values(1).next_double(); - reader.next_line(); - esheat_4 = reader.next_values(1).next_double(); + // C4 (metal*10^12) - // C_limit + reader.next_line(); + esheat_4 = reader.next_values(1).next_double(); - reader.next_line(); - C_limit = reader.next_values(1).next_double(); + // C_limit - // Temperature damping factor + reader.next_line(); + C_limit = reader.next_values(1).next_double(); - reader.next_line(); - T_damp = reader.next_values(1).next_double(); + // Temperature damping factor - // rho_e + reader.next_line(); + T_damp = reader.next_values(1).next_double(); - reader.next_line(); - electronic_density = reader.next_values(1).next_double(); + // rho_e - // thermal_diffusion + reader.next_line(); + electronic_density = reader.next_values(1).next_double(); - reader.next_line(); - el_th_diff = reader.next_values(1).next_double(); + // thermal_diffusion - // gamma_p + reader.next_line(); + el_th_diff = reader.next_values(1).next_double(); - reader.next_line(); - gamma_p = reader.next_values(1).next_double(); + // gamma_p - // gamma_s + reader.next_line(); + gamma_p = reader.next_values(1).next_double(); - reader.next_line(); - gamma_s = reader.next_values(1).next_double(); + // gamma_s - // v0 + reader.next_line(); + gamma_s = reader.next_values(1).next_double(); - reader.next_line(); - v_0 = reader.next_values(1).next_double(); + // v0 - // average intensity of pulse (source of energy) (metal units) + reader.next_line(); + v_0 = reader.next_values(1).next_double(); - reader.next_line(); - intensity = reader.next_values(1).next_double(); + // average intensity of pulse (source of energy) (metal units) - // coordinate of 1st surface in x-direction (in box units) - constant + reader.next_line(); + intensity = reader.next_values(1).next_double(); - reader.next_line(); - surface_l = reader.next_values(1).next_int(); + // coordinate of 1st surface in x-direction (in box units) - constant - // coordinate of 2nd surface in x-direction (in box units) - constant + reader.next_line(); + surface_l = reader.next_values(1).next_int(); - reader.next_line(); - surface_r = reader.next_values(1).next_int(); + // coordinate of 2nd surface in x-direction (in box units) - constant - // skin_layer = intensity is reduced (I=I0*exp[-x/skin_layer]) + reader.next_line(); + surface_r = reader.next_values(1).next_int(); - reader.next_line(); - skin_layer = reader.next_values(1).next_int(); + // skin_layer = intensity is reduced (I=I0*exp[-x/skin_layer]) - // width of pulse (picoseconds) + reader.next_line(); + skin_layer = reader.next_values(1).next_int(); - reader.next_line(); - width = reader.next_values(1).next_double(); + // width of pulse (picoseconds) - // factor of electronic pressure (PF) Pe = PF*Ce*Te + reader.next_line(); + width = reader.next_values(1).next_double(); - reader.next_line(); - pres_factor = reader.next_values(1).next_double(); + // factor of electronic pressure (PF) Pe = PF*Ce*Te - // effective free path of electrons (angstrom) + reader.next_line(); + pres_factor = reader.next_values(1).next_double(); - reader.next_line(); - free_path = reader.next_values(1).next_double(); + // effective free path of electrons (angstrom) - // ionic density (ions*angstrom^{-3}) + reader.next_line(); + free_path = reader.next_values(1).next_double(); - reader.next_line(); - ionic_density = reader.next_values(1).next_double(); + // ionic density (ions*angstrom^{-3}) - // if movsur = 0: surface is frozen + reader.next_line(); + ionic_density = reader.next_values(1).next_double(); - reader.next_line(); - movsur = reader.next_values(1).next_int(); + // if movsur = 0: surface is frozen - // electron_temperature_min + reader.next_line(); + movsur = reader.next_values(1).next_int(); - reader.next_line(); - electron_temperature_min = reader.next_values(1).next_double(); - } catch (std::exception &e) { - error->one(FLERR,e.what()); + // electron_temperature_min + + reader.next_line(); + electron_temperature_min = reader.next_values(1).next_double(); + } catch (std::exception &e) { + error->one(FLERR,e.what()); + } } + MPI_Bcast(&esheat_0, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&esheat_1, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&esheat_2, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&esheat_3, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&esheat_4, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&C_limit, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&T_damp, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&electronic_density, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&el_th_diff, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&gamma_p, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&gamma_s, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&v_0, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&intensity, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&surface_l, 1, MPI_INT, 0, world); + MPI_Bcast(&surface_r, 1, MPI_INT, 0, world); + MPI_Bcast(&skin_layer, 1, MPI_INT, 0, world); + MPI_Bcast(&width, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&pres_factor, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&free_path, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&ionic_density, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&movsur, 1, MPI_INT, 0, world); + MPI_Bcast(&electron_temperature_min, 1, MPI_DOUBLE, 0, world); } /* ---------------------------------------------------------------------- @@ -789,9 +814,9 @@ void FixTTMMod::end_of_step() if (left_x == -1) left_x = nxgrid - 1; if (left_y == -1) left_y = nygrid - 1; if (left_z == -1) left_z = nzgrid - 1; - double skin_layer_d = double(skin_layer); - double ix_d = double(ix); - double surface_d = double(t_surface_l); + auto skin_layer_d = double(skin_layer); + auto ix_d = double(ix); + auto surface_d = double(t_surface_l); mult_factor = 0.0; if (duration < width) { if (ix >= t_surface_l) mult_factor = (intensity/(dx*skin_layer_d))*exp((-1.0)*(ix_d - surface_d)/skin_layer_d); @@ -937,7 +962,7 @@ void FixTTMMod::write_restart(FILE *fp) void FixTTMMod::restart(char *buf) { int n = 0; - double *rlist = (double *) buf; + auto rlist = (double *) buf; // check that restart grid size is same as current grid size diff --git a/src/EXTRA-FIX/fix_viscous_sphere.cpp b/src/EXTRA-FIX/fix_viscous_sphere.cpp index eabb625737..cb5344076e 100644 --- a/src/EXTRA-FIX/fix_viscous_sphere.cpp +++ b/src/EXTRA-FIX/fix_viscous_sphere.cpp @@ -36,7 +36,7 @@ enum { NONE, TYPE, VARIABLE }; FixViscousSphere::FixViscousSphere(LAMMPS *_lmp, int narg, char **arg) : Fix(_lmp, narg, arg), scalegamma(nullptr), scaleval(nullptr), scalevarid(nullptr), - scalestyle(NONE) + scalestyle(NONE), scalevar(-1) { dynamic_group_allow = 1; @@ -114,7 +114,7 @@ void FixViscousSphere::init() int max_respa = 0; if (utils::strmatch(update->integrate_style, "^respa")) { - ilevel_respa = max_respa = ((Respa *) update->integrate)->nlevels - 1; + ilevel_respa = max_respa = (dynamic_cast( update->integrate))->nlevels - 1; if (respa_level >= 0) ilevel_respa = MIN(respa_level, max_respa); } @@ -135,9 +135,9 @@ void FixViscousSphere::setup(int vflag) if (utils::strmatch(update->integrate_style, "^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag, ilevel_respa, 0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/EXTRA-FIX/fix_wall_ees.cpp b/src/EXTRA-FIX/fix_wall_ees.cpp index 26ed4f52f1..8b30e4a0be 100644 --- a/src/EXTRA-FIX/fix_wall_ees.cpp +++ b/src/EXTRA-FIX/fix_wall_ees.cpp @@ -50,7 +50,7 @@ void FixWallEES::precompute(int m) /* ---------------------------------------------------------------------- */ void FixWallEES::init() { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Fix wall/ees requires atom style ellipsoid"); @@ -85,7 +85,7 @@ void FixWallEES::wall_particle(int m, int which, double coord) double **f = atom->f; double **tor = atom->torque; - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); AtomVecEllipsoid::Bonus *bonus = avec->bonus; int *ellipsoid = atom->ellipsoid; int *mask = atom->mask; diff --git a/src/EXTRA-FIX/fix_wall_region_ees.cpp b/src/EXTRA-FIX/fix_wall_region_ees.cpp index 261036333e..eb1ede5c4a 100644 --- a/src/EXTRA-FIX/fix_wall_region_ees.cpp +++ b/src/EXTRA-FIX/fix_wall_region_ees.cpp @@ -91,7 +91,7 @@ void FixWallRegionEES::init() if (iregion == -1) error->all(FLERR,"Region ID for fix wall/region/ees does not exist"); - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Fix wall/region/ees requires atom style ellipsoid"); @@ -119,7 +119,7 @@ void FixWallRegionEES::init() if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -129,9 +129,9 @@ void FixWallRegionEES::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/EXTRA-MOLECULE/dihedral_spherical.cpp b/src/EXTRA-MOLECULE/dihedral_spherical.cpp index 7671acc528..9918e92101 100644 --- a/src/EXTRA-MOLECULE/dihedral_spherical.cpp +++ b/src/EXTRA-MOLECULE/dihedral_spherical.cpp @@ -52,16 +52,16 @@ DihedralSpherical::~DihedralSpherical() memory->destroy(nterms); for (int i = 1; i <= atom->ndihedraltypes; i++) { - if (Ccoeff[i]) delete[] Ccoeff[i]; - if (phi_mult[i]) delete[] phi_mult[i]; - if (phi_shift[i]) delete[] phi_shift[i]; - if (phi_offset[i]) delete[] phi_offset[i]; - if (theta1_mult[i]) delete[] theta1_mult[i]; - if (theta1_shift[i]) delete[] theta1_shift[i]; - if (theta1_offset[i]) delete[] theta1_offset[i]; - if (theta2_mult[i]) delete[] theta2_mult[i]; - if (theta2_shift[i]) delete[] theta2_shift[i]; - if (theta2_offset[i]) delete[] theta2_offset[i]; + delete[] Ccoeff[i]; + delete[] phi_mult[i]; + delete[] phi_shift[i]; + delete[] phi_offset[i]; + delete[] theta1_mult[i]; + delete[] theta1_shift[i]; + delete[] theta1_offset[i]; + delete[] theta2_mult[i]; + delete[] theta2_shift[i]; + delete[] theta2_offset[i]; } delete[] Ccoeff; delete[] phi_mult; diff --git a/src/EXTRA-MOLECULE/dihedral_table_cut.cpp b/src/EXTRA-MOLECULE/dihedral_table_cut.cpp index 522eff8626..5ac3ab6ebb 100644 --- a/src/EXTRA-MOLECULE/dihedral_table_cut.cpp +++ b/src/EXTRA-MOLECULE/dihedral_table_cut.cpp @@ -523,9 +523,9 @@ void DihedralTableCut::coeff(int narg, char **arg) // We also want the angles to be sorted in increasing order. // This messy code fixes these problems with the user's data: { - double *phifile_tmp = new double[tb->ninput]; //temporary arrays - double *ffile_tmp = new double[tb->ninput]; //used for sorting - double *efile_tmp = new double[tb->ninput]; + auto phifile_tmp = new double[tb->ninput]; //temporary arrays + auto ffile_tmp = new double[tb->ninput]; //used for sorting + auto efile_tmp = new double[tb->ninput]; // After re-imaging, does the range of angles cross the 0 or 2*PI boundary? // If so, find the discontinuity: diff --git a/src/EXTRA-PAIR/pair_lj96_cut.cpp b/src/EXTRA-PAIR/pair_lj96_cut.cpp index 28038ea396..778dfbb562 100644 --- a/src/EXTRA-PAIR/pair_lj96_cut.cpp +++ b/src/EXTRA-PAIR/pair_lj96_cut.cpp @@ -487,7 +487,7 @@ void PairLJ96Cut::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -496,8 +496,8 @@ void PairLJ96Cut::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast( update->integrate))->cutoff; else cut_respa = nullptr; } diff --git a/src/EXTRA-PAIR/pair_lj_expand_coul_long.cpp b/src/EXTRA-PAIR/pair_lj_expand_coul_long.cpp index 5d5ceff1e5..a62aabf3a5 100644 --- a/src/EXTRA-PAIR/pair_lj_expand_coul_long.cpp +++ b/src/EXTRA-PAIR/pair_lj_expand_coul_long.cpp @@ -688,7 +688,7 @@ void PairLJExpandCoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -699,8 +699,8 @@ void PairLJExpandCoulLong::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast( update->integrate))->cutoff; else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald diff --git a/src/EXTRA-PAIR/pair_mie_cut.cpp b/src/EXTRA-PAIR/pair_mie_cut.cpp index 729cac8ff8..dff41ce81b 100644 --- a/src/EXTRA-PAIR/pair_mie_cut.cpp +++ b/src/EXTRA-PAIR/pair_mie_cut.cpp @@ -499,7 +499,7 @@ void PairMIECut::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -508,8 +508,8 @@ void PairMIECut::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast( update->integrate))->cutoff; else cut_respa = nullptr; } diff --git a/src/FEP/Install.sh b/src/FEP/Install.sh index c6e7a53aa1..1d7a1c7a48 100755 --- a/src/FEP/Install.sh +++ b/src/FEP/Install.sh @@ -30,6 +30,8 @@ action () { action compute_fep.cpp action compute_fep.h +action compute_fep_ta.cpp +action compute_fep_ta.h action fix_adapt_fep.cpp action fix_adapt_fep.h action pair_coul_cut_soft.cpp diff --git a/src/FEP/compute_fep.cpp b/src/FEP/compute_fep.cpp index 787c8a29e6..f3ee1f3c4b 100644 --- a/src/FEP/compute_fep.cpp +++ b/src/FEP/compute_fep.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -34,51 +33,49 @@ #include "update.h" #include "variable.h" -#include #include +#include using namespace LAMMPS_NS; -enum{PAIR,ATOM}; -enum{CHARGE}; +enum { PAIR, ATOM }; +enum { CHARGE }; /* ---------------------------------------------------------------------- */ -ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg) +ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg) { - if (narg < 5) error->all(FLERR,"Illegal number of arguments in compute fep"); + if (narg < 5) error->all(FLERR, "Illegal number of arguments in compute fep"); scalar_flag = 0; vector_flag = 1; size_vector = 3; extvector = 0; + const int ntypes = atom->ntypes; vector = new double[size_vector]; - fepinitflag = 0; // avoid init to run entirely when called by write_data - temp_fep = utils::numeric(FLERR,arg[3],false,lmp); + temp_fep = utils::numeric(FLERR, arg[3], false, lmp); // count # of perturbations npert = 0; int iarg = 4; while (iarg < narg) { - if (strcmp(arg[iarg],"pair") == 0) { - if (iarg+6 > narg) error->all(FLERR, - "Illegal pair attribute in compute fep"); + if (strcmp(arg[iarg], "pair") == 0) { + if (iarg + 6 > narg) error->all(FLERR, "Illegal pair attribute in compute fep"); npert++; iarg += 6; - } else if (strcmp(arg[iarg],"atom") == 0) { - if (iarg+4 > narg) error->all(FLERR, - "Illegal atom attribute in compute fep"); + } else if (strcmp(arg[iarg], "atom") == 0) { + if (iarg + 4 > narg) error->all(FLERR, "Illegal atom attribute in compute fep"); npert++; iarg += 4; - } else break; + } else + break; } - if (npert == 0) error->all(FLERR,"Illegal syntax in compute fep"); + if (npert == 0) error->all(FLERR, "Illegal syntax in compute fep"); perturb = new Perturb[npert]; // parse keywords @@ -88,33 +85,34 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : iarg = 4; while (iarg < narg) { - if (strcmp(arg[iarg],"pair") == 0) { + if (strcmp(arg[iarg], "pair") == 0) { perturb[npert].which = PAIR; - perturb[npert].pstyle = utils::strdup(arg[iarg+1]); - perturb[npert].pparam = utils::strdup(arg[iarg+2]); - utils::bounds(FLERR,arg[iarg+3],1,atom->ntypes, - perturb[npert].ilo,perturb[npert].ihi,error); - utils::bounds(FLERR,arg[iarg+4],1,atom->ntypes, - perturb[npert].jlo,perturb[npert].jhi,error); - if (utils::strmatch(arg[iarg+5],"^v_")) { - perturb[npert].var = utils::strdup(arg[iarg+5]+2); - } else error->all(FLERR,"Illegal variable in compute fep"); + perturb[npert].pstyle = utils::strdup(arg[iarg + 1]); + perturb[npert].pparam = utils::strdup(arg[iarg + 2]); + utils::bounds(FLERR, arg[iarg + 3], 1, ntypes, perturb[npert].ilo, perturb[npert].ihi, error); + utils::bounds(FLERR, arg[iarg + 4], 1, ntypes, perturb[npert].jlo, perturb[npert].jhi, error); + if (utils::strmatch(arg[iarg + 5], "^v_")) { + perturb[npert].var = utils::strdup(arg[iarg + 5] + 2); + } else + error->all(FLERR, "Illegal variable in compute fep"); npert++; iarg += 6; - } else if (strcmp(arg[iarg],"atom") == 0) { + } else if (strcmp(arg[iarg], "atom") == 0) { perturb[npert].which = ATOM; - if (strcmp(arg[iarg+1],"charge") == 0) { + if (strcmp(arg[iarg + 1], "charge") == 0) { perturb[npert].aparam = CHARGE; chgflag = 1; - } else error->all(FLERR,"Illegal atom argument in compute fep"); - utils::bounds(FLERR,arg[iarg+2],1,atom->ntypes, - perturb[npert].ilo,perturb[npert].ihi,error); - if (utils::strmatch(arg[iarg+3],"^v_")) { - perturb[npert].var = utils::strdup(arg[iarg+3]+2); - } else error->all(FLERR,"Illegal variable in compute fep"); + } else + error->all(FLERR, "Illegal atom argument in compute fep"); + utils::bounds(FLERR, arg[iarg + 2], 1, ntypes, perturb[npert].ilo, perturb[npert].ihi, error); + if (utils::strmatch(arg[iarg + 3], "^v_")) { + perturb[npert].var = utils::strdup(arg[iarg + 3] + 2); + } else + error->all(FLERR, "Illegal variable in compute fep"); npert++; iarg += 4; - } else break; + } else + break; } // optional keywords @@ -123,24 +121,23 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : volumeflag = 0; while (iarg < narg) { - if (strcmp(arg[iarg],"tail") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal optional keyword in compute fep"); - tailflag = utils::logical(FLERR,arg[iarg+1],false,lmp); + if (strcmp(arg[iarg], "tail") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal optional keyword in compute fep"); + tailflag = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"volume") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal optional keyword in compute fep"); - volumeflag = utils::logical(FLERR,arg[iarg+1],false,lmp); + } else if (strcmp(arg[iarg], "volume") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal optional keyword in compute fep"); + volumeflag = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg += 2; } else - error->all(FLERR,"Illegal optional keyword in compute fep"); + error->all(FLERR, "Illegal optional keyword in compute fep"); } // allocate pair style arrays - int ntype = atom->ntypes; for (int m = 0; m < npert; m++) { if (perturb[m].which == PAIR) - memory->create(perturb[m].array_orig,ntype+1,ntype+1,"fep:array_orig"); + memory->create(perturb[m].array_orig, ntypes + 1, ntypes + 1, "fep:array_orig"); } // allocate space for charge, force, energy, virial arrays @@ -159,17 +156,17 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : ComputeFEP::~ComputeFEP() { - delete [] vector; + delete[] vector; for (int m = 0; m < npert; m++) { - delete [] perturb[m].var; + delete[] perturb[m].var; if (perturb[m].which == PAIR) { - delete [] perturb[m].pstyle; - delete [] perturb[m].pparam; + delete[] perturb[m].pstyle; + delete[] perturb[m].pparam; memory->destroy(perturb[m].array_orig); } } - delete [] perturb; + delete[] perturb; deallocate_storage(); } @@ -178,11 +175,12 @@ ComputeFEP::~ComputeFEP() void ComputeFEP::init() { - int i,j; + int i, j; if (!fepinitflag) // avoid init to run entirely when called by write_data - fepinitflag = 1; - else return; + fepinitflag = 1; + else + return; // setup and error checks @@ -192,117 +190,97 @@ void ComputeFEP::init() Perturb *pert = &perturb[m]; pert->ivar = input->variable->find(pert->var); - if (pert->ivar < 0) - error->all(FLERR,"Variable name for compute fep does not exist"); + if (pert->ivar < 0) error->all(FLERR, "Variable name for compute fep does not exist"); if (!input->variable->equalstyle(pert->ivar)) - error->all(FLERR,"Variable for compute fep is of invalid style"); + error->all(FLERR, "Variable for compute fep is of invalid style"); - if (force->pair == nullptr) - error->all(FLERR,"compute fep pair requires pair interactions"); + if (force->pair == nullptr) error->all(FLERR, "compute fep pair requires pair interactions"); if (pert->which == PAIR) { pairflag = 1; - Pair *pair = force->pair_match(pert->pstyle,1); - if (pair == nullptr) error->all(FLERR,"compute fep pair style " - "does not exist"); - void *ptr = pair->extract(pert->pparam,pert->pdim); - if (ptr == nullptr) - error->all(FLERR,"compute fep pair style param not supported"); + Pair *pair = force->pair_match(pert->pstyle, 1); + if (pair == nullptr) + error->all(FLERR, + "compute fep pair style " + "does not exist"); + void *ptr = pair->extract(pert->pparam, pert->pdim); + if (ptr == nullptr) error->all(FLERR, "compute fep pair style param not supported"); pert->array = (double **) ptr; // if pair hybrid, test that ilo,ihi,jlo,jhi are valid for sub-style - if ((strcmp(force->pair_style,"hybrid") == 0 || - strcmp(force->pair_style,"hybrid/overlay") == 0)) { - PairHybrid *pair = (PairHybrid *) force->pair; + if ((strcmp(force->pair_style, "hybrid") == 0 || + strcmp(force->pair_style, "hybrid/overlay") == 0)) { + auto pair = dynamic_cast( force->pair); for (i = pert->ilo; i <= pert->ihi; i++) - for (j = MAX(pert->jlo,i); j <= pert->jhi; j++) - if (!pair->check_ijtype(i,j,pert->pstyle)) - error->all(FLERR,"compute fep type pair range is not valid for " + for (j = MAX(pert->jlo, i); j <= pert->jhi; j++) + if (!pair->check_ijtype(i, j, pert->pstyle)) + error->all(FLERR, + "compute fep type pair range is not valid for " "pair hybrid sub-style"); } } else if (pert->which == ATOM) { if (pert->aparam == CHARGE) { - if (!atom->q_flag) - error->all(FLERR,"compute fep requires atom attribute charge"); + if (!atom->q_flag) error->all(FLERR, "compute fep requires atom attribute charge"); } } } if (tailflag) { if (force->pair->tail_flag == 0) - error->all(FLERR,"Compute fep tail when pair style does not " + error->all(FLERR, + "Compute fep tail when pair style does not " "compute tail corrections"); } // detect if package gpu is present - int ifixgpu = modify->find_fix("package_gpu"); - if (ifixgpu >= 0) fixgpu = modify->fix[ifixgpu]; + fixgpu = modify->get_fix_by_id("package_gpu"); if (comm->me == 0) { - if (screen) { - fprintf(screen, "FEP settings ...\n"); - fprintf(screen, " temperature = %f\n", temp_fep); - fprintf(screen, " tail %s\n", (tailflag ? "yes":"no")); - for (int m = 0; m < npert; m++) { - Perturb *pert = &perturb[m]; - if (pert->which == PAIR) - fprintf(screen, " pair %s %s %d-%d %d-%d\n", pert->pstyle, - pert->pparam, - pert->ilo, pert->ihi, pert->jlo, pert->jhi); - else if (pert->which == ATOM) - fprintf(screen, " atom charge %d-%d\n", pert->ilo, pert->ihi); - } - } - if (logfile) { - fprintf(logfile, "FEP settings ...\n"); - fprintf(logfile, " temperature = %f\n", temp_fep); - fprintf(logfile, " tail %s\n", (tailflag ? "yes":"no")); - for (int m = 0; m < npert; m++) { - Perturb *pert = &perturb[m]; - if (pert->which == PAIR) - fprintf(logfile, " pair %s %s %d-%d %d-%d\n", pert->pstyle, - pert->pparam, - pert->ilo, pert->ihi, pert->jlo, pert->jhi); - else if (pert->which == ATOM) - fprintf(logfile, " atom charge %d-%d\n", pert->ilo, pert->ihi); - } + auto mesg = fmt::format("FEP settings ...\n temperature = {:f}\n", temp_fep); + mesg += fmt::format(" tail {}\n", (tailflag ? "yes" : "no")); + for (int m = 0; m < npert; m++) { + Perturb *pert = &perturb[m]; + if (pert->which == PAIR) + mesg += fmt::format(" pair {} {} {}-{} {}-{}\n", pert->pstyle, pert->pparam, pert->ilo, + pert->ihi, pert->jlo, pert->jhi); + else if (pert->which == ATOM) + mesg += fmt::format(" atom charge {}-{}\n", pert->ilo, pert->ihi); } + utils::logmesg(lmp, mesg); } - } /* ---------------------------------------------------------------------- */ - void ComputeFEP::compute_vector() { - double pe0,pe1; + double pe0, pe1; eflag = 1; vflag = 0; invoked_vector = update->ntimestep; - if (atom->nmax > nmax) { // reallocate working arrays if necessary + if (atom->nmax > nmax) { // reallocate working arrays if necessary deallocate_storage(); allocate_storage(); } - backup_qfev(); // backup charge, force, energy, virial array values - backup_params(); // backup pair parameters + backup_qfev(); // backup charge, force, energy, virial array values + backup_params(); // backup pair parameters timer->stamp(); if (force->pair && force->pair->compute_flag) { - force->pair->compute(eflag,vflag); + force->pair->compute(eflag, vflag); timer->stamp(Timer::PAIR); } if (chgflag && force->kspace && force->kspace->compute_flag) { - force->kspace->compute(eflag,vflag); + force->kspace->compute(eflag, vflag); timer->stamp(Timer::KSPACE); } @@ -315,11 +293,11 @@ void ComputeFEP::compute_vector() timer->stamp(); if (force->pair && force->pair->compute_flag) { - force->pair->compute(eflag,vflag); + force->pair->compute(eflag, vflag); timer->stamp(Timer::PAIR); } if (chgflag && force->kspace && force->kspace->compute_flag) { - force->kspace->compute(eflag,vflag); + force->kspace->compute(eflag, vflag); timer->stamp(Timer::KSPACE); } @@ -330,17 +308,15 @@ void ComputeFEP::compute_vector() pe1 = compute_epair(); - restore_qfev(); // restore charge, force, energy, virial array values - restore_params(); // restore pair parameters + restore_qfev(); // restore charge, force, energy, virial array values + restore_params(); // restore pair parameters - vector[0] = pe1-pe0; - vector[1] = exp(-(pe1-pe0)/(force->boltz*temp_fep)); + vector[0] = pe1 - pe0; + vector[1] = exp(-(pe1 - pe0) / (force->boltz * temp_fep)); vector[2] = domain->xprd * domain->yprd * domain->zprd; - if (volumeflag) - vector[1] *= vector[2]; + if (volumeflag) vector[1] *= vector[2]; } - /* ---------------------------------------------------------------------- obtain pair energy from lammps accumulators ------------------------------------------------------------------------- */ @@ -350,9 +326,8 @@ double ComputeFEP::compute_epair() double eng, eng_pair; eng = 0.0; - if (force->pair) - eng = force->pair->eng_vdwl + force->pair->eng_coul; - MPI_Allreduce(&eng,&eng_pair,1,MPI_DOUBLE,MPI_SUM,world); + if (force->pair) eng = force->pair->eng_vdwl + force->pair->eng_coul; + MPI_Allreduce(&eng, &eng_pair, 1, MPI_DOUBLE, MPI_SUM, world); if (tailflag) { double volume = domain->xprd * domain->yprd * domain->zprd; @@ -364,28 +339,27 @@ double ComputeFEP::compute_epair() return eng_pair; } - /* ---------------------------------------------------------------------- apply perturbation to pair, atom parameters based on variable evaluation ------------------------------------------------------------------------- */ void ComputeFEP::perturb_params() { - int i,j; + int i, j; for (int m = 0; m < npert; m++) { Perturb *pert = &perturb[m]; double delta = input->variable->compute_equal(pert->ivar); - if (pert->which == PAIR) { // modify pair parameters + if (pert->which == PAIR) { // modify pair parameters for (i = pert->ilo; i <= pert->ihi; i++) - for (j = MAX(pert->jlo,i); j <= pert->jhi; j++) + for (j = MAX(pert->jlo, i); j <= pert->jhi; j++) pert->array[i][j] = pert->array_orig[i][j] + delta; } else if (pert->which == ATOM) { - if (pert->aparam == CHARGE) { // modify charges + if (pert->aparam == CHARGE) { // modify charges int *atype = atom->type; double *q = atom->q; int *mask = atom->mask; @@ -393,9 +367,7 @@ void ComputeFEP::perturb_params() for (i = 0; i < natom; i++) if (atype[i] >= pert->ilo && atype[i] <= pert->ihi) - if (mask[i] & groupbit) - q[i] += delta; - + if (mask[i] & groupbit) q[i] += delta; } } } @@ -411,40 +383,36 @@ void ComputeFEP::perturb_params() if (chgflag && force->kspace) force->kspace->qsum_qsq(); } - /* ---------------------------------------------------------------------- backup pair parameters ------------------------------------------------------------------------- */ void ComputeFEP::backup_params() { - int i,j; + int i, j; for (int m = 0; m < npert; m++) { Perturb *pert = &perturb[m]; if (pert->which == PAIR) { for (i = pert->ilo; i <= pert->ihi; i++) - for (j = MAX(pert->jlo,i); j <= pert->jhi; j++) - pert->array_orig[i][j] = pert->array[i][j]; + for (j = MAX(pert->jlo, i); j <= pert->jhi; j++) pert->array_orig[i][j] = pert->array[i][j]; } } } - /* ---------------------------------------------------------------------- restore pair parameters to original values ------------------------------------------------------------------------- */ void ComputeFEP::restore_params() { - int i,j; + int i, j; for (int m = 0; m < npert; m++) { Perturb *pert = &perturb[m]; if (pert->which == PAIR) { for (i = pert->ilo; i <= pert->ihi; i++) - for (j = MAX(pert->jlo,i); j <= pert->jhi; j++) - pert->array[i][j] = pert->array_orig[i][j]; + for (j = MAX(pert->jlo, i); j <= pert->jhi; j++) pert->array[i][j] = pert->array_orig[i][j]; } } @@ -455,7 +423,6 @@ void ComputeFEP::restore_params() if (chgflag && force->kspace) force->kspace->qsum_qsq(); } - /* ---------------------------------------------------------------------- manage storage for charge, force, energy, virial arrays ------------------------------------------------------------------------- */ @@ -463,14 +430,14 @@ void ComputeFEP::restore_params() void ComputeFEP::allocate_storage() { nmax = atom->nmax; - memory->create(f_orig,nmax,3,"fep:f_orig"); - memory->create(peatom_orig,nmax,"fep:peatom_orig"); - memory->create(pvatom_orig,nmax,6,"fep:pvatom_orig"); + memory->create(f_orig, nmax, 3, "fep:f_orig"); + memory->create(peatom_orig, nmax, "fep:peatom_orig"); + memory->create(pvatom_orig, nmax, 6, "fep:pvatom_orig"); if (chgflag) { - memory->create(q_orig,nmax,"fep:q_orig"); + memory->create(q_orig, nmax, "fep:q_orig"); if (force->kspace) { - memory->create(keatom_orig,nmax,"fep:keatom_orig"); - memory->create(kvatom_orig,nmax,6,"fep:kvatom_orig"); + memory->create(keatom_orig, nmax, "fep:keatom_orig"); + memory->create(kvatom_orig, nmax, 6, "fep:kvatom_orig"); } } } @@ -492,7 +459,6 @@ void ComputeFEP::deallocate_storage() pvatom_orig = kvatom_orig = nullptr; } - /* ---------------------------------------------------------------------- backup and restore arrays with charge, force, energy, virial ------------------------------------------------------------------------- */ @@ -503,8 +469,7 @@ void ComputeFEP::backup_qfev() int nall = atom->nlocal + atom->nghost; int natom = atom->nlocal; - if (force->newton || force->kspace->tip4pflag) - natom += atom->nghost; + if (force->newton || force->kspace->tip4pflag) natom += atom->nghost; double **f = atom->f; for (i = 0; i < natom; i++) { @@ -525,8 +490,7 @@ void ComputeFEP::backup_qfev() if (update->eflag_atom) { double *peatom = force->pair->eatom; - for (i = 0; i < natom; i++) - peatom_orig[i] = peatom[i]; + for (i = 0; i < natom; i++) peatom_orig[i] = peatom[i]; } if (update->vflag_atom) { double **pvatom = force->pair->vatom; @@ -542,8 +506,7 @@ void ComputeFEP::backup_qfev() if (chgflag) { double *q = atom->q; - for (i = 0; i < nall; i++) - q_orig[i] = q[i]; + for (i = 0; i < nall; i++) q_orig[i] = q[i]; if (force->kspace) { energy_orig = force->kspace->energy; @@ -556,8 +519,7 @@ void ComputeFEP::backup_qfev() if (update->eflag_atom) { double *keatom = force->kspace->eatom; - for (i = 0; i < natom; i++) - keatom_orig[i] = keatom[i]; + for (i = 0; i < natom; i++) keatom_orig[i] = keatom[i]; } if (update->vflag_atom) { double **kvatom = force->kspace->vatom; @@ -582,8 +544,7 @@ void ComputeFEP::restore_qfev() int nall = atom->nlocal + atom->nghost; int natom = atom->nlocal; - if (force->newton || force->kspace->tip4pflag) - natom += atom->nghost; + if (force->newton || force->kspace->tip4pflag) natom += atom->nghost; double **f = atom->f; for (i = 0; i < natom; i++) { @@ -604,8 +565,7 @@ void ComputeFEP::restore_qfev() if (update->eflag_atom) { double *peatom = force->pair->eatom; - for (i = 0; i < natom; i++) - peatom[i] = peatom_orig[i]; + for (i = 0; i < natom; i++) peatom[i] = peatom_orig[i]; } if (update->vflag_atom) { double **pvatom = force->pair->vatom; @@ -621,8 +581,7 @@ void ComputeFEP::restore_qfev() if (chgflag) { double *q = atom->q; - for (i = 0; i < nall; i++) - q[i] = q_orig[i]; + for (i = 0; i < nall; i++) q[i] = q_orig[i]; if (force->kspace) { force->kspace->energy = energy_orig; @@ -635,8 +594,7 @@ void ComputeFEP::restore_qfev() if (update->eflag_atom) { double *keatom = force->kspace->eatom; - for (i = 0; i < natom; i++) - keatom[i] = keatom_orig[i]; + for (i = 0; i < natom; i++) keatom[i] = keatom_orig[i]; } if (update->vflag_atom) { double **kvatom = force->kspace->vatom; @@ -652,4 +610,3 @@ void ComputeFEP::restore_qfev() } } } - diff --git a/src/FEP/compute_fep_ta.cpp b/src/FEP/compute_fep_ta.cpp new file mode 100644 index 0000000000..9ab848f6db --- /dev/null +++ b/src/FEP/compute_fep_ta.cpp @@ -0,0 +1,515 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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: Shifeng Ke (Zhejiang University) +------------------------------------------------------------------------- */ + +#include "compute_fep_ta.h" + +#include "angle.h" +#include "atom.h" +#include "bond.h" +#include "comm.h" +#include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "fix.h" +#include "force.h" +#include "improper.h" +#include "kspace.h" +#include "memory.h" +#include "modify.h" +#include "neighbor.h" +#include "pair.h" +#include "timer.h" +#include "update.h" + +#include +#include + +using namespace LAMMPS_NS; + +enum { X, Y, Z }; + +/* ---------------------------------------------------------------------- */ + +ComputeFEPTA::ComputeFEPTA(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg) +{ + if (narg < 6) error->all(FLERR, "Illegal number of arguments in compute fep/ta"); + + scalar_flag = 0; + vector_flag = 1; + size_vector = 3; + extvector = 0; + + vector = new double[size_vector]; + + fepinitflag = 0; // avoid init to run entirely when called by write_data + + temp_fep = utils::numeric(FLERR, arg[3], false, lmp); + + if (strcmp(arg[4], "xy") == 0) { + tan_axis1 = X; + tan_axis2 = Y; + norm_axis = Z; + } else if (strcmp(arg[4], "xz") == 0) { + tan_axis1 = X; + tan_axis2 = Z; + norm_axis = Y; + } else if (strcmp(arg[4], "yz") == 0) { + tan_axis1 = Y; + tan_axis2 = Z; + norm_axis = X; + } else + error->all(FLERR, "Illegal arguments in compute fep/ta"); + + scale_factor = utils::numeric(FLERR, arg[5], false, lmp); + + // optional keywords + + tailflag = 0; + + int iarg = 6; + while (iarg < narg) { + if (strcmp(arg[iarg], "tail") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal optional keyword in compute fep/ta"); + tailflag = utils::logical(FLERR, arg[iarg + 1], false, lmp); + iarg += 2; + } else + error->all(FLERR, "Illegal optional keyword in compute fep/ta"); + } + + // allocate space for position, force, energy, virial arrays + + x_orig = nullptr; + f_orig = nullptr; + peatom_orig = keatom_orig = nullptr; + pvatom_orig = kvatom_orig = nullptr; + + allocate_storage(); + + fixgpu = nullptr; +} + +/* ---------------------------------------------------------------------- */ + +ComputeFEPTA::~ComputeFEPTA() +{ + delete[] vector; + + deallocate_storage(); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeFEPTA::init() +{ + if (!fepinitflag) // avoid init to run entirely when called by write_data + fepinitflag = 1; + else + return; + + // setup and error checks + + if (domain->dimension == 2) { error->all(FLERR, "Cannot compute fep/ta in 2d simulation"); } + + if (tailflag) { + if (force->pair->tail_flag == 0) + error->all(FLERR, + "Compute fep/ta tail when pair style does not " + "compute tail corrections"); + } + + // detect if package gpu is present + + fixgpu = modify->get_fix_by_id("package_gpu"); + + if (comm->me == 0) + utils::logmesg(lmp, + "FEP/TA settings ...\n" + " temperature = {:f}\n" + " scale factor = {:f}\n" + " tail {}\n", + temp_fep, scale_factor, tailflag ? "yes" : "no"); +} + +/* ---------------------------------------------------------------------- */ + +void ComputeFEPTA::compute_vector() +{ + double pe0, pe1; + + eflag = 1; + vflag = 0; + + invoked_vector = update->ntimestep; + + if (atom->nmax > nmax) { // reallocate working arrays if necessary + deallocate_storage(); + allocate_storage(); + } + + backup_xfev(); // backup position, force, energy, virial array values + backup_box(); // backup box size + + timer->stamp(); + if (force->pair && force->pair->compute_flag) { + force->pair->compute(eflag, vflag); + timer->stamp(Timer::PAIR); + } + + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) force->bond->compute(eflag, vflag); + if (force->angle) force->angle->compute(eflag, vflag); + if (force->dihedral) force->dihedral->compute(eflag, vflag); + if (force->improper) force->improper->compute(eflag, vflag); + timer->stamp(Timer::BOND); + } + + if (force->kspace && force->kspace->compute_flag) { + force->kspace->compute(eflag, vflag); + timer->stamp(Timer::KSPACE); + } + + // accumulate force/energy/virial from /gpu pair styles + // this is required as to empty the answer queue, + // otherwise the force compute on the GPU in the next step would be incorrect + if (fixgpu) fixgpu->post_force(vflag); + + pe0 = compute_pe(); + + change_box(); + + timer->stamp(); + if (force->pair && force->pair->compute_flag) { + force->pair->compute(eflag, vflag); + timer->stamp(Timer::PAIR); + } + + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) force->bond->compute(eflag, vflag); + if (force->angle) force->angle->compute(eflag, vflag); + if (force->dihedral) force->dihedral->compute(eflag, vflag); + if (force->improper) force->improper->compute(eflag, vflag); + timer->stamp(Timer::BOND); + } + + if (force->kspace && force->kspace->compute_flag) { + force->kspace->compute(eflag, vflag); + timer->stamp(Timer::KSPACE); + } + + // accumulate force/energy/virial from /gpu pair styles + // this is required as to empty the answer queue, + // otherwise the force compute on the GPU in the next step would be incorrect + if (fixgpu) fixgpu->post_force(vflag); + + pe1 = compute_pe(); + + restore_xfev(); // restore position, force, energy, virial array values + restore_box(); // restore box size + + vector[0] = pe1 - pe0; + vector[1] = exp(-(pe1 - pe0) / (force->boltz * temp_fep)); + vector[2] = area_orig * (scale_factor - 1.0); +} + +/* ---------------------------------------------------------------------- + obtain potential energy from lammps accumulators +------------------------------------------------------------------------- */ + +double ComputeFEPTA::compute_pe() +{ + double eng, eng_potential; + + eng = 0.0; + if (force->pair) eng = force->pair->eng_vdwl + force->pair->eng_coul; + + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) eng += force->bond->energy; + if (force->angle) eng += force->angle->energy; + if (force->dihedral) eng += force->dihedral->energy; + if (force->improper) eng += force->improper->energy; + } + + MPI_Allreduce(&eng, &eng_potential, 1, MPI_DOUBLE, MPI_SUM, world); + + if (tailflag) { + double volume = domain->xprd * domain->yprd * domain->zprd; + eng_potential += force->pair->etail / volume; + } + + if (force->kspace) eng_potential += force->kspace->energy; + + return eng_potential; +} + +/* ---------------------------------------------------------------------- + apply changes to box +------------------------------------------------------------------------- */ + +void ComputeFEPTA::change_box() +{ + int i; + double **x = atom->x; + int natom = atom->nlocal + atom->nghost; + + for (i = 0; i < natom; i++) domain->x2lamda(x[i], x[i]); + + domain->boxhi[tan_axis1] *= sqrt(scale_factor); + domain->boxlo[tan_axis1] *= sqrt(scale_factor); + domain->boxhi[tan_axis2] *= sqrt(scale_factor); + domain->boxlo[tan_axis2] *= sqrt(scale_factor); + domain->boxhi[norm_axis] /= scale_factor; + domain->boxlo[norm_axis] /= scale_factor; + + domain->set_global_box(); + domain->set_local_box(); + + // remap atom position + for (i = 0; i < natom; i++) domain->lamda2x(x[i], x[i]); + + if (force->kspace) force->kspace->setup(); +} + +/* ---------------------------------------------------------------------- + backup box size +------------------------------------------------------------------------- */ + +void ComputeFEPTA::backup_box() +{ + for (int i = 0; i < domain->dimension; i++) { + boxhi_orig[i] = domain->boxhi[i]; + boxlo_orig[i] = domain->boxlo[i]; + } + + area_orig = domain->prd[tan_axis1] * domain->prd[tan_axis2]; +} + +/* ---------------------------------------------------------------------- + restore box size to original values +------------------------------------------------------------------------- */ + +void ComputeFEPTA::restore_box() +{ + for (int i = 0; i < domain->dimension; i++) { + domain->boxhi[i] = boxhi_orig[i]; + domain->boxlo[i] = boxlo_orig[i]; + } + + domain->set_global_box(); + domain->set_local_box(); + + if (force->kspace) force->kspace->setup(); +} + +/* ---------------------------------------------------------------------- + manage storage for position, force, energy, virial arrays +------------------------------------------------------------------------- */ + +void ComputeFEPTA::allocate_storage() +{ + nmax = atom->nmax; + memory->create(x_orig, nmax, 3, "fep:x_orig"); + memory->create(f_orig, nmax, 3, "fep:f_orig"); + memory->create(peatom_orig, nmax, "fep:peatom_orig"); + memory->create(pvatom_orig, nmax, 6, "fep:pvatom_orig"); + if (force->kspace) { + memory->create(keatom_orig, nmax, "fep:keatom_orig"); + memory->create(kvatom_orig, nmax, 6, "fep:kvatom_orig"); + } +} + +/* ---------------------------------------------------------------------- */ + +void ComputeFEPTA::deallocate_storage() +{ + memory->destroy(x_orig); + memory->destroy(f_orig); + memory->destroy(peatom_orig); + memory->destroy(pvatom_orig); + memory->destroy(keatom_orig); + memory->destroy(kvatom_orig); + + x_orig = nullptr; + f_orig = nullptr; + peatom_orig = keatom_orig = nullptr; + pvatom_orig = kvatom_orig = nullptr; +} + +/* ---------------------------------------------------------------------- + backup and restore arrays with position, force, energy, virial +------------------------------------------------------------------------- */ + +void ComputeFEPTA::backup_xfev() +{ + int i; + + int natom = atom->nlocal + atom->nghost; + + double **x = atom->x; + for (i = 0; i < natom; i++) { + x_orig[i][0] = x[i][0]; + x_orig[i][1] = x[i][1]; + x_orig[i][2] = x[i][2]; + } + + double **f = atom->f; + for (i = 0; i < natom; i++) { + f_orig[i][0] = f[i][0]; + f_orig[i][1] = f[i][1]; + f_orig[i][2] = f[i][2]; + } + + eng_vdwl_orig = force->pair->eng_vdwl; + eng_coul_orig = force->pair->eng_coul; + + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) eng_bond_orig = force->bond->energy; + if (force->angle) eng_angle_orig = force->angle->energy; + if (force->dihedral) eng_dihedral_orig = force->dihedral->energy; + if (force->improper) eng_improper_orig = force->improper->energy; + } + + pvirial_orig[0] = force->pair->virial[0]; + pvirial_orig[1] = force->pair->virial[1]; + pvirial_orig[2] = force->pair->virial[2]; + pvirial_orig[3] = force->pair->virial[3]; + pvirial_orig[4] = force->pair->virial[4]; + pvirial_orig[5] = force->pair->virial[5]; + + if (update->eflag_atom) { + double *peatom = force->pair->eatom; + for (i = 0; i < natom; i++) peatom_orig[i] = peatom[i]; + } + if (update->vflag_atom) { + double **pvatom = force->pair->vatom; + for (i = 0; i < natom; i++) { + pvatom_orig[i][0] = pvatom[i][0]; + pvatom_orig[i][1] = pvatom[i][1]; + pvatom_orig[i][2] = pvatom[i][2]; + pvatom_orig[i][3] = pvatom[i][3]; + pvatom_orig[i][4] = pvatom[i][4]; + pvatom_orig[i][5] = pvatom[i][5]; + } + } + + if (force->kspace) { + energy_orig = force->kspace->energy; + kvirial_orig[0] = force->kspace->virial[0]; + kvirial_orig[1] = force->kspace->virial[1]; + kvirial_orig[2] = force->kspace->virial[2]; + kvirial_orig[3] = force->kspace->virial[3]; + kvirial_orig[4] = force->kspace->virial[4]; + kvirial_orig[5] = force->kspace->virial[5]; + + if (update->eflag_atom) { + double *keatom = force->kspace->eatom; + for (i = 0; i < natom; i++) keatom_orig[i] = keatom[i]; + } + if (update->vflag_atom) { + double **kvatom = force->kspace->vatom; + for (i = 0; i < natom; i++) { + kvatom_orig[i][0] = kvatom[i][0]; + kvatom_orig[i][1] = kvatom[i][1]; + kvatom_orig[i][2] = kvatom[i][2]; + kvatom_orig[i][3] = kvatom[i][3]; + kvatom_orig[i][4] = kvatom[i][4]; + kvatom_orig[i][5] = kvatom[i][5]; + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +void ComputeFEPTA::restore_xfev() +{ + int i; + + int natom = atom->nlocal + atom->nghost; + + double **x = atom->x; + for (i = 0; i < natom; i++) { + x[i][0] = x_orig[i][0]; + x[i][1] = x_orig[i][1]; + x[i][2] = x_orig[i][2]; + } + + double **f = atom->f; + for (i = 0; i < natom; i++) { + f[i][0] = f_orig[i][0]; + f[i][1] = f_orig[i][1]; + f[i][2] = f_orig[i][2]; + } + + force->pair->eng_vdwl = eng_vdwl_orig; + force->pair->eng_coul = eng_coul_orig; + + if (atom->molecular != Atom::ATOMIC) { + if (force->bond) force->bond->energy = eng_bond_orig; + if (force->angle) force->angle->energy = eng_angle_orig; + if (force->dihedral) force->dihedral->energy = eng_dihedral_orig; + if (force->improper) force->improper->energy = eng_improper_orig; + } + + force->pair->virial[0] = pvirial_orig[0]; + force->pair->virial[1] = pvirial_orig[1]; + force->pair->virial[2] = pvirial_orig[2]; + force->pair->virial[3] = pvirial_orig[3]; + force->pair->virial[4] = pvirial_orig[4]; + force->pair->virial[5] = pvirial_orig[5]; + + if (update->eflag_atom) { + double *peatom = force->pair->eatom; + for (i = 0; i < natom; i++) peatom[i] = peatom_orig[i]; + } + if (update->vflag_atom) { + double **pvatom = force->pair->vatom; + for (i = 0; i < natom; i++) { + pvatom[i][0] = pvatom_orig[i][0]; + pvatom[i][1] = pvatom_orig[i][1]; + pvatom[i][2] = pvatom_orig[i][2]; + pvatom[i][3] = pvatom_orig[i][3]; + pvatom[i][4] = pvatom_orig[i][4]; + pvatom[i][5] = pvatom_orig[i][5]; + } + } + + if (force->kspace) { + force->kspace->energy = energy_orig; + force->kspace->virial[0] = kvirial_orig[0]; + force->kspace->virial[1] = kvirial_orig[1]; + force->kspace->virial[2] = kvirial_orig[2]; + force->kspace->virial[3] = kvirial_orig[3]; + force->kspace->virial[4] = kvirial_orig[4]; + force->kspace->virial[5] = kvirial_orig[5]; + + if (update->eflag_atom) { + double *keatom = force->kspace->eatom; + for (i = 0; i < natom; i++) keatom[i] = keatom_orig[i]; + } + if (update->vflag_atom) { + double **kvatom = force->kspace->vatom; + for (i = 0; i < natom; i++) { + kvatom[i][0] = kvatom_orig[i][0]; + kvatom[i][1] = kvatom_orig[i][1]; + kvatom[i][2] = kvatom_orig[i][2]; + kvatom[i][3] = kvatom_orig[i][3]; + kvatom[i][4] = kvatom_orig[i][4]; + kvatom[i][5] = kvatom_orig[i][5]; + } + } + } +} diff --git a/src/FEP/compute_fep_ta.h b/src/FEP/compute_fep_ta.h new file mode 100644 index 0000000000..b95266eb1a --- /dev/null +++ b/src/FEP/compute_fep_ta.h @@ -0,0 +1,89 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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: Shifeng Ke (Zhejiang University) +------------------------------------------------------------------------- */ + +#ifdef COMPUTE_CLASS +// clang-format off +ComputeStyle(fep/ta,ComputeFEPTA); +// clang-format on +#else + +#ifndef COMPUTE_FEP_TA_H +#define COMPUTE_FEP_TA_H + +#include "compute.h" + +namespace LAMMPS_NS { + +class ComputeFEPTA : public Compute { + public: + ComputeFEPTA(class LAMMPS *, int, char **); // compute ID groupID fep/ta temp xy/xz/yz scale_factor + ~ComputeFEPTA() override; + void init() override; + void compute_vector() override; + + private: + int tailflag; + int fepinitflag; + int eflag, vflag; + double temp_fep; + double scale_factor; + int tan_axis1, tan_axis2, norm_axis; + + double boxlo_orig[3], boxhi_orig[3]; + double area_orig; + + int nmax; + double **x_orig; + double **f_orig; + double eng_vdwl_orig, eng_coul_orig; + double eng_bond_orig, eng_angle_orig, eng_dihedral_orig, eng_improper_orig; + double pvirial_orig[6]; + double *peatom_orig, **pvatom_orig; + double energy_orig; + double kvirial_orig[6]; + double *keatom_orig, **kvatom_orig; + + class Fix *fixgpu; + + double compute_pe(); + void change_box(); + void backup_box(); + void restore_box(); + void allocate_storage(); + void deallocate_storage(); + void backup_xfev(); + void restore_xfev(); +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Cannot compute fep/ta in 2d simulation + +Self-explanatory. + +*/ diff --git a/src/FEP/fix_adapt_fep.cpp b/src/FEP/fix_adapt_fep.cpp index d43c053b9a..090931ae31 100644 --- a/src/FEP/fix_adapt_fep.cpp +++ b/src/FEP/fix_adapt_fep.cpp @@ -211,7 +211,7 @@ void FixAdaptFEP::post_constructor() if (diamflag) { auto cmd = fmt::format("{}_FIX_STORE_DIAM {} STORE peratom 1 1", group->names[igroup]); - fix_diam = (FixStore *) modify->add_fix(cmd); + fix_diam = dynamic_cast( modify->add_fix(cmd)); if (fix_diam->restart_reset) fix_diam->restart_reset = 0; else { @@ -229,7 +229,7 @@ void FixAdaptFEP::post_constructor() if (chgflag) { auto cmd = fmt::format("{}_FIX_STORE_CHG {} STORE peratom 1 1", group->names[igroup]); - fix_chg = (FixStore *) modify->add_fix(cmd); + fix_chg = dynamic_cast( modify->add_fix(cmd)); if (fix_chg->restart_reset) fix_chg->restart_reset = 0; else { @@ -294,7 +294,7 @@ void FixAdaptFEP::init() if (ad->pdim == 2 && (strcmp(force->pair_style,"hybrid") == 0 || strcmp(force->pair_style,"hybrid/overlay") == 0)) { - PairHybrid *pair = (PairHybrid *) force->pair; + auto pair = dynamic_cast( force->pair); for (i = ad->ilo; i <= ad->ihi; i++) for (j = MAX(ad->jlo,i); j <= ad->jhi; j++) if (!pair->check_ijtype(i,j,ad->pstyle)) @@ -335,16 +335,16 @@ void FixAdaptFEP::init() if (id_fix_diam) { int ifix = modify->find_fix(id_fix_diam); if (ifix < 0) error->all(FLERR,"Could not find fix adapt storage fix ID"); - fix_diam = (FixStore *) modify->fix[ifix]; + fix_diam = dynamic_cast( modify->fix[ifix]); } if (id_fix_chg) { int ifix = modify->find_fix(id_fix_chg); if (ifix < 0) error->all(FLERR,"Could not find fix adapt storage fix ID"); - fix_chg = (FixStore *) modify->fix[ifix]; + fix_chg = dynamic_cast( modify->fix[ifix]); } if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ diff --git a/src/FEP/pair_lj_charmm_coul_long_soft.cpp b/src/FEP/pair_lj_charmm_coul_long_soft.cpp index 86681cf51f..119c545579 100644 --- a/src/FEP/pair_lj_charmm_coul_long_soft.cpp +++ b/src/FEP/pair_lj_charmm_coul_long_soft.cpp @@ -692,7 +692,7 @@ void PairLJCharmmCoulLongSoft::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -714,8 +714,8 @@ void PairLJCharmmCoulLongSoft::init_style() // set & error check interior rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - ((Respa *) update->integrate)->level_inner >= 0) { - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) { + cut_respa = (dynamic_cast( update->integrate))->cutoff; if (MIN(cut_lj,cut_coul) < cut_respa[3]) error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) diff --git a/src/FEP/pair_lj_cut_coul_long_soft.cpp b/src/FEP/pair_lj_cut_coul_long_soft.cpp index 7fdc431c61..d3e0ca8a88 100644 --- a/src/FEP/pair_lj_cut_coul_long_soft.cpp +++ b/src/FEP/pair_lj_cut_coul_long_soft.cpp @@ -635,7 +635,7 @@ void PairLJCutCoulLongSoft::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -646,8 +646,8 @@ void PairLJCutCoulLongSoft::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast( update->integrate))->cutoff; else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald diff --git a/src/FEP/pair_lj_cut_soft.cpp b/src/FEP/pair_lj_cut_soft.cpp index cf0a5df644..8cf61f013c 100644 --- a/src/FEP/pair_lj_cut_soft.cpp +++ b/src/FEP/pair_lj_cut_soft.cpp @@ -513,7 +513,7 @@ void PairLJCutSoft::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -522,8 +522,8 @@ void PairLJCutSoft::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast( update->integrate))->cutoff; else cut_respa = nullptr; } diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index 808d435016..85b4f8e0e9 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -275,7 +275,7 @@ void FixGPU::init() // also disallow GPU neighbor lists for hybrid styles if (force->pair_match("^hybrid",0) != nullptr) { - PairHybrid *hybrid = (PairHybrid *) force->pair; + auto hybrid = dynamic_cast( force->pair); for (int i = 0; i < hybrid->nstyles; i++) if (!utils::strmatch(hybrid->keywords[i],"/gpu$")) force->pair->no_virial_fdotr_compute = 1; @@ -286,7 +286,7 @@ void FixGPU::init() // rRESPA support if (utils::strmatch(update->integrate_style,"^respa")) - _nlevels_respa = ((Respa *) update->integrate)->nlevels; + _nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -300,9 +300,9 @@ void FixGPU::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { // In setup only, all forces calculated on GPU are put in the outer level - ((Respa *) update->integrate)->copy_flevel_f(_nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(_nlevels_respa-1); post_force(vflag); - ((Respa *) update->integrate)->copy_f_flevel(_nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(_nlevels_respa-1); } } diff --git a/src/GPU/fix_nh_gpu.cpp b/src/GPU/fix_nh_gpu.cpp index fb09245fa4..9a24c79766 100644 --- a/src/GPU/fix_nh_gpu.cpp +++ b/src/GPU/fix_nh_gpu.cpp @@ -47,7 +47,7 @@ typedef struct { double x,y,z; } dbl3_t; FixNHGPU::FixNHGPU(LAMMPS *lmp, int narg, char **arg) : FixNH(lmp, narg, arg) { - _dtfm = 0; + _dtfm = nullptr; _nlocal3 = 0; _nlocal_max = 0; } @@ -83,7 +83,7 @@ void FixNHGPU::remap() double oldlo,oldhi; double expfac; - dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const x = (dbl3_t *) atom->x[0]; int *mask = atom->mask; int nlocal = atom->nlocal; double *h = domain->h; @@ -420,7 +420,7 @@ void FixNHGPU::nh_v_press() return; } - dbl3_t * _noalias const v = (dbl3_t *)atom->v[0]; + auto * _noalias const v = (dbl3_t *)atom->v[0]; int *mask = atom->mask; int nlocal = atom->nlocal; if (igroup == atom->firstgroup) nlocal = atom->nfirst; diff --git a/src/GPU/fix_nve_asphere_gpu.cpp b/src/GPU/fix_nve_asphere_gpu.cpp index 1323e8b054..1139c56272 100644 --- a/src/GPU/fix_nve_asphere_gpu.cpp +++ b/src/GPU/fix_nve_asphere_gpu.cpp @@ -154,18 +154,18 @@ using namespace FixConst; FixNVEAsphereGPU::FixNVEAsphereGPU(LAMMPS *lmp, int narg, char **arg) : FixNVE(lmp, narg, arg) { - _dtfm = 0; + _dtfm = nullptr; _nlocal_max = 0; - _inertia0 = 0; - _inertia1 = 0; - _inertia2 = 0; + _inertia0 = nullptr; + _inertia1 = nullptr; + _inertia2 = nullptr; } /* ---------------------------------------------------------------------- */ void FixNVEAsphereGPU::init() { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid"); diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp index d3a22bf1cc..ef939f81fb 100644 --- a/src/GPU/pair_eam_alloy_gpu.cpp +++ b/src/GPU/pair_eam_alloy_gpu.cpp @@ -212,7 +212,7 @@ double PairEAMAlloyGPU::single(int i, int j, int itype, int jtype, double rsq, z2 = ((coeff[3] * p + coeff[4]) * p + coeff[5]) * p + coeff[6]; double fp_i, fp_j; - if (fp_single == false) { + if (!fp_single) { fp_i = ((double *) fp_pinned)[i]; fp_j = ((double *) fp_pinned)[j]; } else { @@ -239,13 +239,13 @@ int PairEAMAlloyGPU::pack_forward_comm(int n, int *list, double *buf, int /* pbc m = 0; if (fp_single) { - float *fp_ptr = (float *) fp_pinned; + auto fp_ptr = (float *) fp_pinned; for (i = 0; i < n; i++) { j = list[i]; buf[m++] = static_cast(fp_ptr[j]); } } else { - double *fp_ptr = (double *) fp_pinned; + auto fp_ptr = (double *) fp_pinned; for (i = 0; i < n; i++) { j = list[i]; buf[m++] = fp_ptr[j]; @@ -264,10 +264,10 @@ void PairEAMAlloyGPU::unpack_forward_comm(int n, int first, double *buf) m = 0; last = first + n; if (fp_single) { - float *fp_ptr = (float *) fp_pinned; + auto fp_ptr = (float *) fp_pinned; for (i = first; i < last; i++) fp_ptr[i] = buf[m++]; } else { - double *fp_ptr = (double *) fp_pinned; + auto fp_ptr = (double *) fp_pinned; for (i = first; i < last; i++) fp_ptr[i] = buf[m++]; } } diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp index 09d2b03be4..f174243ced 100644 --- a/src/GPU/pair_eam_fs_gpu.cpp +++ b/src/GPU/pair_eam_fs_gpu.cpp @@ -212,7 +212,7 @@ double PairEAMFSGPU::single(int i, int j, int itype, int jtype, double rsq, z2 = ((coeff[3] * p + coeff[4]) * p + coeff[5]) * p + coeff[6]; double fp_i, fp_j; - if (fp_single == false) { + if (!fp_single) { fp_i = ((double *) fp_pinned)[i]; fp_j = ((double *) fp_pinned)[j]; } else { @@ -239,13 +239,13 @@ int PairEAMFSGPU::pack_forward_comm(int n, int *list, double *buf, int /* pbc_fl m = 0; if (fp_single) { - float *fp_ptr = (float *) fp_pinned; + auto fp_ptr = (float *) fp_pinned; for (i = 0; i < n; i++) { j = list[i]; buf[m++] = static_cast(fp_ptr[j]); } } else { - double *fp_ptr = (double *) fp_pinned; + auto fp_ptr = (double *) fp_pinned; for (i = 0; i < n; i++) { j = list[i]; buf[m++] = fp_ptr[j]; @@ -264,10 +264,10 @@ void PairEAMFSGPU::unpack_forward_comm(int n, int first, double *buf) m = 0; last = first + n; if (fp_single) { - float *fp_ptr = (float *) fp_pinned; + auto fp_ptr = (float *) fp_pinned; for (i = first; i < last; i++) fp_ptr[i] = buf[m++]; } else { - double *fp_ptr = (double *) fp_pinned; + auto fp_ptr = (double *) fp_pinned; for (i = first; i < last; i++) fp_ptr[i] = buf[m++]; } } diff --git a/src/GPU/pair_eam_gpu.cpp b/src/GPU/pair_eam_gpu.cpp index 1fbba6dd6b..c04418720c 100644 --- a/src/GPU/pair_eam_gpu.cpp +++ b/src/GPU/pair_eam_gpu.cpp @@ -209,7 +209,7 @@ double PairEAMGPU::single(int i, int j, int itype, int jtype, double rsq, double z2 = ((coeff[3] * p + coeff[4]) * p + coeff[5]) * p + coeff[6]; double fp_i, fp_j; - if (fp_single == false) { + if (!fp_single) { fp_i = ((double *) fp_pinned)[i]; fp_j = ((double *) fp_pinned)[j]; } else { @@ -236,13 +236,13 @@ int PairEAMGPU::pack_forward_comm(int n, int *list, double *buf, int /* pbc_flag m = 0; if (fp_single) { - float *fp_ptr = (float *) fp_pinned; + auto fp_ptr = (float *) fp_pinned; for (i = 0; i < n; i++) { j = list[i]; buf[m++] = static_cast(fp_ptr[j]); } } else { - double *fp_ptr = (double *) fp_pinned; + auto fp_ptr = (double *) fp_pinned; for (i = 0; i < n; i++) { j = list[i]; buf[m++] = fp_ptr[j]; @@ -261,10 +261,10 @@ void PairEAMGPU::unpack_forward_comm(int n, int first, double *buf) m = 0; last = first + n; if (fp_single) { - float *fp_ptr = (float *) fp_pinned; + auto fp_ptr = (float *) fp_pinned; for (i = first; i < last; i++) fp_ptr[i] = buf[m++]; } else { - double *fp_ptr = (double *) fp_pinned; + auto fp_ptr = (double *) fp_pinned; for (i = first; i < last; i++) fp_ptr[i] = buf[m++]; } } diff --git a/src/GPU/pair_gayberne_gpu.cpp b/src/GPU/pair_gayberne_gpu.cpp index 967817bc36..80ea3af902 100644 --- a/src/GPU/pair_gayberne_gpu.cpp +++ b/src/GPU/pair_gayberne_gpu.cpp @@ -145,7 +145,7 @@ void PairGayBerneGPU::compute(int eflag, int vflag) void PairGayBerneGPU::init_style() { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR, "Pair gayberne/gpu requires atom style ellipsoid"); if (!atom->ellipsoid_flag) error->all(FLERR, "Pair gayberne/gpu requires atom style ellipsoid"); diff --git a/src/GPU/pair_resquared_gpu.cpp b/src/GPU/pair_resquared_gpu.cpp index cfe871be2b..8992f615ee 100644 --- a/src/GPU/pair_resquared_gpu.cpp +++ b/src/GPU/pair_resquared_gpu.cpp @@ -59,7 +59,7 @@ enum { SPHERE_SPHERE, SPHERE_ELLIPSE, ELLIPSE_SPHERE, ELLIPSE_ELLIPSE }; PairRESquaredGPU::PairRESquaredGPU(LAMMPS *lmp) : PairRESquared(lmp), gpu_mode(GPU_FORCE) { reinitflag = 0; - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR, "Pair resquared/gpu requires atom style ellipsoid"); quat_nmax = 0; quat = nullptr; diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index c388db4a2c..d0fd3e66ea 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -514,7 +514,7 @@ void PPPMGPU::poisson_ik() void PPPMGPU::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; int n = 0; @@ -574,7 +574,7 @@ void PPPMGPU::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) void PPPMGPU::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; int n = 0; @@ -634,7 +634,7 @@ void PPPMGPU::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) void PPPMGPU::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; if (flag == REVERSE_RHO_GPU) { FFT_SCALAR *src = &density_brick_gpu[nzlo_out][nylo_out][nxlo_out]; @@ -653,7 +653,7 @@ void PPPMGPU::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) void PPPMGPU::unpack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; if (flag == REVERSE_RHO_GPU) { FFT_SCALAR *dest = &density_brick_gpu[nzlo_out][nylo_out][nxlo_out]; @@ -679,9 +679,9 @@ FFT_SCALAR ***PPPMGPU::create_3d_offset(int n1lo, int n1hi, int n2lo, int n2hi, int n2 = n2hi - n2lo + 1; int n3 = n3hi - n3lo + 1; - FFT_SCALAR **plane = (FFT_SCALAR **) + auto plane = (FFT_SCALAR **) memory->smalloc(n1*n2*sizeof(FFT_SCALAR *),name); - FFT_SCALAR ***array = (FFT_SCALAR ***) + auto array = (FFT_SCALAR ***) memory->smalloc(n1*sizeof(FFT_SCALAR **),name); int n = 0; diff --git a/src/GRANULAR/fix_damping_cundall.cpp b/src/GRANULAR/fix_damping_cundall.cpp index ee4cfaa950..20b7de976a 100644 --- a/src/GRANULAR/fix_damping_cundall.cpp +++ b/src/GRANULAR/fix_damping_cundall.cpp @@ -36,7 +36,7 @@ enum { NONE, TYPE, VARIABLE }; FixDampingCundall::FixDampingCundall(LAMMPS *_lmp, int narg, char **arg) : Fix(_lmp, narg, arg), scalegamma(nullptr), scaleval(nullptr), scalevarid(nullptr), - scalestyle(NONE) + scalestyle(NONE), scalevar(-1) { dynamic_group_allow = 1; @@ -115,7 +115,7 @@ void FixDampingCundall::init() int max_respa = 0; if (utils::strmatch(update->integrate_style, "^respa")) { - ilevel_respa = max_respa = ((Respa *) update->integrate)->nlevels - 1; + ilevel_respa = max_respa = (dynamic_cast( update->integrate))->nlevels - 1; if (respa_level >= 0) ilevel_respa = MIN(respa_level, max_respa); } @@ -143,9 +143,9 @@ void FixDampingCundall::setup(int vflag) if (utils::strmatch(update->integrate_style, "^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag, ilevel_respa, 0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/GRANULAR/fix_freeze.cpp b/src/GRANULAR/fix_freeze.cpp index 1e952ef132..d3ed4db921 100644 --- a/src/GRANULAR/fix_freeze.cpp +++ b/src/GRANULAR/fix_freeze.cpp @@ -73,11 +73,11 @@ void FixFreeze::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - int nlevels_respa = ((Respa *) update->integrate)->nlevels; + int nlevels_respa = (dynamic_cast( update->integrate))->nlevels; for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - ((Respa *) update->integrate)->copy_flevel_f(ilevel); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); } } } diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 34963430e3..2a25efc6f2 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -90,24 +90,24 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : if (strcmp(domain->regions[iregion]->style,"block") == 0) { region_style = 1; - xlo = ((RegBlock *) domain->regions[iregion])->xlo; - xhi = ((RegBlock *) domain->regions[iregion])->xhi; - ylo = ((RegBlock *) domain->regions[iregion])->ylo; - yhi = ((RegBlock *) domain->regions[iregion])->yhi; - zlo = ((RegBlock *) domain->regions[iregion])->zlo; - zhi = ((RegBlock *) domain->regions[iregion])->zhi; + xlo = (dynamic_cast( domain->regions[iregion]))->xlo; + xhi = (dynamic_cast( domain->regions[iregion]))->xhi; + ylo = (dynamic_cast( domain->regions[iregion]))->ylo; + yhi = (dynamic_cast( domain->regions[iregion]))->yhi; + zlo = (dynamic_cast( domain->regions[iregion]))->zlo; + zhi = (dynamic_cast( domain->regions[iregion]))->zhi; if (xlo < domain->boxlo[0] || xhi > domain->boxhi[0] || ylo < domain->boxlo[1] || yhi > domain->boxhi[1] || zlo < domain->boxlo[2] || zhi > domain->boxhi[2]) error->all(FLERR,"Insertion region extends outside simulation box"); } else if (strcmp(domain->regions[iregion]->style,"cylinder") == 0) { region_style = 2; - char axis = ((RegCylinder *) domain->regions[iregion])->axis; - xc = ((RegCylinder *) domain->regions[iregion])->c1; - yc = ((RegCylinder *) domain->regions[iregion])->c2; - rc = ((RegCylinder *) domain->regions[iregion])->radius; - zlo = ((RegCylinder *) domain->regions[iregion])->lo; - zhi = ((RegCylinder *) domain->regions[iregion])->hi; + char axis = (dynamic_cast( domain->regions[iregion]))->axis; + xc = (dynamic_cast( domain->regions[iregion]))->c1; + yc = (dynamic_cast( domain->regions[iregion]))->c2; + rc = (dynamic_cast( domain->regions[iregion]))->radius; + zlo = (dynamic_cast( domain->regions[iregion]))->lo; + zhi = (dynamic_cast( domain->regions[iregion]))->hi; if (axis != 'z') error->all(FLERR,"Must use a z-axis cylinder region with fix pour"); if (xc-rc < domain->boxlo[0] || xc+rc > domain->boxhi[0] || @@ -136,8 +136,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid atom type in fix pour mol command"); if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) - error->all(FLERR,"Fix pour molecule template ID must be same " - "as atom style template ID"); + error->all(FLERR,"Fix pour molecule template ID must be same as atom style template ID"); onemols[i]->check_attributes(0); // fix pour uses geoemetric center of molecule for insertion @@ -188,7 +187,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : auto fixlist = modify->get_fix_by_style("^gravity"); if (fixlist.size() != 1) error->all(FLERR,"There must be exactly one fix gravity defined for fix pour"); - auto fixgrav = (FixGravity *)fixlist.front(); + auto fixgrav = dynamic_cast(fixlist.front()); grav = -fixgrav->magnitude * force->ftm2v; @@ -312,7 +311,7 @@ void FixPour::init() auto fixlist = modify->get_fix_by_style("^gravity"); if (fixlist.size() != 1) error->all(FLERR,"There must be exactly one fix gravity defined for fix pour"); - auto fixgrav = (FixGravity *)fixlist.front(); + auto fixgrav = dynamic_cast(fixlist.front()); if (fixgrav->varflag != FixGravity::CONSTANT) error->all(FLERR,"Fix gravity for fix pour must be constant"); diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 256f6d6611..da7af48e82 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -498,7 +498,7 @@ void FixWallGran::init() dt = update->dt; if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; // check for FixRigid so can extract rigid body masses @@ -550,9 +550,9 @@ void FixWallGran::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); } } @@ -577,7 +577,7 @@ void FixWallGran::post_force(int /*vflag*/) if (neighbor->ago == 0 && fix_rigid) { int tmp; int *body = (int *) fix_rigid->extract("body",tmp); - double *mass_body = (double *) fix_rigid->extract("masstotal",tmp); + auto mass_body = (double *) fix_rigid->extract("masstotal",tmp); if (atom->nmax > nmax) { memory->destroy(mass_rigid); nmax = atom->nmax; diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 45905aea1c..f04b03b340 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -134,7 +134,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) if (neighbor->ago == 0 && fix_rigid) { int tmp; int *body = (int *) fix_rigid->extract("body",tmp); - double *mass_body = (double *) fix_rigid->extract("masstotal",tmp); + auto mass_body = (double *) fix_rigid->extract("masstotal",tmp); if (atom->nmax > nmax) { memory->destroy(mass_rigid); nmax = atom->nmax; diff --git a/src/GRANULAR/pair_gran_hertz_history.cpp b/src/GRANULAR/pair_gran_hertz_history.cpp index 2320b7a8fb..04fc0cf6f0 100644 --- a/src/GRANULAR/pair_gran_hertz_history.cpp +++ b/src/GRANULAR/pair_gran_hertz_history.cpp @@ -45,7 +45,7 @@ void PairGranHertzHistory::compute(int eflag, int vflag) { int i,j,ii,jj,inum,jnum; double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz; - double radi,radj,radsum,rsq,r,rinv,rsqinv; + double radi,radj,radsum,rsq,r,rinv,rsqinv,factor_lj; double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3; double wr1,wr2,wr3; double vtr1,vtr2,vtr3,vrel; @@ -68,7 +68,7 @@ void PairGranHertzHistory::compute(int eflag, int vflag) if (fix_rigid && neighbor->ago == 0) { int tmp; int *body = (int *) fix_rigid->extract("body",tmp); - double *mass_body = (double *) fix_rigid->extract("masstotal",tmp); + auto mass_body = (double *) fix_rigid->extract("masstotal",tmp); if (atom->nmax > nmax) { memory->destroy(mass_rigid); nmax = atom->nmax; @@ -91,6 +91,7 @@ void PairGranHertzHistory::compute(int eflag, int vflag) int *mask = atom->mask; int nlocal = atom->nlocal; int newton_pair = force->newton_pair; + double *special_lj = force->special_lj; inum = list->inum; ilist = list->ilist; @@ -114,8 +115,11 @@ void PairGranHertzHistory::compute(int eflag, int vflag) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; + factor_lj = special_lj[sbmask(j)]; j &= NEIGHMASK; + if (factor_lj == 0) continue; + delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; delz = ztmp - x[j][2]; @@ -247,6 +251,9 @@ void PairGranHertzHistory::compute(int eflag, int vflag) fx = delx*ccel + fs1; fy = dely*ccel + fs2; fz = delz*ccel + fs3; + fx *= factor_lj; + fy *= factor_lj; + fz *= factor_lj; f[i][0] += fx; f[i][1] += fy; f[i][2] += fz; @@ -254,6 +261,9 @@ void PairGranHertzHistory::compute(int eflag, int vflag) tor1 = rinv * (dely*fs3 - delz*fs2); tor2 = rinv * (delz*fs1 - delx*fs3); tor3 = rinv * (delx*fs2 - dely*fs1); + tor1 *= factor_lj; + tor2 *= factor_lj; + tor3 *= factor_lj; torque[i][0] -= radi*tor1; torque[i][1] -= radi*tor2; torque[i][2] -= radi*tor3; diff --git a/src/GRANULAR/pair_gran_hooke.cpp b/src/GRANULAR/pair_gran_hooke.cpp index 5d3724f668..12ce25f7b3 100644 --- a/src/GRANULAR/pair_gran_hooke.cpp +++ b/src/GRANULAR/pair_gran_hooke.cpp @@ -42,7 +42,7 @@ void PairGranHooke::compute(int eflag, int vflag) { int i,j,ii,jj,inum,jnum; double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz; - double radi,radj,radsum,rsq,r,rinv,rsqinv; + double radi,radj,radsum,rsq,r,rinv,rsqinv,factor_lj; double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3; double wr1,wr2,wr3; double vtr1,vtr2,vtr3,vrel; @@ -59,7 +59,7 @@ void PairGranHooke::compute(int eflag, int vflag) if (fix_rigid && neighbor->ago == 0) { int tmp; int *body = (int *) fix_rigid->extract("body",tmp); - double *mass_body = (double *) fix_rigid->extract("masstotal",tmp); + auto mass_body = (double *) fix_rigid->extract("masstotal",tmp); if (atom->nmax > nmax) { memory->destroy(mass_rigid); nmax = atom->nmax; @@ -82,6 +82,7 @@ void PairGranHooke::compute(int eflag, int vflag) int *mask = atom->mask; int nlocal = atom->nlocal; int newton_pair = force->newton_pair; + double *special_lj = force->special_lj; inum = list->inum; ilist = list->ilist; @@ -101,8 +102,11 @@ void PairGranHooke::compute(int eflag, int vflag) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; + factor_lj = special_lj[sbmask(j)]; j &= NEIGHMASK; + if (factor_lj == 0) continue; + delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; delz = ztmp - x[j][2]; @@ -187,6 +191,9 @@ void PairGranHooke::compute(int eflag, int vflag) fx = delx*ccel + fs1; fy = dely*ccel + fs2; fz = delz*ccel + fs3; + fx *= factor_lj; + fy *= factor_lj; + fz *= factor_lj; f[i][0] += fx; f[i][1] += fy; f[i][2] += fz; @@ -194,6 +201,9 @@ void PairGranHooke::compute(int eflag, int vflag) tor1 = rinv * (dely*fs3 - delz*fs2); tor2 = rinv * (delz*fs1 - delx*fs3); tor3 = rinv * (delx*fs2 - dely*fs1); + tor1 *= factor_lj; + tor2 *= factor_lj; + tor3 *= factor_lj; torque[i][0] -= radi*tor1; torque[i][1] -= radi*tor2; torque[i][2] -= radi*tor3; diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp index 49eb1be89b..b231d50bcf 100644 --- a/src/GRANULAR/pair_gran_hooke_history.cpp +++ b/src/GRANULAR/pair_gran_hooke_history.cpp @@ -67,8 +67,8 @@ PairGranHookeHistory::PairGranHookeHistory(LAMMPS *lmp) : Pair(lmp) // this is so final order of Modify:fix will conform to input script fix_history = nullptr; - fix_dummy = (FixDummy *) modify->add_fix("NEIGH_HISTORY_HH_DUMMY" + std::to_string(instance_me) + - " all DUMMY"); + fix_dummy = dynamic_cast( modify->add_fix("NEIGH_HISTORY_HH_DUMMY" + std::to_string(instance_me) + + " all DUMMY")); } /* ---------------------------------------------------------------------- */ @@ -103,7 +103,7 @@ void PairGranHookeHistory::compute(int eflag, int vflag) { int i, j, ii, jj, inum, jnum; double xtmp, ytmp, ztmp, delx, dely, delz, fx, fy, fz; - double radi, radj, radsum, rsq, r, rinv, rsqinv; + double radi, radj, radsum, rsq, r, rinv, rsqinv, factor_lj; double vr1, vr2, vr3, vnnr, vn1, vn2, vn3, vt1, vt2, vt3; double wr1, wr2, wr3; double vtr1, vtr2, vtr3, vrel; @@ -126,7 +126,7 @@ void PairGranHookeHistory::compute(int eflag, int vflag) if (fix_rigid && neighbor->ago == 0) { int tmp; int *body = (int *) fix_rigid->extract("body", tmp); - double *mass_body = (double *) fix_rigid->extract("masstotal", tmp); + auto mass_body = (double *) fix_rigid->extract("masstotal", tmp); if (atom->nmax > nmax) { memory->destroy(mass_rigid); nmax = atom->nmax; @@ -151,6 +151,7 @@ void PairGranHookeHistory::compute(int eflag, int vflag) int *mask = atom->mask; int nlocal = atom->nlocal; int newton_pair = force->newton_pair; + double *special_lj = force->special_lj; inum = list->inum; ilist = list->ilist; @@ -174,8 +175,11 @@ void PairGranHookeHistory::compute(int eflag, int vflag) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; + factor_lj = special_lj[sbmask(j)]; j &= NEIGHMASK; + if (factor_lj == 0) continue; + delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; delz = ztmp - x[j][2]; @@ -306,6 +310,9 @@ void PairGranHookeHistory::compute(int eflag, int vflag) fx = delx * ccel + fs1; fy = dely * ccel + fs2; fz = delz * ccel + fs3; + fx *= factor_lj; + fy *= factor_lj; + fz *= factor_lj; f[i][0] += fx; f[i][1] += fy; f[i][2] += fz; @@ -313,6 +320,9 @@ void PairGranHookeHistory::compute(int eflag, int vflag) tor1 = rinv * (dely * fs3 - delz * fs2); tor2 = rinv * (delz * fs1 - delx * fs3); tor3 = rinv * (delx * fs2 - dely * fs1); + tor1 *= factor_lj; + tor2 *= factor_lj; + tor3 *= factor_lj; torque[i][0] -= radi * tor1; torque[i][1] -= radi * tor2; torque[i][2] -= radi * tor3; @@ -444,8 +454,8 @@ void PairGranHookeHistory::init_style() if (history && (fix_history == nullptr)) { auto cmd = fmt::format("NEIGH_HISTORY_HH{} all NEIGH_HISTORY {}", instance_me, size_history); - fix_history = (FixNeighHistory *) modify->replace_fix( - "NEIGH_HISTORY_HH_DUMMY" + std::to_string(instance_me), cmd, 1); + fix_history = dynamic_cast( modify->replace_fix( + "NEIGH_HISTORY_HH_DUMMY" + std::to_string(instance_me), cmd, 1)); fix_history->pair = this; } @@ -511,7 +521,7 @@ void PairGranHookeHistory::init_style() // set fix which stores history info if (history) { - fix_history = (FixNeighHistory *) modify->get_fix_by_id("NEIGH_HISTORY_HH" + std::to_string(instance_me)); + fix_history = dynamic_cast( modify->get_fix_by_id("NEIGH_HISTORY_HH" + std::to_string(instance_me))); if (!fix_history) error->all(FLERR,"Could not find pair fix neigh history ID"); } } diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index e1719853a4..a8e47bb9fc 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -102,7 +102,7 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) // this is so final order of Modify:fix will conform to input script fix_history = nullptr; - fix_dummy = (FixDummy *) modify->add_fix("NEIGH_HISTORY_GRANULAR_DUMMY all DUMMY"); + fix_dummy = dynamic_cast( modify->add_fix("NEIGH_HISTORY_GRANULAR_DUMMY all DUMMY")); } /* ---------------------------------------------------------------------- */ @@ -150,7 +150,7 @@ void PairGranular::compute(int eflag, int vflag) { int i,j,ii,jj,inum,jnum,itype,jtype; double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz,nx,ny,nz; - double radi,radj,radsum,rsq,r,rinv; + double radi,radj,radsum,rsq,r,rinv,factor_lj; double Reff, delta, dR, dR2, dist_to_contact; double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3; @@ -188,7 +188,7 @@ void PairGranular::compute(int eflag, int vflag) double *history,*allhistory,**firsthistory; bool touchflag = false; - const bool historyupdate = (update->setupflag) ? false : true; + const bool historyupdate = update->setupflag != 0; ev_init(eflag,vflag); @@ -199,7 +199,7 @@ void PairGranular::compute(int eflag, int vflag) if (fix_rigid && neighbor->ago == 0) { int tmp; int *body = (int *) fix_rigid->extract("body",tmp); - double *mass_body = (double *) fix_rigid->extract("masstotal",tmp); + auto mass_body = (double *) fix_rigid->extract("masstotal",tmp); if (atom->nmax > nmax) { memory->destroy(mass_rigid); nmax = atom->nmax; @@ -222,6 +222,7 @@ void PairGranular::compute(int eflag, int vflag) double *rmass = atom->rmass; int *mask = atom->mask; int nlocal = atom->nlocal; + double *special_lj = force->special_lj; inum = list->inum; ilist = list->ilist; @@ -249,8 +250,11 @@ void PairGranular::compute(int eflag, int vflag) for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; + factor_lj = special_lj[sbmask(j)]; j &= NEIGHMASK; + if (factor_lj == 0) continue; + delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; delz = ztmp - x[j][2]; @@ -651,6 +655,9 @@ void PairGranular::compute(int eflag, int vflag) fx = nx*Fntot + fs1; fy = ny*Fntot + fs2; fz = nz*Fntot + fs3; + fx *= factor_lj; + fy *= factor_lj; + fz *= factor_lj; f[i][0] += fx; f[i][1] += fy; @@ -659,6 +666,9 @@ void PairGranular::compute(int eflag, int vflag) tor1 = ny*fs3 - nz*fs2; tor2 = nz*fs1 - nx*fs3; tor3 = nx*fs2 - ny*fs1; + tor1 *= factor_lj; + tor2 *= factor_lj; + tor3 *= factor_lj; dist_to_contact = radi-0.5*delta; torque[i][0] -= dist_to_contact*tor1; @@ -666,9 +676,9 @@ void PairGranular::compute(int eflag, int vflag) torque[i][2] -= dist_to_contact*tor3; if (twist_model[itype][jtype] != TWIST_NONE) { - tortwist1 = magtortwist * nx; - tortwist2 = magtortwist * ny; - tortwist3 = magtortwist * nz; + tortwist1 = magtortwist * nx * factor_lj; + tortwist2 = magtortwist * ny * factor_lj; + tortwist3 = magtortwist * nz * factor_lj; torque[i][0] += tortwist1; torque[i][1] += tortwist2; @@ -676,9 +686,9 @@ void PairGranular::compute(int eflag, int vflag) } if (roll_model[itype][jtype] != ROLL_NONE) { - torroll1 = Reff*(ny*fr3 - nz*fr2); // n cross fr - torroll2 = Reff*(nz*fr1 - nx*fr3); - torroll3 = Reff*(nx*fr2 - ny*fr1); + torroll1 = Reff*(ny*fr3 - nz*fr2) * factor_lj; // n cross fr + torroll2 = Reff*(nz*fr1 - nx*fr3) * factor_lj; + torroll3 = Reff*(nx*fr2 - ny*fr1) * factor_lj; torque[i][0] += torroll1; torque[i][1] += torroll2; @@ -1120,10 +1130,10 @@ void PairGranular::init_style() // this is so its order in the fix list is preserved if (use_history && fix_history == nullptr) { - fix_history = (FixNeighHistory *) modify->replace_fix("NEIGH_HISTORY_GRANULAR_DUMMY", + fix_history = dynamic_cast( modify->replace_fix("NEIGH_HISTORY_GRANULAR_DUMMY", "NEIGH_HISTORY_GRANULAR" " all NEIGH_HISTORY " - + std::to_string(size_history),1); + + std::to_string(size_history),1)); fix_history->pair = this; } @@ -1189,7 +1199,7 @@ void PairGranular::init_style() // set fix which stores history info if (size_history > 0) { - fix_history = (FixNeighHistory *) modify->get_fix_by_id("NEIGH_HISTORY_GRANULAR"); + fix_history = dynamic_cast( modify->get_fix_by_id("NEIGH_HISTORY_GRANULAR")); if (!fix_history) error->all(FLERR,"Could not find pair fix neigh history ID"); } } diff --git a/src/INTEL/dihedral_charmm_intel.cpp b/src/INTEL/dihedral_charmm_intel.cpp index fc416537fe..b36e5ab505 100644 --- a/src/INTEL/dihedral_charmm_intel.cpp +++ b/src/INTEL/dihedral_charmm_intel.cpp @@ -266,7 +266,7 @@ void DihedralCharmmIntel::eval(const int vflag, const flt_t tk = fc.fc[type].k; const int m = fc.fc[type].multiplicity; - flt_t p = (flt_t)1.0; + auto p = (flt_t)1.0; flt_t ddf1, df1; ddf1 = df1 = (flt_t)0.0; @@ -384,7 +384,7 @@ void DihedralCharmmIntel::eval(const int vflag, } if (EFLAG || VFLAG) { - flt_t ev_pre = (flt_t)0; + auto ev_pre = (flt_t)0; if (NEWTON_BOND || i1 < nlocal) ev_pre += (flt_t)0.5; if (NEWTON_BOND || i4 < nlocal) diff --git a/src/INTEL/dihedral_fourier_intel.cpp b/src/INTEL/dihedral_fourier_intel.cpp index ec15afe8e1..68e9fedd44 100644 --- a/src/INTEL/dihedral_fourier_intel.cpp +++ b/src/INTEL/dihedral_fourier_intel.cpp @@ -221,7 +221,7 @@ void DihedralFourierIntel::eval(const int vflag, if (c < (flt_t)-1.0) c = (flt_t)-1.0; flt_t deng; - flt_t df = (flt_t)0.0; + auto df = (flt_t)0.0; if (EFLAG) deng = (flt_t)0.0; for (int j = 0; j < nterms[type]; j++) { @@ -230,7 +230,7 @@ void DihedralFourierIntel::eval(const int vflag, const flt_t tk = fc.fc[j][type].k; const int m = fc.fc[j][type].multiplicity; - flt_t p = (flt_t)1.0; + auto p = (flt_t)1.0; flt_t ddf1, df1; ddf1 = df1 = (flt_t)0.0; diff --git a/src/INTEL/dihedral_harmonic_intel.cpp b/src/INTEL/dihedral_harmonic_intel.cpp index cb23d9dcaa..9b504be3ca 100644 --- a/src/INTEL/dihedral_harmonic_intel.cpp +++ b/src/INTEL/dihedral_harmonic_intel.cpp @@ -225,7 +225,7 @@ void DihedralHarmonicIntel::eval(const int vflag, const flt_t tk = fc.fc[type].k; const int m = fc.fc[type].multiplicity; - flt_t p = (flt_t)1.0; + auto p = (flt_t)1.0; flt_t ddf1, df1; ddf1 = df1 = (flt_t)0.0; diff --git a/src/INTEL/fix_intel.cpp b/src/INTEL/fix_intel.cpp index 933c90e9e8..4f81293e1b 100644 --- a/src/INTEL/fix_intel.cpp +++ b/src/INTEL/fix_intel.cpp @@ -71,11 +71,11 @@ FixIntel::FixIntel(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) _offload_threads = 0; _offload_tpc = 4; - _force_array_s = 0; - _force_array_m = 0; - _force_array_d = 0; - _ev_array_s = 0; - _ev_array_d = 0; + _force_array_s = nullptr; + _force_array_m = nullptr; + _force_array_d = nullptr; + _ev_array_s = nullptr; + _ev_array_d = nullptr; #ifdef _LMP_INTEL_OFFLOAD if (ncops < 0) error->all(FLERR,"Illegal package intel command"); @@ -375,7 +375,7 @@ void FixIntel::setup_pre_reverse(int eflag, int vflag) bool FixIntel::pair_hybrid_check() { - PairHybrid *ph = (PairHybrid *)force->pair; + auto ph = dynamic_cast(force->pair); bool has_intel = false; int nstyles = ph->nstyles; @@ -557,30 +557,30 @@ void FixIntel::_sync_main_arrays(const int prereverse) if (!prereverse) _zero_master = 1; int done_this_step = prereverse; if (_pair_hybrid_zero == 0) done_this_step = 1; - if (_force_array_m != 0) { + if (_force_array_m != nullptr) { if (_need_reduce) { reduce_results(&_force_array_m[0].x); _need_reduce = 0; } add_results(_force_array_m, _ev_array_d, _results_eatom, _results_vatom,0); - if (done_this_step) _force_array_m = 0; - else _ev_array_d = 0; - } else if (_force_array_d != 0) { + if (done_this_step) _force_array_m = nullptr; + else _ev_array_d = nullptr; + } else if (_force_array_d != nullptr) { if (_need_reduce) { reduce_results(&_force_array_d[0].x); _need_reduce = 0; } add_results(_force_array_d, _ev_array_d, _results_eatom, _results_vatom,0); - if (done_this_step) _force_array_d = 0; - else _ev_array_d = 0; - } else if (_force_array_s != 0) { + if (done_this_step) _force_array_d = nullptr; + else _ev_array_d = nullptr; + } else if (_force_array_s != nullptr) { if (_need_reduce) { reduce_results(&_force_array_s[0].x); _need_reduce = 0; } add_results(_force_array_s, _ev_array_s, _results_eatom, _results_vatom,0); - if (done_this_step) _force_array_s = 0; - else _ev_array_s = 0; + if (done_this_step) _force_array_s = nullptr; + else _ev_array_s = nullptr; } #ifdef _LMP_INTEL_OFFLOAD diff --git a/src/INTEL/fix_nh_intel.cpp b/src/INTEL/fix_nh_intel.cpp index 91709aa13f..ada9b4113c 100644 --- a/src/INTEL/fix_nh_intel.cpp +++ b/src/INTEL/fix_nh_intel.cpp @@ -46,7 +46,7 @@ typedef struct { double x,y,z; } dbl3_t; FixNHIntel::FixNHIntel(LAMMPS *lmp, int narg, char **arg) : FixNH(lmp, narg, arg) { - _dtfm = 0; + _dtfm = nullptr; _nlocal3 = 0; _nlocal_max = 0; } @@ -76,7 +76,7 @@ void FixNHIntel::remap() double oldlo,oldhi; double expfac; - dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const x = (dbl3_t *) atom->x[0]; int *mask = atom->mask; int nlocal = atom->nlocal; double *h = domain->h; @@ -416,7 +416,7 @@ void FixNHIntel::nh_v_press() return; } - dbl3_t * _noalias const v = (dbl3_t *)atom->v[0]; + auto * _noalias const v = (dbl3_t *)atom->v[0]; int *mask = atom->mask; int nlocal = atom->nlocal; if (igroup == atom->firstgroup) nlocal = atom->nfirst; diff --git a/src/INTEL/fix_nve_asphere_intel.cpp b/src/INTEL/fix_nve_asphere_intel.cpp index eda8b48a67..fa68c9bb4a 100644 --- a/src/INTEL/fix_nve_asphere_intel.cpp +++ b/src/INTEL/fix_nve_asphere_intel.cpp @@ -37,19 +37,19 @@ using namespace FixConst; FixNVEAsphereIntel::FixNVEAsphereIntel(LAMMPS *lmp, int narg, char **arg) : FixNVE(lmp, narg, arg) { - _dtfm = 0; + _dtfm = nullptr; _nlocal3 = 0; _nlocal_max = 0; - _inertia0 = 0; - _inertia1 = 0; - _inertia2 = 0; + _inertia0 = nullptr; + _inertia1 = nullptr; + _inertia2 = nullptr; } /* ---------------------------------------------------------------------- */ void FixNVEAsphereIntel::init() { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid"); diff --git a/src/INTEL/fix_nve_intel.cpp b/src/INTEL/fix_nve_intel.cpp index 9670af65c2..249e797713 100644 --- a/src/INTEL/fix_nve_intel.cpp +++ b/src/INTEL/fix_nve_intel.cpp @@ -32,7 +32,7 @@ using namespace FixConst; FixNVEIntel::FixNVEIntel(LAMMPS *lmp, int narg, char **arg) : FixNVE(lmp, narg, arg) { - _dtfm = 0; + _dtfm = nullptr; _nlocal3 = 0; _nlocal_max = 0; } diff --git a/src/INTEL/fix_nvt_sllod_intel.cpp b/src/INTEL/fix_nvt_sllod_intel.cpp index f704512c51..bc13d1d677 100644 --- a/src/INTEL/fix_nvt_sllod_intel.cpp +++ b/src/INTEL/fix_nvt_sllod_intel.cpp @@ -70,7 +70,7 @@ void FixNVTSllodIntel::init() int i; for (i = 0; i < modify->nfix; i++) if (strncmp(modify->fix[i]->style,"deform",6) == 0) { - if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP) + if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform " "remap option"); break; diff --git a/src/INTEL/intel_buffers.cpp b/src/INTEL/intel_buffers.cpp index f84505955c..535fa5605e 100644 --- a/src/INTEL/intel_buffers.cpp +++ b/src/INTEL/intel_buffers.cpp @@ -26,18 +26,18 @@ using namespace LAMMPS_NS; template IntelBuffers::IntelBuffers(class LAMMPS *lmp_in) : - lmp(lmp_in), _x(0), _q(0), _quat(0), _f(0), _off_threads(0), + lmp(lmp_in), _x(nullptr), _q(nullptr), _quat(nullptr), _f(nullptr), _off_threads(0), _n_list_ptrs(1), _max_list_ptrs(4), _buf_size(0), _buf_local_size(0) { _neigh_list_ptrs = new IntelNeighListPtrs[_max_list_ptrs]; - _neigh_list_ptrs[0].cnumneigh = 0; + _neigh_list_ptrs[0].cnumneigh = nullptr; _list_alloc_atoms = 0; _ntypes = 0; _off_map_listlocal = 0; - _ccachex = 0; + _ccachex = nullptr; _ncache_alloc = 0; - _ncachetag = 0; - _cutneighsq = 0; - _cutneighghostsq = 0; + _ncachetag = nullptr; + _cutneighsq = nullptr; + _cutneighghostsq = nullptr; _need_tag = 0; #ifdef _LMP_INTEL_OFFLOAD _separate_buffers = 0; @@ -104,8 +104,8 @@ void IntelBuffers::free_buffers() #endif lmp->memory->destroy(x); - if (q != 0) lmp->memory->destroy(q); - if (quat != 0) lmp->memory->destroy(quat); + if (q != nullptr) lmp->memory->destroy(q); + if (quat != nullptr) lmp->memory->destroy(quat); lmp->memory->destroy(_f); _buf_size = _buf_local_size = 0; } @@ -251,7 +251,7 @@ void IntelBuffers::free_list_local() if (_off_map_listlocal > 0) { if (_neigh_list_ptrs[0].cnumneigh) { int * cnumneigh = _neigh_list_ptrs[0].cnumneigh; - _neigh_list_ptrs[0].cnumneigh = 0; + _neigh_list_ptrs[0].cnumneigh = nullptr; #ifdef _LMP_INTEL_OFFLOAD if (_off_map_ilist != nullptr) { #pragma offload_transfer target(mic:_cop) \ @@ -286,7 +286,7 @@ void IntelBuffers::free_list_ptrs() lmp->memory->destroy(_neigh_list_ptrs[list_num].numneighhalf); } _neigh_list_ptrs[list_num].size = 0; - _neigh_list_ptrs[list_num].list_ptr = 0; + _neigh_list_ptrs[list_num].list_ptr = nullptr; } _n_list_ptrs = 1; } @@ -303,7 +303,7 @@ void IntelBuffers::grow_data3(NeighList *list, int *&numneighhalf, if (list_num == _n_list_ptrs) { if (_n_list_ptrs == _max_list_ptrs) { _max_list_ptrs *= 2; - IntelNeighListPtrs *new_list = new IntelNeighListPtrs[_max_list_ptrs]; + auto new_list = new IntelNeighListPtrs[_max_list_ptrs]; for (int i = 0; i < _n_list_ptrs; i++) new_list[i] = _neigh_list_ptrs[i]; delete []_neigh_list_ptrs; _neigh_list_ptrs = new_list; @@ -447,7 +447,7 @@ void IntelBuffers::free_ccache() lmp->memory->destroy(ccachef); #endif - _ccachex = 0; + _ccachex = nullptr; } } @@ -546,7 +546,7 @@ void IntelBuffers::free_ncache() if (ncachetag) lmp->memory->destroy(ncachetag); _ncache_alloc = 0; - _ncachetag = 0; + _ncachetag = nullptr; } } @@ -563,7 +563,7 @@ void IntelBuffers::grow_ncache(const int off_flag, const int vsize = _ncache_stride * nt; if (_ncache_alloc) { - if (vsize > _ncache_alloc || (need_tag() && _ncachetag == 0)) + if (vsize > _ncache_alloc || (need_tag() && _ncachetag == nullptr)) free_ncache(); #ifdef _LMP_INTEL_OFFLOAD else if (off_flag && _off_ncache == 0) @@ -660,7 +660,7 @@ void IntelBuffers::set_ntypes(const int ntypes, } #endif lmp->memory->destroy(_cutneighsq); - if (_cutneighghostsq != 0) lmp->memory->destroy(_cutneighghostsq); + if (_cutneighghostsq != nullptr) lmp->memory->destroy(_cutneighghostsq); } if (ntypes > 0) { lmp->memory->create(_cutneighsq, ntypes, ntypes, "_cutneighsq"); diff --git a/src/INTEL/npair_full_bin_ghost_intel.cpp b/src/INTEL/npair_full_bin_ghost_intel.cpp index 1f4e41be49..b0c052d35b 100644 --- a/src/INTEL/npair_full_bin_ghost_intel.cpp +++ b/src/INTEL/npair_full_bin_ghost_intel.cpp @@ -118,7 +118,7 @@ void NPairFullBinGhostIntel::fbi(const int offload, NeighList * list, const ATOM_T * _noalias const x = buffers->get_x(); int * _noalias const intel_list = buffers->intel_list(list); - int ** _noalias const firstneigh = list->firstneigh; + int ** _noalias const firstneigh = list->firstneigh; // NOLINT const int e_nall = nall_t; const int molecular = atom->molecular; diff --git a/src/INTEL/npair_halffull_newton_intel.cpp b/src/INTEL/npair_halffull_newton_intel.cpp index fe2ddb375a..6755ffc799 100644 --- a/src/INTEL/npair_halffull_newton_intel.cpp +++ b/src/INTEL/npair_halffull_newton_intel.cpp @@ -54,8 +54,7 @@ void NPairHalffullNewtonIntel::build_t(NeighList *list, int ** _noalias const firstneigh = list->firstneigh; const int * _noalias const ilist_full = list->listfull->ilist; const int * _noalias const numneigh_full = list->listfull->numneigh; - const int ** _noalias const firstneigh_full = - (const int ** const)list->listfull->firstneigh; + const int ** _noalias const firstneigh_full = (const int ** const)list->listfull->firstneigh; // NOLINT #if defined(_OPENMP) #pragma omp parallel @@ -141,8 +140,7 @@ void NPairHalffullNewtonIntel::build_t3(NeighList *list, int *numhalf) int ** _noalias const firstneigh = list->firstneigh; const int * _noalias const ilist_full = list->listfull->ilist; const int * _noalias const numneigh_full = numhalf; - const int ** _noalias const firstneigh_full = - (const int ** const)list->listfull->firstneigh; + const int ** _noalias const firstneigh_full = (const int ** const)list->listfull->firstneigh; // NOLINT int packthreads = 1; if (comm->nthreads > INTEL_HTHREADS) packthreads = comm->nthreads; diff --git a/src/INTEL/npair_skip_intel.cpp b/src/INTEL/npair_skip_intel.cpp index 1ebbe9c383..6f34463ac8 100644 --- a/src/INTEL/npair_skip_intel.cpp +++ b/src/INTEL/npair_skip_intel.cpp @@ -36,7 +36,7 @@ NPairSkipIntel::NPairSkipIntel(LAMMPS *lmp) : NPair(lmp) { if (!_fix) error->all(FLERR, "The 'package intel' command is required for /intel styles"); _inum_starts = new int[comm->nthreads]; _inum_counts = new int[comm->nthreads]; - _full_props = 0; + _full_props = nullptr; } /* ---------------------------------------------------------------------- */ @@ -44,7 +44,7 @@ NPairSkipIntel::NPairSkipIntel(LAMMPS *lmp) : NPair(lmp) { NPairSkipIntel::~NPairSkipIntel() { delete []_inum_starts; delete []_inum_counts; - if (_full_props) delete []_full_props; + delete[] _full_props; } /* ---------------------------------------------------------------------- */ @@ -76,13 +76,12 @@ void NPairSkipIntel::build_t(NeighList *list, int *numhalf, int *cnumneigh, const int * _noalias const type = atom->type; int * _noalias const ilist = list->ilist; int * _noalias const numneigh = list->numneigh; - int ** _noalias const firstneigh = (int ** const)list->firstneigh; + int ** _noalias const firstneigh = (int ** const)list->firstneigh; // NOLINT const int * _noalias const ilist_skip = list->listskip->ilist; const int * _noalias const numneigh_skip = list->listskip->numneigh; - const int ** _noalias const firstneigh_skip = - (const int ** const)list->listskip->firstneigh; + const int ** _noalias const firstneigh_skip = (const int ** const)list->listskip->firstneigh; // NOLINT const int * _noalias const iskip = list->iskip; - const int ** _noalias const ijskip = (const int ** const)list->ijskip; + const int ** _noalias const ijskip = (const int ** const)list->ijskip; // NOLINT int num_skip = list->listskip->inum; if (list->ghost) num_skip += list->listskip->gnum; @@ -203,11 +202,11 @@ void NPairSkipIntel::build(NeighList *list) if (_fix->three_body_neighbor()==0 || _full_props[list->listskip->index] == 0) { if (_fix->precision() == FixIntel::PREC_MODE_MIXED) - build_t(list, 0, 0, 0); + build_t(list, nullptr, nullptr, nullptr); else if (_fix->precision() == FixIntel::PREC_MODE_DOUBLE) - build_t(list, 0, 0, 0); + build_t(list, nullptr, nullptr, nullptr); else - build_t(list, 0, 0, 0); + build_t(list, nullptr, nullptr, nullptr); } else { int *nhalf, *cnumneigh, *nhalf_skip, *u; if (_fix->precision() == FixIntel::PREC_MODE_MIXED) { diff --git a/src/INTEL/pair_airebo_intel.cpp b/src/INTEL/pair_airebo_intel.cpp index 5b73ba99d2..939a1873a9 100644 --- a/src/INTEL/pair_airebo_intel.cpp +++ b/src/INTEL/pair_airebo_intel.cpp @@ -409,7 +409,7 @@ void PairAIREBOIntel::eval( ATOM_T * _noalias const x = buffers->get_x(offload); const int * _noalias const numneighhalf = buffers->get_atombin(); const int * _noalias const numneigh = list->numneigh; - const int ** _noalias const firstneigh = (const int **)list->firstneigh; + const int ** _noalias const firstneigh = (const int **)list->firstneigh; // NOLINT tagint * const tag = atom->tag; const int ntypes = atom->ntypes + 1; @@ -570,7 +570,7 @@ void PairAIREBOIntel::eval( if (EVFLAG) fix->add_result_array(f_start, ev_global, offload, eatom, 0, vflag); else - fix->add_result_array(f_start, 0, offload); + fix->add_result_array(f_start, nullptr, offload); } /* ---------------------------------------------------------------------- */ @@ -919,7 +919,7 @@ inline flt_t frebo_pij(KernelArgsAIREBOT * ka, int i, int j, if (pass == 0) { sum_pij += wik * g * ex_lam; sum_dpij_dN += wik * dgdN * ex_lam; - flt_t cutN = Sp(Nki, Nmin, Nmax, nullptr); + auto cutN = Sp(Nki, Nmin, Nmax, nullptr); *sum_N += (1 - ktype) * wik * cutN; } else { flt_t tmp = -0.5 * pij * pij * pij; @@ -1501,17 +1501,17 @@ inline flt_t ref_lennard_jones_bondorder(KernelArgsAIREBOT * ka, flt_t Nji = ka->nH[j] + ka->nC[j] - wij; flt_t NconjtmpI; acc_t fijc[3] = {0}, fjic[3] = {0}; - flt_t pij = frebo_pij(ka, i, j, delx * scale, dely * scale, + auto pij = frebo_pij(ka, i, j, delx * scale, dely * scale, delz * scale, the_r, wij, 0.0, &NconjtmpI, fijc); flt_t NconjtmpJ; - flt_t pji = frebo_pij(ka, j, i, -delx * scale, -dely * scale, + auto pji = frebo_pij(ka, j, i, -delx * scale, -dely * scale, -delz * scale, the_r, wij, 0.0, &NconjtmpJ, fjic); flt_t Nijconj = 1.0 + (NconjtmpI * NconjtmpI) + (NconjtmpJ * NconjtmpJ); flt_t dN3_pi_rc[3]; - flt_t pi_rc = frebo_pi_rc(ka, itype, jtype, Nij, Nji, Nijconj, + auto pi_rc = frebo_pi_rc(ka, itype, jtype, Nij, Nji, Nijconj, dN3_pi_rc); flt_t dN3_Tij[3]; - flt_t Tij = frebo_Tij(ka, itype, jtype, Nij, Nji, Nijconj, + auto Tij = frebo_Tij(ka, itype, jtype, Nij, Nji, Nijconj, dN3_Tij); flt_t sum_omega = 0; if (fabs(Tij) > TOL) { @@ -1522,12 +1522,12 @@ inline flt_t ref_lennard_jones_bondorder(KernelArgsAIREBOT * ka, flt_t pi_dh = Tij * sum_omega; flt_t bij = 0.5 * (pij + pji) + pi_rc + pi_dh; flt_t dStb; - flt_t Stb = Sp2(bij, ka->params.bLJmin[itype][jtype], + auto Stb = Sp2(bij, ka->params.bLJmin[itype][jtype], ka->params.bLJmax[itype][jtype], &dStb); if (dStb != 0) { - flt_t pij_reverse = frebo_pij(ka, i, j, delx * scale, + auto pij_reverse = frebo_pij(ka, i, j, delx * scale, dely * scale, delz * scale, the_r, wij, VA * dStb, &NconjtmpI, fijc); - flt_t pji_reverse = frebo_pij(ka, j, i, -delx * scale, + auto pji_reverse = frebo_pij(ka, j, i, -delx * scale, -dely * scale, -delz * scale, the_r, wij, VA * dStb, &NconjtmpJ, fjic); fijc[0] -= fjic[0]; fijc[1] -= fjic[1]; @@ -1537,7 +1537,7 @@ inline flt_t ref_lennard_jones_bondorder(KernelArgsAIREBOT * ka, frebo_N_spline_force(ka, j, i, VA * dStb, dN3_pi_rc[1], dN3_pi_rc[2], NconjtmpJ); if (fabs(Tij) > TOL) { - flt_t sum_omega_reverse = frebo_sum_omega(ka, i, j, + auto sum_omega_reverse = frebo_sum_omega(ka, i, j, delx * scale, dely * scale, delz * scale, the_r, VA * dStb * Tij, fijc); frebo_N_spline_force(ka, i, j, VA * dStb * sum_omega, dN3_Tij[0], dN3_Tij[2], NconjtmpI); diff --git a/src/INTEL/pair_buck_coul_cut_intel.cpp b/src/INTEL/pair_buck_coul_cut_intel.cpp index 934c5ec0b2..d113b913d1 100644 --- a/src/INTEL/pair_buck_coul_cut_intel.cpp +++ b/src/INTEL/pair_buck_coul_cut_intel.cpp @@ -145,7 +145,7 @@ void PairBuckCoulCutIntel::eval(const int offload, const int vflag, const int * _noalias const ilist = list->ilist; const int * _noalias const numneigh = list->numneigh; - const int ** _noalias const firstneigh = (const int **)list->firstneigh; + const int ** _noalias const firstneigh = (const int **)list->firstneigh; // NOLINT const flt_t * _noalias const special_coul = fc.special_coul; const flt_t * _noalias const special_lj = fc.special_lj; @@ -401,7 +401,7 @@ void PairBuckCoulCutIntel::eval(const int offload, const int vflag, if (EFLAG || vflag) fix->add_result_array(f_start, ev_global, offload, eatom, 0, vflag); else - fix->add_result_array(f_start, 0, offload); + fix->add_result_array(f_start, nullptr, offload); } /* ---------------------------------------------------------------------- */ diff --git a/src/INTEL/pair_buck_coul_long_intel.cpp b/src/INTEL/pair_buck_coul_long_intel.cpp index 563e3abafc..23ff301a81 100644 --- a/src/INTEL/pair_buck_coul_long_intel.cpp +++ b/src/INTEL/pair_buck_coul_long_intel.cpp @@ -146,7 +146,7 @@ void PairBuckCoulLongIntel::eval(const int offload, const int vflag, const int * _noalias const ilist = list->ilist; const int * _noalias const numneigh = list->numneigh; - const int ** _noalias const firstneigh = (const int **)list->firstneigh; + const int ** _noalias const firstneigh = (const int **)list->firstneigh; // NOLINT const flt_t * _noalias const special_coul = fc.special_coul; const flt_t * _noalias const special_lj = fc.special_lj; @@ -477,7 +477,7 @@ void PairBuckCoulLongIntel::eval(const int offload, const int vflag, if (EFLAG || vflag) fix->add_result_array(f_start, ev_global, offload, eatom, 0, vflag); else - fix->add_result_array(f_start, 0, offload); + fix->add_result_array(f_start, nullptr, offload); } /* ---------------------------------------------------------------------- */ diff --git a/src/INTEL/pair_buck_intel.cpp b/src/INTEL/pair_buck_intel.cpp index 54a4cc0be3..4472e91793 100644 --- a/src/INTEL/pair_buck_intel.cpp +++ b/src/INTEL/pair_buck_intel.cpp @@ -141,7 +141,7 @@ void PairBuckIntel::eval(const int offload, const int vflag, const int * _noalias const ilist = list->ilist; const int * _noalias const numneigh = list->numneigh; - const int ** _noalias const firstneigh = (const int **)list->firstneigh; + const int ** _noalias const firstneigh = (const int **)list->firstneigh; // NOLINT const flt_t * _noalias const special_lj = fc.special_lj; const C_FORCE_T * _noalias const c_force = fc.c_force[0]; @@ -368,7 +368,7 @@ void PairBuckIntel::eval(const int offload, const int vflag, if (EFLAG || vflag) fix->add_result_array(f_start, ev_global, offload, eatom, 0, vflag); else - fix->add_result_array(f_start, 0, offload); + fix->add_result_array(f_start, nullptr, offload); } void PairBuckIntel::init_style() diff --git a/src/INTEL/pair_dpd_intel.cpp b/src/INTEL/pair_dpd_intel.cpp index fe76e81a4e..06801b0ce0 100644 --- a/src/INTEL/pair_dpd_intel.cpp +++ b/src/INTEL/pair_dpd_intel.cpp @@ -179,12 +179,12 @@ void PairDPDIntel::eval(const int offload, const int vflag, ATOM_T * _noalias const x = buffers->get_x(offload); typedef struct { double x, y, z; } lmp_vt; - lmp_vt *v = (lmp_vt *)atom->v[0]; + auto *v = (lmp_vt *)atom->v[0]; const flt_t dtinvsqrt = 1.0/sqrt(update->dt); const int * _noalias const ilist = list->ilist; const int * _noalias const numneigh = list->numneigh; - const int ** _noalias const firstneigh = (const int **)list->firstneigh; + const int ** _noalias const firstneigh = (const int **)list->firstneigh; // NOLINT const FC_PACKED1_T * _noalias const param = fc.param[0]; const flt_t * _noalias const special_lj = fc.special_lj; int * _noalias const rngi_thread = fc.rngi; @@ -428,7 +428,7 @@ void PairDPDIntel::eval(const int offload, const int vflag, if (EFLAG || vflag) fix->add_result_array(f_start, ev_global, offload, eatom, 0, vflag); else - fix->add_result_array(f_start, 0, offload); + fix->add_result_array(f_start, nullptr, offload); } /* ---------------------------------------------------------------------- diff --git a/src/INTEL/pair_eam_intel.cpp b/src/INTEL/pair_eam_intel.cpp index 56188028cf..2a491e66c9 100644 --- a/src/INTEL/pair_eam_intel.cpp +++ b/src/INTEL/pair_eam_intel.cpp @@ -44,7 +44,7 @@ using namespace LAMMPS_NS; PairEAMIntel::PairEAMIntel(LAMMPS *lmp) : PairEAM(lmp) { suffix_flag |= Suffix::INTEL; - fp_float = 0; + fp_float = nullptr; } /* ---------------------------------------------------------------------- */ @@ -197,7 +197,7 @@ void PairEAMIntel::eval(const int offload, const int vflag, const int * _noalias const ilist = list->ilist; const int * _noalias const numneigh = list->numneigh; - const int ** _noalias const firstneigh = (const int **)list->firstneigh; + const int ** _noalias const firstneigh = (const int **)list->firstneigh; // NOLINT const FC_PACKED1_T * _noalias const rhor_spline_f = fc.rhor_spline_f; const FC_PACKED1_T * _noalias const rhor_spline_e = fc.rhor_spline_e; const FC_PACKED2_T * _noalias const z2r_spline_t = fc.z2r_spline_t; @@ -306,7 +306,7 @@ void PairEAMIntel::eval(const int offload, const int vflag, const flt_t ytmp = x[i].y; const flt_t ztmp = x[i].z; - acc_t rhoi = (acc_t)0.0; + auto rhoi = (acc_t)0.0; int ej = 0; #if defined(LMP_SIMD_COMPILER) #pragma vector aligned @@ -656,7 +656,7 @@ void PairEAMIntel::eval(const int offload, const int vflag, if (EFLAG || vflag) fix->add_result_array(f_start, ev_global, offload, eatom, 0, vflag); else - fix->add_result_array(f_start, 0, offload); + fix->add_result_array(f_start, nullptr, offload); } /* ---------------------------------------------------------------------- diff --git a/src/INTEL/pair_gayberne_intel.cpp b/src/INTEL/pair_gayberne_intel.cpp index 32f5f2fe78..c3ce8a8d43 100644 --- a/src/INTEL/pair_gayberne_intel.cpp +++ b/src/INTEL/pair_gayberne_intel.cpp @@ -235,7 +235,7 @@ void PairGayBerneIntel::eval(const int offload, const int vflag, const int * _noalias const ilist = list->ilist; const int * _noalias const numneigh = list->numneigh; - const int ** _noalias const firstneigh = (const int **)list->firstneigh; + const int ** _noalias const firstneigh = (const int **)list->firstneigh; // NOLINT const flt_t * _noalias const special_lj = fc.special_lj; const FC_PACKED1_T * _noalias const ijc = fc.ijc[0]; @@ -881,7 +881,7 @@ void PairGayBerneIntel::eval(const int offload, const int vflag, if (EFLAG || vflag) fix->add_result_array(f_start, ev_global, offload, eatom, 0, 2); else - fix->add_result_array(f_start, 0, offload, 0, 0, 2); + fix->add_result_array(f_start, nullptr, offload, 0, 0, 2); } /* ---------------------------------------------------------------------- */ diff --git a/src/INTEL/pair_lj_charmm_coul_charmm_intel.cpp b/src/INTEL/pair_lj_charmm_coul_charmm_intel.cpp index c5035d5f03..721108f8f1 100644 --- a/src/INTEL/pair_lj_charmm_coul_charmm_intel.cpp +++ b/src/INTEL/pair_lj_charmm_coul_charmm_intel.cpp @@ -145,7 +145,7 @@ void PairLJCharmmCoulCharmmIntel::eval(const int offload, const int vflag, const int * _noalias const ilist = list->ilist; const int * _noalias const numneigh = list->numneigh; - const int ** _noalias const firstneigh = (const int **)list->firstneigh; + const int ** _noalias const firstneigh = (const int **)list->firstneigh; // NOLINT const flt_t * _noalias const special_coul = fc.special_coul; const flt_t * _noalias const special_lj = fc.special_lj; @@ -448,7 +448,7 @@ void PairLJCharmmCoulCharmmIntel::eval(const int offload, const int vflag, if (EFLAG || vflag) fix->add_result_array(f_start, ev_global, offload, eatom, 0, vflag); else - fix->add_result_array(f_start, 0, offload); + fix->add_result_array(f_start, nullptr, offload); } /* ---------------------------------------------------------------------- */ diff --git a/src/INTEL/pair_lj_charmm_coul_long_intel.cpp b/src/INTEL/pair_lj_charmm_coul_long_intel.cpp index 850429cd1b..e78797deb0 100644 --- a/src/INTEL/pair_lj_charmm_coul_long_intel.cpp +++ b/src/INTEL/pair_lj_charmm_coul_long_intel.cpp @@ -149,7 +149,7 @@ void PairLJCharmmCoulLongIntel::eval(const int offload, const int vflag, const int * _noalias const ilist = list->ilist; const int * _noalias const numneigh = list->numneigh; - const int ** _noalias const firstneigh = (const int **)list->firstneigh; + const int ** _noalias const firstneigh = (const int **)list->firstneigh; // NOLINT const flt_t * _noalias const special_coul = fc.special_coul; const flt_t * _noalias const special_lj = fc.special_lj; @@ -513,7 +513,7 @@ void PairLJCharmmCoulLongIntel::eval(const int offload, const int vflag, if (EFLAG || vflag) fix->add_result_array(f_start, ev_global, offload, eatom, 0, vflag); else - fix->add_result_array(f_start, 0, offload); + fix->add_result_array(f_start, nullptr, offload); } /* ---------------------------------------------------------------------- */ diff --git a/src/INTEL/pair_lj_cut_coul_long_intel.cpp b/src/INTEL/pair_lj_cut_coul_long_intel.cpp index a13cfbc148..2ab2e35a56 100644 --- a/src/INTEL/pair_lj_cut_coul_long_intel.cpp +++ b/src/INTEL/pair_lj_cut_coul_long_intel.cpp @@ -148,7 +148,7 @@ void PairLJCutCoulLongIntel::eval(const int offload, const int vflag, const int * _noalias const ilist = list->ilist; const int * _noalias const numneigh = list->numneigh; - const int ** _noalias const firstneigh = (const int **)list->firstneigh; + const int ** _noalias const firstneigh = (const int **)list->firstneigh; // NOLINT const flt_t * _noalias const special_coul = fc.special_coul; const flt_t * _noalias const special_lj = fc.special_lj; @@ -478,7 +478,7 @@ void PairLJCutCoulLongIntel::eval(const int offload, const int vflag, if (EFLAG || vflag) fix->add_result_array(f_start, ev_global, offload, eatom, 0, vflag); else - fix->add_result_array(f_start, 0, offload); + fix->add_result_array(f_start, nullptr, offload); } /* ---------------------------------------------------------------------- */ diff --git a/src/INTEL/pair_lj_cut_intel.cpp b/src/INTEL/pair_lj_cut_intel.cpp index 50205cfc49..1f3169ab26 100644 --- a/src/INTEL/pair_lj_cut_intel.cpp +++ b/src/INTEL/pair_lj_cut_intel.cpp @@ -157,7 +157,7 @@ void PairLJCutIntel::eval(const int offload, const int vflag, const int * _noalias const ilist = list->ilist; const int * _noalias const numneigh = list->numneigh; - const int ** _noalias const firstneigh = (const int **)list->firstneigh; + const int ** _noalias const firstneigh = (const int **)list->firstneigh; // NOLINT const flt_t * _noalias const special_lj = fc.special_lj; const FC_PACKED1_T * _noalias const ljc12o = fc.ljc12o[0]; const FC_PACKED2_T * _noalias const lj34 = fc.lj34[0]; @@ -384,7 +384,7 @@ void PairLJCutIntel::eval(const int offload, const int vflag, if (EFLAG || vflag) fix->add_result_array(f_start, ev_global, offload, eatom, 0, vflag); else - fix->add_result_array(f_start, 0, offload); + fix->add_result_array(f_start, nullptr, offload); } /* ---------------------------------------------------------------------- */ diff --git a/src/INTEL/pair_sw_intel.cpp b/src/INTEL/pair_sw_intel.cpp index f6cf90b1d1..1dbb7b10ac 100644 --- a/src/INTEL/pair_sw_intel.cpp +++ b/src/INTEL/pair_sw_intel.cpp @@ -573,7 +573,7 @@ void PairSWIntel::eval(const int offload, const int vflag, if (EFLAG || vflag) fix->add_result_array(f_start, ev_global, offload, eatom, 0, vflag); else - fix->add_result_array(f_start, 0, offload); + fix->add_result_array(f_start, nullptr, offload); } #else diff --git a/src/INTEL/pppm_intel.cpp b/src/INTEL/pppm_intel.cpp index b42a4b7598..c3fce2a753 100644 --- a/src/INTEL/pppm_intel.cpp +++ b/src/INTEL/pppm_intel.cpp @@ -1119,9 +1119,9 @@ FFT_SCALAR *** PPPMIntel::create3d_offset(FFT_SCALAR ***&array, int n1lo, bigint nbytes = ((bigint) sizeof(FFT_SCALAR)) * n1*n2*n3 + INTEL_P3M_ALIGNED_MAXORDER*2; - FFT_SCALAR *data = (FFT_SCALAR *) memory->smalloc(nbytes,name); + auto data = (FFT_SCALAR *) memory->smalloc(nbytes,name); nbytes = ((bigint) sizeof(FFT_SCALAR *)) * n1*n2; - FFT_SCALAR **plane = (FFT_SCALAR **) memory->smalloc(nbytes,name); + auto plane = (FFT_SCALAR **) memory->smalloc(nbytes,name); nbytes = ((bigint) sizeof(FFT_SCALAR **)) * n1; array = (FFT_SCALAR ***) memory->smalloc(nbytes,name); diff --git a/src/INTEL/verlet_lrt_intel.cpp b/src/INTEL/verlet_lrt_intel.cpp index f867ad73e6..0d8eb2e468 100644 --- a/src/INTEL/verlet_lrt_intel.cpp +++ b/src/INTEL/verlet_lrt_intel.cpp @@ -67,7 +67,7 @@ void VerletLRTIntel::init() { Verlet::init(); - _intel_kspace = (PPPMIntel*)(force->kspace_match("^pppm/intel", 0)); + _intel_kspace = dynamic_cast(force->kspace_match("^pppm/intel", 0)); #ifndef LMP_INTEL_USELRT error->all(FLERR, @@ -81,7 +81,7 @@ void VerletLRTIntel::init() void VerletLRTIntel::setup(int flag) { - if (_intel_kspace == 0) { + if (_intel_kspace == nullptr) { Verlet::setup(flag); return; } @@ -94,10 +94,10 @@ void VerletLRTIntel::setup(int flag) } #endif - if (comm->me == 0 && screen) { + if (comm->me == 0) { fprintf(screen,"Setting up VerletLRTIntel run ...\n"); fprintf(screen," Unit style : %s\n", update->unit_style); - fprintf(screen," Current step : " BIGINT_FORMAT "\n", update->ntimestep); + fmt::print(screen," Current step : {}\n", update->ntimestep); fprintf(screen," Time step : %g\n", update->dt); timer->print_timeout(screen); } @@ -109,11 +109,8 @@ void VerletLRTIntel::setup(int flag) sched_getaffinity(0, sizeof(cpuset), &cpuset); int my_cpu_count = CPU_COUNT(&cpuset); if (my_cpu_count < comm->nthreads + 1) { - char str[128]; - sprintf(str,"Using %d threads per MPI rank, but only %d core(s)" - " allocated for each MPI rank", - comm->nthreads + 1, my_cpu_count); - error->warning(FLERR, str); + error->warning(FLERR, "Using {} threads per MPI rank, but only {} core(s) allocated " + "for each MPI rank", comm->nthreads + 1, my_cpu_count); } } #endif @@ -205,7 +202,7 @@ void VerletLRTIntel::setup(int flag) void VerletLRTIntel::run(int n) { - if (_intel_kspace == 0) { + if (_intel_kspace == nullptr) { Verlet::run(n); return; } @@ -391,7 +388,7 @@ void VerletLRTIntel::run(int n) ------------------------------------------------------------------------- */ void * VerletLRTIntel::k_launch_loop(void *context) { - VerletLRTIntel * const c = (VerletLRTIntel *)context; + auto const c = (VerletLRTIntel *)context; if (c->kspace_compute_flag) c->_intel_kspace->compute_first(c->eflag, c->vflag); diff --git a/src/KIM/fix_store_kim.cpp b/src/KIM/fix_store_kim.cpp index 3d2306c654..e57f759e87 100644 --- a/src/KIM/fix_store_kim.cpp +++ b/src/KIM/fix_store_kim.cpp @@ -83,25 +83,25 @@ FixStoreKIM::~FixStoreKIM() // free associated storage if (simulator_model) { - KIM_SimulatorModel *sm = (KIM_SimulatorModel *)simulator_model; + auto sm = (KIM_SimulatorModel *)simulator_model; KIM_SimulatorModel_Destroy(&sm); simulator_model = nullptr; } if (model_name) { - char *mn = (char *)model_name; + auto mn = (char *)model_name; delete[] mn; model_name = nullptr; } if (model_units) { - char *mu = (char *)model_units; + auto mu = (char *)model_units; delete[] mu; model_units = nullptr; } if (user_units) { - char *uu = (char *)user_units; + auto uu = (char *)user_units; delete[] uu; user_units = nullptr; } @@ -121,25 +121,25 @@ void FixStoreKIM::setptr(const std::string &name, void *ptr) { if (name == "simulator_model") { if (simulator_model) { - KIM_SimulatorModel *sm = (KIM_SimulatorModel *)simulator_model; + auto sm = (KIM_SimulatorModel *)simulator_model; KIM_SimulatorModel_Destroy(&sm); } simulator_model = ptr; } else if (name == "model_name") { if (model_name) { - char *mn = (char *)model_name; + auto mn = (char *)model_name; delete[] mn; } model_name = ptr; } else if (name == "model_units") { if (model_units) { - char *mu = (char *)model_units; + auto mu = (char *)model_units; delete[] mu; } model_units = ptr; } else if (name == "user_units") { if (user_units) { - char *uu = (char *)user_units; + auto uu = (char *)user_units; delete[] uu; } user_units = ptr; diff --git a/src/KIM/kim_command.cpp b/src/KIM/kim_command.cpp index f0d320c21a..06b651e377 100644 --- a/src/KIM/kim_command.cpp +++ b/src/KIM/kim_command.cpp @@ -112,24 +112,24 @@ void KimCommand::command(int narg, char **arg) if (lmp->citeme) lmp->citeme->add(cite_openkim); if (subcmd == "init") { - KimInit *cmd = new KimInit(lmp); + auto cmd = new KimInit(lmp); cmd->command(narg, arg); delete cmd; } else if (subcmd == "interactions") { - KimInteractions *cmd = new KimInteractions(lmp); + auto cmd = new KimInteractions(lmp); cmd->command(narg, arg); delete cmd; } else if (subcmd == "param") { - KimParam *cmd = new KimParam(lmp); + auto cmd = new KimParam(lmp); cmd->command(narg, arg); delete cmd; } else if (subcmd == "property") { - KimProperty *cmd = new KimProperty(lmp); + auto cmd = new KimProperty(lmp); cmd->command(narg, arg); delete cmd; } else if (subcmd == "query") { if (lmp->citeme) lmp->citeme->add(cite_openkim_query); - KimQuery *cmd = new KimQuery(lmp); + auto cmd = new KimQuery(lmp); cmd->command(narg, arg); delete cmd; } else error->all(FLERR,"Unknown kim subcommand {}", subcmd); diff --git a/src/KIM/kim_init.cpp b/src/KIM/kim_init.cpp index 2c8a19251f..dae8812a60 100644 --- a/src/KIM/kim_init.cpp +++ b/src/KIM/kim_init.cpp @@ -316,7 +316,7 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM modify->add_fix("KIM_MODEL_STORE all STORE/KIM"); ifix = modify->find_fix("KIM_MODEL_STORE"); - FixStoreKIM *fix_store = (FixStoreKIM *) modify->fix[ifix]; + auto fix_store = dynamic_cast( modify->fix[ifix]); fix_store->setptr("model_name", (void *) model_name); fix_store->setptr("user_units", (void *) user_units); fix_store->setptr("model_units", (void *) model_units); diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index 74ac40198c..3427d6fb57 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -121,7 +121,7 @@ void KimInteractions::do_setup(int narg, char **arg) int ifix = modify->find_fix("KIM_MODEL_STORE"); if (ifix >= 0) { - FixStoreKIM *fix_store = (FixStoreKIM *) modify->fix[ifix]; + auto fix_store = dynamic_cast( modify->fix[ifix]); model_name = (char *)fix_store->getptr("model_name"); simulatorModel = (KIM_SimulatorModel *)fix_store->getptr("simulator_model"); } else error->all(FLERR, "Must use 'kim init' before 'kim interactions'"); diff --git a/src/KIM/kim_param.cpp b/src/KIM/kim_param.cpp index d538ff3c8e..d4dfb0ead6 100644 --- a/src/KIM/kim_param.cpp +++ b/src/KIM/kim_param.cpp @@ -163,7 +163,7 @@ void KimParam::command(int narg, char **arg) int const ifix = modify->find_fix("KIM_MODEL_STORE"); if (ifix >= 0) { - FixStoreKIM *fix_store = reinterpret_cast(modify->fix[ifix]); + auto fix_store = reinterpret_cast(modify->fix[ifix]); KIM_SimulatorModel *simulatorModel = reinterpret_cast( @@ -181,20 +181,17 @@ void KimParam::command(int narg, char **arg) std::string atom_type_list; - bool isPairStyleAssigned = force->pair ? true : false; - if (isPairStyleAssigned) { + if (force->pair) { Pair *pair = force->pair_match("kim", 1, 0); if (pair) { - PairKIM *pairKIM = reinterpret_cast(pair); + auto pairKIM = reinterpret_cast(pair); pkim = pairKIM->get_kim_model(); - if (!pkim) - error->all(FLERR, "Unable to get the KIM Portable Model"); + if (!pkim) error->all(FLERR, "Unable to get the KIM Portable Model"); if (kim_param_get_set == "set") { atom_type_list = pairKIM->get_atom_type_list(); - if (atom_type_list.empty()) - error->all(FLERR, "The requested atom type list is empty"); + if (atom_type_list.empty()) error->all(FLERR, "The requested atom type list is empty"); } } else error->all(FLERR, "Pair style is defined, but there is " diff --git a/src/KIM/kim_query.cpp b/src/KIM/kim_query.cpp index 3e891468a6..e85df32755 100644 --- a/src/KIM/kim_query.cpp +++ b/src/KIM/kim_query.cpp @@ -158,7 +158,7 @@ void KimQuery::command(int narg, char **arg) // check if we had a kim init command by finding fix STORE/KIM const int ifix = modify->find_fix("KIM_MODEL_STORE"); if (ifix >= 0) { - FixStoreKIM *fix_store = (FixStoreKIM *) modify->fix[ifix]; + auto fix_store = dynamic_cast( modify->fix[ifix]); char *model_name_c = (char *) fix_store->getptr("model_name"); model_name = model_name_c; } else { @@ -277,7 +277,7 @@ namespace { // copy data to the user provided data structure, optionally in increments size_t write_callback(void *data, size_t size, size_t nmemb, void *userp) { - WriteBuf *buf = (WriteBuf *) userp; + auto buf = (WriteBuf *) userp; // copy chunks into the buffer for as long as there is space left if (buf->sizeleft) { diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index fc33faab43..f3b53ac71f 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -134,13 +134,11 @@ PairKIM::PairKIM(LAMMPS *lmp) : // vflag_global no_virial_fdotr_compute = 1; - // BEGIN: initial values that determine the KIM state - // (used by kim_free(), etc.) + // initial values that determine the KIM state (used by kim_free(), etc.) kim_init_ok = false; kim_particle_codes_ok = false; if (lmp->citeme) lmp->citeme->add(cite_openkim); - // END } /* ---------------------------------------------------------------------- */ @@ -148,16 +146,16 @@ PairKIM::PairKIM(LAMMPS *lmp) : PairKIM::~PairKIM() { // clean up kim_modelname - if (kim_modelname != nullptr) delete [] kim_modelname; + if (kim_modelname != nullptr) delete[] kim_modelname; // clean up lammps atom species number to unique particle names mapping if (lmps_unique_elements) for (int i = 0; i < lmps_num_unique_elements; i++) - delete [] lmps_unique_elements[i]; - delete [] lmps_unique_elements; + delete[] lmps_unique_elements[i]; + delete[] lmps_unique_elements; if (kim_particle_codes_ok) { - delete [] kim_particle_codes; + delete[] kim_particle_codes; kim_particle_codes = nullptr; kim_particle_codes_ok = false; } @@ -168,7 +166,7 @@ PairKIM::~PairKIM() memory->destroy(lmps_stripped_neigh_list); // clean up lmps_stripped_neigh_ptr if (lmps_stripped_neigh_ptr) { - delete [] lmps_stripped_neigh_ptr; + delete[] lmps_stripped_neigh_ptr; lmps_stripped_neigh_ptr = nullptr; } @@ -177,13 +175,13 @@ PairKIM::~PairKIM() if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); - delete [] lmps_map_species_to_unique; + delete[] lmps_map_species_to_unique; lmps_map_species_to_unique = nullptr; } // clean up neighborlist pointers if (neighborLists) { - delete [] neighborLists; + delete[] neighborLists; neighborLists = nullptr; } @@ -225,8 +223,7 @@ void PairKIM::compute(int eflag, int vflag) KIM_COMPUTE_ARGUMENT_NAME_particleContributing, kim_particleContributing); if (kimerror) - error->all(FLERR,"Unable to set KIM particle species " - "codes and/or contributing"); + error->all(FLERR,"Unable to set KIM particle species codes and/or contributing"); } // kim_particleSpecies = KIM atom species for each LAMMPS atom @@ -310,15 +307,14 @@ void PairKIM::settings(int narg, char **arg) ++settings_call_count; init_style_call_count = 0; - if (narg != 1) { - const std::string arg_str(arg[0]); - if ((narg > 0) && - ((arg_str == "KIMvirial") || (arg_str == "LAMMPSvirial"))) { - error->all(FLERR,"'KIMvirial' or 'LAMMPSvirial' not supported " - "with kim-api"); + // arg[0] is the KIM Model name + if (narg == 0) error->all(FLERR,"Illegal pair_style command"); + if (narg > 1) { + const std::string arg_str(arg[1]); + if ((arg_str == "KIMvirial") || (arg_str == "LAMMPSvirial")) { + error->all(FLERR,"'KIMvirial' or 'LAMMPSvirial' not supported with kim-api"); } else error->all(FLERR,"Illegal pair_style command"); } - // arg[0] is the KIM Model name lmps_using_molecular = (atom->molecular > 0); @@ -331,7 +327,7 @@ void PairKIM::settings(int narg, char **arg) // set KIM Model name if (kim_modelname != nullptr) { - delete [] kim_modelname; + delete[] kim_modelname; kim_modelname = nullptr; } kim_modelname = utils::strdup(arg[0]); @@ -364,9 +360,8 @@ void PairKIM::coeff(int narg, char **arg) const std::string arg_0_str(arg[0]); const std::string arg_1_str(arg[1]); if ((arg_0_str != "*") || (arg_1_str != "*")) - error->all(FLERR,"Incorrect args for pair coefficients.\nThe first two " - "arguments of pair_coeff command must be * * to span " - "all LAMMPS atom types"); + error->all(FLERR,"Incorrect args for pair coefficients.\nThe first two arguments of " + "pair_coeff command must be * * to span all LAMMPS atom types"); int ilo,ihi,jlo,jhi; utils::bounds(FLERR,arg_0_str,1,atom->ntypes,ilo,ihi,error); @@ -381,8 +376,8 @@ void PairKIM::coeff(int narg, char **arg) // if called multiple times: update lmps_unique_elements if (lmps_unique_elements) { for (i = 0; i < lmps_num_unique_elements; i++) - delete [] lmps_unique_elements[i]; - delete [] lmps_unique_elements; + delete[] lmps_unique_elements[i]; + delete[] lmps_unique_elements; } lmps_unique_elements = new char*[atom->ntypes]; for (i = 0; i < atom->ntypes; i++) lmps_unique_elements[i] = nullptr; @@ -417,7 +412,7 @@ void PairKIM::coeff(int narg, char **arg) // setup mapping between LAMMPS unique elements and KIM species codes if (kim_particle_codes_ok) { - delete [] kim_particle_codes; + delete[] kim_particle_codes; kim_particle_codes = nullptr; kim_particle_codes_ok = false; } @@ -435,8 +430,7 @@ void PairKIM::coeff(int narg, char **arg) if (supported) { kim_particle_codes[i] = code; } else { - error->all(FLERR,"GetSpeciesSupportAndCode: symbol not " - "found: {}",lmps_unique_elements[i]); + error->all(FLERR,"GetSpeciesSupportAndCode: symbol not found: {}",lmps_unique_elements[i]); } } // Set the new values for PM parameters @@ -447,7 +441,7 @@ void PairKIM::coeff(int narg, char **arg) if (!numberOfParameters) error->all(FLERR,"Incorrect args for pair coefficients\n" - "This model has No mutable parameters"); + "This model has No mutable parameters"); int kimerror; @@ -469,8 +463,8 @@ void PairKIM::coeff(int narg, char **arg) char const *str_desc = nullptr; for (param_index = 0; param_index < numberOfParameters; ++param_index) { - kimerror = KIM_Model_GetParameterMetadata(pkim, param_index, - &kim_DataType, &extent, &str_name, &str_desc); + kimerror = KIM_Model_GetParameterMetadata(pkim, param_index, &kim_DataType, + &extent, &str_name, &str_desc); if (kimerror) error->all(FLERR,"KIM GetParameterMetadata returned error"); @@ -480,8 +474,8 @@ void PairKIM::coeff(int narg, char **arg) if (param_index >= numberOfParameters) error->all(FLERR,"Wrong argument for pair coefficients.\n" - "This Model does not have the requested " - "'{}' parameter", paramname); + "This Model does not have the requested " + "'{}' parameter", paramname); // Get the index_range for the requested parameter int nlbound(0); @@ -492,9 +486,8 @@ void PairKIM::coeff(int narg, char **arg) // Check to see if the indices range contains only integer numbers & : if (argtostr.find_first_not_of("0123456789:") != std::string::npos) - error->all(FLERR,"Illegal index_range.\nExpected integer" - " parameter(s) instead of '{}' in " - "index_range", argtostr); + error->all(FLERR,"Illegal index_range.\nExpected integer parameter(s) instead " + "of '{}' in index_range", argtostr); std::string::size_type npos = argtostr.find(':'); if (npos != std::string::npos) { @@ -506,21 +499,20 @@ void PairKIM::coeff(int narg, char **arg) if (nubound < 1 || nubound > extent || nlbound < 1 || nlbound > nubound) error->all(FLERR,"Illegal index_range '{}-{}' for '{}' " - "parameter with the extent of '{}'", - nlbound, nubound, paramname, extent); + "parameter with the extent of '{}'", + nlbound, nubound, paramname, extent); } else { nlbound = atoi(argtostr.c_str()); if (nlbound < 1 || nlbound > extent) - error->all(FLERR,"Illegal index '{}' for '{}' parameter " - "with the extent of '{}'", nlbound, - paramname, extent); + error->all(FLERR,"Illegal index '{}' for '{}' parameter with the extent of '{}'", + nlbound, paramname, extent); nubound = nlbound; } } else { error->all(FLERR,"Wrong number of arguments for pair coefficients.\n" - "Index range after parameter name is mandatory"); + "Index range after parameter name is mandatory"); } // Parameter values @@ -528,26 +520,23 @@ void PairKIM::coeff(int narg, char **arg) if (KIM_DataType_Equal(kim_DataType, KIM_DATA_TYPE_Double)) { for (int j = 0; j < nubound - nlbound + 1; ++j) { double const V = utils::numeric(FLERR, arg[i++], true, lmp); - kimerror = KIM_Model_SetParameterDouble(pkim, param_index, - nlbound - 1 + j, V); + kimerror = KIM_Model_SetParameterDouble(pkim, param_index, nlbound - 1 + j, V); if (kimerror) error->all(FLERR,"KIM SetParameterDouble returned error"); } } else if (KIM_DataType_Equal(kim_DataType, KIM_DATA_TYPE_Integer)) { for (int j = 0; j < nubound - nlbound + 1; ++j) { int const V = utils::inumeric(FLERR, arg[i++], true, lmp); - kimerror = KIM_Model_SetParameterInteger(pkim, param_index, - nlbound - 1 + j, V); + kimerror = KIM_Model_SetParameterInteger(pkim, param_index, nlbound - 1 + j, V); if (kimerror) error->all(FLERR,"KIM SetParameterInteger returned error"); } } else error->all(FLERR,"Wrong parameter type to update"); } else { - error->all(FLERR,"Wrong number of variable values for pair " - "coefficients.\n'{}' values are requested " - "for '{}' parameter", nubound - nlbound + 1, - paramname); + error->all(FLERR,"Wrong number of variable values for pair coefficients.\n" + " '{}' values are requested for '{}' parameter", + nubound - nlbound + 1, paramname); } } @@ -558,12 +547,12 @@ void PairKIM::coeff(int narg, char **arg) // Update cached quantities that may have changed due to Refresh KIM_Model_GetInfluenceDistance(pkim, &kim_global_influence_distance); KIM_Model_GetNeighborListPointers( - pkim, - &kim_number_of_neighbor_lists, - &kim_cutoff_values, - &modelWillNotRequestNeighborsOfNoncontributingParticles); + pkim, + &kim_number_of_neighbor_lists, + &kim_cutoff_values, + &modelWillNotRequestNeighborsOfNoncontributingParticles); if (neighborLists) { - delete [] neighborLists; + delete[] neighborLists; neighborLists = nullptr; } neighborLists = new NeighList*[kim_number_of_neighbor_lists]; @@ -588,7 +577,7 @@ void PairKIM::init_style() memory->create(lmps_stripped_neigh_list, kim_number_of_neighbor_lists*neighbor->oneatom, "pair:lmps_stripped_neigh_list"); - delete [] lmps_stripped_neigh_ptr; + delete[] lmps_stripped_neigh_ptr; lmps_stripped_neigh_ptr = new int*[kim_number_of_neighbor_lists]; for (int i = 0; i < kim_number_of_neighbor_lists; ++i) lmps_stripped_neigh_ptr[i] @@ -785,8 +774,7 @@ int PairKIM::get_neigh(void const * const dataObject, int * const numberOfNeighbors, int const ** const neighborsOfParticle) { - PairKIM const * const Model - = reinterpret_cast(dataObject); + auto const Model = reinterpret_cast(dataObject); if (numberOfNeighborLists != Model->kim_number_of_neighbor_lists) return true; @@ -799,7 +787,7 @@ int PairKIM::get_neigh(void const * const dataObject, // initialize numNeigh *numberOfNeighbors = 0; - NeighList * neiobj = Model->neighborLists[neighborListIndex]; + NeighList *neiobj = Model->neighborLists[neighborListIndex]; int *numneigh, **firstneigh; numneigh = neiobj->numneigh; // # of J neighbors for each I atom @@ -883,7 +871,7 @@ void PairKIM::kim_init() &kim_cutoff_values, &modelWillNotRequestNeighborsOfNoncontributingParticles); if (neighborLists) { - delete [] neighborLists; + delete[] neighborLists; neighborLists = nullptr; } neighborLists = new NeighList*[kim_number_of_neighbor_lists]; @@ -1069,19 +1057,16 @@ int PairKIM::check_for_routine_compatibility() pkim, modelRoutineName, &present, &required); if (error) return true; - if ((present == true) && (required == true)) { - if (!(KIM_ModelRoutineName_Equal(modelRoutineName, - KIM_MODEL_ROUTINE_NAME_Create) - || KIM_ModelRoutineName_Equal( - modelRoutineName, - KIM_MODEL_ROUTINE_NAME_ComputeArgumentsCreate) + if (present && required) { + if (!(KIM_ModelRoutineName_Equal(modelRoutineName, KIM_MODEL_ROUTINE_NAME_Create) + || KIM_ModelRoutineName_Equal(modelRoutineName, + KIM_MODEL_ROUTINE_NAME_ComputeArgumentsCreate) || KIM_ModelRoutineName_Equal(modelRoutineName, KIM_MODEL_ROUTINE_NAME_Compute) || KIM_ModelRoutineName_Equal(modelRoutineName, KIM_MODEL_ROUTINE_NAME_Refresh) - || KIM_ModelRoutineName_Equal( - modelRoutineName, - KIM_MODEL_ROUTINE_NAME_ComputeArgumentsDestroy) + || KIM_ModelRoutineName_Equal(modelRoutineName, + KIM_MODEL_ROUTINE_NAME_ComputeArgumentsDestroy) || KIM_ModelRoutineName_Equal(modelRoutineName, KIM_MODEL_ROUTINE_NAME_Destroy))) { return true; @@ -1099,20 +1084,20 @@ void PairKIM::set_kim_model_has_flags() { int numberOfComputeArgumentNames; KIM_COMPUTE_ARGUMENT_NAME_GetNumberOfComputeArgumentNames( - &numberOfComputeArgumentNames); + &numberOfComputeArgumentNames); for (int i = 0; i < numberOfComputeArgumentNames; ++i) { KIM_ComputeArgumentName computeArgumentName; KIM_COMPUTE_ARGUMENT_NAME_GetComputeArgumentName( - i, &computeArgumentName); + i, &computeArgumentName); KIM_SupportStatus supportStatus; KIM_ComputeArguments_GetArgumentSupportStatus( - pargs, computeArgumentName, &supportStatus); + pargs, computeArgumentName, &supportStatus); if (KIM_ComputeArgumentName_Equal(computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialEnergy)) kim_model_support_for_energy = supportStatus; else if (KIM_ComputeArgumentName_Equal( - computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialForces)) + computeArgumentName, KIM_COMPUTE_ARGUMENT_NAME_partialForces)) kim_model_support_for_forces = supportStatus; else if (KIM_ComputeArgumentName_Equal( computeArgumentName, @@ -1133,30 +1118,26 @@ void PairKIM::set_kim_model_has_flags() if (comm->me == 0) { if (KIM_SupportStatus_Equal(kim_model_support_for_energy, KIM_SUPPORT_STATUS_notSupported)) - error->warning(FLERR,"KIM Model does not provide 'partialEnergy'; " - "Potential energy will be zero"); + error->warning(FLERR,"KIM Model does not provide 'partialEnergy'; Potential energy will be zero"); if (KIM_SupportStatus_Equal(kim_model_support_for_forces, KIM_SUPPORT_STATUS_notSupported)) - error->warning(FLERR,"KIM Model does not provide 'partialForce'; " - "Forces will be zero"); + error->warning(FLERR,"KIM Model does not provide 'partialForce'; Forces will be zero"); if (KIM_SupportStatus_Equal(kim_model_support_for_particleEnergy, KIM_SUPPORT_STATUS_notSupported)) - error->warning(FLERR,"KIM Model does not provide " - "'partialParticleEnergy'; " - "energy per atom will be zero"); + error->warning(FLERR,"KIM Model does not provide 'partialParticleEnergy'; " + "energy per atom will be zero"); if (KIM_SupportStatus_Equal(kim_model_support_for_particleVirial, KIM_SUPPORT_STATUS_notSupported)) - error->warning(FLERR,"KIM Model does not provide " - "'partialParticleVirial'; " - "virial per atom will be zero"); + error->warning(FLERR,"KIM Model does not provide 'partialParticleVirial'; " + "virial per atom will be zero"); } int numberOfComputeCallbackNames; KIM_COMPUTE_CALLBACK_NAME_GetNumberOfComputeCallbackNames( - &numberOfComputeCallbackNames); + &numberOfComputeCallbackNames); for (int i = 0; i < numberOfComputeCallbackNames; ++i) { KIM_ComputeCallbackName computeCallbackName; KIM_COMPUTE_CALLBACK_NAME_GetComputeCallbackName(i, &computeCallbackName); diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index 6da318c2d5..65ac13c061 100755 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -230,6 +230,14 @@ action pair_coul_long_kokkos.cpp pair_coul_long.cpp action pair_coul_long_kokkos.h pair_coul_long.h action pair_coul_wolf_kokkos.cpp action pair_coul_wolf_kokkos.h +action pair_dpd_kokkos.h pair_dpd.h +action pair_dpd_kokkos.cpp pair_dpd.cpp +action pair_dpd_ext_kokkos.cpp pair_dpd_ext.cpp +action pair_dpd_ext_kokkos.h pair_dpd_ext.h +action pair_dpd_ext_tstat_kokkos.h pair_dpd_ext_tstat.h +action pair_dpd_ext_tstat_kokkos.cpp pair_dpd_ext_tstat.cpp +action pair_dpd_tstat_kokkos.h pair_dpd_tstat.h +action pair_dpd_tstat_kokkos.cpp pair_dpd_tstat.cpp action pair_dpd_fdt_energy_kokkos.cpp pair_dpd_fdt_energy.cpp action pair_dpd_fdt_energy_kokkos.h pair_dpd_fdt_energy.h action pair_eam_kokkos.cpp pair_eam.cpp @@ -316,6 +324,7 @@ action sna_kokkos.h sna.h action sna_kokkos_impl.h sna.cpp action third_order_kokkos.cpp dynamical_matrix.cpp action third_order_kokkos.h dynamical_matrix.h +action transpose_helper_kokkos.h action verlet_kokkos.cpp action verlet_kokkos.h diff --git a/src/KOKKOS/domain_kokkos.cpp b/src/KOKKOS/domain_kokkos.cpp index 6a1decbed6..8408957ff9 100644 --- a/src/KOKKOS/domain_kokkos.cpp +++ b/src/KOKKOS/domain_kokkos.cpp @@ -56,6 +56,17 @@ public: dst.value[2][1] = dst.value[1][1] = dst.value[0][1] = -BIG; } + KOKKOS_INLINE_FUNCTION + void join(value_type &dst, + const value_type &src) const { + dst.value[0][0] = MIN(dst.value[0][0],src.value[0][0]); + dst.value[0][1] = MAX(dst.value[0][1],src.value[0][1]); + dst.value[1][0] = MIN(dst.value[1][0],src.value[1][0]); + dst.value[1][1] = MAX(dst.value[1][1],src.value[1][1]); + dst.value[2][0] = MIN(dst.value[2][0],src.value[2][0]); + dst.value[2][1] = MAX(dst.value[2][1],src.value[2][1]); + } + KOKKOS_INLINE_FUNCTION void join(volatile value_type &dst, const volatile value_type &src) const { diff --git a/src/KOKKOS/fix_acks2_reaxff_kokkos.cpp b/src/KOKKOS/fix_acks2_reaxff_kokkos.cpp index d8fbe32b9a..aab19e0d47 100644 --- a/src/KOKKOS/fix_acks2_reaxff_kokkos.cpp +++ b/src/KOKKOS/fix_acks2_reaxff_kokkos.cpp @@ -205,7 +205,6 @@ void FixACKS2ReaxFFKokkos::pre_force(int vflag) type = atomKK->k_type.view(); mask = atomKK->k_mask.view(); nlocal = atomKK->nlocal; - nall = atom->nlocal + atom->nghost; newton_pair = force->newton_pair; k_params.template sync(); @@ -219,7 +218,7 @@ void FixACKS2ReaxFFKokkos::pre_force(int vflag) d_ilist = k_list->d_ilist; nn = list->inum; - NN = list->inum + list->gnum; + NN = atom->nlocal + atom->nghost; copymode = 1; @@ -526,7 +525,7 @@ void FixACKS2ReaxFFKokkos::allocate_array() if (efield) get_chi_field(); // init_storage - Kokkos::parallel_for(Kokkos::RangePolicy(0,NN),*this); + Kokkos::parallel_for(Kokkos::RangePolicy(0,nn),*this); } @@ -1377,9 +1376,6 @@ int FixACKS2ReaxFFKokkos::bicgstab_solve() template void FixACKS2ReaxFFKokkos::calculate_Q() { - - Kokkos::parallel_for(Kokkos::RangePolicy(0,nn),*this); - pack_flag = 2; //comm->forward_comm( this ); //Dist_vector( s ); k_s.modify(); @@ -1388,8 +1384,7 @@ void FixACKS2ReaxFFKokkos::calculate_Q() k_s.modify(); k_s.sync(); - Kokkos::parallel_for(Kokkos::RangePolicy(0,NN),*this); - + Kokkos::parallel_for(Kokkos::RangePolicy(0,NN),*this); } /* ---------------------------------------------------------------------- */ @@ -1822,22 +1817,25 @@ void FixACKS2ReaxFFKokkos::operator() (TagACKS2Norm3, const int &ii, template KOKKOS_INLINE_FUNCTION -void FixACKS2ReaxFFKokkos::operator() (TagACKS2CalculateQ1, const int &ii) const +void FixACKS2ReaxFFKokkos::operator() (TagACKS2CalculateQ, const int &i) const { - const int i = d_ilist[ii]; if (mask[i] & groupbit) { - /* backup s */ - for (int k = nprev-1; k > 0; --k) { - d_s_hist(i,k) = d_s_hist(i,k-1); - d_s_hist_X(i,k) = d_s_hist_X(i,k-1); + q(i) = d_s(i); + + if (i < nlocal) { + /* backup s */ + for (int k = nprev-1; k > 0; --k) { + d_s_hist(i,k) = d_s_hist(i,k-1); + d_s_hist_X(i,k) = d_s_hist_X(i,k-1); + } + d_s_hist(i,0) = d_s[i]; + d_s_hist_X(i,0) = d_s[NN+i]; } - d_s_hist(i,0) = d_s[i]; - d_s_hist_X(i,0) = d_s[NN+i]; } // last two rows - if (last_rows_flag && ii == 0) { + if (last_rows_flag && i == 0) { for (int i = 0; i < 2; ++i) { for (int k = nprev-1; k > 0; --k) d_s_hist_last(i,k) = d_s_hist_last(i,k-1); @@ -1848,17 +1846,6 @@ void FixACKS2ReaxFFKokkos::operator() (TagACKS2CalculateQ1, const in /* ---------------------------------------------------------------------- */ -template -KOKKOS_INLINE_FUNCTION -void FixACKS2ReaxFFKokkos::operator() (TagACKS2CalculateQ2, const int &ii) const -{ - const int i = d_ilist[ii]; - if (mask[i] & groupbit) - q(i) = d_s(i); -} - -/* ---------------------------------------------------------------------- */ - template void FixACKS2ReaxFFKokkos::cleanup_copy() { diff --git a/src/KOKKOS/fix_acks2_reaxff_kokkos.h b/src/KOKKOS/fix_acks2_reaxff_kokkos.h index 735b478f1b..e81479d3ba 100644 --- a/src/KOKKOS/fix_acks2_reaxff_kokkos.h +++ b/src/KOKKOS/fix_acks2_reaxff_kokkos.h @@ -54,8 +54,7 @@ struct TagACKS2Precon1B{}; struct TagACKS2Precon2{}; struct TagACKS2Add{}; struct TagACKS2ZeroQGhosts{}; -struct TagACKS2CalculateQ1{}; -struct TagACKS2CalculateQ2{}; +struct TagACKS2CalculateQ{}; template class FixACKS2ReaxFFKokkos : public FixACKS2ReaxFF { @@ -152,10 +151,7 @@ class FixACKS2ReaxFFKokkos : public FixACKS2ReaxFF { void operator()(TagACKS2ZeroQGhosts, const int&) const; KOKKOS_INLINE_FUNCTION - void operator()(TagACKS2CalculateQ1, const int&) const; - - KOKKOS_INLINE_FUNCTION - void operator()(TagACKS2CalculateQ2, const int&) const; + void operator()(TagACKS2CalculateQ, const int&) const; KOKKOS_INLINE_FUNCTION double calculate_H_k(const F_FLOAT &r, const F_FLOAT &shld) const; diff --git a/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp b/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp index 4aa23b77be..43fd832700 100644 --- a/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reaxff_kokkos.cpp @@ -208,7 +208,6 @@ void FixQEqReaxFFKokkos::pre_force(int /*vflag*/) d_neighbors = k_list->d_neighbors; d_ilist = k_list->d_ilist; nn = list->inum; - NN = list->inum + list->gnum; copymode = 1; @@ -375,7 +374,7 @@ void FixQEqReaxFFKokkos::allocate_array() if (efield) get_chi_field(); - Kokkos::parallel_for(Kokkos::RangePolicy(0,NN),*this); + Kokkos::parallel_for(Kokkos::RangePolicy(0,nn),*this); } /* ---------------------------------------------------------------------- */ @@ -872,7 +871,8 @@ void FixQEqReaxFFKokkos::sparse_matvec_kokkos(typename AT::t_ffloat2 } if (neighflag != FULL) { - Kokkos::parallel_for(Kokkos::RangePolicy(nn,NN),*this); + int nall = nlocal + atomKK->nghost; + Kokkos::parallel_for(Kokkos::RangePolicy(atom->nlocal,nall),*this); if (need_dup) dup_o.reset_except(d_o); diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index dc8a1173f3..382808d523 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -232,6 +232,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) #endif neigh_thread = 0; neigh_thread_set = 0; + neigh_transpose = 0; if (ngpus > 0) { neighflag = FULL; neighflag_qeq = FULL; @@ -481,6 +482,10 @@ void KokkosLMP::accelerator(int narg, char **arg) neigh_thread = utils::logical(FLERR,arg[iarg+1],false,lmp); neigh_thread_set = 1; iarg += 2; + } else if (strcmp(arg[iarg],"neigh/transpose") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command"); + neigh_transpose = utils::logical(FLERR,arg[iarg+1],false,lmp); + iarg += 2; } else error->all(FLERR,"Illegal package kokkos command"); } diff --git a/src/KOKKOS/kokkos.h b/src/KOKKOS/kokkos.h index be4990d0a4..669a773734 100644 --- a/src/KOKKOS/kokkos.h +++ b/src/KOKKOS/kokkos.h @@ -46,6 +46,7 @@ class KokkosLMP : protected Pointers { int gpu_aware_flag; int neigh_thread; int neigh_thread_set; + int neigh_transpose; int newtonflag; double binsize; diff --git a/src/KOKKOS/kokkos_type.h b/src/KOKKOS/kokkos_type.h index 09a78b17df..2926ba1d36 100644 --- a/src/KOKKOS/kokkos_type.h +++ b/src/KOKKOS/kokkos_type.h @@ -887,6 +887,13 @@ typedef tdual_neighbors_2d::t_dev_um t_neighbors_2d_um; typedef tdual_neighbors_2d::t_dev_const_um t_neighbors_2d_const_um; typedef tdual_neighbors_2d::t_dev_const_randomread t_neighbors_2d_randomread; +typedef Kokkos::DualView tdual_neighbors_2d_lr; +typedef tdual_neighbors_2d_lr::t_dev t_neighbors_2d_lr; +typedef tdual_neighbors_2d_lr::t_dev_const t_neighbors_2d_const_lr; +typedef tdual_neighbors_2d_lr::t_dev_um t_neighbors_2d_um_lr; +typedef tdual_neighbors_2d_lr::t_dev_const_um t_neighbors_2d_const_um_lr; +typedef tdual_neighbors_2d_lr::t_dev_const_randomread t_neighbors_2d_randomread_lr; + }; #ifdef LMP_KOKKOS_GPU @@ -1156,6 +1163,13 @@ typedef tdual_neighbors_2d::t_host_um t_neighbors_2d_um; typedef tdual_neighbors_2d::t_host_const_um t_neighbors_2d_const_um; typedef tdual_neighbors_2d::t_host_const_randomread t_neighbors_2d_randomread; +typedef Kokkos::DualView tdual_neighbors_2d_lr; +typedef tdual_neighbors_2d_lr::t_host t_neighbors_2d_lr; +typedef tdual_neighbors_2d_lr::t_host_const t_neighbors_2d_const_lr; +typedef tdual_neighbors_2d_lr::t_host_um t_neighbors_2d_um_lr; +typedef tdual_neighbors_2d_lr::t_host_const_um t_neighbors_2d_const_um_lr; +typedef tdual_neighbors_2d_lr::t_host_const_randomread t_neighbors_2d_randomread_lr; + }; #endif //default LAMMPS Types @@ -1200,6 +1214,12 @@ struct params_lj_coul { F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset; }; +// ReaxFF + +struct alignas(4 * sizeof(int)) reax_int4 { + int i0, i1, i2, i3; +}; + // Pair SNAP #define SNAP_KOKKOS_REAL double diff --git a/src/KOKKOS/neigh_list_kokkos.cpp b/src/KOKKOS/neigh_list_kokkos.cpp index b8eeb38ffd..2337b1ef3d 100644 --- a/src/KOKKOS/neigh_list_kokkos.cpp +++ b/src/KOKKOS/neigh_list_kokkos.cpp @@ -13,6 +13,7 @@ ------------------------------------------------------------------------- */ #include "neigh_list_kokkos.h" +#include "kokkos.h" using namespace LAMMPS_NS; @@ -44,6 +45,11 @@ void NeighListKokkos::grow(int nmax) d_numneigh = typename ArrayTypes::t_int_1d("neighlist:numneigh",maxatoms); d_neighbors = typename ArrayTypes::t_neighbors_2d(); d_neighbors = typename ArrayTypes::t_neighbors_2d(Kokkos::NoInit("neighlist:neighbors"),maxatoms,maxneighs); + + if (lmp->kokkos->neigh_transpose) { + d_neighbors_transpose = typename ArrayTypes::t_neighbors_2d_lr(); + d_neighbors_transpose = typename ArrayTypes::t_neighbors_2d_lr(Kokkos::NoInit("neighlist:neighbors"),maxatoms,maxneighs); + } } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/neigh_list_kokkos.h b/src/KOKKOS/neigh_list_kokkos.h index 04e5e7e17f..d06a3e76cf 100644 --- a/src/KOKKOS/neigh_list_kokkos.h +++ b/src/KOKKOS/neigh_list_kokkos.h @@ -70,6 +70,7 @@ public: void grow(int nmax); typename ArrayTypes::t_neighbors_2d d_neighbors; + typename ArrayTypes::t_neighbors_2d_lr d_neighbors_transpose; DAT::tdual_int_1d k_ilist; // local indices of I atoms typename ArrayTypes::t_int_1d d_ilist; typename ArrayTypes::t_int_1d d_numneigh; @@ -82,6 +83,12 @@ public: &d_neighbors(i,1)-&d_neighbors(i,0)); } + KOKKOS_INLINE_FUNCTION + AtomNeighbors get_neighbors_transpose(const int &i) const { + return AtomNeighbors(&d_neighbors_transpose(i,0),d_numneigh(i), + &d_neighbors_transpose(i,1)-&d_neighbors_transpose(i,0)); + } + KOKKOS_INLINE_FUNCTION static AtomNeighborsConst static_neighbors_const(int i, typename ArrayTypes::t_neighbors_2d_const const& d_neighbors, diff --git a/src/KOKKOS/npair_kokkos.cpp b/src/KOKKOS/npair_kokkos.cpp index 1825fd3abe..f42ca39404 100644 --- a/src/KOKKOS/npair_kokkos.cpp +++ b/src/KOKKOS/npair_kokkos.cpp @@ -21,6 +21,8 @@ #include "nbin_kokkos.h" #include "nstencil.h" #include "force.h" +#include "kokkos.h" +#include "transpose_helper_kokkos.h" namespace LAMMPS_NS { @@ -158,7 +160,7 @@ void NPairKokkos::build(NeighList *list_) mbins,nstencil, k_stencil.view(), k_stencilxyz.view(), - nlocal, + nlocal,nall,lmp->kokkos->neigh_transpose, atomKK->k_x.view(), atomKK->k_radius.view(), atomKK->k_type.view(), @@ -229,18 +231,33 @@ void NPairKokkos::build(NeighList *list_) #if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_HIP) #define BINS_PER_BLOCK 2 - const int factor = atoms_per_bin<64?2:1; + const int factor = atoms_per_bin <64?2:1; #else const int factor = 1; #endif if (GHOST) { - NPairKokkosBuildFunctorGhost f(data); + NPairKokkosBuildFunctorGhost f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); +#ifdef LMP_KOKKOS_GPU + if (ExecutionSpaceFromDevice::space == Device) { + int team_size = atoms_per_bin*factor; + int team_size_max = Kokkos::TeamPolicy(team_size,Kokkos::AUTO).team_size_max(f,Kokkos::ParallelForTag()); + if (team_size <= team_size_max) { + Kokkos::TeamPolicy config((mbins+factor-1)/factor,team_size); + Kokkos::parallel_for(config, f); + } else { // fall back to flat method + f.sharedsize = 0; + Kokkos::parallel_for(nall, f); + } + } else + Kokkos::parallel_for(nall, f); +#else Kokkos::parallel_for(nall, f); +#endif } else { if (newton_pair) { if (SIZE) { - NPairKokkosBuildFunctorSize f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); + NPairKokkosBuildFunctorSize f(data,atoms_per_bin * 6 * sizeof(X_FLOAT) * factor); #ifdef LMP_KOKKOS_GPU if (ExecutionSpaceFromDevice::space == Device) { int team_size = atoms_per_bin*factor; @@ -326,6 +343,13 @@ void NPairKokkos::build(NeighList *list_) list->d_neighbors = typename AT::t_neighbors_2d(Kokkos::NoInit("neighlist:neighbors"), maxatoms, list->maxneighs); data.neigh_list.d_neighbors = list->d_neighbors; data.neigh_list.maxneighs = list->maxneighs; + + if (lmp->kokkos->neigh_transpose) { + data.neigh_list.d_neighbors_transpose = typename AT::t_neighbors_2d_lr(); + list->d_neighbors_transpose = typename AT::t_neighbors_2d_lr(); + list->d_neighbors_transpose = typename AT::t_neighbors_2d_lr(Kokkos::NoInit("neighlist:neighbors"), maxatoms, list->maxneighs); + data.neigh_list.d_neighbors_transpose = list->d_neighbors_transpose; + } } } @@ -338,6 +362,10 @@ void NPairKokkos::build(NeighList *list_) } list->k_ilist.template modify(); + + if (lmp->kokkos->neigh_transpose) + TransposeHelperKokkos(list->d_neighbors, list->d_neighbors_transpose); } /* ---------------------------------------------------------------------- */ @@ -416,7 +444,8 @@ void NeighborKokkosExecute:: else moltemplate = 0; // get subview of neighbors of i - const AtomNeighbors neighbors_i = neigh_list.get_neighbors(i); + const AtomNeighbors neighbors_i = neigh_transpose ? + neigh_list.get_neighbors_transpose(i) : neigh_list.get_neighbors(i); const X_FLOAT xtmp = x(i, 0); const X_FLOAT ytmp = x(i, 1); const X_FLOAT ztmp = x(i, 2); @@ -444,7 +473,7 @@ void NeighborKokkosExecute:: const X_FLOAT delx = xtmp - x(j, 0); const X_FLOAT dely = ytmp - x(j, 1); const X_FLOAT delz = ztmp - x(j, 2); - const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; + const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq(itype,jtype)) { if (molecular != Atom::ATOMIC) { if (!moltemplate) @@ -455,18 +484,18 @@ void NeighborKokkosExecute:: /* tag[j]-tagprev); */ /* else which = 0; */ if (which == 0) { - if (n 0) { - if (n:: const X_FLOAT delx = xtmp - x(j, 0); const X_FLOAT dely = ytmp - x(j, 1); const X_FLOAT delz = ztmp - x(j, 2); - const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; + const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq(itype,jtype)) { if (molecular != Atom::ATOMIC) { @@ -512,18 +541,18 @@ void NeighborKokkosExecute:: /* tag[j]-tagprev); */ /* else which = 0; */ if (which == 0) { - if (n 0) { - if (n::build_ItemGPU(typename Kokkos::TeamPolic /* loop over atoms in i's bin, */ const int atoms_per_bin = c_bins.extent(1); - const int BINS_PER_TEAM = dev.team_size()/atoms_per_bin<1?1:dev.team_size()/atoms_per_bin; + const int BINS_PER_TEAM = dev.team_size()/atoms_per_bin <1?1:dev.team_size()/atoms_per_bin; const int TEAMS_PER_BIN = atoms_per_bin/dev.team_size()<1?1:atoms_per_bin/dev.team_size(); const int MY_BIN = dev.team_rank()/atoms_per_bin; const int ibin = dev.league_rank()*BINS_PER_TEAM+MY_BIN; if (ibin >= mbins) return; - X_FLOAT* other_x = sharedmem; - other_x = other_x + 5*atoms_per_bin*MY_BIN; + X_FLOAT* other_x = sharedmem + 5*atoms_per_bin*MY_BIN; int* other_id = (int*) &other_x[4 * atoms_per_bin]; int bincount_current = c_bincount[ibin]; for (int kk = 0; kk < TEAMS_PER_BIN; kk++) { const int MY_II = dev.team_rank()%atoms_per_bin+kk*dev.team_size(); - const int i = MY_II < bincount_current ? c_bins(ibin, MY_II) : -1; - /* if necessary, goto next page and add pages */ + const int i = MY_II < bincount_current ? c_bins(ibin, MY_II) : -1; + /* if necessary, goto next page and add pages */ - int n = 0; + int n = 0; - X_FLOAT xtmp; - X_FLOAT ytmp; - X_FLOAT ztmp; - int itype; - const AtomNeighbors neighbors_i = neigh_list.get_neighbors((i>=0&&i= 0 && i < nlocal) ? i : 0; + const AtomNeighbors neighbors_i = neigh_transpose ? + neigh_list.get_neighbors_transpose(index) : neigh_list.get_neighbors(index); + + if (i >= 0) { + xtmp = x(i, 0); + ytmp = x(i, 1); + ztmp = x(i, 2); + itype = type(i); + other_x[MY_II] = xtmp; + other_x[MY_II + atoms_per_bin] = ytmp; + other_x[MY_II + 2 * atoms_per_bin] = ztmp; + other_x[MY_II + 3 * atoms_per_bin] = itype; + } + other_id[MY_II] = i; - if (i >= 0) { - xtmp = x(i, 0); - ytmp = x(i, 1); - ztmp = x(i, 2); - itype = type(i); - other_x[MY_II] = xtmp; - other_x[MY_II + atoms_per_bin] = ytmp; - other_x[MY_II + 2 * atoms_per_bin] = ztmp; - other_x[MY_II + 3 * atoms_per_bin] = itype; - } - other_id[MY_II] = i; #if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_HIP) - int test = (__syncthreads_count(i >= 0 && i <= nlocal) == 0); - if (test) return; + int test = (__syncthreads_count(i >= 0 && i < nlocal) == 0); + if (test) return; #elif defined(KOKKOS_ENABLE_SYCL) - int not_done = (i >= 0 && i <= nlocal); - dev.team_reduce(Kokkos::Max(not_done)); - if(not_done == 0) return; + int not_done = (i >= 0 && i < nlocal); + dev.team_reduce(Kokkos::Max(not_done)); + if(not_done == 0) return; #elif defined(KOKKOS_ENABLE_OPENMPTARGET) - dev.team_barrier(); + dev.team_barrier(); #endif - if (i >= 0 && i < nlocal) { - #pragma unroll 4 - for (int m = 0; m < bincount_current; m++) { - int j = other_id[m]; - const int jtype = other_x[m + 3 * atoms_per_bin]; - - //for same bin as atom i skip j if i==j and skip atoms "below and to the left" if using halfneighborlists - if ((j == i) || - (HalfNeigh && !Newton && (j < i)) || - (HalfNeigh && Newton && - ((j < i) || - ((j >= nlocal) && ((x(j, 2) < ztmp) || (x(j, 2) == ztmp && x(j, 1) < ytmp) || - (x(j, 2) == ztmp && x(j, 1) == ytmp && x(j, 0) < xtmp))))) - ) continue; - if (Tri) { - if (x(j,2) < ztmp) continue; - if (x(j,2) == ztmp) { - if (x(j,1) < ytmp) continue; - if (x(j,1) == ytmp) { - if (x(j,0) < xtmp) continue; - if (x(j,0) == xtmp && j <= i) continue; - } - } - } - if (exclude && exclusion(i,j,itype,jtype)) continue; - const X_FLOAT delx = xtmp - other_x[m]; - const X_FLOAT dely = ytmp - other_x[m + atoms_per_bin]; - const X_FLOAT delz = ztmp - other_x[m + 2 * atoms_per_bin]; - const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; - - if (rsq <= cutneighsq(itype,jtype)) { - if (molecular != Atom::ATOMIC) { - int which = 0; - if (!moltemplate) - which = NeighborKokkosExecute::find_special(i,j); - /* else if (imol >= 0) */ - /* which = find_special(onemols[imol]->special[iatom], */ - /* onemols[imol]->nspecial[iatom], */ - /* tag[j]-tagprev); */ - /* else which = 0; */ - if (which == 0) { - if (n 0) { - if (n::t_int_1d_const_um stencil - = d_stencil; - for (int k = 0; k < nstencil; k++) { - const int jbin = ibin + stencil[k]; - - if (ibin == jbin) continue; - - bincount_current = c_bincount[jbin]; - int j = MY_II < bincount_current ? c_bins(jbin, MY_II) : -1; - - if (j >= 0) { - other_x[MY_II] = x(j, 0); - other_x[MY_II + atoms_per_bin] = x(j, 1); - other_x[MY_II + 2 * atoms_per_bin] = x(j, 2); - other_x[MY_II + 3 * atoms_per_bin] = type(j); - } - - other_id[MY_II] = j; - - dev.team_barrier(); - if (i >= 0 && i < nlocal) { - #pragma unroll 8 + #pragma unroll 4 for (int m = 0; m < bincount_current; m++) { - const int j = other_id[m]; + int j = other_id[m]; const int jtype = other_x[m + 3 * atoms_per_bin]; - //if(HalfNeigh && (j < i)) continue; - if (HalfNeigh && !Newton && (j < i)) continue; - if (!HalfNeigh && j==i) continue; - if (Tri) { - if (x(j,2) < ztmp) continue; - if (x(j,2) == ztmp) { - if (x(j,1) < ytmp) continue; - if (x(j,1) == ytmp) { - if (x(j,0) < xtmp) continue; - if (x(j,0) == xtmp && j <= i) continue; + //for same bin as atom i skip j if i==j and skip atoms "below and to the left" if using halfneighborlists + if ((j == i) || + (HalfNeigh && !Newton && (j < i)) || + (HalfNeigh && Newton && + ((j < i) || + ((j >= nlocal) && ((x(j, 2) < ztmp) || (x(j, 2) == ztmp && x(j, 1) < ytmp) || + (x(j, 2) == ztmp && x(j, 1) == ytmp && x(j, 0) < xtmp))))) + ) continue; + if (Tri) { + if (x(j,2) < ztmp) continue; + if (x(j,2) == ztmp) { + if (x(j,1) < ytmp) continue; + if (x(j,1) == ytmp) { + if (x(j,0) < xtmp) continue; + if (x(j,0) == xtmp && j <= i) continue; + } } } - } if (exclude && exclusion(i,j,itype,jtype)) continue; - const X_FLOAT delx = xtmp - other_x[m]; const X_FLOAT dely = ytmp - other_x[m + atoms_per_bin]; const X_FLOAT delz = ztmp - other_x[m + 2 * atoms_per_bin]; - const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; + const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq(itype,jtype)) { if (molecular != Atom::ATOMIC) { @@ -739,18 +692,18 @@ void NeighborKokkosExecute::build_ItemGPU(typename Kokkos::TeamPolic /* tag[j]-tagprev); */ /* else which = 0; */ if (which == 0) { - if (n 0) { - if (n::build_ItemGPU(typename Kokkos::TeamPolic } } dev.team_barrier(); - } - if (i >= 0 && i < nlocal) { - neigh_list.d_numneigh(i) = n; - neigh_list.d_ilist(i) = i; - } + const typename ArrayTypes::t_int_1d_const_um stencil + = d_stencil; + for (int k = 0; k < nstencil; k++) { + const int jbin = ibin + stencil[k]; - if (n > neigh_list.maxneighs) { - resize() = 1; + if (ibin == jbin) continue; - if (n > new_maxneighs()) new_maxneighs() = n; // avoid atomics, safe because in while loop - } + bincount_current = c_bincount[jbin]; + int j = MY_II < bincount_current ? c_bins(jbin, MY_II) : -1; + + if (j >= 0) { + other_x[MY_II] = x(j, 0); + other_x[MY_II + atoms_per_bin] = x(j, 1); + other_x[MY_II + 2 * atoms_per_bin] = x(j, 2); + other_x[MY_II + 3 * atoms_per_bin] = type(j); + } + + other_id[MY_II] = j; + + dev.team_barrier(); + + if (i >= 0 && i < nlocal) { + #pragma unroll 8 + for (int m = 0; m < bincount_current; m++) { + const int j = other_id[m]; + const int jtype = other_x[m + 3 * atoms_per_bin]; + + //if(HalfNeigh && (j < i)) continue; + if (HalfNeigh && !Newton && (j < i)) continue; + if (!HalfNeigh && j==i) continue; + if (Tri) { + if (x(j,2) < ztmp) continue; + if (x(j,2) == ztmp) { + if (x(j,1) < ytmp) continue; + if (x(j,1) == ytmp) { + if (x(j,0) < xtmp) continue; + if (x(j,0) == xtmp && j <= i) continue; + } + } + } + if (exclude && exclusion(i,j,itype,jtype)) continue; + + const X_FLOAT delx = xtmp - other_x[m]; + const X_FLOAT dely = ytmp - other_x[m + atoms_per_bin]; + const X_FLOAT delz = ztmp - other_x[m + 2 * atoms_per_bin]; + const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; + + if (rsq <= cutneighsq(itype,jtype)) { + if (molecular != Atom::ATOMIC) { + int which = 0; + if (!moltemplate) + which = NeighborKokkosExecute::find_special(i,j); + /* else if (imol >= 0) */ + /* which = find_special(onemols[imol]->special[iatom], */ + /* onemols[imol]->nspecial[iatom], */ + /* tag[j]-tagprev); */ + /* else which = 0; */ + if (which == 0) { + if (n < neigh_list.maxneighs) neighbors_i(n++) = j; + else n++; + } else if (minimum_image_check(delx,dely,delz)) { + if (n < neigh_list.maxneighs) neighbors_i(n++) = j; + else n++; + } + else if (which > 0) { + if (n < neigh_list.maxneighs) neighbors_i(n++) = j ^ (which << SBBITS); + else n++; + } + } else { + if (n < neigh_list.maxneighs) neighbors_i(n++) = j; + else n++; + } + } + + } + } + dev.team_barrier(); + } + + if (i >= 0 && i < nlocal) { + neigh_list.d_numneigh(i) = n; + neigh_list.d_ilist(i) = i; + } + + if (n > neigh_list.maxneighs) { + resize() = 1; + + if (n > new_maxneighs()) new_maxneighs() = n; // avoid atomics, safe because in while loop + } } } #endif @@ -779,7 +810,7 @@ void NeighborKokkosExecute::build_ItemGPU(typename Kokkos::TeamPolic template template KOKKOS_FUNCTION void NeighborKokkosExecute:: - build_Item_Ghost(const int &i) const + build_ItemGhost(const int &i) const { /* if necessary, goto next page and add pages */ int n = 0; @@ -789,7 +820,8 @@ void NeighborKokkosExecute:: else moltemplate = 0; // get subview of neighbors of i - const AtomNeighbors neighbors_i = neigh_list.get_neighbors(i); + const AtomNeighbors neighbors_i = neigh_transpose ? + neigh_list.get_neighbors_transpose(i) : neigh_list.get_neighbors(i); const X_FLOAT xtmp = x(i, 0); const X_FLOAT ytmp = x(i, 1); const X_FLOAT ztmp = x(i, 2); @@ -833,24 +865,23 @@ void NeighborKokkosExecute:: /* tag[j]-tagprev); */ /* else which = 0; */ if (which == 0) { - if (n 0) { - if (n:: const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq(itype,jtype)) { - if (n:: /* ---------------------------------------------------------------------- */ +#ifdef LMP_KOKKOS_GPU +template template +LAMMPS_DEVICE_FUNCTION inline +void NeighborKokkosExecute::build_ItemGhostGPU(typename Kokkos::TeamPolicy::member_type dev, + size_t sharedsize) const +{ + auto* sharedmem = static_cast(dev.team_shmem().get_shmem(sharedsize)); + // loop over atoms in i's bin + + const int atoms_per_bin = c_bins.extent(1); + const int BINS_PER_TEAM = dev.team_size()/atoms_per_bin <1?1:dev.team_size()/atoms_per_bin; + const int TEAMS_PER_BIN = atoms_per_bin/dev.team_size()<1?1:atoms_per_bin/dev.team_size(); + const int MY_BIN = dev.team_rank()/atoms_per_bin; + + const int ibin = dev.league_rank()*BINS_PER_TEAM+MY_BIN; + + if (ibin >= mbins) return; + + X_FLOAT* other_x = sharedmem + 5*atoms_per_bin*MY_BIN; + int* other_id = (int*) &other_x[4 * atoms_per_bin]; + + int bincount_current = c_bincount[ibin]; + + for (int kk = 0; kk < TEAMS_PER_BIN; kk++) { + const int MY_II = dev.team_rank()%atoms_per_bin+kk*dev.team_size(); + const int i = MY_II < bincount_current ? c_bins(ibin, MY_II) : -1; + + int n = 0; + + X_FLOAT xtmp; + X_FLOAT ytmp; + X_FLOAT ztmp; + int itype; + const int index = (i >= 0 && i < nall) ? i : 0; + const AtomNeighbors neighbors_i = neigh_transpose ? + neigh_list.get_neighbors_transpose(index) : neigh_list.get_neighbors(index); + + if (i >= 0) { + xtmp = x(i, 0); + ytmp = x(i, 1); + ztmp = x(i, 2); + itype = type(i); + other_x[MY_II] = xtmp; + other_x[MY_II + atoms_per_bin] = ytmp; + other_x[MY_II + 2 * atoms_per_bin] = ztmp; + other_x[MY_II + 3 * atoms_per_bin] = itype; + } + other_id[MY_II] = i; +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_HIP) + int test = (__syncthreads_count(i >= 0 && i < nall) == 0); + if (test) return; +#elif defined(KOKKOS_ENABLE_SYCL) + int not_done = (i >= 0 && i < nall); + dev.team_reduce(Kokkos::Max(not_done)); + if (not_done == 0) return; +#elif defined(KOKKOS_ENABLE_OPENMPTARGET) + dev.team_barrier(); +#endif + + int which = 0; + int moltemplate; + if (molecular == Atom::TEMPLATE) moltemplate = 1; + else moltemplate = 0; + + const typename ArrayTypes::t_int_1d_const_um stencil + = d_stencil; + const typename ArrayTypes::t_int_1d_3_const_um stencilxyz + = d_stencilxyz; + + // loop over all atoms in surrounding bins in stencil including self + // when i is a ghost atom, must check if stencil bin is out of bounds + // skip i = j + // no molecular test when i = ghost atom + + int ghost = (i >= nlocal && i < nall); + int binxyz[3]; + if (ghost) + coord2bin(xtmp, ytmp, ztmp, binxyz); + const int xbin = binxyz[0]; + const int ybin = binxyz[1]; + const int zbin = binxyz[2]; + for (int k = 0; k < nstencil; k++) { + int active = 1; + if (ghost) { + const int xbin2 = xbin + stencilxyz(k,0); + const int ybin2 = ybin + stencilxyz(k,1); + const int zbin2 = zbin + stencilxyz(k,2); + if (xbin2 < 0 || xbin2 >= mbinx || + ybin2 < 0 || ybin2 >= mbiny || + zbin2 < 0 || zbin2 >= mbinz) active = 0; + } + + const int jbin = ibin + stencil[k]; + bincount_current = c_bincount[jbin]; + int j = MY_II < bincount_current ? c_bins(jbin, MY_II) : -1; + + if (j >= 0) { + other_x[MY_II] = x(j, 0); + other_x[MY_II + atoms_per_bin] = x(j, 1); + other_x[MY_II + 2 * atoms_per_bin] = x(j, 2); + other_x[MY_II + 3 * atoms_per_bin] = type(j); + } + + other_id[MY_II] = j; + + dev.team_barrier(); + + if (active && i >= 0 && i < nall) { + #pragma unroll 4 + for (int m = 0; m < bincount_current; m++) { + const int j = other_id[m]; + + if (HalfNeigh && j <= i) continue; + else if (j == i) continue; + + const int jtype = other_x[m + 3 * atoms_per_bin]; + if (exclude && exclusion(i,j,itype,jtype)) continue; + + const X_FLOAT delx = xtmp - other_x[m]; + const X_FLOAT dely = ytmp - other_x[m + atoms_per_bin]; + const X_FLOAT delz = ztmp - other_x[m + 2 * atoms_per_bin]; + const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; + + if (rsq <= cutneighsq(itype,jtype)) { + if (molecular != Atom::ATOMIC && !ghost) { + if (!moltemplate) + which = NeighborKokkosExecute::find_special(i,j); + /* else if (imol >= 0) */ + /* which = find_special(onemols[imol]->special[iatom], */ + /* onemols[imol]->nspecial[iatom], */ + /* tag[j]-tagprev); */ + /* else which = 0; */ + if (which == 0) { + if (n < neigh_list.maxneighs) neighbors_i(n++) = j; + else n++; + } else if (minimum_image_check(delx,dely,delz)) { + if (n < neigh_list.maxneighs) neighbors_i(n++) = j; + else n++; + } + else if (which > 0) { + if (n < neigh_list.maxneighs) neighbors_i(n++) = j ^ (which << SBBITS); + else n++; + } + } else { + if (n < neigh_list.maxneighs) neighbors_i(n++) = j; + else n++; + } + } + } + } + dev.team_barrier(); + } + + if (i >= 0 && i < nall) { + neigh_list.d_numneigh(i) = n; + neigh_list.d_ilist(i) = i; + } + + if (n > neigh_list.maxneighs) { + resize() = 1; + + if (n > new_maxneighs()) new_maxneighs() = n; // avoid atomics, safe because in while loop + } + } +} +#endif + +/* ---------------------------------------------------------------------- */ + template template KOKKOS_FUNCTION void NeighborKokkosExecute:: @@ -909,7 +1109,8 @@ void NeighborKokkosExecute:: // get subview of neighbors of i - const AtomNeighbors neighbors_i = neigh_list.get_neighbors(i); + const AtomNeighbors neighbors_i = neigh_transpose ? + neigh_list.get_neighbors_transpose(i) : neigh_list.get_neighbors(i); const X_FLOAT xtmp = x(i, 0); const X_FLOAT ytmp = x(i, 1); const X_FLOAT ztmp = x(i, 2); @@ -940,12 +1141,12 @@ void NeighborKokkosExecute:: const X_FLOAT delx = xtmp - x(j, 0); const X_FLOAT dely = ytmp - x(j, 1); const X_FLOAT delz = ztmp - x(j, 2); - const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; + const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; const X_FLOAT radsum = radi + radius(j); const X_FLOAT cutsq = (radsum + skin) * (radsum + skin); if (rsq <= cutsq) { - if (n:: const X_FLOAT delx = xtmp - x(j, 0); const X_FLOAT dely = ytmp - x(j, 1); const X_FLOAT delz = ztmp - x(j, 2); - const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; + const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; const X_FLOAT radsum = radi + radius(j); const X_FLOAT cutsq = (radsum + skin) * (radsum + skin); if (rsq <= cutsq) { - if (n::build_ItemSizeGPU(typename Kokkos::TeamP /* loop over atoms in i's bin, */ const int atoms_per_bin = c_bins.extent(1); - const int BINS_PER_TEAM = dev.team_size()/atoms_per_bin<1?1:dev.team_size()/atoms_per_bin; + const int BINS_PER_TEAM = dev.team_size()/atoms_per_bin <1?1:dev.team_size()/atoms_per_bin; const int TEAMS_PER_BIN = atoms_per_bin/dev.team_size()<1?1:atoms_per_bin/dev.team_size(); const int MY_BIN = dev.team_rank()/atoms_per_bin; const int ibin = dev.league_rank()*BINS_PER_TEAM+MY_BIN; if (ibin >= mbins) return; - X_FLOAT* other_x = sharedmem; - other_x = other_x + 6*atoms_per_bin*MY_BIN; + X_FLOAT* other_x = sharedmem + 6*atoms_per_bin*MY_BIN; int* other_id = (int*) &other_x[5 * atoms_per_bin]; int bincount_current = c_bincount[ibin]; @@ -1044,7 +1244,9 @@ void NeighborKokkosExecute::build_ItemSizeGPU(typename Kokkos::TeamP X_FLOAT ztmp; X_FLOAT radi; int itype; - const AtomNeighbors neighbors_i = neigh_list.get_neighbors((i>=0&&i= 0 && i < nlocal) ? i : 0; + const AtomNeighbors neighbors_i = neigh_transpose ? + neigh_list.get_neighbors_transpose(index) : neigh_list.get_neighbors(index); const int mask_history = 3 << SBBITS; if (i >= 0) { @@ -1061,12 +1263,12 @@ void NeighborKokkosExecute::build_ItemSizeGPU(typename Kokkos::TeamP } other_id[MY_II] = i; #if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_HIP) - int test = (__syncthreads_count(i >= 0 && i <= nlocal) == 0); + int test = (__syncthreads_count(i >= 0 && i < nlocal) == 0); if (test) return; #elif defined(KOKKOS_ENABLE_SYCL) - int not_done = (i >= 0 && i <= nlocal); + int not_done = (i >= 0 && i < nlocal); dev.team_reduce(Kokkos::Max(not_done)); - if(not_done == 0) return; + if (not_done == 0) return; #elif defined(KOKKOS_ENABLE_OPENMPTARGET) dev.team_barrier(); #endif @@ -1099,12 +1301,12 @@ void NeighborKokkosExecute::build_ItemSizeGPU(typename Kokkos::TeamP const X_FLOAT delx = xtmp - other_x[m]; const X_FLOAT dely = ytmp - other_x[m + atoms_per_bin]; const X_FLOAT delz = ztmp - other_x[m + 2 * atoms_per_bin]; - const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; + const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; const X_FLOAT radsum = radi + other_x[m + 4 * atoms_per_bin]; const X_FLOAT cutsq = (radsum + skin) * (radsum + skin); if (rsq <= cutsq) { - if (n::build_ItemSizeGPU(typename Kokkos::TeamP const X_FLOAT delx = xtmp - other_x[m]; const X_FLOAT dely = ytmp - other_x[m + atoms_per_bin]; const X_FLOAT delz = ztmp - other_x[m + 2 * atoms_per_bin]; - const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; + const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; const X_FLOAT radsum = radi + other_x[m + 4 * atoms_per_bin]; const X_FLOAT cutsq = (radsum + skin) * (radsum + skin); if (rsq <= cutsq) { - if (n KOKKOS_FUNCTION - void build_Item_Ghost(const int &i) const; + void build_ItemGhost(const int &i) const; template KOKKOS_FUNCTION @@ -316,6 +316,11 @@ class NeighborKokkosExecute void build_ItemGPU(typename Kokkos::TeamPolicy::member_type dev, size_t sharedsize) const; + template + LAMMPS_DEVICE_FUNCTION inline + void build_ItemGhostGPU(typename Kokkos::TeamPolicy::member_type dev, + size_t sharedsize) const; + template LAMMPS_DEVICE_FUNCTION inline void build_ItemSizeGPU(typename Kokkos::TeamPolicy::member_type dev, @@ -422,13 +427,43 @@ struct NPairKokkosBuildFunctorGhost { typedef DeviceType device_type; const NeighborKokkosExecute c; + size_t sharedsize; - NPairKokkosBuildFunctorGhost(const NeighborKokkosExecute &_c):c(_c) {} + NPairKokkosBuildFunctorGhost(const NeighborKokkosExecute &_c, + size_t _sharedsize):c(_c), + sharedsize(_sharedsize) {} KOKKOS_INLINE_FUNCTION void operator() (const int & i) const { - c.template build_Item_Ghost(i); + c.template build_ItemGhost(i); } + +#ifdef LMP_KOKKOS_GPU + LAMMPS_DEVICE_FUNCTION inline + void operator() (typename Kokkos::TeamPolicy::member_type dev) const { + c.template build_ItemGhostGPU(dev, sharedsize); + } + size_t team_shmem_size(const int team_size) const { (void) team_size; return sharedsize; } +#endif +}; + +template +struct NPairKokkosBuildFunctorGhost { + typedef LMPHostType device_type; + + const NeighborKokkosExecute c; + size_t sharedsize; + + NPairKokkosBuildFunctorGhost(const NeighborKokkosExecute &_c, + size_t _sharedsize):c(_c), + sharedsize(_sharedsize) {} + + KOKKOS_INLINE_FUNCTION + void operator() (const int & i) const { + c.template build_ItemGhost(i); + } + + void operator() (typename Kokkos::TeamPolicy::member_type /*dev*/) const {} // Should error out }; template diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_kokkos.cpp new file mode 100644 index 0000000000..81a1b0b0a3 --- /dev/null +++ b/src/KOKKOS/pair_dpd_ext_kokkos.cpp @@ -0,0 +1,463 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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: Matt Bettencourt (NVIDIA) +------------------------------------------------------------------------- */ + +#include "pair_dpd_ext_kokkos.h" + +#include "atom.h" +#include "atom_kokkos.h" +#include "memory_kokkos.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "random_mars.h" +#include "update.h" +#include "atom_masks.h" +#include "kokkos.h" + +#include + +using namespace LAMMPS_NS; + +#define EPSILON 1.0e-10 + + +template +PairDPDExtKokkos::PairDPDExtKokkos(class LAMMPS *lmp) : + PairDPDExt(lmp) , +#ifdef DPD_USE_RAN_MARS + rand_pool(0 /* unused */, lmp) +#else + rand_pool() +#endif +{ + kokkosable = 1; + atomKK = (AtomKokkos *) atom; + execution_space = ExecutionSpaceFromDevice::space; + + datamask_read = EMPTY_MASK; + datamask_modify = EMPTY_MASK; +} + +/* ---------------------------------------------------------------------- */ + +template +PairDPDExtKokkos::~PairDPDExtKokkos() { + if (copymode) return; + +#ifdef DPD_USE_RAN_MARS + rand_pool.destroy(); +#endif + + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + + memoryKK->destroy_kokkos(k_cutsq,cutsq); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDExtKokkos::init_style() +{ + PairDPDExt::init_style(); + +#ifdef DPD_USE_RAN_MARS + rand_pool.init(random,seed); +#else + typedef Kokkos::Experimental::UniqueToken< + DeviceType, Kokkos::Experimental::UniqueTokenScope::Global> unique_token_type; + unique_token_type unique_token; + rand_pool.init(seed + comm->me,unique_token.size()); +#endif + + neighflag = lmp->kokkos->neighflag; + + if (force->newton_pair == 0 || neighflag == FULL) + error->all(FLERR,"Must use half neighbor list style and newton on with pair dpd/ext/kk"); + + auto request = neighbor->find_request(this); + request->set_kokkos_host(std::is_same::value && + !std::is_same::value); + request->set_kokkos_device(std::is_same::value); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDExtKokkos::compute(int eflagin, int vflagin) +{ + eflag = eflagin; vflag = vflagin; + + ev_init(eflag,vflag,0); + + if (eflag_atom) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + d_eatom = k_eatom.template view(); + } + if (vflag_atom) { + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"pair:vatom"); + d_vatom = k_vatom.template view(); + } + + atomKK->sync(execution_space,X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK); + + x = atomKK->k_x.view(); + v = atomKK->k_v.view(); + f = atomKK->k_f.view(); + type = atomKK->k_type.view(); + + k_cutsq.template sync(); + k_params.template sync(); + + special_lj[0] = force->special_lj[0]; + special_lj[1] = force->special_lj[1]; + special_lj[2] = force->special_lj[2]; + special_lj[3] = force->special_lj[3]; + + nlocal = atom->nlocal; + dtinvsqrt = 1.0/sqrt(update->dt); + + NeighListKokkos* k_list = static_cast*>(list); + d_numneigh = k_list->d_numneigh; + d_neighbors = k_list->d_neighbors; + d_ilist = k_list->d_ilist; + + need_dup = lmp->kokkos->need_dup(); + if (need_dup) { + dup_f = Kokkos::Experimental::create_scatter_view(f); + dup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); + dup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } else { + ndup_f = Kokkos::Experimental::create_scatter_view(f); + ndup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); + ndup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } + + // loop over neighbors of my atoms + + int inum = list->inum; + EV_FLOAT ev; + copymode = 1; + if (neighflag == HALF) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else if (neighflag == HALFTHREAD) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + + if (need_dup) + Kokkos::Experimental::contribute(f, dup_f); + + if (eflag_global) eng_vdwl += ev.evdwl; + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (vflag_fdotr) pair_virial_fdotr_compute(this); + + if (eflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_eatom, dup_eatom); + k_eatom.template modify(); + k_eatom.template sync(); + } + + if (vflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_vatom, dup_vatom); + k_vatom.template modify(); + k_vatom.template sync(); + } + + copymode = 0; + + if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); + else atomKK->modified(execution_space,F_MASK); + + // free duplicated memory + if (need_dup) { + dup_f = decltype(dup_f)(); + dup_eatom = decltype(dup_eatom)(); + dup_vatom = decltype(dup_vatom)(); + } +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDExtKokkos::operator() (TagDPDExtKokkos, const int &ii) const { + EV_FLOAT ev; + this->template operator()(TagDPDExtKokkos(), ii, ev); +} + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDExtKokkos::operator() (TagDPDExtKokkos, const int &ii, EV_FLOAT &ev) const { + + // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_f = ScatterViewHelper,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 fx = 0,fy = 0,fz = 0; + double evdwl = 0; + i = d_ilist[ii]; + xtmp = x(i,0); + ytmp = x(i,1); + ztmp = x(i,2); + vxtmp = v(i,0); + vytmp = v(i,1); + vztmp = v(i,2); + itype = type(i); + jnum = d_numneigh[i]; + rand_type rand_gen = rand_pool.get_state(); + for (jj = 0; jj < jnum; jj++) { + double P[3][3]; + j = d_neighbors(i,jj); + factor_dpd = special_lj[sbmask(j)]; + j &= NEIGHMASK; + + delx = xtmp - x(j,0); + dely = ytmp - x(j,1); + delz = ztmp - x(j,2); + rsq = delx*delx + dely*dely + delz*delz; + jtype = type(j); + if (rsq < d_cutsq(itype,jtype)) { + r = sqrt(rsq); + if (r < EPSILON) continue; // r can be 0.0 in DPD systems + rinv = 1.0/r; + delvx = vxtmp - v(j,0); + delvy = vytmp - v(j,1); + delvz = vztmp - v(j,2); + dot = delx*delvx + dely*delvy + delz*delvz; + + P[0][0] = 1.0 - delx*delx*rinv*rinv; + P[0][1] = - delx*dely*rinv*rinv; + P[0][2] = - delx*delz*rinv*rinv; + + P[1][0] = P[0][1]; + P[1][1] = 1.0 - dely*dely*rinv*rinv; + P[1][2] = - dely*delz*rinv*rinv; + + P[2][0] = P[0][2]; + P[2][1] = P[1][2]; + P[2][2] = 1.0 - delz*delz*rinv*rinv; + + wd = 1.0 - r/params(itype,jtype).cut; + wdPar = pow(wd,params(itype,jtype).ws); + wdPerp = pow(wd,params(itype,jtype).wsT); + + randnum = rand_gen.normal(); + randnumx = rand_gen.normal(); + randnumy = rand_gen.normal(); + randnumz = rand_gen.normal(); + + // conservative force + fpair = params(itype,jtype).a0*wd; + + // drag force - parallel + fpair -= params(itype,jtype).gamma*wdPar*wdPar*dot*rinv; + + // random force - parallel + fpair += 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); + + // 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; + + fx += fpairx; + fy += fpairy; + fz += fpairz; + a_f(j,0) -= fpairx; + a_f(j,1) -= fpairy; + a_f(j,2) -= fpairz; + + if (EVFLAG && eflag) { + // unshifted eng of conservative term: + // evdwl = -a0[itype][jtype]*r * (1.0-0.5*r/cut[itype][jtype]); + // eng shifted to 0.0 at cutoff + evdwl = 0.5*params(itype,jtype).a0*params(itype,jtype).cut* wd*wd; + evdwl *= factor_dpd; + if (EVFLAG && eflag_global) + ev.evdwl += evdwl; + } + if (EVFLAG && (eflag_atom || vflag_either)) + this->template ev_tally_xyz(ev,i,j,evdwl,fpairx,fpairy,fpairz,delx,dely,delz); + } + } + a_f(i,0) += fx; + a_f(i,1) += fy; + a_f(i,2) += fz; + rand_pool.free_state(rand_gen); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDExtKokkos::ev_tally_xyz(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &epair, + 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 +{ + // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); + + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); + + if (eflag_atom) { + const E_FLOAT epairhalf = 0.5 * epair; + a_eatom[i] += epairhalf; + a_eatom[j] += epairhalf; + } + + if (vflag_either) { + const E_FLOAT v0 = delx*fx; + const E_FLOAT v1 = dely*fy; + const E_FLOAT v2 = delz*fz; + const E_FLOAT v3 = delx*fy; + const E_FLOAT v4 = delx*fz; + const E_FLOAT v5 = dely*fz; + + if (vflag_global) { + ev.v[0] += v0; + ev.v[1] += v1; + ev.v[2] += v2; + ev.v[3] += v3; + ev.v[4] += v4; + ev.v[5] += v5; + } + + if (vflag_atom) { + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; + } + } +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDExtKokkos::allocate() +{ + PairDPDExt::allocate(); + int n = atom->ntypes; + + memory->destroy(cutsq); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + d_cutsq = k_cutsq.template view(); + + k_params = Kokkos::DualView("PairDPDExt::params",n+1,n+1); + params = k_params.template view(); +} + +/* ---------------------------------------------------------------------- */ + +template +KOKKOS_INLINE_FUNCTION +int PairDPDExtKokkos::sbmask(const int& j) const { + return j >> SBBITS & 3; +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +template +double PairDPDExtKokkos::init_one(int i, int j) +{ + double cutone = PairDPDExt::init_one(i,j); + + k_params.h_view(i,j).cut = cut[i][j]; + k_params.h_view(i,j).ws = ws[i][j]; + k_params.h_view(i,j).wsT = wsT[i][j]; + k_params.h_view(i,j).a0 = a0[i][j]; + k_params.h_view(i,j).gamma = gamma[i][j]; + k_params.h_view(i,j).sigma = sigma[i][j]; + k_params.h_view(i,j).gammaT = gammaT[i][j]; + k_params.h_view(i,j).sigmaT = sigmaT[i][j]; + k_params.h_view(j,i) = k_params.h_view(i,j); + + k_params.template modify(); + + k_cutsq.h_view(i,j) = cutone*cutone; + k_cutsq.h_view(j,i) = k_cutsq.h_view(i,j); + k_cutsq.template modify(); + + return cutone; +} + +namespace LAMMPS_NS { +template class PairDPDExtKokkos; +#ifdef LMP_KOKKOS_GPU +template class PairDPDExtKokkos; +#endif +} diff --git a/src/KOKKOS/pair_dpd_ext_kokkos.h b/src/KOKKOS/pair_dpd_ext_kokkos.h new file mode 100644 index 0000000000..1c04be6b01 --- /dev/null +++ b/src/KOKKOS/pair_dpd_ext_kokkos.h @@ -0,0 +1,143 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS +// clang-format off +PairStyle(dpd/ext/kk,PairDPDExtKokkos); +PairStyle(dpd/ext/kk/device,PairDPDExtKokkos); +PairStyle(dpd/ext/kk/host,PairDPDExtKokkos); +// clang-format on +#else + +#ifndef LMP_PAIR_DPD_EXT_KOKKOS_H +#define LMP_PAIR_DPD_EXT_KOKKOS_H + +#include "pair_dpd_ext.h" +#include "pair_kokkos.h" +#include "kokkos_type.h" + +#if !defined(DPD_USE_RAN_MARS) && !defined(DPD_USE_Random_XorShift64) && !defined(Random_XorShift1024) +#define DPD_USE_Random_XorShift64 +#endif + +#ifdef DPD_USE_RAN_MARS +#include "rand_pool_wrap_kokkos.h" +#else +#include "Kokkos_Random.hpp" +#endif + +namespace LAMMPS_NS { + +template +class PairDPDExtKokkos : public PairDPDExt { + public: + typedef DeviceType device_type; + typedef ArrayTypes AT; + typedef EV_FLOAT value_type; + + PairDPDExtKokkos(class LAMMPS*); + ~PairDPDExtKokkos() override; + + void allocate() override; + + void init_style() override; + double init_one(int i, int j) override; + void compute(int, int) override; + + struct params_dpd { + KOKKOS_INLINE_FUNCTION + params_dpd() {cut=ws=wsT=a0=gamma=sigma=gammaT=sigmaT=0;} + KOKKOS_INLINE_FUNCTION + params_dpd(int /*i*/) {cut=ws=wsT=a0=gamma=sigma=gammaT=sigmaT=0;} + F_FLOAT cut,ws,wsT,a0,gamma,sigma,gammaT,sigmaT; + }; + + template + struct TagDPDExtKokkos{}; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDExtKokkos, const int &i) const; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDExtKokkos, const int &i, EV_FLOAT&) const; + + template + KOKKOS_INLINE_FUNCTION + void ev_tally_xyz(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &epair, + 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]; + int eflag,vflag; + int neighflag,nlocal; + double dtinvsqrt; + + int need_dup; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; + +#ifdef DPD_USE_RAN_MARS + RandPoolWrap rand_pool; + typedef RandWrap rand_type; +#elif defined(DPD_USE_Random_XorShift64) + Kokkos::Random_XorShift64_Pool rand_pool; + typedef typename Kokkos::Random_XorShift64_Pool::generator_type rand_type; +#elif defined(DPD_USE_Random_XorShift1024) + Kokkos::Random_XorShift1024_Pool rand_pool; + typedef typename Kokkos::Random_XorShift1024_Pool::generator_type rand_type; +#endif + typename AT::t_x_array_randomread x; + typename AT::t_x_array_randomread v; + typename AT::t_f_array f; + typename AT::t_int_1d_randomread type; + + typename AT::t_neighbors_2d d_neighbors; + typename AT::t_int_1d_randomread d_ilist; + typename AT::t_int_1d_randomread d_numneigh; + + typename AT::tdual_ffloat_2d k_cutsq; + typename AT::t_ffloat_2d d_cutsq; + + Kokkos::DualView k_params; + typename Kokkos::DualView::t_dev_const_um params; + + DAT::tdual_efloat_1d k_eatom; + DAT::tdual_virial_array k_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; + + KOKKOS_INLINE_FUNCTION + int sbmask(const int& j) const; + friend void pair_virial_fdotr_compute(PairDPDExtKokkos*); + +}; +} +#endif +#endif diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp new file mode 100644 index 0000000000..76b7658ac9 --- /dev/null +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.cpp @@ -0,0 +1,444 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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: Matt Bettencourt (NVIDIA) +------------------------------------------------------------------------- */ + +#include "pair_dpd_ext_tstat_kokkos.h" + +#include "atom.h" +#include "atom_kokkos.h" +#include "memory_kokkos.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "random_mars.h" +#include "update.h" +#include "atom_masks.h" +#include "kokkos.h" + +#include + +using namespace LAMMPS_NS; + +#define EPSILON 1.0e-10 + + +template +PairDPDExtTstatKokkos::PairDPDExtTstatKokkos(class LAMMPS *lmp) : + PairDPDExtTstat(lmp) , +#ifdef DPD_USE_RAN_MARS + rand_pool(0 /* unused */, lmp) +#else + rand_pool() +#endif +{ + kokkosable = 1; + atomKK = (AtomKokkos *) atom; + execution_space = ExecutionSpaceFromDevice::space; + + datamask_read = EMPTY_MASK; + datamask_modify = EMPTY_MASK; +} + +/* ---------------------------------------------------------------------- */ + +template +PairDPDExtTstatKokkos::~PairDPDExtTstatKokkos() { + if (copymode) return; + +#ifdef DPD_USE_RAN_MARS + rand_pool.destroy(); +#endif + + memoryKK->destroy_kokkos(k_vatom,vatom); + + memoryKK->destroy_kokkos(k_cutsq,cutsq); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDExtTstatKokkos::init_style() +{ + PairDPDExt::init_style(); + +#ifdef DPD_USE_RAN_MARS + rand_pool.init(random,seed); +#else + typedef Kokkos::Experimental::UniqueToken< + DeviceType, Kokkos::Experimental::UniqueTokenScope::Global> unique_token_type; + unique_token_type unique_token; + rand_pool.init(seed + comm->me,unique_token.size()); +#endif + + neighflag = lmp->kokkos->neighflag; + + if (force->newton_pair == 0 || neighflag == FULL ) + error->all(FLERR,"Must use half neighbor list style and newton on with pair dpd/ext/kk"); + + auto request = neighbor->find_request(this); + request->set_kokkos_host(std::is_same::value && + !std::is_same::value); + request->set_kokkos_device(std::is_same::value); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDExtTstatKokkos::compute(int eflagin, int vflagin) +{ + eflag = eflagin; vflag = vflagin; + + ev_init(eflag,vflag,0); + + // adjust sigma if target T is changing + if (t_start != t_stop) { + double delta = update->ntimestep - update->beginstep; + if (delta != 0.0) delta /= update->endstep - update->beginstep; + temperature = t_start + delta * (t_stop-t_start); + double boltz = force->boltz; + for (int i = 1; i <= atom->ntypes; i++) + for (int j = i; j <= atom->ntypes; j++) { + k_params.h_view(i,j).sigma = k_params.h_view(j,i).sigma = + sqrt(2.0*boltz*temperature*gamma[i][j]); + } + } + k_params.template modify(); + + if (eflag_atom) { + maxeatom = atom->nmax; + memory->destroy(eatom); + 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"); + d_vatom = k_vatom.template view(); + } + + atomKK->sync(execution_space,X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK); + + x = atomKK->k_x.view(); + v = atomKK->k_v.view(); + f = atomKK->k_f.view(); + type = atomKK->k_type.view(); + + k_cutsq.template sync(); + k_params.template sync(); + + special_lj[0] = force->special_lj[0]; + special_lj[1] = force->special_lj[1]; + special_lj[2] = force->special_lj[2]; + special_lj[3] = force->special_lj[3]; + + nlocal = atom->nlocal; + dtinvsqrt = 1.0/sqrt(update->dt); + + NeighListKokkos* k_list = static_cast*>(list); + d_numneigh = k_list->d_numneigh; + d_neighbors = k_list->d_neighbors; + d_ilist = k_list->d_ilist; + + need_dup = lmp->kokkos->need_dup(); + if (need_dup) { + dup_f = Kokkos::Experimental::create_scatter_view(f); + dup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } else { + ndup_f = Kokkos::Experimental::create_scatter_view(f); + ndup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } + + // loop over neighbors of my atoms + + int inum = list->inum; + EV_FLOAT ev; + copymode = 1; + if (neighflag == HALF) { + if (vflag_either) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else if (neighflag == HALFTHREAD) { + if (vflag_either) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + + if (need_dup) + Kokkos::Experimental::contribute(f, dup_f); + + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (vflag_fdotr) pair_virial_fdotr_compute(this); + + if (vflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_vatom, dup_vatom); + k_vatom.template modify(); + k_vatom.template sync(); + } + + copymode = 0; + + if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); + else atomKK->modified(execution_space,F_MASK); + + // free duplicated memory + if (need_dup) { + dup_f = decltype(dup_f)(); + dup_vatom = decltype(dup_vatom)(); + } +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos, const int &ii) const { + EV_FLOAT ev; + this->template operator()(TagDPDExtTstatKokkos(), ii, ev); +} + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDExtTstatKokkos::operator() (TagDPDExtTstatKokkos, const int &ii, EV_FLOAT &ev) const { + + // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_f = ScatterViewHelper,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 fx = 0,fy = 0,fz = 0; + + i = d_ilist[ii]; + xtmp = x(i,0); + ytmp = x(i,1); + ztmp = x(i,2); + vxtmp = v(i,0); + vytmp = v(i,1); + vztmp = v(i,2); + itype = type(i); + jnum = d_numneigh[i]; + rand_type rand_gen = rand_pool.get_state(); + for (jj = 0; jj < jnum; jj++) { + double P[3][3]; + j = d_neighbors(i,jj); + factor_dpd = special_lj[sbmask(j)]; + j &= NEIGHMASK; + + delx = xtmp - x(j,0); + dely = ytmp - x(j,1); + delz = ztmp - x(j,2); + rsq = delx*delx + dely*dely + delz*delz; + jtype = type(j); + if (rsq < d_cutsq(itype,jtype)) { + r = sqrt(rsq); + if (r < EPSILON) continue; // r can be 0.0 in DPD systems + rinv = 1.0/r; + delvx = vxtmp - v(j,0); + delvy = vytmp - v(j,1); + delvz = vztmp - v(j,2); + dot = delx*delvx + dely*delvy + delz*delvz; + + P[0][0] = 1.0 - delx*delx*rinv*rinv; + P[0][1] = - delx*dely*rinv*rinv; + P[0][2] = - delx*delz*rinv*rinv; + + P[1][0] = P[0][1]; + P[1][1] = 1.0 - dely*dely*rinv*rinv; + P[1][2] = - dely*delz*rinv*rinv; + + P[2][0] = P[0][2]; + P[2][1] = P[1][2]; + P[2][2] = 1.0 - delz*delz*rinv*rinv; + + wd = 1.0 - r/params(itype,jtype).cut; + wdPar = pow(wd,params(itype,jtype).ws); + wdPerp = pow(wd,params(itype,jtype).wsT); + + randnum = rand_gen.normal(); + randnumx = rand_gen.normal(); + randnumy = rand_gen.normal(); + randnumz = rand_gen.normal(); + + // drag force - parallel + fpair = -params(itype,jtype).gamma*wdPar*wdPar*dot*rinv; + + // random force - parallel + fpair += 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); + + // 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; + + fx += fpairx; + fy += fpairy; + fz += fpairz; + a_f(j,0) -= fpairx; + a_f(j,1) -= fpairy; + a_f(j,2) -= fpairz; + + if (VFLAG) + this->template v_tally_xyz(ev,i,j,fpairx,fpairy,fpairz,delx,dely,delz); + } + } + a_f(i,0) += fx; + a_f(i,1) += fy; + a_f(i,2) += fz; + rand_pool.free_state(rand_gen); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDExtTstatKokkos::v_tally_xyz(EV_FLOAT &ev, const int &i, const int &j, + 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 +{ + + // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); + + const E_FLOAT v0 = delx*fx; + const E_FLOAT v1 = dely*fy; + const E_FLOAT v2 = delz*fz; + const E_FLOAT v3 = delx*fy; + const E_FLOAT v4 = delx*fz; + const E_FLOAT v5 = dely*fz; + + if (vflag_global) { + ev.v[0] += v0; + ev.v[1] += v1; + ev.v[2] += v2; + ev.v[3] += v3; + ev.v[4] += v4; + ev.v[5] += v5; + } + + if (vflag_atom) { + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; + } +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDExtTstatKokkos::allocate() +{ + PairDPDExt::allocate(); + int n = atom->ntypes; + + memory->destroy(cutsq); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + d_cutsq = k_cutsq.template view(); + + k_params = Kokkos::DualView("PairDPDExt::params",n+1,n+1); + params = k_params.template view(); +} + +/* ---------------------------------------------------------------------- */ + +template +KOKKOS_INLINE_FUNCTION +int PairDPDExtTstatKokkos::sbmask(const int& j) const { + return j >> SBBITS & 3; +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +template +double PairDPDExtTstatKokkos::init_one(int i, int j) +{ + double cutone = PairDPDExt::init_one(i,j); + + k_params.h_view(i,j).cut = cut[i][j]; + k_params.h_view(i,j).ws = ws[i][j]; + k_params.h_view(i,j).wsT = wsT[i][j]; + k_params.h_view(i,j).gamma = gamma[i][j]; + k_params.h_view(i,j).sigma = sigma[i][j]; + k_params.h_view(i,j).gammaT = gammaT[i][j]; + k_params.h_view(i,j).sigmaT = sigmaT[i][j]; + k_params.h_view(j,i) = k_params.h_view(i,j); + + k_params.template modify(); + + k_cutsq.h_view(i,j) = cutone*cutone; + k_cutsq.h_view(j,i) = k_cutsq.h_view(i,j); + k_cutsq.template modify(); + + return cutone; +} + +namespace LAMMPS_NS { +template class PairDPDExtTstatKokkos; +#ifdef LMP_KOKKOS_GPU +template class PairDPDExtTstatKokkos; +#endif +} diff --git a/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h new file mode 100644 index 0000000000..03debe58af --- /dev/null +++ b/src/KOKKOS/pair_dpd_ext_tstat_kokkos.h @@ -0,0 +1,138 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS +// clang-format off +PairStyle(dpd/ext/tstat/kk,PairDPDExtTstatKokkos); +PairStyle(dpd/ext/tstat/kk/device,PairDPDExtTstatKokkos); +PairStyle(dpd/ext/tstat/kk/host,PairDPDExtTstatKokkos); +// clang-format on +#else + +#ifndef LMP_PAIR_DPD_EXT_TSTAT_KOKKOS_H +#define LMP_PAIR_DPD_EXT_TSTAT_KOKKOS_H + +#include "pair_dpd_ext_tstat.h" +#include "pair_kokkos.h" +#include "kokkos_type.h" + +#if !defined(DPD_USE_RAN_MARS) && !defined(DPD_USE_Random_XorShift64) && !defined(Random_XorShift1024) +#define DPD_USE_Random_XorShift64 +#endif + +#ifdef DPD_USE_RAN_MARS +#include "rand_pool_wrap_kokkos.h" +#else +#include "Kokkos_Random.hpp" +#endif + +namespace LAMMPS_NS { + +template +class PairDPDExtTstatKokkos : public PairDPDExtTstat { + public: + typedef DeviceType device_type; + typedef ArrayTypes AT; + typedef EV_FLOAT value_type; + + PairDPDExtTstatKokkos(class LAMMPS*); + ~PairDPDExtTstatKokkos() override; + + void allocate() override; + + void init_style() override; + double init_one(int i, int j) override; + void compute(int, int) override; + + struct params_dpd { + KOKKOS_INLINE_FUNCTION + params_dpd() {cut=ws=wsT=gamma=sigma=gammaT=sigmaT=0;} + KOKKOS_INLINE_FUNCTION + params_dpd(int /*i*/) {cut=ws=wsT=gamma=sigma=gammaT=sigmaT=0;} + F_FLOAT cut,ws,wsT,gamma,sigma,gammaT,sigmaT; + }; + + template + struct TagDPDExtTstatKokkos{}; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDExtTstatKokkos, const int &i) const; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDExtTstatKokkos, const int &i, EV_FLOAT&) const; + + template + KOKKOS_INLINE_FUNCTION + void v_tally_xyz(EV_FLOAT &ev, const int &i, const int &j, + 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]; + int eflag,vflag; + int neighflag,nlocal; + double dtinvsqrt; + + int need_dup; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_vatom; + NonDupScatterView ndup_f; + NonDupScatterView ndup_vatom; + +#ifdef DPD_USE_RAN_MARS + RandPoolWrap rand_pool; + typedef RandWrap rand_type; +#elif defined(DPD_USE_Random_XorShift64) + Kokkos::Random_XorShift64_Pool rand_pool; + typedef typename Kokkos::Random_XorShift64_Pool::generator_type rand_type; +#elif defined(DPD_USE_Random_XorShift1024) + Kokkos::Random_XorShift1024_Pool rand_pool; + typedef typename Kokkos::Random_XorShift1024_Pool::generator_type rand_type; +#endif + typename AT::t_x_array_randomread x; + typename AT::t_x_array_randomread v; + typename AT::t_f_array f; + typename AT::t_int_1d_randomread type; + + typename AT::t_neighbors_2d d_neighbors; + typename AT::t_int_1d_randomread d_ilist; + typename AT::t_int_1d_randomread d_numneigh; + + typename AT::tdual_ffloat_2d k_cutsq; + typename AT::t_ffloat_2d d_cutsq; + + Kokkos::DualView k_params; + typename Kokkos::DualView::t_dev_const_um params; + + DAT::tdual_virial_array k_vatom; + typename AT::t_virial_array d_vatom; + + KOKKOS_INLINE_FUNCTION + int sbmask(const int& j) const; + friend void pair_virial_fdotr_compute(PairDPDExtTstatKokkos*); + +}; +} +#endif +#endif diff --git a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp index 123467865a..dc22938dc8 100644 --- a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp @@ -729,21 +729,19 @@ void PairDPDfdtEnergyKokkos::ev_tally(EV_FLOAT &ev, const int &i, co if (vflag_atom) { if (NEIGHFLAG!=FULL) { - if (NEWTON_PAIR || i < nlocal) { - v_vatom(i,0) += 0.5*v0; - v_vatom(i,1) += 0.5*v1; - v_vatom(i,2) += 0.5*v2; - v_vatom(i,3) += 0.5*v3; - v_vatom(i,4) += 0.5*v4; - v_vatom(i,5) += 0.5*v5; - } + v_vatom(i,0) += 0.5*v0; + v_vatom(i,1) += 0.5*v1; + v_vatom(i,2) += 0.5*v2; + v_vatom(i,3) += 0.5*v3; + v_vatom(i,4) += 0.5*v4; + v_vatom(i,5) += 0.5*v5; if (NEWTON_PAIR || j < nlocal) { - v_vatom(j,0) += 0.5*v0; - v_vatom(j,1) += 0.5*v1; - v_vatom(j,2) += 0.5*v2; - v_vatom(j,3) += 0.5*v3; - v_vatom(j,4) += 0.5*v4; - v_vatom(j,5) += 0.5*v5; + v_vatom(j,0) += 0.5*v0; + v_vatom(j,1) += 0.5*v1; + v_vatom(j,2) += 0.5*v2; + v_vatom(j,3) += 0.5*v3; + v_vatom(j,4) += 0.5*v4; + v_vatom(j,5) += 0.5*v5; } } else { v_vatom(i,0) += 0.5*v0; diff --git a/src/KOKKOS/pair_dpd_kokkos.cpp b/src/KOKKOS/pair_dpd_kokkos.cpp new file mode 100644 index 0000000000..2b2c4594ac --- /dev/null +++ b/src/KOKKOS/pair_dpd_kokkos.cpp @@ -0,0 +1,417 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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: Matt Bettencourt (NVIDIA) +------------------------------------------------------------------------- */ + +#include "pair_dpd_kokkos.h" + +#include "atom.h" +#include "atom_kokkos.h" +#include "memory_kokkos.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "random_mars.h" +#include "update.h" +#include "atom_masks.h" +#include "kokkos.h" + +#include + +using namespace LAMMPS_NS; + +#define EPSILON 1.0e-10 + + +template +PairDPDKokkos::PairDPDKokkos(class LAMMPS *lmp) : + PairDPD(lmp) , +#ifdef DPD_USE_RAN_MARS + rand_pool(0 /* unused */, lmp) +#else + rand_pool() +#endif +{ + kokkosable = 1; + atomKK = (AtomKokkos *) atom; + execution_space = ExecutionSpaceFromDevice::space; + + datamask_read = EMPTY_MASK; + datamask_modify = EMPTY_MASK; +} + +/* ---------------------------------------------------------------------- */ + +template +PairDPDKokkos::~PairDPDKokkos() { + if (copymode) return; + +#ifdef DPD_USE_RAN_MARS + rand_pool.destroy(); +#endif + + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + + memoryKK->destroy_kokkos(k_cutsq,cutsq); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDKokkos::init_style() +{ + PairDPD::init_style(); + +#ifdef DPD_USE_RAN_MARS + rand_pool.init(random,seed); +#else + typedef Kokkos::Experimental::UniqueToken< + DeviceType, Kokkos::Experimental::UniqueTokenScope::Global> unique_token_type; + unique_token_type unique_token; + rand_pool.init(seed + comm->me,unique_token.size()); +#endif + + neighflag = lmp->kokkos->neighflag; + + if (force->newton_pair == 0 || neighflag == FULL) + error->all(FLERR,"Must use half neighbor list style and newton on with pair dpd/kk"); + + auto request = neighbor->find_request(this); + request->set_kokkos_host(std::is_same::value && + !std::is_same::value); + request->set_kokkos_device(std::is_same::value); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDKokkos::compute(int eflagin, int vflagin) +{ + eflag = eflagin; vflag = vflagin; + + ev_init(eflag,vflag,0); + + if (eflag_atom) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom"); + d_eatom = k_eatom.template view(); + } + if (vflag_atom) { + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->create_kokkos(k_vatom,vatom,maxvatom,"pair:vatom"); + d_vatom = k_vatom.template view(); + } + + atomKK->sync(execution_space,X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK); + + x = atomKK->k_x.view(); + v = atomKK->k_v.view(); + f = atomKK->k_f.view(); + type = atomKK->k_type.view(); + + k_cutsq.template sync(); + k_params.template sync(); + + special_lj[0] = force->special_lj[0]; + special_lj[1] = force->special_lj[1]; + special_lj[2] = force->special_lj[2]; + special_lj[3] = force->special_lj[3]; + + nlocal = atom->nlocal; + dtinvsqrt = 1.0/sqrt(update->dt); + + NeighListKokkos* k_list = static_cast*>(list); + d_numneigh = k_list->d_numneigh; + d_neighbors = k_list->d_neighbors; + d_ilist = k_list->d_ilist; + + need_dup = lmp->kokkos->need_dup(); + if (need_dup) { + dup_f = Kokkos::Experimental::create_scatter_view(f); + dup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); + dup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } else { + ndup_f = Kokkos::Experimental::create_scatter_view(f); + ndup_eatom = Kokkos::Experimental::create_scatter_view(d_eatom); + ndup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } + + // loop over neighbors of my atoms + + int inum = list->inum; + EV_FLOAT ev; + copymode = 1; + if (neighflag == HALF) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else if (neighflag == HALFTHREAD) { + if (evflag) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + + if (need_dup) + Kokkos::Experimental::contribute(f, dup_f); + + if (eflag_global) eng_vdwl += ev.evdwl; + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (vflag_fdotr) pair_virial_fdotr_compute(this); + + if (eflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_eatom, dup_eatom); + k_eatom.template modify(); + k_eatom.template sync(); + } + + if (vflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_vatom, dup_vatom); + k_vatom.template modify(); + k_vatom.template sync(); + } + + copymode = 0; + + if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); + else atomKK->modified(execution_space,F_MASK); + + // free duplicated memory + if (need_dup) { + dup_f = decltype(dup_f)(); + dup_eatom = decltype(dup_eatom)(); + dup_vatom = decltype(dup_vatom)(); + } +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDKokkos::operator() (TagDPDKokkos, const int &ii) const { + EV_FLOAT ev; + this->template operator()(TagDPDKokkos(), ii, ev); +} + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDKokkos::operator() (TagDPDKokkos, const int &ii, EV_FLOAT &ev) const { + + // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_f = ScatterViewHelper,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,fpair; + double vxtmp,vytmp,vztmp,delvx,delvy,delvz; + double rsq,r,rinv,dot,wd,randnum,factor_dpd; + double fx = 0,fy = 0,fz = 0; + double evdwl = 0; + i = d_ilist[ii]; + xtmp = x(i,0); + ytmp = x(i,1); + ztmp = x(i,2); + vxtmp = v(i,0); + vytmp = v(i,1); + vztmp = v(i,2); + itype = type(i); + jnum = d_numneigh[i]; + rand_type rand_gen = rand_pool.get_state(); + for (jj = 0; jj < jnum; jj++) { + j = d_neighbors(i,jj); + factor_dpd = special_lj[sbmask(j)]; + j &= NEIGHMASK; + + delx = xtmp - x(j,0); + dely = ytmp - x(j,1); + delz = ztmp - x(j,2); + rsq = delx*delx + dely*dely + delz*delz; + jtype = type(j); + if (rsq < d_cutsq(itype,jtype)) { + r = sqrt(rsq); + if (r < EPSILON) continue; // r can be 0.0 in DPD systems + rinv = 1.0/r; + delvx = vxtmp - v(j,0); + delvy = vytmp - v(j,1); + delvz = vztmp - v(j,2); + dot = delx*delvx + dely*delvy + delz*delvz; + + wd = 1.0 - r/params(itype,jtype).cut; + + randnum = rand_gen.normal(); + + // conservative force + fpair = params(itype,jtype).a0*wd; + + // drag force - parallel + fpair -= params(itype,jtype).gamma*wd*wd*dot*rinv; + + // random force - parallel + fpair += params(itype,jtype).sigma*wd*randnum*dtinvsqrt; + fpair *= factor_dpd*rinv; + + fx += fpair*delx; + fy += fpair*dely; + fz += fpair*delz; + + a_f(j,0) -= fpair*delx; + a_f(j,1) -= fpair*dely; + a_f(j,2) -= fpair*delz; + + if (EVFLAG && eflag_global) { + // unshifted eng of conservative term: + // evdwl = -a0[itype][jtype]*r * (1.0-0.5*r/cut[itype][jtype]); + // eng shifted to 0.0 at cutoff + evdwl = 0.5*params(itype,jtype).a0*params(itype,jtype).cut* wd*wd; + evdwl *= factor_dpd; + ev.evdwl += evdwl; + } + if (EVFLAG && (eflag_atom || vflag_either)) + this->template ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz); + } + } + a_f(i,0) += fx; + a_f(i,1) += fy; + a_f(i,2) += fz; + rand_pool.free_state(rand_gen); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDKokkos::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 +{ + // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access>(); + + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); + + if (eflag_atom) { + const E_FLOAT epairhalf = 0.5 * epair; + a_eatom[i] += epairhalf; + a_eatom[j] += epairhalf; + } + + if (vflag_either) { + const E_FLOAT v0 = delx*delx*fpair; + const E_FLOAT v1 = dely*dely*fpair; + const E_FLOAT v2 = delz*delz*fpair; + const E_FLOAT v3 = delx*dely*fpair; + const E_FLOAT v4 = delx*delz*fpair; + const E_FLOAT v5 = dely*delz*fpair; + + if (vflag_global) { + ev.v[0] += v0; + ev.v[1] += v1; + ev.v[2] += v2; + ev.v[3] += v3; + ev.v[4] += v4; + ev.v[5] += v5; + } + + if (vflag_atom) { + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; + } + } +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDKokkos::allocate() +{ + PairDPD::allocate(); + int n = atom->ntypes; + + memory->destroy(cutsq); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + d_cutsq = k_cutsq.template view(); + + k_params = Kokkos::DualView("PairDPD::params",n+1,n+1); + params = k_params.template view(); +} + +/* ---------------------------------------------------------------------- */ + +template +KOKKOS_INLINE_FUNCTION +int PairDPDKokkos::sbmask(const int& j) const { + return j >> SBBITS & 3; +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +template +double PairDPDKokkos::init_one(int i, int j) +{ + double cutone = PairDPD::init_one(i,j); + + k_params.h_view(i,j).cut = cut[i][j]; + k_params.h_view(i,j).a0 = a0[i][j]; + k_params.h_view(i,j).gamma = gamma[i][j]; + k_params.h_view(i,j).sigma = sigma[i][j]; + k_params.h_view(j,i) = k_params.h_view(i,j); + + k_params.template modify(); + + k_cutsq.h_view(i,j) = cutone*cutone; + k_cutsq.h_view(j,i) = k_cutsq.h_view(i,j); + k_cutsq.template modify(); + + return cutone; +} + +namespace LAMMPS_NS { +template class PairDPDKokkos; +#ifdef LMP_KOKKOS_GPU +template class PairDPDKokkos; +#endif +} diff --git a/src/KOKKOS/pair_dpd_kokkos.h b/src/KOKKOS/pair_dpd_kokkos.h new file mode 100644 index 0000000000..c492ffcfdd --- /dev/null +++ b/src/KOKKOS/pair_dpd_kokkos.h @@ -0,0 +1,142 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS +// clang-format off +PairStyle(dpd/kk,PairDPDKokkos); +PairStyle(dpd/kk/device,PairDPDKokkos); +PairStyle(dpd/kk/host,PairDPDKokkos); +// clang-format on +#else + +#ifndef LMP_PAIR_DPD_KOKKOS_H +#define LMP_PAIR_DPD_KOKKOS_H + +#include "pair_dpd.h" +#include "pair_kokkos.h" +#include "kokkos_type.h" + +#if !defined(DPD_USE_RAN_MARS) && !defined(DPD_USE_Random_XorShift64) && !defined(Random_XorShift1024) +#define DPD_USE_Random_XorShift64 +#endif + +#ifdef DPD_USE_RAN_MARS +#include "rand_pool_wrap_kokkos.h" +#else +#include "Kokkos_Random.hpp" +#endif + +namespace LAMMPS_NS { + +template +class PairDPDKokkos : public PairDPD { + public: + typedef DeviceType device_type; + typedef ArrayTypes AT; + typedef EV_FLOAT value_type; + + PairDPDKokkos(class LAMMPS*); + ~PairDPDKokkos() override; + + void allocate() override; + + void init_style() override; + double init_one(int i, int j) override; + void compute(int, int) override; + + struct params_dpd { + KOKKOS_INLINE_FUNCTION + params_dpd() {cut=a0=gamma=sigma=0;} + KOKKOS_INLINE_FUNCTION + params_dpd(int /*i*/) {cut=a0=gamma=sigma=0;} + F_FLOAT cut,a0,gamma,sigma; + }; + + template + struct TagDPDKokkos{}; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDKokkos, const int &i) const; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDKokkos, const int &i, EV_FLOAT&) const; + + 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; + private: + double special_lj[4]; + int eflag,vflag; + int neighflag,nlocal; + double dtinvsqrt; + + int need_dup; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_eatom; + DupScatterView dup_vatom; + NonDupScatterView ndup_f; + NonDupScatterView ndup_eatom; + NonDupScatterView ndup_vatom; + +#ifdef DPD_USE_RAN_MARS + RandPoolWrap rand_pool; + typedef RandWrap rand_type; +#elif defined(DPD_USE_Random_XorShift64) + Kokkos::Random_XorShift64_Pool rand_pool; + typedef typename Kokkos::Random_XorShift64_Pool::generator_type rand_type; +#elif defined(DPD_USE_Random_XorShift1024) + Kokkos::Random_XorShift1024_Pool rand_pool; + typedef typename Kokkos::Random_XorShift1024_Pool::generator_type rand_type; +#endif + typename AT::t_x_array_randomread x; + typename AT::t_x_array_randomread v; + typename AT::t_f_array f; + typename AT::t_int_1d_randomread type; + + typename AT::t_neighbors_2d d_neighbors; + typename AT::t_int_1d_randomread d_ilist; + typename AT::t_int_1d_randomread d_numneigh; + + typename AT::tdual_ffloat_2d k_cutsq; + typename AT::t_ffloat_2d d_cutsq; + + Kokkos::DualView k_params; + typename Kokkos::DualView::t_dev_const_um params; + + DAT::tdual_efloat_1d k_eatom; + DAT::tdual_virial_array k_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; + + KOKKOS_INLINE_FUNCTION + int sbmask(const int& j) const; + friend void pair_virial_fdotr_compute(PairDPDKokkos*); + +}; +} +#endif +#endif diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.cpp b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp new file mode 100644 index 0000000000..d9a37c825a --- /dev/null +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.cpp @@ -0,0 +1,399 @@ +// clang-format off +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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: Matt Bettencourt (NVIDIA) +------------------------------------------------------------------------- */ + +#include "pair_dpd_tstat_kokkos.h" + +#include "atom.h" +#include "atom_kokkos.h" +#include "memory_kokkos.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "random_mars.h" +#include "update.h" +#include "atom_masks.h" +#include "kokkos.h" + +#include + +using namespace LAMMPS_NS; + +#define EPSILON 1.0e-10 + + +template +PairDPDTstatKokkos::PairDPDTstatKokkos(class LAMMPS *lmp) : + PairDPDTstat(lmp) , +#ifdef DPD_USE_RAN_MARS + rand_pool(0 /* unused */, lmp) +#else + rand_pool() +#endif +{ + kokkosable = 1; + atomKK = (AtomKokkos *) atom; + execution_space = ExecutionSpaceFromDevice::space; + + datamask_read = EMPTY_MASK; + datamask_modify = EMPTY_MASK; +} + +/* ---------------------------------------------------------------------- */ + +template +PairDPDTstatKokkos::~PairDPDTstatKokkos() { + if (copymode) return; + +#ifdef DPD_USE_RAN_MARS + rand_pool.destroy(); +#endif + + memoryKK->destroy_kokkos(k_vatom,vatom); + + memoryKK->destroy_kokkos(k_cutsq,cutsq); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDTstatKokkos::init_style() +{ + PairDPD::init_style(); + +#ifdef DPD_USE_RAN_MARS + rand_pool.init(random,seed); +#else + typedef Kokkos::Experimental::UniqueToken< + DeviceType, Kokkos::Experimental::UniqueTokenScope::Global> unique_token_type; + unique_token_type unique_token; + rand_pool.init(seed + comm->me,unique_token.size()); +#endif + + neighflag = lmp->kokkos->neighflag; + + if (force->newton_pair == 0 || neighflag == FULL ) + error->all(FLERR,"Must use half neighbor list style and newton on with pair dpd/kk"); + + auto request = neighbor->find_request(this); + request->set_kokkos_host(std::is_same::value && + !std::is_same::value); + request->set_kokkos_device(std::is_same::value); +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDTstatKokkos::compute(int eflagin, int vflagin) +{ + eflag = eflagin; vflag = vflagin; + + ev_init(eflag,vflag,0); + + // adjust sigma if target T is changing + if (t_start != t_stop) { + double delta = update->ntimestep - update->beginstep; + if (delta != 0.0) delta /= update->endstep - update->beginstep; + temperature = t_start + delta * (t_stop-t_start); + double boltz = force->boltz; + for (int i = 1; i <= atom->ntypes; i++) + for (int j = i; j <= atom->ntypes; j++) { + k_params.h_view(i,j).sigma = k_params.h_view(j,i).sigma = + sqrt(2.0*boltz*temperature*gamma[i][j]); + } + } + k_params.template modify(); + + if (eflag_atom) { + maxeatom = atom->nmax; + memory->destroy(eatom); + 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"); + d_vatom = k_vatom.template view(); + } + + atomKK->sync(execution_space,X_MASK | V_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK); + + x = atomKK->k_x.view(); + v = atomKK->k_v.view(); + f = atomKK->k_f.view(); + type = atomKK->k_type.view(); + + k_cutsq.template sync(); + k_params.template sync(); + + special_lj[0] = force->special_lj[0]; + special_lj[1] = force->special_lj[1]; + special_lj[2] = force->special_lj[2]; + special_lj[3] = force->special_lj[3]; + + nlocal = atom->nlocal; + dtinvsqrt = 1.0/sqrt(update->dt); + + NeighListKokkos* k_list = static_cast*>(list); + d_numneigh = k_list->d_numneigh; + d_neighbors = k_list->d_neighbors; + d_ilist = k_list->d_ilist; + + need_dup = lmp->kokkos->need_dup(); + if (need_dup) { + dup_f = Kokkos::Experimental::create_scatter_view(f); + dup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } else { + ndup_f = Kokkos::Experimental::create_scatter_view(f); + ndup_vatom = Kokkos::Experimental::create_scatter_view(d_vatom); + } + + // loop over neighbors of my atoms + + int inum = list->inum; + EV_FLOAT ev; + copymode = 1; + if (neighflag == HALF) { + if (vflag_either) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } else if (neighflag == HALFTHREAD) { + if (vflag_either) Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + else Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + } + + if (need_dup) + Kokkos::Experimental::contribute(f, dup_f); + + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (vflag_fdotr) pair_virial_fdotr_compute(this); + + if (vflag_atom) { + if (need_dup) + Kokkos::Experimental::contribute(d_vatom, dup_vatom); + k_vatom.template modify(); + k_vatom.template sync(); + } + + copymode = 0; + + if (evflag) atomKK->modified(execution_space,F_MASK | ENERGY_MASK | VIRIAL_MASK); + else atomKK->modified(execution_space,F_MASK); + + // free duplicated memory + if (need_dup) { + dup_f = decltype(dup_f)(); + dup_vatom = decltype(dup_vatom)(); + } +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos, const int &ii) const { + EV_FLOAT ev; + this->template operator()(TagDPDTstatKokkos(), ii, ev); +} + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDTstatKokkos::operator() (TagDPDTstatKokkos, const int &ii, EV_FLOAT &ev) const { + + // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_f = ScatterViewHelper,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,fpair; + double vxtmp,vytmp,vztmp,delvx,delvy,delvz; + double rsq,r,rinv,dot,wd,randnum,factor_dpd; + double fx = 0,fy = 0,fz = 0; + + i = d_ilist[ii]; + xtmp = x(i,0); + ytmp = x(i,1); + ztmp = x(i,2); + vxtmp = v(i,0); + vytmp = v(i,1); + vztmp = v(i,2); + itype = type(i); + jnum = d_numneigh[i]; + rand_type rand_gen = rand_pool.get_state(); + for (jj = 0; jj < jnum; jj++) { + j = d_neighbors(i,jj); + factor_dpd = special_lj[sbmask(j)]; + j &= NEIGHMASK; + + delx = xtmp - x(j,0); + dely = ytmp - x(j,1); + delz = ztmp - x(j,2); + rsq = delx*delx + dely*dely + delz*delz; + jtype = type(j); + if (rsq < d_cutsq(itype,jtype)) { + r = sqrt(rsq); + if (r < EPSILON) continue; // r can be 0.0 in DPD systems + rinv = 1.0/r; + delvx = vxtmp - v(j,0); + delvy = vytmp - v(j,1); + delvz = vztmp - v(j,2); + dot = delx*delvx + dely*delvy + delz*delvz; + + wd = 1.0 - r/params(itype,jtype).cut; + + randnum = rand_gen.normal(); + + // drag force - parallel + fpair = -params(itype,jtype).gamma*wd*wd*dot*rinv; + + // random force - parallel + fpair += params(itype,jtype).sigma*wd*randnum*dtinvsqrt; + fpair *= factor_dpd*rinv; + + fx += fpair*delx; + fy += fpair*dely; + fz += fpair*delz; + + a_f(j,0) -= fpair*delx; + a_f(j,1) -= fpair*dely; + a_f(j,2) -= fpair*delz; + + if (VFLAG) + this->template v_tally(ev,i,j,fpair,delx,dely,delz); + } + } + a_f(i,0) += fx; + a_f(i,1) += fy; + a_f(i,2) += fz; + rand_pool.free_state(rand_gen); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairDPDTstatKokkos::v_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &fpair, const F_FLOAT &delx, + const F_FLOAT &dely, const F_FLOAT &delz) const +{ + + // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial + + auto v_vatom = ScatterViewHelper,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access>(); + + const E_FLOAT v0 = delx*delx*fpair; + const E_FLOAT v1 = dely*dely*fpair; + const E_FLOAT v2 = delz*delz*fpair; + const E_FLOAT v3 = delx*dely*fpair; + const E_FLOAT v4 = delx*delz*fpair; + const E_FLOAT v5 = dely*delz*fpair; + + if (vflag_global) { + ev.v[0] += v0; + ev.v[1] += v1; + ev.v[2] += v2; + ev.v[3] += v3; + ev.v[4] += v4; + ev.v[5] += v5; + } + + if (vflag_atom) { + a_vatom(i,0) += 0.5*v0; + a_vatom(i,1) += 0.5*v1; + a_vatom(i,2) += 0.5*v2; + a_vatom(i,3) += 0.5*v3; + a_vatom(i,4) += 0.5*v4; + a_vatom(i,5) += 0.5*v5; + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; + } +} + +/* ---------------------------------------------------------------------- */ + +template +void PairDPDTstatKokkos::allocate() +{ + PairDPD::allocate(); + int n = atom->ntypes; + + memory->destroy(cutsq); + memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); + d_cutsq = k_cutsq.template view(); + + k_params = Kokkos::DualView("PairDPD::params",n+1,n+1); + params = k_params.template view(); +} + +/* ---------------------------------------------------------------------- */ + +template +KOKKOS_INLINE_FUNCTION +int PairDPDTstatKokkos::sbmask(const int& j) const { + return j >> SBBITS & 3; +} + +/* ---------------------------------------------------------------------- + init for one type pair i,j and corresponding j,i +------------------------------------------------------------------------- */ + +template +double PairDPDTstatKokkos::init_one(int i, int j) +{ + double cutone = PairDPD::init_one(i,j); + + k_params.h_view(i,j).cut = cut[i][j]; + k_params.h_view(i,j).gamma = gamma[i][j]; + k_params.h_view(i,j).sigma = sigma[i][j]; + k_params.h_view(j,i) = k_params.h_view(i,j); + + k_params.template modify(); + + k_cutsq.h_view(i,j) = cutone*cutone; + k_cutsq.h_view(j,i) = k_cutsq.h_view(i,j); + k_cutsq.template modify(); + + return cutone; +} + +namespace LAMMPS_NS { +template class PairDPDTstatKokkos; +#ifdef LMP_KOKKOS_GPU +template class PairDPDTstatKokkos; +#endif +} diff --git a/src/KOKKOS/pair_dpd_tstat_kokkos.h b/src/KOKKOS/pair_dpd_tstat_kokkos.h new file mode 100644 index 0000000000..ae21cd1a14 --- /dev/null +++ b/src/KOKKOS/pair_dpd_tstat_kokkos.h @@ -0,0 +1,138 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS +// clang-format off +PairStyle(dpd/tstat/kk,PairDPDTstatKokkos); +PairStyle(dpd/tstat/kk/device,PairDPDTstatKokkos); +PairStyle(dpd/tstat/kk/host,PairDPDTstatKokkos); +// clang-format on +#else + +#ifndef LMP_PAIR_DPD_TSTAT_KOKKOS_H +#define LMP_PAIR_DPD_TSTAT_KOKKOS_H + +#include "pair_dpd_tstat.h" +#include "pair_kokkos.h" +#include "kokkos_type.h" + +#if !defined(DPD_USE_RAN_MARS) && !defined(DPD_USE_Random_XorShift64) && !defined(Random_XorShift1024) +#define DPD_USE_Random_XorShift64 +#endif + +#ifdef DPD_USE_RAN_MARS +#include "rand_pool_wrap_kokkos.h" +#else +#include "Kokkos_Random.hpp" +#endif + +namespace LAMMPS_NS { + +template +class PairDPDTstatKokkos : public PairDPDTstat { + public: + typedef DeviceType device_type; + typedef ArrayTypes AT; + typedef EV_FLOAT value_type; + + PairDPDTstatKokkos(class LAMMPS*); + ~PairDPDTstatKokkos() override; + + void allocate() override; + + void init_style() override; + double init_one(int i, int j) override; + void compute(int, int) override; + + struct params_dpd { + KOKKOS_INLINE_FUNCTION + params_dpd() {cut=gamma=sigma=0;} + KOKKOS_INLINE_FUNCTION + params_dpd(int /*i*/) {cut=gamma=sigma=0;} + F_FLOAT cut,gamma,sigma; + }; + + template + struct TagDPDTstatKokkos{}; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDTstatKokkos, const int &i) const; + + template + KOKKOS_INLINE_FUNCTION + void operator () (TagDPDTstatKokkos, const int &i, EV_FLOAT&) const; + + template + KOKKOS_INLINE_FUNCTION + void v_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &fpair, const F_FLOAT &delx, + const F_FLOAT &dely, const F_FLOAT &delz) const; + private: + double special_lj[4]; + int eflag,vflag; + int neighflag,nlocal; + double dtinvsqrt; + + int need_dup; + + using KKDeviceType = typename KKDevice::value; + + template + using DupScatterView = KKScatterView; + + template + using NonDupScatterView = KKScatterView; + + DupScatterView dup_f; + DupScatterView dup_vatom; + NonDupScatterView ndup_f; + NonDupScatterView ndup_vatom; + +#ifdef DPD_USE_RAN_MARS + RandPoolWrap rand_pool; + typedef RandWrap rand_type; +#elif defined(DPD_USE_Random_XorShift64) + Kokkos::Random_XorShift64_Pool rand_pool; + typedef typename Kokkos::Random_XorShift64_Pool::generator_type rand_type; +#elif defined(DPD_USE_Random_XorShift1024) + Kokkos::Random_XorShift1024_Pool rand_pool; + typedef typename Kokkos::Random_XorShift1024_Pool::generator_type rand_type; +#endif + typename AT::t_x_array_randomread x; + typename AT::t_x_array_randomread v; + typename AT::t_f_array f; + typename AT::t_int_1d_randomread type; + + typename AT::t_neighbors_2d d_neighbors; + typename AT::t_int_1d_randomread d_ilist; + typename AT::t_int_1d_randomread d_numneigh; + + typename AT::tdual_ffloat_2d k_cutsq; + typename AT::t_ffloat_2d d_cutsq; + + Kokkos::DualView k_params; + typename Kokkos::DualView::t_dev_const_um params; + + DAT::tdual_virial_array k_vatom; + typename AT::t_virial_array d_vatom; + + KOKKOS_INLINE_FUNCTION + int sbmask(const int& j) const; + friend void pair_virial_fdotr_compute(PairDPDTstatKokkos*); + +}; +} +#endif +#endif diff --git a/src/KOKKOS/pair_reaxff_kokkos.cpp b/src/KOKKOS/pair_reaxff_kokkos.cpp index fd73bd7c4c..3bf5c46338 100644 --- a/src/KOKKOS/pair_reaxff_kokkos.cpp +++ b/src/KOKKOS/pair_reaxff_kokkos.cpp @@ -13,7 +13,8 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing authors: Ray Shan (SNL), Stan Moore (SNL) + Contributing authors: Ray Shan (SNL), Stan Moore (SNL), + Evan Weinberg (NVIDIA) Nicholas Curtis (AMD), Leopold Grinberd (AMD), and Gina Sitaraman (AMD): - Reduced math overhead: enabled specialized calls (e.g., cbrt for a @@ -77,6 +78,12 @@ PairReaxFFKokkos::PairReaxFFKokkos(LAMMPS *lmp) : PairReaxFF(lmp) k_error_flag = DAT::tdual_int_scalar("pair:error_flag"); k_nbuf_local = DAT::tdual_int_scalar("pair:nbuf_local"); + d_torsion_pack = t_reax_int4_2d("reaxff:torsion_pack",1,2); + d_angular_pack = t_reax_int4_2d("reaxff:angular_pack",1,2); + + k_count_angular_torsion = DAT::tdual_int_1d("PairReaxFF::count_angular_torsion",2); + d_count_angular_torsion = k_count_angular_torsion.template view(); + if (execution_space == Host) list_blocking_flag = 1; } @@ -687,7 +694,7 @@ void PairReaxFFKokkos::compute(int eflag_in, int vflag_in) eflag = eflag_in; vflag = vflag_in; - ev_init(eflag,vflag); + ev_init(eflag,vflag,0); atomKK->sync(execution_space,datamask_read); k_params_sing.template sync(); @@ -708,7 +715,7 @@ void PairReaxFFKokkos::compute(int eflag_in, int vflag_in) newton_pair = force->newton_pair; nn = list->inum; - NN = list->inum + list->gnum; + NN = atom->nlocal + atom->nghost; const int inum = list->inum; const int ignum = inum + list->gnum; @@ -935,18 +942,49 @@ void PairReaxFFKokkos::compute(int eflag_in, int vflag_in) pvector[3] = 0.0; ev_all.evdwl += ev.ereax[0] + ev.ereax[1] + ev.ereax[2]; + int count_angular = 0; + int count_torsion = 0; + + auto& h_count_angular_torsion = k_count_angular_torsion.h_view; + h_count_angular_torsion(0) = 0; + h_count_angular_torsion(1) = 0; + k_count_angular_torsion.template modify(); + k_count_angular_torsion.template sync(); + + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + + k_count_angular_torsion.template modify(); + k_count_angular_torsion.template sync(); + count_angular = h_count_angular_torsion(0); + count_torsion = h_count_angular_torsion(1); + + if (count_angular > (int)d_angular_pack.extent(0)) + d_angular_pack = t_reax_int4_2d("reaxff:angular_pack",(int)(count_angular * 1.1),2); + if (count_torsion > (int)d_torsion_pack.extent(0)) + d_torsion_pack = t_reax_int4_2d("reaxff:torsion_pack",(int)(count_torsion * 1.1),2); + + // need to zero to re-count + h_count_angular_torsion(0) = 0; + h_count_angular_torsion(1) = 0; + k_count_angular_torsion.template modify(); + k_count_angular_torsion.template sync(); + + Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + + // no need to re-sync count_angular, count_torsion + // Angular if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,count_angular),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy>(0,count_angular),*this); ev_all += ev; } else { //if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,count_angular),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy>(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy>(0,count_angular),*this); ev_all += ev; } pvector[4] = ev.ereax[3]; @@ -954,42 +992,20 @@ void PairReaxFFKokkos::compute(int eflag_in, int vflag_in) pvector[6] = ev.ereax[5]; ev_all.evdwl += ev.ereax[3] + ev.ereax[4] + ev.ereax[5]; - if (inum > counters.extent(0)) { - // HIP backend note: use the "hipHostMallocNonCoherent" flag if/when - // it is exposed in Kokkos for HIP pinned memory allocations - counters = t_hostpinned_int_1d("ReaxFF::counters", inum); - counters_jj_min = t_hostpinned_int_1d("ReaxFF::counters_jj_min", inum); - counters_jj_max = t_hostpinned_int_1d("ReaxFF::counters_jj_max", inum); - counters_kk_min = t_hostpinned_int_1d("ReaxFF::counters_kk_min", inum); - counters_kk_max = t_hostpinned_int_1d("ReaxFF::counters_kk_max", inum); - } - - Kokkos::parallel_for(Kokkos::RangePolicy(0,inum),*this); - Kokkos::fence(); - - // Compress the counters list ; could be accomplished on device with parallel scan - int nnz = 0; - for (int i = 0; i < inum; ++i) { - if (counters[i] > 0) { - counters[nnz] = i; - nnz++; - } - } - + // Torsion if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,nnz),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,count_torsion),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy>(0,nnz),*this); + Kokkos::parallel_for(Kokkos::RangePolicy>(0,count_torsion),*this); ev_all += ev; - } else { + } else { //if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,nnz),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy>(0,count_torsion),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy>(0,nnz),*this); + Kokkos::parallel_for(Kokkos::RangePolicy>(0,count_torsion),*this); ev_all += ev; } - pvector[8] = ev.ereax[6]; pvector[9] = ev.ereax[7]; ev_all.evdwl += ev.ereax[6] + ev.ereax[7]; @@ -1514,13 +1530,8 @@ void PairReaxFFKokkos::allocate_array() d_BO_pi = typename AT::t_ffloat_2d_dl("reaxff/kk:BO_pi",nmax,maxbo); d_BO_pi2 = typename AT::t_ffloat_2d_dl("reaxff/kk:BO_pi2",nmax,maxbo); - d_dln_BOp_pix = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_pix",nmax,maxbo); - d_dln_BOp_piy = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_piy",nmax,maxbo); - d_dln_BOp_piz = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_piz",nmax,maxbo); - - d_dln_BOp_pi2x = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_pi2x",nmax,maxbo); - d_dln_BOp_pi2y = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_pi2y",nmax,maxbo); - d_dln_BOp_pi2z = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_pi2z",nmax,maxbo); + d_dln_BOp_pi = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_pi",nmax,maxbo); + d_dln_BOp_pi2 = typename AT::t_ffloat_2d_dl("reaxff/kk:d_dln_BOp_pi2",nmax,maxbo); d_C1dbo = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C1dbo",nmax,maxbo); d_C2dbo = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C2dbo",nmax,maxbo); @@ -1536,9 +1547,7 @@ void PairReaxFFKokkos::allocate_array() d_C3dbopi2 = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C3dbopi2",nmax,maxbo); d_C4dbopi2 = typename AT::t_ffloat_2d_dl("reaxff/kk:d_C4dbopi2",nmax,maxbo); - d_dBOpx = typename AT::t_ffloat_2d_dl("reaxff/kk:dBOpx",nmax,maxbo); - d_dBOpy = typename AT::t_ffloat_2d_dl("reaxff/kk:dBOpy",nmax,maxbo); - d_dBOpz = typename AT::t_ffloat_2d_dl("reaxff/kk:dBOpz",nmax,maxbo); + d_dBOp = typename AT::t_ffloat_2d_dl("reaxff/kk:dBOp",nmax,maxbo); d_dDeltap_self = typename AT::t_ffloat_2d_dl("reaxff/kk:dDeltap_self",nmax,3); d_Deltap_boc = typename AT::t_ffloat_1d("reaxff/kk:Deltap_boc",nmax); @@ -1561,6 +1570,9 @@ void PairReaxFFKokkos::allocate_array() d_abo = typename AT::t_ffloat_2d("reaxff/kk:abo",nmax,maxbo); d_neighid = typename AT::t_tagint_2d("reaxff/kk:neighid",nmax,maxbo); d_numneigh_bonds = typename AT::t_int_1d("reaxff/kk:numneigh_bonds",nmax); + + // ComputeAngular intermediates + d_angular_intermediates = typename AT::t_ffloat_2d("reaxff/kk:angular_intermediates",nmax,4); } /* ---------------------------------------------------------------------- */ @@ -1582,13 +1594,8 @@ void PairReaxFFKokkos::deallocate_array() d_BO_pi = typename AT::t_ffloat_2d_dl(); d_BO_pi2 = typename AT::t_ffloat_2d_dl(); - d_dln_BOp_pix = typename AT::t_ffloat_2d_dl(); - d_dln_BOp_piy = typename AT::t_ffloat_2d_dl(); - d_dln_BOp_piz = typename AT::t_ffloat_2d_dl(); - - d_dln_BOp_pi2x = typename AT::t_ffloat_2d_dl(); - d_dln_BOp_pi2y = typename AT::t_ffloat_2d_dl(); - d_dln_BOp_pi2z = typename AT::t_ffloat_2d_dl(); + d_dln_BOp_pi = typename AT::t_ffloat_2d_dl(); + d_dln_BOp_pi2 = typename AT::t_ffloat_2d_dl(); d_C1dbo = typename AT::t_ffloat_2d_dl(); d_C2dbo = typename AT::t_ffloat_2d_dl(); @@ -1604,9 +1611,7 @@ void PairReaxFFKokkos::deallocate_array() d_C3dbopi2 = typename AT::t_ffloat_2d_dl(); d_C4dbopi2 = typename AT::t_ffloat_2d_dl(); - d_dBOpx = typename AT::t_ffloat_2d_dl(); - d_dBOpy = typename AT::t_ffloat_2d_dl(); - d_dBOpz = typename AT::t_ffloat_2d_dl(); + d_dBOp = typename AT::t_ffloat_2d_dl(); d_dDeltap_self = typename AT::t_ffloat_2d_dl(); d_Deltap_boc = typename AT::t_ffloat_1d(); @@ -1629,6 +1634,9 @@ void PairReaxFFKokkos::deallocate_array() d_abo = typename AT::t_ffloat_2d(); d_neighid = typename AT::t_tagint_2d(); d_numneigh_bonds = typename AT::t_int_1d(); + + // ComputeAngular intermediates + d_angular_intermediates = typename AT::t_ffloat_2d(); } /* ---------------------------------------------------------------------- */ @@ -1665,8 +1673,7 @@ void PairReaxFFKokkos::operator()(TagPairReaxBuildListsHalfBlocking< const int itype = type(i); const int jnum = d_numneigh[i]; - const int three = 3; - F_FLOAT C12, C34, C56, BO_s, BO_pi, BO_pi2, BO, delij[three], dBOp_i[three], dln_BOp_pi_i[three], dln_BOp_pi2_i[three]; + F_FLOAT C12, C34, C56, BO_s, BO_pi, BO_pi2, BO, delij[3], dBOp_i[3]; F_FLOAT dDeltap_self_i[3] = {0.0,0.0,0.0}; F_FLOAT total_bo_i = 0.0; @@ -1675,7 +1682,6 @@ void PairReaxFFKokkos::operator()(TagPairReaxBuildListsHalfBlocking< const int bo_first_i = d_bo_first[i]; int ihb = -1; - int jhb = -1; int hb_first_i; if (cut_hbsq > 0.0) { @@ -1729,101 +1735,41 @@ void PairReaxFFKokkos::operator()(TagPairReaxBuildListsHalfBlocking< const F_FLOAT rsq = delij[0]*delij[0] + delij[1]*delij[1] + delij[2]*delij[2]; // hbond list - if (i < nlocal && cut_hbsq > 0.0 && (ihb == 1 || ihb == 2) && rsq <= cut_hbsq) { - jhb = paramssing(jtype).p_hbond; - if (ihb == 1 && jhb == 2) { - if (NEIGHFLAG == HALF) { - j_index = hb_first_i + d_hb_num[i]; - d_hb_num[i]++; - } else - j_index = hb_first_i + Kokkos::atomic_fetch_add(&d_hb_num[i],1); - - const int jj_index = j_index - hb_first_i; - - if (jj_index >= maxhb) - d_resize_hb() = MAX(d_resize_hb(),jj_index+1); - else - d_hb_list[j_index] = j; - } else if (j < nlocal && ihb == 2 && jhb == 1) { - if (NEIGHFLAG == HALF) { - i_index = d_hb_first[j] + d_hb_num[j]; - d_hb_num[j]++; - } else - i_index = d_hb_first[j] + Kokkos::atomic_fetch_add(&d_hb_num[j],1); - - const int ii_index = i_index - d_hb_first[j]; - - if (ii_index >= maxhb) - d_resize_hb() = MAX(d_resize_hb(),ii_index+1); - else - d_hb_list[i_index] = i; - } - } + build_hb_list(rsq, i, hb_first_i, ihb, j, jtype); if (rsq > cut_bosq) continue; - // bond_list + // bond_list const F_FLOAT rij = sqrt(rsq); - const F_FLOAT p_bo1 = paramstwbp(itype,jtype).p_bo1; const F_FLOAT p_bo2 = paramstwbp(itype,jtype).p_bo2; - const F_FLOAT p_bo3 = paramstwbp(itype,jtype).p_bo3; const F_FLOAT p_bo4 = paramstwbp(itype,jtype).p_bo4; - const F_FLOAT p_bo5 = paramstwbp(itype,jtype).p_bo5; const F_FLOAT p_bo6 = paramstwbp(itype,jtype).p_bo6; - const F_FLOAT r_s = paramstwbp(itype,jtype).r_s; - const F_FLOAT r_pi = paramstwbp(itype,jtype).r_pi; - const F_FLOAT r_pi2 = paramstwbp(itype,jtype).r_pi2; - if (paramssing(itype).r_s > 0.0 && paramssing(jtype).r_s > 0.0) { - C12 = p_bo1 * ((p_bo2 != 0) ? (pow(rij/r_s,p_bo2)) : 1.0); - BO_s = (1.0+bo_cut)*exp(C12); - } else BO_s = C12 = 0.0; - - if (paramssing(itype).r_pi > 0.0 && paramssing(jtype).r_pi > 0.0) { - C34 = p_bo3 * ((p_bo4 != 0) ? (pow(rij/r_pi,p_bo4)) : 1.0); - BO_pi = exp(C34); - } else BO_pi = C34 = 0.0; - - if (paramssing(itype).r_pi2 > 0.0 && paramssing(jtype).r_pi2 > 0.0) { - C56 = p_bo5 * ((p_bo6 != 0) ? (pow(rij/r_pi2,p_bo6)) : 1.0); - BO_pi2 = exp(C56); - } else BO_pi2 = C56 = 0.0; + // returns BO_*, C** by reference + compute_bo(rij, itype, jtype, p_bo2, p_bo4, p_bo6, + BO_s, BO_pi, BO_pi2, C12, C34, C56); BO = BO_s + BO_pi + BO_pi2; if (BO < bo_cut) continue; - if (NEIGHFLAG == HALF) { - j_index = bo_first_i + d_bo_num[i]; - i_index = d_bo_first[j] + d_bo_num[j]; - d_bo_num[i]++; - d_bo_num[j]++; - } else { - j_index = bo_first_i + Kokkos::atomic_fetch_add(&d_bo_num[i],1); - i_index = d_bo_first[j] + Kokkos::atomic_fetch_add(&d_bo_num[j],1); - } - - const int jj_index = j_index - bo_first_i; - const int ii_index = i_index - d_bo_first[j]; - - if (jj_index >= maxbo || ii_index >= maxbo) { - const int max_val = MAX(ii_index+1,jj_index+1); - d_resize_bo() = MAX(d_resize_bo(),max_val); - } else { - d_bo_list[j_index] = j; - d_bo_list[i_index] = i; + int ii_index = -1; + int jj_index = -1; + if (build_bo_list(bo_first_i, i, j, i_index, j_index, ii_index, jj_index)) { // from BondOrder1 d_BO(i,jj_index) = BO; d_BO_s(i,jj_index) = BO_s; - d_BO_pi(i,jj_index) = BO_pi; - d_BO_pi2(i,jj_index) = BO_pi2; d_BO(j,ii_index) = BO; d_BO_s(j,ii_index) = BO_s; + d_BO_pi(j,ii_index) = BO_pi; d_BO_pi2(j,ii_index) = BO_pi2; + d_BO_pi(i,jj_index) = BO_pi; + d_BO_pi2(i,jj_index) = BO_pi2; + F_FLOAT Cln_BOp_s = p_bo2 * C12 / rij / rij; F_FLOAT Cln_BOp_pi = p_bo4 * C34 / rij / rij; F_FLOAT Cln_BOp_pi2 = p_bo6 * C56 / rij / rij; @@ -1831,42 +1777,24 @@ void PairReaxFFKokkos::operator()(TagPairReaxBuildListsHalfBlocking< if (nlocal == 0) Cln_BOp_s = Cln_BOp_pi = Cln_BOp_pi2 = 0.0; - for (int d = 0; d < 3; d++) dln_BOp_pi_i[d] = -(BO_pi*Cln_BOp_pi)*delij[d]; - for (int d = 0; d < 3; d++) dln_BOp_pi2_i[d] = -(BO_pi2*Cln_BOp_pi2)*delij[d]; for (int d = 0; d < 3; d++) dBOp_i[d] = -(BO_s*Cln_BOp_s+BO_pi*Cln_BOp_pi+BO_pi2*Cln_BOp_pi2)*delij[d]; for (int d = 0; d < 3; d++) dDeltap_self_i[d] += dBOp_i[d]; for (int d = 0; d < 3; d++) a_dDeltap_self(j,d) += -dBOp_i[d]; - d_dln_BOp_pix(i,jj_index) = dln_BOp_pi_i[0]; - d_dln_BOp_piy(i,jj_index) = dln_BOp_pi_i[1]; - d_dln_BOp_piz(i,jj_index) = dln_BOp_pi_i[2]; + d_dln_BOp_pi(i,jj_index) = -(BO_pi*Cln_BOp_pi); + d_dln_BOp_pi(j,ii_index) = -(BO_pi*Cln_BOp_pi); - d_dln_BOp_pix(j,ii_index) = -dln_BOp_pi_i[0]; - d_dln_BOp_piy(j,ii_index) = -dln_BOp_pi_i[1]; - d_dln_BOp_piz(j,ii_index) = -dln_BOp_pi_i[2]; + d_dln_BOp_pi2(i,jj_index) = -(BO_pi2*Cln_BOp_pi2); + d_dln_BOp_pi2(j,ii_index) = -(BO_pi2*Cln_BOp_pi2); - d_dln_BOp_pi2x(i,jj_index) = dln_BOp_pi2_i[0]; - d_dln_BOp_pi2y(i,jj_index) = dln_BOp_pi2_i[1]; - d_dln_BOp_pi2z(i,jj_index) = dln_BOp_pi2_i[2]; - - d_dln_BOp_pi2x(j,ii_index) = -dln_BOp_pi2_i[0]; - d_dln_BOp_pi2y(j,ii_index) = -dln_BOp_pi2_i[1]; - d_dln_BOp_pi2z(j,ii_index) = -dln_BOp_pi2_i[2]; - - d_dBOpx(i,jj_index) = dBOp_i[0]; - d_dBOpy(i,jj_index) = dBOp_i[1]; - d_dBOpz(i,jj_index) = dBOp_i[2]; - - d_dBOpx(j,ii_index) = -dBOp_i[0]; - d_dBOpy(j,ii_index) = -dBOp_i[1]; - d_dBOpz(j,ii_index) = -dBOp_i[2]; - - d_BO(i,jj_index) -= bo_cut; - d_BO(j,ii_index) -= bo_cut; - d_BO_s(i,jj_index) -= bo_cut; - d_BO_s(j,ii_index) -= bo_cut; - total_bo_i += d_BO(i,jj_index); - a_total_bo[j] += d_BO(j,ii_index); + d_dBOp(i,jj_index) = -(BO_s*Cln_BOp_s+BO_pi*Cln_BOp_pi+BO_pi2*Cln_BOp_pi2); + d_dBOp(j,ii_index) = -(BO_s*Cln_BOp_s+BO_pi*Cln_BOp_pi+BO_pi2*Cln_BOp_pi2); + d_BO(i,jj_index) = BO - bo_cut; + d_BO(j,ii_index) = BO - bo_cut; + d_BO_s(i,jj_index) = BO_s - bo_cut; + d_BO_s(j,ii_index) = BO_s - bo_cut; + total_bo_i += (BO - bo_cut); + a_total_bo[j] += (BO - bo_cut); } } } @@ -1899,7 +1827,6 @@ void PairReaxFFKokkos::operator()(TagPairReaxBuildListsHalfBlockingP const int bo_first_i = d_bo_first[i]; int ihb = -1; - int jhb = -1; int hb_first_i; if (cut_hbsq > 0.0) { @@ -1954,89 +1881,26 @@ void PairReaxFFKokkos::operator()(TagPairReaxBuildListsHalfBlockingP const F_FLOAT rsq = delij[0]*delij[0] + delij[1]*delij[1] + delij[2]*delij[2]; // hbond list - if (i < nlocal && cut_hbsq > 0.0 && (ihb == 1 || ihb == 2) && rsq <= cut_hbsq) { - jhb = paramssing(jtype).p_hbond; - if (ihb == 1 && jhb == 2) { - if (NEIGHFLAG == HALF) { - j_index = hb_first_i + d_hb_num[i]; - d_hb_num[i]++; - } else - j_index = hb_first_i + Kokkos::atomic_fetch_add(&d_hb_num[i],1); - - const int jj_index = j_index - hb_first_i; - - if (jj_index >= maxhb) - d_resize_hb() = MAX(d_resize_hb(),jj_index+1); - else - d_hb_list[j_index] = j; - } else if (j < nlocal && ihb == 2 && jhb == 1) { - if (NEIGHFLAG == HALF) { - i_index = d_hb_first[j] + d_hb_num[j]; - d_hb_num[j]++; - } else - i_index = d_hb_first[j] + Kokkos::atomic_fetch_add(&d_hb_num[j],1); - - const int ii_index = i_index - d_hb_first[j]; - - if (ii_index >= maxhb) - d_resize_hb() = MAX(d_resize_hb(),ii_index+1); - else - d_hb_list[i_index] = i; - } - } + build_hb_list(rsq, i, hb_first_i, ihb, j, jtype); if (rsq > cut_bosq) continue; - // bond_list + // bond_list const F_FLOAT rij = sqrt(rsq); - const F_FLOAT p_bo1 = paramstwbp(itype,jtype).p_bo1; const F_FLOAT p_bo2 = paramstwbp(itype,jtype).p_bo2; - const F_FLOAT p_bo3 = paramstwbp(itype,jtype).p_bo3; const F_FLOAT p_bo4 = paramstwbp(itype,jtype).p_bo4; - const F_FLOAT p_bo5 = paramstwbp(itype,jtype).p_bo5; const F_FLOAT p_bo6 = paramstwbp(itype,jtype).p_bo6; - const F_FLOAT r_s = paramstwbp(itype,jtype).r_s; - const F_FLOAT r_pi = paramstwbp(itype,jtype).r_pi; - const F_FLOAT r_pi2 = paramstwbp(itype,jtype).r_pi2; - if (paramssing(itype).r_s > 0.0 && paramssing(jtype).r_s > 0.0) { - C12 = p_bo1 * ((p_bo2 != 0) ? (pow(rij/r_s,p_bo2)) : 1.0); - BO_s = (1.0+bo_cut)*exp(C12); - } else BO_s = C12 = 0.0; - - if (paramssing(itype).r_pi > 0.0 && paramssing(jtype).r_pi > 0.0) { - C34 = p_bo3 * ((p_bo4 != 0) ? (pow(rij/r_pi,p_bo4)) : 1.0); - BO_pi = exp(C34); - } else BO_pi = C34 = 0.0; - - if (paramssing(itype).r_pi2 > 0.0 && paramssing(jtype).r_pi2 > 0.0) { - C56 = p_bo5 * ((p_bo6 != 0) ? (pow(rij/r_pi2,p_bo6)) : 1.0); - BO_pi2 = exp(C56); - } else BO_pi2 = C56 = 0.0; + // returns BO_*, C** by reference + compute_bo(rij, itype, jtype, p_bo2, p_bo4, p_bo6, + BO_s, BO_pi, BO_pi2, C12, C34, C56); BO = BO_s + BO_pi + BO_pi2; if (BO < bo_cut) continue; - if (NEIGHFLAG == HALF) { - j_index = bo_first_i + d_bo_num[i]; - i_index = d_bo_first[j] + d_bo_num[j]; - d_bo_num[i]++; - d_bo_num[j]++; - } else { - j_index = bo_first_i + Kokkos::atomic_fetch_add(&d_bo_num[i],1); - i_index = d_bo_first[j] + Kokkos::atomic_fetch_add(&d_bo_num[j],1); - } - - const int jj_index = j_index - bo_first_i; - const int ii_index = i_index - d_bo_first[j]; - - if (jj_index >= maxbo || ii_index >= maxbo) { - const int max_val = MAX(ii_index+1,jj_index+1); - d_resize_bo() = MAX(d_resize_bo(),max_val); - } else { - d_bo_list[j_index] = j; - d_bo_list[i_index] = i; - } + int ii_index = -1; + int jj_index = -1; + build_bo_list(bo_first_i, i, j, i_index, j_index, ii_index, jj_index); } } } @@ -2062,7 +1926,6 @@ void PairReaxFFKokkos::operator()(TagPairReaxBuildListsHalfPreview 0.0) { @@ -2087,90 +1950,106 @@ void PairReaxFFKokkos::operator()(TagPairReaxBuildListsHalfPreview 0.0 && (ihb == 1 || ihb == 2) && rsq <= cut_hbsq) { - jhb = paramssing(jtype).p_hbond; - if (ihb == 1 && jhb == 2) { - if (NEIGHFLAG == HALF) { - j_index = hb_first_i + d_hb_num[i]; - d_hb_num[i]++; - } else - j_index = hb_first_i + Kokkos::atomic_fetch_add(&d_hb_num[i],1); - - const int jj_index = j_index - hb_first_i; - - if (jj_index >= maxhb) - d_resize_hb() = MAX(d_resize_hb(),jj_index+1); - else - d_hb_list[j_index] = j; - } else if (j < nlocal && ihb == 2 && jhb == 1) { - if (NEIGHFLAG == HALF) { - i_index = d_hb_first[j] + d_hb_num[j]; - d_hb_num[j]++; - } else - i_index = d_hb_first[j] + Kokkos::atomic_fetch_add(&d_hb_num[j],1); - - const int ii_index = i_index - d_hb_first[j]; - - if (ii_index >= maxhb) - d_resize_hb() = MAX(d_resize_hb(),ii_index+1); - else - d_hb_list[i_index] = i; - } - } + build_hb_list(rsq, i, hb_first_i, ihb, j, jtype); if (rsq > cut_bosq) continue; // bond_list const F_FLOAT rij = sqrt(rsq); - const F_FLOAT p_bo1 = paramstwbp(itype,jtype).p_bo1; const F_FLOAT p_bo2 = paramstwbp(itype,jtype).p_bo2; - const F_FLOAT p_bo3 = paramstwbp(itype,jtype).p_bo3; const F_FLOAT p_bo4 = paramstwbp(itype,jtype).p_bo4; - const F_FLOAT p_bo5 = paramstwbp(itype,jtype).p_bo5; const F_FLOAT p_bo6 = paramstwbp(itype,jtype).p_bo6; - const F_FLOAT r_s = paramstwbp(itype,jtype).r_s; - const F_FLOAT r_pi = paramstwbp(itype,jtype).r_pi; - const F_FLOAT r_pi2 = paramstwbp(itype,jtype).r_pi2; - if (paramssing(itype).r_s > 0.0 && paramssing(jtype).r_s > 0.0) { - C12 = p_bo1 * ((p_bo2 != 0) ? (pow(rij/r_s,p_bo2)) : 1.0); - BO_s = (1.0+bo_cut)*exp(C12); - } else BO_s = C12 = 0.0; - - if (paramssing(itype).r_pi > 0.0 && paramssing(jtype).r_pi > 0.0) { - C34 = p_bo3 * ((p_bo4 != 0) ? (pow(rij/r_pi,p_bo4)) : 1.0); - BO_pi = exp(C34); - } else BO_pi = C34 = 0.0; - - if (paramssing(itype).r_pi2 > 0.0 && paramssing(jtype).r_pi2 > 0.0) { - C56 = p_bo5 * ((p_bo6 != 0) ? (pow(rij/r_pi2,p_bo6)) : 1.0); - BO_pi2 = exp(C56); - } else BO_pi2 = C56 = 0.0; + // returns BO_*, C** by reference + compute_bo(rij, itype, jtype, p_bo2, p_bo4, p_bo6, + BO_s, BO_pi, BO_pi2, C12, C34, C56); BO = BO_s + BO_pi + BO_pi2; if (BO < bo_cut) continue; - if (NEIGHFLAG == HALF) { - j_index = bo_first_i + d_bo_num[i]; - i_index = d_bo_first[j] + d_bo_num[j]; - d_bo_num[i]++; - d_bo_num[j]++; - } else { - j_index = bo_first_i + Kokkos::atomic_fetch_add(&d_bo_num[i],1); - i_index = d_bo_first[j] + Kokkos::atomic_fetch_add(&d_bo_num[j],1); - } + int ii_index = -1; + int jj_index = -1; - const int jj_index = j_index - bo_first_i; - const int ii_index = i_index - d_bo_first[j]; + build_bo_list(bo_first_i, i, j, i_index, j_index, ii_index, jj_index); + } +} - if (jj_index >= maxbo || ii_index >= maxbo) { - const int max_val = MAX(ii_index+1,jj_index+1); - d_resize_bo() = MAX(d_resize_bo(),max_val); - } else { - d_bo_list[j_index] = j; - d_bo_list[i_index] = i; +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairReaxFFKokkos::build_hb_list(F_FLOAT rsq, int i, int hb_first_i, int ihb, int j, int jtype) const { + + int i_index, j_index; + int jhb = -1; + if (i < nlocal && cut_hbsq > 0.0 && (ihb == 1 || ihb == 2) && rsq <= cut_hbsq) { + jhb = paramssing(jtype).p_hbond; + if (ihb == 1 && jhb == 2) { + if (NEIGHFLAG == HALF) { + j_index = hb_first_i + d_hb_num[i]; + d_hb_num[i]++; + } else + j_index = hb_first_i + Kokkos::atomic_fetch_add(&d_hb_num[i],1); + + const int jj_index = j_index - hb_first_i; + + if (jj_index >= maxhb) + d_resize_hb() = MAX(d_resize_hb(),jj_index+1); + else + d_hb_list[j_index] = j; + } else if (j < nlocal && ihb == 2 && jhb == 1) { + if (NEIGHFLAG == HALF) { + i_index = d_hb_first[j] + d_hb_num[j]; + d_hb_num[j]++; + } else + i_index = d_hb_first[j] + Kokkos::atomic_fetch_add(&d_hb_num[j],1); + + const int ii_index = i_index - d_hb_first[j]; + + if (ii_index >= maxhb) + d_resize_hb() = MAX(d_resize_hb(),ii_index+1); + else + d_hb_list[i_index] = i; } } + +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +bool PairReaxFFKokkos::build_bo_list(int bo_first_i, int i, int j, int i_index, int j_index, int& ii_index, int& jj_index) const { + + if (NEIGHFLAG == HALF) { + j_index = bo_first_i + d_bo_num[i]; + i_index = d_bo_first[j] + d_bo_num[j]; + d_bo_num[i]++; + d_bo_num[j]++; + } else { + j_index = bo_first_i + Kokkos::atomic_fetch_add(&d_bo_num[i],1); + i_index = d_bo_first[j] + Kokkos::atomic_fetch_add(&d_bo_num[j],1); + } + + jj_index = j_index - bo_first_i; + ii_index = i_index - d_bo_first[j]; + + bool set_dB_flag = true; + + if (jj_index >= maxbo || ii_index >= maxbo) { + const int max_val = MAX(ii_index+1,jj_index+1); + d_resize_bo() = MAX(d_resize_bo(),max_val); + set_dB_flag = false; + } else { + d_bo_list[j_index] = j; + d_bo_list[i_index] = i; + set_dB_flag = true; + } + + return set_dB_flag; + } /* ---------------------------------------------------------------------- */ @@ -2185,7 +2064,7 @@ void PairReaxFFKokkos::operator()(TagPairReaxBuildListsFull, const i const X_FLOAT ztmp = x(i,2); const int itype = type(i); - F_FLOAT C12, C34, C56, BO_s, BO_pi, BO_pi2, BO, delij[3], dBOp_i[3], dln_BOp_pi_i[3], dln_BOp_pi2_i[3]; + F_FLOAT C12, C34, C56, BO_s, BO_pi, BO_pi2, BO, delij[3], dBOp_i[3]; F_FLOAT dDeltap_self_i[3] = {0.0,0.0,0.0}; F_FLOAT total_bo_i = 0.0; @@ -2202,32 +2081,15 @@ void PairReaxFFKokkos::operator()(TagPairReaxBuildListsFull, const i const F_FLOAT rsq = delij[0]*delij[0] + delij[1]*delij[1] + delij[2]*delij[2]; const F_FLOAT rsq_inv = 1.0 / rsq; - // bond_list + // bond_list const F_FLOAT rij = sqrt(rsq); - const F_FLOAT p_bo1 = paramstwbp(itype,jtype).p_bo1; const F_FLOAT p_bo2 = paramstwbp(itype,jtype).p_bo2; - const F_FLOAT p_bo3 = paramstwbp(itype,jtype).p_bo3; const F_FLOAT p_bo4 = paramstwbp(itype,jtype).p_bo4; - const F_FLOAT p_bo5 = paramstwbp(itype,jtype).p_bo5; const F_FLOAT p_bo6 = paramstwbp(itype,jtype).p_bo6; - const F_FLOAT r_s = paramstwbp(itype,jtype).r_s; - const F_FLOAT r_pi = paramstwbp(itype,jtype).r_pi; - const F_FLOAT r_pi2 = paramstwbp(itype,jtype).r_pi2; - if (paramssing(itype).r_s > 0.0 && paramssing(jtype).r_s > 0.0) { - C12 = p_bo1 * ((p_bo2 != 0) ? (pow(rij/r_s,p_bo2)) : 1.0); - BO_s = (1.0+bo_cut)*exp(C12); - } else BO_s = C12 = 0.0; - - if (paramssing(itype).r_pi > 0.0 && paramssing(jtype).r_pi > 0.0) { - C34 = p_bo3 * ((p_bo4 != 0) ? (pow(rij/r_pi,p_bo4)) : 1.0); - BO_pi = exp(C34); - } else BO_pi = C34 = 0.0; - - if (paramssing(itype).r_pi2 > 0.0 && paramssing(jtype).r_pi2 > 0.0) { - C56 = p_bo5 * ((p_bo6 != 0) ? (pow(rij/r_pi2,p_bo6)) : 1.0); - BO_pi2 = exp(C56); - } else BO_pi2 = C56 = 0.0; + // returns BO_*, C** by reference + compute_bo(rij, itype, jtype, p_bo2, p_bo4, p_bo6, + BO_s, BO_pi, BO_pi2, C12, C34, C56); BO = BO_s + BO_pi + BO_pi2; @@ -2245,26 +2107,17 @@ void PairReaxFFKokkos::operator()(TagPairReaxBuildListsFull, const i if (nlocal == 0) Cln_BOp_s = Cln_BOp_pi = Cln_BOp_pi2 = 0.0; - for (int d = 0; d < 3; d++) dln_BOp_pi_i[d] = -(BO_pi*Cln_BOp_pi)*delij[d]; - for (int d = 0; d < 3; d++) dln_BOp_pi2_i[d] = -(BO_pi2*Cln_BOp_pi2)*delij[d]; for (int d = 0; d < 3; d++) dBOp_i[d] = -(BO_s*Cln_BOp_s+BO_pi*Cln_BOp_pi+BO_pi2*Cln_BOp_pi2)*delij[d]; for (int d = 0; d < 3; d++) dDeltap_self_i[d] += dBOp_i[d]; - d_dln_BOp_pix(i,j_index) = dln_BOp_pi_i[0]; - d_dln_BOp_piy(i,j_index) = dln_BOp_pi_i[1]; - d_dln_BOp_piz(i,j_index) = dln_BOp_pi_i[2]; - d_dln_BOp_pi2x(i,j_index) = dln_BOp_pi2_i[0]; - d_dln_BOp_pi2y(i,j_index) = dln_BOp_pi2_i[1]; - d_dln_BOp_pi2z(i,j_index) = dln_BOp_pi2_i[2]; + d_dln_BOp_pi(i,j_index) = -(BO_pi*Cln_BOp_pi); + d_dln_BOp_pi2(i,j_index) = -(BO_pi2*Cln_BOp_pi2); + d_dBOp(i,j_index) = -(BO_s*Cln_BOp_s+BO_pi*Cln_BOp_pi+BO_pi2*Cln_BOp_pi2); - d_dBOpx(i,j_index) = dBOp_i[0]; - d_dBOpy(i,j_index) = dBOp_i[1]; - d_dBOpz(i,j_index) = dBOp_i[2]; - - d_BO(i,j_index) -= bo_cut; - d_BO_s(i,j_index) -= bo_cut; - total_bo_i += d_BO(i,j_index); + d_BO(i,j_index) = BO - bo_cut; + d_BO_s(i,j_index) = BO_s - bo_cut; + total_bo_i += (BO - bo_cut); } for (int d = 0; d < 3; d++) @@ -2275,6 +2128,37 @@ void PairReaxFFKokkos::operator()(TagPairReaxBuildListsFull, const i /* ---------------------------------------------------------------------- */ +template +KOKKOS_INLINE_FUNCTION +void PairReaxFFKokkos::compute_bo(F_FLOAT rij, int itype, int jtype, F_FLOAT p_bo2, F_FLOAT p_bo4, F_FLOAT p_bo6, + F_FLOAT& BO_s, F_FLOAT& BO_pi, F_FLOAT& BO_pi2, F_FLOAT& C12, F_FLOAT& C34, F_FLOAT& C56) const { + + const F_FLOAT p_bo1 = paramstwbp(itype,jtype).p_bo1; + const F_FLOAT p_bo3 = paramstwbp(itype,jtype).p_bo3; + const F_FLOAT p_bo5 = paramstwbp(itype,jtype).p_bo5; + const F_FLOAT r_s = paramstwbp(itype,jtype).r_s; + const F_FLOAT r_pi = paramstwbp(itype,jtype).r_pi; + const F_FLOAT r_pi2 = paramstwbp(itype,jtype).r_pi2; + + if (paramssing(itype).r_s > 0.0 && paramssing(jtype).r_s > 0.0) { + C12 = p_bo1 * ((p_bo2 != 0) ? (pow(rij/r_s,p_bo2)) : 1.0); + BO_s = (1.0+bo_cut)*exp(C12); + } else BO_s = C12 = 0.0; + + if (paramssing(itype).r_pi > 0.0 && paramssing(jtype).r_pi > 0.0) { + C34 = p_bo3 * ((p_bo4 != 0) ? (pow(rij/r_pi,p_bo4)) : 1.0); + BO_pi = exp(C34); + } else BO_pi = C34 = 0.0; + + if (paramssing(itype).r_pi2 > 0.0 && paramssing(jtype).r_pi2 > 0.0) { + C56 = p_bo5 * ((p_bo6 != 0) ? (pow(rij/r_pi2,p_bo6)) : 1.0); + BO_pi2 = exp(C56); + } else BO_pi2 = C56 = 0.0; + +} + +/* ---------------------------------------------------------------------- */ + template KOKKOS_INLINE_FUNCTION void PairReaxFFKokkos::operator()(TagPairReaxBondOrder1, const int &ii) const { @@ -2643,79 +2527,81 @@ void PairReaxFFKokkos::operator()(TagPairReaxComputeMulti2 -template +template KOKKOS_INLINE_FUNCTION -void PairReaxFFKokkos::operator()(TagPairReaxComputeAngular, const int &ii, EV_FLOAT_REAX& ev) const { - - const auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - const auto a_f = v_f.template access>(); - Kokkos::View::value> > a_Cdbo = d_Cdbo; - - const auto v_CdDelta = ScatterViewHelper,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); - const auto a_CdDelta = v_CdDelta.template access>(); +void PairReaxFFKokkos::operator()(TagPairReaxCountAngularTorsion, const int &ii) const { const int i = d_ilist[ii]; const int itype = type(i); - const X_FLOAT xtmp = x(i,0); - const X_FLOAT ytmp = x(i,1); - const X_FLOAT ztmp = x(i,2); - - F_FLOAT temp, temp_bo_jt, pBOjt7; - F_FLOAT p_val1, p_val2, p_val3, p_val4, p_val5; - F_FLOAT p_val6, p_val7, p_val8, p_val9, p_val10; - F_FLOAT p_pen1, p_pen2, p_pen3, p_pen4; - F_FLOAT p_coa1, p_coa2, p_coa3, p_coa4; - F_FLOAT trm8, expval6, expval7, expval2theta, expval12theta, exp3ij, exp3jk; - F_FLOAT exp_pen2ij, exp_pen2jk, exp_pen3, exp_pen4, trm_pen34, exp_coa2; - F_FLOAT dSBO1, dSBO2, SBO, SBO2, CSBO2, SBOp, prod_SBO, vlpadj; - F_FLOAT CEval1, CEval2, CEval3, CEval4, CEval5, CEval6, CEval7, CEval8; - F_FLOAT CEpen1, CEpen2, CEpen3; - F_FLOAT e_ang, e_coa, e_pen; - F_FLOAT CEcoa1, CEcoa2, CEcoa3, CEcoa4, CEcoa5; - F_FLOAT Cf7ij, Cf7jk, Cf8j, Cf9j; - F_FLOAT f7_ij, f7_jk, f8_Dj, f9_Dj; - F_FLOAT Ctheta_0, theta_0, theta_00, theta, cos_theta, sin_theta; - F_FLOAT BOA_ij, BOA_ik, rij, bo_ij, bo_ik; - F_FLOAT dcos_theta_di[3], dcos_theta_dj[3], dcos_theta_dk[3]; - F_FLOAT eng_tmp, fi_tmp[3], fj_tmp[3], fk_tmp[3]; - F_FLOAT delij[3], delik[3], delji[3], delki[3]; - - p_val6 = gp[14]; - p_val8 = gp[33]; - p_val9 = gp[16]; - p_val10 = gp[17]; - - p_pen2 = gp[19]; - p_pen3 = gp[20]; - p_pen4 = gp[21]; - - p_coa2 = gp[2]; - p_coa3 = gp[38]; - p_coa4 = gp[30]; - - p_val3 = paramssing(itype).p_val3; - p_val5 = paramssing(itype).p_val5; const int j_start = d_bo_first[i]; const int j_end = j_start + d_bo_num[i]; - const F_FLOAT Delta_val = d_total_bo[i] - paramssing(itype).valency_val; + if (POPULATE) { + // Computes and stores SBO2, CSBO2, dSBO1, dSBO2 + compute_angular_sbo(i, itype, j_start, j_end); + } - SBOp = 0.0, prod_SBO = 1.0; + // Angular + + // Count buffer size for `i` + int location_angular = 0; // dummy declaration + int count_angular = preprocess_angular(i, itype, j_start, j_end, location_angular); + location_angular = Kokkos::atomic_fetch_add(&d_count_angular_torsion(0), count_angular); + + if (POPULATE) { + // Fill buffer for `i` + preprocess_angular(i, itype, j_start, j_end, location_angular); + } + + // Torsion + + const tagint itag = tag(i); + const X_FLOAT xtmp = x(i,0); + const X_FLOAT ytmp = x(i,1); + const X_FLOAT ztmp = x(i,2); + + // Count buffer size for `i` + int location_torsion = 0; // dummy declaration + int count_torsion = preprocess_torsion(i, itype, itag, xtmp, ytmp, ztmp, j_start, j_end, location_torsion); + location_torsion = Kokkos::atomic_fetch_add(&d_count_angular_torsion(1), count_torsion); + + if (POPULATE) { + // Fill buffer for `i` + preprocess_torsion(i, itype, itag, xtmp, ytmp, ztmp, j_start, j_end, location_torsion); + } + +} + +/* ---------------------------------------------------------------------- */ + +template +KOKKOS_INLINE_FUNCTION +void PairReaxFFKokkos::compute_angular_sbo(int i, int itype, int j_start, int j_end) const { + + F_FLOAT SBO2, CSBO2, dSBO1, dSBO2; + + const F_FLOAT p_val8 = gp[33]; + const F_FLOAT p_val9 = gp[16]; + + F_FLOAT SBOp = 0.0; + F_FLOAT prod_SBO = 1.0; for (int jj = j_start; jj < j_end; jj++) { int j = d_bo_list[jj]; j &= NEIGHMASK; const int j_index = jj - j_start; - bo_ij = d_BO(i,j_index); + const F_FLOAT bo_ij = d_BO(i,j_index); SBOp += (d_BO_pi(i,j_index) + d_BO_pi2(i,j_index)); - temp = SQR(bo_ij); + F_FLOAT temp = SQR(bo_ij); temp *= temp; temp *= temp; prod_SBO *= exp(-temp); } + F_FLOAT vlpadj; + const F_FLOAT Delta_e = d_total_bo[i] - paramssing(itype).valency_e; const F_FLOAT vlpex = Delta_e - 2.0 * (int)(Delta_e/2.0); const F_FLOAT explp1 = exp(-gp[15] * SQR(2.0 + vlpex)); @@ -2728,51 +2614,51 @@ void PairReaxFFKokkos::operator()(TagPairReaxComputeAngular 0.0 && SBO <= 1.0) { - CSBO2 = pow(SBO, p_val9 - 1.0); - SBO2 = CSBO2*SBO; - CSBO2 = p_val9 * CSBO2; + SBO2 = pow(SBO, p_val9); + CSBO2 = p_val9 * pow(SBO, p_val9 - 1.0); } else if (SBO > 1.0 && SBO < 2.0) { - CSBO2 = pow(2.0 - SBO, p_val9 - 1.0); - SBO2 = 2.0 - CSBO2*(2.0 - SBO); - CSBO2 = p_val9 * CSBO2; + SBO2 = 2.0 - pow(2.0-SBO, p_val9); + CSBO2 = p_val9 * pow(2.0 - SBO, p_val9 - 1.0); } else { SBO2 = 2.0; CSBO2 = 0.0; } - expval6 = exp(p_val6 * d_Delta_boc[i]); - F_FLOAT CdDelta_i = 0.0; - F_FLOAT fitmp[3],fjtmp[3]; - for (int j = 0; j < 3; j++) fitmp[j] = 0.0; + d_angular_intermediates(i,0) = SBO2; + d_angular_intermediates(i,1) = CSBO2; + d_angular_intermediates(i,2) = dSBO1; + d_angular_intermediates(i,3) = dSBO2; + +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +int PairReaxFFKokkos::preprocess_angular(int i, int itype, int j_start, int j_end, int location_angular) const { + + int count_angular = 0; for (int jj = j_start; jj < j_end; jj++) { int j = d_bo_list[jj]; j &= NEIGHMASK; const int j_index = jj - j_start; - delij[0] = x(j,0) - xtmp; - delij[1] = x(j,1) - ytmp; - delij[2] = x(j,2) - ztmp; - const F_FLOAT rsqij = delij[0]*delij[0] + delij[1]*delij[1] + delij[2]*delij[2]; - rij = sqrt(rsqij); - bo_ij = d_BO(i,j_index); - const int i_index = maxbo+j_index; + const F_FLOAT bo_ij = d_BO(i,j_index); - BOA_ij = bo_ij - thb_cut; - if (BOA_ij <= 0.0) continue; + if (bo_ij <= thb_cut) continue; if (i >= nlocal && j >= nlocal) continue; + const int i_index = maxbo + j_index; const int jtype = type(j); - F_FLOAT CdDelta_j = 0.0; - for (int k = 0; k < 3; k++) fjtmp[k] = 0.0; - for (int kk = jj+1; kk < j_end; kk++) { //for (int kk = j_start; kk < j_end; kk++) { int k = d_bo_list[kk]; @@ -2780,6 +2666,216 @@ void PairReaxFFKokkos::operator()(TagPairReaxComputeAngular +template +KOKKOS_INLINE_FUNCTION +int PairReaxFFKokkos::preprocess_torsion(int i, int /*itype*/, int itag, + F_FLOAT xtmp, F_FLOAT ytmp, F_FLOAT ztmp, int j_start, int j_end, int location_torsion) const { + + // in reaxff_torsion_angles: j = i, k = j, i = k; + + int count_torsion = 0; + + for (int jj = j_start; jj < j_end; jj++) { + int j = d_bo_list[jj]; + j &= NEIGHMASK; + const tagint jtag = tag(j); + const int j_index = jj - j_start; + + // skip half of the interactions + if (itag > jtag) { + if ((itag+jtag) % 2 == 0) continue; + } else if (itag < jtag) { + if ((itag+jtag) % 2 == 1) continue; + } else { + if (x(j,2) < ztmp) continue; + if (x(j,2) == ztmp && x(j,1) < ytmp) continue; + if (x(j,2) == ztmp && x(j,1) == ytmp && x(j,0) < xtmp) continue; + } + + const F_FLOAT bo_ij = d_BO(i,j_index); + if (bo_ij < thb_cut) continue; + + const int l_start = d_bo_first[j]; + const int l_end = l_start + d_bo_num[j]; + + for (int kk = j_start; kk < j_end; kk++) { + int k = d_bo_list[kk]; + k &= NEIGHMASK; + if (k == j) continue; + const int k_index = kk - j_start; + + const F_FLOAT bo_ik = d_BO(i,k_index); + if (bo_ik < thb_cut) continue; + + for (int ll = l_start; ll < l_end; ll++) { + int l = d_bo_list[ll]; + l &= NEIGHMASK; + if (l == i) continue; + const int l_index = ll - l_start; + + const F_FLOAT bo_jl = d_BO(j,l_index); + if (l == k || bo_jl < thb_cut || bo_ij*bo_ik*bo_jl < thb_cut) continue; + + if (POPULATE) { + reax_int4 pack; + + pack.i0 = i; + pack.i1 = j; + pack.i2 = k; + pack.i3 = l; + d_torsion_pack(location_torsion, 0) = pack; + + pack.i0 = 0; // no i_index + pack.i1 = j_index; + pack.i2 = k_index; + pack.i3 = l_index; + d_torsion_pack(location_torsion, 1) = pack; + + location_torsion++; + } else { + count_torsion++; + } + } + } + } + + return count_torsion; +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void PairReaxFFKokkos::operator()(TagPairReaxComputeAngularPreprocessed, const int &apack, EV_FLOAT_REAX& ev) const { + + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); + Kokkos::View::value,Kokkos::MemoryTraits::value>> a_Cdbo = d_Cdbo; + Kokkos::View::value,Kokkos::MemoryTraits::value>> a_Cdbopi = d_Cdbopi; + Kokkos::View::value,Kokkos::MemoryTraits::value>> a_Cdbopi2 = d_Cdbopi2; + + auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); + auto a_CdDelta = v_CdDelta.template access::value>(); + + F_FLOAT temp, temp_bo_jt, pBOjt7; + F_FLOAT p_val1, p_val2, p_val3, p_val4, p_val5; + F_FLOAT p_val6, p_val7, p_val10; + F_FLOAT p_pen1, p_pen2, p_pen3, p_pen4; + F_FLOAT p_coa1, p_coa2, p_coa3, p_coa4; + F_FLOAT trm8, expval6, expval7, expval2theta, expval12theta, exp3ij, exp3jk; + F_FLOAT exp_pen2ij, exp_pen2jk, exp_pen3, exp_pen4, trm_pen34, exp_coa2; + F_FLOAT dSBO1, dSBO2, SBO2, CSBO2; + F_FLOAT CEval1, CEval2, CEval3, CEval4, CEval5, CEval6, CEval7, CEval8; + F_FLOAT CEpen1, CEpen2, CEpen3; + F_FLOAT e_ang, e_coa, e_pen; + F_FLOAT CEcoa1, CEcoa2, CEcoa3, CEcoa4, CEcoa5; + F_FLOAT Cf7ij, Cf7jk, Cf8j, Cf9j; + F_FLOAT f7_ij, f7_jk, f8_Dj, f9_Dj; + F_FLOAT Ctheta_0, theta_0, theta_00, theta, cos_theta, sin_theta; + F_FLOAT BOA_ij, BOA_ik, rij, bo_ij, bo_ik; + F_FLOAT dcos_theta_di[3], dcos_theta_dj[3], dcos_theta_dk[3]; + F_FLOAT eng_tmp, fi_tmp[3], fj_tmp[3], fk_tmp[3]; + F_FLOAT delij[3], delik[3], delji[3], delki[3]; + + p_val6 = gp[14]; + p_val10 = gp[17]; + + p_pen2 = gp[19]; + p_pen3 = gp[20]; + p_pen4 = gp[21]; + + p_coa2 = gp[2]; + p_coa3 = gp[38]; + p_coa4 = gp[30]; + + reax_int4 pack = d_angular_pack(apack,0); + const int i = pack.i0; + const int j = pack.i1; + const int k = pack.i2; + const int j_start = pack.i3; + + pack = d_angular_pack(apack, 1); + const int i_index = pack.i0; + const int j_index = pack.i1; + const int k_index = pack.i2; + const int j_end = pack.i3; + + const int itype = type(i); + const X_FLOAT xtmp = x(i,0); + const X_FLOAT ytmp = x(i,1); + const X_FLOAT ztmp = x(i,2); + + p_val3 = paramssing(itype).p_val3; + p_val5 = paramssing(itype).p_val5; + + const F_FLOAT Delta_val = d_total_bo[i] - paramssing(itype).valency_val; + + SBO2 = d_angular_intermediates(i, 0); + CSBO2 = d_angular_intermediates(i, 1); + dSBO1 = d_angular_intermediates(i, 2); + dSBO2 = d_angular_intermediates(i, 3); + + expval6 = exp(p_val6 * d_Delta_boc[i]); + + F_FLOAT CdDelta_i = 0.0; + F_FLOAT fitmp[3],fjtmp[3]; + for (int j = 0; j < 3; j++) fitmp[j] = 0.0; + + delij[0] = x(j,0) - xtmp; + delij[1] = x(j,1) - ytmp; + delij[2] = x(j,2) - ztmp; + const F_FLOAT rsqij = delij[0]*delij[0] + delij[1]*delij[1] + delij[2]*delij[2]; + rij = sqrt(rsqij); + bo_ij = d_BO(i,j_index); + + BOA_ij = bo_ij - thb_cut; + + const int jtype = type(j); + + F_FLOAT CdDelta_j = 0.0; + for (int k = 0; k < 3; k++) fjtmp[k] = 0.0; + delik[0] = x(k,0) - xtmp; delik[1] = x(k,1) - ytmp; delik[2] = x(k,2) - ztmp; @@ -2788,8 +2884,6 @@ void PairReaxFFKokkos::operator()(TagPairReaxComputeAngular::operator()(TagPairReaxComputeAngular::operator()(TagPairReaxComputeAngular::operator()(TagPairReaxComputeAngular::operator()(TagPairReaxComputeAngular::operator()(TagPairReaxComputeAngular::operator()(TagPairReaxComputeAngular::operator()(TagPairReaxComputeAngulartemplate v_tally3(ev,i,j,k,fj_tmp,fk_tmp,delji,delki); } - } a_CdDelta[j] += CdDelta_j; for (int d = 0; d < 3; d++) a_f(j,d) += fjtmp[d]; - } a_CdDelta[i] += CdDelta_i; for (int d = 0; d < 3; d++) a_f(i,d) += fitmp[d]; } @@ -2951,84 +3037,10 @@ void PairReaxFFKokkos::operator()(TagPairReaxComputeAngular template KOKKOS_INLINE_FUNCTION -void PairReaxFFKokkos::operator()(TagPairReaxComputeAngular, const int &ii) const { +void PairReaxFFKokkos::operator()(TagPairReaxComputeAngularPreprocessed, const int &apack) const { EV_FLOAT_REAX ev; - this->template operator()(TagPairReaxComputeAngular(), ii, ev); -} + this->template operator()(TagPairReaxComputeAngularPreprocessed(), apack, ev); -/* ---------------------------------------------------------------------- */ - -template -KOKKOS_INLINE_FUNCTION -void PairReaxFFKokkos::operator()(TagPairReaxComputeTorsionPreview, const int &ii) const { - - F_FLOAT bo_ij, bo_ik; - int counter = 0; - - const int i = d_ilist[ii]; - const int itype = type(i); - const tagint itag = tag(i); - const X_FLOAT xtmp = x(i,0); - const X_FLOAT ytmp = x(i,1); - const X_FLOAT ztmp = x(i,2); - - const int j_start = d_bo_first[i]; - const int j_end = j_start + d_bo_num[i]; - - int jj_min = j_end+1; - int jj_max = j_start-1; - int kk_min = j_end+1; - int kk_max = j_start-1; - - for (int jj = j_start; jj < j_end; jj++) { - - // j_counter1++; - - int j = d_bo_list[jj]; - j &= NEIGHMASK; - const tagint jtag = tag(j); - const int j_index = jj - j_start; - - // skip half of the interactions - if (itag > jtag) { - if ((itag+jtag) % 2 == 0) continue; - } else if (itag < jtag) { - if ((itag+jtag) % 2 == 1) continue; - } else { - if (x(j,2) < ztmp) continue; - if (x(j,2) == ztmp && x(j,1) < ytmp) continue; - if (x(j,2) == ztmp && x(j,1) == ytmp && x(j,0) < xtmp) continue; - } - - bo_ij = d_BO(i,j_index); - if (bo_ij < thb_cut) continue; - - const int l_start = d_bo_first[j]; - const int l_end = l_start + d_bo_num[j]; - - for (int kk = j_start; kk < j_end; kk++) { - int k = d_bo_list[kk]; - k &= NEIGHMASK; - if (k == j) continue; - const int k_index = kk - j_start; - bo_ik = d_BO(i,k_index); - if (bo_ik < thb_cut) continue; - - counter++; - jj_min = jj < jj_min ? jj : jj_min; - jj_max = jj >= jj_max ? (jj+1) : jj_max; - kk_min = kk < kk_min ? kk : kk_min; - kk_max = kk >= kk_max ? (kk+1) : kk_max; - } - - } - counters[ii] = counter; - if (counter > 0) { - counters_jj_min[ii] = jj_min; - counters_jj_max[ii] = jj_max; - counters_kk_min[ii] = kk_min; - counters_kk_max[ii] = kk_max; - } } /* ---------------------------------------------------------------------- */ @@ -3036,19 +3048,16 @@ void PairReaxFFKokkos::operator()(TagPairReaxComputeTorsionPreview, template template KOKKOS_INLINE_FUNCTION -void PairReaxFFKokkos::operator()(TagPairReaxComputeTorsion, const int &iii, EV_FLOAT_REAX& ev) const { +void PairReaxFFKokkos::operator()(TagPairReaxComputeTorsionPreprocessed, const int &tpack, EV_FLOAT_REAX& ev) const { - constexpr int blocksize = PairReaxFFKokkos::compute_torsion_blocksize; + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); - const int ii = counters[iii]; - - const auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - const auto a_f = v_f.template access>(); - - const auto v_CdDelta = ScatterViewHelper,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); - const auto a_CdDelta = v_CdDelta.template access>(); - Kokkos::View::value>> a_Cdbo = d_Cdbo; - //auto a_Cdbo = dup_Cdbo.template access>(); + auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); + auto a_CdDelta = v_CdDelta.template access::value>(); + Kokkos::View::value,Kokkos::MemoryTraits::value>> a_Cdbo = d_Cdbo; + Kokkos::View::value,Kokkos::MemoryTraits::value>> a_Cdbopi = d_Cdbopi; + //auto a_Cdbo = dup_Cdbo.template access::value>(); // in reaxff_torsion_angles: j = i, k = j, i = k; @@ -3064,8 +3073,7 @@ void PairReaxFFKokkos::operator()(TagPairReaxComputeTorsion::operator()(TagPairReaxComputeTorsion jtag) { - if ((itag+jtag) % 2 == 0) continue_flag = true; - } else if (itag < jtag) { - if ((itag+jtag) % 2 == 1) continue_flag = true; - } else { - if (x(j,2) < ztmp) continue_flag = true; - else if (x(j,2) == ztmp && x(j,1) < ytmp) continue_flag = true; - else if (x(j,2) == ztmp && x(j,1) == ytmp && x(j,0) < xtmp) continue_flag = true; + bo_ik = d_BO(i,k_index); + + BOA_ik = bo_ik - thb_cut; + for (int d = 0; d < 3; d ++) delik[d] = x(k,d) - x(i,d); + const F_FLOAT rsqik = delik[0]*delik[0] + delik[1]*delik[1] + delik[2]*delik[2]; + const F_FLOAT rik = sqrt(rsqik); + + cos_ijk = (delij[0]*delik[0]+delij[1]*delik[1]+delij[2]*delik[2])/(rij*rik); + if (cos_ijk > 1.0) cos_ijk = 1.0; + if (cos_ijk < -1.0) cos_ijk = -1.0; + theta_ijk = acos(cos_ijk); + + // dcos_ijk + const F_FLOAT inv_dists = 1.0 / (rij * rik); + const F_FLOAT cos_ijk_tmp = cos_ijk / ((rij*rik)*(rij*rik)); + + for (int d = 0; d < 3; d++) { + dcos_ijk_di[d] = -(delik[d] + delij[d]) * inv_dists + cos_ijk_tmp * (rsqik * delij[d] + rsqij * delik[d]); + dcos_ijk_dj[d] = delik[d] * inv_dists - cos_ijk_tmp * rsqik * delij[d]; + dcos_ijk_dk[d] = delij[d] * inv_dists - cos_ijk_tmp * rsqij * delik[d]; } - bo_ij = d_BO(i,j_index); - if (bo_ij < thb_cut) continue_flag = true; + sin_ijk = sin(theta_ijk); + if (sin_ijk >= 0 && sin_ijk <= 1e-10) + tan_ijk_i = cos_ijk / 1e-10; + else if (sin_ijk <= 0 && sin_ijk >= -1e-10) + tan_ijk_i = -cos_ijk / 1e-10; + else tan_ijk_i = cos_ijk / sin_ijk; - if (!continue_flag) { - selected_jj[nnz_jj] = jj_current-jj_start; - nnz_jj++; - } - jj_current++; - if (jj_current == jj_stop) break; - } + exp_tor2_ik = exp(-p_tor2 * BOA_ik); + exp_cot2_ik = exp(-p_cot2 * SQR(BOA_ik -1.5)); - for (int jj_inner = 0; jj_inner < nnz_jj; jj_inner++) { - const int jj = jj_start + selected_jj[jj_inner]; - int j = d_bo_list[jj]; - j &= NEIGHMASK; - const tagint jtag = tag(j); - const int jtype = type(j); - const int j_index = jj - j_start; - bo_ij = d_BO(i,j_index); + const int ltype = type(l); + bo_jl = d_BO(j,l_index); - delij[0] = x(j,0) - xtmp; - delij[1] = x(j,1) - ytmp; - delij[2] = x(j,2) - ztmp; - const F_FLOAT rsqij = delij[0]*delij[0] + delij[1]*delij[1] + delij[2]*delij[2]; - const F_FLOAT rij = sqrt(rsqij); + for (int d = 0; d < 3; d ++) deljl[d] = x(l,d) - x(j,d); + const F_FLOAT rsqjl = deljl[0]*deljl[0] + deljl[1]*deljl[1] + deljl[2]*deljl[2]; + const F_FLOAT rjl = sqrt(rsqjl); + BOA_jl = bo_jl - thb_cut; - BOA_ij = bo_ij - thb_cut; - Delta_j = d_Delta_boc[j]; - exp_tor2_ij = exp(-p_tor2 * BOA_ij); - exp_cot2_ij = exp(-p_cot2 * SQR(BOA_ij - 1.5)); - exp_tor3_DiDj = exp(-p_tor3 * (Delta_i + Delta_j)); - exp_tor4_DiDj = exp(p_tor4 * (Delta_i + Delta_j)); - exp_tor34_inv = 1.0 / (1.0 + exp_tor3_DiDj + exp_tor4_DiDj); - f11_DiDj = (2.0 + exp_tor3_DiDj) * exp_tor34_inv; + cos_jil = -(delij[0]*deljl[0]+delij[1]*deljl[1]+delij[2]*deljl[2])/(rij*rjl); + if (cos_jil > 1.0) cos_jil = 1.0; + if (cos_jil < -1.0) cos_jil = -1.0; + theta_jil = acos(cos_jil); - const int l_start = d_bo_first[j]; - const int l_end = l_start + d_bo_num[j]; + // dcos_jil + const F_FLOAT inv_distjl = 1.0 / (rij * rjl); + const F_FLOAT cos_jil_tmp = cos_jil / ((rij*rjl)*(rij*rjl)); - for(int k = 0; k < 3; k++) fjtmp[k] = 0.0; - F_FLOAT CdDelta_j = 0.0; - - int nnz_kk; - int selected_kk[blocksize]; - int kk_current = kk_start; - - while (kk_current < kk_stop) { - nnz_kk=0; - while (nnz_kk < blocksize) { - int kk = kk_current; - int k = d_bo_list[kk]; - k &= NEIGHMASK; - bool continue_flag = false; - - if (k == j) - continue_flag = true; - else{ - const int k_index = kk - j_start; - bo_ik = d_BO(i,k_index); - if (bo_ik < thb_cut) continue_flag = true; - } - - if (!continue_flag) { - selected_kk[nnz_kk] = kk_current-kk_start; - nnz_kk++; - } - kk_current++; - if (kk_current == kk_stop) break; + for (int d = 0; d < 3; d++) { + dcos_jil_di[d] = deljl[d] * inv_distjl - cos_jil_tmp * rsqjl * -delij[d]; + dcos_jil_dj[d] = (-deljl[d] + delij[d]) * inv_distjl - cos_jil_tmp * (rsqjl * delij[d] + rsqij * -deljl[d]); + dcos_jil_dk[d] = -delij[d] * inv_distjl - cos_jil_tmp * rsqij * deljl[d]; } - for (int kk_inner = 0; kk_inner < nnz_kk; kk_inner++) { - const int kk = kk_start + selected_kk[kk_inner]; - int k = d_bo_list[kk]; - k &= NEIGHMASK; - const int ktype = type(k); - const int k_index = kk - j_start; - bo_ik = d_BO(i,k_index); + sin_jil = sin(theta_jil); + if (sin_jil >= 0 && sin_jil <= 1e-10) + tan_jil_i = cos_jil / 1e-10; + else if (sin_jil <= 0 && sin_jil >= -1e-10) + tan_jil_i = -cos_jil / 1e-10; + else tan_jil_i = cos_jil / sin_jil; - BOA_ik = bo_ik - thb_cut; - for (int d = 0; d < 3; d ++) delik[d] = x(k,d) - x(i,d); - const F_FLOAT rsqik = delik[0]*delik[0] + delik[1]*delik[1] + delik[2]*delik[2]; - const F_FLOAT rik = sqrt(rsqik); + for (int d = 0; d < 3; d ++) dellk[d] = x(k,d) - x(l,d); + const F_FLOAT rsqlk = dellk[0]*dellk[0] + dellk[1]*dellk[1] + dellk[2]*dellk[2]; + const F_FLOAT rlk = sqrt(rsqlk); - cos_ijk = (delij[0]*delik[0]+delij[1]*delik[1]+delij[2]*delik[2])/(rij*rik); - if (cos_ijk > 1.0) cos_ijk = 1.0; - else if (cos_ijk < -1.0) cos_ijk = -1.0; - theta_ijk = acos(cos_ijk); + F_FLOAT unnorm_cos_omega, unnorm_sin_omega, omega; + F_FLOAT htra, htrb, htrc, hthd, hthe, hnra, hnrc, hnhd, hnhe; + F_FLOAT arg, poem, tel; + F_FLOAT cross_ij_jl[3]; - // dcos_ijk - const F_FLOAT inv_dists = 1.0 / (rij * rik); - const F_FLOAT cos_ijk_tmp = cos_ijk *inv_dists * inv_dists; + // omega - for(int d = 0; d < 3; d++) { - dcos_ijk_di[d] = -(delik[d] + delij[d]) * inv_dists + cos_ijk_tmp * (rsqik * delij[d] + rsqij * delik[d]); - dcos_ijk_dj[d] = delik[d] * inv_dists - cos_ijk_tmp * rsqik * delij[d]; - dcos_ijk_dk[d] = delij[d] * inv_dists - cos_ijk_tmp * rsqij * delik[d]; - } + F_FLOAT dot_ij_jk = -(delij[0]*delik[0]+delij[1]*delik[1]+delij[2]*delik[2]); + F_FLOAT dot_ij_lj = delij[0]*deljl[0]+delij[1]*deljl[1]+delij[2]*deljl[2]; + F_FLOAT dot_ik_jl = delik[0]*deljl[0]+delik[1]*deljl[1]+delik[2]*deljl[2]; + unnorm_cos_omega = dot_ij_jk * dot_ij_lj + rsqij * dot_ik_jl; - sin_ijk = sin(theta_ijk); - if (sin_ijk >= 0 && sin_ijk <= 1e-10) - tan_ijk_i = cos_ijk / 1e-10; - else if (sin_ijk <= 0 && sin_ijk >= -1e-10) - tan_ijk_i = -cos_ijk / 1e-10; - else tan_ijk_i = cos_ijk / sin_ijk; + cross_ij_jl[0] = delij[1]*deljl[2] - delij[2]*deljl[1]; + cross_ij_jl[1] = delij[2]*deljl[0] - delij[0]*deljl[2]; + cross_ij_jl[2] = delij[0]*deljl[1] - delij[1]*deljl[0]; - exp_tor2_ik = exp(-p_tor2 * BOA_ik); - exp_cot2_ik = exp(-p_cot2 * SQR(BOA_ik -1.5)); + unnorm_sin_omega = -rij*(delik[0]*cross_ij_jl[0]+delik[1]*cross_ij_jl[1]+delik[2]*cross_ij_jl[2]); + omega = atan2(unnorm_sin_omega, unnorm_cos_omega); - for(int l = 0; l < 3; l++) fktmp[l] = 0.0; + htra = rik + cos_ijk * (rjl * cos_jil - rij); + htrb = rij - rik * cos_ijk - rjl * cos_jil; + htrc = rjl + cos_jil * (rik * cos_ijk - rij); + hthd = rik * sin_ijk * (rij - rjl * cos_jil); + hthe = rjl * sin_jil * (rij - rik * cos_ijk); + hnra = rjl * sin_ijk * sin_jil; + hnrc = rik * sin_ijk * sin_jil; + hnhd = rik * rjl * cos_ijk * sin_jil; + hnhe = rik * rjl * sin_ijk * cos_jil; - for (int ll = l_start; ll < l_end; ll++) { - int l = d_bo_list[ll]; - l &= NEIGHMASK; - if (l == i) continue; - const int ltype = type(l); - const int l_index = ll - l_start; + poem = 2.0 * rik * rjl * sin_ijk * sin_jil; + if (poem < 1e-20) poem = 1e-20; - bo_jl = d_BO(j,l_index); - if (l == k || bo_jl < thb_cut || bo_ij*bo_ik*bo_jl < thb_cut) continue; + tel = SQR(rik) + SQR(rij) + SQR(rjl) - SQR(rlk) - + 2.0 * (rik * rij * cos_ijk - rik * rjl * cos_ijk * cos_jil + rij * rjl * cos_jil); - for (int d = 0; d < 3; d ++) deljl[d] = x(l,d) - x(j,d); - const F_FLOAT rsqjl = deljl[0]*deljl[0] + deljl[1]*deljl[1] + deljl[2]*deljl[2]; - const F_FLOAT rjl = sqrt(rsqjl); - BOA_jl = bo_jl - thb_cut; + F_FLOAT inv_poem = 1.0 / poem; - cos_jil = -(delij[0]*deljl[0]+delij[1]*deljl[1]+delij[2]*deljl[2])/(rij*rjl); - if (cos_jil > 1.0) cos_jil = 1.0; - else if (cos_jil < -1.0) cos_jil = -1.0; - theta_jil = acos(cos_jil); + arg = tel * inv_poem; + if (arg > 1.0) arg = 1.0; + if (arg < -1.0) arg = -1.0; - // dcos_jil - const F_FLOAT inv_distjl = 1.0 / (rij * rjl); - const F_FLOAT cos_jil_tmp = cos_jil / ((rij*rjl)*(rij*rjl)); + F_FLOAT sin_ijk_rnd = sin_ijk; + F_FLOAT sin_jil_rnd = sin_jil; - for(int d = 0; d < 3; d++) { - dcos_jil_di[d] = deljl[d] * inv_distjl - cos_jil_tmp * rsqjl * -delij[d]; - dcos_jil_dj[d] = (-deljl[d] + delij[d]) * inv_distjl - cos_jil_tmp * (rsqjl * delij[d] + rsqij * -deljl[d]); - dcos_jil_dk[d] = -delij[d] * inv_distjl - cos_jil_tmp * rsqij * deljl[d]; - } + if (sin_ijk >= 0 && sin_ijk <= 1e-10) sin_ijk_rnd = 1e-10; + else if (sin_ijk <= 0 && sin_ijk >= -1e-10) sin_ijk_rnd = -1e-10; + if (sin_jil >= 0 && sin_jil <= 1e-10) sin_jil_rnd = 1e-10; + else if (sin_jil <= 0 && sin_jil >= -1e-10) sin_jil_rnd = -1e-10; - sin_jil = sin(theta_jil); - if (sin_jil >= 0 && sin_jil <= 1e-10) - tan_jil_i = cos_jil / 1e-10; - else if (sin_jil <= 0 && sin_jil >= -1e-10) - tan_jil_i = -cos_jil / 1e-10; - else tan_jil_i = cos_jil / sin_jil; + cos_omega = cos(omega); + cos2omega = cos(2. * omega); + cos3omega = cos(3. * omega); - for (int d = 0; d < 3; d ++) dellk[d] = x(k,d) - x(l,d); - const F_FLOAT rsqlk = dellk[0]*dellk[0] + dellk[1]*dellk[1] + dellk[2]*dellk[2]; - const F_FLOAT rlk = sqrt(rsqlk); + // torsion energy - F_FLOAT unnorm_cos_omega, unnorm_sin_omega, omega; - F_FLOAT htra, htrb, htrc, hthd, hthe, hnra, hnrc, hnhd, hnhe; - F_FLOAT arg, poem, tel; - F_FLOAT cross_ij_jl[3]; + p_tor1 = paramsfbp(ktype,itype,jtype,ltype).p_tor1; + p_cot1 = paramsfbp(ktype,itype,jtype,ltype).p_cot1; + V1 = paramsfbp(ktype,itype,jtype,ltype).V1; + V2 = paramsfbp(ktype,itype,jtype,ltype).V2; + V3 = paramsfbp(ktype,itype,jtype,ltype).V3; - // omega + exp_tor1 = exp(p_tor1 * SQR(2.0 - d_BO_pi(i,j_index) - f11_DiDj)); + exp_tor2_jl = exp(-p_tor2 * BOA_jl); + exp_cot2_jl = exp(-p_cot2 * SQR(BOA_jl - 1.5)); + fn10 = (1.0 - exp_tor2_ik) * (1.0 - exp_tor2_ij) * (1.0 - exp_tor2_jl); - F_FLOAT dot_ij_jk = -(delij[0]*delik[0]+delij[1]*delik[1]+delij[2]*delik[2]); - F_FLOAT dot_ij_lj = delij[0]*deljl[0]+delij[1]*deljl[1]+delij[2]*deljl[2]; - F_FLOAT dot_ik_jl = delik[0]*deljl[0]+delik[1]*deljl[1]+delik[2]*deljl[2]; - unnorm_cos_omega = dot_ij_jk * dot_ij_lj + rsqij * dot_ik_jl; + CV = 0.5 * (V1 * (1.0 + cos_omega) + V2 * exp_tor1 * (1.0 - cos2omega) + V3 * (1.0 + cos3omega)); - cross_ij_jl[0] = delij[1]*deljl[2] - delij[2]*deljl[1]; - cross_ij_jl[1] = delij[2]*deljl[0] - delij[0]*deljl[2]; - cross_ij_jl[2] = delij[0]*deljl[1] - delij[1]*deljl[0]; + e_tor = fn10 * sin_ijk * sin_jil * CV; + if (eflag) ev.ereax[6] += e_tor; - unnorm_sin_omega = -rij*(delik[0]*cross_ij_jl[0]+delik[1]*cross_ij_jl[1]+delik[2]*cross_ij_jl[2]); - omega = atan2(unnorm_sin_omega, unnorm_cos_omega); + dfn11 = (-p_tor3 * exp_tor3_DiDj + (p_tor3 * exp_tor3_DiDj - p_tor4 * exp_tor4_DiDj) * + (2.0 + exp_tor3_DiDj) * exp_tor34_inv) * exp_tor34_inv; - htra = rik + cos_ijk * (rjl * cos_jil - rij); - htrb = rij - rik * cos_ijk - rjl * cos_jil; - htrc = rjl + cos_jil * (rik * cos_ijk - rij); - hthd = rik * sin_ijk * (rij - rjl * cos_jil); - hthe = rjl * sin_jil * (rij - rik * cos_ijk); - hnra = rjl * sin_ijk * sin_jil; - hnrc = rik * sin_ijk * sin_jil; - hnhd = rik * rjl * cos_ijk * sin_jil; - hnhe = rik * rjl * sin_ijk * cos_jil; + CEtors1 = sin_ijk * sin_jil * CV; - poem = 2.0 * rik * rjl * sin_ijk * sin_jil; - if (poem < 1e-20) poem = 1e-20; + CEtors2 = -fn10 * 2.0 * p_tor1 * V2 * exp_tor1 * (2.0 - d_BO_pi(i,j_index) - f11_DiDj) * + (1.0 - SQR(cos_omega)) * sin_ijk * sin_jil; + CEtors3 = CEtors2 * dfn11; - tel = SQR(rik) + SQR(rij) + SQR(rjl) - SQR(rlk) - - 2.0 * (rik * rij * cos_ijk - rik * rjl * cos_ijk * cos_jil + rij * rjl * cos_jil); + CEtors4 = CEtors1 * p_tor2 * exp_tor2_ik * (1.0 - exp_tor2_ij) * (1.0 - exp_tor2_jl); + CEtors5 = CEtors1 * p_tor2 * (1.0 - exp_tor2_ik) * exp_tor2_ij * (1.0 - exp_tor2_jl); + CEtors6 = CEtors1 * p_tor2 * (1.0 - exp_tor2_ik) * (1.0 - exp_tor2_ij) * exp_tor2_jl; - arg = tel / poem; - if (arg > 1.0) arg = 1.0; - else if (arg < -1.0) arg = -1.0; + cmn = -fn10 * CV; + CEtors7 = cmn * sin_jil * tan_ijk_i; + CEtors8 = cmn * sin_ijk * tan_jil_i; - F_FLOAT sin_ijk_rnd = sin_ijk; - F_FLOAT sin_jil_rnd = sin_jil; + CEtors9 = fn10 * sin_ijk * sin_jil * + (0.5 * V1 - 2.0 * V2 * exp_tor1 * cos_omega + 1.5 * V3 * (cos2omega + 2.0 * SQR(cos_omega))); - if (sin_ijk >= 0 && sin_ijk <= 1e-10) sin_ijk_rnd = 1e-10; - else if (sin_ijk <= 0 && sin_ijk >= -1e-10) sin_ijk_rnd = -1e-10; - if (sin_jil >= 0 && sin_jil <= 1e-10) sin_jil_rnd = 1e-10; - else if (sin_jil <= 0 && sin_jil >= -1e-10) sin_jil_rnd = -1e-10; + // 4-body conjugation energy - // dcos_omega_di - for (int d = 0; d < 3; d++) dcos_omega_dk[d] = ((htra-arg*hnra)/rik) * delik[d] - dellk[d]; - for (int d = 0; d < 3; d++) dcos_omega_dk[d] += (hthd-arg*hnhd)/sin_ijk_rnd * -dcos_ijk_dk[d]; - for (int d = 0; d < 3; d++) dcos_omega_dk[d] *= 2.0/poem; + fn12 = exp_cot2_ik * exp_cot2_ij * exp_cot2_jl; + e_con = p_cot1 * fn12 * (1.0 + (SQR(cos_omega) - 1.0) * sin_ijk * sin_jil); + if (eflag) ev.ereax[7] += e_con; - // dcos_omega_dj - for (int d = 0; d < 3; d++) dcos_omega_di[d] = -((htra-arg*hnra)/rik) * delik[d] - htrb/rij * delij[d]; - for (int d = 0; d < 3; d++) dcos_omega_di[d] += -(hthd-arg*hnhd)/sin_ijk_rnd * dcos_ijk_di[d]; - for (int d = 0; d < 3; d++) dcos_omega_di[d] += -(hthe-arg*hnhe)/sin_jil_rnd * dcos_jil_di[d]; - for (int d = 0; d < 3; d++) dcos_omega_di[d] *= 2.0/poem; + Cconj = -2.0 * fn12 * p_cot1 * p_cot2 * (1.0 + (SQR(cos_omega) - 1.0) * sin_ijk * sin_jil); - // dcos_omega_dk - for (int d = 0; d < 3; d++) dcos_omega_dj[d] = -((htrc-arg*hnrc)/rjl) * deljl[d] + htrb/rij * delij[d]; - for (int d = 0; d < 3; d++) dcos_omega_dj[d] += -(hthd-arg*hnhd)/sin_ijk_rnd * dcos_ijk_dj[d]; - for (int d = 0; d < 3; d++) dcos_omega_dj[d] += -(hthe-arg*hnhe)/sin_jil_rnd * dcos_jil_dj[d]; - for (int d = 0; d < 3; d++) dcos_omega_dj[d] *= 2.0/poem; + CEconj1 = Cconj * (BOA_ik - 1.5e0); + CEconj2 = Cconj * (BOA_ij - 1.5e0); + CEconj3 = Cconj * (BOA_jl - 1.5e0); - // dcos_omega_dl - for (int d = 0; d < 3; d++) dcos_omega_dl[d] = ((htrc-arg*hnrc)/rjl) * deljl[d] + dellk[d]; - for (int d = 0; d < 3; d++) dcos_omega_dl[d] += (hthe-arg*hnhe)/sin_jil_rnd * -dcos_jil_dk[d]; - for (int d = 0; d < 3; d++) dcos_omega_dl[d] *= 2.0/poem; + CEconj4 = -p_cot1 * fn12 * (SQR(cos_omega) - 1.0) * sin_jil * tan_ijk_i; + CEconj5 = -p_cot1 * fn12 * (SQR(cos_omega) - 1.0) * sin_ijk * tan_jil_i; + CEconj6 = 2.0 * p_cot1 * fn12 * cos_omega * sin_ijk * sin_jil; - cos_omega = cos(omega); - cos2omega = cos(2. * omega); - cos3omega = cos(3. * omega); + // forces - // torsion energy + // contribution to bond order - p_tor1 = paramsfbp(ktype,itype,jtype,ltype).p_tor1; - p_cot1 = paramsfbp(ktype,itype,jtype,ltype).p_cot1; - V1 = paramsfbp(ktype,itype,jtype,ltype).V1; - V2 = paramsfbp(ktype,itype,jtype,ltype).V2; - V3 = paramsfbp(ktype,itype,jtype,ltype).V3; + a_Cdbopi(i,j_index) += CEtors2; - exp_tor1 = exp(p_tor1 * SQR(2.0 - d_BO_pi(i,j_index) - f11_DiDj)); - exp_tor2_jl = exp(-p_tor2 * BOA_jl); - exp_cot2_jl = exp(-p_cot2 * SQR(BOA_jl - 1.5)); - fn10 = (1.0 - exp_tor2_ik) * (1.0 - exp_tor2_ij) * (1.0 - exp_tor2_jl); + a_CdDelta[j] += CEtors3; + a_CdDelta[i] += CEtors3; - CV = 0.5 * (V1 * (1.0 + cos_omega) + V2 * exp_tor1 * (1.0 - cos2omega) + V3 * (1.0 + cos3omega)); + a_Cdbo(i,k_index) += CEtors4 + CEconj1; + a_Cdbo(i,j_index) += CEtors5 + CEconj2; + a_Cdbo(j,l_index) += CEtors6 + CEconj3; // trouble - e_tor = fn10 * sin_ijk * sin_jil * CV; - if (EVFLAG && eflag_global) ev.ereax[6] += e_tor; + const F_FLOAT coeff74 = CEtors7 + CEconj4; + const F_FLOAT coeff85 = CEtors8 + CEconj5; + const F_FLOAT coeff96 = CEtors9 + CEconj6; - dfn11 = (-p_tor3 * exp_tor3_DiDj + (p_tor3 * exp_tor3_DiDj - p_tor4 * exp_tor4_DiDj) * - (2.0 + exp_tor3_DiDj) * exp_tor34_inv) * exp_tor34_inv; + const F_FLOAT inv_rij = 1.0 / rij; + const F_FLOAT inv_rik = 1.0 / rik; + const F_FLOAT inv_rjl = 1.0 / rjl; + const F_FLOAT inv_sin_ijk_rnd = 1.0 / sin_ijk_rnd; + const F_FLOAT inv_sin_jil_rnd = 1.0 / sin_jil_rnd; - CEtors1 = sin_ijk * sin_jil * CV; + #pragma unroll + for (int d = 0; d < 3; d++) { + // dcos_omega_di + F_FLOAT dcos_omega_dk = ((htra-arg*hnra) * inv_rik) * delik[d] - dellk[d]; + dcos_omega_dk += (hthd-arg*hnhd) * inv_sin_ijk_rnd * -dcos_ijk_dk[d]; + dcos_omega_dk *= 2.0 * inv_poem; - CEtors2 = -fn10 * 2.0 * p_tor1 * V2 * exp_tor1 * (2.0 - d_BO_pi(i,j_index) - f11_DiDj) * - (1.0 - SQR(cos_omega)) * sin_ijk * sin_jil; - CEtors3 = CEtors2 * dfn11; + // dcos_omega_dj + F_FLOAT dcos_omega_di = -((htra-arg*hnra) * inv_rik) * delik[d] - htrb * inv_rij * delij[d]; + dcos_omega_di += -(hthd-arg*hnhd) * inv_sin_ijk_rnd * dcos_ijk_di[d]; + dcos_omega_di += -(hthe-arg*hnhe) * inv_sin_jil_rnd * dcos_jil_di[d]; + dcos_omega_di *= 2.0 * inv_poem; - CEtors4 = CEtors1 * p_tor2 * exp_tor2_ik * (1.0 - exp_tor2_ij) * (1.0 - exp_tor2_jl); - CEtors5 = CEtors1 * p_tor2 * (1.0 - exp_tor2_ik) * exp_tor2_ij * (1.0 - exp_tor2_jl); - CEtors6 = CEtors1 * p_tor2 * (1.0 - exp_tor2_ik) * (1.0 - exp_tor2_ij) * exp_tor2_jl; + // dcos_omega_dk + F_FLOAT dcos_omega_dj = -((htrc-arg*hnrc) * inv_rjl) * deljl[d] + htrb * inv_rij * delij[d]; + dcos_omega_dj += -(hthd-arg*hnhd) * inv_sin_ijk_rnd * dcos_ijk_dj[d]; + dcos_omega_dj += -(hthe-arg*hnhe) * inv_sin_jil_rnd * dcos_jil_dj[d]; + dcos_omega_dj *= 2.0 * inv_poem; - cmn = -fn10 * CV; - CEtors7 = cmn * sin_jil * tan_ijk_i; - CEtors8 = cmn * sin_ijk * tan_jil_i; + // dcos_omega_dl + F_FLOAT dcos_omega_dl = ((htrc-arg*hnrc) * inv_rjl) * deljl[d] + dellk[d]; + dcos_omega_dl += (hthe-arg*hnhe) * inv_sin_jil_rnd * -dcos_jil_dk[d]; + dcos_omega_dl *= 2.0 * inv_poem; - CEtors9 = fn10 * sin_ijk * sin_jil * - (0.5 * V1 - 2.0 * V2 * exp_tor1 * cos_omega + 1.5 * V3 * (cos2omega + 2.0 * SQR(cos_omega))); + // dcos_theta_ijk + fi_tmp[d] = (coeff74) * dcos_ijk_di[d]; + fj_tmp[d] = (coeff74) * dcos_ijk_dj[d]; + fk_tmp[d] = (coeff74) * dcos_ijk_dk[d]; - // 4-body conjugation energy + // dcos_theta_jil + fi_tmp[d] += (coeff85) * dcos_jil_di[d]; + fj_tmp[d] += (coeff85) * dcos_jil_dj[d]; + F_FLOAT fl_tmp = (coeff85) * dcos_jil_dk[d]; - fn12 = exp_cot2_ik * exp_cot2_ij * exp_cot2_jl; - e_con = p_cot1 * fn12 * (1.0 + (SQR(cos_omega) - 1.0) * sin_ijk * sin_jil); - if (EVFLAG && eflag_global) ev.ereax[7] += e_con; + // dcos_omega + fi_tmp[d] += (coeff96) * dcos_omega_di; + fj_tmp[d] += (coeff96) * dcos_omega_dj; + fk_tmp[d] += (coeff96) * dcos_omega_dk; + fl_tmp += (coeff96) * dcos_omega_dl; - Cconj = -2.0 * fn12 * p_cot1 * p_cot2 * (1.0 + (SQR(cos_omega) - 1.0) * sin_ijk * sin_jil); - - CEconj1 = Cconj * (BOA_ik - 1.5e0); - CEconj2 = Cconj * (BOA_ij - 1.5e0); - CEconj3 = Cconj * (BOA_jl - 1.5e0); - - CEconj4 = -p_cot1 * fn12 * (SQR(cos_omega) - 1.0) * sin_jil * tan_ijk_i; - CEconj5 = -p_cot1 * fn12 * (SQR(cos_omega) - 1.0) * sin_ijk * tan_jil_i; - CEconj6 = 2.0 * p_cot1 * fn12 * cos_omega * sin_ijk * sin_jil; - - // forces - - // contribution to bond order - - d_Cdbopi(i,j_index) += CEtors2; - CdDelta_i += CEtors3; - CdDelta_j += CEtors3; - - a_Cdbo(i,k_index) += CEtors4 + CEconj1; - a_Cdbo(i,j_index) += CEtors5 + CEconj2; - a_Cdbo(j,l_index) += CEtors6 + CEconj3; // trouble - - // dcos_theta_ijk - const F_FLOAT coeff74 = CEtors7 + CEconj4; - for (int d = 0; d < 3; d++) fi_tmp[d] = (coeff74) * dcos_ijk_di[d]; - for (int d = 0; d < 3; d++) fj_tmp[d] = (coeff74) * dcos_ijk_dj[d]; - for (int d = 0; d < 3; d++) fk_tmp[d] = (coeff74) * dcos_ijk_dk[d]; - - const F_FLOAT coeff85 = CEtors8 + CEconj5; - // dcos_theta_jil - for (int d = 0; d < 3; d++) fi_tmp[d] += (coeff85) * dcos_jil_di[d]; - for (int d = 0; d < 3; d++) fj_tmp[d] += (coeff85) * dcos_jil_dj[d]; - for (int d = 0; d < 3; d++) fl_tmp[d] = (coeff85) * dcos_jil_dk[d]; - - // dcos_omega - const F_FLOAT coeff96 = CEtors9 + CEconj6; - for (int d = 0; d < 3; d++) fi_tmp[d] += (coeff96) * dcos_omega_di[d]; - for (int d = 0; d < 3; d++) fj_tmp[d] += (coeff96) * dcos_omega_dj[d]; - for (int d = 0; d < 3; d++) fk_tmp[d] += (coeff96) * dcos_omega_dk[d]; - for (int d = 0; d < 3; d++) fl_tmp[d] += (coeff96) * dcos_omega_dl[d]; - - // total forces - - for (int d = 0; d < 3; d++) fitmp[d] -= fi_tmp[d]; - for (int d = 0; d < 3; d++) fjtmp[d] -= fj_tmp[d]; - for (int d = 0; d < 3; d++) fktmp[d] -= fk_tmp[d]; - for (int d = 0; d < 3; d++) a_f(l,d) -= fl_tmp[d]; - - // per-atom energy/virial tally - - if (EVFLAG) { - eng_tmp = e_tor + e_con; - //if (eflag_atom) this->template ev_tally(ev,i,j,eng_tmp,0.0,0.0,0.0,0.0); - if (eflag_atom) this->template e_tally(ev,i,j,eng_tmp); - if (vflag_either) { - for (int d = 0; d < 3; d ++) delil[d] = x(l,d) - x(i,d); - for (int d = 0; d < 3; d ++) delkl[d] = x(l,d) - x(k,d); - this->template v_tally4(ev,k,i,j,l,fk_tmp,fi_tmp,fj_tmp,delkl,delil,deljl); - } - } - } - - for (int d = 0; d < 3; d++) a_f(k,d) += fktmp[d]; + // total forces + a_f(i,d) -= fi_tmp[d]; + a_f(j,d) -= fj_tmp[d]; + a_f(k,d) -= fk_tmp[d]; + a_f(l,d) -= fl_tmp; } - } - a_CdDelta[j] += CdDelta_j; - for (int d = 0; d < 3; d++) a_f(j,d) += fjtmp[d]; - } - } - a_CdDelta[i] += CdDelta_i; - for (int d = 0; d < 3; d++) a_f(i,d) += fitmp[d]; + + // per-atom energy/virial tally + + if (EVFLAG) { + eng_tmp = e_tor + e_con; + //if (eflag_atom) this->template ev_tally(ev,i,j,eng_tmp,0.0,0.0,0.0,0.0); + if (eflag_atom) this->template e_tally(ev,i,j,eng_tmp); + if (vflag_either) { + for (int d = 0; d < 3; d ++) delil[d] = x(l,d) - x(i,d); + for (int d = 0; d < 3; d ++) delkl[d] = x(l,d) - x(k,d); + this->template v_tally4(ev,k,i,j,l,fk_tmp,fi_tmp,fj_tmp,delkl,delil,deljl); + } + } + + } template template KOKKOS_INLINE_FUNCTION -void PairReaxFFKokkos::operator()(TagPairReaxComputeTorsion, const int &ii) const { - +void PairReaxFFKokkos::operator()(TagPairReaxComputeTorsionPreprocessed, const int &tpack) const { EV_FLOAT_REAX ev; - this->template operator()(TagPairReaxComputeTorsion(), ii, ev); + this->template operator()(TagPairReaxComputeTorsionPreprocessed(), tpack, ev); + } /* ---------------------------------------------------------------------- */ @@ -3626,9 +3546,9 @@ template KOKKOS_INLINE_FUNCTION void PairReaxFFKokkos::operator()(TagPairReaxUpdateBond, const int &ii) const { - Kokkos::View::value> > a_Cdbo = d_Cdbo; - Kokkos::View::value> > a_Cdbopi = d_Cdbopi; - Kokkos::View::value> > a_Cdbopi2 = d_Cdbopi2; + Kokkos::View::value>> a_Cdbo = d_Cdbo; + Kokkos::View::value>> a_Cdbopi = d_Cdbopi; + Kokkos::View::value>> a_Cdbopi2 = d_Cdbopi2; //auto a_Cdbo = dup_Cdbo.template access>(); //auto a_Cdbopi = dup_Cdbopi.template access>(); //auto a_Cdbopi2 = dup_Cdbopi2.template access>(); @@ -3870,17 +3790,14 @@ void PairReaxFFKokkos::operator()(TagPairReaxComputeBond2::operator()(TagPairReaxComputeBond2::operator()(TagPairReaxComputeBond2 struct TagPairReaxComputeMulti2{}; +template +struct TagPairReaxCountAngularTorsion{}; template -struct TagPairReaxComputeAngular{}; - -struct TagPairReaxComputeTorsionPreview{}; +struct TagPairReaxComputeAngularPreprocessed{}; template -struct TagPairReaxComputeTorsion{}; +struct TagPairReaxComputeTorsionPreprocessed{}; template struct TagPairReaxComputeHydrogen{}; @@ -120,7 +120,7 @@ class PairReaxFFKokkos : public PairReaxFF { // "Blocking" factors to reduce thread divergence within some kernels using blocking_t = unsigned short int; - // "PairReaxFFComputeTorsionBlocking" + // "PairReaxFFComputeTorsion" static constexpr int compute_torsion_blocksize = 8; // "PairReaxBuildListsHalfBlocking" @@ -176,9 +176,28 @@ class PairReaxFFKokkos : public PairReaxFF { KOKKOS_INLINE_FUNCTION void operator()(TagPairReaxBuildListsHalfPreview, const int&) const; + // Isolated function that builds the hbond list, reused across + // TagPairReaxBuildListsHalfBlocking, HalfBlockingPreview, HalfPreview + template + KOKKOS_INLINE_FUNCTION + void build_hb_list(F_FLOAT, int, int, int, int, int) const; + + // Isolated function that builds the bond order list, reused across + // TagPairReaxBuildListsHalfBlocking, HalfBlockingPreview, HalfPreview + // Returns if we need to populate d_d* functions or not + template + KOKKOS_INLINE_FUNCTION + bool build_bo_list(int, int, int, int, int, int&, int&) const; + KOKKOS_INLINE_FUNCTION void operator()(TagPairReaxBuildListsFull, const int&) const; + // Isolated function that computes bond order parameters + // Returns BO_s, BO_pi, BO_pi2, C12, C34, C56 by reference + KOKKOS_INLINE_FUNCTION + void compute_bo(F_FLOAT, int, int, F_FLOAT, F_FLOAT, F_FLOAT, + F_FLOAT&, F_FLOAT&, F_FLOAT&, F_FLOAT&, F_FLOAT&, F_FLOAT&) const; + KOKKOS_INLINE_FUNCTION void operator()(TagPairReaxZero, const int&) const; @@ -222,24 +241,39 @@ class PairReaxFFKokkos : public PairReaxFF { KOKKOS_INLINE_FUNCTION void operator()(TagPairReaxComputeMulti2, const int&) const; - template + template KOKKOS_INLINE_FUNCTION - void operator()(TagPairReaxComputeAngular, const int&, EV_FLOAT_REAX&) const; + void operator()(TagPairReaxCountAngularTorsion, const int&) const; + + // Abstraction for computing SBSO2, CSBO2, dSBO1, dsBO2 + KOKKOS_INLINE_FUNCTION + void compute_angular_sbo(int, int, int, int) const; + + // Abstraction for counting and populating angular intermediates + template + KOKKOS_INLINE_FUNCTION + int preprocess_angular(int, int, int, int, int) const; + + // Abstraction for counting and populating torsion intermediated + template + KOKKOS_INLINE_FUNCTION + int preprocess_torsion(int, int, int, F_FLOAT, F_FLOAT, F_FLOAT, int, int, int) const; template KOKKOS_INLINE_FUNCTION - void operator()(TagPairReaxComputeAngular, const int&) const; - - KOKKOS_INLINE_FUNCTION - void operator()(TagPairReaxComputeTorsionPreview, const int&) const; + void operator()(TagPairReaxComputeAngularPreprocessed, const int&, EV_FLOAT_REAX&) const; template KOKKOS_INLINE_FUNCTION - void operator()(TagPairReaxComputeTorsion, const int&, EV_FLOAT_REAX&) const; + void operator()(TagPairReaxComputeAngularPreprocessed, const int&) const; template KOKKOS_INLINE_FUNCTION - void operator()(TagPairReaxComputeTorsion, const int&) const; + void operator()(TagPairReaxComputeTorsionPreprocessed, const int&, EV_FLOAT_REAX&) const; + + template + KOKKOS_INLINE_FUNCTION + void operator()(TagPairReaxComputeTorsionPreprocessed, const int&) const; template KOKKOS_INLINE_FUNCTION @@ -395,9 +429,8 @@ class PairReaxFFKokkos : public PairReaxFF { typename AT::t_float_1d d_bo_rij, d_hb_rsq, d_Deltap, d_Deltap_boc, d_total_bo, d_s; typename AT::t_float_1d d_Delta, d_Delta_boc, d_Delta_lp, d_dDelta_lp, d_Delta_lp_temp, d_CdDelta; - typename AT::t_ffloat_2d_dl d_BO, d_BO_s, d_BO_pi, d_BO_pi2, d_dBOp; - typename AT::t_ffloat_2d_dl d_dln_BOp_pix, d_dln_BOp_piy, d_dln_BOp_piz; - typename AT::t_ffloat_2d_dl d_dln_BOp_pi2x, d_dln_BOp_pi2y, d_dln_BOp_pi2z; + typename AT::t_ffloat_2d_dl d_BO, d_BO_s, d_BO_pi, d_BO_pi2; + typename AT::t_ffloat_2d_dl d_dln_BOp_pi, d_dln_BOp_pi2; typename AT::t_ffloat_2d_dl d_C1dbo, d_C2dbo, d_C3dbo; typename AT::t_ffloat_2d_dl d_C1dbopi, d_C2dbopi, d_C3dbopi, d_C4dbopi; typename AT::t_ffloat_2d_dl d_C1dbopi2, d_C2dbopi2, d_C3dbopi2, d_C4dbopi2; @@ -447,7 +480,7 @@ class PairReaxFFKokkos : public PairReaxFF { typename AT::t_int_scalar d_resize_bo, d_resize_hb; typename AT::t_ffloat_2d_dl d_sum_ovun; - typename AT::t_ffloat_2d_dl d_dBOpx, d_dBOpy, d_dBOpz; + typename AT::t_ffloat_2d_dl d_dBOp; int neighflag, newton_pair, maxnumneigh, maxhb, maxbo; int nlocal,nn,NN,eflag,vflag,acks2_flag; @@ -480,15 +513,15 @@ class PairReaxFFKokkos : public PairReaxFF { typename AT::t_ffloat_1d d_buf; DAT::tdual_int_scalar k_nbuf_local; - // for fast ComputeTorsion preprocessor kernel - typedef Kokkos::View t_hostpinned_int_1d; + typedef Kokkos::View t_reax_int4_2d; + + t_reax_int4_2d d_angular_pack, d_torsion_pack; + + typename AT::t_ffloat_2d d_angular_intermediates; + + typename AT::tdual_int_1d k_count_angular_torsion; + typename AT::t_int_1d d_count_angular_torsion; - int inum_store; - t_hostpinned_int_1d counters; - t_hostpinned_int_1d counters_jj_min; - t_hostpinned_int_1d counters_jj_max; - t_hostpinned_int_1d counters_kk_min; - t_hostpinned_int_1d counters_kk_max; }; template diff --git a/src/KOKKOS/pair_snap_kokkos_impl.h b/src/KOKKOS/pair_snap_kokkos_impl.h index 957ae953a7..6cf40b31a5 100644 --- a/src/KOKKOS/pair_snap_kokkos_impl.h +++ b/src/KOKKOS/pair_snap_kokkos_impl.h @@ -102,13 +102,15 @@ void PairSNAPKokkos::init_style() if (force->newton_pair == 0) error->all(FLERR,"Pair style SNAP requires newton pair on"); - // adjust neighbor list request for KOKKOS + // neighbor list request for KOKKOS + + neighflag = lmp->kokkos->neighflag; auto request = neighbor->add_request(this, NeighConst::REQ_FULL); request->set_kokkos_host(std::is_same::value && !std::is_same::value); request->set_kokkos_device(std::is_same::value); - if (lmp->kokkos->neighflag == FULL) + if (neighflag == FULL) error->all(FLERR,"Must use half neighbor list style with pair snap/kk"); } diff --git a/src/KOKKOS/pair_sw_kokkos.cpp b/src/KOKKOS/pair_sw_kokkos.cpp index f2d2058504..cae0aea0e8 100644 --- a/src/KOKKOS/pair_sw_kokkos.cpp +++ b/src/KOKKOS/pair_sw_kokkos.cpp @@ -78,8 +78,6 @@ void PairSWKokkos::compute(int eflag_in, int vflag_in) eflag = eflag_in; vflag = vflag_in; - if (neighflag == FULL) no_virial_fdotr_compute = 1; - ev_init(eflag,vflag,0); // reallocate per-atom arrays if necessary @@ -134,39 +132,27 @@ void PairSWKokkos::compute(int eflag_in, int vflag_in) int max_neighs = d_neighbors.extent(1); - if (((int) d_neighbors_short.extent(1) != max_neighs) || - ((int) d_neighbors_short.extent(0) != ignum)) { - d_neighbors_short = Kokkos::View("SW::neighbors_short",ignum,max_neighs); + if (((int) d_neighbors_short.extent(1) < max_neighs) || + ((int) d_neighbors_short.extent(0) < ignum)) { + d_neighbors_short = Kokkos::View("SW::neighbors_short",ignum*1.2,max_neighs); } - if ((int)d_numneigh_short.extent(0)!=ignum) - d_numneigh_short = Kokkos::View("SW::numneighs_short",ignum); - Kokkos::parallel_for(Kokkos::RangePolicy(0,neighflag==FULL?ignum:inum), *this); + if ((int)d_numneigh_short.extent(0) < ignum) + d_numneigh_short = Kokkos::View("SW::numneighs_short",ignum*1.2); + Kokkos::parallel_for(Kokkos::RangePolicy(0,inum), *this); // loop over neighbor list of my atoms if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } else if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - ev_all += ev; - } else if (neighflag == FULL) { - if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - ev_all += ev; - - if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,ignum),*this,ev); - else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,ignum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } @@ -216,6 +202,7 @@ template KOKKOS_INLINE_FUNCTION void PairSWKokkos::operator()(TagPairSWComputeShortNeigh, const int& ii) const { const int i = d_ilist[ii]; + const int itype = d_map[type[i]]; const X_FLOAT xtmp = x(i,0); const X_FLOAT ytmp = x(i,1); const X_FLOAT ztmp = x(i,2); @@ -225,18 +212,20 @@ void PairSWKokkos::operator()(TagPairSWComputeShortNeigh, const int& for (int jj = 0; jj < jnum; jj++) { int j = d_neighbors(i,jj); j &= NEIGHMASK; + const int jtype = d_map[type[j]]; const X_FLOAT delx = xtmp - x(j,0); const X_FLOAT dely = ytmp - x(j,1); const X_FLOAT delz = ztmp - x(j,2); const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; - if (rsq < cutmax*cutmax) { - d_neighbors_short(i,inside) = j; + const int ijparam = d_elem3param(itype,jtype,jtype); + if (rsq < d_params[ijparam].cutsq) { + d_neighbors_short(ii,inside) = j; inside++; } } - d_numneigh_short(i) = inside; + d_numneigh_short(ii) = inside; } /* ---------------------------------------------------------------------- */ @@ -244,7 +233,7 @@ void PairSWKokkos::operator()(TagPairSWComputeShortNeigh, const int& template template KOKKOS_INLINE_FUNCTION -void PairSWKokkos::operator()(TagPairSWComputeHalf, const int &ii, EV_FLOAT& ev) const { +void PairSWKokkos::operator()(TagPairSWCompute, const int &ii, EV_FLOAT& ev) const { // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial @@ -264,15 +253,14 @@ void PairSWKokkos::operator()(TagPairSWComputeHalf // two-body interactions, skip half of them - const int jnum = d_numneigh_short[i]; + const int jnum = d_numneigh_short[ii]; F_FLOAT fxtmpi = 0.0; F_FLOAT fytmpi = 0.0; F_FLOAT fztmpi = 0.0; for (int jj = 0; jj < jnum; jj++) { - int j = d_neighbors_short(i,jj); - j &= NEIGHMASK; + int j = d_neighbors_short(ii,jj); const tagint jtag = tag[j]; if (itag > jtag) { @@ -293,7 +281,6 @@ void PairSWKokkos::operator()(TagPairSWComputeHalf const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; const int ijparam = d_elem3param(itype,jtype,jtype); - if (rsq >= d_params[ijparam].cutsq) continue; twobody(d_params[ijparam],rsq,fpair,eflag,evdwl); @@ -313,23 +300,20 @@ void PairSWKokkos::operator()(TagPairSWComputeHalf const int jnumm1 = jnum - 1; for (int jj = 0; jj < jnumm1; jj++) { - int j = d_neighbors_short(i,jj); - j &= NEIGHMASK; + int j = d_neighbors_short(ii,jj); const int jtype = d_map[type[j]]; const int ijparam = d_elem3param(itype,jtype,jtype); delr1[0] = x(j,0) - xtmp; delr1[1] = x(j,1) - ytmp; delr1[2] = x(j,2) - ztmp; const F_FLOAT rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2]; - if (rsq1 >= d_params[ijparam].cutsq) continue; F_FLOAT fxtmpj = 0.0; F_FLOAT fytmpj = 0.0; F_FLOAT fztmpj = 0.0; for (int kk = jj+1; kk < jnum; kk++) { - int k = d_neighbors_short(i,kk); - k &= NEIGHMASK; + int k = d_neighbors_short(ii,kk); const int ktype = d_map[type[k]]; const int ikparam = d_elem3param(itype,ktype,ktype); const int ijkparam = d_elem3param(itype,jtype,ktype); @@ -339,8 +323,6 @@ void PairSWKokkos::operator()(TagPairSWComputeHalf delr2[2] = x(k,2) - ztmp; const F_FLOAT rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2]; - if (rsq2 >= d_params[ikparam].cutsq) continue; - threebody_kk(d_params[ijparam],d_params[ikparam],d_params[ijkparam], rsq1,rsq2,delr1,delr2,fj,fk,eflag,evdwl); @@ -373,203 +355,9 @@ void PairSWKokkos::operator()(TagPairSWComputeHalf template template KOKKOS_INLINE_FUNCTION -void PairSWKokkos::operator()(TagPairSWComputeHalf, const int &ii) const { +void PairSWKokkos::operator()(TagPairSWCompute, const int &ii) const { EV_FLOAT ev; - this->template operator()(TagPairSWComputeHalf(), ii, ev); -} - -/* ---------------------------------------------------------------------- */ - -template -template -KOKKOS_INLINE_FUNCTION -void PairSWKokkos::operator()(TagPairSWComputeFullA, const int &ii, EV_FLOAT& ev) const { - - F_FLOAT delr1[3],delr2[3],fj[3],fk[3]; - F_FLOAT evdwl = 0.0; - F_FLOAT fpair = 0.0; - - const int i = d_ilist[ii]; - - const int itype = d_map[type[i]]; - const X_FLOAT xtmp = x(i,0); - const X_FLOAT ytmp = x(i,1); - const X_FLOAT ztmp = x(i,2); - - // two-body interactions - - const int jnum = d_numneigh_short[i]; - - F_FLOAT fxtmpi = 0.0; - F_FLOAT fytmpi = 0.0; - F_FLOAT fztmpi = 0.0; - - for (int jj = 0; jj < jnum; jj++) { - int j = d_neighbors_short(i,jj); - j &= NEIGHMASK; - - const int jtype = d_map[type[j]]; - - const X_FLOAT delx = xtmp - x(j,0); - const X_FLOAT dely = ytmp - x(j,1); - const X_FLOAT delz = ztmp - x(j,2); - const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; - - const int ijparam = d_elem3param(itype,jtype,jtype); - - if (rsq >= d_params[ijparam].cutsq) continue; - - twobody(d_params[ijparam],rsq,fpair,eflag,evdwl); - - fxtmpi += delx*fpair; - fytmpi += dely*fpair; - fztmpi += delz*fpair; - - if (EVFLAG) { - if (eflag) ev.evdwl += 0.5*evdwl; - if (vflag_either || eflag_atom) this->template ev_tally(ev,i,j,evdwl,fpair,delx,dely,delz); - } - } - - const int jnumm1 = jnum - 1; - - for (int jj = 0; jj < jnumm1; jj++) { - int j = d_neighbors_short(i,jj); - j &= NEIGHMASK; - const int jtype = d_map[type[j]]; - const int ijparam = d_elem3param(itype,jtype,jtype); - delr1[0] = x(j,0) - xtmp; - delr1[1] = x(j,1) - ytmp; - delr1[2] = x(j,2) - ztmp; - const F_FLOAT rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2]; - - if (rsq1 >= d_params[ijparam].cutsq) continue; - - for (int kk = jj+1; kk < jnum; kk++) { - int k = d_neighbors_short(i,kk); - k &= NEIGHMASK; - const int ktype = d_map[type[k]]; - const int ikparam = d_elem3param(itype,ktype,ktype); - const int ijkparam = d_elem3param(itype,jtype,ktype); - - delr2[0] = x(k,0) - xtmp; - delr2[1] = x(k,1) - ytmp; - delr2[2] = x(k,2) - ztmp; - const F_FLOAT rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2]; - - if (rsq2 >= d_params[ikparam].cutsq) continue; - - threebody_kk(d_params[ijparam],d_params[ikparam],d_params[ijkparam], - rsq1,rsq2,delr1,delr2,fj,fk,eflag,evdwl); - - fxtmpi -= fj[0] + fk[0]; - fytmpi -= fj[1] + fk[1]; - fztmpi -= fj[2] + fk[2]; - - if (EVFLAG) { - if (eflag) ev.evdwl += evdwl; - if (vflag_either || eflag_atom) this->template ev_tally3(ev,i,j,k,evdwl,0.0,fj,fk,delr1,delr2); - } - } - } - - f(i,0) += fxtmpi; - f(i,1) += fytmpi; - f(i,2) += fztmpi; -} - -template -template -KOKKOS_INLINE_FUNCTION -void PairSWKokkos::operator()(TagPairSWComputeFullA, const int &ii) const { - EV_FLOAT ev; - this->template operator()(TagPairSWComputeFullA(), ii, ev); -} - -/* ---------------------------------------------------------------------- */ - -template -template -KOKKOS_INLINE_FUNCTION -void PairSWKokkos::operator()(TagPairSWComputeFullB, const int &ii, EV_FLOAT& ev) const { - - F_FLOAT delr1[3],delr2[3],fj[3],fk[3]; - F_FLOAT evdwl = 0.0; - - const int i = d_ilist[ii]; - - const int itype = d_map[type[i]]; - const X_FLOAT xtmpi = x(i,0); - const X_FLOAT ytmpi = x(i,1); - const X_FLOAT ztmpi = x(i,2); - - const int jnum = d_numneigh_short[i]; - - F_FLOAT fxtmpi = 0.0; - F_FLOAT fytmpi = 0.0; - F_FLOAT fztmpi = 0.0; - - for (int jj = 0; jj < jnum; jj++) { - int j = d_neighbors_short(i,jj); - j &= NEIGHMASK; - if (j >= nlocal) continue; - const int jtype = d_map[type[j]]; - const int jiparam = d_elem3param(jtype,itype,itype); - const X_FLOAT xtmpj = x(j,0); - const X_FLOAT ytmpj = x(j,1); - const X_FLOAT ztmpj = x(j,2); - - delr1[0] = xtmpi - xtmpj; - delr1[1] = ytmpi - ytmpj; - delr1[2] = ztmpi - ztmpj; - const F_FLOAT rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2]; - - if (rsq1 >= d_params[jiparam].cutsq) continue; - - const int j_jnum = d_numneigh_short[j]; - - for (int kk = 0; kk < j_jnum; kk++) { - int k = d_neighbors_short(j,kk); - k &= NEIGHMASK; - if (k == i) continue; - const int ktype = d_map[type[k]]; - const int jkparam = d_elem3param(jtype,ktype,ktype); - const int jikparam = d_elem3param(jtype,itype,ktype); - - delr2[0] = x(k,0) - xtmpj; - delr2[1] = x(k,1) - ytmpj; - delr2[2] = x(k,2) - ztmpj; - const F_FLOAT rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2]; - - if (rsq2 >= d_params[jkparam].cutsq) continue; - - if (vflag_atom) - threebody_kk(d_params[jiparam],d_params[jkparam],d_params[jikparam], - rsq1,rsq2,delr1,delr2,fj,fk,eflag,evdwl); - else - threebodyj(d_params[jiparam],d_params[jkparam],d_params[jikparam], - rsq1,rsq2,delr1,delr2,fj); - - fxtmpi += fj[0]; - fytmpi += fj[1]; - fztmpi += fj[2]; - - if (EVFLAG) - if (vflag_atom || eflag_atom) ev_tally3_atom(ev,i,evdwl,0.0,fj,fk,delr1,delr2); - } - } - - f(i,0) += fxtmpi; - f(i,1) += fytmpi; - f(i,2) += fztmpi; -} - -template -template -KOKKOS_INLINE_FUNCTION -void PairSWKokkos::operator()(TagPairSWComputeFullB, const int &ii) const { - EV_FLOAT ev; - this->template operator()(TagPairSWComputeFullB(), ii, ev); + this->template operator()(TagPairSWCompute(), ii, ev); } /* ---------------------------------------------------------------------- @@ -613,9 +401,9 @@ void PairSWKokkos::init_style() request->set_kokkos_host(std::is_same::value && !std::is_same::value); request->set_kokkos_device(std::is_same::value); - // always request a full neighbor list - request->enable_full(); - if (neighflag == FULL) request->enable_ghost(); + + if (neighflag == FULL) + error->all(FLERR,"Must use half neighbor list style with pair sw/kk"); } /* ---------------------------------------------------------------------- */ @@ -732,52 +520,6 @@ void PairSWKokkos::threebody_kk(const Param& paramij, const Param& p /* ---------------------------------------------------------------------- */ -template -KOKKOS_INLINE_FUNCTION -void PairSWKokkos::threebodyj(const Param& paramij, const Param& paramik, const Param& paramijk, - const F_FLOAT& rsq1, const F_FLOAT& rsq2, F_FLOAT *delr1, F_FLOAT *delr2, F_FLOAT *fj) const -{ - F_FLOAT r1,rinvsq1,rainv1,gsrainv1,gsrainvsq1,expgsrainv1; - F_FLOAT r2, rainv2, gsrainv2, expgsrainv2; - F_FLOAT rinv12,cs,delcs,delcssq,facexp,facrad,frad1; - F_FLOAT facang,facang12,csfacang,csfac1; - - r1 = sqrt(rsq1); - rinvsq1 = 1.0/rsq1; - rainv1 = 1.0/(r1 - paramij.cut); - gsrainv1 = paramij.sigma_gamma * rainv1; - gsrainvsq1 = gsrainv1*rainv1/r1; - expgsrainv1 = exp(gsrainv1); - - r2 = sqrt(rsq2); - rainv2 = 1.0/(r2 - paramik.cut); - gsrainv2 = paramik.sigma_gamma * rainv2; - expgsrainv2 = exp(gsrainv2); - - rinv12 = 1.0/(r1*r2); - cs = (delr1[0]*delr2[0] + delr1[1]*delr2[1] + delr1[2]*delr2[2]) * rinv12; - delcs = cs - paramijk.costheta; - delcssq = delcs*delcs; - - facexp = expgsrainv1*expgsrainv2; - - // facrad = sqrt(paramij.lambda_epsilon*paramik.lambda_epsilon) * - // facexp*delcssq; - - facrad = paramijk.lambda_epsilon * facexp*delcssq; - frad1 = facrad*gsrainvsq1; - facang = paramijk.lambda_epsilon2 * facexp*delcs; - facang12 = rinv12*facang; - csfacang = cs*facang; - csfac1 = rinvsq1*csfacang; - - fj[0] = delr1[0]*(frad1+csfac1)-delr2[0]*facang12; - fj[1] = delr1[1]*(frad1+csfac1)-delr2[1]*facang12; - fj[2] = delr1[2]*(frad1+csfac1)-delr2[2]*facang12; -} - -/* ---------------------------------------------------------------------- */ - template template KOKKOS_INLINE_FUNCTION @@ -785,7 +527,6 @@ void PairSWKokkos::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 int VFLAG = vflag_either; // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial @@ -798,11 +539,10 @@ void PairSWKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; a_eatom[i] += epairhalf; - if (NEIGHFLAG != FULL) - a_eatom[j] += epairhalf; + a_eatom[j] += epairhalf; } - if (VFLAG) { + if (vflag_either) { const E_FLOAT v0 = delx*delx*fpair; const E_FLOAT v1 = dely*dely*fpair; const E_FLOAT v2 = delz*delz*fpair; @@ -811,21 +551,12 @@ void PairSWKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j const E_FLOAT v5 = dely*delz*fpair; if (vflag_global) { - if (NEIGHFLAG != FULL) { - ev.v[0] += v0; - ev.v[1] += v1; - ev.v[2] += v2; - ev.v[3] += v3; - ev.v[4] += v4; - ev.v[5] += v5; - } else { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } + ev.v[0] += v0; + ev.v[1] += v1; + ev.v[2] += v2; + ev.v[3] += v3; + ev.v[4] += v4; + ev.v[5] += v5; } if (vflag_atom) { @@ -836,14 +567,12 @@ void PairSWKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j a_vatom(i,4) += 0.5*v4; a_vatom(i,5) += 0.5*v5; - if (NEIGHFLAG != FULL) { - a_vatom(j,0) += 0.5*v0; - a_vatom(j,1) += 0.5*v1; - a_vatom(j,2) += 0.5*v2; - a_vatom(j,3) += 0.5*v3; - a_vatom(j,4) += 0.5*v4; - a_vatom(j,5) += 0.5*v5; - } + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; } } } @@ -863,8 +592,6 @@ void PairSWKokkos::ev_tally3(EV_FLOAT &ev, const int &i, const int & { F_FLOAT epairthird,v[6]; - const int VFLAG = vflag_either; - // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); @@ -876,13 +603,11 @@ void PairSWKokkos::ev_tally3(EV_FLOAT &ev, const int &i, const int & if (eflag_atom) { epairthird = THIRD * (evdwl + ecoul); a_eatom[i] += epairthird; - if (NEIGHFLAG != FULL) { - a_eatom[j] += epairthird; - a_eatom[k] += epairthird; - } + a_eatom[j] += epairthird; + a_eatom[k] += epairthird; } - if (VFLAG) { + if (vflag_either) { v[0] = drji[0]*fj[0] + drki[0]*fk[0]; v[1] = drji[1]*fj[1] + drki[1]*fk[1]; v[2] = drji[2]*fj[2] + drki[2]*fk[2]; @@ -904,15 +629,13 @@ void PairSWKokkos::ev_tally3(EV_FLOAT &ev, const int &i, const int & a_vatom(i,2) += THIRD*v[2]; a_vatom(i,3) += THIRD*v[3]; a_vatom(i,4) += THIRD*v[4]; a_vatom(i,5) += THIRD*v[5]; - if (NEIGHFLAG != FULL) { - a_vatom(j,0) += THIRD*v[0]; a_vatom(j,1) += THIRD*v[1]; - a_vatom(j,2) += THIRD*v[2]; a_vatom(j,3) += THIRD*v[3]; - a_vatom(j,4) += THIRD*v[4]; a_vatom(j,5) += THIRD*v[5]; + a_vatom(j,0) += THIRD*v[0]; a_vatom(j,1) += THIRD*v[1]; + a_vatom(j,2) += THIRD*v[2]; a_vatom(j,3) += THIRD*v[3]; + a_vatom(j,4) += THIRD*v[4]; a_vatom(j,5) += THIRD*v[5]; - a_vatom(k,0) += THIRD*v[0]; a_vatom(k,1) += THIRD*v[1]; - a_vatom(k,2) += THIRD*v[2]; a_vatom(k,3) += THIRD*v[3]; - a_vatom(k,4) += THIRD*v[4]; a_vatom(k,5) += THIRD*v[5]; - } + a_vatom(k,0) += THIRD*v[0]; a_vatom(k,1) += THIRD*v[1]; + a_vatom(k,2) += THIRD*v[2]; a_vatom(k,3) += THIRD*v[3]; + a_vatom(k,4) += THIRD*v[4]; a_vatom(k,5) += THIRD*v[5]; } } } @@ -931,14 +654,12 @@ void PairSWKokkos::ev_tally3_atom(EV_FLOAT & /*ev*/, const int &i, { F_FLOAT epairthird,v[6]; - const int VFLAG = vflag_either; - if (eflag_atom) { epairthird = THIRD * (evdwl + ecoul); d_eatom[i] += epairthird; } - if (VFLAG) { + if (vflag_either) { v[0] = drji[0]*fj[0] + drki[0]*fk[0]; v[1] = drji[1]*fj[1] + drki[1]*fk[1]; v[2] = drji[2]*fj[2] + drki[2]*fk[2]; diff --git a/src/KOKKOS/pair_sw_kokkos.h b/src/KOKKOS/pair_sw_kokkos.h index 1259ddf71e..2099e98ed0 100644 --- a/src/KOKKOS/pair_sw_kokkos.h +++ b/src/KOKKOS/pair_sw_kokkos.h @@ -27,13 +27,7 @@ PairStyle(sw/kk/host,PairSWKokkos); #include "pair_kokkos.h" template -struct TagPairSWComputeHalf{}; - -template -struct TagPairSWComputeFullA{}; - -template -struct TagPairSWComputeFullB{}; +struct TagPairSWCompute{}; struct TagPairSWComputeShortNeigh{}; @@ -42,7 +36,7 @@ namespace LAMMPS_NS { template class PairSWKokkos : public PairSW { public: - enum {EnabledNeighFlags=FULL}; + enum {EnabledNeighFlags=HALF|HALFTHREAD}; enum {COUL_FLAG=0}; typedef DeviceType device_type; typedef ArrayTypes AT; @@ -56,27 +50,11 @@ class PairSWKokkos : public PairSW { template KOKKOS_INLINE_FUNCTION - void operator()(TagPairSWComputeHalf, const int&, EV_FLOAT&) const; + void operator()(TagPairSWCompute, const int&, EV_FLOAT&) const; template KOKKOS_INLINE_FUNCTION - void operator()(TagPairSWComputeHalf, const int&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairSWComputeFullA, const int&, EV_FLOAT&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairSWComputeFullA, const int&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairSWComputeFullB, const int&, EV_FLOAT&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairSWComputeFullB, const int&) const; + void operator()(TagPairSWCompute, const int&) const; KOKKOS_INLINE_FUNCTION void operator()(TagPairSWComputeShortNeigh, const int&) const; @@ -121,10 +99,6 @@ class PairSWKokkos : public PairSW { void threebody_kk(const Param&, const Param&, const Param&, const F_FLOAT&, const F_FLOAT&, F_FLOAT *, F_FLOAT *, F_FLOAT *, F_FLOAT *, const int&, F_FLOAT&) const; - KOKKOS_INLINE_FUNCTION - void threebodyj(const Param&, const Param&, const Param&, const F_FLOAT&, const F_FLOAT&, F_FLOAT *, F_FLOAT *, - F_FLOAT *) const; - typename AT::t_x_array_randomread x; typename AT::t_f_array f; typename AT::t_tagint_1d tag; @@ -180,7 +154,7 @@ class PairSWKokkos : public PairSW { /* ERROR/WARNING messages: -E: Cannot use chosen neighbor list style with pair sw/kk +E: Must use half neighbor list style with pair sw/kk Self-explanatory. diff --git a/src/KOKKOS/pair_tersoff_kokkos.cpp b/src/KOKKOS/pair_tersoff_kokkos.cpp index 1bab686926..ce84496b95 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_kokkos.cpp @@ -19,7 +19,7 @@ - Reduced math overhead: enabled specialized calls (e.g., cbrt for a cube root instead of pow) and use power/exponential laws to reduce the number of exponentials evaluated, etc. - - Fused the jj loop in TagPairTersoffComputeHalf between the repulsive + - Fused the jj loop in TagPairTersoffCompute between the repulsive and attractive iterations - Merged "ters_fc_k" with "ters_dfc", "ters_bij_k" with "ters_dbij", "ters_gijk" with "ters_dgijk", and "ters_fa_k" with "ters_dfa" @@ -75,18 +75,29 @@ PairTersoffKokkos::~PairTersoffKokkos() } } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + set coeffs for one or more type pairs +------------------------------------------------------------------------- */ template -void PairTersoffKokkos::allocate() +void PairTersoffKokkos::coeff(int narg, char **arg) { - PairTersoff::allocate(); + PairTersoff::coeff(narg,arg); + + // sync map int n = atom->ntypes; - k_params = Kokkos::DualView - ("PairTersoff::paramskk",n+1,n+1,n+1); - paramskk = k_params.template view(); + DAT::tdual_int_1d k_map = DAT::tdual_int_1d("pair:map",n+1); + HAT::t_int_1d h_map = k_map.h_view; + + for (int i = 1; i <= n; i++) + h_map[i] = map[i]; + + k_map.template modify(); + k_map.template sync(); + + d_map = k_map.template view(); } /* ---------------------------------------------------------------------- @@ -105,9 +116,9 @@ void PairTersoffKokkos::init_style() request->set_kokkos_host(std::is_same::value && !std::is_same::value); request->set_kokkos_device(std::is_same::value); - request->enable_full(); + if (neighflag == FULL) - error->all(FLERR,"Cannot (yet) use full neighbor list style with tersoff/kk"); + error->all(FLERR,"Must use half neighbor list style with pair tersoff/kk"); } /* ---------------------------------------------------------------------- */ @@ -117,35 +128,29 @@ void PairTersoffKokkos::setup_params() { PairTersoff::setup_params(); - int i,j,k,m; - int n = atom->ntypes; + // sync elem3param and params - for (i = 1; i <= n; i++) - for (j = 1; j <= n; j++) - for (k = 1; k <= n; k++) { - m = elem3param[map[i]][map[j]][map[k]]; - k_params.h_view(i,j,k).powerm = params[m].powerm; - k_params.h_view(i,j,k).gamma = params[m].gamma; - k_params.h_view(i,j,k).lam3 = params[m].lam3; - k_params.h_view(i,j,k).c = params[m].c; - k_params.h_view(i,j,k).d = params[m].d; - k_params.h_view(i,j,k).h = params[m].h; - k_params.h_view(i,j,k).powern = params[m].powern; - k_params.h_view(i,j,k).beta = params[m].beta; - k_params.h_view(i,j,k).lam2 = params[m].lam2; - k_params.h_view(i,j,k).bigb = params[m].bigb; - k_params.h_view(i,j,k).bigr = params[m].bigr; - k_params.h_view(i,j,k).bigd = params[m].bigd; - k_params.h_view(i,j,k).lam1 = params[m].lam1; - k_params.h_view(i,j,k).biga = params[m].biga; - k_params.h_view(i,j,k).cutsq = params[m].cutsq; - k_params.h_view(i,j,k).c1 = params[m].c1; - k_params.h_view(i,j,k).c2 = params[m].c2; - k_params.h_view(i,j,k).c3 = params[m].c3; - k_params.h_view(i,j,k).c4 = params[m].c4; - } + tdual_int_3d k_elem3param = tdual_int_3d("pair:elem3param",nelements,nelements,nelements); + t_host_int_3d h_elem3param = k_elem3param.h_view; - k_params.template modify(); + tdual_param_1d k_params = tdual_param_1d("pair:params",nparams); + t_host_param_1d h_params = k_params.h_view; + + for (int i = 0; i < nelements; i++) + for (int j = 0; j < nelements; j++) + for (int k = 0; k < nelements; k++) + h_elem3param(i,j,k) = elem3param[i][j][k]; + + for (int m = 0; m < nparams; m++) + h_params[m] = params[m]; + + k_elem3param.modify_host(); + k_elem3param.template sync(); + k_params.modify_host(); + k_params.template sync(); + + d_elem3param = k_elem3param.template view(); + d_params = k_params.template view(); } /* ---------------------------------------------------------------------- */ @@ -156,8 +161,6 @@ void PairTersoffKokkos::compute(int eflag_in, int vflag_in) eflag = eflag_in; vflag = vflag_in; - if (neighflag == FULL) no_virial_fdotr_compute = 1; - ev_init(eflag,vflag,0); // reallocate per-atom arrays if necessary @@ -174,7 +177,6 @@ void PairTersoffKokkos::compute(int eflag_in, int vflag_in) } atomKK->sync(execution_space,datamask_read); - k_params.template sync(); if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); else atomKK->modified(execution_space,F_MASK); @@ -213,37 +215,25 @@ void PairTersoffKokkos::compute(int eflag_in, int vflag_in) int max_neighs = d_neighbors.extent(1); - if (((int)d_neighbors_short.extent(1) != max_neighs) || - ((int)d_neighbors_short.extent(0) != ignum)) { - d_neighbors_short = Kokkos::View("Tersoff::neighbors_short",ignum,max_neighs); + if (((int)d_neighbors_short.extent(1) < max_neighs) || + ((int)d_neighbors_short.extent(0) < ignum)) { + d_neighbors_short = Kokkos::View("Tersoff::neighbors_short",ignum*1.2,max_neighs); } - if ((int)d_numneigh_short.extent(0)!=ignum) - d_numneigh_short = Kokkos::View("Tersoff::numneighs_short",ignum); - Kokkos::parallel_for(Kokkos::RangePolicy(0,neighflag==FULL?ignum:inum), *this); + if ((int)d_numneigh_short.extent(0) < ignum) + d_numneigh_short = Kokkos::View("Tersoff::numneighs_short",ignum*1.2); + Kokkos::parallel_for(Kokkos::RangePolicy(0,inum), *this); if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } else if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - ev_all += ev; - } else if (neighflag == FULL) { - if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - ev_all += ev; - - if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,ignum),*this,ev); - else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,ignum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } @@ -309,11 +299,11 @@ void PairTersoffKokkos::operator()(TagPairTersoffComputeShortNeigh, const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq < cutmax_sq) { - d_neighbors_short(i,inside) = j; + d_neighbors_short(ii,inside) = j; inside++; } } - d_numneigh_short(i) = inside; + d_numneigh_short(ii) = inside; } /* ---------------------------------------------------------------------- */ @@ -321,7 +311,7 @@ void PairTersoffKokkos::operator()(TagPairTersoffComputeShortNeigh, template template KOKKOS_INLINE_FUNCTION -void PairTersoffKokkos::operator()(TagPairTersoffComputeHalf, const int &ii, EV_FLOAT& ev) const { +void PairTersoffKokkos::operator()(TagPairTersoffCompute, const int &ii, EV_FLOAT& ev) const { // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial @@ -333,13 +323,13 @@ void PairTersoffKokkos::operator()(TagPairTersoffComputeHalf::operator()(TagPairTersoffComputeHalf cutsq1) continue; @@ -366,26 +356,26 @@ void PairTersoffKokkos::operator()(TagPairTersoffComputeHalf cutsq2) continue; const F_FLOAT rik = sqrt(rsq2); - bo_ij += bondorder(itype,jtype,ktype,rij,delx1,dely1,delz1,rik,delx2,dely2,delz2); + bo_ij += bondorder(d_params(iparam_ijk),rij,delx1,dely1,delz1,rik,delx2,dely2,delz2); } // attractive: pairwise potential and force F_FLOAT fa, dfa, bij, prefactor; - ters_fa_k_and_ters_dfa(itype,jtype,jtype,rij,fa,dfa); - ters_bij_k_and_ters_dbij(itype,jtype,jtype,bo_ij,bij,prefactor); + ters_fa_k_and_ters_dfa(d_params(iparam_ij),rij,fa,dfa); + ters_bij_k_and_ters_dbij(d_params(iparam_ij),bo_ij,bij,prefactor); const F_FLOAT fatt = -0.5*bij * dfa / rij; prefactor = 0.5*fa * prefactor; @@ -407,19 +397,19 @@ void PairTersoffKokkos::operator()(TagPairTersoffComputeHalf cutsq2) continue; const F_FLOAT rik = sqrt(rsq2); - ters_dthb(itype,jtype,ktype,prefactor,rij,delx1,dely1,delz1, + ters_dthb(d_params(iparam_ijk),prefactor,rij,delx1,dely1,delz1, rik,delx2,dely2,delz2,fi,fj,fk); f_x += fi[0]; @@ -456,12 +446,12 @@ void PairTersoffKokkos::operator()(TagPairTersoffComputeHalf::operator()(TagPairTersoffComputeHalf template KOKKOS_INLINE_FUNCTION -void PairTersoffKokkos::operator()(TagPairTersoffComputeHalf, const int &ii) const { +void PairTersoffKokkos::operator()(TagPairTersoffCompute, const int &ii) const { EV_FLOAT ev; - this->template operator()(TagPairTersoffComputeHalf(), ii, ev); -} - -/* ---------------------------------------------------------------------- */ - -template -template -KOKKOS_INLINE_FUNCTION -void PairTersoffKokkos::operator()(TagPairTersoffComputeFullA, const int &ii, EV_FLOAT& ev) const { - - const int i = d_ilist[ii]; - const X_FLOAT xtmp = x(i,0); - const X_FLOAT ytmp = x(i,1); - const X_FLOAT ztmp = x(i,2); - const int itype = type(i); - const tagint itag = tag(i); - - int j,k,jj,kk,jtype,ktype; - F_FLOAT rsq1, cutsq1, rsq2, cutsq2, rij, rik, bo_ij; - F_FLOAT fi[3], fj[3], fk[3]; - X_FLOAT delx1, dely1, delz1, delx2, dely2, delz2; - - //const AtomNeighborsConst d_neighbors_i = k_list.get_neighbors_const(i); - const int jnum = d_numneigh_short[i]; - - F_FLOAT f_x = 0.0; - F_FLOAT f_y = 0.0; - F_FLOAT f_z = 0.0; - - // attractive: bond order - - for (jj = 0; jj < jnum; jj++) { - j = d_neighbors_short(i,jj); - j &= NEIGHMASK; - jtype = type(j); - - delx1 = xtmp - x(j,0); - dely1 = ytmp - x(j,1); - delz1 = ztmp - x(j,2); - rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1; - cutsq1 = paramskk(itype,jtype,jtype).cutsq; - - bo_ij = 0.0; - if (rsq1 > cutsq1) continue; - rij = sqrt(rsq1); - - for (kk = 0; kk < jnum; kk++) { - if (jj == kk) continue; - k = d_neighbors_short(i,kk); - k &= NEIGHMASK; - ktype = type(k); - - delx2 = xtmp - x(k,0); - dely2 = ytmp - x(k,1); - delz2 = ztmp - x(k,2); - rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - cutsq2 = paramskk(itype,jtype,ktype).cutsq; - - if (rsq2 > cutsq2) continue; - rik = sqrt(rsq2); - bo_ij += bondorder(itype,jtype,ktype,rij,delx1,dely1,delz1,rik,delx2,dely2,delz2); - } - - // attractive: pairwise potential and force - - F_FLOAT fa, dfa, bij, prefactor; - ters_fa_k_and_ters_dfa(itype,jtype,jtype,rij,fa,dfa); - ters_bij_k_and_ters_dbij(itype,jtype,jtype, bo_ij, bij, prefactor); - const F_FLOAT fatt = -0.5*bij * dfa / rij; - prefactor = 0.5*fa * prefactor; - const F_FLOAT eng = 0.5*bij * fa; - - f_x += delx1*fatt; - f_y += dely1*fatt; - f_z += delz1*fatt; - - if (EVFLAG) { - if (eflag) ev.evdwl += 0.5*eng; - if (vflag_either || eflag_atom) - this->template ev_tally(ev,i,j,eng,fatt,delx1,dely1,delz1); - } - - // attractive: three-body force - - for (kk = 0; kk < jnum; kk++) { - if (jj == kk) continue; - k = d_neighbors_short(i,kk); - k &= NEIGHMASK; - ktype = type(k); - - delx2 = xtmp - x(k,0); - dely2 = ytmp - x(k,1); - delz2 = ztmp - x(k,2); - rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - cutsq2 = paramskk(itype,jtype,ktype).cutsq; - - if (rsq2 > cutsq2) continue; - rik = sqrt(rsq2); - ters_dthb(itype,jtype,ktype,prefactor,rij,delx1,dely1,delz1, - rik,delx2,dely2,delz2,fi,fj,fk); - - f_x += fi[0]; - f_y += fi[1]; - f_z += fi[2]; - - if (vflag_either) { - F_FLOAT delrij[3], delrik[3]; - delrij[0] = -delx1; delrij[1] = -dely1; delrij[2] = -delz1; - delrik[0] = -delx2; delrik[1] = -dely2; delrik[2] = -delz2; - if (vflag_either) this->template v_tally3(ev,i,j,k,fj,fk,delrij,delrik); - } - } - - // repulsive - - const tagint jtag = tag(j); - bool continue_flag = false; - - if (itag > jtag) { - if ((itag+jtag) % 2 == 0) continue_flag = true; - } else if (itag < jtag) { - if ((itag+jtag) % 2 == 1) continue_flag = true; - } else { - if (x(j,2) < ztmp) continue_flag = true; - else if (x(j,2) == ztmp && x(j,1) < ytmp) continue_flag = true; - else if (x(j,2) == ztmp && x(j,1) == ytmp && x(j,0) < xtmp) continue_flag = true; - } - if (!continue_flag) { - F_FLOAT tmp_fce, tmp_fcd; - ters_fc_k_and_ters_dfc(itype,jtype,jtype,rij,tmp_fce,tmp_fcd); - - const F_FLOAT tmp_exp = exp(-paramskk(itype,jtype,jtype).lam1 * rij); - const F_FLOAT frep = -paramskk(itype,jtype,jtype).biga * tmp_exp * - (tmp_fcd - tmp_fce*paramskk(itype,jtype,jtype).lam1) / rij; - const F_FLOAT eng = tmp_fce * paramskk(itype,jtype,jtype).biga * tmp_exp; - - f_x += delx1*frep; - f_y += dely1*frep; - f_z += delz1*frep; - - if (EVFLAG) { - if (eflag) ev.evdwl += 0.5 * eng; - if (vflag_either || eflag_atom) this->template ev_tally(ev,i,j,eng,frep,delx1,dely1,delz1); - } - } - } - f(i,0) += f_x; - f(i,1) += f_y; - f(i,2) += f_z; -} - -template -template -KOKKOS_INLINE_FUNCTION -void PairTersoffKokkos::operator()(TagPairTersoffComputeFullA, const int &ii) const { - EV_FLOAT ev; - this->template operator()(TagPairTersoffComputeFullA(), ii, ev); -} - -/* ---------------------------------------------------------------------- */ - -template -template -KOKKOS_INLINE_FUNCTION -void PairTersoffKokkos::operator()(TagPairTersoffComputeFullB, const int &ii, EV_FLOAT& ev) const { - - const int i = d_ilist[ii]; - const X_FLOAT xtmp = x(i,0); - const X_FLOAT ytmp = x(i,1); - const X_FLOAT ztmp = x(i,2); - const int itype = type(i); - - int j,k,jj,kk,jtype,ktype,j_jnum; - F_FLOAT rsq1, cutsq1, rsq2, cutsq2, rij, rik, bo_ij; - F_FLOAT fj[3], fk[3]; - X_FLOAT delx1, dely1, delz1, delx2, dely2, delz2; - - const int jnum = d_numneigh_short[i]; - - F_FLOAT f_x = 0.0; - F_FLOAT f_y = 0.0; - F_FLOAT f_z = 0.0; - - // attractive: bond order - - for (jj = 0; jj < jnum; jj++) { - j = d_neighbors_short(i,jj); - j &= NEIGHMASK; - if (j >= nlocal) continue; - jtype = type(j); - - delx1 = x(j,0) - xtmp; - dely1 = x(j,1) - ytmp; - delz1 = x(j,2) - ztmp; - rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1; - cutsq1 = paramskk(jtype,itype,itype).cutsq; - - bo_ij = 0.0; - if (rsq1 > cutsq1) continue; - rij = sqrt(rsq1); - - j_jnum = d_numneigh_short[j]; - - for (kk = 0; kk < j_jnum; kk++) { - k = d_neighbors_short(j,kk); - if (k == i) continue; - k &= NEIGHMASK; - ktype = type(k); - - delx2 = x(j,0) - x(k,0); - dely2 = x(j,1) - x(k,1); - delz2 = x(j,2) - x(k,2); - rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - cutsq2 = paramskk(jtype,itype,ktype).cutsq; - - if (rsq2 > cutsq2) continue; - rik = sqrt(rsq2); - bo_ij += bondorder(jtype,itype,ktype,rij,delx1,dely1,delz1,rik,delx2,dely2,delz2); - - } - - // attractive: pairwise potential and force - - F_FLOAT fa, dfa, bij, prefactor; - ters_fa_k_and_ters_dfa(itype,jtype,jtype,rij,fa,dfa); - ters_bij_k_and_ters_dbij(itype,jtype,jtype, bo_ij, bij, prefactor); - const F_FLOAT fatt = -0.5*bij * dfa / rij; - prefactor = 0.5*fa * prefactor; - const F_FLOAT eng = 0.5*bij * fa; - - f_x -= delx1*fatt; - f_y -= dely1*fatt; - f_z -= delz1*fatt; - - if (EVFLAG) { - if (eflag) - ev.evdwl += 0.5 * eng; - if (vflag_either || eflag_atom) - this->template ev_tally(ev,i,j,eng,fatt,delx1,dely1,delz1); - } - - // attractive: three-body force - - for (kk = 0; kk < j_jnum; kk++) { - k = d_neighbors_short(j,kk); - if (k == i) continue; - k &= NEIGHMASK; - ktype = type(k); - - delx2 = x(j,0) - x(k,0); - dely2 = x(j,1) - x(k,1); - delz2 = x(j,2) - x(k,2); - rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - cutsq2 = paramskk(jtype,itype,ktype).cutsq; - - if (rsq2 > cutsq2) continue; - rik = sqrt(rsq2); - ters_dthbj(jtype,itype,ktype,prefactor,rij,delx1,dely1,delz1, - rik,delx2,dely2,delz2,fj,fk); - f_x += fj[0]; - f_y += fj[1]; - f_z += fj[2]; - - if (vflag_either) { - F_FLOAT delrji[3], delrjk[3]; - delrji[0] = -delx1; delrji[1] = -dely1; delrji[2] = -delz1; - delrjk[0] = -delx2; delrjk[1] = -dely2; delrjk[2] = -delz2; - if (vflag_either) v_tally3_atom(ev,i,j,k,fj,fk,delrji,delrjk); - } - - const F_FLOAT fa_jk = ters_fa_k(jtype,ktype,itype,rik); - const F_FLOAT prefactor_jk = 0.5*fa_jk * ters_dbij(jtype,ktype,itype,bo_ij); - ters_dthbk(jtype,ktype,itype,prefactor_jk,rik,delx2,dely2,delz2, - rij,delx1,dely1,delz1,fk); - f_x += fk[0]; - f_y += fk[1]; - f_z += fk[2]; - } - } - f(i,0) += f_x; - f(i,1) += f_y; - f(i,2) += f_z; -} - -template -template -KOKKOS_INLINE_FUNCTION -void PairTersoffKokkos::operator()(TagPairTersoffComputeFullB, const int &ii) const { - EV_FLOAT ev; - this->template operator()(TagPairTersoffComputeFullB(), ii, ev); + this->template operator()(TagPairTersoffCompute(), ii, ev); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffKokkos::ters_fc_k(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffKokkos::ters_fc_k(const Param& param, const F_FLOAT &r) const { - const F_FLOAT ters_R = paramskk(i,j,k).bigr; - const F_FLOAT ters_D = paramskk(i,j,k).bigd; + const F_FLOAT ters_R = param.bigr; + const F_FLOAT ters_D = param.bigd; if (r < ters_R-ters_D) return 1.0; if (r > ters_R+ters_D) return 0.0; @@ -803,11 +503,10 @@ double PairTersoffKokkos::ters_fc_k(const int &i, const int &j, template KOKKOS_INLINE_FUNCTION -double PairTersoffKokkos::ters_dfc(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffKokkos::ters_dfc(const Param& param, const F_FLOAT &r) const { - const F_FLOAT ters_R = paramskk(i,j,k).bigr; - const F_FLOAT ters_D = paramskk(i,j,k).bigd; + const F_FLOAT ters_R = param.bigr; + const F_FLOAT ters_D = param.bigd; if (r < ters_R-ters_D) return 0.0; if (r > ters_R+ters_D) return 0.0; @@ -818,11 +517,10 @@ double PairTersoffKokkos::ters_dfc(const int &i, const int &j, template KOKKOS_INLINE_FUNCTION -void PairTersoffKokkos::ters_fc_k_and_ters_dfc(const int &i, const int &j, - const int &k, const F_FLOAT &r, double& fc, double& dfc) const +void PairTersoffKokkos::ters_fc_k_and_ters_dfc(const Param& param, const F_FLOAT &r, double& fc, double& dfc) const { - const F_FLOAT ters_R = paramskk(i,j,k).bigr; - const F_FLOAT ters_D = paramskk(i,j,k).bigd; + const F_FLOAT ters_R = param.bigr; + const F_FLOAT ters_D = param.bigd; if (r < ters_R-ters_D) { fc = 1.0; @@ -848,7 +546,7 @@ void PairTersoffKokkos::ters_fc_k_and_ters_dfc(const int &i, const i template KOKKOS_INLINE_FUNCTION -double PairTersoffKokkos::bondorder(const int &i, const int &j, const int &k, +double PairTersoffKokkos::bondorder(const Param& param, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2) const { @@ -856,15 +554,15 @@ double PairTersoffKokkos::bondorder(const int &i, const int &j, cons const F_FLOAT costheta = (dx1*dx2 + dy1*dy2 + dz1*dz2)/(rij*rik); - const F_FLOAT param = paramskk(i,j,k).lam3 * (rij-rik); - if (int(paramskk(i,j,k).powerm) == 3) arg = param*param*param;//pow(paramskk(i,j,k).lam3 * (rij-rik),3.0); - else arg = param; + const F_FLOAT paramtmp = param.lam3 * (rij-rik); + if (int(param.powerm) == 3) arg = paramtmp*paramtmp*paramtmp;//pow(param.lam3 * (rij-rik),3.0); + else arg = paramtmp; if (arg > 69.0776) ex_delr = 1.e30; else if (arg < -69.0776) ex_delr = 0.0; else ex_delr = exp(arg); - return ters_fc_k(i,j,k,rik) * ters_gijk(i,j,k,costheta) * ex_delr; + return ters_fc_k(param,rik) * ters_gijk(param,costheta) * ex_delr; } /* ---------------------------------------------------------------------- */ @@ -872,13 +570,13 @@ double PairTersoffKokkos::bondorder(const int &i, const int &j, cons template KOKKOS_INLINE_FUNCTION double PairTersoffKokkos:: - ters_gijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const + ters_gijk(const Param& param, const F_FLOAT &cos) const { - const F_FLOAT ters_c = paramskk(i,j,k).c * paramskk(i,j,k).c; - const F_FLOAT ters_d = paramskk(i,j,k).d * paramskk(i,j,k).d; - const F_FLOAT hcth = paramskk(i,j,k).h - cos; + const F_FLOAT ters_c = param.c * param.c; + const F_FLOAT ters_d = param.d * param.d; + const F_FLOAT hcth = param.h - cos; - return paramskk(i,j,k).gamma*(1.0 + ters_c/ters_d - ters_c/(ters_d+hcth*hcth)); + return param.gamma*(1.0 + ters_c/ters_d - ters_c/(ters_d+hcth*hcth)); } /* ---------------------------------------------------------------------- */ @@ -886,14 +584,14 @@ double PairTersoffKokkos:: template KOKKOS_INLINE_FUNCTION double PairTersoffKokkos:: - ters_dgijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const + ters_dgijk(const Param& param, const F_FLOAT &cos) const { - const F_FLOAT ters_c = paramskk(i,j,k).c * paramskk(i,j,k).c; - const F_FLOAT ters_d = paramskk(i,j,k).d * paramskk(i,j,k).d; - const F_FLOAT hcth = paramskk(i,j,k).h - cos; + const F_FLOAT ters_c = param.c * param.c; + const F_FLOAT ters_d = param.d * param.d; + const F_FLOAT hcth = param.h - cos; const F_FLOAT numerator = -2.0 * ters_c * hcth; const F_FLOAT denominator = 1.0/(ters_d + hcth*hcth); - return paramskk(i,j,k).gamma * numerator * denominator * denominator; + return param.gamma * numerator * denominator * denominator; } /* ---------------------------------------------------------------------- */ @@ -901,59 +599,56 @@ double PairTersoffKokkos:: template KOKKOS_INLINE_FUNCTION void PairTersoffKokkos:: - ters_gijk_and_ters_dgijk(const int &i, const int &j, const int &k, const F_FLOAT &cos, double &gijk, double &dgijk) const + ters_gijk_and_ters_dgijk(const Param& param, const F_FLOAT &cos, double &gijk, double &dgijk) const { - const F_FLOAT ters_c = paramskk(i,j,k).c * paramskk(i,j,k).c; - const F_FLOAT ters_d = paramskk(i,j,k).d * paramskk(i,j,k).d; - const F_FLOAT hcth = paramskk(i,j,k).h - cos; + const F_FLOAT ters_c = param.c * param.c; + const F_FLOAT ters_d = param.d * param.d; + const F_FLOAT hcth = param.h - cos; const F_FLOAT numerator = -2.0 * ters_c * hcth; const F_FLOAT denominator = 1.0/(ters_d + hcth*hcth); - gijk = paramskk(i,j,k).gamma*(1.0 + ters_c/ters_d - ters_c*denominator); - dgijk = paramskk(i,j,k).gamma * numerator * denominator * denominator; + gijk = param.gamma*(1.0 + ters_c/ters_d - ters_c*denominator); + dgijk = param.gamma * numerator * denominator * denominator; } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffKokkos::ters_fa_k(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffKokkos::ters_fa_k(const Param& param, const F_FLOAT &r) const { - if (r > paramskk(i,j,k).bigr + paramskk(i,j,k).bigd) return 0.0; - return -paramskk(i,j,k).bigb * exp(-paramskk(i,j,k).lam2 * r) - * ters_fc_k(i,j,k,r); + if (r > param.bigr + param.bigd) return 0.0; + return -param.bigb * exp(-param.lam2 * r) + * ters_fc_k(param,r); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffKokkos::ters_dfa(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffKokkos::ters_dfa(const Param& param, const F_FLOAT &r) const { - if (r > paramskk(i,j,k).bigr + paramskk(i,j,k).bigd) return 0.0; - return paramskk(i,j,k).bigb * exp(-paramskk(i,j,k).lam2 * r) * - (paramskk(i,j,k).lam2 * ters_fc_k(i,j,k,r) - ters_dfc(i,j,k,r)); + if (r > param.bigr + param.bigd) return 0.0; + return param.bigb * exp(-param.lam2 * r) * + (param.lam2 * ters_fc_k(param,r) - ters_dfc(param,r)); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -void PairTersoffKokkos::ters_fa_k_and_ters_dfa(const int &i, const int &j, - const int &k, const F_FLOAT &r, double &fa, double &dfa) const +void PairTersoffKokkos::ters_fa_k_and_ters_dfa(const Param& param, const F_FLOAT &r, double &fa, double &dfa) const { - if (r > paramskk(i,j,k).bigr + paramskk(i,j,k).bigd) { + if (r > param.bigr + param.bigd) { fa = 0.0; dfa = 0.0; } else { - double tmp1 = paramskk(i,j,k).bigb * exp(-paramskk(i,j,k).lam2 * r); + double tmp1 = param.bigb * exp(-param.lam2 * r); F_FLOAT fc_k, dfc; - ters_fc_k_and_ters_dfc(i,j,k,r,fc_k,dfc); + ters_fc_k_and_ters_dfc(param,r,fc_k,dfc); fa = -tmp1 * fc_k; - dfa = tmp1 * (paramskk(i,j,k).lam2 * fc_k - dfc); + dfa = tmp1 * (param.lam2 * fc_k - dfc); } } @@ -961,82 +656,79 @@ void PairTersoffKokkos::ters_fa_k_and_ters_dfa(const int &i, const i template KOKKOS_INLINE_FUNCTION -double PairTersoffKokkos::ters_bij_k(const int &i, const int &j, - const int &k, const F_FLOAT &bo) const +double PairTersoffKokkos::ters_bij_k(const Param& param, const F_FLOAT &bo) const { - const F_FLOAT tmp = paramskk(i,j,k).beta * bo; - if (tmp > paramskk(i,j,k).c1) return 1.0/sqrt(tmp); - if (tmp > paramskk(i,j,k).c2) - return (1.0 - pow(tmp,-paramskk(i,j,k).powern) / (2.0*paramskk(i,j,k).powern))/sqrt(tmp); - if (tmp < paramskk(i,j,k).c4) return 1.0; - if (tmp < paramskk(i,j,k).c3) - return 1.0 - pow(tmp,paramskk(i,j,k).powern)/(2.0*paramskk(i,j,k).powern); - return pow(1.0 + pow(tmp,paramskk(i,j,k).powern), -1.0/(2.0*paramskk(i,j,k).powern)); + const F_FLOAT tmp = param.beta * bo; + if (tmp > param.c1) return 1.0/sqrt(tmp); + if (tmp > param.c2) + return (1.0 - pow(tmp,-param.powern) / (2.0*param.powern))/sqrt(tmp); + if (tmp < param.c4) return 1.0; + if (tmp < param.c3) + return 1.0 - pow(tmp,param.powern)/(2.0*param.powern); + return pow(1.0 + pow(tmp,param.powern), -1.0/(2.0*param.powern)); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffKokkos::ters_dbij(const int &i, const int &j, - const int &k, const F_FLOAT &bo) const +double PairTersoffKokkos::ters_dbij(const Param& param, const F_FLOAT &bo) const { - const F_FLOAT tmp = paramskk(i,j,k).beta * bo; + const F_FLOAT tmp = param.beta * bo; const F_FLOAT factor = -0.5/sqrt(tmp*tmp*tmp); //pow(tmp,-1.5) - if (tmp > paramskk(i,j,k).c1) return paramskk(i,j,k).beta * factor; - if (tmp > paramskk(i,j,k).c2) - return paramskk(i,j,k).beta * (factor * + if (tmp > param.c1) return param.beta * factor; + if (tmp > param.c2) + return param.beta * (factor * // error in negligible 2nd term fixed 2/21/2022 - // (1.0 - 0.5*(1.0 + 1.0/(2.0*paramskk(i,j,k).powern)) * - (1.0 - (1.0 + 1.0/(2.0*paramskk(i,j,k).powern)) * - pow(tmp,-paramskk(i,j,k).powern))); - if (tmp < paramskk(i,j,k).c4) return 0.0; - if (tmp < paramskk(i,j,k).c3) - return -0.5*paramskk(i,j,k).beta * pow(tmp,paramskk(i,j,k).powern-1.0); + // (1.0 - 0.5*(1.0 + 1.0/(2.0*param.powern)) * + (1.0 - (1.0 + 1.0/(2.0*param.powern)) * + pow(tmp,-param.powern))); + if (tmp < param.c4) return 0.0; + if (tmp < param.c3) + return -0.5*param.beta * pow(tmp,param.powern-1.0); - const F_FLOAT tmp_n = pow(tmp,paramskk(i,j,k).powern); - return -0.5 * pow(1.0+tmp_n, -1.0-(1.0/(2.0*paramskk(i,j,k).powern)))*tmp_n / bo; + const F_FLOAT tmp_n = pow(tmp,param.powern); + return -0.5 * pow(1.0+tmp_n, -1.0-(1.0/(2.0*param.powern)))*tmp_n / bo; } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -void PairTersoffKokkos::ters_bij_k_and_ters_dbij(const int &i, const int &j, - const int &k, const F_FLOAT &bo, double& bij, double& prefactor) const +void PairTersoffKokkos::ters_bij_k_and_ters_dbij(const Param& param, const F_FLOAT &bo, double& bij, double& prefactor) const { - const F_FLOAT tmp = paramskk(i,j,k).beta * bo; + const F_FLOAT tmp = param.beta * bo; const F_FLOAT factor = -0.5/sqrt(tmp*tmp*tmp); //pow(tmp,-1.5) - if (tmp > paramskk(i,j,k).c1) { + if (tmp > param.c1) { bij = 1.0/sqrt(tmp); - prefactor = paramskk(i,j,k).beta * factor; + prefactor = param.beta * factor; return; } - auto prm_ijk_pn = paramskk(i,j,k).powern; + auto prm_ijk_pn = param.powern; - if (tmp > paramskk(i,j,k).c2) { + if (tmp > param.c2) { auto tmp_pow_neg_prm_ijk_pn = pow(tmp,-prm_ijk_pn); bij = (1.0 - tmp_pow_neg_prm_ijk_pn / (2.0*prm_ijk_pn))/sqrt(tmp); - prefactor = paramskk(i,j,k).beta * (factor * + prefactor = param.beta * (factor * (1.0 - 0.5*(1.0 + 1.0/(2.0*prm_ijk_pn)) * tmp_pow_neg_prm_ijk_pn)); return; } - if (tmp < paramskk(i,j,k).c4) { + if (tmp < param.c4) { bij = 1.0; prefactor = 0.0; return; } - if (tmp < paramskk(i,j,k).c3) { + if (tmp < param.c3) { auto tmp_pow_prm_ijk_pn_less_one = pow(tmp,prm_ijk_pn-1.0); bij = 1.0 - tmp_pow_prm_ijk_pn_less_one*tmp/(2.0*prm_ijk_pn); - prefactor = -0.5*paramskk(i,j,k).beta * tmp_pow_prm_ijk_pn_less_one; + prefactor = -0.5*param.beta * tmp_pow_prm_ijk_pn_less_one; return; } - const F_FLOAT tmp_n = pow(tmp,paramskk(i,j,k).powern); + const F_FLOAT tmp_n = pow(tmp,param.powern); bij = pow(1.0 + tmp_n, -1.0/(2.0*prm_ijk_pn)); prefactor = -0.5 * pow(1.0+tmp_n, -1.0-(1.0/(2.0*prm_ijk_pn)))*tmp_n / bo; } @@ -1046,7 +738,7 @@ void PairTersoffKokkos::ters_bij_k_and_ters_dbij(const int &i, const template KOKKOS_INLINE_FUNCTION void PairTersoffKokkos::ters_dthb( - const int &i, const int &j, const int &k, const F_FLOAT &prefactor, + const Param& param, const F_FLOAT &prefactor, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk) const @@ -1071,23 +763,23 @@ void PairTersoffKokkos::ters_dthb( F_FLOAT gijk,dgijk,ex_delr,dex_delr,fc,dfc,cos,tmp; F_FLOAT dcosfi[3],dcosfj[3],dcosfk[3]; - ters_fc_k_and_ters_dfc(i,j,k,rik,fc,dfc); + ters_fc_k_and_ters_dfc(param,rik,fc,dfc); - const F_FLOAT param = paramskk(i,j,k).lam3 * (rij-rik); - if (int(paramskk(i,j,k).powerm) == 3) tmp = param*param*param;//pow(paramskk(i,j,k).lam3 * (rij-rik),3.0); - else tmp = param; + const F_FLOAT paramtmp = param.lam3 * (rij-rik); + if (int(param.powerm) == 3) tmp = paramtmp*paramtmp*paramtmp;//pow(param.lam3 * (rij-rik),3.0); + else tmp = paramtmp; if (tmp > 69.0776) ex_delr = 1.e30; else if (tmp < -69.0776) ex_delr = 0.0; else ex_delr = exp(tmp); - if (int(paramskk(i,j,k).powerm) == 3) - dex_delr = 3.0*param*param*paramskk(i,j,k).lam3*ex_delr;//pow(rij-rik,2.0)*ex_delr; - else dex_delr = paramskk(i,j,k).lam3 * ex_delr; + if (int(param.powerm) == 3) + dex_delr = 3.0*paramtmp*paramtmp*param.lam3*ex_delr;//pow(rij-rik,2.0)*ex_delr; + else dex_delr = param.lam3 * ex_delr; cos = vec3_dot(rij_hat,rik_hat); - ters_gijk_and_ters_dgijk(i,j,k,cos,gijk,dgijk); + ters_gijk_and_ters_dgijk(param,cos,gijk,dgijk); // from PairTersoff::costheta_d vec3_scaleadd(-cos,rij_hat,rik_hat,dcosfj); @@ -1119,7 +811,7 @@ void PairTersoffKokkos::ters_dthb( template KOKKOS_INLINE_FUNCTION void PairTersoffKokkos::ters_dthbj( - const int &i, const int &j, const int &k, const F_FLOAT &prefactor, + const Param& param, const F_FLOAT &prefactor, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, F_FLOAT *fj, F_FLOAT *fk) const @@ -1140,23 +832,23 @@ void PairTersoffKokkos::ters_dthbj( F_FLOAT gijk,dgijk,ex_delr,dex_delr,fc,dfc,cos,tmp; F_FLOAT dcosfi[3],dcosfj[3],dcosfk[3]; - fc = ters_fc_k(i,j,k,rik); - dfc = ters_dfc(i,j,k,rik); - const F_FLOAT param = paramskk(i,j,k).lam3 * (rij-rik); - if (int(paramskk(i,j,k).powerm) == 3) tmp = param*param*param;//pow(paramskk(i,j,k).lam3 * (rij-rik),3.0); - else tmp = param;//paramskk(i,j,k).lam3 * (rij-rik); + fc = ters_fc_k(param,rik); + dfc = ters_dfc(param,rik); + const F_FLOAT paramtmp = param.lam3 * (rij-rik); + if (int(param.powerm) == 3) tmp = paramtmp*paramtmp*paramtmp;//pow(param.lam3 * (rij-rik),3.0); + else tmp = paramtmp; if (tmp > 69.0776) ex_delr = 1.e30; else if (tmp < -69.0776) ex_delr = 0.0; else ex_delr = exp(tmp); - if (int(paramskk(i,j,k).powerm) == 3) - dex_delr = 3.0*param*param*paramskk(i,j,k).lam3*ex_delr;//pow(paramskk(i,j,k).lam3,3.0) * pow(rij-rik,2.0)*ex_delr; - else dex_delr = paramskk(i,j,k).lam3 * ex_delr; + if (int(param.powerm) == 3) + dex_delr = 3.0*paramtmp*paramtmp*param.lam3*ex_delr;//pow(param.lam3,3.0) * pow(rij-rik,2.0)*ex_delr; + else dex_delr = param.lam3 * ex_delr; cos = vec3_dot(rij_hat,rik_hat); - gijk = ters_gijk(i,j,k,cos); - dgijk = ters_dgijk(i,j,k,cos); + gijk = ters_gijk(param,cos); + dgijk = ters_dgijk(param,cos); vec3_scaleadd(-cos,rij_hat,rik_hat,dcosfj); vec3_scale(rijinv,dcosfj,dcosfj); @@ -1181,7 +873,7 @@ void PairTersoffKokkos::ters_dthbj( template KOKKOS_INLINE_FUNCTION void PairTersoffKokkos::ters_dthbk( - const int &i, const int &j, const int &k, const F_FLOAT &prefactor, + const Param& param, const F_FLOAT &prefactor, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, F_FLOAT *fk) const @@ -1202,23 +894,23 @@ void PairTersoffKokkos::ters_dthbk( F_FLOAT gijk,dgijk,ex_delr,dex_delr,fc,dfc,cos,tmp; F_FLOAT dcosfi[3],dcosfj[3],dcosfk[3]; - fc = ters_fc_k(i,j,k,rik); - dfc = ters_dfc(i,j,k,rik); - const F_FLOAT param = paramskk(i,j,k).lam3 * (rij-rik); - if (int(paramskk(i,j,k).powerm) == 3) tmp = param*param*param;//pow(paramskk(i,j,k).lam3 * (rij-rik),3.0); - else tmp = param;//paramskk(i,j,k).lam3 * (rij-rik); + fc = ters_fc_k(param,rik); + dfc = ters_dfc(param,rik); + const F_FLOAT paramtmp = param.lam3 * (rij-rik); + if (int(param.powerm) == 3) tmp = paramtmp*paramtmp*paramtmp;//pow(param.lam3 * (rij-rik),3.0); + else tmp = paramtmp; if (tmp > 69.0776) ex_delr = 1.e30; else if (tmp < -69.0776) ex_delr = 0.0; else ex_delr = exp(tmp); - if (int(paramskk(i,j,k).powerm) == 3) - dex_delr = 3.0*param*param*paramskk(i,j,k).lam3*ex_delr;//pow(paramskk(i,j,k).lam3,3.0) * pow(rij-rik,2.0)*ex_delr; - else dex_delr = paramskk(i,j,k).lam3 * ex_delr; + if (int(param.powerm) == 3) + dex_delr = 3.0*paramtmp*paramtmp*param.lam3*ex_delr;//pow(param.lam3,3.0) * pow(rij-rik,2.0)*ex_delr; + else dex_delr = param.lam3 * ex_delr; cos = vec3_dot(rij_hat,rik_hat); - gijk = ters_gijk(i,j,k,cos); - dgijk = ters_dgijk(i,j,k,cos); + gijk = ters_gijk(param,cos); + dgijk = ters_dgijk(param,cos); vec3_scaleadd(-cos,rij_hat,rik_hat,dcosfj); vec3_scale(rijinv,dcosfj,dcosfj); @@ -1242,8 +934,6 @@ void PairTersoffKokkos::ev_tally(EV_FLOAT &ev, const int &i, const i const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const { - const int VFLAG = vflag_either; - // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); @@ -1255,10 +945,10 @@ void PairTersoffKokkos::ev_tally(EV_FLOAT &ev, const int &i, const i if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; a_eatom[i] += epairhalf; - if (NEIGHFLAG != FULL) a_eatom[j] += epairhalf; + a_eatom[j] += epairhalf; } - if (VFLAG) { + if (vflag_either) { const E_FLOAT v0 = delx*delx*fpair; const E_FLOAT v1 = dely*dely*fpair; const E_FLOAT v2 = delz*delz*fpair; @@ -1267,21 +957,12 @@ void PairTersoffKokkos::ev_tally(EV_FLOAT &ev, const int &i, const i const E_FLOAT v5 = dely*delz*fpair; if (vflag_global) { - if (NEIGHFLAG != FULL) { - ev.v[0] += v0; - ev.v[1] += v1; - ev.v[2] += v2; - ev.v[3] += v3; - ev.v[4] += v4; - ev.v[5] += v5; - } else { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } + ev.v[0] += v0; + ev.v[1] += v1; + ev.v[2] += v2; + ev.v[3] += v3; + ev.v[4] += v4; + ev.v[5] += v5; } if (vflag_atom) { @@ -1292,14 +973,12 @@ void PairTersoffKokkos::ev_tally(EV_FLOAT &ev, const int &i, const i a_vatom(i,4) += 0.5*v4; a_vatom(i,5) += 0.5*v5; - if (NEIGHFLAG != FULL) { - a_vatom(j,0) += 0.5*v0; - a_vatom(j,1) += 0.5*v1; - a_vatom(j,2) += 0.5*v2; - a_vatom(j,3) += 0.5*v3; - a_vatom(j,4) += 0.5*v4; - a_vatom(j,5) += 0.5*v5; - } + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; } } } @@ -1309,7 +988,8 @@ void PairTersoffKokkos::ev_tally(EV_FLOAT &ev, const int &i, const i template template KOKKOS_INLINE_FUNCTION -void PairTersoffKokkos::v_tally3(EV_FLOAT &ev, const int &i, const int &j, const int &k, +void PairTersoffKokkos::v_tally3(EV_FLOAT &ev, + const int &i, const int &j, const int &k, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drij, F_FLOAT *drik) const { // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial @@ -1345,12 +1025,12 @@ void PairTersoffKokkos::v_tally3(EV_FLOAT &ev, const int &i, const i a_vatom(i,0) += v[0]; a_vatom(i,1) += v[1]; a_vatom(i,2) += v[2]; a_vatom(i,3) += v[3]; a_vatom(i,4) += v[4]; a_vatom(i,5) += v[5]; - if (NEIGHFLAG != FULL) { - a_vatom(j,0) += v[0]; a_vatom(j,1) += v[1]; a_vatom(j,2) += v[2]; - a_vatom(j,3) += v[3]; a_vatom(j,4) += v[4]; a_vatom(j,5) += v[5]; - a_vatom(k,0) += v[0]; a_vatom(k,1) += v[1]; a_vatom(k,2) += v[2]; - a_vatom(k,3) += v[3]; a_vatom(k,4) += v[4]; a_vatom(k,5) += v[5]; - } + + a_vatom(j,0) += v[0]; a_vatom(j,1) += v[1]; a_vatom(j,2) += v[2]; + a_vatom(j,3) += v[3]; a_vatom(j,4) += v[4]; a_vatom(j,5) += v[5]; + + a_vatom(k,0) += v[0]; a_vatom(k,1) += v[1]; a_vatom(k,2) += v[2]; + a_vatom(k,3) += v[3]; a_vatom(k,4) += v[4]; a_vatom(k,5) += v[5]; } } @@ -1359,7 +1039,8 @@ void PairTersoffKokkos::v_tally3(EV_FLOAT &ev, const int &i, const i template KOKKOS_INLINE_FUNCTION void PairTersoffKokkos::v_tally3_atom(EV_FLOAT &ev, const int &i, const int & /*j*/, - const int & /*k*/, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const + const int & /*k*/, F_FLOAT *fj, F_FLOAT *fk, + F_FLOAT *drji, F_FLOAT *drjk) const { F_FLOAT v[6]; diff --git a/src/KOKKOS/pair_tersoff_kokkos.h b/src/KOKKOS/pair_tersoff_kokkos.h index 3a7ef417d2..42484be6cd 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.h +++ b/src/KOKKOS/pair_tersoff_kokkos.h @@ -30,20 +30,14 @@ PairStyle(tersoff/kk/host,PairTersoffKokkos); namespace LAMMPS_NS { template -struct TagPairTersoffComputeHalf{}; - -template -struct TagPairTersoffComputeFullA{}; - -template -struct TagPairTersoffComputeFullB{}; +struct TagPairTersoffCompute{}; struct TagPairTersoffComputeShortNeigh{}; template class PairTersoffKokkos : public PairTersoff { public: - enum {EnabledNeighFlags=FULL}; + enum {EnabledNeighFlags=HALF|HALFTHREAD}; enum {COUL_FLAG=0}; typedef DeviceType device_type; typedef ArrayTypes AT; @@ -52,90 +46,75 @@ class PairTersoffKokkos : public PairTersoff { PairTersoffKokkos(class LAMMPS *); ~PairTersoffKokkos() override; void compute(int, int) override; + void coeff(int, char **) override; void init_style() override; template KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffComputeHalf, const int&, EV_FLOAT&) const; + void operator()(TagPairTersoffCompute, const int&, EV_FLOAT&) const; template KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffComputeHalf, const int&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffComputeFullA, const int&, EV_FLOAT&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffComputeFullA, const int&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffComputeFullB, const int&, EV_FLOAT&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffComputeFullB, const int&) const; + void operator()(TagPairTersoffCompute, const int&) const; KOKKOS_INLINE_FUNCTION void operator()(TagPairTersoffComputeShortNeigh, const int&) const; KOKKOS_INLINE_FUNCTION - double ters_fc_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double ters_fc_k(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - double ters_dfc(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double ters_dfc(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - void ters_fc_k_and_ters_dfc(const int &i, const int &j, const int &k, const F_FLOAT &r, double &fc, double &dfc) const; + void ters_fc_k_and_ters_dfc(const Param& param, const F_FLOAT &r, double &fc, double &dfc) const; KOKKOS_INLINE_FUNCTION - double ters_fa_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double ters_fa_k(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - double ters_dfa(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double ters_dfa(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - void ters_fa_k_and_ters_dfa(const int &i, const int &j, const int &k, const F_FLOAT &r, double &fa, double &dfa) const; + void ters_fa_k_and_ters_dfa(const Param& param, const F_FLOAT &r, double &fa, double &dfa) const; KOKKOS_INLINE_FUNCTION - double ters_bij_k(const int &i, const int &j, const int &k, const F_FLOAT &bo) const; + double ters_bij_k(const Param& param, const F_FLOAT &bo) const; KOKKOS_INLINE_FUNCTION - double ters_dbij(const int &i, const int &j, const int &k, const F_FLOAT &bo) const; + double ters_dbij(const Param& param, const F_FLOAT &bo) const; KOKKOS_INLINE_FUNCTION - void ters_bij_k_and_ters_dbij(const int &i, const int &j, const int &k, const F_FLOAT &bo, double &bij, double &prefactor) const; + void ters_bij_k_and_ters_dbij(const Param& param, const F_FLOAT &bo, double &bij, double &prefactor) const; KOKKOS_INLINE_FUNCTION - double bondorder(const int &i, const int &j, const int &k, + double bondorder(const Param& param, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2) const; KOKKOS_INLINE_FUNCTION - double ters_gijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const; + double ters_gijk(const Param& param, const F_FLOAT &cos) const; KOKKOS_INLINE_FUNCTION - double ters_dgijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const; + double ters_dgijk(const Param& param, const F_FLOAT &cos) const; KOKKOS_INLINE_FUNCTION - void ters_gijk_and_ters_dgijk(const int &i, const int &j, const int &k, const F_FLOAT &cos, double& gijk, double& dgijk) const; + void ters_gijk_and_ters_dgijk(const Param& param, const F_FLOAT &cos, double& gijk, double& dgijk) const; KOKKOS_INLINE_FUNCTION - void ters_dthb(const int &i, const int &j, const int &k, const F_FLOAT &prefactor, + void ters_dthb(const Param& param, const F_FLOAT &prefactor, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk) const; KOKKOS_INLINE_FUNCTION - void ters_dthbj(const int &i, const int &j, const int &k, const F_FLOAT &prefactor, + void ters_dthbj(const Param& param, const F_FLOAT &prefactor, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, F_FLOAT *fj, F_FLOAT *fk) const; KOKKOS_INLINE_FUNCTION - void ters_dthbk(const int &i, const int &j, const int &k, const F_FLOAT &prefactor, + void ters_dthbk(const Param& param, const F_FLOAT &prefactor, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, F_FLOAT *fk) const; @@ -163,17 +142,6 @@ class PairTersoffKokkos : public PairTersoff { KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const; - struct params_ters{ - KOKKOS_INLINE_FUNCTION - params_ters() {powerm=0;gamma=0;lam3=0;c=0;d=0;h=0;powern=0;beta=0;lam2=0;bigb=0; - bigr=0;bigd=0;lam1=0;biga=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;}; - KOKKOS_INLINE_FUNCTION - params_ters(int /*i*/) {powerm=0;gamma=0;lam3=0;c=0;d=0;h=0;powern=0;beta=0;lam2=0;bigb=0; - bigr=0;bigd=0;lam1=0;biga=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;}; - F_FLOAT powerm, gamma, lam3, c, d, h, powern, beta, lam2, bigb, bigr, - bigd, lam1, biga, cutsq, c1, c2, c3, c4; - }; - template KOKKOS_INLINE_FUNCTION void ev_tally(EV_FLOAT &ev, const int &i, const int &j, @@ -189,16 +157,21 @@ class PairTersoffKokkos : public PairTersoff { void v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const; - void allocate() override; void setup_params() override; protected: typedef Kokkos::DualView tdual_int_3d; - Kokkos::DualView k_params; - typename Kokkos::DualView::t_dev_const_um paramskk; - // hardwired to space for 12 atom types - //params_ters m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1]; + typedef typename tdual_int_3d::t_dev_const_randomread t_int_3d_randomread; + typedef typename tdual_int_3d::t_host t_host_int_3d; + + t_int_3d_randomread d_elem3param; + typename AT::t_int_1d_randomread d_map; + + typedef Kokkos::DualView tdual_param_1d; + typedef typename tdual_param_1d::t_dev t_param_1d; + typedef typename tdual_param_1d::t_host t_host_param_1d; + + t_param_1d d_params; int inum; typename AT::t_x_array_randomread x; @@ -254,11 +227,7 @@ class PairTersoffKokkos : public PairTersoff { /* ERROR/WARNING messages: -E: Cannot (yet) use full neighbor list style with tersoff/kk - -Self-explanatory. - -E: Cannot use chosen neighbor list style with tersoff/kk +E: Must use half neighbor list style with pair tersoff/kk Self-explanatory. diff --git a/src/KOKKOS/pair_tersoff_mod_kokkos.cpp b/src/KOKKOS/pair_tersoff_mod_kokkos.cpp index 2f354a93a9..203cfba134 100644 --- a/src/KOKKOS/pair_tersoff_mod_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_mod_kokkos.cpp @@ -65,18 +65,29 @@ PairTersoffMODKokkos::~PairTersoffMODKokkos() } } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + set coeffs for one or more type pairs +------------------------------------------------------------------------- */ template -void PairTersoffMODKokkos::allocate() +void PairTersoffMODKokkos::coeff(int narg, char **arg) { - PairTersoffMOD::allocate(); + PairTersoffMOD::coeff(narg,arg); + + // sync map int n = atom->ntypes; - k_params = Kokkos::DualView - ("PairTersoffMOD::paramskk",n+1,n+1,n+1); - paramskk = k_params.template view(); + DAT::tdual_int_1d k_map = DAT::tdual_int_1d("pair:map",n+1); + HAT::t_int_1d h_map = k_map.h_view; + + for (int i = 1; i <= n; i++) + h_map[i] = map[i]; + + k_map.template modify(); + k_map.template sync(); + + d_map = k_map.template view(); } /* ---------------------------------------------------------------------- @@ -95,8 +106,9 @@ void PairTersoffMODKokkos::init_style() request->set_kokkos_host(std::is_same::value && !std::is_same::value); request->set_kokkos_device(std::is_same::value); + if (neighflag == FULL) - error->all(FLERR,"Cannot (yet) use full neighbor list style with tersoff/mod/kk"); + error->all(FLERR,"Must use half neighbor list style with pair tersoff/kk"); } /* ---------------------------------------------------------------------- */ @@ -106,37 +118,29 @@ void PairTersoffMODKokkos::setup_params() { PairTersoffMOD::setup_params(); - int i,j,k,m; - int n = atom->ntypes; + // sync elem3param and params - for (i = 1; i <= n; i++) - for (j = 1; j <= n; j++) - for (k = 1; k <= n; k++) { - m = elem3param[map[i]][map[j]][map[k]]; - k_params.h_view(i,j,k).powerm = params[m].powerm; - k_params.h_view(i,j,k).lam3 = params[m].lam3; - k_params.h_view(i,j,k).h = params[m].h; - k_params.h_view(i,j,k).powern = params[m].powern; - k_params.h_view(i,j,k).beta = params[m].beta; - k_params.h_view(i,j,k).lam2 = params[m].lam2; - k_params.h_view(i,j,k).bigb = params[m].bigb; - k_params.h_view(i,j,k).bigr = params[m].bigr; - k_params.h_view(i,j,k).bigd = params[m].bigd; - k_params.h_view(i,j,k).lam1 = params[m].lam1; - k_params.h_view(i,j,k).biga = params[m].biga; - k_params.h_view(i,j,k).cutsq = params[m].cutsq; - k_params.h_view(i,j,k).c1 = params[m].c1; - k_params.h_view(i,j,k).c2 = params[m].c2; - k_params.h_view(i,j,k).c3 = params[m].c3; - k_params.h_view(i,j,k).c4 = params[m].c4; - k_params.h_view(i,j,k).c5 = params[m].c5; - k_params.h_view(i,j,k).ca1 = params[m].ca1; - k_params.h_view(i,j,k).ca4 = params[m].ca4; - k_params.h_view(i,j,k).powern_del = params[m].powern_del; - } + tdual_int_3d k_elem3param = tdual_int_3d("pair:elem3param",nelements,nelements,nelements); + t_host_int_3d h_elem3param = k_elem3param.h_view; - k_params.template modify(); + tdual_param_1d k_params = tdual_param_1d("pair:params",nparams); + t_host_param_1d h_params = k_params.h_view; + for (int i = 0; i < nelements; i++) + for (int j = 0; j < nelements; j++) + for (int k = 0; k < nelements; k++) + h_elem3param(i,j,k) = elem3param[i][j][k]; + + for (int m = 0; m < nparams; m++) + h_params[m] = params[m]; + + k_elem3param.modify_host(); + k_elem3param.template sync(); + k_params.modify_host(); + k_params.template sync(); + + d_elem3param = k_elem3param.template view(); + d_params = k_params.template view(); } /* ---------------------------------------------------------------------- */ @@ -147,8 +151,6 @@ void PairTersoffMODKokkos::compute(int eflag_in, int vflag_in) eflag = eflag_in; vflag = vflag_in; - if (neighflag == FULL) no_virial_fdotr_compute = 1; - ev_init(eflag,vflag,0); // reallocate per-atom arrays if necessary @@ -165,7 +167,6 @@ void PairTersoffMODKokkos::compute(int eflag_in, int vflag_in) } atomKK->sync(execution_space,datamask_read); - k_params.template sync(); if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); else atomKK->modified(execution_space,F_MASK); @@ -204,37 +205,25 @@ void PairTersoffMODKokkos::compute(int eflag_in, int vflag_in) int max_neighs = d_neighbors.extent(1); - if (((int)d_neighbors_short.extent(1) != max_neighs) || - ((int)d_neighbors_short.extent(0) != ignum)) { - d_neighbors_short = Kokkos::View("Tersoff::neighbors_short",ignum,max_neighs); + if (((int)d_neighbors_short.extent(1) < max_neighs) || + ((int)d_neighbors_short.extent(0) < ignum)) { + d_neighbors_short = Kokkos::View("Tersoff::neighbors_short",ignum*1.2,max_neighs); } - if ((int)d_numneigh_short.extent(0)!=ignum) - d_numneigh_short = Kokkos::View("Tersoff::numneighs_short",ignum); - Kokkos::parallel_for(Kokkos::RangePolicy(0,neighflag==FULL?ignum:inum), *this); + if ((int)d_numneigh_short.extent(0) < ignum) + d_numneigh_short = Kokkos::View("Tersoff::numneighs_short",ignum*1.2); + Kokkos::parallel_for(Kokkos::RangePolicy(0,inum), *this); if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } else if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - ev_all += ev; - } else if (neighflag == FULL) { - if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - ev_all += ev; - - if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,ignum),*this,ev); - else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,ignum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } @@ -286,6 +275,7 @@ void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeShortN const X_FLOAT xtmp = x(i,0); const X_FLOAT ytmp = x(i,1); const X_FLOAT ztmp = x(i,2); + const F_FLOAT cutmax_sq = cutmax*cutmax; const int jnum = d_numneigh[i]; int inside = 0; @@ -298,12 +288,12 @@ void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeShortN const X_FLOAT delz = ztmp - x(j,2); const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; - if (rsq < cutmax*cutmax) { - d_neighbors_short(i,inside) = j; + if (rsq < cutmax_sq) { + d_neighbors_short(ii,inside) = j; inside++; } } - d_numneigh_short(i) = inside; + d_numneigh_short(ii) = inside; } /* ---------------------------------------------------------------------- */ @@ -311,25 +301,25 @@ void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeShortN template template KOKKOS_INLINE_FUNCTION -void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeHalf, const int &ii, EV_FLOAT& ev) const { +void PairTersoffMODKokkos::operator()(TagPairTersoffMODCompute, const int &ii, EV_FLOAT& ev) const { // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access>(); + const auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + const auto a_f = v_f.template access>(); const int i = d_ilist[ii]; if (i >= nlocal) return; const X_FLOAT xtmp = x(i,0); const X_FLOAT ytmp = x(i,1); const X_FLOAT ztmp = x(i,2); - const int itype = type(i); + const int itype = d_map(type(i)); const tagint itag = tag(i); F_FLOAT fi[3], fj[3], fk[3]; //const AtomNeighborsConst d_neighbors_i = k_list.get_neighbors_const(i); - const int jnum = d_numneigh_short[i]; + const int jnum = d_numneigh_short[ii]; // repulsive @@ -338,9 +328,8 @@ void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeHalf jtag) { @@ -357,17 +346,18 @@ void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeHalf cutsq) continue; + if (rsq >= cutsq) continue; const F_FLOAT r = sqrt(rsq); - const F_FLOAT tmp_fce = ters_fc_k(itype,jtype,jtype,r); - const F_FLOAT tmp_fcd = ters_dfc(itype,jtype,jtype,r); - const F_FLOAT tmp_exp = exp(-paramskk(itype,jtype,jtype).lam1 * r); - const F_FLOAT frep = -paramskk(itype,jtype,jtype).biga * tmp_exp * - (tmp_fcd - tmp_fce*paramskk(itype,jtype,jtype).lam1) / r; - const F_FLOAT eng = tmp_fce * paramskk(itype,jtype,jtype).biga * tmp_exp; + const F_FLOAT tmp_fce = ters_fc_k(d_params(iparam_ij),r); + const F_FLOAT tmp_fcd = ters_dfc(d_params(iparam_ij),r); + const F_FLOAT tmp_exp = exp(-d_params(iparam_ij).lam1 * r); + const F_FLOAT frep = -d_params(iparam_ij).biga * tmp_exp * + (tmp_fcd - tmp_fce*d_params(iparam_ij).lam1) / r; + const F_FLOAT eng = tmp_fce * d_params(iparam_ij).biga * tmp_exp; f_x += delx*frep; f_y += dely*frep; @@ -385,15 +375,15 @@ void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeHalf cutsq1) continue; @@ -401,28 +391,28 @@ void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeHalf cutsq2) continue; const F_FLOAT rik = sqrt(rsq2); - bo_ij += bondorder(itype,jtype,ktype,rij,delx1,dely1,delz1,rik,delx2,dely2,delz2); + bo_ij += bondorder(d_params(iparam_ijk),rij,delx1,dely1,delz1,rik,delx2,dely2,delz2); } // attractive: pairwise potential and force - const F_FLOAT fa = ters_fa_k(itype,jtype,jtype,rij); - const F_FLOAT dfa = ters_dfa(itype,jtype,jtype,rij); - const F_FLOAT bij = ters_bij_k(itype,jtype,jtype,bo_ij); + const F_FLOAT fa = ters_fa_k(d_params(iparam_ij),rij); + const F_FLOAT dfa = ters_dfa(d_params(iparam_ij),rij); + const F_FLOAT bij = ters_bij_k(d_params(iparam_ij),bo_ij); const F_FLOAT fatt = -0.5*bij * dfa / rij; - const F_FLOAT prefactor = 0.5*fa * ters_dbij(itype,jtype,jtype,bo_ij); + const F_FLOAT prefactor = 0.5*fa * ters_dbij(d_params(iparam_ij),bo_ij); f_x += delx1*fatt; f_y += dely1*fatt; @@ -435,26 +425,26 @@ void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeHalftemplate ev_tally(ev,i,j,eng,fatt,delx1,dely1,delz1); + this->template ev_tally(ev,i,j,eng,fatt,delx1,dely1,delz1); } // attractive: three-body force for (int kk = 0; kk < jnum; kk++) { if (jj == kk) continue; - int k = d_neighbors_short(i,kk); - k &= NEIGHMASK; - const int ktype = type(k); + int k = d_neighbors_short(ii,kk); + const int ktype = d_map(type(k)); const F_FLOAT delx2 = xtmp - x(k,0); const F_FLOAT dely2 = ytmp - x(k,1); const F_FLOAT delz2 = ztmp - x(k,2); const F_FLOAT rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - const F_FLOAT cutsq2 = paramskk(itype,jtype,ktype).cutsq; + const int iparam_ijk = d_elem3param(itype,jtype,ktype); + const F_FLOAT cutsq2 = d_params(iparam_ijk).cutsq; if (rsq2 > cutsq2) continue; const F_FLOAT rik = sqrt(rsq2); - ters_dthb(itype,jtype,ktype,prefactor,rij,delx1,dely1,delz1, + ters_dthb(d_params(iparam_ijk),prefactor,rij,delx1,dely1,delz1, rik,delx2,dely2,delz2,fi,fj,fk); f_x += fi[0]; @@ -474,6 +464,7 @@ void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeHalftemplate v_tally3(ev,i,j,k,fj,fk,delrij,delrik); } } + a_f(j,0) += fj_x; a_f(j,1) += fj_y; a_f(j,2) += fj_z; @@ -486,309 +477,19 @@ void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeHalf template KOKKOS_INLINE_FUNCTION -void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeHalf, const int &ii) const { +void PairTersoffMODKokkos::operator()(TagPairTersoffMODCompute, const int &ii) const { EV_FLOAT ev; - this->template operator()(TagPairTersoffMODComputeHalf(), ii, ev); -} - -/* ---------------------------------------------------------------------- */ - -template -template -KOKKOS_INLINE_FUNCTION -void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeFullA, const int &ii, EV_FLOAT& ev) const { - - const int i = d_ilist[ii]; - const X_FLOAT xtmp = x(i,0); - const X_FLOAT ytmp = x(i,1); - const X_FLOAT ztmp = x(i,2); - const int itype = type(i); - - int j,k,jj,kk,jtype,ktype; - F_FLOAT rsq1, cutsq1, rsq2, cutsq2, rij, rik, bo_ij; - F_FLOAT fi[3], fj[3], fk[3]; - X_FLOAT delx1, dely1, delz1, delx2, dely2, delz2; - - //const AtomNeighborsConst d_neighbors_i = k_list.get_neighbors_const(i); - const int jnum = d_numneigh_short[i]; - - // repulsive - - F_FLOAT f_x = 0.0; - F_FLOAT f_y = 0.0; - F_FLOAT f_z = 0.0; - for (jj = 0; jj < jnum; jj++) { - j = d_neighbors_short(i,jj); - j &= NEIGHMASK; - const int jtype = type(j); - - const X_FLOAT delx = xtmp - x(j,0); - const X_FLOAT dely = ytmp - x(j,1); - const X_FLOAT delz = ztmp - x(j,2); - const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; - const F_FLOAT cutsq = paramskk(itype,jtype,jtype).cutsq; - - if (rsq > cutsq) continue; - - const F_FLOAT r = sqrt(rsq); - const F_FLOAT tmp_fce = ters_fc_k(itype,jtype,jtype,r); - const F_FLOAT tmp_fcd = ters_dfc(itype,jtype,jtype,r); - const F_FLOAT tmp_exp = exp(-paramskk(itype,jtype,jtype).lam1 * r); - const F_FLOAT frep = -paramskk(itype,jtype,jtype).biga * tmp_exp * - (tmp_fcd - tmp_fce*paramskk(itype,jtype,jtype).lam1) / r; - const F_FLOAT eng = tmp_fce * paramskk(itype,jtype,jtype).biga * tmp_exp; - - f_x += delx*frep; - f_y += dely*frep; - f_z += delz*frep; - - if (EVFLAG) { - if (eflag) - ev.evdwl += 0.5*eng; - if (vflag_either || eflag_atom) - this->template ev_tally(ev,i,j,eng,frep,delx,dely,delz); - } - } - - // attractive: bond order - - for (jj = 0; jj < jnum; jj++) { - j = d_neighbors_short(i,jj); - j &= NEIGHMASK; - jtype = type(j); - - delx1 = xtmp - x(j,0); - dely1 = ytmp - x(j,1); - delz1 = ztmp - x(j,2); - rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1; - cutsq1 = paramskk(itype,jtype,jtype).cutsq; - - bo_ij = 0.0; - if (rsq1 > cutsq1) continue; - rij = sqrt(rsq1); - - for (kk = 0; kk < jnum; kk++) { - if (jj == kk) continue; - k = d_neighbors_short(i,kk); - k &= NEIGHMASK; - ktype = type(k); - - delx2 = xtmp - x(k,0); - dely2 = ytmp - x(k,1); - delz2 = ztmp - x(k,2); - rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - cutsq2 = paramskk(itype,jtype,ktype).cutsq; - - if (rsq2 > cutsq2) continue; - rik = sqrt(rsq2); - bo_ij += bondorder(itype,jtype,ktype,rij,delx1,dely1,delz1,rik,delx2,dely2,delz2); - } - - // attractive: pairwise potential and force - - const F_FLOAT fa = ters_fa_k(itype,jtype,jtype,rij); - const F_FLOAT dfa = ters_dfa(itype,jtype,jtype,rij); - const F_FLOAT bij = ters_bij_k(itype,jtype,jtype,bo_ij); - const F_FLOAT fatt = -0.5*bij * dfa / rij; - const F_FLOAT prefactor = 0.5*fa * ters_dbij(itype,jtype,jtype,bo_ij); - const F_FLOAT eng = 0.5*bij * fa; - - f_x += delx1*fatt; - f_y += dely1*fatt; - f_z += delz1*fatt; - - if (EVFLAG) { - if (eflag) ev.evdwl += 0.5*eng; - if (vflag_either || eflag_atom) - this->template ev_tally(ev,i,j,eng,fatt,delx1,dely1,delz1); - } - - // attractive: three-body force - - for (kk = 0; kk < jnum; kk++) { - if (jj == kk) continue; - k = d_neighbors_short(i,kk); - k &= NEIGHMASK; - ktype = type(k); - - delx2 = xtmp - x(k,0); - dely2 = ytmp - x(k,1); - delz2 = ztmp - x(k,2); - rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - cutsq2 = paramskk(itype,jtype,ktype).cutsq; - - if (rsq2 > cutsq2) continue; - rik = sqrt(rsq2); - ters_dthb(itype,jtype,ktype,prefactor,rij,delx1,dely1,delz1, - rik,delx2,dely2,delz2,fi,fj,fk); - - f_x += fi[0]; - f_y += fi[1]; - f_z += fi[2]; - - if (vflag_either) { - F_FLOAT delrij[3], delrik[3]; - delrij[0] = -delx1; delrij[1] = -dely1; delrij[2] = -delz1; - delrik[0] = -delx2; delrik[1] = -dely2; delrik[2] = -delz2; - if (vflag_either) this->template v_tally3(ev,i,j,k,fj,fk,delrij,delrik); - } - } - } - f(i,0) += f_x; - f(i,1) += f_y; - f(i,2) += f_z; -} - -template -template -KOKKOS_INLINE_FUNCTION -void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeFullA, const int &ii) const { - EV_FLOAT ev; - this->template operator()(TagPairTersoffMODComputeFullA(), ii, ev); -} - -/* ---------------------------------------------------------------------- */ - -template -template -KOKKOS_INLINE_FUNCTION -void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeFullB, const int &ii, EV_FLOAT& ev) const { - - const int i = d_ilist[ii]; - const X_FLOAT xtmp = x(i,0); - const X_FLOAT ytmp = x(i,1); - const X_FLOAT ztmp = x(i,2); - const int itype = type(i); - - int j,k,jj,kk,jtype,ktype,j_jnum; - F_FLOAT rsq1, cutsq1, rsq2, cutsq2, rij, rik, bo_ij; - F_FLOAT fj[3], fk[3]; - X_FLOAT delx1, dely1, delz1, delx2, dely2, delz2; - - const int jnum = d_numneigh_short[i]; - - F_FLOAT f_x = 0.0; - F_FLOAT f_y = 0.0; - F_FLOAT f_z = 0.0; - - // attractive: bond order - - for (jj = 0; jj < jnum; jj++) { - j = d_neighbors_short(i,jj); - j &= NEIGHMASK; - if (j >= nlocal) continue; - jtype = type(j); - - delx1 = x(j,0) - xtmp; - dely1 = x(j,1) - ytmp; - delz1 = x(j,2) - ztmp; - rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1; - cutsq1 = paramskk(jtype,itype,itype).cutsq; - - bo_ij = 0.0; - if (rsq1 > cutsq1) continue; - rij = sqrt(rsq1); - - j_jnum = d_numneigh_short[j]; - - for (kk = 0; kk < j_jnum; kk++) { - k = d_neighbors_short(j,kk); - if (k == i) continue; - k &= NEIGHMASK; - ktype = type(k); - - delx2 = x(j,0) - x(k,0); - dely2 = x(j,1) - x(k,1); - delz2 = x(j,2) - x(k,2); - rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - cutsq2 = paramskk(jtype,itype,ktype).cutsq; - - if (rsq2 > cutsq2) continue; - rik = sqrt(rsq2); - bo_ij += bondorder(jtype,itype,ktype,rij,delx1,dely1,delz1,rik,delx2,dely2,delz2); - - } - - // attractive: pairwise potential and force - - const F_FLOAT fa = ters_fa_k(jtype,itype,itype,rij); - const F_FLOAT dfa = ters_dfa(jtype,itype,itype,rij); - const F_FLOAT bij = ters_bij_k(jtype,itype,itype,bo_ij); - const F_FLOAT fatt = -0.5*bij * dfa / rij; - const F_FLOAT prefactor = 0.5*fa * ters_dbij(jtype,itype,itype,bo_ij); - const F_FLOAT eng = 0.5*bij * fa; - - f_x -= delx1*fatt; - f_y -= dely1*fatt; - f_z -= delz1*fatt; - - if (EVFLAG) { - if (eflag) - ev.evdwl += 0.5 * eng; - if (vflag_either || eflag_atom) - this->template ev_tally(ev,i,j,eng,fatt,delx1,dely1,delz1); - } - - // attractive: three-body force - - for (kk = 0; kk < j_jnum; kk++) { - k = d_neighbors_short(j,kk); - if (k == i) continue; - k &= NEIGHMASK; - ktype = type(k); - - delx2 = x(j,0) - x(k,0); - dely2 = x(j,1) - x(k,1); - delz2 = x(j,2) - x(k,2); - rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - cutsq2 = paramskk(jtype,itype,ktype).cutsq; - - if (rsq2 > cutsq2) continue; - rik = sqrt(rsq2); - ters_dthbj(jtype,itype,ktype,prefactor,rij,delx1,dely1,delz1, - rik,delx2,dely2,delz2,fj,fk); - f_x += fj[0]; - f_y += fj[1]; - f_z += fj[2]; - - if (vflag_either) { - F_FLOAT delrji[3], delrjk[3]; - delrji[0] = -delx1; delrji[1] = -dely1; delrji[2] = -delz1; - delrjk[0] = -delx2; delrjk[1] = -dely2; delrjk[2] = -delz2; - if (vflag_either) v_tally3_atom(ev,i,j,k,fj,fk,delrji,delrjk); - } - - const F_FLOAT fa_jk = ters_fa_k(jtype,ktype,itype,rik); - const F_FLOAT prefactor_jk = 0.5*fa_jk * ters_dbij(jtype,ktype,itype,bo_ij); - ters_dthbk(jtype,ktype,itype,prefactor_jk,rik,delx2,dely2,delz2, - rij,delx1,dely1,delz1,fk); - f_x += fk[0]; - f_y += fk[1]; - f_z += fk[2]; - } - } - f(i,0) += f_x; - f(i,1) += f_y; - f(i,2) += f_z; -} - -template -template -KOKKOS_INLINE_FUNCTION -void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeFullB, const int &ii) const { - EV_FLOAT ev; - this->template operator()(TagPairTersoffMODComputeFullB(), ii, ev); + this->template operator()(TagPairTersoffMODCompute(), ii, ev); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffMODKokkos::ters_fc_k(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffMODKokkos::ters_fc_k(const Param& param, const F_FLOAT &r) const { - const F_FLOAT ters_R = paramskk(i,j,k).bigr; - const F_FLOAT ters_D = paramskk(i,j,k).bigd; + const F_FLOAT ters_R = param.bigr; + const F_FLOAT ters_D = param.bigd; if (r < ters_R-ters_D) return 1.0; if (r > ters_R+ters_D) return 0.0; @@ -800,11 +501,10 @@ double PairTersoffMODKokkos::ters_fc_k(const int &i, const int &j, template KOKKOS_INLINE_FUNCTION -double PairTersoffMODKokkos::ters_dfc(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffMODKokkos::ters_dfc(const Param& param, const F_FLOAT &r) const { - const F_FLOAT ters_R = paramskk(i,j,k).bigr; - const F_FLOAT ters_D = paramskk(i,j,k).bigd; + const F_FLOAT ters_R = param.bigr; + const F_FLOAT ters_D = param.bigd; if (r < ters_R-ters_D) return 0.0; if (r > ters_R+ters_D) return 0.0; @@ -816,7 +516,7 @@ double PairTersoffMODKokkos::ters_dfc(const int &i, const int &j, template KOKKOS_INLINE_FUNCTION -double PairTersoffMODKokkos::bondorder(const int &i, const int &j, const int &k, +double PairTersoffMODKokkos::bondorder(const Param& param, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2) const { @@ -824,14 +524,15 @@ double PairTersoffMODKokkos::bondorder(const int &i, const int &j, c const F_FLOAT costheta = (dx1*dx2 + dy1*dy2 + dz1*dz2)/(rij*rik); - if (int(paramskk(i,j,k).powerm) == 3) arg = pow(paramskk(i,j,k).lam3 * (rij-rik),3.0); - else arg = paramskk(i,j,k).lam3 * (rij-rik); + const F_FLOAT paramtmp = param.lam3 * (rij-rik); + if (int(param.powerm) == 3) arg = paramtmp*paramtmp*paramtmp;//pow(param.lam3 * (rij-rik),3.0); + else arg = paramtmp; if (arg > 69.0776) ex_delr = 1.e30; else if (arg < -69.0776) ex_delr = 0.0; else ex_delr = exp(arg); - return ters_fc_k(i,j,k,rik) * ters_gijk(i,j,k,costheta) * ex_delr; + return ters_fc_k(param,rik) * ters_gijk(param,costheta) * ex_delr; } /* ---------------------------------------------------------------------- */ @@ -839,14 +540,14 @@ double PairTersoffMODKokkos::bondorder(const int &i, const int &j, c template KOKKOS_INLINE_FUNCTION double PairTersoffMODKokkos:: - ters_gijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const + ters_gijk(const Param& param, const F_FLOAT &cos) const { - const F_FLOAT ters_c1 = paramskk(i,j,k).c1; - const F_FLOAT ters_c2 = paramskk(i,j,k).c2; - const F_FLOAT ters_c3 = paramskk(i,j,k).c3; - const F_FLOAT ters_c4 = paramskk(i,j,k).c4; - const F_FLOAT ters_c5 = paramskk(i,j,k).c5; - const F_FLOAT tmp_h = (paramskk(i,j,k).h - cos)*(paramskk(i,j,k).h - cos); + const F_FLOAT ters_c1 = param.c1; + const F_FLOAT ters_c2 = param.c2; + const F_FLOAT ters_c3 = param.c3; + const F_FLOAT ters_c4 = param.c4; + const F_FLOAT ters_c5 = param.c5; + const F_FLOAT tmp_h = (param.h - cos)*(param.h - cos); return ters_c1 + (ters_c2*tmp_h/(ters_c3 + tmp_h)) * (1.0 + ters_c4*exp(-ters_c5*tmp_h)); @@ -858,17 +559,17 @@ double PairTersoffMODKokkos:: template KOKKOS_INLINE_FUNCTION double PairTersoffMODKokkos:: - ters_dgijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const + ters_dgijk(const Param& param, const F_FLOAT &cos) const { - const F_FLOAT ters_c2 = paramskk(i,j,k).c2; - const F_FLOAT ters_c3 = paramskk(i,j,k).c3; - const F_FLOAT ters_c4 = paramskk(i,j,k).c4; - const F_FLOAT ters_c5 = paramskk(i,j,k).c5; - const F_FLOAT tmp_h = (paramskk(i,j,k).h - cos)*(paramskk(i,j,k).h - cos); - const F_FLOAT g1 = (paramskk(i,j,k).h - cos)/(ters_c3 + tmp_h); + const F_FLOAT ters_c2 = param.c2; + const F_FLOAT ters_c3 = param.c3; + const F_FLOAT ters_c4 = param.c4; + const F_FLOAT ters_c5 = param.c5; + const F_FLOAT tmp_h = (param.h - cos)*(param.h - cos); + const F_FLOAT g1 = (param.h - cos)/(ters_c3 + tmp_h); const F_FLOAT g2 = exp(-ters_c5*tmp_h); - return -2.0*ters_c2*g1*((1 + ters_c4*g2)*(1 + g1*(cos - paramskk(i,j,k).h)) - + return -2.0*ters_c2*g1*((1 + ters_c4*g2)*(1 + g1*(cos - param.h)) - tmp_h*ters_c4*ters_c5*g2); } @@ -876,58 +577,54 @@ double PairTersoffMODKokkos:: template KOKKOS_INLINE_FUNCTION -double PairTersoffMODKokkos::ters_fa_k(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffMODKokkos::ters_fa_k(const Param& param, const F_FLOAT &r) const { - if (r > paramskk(i,j,k).bigr + paramskk(i,j,k).bigd) return 0.0; - return -paramskk(i,j,k).bigb * exp(-paramskk(i,j,k).lam2 * r) - * ters_fc_k(i,j,k,r); + if (r > param.bigr + param.bigd) return 0.0; + return -param.bigb * exp(-param.lam2 * r) + * ters_fc_k(param,r); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffMODKokkos::ters_dfa(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffMODKokkos::ters_dfa(const Param& param, const F_FLOAT &r) const { - if (r > paramskk(i,j,k).bigr + paramskk(i,j,k).bigd) return 0.0; - return paramskk(i,j,k).bigb * exp(-paramskk(i,j,k).lam2 * r) * - (paramskk(i,j,k).lam2 * ters_fc_k(i,j,k,r) - ters_dfc(i,j,k,r)); + if (r > param.bigr + param.bigd) return 0.0; + return param.bigb * exp(-param.lam2 * r) * + (param.lam2 * ters_fc_k(param,r) - ters_dfc(param,r)); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffMODKokkos::ters_bij_k(const int &i, const int &j, - const int &k, const F_FLOAT &bo) const +double PairTersoffMODKokkos::ters_bij_k(const Param& param, const F_FLOAT &bo) const { - const F_FLOAT tmp = paramskk(i,j,k).beta * bo; - if (tmp > paramskk(i,j,k).ca1) - return pow(tmp, -paramskk(i,j,k).powern/(2.0*paramskk(i,j,k).powern_del)); - if (tmp < paramskk(i,j,k).ca4) + const F_FLOAT tmp = param.beta * bo; + if (tmp > param.ca1) + return pow(tmp, -param.powern/(2.0*param.powern_del)); + if (tmp < param.ca4) return 1.0; - return pow(1.0 + pow(tmp,paramskk(i,j,k).powern), -1.0/(2.0*paramskk(i,j,k).powern_del)); + return pow(1.0 + pow(tmp,param.powern), -1.0/(2.0*param.powern_del)); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffMODKokkos::ters_dbij(const int &i, const int &j, - const int &k, const F_FLOAT &bo) const +double PairTersoffMODKokkos::ters_dbij(const Param& param, const F_FLOAT &bo) const { - const F_FLOAT tmp = paramskk(i,j,k).beta * bo; - if (tmp > paramskk(i,j,k).ca1) - return -0.5*(paramskk(i,j,k).powern/paramskk(i,j,k).powern_del)* - pow(tmp,-0.5*(paramskk(i,j,k).powern/paramskk(i,j,k).powern_del)) / bo; - if (tmp < paramskk(i,j,k).ca4) + const F_FLOAT tmp = param.beta * bo; + if (tmp > param.ca1) + return -0.5*(param.powern/param.powern_del)* + pow(tmp,-0.5*(param.powern/param.powern_del)) / bo; + if (tmp < param.ca4) return 0.0; - const F_FLOAT tmp_n = pow(tmp,paramskk(i,j,k).powern); - return -0.5 *(paramskk(i,j,k).powern/paramskk(i,j,k).powern_del)* - pow(1.0+tmp_n, -1.0-(1.0/(2.0*paramskk(i,j,k).powern_del)))*tmp_n / bo; + const F_FLOAT tmp_n = pow(tmp,param.powern); + return -0.5 *(param.powern/param.powern_del)* + pow(1.0+tmp_n, -1.0-(1.0/(2.0*param.powern_del)))*tmp_n / bo; } /* ---------------------------------------------------------------------- */ @@ -935,7 +632,7 @@ double PairTersoffMODKokkos::ters_dbij(const int &i, const int &j, template KOKKOS_INLINE_FUNCTION void PairTersoffMODKokkos::ters_dthb( - const int &i, const int &j, const int &k, const F_FLOAT &prefactor, + const Param& param, const F_FLOAT &prefactor, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk) const @@ -960,22 +657,24 @@ void PairTersoffMODKokkos::ters_dthb( F_FLOAT gijk,dgijk,ex_delr,dex_delr,fc,dfc,cos,tmp; F_FLOAT dcosfi[3],dcosfj[3],dcosfk[3]; - fc = ters_fc_k(i,j,k,rik); - dfc = ters_dfc(i,j,k,rik); - if (int(paramskk(i,j,k).powerm) == 3) tmp = pow(paramskk(i,j,k).lam3 * (rij-rik),3.0); - else tmp = paramskk(i,j,k).lam3 * (rij-rik); + fc = ters_fc_k(param,rik); + dfc = ters_dfc(param,rik); + + const F_FLOAT paramtmp = param.lam3 * (rij-rik); + if (int(param.powerm) == 3) tmp = paramtmp*paramtmp*paramtmp;//pow(param.lam3 * (rij-rik),3.0); + else tmp = paramtmp; if (tmp > 69.0776) ex_delr = 1.e30; else if (tmp < -69.0776) ex_delr = 0.0; else ex_delr = exp(tmp); - if (int(paramskk(i,j,k).powerm) == 3) - dex_delr = 3.0*pow(paramskk(i,j,k).lam3,3.0) * pow(rij-rik,2.0)*ex_delr; - else dex_delr = paramskk(i,j,k).lam3 * ex_delr; + if (int(param.powerm) == 3) + dex_delr = 3.0*paramtmp*paramtmp*param.lam3*ex_delr;//pow(rij-rik,2.0)*ex_delr; + else dex_delr = param.lam3 * ex_delr; cos = vec3_dot(rij_hat,rik_hat); - gijk = ters_gijk(i,j,k,cos); - dgijk = ters_dgijk(i,j,k,cos); + gijk = ters_gijk(param,cos); + dgijk = ters_dgijk(param,cos); // from PairTersoffMOD::costheta_d vec3_scaleadd(-cos,rij_hat,rik_hat,dcosfj); @@ -1007,7 +706,7 @@ void PairTersoffMODKokkos::ters_dthb( template KOKKOS_INLINE_FUNCTION void PairTersoffMODKokkos::ters_dthbj( - const int &i, const int &j, const int &k, const F_FLOAT &prefactor, + const Param& param, const F_FLOAT &prefactor, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, F_FLOAT *fj, F_FLOAT *fk) const @@ -1028,22 +727,23 @@ void PairTersoffMODKokkos::ters_dthbj( F_FLOAT gijk,dgijk,ex_delr,dex_delr,fc,dfc,cos,tmp; F_FLOAT dcosfi[3],dcosfj[3],dcosfk[3]; - fc = ters_fc_k(i,j,k,rik); - dfc = ters_dfc(i,j,k,rik); - if (int(paramskk(i,j,k).powerm) == 3) tmp = pow(paramskk(i,j,k).lam3 * (rij-rik),3.0); - else tmp = paramskk(i,j,k).lam3 * (rij-rik); + fc = ters_fc_k(param,rik); + dfc = ters_dfc(param,rik); + const F_FLOAT paramtmp = param.lam3 * (rij-rik); + if (int(param.powerm) == 3) tmp = paramtmp*paramtmp*paramtmp;//pow(param.lam3 * (rij-rik),3.0); + else tmp = paramtmp; if (tmp > 69.0776) ex_delr = 1.e30; else if (tmp < -69.0776) ex_delr = 0.0; else ex_delr = exp(tmp); - if (int(paramskk(i,j,k).powerm) == 3) - dex_delr = 3.0*pow(paramskk(i,j,k).lam3,3.0) * pow(rij-rik,2.0)*ex_delr; - else dex_delr = paramskk(i,j,k).lam3 * ex_delr; + if (int(param.powerm) == 3) + dex_delr = 3.0*paramtmp*paramtmp*param.lam3*ex_delr;//pow(param.lam3,3.0) * pow(rij-rik,2.0)*ex_delr; + else dex_delr = param.lam3 * ex_delr; cos = vec3_dot(rij_hat,rik_hat); - gijk = ters_gijk(i,j,k,cos); - dgijk = ters_dgijk(i,j,k,cos); + gijk = ters_gijk(param,cos); + dgijk = ters_dgijk(param,cos); vec3_scaleadd(-cos,rij_hat,rik_hat,dcosfj); vec3_scale(rijinv,dcosfj,dcosfj); @@ -1068,7 +768,7 @@ void PairTersoffMODKokkos::ters_dthbj( template KOKKOS_INLINE_FUNCTION void PairTersoffMODKokkos::ters_dthbk( - const int &i, const int &j, const int &k, const F_FLOAT &prefactor, + const Param& param, const F_FLOAT &prefactor, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, F_FLOAT *fk) const @@ -1089,22 +789,23 @@ void PairTersoffMODKokkos::ters_dthbk( F_FLOAT gijk,dgijk,ex_delr,dex_delr,fc,dfc,cos,tmp; F_FLOAT dcosfi[3],dcosfj[3],dcosfk[3]; - fc = ters_fc_k(i,j,k,rik); - dfc = ters_dfc(i,j,k,rik); - if (int(paramskk(i,j,k).powerm) == 3) tmp = pow(paramskk(i,j,k).lam3 * (rij-rik),3.0); - else tmp = paramskk(i,j,k).lam3 * (rij-rik); + fc = ters_fc_k(param,rik); + dfc = ters_dfc(param,rik); + const F_FLOAT paramtmp = param.lam3 * (rij-rik); + if (int(param.powerm) == 3) tmp = paramtmp*paramtmp*paramtmp;//pow(param.lam3 * (rij-rik),3.0); + else tmp = paramtmp; if (tmp > 69.0776) ex_delr = 1.e30; else if (tmp < -69.0776) ex_delr = 0.0; else ex_delr = exp(tmp); - if (int(paramskk(i,j,k).powerm) == 3) - dex_delr = 3.0*pow(paramskk(i,j,k).lam3,3.0) * pow(rij-rik,2.0)*ex_delr; - else dex_delr = paramskk(i,j,k).lam3 * ex_delr; + if (int(param.powerm) == 3) + dex_delr = 3.0*paramtmp*paramtmp*param.lam3*ex_delr;//pow(param.lam3,3.0) * pow(rij-rik,2.0)*ex_delr; + else dex_delr = param.lam3 * ex_delr; cos = vec3_dot(rij_hat,rik_hat); - gijk = ters_gijk(i,j,k,cos); - dgijk = ters_dgijk(i,j,k,cos); + gijk = ters_gijk(param,cos); + dgijk = ters_dgijk(param,cos); vec3_scaleadd(-cos,rij_hat,rik_hat,dcosfj); vec3_scale(rijinv,dcosfj,dcosfj); @@ -1117,7 +818,6 @@ void PairTersoffMODKokkos::ters_dthbk( vec3_scaleadd(fc*dgijk*ex_delr,dcosfk,fk,fk); vec3_scaleadd(-fc*gijk*dex_delr,rik_hat,fk,fk); vec3_scale(prefactor,fk,fk); - } /* ---------------------------------------------------------------------- */ @@ -1129,8 +829,6 @@ void PairTersoffMODKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const { - const int VFLAG = vflag_either; - // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); @@ -1142,10 +840,10 @@ void PairTersoffMODKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; a_eatom[i] += epairhalf; - if (NEIGHFLAG != FULL) a_eatom[j] += epairhalf; + a_eatom[j] += epairhalf; } - if (VFLAG) { + if (vflag_either) { const E_FLOAT v0 = delx*delx*fpair; const E_FLOAT v1 = dely*dely*fpair; const E_FLOAT v2 = delz*delz*fpair; @@ -1154,21 +852,12 @@ void PairTersoffMODKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons const E_FLOAT v5 = dely*delz*fpair; if (vflag_global) { - if (NEIGHFLAG != FULL) { - ev.v[0] += v0; - ev.v[1] += v1; - ev.v[2] += v2; - ev.v[3] += v3; - ev.v[4] += v4; - ev.v[5] += v5; - } else { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } + ev.v[0] += v0; + ev.v[1] += v1; + ev.v[2] += v2; + ev.v[3] += v3; + ev.v[4] += v4; + ev.v[5] += v5; } if (vflag_atom) { @@ -1179,14 +868,12 @@ void PairTersoffMODKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons a_vatom(i,4) += 0.5*v4; a_vatom(i,5) += 0.5*v5; - if (NEIGHFLAG != FULL) { - a_vatom(j,0) += 0.5*v0; - a_vatom(j,1) += 0.5*v1; - a_vatom(j,2) += 0.5*v2; - a_vatom(j,3) += 0.5*v3; - a_vatom(j,4) += 0.5*v4; - a_vatom(j,5) += 0.5*v5; - } + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; } } } @@ -1232,14 +919,13 @@ void PairTersoffMODKokkos::v_tally3(EV_FLOAT &ev, const int &i, cons a_vatom(i,0) += v[0]; a_vatom(i,1) += v[1]; a_vatom(i,2) += v[2]; a_vatom(i,3) += v[3]; a_vatom(i,4) += v[4]; a_vatom(i,5) += v[5]; - if (NEIGHFLAG != FULL) { - a_vatom(j,0) += v[0]; a_vatom(j,1) += v[1]; a_vatom(j,2) += v[2]; - a_vatom(j,3) += v[3]; a_vatom(j,4) += v[4]; a_vatom(j,5) += v[5]; - a_vatom(k,0) += v[0]; a_vatom(k,1) += v[1]; a_vatom(k,2) += v[2]; - a_vatom(k,3) += v[3]; a_vatom(k,4) += v[4]; a_vatom(k,5) += v[5]; - } - } + a_vatom(j,0) += v[0]; a_vatom(j,1) += v[1]; a_vatom(j,2) += v[2]; + a_vatom(j,3) += v[3]; a_vatom(j,4) += v[4]; a_vatom(j,5) += v[5]; + + a_vatom(k,0) += v[0]; a_vatom(k,1) += v[1]; a_vatom(k,2) += v[2]; + a_vatom(k,3) += v[3]; a_vatom(k,4) += v[4]; a_vatom(k,5) += v[5]; + } } /* ---------------------------------------------------------------------- */ @@ -1289,4 +975,3 @@ template class PairTersoffMODKokkos; template class PairTersoffMODKokkos; #endif } - diff --git a/src/KOKKOS/pair_tersoff_mod_kokkos.h b/src/KOKKOS/pair_tersoff_mod_kokkos.h index ec7eb1ce92..1eb6f6f555 100644 --- a/src/KOKKOS/pair_tersoff_mod_kokkos.h +++ b/src/KOKKOS/pair_tersoff_mod_kokkos.h @@ -30,20 +30,14 @@ PairStyle(tersoff/mod/kk/host,PairTersoffMODKokkos); namespace LAMMPS_NS { template -struct TagPairTersoffMODComputeHalf{}; - -template -struct TagPairTersoffMODComputeFullA{}; - -template -struct TagPairTersoffMODComputeFullB{}; +struct TagPairTersoffMODCompute{}; struct TagPairTersoffMODComputeShortNeigh{}; template class PairTersoffMODKokkos : public PairTersoffMOD { public: - enum {EnabledNeighFlags=FULL}; + enum {EnabledNeighFlags=HALF|HALFTHREAD}; enum {COUL_FLAG=0}; typedef DeviceType device_type; typedef ArrayTypes AT; @@ -52,81 +46,66 @@ class PairTersoffMODKokkos : public PairTersoffMOD { PairTersoffMODKokkos(class LAMMPS *); ~PairTersoffMODKokkos() override; void compute(int, int) override; + void coeff(int, char **) override; void init_style() override; template KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffMODComputeHalf, const int&, EV_FLOAT&) const; + void operator()(TagPairTersoffMODCompute, const int&, EV_FLOAT&) const; template KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffMODComputeHalf, const int&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffMODComputeFullA, const int&, EV_FLOAT&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffMODComputeFullA, const int&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffMODComputeFullB, const int&, EV_FLOAT&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffMODComputeFullB, const int&) const; + void operator()(TagPairTersoffMODCompute, const int&) const; KOKKOS_INLINE_FUNCTION void operator()(TagPairTersoffMODComputeShortNeigh, const int&) const; KOKKOS_INLINE_FUNCTION - double ters_fc_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double ters_fc_k(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - double ters_dfc(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double ters_dfc(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - double ters_fa_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double ters_fa_k(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - double ters_dfa(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double ters_dfa(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - double ters_bij_k(const int &i, const int &j, const int &k, const F_FLOAT &bo) const; + double ters_bij_k(const Param& param, const F_FLOAT &bo) const; KOKKOS_INLINE_FUNCTION - double ters_dbij(const int &i, const int &j, const int &k, const F_FLOAT &bo) const; + double ters_dbij(const Param& param, const F_FLOAT &bo) const; KOKKOS_INLINE_FUNCTION - double bondorder(const int &i, const int &j, const int &k, - const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, - const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2) const; + double bondorder(const Param& param, + const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, + const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2) const; KOKKOS_INLINE_FUNCTION - double ters_gijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const; + double ters_gijk(const Param& param, const F_FLOAT &cos) const; KOKKOS_INLINE_FUNCTION - double ters_dgijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const; + double ters_dgijk(const Param& param, const F_FLOAT &cos) const; KOKKOS_INLINE_FUNCTION - void ters_dthb(const int &i, const int &j, const int &k, const F_FLOAT &prefactor, - const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, - const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, - F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk) const; + void ters_dthb(const Param& param, const F_FLOAT &prefactor, + const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, + const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, + F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk) const; KOKKOS_INLINE_FUNCTION - void ters_dthbj(const int &i, const int &j, const int &k, const F_FLOAT &prefactor, - const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, - const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, - F_FLOAT *fj, F_FLOAT *fk) const; + void ters_dthbj(const Param& param, const F_FLOAT &prefactor, + const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, + const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, + F_FLOAT *fj, F_FLOAT *fk) const; KOKKOS_INLINE_FUNCTION - void ters_dthbk(const int &i, const int &j, const int &k, const F_FLOAT &prefactor, - const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, - const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, - F_FLOAT *fk) const; + void ters_dthbk(const Param& param, const F_FLOAT &prefactor, + const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, + const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, + F_FLOAT *fk) const; KOKKOS_INLINE_FUNCTION double vec3_dot(const F_FLOAT x[3], const double y[3]) const { @@ -151,17 +130,6 @@ class PairTersoffMODKokkos : public PairTersoffMOD { KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const; - struct params_ters { - KOKKOS_INLINE_FUNCTION - params_ters() {powerm=0;lam3=0;h=0;powern=0;beta=0;lam2=0;bigb=0;bigr=0;bigd=0; - lam1=0;biga=0;powern_del=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;c5=0;ca1=0;ca4=0;}; - KOKKOS_INLINE_FUNCTION - params_ters(int /*i*/) {powerm=0;lam3=0;h=0;powern=0;beta=0;lam2=0;bigb=0;bigr=0;bigd=0; - lam1=0;biga=0;powern_del=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;c5=0;ca1=0;ca4=0;}; - F_FLOAT powerm, lam3, h, powern, beta, lam2, bigb, bigr, bigd, - lam1, biga, powern_del, cutsq, c1, c2, c3, c4, c5, ca1, ca4; - }; - template KOKKOS_INLINE_FUNCTION void ev_tally(EV_FLOAT &ev, const int &i, const int &j, @@ -171,24 +139,27 @@ class PairTersoffMODKokkos : public PairTersoffMOD { template KOKKOS_INLINE_FUNCTION void v_tally3(EV_FLOAT &ev, const int &i, const int &j, const int &k, - F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drij, F_FLOAT *drik) const; + F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drij, F_FLOAT *drik) const; KOKKOS_INLINE_FUNCTION void v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k, - F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const; + F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const; - void allocate() override; void setup_params() override; protected: - using KKDeviceType = typename KKDevice::value; - typedef Kokkos::DualView tdual_int_3d; - Kokkos::DualView k_params; - typename Kokkos::DualView::t_dev_const_um paramskk; - // hardwired to space for 12 atom types - //params_ters m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1]; + typedef typename tdual_int_3d::t_dev_const_randomread t_int_3d_randomread; + typedef typename tdual_int_3d::t_host t_host_int_3d; + + t_int_3d_randomread d_elem3param; + typename AT::t_int_1d_randomread d_map; + + typedef Kokkos::DualView tdual_param_1d; + typedef typename tdual_param_1d::t_dev t_param_1d; + typedef typename tdual_param_1d::t_host t_host_param_1d; + + t_param_1d d_params; int inum; typename AT::t_x_array_randomread x; @@ -203,6 +174,7 @@ class PairTersoffMODKokkos : public PairTersoffMOD { int need_dup; + using KKDeviceType = typename KKDevice::value; template using DupScatterView = KKScatterView; @@ -213,6 +185,7 @@ class PairTersoffMODKokkos : public PairTersoffMOD { DupScatterView dup_f; DupScatterView dup_eatom; DupScatterView dup_vatom; + NonDupScatterView ndup_f; NonDupScatterView ndup_eatom; NonDupScatterView ndup_vatom; @@ -242,11 +215,7 @@ class PairTersoffMODKokkos : public PairTersoffMOD { /* ERROR/WARNING messages: -E: Cannot (yet) use full neighbor list style with tersoff/mod/kk - -Self-explanatory. - -E: Cannot use chosen neighbor list style with tersoff/mod/kk +E: Must use half neighbor list style with pair tersoff/mod/kk Self-explanatory. diff --git a/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp b/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp index 56c73cc3ce..4068f14f6d 100644 --- a/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp @@ -78,18 +78,29 @@ PairTersoffZBLKokkos::~PairTersoffZBLKokkos() } } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + set coeffs for one or more type pairs +------------------------------------------------------------------------- */ template -void PairTersoffZBLKokkos::allocate() +void PairTersoffZBLKokkos::coeff(int narg, char **arg) { - PairTersoffZBL::allocate(); + PairTersoffZBL::coeff(narg,arg); + + // sync map int n = atom->ntypes; - k_params = Kokkos::DualView - ("PairTersoffZBL::paramskk",n+1,n+1,n+1); - paramskk = k_params.template view(); + DAT::tdual_int_1d k_map = DAT::tdual_int_1d("pair:map",n+1); + HAT::t_int_1d h_map = k_map.h_view; + + for (int i = 1; i <= n; i++) + h_map[i] = map[i]; + + k_map.template modify(); + k_map.template sync(); + + d_map = k_map.template view(); } /* ---------------------------------------------------------------------- @@ -108,9 +119,9 @@ void PairTersoffZBLKokkos::init_style() request->set_kokkos_host(std::is_same::value && !std::is_same::value); request->set_kokkos_device(std::is_same::value); - request->enable_full(); + if (neighflag == FULL) - error->all(FLERR,"Cannot (yet) use full neighbor list style with tersoff/zbl/kk"); + error->all(FLERR,"Must use half neighbor list style with pair tersoff/kk"); } /* ---------------------------------------------------------------------- */ @@ -120,40 +131,29 @@ void PairTersoffZBLKokkos::setup_params() { PairTersoffZBL::setup_params(); - int i,j,k,m; - int n = atom->ntypes; + // sync elem3param and params - for (i = 1; i <= n; i++) - for (j = 1; j <= n; j++) - for (k = 1; k <= n; k++) { - m = elem3param[map[i]][map[j]][map[k]]; - k_params.h_view(i,j,k).powerm = params[m].powerm; - k_params.h_view(i,j,k).gamma = params[m].gamma; - k_params.h_view(i,j,k).lam3 = params[m].lam3; - k_params.h_view(i,j,k).c = params[m].c; - k_params.h_view(i,j,k).d = params[m].d; - k_params.h_view(i,j,k).h = params[m].h; - k_params.h_view(i,j,k).powern = params[m].powern; - k_params.h_view(i,j,k).beta = params[m].beta; - k_params.h_view(i,j,k).lam2 = params[m].lam2; - k_params.h_view(i,j,k).bigb = params[m].bigb; - k_params.h_view(i,j,k).bigr = params[m].bigr; - k_params.h_view(i,j,k).bigd = params[m].bigd; - k_params.h_view(i,j,k).lam1 = params[m].lam1; - k_params.h_view(i,j,k).biga = params[m].biga; - k_params.h_view(i,j,k).cutsq = params[m].cutsq; - k_params.h_view(i,j,k).c1 = params[m].c1; - k_params.h_view(i,j,k).c2 = params[m].c2; - k_params.h_view(i,j,k).c3 = params[m].c3; - k_params.h_view(i,j,k).c4 = params[m].c4; - k_params.h_view(i,j,k).Z_i = params[m].Z_i; - k_params.h_view(i,j,k).Z_j = params[m].Z_j; - k_params.h_view(i,j,k).ZBLcut = params[m].ZBLcut; - k_params.h_view(i,j,k).ZBLexpscale = params[m].ZBLexpscale; - } + tdual_int_3d k_elem3param = tdual_int_3d("pair:elem3param",nelements,nelements,nelements); + t_host_int_3d h_elem3param = k_elem3param.h_view; - k_params.template modify(); + tdual_param_1d k_params = tdual_param_1d("pair:params",nparams); + t_host_param_1d h_params = k_params.h_view; + for (int i = 0; i < nelements; i++) + for (int j = 0; j < nelements; j++) + for (int k = 0; k < nelements; k++) + h_elem3param(i,j,k) = elem3param[i][j][k]; + + for (int m = 0; m < nparams; m++) + h_params[m] = params[m]; + + k_elem3param.modify_host(); + k_elem3param.template sync(); + k_params.modify_host(); + k_params.template sync(); + + d_elem3param = k_elem3param.template view(); + d_params = k_params.template view(); } /* ---------------------------------------------------------------------- */ @@ -164,8 +164,6 @@ void PairTersoffZBLKokkos::compute(int eflag_in, int vflag_in) eflag = eflag_in; vflag = vflag_in; - if (neighflag == FULL) no_virial_fdotr_compute = 1; - ev_init(eflag,vflag,0); // reallocate per-atom arrays if necessary @@ -182,7 +180,6 @@ void PairTersoffZBLKokkos::compute(int eflag_in, int vflag_in) } atomKK->sync(execution_space,datamask_read); - k_params.template sync(); if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); else atomKK->modified(execution_space,F_MASK); @@ -221,37 +218,25 @@ void PairTersoffZBLKokkos::compute(int eflag_in, int vflag_in) int max_neighs = d_neighbors.extent(1); - if (((int)d_neighbors_short.extent(1) != max_neighs) || - ((int)d_neighbors_short.extent(0) != ignum)) { - d_neighbors_short = Kokkos::View("Tersoff::neighbors_short",ignum,max_neighs); + if (((int)d_neighbors_short.extent(1) < max_neighs) || + ((int)d_neighbors_short.extent(0) < ignum)) { + d_neighbors_short = Kokkos::View("Tersoff::neighbors_short",ignum*1.2,max_neighs); } - if ((int)d_numneigh_short.extent(0)!=ignum) - d_numneigh_short = Kokkos::View("Tersoff::numneighs_short",ignum); - Kokkos::parallel_for(Kokkos::RangePolicy(0,neighflag==FULL?ignum:inum), *this); + if ((int)d_numneigh_short.extent(0) < ignum) + d_numneigh_short = Kokkos::View("Tersoff::numneighs_short",ignum*1.2); + Kokkos::parallel_for(Kokkos::RangePolicy(0,inum), *this); if (neighflag == HALF) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } else if (neighflag == HALFTHREAD) { if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - ev_all += ev; - } else if (neighflag == FULL) { - if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,inum),*this,ev); - else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); - ev_all += ev; - - if (evflag) - Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,ignum),*this,ev); - else - Kokkos::parallel_for(Kokkos::RangePolicy >(0,ignum),*this); + Kokkos::parallel_for(Kokkos::RangePolicy >(0,inum),*this); ev_all += ev; } @@ -303,6 +288,7 @@ void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeShortN const X_FLOAT xtmp = x(i,0); const X_FLOAT ytmp = x(i,1); const X_FLOAT ztmp = x(i,2); + const F_FLOAT cutmax_sq = cutmax*cutmax; const int jnum = d_numneigh[i]; int inside = 0; @@ -315,12 +301,12 @@ void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeShortN const X_FLOAT delz = ztmp - x(j,2); const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; - if (rsq < cutmax*cutmax) { - d_neighbors_short(i,inside) = j; + if (rsq < cutmax_sq) { + d_neighbors_short(ii,inside) = j; inside++; } } - d_numneigh_short(i) = inside; + d_numneigh_short(ii) = inside; } /* ---------------------------------------------------------------------- */ @@ -328,25 +314,25 @@ void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeShortN template template KOKKOS_INLINE_FUNCTION -void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeHalf, const int &ii, EV_FLOAT& ev) const { +void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLCompute, const int &ii, EV_FLOAT& ev) const { // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access>(); + const auto v_f = ScatterViewHelper,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + const auto a_f = v_f.template access>(); const int i = d_ilist[ii]; if (i >= nlocal) return; const X_FLOAT xtmp = x(i,0); const X_FLOAT ytmp = x(i,1); const X_FLOAT ztmp = x(i,2); - const int itype = type(i); + const int itype = d_map(type(i)); const tagint itag = tag(i); F_FLOAT fi[3], fj[3], fk[3]; //const AtomNeighborsConst d_neighbors_i = k_list.get_neighbors_const(i); - const int jnum = d_numneigh_short[i]; + const int jnum = d_numneigh_short[ii]; // repulsive @@ -355,9 +341,8 @@ void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeHalf jtag) { @@ -374,26 +359,27 @@ void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeHalf cutsq) continue; // Tersoff repulsive portion const F_FLOAT r = sqrt(rsq); - const F_FLOAT tmp_fce = ters_fc_k(itype,jtype,jtype,r); - const F_FLOAT tmp_fcd = ters_dfc(itype,jtype,jtype,r); - const F_FLOAT tmp_exp = exp(-paramskk(itype,jtype,jtype).lam1 * r); - const F_FLOAT frep_t = paramskk(itype,jtype,jtype).biga * tmp_exp * - (tmp_fcd - tmp_fce*paramskk(itype,jtype,jtype).lam1); - const F_FLOAT eng_t = tmp_fce * paramskk(itype,jtype,jtype).biga * tmp_exp; + const F_FLOAT tmp_fce = ters_fc_k(d_params(iparam_ij),r); + const F_FLOAT tmp_fcd = ters_dfc(d_params(iparam_ij),r); + const F_FLOAT tmp_exp = exp(-d_params(iparam_ij).lam1 * r); + const F_FLOAT frep_t = d_params(iparam_ij).biga * tmp_exp * + (tmp_fcd - tmp_fce*d_params(iparam_ij).lam1); + const F_FLOAT eng_t = tmp_fce * d_params(iparam_ij).biga * tmp_exp; // ZBL repulsive portion const F_FLOAT esq = pow(global_e,2.0); const F_FLOAT a_ij = (0.8854*global_a_0) / - (pow(paramskk(itype,jtype,jtype).Z_i,0.23) + pow(paramskk(itype,jtype,jtype).Z_j,0.23)); - const F_FLOAT premult = (paramskk(itype,jtype,jtype).Z_i * paramskk(itype,jtype,jtype).Z_j * esq)/ + (pow(d_params(iparam_ij).Z_i,0.23) + pow(d_params(iparam_ij).Z_j,0.23)); + const F_FLOAT premult = (d_params(iparam_ij).Z_i * d_params(iparam_ij).Z_j * esq)/ (4.0*MY_PI*global_epsilon_0); const F_FLOAT r_ov_a = r/a_ij; const F_FLOAT phi = 0.1818*exp(-3.2*r_ov_a) + 0.5099*exp(-0.9423*r_ov_a) + @@ -408,13 +394,13 @@ void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeHalf::operator()(TagPairTersoffZBLComputeHalf cutsq1) continue; @@ -448,28 +434,28 @@ void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeHalf cutsq2) continue; const F_FLOAT rik = sqrt(rsq2); - bo_ij += bondorder(itype,jtype,ktype,rij,delx1,dely1,delz1,rik,delx2,dely2,delz2); + bo_ij += bondorder(d_params(iparam_ijk),rij,delx1,dely1,delz1,rik,delx2,dely2,delz2); } // attractive: pairwise potential and force - const F_FLOAT fa = ters_fa_k(itype,jtype,jtype,rij); - const F_FLOAT dfa = ters_dfa(itype,jtype,jtype,rij); - const F_FLOAT bij = ters_bij_k(itype,jtype,jtype,bo_ij); + const F_FLOAT fa = ters_fa_k(d_params(iparam_ij),rij); + const F_FLOAT dfa = ters_dfa(d_params(iparam_ij),rij); + const F_FLOAT bij = ters_bij_k(d_params(iparam_ij),bo_ij); const F_FLOAT fatt = -0.5*bij * dfa / rij; - const F_FLOAT prefactor = 0.5*fa * ters_dbij(itype,jtype,jtype,bo_ij); + const F_FLOAT prefactor = 0.5*fa * ters_dbij(d_params(iparam_ij),bo_ij); f_x += delx1*fatt; f_y += dely1*fatt; @@ -489,19 +475,19 @@ void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeHalf cutsq2) continue; const F_FLOAT rik = sqrt(rsq2); - ters_dthb(itype,jtype,ktype,prefactor,rij,delx1,dely1,delz1, + ters_dthb(d_params(iparam_ijk),prefactor,rij,delx1,dely1,delz1, rik,delx2,dely2,delz2,fi,fj,fk); f_x += fi[0]; @@ -521,6 +507,7 @@ void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeHalftemplate v_tally3(ev,i,j,k,fj,fk,delrij,delrik); } } + a_f(j,0) += fj_x; a_f(j,1) += fj_y; a_f(j,2) += fj_z; @@ -533,339 +520,19 @@ void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeHalf template KOKKOS_INLINE_FUNCTION -void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeHalf, const int &ii) const { +void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLCompute, const int &ii) const { EV_FLOAT ev; - this->template operator()(TagPairTersoffZBLComputeHalf(), ii, ev); -} - -/* ---------------------------------------------------------------------- */ - -template -template -KOKKOS_INLINE_FUNCTION -void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeFullA, const int &ii, EV_FLOAT& ev) const { - - const int i = d_ilist[ii]; - const X_FLOAT xtmp = x(i,0); - const X_FLOAT ytmp = x(i,1); - const X_FLOAT ztmp = x(i,2); - const int itype = type(i); - - int j,k,jj,kk,jtype,ktype; - F_FLOAT rsq1, cutsq1, rsq2, cutsq2, rij, rik, bo_ij; - F_FLOAT fi[3], fj[3], fk[3]; - X_FLOAT delx1, dely1, delz1, delx2, dely2, delz2; - - //const AtomNeighborsConst d_neighbors_i = k_list.get_neighbors_const(i); - const int jnum = d_numneigh[i]; - - // repulsive - - F_FLOAT f_x = 0.0; - F_FLOAT f_y = 0.0; - F_FLOAT f_z = 0.0; - for (jj = 0; jj < jnum; jj++) { - j = d_neighbors_short(i,jj); - j &= NEIGHMASK; - const int jtype = type(j); - - const X_FLOAT delx = xtmp - x(j,0); - const X_FLOAT dely = ytmp - x(j,1); - const X_FLOAT delz = ztmp - x(j,2); - const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; - const F_FLOAT cutsq = paramskk(itype,jtype,jtype).cutsq; - - if (rsq > cutsq) continue; - - // Tersoff repulsive portion - - const F_FLOAT r = sqrt(rsq); - const F_FLOAT tmp_fce = ters_fc_k(itype,jtype,jtype,r); - const F_FLOAT tmp_fcd = ters_dfc(itype,jtype,jtype,r); - const F_FLOAT tmp_exp = exp(-paramskk(itype,jtype,jtype).lam1 * r); - const F_FLOAT frep_t = paramskk(itype,jtype,jtype).biga * tmp_exp * - (tmp_fcd - tmp_fce*paramskk(itype,jtype,jtype).lam1); - const F_FLOAT eng_t = tmp_fce * paramskk(itype,jtype,jtype).biga * tmp_exp; - - // ZBL repulsive portion - - const F_FLOAT esq = pow(global_e,2.0); - const F_FLOAT a_ij = (0.8854*global_a_0) / - (pow(paramskk(itype,jtype,jtype).Z_i,0.23) + pow(paramskk(itype,jtype,jtype).Z_j,0.23)); - const F_FLOAT premult = (paramskk(itype,jtype,jtype).Z_i * paramskk(itype,jtype,jtype).Z_j * esq)/ - (4.0*MY_PI*global_epsilon_0); - const F_FLOAT r_ov_a = r/a_ij; - const F_FLOAT phi = 0.1818*exp(-3.2*r_ov_a) + 0.5099*exp(-0.9423*r_ov_a) + - 0.2802*exp(-0.4029*r_ov_a) + 0.02817*exp(-0.2016*r_ov_a); - const F_FLOAT dphi = (1.0/a_ij) * (-3.2*0.1818*exp(-3.2*r_ov_a) - - 0.9423*0.5099*exp(-0.9423*r_ov_a) - - 0.4029*0.2802*exp(-0.4029*r_ov_a) - - 0.2016*0.02817*exp(-0.2016*r_ov_a)); - const F_FLOAT frep_z = premult*-phi/rsq + premult*dphi/r; - const F_FLOAT eng_z = premult*(1.0/r)*phi; - - // combine two parts with smoothing by Fermi-like function - - F_FLOAT frep, eng; - frep = -(-fermi_d_k(itype,jtype,jtype,r) * eng_z + - (1.0 - fermi_k(itype,jtype,jtype,r))*frep_z + - fermi_d_k(itype,jtype,jtype,r)*eng_t + fermi_k(itype,jtype,jtype,r)*frep_t) / r; - - if (eflag) - eng = (1.0 - fermi_k(itype,jtype,jtype,r)) * eng_z + - fermi_k(itype,jtype,jtype,r) * eng_t; - - f_x += delx*frep; - f_y += dely*frep; - f_z += delz*frep; - - if (EVFLAG) { - if (eflag) - ev.evdwl += 0.5*eng; - if (vflag_either || eflag_atom) - this->template ev_tally(ev,i,j,eng,frep,delx,dely,delz); - } - } - - // attractive: bond order - - for (jj = 0; jj < jnum; jj++) { - j = d_neighbors_short(i,jj); - j &= NEIGHMASK; - jtype = type(j); - - delx1 = xtmp - x(j,0); - dely1 = ytmp - x(j,1); - delz1 = ztmp - x(j,2); - rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1; - cutsq1 = paramskk(itype,jtype,jtype).cutsq; - - bo_ij = 0.0; - if (rsq1 > cutsq1) continue; - rij = sqrt(rsq1); - - for (kk = 0; kk < jnum; kk++) { - if (jj == kk) continue; - k = d_neighbors_short(i,kk); - k &= NEIGHMASK; - ktype = type(k); - - delx2 = xtmp - x(k,0); - dely2 = ytmp - x(k,1); - delz2 = ztmp - x(k,2); - rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - cutsq2 = paramskk(itype,jtype,ktype).cutsq; - - if (rsq2 > cutsq2) continue; - rik = sqrt(rsq2); - bo_ij += bondorder(itype,jtype,ktype,rij,delx1,dely1,delz1,rik,delx2,dely2,delz2); - } - - // attractive: pairwise potential and force - - const F_FLOAT fa = ters_fa_k(itype,jtype,jtype,rij); - const F_FLOAT dfa = ters_dfa(itype,jtype,jtype,rij); - const F_FLOAT bij = ters_bij_k(itype,jtype,jtype,bo_ij); - const F_FLOAT fatt = -0.5*bij * dfa / rij; - const F_FLOAT prefactor = 0.5*fa * ters_dbij(itype,jtype,jtype,bo_ij); - const F_FLOAT eng = 0.5*bij * fa; - - f_x += delx1*fatt; - f_y += dely1*fatt; - f_z += delz1*fatt; - - if (EVFLAG) { - if (eflag) ev.evdwl += 0.5*eng; - if (vflag_either || eflag_atom) - this->template ev_tally(ev,i,j,eng,fatt,delx1,dely1,delz1); - } - - // attractive: three-body force - - for (kk = 0; kk < jnum; kk++) { - if (jj == kk) continue; - k = d_neighbors_short(i,kk); - k &= NEIGHMASK; - ktype = type(k); - - delx2 = xtmp - x(k,0); - dely2 = ytmp - x(k,1); - delz2 = ztmp - x(k,2); - rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - cutsq2 = paramskk(itype,jtype,ktype).cutsq; - - if (rsq2 > cutsq2) continue; - rik = sqrt(rsq2); - ters_dthb(itype,jtype,ktype,prefactor,rij,delx1,dely1,delz1, - rik,delx2,dely2,delz2,fi,fj,fk); - - f_x += fi[0]; - f_y += fi[1]; - f_z += fi[2]; - - if (vflag_either) { - F_FLOAT delrij[3], delrik[3]; - delrij[0] = -delx1; delrij[1] = -dely1; delrij[2] = -delz1; - delrik[0] = -delx2; delrik[1] = -dely2; delrik[2] = -delz2; - if (vflag_either) this->template v_tally3(ev,i,j,k,fj,fk,delrij,delrik); - } - } - } - f(i,0) += f_x; - f(i,1) += f_y; - f(i,2) += f_z; -} - -template -template -KOKKOS_INLINE_FUNCTION -void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeFullA, const int &ii) const { - EV_FLOAT ev; - this->template operator()(TagPairTersoffZBLComputeFullA(), ii, ev); -} - -/* ---------------------------------------------------------------------- */ - -template -template -KOKKOS_INLINE_FUNCTION -void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeFullB, const int &ii, EV_FLOAT& ev) const { - - const int i = d_ilist[ii]; - const X_FLOAT xtmp = x(i,0); - const X_FLOAT ytmp = x(i,1); - const X_FLOAT ztmp = x(i,2); - const int itype = type(i); - - int j,k,jj,kk,jtype,ktype,j_jnum; - F_FLOAT rsq1, cutsq1, rsq2, cutsq2, rij, rik, bo_ij; - F_FLOAT fj[3], fk[3]; - X_FLOAT delx1, dely1, delz1, delx2, dely2, delz2; - - const int jnum = d_numneigh_short[i]; - - F_FLOAT f_x = 0.0; - F_FLOAT f_y = 0.0; - F_FLOAT f_z = 0.0; - - // attractive: bond order - - for (jj = 0; jj < jnum; jj++) { - j = d_neighbors_short(i,jj); - j &= NEIGHMASK; - if (j >= nlocal) continue; - jtype = type(j); - - delx1 = x(j,0) - xtmp; - dely1 = x(j,1) - ytmp; - delz1 = x(j,2) - ztmp; - rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1; - cutsq1 = paramskk(jtype,itype,itype).cutsq; - - bo_ij = 0.0; - if (rsq1 > cutsq1) continue; - rij = sqrt(rsq1); - - j_jnum = d_numneigh_short[j]; - - for (kk = 0; kk < j_jnum; kk++) { - k = d_neighbors_short(j,kk); - if (k == i) continue; - k &= NEIGHMASK; - ktype = type(k); - - delx2 = x(j,0) - x(k,0); - dely2 = x(j,1) - x(k,1); - delz2 = x(j,2) - x(k,2); - rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - cutsq2 = paramskk(jtype,itype,ktype).cutsq; - - if (rsq2 > cutsq2) continue; - rik = sqrt(rsq2); - bo_ij += bondorder(jtype,itype,ktype,rij,delx1,dely1,delz1,rik,delx2,dely2,delz2); - - } - - // attractive: pairwise potential and force - - const F_FLOAT fa = ters_fa_k(jtype,itype,itype,rij); - const F_FLOAT dfa = ters_dfa(jtype,itype,itype,rij); - const F_FLOAT bij = ters_bij_k(jtype,itype,itype,bo_ij); - const F_FLOAT fatt = -0.5*bij * dfa / rij; - const F_FLOAT prefactor = 0.5*fa * ters_dbij(jtype,itype,itype,bo_ij); - const F_FLOAT eng = 0.5*bij * fa; - - f_x -= delx1*fatt; - f_y -= dely1*fatt; - f_z -= delz1*fatt; - - if (EVFLAG) { - if (eflag) - ev.evdwl += 0.5 * eng; - if (vflag_either || eflag_atom) - this->template ev_tally(ev,i,j,eng,fatt,delx1,dely1,delz1); - } - - // attractive: three-body force - - for (kk = 0; kk < j_jnum; kk++) { - k = d_neighbors_short(j,kk); - if (k == i) continue; - k &= NEIGHMASK; - ktype = type(k); - - delx2 = x(j,0) - x(k,0); - dely2 = x(j,1) - x(k,1); - delz2 = x(j,2) - x(k,2); - rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; - cutsq2 = paramskk(jtype,itype,ktype).cutsq; - - if (rsq2 > cutsq2) continue; - rik = sqrt(rsq2); - ters_dthbj(jtype,itype,ktype,prefactor,rij,delx1,dely1,delz1, - rik,delx2,dely2,delz2,fj,fk); - f_x += fj[0]; - f_y += fj[1]; - f_z += fj[2]; - - if (vflag_either) { - F_FLOAT delrji[3], delrjk[3]; - delrji[0] = -delx1; delrji[1] = -dely1; delrji[2] = -delz1; - delrjk[0] = -delx2; delrjk[1] = -dely2; delrjk[2] = -delz2; - if (vflag_either) v_tally3_atom(ev,i,j,k,fj,fk,delrji,delrjk); - } - - const F_FLOAT fa_jk = ters_fa_k(jtype,ktype,itype,rik); - const F_FLOAT prefactor_jk = 0.5*fa_jk * ters_dbij(jtype,ktype,itype,bo_ij); - ters_dthbk(jtype,ktype,itype,prefactor_jk,rik,delx2,dely2,delz2, - rij,delx1,dely1,delz1,fk); - f_x += fk[0]; - f_y += fk[1]; - f_z += fk[2]; - } - } - f(i,0) += f_x; - f(i,1) += f_y; - f(i,2) += f_z; -} - -template -template -KOKKOS_INLINE_FUNCTION -void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeFullB, const int &ii) const { - EV_FLOAT ev; - this->template operator()(TagPairTersoffZBLComputeFullB(), ii, ev); + this->template operator()(TagPairTersoffZBLCompute(), ii, ev); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffZBLKokkos::ters_fc_k(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffZBLKokkos::ters_fc_k(const Param& param, const F_FLOAT &r) const { - const F_FLOAT ters_R = paramskk(i,j,k).bigr; - const F_FLOAT ters_D = paramskk(i,j,k).bigd; + const F_FLOAT ters_R = param.bigr; + const F_FLOAT ters_D = param.bigd; if (r < ters_R-ters_D) return 1.0; if (r > ters_R+ters_D) return 0.0; @@ -876,11 +543,10 @@ double PairTersoffZBLKokkos::ters_fc_k(const int &i, const int &j, template KOKKOS_INLINE_FUNCTION -double PairTersoffZBLKokkos::ters_dfc(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffZBLKokkos::ters_dfc(const Param& param, const F_FLOAT &r) const { - const F_FLOAT ters_R = paramskk(i,j,k).bigr; - const F_FLOAT ters_D = paramskk(i,j,k).bigd; + const F_FLOAT ters_R = param.bigr; + const F_FLOAT ters_D = param.bigd; if (r < ters_R-ters_D) return 0.0; if (r > ters_R+ters_D) return 0.0; @@ -891,7 +557,7 @@ double PairTersoffZBLKokkos::ters_dfc(const int &i, const int &j, template KOKKOS_INLINE_FUNCTION -double PairTersoffZBLKokkos::bondorder(const int &i, const int &j, const int &k, +double PairTersoffZBLKokkos::bondorder(const Param& param, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2) const { @@ -899,14 +565,15 @@ double PairTersoffZBLKokkos::bondorder(const int &i, const int &j, c const F_FLOAT costheta = (dx1*dx2 + dy1*dy2 + dz1*dz2)/(rij*rik); - if (int(paramskk(i,j,k).powerm) == 3) arg = pow(paramskk(i,j,k).lam3 * (rij-rik),3.0); - else arg = paramskk(i,j,k).lam3 * (rij-rik); + const F_FLOAT paramtmp = param.lam3 * (rij-rik); + if (int(param.powerm) == 3) arg = paramtmp*paramtmp*paramtmp;//pow(param.lam3 * (rij-rik),3.0); + else arg = paramtmp; if (arg > 69.0776) ex_delr = 1.e30; else if (arg < -69.0776) ex_delr = 0.0; else ex_delr = exp(arg); - return ters_fc_k(i,j,k,rik) * ters_gijk(i,j,k,costheta) * ex_delr; + return ters_fc_k(param,rik) * ters_gijk(param,costheta) * ex_delr; } /* ---------------------------------------------------------------------- */ @@ -914,13 +581,13 @@ double PairTersoffZBLKokkos::bondorder(const int &i, const int &j, c template KOKKOS_INLINE_FUNCTION double PairTersoffZBLKokkos:: - ters_gijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const + ters_gijk(const Param& param, const F_FLOAT &cos) const { - const F_FLOAT ters_c = paramskk(i,j,k).c * paramskk(i,j,k).c; - const F_FLOAT ters_d = paramskk(i,j,k).d * paramskk(i,j,k).d; - const F_FLOAT hcth = paramskk(i,j,k).h - cos; + const F_FLOAT ters_c = param.c * param.c; + const F_FLOAT ters_d = param.d * param.d; + const F_FLOAT hcth = param.h - cos; - return paramskk(i,j,k).gamma*(1.0 + ters_c/ters_d - ters_c/(ters_d+hcth*hcth)); + return param.gamma*(1.0 + ters_c/ters_d - ters_c/(ters_d+hcth*hcth)); } /* ---------------------------------------------------------------------- */ @@ -928,81 +595,77 @@ double PairTersoffZBLKokkos:: template KOKKOS_INLINE_FUNCTION double PairTersoffZBLKokkos:: - ters_dgijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const + ters_dgijk(const Param& param, const F_FLOAT &cos) const { - - const F_FLOAT ters_c = paramskk(i,j,k).c * paramskk(i,j,k).c; - const F_FLOAT ters_d = paramskk(i,j,k).d * paramskk(i,j,k).d; - const F_FLOAT hcth = paramskk(i,j,k).h - cos; + const F_FLOAT ters_c = param.c * param.c; + const F_FLOAT ters_d = param.d * param.d; + const F_FLOAT hcth = param.h - cos; const F_FLOAT numerator = -2.0 * ters_c * hcth; const F_FLOAT denominator = 1.0/(ters_d + hcth*hcth); - return paramskk(i,j,k).gamma * numerator * denominator * denominator; + return param.gamma * numerator * denominator * denominator; } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffZBLKokkos::ters_fa_k(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffZBLKokkos::ters_fa_k(const Param& param, const F_FLOAT &r) const { - if (r > paramskk(i,j,k).bigr + paramskk(i,j,k).bigd) return 0.0; - return -paramskk(i,j,k).bigb * exp(-paramskk(i,j,k).lam2 * r) - * ters_fc_k(i,j,k,r) * fermi_k(i,j,k,r); + if (r > param.bigr + param.bigd) return 0.0; + return -param.bigb * exp(-param.lam2 * r) + * ters_fc_k(param,r) * fermi_k(param,r); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffZBLKokkos::ters_dfa(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffZBLKokkos::ters_dfa(const Param& param, const F_FLOAT &r) const { - if (r > paramskk(i,j,k).bigr + paramskk(i,j,k).bigd) return 0.0; - return paramskk(i,j,k).bigb * exp(-paramskk(i,j,k).lam2 * r) * - (paramskk(i,j,k).lam2 * ters_fc_k(i,j,k,r) * fermi_k(i,j,k,r) - - ters_dfc(i,j,k,r) * fermi_k(i,j,k,r) - ters_fc_k(i,j,k,r) * - fermi_d_k(i,j,k,r)); + if (r > param.bigr + param.bigd) return 0.0; + return param.bigb * exp(-param.lam2 * r) * + (param.lam2 * ters_fc_k(param,r) * fermi_k(param,r) - + ters_dfc(param,r) * fermi_k(param,r) - ters_fc_k(param,r) * + fermi_d_k(param,r)); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffZBLKokkos::ters_bij_k(const int &i, const int &j, - const int &k, const F_FLOAT &bo) const +double PairTersoffZBLKokkos::ters_bij_k(const Param& param, const F_FLOAT &bo) const { - const F_FLOAT tmp = paramskk(i,j,k).beta * bo; - if (tmp > paramskk(i,j,k).c1) return 1.0/sqrt(tmp); - if (tmp > paramskk(i,j,k).c2) - return (1.0 - pow(tmp,-paramskk(i,j,k).powern) / (2.0*paramskk(i,j,k).powern))/sqrt(tmp); - if (tmp < paramskk(i,j,k).c4) return 1.0; - if (tmp < paramskk(i,j,k).c3) - return 1.0 - pow(tmp,paramskk(i,j,k).powern)/(2.0*paramskk(i,j,k).powern); - return pow(1.0 + pow(tmp,paramskk(i,j,k).powern), -1.0/(2.0*paramskk(i,j,k).powern)); + const F_FLOAT tmp = param.beta * bo; + if (tmp > param.c1) return 1.0/sqrt(tmp); + if (tmp > param.c2) + return (1.0 - pow(tmp,-param.powern) / (2.0*param.powern))/sqrt(tmp); + if (tmp < param.c4) return 1.0; + if (tmp < param.c3) + return 1.0 - pow(tmp,param.powern)/(2.0*param.powern); + return pow(1.0 + pow(tmp,param.powern), -1.0/(2.0*param.powern)); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffZBLKokkos::ters_dbij(const int &i, const int &j, - const int &k, const F_FLOAT &bo) const +double PairTersoffZBLKokkos::ters_dbij(const Param& param, const F_FLOAT &bo) const { - const F_FLOAT tmp = paramskk(i,j,k).beta * bo; - if (tmp > paramskk(i,j,k).c1) return paramskk(i,j,k).beta * -0.5*pow(tmp,-1.5); - if (tmp > paramskk(i,j,k).c2) - return paramskk(i,j,k).beta * (-0.5*pow(tmp,-1.5) * + const F_FLOAT tmp = param.beta * bo; + const F_FLOAT factor = -0.5/sqrt(tmp*tmp*tmp); //pow(tmp,-1.5) + if (tmp > param.c1) return param.beta * factor; + if (tmp > param.c2) + return param.beta * (factor * // error in negligible 2nd term fixed 2/21/2022 - //(1.0 - 0.5*(1.0 + 1.0/(2.0*paramskk(i,j,k).powern)) * - (1.0 - (1.0 + 1.0/(2.0*paramskk(i,j,k).powern)) * - pow(tmp,-paramskk(i,j,k).powern))); - if (tmp < paramskk(i,j,k).c4) return 0.0; - if (tmp < paramskk(i,j,k).c3) - return -0.5*paramskk(i,j,k).beta * pow(tmp,paramskk(i,j,k).powern-1.0); + // (1.0 - 0.5*(1.0 + 1.0/(2.0*param.powern)) * + (1.0 - (1.0 + 1.0/(2.0*param.powern)) * + pow(tmp,-param.powern))); + if (tmp < param.c4) return 0.0; + if (tmp < param.c3) + return -0.5*param.beta * pow(tmp,param.powern-1.0); - const F_FLOAT tmp_n = pow(tmp,paramskk(i,j,k).powern); - return -0.5 * pow(1.0+tmp_n, -1.0-(1.0/(2.0*paramskk(i,j,k).powern)))*tmp_n / bo; + const F_FLOAT tmp_n = pow(tmp,param.powern); + return -0.5 * pow(1.0+tmp_n, -1.0-(1.0/(2.0*param.powern)))*tmp_n / bo; } /* ---------------------------------------------------------------------- */ @@ -1010,7 +673,7 @@ double PairTersoffZBLKokkos::ters_dbij(const int &i, const int &j, template KOKKOS_INLINE_FUNCTION void PairTersoffZBLKokkos::ters_dthb( - const int &i, const int &j, const int &k, const F_FLOAT &prefactor, + const Param& param, const F_FLOAT &prefactor, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk) const @@ -1035,22 +698,24 @@ void PairTersoffZBLKokkos::ters_dthb( F_FLOAT gijk,dgijk,ex_delr,dex_delr,fc,dfc,cos,tmp; F_FLOAT dcosfi[3],dcosfj[3],dcosfk[3]; - fc = ters_fc_k(i,j,k,rik); - dfc = ters_dfc(i,j,k,rik); - if (int(paramskk(i,j,k).powerm) == 3) tmp = pow(paramskk(i,j,k).lam3 * (rij-rik),3.0); - else tmp = paramskk(i,j,k).lam3 * (rij-rik); + fc = ters_fc_k(param,rik); + dfc = ters_dfc(param,rik); + + const F_FLOAT paramtmp = param.lam3 * (rij-rik); + if (int(param.powerm) == 3) tmp = paramtmp*paramtmp*paramtmp;//pow(param.lam3 * (rij-rik),3.0); + else tmp = paramtmp; if (tmp > 69.0776) ex_delr = 1.e30; else if (tmp < -69.0776) ex_delr = 0.0; else ex_delr = exp(tmp); - if (int(paramskk(i,j,k).powerm) == 3) - dex_delr = 3.0*pow(paramskk(i,j,k).lam3,3.0) * pow(rij-rik,2.0)*ex_delr; - else dex_delr = paramskk(i,j,k).lam3 * ex_delr; + if (int(param.powerm) == 3) + dex_delr = 3.0*paramtmp*paramtmp*param.lam3*ex_delr;//pow(rij-rik,2.0)*ex_delr; + else dex_delr = param.lam3 * ex_delr; cos = vec3_dot(rij_hat,rik_hat); - gijk = ters_gijk(i,j,k,cos); - dgijk = ters_dgijk(i,j,k,cos); + gijk = ters_gijk(param,cos); + dgijk = ters_dgijk(param,cos); // from PairTersoffZBL::costheta_d vec3_scaleadd(-cos,rij_hat,rik_hat,dcosfj); @@ -1082,7 +747,7 @@ void PairTersoffZBLKokkos::ters_dthb( template KOKKOS_INLINE_FUNCTION void PairTersoffZBLKokkos::ters_dthbj( - const int &i, const int &j, const int &k, const F_FLOAT &prefactor, + const Param& param, const F_FLOAT &prefactor, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, F_FLOAT *fj, F_FLOAT *fk) const @@ -1103,22 +768,23 @@ void PairTersoffZBLKokkos::ters_dthbj( F_FLOAT gijk,dgijk,ex_delr,dex_delr,fc,dfc,cos,tmp; F_FLOAT dcosfi[3],dcosfj[3],dcosfk[3]; - fc = ters_fc_k(i,j,k,rik); - dfc = ters_dfc(i,j,k,rik); - if (int(paramskk(i,j,k).powerm) == 3) tmp = pow(paramskk(i,j,k).lam3 * (rij-rik),3.0); - else tmp = paramskk(i,j,k).lam3 * (rij-rik); + fc = ters_fc_k(param,rik); + dfc = ters_dfc(param,rik); + const F_FLOAT paramtmp = param.lam3 * (rij-rik); + if (int(param.powerm) == 3) tmp = paramtmp*paramtmp*paramtmp;//pow(param.lam3 * (rij-rik),3.0); + else tmp = paramtmp; if (tmp > 69.0776) ex_delr = 1.e30; else if (tmp < -69.0776) ex_delr = 0.0; else ex_delr = exp(tmp); - if (int(paramskk(i,j,k).powerm) == 3) - dex_delr = 3.0*pow(paramskk(i,j,k).lam3,3.0) * pow(rij-rik,2.0)*ex_delr; - else dex_delr = paramskk(i,j,k).lam3 * ex_delr; + if (int(param.powerm) == 3) + dex_delr = 3.0*paramtmp*paramtmp*param.lam3*ex_delr;//pow(param.lam3,3.0) * pow(rij-rik,2.0)*ex_delr; + else dex_delr = param.lam3 * ex_delr; cos = vec3_dot(rij_hat,rik_hat); - gijk = ters_gijk(i,j,k,cos); - dgijk = ters_dgijk(i,j,k,cos); + gijk = ters_gijk(param,cos); + dgijk = ters_dgijk(param,cos); vec3_scaleadd(-cos,rij_hat,rik_hat,dcosfj); vec3_scale(rijinv,dcosfj,dcosfj); @@ -1143,7 +809,7 @@ void PairTersoffZBLKokkos::ters_dthbj( template KOKKOS_INLINE_FUNCTION void PairTersoffZBLKokkos::ters_dthbk( - const int &i, const int &j, const int &k, const F_FLOAT &prefactor, + const Param& param, const F_FLOAT &prefactor, const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, F_FLOAT *fk) const @@ -1164,22 +830,23 @@ void PairTersoffZBLKokkos::ters_dthbk( F_FLOAT gijk,dgijk,ex_delr,dex_delr,fc,dfc,cos,tmp; F_FLOAT dcosfi[3],dcosfj[3],dcosfk[3]; - fc = ters_fc_k(i,j,k,rik); - dfc = ters_dfc(i,j,k,rik); - if (int(paramskk(i,j,k).powerm) == 3) tmp = pow(paramskk(i,j,k).lam3 * (rij-rik),3.0); - else tmp = paramskk(i,j,k).lam3 * (rij-rik); + fc = ters_fc_k(param,rik); + dfc = ters_dfc(param,rik); + const F_FLOAT paramtmp = param.lam3 * (rij-rik); + if (int(param.powerm) == 3) tmp = paramtmp*paramtmp*paramtmp;//pow(param.lam3 * (rij-rik),3.0); + else tmp = paramtmp; if (tmp > 69.0776) ex_delr = 1.e30; else if (tmp < -69.0776) ex_delr = 0.0; else ex_delr = exp(tmp); - if (int(paramskk(i,j,k).powerm) == 3) - dex_delr = 3.0*pow(paramskk(i,j,k).lam3,3.0) * pow(rij-rik,2.0)*ex_delr; - else dex_delr = paramskk(i,j,k).lam3 * ex_delr; + if (int(param.powerm) == 3) + dex_delr = 3.0*paramtmp*paramtmp*param.lam3*ex_delr;//pow(param.lam3,3.0) * pow(rij-rik,2.0)*ex_delr; + else dex_delr = param.lam3 * ex_delr; cos = vec3_dot(rij_hat,rik_hat); - gijk = ters_gijk(i,j,k,cos); - dgijk = ters_dgijk(i,j,k,cos); + gijk = ters_gijk(param,cos); + dgijk = ters_dgijk(param,cos); vec3_scaleadd(-cos,rij_hat,rik_hat,dcosfj); vec3_scale(rijinv,dcosfj,dcosfj); @@ -1199,24 +866,22 @@ void PairTersoffZBLKokkos::ters_dthbk( template KOKKOS_INLINE_FUNCTION -double PairTersoffZBLKokkos::fermi_k(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffZBLKokkos::fermi_k(const Param& param, const F_FLOAT &r) const { - return 1.0 / (1.0 + exp(-paramskk(i,j,k).ZBLexpscale * - (r - paramskk(i,j,k).ZBLcut))); + return 1.0 / (1.0 + exp(-param.ZBLexpscale * + (r - param.ZBLcut))); } /* ---------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION -double PairTersoffZBLKokkos::fermi_d_k(const int &i, const int &j, - const int &k, const F_FLOAT &r) const +double PairTersoffZBLKokkos::fermi_d_k(const Param& param, const F_FLOAT &r) const { - return paramskk(i,j,k).ZBLexpscale * exp(-paramskk(i,j,k).ZBLexpscale * - (r - paramskk(i,j,k).ZBLcut)) / - pow(1.0 + exp(-paramskk(i,j,k).ZBLexpscale * - (r - paramskk(i,j,k).ZBLcut)),2.0); + return param.ZBLexpscale * exp(-param.ZBLexpscale * + (r - param.ZBLcut)) / + pow(1.0 + exp(-param.ZBLexpscale * + (r - param.ZBLcut)),2.0); } /* ---------------------------------------------------------------------- */ @@ -1228,8 +893,6 @@ void PairTersoffZBLKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const { - const int VFLAG = vflag_either; - // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial auto v_eatom = ScatterViewHelper,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); @@ -1241,10 +904,10 @@ void PairTersoffZBLKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; a_eatom[i] += epairhalf; - if (NEIGHFLAG != FULL) a_eatom[j] += epairhalf; + a_eatom[j] += epairhalf; } - if (VFLAG) { + if (vflag_either) { const E_FLOAT v0 = delx*delx*fpair; const E_FLOAT v1 = dely*dely*fpair; const E_FLOAT v2 = delz*delz*fpair; @@ -1253,21 +916,12 @@ void PairTersoffZBLKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons const E_FLOAT v5 = dely*delz*fpair; if (vflag_global) { - if (NEIGHFLAG != FULL) { - ev.v[0] += v0; - ev.v[1] += v1; - ev.v[2] += v2; - ev.v[3] += v3; - ev.v[4] += v4; - ev.v[5] += v5; - } else { - ev.v[0] += 0.5*v0; - ev.v[1] += 0.5*v1; - ev.v[2] += 0.5*v2; - ev.v[3] += 0.5*v3; - ev.v[4] += 0.5*v4; - ev.v[5] += 0.5*v5; - } + ev.v[0] += v0; + ev.v[1] += v1; + ev.v[2] += v2; + ev.v[3] += v3; + ev.v[4] += v4; + ev.v[5] += v5; } if (vflag_atom) { @@ -1278,14 +932,12 @@ void PairTersoffZBLKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons a_vatom(i,4) += 0.5*v4; a_vatom(i,5) += 0.5*v5; - if (NEIGHFLAG != FULL) { - a_vatom(j,0) += 0.5*v0; - a_vatom(j,1) += 0.5*v1; - a_vatom(j,2) += 0.5*v2; - a_vatom(j,3) += 0.5*v3; - a_vatom(j,4) += 0.5*v4; - a_vatom(j,5) += 0.5*v5; - } + a_vatom(j,0) += 0.5*v0; + a_vatom(j,1) += 0.5*v1; + a_vatom(j,2) += 0.5*v2; + a_vatom(j,3) += 0.5*v3; + a_vatom(j,4) += 0.5*v4; + a_vatom(j,5) += 0.5*v5; } } } @@ -1295,7 +947,8 @@ void PairTersoffZBLKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons template template KOKKOS_INLINE_FUNCTION -void PairTersoffZBLKokkos::v_tally3(EV_FLOAT &ev, const int &i, const int &j, const int &k, +void PairTersoffZBLKokkos::v_tally3(EV_FLOAT &ev, + const int &i, const int &j, const int &k, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drij, F_FLOAT *drik) const { // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial @@ -1331,14 +984,13 @@ void PairTersoffZBLKokkos::v_tally3(EV_FLOAT &ev, const int &i, cons a_vatom(i,0) += v[0]; a_vatom(i,1) += v[1]; a_vatom(i,2) += v[2]; a_vatom(i,3) += v[3]; a_vatom(i,4) += v[4]; a_vatom(i,5) += v[5]; - if (NEIGHFLAG != FULL) { - a_vatom(j,0) += v[0]; a_vatom(j,1) += v[1]; a_vatom(j,2) += v[2]; - a_vatom(j,3) += v[3]; a_vatom(j,4) += v[4]; a_vatom(j,5) += v[5]; - a_vatom(k,0) += v[0]; a_vatom(k,1) += v[1]; a_vatom(k,2) += v[2]; - a_vatom(k,3) += v[3]; a_vatom(k,4) += v[4]; a_vatom(k,5) += v[5]; - } - } + a_vatom(j,0) += v[0]; a_vatom(j,1) += v[1]; a_vatom(j,2) += v[2]; + a_vatom(j,3) += v[3]; a_vatom(j,4) += v[4]; a_vatom(j,5) += v[5]; + + a_vatom(k,0) += v[0]; a_vatom(k,1) += v[1]; a_vatom(k,2) += v[2]; + a_vatom(k,3) += v[3]; a_vatom(k,4) += v[4]; a_vatom(k,5) += v[5]; + } } /* ---------------------------------------------------------------------- */ @@ -1387,4 +1039,3 @@ template class PairTersoffZBLKokkos; template class PairTersoffZBLKokkos; #endif } - diff --git a/src/KOKKOS/pair_tersoff_zbl_kokkos.h b/src/KOKKOS/pair_tersoff_zbl_kokkos.h index 2cad44e200..c912eea822 100644 --- a/src/KOKKOS/pair_tersoff_zbl_kokkos.h +++ b/src/KOKKOS/pair_tersoff_zbl_kokkos.h @@ -30,20 +30,14 @@ PairStyle(tersoff/zbl/kk/host,PairTersoffZBLKokkos); namespace LAMMPS_NS { template -struct TagPairTersoffZBLComputeHalf{}; - -template -struct TagPairTersoffZBLComputeFullA{}; - -template -struct TagPairTersoffZBLComputeFullB{}; +struct TagPairTersoffZBLCompute{}; struct TagPairTersoffZBLComputeShortNeigh{}; template class PairTersoffZBLKokkos : public PairTersoffZBL { public: - enum {EnabledNeighFlags=FULL}; + enum {EnabledNeighFlags=HALF|HALFTHREAD}; enum {COUL_FLAG=0}; typedef DeviceType device_type; typedef ArrayTypes AT; @@ -52,80 +46,66 @@ class PairTersoffZBLKokkos : public PairTersoffZBL { PairTersoffZBLKokkos(class LAMMPS *); ~PairTersoffZBLKokkos() override; void compute(int, int) override; + void coeff(int, char **) override; void init_style() override; template KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffZBLComputeHalf, const int&, EV_FLOAT&) const; + void operator()(TagPairTersoffZBLCompute, const int&, EV_FLOAT&) const; template KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffZBLComputeHalf, const int&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffZBLComputeFullA, const int&, EV_FLOAT&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffZBLComputeFullA, const int&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffZBLComputeFullB, const int&, EV_FLOAT&) const; - - template - KOKKOS_INLINE_FUNCTION - void operator()(TagPairTersoffZBLComputeFullB, const int&) const; + void operator()(TagPairTersoffZBLCompute, const int&) const; KOKKOS_INLINE_FUNCTION void operator()(TagPairTersoffZBLComputeShortNeigh, const int&) const; - KOKKOS_INLINE_FUNCTION - double ters_fc_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - double ters_dfc(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double ters_fc_k(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - double ters_fa_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double ters_dfc(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - double ters_dfa(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double ters_fa_k(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - double ters_bij_k(const int &i, const int &j, const int &k, const F_FLOAT &bo) const; + double ters_dfa(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - double ters_dbij(const int &i, const int &j, const int &k, const F_FLOAT &bo) const; + double ters_bij_k(const Param& param, const F_FLOAT &bo) const; KOKKOS_INLINE_FUNCTION - double bondorder(const int &i, const int &j, const int &k, - const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, - const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2) const; + double ters_dbij(const Param& param, const F_FLOAT &bo) const; KOKKOS_INLINE_FUNCTION - double ters_gijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const; + double bondorder(const Param& param, + const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, + const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2) const; KOKKOS_INLINE_FUNCTION - double ters_dgijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const; + double ters_gijk(const Param& param, const F_FLOAT &cos) const; KOKKOS_INLINE_FUNCTION - void ters_dthb(const int &i, const int &j, const int &k, const F_FLOAT &prefactor, - const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, - const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, - F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk) const; + double ters_dgijk(const Param& param, const F_FLOAT &cos) const; KOKKOS_INLINE_FUNCTION - void ters_dthbj(const int &i, const int &j, const int &k, const F_FLOAT &prefactor, - const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, - const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, - F_FLOAT *fj, F_FLOAT *fk) const; + void ters_dthb(const Param& param, const F_FLOAT &prefactor, + const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, + const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, + F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk) const; KOKKOS_INLINE_FUNCTION - void ters_dthbk(const int &i, const int &j, const int &k, const F_FLOAT &prefactor, - const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, - const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, - F_FLOAT *fk) const; + void ters_dthbj(const Param& param, const F_FLOAT &prefactor, + const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, + const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, + F_FLOAT *fj, F_FLOAT *fk) const; + + KOKKOS_INLINE_FUNCTION + void ters_dthbk(const Param& param, const F_FLOAT &prefactor, + const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1, + const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2, + F_FLOAT *fk) const; KOKKOS_INLINE_FUNCTION double vec3_dot(const F_FLOAT x[3], const double y[3]) const { @@ -150,17 +130,6 @@ class PairTersoffZBLKokkos : public PairTersoffZBL { KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const; - struct params_ters { - KOKKOS_INLINE_FUNCTION - params_ters() {powerm=0;gamma=0;lam3=0;c=0;d=0;h=0;powern=0;beta=0;lam2=0;bigb=0; - bigr=0;bigd=0;lam1=0;biga=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;Z_i=0;Z_j=0;ZBLcut=0;ZBLexpscale=0;}; - KOKKOS_INLINE_FUNCTION - params_ters(int /*i*/) {powerm=0;gamma=0;lam3=0;c=0;d=0;h=0;powern=0;beta=0;lam2=0;bigb=0; - bigr=0;bigd=0;lam1=0;biga=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;Z_i=0;Z_j=0;ZBLcut=0;ZBLexpscale=0;}; - F_FLOAT powerm, gamma, lam3, c, d, h, powern, beta, lam2, bigb, bigr, - bigd, lam1, biga, cutsq, c1, c2, c3, c4, Z_i, Z_j, ZBLcut, ZBLexpscale; - }; - template KOKKOS_INLINE_FUNCTION void ev_tally(EV_FLOAT &ev, const int &i, const int &j, @@ -170,28 +139,33 @@ class PairTersoffZBLKokkos : public PairTersoffZBL { template KOKKOS_INLINE_FUNCTION void v_tally3(EV_FLOAT &ev, const int &i, const int &j, const int &k, - F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drij, F_FLOAT *drik) const; + F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drij, F_FLOAT *drik) const; KOKKOS_INLINE_FUNCTION void v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k, - F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const; + F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const; - void allocate() override; void setup_params() override; KOKKOS_INLINE_FUNCTION - double fermi_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double fermi_k(const Param& param, const F_FLOAT &r) const; KOKKOS_INLINE_FUNCTION - double fermi_d_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const; + double fermi_d_k(const Param& param, const F_FLOAT &r) const; protected: typedef Kokkos::DualView tdual_int_3d; - Kokkos::DualView k_params; - typename Kokkos::DualView::t_dev_const_um paramskk; - // hardwired to space for 12 atom types - //params_ters m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1]; + typedef typename tdual_int_3d::t_dev_const_randomread t_int_3d_randomread; + typedef typename tdual_int_3d::t_host t_host_int_3d; + + t_int_3d_randomread d_elem3param; + typename AT::t_int_1d_randomread d_map; + + typedef Kokkos::DualView tdual_param_1d; + typedef typename tdual_param_1d::t_dev t_param_1d; + typedef typename tdual_param_1d::t_host t_host_param_1d; + + t_param_1d d_params; int inum; typename AT::t_x_array_randomread x; @@ -238,7 +212,7 @@ class PairTersoffZBLKokkos : public PairTersoffZBL { Kokkos::View d_numneigh_short; // ZBL - F_FLOAT global_a_0; // Bohr radius for Coulomb repulsion + F_FLOAT global_a_0; // Bohr radius for Coulomb repulsion F_FLOAT global_epsilon_0; // permittivity of vacuum for Coulomb repulsion F_FLOAT global_e; // proton charge (negative of electron charge) @@ -256,11 +230,7 @@ E: Pair tersoff/zbl/kk requires metal or real units This is a current restriction of this pair potential. -E: Cannot (yet) use full neighbor list style with tersoff/zbl/kk - -Self-explanatory. - -E: Cannot use chosen neighbor list style with tersoff/zbl/kk +E: Must use half neighbor list style with pair tersoff/zlb/kk Self-explanatory. diff --git a/src/KOKKOS/transpose_helper_kokkos.h b/src/KOKKOS/transpose_helper_kokkos.h new file mode 100644 index 0000000000..464bf04c4c --- /dev/null +++ b/src/KOKKOS/transpose_helper_kokkos.h @@ -0,0 +1,207 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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: Evan Weinberg (NVIDIA) +------------------------------------------------------------------------- */ + +#include "kokkos_type.h" + +namespace LAMMPS_NS { + +// This helper class implements optimized out-of-place transposes for Rank-2 views. +// In the case where both views have the same layout, it uses Kokkos' default `deep_copy`. +// In the case where the views have different layouts (LayoutLeft/LayoutRight), it implements +// a transpose through scratch memory staging +template +struct TransposeHelperKokkos { + + using DeviceType = DeviceType_; + + using t_view_dst = t_view_dst_; + using t_view_src = t_view_src_; + + static_assert(std::is_same::value, "Value types do not match"); + static_assert(t_view_dst::Rank == 2, "Destination view rank != 2"); + static_assert(t_view_src::Rank == 2, "Source view rank != 2"); + + using dst_layout = typename t_view_dst::traits::array_layout; + using src_layout = typename t_view_src::traits::array_layout; + + typedef ArrayTypes AT; + + using t_view_value = typename t_view_dst::value_type; + + + // set tile size, will update so each thread does multiple loads +#ifdef KOKKOS_ENABLE_HIP + static constexpr int tile_size = 16; + static constexpr int threads_per_team = 8; +#else + static constexpr int tile_size = 32; + static constexpr int threads_per_team = 4; +#endif + static constexpr int bank_pad = 1; + static constexpr int elem_size = sizeof(t_view_value); + + + t_view_dst d_dst; + t_view_src d_src; + + bool src_is_layout_right; + + // extents divided by vector length, rounded up + int extent_tiles[2]; + + // 1 if extent is divisible by vector length, 0 otherwise + int extent_is_multiple_tile_size[2]; + + // number of teams + int n_teams; + + // amount of shared memory per thread + int shared_mem_per_thread; + + TransposeHelperKokkos(t_view_dst d_dst_, t_view_src d_src_) + : d_dst(d_dst_), d_src(d_src_) { + + assert(d_dst.extent(0) == d_src.extent(0) && d_dst.extent(1) == d_dst.extent(1)); + + if (std::is_same::value) { + Kokkos::deep_copy(d_dst, d_src); + } else { + + src_is_layout_right = std::is_same::value; + + extent_tiles[0] = (d_dst.extent(0) + tile_size - 1) / tile_size; + extent_tiles[1] = (d_dst.extent(1) + tile_size - 1) / tile_size; + + extent_is_multiple_tile_size[0] = (extent_tiles[0] * tile_size == d_dst.extent(0)) ? 1 : 0; + extent_is_multiple_tile_size[1] = (extent_tiles[1] * tile_size == d_dst.extent(1)) ? 1 : 0; + + n_teams = (extent_tiles[0] * extent_tiles[1] + threads_per_team - 1) / threads_per_team; + + shared_mem_per_thread = tile_size * (tile_size + bank_pad) * elem_size; + + Kokkos::TeamPolicy transpose_policy(n_teams, threads_per_team, tile_size); + transpose_policy = transpose_policy.set_scratch_size(0, Kokkos::PerThread(shared_mem_per_thread)); + + Kokkos::parallel_for(transpose_policy, *this); + } + } + + KOKKOS_INLINE_FUNCTION + void operator()(const typename Kokkos::TeamPolicy::member_type& team_member) const { + + t_view_value* buffer = (t_view_value*)(team_member.team_shmem().get_shmem(shared_mem_per_thread * threads_per_team, 0)) + (shared_mem_per_thread / elem_size) * team_member.team_rank(); + + // extract flattened tile + const int flattened_idx = team_member.team_rank() + team_member.league_rank() * threads_per_team; + + // get range x, range y tile + int extent_tile_id[2]; + if (src_is_layout_right) { + // keep extent 1 tiles close together b/c loading from layout right + extent_tile_id[0] = flattened_idx / extent_tiles[1]; + extent_tile_id[1] = flattened_idx - extent_tile_id[0] * extent_tiles[1]; + } else { + // keep extent 0 tiles close together b/c loading from layout left + extent_tile_id[1] = flattened_idx / extent_tiles[0]; + extent_tile_id[0] = flattened_idx - extent_tile_id[1] * extent_tiles[0]; + } + + int elem[2]; + elem[0] = extent_tile_id[0] * tile_size; + elem[1] = extent_tile_id[1] * tile_size; + + if (elem[0] >= d_dst.extent(0) || + elem[1] >= d_dst.extent(1)) return; + + // determine if a row/column is a full `tile_size` in size or not + bool perfect_pad[2]; + perfect_pad[0] = (extent_is_multiple_tile_size[0] == 1 || extent_tile_id[0] + 1 < extent_tiles[0]); + perfect_pad[1] = (extent_is_multiple_tile_size[1] == 1 || extent_tile_id[1] + 1 < extent_tiles[1]); + + // load phase + if (src_is_layout_right) { + Kokkos::parallel_for(Kokkos::ThreadVectorRange(team_member, tile_size), + [&] (const int j) { + + if (elem[1] + j < d_src.extent(1)) { + if (perfect_pad[0]) { + for (int i = 0; i < tile_size; i++) + buffer[i * (tile_size + bank_pad) + j] = d_src(elem[0] + i, elem[1] + j); + } else { + for (int i = 0; i < (d_src.extent(0) - elem[0]); i++) + buffer[i * (tile_size + bank_pad) + j] = d_src(elem[0] + i, elem[1] + j); + } + } + }); + + } else { + // src is layout left + Kokkos::parallel_for(Kokkos::ThreadVectorRange(team_member, tile_size), + [&] (const int i) { + + if (elem[0] + i < d_src.extent(0)) { + if (perfect_pad[1]) { + for (int j = 0; j < tile_size; j++) + buffer[i * (tile_size + bank_pad) + j] = d_src(elem[0] + i, elem[1] + j); + } else { + for (int j = 0; j < (d_src.extent(1) - elem[1]); j++) + buffer[i * (tile_size + bank_pad) + j] = d_src(elem[0] + i, elem[1] + j); + } + } + }); + } + + // No need for an extra sync b/c there is an implicit sync at the end + // of a ThreadVectorRange as per the Kokkos programming model + + // save phase + if (src_is_layout_right) { + Kokkos::parallel_for(Kokkos::ThreadVectorRange(team_member, tile_size), + [&] (const int i) { + + if (elem[0] + i < d_dst.extent(0)) { + if (perfect_pad[1]) { + for (int j = 0; j < tile_size; j++) + d_dst(elem[0] + i, elem[1] + j) = buffer[i * (tile_size + bank_pad) + j]; + } else { + for (int j = 0; j < (d_dst.extent(1) - elem[1]); j++) + d_dst(elem[0] + i, elem[1] + j) = buffer[i * (tile_size + bank_pad) + j]; + } + } + }); + } else { + + // src is layout left + Kokkos::parallel_for(Kokkos::ThreadVectorRange(team_member, tile_size), + [&] (const int j) { + + if (elem[1] + j < d_dst.extent(1)) { + if (perfect_pad[0]) { + for (int i = 0; i < tile_size; i++) + d_dst(elem[0] + i, elem[1] + j) = buffer[i * (tile_size + bank_pad) + j]; + } else { + for (int i = 0; i < (d_dst.extent(0) - elem[0]); i++) + d_dst(elem[0] + i, elem[1] + j) = buffer[i * (tile_size + bank_pad) + j]; + } + } + }); + } + + } +}; + +} diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp index fbdd24af1d..2f787c54fe 100644 --- a/src/KSPACE/ewald.cpp +++ b/src/KSPACE/ewald.cpp @@ -121,7 +121,7 @@ void Ewald::init() pair_check(); int itmp; - double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); + auto p_cutoff = (double *) force->pair->extract("cut_coul",itmp); if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); double cutoff = *p_cutoff; diff --git a/src/MESSAGE/server_md.h b/src/KSPACE/ewald_const.h similarity index 61% rename from src/MESSAGE/server_md.h rename to src/KSPACE/ewald_const.h index bd227286b4..3562b93644 100644 --- a/src/MESSAGE/server_md.h +++ b/src/KSPACE/ewald_const.h @@ -11,28 +11,19 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifndef LMP_SERVER_MD_H -#define LMP_SERVER_MD_H - -#include "pointers.h" +#ifndef LMP_EWALD_CONST_H +#define LMP_EWALD_CONST_H namespace LAMMPS_NS { - -class ServerMD : protected Pointers { - public: - ServerMD(class LAMMPS *); - ~ServerMD() override; - void loop(); - - private: - int units; - double fconvert, econvert, pconvert; - double **fcopy; - - void box_change(double *, double *); - void send_fev(int); -}; - +namespace EwaldConst { + static constexpr double EWALD_F = 1.12837917; + static constexpr double EWALD_P = 0.3275911; + static constexpr double A1 = 0.254829592; + static constexpr double A2 = -0.284496736; + static constexpr double A3 = 1.421413741; + static constexpr double A4 = -1.453152027; + static constexpr double A5 = 1.061405429; +} // namespace EwaldConst } // namespace LAMMPS_NS #endif diff --git a/src/KSPACE/ewald_dipole.cpp b/src/KSPACE/ewald_dipole.cpp index 5c7835bd51..2aeacd3609 100644 --- a/src/KSPACE/ewald_dipole.cpp +++ b/src/KSPACE/ewald_dipole.cpp @@ -112,7 +112,7 @@ void EwaldDipole::init() pair_check(); int itmp; - double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); + auto p_cutoff = (double *) force->pair->extract("cut_coul",itmp); if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); double cutoff = *p_cutoff; diff --git a/src/KSPACE/ewald_dipole_spin.cpp b/src/KSPACE/ewald_dipole_spin.cpp index 1f08205f21..8bad7b87a0 100644 --- a/src/KSPACE/ewald_dipole_spin.cpp +++ b/src/KSPACE/ewald_dipole_spin.cpp @@ -96,7 +96,7 @@ void EwaldDipoleSpin::init() pair_check(); int itmp; - double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); + auto p_cutoff = (double *) force->pair->extract("cut_coul",itmp); if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); double cutoff = *p_cutoff; diff --git a/src/KSPACE/ewald_disp.cpp b/src/KSPACE/ewald_disp.cpp index 670da1610d..cff419de76 100644 --- a/src/KSPACE/ewald_disp.cpp +++ b/src/KSPACE/ewald_disp.cpp @@ -543,7 +543,7 @@ void EwaldDisp::init_coeffs() int n = atom->ntypes; if (function[1]) { // geometric 1/r^6 - double **b = (double **) force->pair->extract("B",tmp); + auto b = (double **) force->pair->extract("B",tmp); delete [] B; B = new double[n+1]; B[0] = 0.0; @@ -551,8 +551,8 @@ void EwaldDisp::init_coeffs() for (int i=1; i<=n; ++i) B[i] = sqrt(fabs(b[i][i])); } if (function[2]) { // arithmetic 1/r^6 - double **epsilon = (double **) force->pair->extract("epsilon",tmp); - double **sigma = (double **) force->pair->extract("sigma",tmp); + auto epsilon = (double **) force->pair->extract("epsilon",tmp); + auto sigma = (double **) force->pair->extract("sigma",tmp); delete [] B; double eps_i, sigma_i, sigma_n, *bi = B = new double[7*n+7]; double c[7] = { @@ -772,7 +772,7 @@ void EwaldDisp::compute_ek() int lbytes = (2*nbox+1)*sizeof(cvector); hvector *h = nullptr; kvector *k, *nk = kvec+nkvec; - cvector *z = new cvector[2*nbox+1]; + auto z = new cvector[2*nbox+1]; cvector z1, *zx, *zy, *zz, *zn = z+2*nbox; complex *cek, zxyz, zxy = COMPLEX_NULL, cx = COMPLEX_NULL; double mui[3]; diff --git a/src/KSPACE/fix_tune_kspace.cpp b/src/KSPACE/fix_tune_kspace.cpp index 6b3b969a7f..e2e0e4d622 100644 --- a/src/KSPACE/fix_tune_kspace.cpp +++ b/src/KSPACE/fix_tune_kspace.cpp @@ -104,7 +104,7 @@ void FixTuneKspace::init() acc_str = std::to_string(old_acc); int itmp; - double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); + auto p_cutoff = (double *) force->pair->extract("cut_coul",itmp); pair_cut_coul = *p_cutoff; } @@ -120,7 +120,7 @@ void FixTuneKspace::pre_exchange() if (next_reneighbor != update->ntimestep) return; next_reneighbor = update->ntimestep + nevery; - Info *info = new Info(lmp); + auto info = new Info(lmp); bool has_msm = info->has_style("pair", base_pair_style + "/msm"); delete info; @@ -230,7 +230,7 @@ void FixTuneKspace::update_pair_style(const std::string &new_pair_style, double pair_cut_coul) { int itmp; - double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); + auto p_cutoff = (double *) force->pair->extract("cut_coul",itmp); *p_cutoff = pair_cut_coul; // check to see if we need to change pair styles @@ -250,7 +250,7 @@ void FixTuneKspace::update_pair_style(const std::string &new_pair_style, // restore current pair settings from temporary file force->pair->read_restart(p_pair_settings_file); - double *pcutoff = (double *) force->pair->extract("cut_coul",itmp); + auto pcutoff = (double *) force->pair->extract("cut_coul",itmp); double current_cutoff = *pcutoff; if (comm->me == 0) utils::logmesg(lmp,"Coulomb cutoff for real space: {}\n",current_cutoff); @@ -268,7 +268,7 @@ void FixTuneKspace::update_kspace_style(const std::string &new_kspace_style, { // delete old kspace style and create new one - char *tmp_acc_str = (char *)new_acc_str.c_str(); + auto tmp_acc_str = (char *)new_acc_str.c_str(); force->create_kspace(new_kspace_style.c_str(),1); force->kspace->settings(1,&tmp_acc_str); force->kspace->differentiation_flag = old_differentiation_flag; @@ -305,7 +305,7 @@ void FixTuneKspace::adjust_rcut(double time) // get the current cutoff int itmp; - double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); + auto p_cutoff = (double *) force->pair->extract("cut_coul",itmp); double current_cutoff = *p_cutoff; if (comm->me == 0) utils::logmesg(lmp,"Old Coulomb cutoff for real space: {}\n",current_cutoff); @@ -376,7 +376,7 @@ void FixTuneKspace::adjust_rcut(double time) *p_cutoff = pair_cut_coul; // report the new cutoff - double *new_cutoff = (double *) force->pair->extract("cut_coul",itmp); + auto new_cutoff = (double *) force->pair->extract("cut_coul",itmp); current_cutoff = *new_cutoff; if (comm->me == 0) utils::logmesg(lmp,"Adjusted Coulomb cutoff for real space: {}\n", current_cutoff); diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index a6bfba3e6f..b518d8efe1 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -150,7 +150,7 @@ void MSM::init() pair_check(); int itmp; - double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); + auto p_cutoff = (double *) force->pair->extract("cut_coul",itmp); if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -1064,7 +1064,7 @@ void MSM::set_grid_global() cutoff = pow(k*k*sum/3.0,1.0/(2.0*p)); int itmp; - double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); + auto p_cutoff = (double *) force->pair->extract("cut_coul",itmp); *p_cutoff = cutoff; if (me == 0) @@ -2506,7 +2506,7 @@ void MSM::grid_swap_reverse(int n, double*** &gridn) void MSM::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) { - double *buf = (double *) vbuf; + auto buf = (double *) vbuf; int n = current_level; int k = 0; @@ -2552,7 +2552,7 @@ void MSM::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) void MSM::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) { - double *buf = (double *) vbuf; + auto buf = (double *) vbuf; int n = current_level; int k = 0; @@ -2598,7 +2598,7 @@ void MSM::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) void MSM::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { - double *buf = (double *) vbuf; + auto buf = (double *) vbuf; int n = current_level; int k = 0; @@ -2644,7 +2644,7 @@ void MSM::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) void MSM::unpack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { - double *buf = (double *) vbuf; + auto buf = (double *) vbuf; int n = current_level; int k = 0; diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index 1af0857668..b1717a891d 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -249,8 +249,8 @@ void PairBuckLongCoulLong::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast( update->integrate))->cutoff; else cut_respa = nullptr; // setup force tables @@ -264,7 +264,7 @@ void PairBuckLongCoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp index 67e0a328e5..6e39a4f56f 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp @@ -690,7 +690,7 @@ void PairLJCharmmCoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -713,8 +713,8 @@ void PairLJCharmmCoulLong::init_style() // set & error check interior rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - ((Respa *) update->integrate)->level_inner >= 0) { - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) { + cut_respa = (dynamic_cast( update->integrate))->cutoff; cut_in_off = cut_respa[0]; cut_in_on = cut_respa[1]; cut_out_on = cut_respa[2]; diff --git a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp index 1fb72a3108..a4741a56a2 100644 --- a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp @@ -741,7 +741,7 @@ void PairLJCharmmfswCoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -775,8 +775,8 @@ void PairLJCharmmfswCoulLong::init_style() // set & error check interior rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - ((Respa *) update->integrate)->level_inner >= 0) { - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) { + cut_respa = (dynamic_cast( update->integrate))->cutoff; if (MIN(cut_lj,cut_coul) < cut_respa[3]) error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp index 6a3597a0ae..0ffdde24de 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.cpp +++ b/src/KSPACE/pair_lj_cut_coul_long.cpp @@ -658,7 +658,7 @@ void PairLJCutCoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -669,8 +669,8 @@ void PairLJCutCoulLong::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast( update->integrate))->cutoff; else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index a7d4464094..742f424b95 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -242,8 +242,8 @@ void PairLJLongCoulLong::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style,"^respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast( update->integrate))->cutoff; else cut_respa = nullptr; // setup force tables @@ -257,7 +257,7 @@ void PairLJLongCoulLong::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index d531233a3a..e94193759f 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -227,7 +227,7 @@ void PPPM::init() pair_check(); int itmp = 0; - double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); + auto p_cutoff = (double *) force->pair->extract("cut_coul",itmp); if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -240,7 +240,7 @@ void PPPM::init() if (tip4pflag) { if (me == 0) utils::logmesg(lmp," extracting TIP4P info from pair style\n"); - double *p_qdist = (double *) force->pair->extract("qdist",itmp); + auto p_qdist = (double *) force->pair->extract("qdist",itmp); int *p_typeO = (int *) force->pair->extract("typeO",itmp); int *p_typeH = (int *) force->pair->extract("typeH",itmp); int *p_typeA = (int *) force->pair->extract("typeA",itmp); @@ -319,8 +319,7 @@ void PPPM::init() if (order < minorder) error->all(FLERR,"PPPM order < minimum allowed order"); if (!overlap_allowed && !gctmp->ghost_adjacent()) - error->all(FLERR,"PPPM grid stencil extends " - "beyond nearest neighbor processor"); + error->all(FLERR,"PPPM grid stencil extends beyond nearest neighbor processor"); if (gctmp) delete gctmp; // adjust g_ewald @@ -569,8 +568,7 @@ void PPPM::setup_grid() allocate(); if (!overlap_allowed && !gc->ghost_adjacent()) - error->all(FLERR,"PPPM grid stencil extends " - "beyond nearest neighbor processor"); + error->all(FLERR,"PPPM grid stencil extends beyond nearest neighbor processor"); // pre-compute Green's function denomiator expansion // pre-compute 1d charge distribution coefficients @@ -2610,7 +2608,7 @@ void PPPM::fieldforce_peratom() void PPPM::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; int n = 0; @@ -2670,7 +2668,7 @@ void PPPM::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) void PPPM::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; int n = 0; @@ -2730,7 +2728,7 @@ void PPPM::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) void PPPM::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; if (flag == REVERSE_RHO) { FFT_SCALAR *src = &density_brick[nzlo_out][nylo_out][nxlo_out]; @@ -2745,7 +2743,7 @@ void PPPM::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) void PPPM::unpack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; if (flag == REVERSE_RHO) { FFT_SCALAR *dest = &density_brick[nzlo_out][nylo_out][nxlo_out]; diff --git a/src/KSPACE/pppm_dipole.cpp b/src/KSPACE/pppm_dipole.cpp index abadcc52be..aef14b0189 100644 --- a/src/KSPACE/pppm_dipole.cpp +++ b/src/KSPACE/pppm_dipole.cpp @@ -153,7 +153,7 @@ void PPPMDipole::init() pair_check(); int itmp = 0; - double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); + auto p_cutoff = (double *) force->pair->extract("cut_coul",itmp); if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -216,8 +216,7 @@ void PPPMDipole::init() if (order < minorder) error->all(FLERR,"PPPMDipole order < minimum allowed order"); if (!overlap_allowed && !gctmp->ghost_adjacent()) - error->all(FLERR,"PPPMDipole grid stencil extends " - "beyond nearest neighbor processor"); + error->all(FLERR,"PPPMDipole grid stencil extends beyond nearest neighbor processor"); if (gctmp) delete gctmp; // adjust g_ewald @@ -375,8 +374,7 @@ void PPPMDipole::setup_grid() allocate(); if (!overlap_allowed && !gc_dipole->ghost_adjacent()) - error->all(FLERR,"PPPMDipole grid stencil extends " - "beyond nearest neighbor processor"); + error->all(FLERR,"PPPMDipole grid stencil extends beyond nearest neighbor processor"); // pre-compute Green's function denomiator expansion // pre-compute 1d charge distribution coefficients @@ -2190,7 +2188,7 @@ void PPPMDipole::fieldforce_peratom_dipole() void PPPMDipole::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; int n = 0; @@ -2263,7 +2261,7 @@ void PPPMDipole::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) void PPPMDipole::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; int n = 0; @@ -2336,7 +2334,7 @@ void PPPMDipole::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) void PPPMDipole::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; int n = 0; if (flag == REVERSE_MU) { @@ -2357,7 +2355,7 @@ void PPPMDipole::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) void PPPMDipole::unpack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; int n = 0; if (flag == REVERSE_MU) { diff --git a/src/KSPACE/pppm_dipole_spin.cpp b/src/KSPACE/pppm_dipole_spin.cpp index 1692ae3ed7..148da52770 100644 --- a/src/KSPACE/pppm_dipole_spin.cpp +++ b/src/KSPACE/pppm_dipole_spin.cpp @@ -138,7 +138,7 @@ void PPPMDipoleSpin::init() pair_check(); int itmp = 0; - double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); + auto p_cutoff = (double *) force->pair->extract("cut_coul",itmp); // check the correct extract here if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); @@ -201,8 +201,7 @@ void PPPMDipoleSpin::init() if (order < minorder) error->all(FLERR,"PPPMDipoleSpin order < minimum allowed order"); if (!overlap_allowed && !gctmp->ghost_adjacent()) - error->all(FLERR,"PPPMDipoleSpin grid stencil extends " - "beyond nearest neighbor processor"); + error->all(FLERR,"PPPMDipoleSpin grid stencil extends beyond nearest neighbor processor"); if (gctmp) delete gctmp; // adjust g_ewald diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index 85aceb8500..bd2e48aa5b 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -366,7 +366,7 @@ void PPPMDisp::init() if (tip4pflag) { int itmp; - double *p_qdist = (double *) force->pair->extract("qdist",itmp); + auto p_qdist = (double *) force->pair->extract("qdist",itmp); int *p_typeO = (int *) force->pair->extract("typeO",itmp); int *p_typeH = (int *) force->pair->extract("typeH",itmp); int *p_typeA = (int *) force->pair->extract("typeA",itmp); @@ -456,8 +456,7 @@ void PPPMDisp::init() if (order < minorder) error->all(FLERR,"Coulomb PPPMDisp order has been reduced below minorder"); if (!overlap_allowed && !gctmp->ghost_adjacent()) - error->all(FLERR,"PPPMDisp grid stencil extends " - "beyond nearest neighbor processor"); + error->all(FLERR,"PPPMDisp grid stencil extends beyond nearest neighbor processor"); if (gctmp) delete gctmp; // adjust g_ewald @@ -538,8 +537,7 @@ void PPPMDisp::init() error->all(FLERR,"Dispersion PPPMDisp order has been " "reduced below minorder"); if (!overlap_allowed && !gctmp->ghost_adjacent()) - error->all(FLERR,"Dispersion PPPMDisp grid stencil extends " - "beyond nearest neighbor processor"); + error->all(FLERR,"Dispersion PPPMDisp grid stencil extends beyond nearest neighbor proc"); if (gctmp) delete gctmp; // adjust g_ewald_6 @@ -837,13 +835,11 @@ void PPPMDisp::setup_grid() if (function[0]) { if (!overlap_allowed && !gc->ghost_adjacent()) - error->all(FLERR,"PPPMDisp grid stencil extends " - "beyond nearest neighbor processor"); + error->all(FLERR,"PPPMDisp grid stencil extends beyond nearest neighbor processor"); } if (function[1] + function[2] + function[3]) { if (!overlap_allowed && !gc6->ghost_adjacent()) - error->all(FLERR,"Dispersion PPPMDisp grid stencil extends " - "beyond nearest neighbor processor"); + error->all(FLERR,"Dispersion PPPMDisp grid stencil extends beyond nearest neighbor proc"); } // pre-compute Green's function denomiator expansion @@ -1301,7 +1297,7 @@ void PPPMDisp::init_coeffs() double **Q=nullptr; if (n > 1) { // get dispersion coefficients - double **b = (double **) force->pair->extract("B",tmp); + auto b = (double **) force->pair->extract("B",tmp); memory->create(A,n,n,"pppm/disp:A"); memory->create(Q,n,n,"pppm/disp:Q"); // fill coefficients to matrix a @@ -1379,7 +1375,7 @@ void PPPMDisp::init_coeffs() // check if the function should preferably be [1] or [2] or [3] if (nsplit == 1) { - if (B) delete [] B; + delete[] B; function[3] = 0; function[2] = 0; function[1] = 1; @@ -1392,12 +1388,12 @@ void PPPMDisp::init_coeffs() utils::logmesg(lmp," Using {} instead of 7 structure factors\n",nsplit); //function[3] = 1; //function[2] = 0; - if (B) delete [] B; // remove this when un-comment previous 2 lines + delete[] B; // remove this when un-comment previous 2 lines } if (function[2] && (nsplit > 6)) { if (me == 0) utils::logmesg(lmp," Using 7 structure factors\n"); - if (B) delete [] B; + delete[] B; } if (function[3]) { @@ -1413,15 +1409,15 @@ void PPPMDisp::init_coeffs() } if (function[1]) { // geometric 1/r^6 - double **b = (double **) force->pair->extract("B",tmp); + auto b = (double **) force->pair->extract("B",tmp); B = new double[n+1]; B[0] = 0.0; for (int i=1; i<=n; ++i) B[i] = sqrt(fabs(b[i][i])); } if (function[2]) { // arithmetic 1/r^6 - double **epsilon = (double **) force->pair->extract("epsilon",tmp); - double **sigma = (double **) force->pair->extract("sigma",tmp); + auto epsilon = (double **) force->pair->extract("epsilon",tmp); + auto sigma = (double **) force->pair->extract("sigma",tmp); if (!(epsilon&&sigma)) error->all(FLERR,"Epsilon or sigma reference not set by pair style for PPPMDisp"); double eps_i,sigma_i,sigma_n; @@ -6820,7 +6816,7 @@ void PPPMDisp::fieldforce_none_peratom() void PPPMDisp::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; int n = 0; @@ -7333,7 +7329,7 @@ void PPPMDisp::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) void PPPMDisp::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; int n = 0; @@ -7846,7 +7842,7 @@ void PPPMDisp::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) void PPPMDisp::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; int n = 0; @@ -7901,7 +7897,7 @@ void PPPMDisp::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) void PPPMDisp::unpack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { - FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + auto buf = (FFT_SCALAR *) vbuf; int n = 0; diff --git a/src/KSPACE/remap.cpp b/src/KSPACE/remap.cpp index 9ca040aa64..c3e8fafdac 100644 --- a/src/KSPACE/remap.cpp +++ b/src/KSPACE/remap.cpp @@ -125,10 +125,8 @@ void remap_3d(FFT_SCALAR *in, FFT_SCALAR *out, FFT_SCALAR *buf, for (int i=0;inrecv;i++) recvBufferSize += plan->recv_size[i]; - FFT_SCALAR *packedSendBuffer - = (FFT_SCALAR *) malloc(sizeof(FFT_SCALAR) * sendBufferSize); - FFT_SCALAR *packedRecvBuffer - = (FFT_SCALAR *) malloc(sizeof(FFT_SCALAR) * recvBufferSize); + auto packedSendBuffer = (FFT_SCALAR *) malloc(sizeof(FFT_SCALAR) * sendBufferSize); + auto packedRecvBuffer = (FFT_SCALAR *) malloc(sizeof(FFT_SCALAR) * recvBufferSize); int *sendcnts = (int *) malloc(sizeof(int) * plan->commringlen); int *rcvcnts = (int *) malloc(sizeof(int) * plan->commringlen); diff --git a/src/MACHDYN/compute_smd_hourglass_error.cpp b/src/MACHDYN/compute_smd_hourglass_error.cpp index b0d01d2b14..1e36c9d182 100644 --- a/src/MACHDYN/compute_smd_hourglass_error.cpp +++ b/src/MACHDYN/compute_smd_hourglass_error.cpp @@ -86,7 +86,7 @@ void ComputeSMDHourglassError::compute_peratom() { } int itmp = 0; - double *hourglass_error = (double *) force->pair->extract("smd/tlsph/hourglass_error_ptr", itmp); + auto hourglass_error = (double *) force->pair->extract("smd/tlsph/hourglass_error_ptr", itmp); if (hourglass_error == nullptr) { error->all(FLERR, "compute smd/hourglass_error failed to access hourglass_error array"); } diff --git a/src/MACHDYN/compute_smd_tlsph_dt.cpp b/src/MACHDYN/compute_smd_tlsph_dt.cpp index ca1973309f..44311fc4ce 100644 --- a/src/MACHDYN/compute_smd_tlsph_dt.cpp +++ b/src/MACHDYN/compute_smd_tlsph_dt.cpp @@ -87,7 +87,7 @@ void ComputeSMDTlsphDt::compute_peratom() { } int itmp = 0; - double *particle_dt = (double *) force->pair->extract("smd/tlsph/particle_dt_ptr", + auto particle_dt = (double *) force->pair->extract("smd/tlsph/particle_dt_ptr", itmp); if (particle_dt == nullptr) { error->all(FLERR, diff --git a/src/MACHDYN/compute_smd_tlsph_shape.cpp b/src/MACHDYN/compute_smd_tlsph_shape.cpp index 1887de683c..5e69c6650b 100644 --- a/src/MACHDYN/compute_smd_tlsph_shape.cpp +++ b/src/MACHDYN/compute_smd_tlsph_shape.cpp @@ -89,12 +89,12 @@ void ComputeSmdTlsphShape::compute_peratom() { } int itmp = 0; - Matrix3d *R = (Matrix3d *) force->pair->extract("smd/tlsph/rotation_ptr", itmp); + auto R = (Matrix3d *) force->pair->extract("smd/tlsph/rotation_ptr", itmp); if (R == nullptr) { error->all(FLERR, "compute smd/tlsph_shape failed to access rotation array"); } - Matrix3d *F = (Matrix3d *) force->pair->extract("smd/tlsph/Fincr_ptr", itmp); + auto F = (Matrix3d *) force->pair->extract("smd/tlsph/Fincr_ptr", itmp); if (F == nullptr) { error->all(FLERR, "compute smd/tlsph_shape failed to access deformation gradient array"); } diff --git a/src/MACHDYN/compute_smd_tlsph_strain.cpp b/src/MACHDYN/compute_smd_tlsph_strain.cpp index 30f158a3f1..bb71792442 100644 --- a/src/MACHDYN/compute_smd_tlsph_strain.cpp +++ b/src/MACHDYN/compute_smd_tlsph_strain.cpp @@ -92,7 +92,7 @@ void ComputeSMDTLSPHstrain::compute_peratom() { // copy data to output array int itmp = 0; - Matrix3d *Fincr = (Matrix3d *) force->pair->extract("smd/tlsph/Fincr_ptr", itmp); + auto Fincr = (Matrix3d *) force->pair->extract("smd/tlsph/Fincr_ptr", itmp); if (Fincr == nullptr) { error->all(FLERR, "compute smd/tlsph_strain failed to access Fincr array"); } diff --git a/src/MACHDYN/compute_smd_tlsph_strain_rate.cpp b/src/MACHDYN/compute_smd_tlsph_strain_rate.cpp index 1889cbcc0f..d6da2d2288 100644 --- a/src/MACHDYN/compute_smd_tlsph_strain_rate.cpp +++ b/src/MACHDYN/compute_smd_tlsph_strain_rate.cpp @@ -89,7 +89,7 @@ void ComputeSMDTLSPHStrainRate::compute_peratom() { } int itmp = 0; - Matrix3d *D = (Matrix3d *) force->pair->extract("smd/tlsph/strain_rate_ptr", itmp); + auto D = (Matrix3d *) force->pair->extract("smd/tlsph/strain_rate_ptr", itmp); if (D == nullptr) { error->all(FLERR, "compute smd/tlsph_strain_rate could not access strain rate. Are the matching pair styles present?"); diff --git a/src/MACHDYN/compute_smd_tlsph_stress.cpp b/src/MACHDYN/compute_smd_tlsph_stress.cpp index 038e09a3c0..f8592fec8d 100644 --- a/src/MACHDYN/compute_smd_tlsph_stress.cpp +++ b/src/MACHDYN/compute_smd_tlsph_stress.cpp @@ -99,7 +99,7 @@ void ComputeSMDTLSPHStress::compute_peratom() { } int itmp = 0; - Matrix3d *T = (Matrix3d *) force->pair->extract("smd/tlsph/stressTensor_ptr", itmp); + auto T = (Matrix3d *) force->pair->extract("smd/tlsph/stressTensor_ptr", itmp); if (T == nullptr) { error->all(FLERR, "compute smd/tlsph_stress could not access stress tensors. Are the matching pair styles present?"); } diff --git a/src/MACHDYN/compute_smd_ulsph_effm.cpp b/src/MACHDYN/compute_smd_ulsph_effm.cpp index 24cae6b14e..35b0fe851d 100644 --- a/src/MACHDYN/compute_smd_ulsph_effm.cpp +++ b/src/MACHDYN/compute_smd_ulsph_effm.cpp @@ -23,16 +23,18 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include #include "compute_smd_ulsph_effm.h" + #include "atom.h" -#include "update.h" -#include "modify.h" #include "comm.h" +#include "error.h" #include "force.h" #include "memory.h" -#include "error.h" +#include "modify.h" #include "pair.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -87,12 +89,9 @@ void ComputeSMD_Ulsph_Effm::compute_peratom() { } int itmp = 0; - double *particle_dt = (double *) force->pair->extract("smd/ulsph/effective_modulus_ptr", - itmp); - if (particle_dt == nullptr) { - error->all(FLERR, - "compute smd/ulsph_effm failed to access particle_dt array"); - } + auto particle_dt = (double *) force->pair->extract("smd/ulsph/effective_modulus_ptr", itmp); + if (particle_dt == nullptr) + error->all(FLERR, "compute smd/ulsph_effm failed to access particle_dt array"); int *mask = atom->mask; int nlocal = atom->nlocal; diff --git a/src/MACHDYN/compute_smd_ulsph_strain_rate.cpp b/src/MACHDYN/compute_smd_ulsph_strain_rate.cpp index 9e2709eb0a..b690bfab88 100644 --- a/src/MACHDYN/compute_smd_ulsph_strain_rate.cpp +++ b/src/MACHDYN/compute_smd_ulsph_strain_rate.cpp @@ -87,7 +87,7 @@ void ComputeSMDULSPHStrainRate::compute_peratom() { } int itmp = 0; - Matrix3d *L = (Matrix3d *) force->pair->extract("smd/ulsph/velocityGradient_ptr", itmp); + auto L = (Matrix3d *) force->pair->extract("smd/ulsph/velocityGradient_ptr", itmp); if (L == nullptr) { error->all(FLERR, "compute smd/ulsph_strain_rate could not access any velocity gradients. Are the matching pair styles present?"); diff --git a/src/MACHDYN/compute_smd_ulsph_stress.cpp b/src/MACHDYN/compute_smd_ulsph_stress.cpp index 9aa75b76e8..b7bf3fd546 100644 --- a/src/MACHDYN/compute_smd_ulsph_stress.cpp +++ b/src/MACHDYN/compute_smd_ulsph_stress.cpp @@ -99,7 +99,7 @@ void ComputeSMDULSPHStress::compute_peratom() { } int itmp = 0; - Matrix3d *T = (Matrix3d *) force->pair->extract("smd/ulsph/stressTensor_ptr", itmp); + auto T = (Matrix3d *) force->pair->extract("smd/ulsph/stressTensor_ptr", itmp); if (T == nullptr) { error->all(FLERR, "compute smd/ulsph_stress could not access stress tensors. Are the matching pair styles present?"); } diff --git a/src/MACHDYN/fix_smd_adjust_dt.cpp b/src/MACHDYN/fix_smd_adjust_dt.cpp index f45364713a..0890527640 100644 --- a/src/MACHDYN/fix_smd_adjust_dt.cpp +++ b/src/MACHDYN/fix_smd_adjust_dt.cpp @@ -103,11 +103,11 @@ void FixSMDTlsphDtReset::end_of_step() { * extract minimum CFL timestep from TLSPH and ULSPH pair styles */ - double *dtCFL_TLSPH = (double *) force->pair->extract("smd/tlsph/dtCFL_ptr", itmp); - double *dtCFL_ULSPH = (double *) force->pair->extract("smd/ulsph/dtCFL_ptr", itmp); - double *dt_TRI = (double *) force->pair->extract("smd/tri_surface/stable_time_increment_ptr", itmp); - double *dt_HERTZ = (double *) force->pair->extract("smd/hertz/stable_time_increment_ptr", itmp); - double *dt_PERI_IPMB = (double *) force->pair->extract("smd/peri_ipmb/stable_time_increment_ptr", itmp); + auto dtCFL_TLSPH = (double *) force->pair->extract("smd/tlsph/dtCFL_ptr", itmp); + auto dtCFL_ULSPH = (double *) force->pair->extract("smd/ulsph/dtCFL_ptr", itmp); + auto dt_TRI = (double *) force->pair->extract("smd/tri_surface/stable_time_increment_ptr", itmp); + auto dt_HERTZ = (double *) force->pair->extract("smd/hertz/stable_time_increment_ptr", itmp); + auto dt_PERI_IPMB = (double *) force->pair->extract("smd/peri_ipmb/stable_time_increment_ptr", itmp); if ((dtCFL_TLSPH == nullptr) && (dtCFL_ULSPH == nullptr) && (dt_TRI == nullptr) && (dt_HERTZ == nullptr) && (dt_PERI_IPMB == nullptr)) { @@ -222,7 +222,7 @@ void FixSMDTlsphDtReset::write_restart(FILE *fp) { void FixSMDTlsphDtReset::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; t_elapsed = list[n++]; } diff --git a/src/MACHDYN/fix_smd_integrate_tlsph.cpp b/src/MACHDYN/fix_smd_integrate_tlsph.cpp index 8bde3b3d07..cb020d330d 100644 --- a/src/MACHDYN/fix_smd_integrate_tlsph.cpp +++ b/src/MACHDYN/fix_smd_integrate_tlsph.cpp @@ -137,7 +137,7 @@ void FixSMDIntegrateTlsph::initial_integrate(int /*vflag*/) { if (igroup == atom->firstgroup) nlocal = atom->nfirst; - Vector3d *smoothVelDifference = (Vector3d *) force->pair->extract("smd/tlsph/smoothVel_ptr", itmp); + auto smoothVelDifference = (Vector3d *) force->pair->extract("smd/tlsph/smoothVel_ptr", itmp); if (xsphFlag) { if (smoothVelDifference == nullptr) { diff --git a/src/MACHDYN/fix_smd_integrate_ulsph.cpp b/src/MACHDYN/fix_smd_integrate_ulsph.cpp index 967cf33095..2a082078a6 100644 --- a/src/MACHDYN/fix_smd_integrate_ulsph.cpp +++ b/src/MACHDYN/fix_smd_integrate_ulsph.cpp @@ -169,7 +169,7 @@ void FixSMDIntegrateUlsph::initial_integrate(int /*vflag*/) { * get smoothed velocities from ULSPH pair style */ - Vector3d *smoothVel = (Vector3d *) force->pair->extract("smd/ulsph/smoothVel_ptr", itmp); + auto smoothVel = (Vector3d *) force->pair->extract("smd/ulsph/smoothVel_ptr", itmp); if (xsphFlag) { if (smoothVel == nullptr) { @@ -264,7 +264,7 @@ void FixSMDIntegrateUlsph::final_integrate() { error->one(FLERR, "fix smd/integrate_ulsph failed to accesss num_neighs array"); } - Matrix3d *L = (Matrix3d *) force->pair->extract("smd/ulsph/velocityGradient_ptr", itmp); + auto L = (Matrix3d *) force->pair->extract("smd/ulsph/velocityGradient_ptr", itmp); if (L == nullptr) { error->one(FLERR, "fix smd/integrate_ulsph failed to accesss velocityGradient array"); } diff --git a/src/MACHDYN/fix_smd_tlsph_reference_configuration.cpp b/src/MACHDYN/fix_smd_tlsph_reference_configuration.cpp index a3ba73709b..df23726b38 100644 --- a/src/MACHDYN/fix_smd_tlsph_reference_configuration.cpp +++ b/src/MACHDYN/fix_smd_tlsph_reference_configuration.cpp @@ -27,7 +27,6 @@ #include "fix_smd_tlsph_reference_configuration.h" -#include #include "atom.h" #include "comm.h" #include "neigh_list.h" @@ -41,12 +40,14 @@ #include "smd_kernels.h" #include "smd_math.h" +#include + using namespace Eigen; using namespace LAMMPS_NS; using namespace FixConst; using namespace SMD_Kernels; -using namespace std; using namespace SMD_Math; + #define DELTA 16384 #define INSERT_PREDEFINED_CRACKS false @@ -54,141 +55,134 @@ using namespace SMD_Math; /* ---------------------------------------------------------------------- */ FixSMD_TLSPH_ReferenceConfiguration::FixSMD_TLSPH_ReferenceConfiguration(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) { + Fix(lmp, narg, arg) { - if (atom->map_style == Atom::MAP_NONE) - error->all(FLERR, "Pair tlsph with partner list requires an atom map, see atom_modify"); + if (atom->map_style == Atom::MAP_NONE) + error->all(FLERR, "Pair tlsph with partner list requires an atom map, see atom_modify"); - maxpartner = 1; - npartner = nullptr; - partner = nullptr; - wfd_list = nullptr; - wf_list = nullptr; - energy_per_bond = nullptr; - degradation_ij = nullptr; - grow_arrays(atom->nmax); - atom->add_callback(Atom::GROW); + maxpartner = 1; + npartner = nullptr; + partner = nullptr; + wfd_list = nullptr; + wf_list = nullptr; + energy_per_bond = nullptr; + degradation_ij = nullptr; + grow_arrays(atom->nmax); + atom->add_callback(Atom::GROW); - // initialize npartner to 0 so neighbor list creation is OK the 1st time - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) { - npartner[i] = 0; - } + // initialize npartner to 0 so neighbor list creation is OK the 1st time + int nlocal = atom->nlocal; + for (int i = 0; i < nlocal; i++) { + npartner[i] = 0; + } - comm_forward = 14; - updateFlag = 1; + comm_forward = 14; + updateFlag = 1; } /* ---------------------------------------------------------------------- */ FixSMD_TLSPH_ReferenceConfiguration::~FixSMD_TLSPH_ReferenceConfiguration() { - // unregister this fix so atom class doesn't invoke it any more + // unregister this fix so atom class doesn't invoke it any more - atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays - memory->destroy(npartner); - memory->destroy(partner); - memory->destroy(wfd_list); - memory->destroy(wf_list); - memory->destroy(degradation_ij); - memory->destroy(energy_per_bond); + memory->destroy(npartner); + memory->destroy(partner); + memory->destroy(wfd_list); + memory->destroy(wf_list); + memory->destroy(degradation_ij); + memory->destroy(energy_per_bond); } /* ---------------------------------------------------------------------- */ int FixSMD_TLSPH_ReferenceConfiguration::setmask() { - int mask = 0; - mask |= PRE_EXCHANGE; - return mask; + int mask = 0; + mask |= PRE_EXCHANGE; + return mask; } /* ---------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::init() { - if (atom->tag_enable == 0) - error->all(FLERR, "Pair style tlsph requires atoms have IDs"); + if (atom->tag_enable == 0) error->all(FLERR, "Pair style tlsph requires atoms have IDs"); } /* ---------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::pre_exchange() { - //return; - //printf("in FixSMD_TLSPH_ReferenceConfiguration::pre_exchange()\n"); - double **defgrad = atom->smd_data_9; - double *radius = atom->radius; - double *rho = atom->rho; - double *vfrac = atom->vfrac; - double **x = atom->x; - double **x0 = atom->x0; - double *rmass = atom->rmass; - int nlocal = atom->nlocal; - int i, itmp; - int *mask = atom->mask; - if (igroup == atom->firstgroup) { - nlocal = atom->nfirst; + double **defgrad = atom->smd_data_9; + double *radius = atom->radius; + double *rho = atom->rho; + double *vfrac = atom->vfrac; + double **x = atom->x; + double **x0 = atom->x0; + double *rmass = atom->rmass; + int nlocal = atom->nlocal; + int i, itmp; + int *mask = atom->mask; + if (igroup == atom->firstgroup) { + nlocal = atom->nfirst; + } + + int *updateFlag_ptr = (int *) force->pair->extract("smd/tlsph/updateFlag_ptr", itmp); + if (updateFlag_ptr == nullptr) { + error->one(FLERR, + "fix FixSMD_TLSPH_ReferenceConfiguration failed to access updateFlag pointer. Check if a pair style exist which calculates this quantity."); + } + + int *nn = (int *) force->pair->extract("smd/tlsph/numNeighsRefConfig_ptr", itmp); + if (nn == nullptr) { + error->all(FLERR, "FixSMDIntegrateTlsph::updateReferenceConfiguration() failed to access numNeighsRefConfig_ptr array"); + } + + // sum all update flag across processors + MPI_Allreduce(updateFlag_ptr, &updateFlag, 1, MPI_INT, MPI_MAX, world); + + if (updateFlag > 0) { + if (comm->me == 0) utils::logmesg(lmp, "**** updating ref config at step: {}\n", update->ntimestep); + + for (i = 0; i < nlocal; i++) { + + if (mask[i] & groupbit) { + + // re-set x0 coordinates + x0[i][0] = x[i][0]; + x0[i][1] = x[i][1]; + x0[i][2] = x[i][2]; + + // re-set deformation gradient + defgrad[i][0] = 1.0; + defgrad[i][1] = 0.0; + defgrad[i][2] = 0.0; + defgrad[i][3] = 0.0; + defgrad[i][4] = 1.0; + defgrad[i][5] = 0.0; + defgrad[i][6] = 0.0; + defgrad[i][7] = 0.0; + defgrad[i][8] = 1.0; + /* + * Adjust particle volume as the reference configuration is changed. + * We safeguard against excessive deformations by limiting the adjustment range + * to the intervale J \in [0.9..1.1] + */ + vfrac[i] = rmass[i] / rho[i]; + + if (nn[i] < 15) { + radius[i] *= 1.2; } + } + } - int *updateFlag_ptr = (int *) force->pair->extract("smd/tlsph/updateFlag_ptr", itmp); - if (updateFlag_ptr == nullptr) { - error->one(FLERR, - "fix FixSMD_TLSPH_ReferenceConfiguration failed to access updateFlag pointer. Check if a pair style exist which calculates this quantity."); - } + // update of reference config could have changed x0, vfrac, radius + // communicate these quantities now to ghosts: x0, vfrac, radius + comm->forward_comm(this); - int *nn = (int *) force->pair->extract("smd/tlsph/numNeighsRefConfig_ptr", itmp); - if (nn == nullptr) { - error->all(FLERR, "FixSMDIntegrateTlsph::updateReferenceConfiguration() failed to access numNeighsRefConfig_ptr array"); - } - - // sum all update flag across processors - MPI_Allreduce(updateFlag_ptr, &updateFlag, 1, MPI_INT, MPI_MAX, world); - - if (updateFlag > 0) { - if (comm->me == 0) { - printf("**** updating ref config at step: " BIGINT_FORMAT "\n", update->ntimestep); - } - - for (i = 0; i < nlocal; i++) { - - if (mask[i] & groupbit) { - - // re-set x0 coordinates - x0[i][0] = x[i][0]; - x0[i][1] = x[i][1]; - x0[i][2] = x[i][2]; - - // re-set deformation gradient - defgrad[i][0] = 1.0; - defgrad[i][1] = 0.0; - defgrad[i][2] = 0.0; - defgrad[i][3] = 0.0; - defgrad[i][4] = 1.0; - defgrad[i][5] = 0.0; - defgrad[i][6] = 0.0; - defgrad[i][7] = 0.0; - defgrad[i][8] = 1.0; - /* - * Adjust particle volume as the reference configuration is changed. - * We safeguard against excessive deformations by limiting the adjustment range - * to the intervale J \in [0.9..1.1] - */ - vfrac[i] = rmass[i] / rho[i]; -// - if (nn[i] < 15) { - radius[i] *= 1.2; - } // else //{ - // radius[i] *= pow(J, 1.0 / domain->dimension); - //} - } - } - - // update of reference config could have changed x0, vfrac, radius - // communicate these quantities now to ghosts: x0, vfrac, radius - comm->forward_comm(this); - - setup(0); - } + setup(0); + } } /* ---------------------------------------------------------------------- @@ -197,155 +191,155 @@ void FixSMD_TLSPH_ReferenceConfiguration::pre_exchange() { ------------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::setup(int /*vflag*/) { - int i, j, ii, jj, n, inum, jnum; - int *ilist, *jlist, *numneigh, **firstneigh; - double r, h, wf, wfd; - Vector3d dx; + int i, j, ii, jj, n, inum, jnum; + int *ilist, *jlist, *numneigh, **firstneigh; + double r, h, wf, wfd; + Vector3d dx; - if (updateFlag == 0) - return; + if (updateFlag == 0) + return; - int nlocal = atom->nlocal; - nmax = atom->nmax; - grow_arrays(nmax); + int nlocal = atom->nlocal; + nmax = atom->nmax; + grow_arrays(nmax); // 1st loop over neighbor list // calculate npartner for each owned atom // nlocal_neigh = nlocal when neigh list was built, may be smaller than nlocal - double **x0 = atom->x; - double *radius = atom->radius; - int *mask = atom->mask; - tagint *tag = atom->tag; - NeighList *list = pair->list; - inum = list->inum; - ilist = list->ilist; - numneigh = list->numneigh; - firstneigh = list->firstneigh; + double **x0 = atom->x; + double *radius = atom->radius; + int *mask = atom->mask; + tagint *tag = atom->tag; + NeighList *list = pair->list; + inum = list->inum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; - // zero npartner for all current atoms - for (i = 0; i < nlocal; i++) - npartner[i] = 0; + // zero npartner for all current atoms + for (i = 0; i < nlocal; i++) + npartner[i] = 0; - for (ii = 0; ii < inum; ii++) { - i = ilist[ii]; - jlist = firstneigh[i]; - jnum = numneigh[i]; + for (ii = 0; ii < inum; ii++) { + i = ilist[ii]; + jlist = firstneigh[i]; + jnum = numneigh[i]; - for (jj = 0; jj < jnum; jj++) { - j = jlist[jj]; - j &= NEIGHMASK; + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + j &= NEIGHMASK; - if (INSERT_PREDEFINED_CRACKS) { - if (!crack_exclude(i, j)) - continue; - } + if (INSERT_PREDEFINED_CRACKS) { + if (!crack_exclude(i, j)) + continue; + } - dx(0) = x0[i][0] - x0[j][0]; - dx(1) = x0[i][1] - x0[j][1]; - dx(2) = x0[i][2] - x0[j][2]; - r = dx.norm(); - h = radius[i] + radius[j]; + dx(0) = x0[i][0] - x0[j][0]; + dx(1) = x0[i][1] - x0[j][1]; + dx(2) = x0[i][2] - x0[j][2]; + r = dx.norm(); + h = radius[i] + radius[j]; - if (r <= h) { - npartner[i]++; - if (j < nlocal) { - npartner[j]++; - } - } - } + if (r <= h) { + npartner[i]++; + if (j < nlocal) { + npartner[j]++; } + } + } + } - maxpartner = 0; - for (i = 0; i < nlocal; i++) - maxpartner = MAX(maxpartner, npartner[i]); - int maxall; - MPI_Allreduce(&maxpartner, &maxall, 1, MPI_INT, MPI_MAX, world); - maxpartner = maxall; + maxpartner = 0; + for (i = 0; i < nlocal; i++) + maxpartner = MAX(maxpartner, npartner[i]); + int maxall; + MPI_Allreduce(&maxpartner, &maxall, 1, MPI_INT, MPI_MAX, world); + maxpartner = maxall; - grow_arrays(nmax); + grow_arrays(nmax); - for (i = 0; i < nlocal; i++) { - npartner[i] = 0; - for (jj = 0; jj < maxpartner; jj++) { - wfd_list[i][jj] = 0.0; - wf_list[i][jj] = 0.0; - degradation_ij[i][jj] = 0.0; - energy_per_bond[i][jj] = 0.0; - } + for (i = 0; i < nlocal; i++) { + npartner[i] = 0; + for (jj = 0; jj < maxpartner; jj++) { + wfd_list[i][jj] = 0.0; + wf_list[i][jj] = 0.0; + degradation_ij[i][jj] = 0.0; + energy_per_bond[i][jj] = 0.0; + } + } + + for (ii = 0; ii < inum; ii++) { + i = ilist[ii]; + jlist = firstneigh[i]; + jnum = numneigh[i]; + + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + j &= NEIGHMASK; + + dx(0) = x0[i][0] - x0[j][0]; + dx(1) = x0[i][1] - x0[j][1]; + dx(2) = x0[i][2] - x0[j][2]; + r = dx.norm(); + h = radius[i] + radius[j]; + + if (INSERT_PREDEFINED_CRACKS) { + if (!crack_exclude(i, j)) + continue; + } + + if (r < h) { + spiky_kernel_and_derivative(h, r, domain->dimension, wf, wfd); + + partner[i][npartner[i]] = tag[j]; + wfd_list[i][npartner[i]] = wfd; + wf_list[i][npartner[i]] = wf; + npartner[i]++; + if (j < nlocal) { + partner[j][npartner[j]] = tag[i]; + wfd_list[j][npartner[j]] = wfd; + wf_list[j][npartner[j]] = wf; + npartner[j]++; } + } + } + } - for (ii = 0; ii < inum; ii++) { - i = ilist[ii]; - jlist = firstneigh[i]; - jnum = numneigh[i]; + // count number of particles for which this group is active - for (jj = 0; jj < jnum; jj++) { - j = jlist[jj]; - j &= NEIGHMASK; + // bond statistics + if (update->ntimestep > -1) { + n = 0; + int count = 0; + for (i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + n += npartner[i]; + count += 1; + } + } + int nall, countall; + MPI_Allreduce(&n, &nall, 1, MPI_INT, MPI_SUM, world); + MPI_Allreduce(&count, &countall, 1, MPI_INT, MPI_SUM, world); + if (countall < 1) countall = 1; - dx(0) = x0[i][0] - x0[j][0]; - dx(1) = x0[i][1] - x0[j][1]; - dx(2) = x0[i][2] - x0[j][2]; - r = dx.norm(); - h = radius[i] + radius[j]; + if (comm->me == 0) { + if (screen) { + printf("\n>>========>>========>>========>>========>>========>>========>>========>>========\n"); + fprintf(screen, "TLSPH neighbors:\n"); + fprintf(screen, " max # of neighbors for a single particle = %d\n", maxpartner); + fprintf(screen, " average # of neighbors/particle in group tlsph = %g\n", (double) nall / countall); + printf(">>========>>========>>========>>========>>========>>========>>========>>========\n\n"); + } + if (logfile) { + fprintf(logfile, "\nTLSPH neighbors:\n"); + fprintf(logfile, " max # of neighbors for a single particle = %d\n", maxpartner); + fprintf(logfile, " average # of neighbors/particle in group tlsph = %g\n", (double) nall / countall); + } + } + } - if (INSERT_PREDEFINED_CRACKS) { - if (!crack_exclude(i, j)) - continue; - } - - if (r < h) { - spiky_kernel_and_derivative(h, r, domain->dimension, wf, wfd); - - partner[i][npartner[i]] = tag[j]; - wfd_list[i][npartner[i]] = wfd; - wf_list[i][npartner[i]] = wf; - npartner[i]++; - if (j < nlocal) { - partner[j][npartner[j]] = tag[i]; - wfd_list[j][npartner[j]] = wfd; - wf_list[j][npartner[j]] = wf; - npartner[j]++; - } - } - } - } - - // count number of particles for which this group is active - - // bond statistics - if (update->ntimestep > -1) { - n = 0; - int count = 0; - for (i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) { - n += npartner[i]; - count += 1; - } - } - int nall, countall; - MPI_Allreduce(&n, &nall, 1, MPI_INT, MPI_SUM, world); - MPI_Allreduce(&count, &countall, 1, MPI_INT, MPI_SUM, world); - if (countall < 1) countall = 1; - - if (comm->me == 0) { - if (screen) { - printf("\n>>========>>========>>========>>========>>========>>========>>========>>========\n"); - fprintf(screen, "TLSPH neighbors:\n"); - fprintf(screen, " max # of neighbors for a single particle = %d\n", maxpartner); - fprintf(screen, " average # of neighbors/particle in group tlsph = %g\n", (double) nall / countall); - printf(">>========>>========>>========>>========>>========>>========>>========>>========\n\n"); - } - if (logfile) { - fprintf(logfile, "\nTLSPH neighbors:\n"); - fprintf(logfile, " max # of neighbors for a single particle = %d\n", maxpartner); - fprintf(logfile, " average # of neighbors/particle in group tlsph = %g\n", (double) nall / countall); - } - } - } - - updateFlag = 0; // set update flag to zero after the update + updateFlag = 0; // set update flag to zero after the update } @@ -354,14 +348,14 @@ void FixSMD_TLSPH_ReferenceConfiguration::setup(int /*vflag*/) { ------------------------------------------------------------------------- */ double FixSMD_TLSPH_ReferenceConfiguration::memory_usage() { - int nmax = atom->nmax; - int bytes = nmax * sizeof(int); - bytes += (double)nmax * maxpartner * sizeof(tagint); // partner array - bytes += (double)nmax * maxpartner * sizeof(float); // wf_list - bytes += (double)nmax * maxpartner * sizeof(float); // wfd_list - bytes += (double)nmax * maxpartner * sizeof(float); // damage_per_interaction array - bytes += (double)nmax * sizeof(int); // npartner array - return bytes; + int nmax = atom->nmax; + int bytes = nmax * sizeof(int); + bytes += (double)nmax * maxpartner * sizeof(tagint); // partner array + bytes += (double)nmax * maxpartner * sizeof(float); // wf_list + bytes += (double)nmax * maxpartner * sizeof(float); // wfd_list + bytes += (double)nmax * maxpartner * sizeof(float); // damage_per_interaction array + bytes += (double)nmax * sizeof(int); // npartner array + return bytes; } @@ -370,13 +364,12 @@ double FixSMD_TLSPH_ReferenceConfiguration::memory_usage() { ------------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::grow_arrays(int nmax) { - //printf("in FixSMD_TLSPH_ReferenceConfiguration::grow_arrays\n"); - memory->grow(npartner, nmax, "tlsph_refconfig_neigh:npartner"); - memory->grow(partner, nmax, maxpartner, "tlsph_refconfig_neigh:partner"); - memory->grow(wfd_list, nmax, maxpartner, "tlsph_refconfig_neigh:wfd"); - memory->grow(wf_list, nmax, maxpartner, "tlsph_refconfig_neigh:wf"); - memory->grow(degradation_ij, nmax, maxpartner, "tlsph_refconfig_neigh:degradation_ij"); - memory->grow(energy_per_bond, nmax, maxpartner, "tlsph_refconfig_neigh:damage_onset_strain"); + memory->grow(npartner, nmax, "tlsph_refconfig_neigh:npartner"); + memory->grow(partner, nmax, maxpartner, "tlsph_refconfig_neigh:partner"); + memory->grow(wfd_list, nmax, maxpartner, "tlsph_refconfig_neigh:wfd"); + memory->grow(wf_list, nmax, maxpartner, "tlsph_refconfig_neigh:wf"); + memory->grow(degradation_ij, nmax, maxpartner, "tlsph_refconfig_neigh:degradation_ij"); + memory->grow(energy_per_bond, nmax, maxpartner, "tlsph_refconfig_neigh:damage_onset_strain"); } /* ---------------------------------------------------------------------- @@ -384,14 +377,14 @@ void FixSMD_TLSPH_ReferenceConfiguration::grow_arrays(int nmax) { ------------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::copy_arrays(int i, int j, int /*delflag*/) { - npartner[j] = npartner[i]; - for (int m = 0; m < npartner[j]; m++) { - partner[j][m] = partner[i][m]; - wfd_list[j][m] = wfd_list[i][m]; - wf_list[j][m] = wf_list[i][m]; - degradation_ij[j][m] = degradation_ij[i][m]; - energy_per_bond[j][m] = energy_per_bond[i][m]; - } + npartner[j] = npartner[i]; + for (int m = 0; m < npartner[j]; m++) { + partner[j][m] = partner[i][m]; + wfd_list[j][m] = wfd_list[i][m]; + wf_list[j][m] = wf_list[i][m]; + degradation_ij[j][m] = degradation_ij[i][m]; + energy_per_bond[j][m] = energy_per_bond[i][m]; + } } /* ---------------------------------------------------------------------- @@ -402,18 +395,16 @@ int FixSMD_TLSPH_ReferenceConfiguration::pack_exchange(int i, double *buf) { // NOTE: how do I know comm buf is big enough if extreme # of touching neighs // Comm::BUFEXTRA may need to be increased -//printf("pack_exchange ...\n"); - - int m = 0; - buf[m++] = npartner[i]; - for (int n = 0; n < npartner[i]; n++) { - buf[m++] = partner[i][n]; - buf[m++] = wfd_list[i][n]; - buf[m++] = wf_list[i][n]; - buf[m++] = degradation_ij[i][n]; - buf[m++] = energy_per_bond[i][n]; - } - return m; + int m = 0; + buf[m++] = npartner[i]; + for (int n = 0; n < npartner[i]; n++) { + buf[m++] = partner[i][n]; + buf[m++] = wfd_list[i][n]; + buf[m++] = wf_list[i][n]; + buf[m++] = degradation_ij[i][n]; + buf[m++] = energy_per_bond[i][n]; + } + return m; } @@ -422,27 +413,25 @@ int FixSMD_TLSPH_ReferenceConfiguration::pack_exchange(int i, double *buf) { ------------------------------------------------------------------------- */ int FixSMD_TLSPH_ReferenceConfiguration::unpack_exchange(int nlocal, double *buf) { - if (nlocal == nmax) { - //printf("nlocal=%d, nmax=%d\n", nlocal, nmax); - nmax = nmax / DELTA * DELTA; - nmax += DELTA; - grow_arrays(nmax); + if (nlocal == nmax) { + nmax = nmax / DELTA * DELTA; + nmax += DELTA; + grow_arrays(nmax); - error->message(FLERR, - "in Fixtlsph_refconfigNeighGCG::unpack_exchange: local arrays too small for receiving partner information; growing arrays"); - } -//printf("nlocal=%d, nmax=%d\n", nlocal, nmax); + if (comm->me == 0) + error->message(FLERR, "in Fixtlsph_refconfigNeighGCG::unpack_exchange: local arrays too small for receiving partner information; growing arrays"); + } - int m = 0; - npartner[nlocal] = static_cast(buf[m++]); - for (int n = 0; n < npartner[nlocal]; n++) { - partner[nlocal][n] = static_cast(buf[m++]); - wfd_list[nlocal][n] = static_cast(buf[m++]); - wf_list[nlocal][n] = static_cast(buf[m++]); - degradation_ij[nlocal][n] = static_cast(buf[m++]); - energy_per_bond[nlocal][n] = static_cast(buf[m++]); - } - return m; + int m = 0; + npartner[nlocal] = static_cast(buf[m++]); + for (int n = 0; n < npartner[nlocal]; n++) { + partner[nlocal][n] = static_cast(buf[m++]); + wfd_list[nlocal][n] = static_cast(buf[m++]); + wf_list[nlocal][n] = static_cast(buf[m++]); + degradation_ij[nlocal][n] = static_cast(buf[m++]); + energy_per_bond[nlocal][n] = static_cast(buf[m++]); + } + return m; } /* ---------------------------------------------------------------------- @@ -450,18 +439,18 @@ 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++) { - buf[m++] = partner[i][n]; - buf[m++] = wfd_list[i][n]; - buf[m++] = wf_list[i][n]; - buf[m++] = degradation_ij[i][n]; - buf[m++] = energy_per_bond[i][n]; - } - return m; + 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++) { + buf[m++] = partner[i][n]; + buf[m++] = wfd_list[i][n]; + buf[m++] = wf_list[i][n]; + buf[m++] = degradation_ij[i][n]; + buf[m++] = energy_per_bond[i][n]; + } + return m; } /* ---------------------------------------------------------------------- @@ -496,9 +485,9 @@ void FixSMD_TLSPH_ReferenceConfiguration::unpack_restart(int /*nlocal*/, int /*n int FixSMD_TLSPH_ReferenceConfiguration::maxsize_restart() { // maxtouch_all = max # of touching partners across all procs - int maxtouch_all; - MPI_Allreduce(&maxpartner, &maxtouch_all, 1, MPI_INT, MPI_MAX, world); - return 4 * maxtouch_all + 2; + int maxtouch_all; + MPI_Allreduce(&maxpartner, &maxtouch_all, 1, MPI_INT, MPI_MAX, world); + return 4 * maxtouch_all + 2; } /* ---------------------------------------------------------------------- @@ -506,72 +495,71 @@ int FixSMD_TLSPH_ReferenceConfiguration::maxsize_restart() { ------------------------------------------------------------------------- */ int FixSMD_TLSPH_ReferenceConfiguration::size_restart(int nlocal) { - return 4 * npartner[nlocal] + 2; + return 4 * npartner[nlocal] + 2; } /* ---------------------------------------------------------------------- */ int FixSMD_TLSPH_ReferenceConfiguration::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/) { - int i, j, m; - double *radius = atom->radius; - double *vfrac = atom->vfrac; - double **x0 = atom->x0; - double **defgrad0 = atom->smd_data_9; + int i, j, m; + double *radius = atom->radius; + double *vfrac = atom->vfrac; + double **x0 = atom->x0; + double **defgrad0 = atom->smd_data_9; - //printf("FixSMD_TLSPH_ReferenceConfiguration:::pack_forward_comm\n"); - m = 0; - for (i = 0; i < n; i++) { - j = list[i]; - buf[m++] = x0[j][0]; - buf[m++] = x0[j][1]; - buf[m++] = x0[j][2]; + m = 0; + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = x0[j][0]; + buf[m++] = x0[j][1]; + buf[m++] = x0[j][2]; - buf[m++] = vfrac[j]; - buf[m++] = radius[j]; + buf[m++] = vfrac[j]; + buf[m++] = radius[j]; - buf[m++] = defgrad0[i][0]; - buf[m++] = defgrad0[i][1]; - buf[m++] = defgrad0[i][2]; - buf[m++] = defgrad0[i][3]; - buf[m++] = defgrad0[i][4]; - buf[m++] = defgrad0[i][5]; - buf[m++] = defgrad0[i][6]; - buf[m++] = defgrad0[i][7]; - buf[m++] = defgrad0[i][8]; + buf[m++] = defgrad0[i][0]; + buf[m++] = defgrad0[i][1]; + buf[m++] = defgrad0[i][2]; + buf[m++] = defgrad0[i][3]; + buf[m++] = defgrad0[i][4]; + buf[m++] = defgrad0[i][5]; + buf[m++] = defgrad0[i][6]; + buf[m++] = defgrad0[i][7]; + buf[m++] = defgrad0[i][8]; - } - return m; + } + return m; } /* ---------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::unpack_forward_comm(int n, int first, double *buf) { - int i, m, last; - double *radius = atom->radius; - double *vfrac = atom->vfrac; - double **x0 = atom->x0; - double **defgrad0 = atom->smd_data_9; + int i, m, last; + double *radius = atom->radius; + double *vfrac = atom->vfrac; + double **x0 = atom->x0; + double **defgrad0 = atom->smd_data_9; - m = 0; - last = first + n; - for (i = first; i < last; i++) { - x0[i][0] = buf[m++]; - x0[i][1] = buf[m++]; - x0[i][2] = buf[m++]; + m = 0; + last = first + n; + for (i = first; i < last; i++) { + x0[i][0] = buf[m++]; + x0[i][1] = buf[m++]; + x0[i][2] = buf[m++]; - vfrac[i] = buf[m++]; - radius[i] = buf[m++]; + vfrac[i] = buf[m++]; + radius[i] = buf[m++]; - defgrad0[i][0] = buf[m++]; - defgrad0[i][1] = buf[m++]; - defgrad0[i][2] = buf[m++]; - defgrad0[i][3] = buf[m++]; - defgrad0[i][4] = buf[m++]; - defgrad0[i][5] = buf[m++]; - defgrad0[i][6] = buf[m++]; - defgrad0[i][7] = buf[m++]; - defgrad0[i][8] = buf[m++]; - } + defgrad0[i][0] = buf[m++]; + defgrad0[i][1] = buf[m++]; + defgrad0[i][2] = buf[m++]; + defgrad0[i][3] = buf[m++]; + defgrad0[i][4] = buf[m++]; + defgrad0[i][5] = buf[m++]; + defgrad0[i][6] = buf[m++]; + defgrad0[i][7] = buf[m++]; + defgrad0[i][8] = buf[m++]; + } } /* ---------------------------------------------------------------------- @@ -582,26 +570,24 @@ void FixSMD_TLSPH_ReferenceConfiguration::unpack_forward_comm(int n, int first, bool FixSMD_TLSPH_ReferenceConfiguration::crack_exclude(int i, int j) { - double **x = atom->x; - double l0 = domain->lattice->xlattice; + double **x = atom->x; + double l0 = domain->lattice->xlattice; - // line between pair of atoms i,j - double x1 = x[i][0] / l0; - double y1 = x[i][1] / l0; + // line between pair of atoms i,j + double x1 = x[i][0] / l0; + double y1 = x[i][1] / l0; - double x2 = x[j][0] / l0; - double y2 = x[j][1] / l0; + double x2 = x[j][0] / l0; + double y2 = x[j][1] / l0; - // hardcoded crack line - double x3 = -0.1 / l0; - double y3 = ((int) 1.0 / l0) + 0.5; - //printf("y3 = %f\n", y3); - double x4 = 0.1 / l0 - 1.0 + 0.1; - double y4 = y3; + // hardcoded crack line + double x3 = -0.1 / l0; + double y3 = ((int) 1.0 / l0) + 0.5; + double x4 = 0.1 / l0 - 1.0 + 0.1; + double y4 = y3; - bool retVal = DoLineSegmentsIntersect(x1, y1, x2, y2, x3, y3, x4, y4); + bool retVal = DoLineSegmentsIntersect(x1, y1, x2, y2, x3, y3, x4, y4); - return !retVal; - //return 1; + return !retVal; } diff --git a/src/MACHDYN/pair_smd_tlsph.cpp b/src/MACHDYN/pair_smd_tlsph.cpp index 5fcc8742de..ac1ccd7eb2 100644 --- a/src/MACHDYN/pair_smd_tlsph.cpp +++ b/src/MACHDYN/pair_smd_tlsph.cpp @@ -45,11 +45,9 @@ #include #include #include -#include using namespace SMD_Kernels; using namespace Eigen; -using namespace std; using namespace LAMMPS_NS; using namespace SMD_Math; @@ -62,68 +60,67 @@ using namespace SMD_Math; /* ---------------------------------------------------------------------- */ PairTlsph::PairTlsph(LAMMPS *lmp) : - Pair(lmp) { + Pair(lmp) { - onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; + onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; - failureModel = nullptr; - strengthModel = eos = nullptr; + failureModel = nullptr; + strengthModel = eos = nullptr; - nmax = 0; // make sure no atom on this proc such that initial memory allocation is correct - Fdot = Fincr = K = PK1 = nullptr; - R = FincrInv = W = D = nullptr; - detF = nullptr; - smoothVelDifference = nullptr; - numNeighsRefConfig = nullptr; - CauchyStress = nullptr; - hourglass_error = nullptr; - Lookup = nullptr; - particle_dt = nullptr; + nmax = 0; // make sure no atom on this proc such that initial memory allocation is correct + Fdot = Fincr = K = PK1 = nullptr; + R = FincrInv = W = D = nullptr; + detF = nullptr; + smoothVelDifference = nullptr; + numNeighsRefConfig = nullptr; + CauchyStress = nullptr; + hourglass_error = nullptr; + Lookup = nullptr; + particle_dt = nullptr; - updateFlag = 0; - first = true; - dtCFL = 0.0; // initialize dtCFL so it is set to safe value if extracted on zero-th timestep + updateFlag = 0; + first = true; + dtCFL = 0.0; // initialize dtCFL so it is set to safe value if extracted on zero-th timestep - comm_forward = 22; // this pair style communicates 20 doubles to ghost atoms : PK1 tensor + F tensor + shepardWeight - fix_tlsph_reference_configuration = nullptr; + comm_forward = 22; // this pair style communicates 20 doubles to ghost atoms : PK1 tensor + F tensor + shepardWeight + fix_tlsph_reference_configuration = nullptr; - cut_comm = MAX(neighbor->cutneighmax, comm->cutghostuser); // cutoff radius within which ghost atoms are communicated. + cut_comm = MAX(neighbor->cutneighmax, comm->cutghostuser); // cutoff radius within which ghost atoms are communicated. } /* ---------------------------------------------------------------------- */ PairTlsph::~PairTlsph() { - //printf("in PairTlsph::~PairTlsph()\n"); - if (allocated) { - memory->destroy(setflag); - memory->destroy(cutsq); - memory->destroy(strengthModel); - memory->destroy(eos); - memory->destroy(Lookup); + if (allocated) { + memory->destroy(setflag); + memory->destroy(cutsq); + memory->destroy(strengthModel); + memory->destroy(eos); + memory->destroy(Lookup); - delete[] onerad_dynamic; - delete[] onerad_frozen; - delete[] maxrad_dynamic; - delete[] maxrad_frozen; + delete[] onerad_dynamic; + delete[] onerad_frozen; + delete[] maxrad_dynamic; + delete[] maxrad_frozen; - delete[] Fdot; - delete[] Fincr; - delete[] K; - delete[] detF; - delete[] PK1; - delete[] smoothVelDifference; - delete[] R; - delete[] FincrInv; - delete[] W; - delete[] D; - delete[] numNeighsRefConfig; - delete[] CauchyStress; - delete[] hourglass_error; - delete[] particle_dt; + delete[] Fdot; + delete[] Fincr; + delete[] K; + delete[] detF; + delete[] PK1; + delete[] smoothVelDifference; + delete[] R; + delete[] FincrInv; + delete[] W; + delete[] D; + delete[] numNeighsRefConfig; + delete[] CauchyStress; + delete[] hourglass_error; + delete[] particle_dt; - delete[] failureModel; - } + delete[] failureModel; + } } /* ---------------------------------------------------------------------- @@ -133,561 +130,548 @@ PairTlsph::~PairTlsph() { ---------------------------------------------------------------------- */ void PairTlsph::PreCompute() { - tagint *mol = atom->molecule; - double *vfrac = atom->vfrac; - double *radius = atom->radius; - double **x0 = atom->x0; - double **x = atom->x; - double **v = atom->vest; // extrapolated velocities corresponding to current positions - double **vint = atom->v; // Velocity-Verlet algorithm velocities - double *damage = atom->damage; - tagint *tag = atom->tag; - int *type = atom->type; - int nlocal = atom->nlocal; - int jnum, jj, i, j, itype, idim; + tagint *mol = atom->molecule; + double *vfrac = atom->vfrac; + double *radius = atom->radius; + double **x0 = atom->x0; + double **x = atom->x; + double **v = atom->vest; // extrapolated velocities corresponding to current positions + double **vint = atom->v; // Velocity-Verlet algorithm velocities + double *damage = atom->damage; + tagint *tag = atom->tag; + int *type = atom->type; + int nlocal = atom->nlocal; + int jnum, jj, i, j, itype, idim; - tagint **partner = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->partner; - int *npartner = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->npartner; - float **wfd_list = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->wfd_list; - float **wf_list = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->wf_list; - float **degradation_ij = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->degradation_ij; - double r0, r0Sq, wf, wfd, h, irad, voli, volj, scale, shepardWeight; - Vector3d dx, dx0, dv, g; - Matrix3d Ktmp, Ftmp, Fdottmp, L, U, eye; - Vector3d vi, vj, vinti, vintj, xi, xj, x0i, x0j, dvint; - int periodic = (domain->xperiodic || domain->yperiodic || domain->zperiodic); - bool status; - Matrix3d F0; + tagint **partner = (dynamic_cast( modify->fix[ifix_tlsph]))->partner; + int *npartner = (dynamic_cast( modify->fix[ifix_tlsph]))->npartner; + float **wfd_list = (dynamic_cast( modify->fix[ifix_tlsph]))->wfd_list; + float **wf_list = (dynamic_cast( modify->fix[ifix_tlsph]))->wf_list; + float **degradation_ij = (dynamic_cast( modify->fix[ifix_tlsph]))->degradation_ij; + double r0, r0Sq, wf, wfd, h, irad, voli, volj, scale, shepardWeight; + Vector3d dx, dx0, dv, g; + Matrix3d Ktmp, Ftmp, Fdottmp, L, U, eye; + Vector3d vi, vj, vinti, vintj, xi, xj, x0i, x0j, dvint; + int periodic = (domain->xperiodic || domain->yperiodic || domain->zperiodic); + bool status; + Matrix3d F0; - eye.setIdentity(); + eye.setIdentity(); - for (i = 0; i < nlocal; i++) { + for (i = 0; i < nlocal; i++) { - itype = type[i]; - if (setflag[itype][itype] == 1) { + itype = type[i]; + if (setflag[itype][itype] == 1) { - K[i].setZero(); - Fincr[i].setZero(); - Fdot[i].setZero(); - numNeighsRefConfig[i] = 0; - smoothVelDifference[i].setZero(); - hourglass_error[i] = 0.0; + K[i].setZero(); + Fincr[i].setZero(); + Fdot[i].setZero(); + numNeighsRefConfig[i] = 0; + smoothVelDifference[i].setZero(); + hourglass_error[i] = 0.0; - if (mol[i] < 0) { // valid SPH particle have mol > 0 - continue; - } + if (mol[i] < 0) { // valid SPH particle have mol > 0 + continue; + } - // initialize aveage mass density - h = 2.0 * radius[i]; - r0 = 0.0; - spiky_kernel_and_derivative(h, r0, domain->dimension, wf, wfd); + // initialize aveage mass density + h = 2.0 * radius[i]; + r0 = 0.0; + spiky_kernel_and_derivative(h, r0, domain->dimension, wf, wfd); - jnum = npartner[i]; - irad = radius[i]; - voli = vfrac[i]; - shepardWeight = wf * voli; + jnum = npartner[i]; + irad = radius[i]; + voli = vfrac[i]; + shepardWeight = wf * voli; - // initialize Eigen data structures from LAMMPS data structures - for (idim = 0; idim < 3; idim++) { - xi(idim) = x[i][idim]; - x0i(idim) = x0[i][idim]; - vi(idim) = v[i][idim]; - vinti(idim) = vint[i][idim]; - } + // initialize Eigen data structures from LAMMPS data structures + for (idim = 0; idim < 3; idim++) { + xi(idim) = x[i][idim]; + x0i(idim) = x0[i][idim]; + vi(idim) = v[i][idim]; + vinti(idim) = vint[i][idim]; + } - for (jj = 0; jj < jnum; jj++) { + for (jj = 0; jj < jnum; jj++) { - if (partner[i][jj] == 0) - continue; - j = atom->map(partner[i][jj]); - if (j < 0) { // // check if lost a partner without first breaking bond - partner[i][jj] = 0; - continue; - } + if (partner[i][jj] == 0) + continue; + j = atom->map(partner[i][jj]); + if (j < 0) { // // check if lost a partner without first breaking bond + partner[i][jj] = 0; + continue; + } - if (mol[j] < 0) { // particle has failed. do not include it for computing any property - continue; - } + if (mol[j] < 0) { // particle has failed. do not include it for computing any property + continue; + } - if (mol[i] != mol[j]) { - continue; - } + if (mol[i] != mol[j]) { + continue; + } - // initialize Eigen data structures from LAMMPS data structures - for (idim = 0; idim < 3; idim++) { - xj(idim) = x[j][idim]; - x0j(idim) = x0[j][idim]; - vj(idim) = v[j][idim]; - vintj(idim) = vint[j][idim]; - } - dx0 = x0j - x0i; - dx = xj - xi; + // initialize Eigen data structures from LAMMPS data structures + for (idim = 0; idim < 3; idim++) { + xj(idim) = x[j][idim]; + x0j(idim) = x0[j][idim]; + vj(idim) = v[j][idim]; + vintj(idim) = vint[j][idim]; + } + dx0 = x0j - x0i; + dx = xj - xi; - if (periodic) - domain->minimum_image(dx0(0), dx0(1), dx0(2)); + if (periodic) + domain->minimum_image(dx0(0), dx0(1), dx0(2)); - r0Sq = dx0.squaredNorm(); - h = irad + radius[j]; + r0Sq = dx0.squaredNorm(); + h = irad + radius[j]; - r0 = sqrt(r0Sq); - volj = vfrac[j]; + r0 = sqrt(r0Sq); + volj = vfrac[j]; - // distance vectors in current and reference configuration, velocity difference - dv = vj - vi; - dvint = vintj - vinti; + // distance vectors in current and reference configuration, velocity difference + dv = vj - vi; + dvint = vintj - vinti; - // scale the interaction according to the damage variable - scale = 1.0 - degradation_ij[i][jj]; - wf = wf_list[i][jj] * scale; - wfd = wfd_list[i][jj] * scale; - g = (wfd / r0) * dx0; + // scale the interaction according to the damage variable + scale = 1.0 - degradation_ij[i][jj]; + wf = wf_list[i][jj] * scale; + wfd = wfd_list[i][jj] * scale; + g = (wfd / r0) * dx0; - /* build matrices */ - Ktmp = -g * dx0.transpose(); - Fdottmp = -dv * g.transpose(); - Ftmp = -(dx - dx0) * g.transpose(); + /* build matrices */ + Ktmp = -g * dx0.transpose(); + Fdottmp = -dv * g.transpose(); + Ftmp = -(dx - dx0) * g.transpose(); - K[i] += volj * Ktmp; - Fdot[i] += volj * Fdottmp; - Fincr[i] += volj * Ftmp; - shepardWeight += volj * wf; - smoothVelDifference[i] += volj * wf * dvint; - numNeighsRefConfig[i]++; - } // end loop over j + K[i] += volj * Ktmp; + Fdot[i] += volj * Fdottmp; + Fincr[i] += volj * Ftmp; + shepardWeight += volj * wf; + smoothVelDifference[i] += volj * wf * dvint; + numNeighsRefConfig[i]++; + } // end loop over j - // normalize average velocity field around an integration point - if (shepardWeight > 0.0) { - smoothVelDifference[i] /= shepardWeight; - } else { - smoothVelDifference[i].setZero(); - } + // normalize average velocity field around an integration point + if (shepardWeight > 0.0) { + smoothVelDifference[i] /= shepardWeight; + } else { + smoothVelDifference[i].setZero(); + } - pseudo_inverse_SVD(K[i]); - Fdot[i] *= K[i]; - Fincr[i] *= K[i]; - Fincr[i] += eye; + pseudo_inverse_SVD(K[i]); + Fdot[i] *= K[i]; + Fincr[i] *= K[i]; + Fincr[i] += eye; - if (JAUMANN) { - R[i].setIdentity(); // for Jaumann stress rate, we do not need a subsequent rotation back into the reference configuration - } else { - status = PolDec(Fincr[i], R[i], U, false); // polar decomposition of the deformation gradient, F = R * U - if (!status) { - error->message(FLERR, "Polar decomposition of deformation gradient failed.\n"); - mol[i] = -1; - } else { - Fincr[i] = R[i] * U; - } - } + if (JAUMANN) { + R[i].setIdentity(); // for Jaumann stress rate, we do not need a subsequent rotation back into the reference configuration + } else { + status = PolDec(Fincr[i], R[i], U, false); // polar decomposition of the deformation gradient, F = R * U + if (!status) { + error->message(FLERR, "Polar decomposition of deformation gradient failed.\n"); + mol[i] = -1; + } else { + Fincr[i] = R[i] * U; + } + } - detF[i] = Fincr[i].determinant(); - FincrInv[i] = Fincr[i].inverse(); + detF[i] = Fincr[i].determinant(); + FincrInv[i] = Fincr[i].inverse(); - // velocity gradient - L = Fdot[i] * FincrInv[i]; + // velocity gradient + L = Fdot[i] * FincrInv[i]; - // symmetric (D) and asymmetric (W) parts of L - D[i] = 0.5 * (L + L.transpose()); - W[i] = 0.5 * (L - L.transpose()); // spin tensor:: need this for Jaumann rate + // symmetric (D) and asymmetric (W) parts of L + D[i] = 0.5 * (L + L.transpose()); + W[i] = 0.5 * (L - L.transpose()); // spin tensor:: need this for Jaumann rate - // unrotated rate-of-deformation tensor d, see right side of Pronto2d, eqn.(2.1.7) - // convention: unrotated frame is that one, where the true rotation of an integration point has been subtracted. - // stress in the unrotated frame of reference is denoted sigma (stress seen by an observer doing rigid body rotations along with the material) - // stress in the true frame of reference (a stationary observer) is denoted by T, "true stress" - D[i] = (R[i].transpose() * D[i] * R[i]).eval(); + // unrotated rate-of-deformation tensor d, see right side of Pronto2d, eqn.(2.1.7) + // convention: unrotated frame is that one, where the true rotation of an integration point has been subtracted. + // stress in the unrotated frame of reference is denoted sigma (stress seen by an observer doing rigid body rotations along with the material) + // stress in the true frame of reference (a stationary observer) is denoted by T, "true stress" + D[i] = (R[i].transpose() * D[i] * R[i]).eval(); - // limit strain rate - //double limit = 1.0e-3 * Lookup[SIGNAL_VELOCITY][itype] / radius[i]; - //D[i] = LimitEigenvalues(D[i], limit); + // limit strain rate + //double limit = 1.0e-3 * Lookup[SIGNAL_VELOCITY][itype] / radius[i]; + //D[i] = LimitEigenvalues(D[i], limit); - /* - * make sure F stays within some limits - */ + /* + * make sure F stays within some limits + */ - if ((detF[i] < DETF_MIN) || (detF[i] > DETF_MAX) || (numNeighsRefConfig[i] == 0)) { - printf("deleting particle [" TAGINT_FORMAT "] because det(F)=%f is outside stable range %f -- %f \n", tag[i], - Fincr[i].determinant(), - DETF_MIN, DETF_MAX); - printf("nn = %d, damage=%f\n", numNeighsRefConfig[i], damage[i]); - cout << "Here is matrix F:" << endl << Fincr[i] << endl; - cout << "Here is matrix F-1:" << endl << FincrInv[i] << endl; - cout << "Here is matrix K-1:" << endl << K[i] << endl; - cout << "Here is matrix K:" << endl << K[i].inverse() << endl; - cout << "Here is det of K" << endl << (K[i].inverse()).determinant() << endl; - cout << "Here is matrix R:" << endl << R[i] << endl; - cout << "Here is det of R" << endl << R[i].determinant() << endl; - cout << "Here is matrix U:" << endl << U << endl; - mol[i] = -1; - //error->one(FLERR, ""); - } + if ((detF[i] < DETF_MIN) || (detF[i] > DETF_MAX) || (numNeighsRefConfig[i] == 0)) { + utils::logmesg(lmp, "deleting particle [{}] because det(F)={}f is outside stable range" + " {} -- {} \n", tag[i], Fincr[i].determinant(), DETF_MIN, DETF_MAX); + utils::logmesg(lmp,"nn = {}, damage={}\n", numNeighsRefConfig[i], damage[i]); + mol[i] = -1; + } - if (mol[i] < 0) { - D[i].setZero(); - Fdot[i].setZero(); - Fincr[i].setIdentity(); - smoothVelDifference[i].setZero(); - detF[i] = 1.0; - K[i].setIdentity(); + if (mol[i] < 0) { + D[i].setZero(); + Fdot[i].setZero(); + Fincr[i].setIdentity(); + smoothVelDifference[i].setZero(); + detF[i] = 1.0; + K[i].setIdentity(); - vint[i][0] = 0.0; - vint[i][1] = 0.0; - vint[i][2] = 0.0; - } - } // end loop over i - } // end check setflag + vint[i][0] = 0.0; + vint[i][1] = 0.0; + vint[i][2] = 0.0; + } + } // end loop over i + } // end check setflag } /* ---------------------------------------------------------------------- */ void PairTlsph::compute(int eflag, int vflag) { - if (atom->nmax > nmax) { - nmax = atom->nmax; - delete[] Fdot; - Fdot = new Matrix3d[nmax]; // memory usage: 9 doubles - delete[] Fincr; - Fincr = new Matrix3d[nmax]; // memory usage: 9 doubles - delete[] K; - K = new Matrix3d[nmax]; // memory usage: 9 doubles - delete[] PK1; - PK1 = new Matrix3d[nmax]; // memory usage: 9 doubles; total 5*9=45 doubles - delete[] detF; - detF = new double[nmax]; // memory usage: 1 double; total 46 doubles - delete[] smoothVelDifference; - smoothVelDifference = new Vector3d[nmax]; // memory usage: 3 doubles; total 49 doubles - delete[] R; - R = new Matrix3d[nmax]; // memory usage: 9 doubles; total 67 doubles - delete[] FincrInv; - FincrInv = new Matrix3d[nmax]; // memory usage: 9 doubles; total 85 doubles - delete[] W; - W = new Matrix3d[nmax]; // memory usage: 9 doubles; total 94 doubles - delete[] D; - D = new Matrix3d[nmax]; // memory usage: 9 doubles; total 103 doubles - delete[] numNeighsRefConfig; - numNeighsRefConfig = new int[nmax]; // memory usage: 1 int; total 108 doubles - delete[] CauchyStress; - CauchyStress = new Matrix3d[nmax]; // memory usage: 9 doubles; total 118 doubles - delete[] hourglass_error; - hourglass_error = new double[nmax]; - delete[] particle_dt; - particle_dt = new double[nmax]; - } + if (atom->nmax > nmax) { + nmax = atom->nmax; + delete[] Fdot; + Fdot = new Matrix3d[nmax]; // memory usage: 9 doubles + delete[] Fincr; + Fincr = new Matrix3d[nmax]; // memory usage: 9 doubles + delete[] K; + K = new Matrix3d[nmax]; // memory usage: 9 doubles + delete[] PK1; + PK1 = new Matrix3d[nmax]; // memory usage: 9 doubles; total 5*9=45 doubles + delete[] detF; + detF = new double[nmax]; // memory usage: 1 double; total 46 doubles + delete[] smoothVelDifference; + smoothVelDifference = new Vector3d[nmax]; // memory usage: 3 doubles; total 49 doubles + delete[] R; + R = new Matrix3d[nmax]; // memory usage: 9 doubles; total 67 doubles + delete[] FincrInv; + FincrInv = new Matrix3d[nmax]; // memory usage: 9 doubles; total 85 doubles + delete[] W; + W = new Matrix3d[nmax]; // memory usage: 9 doubles; total 94 doubles + delete[] D; + D = new Matrix3d[nmax]; // memory usage: 9 doubles; total 103 doubles + delete[] numNeighsRefConfig; + numNeighsRefConfig = new int[nmax]; // memory usage: 1 int; total 108 doubles + delete[] CauchyStress; + CauchyStress = new Matrix3d[nmax]; // memory usage: 9 doubles; total 118 doubles + delete[] hourglass_error; + hourglass_error = new double[nmax]; + delete[] particle_dt; + particle_dt = new double[nmax]; + } - if (first) { // return on first call, because reference connectivity lists still needs to be built. Also zero quantities which are otherwise undefined. - first = false; + if (first) { // return on first call, because reference connectivity lists still needs to be built. Also zero quantities which are otherwise undefined. + first = false; - for (int i = 0; i < atom->nlocal; i++) { - Fincr[i].setZero(); - detF[i] = 0.0; - smoothVelDifference[i].setZero(); - D[i].setZero(); - numNeighsRefConfig[i] = 0; - CauchyStress[i].setZero(); - hourglass_error[i] = 0.0; - particle_dt[i] = 0.0; - } + for (int i = 0; i < atom->nlocal; i++) { + Fincr[i].setZero(); + detF[i] = 0.0; + smoothVelDifference[i].setZero(); + D[i].setZero(); + numNeighsRefConfig[i] = 0; + CauchyStress[i].setZero(); + hourglass_error[i] = 0.0; + particle_dt[i] = 0.0; + } - return; - } + return; + } - /* - * calculate deformations and rate-of-deformations - */ - PairTlsph::PreCompute(); + /* + * calculate deformations and rate-of-deformations + */ + PairTlsph::PreCompute(); - /* - * calculate stresses from constitutive models - */ - PairTlsph::AssembleStress(); + /* + * calculate stresses from constitutive models + */ + PairTlsph::AssembleStress(); - /* - * QUANTITIES ABOVE HAVE ONLY BEEN CALCULATED FOR NLOCAL PARTICLES. - * NEED TO DO A FORWARD COMMUNICATION TO GHOST ATOMS NOW - */ - comm->forward_comm(this); + /* + * QUANTITIES ABOVE HAVE ONLY BEEN CALCULATED FOR NLOCAL PARTICLES. + * NEED TO DO A FORWARD COMMUNICATION TO GHOST ATOMS NOW + */ + comm->forward_comm(this); - /* - * compute forces between particles - */ - updateFlag = 0; - ComputeForces(eflag, vflag); + /* + * compute forces between particles + */ + updateFlag = 0; + ComputeForces(eflag, vflag); } void PairTlsph::ComputeForces(int eflag, int vflag) { - tagint *mol = atom->molecule; - double **x = atom->x; - double **v = atom->vest; - double **x0 = atom->x0; - double **f = atom->f; - double *vfrac = atom->vfrac; - double *desph = atom->desph; - double *rmass = atom->rmass; - double *radius = atom->radius; - double *damage = atom->damage; - double *plastic_strain = atom->eff_plastic_strain; - int *type = atom->type; - int nlocal = atom->nlocal; - int i, j, jj, jnum, itype, idim; - double r, hg_mag, wf, wfd, h, r0, r0Sq, voli, volj; - double delVdotDelR, visc_magnitude, deltaE, mu_ij, hg_err, gamma_dot_dx, delta, scale; - double strain1d, strain1d_max, softening_strain, shepardWeight; - char str[128]; - Vector3d fi, fj, dx0, dx, dv, f_stress, f_hg, dxp_i, dxp_j, gamma, g, gamma_i, gamma_j, x0i, x0j; - Vector3d xi, xj, vi, vj, f_visc, sumForces, f_spring; - int periodic = (domain->xperiodic || domain->yperiodic || domain->zperiodic); + tagint *mol = atom->molecule; + double **x = atom->x; + double **v = atom->vest; + double **x0 = atom->x0; + double **f = atom->f; + double *vfrac = atom->vfrac; + double *desph = atom->desph; + double *rmass = atom->rmass; + double *radius = atom->radius; + double *damage = atom->damage; + double *plastic_strain = atom->eff_plastic_strain; + int *type = atom->type; + int nlocal = atom->nlocal; + int i, j, jj, jnum, itype, idim; + double r, hg_mag, wf, wfd, h, r0, r0Sq, voli, volj; + double delVdotDelR, visc_magnitude, deltaE, mu_ij, hg_err, gamma_dot_dx, delta, scale; + double strain1d, strain1d_max, softening_strain, shepardWeight; + Vector3d fi, fj, dx0, dx, dv, f_stress, f_hg, dxp_i, dxp_j, gamma, g, gamma_i, gamma_j, x0i, x0j; + Vector3d xi, xj, vi, vj, f_visc, sumForces, f_spring; + int periodic = (domain->xperiodic || domain->yperiodic || domain->zperiodic); - tagint **partner = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->partner; - int *npartner = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->npartner; - float **wfd_list = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->wfd_list; - float **wf_list = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->wf_list; - float **degradation_ij = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->degradation_ij; - float **energy_per_bond = ((FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[ifix_tlsph])->energy_per_bond; - Matrix3d eye; - eye.setIdentity(); + tagint **partner = (dynamic_cast( modify->fix[ifix_tlsph]))->partner; + int *npartner = (dynamic_cast( modify->fix[ifix_tlsph]))->npartner; + float **wfd_list = (dynamic_cast( modify->fix[ifix_tlsph]))->wfd_list; + float **wf_list = (dynamic_cast( modify->fix[ifix_tlsph]))->wf_list; + float **degradation_ij = (dynamic_cast( modify->fix[ifix_tlsph]))->degradation_ij; + float **energy_per_bond = (dynamic_cast( modify->fix[ifix_tlsph]))->energy_per_bond; + Matrix3d eye; + eye.setIdentity(); - ev_init(eflag, vflag); + ev_init(eflag, vflag); + /* + * iterate over pairs of particles i, j and assign forces using PK1 stress tensor + */ + + //updateFlag = 0; + hMin = 1.0e22; + dtRelative = 1.0e22; + + for (i = 0; i < nlocal; i++) { + + if (mol[i] < 0) { + continue; // Particle i is not a valid SPH particle (anymore). Skip all interactions with this particle. + } + + itype = type[i]; + jnum = npartner[i]; + voli = vfrac[i]; + + // initialize aveage mass density + h = 2.0 * radius[i]; + r = 0.0; + spiky_kernel_and_derivative(h, r, domain->dimension, wf, wfd); + shepardWeight = wf * voli; + + for (idim = 0; idim < 3; idim++) { + x0i(idim) = x0[i][idim]; + xi(idim) = x[i][idim]; + vi(idim) = v[i][idim]; + } + + for (jj = 0; jj < jnum; jj++) { + if (partner[i][jj] == 0) + continue; + j = atom->map(partner[i][jj]); + if (j < 0) { // // check if lost a partner without first breaking bond + partner[i][jj] = 0; + continue; + } + + if (mol[j] < 0) { + continue; // Particle j is not a valid SPH particle (anymore). Skip all interactions with this particle. + } + + if (mol[i] != mol[j]) { + continue; + } + + if (type[j] != itype) + error->all(FLERR, "particle pair is not of same type!"); + + for (idim = 0; idim < 3; idim++) { + x0j(idim) = x0[j][idim]; + xj(idim) = x[j][idim]; + vj(idim) = v[j][idim]; + } + + if (periodic) + domain->minimum_image(dx0(0), dx0(1), dx0(2)); + + // check that distance between i and j (in the reference config) is less than cutoff + dx0 = x0j - x0i; + r0Sq = dx0.squaredNorm(); + h = radius[i] + radius[j]; + hMin = MIN(hMin, h); + r0 = sqrt(r0Sq); + volj = vfrac[j]; + + // distance vectors in current and reference configuration, velocity difference + dx = xj - xi; + dv = vj - vi; + r = dx.norm(); // current distance + + // scale the interaction according to the damage variable + scale = 1.0 - degradation_ij[i][jj]; + wf = wf_list[i][jj] * scale; + wfd = wfd_list[i][jj] * scale; + + g = (wfd / r0) * dx0; // uncorrected kernel gradient + + /* + * force contribution -- note that the kernel gradient correction has been absorbed into PK1 + */ + + f_stress = -voli * volj * (PK1[i] + PK1[j]) * g; + + /* + * artificial viscosity + */ + delVdotDelR = dx.dot(dv) / (r + 0.1 * h); // project relative velocity onto unit particle distance vector [m/s] + LimitDoubleMagnitude(delVdotDelR, 0.01 * Lookup[SIGNAL_VELOCITY][itype]); + mu_ij = h * delVdotDelR / (r + 0.1 * h); // units: [m * m/s / m = m/s] + visc_magnitude = (-Lookup[VISCOSITY_Q1][itype] * Lookup[SIGNAL_VELOCITY][itype] * mu_ij + + Lookup[VISCOSITY_Q2][itype] * mu_ij * mu_ij) / Lookup[REFERENCE_DENSITY][itype]; // units: m^5/(s^2 kg)) + f_visc = rmass[i] * rmass[j] * visc_magnitude * wfd * dx / (r + 1.0e-2 * h); // units: kg^2 * m^5/(s^2 kg) * m^-4 = kg m / s^2 = N + + /* + * hourglass deviation of particles i and j + */ + + gamma = 0.5 * (Fincr[i] + Fincr[j]) * dx0 - dx; + hg_err = gamma.norm() / r0; + hourglass_error[i] += volj * wf * hg_err; + + /* SPH-like hourglass formulation */ + + if (MAX(plastic_strain[i], plastic_strain[j]) > 1.0e-3) { /* - * iterate over pairs of particles i, j and assign forces using PK1 stress tensor + * viscous hourglass formulation for particles with plastic deformation + */ + delta = gamma.dot(dx); + if (delVdotDelR * delta < 0.0) { + hg_err = MAX(hg_err, 0.05); // limit hg_err to avoid numerical instabilities + hg_mag = -hg_err * Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] * Lookup[SIGNAL_VELOCITY][itype] * mu_ij + / Lookup[REFERENCE_DENSITY][itype]; // this has units of pressure + } else { + hg_mag = 0.0; + } + f_hg = rmass[i] * rmass[j] * hg_mag * wfd * dx / (r + 1.0e-2 * h); + + } else { + /* + * stiffness hourglass formulation for particle in the elastic regime */ - //updateFlag = 0; - hMin = 1.0e22; - dtRelative = 1.0e22; + gamma_dot_dx = gamma.dot(dx); // project hourglass error vector onto pair distance vector + LimitDoubleMagnitude(gamma_dot_dx, 0.1 * r); // limit projected vector to avoid numerical instabilities + delta = 0.5 * gamma_dot_dx / (r + 0.1 * h); // delta has dimensions of [m] + hg_mag = Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] * delta / (r0Sq + 0.01 * h * h); // hg_mag has dimensions [m^(-1)] + hg_mag *= -voli * volj * wf * Lookup[YOUNGS_MODULUS][itype]; // hg_mag has dimensions [J*m^(-1)] = [N] + f_hg = (hg_mag / (r + 0.01 * h)) * dx; + } - for (i = 0; i < nlocal; i++) { + // scale hourglass force with damage + f_hg *= (1.0 - damage[i]) * (1.0 - damage[j]); - if (mol[i] < 0) { - continue; // Particle i is not a valid SPH particle (anymore). Skip all interactions with this particle. - } + // sum stress, viscous, and hourglass forces + sumForces = f_stress + f_visc + f_hg; // + f_spring; - itype = type[i]; - jnum = npartner[i]; - voli = vfrac[i]; + // energy rate -- project velocity onto force vector + deltaE = 0.5 * sumForces.dot(dv); - // initialize aveage mass density - h = 2.0 * radius[i]; - r = 0.0; - spiky_kernel_and_derivative(h, r, domain->dimension, wf, wfd); - shepardWeight = wf * voli; + // apply forces to pair of particles + f[i][0] += sumForces(0); + f[i][1] += sumForces(1); + f[i][2] += sumForces(2); + desph[i] += deltaE; - for (idim = 0; idim < 3; idim++) { - x0i(idim) = x0[i][idim]; - xi(idim) = x[i][idim]; - vi(idim) = v[i][idim]; - } + // tally atomistic stress tensor + if (evflag) { + ev_tally_xyz(i, j, nlocal, 0, 0.0, 0.0, sumForces(0), sumForces(1), sumForces(2), dx(0), dx(1), dx(2)); + } - for (jj = 0; jj < jnum; jj++) { - if (partner[i][jj] == 0) - continue; - j = atom->map(partner[i][jj]); - if (j < 0) { // // check if lost a partner without first breaking bond - partner[i][jj] = 0; - continue; - } + shepardWeight += wf * volj; - if (mol[j] < 0) { - continue; // Particle j is not a valid SPH particle (anymore). Skip all interactions with this particle. - } + // check if a particle has moved too much w.r.t another particle + if (r > r0) { + if (update_method == UPDATE_CONSTANT_THRESHOLD) { + if (r - r0 > update_threshold) { + updateFlag = 1; + } + } else if (update_method == UPDATE_PAIRWISE_RATIO) { + if ((r - r0) / h > update_threshold) { + updateFlag = 1; + } + } + } - if (mol[i] != mol[j]) { - continue; - } + if (failureModel[itype].failure_max_pairwise_strain) { - if (type[j] != itype) { - sprintf(str, "particle pair is not of same type!"); - error->all(FLERR, str); - } + strain1d = (r - r0) / r0; + strain1d_max = Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype]; + softening_strain = 2.0 * strain1d_max; - for (idim = 0; idim < 3; idim++) { - x0j(idim) = x0[j][idim]; - xj(idim) = x[j][idim]; - vj(idim) = v[j][idim]; - } + if (strain1d > strain1d_max) { + degradation_ij[i][jj] = (strain1d - strain1d_max) / softening_strain; + } else { + degradation_ij[i][jj] = 0.0; + } - if (periodic) - domain->minimum_image(dx0(0), dx0(1), dx0(2)); + if (degradation_ij[i][jj] >= 1.0) { // delete interaction if fully damaged + partner[i][jj] = 0; + } + } - // check that distance between i and j (in the reference config) is less than cutoff - dx0 = x0j - x0i; - r0Sq = dx0.squaredNorm(); - h = radius[i] + radius[j]; - hMin = MIN(hMin, h); - r0 = sqrt(r0Sq); - volj = vfrac[j]; + if (failureModel[itype].failure_energy_release_rate) { - // distance vectors in current and reference configuration, velocity difference - dx = xj - xi; - dv = vj - vi; - r = dx.norm(); // current distance + // integration approach + energy_per_bond[i][jj] += update->dt * f_stress.dot(dv) / (voli * volj); + double Vic = (2.0 / 3.0) * h * h * h; // interaction volume for 2d plane strain + double critical_energy_per_bond = Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype] / (2.0 * Vic); - // scale the interaction according to the damage variable - scale = 1.0 - degradation_ij[i][jj]; - wf = wf_list[i][jj] * scale; - wfd = wfd_list[i][jj] * scale; + if (energy_per_bond[i][jj] > critical_energy_per_bond) { + //degradation_ij[i][jj] = 1.0; + partner[i][jj] = 0; + } + } - g = (wfd / r0) * dx0; // uncorrected kernel gradient + if (failureModel[itype].integration_point_wise) { - /* - * force contribution -- note that the kernel gradient correction has been absorbed into PK1 - */ + strain1d = (r - r0) / r0; - f_stress = -voli * volj * (PK1[i] + PK1[j]) * g; + if (strain1d > 0.0) { - /* - * artificial viscosity - */ - delVdotDelR = dx.dot(dv) / (r + 0.1 * h); // project relative velocity onto unit particle distance vector [m/s] - LimitDoubleMagnitude(delVdotDelR, 0.01 * Lookup[SIGNAL_VELOCITY][itype]); - mu_ij = h * delVdotDelR / (r + 0.1 * h); // units: [m * m/s / m = m/s] - visc_magnitude = (-Lookup[VISCOSITY_Q1][itype] * Lookup[SIGNAL_VELOCITY][itype] * mu_ij - + Lookup[VISCOSITY_Q2][itype] * mu_ij * mu_ij) / Lookup[REFERENCE_DENSITY][itype]; // units: m^5/(s^2 kg)) - f_visc = rmass[i] * rmass[j] * visc_magnitude * wfd * dx / (r + 1.0e-2 * h); // units: kg^2 * m^5/(s^2 kg) * m^-4 = kg m / s^2 = N + if ((damage[i] == 1.0) && (damage[j] == 1.0)) { + // check if damage_onset is already defined + if (energy_per_bond[i][jj] == 0.0) { // pair damage not defined yet + energy_per_bond[i][jj] = strain1d; + } else { // damage initiation strain already defined + strain1d_max = energy_per_bond[i][jj]; + softening_strain = 2.0 * strain1d_max; - /* - * hourglass deviation of particles i and j - */ + if (strain1d > strain1d_max) { + degradation_ij[i][jj] = (strain1d - strain1d_max) / softening_strain; + } else { + degradation_ij[i][jj] = 0.0; + } + } + } - gamma = 0.5 * (Fincr[i] + Fincr[j]) * dx0 - dx; - hg_err = gamma.norm() / r0; - hourglass_error[i] += volj * wf * hg_err; + if (degradation_ij[i][jj] >= 1.0) { // delete interaction if fully damaged + partner[i][jj] = 0; + } - /* SPH-like hourglass formulation */ + } else { + degradation_ij[i][jj] = 0.0; + } // end failureModel[itype].integration_point_wise - if (MAX(plastic_strain[i], plastic_strain[j]) > 1.0e-3) { - /* - * viscous hourglass formulation for particles with plastic deformation - */ - delta = gamma.dot(dx); - if (delVdotDelR * delta < 0.0) { - hg_err = MAX(hg_err, 0.05); // limit hg_err to avoid numerical instabilities - hg_mag = -hg_err * Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] * Lookup[SIGNAL_VELOCITY][itype] * mu_ij - / Lookup[REFERENCE_DENSITY][itype]; // this has units of pressure - } else { - hg_mag = 0.0; - } - f_hg = rmass[i] * rmass[j] * hg_mag * wfd * dx / (r + 1.0e-2 * h); + } - } else { - /* - * stiffness hourglass formulation for particle in the elastic regime - */ + } // end loop over jj neighbors of i - gamma_dot_dx = gamma.dot(dx); // project hourglass error vector onto pair distance vector - LimitDoubleMagnitude(gamma_dot_dx, 0.1 * r); // limit projected vector to avoid numerical instabilities - delta = 0.5 * gamma_dot_dx / (r + 0.1 * h); // delta has dimensions of [m] - hg_mag = Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] * delta / (r0Sq + 0.01 * h * h); // hg_mag has dimensions [m^(-1)] - hg_mag *= -voli * volj * wf * Lookup[YOUNGS_MODULUS][itype]; // hg_mag has dimensions [J*m^(-1)] = [N] - f_hg = (hg_mag / (r + 0.01 * h)) * dx; - } + // avoid division by zero and overflow + if ((shepardWeight != 0.0) && (fabs(hourglass_error[i]) < 1.0e300)) { + hourglass_error[i] /= shepardWeight; + } - // scale hourglass force with damage - f_hg *= (1.0 - damage[i]) * (1.0 - damage[j]); + } // end loop over i - // sum stress, viscous, and hourglass forces - sumForces = f_stress + f_visc + f_hg; // + f_spring; - - // energy rate -- project velocity onto force vector - deltaE = 0.5 * sumForces.dot(dv); - - // apply forces to pair of particles - f[i][0] += sumForces(0); - f[i][1] += sumForces(1); - f[i][2] += sumForces(2); - desph[i] += deltaE; - - // tally atomistic stress tensor - if (evflag) { - ev_tally_xyz(i, j, nlocal, 0, 0.0, 0.0, sumForces(0), sumForces(1), sumForces(2), dx(0), dx(1), dx(2)); - } - - shepardWeight += wf * volj; - - // check if a particle has moved too much w.r.t another particle - if (r > r0) { - if (update_method == UPDATE_CONSTANT_THRESHOLD) { - if (r - r0 > update_threshold) { - updateFlag = 1; - } - } else if (update_method == UPDATE_PAIRWISE_RATIO) { - if ((r - r0) / h > update_threshold) { - updateFlag = 1; - } - } - } - - if (failureModel[itype].failure_max_pairwise_strain) { - - strain1d = (r - r0) / r0; - strain1d_max = Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype]; - softening_strain = 2.0 * strain1d_max; - - if (strain1d > strain1d_max) { - degradation_ij[i][jj] = (strain1d - strain1d_max) / softening_strain; - } else { - degradation_ij[i][jj] = 0.0; - } - - if (degradation_ij[i][jj] >= 1.0) { // delete interaction if fully damaged - partner[i][jj] = 0; - } - } - - if (failureModel[itype].failure_energy_release_rate) { - - // integration approach - energy_per_bond[i][jj] += update->dt * f_stress.dot(dv) / (voli * volj); - double Vic = (2.0 / 3.0) * h * h * h; // interaction volume for 2d plane strain - double critical_energy_per_bond = Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype] / (2.0 * Vic); - - if (energy_per_bond[i][jj] > critical_energy_per_bond) { - //degradation_ij[i][jj] = 1.0; - partner[i][jj] = 0; - } - } - - if (failureModel[itype].integration_point_wise) { - - strain1d = (r - r0) / r0; - - if (strain1d > 0.0) { - - if ((damage[i] == 1.0) && (damage[j] == 1.0)) { - // check if damage_onset is already defined - if (energy_per_bond[i][jj] == 0.0) { // pair damage not defined yet - energy_per_bond[i][jj] = strain1d; - } else { // damage initiation strain already defined - strain1d_max = energy_per_bond[i][jj]; - softening_strain = 2.0 * strain1d_max; - - if (strain1d > strain1d_max) { - degradation_ij[i][jj] = (strain1d - strain1d_max) / softening_strain; - } else { - degradation_ij[i][jj] = 0.0; - } - } - } - - if (degradation_ij[i][jj] >= 1.0) { // delete interaction if fully damaged - partner[i][jj] = 0; - } - - } else { - degradation_ij[i][jj] = 0.0; - } // end failureModel[itype].integration_point_wise - - } - - } // end loop over jj neighbors of i - - // avoid division by zero and overflow - if ((shepardWeight != 0.0) && (fabs(hourglass_error[i]) < 1.0e300)) { - hourglass_error[i] /= shepardWeight; - } - - } // end loop over i - - if (vflag_fdotr) - virial_fdotr_compute(); + if (vflag_fdotr) + virial_fdotr_compute(); } /* ---------------------------------------------------------------------- @@ -696,181 +680,181 @@ void PairTlsph::ComputeForces(int eflag, int vflag) { shape matrix correction ------------------------------------------------------------------------- */ void PairTlsph::AssembleStress() { - tagint *mol = atom->molecule; - double *eff_plastic_strain = atom->eff_plastic_strain; - double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; - double **tlsph_stress = atom->smd_stress; - int *type = atom->type; - double *radius = atom->radius; - double *damage = atom->damage; - double *rmass = atom->rmass; - double *vfrac = atom->vfrac; - double *esph = atom->esph; - double pInitial, d_iso, pFinal, p_rate, plastic_strain_increment; - int i, itype; - int nlocal = atom->nlocal; - double dt = update->dt; - double M_eff, p_wave_speed, mass_specific_energy, vol_specific_energy, rho; - Matrix3d sigma_rate, eye, sigmaInitial, sigmaFinal, T, T_damaged, Jaumann_rate, sigma_rate_check; - Matrix3d d_dev, sigmaInitial_dev, sigmaFinal_dev, sigma_dev_rate, strain; - Vector3d x0i, xi, xp; + tagint *mol = atom->molecule; + double *eff_plastic_strain = atom->eff_plastic_strain; + double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; + double **tlsph_stress = atom->smd_stress; + int *type = atom->type; + double *radius = atom->radius; + double *damage = atom->damage; + double *rmass = atom->rmass; + double *vfrac = atom->vfrac; + double *esph = atom->esph; + double pInitial, d_iso, pFinal, p_rate, plastic_strain_increment; + int i, itype; + int nlocal = atom->nlocal; + double dt = update->dt; + double M_eff, p_wave_speed, mass_specific_energy, vol_specific_energy, rho; + Matrix3d sigma_rate, eye, sigmaInitial, sigmaFinal, T, T_damaged, Jaumann_rate, sigma_rate_check; + Matrix3d d_dev, sigmaInitial_dev, sigmaFinal_dev, sigma_dev_rate, strain; + Vector3d x0i, xi, xp; - eye.setIdentity(); - dtCFL = 1.0e22; - pFinal = 0.0; + eye.setIdentity(); + dtCFL = 1.0e22; + pFinal = 0.0; - for (i = 0; i < nlocal; i++) { - particle_dt[i] = 0.0; + for (i = 0; i < nlocal; i++) { + particle_dt[i] = 0.0; - itype = type[i]; - if (setflag[itype][itype] == 1) { - if (mol[i] > 0) { // only do the following if particle has not failed -- mol < 0 means particle has failed + itype = type[i]; + if (setflag[itype][itype] == 1) { + if (mol[i] > 0) { // only do the following if particle has not failed -- mol < 0 means particle has failed - /* - * initial stress state: given by the unrotateted Cauchy stress. - * Assemble Eigen 3d matrix from stored stress state - */ - sigmaInitial(0, 0) = tlsph_stress[i][0]; - sigmaInitial(0, 1) = tlsph_stress[i][1]; - sigmaInitial(0, 2) = tlsph_stress[i][2]; - sigmaInitial(1, 1) = tlsph_stress[i][3]; - sigmaInitial(1, 2) = tlsph_stress[i][4]; - sigmaInitial(2, 2) = tlsph_stress[i][5]; - sigmaInitial(1, 0) = sigmaInitial(0, 1); - sigmaInitial(2, 0) = sigmaInitial(0, 2); - sigmaInitial(2, 1) = sigmaInitial(1, 2); + /* + * initial stress state: given by the unrotateted Cauchy stress. + * Assemble Eigen 3d matrix from stored stress state + */ + sigmaInitial(0, 0) = tlsph_stress[i][0]; + sigmaInitial(0, 1) = tlsph_stress[i][1]; + sigmaInitial(0, 2) = tlsph_stress[i][2]; + sigmaInitial(1, 1) = tlsph_stress[i][3]; + sigmaInitial(1, 2) = tlsph_stress[i][4]; + sigmaInitial(2, 2) = tlsph_stress[i][5]; + sigmaInitial(1, 0) = sigmaInitial(0, 1); + sigmaInitial(2, 0) = sigmaInitial(0, 2); + sigmaInitial(2, 1) = sigmaInitial(1, 2); - //cout << "this is sigma initial" << endl << sigmaInitial << endl; + //cout << "this is sigma initial" << endl << sigmaInitial << endl; - pInitial = sigmaInitial.trace() / 3.0; // isotropic part of initial stress - sigmaInitial_dev = Deviator(sigmaInitial); - d_iso = D[i].trace(); // volumetric part of stretch rate - d_dev = Deviator(D[i]); // deviatoric part of stretch rate - strain = 0.5 * (Fincr[i].transpose() * Fincr[i] - eye); - mass_specific_energy = esph[i] / rmass[i]; // energy per unit mass - rho = rmass[i] / (detF[i] * vfrac[i]); - vol_specific_energy = mass_specific_energy * rho; // energy per current volume + pInitial = sigmaInitial.trace() / 3.0; // isotropic part of initial stress + sigmaInitial_dev = Deviator(sigmaInitial); + d_iso = D[i].trace(); // volumetric part of stretch rate + d_dev = Deviator(D[i]); // deviatoric part of stretch rate + strain = 0.5 * (Fincr[i].transpose() * Fincr[i] - eye); + mass_specific_energy = esph[i] / rmass[i]; // energy per unit mass + rho = rmass[i] / (detF[i] * vfrac[i]); + vol_specific_energy = mass_specific_energy * rho; // energy per current volume - /* - * pressure: compute pressure rate p_rate and final pressure pFinal - */ + /* + * pressure: compute pressure rate p_rate and final pressure pFinal + */ - ComputePressure(i, rho, mass_specific_energy, vol_specific_energy, pInitial, d_iso, pFinal, p_rate); + ComputePressure(i, rho, mass_specific_energy, vol_specific_energy, pInitial, d_iso, pFinal, p_rate); - /* - * material strength - */ + /* + * material strength + */ - //cout << "this is the strain deviator rate" << endl << d_dev << endl; - ComputeStressDeviator(i, sigmaInitial_dev, d_dev, sigmaFinal_dev, sigma_dev_rate, plastic_strain_increment); - //cout << "this is the stress deviator rate" << endl << sigma_dev_rate << endl; + //cout << "this is the strain deviator rate" << endl << d_dev << endl; + ComputeStressDeviator(i, sigmaInitial_dev, d_dev, sigmaFinal_dev, sigma_dev_rate, plastic_strain_increment); + //cout << "this is the stress deviator rate" << endl << sigma_dev_rate << endl; - // keep a rolling average of the plastic strain rate over the last 100 or so timesteps - eff_plastic_strain[i] += plastic_strain_increment; + // keep a rolling average of the plastic strain rate over the last 100 or so timesteps + eff_plastic_strain[i] += plastic_strain_increment; - // compute a characteristic time over which to average the plastic strain - double tav = 1000 * radius[i] / (Lookup[SIGNAL_VELOCITY][itype]); - eff_plastic_strain_rate[i] -= eff_plastic_strain_rate[i] * dt / tav; - eff_plastic_strain_rate[i] += plastic_strain_increment / tav; - eff_plastic_strain_rate[i] = MAX(0.0, eff_plastic_strain_rate[i]); + // compute a characteristic time over which to average the plastic strain + double tav = 1000 * radius[i] / (Lookup[SIGNAL_VELOCITY][itype]); + eff_plastic_strain_rate[i] -= eff_plastic_strain_rate[i] * dt / tav; + eff_plastic_strain_rate[i] += plastic_strain_increment / tav; + eff_plastic_strain_rate[i] = MAX(0.0, eff_plastic_strain_rate[i]); - /* - * assemble total stress from pressure and deviatoric stress - */ - sigmaFinal = pFinal * eye + sigmaFinal_dev; // this is the stress that is kept + /* + * assemble total stress from pressure and deviatoric stress + */ + sigmaFinal = pFinal * eye + sigmaFinal_dev; // this is the stress that is kept - if (JAUMANN) { - /* - * sigma is already the co-rotated Cauchy stress. - * The stress rate, however, needs to be made objective. - */ + if (JAUMANN) { + /* + * sigma is already the co-rotated Cauchy stress. + * The stress rate, however, needs to be made objective. + */ - if (dt > 1.0e-16) { - sigma_rate = (1.0 / dt) * (sigmaFinal - sigmaInitial); - } else { - sigma_rate.setZero(); - } + if (dt > 1.0e-16) { + sigma_rate = (1.0 / dt) * (sigmaFinal - sigmaInitial); + } else { + sigma_rate.setZero(); + } - Jaumann_rate = sigma_rate + W[i] * sigmaInitial + sigmaInitial * W[i].transpose(); - sigmaFinal = sigmaInitial + dt * Jaumann_rate; - T = sigmaFinal; - } else { - /* - * sigma is the unrotated stress. - * need to do forward rotation of the unrotated stress sigma to the current configuration - */ - T = R[i] * sigmaFinal * R[i].transpose(); - } + Jaumann_rate = sigma_rate + W[i] * sigmaInitial + sigmaInitial * W[i].transpose(); + sigmaFinal = sigmaInitial + dt * Jaumann_rate; + T = sigmaFinal; + } else { + /* + * sigma is the unrotated stress. + * need to do forward rotation of the unrotated stress sigma to the current configuration + */ + T = R[i] * sigmaFinal * R[i].transpose(); + } - /* - * store unrotated stress in atom vector - * symmetry is exploited - */ - tlsph_stress[i][0] = sigmaFinal(0, 0); - tlsph_stress[i][1] = sigmaFinal(0, 1); - tlsph_stress[i][2] = sigmaFinal(0, 2); - tlsph_stress[i][3] = sigmaFinal(1, 1); - tlsph_stress[i][4] = sigmaFinal(1, 2); - tlsph_stress[i][5] = sigmaFinal(2, 2); + /* + * store unrotated stress in atom vector + * symmetry is exploited + */ + tlsph_stress[i][0] = sigmaFinal(0, 0); + tlsph_stress[i][1] = sigmaFinal(0, 1); + tlsph_stress[i][2] = sigmaFinal(0, 2); + tlsph_stress[i][3] = sigmaFinal(1, 1); + tlsph_stress[i][4] = sigmaFinal(1, 2); + tlsph_stress[i][5] = sigmaFinal(2, 2); - /* - * Damage due to failure criteria. - */ + /* + * Damage due to failure criteria. + */ - if (failureModel[itype].integration_point_wise) { - ComputeDamage(i, strain, T, T_damaged); - //T = T_damaged; Do not do this, it is undefined as of now - } + if (failureModel[itype].integration_point_wise) { + ComputeDamage(i, strain, T, T_damaged); + //T = T_damaged; Do not do this, it is undefined as of now + } - // store rotated, "true" Cauchy stress - CauchyStress[i] = T; + // store rotated, "true" Cauchy stress + CauchyStress[i] = T; - /* - * We have the corotational Cauchy stress. - * Convert to PK1. Note that reference configuration used for computing the forces is linked via - * the incremental deformation gradient, not the full deformation gradient. - */ - PK1[i] = detF[i] * T * FincrInv[i].transpose(); + /* + * We have the corotational Cauchy stress. + * Convert to PK1. Note that reference configuration used for computing the forces is linked via + * the incremental deformation gradient, not the full deformation gradient. + */ + PK1[i] = detF[i] * T * FincrInv[i].transpose(); - /* - * pre-multiply stress tensor with shape matrix to save computation in force loop - */ - PK1[i] = PK1[i] * K[i]; + /* + * pre-multiply stress tensor with shape matrix to save computation in force loop + */ + PK1[i] = PK1[i] * K[i]; - /* - * compute stable time step according to Pronto 2d - */ + /* + * compute stable time step according to Pronto 2d + */ - Matrix3d deltaSigma; - deltaSigma = sigmaFinal - sigmaInitial; - p_rate = deltaSigma.trace() / (3.0 * dt + 1.0e-16); - sigma_dev_rate = Deviator(deltaSigma) / (dt + 1.0e-16); + Matrix3d deltaSigma; + deltaSigma = sigmaFinal - sigmaInitial; + p_rate = deltaSigma.trace() / (3.0 * dt + 1.0e-16); + sigma_dev_rate = Deviator(deltaSigma) / (dt + 1.0e-16); - double K_eff, mu_eff; - effective_longitudinal_modulus(itype, dt, d_iso, p_rate, d_dev, sigma_dev_rate, damage[i], K_eff, mu_eff, M_eff); - p_wave_speed = sqrt(M_eff / rho); + double K_eff, mu_eff; + effective_longitudinal_modulus(itype, dt, d_iso, p_rate, d_dev, sigma_dev_rate, damage[i], K_eff, mu_eff, M_eff); + p_wave_speed = sqrt(M_eff / rho); - if (mol[i] < 0) { - error->one(FLERR, "this should not happen"); - } + if (mol[i] < 0) { + error->one(FLERR, "this should not happen"); + } - particle_dt[i] = 2.0 * radius[i] / p_wave_speed; - dtCFL = MIN(dtCFL, particle_dt[i]); + particle_dt[i] = 2.0 * radius[i] / p_wave_speed; + dtCFL = MIN(dtCFL, particle_dt[i]); - } else { // end if mol > 0 - PK1[i].setZero(); - K[i].setIdentity(); - CauchyStress[i].setZero(); - sigma_rate.setZero(); - tlsph_stress[i][0] = 0.0; - tlsph_stress[i][1] = 0.0; - tlsph_stress[i][2] = 0.0; - tlsph_stress[i][3] = 0.0; - tlsph_stress[i][4] = 0.0; - tlsph_stress[i][5] = 0.0; - } // end if mol > 0 - } // end setflag - } // end for + } else { // end if mol > 0 + PK1[i].setZero(); + K[i].setIdentity(); + CauchyStress[i].setZero(); + sigma_rate.setZero(); + tlsph_stress[i][0] = 0.0; + tlsph_stress[i][1] = 0.0; + tlsph_stress[i][2] = 0.0; + tlsph_stress[i][3] = 0.0; + tlsph_stress[i][4] = 0.0; + tlsph_stress[i][5] = 0.0; + } // end if mol > 0 + } // end setflag + } // end for } /* ---------------------------------------------------------------------- @@ -878,25 +862,25 @@ void PairTlsph::AssembleStress() { ------------------------------------------------------------------------- */ void PairTlsph::allocate() { - allocated = 1; - int n = atom->ntypes; + allocated = 1; + int n = atom->ntypes; - memory->create(setflag, n + 1, n + 1, "pair:setflag"); - for (int i = 1; i <= n; i++) - for (int j = i; j <= n; j++) - setflag[i][j] = 0; + memory->create(setflag, n + 1, n + 1, "pair:setflag"); + for (int i = 1; i <= n; i++) + for (int j = i; j <= n; j++) + setflag[i][j] = 0; - memory->create(strengthModel, n + 1, "pair:strengthmodel"); - memory->create(eos, n + 1, "pair:eosmodel"); - failureModel = new failure_types[n + 1]; - memory->create(Lookup, MAX_KEY_VALUE, n + 1, "pair:LookupTable"); + memory->create(strengthModel, n + 1, "pair:strengthmodel"); + memory->create(eos, n + 1, "pair:eosmodel"); + failureModel = new failure_types[n + 1]; + memory->create(Lookup, MAX_KEY_VALUE, n + 1, "pair:LookupTable"); - memory->create(cutsq, n + 1, n + 1, "pair:cutsq"); // always needs to be allocated, even with granular neighborlist + memory->create(cutsq, n + 1, n + 1, "pair:cutsq"); // always needs to be allocated, even with granular neighborlist - onerad_dynamic = new double[n + 1]; - onerad_frozen = new double[n + 1]; - maxrad_dynamic = new double[n + 1]; - maxrad_frozen = new double[n + 1]; + onerad_dynamic = new double[n + 1]; + onerad_frozen = new double[n + 1]; + maxrad_dynamic = new double[n + 1]; + maxrad_frozen = new double[n + 1]; } @@ -906,83 +890,73 @@ void PairTlsph::allocate() { void PairTlsph::settings(int narg, char **arg) { - if (comm->me == 0) { - printf( - "\n>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n"); - printf("TLSPH settings\n"); - } + if (comm->me == 0) + utils::logmesg(lmp,"\n>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n" + "TLSPH settings\n"); - /* - * default value for update_threshold for updates of reference configuration: - * The maximum relative displacement which is tracked by the construction of LAMMPS' neighborlists - * is the following. - */ + /* + * default value for update_threshold for updates of reference configuration: + * The maximum relative displacement which is tracked by the construction of LAMMPS' neighborlists + * is the following. + */ - cut_comm = MAX(neighbor->cutneighmax, comm->cutghostuser); // cutoff radius within which ghost atoms are communicated. - update_threshold = cut_comm; - update_method = UPDATE_NONE; + cut_comm = MAX(neighbor->cutneighmax, comm->cutghostuser); // cutoff radius within which ghost atoms are communicated. + update_threshold = cut_comm; + update_method = UPDATE_NONE; - int iarg = 0; + int iarg = 0; - while (true) { + while (true) { - if (iarg >= narg) { - break; - } + if (iarg >= narg) { + break; + } - if (strcmp(arg[iarg], "*UPDATE_CONSTANT") == 0) { - iarg++; - if (iarg == narg) { - error->all(FLERR, "expected number following *UPDATE_CONSTANT keyword"); - } + if (strcmp(arg[iarg], "*UPDATE_CONSTANT") == 0) { + iarg++; + if (iarg == narg) { + error->all(FLERR, "expected number following *UPDATE_CONSTANT keyword"); + } - update_method = UPDATE_CONSTANT_THRESHOLD; - update_threshold = utils::numeric(FLERR, arg[iarg],false,lmp); + update_method = UPDATE_CONSTANT_THRESHOLD; + update_threshold = utils::numeric(FLERR, arg[iarg],false,lmp); - } else if (strcmp(arg[iarg], "*UPDATE_PAIRWISE") == 0) { - iarg++; - if (iarg == narg) { - error->all(FLERR, "expected number following *UPDATE_PAIRWISE keyword"); - } + } else if (strcmp(arg[iarg], "*UPDATE_PAIRWISE") == 0) { + iarg++; + if (iarg == narg) { + error->all(FLERR, "expected number following *UPDATE_PAIRWISE keyword"); + } - update_method = UPDATE_PAIRWISE_RATIO; - update_threshold = utils::numeric(FLERR, arg[iarg],false,lmp); + update_method = UPDATE_PAIRWISE_RATIO; + update_threshold = utils::numeric(FLERR, arg[iarg],false,lmp); - } else { - char msg[128]; - sprintf(msg, "Illegal keyword for smd/integrate_tlsph: %s\n", arg[iarg]); - error->all(FLERR, msg); - } + } else { + error->all(FLERR, "Illegal keyword for smd/integrate_tlsph: {}\n", arg[iarg]); + } + iarg++; + } - iarg++; - } - - if ((update_threshold > cut_comm) && (update_method == UPDATE_CONSTANT_THRESHOLD)) { - if (comm->me == 0) { - printf("\n ***** WARNING ***\n"); - printf("requested reference configuration update threshold is %g length units\n", update_threshold); - printf("This value exceeds the maximum value %g beyond which TLSPH displacements can be tracked at current settings.\n", - cut_comm); - printf("Expect loss of neighbors!\n"); - } - } - - if (comm->me == 0) { - - if (update_method == UPDATE_CONSTANT_THRESHOLD) { - printf("... will update reference configuration if magnitude of relative displacement exceeds %g length units\n", - update_threshold); - } else if (update_method == UPDATE_PAIRWISE_RATIO) { - printf("... will update reference configuration if ratio pairwise distance / smoothing length exceeds %g\n", - update_threshold); - } else if (update_method == UPDATE_NONE) { - printf("... will never update reference configuration\n"); - } - printf( - ">>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n"); - - } + if ((update_threshold > cut_comm) && (update_method == UPDATE_CONSTANT_THRESHOLD)) { + if (comm->me == 0) { + utils::logmesg(lmp, "\n ***** WARNING ***\n"); + utils::logmesg(lmp, "requested reference configuration update threshold is {} length units\n", update_threshold); + utils::logmesg(lmp, "This value exceeds the maximum value {} beyond which TLSPH displacements can be tracked at current settings.\n",cut_comm); + utils::logmesg(lmp, "Expect loss of neighbors!\n"); + } + } + if (comm->me == 0) { + if (update_method == UPDATE_CONSTANT_THRESHOLD) { + utils::logmesg(lmp, "... will update reference configuration if magnitude of relative displacement exceeds {} length units\n", + update_threshold); + } else if (update_method == UPDATE_PAIRWISE_RATIO) { + utils::logmesg(lmp, "... will update reference configuration if ratio pairwise distance / smoothing length exceeds {}\n", + update_threshold); + } else if (update_method == UPDATE_NONE) { + utils::logmesg(lmp, "... will never update reference configuration\n"); + } + utils::logmesg(lmp,">>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n"); + } } /* ---------------------------------------------------------------------- @@ -990,702 +964,585 @@ void PairTlsph::settings(int narg, char **arg) { ------------------------------------------------------------------------- */ void PairTlsph::coeff(int narg, char **arg) { - int ioffset, iarg, iNextKwd, itype; - char str[128]; - std::string s, t; + int ioffset, iarg, iNextKwd, itype; + std::string s, t; - if (narg < 3) { - sprintf(str, "number of arguments for pair tlsph is too small!"); - error->all(FLERR, str); - } - if (!allocated) - allocate(); + if (narg < 3) + error->all(FLERR, "number of arguments for pair tlsph is too small!"); - /* - * check that TLSPH parameters are given only in i,i form - */ - if (utils::inumeric(FLERR, arg[0], false, lmp) != utils::inumeric(FLERR, arg[1], false, lmp)) { - sprintf(str, "TLSPH coefficients can only be specified between particles of same type!"); - error->all(FLERR, str); - } - itype = utils::inumeric(FLERR, arg[0],false,lmp); + if (!allocated) + allocate(); + + /* + * check that TLSPH parameters are given only in i,i form + */ + if (utils::inumeric(FLERR, arg[0], false, lmp) != utils::inumeric(FLERR, arg[1], false, lmp)) + error->all(FLERR, "TLSPH coefficients can only be specified between particles of same type!"); + + itype = utils::inumeric(FLERR, arg[0],false,lmp); // set all eos, strength and failure models to inactive by default - eos[itype] = EOS_NONE; - strengthModel[itype] = STRENGTH_NONE; + eos[itype] = EOS_NONE; + strengthModel[itype] = STRENGTH_NONE; - if (comm->me == 0) { - printf( - "\n>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n"); - printf("SMD / TLSPH PROPERTIES OF PARTICLE TYPE %d:\n", itype); + if (comm->me == 0) + utils::logmesg(lmp,"\n>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n" + "SMD / TLSPH PROPERTIES OF PARTICLE TYPE {}:\n", itype); + + /* + * read parameters which are common -- regardless of material / eos model + */ + + ioffset = 2; + if (strcmp(arg[ioffset], "*COMMON") != 0) + error->all(FLERR, "common keyword missing!"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) error->all(FLERR, "no *KEYWORD terminates *COMMON"); + if (iNextKwd - ioffset != 7 + 1) + error->all(FLERR, "expected 7 arguments following *COMMON but got {}\n", iNextKwd - ioffset - 1); + + Lookup[REFERENCE_DENSITY][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[YOUNGS_MODULUS][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[POISSON_RATIO][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[VISCOSITY_Q1][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[VISCOSITY_Q2][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); + Lookup[HEAT_CAPACITY][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); + + Lookup[LAME_LAMBDA][itype] = Lookup[YOUNGS_MODULUS][itype] * Lookup[POISSON_RATIO][itype] + / ((1.0 + Lookup[POISSON_RATIO][itype]) * (1.0 - 2.0 * Lookup[POISSON_RATIO][itype])); + Lookup[SHEAR_MODULUS][itype] = Lookup[YOUNGS_MODULUS][itype] / (2.0 * (1.0 + Lookup[POISSON_RATIO][itype])); + Lookup[M_MODULUS][itype] = Lookup[LAME_LAMBDA][itype] + 2.0 * Lookup[SHEAR_MODULUS][itype]; + Lookup[SIGNAL_VELOCITY][itype] = sqrt( + (Lookup[LAME_LAMBDA][itype] + 2.0 * Lookup[SHEAR_MODULUS][itype]) / Lookup[REFERENCE_DENSITY][itype]); + Lookup[BULK_MODULUS][itype] = Lookup[LAME_LAMBDA][itype] + 2.0 * Lookup[SHEAR_MODULUS][itype] / 3.0; + + if (comm->me == 0) { + utils::logmesg(lmp, "\nmaterial unspecific properties for SMD/TLSPH definition of particle type {}:\n", itype); + utils::logmesg(lmp, "{:60} : {}\n", "reference density", Lookup[REFERENCE_DENSITY][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Young's modulus", Lookup[YOUNGS_MODULUS][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Poisson ratio", Lookup[POISSON_RATIO][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "linear viscosity coefficient", Lookup[VISCOSITY_Q1][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "quadratic viscosity coefficient", Lookup[VISCOSITY_Q2][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "hourglass control coefficient", Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "heat capacity [energy / (mass * temperature)]", Lookup[HEAT_CAPACITY][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Lame constant lambda", Lookup[LAME_LAMBDA][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "shear modulus", Lookup[SHEAR_MODULUS][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "bulk modulus", Lookup[BULK_MODULUS][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "signal velocity", Lookup[SIGNAL_VELOCITY][itype]); + } + + /* + * read following material cards + */ + + eos[itype] = EOS_NONE; + strengthModel[itype] = STRENGTH_NONE; + + while (true) { + if (strcmp(arg[iNextKwd], "*END") == 0) { + if (comm->me == 0) + utils::logmesg(lmp,"found *END keyword" + "\n>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n\n"); + break; + } + + /* + * Linear Elasticity model based on deformation gradient + */ + ioffset = iNextKwd; + if (strcmp(arg[ioffset], "*LINEAR_DEFGRAD") == 0) { + strengthModel[itype] = LINEAR_DEFGRAD; + + if (comm->me == 0) utils::logmesg(lmp, "reading *LINEAR_DEFGRAD\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } + } - /* - * read parameters which are common -- regardless of material / eos model - */ + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *LINEAR_DEFGRAD"); - ioffset = 2; - if (strcmp(arg[ioffset], "*COMMON") != 0) { - sprintf(str, "common keyword missing!"); - error->all(FLERR, str); + if (iNextKwd - ioffset != 1) + error->all(FLERR, "expected 0 arguments following *LINEAR_DEFGRAD but got {}\n", iNextKwd - ioffset - 1); + + if (comm->me == 0) utils::logmesg(lmp, "\nLinear Elasticity model based on deformation gradient\n"); + + } else if (strcmp(arg[ioffset], "*STRENGTH_LINEAR") == 0) { + + /* + * Linear Elasticity strength only model based on strain rate + */ + + strengthModel[itype] = STRENGTH_LINEAR; + if (comm->me == 0) utils::logmesg(lmp,"reading *STRENGTH_LINEAR\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } + } - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *STRENGTH_LINEAR"); + + if (iNextKwd - ioffset != 1) + error->all(FLERR, "expected 0 arguments following *STRENGTH_LINEAR but got {}\n", iNextKwd - ioffset - 1); + + if (comm->me == 0) utils::logmesg(lmp, "Linear Elasticity strength based on strain rate\n"); + + } // end Linear Elasticity strength only model based on strain rate + + else if (strcmp(arg[ioffset], "*STRENGTH_LINEAR_PLASTIC") == 0) { + + /* + * Linear Elastic / perfectly plastic strength only model based on strain rate + */ + + strengthModel[itype] = STRENGTH_LINEAR_PLASTIC; + if (comm->me == 0) utils::logmesg(lmp,"reading *STRENGTH_LINEAR_PLASTIC\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } + } -//printf("keyword following *COMMON is %s\n", arg[iNextKwd]); + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *STRENGTH_LINEAR_PLASTIC"); - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *COMMON"); - error->all(FLERR, str); + if (iNextKwd - ioffset != 2 + 1) + error->all(FLERR, "expected 2 arguments following *STRENGTH_LINEAR_PLASTIC but got {}\n", iNextKwd - ioffset - 1); + + Lookup[YIELD_STRESS][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[HARDENING_PARAMETER][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "Linear elastic / perfectly plastic strength based on strain rate"); + utils::logmesg(lmp, "{:60} : {}\n", "Young's modulus", Lookup[YOUNGS_MODULUS][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Poisson ratio", Lookup[POISSON_RATIO][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "shear modulus", Lookup[SHEAR_MODULUS][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "constant yield stress", Lookup[YIELD_STRESS][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "constant hardening parameter", Lookup[HARDENING_PARAMETER][itype]); + } + } // end Linear Elastic / perfectly plastic strength only model based on strain rate + + else if (strcmp(arg[ioffset], "*JOHNSON_COOK") == 0) { + + /* + * JOHNSON - COOK + */ + + strengthModel[itype] = STRENGTH_JOHNSON_COOK; + if (comm->me == 0) utils::logmesg(lmp, "reading *JOHNSON_COOK\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } + } - if (iNextKwd - ioffset != 7 + 1) { - sprintf(str, "expected 7 arguments following *COMMON but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *JOHNSON_COOK"); + + if (iNextKwd - ioffset != 8 + 1) + error->all(FLERR, "expected 8 arguments following *JOHNSON_COOK but got {}\n", iNextKwd - ioffset - 1); + + Lookup[JC_A][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[JC_B][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[JC_a][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[JC_C][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[JC_epdot0][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + Lookup[JC_T0][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); + Lookup[JC_Tmelt][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); + Lookup[JC_M][itype] = utils::numeric(FLERR, arg[ioffset + 8],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "Johnson Cook material strength model\n"); + utils::logmesg(lmp, "{:60} : {}\n", "A: initial yield stress", Lookup[JC_A][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "B : proportionality factor for plastic strain dependency", Lookup[JC_B][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "a : exponent for plastic strain dependency", Lookup[JC_a][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "C : proportionality factor for logarithmic plastic strain rate dependency",Lookup[JC_C][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "epdot0 : dimensionality factor for plastic strain rate dependency", Lookup[JC_epdot0][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "T0 : reference (room) temperature", Lookup[JC_T0][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Tmelt : melting temperature", Lookup[JC_Tmelt][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "M : exponent for temperature dependency", Lookup[JC_M][itype]); + } + + } else if (strcmp(arg[ioffset], "*EOS_NONE") == 0) { + + /* + * no eos + */ + + eos[itype] = EOS_NONE; + if (comm->me == 0) utils::logmesg(lmp, "reading *EOS_NONE\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } + } - Lookup[REFERENCE_DENSITY][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - Lookup[YOUNGS_MODULUS][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); - Lookup[POISSON_RATIO][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); - Lookup[VISCOSITY_Q1][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); - Lookup[VISCOSITY_Q2][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); - Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); - Lookup[HEAT_CAPACITY][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *EOS_NONE"); - Lookup[LAME_LAMBDA][itype] = Lookup[YOUNGS_MODULUS][itype] * Lookup[POISSON_RATIO][itype] - / ((1.0 + Lookup[POISSON_RATIO][itype]) * (1.0 - 2.0 * Lookup[POISSON_RATIO][itype])); - Lookup[SHEAR_MODULUS][itype] = Lookup[YOUNGS_MODULUS][itype] / (2.0 * (1.0 + Lookup[POISSON_RATIO][itype])); - Lookup[M_MODULUS][itype] = Lookup[LAME_LAMBDA][itype] + 2.0 * Lookup[SHEAR_MODULUS][itype]; - Lookup[SIGNAL_VELOCITY][itype] = sqrt( - (Lookup[LAME_LAMBDA][itype] + 2.0 * Lookup[SHEAR_MODULUS][itype]) / Lookup[REFERENCE_DENSITY][itype]); - Lookup[BULK_MODULUS][itype] = Lookup[LAME_LAMBDA][itype] + 2.0 * Lookup[SHEAR_MODULUS][itype] / 3.0; + if (iNextKwd - ioffset != 1) + error->all(FLERR, "expected 0 arguments following *EOS_NONE but got {}\n", iNextKwd - ioffset - 1); - if (comm->me == 0) { - printf("\n material unspecific properties for SMD/TLSPH definition of particle type %d:\n", itype); - printf("%60s : %g\n", "reference density", Lookup[REFERENCE_DENSITY][itype]); - printf("%60s : %g\n", "Young's modulus", Lookup[YOUNGS_MODULUS][itype]); - printf("%60s : %g\n", "Poisson ratio", Lookup[POISSON_RATIO][itype]); - printf("%60s : %g\n", "linear viscosity coefficient", Lookup[VISCOSITY_Q1][itype]); - printf("%60s : %g\n", "quadratic viscosity coefficient", Lookup[VISCOSITY_Q2][itype]); - printf("%60s : %g\n", "hourglass control coefficient", Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype]); - printf("%60s : %g\n", "heat capacity [energy / (mass * temperature)]", Lookup[HEAT_CAPACITY][itype]); - printf("%60s : %g\n", "Lame constant lambda", Lookup[LAME_LAMBDA][itype]); - printf("%60s : %g\n", "shear modulus", Lookup[SHEAR_MODULUS][itype]); - printf("%60s : %g\n", "bulk modulus", Lookup[BULK_MODULUS][itype]); - printf("%60s : %g\n", "signal velocity", Lookup[SIGNAL_VELOCITY][itype]); + if (comm->me == 0) utils::logmesg(lmp, "\nno EOS selected\n"); + } else if (strcmp(arg[ioffset], "*EOS_LINEAR") == 0) { + + /* + * linear eos + */ + + eos[itype] = EOS_LINEAR; + if (comm->me == 0) utils::logmesg(lmp, "reading *EOS_LINEAR\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } - - /* - * read following material cards - */ - -//printf("next kwd is %s\n", arg[iNextKwd]); - eos[itype] = EOS_NONE; - strengthModel[itype] = STRENGTH_NONE; - - while (true) { - if (strcmp(arg[iNextKwd], "*END") == 0) { - if (comm->me == 0) { - printf("found *END keyword"); - printf( - "\n>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========>>========\n\n"); - } - break; - } - - /* - * Linear Elasticity model based on deformation gradient - */ - ioffset = iNextKwd; - if (strcmp(arg[ioffset], "*LINEAR_DEFGRAD") == 0) { - strengthModel[itype] = LINEAR_DEFGRAD; - - if (comm->me == 0) { - printf("reading *LINEAR_DEFGRAD\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *LINEAR_DEFGRAD"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1) { - sprintf(str, "expected 0 arguments following *LINEAR_DEFGRAD but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - if (comm->me == 0) { - printf("\n%60s\n", "Linear Elasticity model based on deformation gradient"); - } - } else if (strcmp(arg[ioffset], "*STRENGTH_LINEAR") == 0) { - - /* - * Linear Elasticity strength only model based on strain rate - */ - - strengthModel[itype] = STRENGTH_LINEAR; - if (comm->me == 0) { - printf("reading *STRENGTH_LINEAR\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *STRENGTH_LINEAR"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1) { - sprintf(str, "expected 0 arguments following *STRENGTH_LINEAR but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - if (comm->me == 0) { - printf("%60s\n", "Linear Elasticity strength based on strain rate"); - } - } // end Linear Elasticity strength only model based on strain rate - - else if (strcmp(arg[ioffset], "*STRENGTH_LINEAR_PLASTIC") == 0) { - - /* - * Linear Elastic / perfectly plastic strength only model based on strain rate - */ - - strengthModel[itype] = STRENGTH_LINEAR_PLASTIC; - if (comm->me == 0) { - printf("reading *STRENGTH_LINEAR_PLASTIC\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *STRENGTH_LINEAR_PLASTIC"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 2 + 1) { - sprintf(str, "expected 2 arguments following *STRENGTH_LINEAR_PLASTIC but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - Lookup[YIELD_STRESS][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - Lookup[HARDENING_PARAMETER][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); - - if (comm->me == 0) { - printf("%60s\n", "Linear elastic / perfectly plastic strength based on strain rate"); - printf("%60s : %g\n", "Young's modulus", Lookup[YOUNGS_MODULUS][itype]); - printf("%60s : %g\n", "Poisson ratio", Lookup[POISSON_RATIO][itype]); - printf("%60s : %g\n", "shear modulus", Lookup[SHEAR_MODULUS][itype]); - printf("%60s : %g\n", "constant yield stress", Lookup[YIELD_STRESS][itype]); - printf("%60s : %g\n", "constant hardening parameter", Lookup[HARDENING_PARAMETER][itype]); - } - } // end Linear Elastic / perfectly plastic strength only model based on strain rate - - else if (strcmp(arg[ioffset], "*JOHNSON_COOK") == 0) { - - /* - * JOHNSON - COOK - */ - - strengthModel[itype] = STRENGTH_JOHNSON_COOK; - if (comm->me == 0) { - printf("reading *JOHNSON_COOK\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *JOHNSON_COOK"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 8 + 1) { - sprintf(str, "expected 8 arguments following *JOHNSON_COOK but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - Lookup[JC_A][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - Lookup[JC_B][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); - Lookup[JC_a][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); - Lookup[JC_C][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); - Lookup[JC_epdot0][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); - Lookup[JC_T0][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); - Lookup[JC_Tmelt][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); - Lookup[JC_M][itype] = utils::numeric(FLERR, arg[ioffset + 8],false,lmp); - - if (comm->me == 0) { - printf("%60s\n", "Johnson Cook material strength model"); - printf("%60s : %g\n", "A: initial yield stress", Lookup[JC_A][itype]); - printf("%60s : %g\n", "B : proportionality factor for plastic strain dependency", Lookup[JC_B][itype]); - printf("%60s : %g\n", "a : exponent for plastic strain dependency", Lookup[JC_a][itype]); - printf("%60s : %g\n", "C : proportionality factor for logarithmic plastic strain rate dependency", - Lookup[JC_C][itype]); - printf("%60s : %g\n", "epdot0 : dimensionality factor for plastic strain rate dependency", - Lookup[JC_epdot0][itype]); - printf("%60s : %g\n", "T0 : reference (room) temperature", Lookup[JC_T0][itype]); - printf("%60s : %g\n", "Tmelt : melting temperature", Lookup[JC_Tmelt][itype]); - printf("%60s : %g\n", "M : exponent for temperature dependency", Lookup[JC_M][itype]); - } - - } else if (strcmp(arg[ioffset], "*EOS_NONE") == 0) { - - /* - * no eos - */ - - eos[itype] = EOS_NONE; - if (comm->me == 0) { - printf("reading *EOS_NONE\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *EOS_NONE"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1) { - sprintf(str, "expected 0 arguments following *EOS_NONE but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - if (comm->me == 0) { - printf("\n%60s\n", "no EOS selected"); - } - - } else if (strcmp(arg[ioffset], "*EOS_LINEAR") == 0) { - - /* - * linear eos - */ - - eos[itype] = EOS_LINEAR; - if (comm->me == 0) { - printf("reading *EOS_LINEAR\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *EOS_LINEAR"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1) { - sprintf(str, "expected 0 arguments following *EOS_LINEAR but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - if (comm->me == 0) { - printf("\n%60s\n", "linear EOS based on strain rate"); - printf("%60s : %g\n", "bulk modulus", Lookup[BULK_MODULUS][itype]); - } - } // end linear eos - else if (strcmp(arg[ioffset], "*EOS_SHOCK") == 0) { - - /* - * shock eos - */ - - eos[itype] = EOS_SHOCK; - if (comm->me == 0) { - printf("reading *EOS_SHOCK\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *EOS_SHOCK"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 3 + 1) { - sprintf(str, "expected 3 arguments (c0, S, Gamma) following *EOS_SHOCK but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - Lookup[EOS_SHOCK_C0][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - Lookup[EOS_SHOCK_S][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); - Lookup[EOS_SHOCK_GAMMA][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); - if (comm->me == 0) { - printf("\n%60s\n", "shock EOS based on strain rate"); - printf("%60s : %g\n", "reference speed of sound", Lookup[EOS_SHOCK_C0][itype]); - printf("%60s : %g\n", "Hugoniot parameter S", Lookup[EOS_SHOCK_S][itype]); - printf("%60s : %g\n", "Grueneisen Gamma", Lookup[EOS_SHOCK_GAMMA][itype]); - } - } // end shock eos - - else if (strcmp(arg[ioffset], "*EOS_POLYNOMIAL") == 0) { - /* - * polynomial eos - */ - - eos[itype] = EOS_POLYNOMIAL; - if (comm->me == 0) { - printf("reading *EOS_POLYNOMIAL\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *EOS_POLYNOMIAL"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 7 + 1) { - sprintf(str, "expected 7 arguments following *EOS_POLYNOMIAL but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - Lookup[EOS_POLYNOMIAL_C0][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - Lookup[EOS_POLYNOMIAL_C1][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); - Lookup[EOS_POLYNOMIAL_C2][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); - Lookup[EOS_POLYNOMIAL_C3][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); - Lookup[EOS_POLYNOMIAL_C4][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); - Lookup[EOS_POLYNOMIAL_C5][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); - Lookup[EOS_POLYNOMIAL_C6][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); - if (comm->me == 0) { - printf("\n%60s\n", "polynomial EOS based on strain rate"); - printf("%60s : %g\n", "parameter c0", Lookup[EOS_POLYNOMIAL_C0][itype]); - printf("%60s : %g\n", "parameter c1", Lookup[EOS_POLYNOMIAL_C1][itype]); - printf("%60s : %g\n", "parameter c2", Lookup[EOS_POLYNOMIAL_C2][itype]); - printf("%60s : %g\n", "parameter c3", Lookup[EOS_POLYNOMIAL_C3][itype]); - printf("%60s : %g\n", "parameter c4", Lookup[EOS_POLYNOMIAL_C4][itype]); - printf("%60s : %g\n", "parameter c5", Lookup[EOS_POLYNOMIAL_C5][itype]); - printf("%60s : %g\n", "parameter c6", Lookup[EOS_POLYNOMIAL_C6][itype]); - } - } // end polynomial eos - - else if (strcmp(arg[ioffset], "*FAILURE_MAX_PLASTIC_STRAIN") == 0) { - - /* - * maximum plastic strain failure criterion - */ - - if (comm->me == 0) { - printf("reading *FAILURE_MAX_PLASTIC_SRTRAIN\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *FAILURE_MAX_PLASTIC_STRAIN"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1 + 1) { - sprintf(str, "expected 1 arguments following *FAILURE_MAX_PLASTIC_STRAIN but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - failureModel[itype].failure_max_plastic_strain = true; - failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - - if (comm->me == 0) { - printf("\n%60s\n", "maximum plastic strain failure criterion"); - printf("%60s : %g\n", "failure occurs when plastic strain reaches limit", - Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype]); - } - } // end maximum plastic strain failure criterion - else if (strcmp(arg[ioffset], "*FAILURE_MAX_PAIRWISE_STRAIN") == 0) { - - /* - * failure criterion based on maximum strain between a pair of TLSPH particles. - */ - - if (comm->me == 0) { - printf("reading *FAILURE_MAX_PAIRWISE_STRAIN\n"); - } - - if (update_method != UPDATE_NONE) { - error->all(FLERR, "cannot use *FAILURE_MAX_PAIRWISE_STRAIN with updated Total-Lagrangian formalism"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *FAILURE_MAX_PAIRWISE_STRAIN"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1 + 1) { - sprintf(str, "expected 1 arguments following *FAILURE_MAX_PAIRWISE_STRAIN but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - failureModel[itype].failure_max_pairwise_strain = true; - failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - - if (comm->me == 0) { - printf("\n%60s\n", "maximum pairwise strain failure criterion"); - printf("%60s : %g\n", "failure occurs when pairwise strain reaches limit", - Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype]); - } - } // end pair based maximum strain failure criterion - else if (strcmp(arg[ioffset], "*FAILURE_MAX_PRINCIPAL_STRAIN") == 0) { - error->all(FLERR, "this failure model is currently unsupported"); - - /* - * maximum principal strain failure criterion - */ - if (comm->me == 0) { - printf("reading *FAILURE_MAX_PRINCIPAL_STRAIN\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *FAILURE_MAX_PRINCIPAL_STRAIN"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1 + 1) { - sprintf(str, "expected 1 arguments following *FAILURE_MAX_PRINCIPAL_STRAIN but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - failureModel[itype].failure_max_principal_strain = true; - failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - - if (comm->me == 0) { - printf("\n%60s\n", "maximum principal strain failure criterion"); - printf("%60s : %g\n", "failure occurs when principal strain reaches limit", - Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype]); - } - } // end maximum principal strain failure criterion - else if (strcmp(arg[ioffset], "*FAILURE_JOHNSON_COOK") == 0) { - error->all(FLERR, "this failure model is currently unsupported"); - if (comm->me == 0) { - printf("reading *FAILURE_JOHNSON_COOK\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *FAILURE_JOHNSON_COOK"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 5 + 1) { - sprintf(str, "expected 5 arguments following *FAILURE_JOHNSON_COOK but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - failureModel[itype].failure_johnson_cook = true; - failureModel[itype].integration_point_wise = true; - - Lookup[FAILURE_JC_D1][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - Lookup[FAILURE_JC_D2][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); - Lookup[FAILURE_JC_D3][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); - Lookup[FAILURE_JC_D4][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); - Lookup[FAILURE_JC_EPDOT0][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); - - if (comm->me == 0) { - printf("\n%60s\n", "Johnson-Cook failure criterion"); - printf("%60s : %g\n", "parameter d1", Lookup[FAILURE_JC_D1][itype]); - printf("%60s : %g\n", "parameter d2", Lookup[FAILURE_JC_D2][itype]); - printf("%60s : %g\n", "parameter d3", Lookup[FAILURE_JC_D3][itype]); - printf("%60s : %g\n", "parameter d4", Lookup[FAILURE_JC_D4][itype]); - printf("%60s : %g\n", "reference plastic strain rate", Lookup[FAILURE_JC_EPDOT0][itype]); - } - - } else if (strcmp(arg[ioffset], "*FAILURE_MAX_PRINCIPAL_STRESS") == 0) { - error->all(FLERR, "this failure model is currently unsupported"); - - /* - * maximum principal stress failure criterion - */ - - if (comm->me == 0) { - printf("reading *FAILURE_MAX_PRINCIPAL_STRESS\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *FAILURE_MAX_PRINCIPAL_STRESS"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1 + 1) { - sprintf(str, "expected 1 arguments following *FAILURE_MAX_PRINCIPAL_STRESS but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - failureModel[itype].failure_max_principal_stress = true; - failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - - if (comm->me == 0) { - printf("\n%60s\n", "maximum principal stress failure criterion"); - printf("%60s : %g\n", "failure occurs when principal stress reaches limit", - Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype]); - } - } // end maximum principal stress failure criterion - - else if (strcmp(arg[ioffset], "*FAILURE_ENERGY_RELEASE_RATE") == 0) { - if (comm->me == 0) { - printf("reading *FAILURE_ENERGY_RELEASE_RATE\n"); - } - - t = string("*"); - iNextKwd = -1; - for (iarg = ioffset + 1; iarg < narg; iarg++) { - s = string(arg[iarg]); - if (s.compare(0, t.length(), t) == 0) { - iNextKwd = iarg; - break; - } - } - - if (iNextKwd < 0) { - sprintf(str, "no *KEYWORD terminates *FAILURE_ENERGY_RELEASE_RATE"); - error->all(FLERR, str); - } - - if (iNextKwd - ioffset != 1 + 1) { - sprintf(str, "expected 1 arguments following *FAILURE_ENERGY_RELEASE_RATE but got %d\n", iNextKwd - ioffset - 1); - error->all(FLERR, str); - } - - failureModel[itype].failure_energy_release_rate = true; - Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); - - if (comm->me == 0) { - printf("\n%60s\n", "critical energy release rate failure criterion"); - printf("%60s : %g\n", "failure occurs when energy release rate reaches limit", - Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype]); - } - } // end energy release rate failure criterion - - else { - snprintf(str,128,"unknown *KEYWORD: %s", arg[ioffset]); - error->all(FLERR, str); - } - + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *EOS_LINEAR"); + + if (iNextKwd - ioffset != 1) + error->all(FLERR, "expected 0 arguments following *EOS_LINEAR but got {}\n", iNextKwd - ioffset - 1); + + if (comm->me == 0) { + utils::logmesg(lmp, "\nlinear EOS based on strain rate\n"); + utils::logmesg(lmp, "{:60} : {}\n", "bulk modulus", Lookup[BULK_MODULUS][itype]); + } + } // end linear eos + else if (strcmp(arg[ioffset], "*EOS_SHOCK") == 0) { + + /* + * shock eos + */ + + eos[itype] = EOS_SHOCK; + if (comm->me == 0) utils::logmesg(lmp, "reading *EOS_SHOCK\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; } + } - setflag[itype][itype] = 1; + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *EOS_SHOCK"); + if (iNextKwd - ioffset != 3 + 1) + error->all(FLERR, "expected 3 arguments (c0, S, Gamma) following *EOS_SHOCK but got {}\n", iNextKwd - ioffset - 1); + + Lookup[EOS_SHOCK_C0][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[EOS_SHOCK_S][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[EOS_SHOCK_GAMMA][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + if (comm->me == 0) { + utils::logmesg(lmp, "\nshock EOS based on strain rate\n"); + utils::logmesg(lmp, "{:60} : {}\n", "reference speed of sound", Lookup[EOS_SHOCK_C0][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Hugoniot parameter S", Lookup[EOS_SHOCK_S][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "Grueneisen Gamma", Lookup[EOS_SHOCK_GAMMA][itype]); + } + } // end shock eos + + else if (strcmp(arg[ioffset], "*EOS_POLYNOMIAL") == 0) { + /* + * polynomial eos + */ + + eos[itype] = EOS_POLYNOMIAL; + if (comm->me == 0) utils::logmesg(lmp, "reading *EOS_POLYNOMIAL\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *EOS_POLYNOMIAL"); + + if (iNextKwd - ioffset != 7 + 1) + error->all(FLERR, "expected 7 arguments following *EOS_POLYNOMIAL but got {}\n", iNextKwd - ioffset - 1); + + Lookup[EOS_POLYNOMIAL_C0][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[EOS_POLYNOMIAL_C1][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[EOS_POLYNOMIAL_C2][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[EOS_POLYNOMIAL_C3][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[EOS_POLYNOMIAL_C4][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + Lookup[EOS_POLYNOMIAL_C5][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); + Lookup[EOS_POLYNOMIAL_C6][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); + if (comm->me == 0) { + utils::logmesg(lmp, "\npolynomial EOS based on strain rate\n"); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c0", Lookup[EOS_POLYNOMIAL_C0][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c1", Lookup[EOS_POLYNOMIAL_C1][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c2", Lookup[EOS_POLYNOMIAL_C2][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c3", Lookup[EOS_POLYNOMIAL_C3][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c4", Lookup[EOS_POLYNOMIAL_C4][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c5", Lookup[EOS_POLYNOMIAL_C5][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter c6", Lookup[EOS_POLYNOMIAL_C6][itype]); + } + } // end polynomial eos + + else if (strcmp(arg[ioffset], "*FAILURE_MAX_PLASTIC_STRAIN") == 0) { + + /* + * maximum plastic strain failure criterion + */ + + if (comm->me == 0) utils::logmesg(lmp, "reading *FAILURE_MAX_PLASTIC_SRTRAIN\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) error->all(FLERR, "no *KEYWORD terminates *FAILURE_MAX_PLASTIC_STRAIN"); + if (iNextKwd - ioffset != 1 + 1) + error->all(FLERR, "expected 1 arguments following *FAILURE_MAX_PLASTIC_STRAIN but got {}\n", iNextKwd - ioffset - 1); + + failureModel[itype].failure_max_plastic_strain = true; + failureModel[itype].integration_point_wise = true; + Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "\nmaximum plastic strain failure criterion\n"); + utils::logmesg(lmp, "{:60} : {}\n", "failure occurs when plastic strain reaches limit", + Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype]); + } + } // end maximum plastic strain failure criterion + else if (strcmp(arg[ioffset], "*FAILURE_MAX_PAIRWISE_STRAIN") == 0) { + + /* + * failure criterion based on maximum strain between a pair of TLSPH particles. + */ + + if (comm->me == 0) utils::logmesg(lmp, "reading *FAILURE_MAX_PAIRWISE_STRAIN\n"); + + if (update_method != UPDATE_NONE) { + error->all(FLERR, "cannot use *FAILURE_MAX_PAIRWISE_STRAIN with updated Total-Lagrangian formalism"); + } + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *FAILURE_MAX_PAIRWISE_STRAIN"); + + if (iNextKwd - ioffset != 1 + 1) + error->all(FLERR, "expected 1 arguments following *FAILURE_MAX_PAIRWISE_STRAIN but got {}\n", iNextKwd - ioffset - 1); + + failureModel[itype].failure_max_pairwise_strain = true; + failureModel[itype].integration_point_wise = true; + Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "\nmaximum pairwise strain failure criterion\n"); + utils::logmesg(lmp, "{:60} : {}\n", "failure occurs when pairwise strain reaches limit", + Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype]); + } + } // end pair based maximum strain failure criterion + else if (strcmp(arg[ioffset], "*FAILURE_MAX_PRINCIPAL_STRAIN") == 0) { + error->all(FLERR, "this failure model is currently unsupported"); + + /* + * maximum principal strain failure criterion + */ + if (comm->me == 0) utils::logmesg(lmp, "reading *FAILURE_MAX_PRINCIPAL_STRAIN\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *FAILURE_MAX_PRINCIPAL_STRAIN"); + + if (iNextKwd - ioffset != 1 + 1) + error->all(FLERR, "expected 1 arguments following *FAILURE_MAX_PRINCIPAL_STRAIN but got {}\n", iNextKwd - ioffset - 1); + + failureModel[itype].failure_max_principal_strain = true; + failureModel[itype].integration_point_wise = true; + Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "\nmaximum principal strain failure criterion\n"); + utils::logmesg(lmp, "{:60} : {}\n", "failure occurs when principal strain reaches limit", + Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype]); + } + } // end maximum principal strain failure criterion + else if (strcmp(arg[ioffset], "*FAILURE_JOHNSON_COOK") == 0) { + error->all(FLERR, "this failure model is currently unsupported"); + if (comm->me == 0) utils::logmesg(lmp, "reading *FAILURE_JOHNSON_COOK\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *FAILURE_JOHNSON_COOK"); + + if (iNextKwd - ioffset != 5 + 1) + error->all(FLERR, "expected 5 arguments following *FAILURE_JOHNSON_COOK but got {}\n", iNextKwd - ioffset - 1); + + failureModel[itype].failure_johnson_cook = true; + failureModel[itype].integration_point_wise = true; + + Lookup[FAILURE_JC_D1][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[FAILURE_JC_D2][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[FAILURE_JC_D3][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[FAILURE_JC_D4][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[FAILURE_JC_EPDOT0][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "\nJohnson-Cook failure criterion\n"); + utils::logmesg(lmp, "{:60} : {}\n", "parameter d1", Lookup[FAILURE_JC_D1][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter d2", Lookup[FAILURE_JC_D2][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter d3", Lookup[FAILURE_JC_D3][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "parameter d4", Lookup[FAILURE_JC_D4][itype]); + utils::logmesg(lmp, "{:60} : {}\n", "reference plastic strain rate", Lookup[FAILURE_JC_EPDOT0][itype]); + } + + } else if (strcmp(arg[ioffset], "*FAILURE_MAX_PRINCIPAL_STRESS") == 0) { + error->all(FLERR, "this failure model is currently unsupported"); + + /* + * maximum principal stress failure criterion + */ + + if (comm->me == 0) utils::logmesg(lmp, "reading *FAILURE_MAX_PRINCIPAL_STRESS\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *FAILURE_MAX_PRINCIPAL_STRESS"); + + if (iNextKwd - ioffset != 1 + 1) + error->all(FLERR, "expected 1 arguments following *FAILURE_MAX_PRINCIPAL_STRESS but got {}\n", iNextKwd - ioffset - 1); + + failureModel[itype].failure_max_principal_stress = true; + failureModel[itype].integration_point_wise = true; + Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp, "\nmaximum principal stress failure criterion\n"); + utils::logmesg(lmp, "{:60} : {}\n", "failure occurs when principal stress reaches limit", + Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype]); + } + } // end maximum principal stress failure criterion + + else if (strcmp(arg[ioffset], "*FAILURE_ENERGY_RELEASE_RATE") == 0) { + if (comm->me == 0) utils::logmesg(lmp, "reading *FAILURE_ENERGY_RELEASE_RATE\n"); + + t = std::string("*"); + iNextKwd = -1; + for (iarg = ioffset + 1; iarg < narg; iarg++) { + s = std::string(arg[iarg]); + if (s.compare(0, t.length(), t) == 0) { + iNextKwd = iarg; + break; + } + } + + if (iNextKwd < 0) + error->all(FLERR, "no *KEYWORD terminates *FAILURE_ENERGY_RELEASE_RATE"); + + if (iNextKwd - ioffset != 1 + 1) + error->all(FLERR, "expected 1 arguments following *FAILURE_ENERGY_RELEASE_RATE but got {}\n", iNextKwd - ioffset - 1); + + failureModel[itype].failure_energy_release_rate = true; + Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + + if (comm->me == 0) { + utils::logmesg(lmp,"\ncritical energy release rate failure criterion\n"); + utils::logmesg(lmp, "{:60} : {}\n", "failure occurs when energy release rate reaches limit", + Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype]); + } + } // end energy release rate failure criterion + + else error->all(FLERR, "unknown *KEYWORD: {}", arg[ioffset]); + } + setflag[itype][itype] = 1; } /* ---------------------------------------------------------------------- @@ -1694,23 +1551,22 @@ void PairTlsph::coeff(int narg, char **arg) { double PairTlsph::init_one(int i, int j) { - if (!allocated) - allocate(); + if (!allocated) + allocate(); - if (setflag[i][j] == 0) - error->all(FLERR, "All pair coeffs are not set"); + if (setflag[i][j] == 0) + error->all(FLERR, "All pair coeffs are not set"); - if (force->newton == 1) - error->all(FLERR, "Pair style tlsph requires newton off"); + if (force->newton == 1) + error->all(FLERR, "Pair style tlsph requires newton off"); // cutoff = sum of max I,J radii for // dynamic/dynamic & dynamic/frozen interactions, but not frozen/frozen - double cutoff = maxrad_dynamic[i] + maxrad_dynamic[j]; - cutoff = MAX(cutoff, maxrad_frozen[i] + maxrad_dynamic[j]); - cutoff = MAX(cutoff, maxrad_dynamic[i] + maxrad_frozen[j]); -//printf("cutoff for pair pair tlsph = %f\n", cutoff); - return cutoff; + double cutoff = maxrad_dynamic[i] + maxrad_dynamic[j]; + cutoff = MAX(cutoff, maxrad_frozen[i] + maxrad_dynamic[j]); + cutoff = MAX(cutoff, maxrad_dynamic[i] + maxrad_frozen[j]); + return cutoff; } /* ---------------------------------------------------------------------- @@ -1718,57 +1574,57 @@ double PairTlsph::init_one(int i, int j) { ------------------------------------------------------------------------- */ void PairTlsph::init_style() { - int i; + int i; - if (force->newton_pair == 1) { - error->all(FLERR, "Pair style tlsph requires newton pair off"); - } + if (force->newton_pair == 1) { + error->all(FLERR, "Pair style tlsph requires newton pair off"); + } // request a granular neighbor list - neighbor->add_request(this, NeighConst::REQ_SIZE); + neighbor->add_request(this, NeighConst::REQ_SIZE); // set maxrad_dynamic and maxrad_frozen for each type // include future Fix pour particles as dynamic - for (i = 1; i <= atom->ntypes; i++) - onerad_dynamic[i] = onerad_frozen[i] = 0.0; + for (i = 1; i <= atom->ntypes; i++) + onerad_dynamic[i] = onerad_frozen[i] = 0.0; - double *radius = atom->radius; - int *type = atom->type; - int nlocal = atom->nlocal; + double *radius = atom->radius; + int *type = atom->type; + int nlocal = atom->nlocal; - for (i = 0; i < nlocal; i++) - onerad_dynamic[type[i]] = MAX(onerad_dynamic[type[i]], radius[i]); + for (i = 0; i < nlocal; i++) + onerad_dynamic[type[i]] = MAX(onerad_dynamic[type[i]], radius[i]); - MPI_Allreduce(&onerad_dynamic[1], &maxrad_dynamic[1], atom->ntypes, MPI_DOUBLE, MPI_MAX, world); - MPI_Allreduce(&onerad_frozen[1], &maxrad_frozen[1], atom->ntypes, MPI_DOUBLE, MPI_MAX, world); + MPI_Allreduce(&onerad_dynamic[1], &maxrad_dynamic[1], atom->ntypes, MPI_DOUBLE, MPI_MAX, world); + MPI_Allreduce(&onerad_frozen[1], &maxrad_frozen[1], atom->ntypes, MPI_DOUBLE, MPI_MAX, world); // if first init, create Fix needed for storing reference configuration neighbors - int igroup = group->find("tlsph"); - if (igroup == -1) - error->all(FLERR, "Pair style tlsph requires its particles to be part of a group named tlsph. This group does not exist."); + int igroup = group->find("tlsph"); + if (igroup == -1) + error->all(FLERR, "Pair style tlsph requires its particles to be part of a group named tlsph. This group does not exist."); - if (fix_tlsph_reference_configuration == nullptr) { - char **fixarg = new char*[3]; - fixarg[0] = (char *) "SMD_TLSPH_NEIGHBORS"; - fixarg[1] = (char *) "tlsph"; - fixarg[2] = (char *) "SMD_TLSPH_NEIGHBORS"; - modify->add_fix(3, fixarg); - delete[] fixarg; - fix_tlsph_reference_configuration = (FixSMD_TLSPH_ReferenceConfiguration *) modify->fix[modify->nfix - 1]; - fix_tlsph_reference_configuration->pair = this; - } + if (fix_tlsph_reference_configuration == nullptr) { + auto fixarg = new char*[3]; + fixarg[0] = (char *) "SMD_TLSPH_NEIGHBORS"; + fixarg[1] = (char *) "tlsph"; + fixarg[2] = (char *) "SMD_TLSPH_NEIGHBORS"; + modify->add_fix(3, fixarg); + delete[] fixarg; + fix_tlsph_reference_configuration = dynamic_cast( modify->fix[modify->nfix - 1]); + fix_tlsph_reference_configuration->pair = this; + } // find associated SMD_TLSPH_NEIGHBORS fix that must exist // could have changed locations in fix list since created - ifix_tlsph = -1; - for (int i = 0; i < modify->nfix; i++) - if (strcmp(modify->fix[i]->style, "SMD_TLSPH_NEIGHBORS") == 0) - ifix_tlsph = i; - if (ifix_tlsph == -1) - error->all(FLERR, "Fix SMD_TLSPH_NEIGHBORS does not exist"); + ifix_tlsph = -1; + for (int i = 0; i < modify->nfix; i++) + if (strcmp(modify->fix[i]->style, "SMD_TLSPH_NEIGHBORS") == 0) + ifix_tlsph = i; + if (ifix_tlsph == -1) + error->all(FLERR, "Fix SMD_TLSPH_NEIGHBORS does not exist"); } @@ -1794,123 +1650,118 @@ double PairTlsph::memory_usage() { ------------------------------------------------------------------------- */ void *PairTlsph::extract(const char *str, int &/*i*/) { -//printf("in PairTlsph::extract\n"); - if (strcmp(str, "smd/tlsph/Fincr_ptr") == 0) { - return (void *) Fincr; - } else if (strcmp(str, "smd/tlsph/detF_ptr") == 0) { - return (void *) detF; - } else if (strcmp(str, "smd/tlsph/PK1_ptr") == 0) { - return (void *) PK1; - } else if (strcmp(str, "smd/tlsph/smoothVel_ptr") == 0) { - return (void *) smoothVelDifference; - } else if (strcmp(str, "smd/tlsph/numNeighsRefConfig_ptr") == 0) { - return (void *) numNeighsRefConfig; - } else if (strcmp(str, "smd/tlsph/stressTensor_ptr") == 0) { - return (void *) CauchyStress; - } else if (strcmp(str, "smd/tlsph/updateFlag_ptr") == 0) { - return (void *) &updateFlag; - } else if (strcmp(str, "smd/tlsph/strain_rate_ptr") == 0) { - return (void *) D; - } else if (strcmp(str, "smd/tlsph/hMin_ptr") == 0) { - return (void *) &hMin; - } else if (strcmp(str, "smd/tlsph/dtCFL_ptr") == 0) { - return (void *) &dtCFL; - } else if (strcmp(str, "smd/tlsph/dtRelative_ptr") == 0) { - return (void *) &dtRelative; - } else if (strcmp(str, "smd/tlsph/hourglass_error_ptr") == 0) { - return (void *) hourglass_error; - } else if (strcmp(str, "smd/tlsph/particle_dt_ptr") == 0) { - return (void *) particle_dt; - } else if (strcmp(str, "smd/tlsph/rotation_ptr") == 0) { - return (void *) R; - } + if (strcmp(str, "smd/tlsph/Fincr_ptr") == 0) { + return (void *) Fincr; + } else if (strcmp(str, "smd/tlsph/detF_ptr") == 0) { + return (void *) detF; + } else if (strcmp(str, "smd/tlsph/PK1_ptr") == 0) { + return (void *) PK1; + } else if (strcmp(str, "smd/tlsph/smoothVel_ptr") == 0) { + return (void *) smoothVelDifference; + } else if (strcmp(str, "smd/tlsph/numNeighsRefConfig_ptr") == 0) { + return (void *) numNeighsRefConfig; + } else if (strcmp(str, "smd/tlsph/stressTensor_ptr") == 0) { + return (void *) CauchyStress; + } else if (strcmp(str, "smd/tlsph/updateFlag_ptr") == 0) { + return (void *) &updateFlag; + } else if (strcmp(str, "smd/tlsph/strain_rate_ptr") == 0) { + return (void *) D; + } else if (strcmp(str, "smd/tlsph/hMin_ptr") == 0) { + return (void *) &hMin; + } else if (strcmp(str, "smd/tlsph/dtCFL_ptr") == 0) { + return (void *) &dtCFL; + } else if (strcmp(str, "smd/tlsph/dtRelative_ptr") == 0) { + return (void *) &dtRelative; + } else if (strcmp(str, "smd/tlsph/hourglass_error_ptr") == 0) { + return (void *) hourglass_error; + } else if (strcmp(str, "smd/tlsph/particle_dt_ptr") == 0) { + return (void *) particle_dt; + } else if (strcmp(str, "smd/tlsph/rotation_ptr") == 0) { + return (void *) R; + } - return nullptr; + return nullptr; } /* ---------------------------------------------------------------------- */ int PairTlsph::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/) { - int i, j, m; - tagint *mol = atom->molecule; - double *damage = atom->damage; - double *eff_plastic_strain = atom->eff_plastic_strain; - double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; + int i, j, m; + tagint *mol = atom->molecule; + double *damage = atom->damage; + double *eff_plastic_strain = atom->eff_plastic_strain; + double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; -//printf("in PairTlsph::pack_forward_comm\n"); + m = 0; + for (i = 0; i < n; i++) { + j = list[i]; + buf[m++] = PK1[j](0, 0); // PK1 is not symmetric + buf[m++] = PK1[j](0, 1); + buf[m++] = PK1[j](0, 2); + buf[m++] = PK1[j](1, 0); + buf[m++] = PK1[j](1, 1); + buf[m++] = PK1[j](1, 2); + buf[m++] = PK1[j](2, 0); + buf[m++] = PK1[j](2, 1); + buf[m++] = PK1[j](2, 2); // 9 - m = 0; - for (i = 0; i < n; i++) { - j = list[i]; - buf[m++] = PK1[j](0, 0); // PK1 is not symmetric - buf[m++] = PK1[j](0, 1); - buf[m++] = PK1[j](0, 2); - buf[m++] = PK1[j](1, 0); - buf[m++] = PK1[j](1, 1); - buf[m++] = PK1[j](1, 2); - buf[m++] = PK1[j](2, 0); - buf[m++] = PK1[j](2, 1); - buf[m++] = PK1[j](2, 2); // 9 + buf[m++] = Fincr[j](0, 0); // Fincr is not symmetric + buf[m++] = Fincr[j](0, 1); + buf[m++] = Fincr[j](0, 2); + buf[m++] = Fincr[j](1, 0); + buf[m++] = Fincr[j](1, 1); + buf[m++] = Fincr[j](1, 2); + buf[m++] = Fincr[j](2, 0); + buf[m++] = Fincr[j](2, 1); + buf[m++] = Fincr[j](2, 2); // 9 + 9 = 18 - buf[m++] = Fincr[j](0, 0); // Fincr is not symmetric - buf[m++] = Fincr[j](0, 1); - buf[m++] = Fincr[j](0, 2); - buf[m++] = Fincr[j](1, 0); - buf[m++] = Fincr[j](1, 1); - buf[m++] = Fincr[j](1, 2); - buf[m++] = Fincr[j](2, 0); - buf[m++] = Fincr[j](2, 1); - buf[m++] = Fincr[j](2, 2); // 9 + 9 = 18 + buf[m++] = mol[j]; //19 + buf[m++] = damage[j]; //20 + buf[m++] = eff_plastic_strain[j]; //21 + buf[m++] = eff_plastic_strain_rate[j]; //22 - buf[m++] = mol[j]; //19 - buf[m++] = damage[j]; //20 - buf[m++] = eff_plastic_strain[j]; //21 - buf[m++] = eff_plastic_strain_rate[j]; //22 - - } - return m; + } + return m; } /* ---------------------------------------------------------------------- */ void PairTlsph::unpack_forward_comm(int n, int first, double *buf) { - int i, m, last; - tagint *mol = atom->molecule; - double *damage = atom->damage; - double *eff_plastic_strain = atom->eff_plastic_strain; - double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; + int i, m, last; + tagint *mol = atom->molecule; + double *damage = atom->damage; + double *eff_plastic_strain = atom->eff_plastic_strain; + double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; -//printf("in PairTlsph::unpack_forward_comm\n"); + m = 0; + last = first + n; + for (i = first; i < last; i++) { - m = 0; - last = first + n; - for (i = first; i < last; i++) { + PK1[i](0, 0) = buf[m++]; // PK1 is not symmetric + PK1[i](0, 1) = buf[m++]; + PK1[i](0, 2) = buf[m++]; + PK1[i](1, 0) = buf[m++]; + PK1[i](1, 1) = buf[m++]; + PK1[i](1, 2) = buf[m++]; + PK1[i](2, 0) = buf[m++]; + PK1[i](2, 1) = buf[m++]; + PK1[i](2, 2) = buf[m++]; - PK1[i](0, 0) = buf[m++]; // PK1 is not symmetric - PK1[i](0, 1) = buf[m++]; - PK1[i](0, 2) = buf[m++]; - PK1[i](1, 0) = buf[m++]; - PK1[i](1, 1) = buf[m++]; - PK1[i](1, 2) = buf[m++]; - PK1[i](2, 0) = buf[m++]; - PK1[i](2, 1) = buf[m++]; - PK1[i](2, 2) = buf[m++]; + Fincr[i](0, 0) = buf[m++]; + Fincr[i](0, 1) = buf[m++]; + Fincr[i](0, 2) = buf[m++]; + Fincr[i](1, 0) = buf[m++]; + Fincr[i](1, 1) = buf[m++]; + Fincr[i](1, 2) = buf[m++]; + Fincr[i](2, 0) = buf[m++]; + Fincr[i](2, 1) = buf[m++]; + Fincr[i](2, 2) = buf[m++]; - Fincr[i](0, 0) = buf[m++]; - Fincr[i](0, 1) = buf[m++]; - Fincr[i](0, 2) = buf[m++]; - Fincr[i](1, 0) = buf[m++]; - Fincr[i](1, 1) = buf[m++]; - Fincr[i](1, 2) = buf[m++]; - Fincr[i](2, 0) = buf[m++]; - Fincr[i](2, 1) = buf[m++]; - Fincr[i](2, 2) = buf[m++]; - - mol[i] = static_cast(buf[m++]); - damage[i] = buf[m++]; - eff_plastic_strain[i] = buf[m++]; //22 - eff_plastic_strain_rate[i] = buf[m++]; //23 - } + mol[i] = static_cast(buf[m++]); + damage[i] = buf[m++]; + eff_plastic_strain[i] = buf[m++]; //22 + eff_plastic_strain_rate[i] = buf[m++]; //23 + } } /* ---------------------------------------------------------------------- @@ -1919,166 +1770,145 @@ void PairTlsph::unpack_forward_comm(int n, int first, double *buf) { ------------------------------------------------------------------------- */ void PairTlsph::effective_longitudinal_modulus(const int itype, const double dt, const double d_iso, const double p_rate, - const Matrix3d d_dev, const Matrix3d sigma_dev_rate, const double /*damage*/, double &K_eff, double &mu_eff, double &M_eff) { - double M0; // initial longitudinal modulus - double shear_rate_sq; + const Matrix3d d_dev, const Matrix3d sigma_dev_rate, const double /*damage*/, double &K_eff, double &mu_eff, double &M_eff) { + double M0; // initial longitudinal modulus + double shear_rate_sq; -// if (damage >= 0.5) { -// M_eff = Lookup[M_MODULUS][itype]; -// K_eff = Lookup[BULK_MODULUS][itype]; -// mu_eff = Lookup[SHEAR_MODULUS][itype]; -// return; -// } + M0 = Lookup[M_MODULUS][itype]; - M0 = Lookup[M_MODULUS][itype]; + if (dt * d_iso > 1.0e-6) { + K_eff = p_rate / d_iso; + if (K_eff < 0.0) { // it is possible for K_eff to become negative due to strain softening + K_eff = Lookup[BULK_MODULUS][itype]; + } + } else { + K_eff = Lookup[BULK_MODULUS][itype]; + } - if (dt * d_iso > 1.0e-6) { - K_eff = p_rate / d_iso; - if (K_eff < 0.0) { // it is possible for K_eff to become negative due to strain softening -// if (damage == 0.0) { -// error->one(FLERR, "computed a negative effective bulk modulus but particle is not damaged."); -// } - K_eff = Lookup[BULK_MODULUS][itype]; - } - } else { - K_eff = Lookup[BULK_MODULUS][itype]; - } - - if (domain->dimension == 3) { + if (domain->dimension == 3) { // Calculate 2 mu by looking at ratio shear stress / shear strain. Use numerical softening to avoid divide-by-zero. - mu_eff = 0.5 - * (sigma_dev_rate(0, 1) / (d_dev(0, 1) + 1.0e-16) + sigma_dev_rate(0, 2) / (d_dev(0, 2) + 1.0e-16) - + sigma_dev_rate(1, 2) / (d_dev(1, 2) + 1.0e-16)); + mu_eff = 0.5 + * (sigma_dev_rate(0, 1) / (d_dev(0, 1) + 1.0e-16) + sigma_dev_rate(0, 2) / (d_dev(0, 2) + 1.0e-16) + + sigma_dev_rate(1, 2) / (d_dev(1, 2) + 1.0e-16)); // Calculate magnitude of deviatoric strain rate. This is used for deciding if shear modulus should be computed from current rate or be taken as the initial value. - shear_rate_sq = d_dev(0, 1) * d_dev(0, 1) + d_dev(0, 2) * d_dev(0, 2) + d_dev(1, 2) * d_dev(1, 2); - } else { - mu_eff = 0.5 * (sigma_dev_rate(0, 1) / (d_dev(0, 1) + 1.0e-16)); - shear_rate_sq = d_dev(0, 1) * d_dev(0, 1); - } + shear_rate_sq = d_dev(0, 1) * d_dev(0, 1) + d_dev(0, 2) * d_dev(0, 2) + d_dev(1, 2) * d_dev(1, 2); + } else { + mu_eff = 0.5 * (sigma_dev_rate(0, 1) / (d_dev(0, 1) + 1.0e-16)); + shear_rate_sq = d_dev(0, 1) * d_dev(0, 1); + } - if (dt * dt * shear_rate_sq < 1.0e-8) { - mu_eff = Lookup[SHEAR_MODULUS][itype]; - } + if (dt * dt * shear_rate_sq < 1.0e-8) { + mu_eff = Lookup[SHEAR_MODULUS][itype]; + } - if (mu_eff < Lookup[SHEAR_MODULUS][itype]) { // it is possible for mu_eff to become negative due to strain softening -// if (damage == 0.0) { -// printf("mu_eff = %f, tau=%f, gamma=%f\n", mu_eff, sigma_dev_rate(0, 1), d_dev(0, 1)); -// error->message(FLERR, "computed a negative effective shear modulus but particle is not damaged."); -// } - mu_eff = Lookup[SHEAR_MODULUS][itype]; - } + if (mu_eff < Lookup[SHEAR_MODULUS][itype]) { // it is possible for mu_eff to become negative due to strain softening + mu_eff = Lookup[SHEAR_MODULUS][itype]; + } -//mu_eff = Lookup[SHEAR_MODULUS][itype]; + if (mu_eff < 0.0) { + error->one(FLERR, "mu_eff = {}, tau={}, gamma={}", mu_eff, sigma_dev_rate(0, 1), d_dev(0, 1)); - if (K_eff < 0.0) { - printf("K_eff = %f, p_rate=%f, vol_rate=%f\n", K_eff, p_rate, d_iso); - } + } - if (mu_eff < 0.0) { - printf("mu_eff = %f, tau=%f, gamma=%f\n", mu_eff, sigma_dev_rate(0, 1), d_dev(0, 1)); - error->one(FLERR, ""); - } + M_eff = (K_eff + 4.0 * mu_eff / 3.0); // effective dilational modulus, see Pronto 2d eqn 3.4.8 - M_eff = (K_eff + 4.0 * mu_eff / 3.0); // effective dilational modulus, see Pronto 2d eqn 3.4.8 - - if (M_eff < M0) { // do not allow effective dilatational modulus to decrease beyond its initial value - M_eff = M0; - } + if (M_eff < M0) { // do not allow effective dilatational modulus to decrease beyond its initial value + M_eff = M0; + } } /* ---------------------------------------------------------------------- compute pressure. Called from AssembleStress(). ------------------------------------------------------------------------- */ void PairTlsph::ComputePressure(const int i, const double rho, const double mass_specific_energy, const double vol_specific_energy, - const double pInitial, const double d_iso, double &pFinal, double &p_rate) { - int *type = atom->type; - double dt = update->dt; + const double pInitial, const double d_iso, double &pFinal, double &p_rate) { + int *type = atom->type; + double dt = update->dt; - int itype; + int itype; - itype = type[i]; + itype = type[i]; - switch (eos[itype]) { - case EOS_LINEAR: - LinearEOS(Lookup[BULK_MODULUS][itype], pInitial, d_iso, dt, pFinal, p_rate); - break; - case EOS_NONE: - pFinal = 0.0; - p_rate = 0.0; - break; - case EOS_SHOCK: + switch (eos[itype]) { + case EOS_LINEAR: + LinearEOS(Lookup[BULK_MODULUS][itype], pInitial, d_iso, dt, pFinal, p_rate); + break; + case EOS_NONE: + pFinal = 0.0; + p_rate = 0.0; + break; + case EOS_SHOCK: // rho, rho0, e, e0, c0, S, Gamma, pInitial, dt, &pFinal, &p_rate); - ShockEOS(rho, Lookup[REFERENCE_DENSITY][itype], mass_specific_energy, 0.0, Lookup[EOS_SHOCK_C0][itype], - Lookup[EOS_SHOCK_S][itype], Lookup[EOS_SHOCK_GAMMA][itype], pInitial, dt, pFinal, p_rate); - break; - case EOS_POLYNOMIAL: - polynomialEOS(rho, Lookup[REFERENCE_DENSITY][itype], vol_specific_energy, Lookup[EOS_POLYNOMIAL_C0][itype], - Lookup[EOS_POLYNOMIAL_C1][itype], Lookup[EOS_POLYNOMIAL_C2][itype], Lookup[EOS_POLYNOMIAL_C3][itype], - Lookup[EOS_POLYNOMIAL_C4][itype], Lookup[EOS_POLYNOMIAL_C5][itype], Lookup[EOS_POLYNOMIAL_C6][itype], pInitial, dt, - pFinal, p_rate); + ShockEOS(rho, Lookup[REFERENCE_DENSITY][itype], mass_specific_energy, 0.0, Lookup[EOS_SHOCK_C0][itype], + Lookup[EOS_SHOCK_S][itype], Lookup[EOS_SHOCK_GAMMA][itype], pInitial, dt, pFinal, p_rate); + break; + case EOS_POLYNOMIAL: + polynomialEOS(rho, Lookup[REFERENCE_DENSITY][itype], vol_specific_energy, Lookup[EOS_POLYNOMIAL_C0][itype], + Lookup[EOS_POLYNOMIAL_C1][itype], Lookup[EOS_POLYNOMIAL_C2][itype], Lookup[EOS_POLYNOMIAL_C3][itype], + Lookup[EOS_POLYNOMIAL_C4][itype], Lookup[EOS_POLYNOMIAL_C5][itype], Lookup[EOS_POLYNOMIAL_C6][itype], pInitial, dt, + pFinal, p_rate); - break; - default: - error->one(FLERR, "unknown EOS."); - break; - } + break; + default: + error->one(FLERR, "unknown EOS."); + break; + } } /* ---------------------------------------------------------------------- Compute stress deviator. Called from AssembleStress(). ------------------------------------------------------------------------- */ void PairTlsph::ComputeStressDeviator(const int i, const Matrix3d sigmaInitial_dev, const Matrix3d d_dev, Matrix3d &sigmaFinal_dev, - Matrix3d &sigma_dev_rate, double &plastic_strain_increment) { - double *eff_plastic_strain = atom->eff_plastic_strain; - double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; - int *type = atom->type; - double *rmass = atom->rmass; -//double *vfrac = atom->vfrac; - double *esph = atom->esph; - double dt = update->dt; - double yieldStress; - int itype; + Matrix3d &sigma_dev_rate, double &plastic_strain_increment) { + double *eff_plastic_strain = atom->eff_plastic_strain; + double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; + int *type = atom->type; + double *rmass = atom->rmass; + double *esph = atom->esph; + double dt = update->dt; + double yieldStress; + int itype; - double mass_specific_energy = esph[i] / rmass[i]; // energy per unit mass - plastic_strain_increment = 0.0; - itype = type[i]; + double mass_specific_energy = esph[i] / rmass[i]; // energy per unit mass + plastic_strain_increment = 0.0; + itype = type[i]; - switch (strengthModel[itype]) { - case STRENGTH_LINEAR: + switch (strengthModel[itype]) { + case STRENGTH_LINEAR: - sigma_dev_rate = 2.0 * Lookup[SHEAR_MODULUS][itype] * d_dev; - sigmaFinal_dev = sigmaInitial_dev + dt * sigma_dev_rate; + sigma_dev_rate = 2.0 * Lookup[SHEAR_MODULUS][itype] * d_dev; + sigmaFinal_dev = sigmaInitial_dev + dt * sigma_dev_rate; - break; - case LINEAR_DEFGRAD: + break; + case LINEAR_DEFGRAD: //LinearStrengthDefgrad(Lookup[LAME_LAMBDA][itype], Lookup[SHEAR_MODULUS][itype], Fincr[i], &sigmaFinal_dev); //eff_plastic_strain[i] = 0.0; //p_rate = pInitial - sigmaFinal_dev.trace() / 3.0; //sigma_dev_rate = sigmaInitial_dev - Deviator(sigmaFinal_dev); - error->one(FLERR, "LINEAR_DEFGRAD is only for debugging purposes and currently deactivated."); - R[i].setIdentity(); - break; - case STRENGTH_LINEAR_PLASTIC: + error->one(FLERR, "LINEAR_DEFGRAD is only for debugging purposes and currently deactivated."); + R[i].setIdentity(); + break; + case STRENGTH_LINEAR_PLASTIC: - yieldStress = Lookup[YIELD_STRESS][itype] + Lookup[HARDENING_PARAMETER][itype] * eff_plastic_strain[i]; - LinearPlasticStrength(Lookup[SHEAR_MODULUS][itype], yieldStress, sigmaInitial_dev, d_dev, dt, sigmaFinal_dev, - sigma_dev_rate, plastic_strain_increment); - break; - case STRENGTH_JOHNSON_COOK: - JohnsonCookStrength(Lookup[SHEAR_MODULUS][itype], Lookup[HEAT_CAPACITY][itype], mass_specific_energy, Lookup[JC_A][itype], - Lookup[JC_B][itype], Lookup[JC_a][itype], Lookup[JC_C][itype], Lookup[JC_epdot0][itype], Lookup[JC_T0][itype], - Lookup[JC_Tmelt][itype], Lookup[JC_M][itype], dt, eff_plastic_strain[i], eff_plastic_strain_rate[i], - sigmaInitial_dev, d_dev, sigmaFinal_dev, sigma_dev_rate, plastic_strain_increment); - break; - case STRENGTH_NONE: - sigmaFinal_dev.setZero(); - sigma_dev_rate.setZero(); - break; - default: - error->one(FLERR, "unknown strength model."); - break; - } + yieldStress = Lookup[YIELD_STRESS][itype] + Lookup[HARDENING_PARAMETER][itype] * eff_plastic_strain[i]; + LinearPlasticStrength(Lookup[SHEAR_MODULUS][itype], yieldStress, sigmaInitial_dev, d_dev, dt, sigmaFinal_dev, + sigma_dev_rate, plastic_strain_increment); + break; + case STRENGTH_JOHNSON_COOK: + JohnsonCookStrength(Lookup[SHEAR_MODULUS][itype], Lookup[HEAT_CAPACITY][itype], mass_specific_energy, Lookup[JC_A][itype], + Lookup[JC_B][itype], Lookup[JC_a][itype], Lookup[JC_C][itype], Lookup[JC_epdot0][itype], Lookup[JC_T0][itype], + Lookup[JC_Tmelt][itype], Lookup[JC_M][itype], dt, eff_plastic_strain[i], eff_plastic_strain_rate[i], + sigmaInitial_dev, d_dev, sigmaFinal_dev, sigma_dev_rate, plastic_strain_increment); + break; + case STRENGTH_NONE: + sigmaFinal_dev.setZero(); + sigma_dev_rate.setZero(); + break; + default: + error->one(FLERR, "unknown strength model."); + break; + } } @@ -2086,67 +1916,45 @@ void PairTlsph::ComputeStressDeviator(const int i, const Matrix3d sigmaInitial_d Compute damage. Called from AssembleStress(). ------------------------------------------------------------------------- */ void PairTlsph::ComputeDamage(const int i, const Matrix3d strain, const Matrix3d stress, Matrix3d &/*stress_damaged*/) { - double *eff_plastic_strain = atom->eff_plastic_strain; - double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; - double *radius = atom->radius; - double *damage = atom->damage; - int *type = atom->type; - int itype = type[i]; - double jc_failure_strain; -//double damage_gap, damage_rate; - Matrix3d eye, stress_deviator; + double *eff_plastic_strain = atom->eff_plastic_strain; + double *eff_plastic_strain_rate = atom->eff_plastic_strain_rate; + double *radius = atom->radius; + double *damage = atom->damage; + int *type = atom->type; + int itype = type[i]; + double jc_failure_strain; + Matrix3d eye, stress_deviator; - eye.setIdentity(); - stress_deviator = Deviator(stress); - double pressure = -stress.trace() / 3.0; + eye.setIdentity(); + stress_deviator = Deviator(stress); + double pressure = -stress.trace() / 3.0; - if (failureModel[itype].failure_max_principal_stress) { - error->one(FLERR, "not yet implemented"); - /* - * maximum stress failure criterion: - */ - IsotropicMaxStressDamage(stress, Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype]); - } else if (failureModel[itype].failure_max_principal_strain) { - error->one(FLERR, "not yet implemented"); - /* - * maximum strain failure criterion: - */ - IsotropicMaxStrainDamage(strain, Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype]); - } else if (failureModel[itype].failure_max_plastic_strain) { - if (eff_plastic_strain[i] >= Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype]) { - damage[i] = 1.0; - //double damage_gap = 0.5 * Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype]; - //damage[i] = (eff_plastic_strain[i] - Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype]) / damage_gap; - } - } else if (failureModel[itype].failure_johnson_cook) { + if (failureModel[itype].failure_max_principal_stress) { + error->one(FLERR, "not yet implemented"); + /* + * maximum stress failure criterion: + */ + IsotropicMaxStressDamage(stress, Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype]); + } else if (failureModel[itype].failure_max_principal_strain) { + error->one(FLERR, "not yet implemented"); + /* + * maximum strain failure criterion: + */ + IsotropicMaxStrainDamage(strain, Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype]); + } else if (failureModel[itype].failure_max_plastic_strain) { + if (eff_plastic_strain[i] >= Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype]) { + damage[i] = 1.0; + } + } else if (failureModel[itype].failure_johnson_cook) { - //cout << "this is stress deviator" << stress_deviator << endl; - - jc_failure_strain = JohnsonCookFailureStrain(pressure, stress_deviator, Lookup[FAILURE_JC_D1][itype], - Lookup[FAILURE_JC_D2][itype], Lookup[FAILURE_JC_D3][itype], Lookup[FAILURE_JC_D4][itype], - Lookup[FAILURE_JC_EPDOT0][itype], eff_plastic_strain_rate[i]); - - //cout << "plastic strain increment is " << plastic_strain_increment << " jc fs is " << jc_failure_strain << endl; - //printf("JC failure strain is: %f\n", jc_failure_strain); - - if (eff_plastic_strain[i] >= jc_failure_strain) { - double damage_rate = Lookup[SIGNAL_VELOCITY][itype] / (100.0 * radius[i]); - damage[i] += damage_rate * update->dt; - //damage[i] = 1.0; - } - } - - /* - * Apply damage to integration point - */ - -// damage[i] = MIN(damage[i], 0.8); -// -// if (pressure > 0.0) { // compression: particle can carry compressive load but reduced shear -// stress_damaged = -pressure * eye + (1.0 - damage[i]) * Deviator(stress); -// } else { // tension: particle has reduced tensile and shear load bearing capability -// stress_damaged = (1.0 - damage[i]) * (-pressure * eye + Deviator(stress)); -// } + jc_failure_strain = JohnsonCookFailureStrain(pressure, stress_deviator, Lookup[FAILURE_JC_D1][itype], + Lookup[FAILURE_JC_D2][itype], Lookup[FAILURE_JC_D3][itype], Lookup[FAILURE_JC_D4][itype], + Lookup[FAILURE_JC_EPDOT0][itype], eff_plastic_strain_rate[i]); + if (eff_plastic_strain[i] >= jc_failure_strain) { + double damage_rate = Lookup[SIGNAL_VELOCITY][itype] / (100.0 * radius[i]); + damage[i] += damage_rate * update->dt; + } + } } diff --git a/src/MANIFOLD/fix_manifoldforce.cpp b/src/MANIFOLD/fix_manifoldforce.cpp index 2968361e43..7542205f8f 100644 --- a/src/MANIFOLD/fix_manifoldforce.cpp +++ b/src/MANIFOLD/fix_manifoldforce.cpp @@ -124,11 +124,11 @@ void FixManifoldForce::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - int nlevels_respa = ((Respa *) update->integrate)->nlevels; + int nlevels_respa = (dynamic_cast( update->integrate))->nlevels; for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - ((Respa *) update->integrate)->copy_flevel_f(ilevel); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); } } } diff --git a/src/MANIFOLD/fix_nve_manifold_rattle.cpp b/src/MANIFOLD/fix_nve_manifold_rattle.cpp index e3c0024d57..f9a728cb73 100644 --- a/src/MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/MANIFOLD/fix_nve_manifold_rattle.cpp @@ -165,8 +165,8 @@ FixNVEManifoldRattle::~FixNVEManifoldRattle() } if (tvars ) delete [] tvars; - if (tstyle) delete [] tstyle; - if (is_var) delete [] is_var; + delete[] tstyle; + delete[] is_var; } @@ -537,13 +537,9 @@ void FixNVEManifoldRattle::rattle_manifold_x(double *x, double *v, // gg = ptr_m->g(x); } - if (iters >= max_iter && res > tolerance) { - char msg[2048]; - sprintf(msg,"Failed to constrain atom " TAGINT_FORMAT - " (x = (%f, %f, %f)! res = %e, iters = %d\n", - tagi, x[0], x[1], x[2], res, iters); - error->one(FLERR,msg); - } + if (iters >= max_iter && res > tolerance) + error->one(FLERR, "Failed to constrain atom {} (x = ({}, {}, {})! res = {}, iters = {}\n", + tagi, x[0], x[1], x[2], res, iters); // "sync" x and v: v[0] = vt[0] - l*no_dt[0]; @@ -631,13 +627,9 @@ void FixNVEManifoldRattle::rattle_manifold_v(double *v, double *f, ++iters; } while ((res > tolerance) && (iters < max_iter)); - if (iters >= max_iter && res >= tolerance) { - char msg[2048]; - sprintf(msg,"Failed to constrain atom " TAGINT_FORMAT - " (x = (%f, %f, %f)! res = %e, iters = %d\n", - tagi, x[0], x[1], x[2], res, iters); - error->all(FLERR,msg); - } + if (iters >= max_iter && res >= tolerance) + error->all(FLERR,"Failed to constrain atom {} (x = ({}, {}, {})! res = {}, iters = {}\n", + tagi, x[0], x[1], x[2], res, iters); stats.v_iters += iters; } diff --git a/src/MANIFOLD/fix_nvt_manifold_rattle.cpp b/src/MANIFOLD/fix_nvt_manifold_rattle.cpp index 0dcc233b54..6dbd211042 100644 --- a/src/MANIFOLD/fix_nvt_manifold_rattle.cpp +++ b/src/MANIFOLD/fix_nvt_manifold_rattle.cpp @@ -159,13 +159,13 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, FixNVTManifoldRattle::~FixNVTManifoldRattle() { // Deallocate heap-allocated objects. - if (eta) delete[] eta; - if (eta_dot) delete[] eta_dot; - if (eta_dotdot) delete[] eta_dotdot; - if (eta_mass) delete[] eta_mass; + delete[] eta; + delete[] eta_dot; + delete[] eta_dotdot; + delete[] eta_mass; modify->delete_compute(id_temp); - if (id_temp) delete[] id_temp; + delete[] id_temp; } int FixNVTManifoldRattle::setmask() diff --git a/src/MANIFOLD/manifold_thylakoid.cpp b/src/MANIFOLD/manifold_thylakoid.cpp index ca50bfc881..a6cded49aa 100644 --- a/src/MANIFOLD/manifold_thylakoid.cpp +++ b/src/MANIFOLD/manifold_thylakoid.cpp @@ -447,7 +447,7 @@ thyla_part *manifold_thylakoid::make_plane_part (double a, double b, double c, args[3] = pt[0]; args[4] = pt[1]; args[5] = pt[2]; - thyla_part *p = new thyla_part(thyla_part::THYLA_TYPE_PLANE,args,0,0,0,0,0,0); + auto p = new thyla_part(thyla_part::THYLA_TYPE_PLANE,args,0,0,0,0,0,0); return p; } @@ -462,7 +462,7 @@ thyla_part *manifold_thylakoid::make_cyl_part (double a, double b, double c, args[4] = pt[1]; args[5] = pt[2]; args[6] = R; - thyla_part *p = new thyla_part(thyla_part::THYLA_TYPE_CYL,args,0,0,0,0,0,0); + auto p = new thyla_part(thyla_part::THYLA_TYPE_CYL,args,0,0,0,0,0,0); return p; } @@ -474,7 +474,7 @@ thyla_part *manifold_thylakoid::make_sphere_part(const std::vector &pt, args[1] = pt[0]; args[2] = pt[1]; args[3] = pt[2]; - thyla_part *p = new thyla_part(thyla_part::THYLA_TYPE_SPHERE,args,0,0,0,0,0,0); + auto p = new thyla_part(thyla_part::THYLA_TYPE_SPHERE,args,0,0,0,0,0,0); return p; } @@ -490,6 +490,6 @@ thyla_part *manifold_thylakoid::make_cyl_to_plane_part(double X0, double R0, dou args[4] = pt[1]; args[5] = pt[2]; args[6] = s; - thyla_part *p = new thyla_part(thyla_part::THYLA_TYPE_CYL_TO_PLANE,args,0,0,0,0,0,0); + auto p = new thyla_part(thyla_part::THYLA_TYPE_CYL_TO_PLANE,args,0,0,0,0,0,0); return p; } diff --git a/src/MANYBODY/fix_qeq_comb.cpp b/src/MANYBODY/fix_qeq_comb.cpp index 16425d5d64..cf9441da1e 100644 --- a/src/MANYBODY/fix_qeq_comb.cpp +++ b/src/MANYBODY/fix_qeq_comb.cpp @@ -119,14 +119,14 @@ void FixQEQComb::init() if (!atom->q_flag) error->all(FLERR,"Fix qeq/comb requires atom attribute q"); - comb3 = (PairComb3 *) force->pair_match("^comb3",0); - if (!comb3) comb = (PairComb *) force->pair_match("^comb",0); + comb3 = dynamic_cast( force->pair_match("^comb3",0)); + if (!comb3) comb = dynamic_cast( force->pair_match("^comb",0)); if (comb == nullptr && comb3 == nullptr) error->all(FLERR,"Must use pair_style comb or comb3 with fix qeq/comb"); if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -154,9 +154,9 @@ void FixQEQComb::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } firstflag = 0; } diff --git a/src/MANYBODY/pair_eam_cd.cpp b/src/MANYBODY/pair_eam_cd.cpp index 67ecc581f9..e575a6643b 100644 --- a/src/MANYBODY/pair_eam_cd.cpp +++ b/src/MANYBODY/pair_eam_cd.cpp @@ -503,7 +503,7 @@ void PairEAMCD::read_h_coeff(char *filename) error->one(FLERR,"Failure to seek to end-of-file for reading h(x) coeffs: {}", utils::getsyserror()); - char *buf = new char[MAXLINE+1]; + auto buf = new char[MAXLINE+1]; auto rv = fread(buf,1,MAXLINE,fptr); if (rv == 0) error->one(FLERR,"Failure to read h(x) coeffs: {}", utils::getsyserror()); buf[rv] = '\0'; // must 0-terminate buffer for string processing diff --git a/src/MANYBODY/pair_meam_spline.cpp b/src/MANYBODY/pair_meam_spline.cpp index 033cce51b0..ab4f39bf15 100644 --- a/src/MANYBODY/pair_meam_spline.cpp +++ b/src/MANYBODY/pair_meam_spline.cpp @@ -665,7 +665,7 @@ void PairMEAMSpline::SplineFunction::prepareSpline() h = (xmax-xmin)/(N-1); hsq = h*h; - double* u = new double[N]; + auto u = new double[N]; Y2[0] = -0.5; u[0] = (3.0/(X[1]-X[0])) * ((Y[1]-Y[0])/(X[1]-X[0]) - deriv0); for (int i = 1; i <= N-2; i++) { diff --git a/src/MANYBODY/pair_meam_sw_spline.cpp b/src/MANYBODY/pair_meam_sw_spline.cpp index 164787a9a4..c744e8f002 100644 --- a/src/MANYBODY/pair_meam_sw_spline.cpp +++ b/src/MANYBODY/pair_meam_sw_spline.cpp @@ -546,7 +546,7 @@ void PairMEAMSWSpline::SplineFunction::prepareSpline() h = (xmax-xmin)/((double)(N-1)); hsq = h*h; - double* u = new double[N]; + auto u = new double[N]; Y2[0] = -0.5; u[0] = (3.0/(X[1]-X[0])) * ((Y[1]-Y[0])/(X[1]-X[0]) - deriv0); for (int i = 1; i <= N-2; i++) { diff --git a/src/MANYBODY/pair_polymorphic.cpp b/src/MANYBODY/pair_polymorphic.cpp index 21aba6d6df..cb7b3fe361 100644 --- a/src/MANYBODY/pair_polymorphic.cpp +++ b/src/MANYBODY/pair_polymorphic.cpp @@ -635,7 +635,7 @@ void PairPolymorphic::read_file(char *file) MPI_Bcast(pairParameters, npair*sizeof(PairParameters), MPI_BYTE, 0, world); // start reading tabular functions - double * singletable = new double[nr]; + auto singletable = new double[nr]; for (int i = 0; i < npair; i++) { // U PairParameters &p = pairParameters[i]; if (comm->me == 0) reader->next_dvector(singletable, nr); diff --git a/src/MANYBODY/pair_tersoff.h b/src/MANYBODY/pair_tersoff.h index b246c8260d..85edf26edc 100644 --- a/src/MANYBODY/pair_tersoff.h +++ b/src/MANYBODY/pair_tersoff.h @@ -38,7 +38,6 @@ class PairTersoff : public Pair { static constexpr int NPARAMS_PER_LINE = 17; - protected: struct Param { double lam1, lam2, lam3; double c, d, h; @@ -56,6 +55,7 @@ class PairTersoff : public Pair { double c0; // added for TersoffMODC }; + protected: Param *params; // parameter set for an I-J-K interaction double cutmax; // max cutoff for all elements int maxshort; // size of short neighbor list array diff --git a/src/MANYBODY/pair_vashishta_table.cpp b/src/MANYBODY/pair_vashishta_table.cpp index a39f2b90ec..8a46af69da 100644 --- a/src/MANYBODY/pair_vashishta_table.cpp +++ b/src/MANYBODY/pair_vashishta_table.cpp @@ -198,7 +198,7 @@ void PairVashishtaTable::twobody_table(const Param ¶m, double rsq, // use analytic form if rsq is inside inner cutoff if (rsq < tabinnersq) { - Param *pparam = const_cast (¶m); + auto pparam = const_cast (¶m); PairVashishta::twobody(pparam,rsq,fforce,eflag,eng); return; } diff --git a/src/MC/fix_atom_swap.cpp b/src/MC/fix_atom_swap.cpp index 9900f1aa26..690e628fe3 100644 --- a/src/MC/fix_atom_swap.cpp +++ b/src/MC/fix_atom_swap.cpp @@ -205,7 +205,7 @@ int FixAtomSwap::setmask() void FixAtomSwap::init() { - char *id_pe = (char *) "thermo_pe"; + auto id_pe = (char *) "thermo_pe"; int ipe = modify->find_compute(id_pe); c_pe = modify->compute[ipe]; @@ -804,7 +804,7 @@ void FixAtomSwap::write_restart(FILE *fp) void FixAtomSwap::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; seed = static_cast (list[n++]); random_equal->reset(seed); diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index 7e55cbd965..71408d8aed 100644 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -14,16 +14,20 @@ #include "fix_bond_break.h" -#include -#include "update.h" -#include "respa.h" #include "atom.h" -#include "force.h" #include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "modify.h" #include "neighbor.h" #include "random_mars.h" -#include "memory.h" -#include "error.h" +#include "respa.h" +#include "update.h" + +#include "fix_bond_history.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -145,7 +149,7 @@ int FixBondBreak::setmask() void FixBondBreak::init() { if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; // enable angle/dihedral/improper breaking if any defined @@ -157,15 +161,11 @@ void FixBondBreak::init() else improperflag = 0; if (force->improper) { - if (force->improper_match("class2") || force->improper_match("ring")) - error->all(FLERR,"Cannot yet use fix bond/break with this " - "improper style"); + if (force->improper_match("^class2") || force->improper_match("^ring")) + error->all(FLERR,"Cannot yet use fix bond/break with this improper style"); } lastcheck = -1; - - // DEBUG - //print_bb(); } /* ---------------------------------------------------------------------- */ @@ -261,6 +261,10 @@ void FixBondBreak::post_integrate() commflag = 1; comm->forward_comm(this,2); + // find instances of bond history to delete data + auto histories = modify->get_fix_by_style("BOND_HISTORY"); + int n_histories = histories.size(); + // break bonds // if both atoms list each other as winning bond partner // and probability constraint is satisfied @@ -295,7 +299,13 @@ void FixBondBreak::post_integrate() for (k = m; k < num_bond[i]-1; k++) { bond_atom[i][k] = bond_atom[i][k+1]; bond_type[i][k] = bond_type[i][k+1]; + if (n_histories > 0) + for (auto &ihistory: histories) + dynamic_cast(ihistory)->shift_history(i,k,k+1); } + if (n_histories > 0) + for (auto &ihistory: histories) + dynamic_cast(ihistory)->delete_history(i,num_bond[i]-1); num_bond[i]--; break; } @@ -790,50 +800,6 @@ void FixBondBreak::unpack_reverse_comm(int n, int *list, double *buf) } } - -/* ---------------------------------------------------------------------- */ - -void FixBondBreak::print_bb() -{ - for (int i = 0; i < atom->nlocal; i++) { - printf("TAG " TAGINT_FORMAT ": %d nbonds: ",atom->tag[i],atom->num_bond[i]); - for (int j = 0; j < atom->num_bond[i]; j++) { - printf(" " TAGINT_FORMAT, atom->bond_atom[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d nangles: ",atom->tag[i],atom->num_angle[i]); - for (int j = 0; j < atom->num_angle[i]; j++) { - printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT ",", - atom->angle_atom1[i][j],atom->angle_atom2[i][j], - atom->angle_atom3[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d ndihedrals: ",atom->tag[i],atom->num_dihedral[i]); - for (int j = 0; j < atom->num_dihedral[i]; j++) { - printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT ",", - atom->dihedral_atom1[i][j],atom->dihedral_atom2[i][j], - atom->dihedral_atom3[i][j],atom->dihedral_atom4[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d %d %d nspecial: ",atom->tag[i], - atom->nspecial[i][0],atom->nspecial[i][1],atom->nspecial[i][2]); - for (int j = 0; j < atom->nspecial[i][2]; j++) { - printf(" " TAGINT_FORMAT, atom->special[i][j]); - } - printf("\n"); - } -} - -/* ---------------------------------------------------------------------- */ - -void FixBondBreak::print_copy(const char *str, tagint m, - int n1, int n2, int n3, int *v) -{ - printf("%s " TAGINT_FORMAT ": %d %d %d nspecial: ",str,m,n1,n2,n3); - for (int j = 0; j < n3; j++) printf(" %d",v[j]); - printf("\n"); -} - /* ---------------------------------------------------------------------- */ double FixBondBreak::compute_vector(int n) diff --git a/src/MC/fix_bond_break.h b/src/MC/fix_bond_break.h index f470adcce0..52b3c84725 100644 --- a/src/MC/fix_bond_break.h +++ b/src/MC/fix_bond_break.h @@ -71,11 +71,6 @@ class FixBondBreak : public Fix { void break_impropers(int, tagint, tagint); void rebuild_special_one(int); int dedup(int, int, tagint *); - - // DEBUG - - void print_bb(); - void print_copy(const char *, tagint, int, int, int, int *); }; } // namespace LAMMPS_NS diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index c05a37cb38..2550e881d6 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -235,7 +235,7 @@ int FixBondCreate::setmask() void FixBondCreate::init() { if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; // check cutoff for iatomtype,jatomtype @@ -621,9 +621,6 @@ void FixBondCreate::post_integrate() // also add angles/dihedrals/impropers induced by created bonds update_topology(); - - // DEBUG - //print_bb(); } /* ---------------------------------------------------------------------- @@ -685,11 +682,6 @@ void FixBondCreate::update_topology() nimpropers = 0; overflow = 0; - //printf("NCREATE %d: ",ncreate); - //for (i = 0; i < ncreate; i++) - // printf(" %d %d,",created[i][0],created[i][1]); - //printf("\n"); - for (i = 0; i < nlocal; i++) { influenced = 0; slist = special[i]; @@ -1439,54 +1431,3 @@ double FixBondCreate::memory_usage() return bytes; } -/* ---------------------------------------------------------------------- */ - -void FixBondCreate::print_bb() -{ - for (int i = 0; i < atom->nlocal; i++) { - printf("TAG " TAGINT_FORMAT ": %d nbonds: ",atom->tag[i],atom->num_bond[i]); - for (int j = 0; j < atom->num_bond[i]; j++) { - printf(" " TAGINT_FORMAT,atom->bond_atom[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d nangles: ",atom->tag[i],atom->num_angle[i]); - for (int j = 0; j < atom->num_angle[i]; j++) { - printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT ",", - atom->angle_atom1[i][j], atom->angle_atom2[i][j], - atom->angle_atom3[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d ndihedrals: ",atom->tag[i],atom->num_dihedral[i]); - for (int j = 0; j < atom->num_dihedral[i]; j++) { - printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " - TAGINT_FORMAT ",", atom->dihedral_atom1[i][j], - atom->dihedral_atom2[i][j],atom->dihedral_atom3[i][j], - atom->dihedral_atom4[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d nimpropers: ",atom->tag[i],atom->num_improper[i]); - for (int j = 0; j < atom->num_improper[i]; j++) { - printf(" " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " - TAGINT_FORMAT ",",atom->improper_atom1[i][j], - atom->improper_atom2[i][j],atom->improper_atom3[i][j], - atom->improper_atom4[i][j]); - } - printf("\n"); - printf("TAG " TAGINT_FORMAT ": %d %d %d nspecial: ",atom->tag[i], - atom->nspecial[i][0],atom->nspecial[i][1],atom->nspecial[i][2]); - for (int j = 0; j < atom->nspecial[i][2]; j++) { - printf(" " TAGINT_FORMAT,atom->special[i][j]); - } - printf("\n"); - } -} - -/* ---------------------------------------------------------------------- */ - -void FixBondCreate::print_copy(const char *str, tagint m, - int n1, int n2, int n3, int *v) -{ - printf("%s " TAGINT_FORMAT ": %d %d %d nspecial: ",str,m,n1,n2,n3); - for (int j = 0; j < n3; j++) printf(" %d",v[j]); - printf("\n"); -} diff --git a/src/MC/fix_bond_create.h b/src/MC/fix_bond_create.h index 26505a5906..339094c8ef 100644 --- a/src/MC/fix_bond_create.h +++ b/src/MC/fix_bond_create.h @@ -88,11 +88,6 @@ class FixBondCreate : public Fix { int dedup(int, int, tagint *); virtual int constrain(int, int, double, double) { return 1; } - - // DEBUG - - void print_bb(); - void print_copy(const char *, tagint, int, int, int, int *); }; } // namespace LAMMPS_NS diff --git a/src/MC/fix_bond_create_angle.cpp b/src/MC/fix_bond_create_angle.cpp index 3ebda59f0d..f3014a4b07 100644 --- a/src/MC/fix_bond_create_angle.cpp +++ b/src/MC/fix_bond_create_angle.cpp @@ -17,21 +17,15 @@ ------------------------------------------------------------------------- */ #include "fix_bond_create_angle.h" + #include "atom.h" + #include using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -FixBondCreateAngle::FixBondCreateAngle(LAMMPS *lmp, int narg, char **arg) : - FixBondCreate(lmp, narg, arg) -{ - -} - -/* ---------------------------------------------------------------------- */ - int FixBondCreateAngle::constrain(int i, int j, double amin, double amax) { double **x = atom->x; diff --git a/src/MC/fix_bond_create_angle.h b/src/MC/fix_bond_create_angle.h index 6c74f0e6d7..ae3d6afa97 100644 --- a/src/MC/fix_bond_create_angle.h +++ b/src/MC/fix_bond_create_angle.h @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixBondCreateAngle : public FixBondCreate { public: - FixBondCreateAngle(class LAMMPS *, int, char **); + FixBondCreateAngle(LAMMPS *_lmp, int narg, char **arg) : FixBondCreate(_lmp, narg, arg) {} private: int constrain(int, int, double, double) override; diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp index c4abf31f16..59fabc8ffe 100644 --- a/src/MC/fix_bond_swap.cpp +++ b/src/MC/fix_bond_swap.cpp @@ -22,6 +22,7 @@ #include "compute.h" #include "domain.h" #include "error.h" +#include "fix_bond_history.h" #include "force.h" #include "memory.h" #include "modify.h" @@ -446,6 +447,10 @@ void FixBondSwap::post_integrate() if (!accept) return; naccept++; + // find instances of bond/history to reset history + auto histories = modify->get_fix_by_style("BOND_HISTORY"); + int n_histories = histories.size(); + // change bond partners of affected atoms // on atom i: bond i-inext changes to i-jnext // on atom j: bond j-jnext changes to j-inext @@ -453,13 +458,33 @@ void FixBondSwap::post_integrate() // on atom jnext: bond jnext-j changes to jnext-i for (ibond = 0; ibond < num_bond[i]; ibond++) - if (bond_atom[i][ibond] == tag[inext]) bond_atom[i][ibond] = tag[jnext]; + if (bond_atom[i][ibond] == tag[inext]) { + if (n_histories > 0) + for (auto &ihistory: histories) + dynamic_cast(ihistory)->delete_history(i,ibond); + bond_atom[i][ibond] = tag[jnext]; + } for (jbond = 0; jbond < num_bond[j]; jbond++) - if (bond_atom[j][jbond] == tag[jnext]) bond_atom[j][jbond] = tag[inext]; + if (bond_atom[j][jbond] == tag[jnext]) { + if (n_histories > 0) + for (auto &ihistory: histories) + dynamic_cast(ihistory)->delete_history(j,jbond); + bond_atom[j][jbond] = tag[inext]; + } for (ibond = 0; ibond < num_bond[inext]; ibond++) - if (bond_atom[inext][ibond] == tag[i]) bond_atom[inext][ibond] = tag[j]; + if (bond_atom[inext][ibond] == tag[i]) { + if (n_histories > 0) + for (auto &ihistory: histories) + dynamic_cast(ihistory)->delete_history(inext,ibond); + bond_atom[inext][ibond] = tag[j]; + } for (jbond = 0; jbond < num_bond[jnext]; jbond++) - if (bond_atom[jnext][jbond] == tag[j]) bond_atom[jnext][jbond] = tag[i]; + if (bond_atom[jnext][jbond] == tag[j]) { + if (n_histories > 0) + for (auto &ihistory: histories) + dynamic_cast(ihistory)->delete_history(jnext,jbond); + bond_atom[jnext][jbond] = tag[i]; + } // set global tags of 4 atoms in bonds diff --git a/src/MC/fix_charge_regulation.cpp b/src/MC/fix_charge_regulation.cpp index 344e950847..a5a2eaff82 100644 --- a/src/MC/fix_charge_regulation.cpp +++ b/src/MC/fix_charge_regulation.cpp @@ -1232,7 +1232,7 @@ void FixChargeRegulation::write_restart(FILE *fp) void FixChargeRegulation::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; seed = static_cast (list[n++]); random_equal->reset(seed); diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index 1d411c19a7..6937b90202 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -1324,7 +1324,7 @@ void FixGCMC::attempt_molecule_insertion() MathExtra::quat_to_mat(quat,rotmat); double insertion_energy = 0.0; - bool *procflag = new bool[natoms_per_molecule]; + auto procflag = new bool[natoms_per_molecule]; for (int i = 0; i < natoms_per_molecule; i++) { MathExtra::matvec(rotmat,onemols[imol]->x[i],molcoords[i]); @@ -2416,9 +2416,9 @@ void FixGCMC::update_gas_atoms_list() for (int i = 0; i < nlocal; i++) maxmol = MAX(maxmol,molecule[i]); tagint maxmol_all; MPI_Allreduce(&maxmol,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world); - double *comx = new double[maxmol_all]; - double *comy = new double[maxmol_all]; - double *comz = new double[maxmol_all]; + auto comx = new double[maxmol_all]; + auto comy = new double[maxmol_all]; + auto comz = new double[maxmol_all]; for (int imolecule = 0; imolecule < maxmol_all; imolecule++) { for (int i = 0; i < nlocal; i++) { if (molecule[i] == imolecule) { @@ -2538,7 +2538,7 @@ void FixGCMC::write_restart(FILE *fp) void FixGCMC::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; seed = static_cast (list[n++]); random_equal->reset(seed); diff --git a/src/MC/fix_mol_swap.cpp b/src/MC/fix_mol_swap.cpp index a8c7b4ddb2..c93f0093a8 100644 --- a/src/MC/fix_mol_swap.cpp +++ b/src/MC/fix_mol_swap.cpp @@ -138,7 +138,7 @@ void FixMolSwap::init() { // c_pe = compute used to calculate before/after potential energy - char *id_pe = (char *) "thermo_pe"; + auto id_pe = (char *) "thermo_pe"; int ipe = modify->find_compute(id_pe); c_pe = modify->compute[ipe]; @@ -487,7 +487,7 @@ void FixMolSwap::write_restart(FILE *fp) void FixMolSwap::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; seed = static_cast (list[n++]); random->reset(seed); diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index e2989f8981..bb20313ea8 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -619,7 +619,7 @@ void FixWidom::attempt_molecule_insertion() MathExtra::quat_to_mat(quat,rotmat); double insertion_energy = 0.0; - bool *procflag = new bool[natoms_per_molecule]; + auto procflag = new bool[natoms_per_molecule]; for (int i = 0; i < natoms_per_molecule; i++) { MathExtra::matvec(rotmat,onemols[imol]->x[i],molcoords[i]); @@ -1089,9 +1089,9 @@ void FixWidom::update_gas_atoms_list() for (int i = 0; i < nlocal; i++) maxmol = MAX(maxmol,molecule[i]); tagint maxmol_all; MPI_Allreduce(&maxmol,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world); - double *comx = new double[maxmol_all]; - double *comy = new double[maxmol_all]; - double *comz = new double[maxmol_all]; + auto comx = new double[maxmol_all]; + auto comy = new double[maxmol_all]; + auto comz = new double[maxmol_all]; for (int imolecule = 0; imolecule < maxmol_all; imolecule++) { for (int i = 0; i < nlocal; i++) { if (molecule[i] == imolecule) { @@ -1195,7 +1195,7 @@ void FixWidom::write_restart(FILE *fp) void FixWidom::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; seed = static_cast (list[n++]); random_equal->reset(seed); diff --git a/src/MDI/README b/src/MDI/README index cad9ae3f39..7669b94780 100644 --- a/src/MDI/README +++ b/src/MDI/README @@ -8,16 +8,15 @@ developed and maintained by Taylor Barnes (tbarnes1@vt.edu) at the Molecular Sciences Software Institute (MolSSI). For more information about using MDI with LAMMPS, see the LAMMPS -documentation for the mdi/engine command and the mdi/engine fix. -For general purpose information about MDI, see the MDI Library -documentation: +documentation for Howto_mdi in the Howto section. For general purpose +information about MDI, see the MDI Library documentation: https://molssi-mdi.github.io/MDI_Library/html/index.html The MDI Library is required in order to use this package, and can be -built using the Install.py file in lib/mdi. For example: +built using the Install.py file in lib/mdi as explained in +lib/mdi/README. For example: -python Install.py -m gcc -python Install.py -m icc +python Install.py -m When using CMake to build LAMMPS the CMake configuration can use either a preinstalled MDI library or download and compile a diff --git a/src/MDI/fix_mdi_aimd.cpp b/src/MDI/fix_mdi_aimd.cpp new file mode 100644 index 0000000000..c878d183d3 --- /dev/null +++ b/src/MDI/fix_mdi_aimd.cpp @@ -0,0 +1,379 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/ 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 "fix_mdi_aimd.h" +#include "atom.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "update.h" + +using namespace LAMMPS_NS; +using namespace FixConst; + +enum { NATIVE, REAL, METAL }; // LAMMPS units which MDI supports + +/* ---------------------------------------------------------------------- */ + +FixMDIAimd::FixMDIAimd(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) +{ + if (narg != 3) error->all(FLERR, "Illegal fix mdi/aimd command"); + + scalar_flag = 1; + global_freq = 1; + extscalar = 1; + energy_global_flag = 1; + virial_global_flag = 1; + thermo_energy = thermo_virial = 1; + + // check requirements for LAMMPS to work with MDI as an engine + + if (atom->tag_enable == 0) error->all(FLERR, "Cannot use MDI engine without atom IDs"); + + if (atom->natoms && atom->tag_consecutive() == 0) + error->all(FLERR, "MDI engine requires consecutive atom IDs"); + + // confirm LAMMPS is being run as a driver + + int role; + MDI_Get_role(&role); + if (role != MDI_DRIVER) + error->all(FLERR, "Must invoke LAMMPS as an MDI driver to use fix mdi/aimd"); + + // mdicomm will be one-time initialized in init() + // cannot be done here for a plugin library, b/c mdi plugin command is later + + mdicomm = MDI_COMM_NULL; + + // storage for all atoms + + buf3 = buf3all = nullptr; + maxbuf = 0; + + // set unit conversion factors + + if (strcmp(update->unit_style, "real") == 0) + lmpunits = REAL; + else if (strcmp(update->unit_style, "metal") == 0) + lmpunits = METAL; + else + lmpunits = NATIVE; + + unit_conversions(); + + nprocs = comm->nprocs; +} + +/* ---------------------------------------------------------------------- */ + +FixMDIAimd::~FixMDIAimd() +{ + // send exit command to engine if it is a stand-alone code + // for plugin, this happens in MDIPlugin::plugin_wrapper() + + if (!plugin) { + int ierr = MDI_Send_command("EXIT", mdicomm); + if (ierr) error->all(FLERR, "MDI: EXIT command"); + } + + // clean up + + memory->destroy(buf3); + memory->destroy(buf3all); +} + +/* ---------------------------------------------------------------------- */ + +int FixMDIAimd::setmask() +{ + int mask = 0; + mask |= PRE_REVERSE; + mask |= POST_FORCE; + mask |= MIN_POST_FORCE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIAimd::init() +{ + if (mdicomm != MDI_COMM_NULL) return; + + // one-time auto-detect whether engine is stand-alone code or plugin library + // also initializes mdicomm + // plugin = 0/1 for engine = stand-alone code vs plugin library + + MDI_Get_communicator(&mdicomm, 0); + + if (mdicomm == MDI_COMM_NULL) { + plugin = 0; + MDI_Accept_communicator(&mdicomm); + if (mdicomm == MDI_COMM_NULL) error->all(FLERR, "MDI unable to connect to stand-alone engine"); + } else { + plugin = 1; + int method; + MDI_Get_method(&method, mdicomm); + if (method != MDI_PLUGIN) error->all(FLERR, "MDI internal error for plugin engine"); + } +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIAimd::setup(int vflag) +{ + post_force(vflag); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIAimd::setup_pre_reverse(int eflag, int vflag) +{ + pre_reverse(eflag, vflag); +} + +/* ---------------------------------------------------------------------- + store eflag, so can use it in post_force to request energy +------------------------------------------------------------------------- */ + +void FixMDIAimd::pre_reverse(int eflag, int /*vflag*/) +{ + eflag_caller = eflag; +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIAimd::post_force(int vflag) +{ + int ilocal, ierr; + double cell[9]; + + int eflag = eflag_caller; + ev_init(eflag, vflag); + + // if simulation box dynamically changes, send current box to MDI engine + + if (domain->box_change_size || domain->box_change_shape) { + ierr = MDI_Send_command(">CELL_DISPL", mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL_DISPL command"); + cell[0] = domain->boxlo[0] * lmp2mdi_length; + cell[1] = domain->boxlo[1] * lmp2mdi_length; + cell[2] = domain->boxlo[2] * lmp2mdi_length; + ierr = MDI_Send(cell, 3, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL_DISPL data"); + + ierr = MDI_Send_command(">CELL", mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL command"); + cell[0] = domain->boxhi[0] - domain->boxlo[0]; + cell[1] = 0.0; + cell[2] = 0.0; + cell[3] = domain->xy; + cell[4] = domain->boxhi[1] - domain->boxlo[1]; + cell[5] = 0.0; + cell[6] = domain->xz; + cell[7] = domain->yz; + cell[8] = domain->boxhi[2] - domain->boxlo[2]; + ierr = MDI_Send(cell, 9, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL data"); + } + + // gather all coords, ordered by atomID + + reallocate(); + memset(buf3, 0, 3 * atom->natoms * sizeof(double)); + + double **x = atom->x; + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + buf3[3 * ilocal + 0] = x[i][0] * lmp2mdi_length; + buf3[3 * ilocal + 1] = x[i][1] * lmp2mdi_length; + buf3[3 * ilocal + 2] = x[i][2] * lmp2mdi_length; + } + + MPI_Reduce(buf3, buf3all, 3 * atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); + + // send current coords to MDI engine + + ierr = MDI_Send_command(">COORDS", mdicomm); + if (ierr) error->all(FLERR, "MDI: >COORDS command"); + ierr = MDI_Send(buf3all, 3 * atom->natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >COORDS data"); + + // request forces from MDI engine + // this triggers engine to evaluate forces,energy,stress for current system + + ierr = MDI_Send_command("all(FLERR, "MDI: natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: natoms, MPI_DOUBLE, 0, world); + + // add forces to owned atoms + // use atomID to index into ordered buf3 + + double **f = atom->f; + + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + f[i][0] += buf3[3 * ilocal + 0] * mdi2lmp_force; + f[i][1] += buf3[3 * ilocal + 1] * mdi2lmp_force; + f[i][2] += buf3[3 * ilocal + 2] * mdi2lmp_force; + } + + // optionally request potential energy from MDI engine + + if (eflag_global) { + ierr = MDI_Send_command("all(FLERR, "MDI: all(FLERR, "MDI: all(FLERR, "MDI: all(FLERR, "MDI: xprd * domain->yprd * domain->zprd; + for (int i = 0; i < 6; i++) { + ptensor[i] *= mdi2lmp_pressure; + virial[i] = ptensor[i] * volume / force->nktv2p / nprocs; + } + } +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIAimd::min_post_force(int vflag) +{ + post_force(vflag); +} + +/* ---------------------------------------------------------------------- + energy from MDI engine +------------------------------------------------------------------------- */ + +double FixMDIAimd::compute_scalar() +{ + return engine_energy; +} + +/* ---------------------------------------------------------------------- + reallocate storage for all atoms if necessary +------------------------------------------------------------------------- */ + +void FixMDIAimd::reallocate() +{ + if (atom->natoms <= maxbuf) return; + + if (3 * atom->natoms > MAXSMALLINT) + error->all(FLERR, "Natoms too large to use with fix mdi/aimd"); + + maxbuf = atom->natoms; + + memory->destroy(buf3); + memory->destroy(buf3all); + + memory->create(buf3, 3 * maxbuf, "mdi:buf3"); + memory->create(buf3all, 3 * maxbuf, "mdi:buf3all"); +} + +/* ---------------------------------------------------------------------- + MDI to/from LAMMPS conversion factors +------------------------------------------------------------------------- */ + +void FixMDIAimd::unit_conversions() +{ + double angstrom_to_bohr, kelvin_to_hartree, ev_to_hartree, second_to_aut; + + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); + MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); + MDI_Conversion_Factor("second", "atomic_unit_of_time", &second_to_aut); + + // length units + + mdi2lmp_length = 1.0; + lmp2mdi_length = 1.0; + + if (lmpunits == REAL || lmpunits == METAL) { + lmp2mdi_length = angstrom_to_bohr; + mdi2lmp_length = 1.0 / angstrom_to_bohr; + } + + // energy units + + mdi2lmp_energy = 1.0; + lmp2mdi_energy = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_energy = kelvin_to_hartree / force->boltz; + mdi2lmp_energy = force->boltz / kelvin_to_hartree; + } else if (lmpunits == METAL) { + lmp2mdi_energy = ev_to_hartree; + mdi2lmp_energy = 1.0 / ev_to_hartree; + } + + // force units = energy/length + + mdi2lmp_force = 1.0; + lmp2mdi_force = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_force = (kelvin_to_hartree / force->boltz) / angstrom_to_bohr; + mdi2lmp_force = 1.0 / lmp2mdi_force; + } else if (lmpunits == METAL) { + lmp2mdi_force = ev_to_hartree / angstrom_to_bohr; + mdi2lmp_force = angstrom_to_bohr / ev_to_hartree; + } + + // pressure or stress units = force/area = energy/volume + + mdi2lmp_pressure = 1.0; + lmp2mdi_pressure = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_pressure = (kelvin_to_hartree / force->boltz) / + (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; + mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; + } else if (lmpunits == METAL) { + lmp2mdi_pressure = + ev_to_hartree / (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; + mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; + } + + // velocity units = distance/time + + mdi2lmp_velocity = 1.0; + lmp2mdi_velocity = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_velocity = angstrom_to_bohr / (1.0e-15 * second_to_aut); + mdi2lmp_velocity = 1.0 / lmp2mdi_velocity; + } else if (lmpunits == METAL) { + lmp2mdi_velocity = angstrom_to_bohr / (1.0e-12 * second_to_aut); + mdi2lmp_velocity = 1.0 / lmp2mdi_velocity; + } +} diff --git a/src/MDI/fix_mdi_aimd.h b/src/MDI/fix_mdi_aimd.h new file mode 100644 index 0000000000..7d408b414f --- /dev/null +++ b/src/MDI/fix_mdi_aimd.h @@ -0,0 +1,78 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/ Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS +// clang-format off +FixStyle(mdi/aimd,FixMDIAimd); +// clang-format on +#else + +#ifndef LMP_FIX_MDI_AIMD_H +#define LMP_FIX_MDI_AIMD_H + +#include "fix.h" +#include + +namespace LAMMPS_NS { + +class FixMDIAimd : public Fix { + public: + FixMDIAimd(class LAMMPS *, int, char **); + ~FixMDIAimd(); + int setmask(); + + void init(); + void setup(int); + void setup_pre_reverse(int, int); + void pre_reverse(int, int); + void post_force(int); + void min_post_force(int); + double compute_scalar(); + + private: + int nprocs; + int plugin; + + MDI_Comm mdicomm; + + int eflag_caller; + double engine_energy; + int lmpunits; + + // unit conversion factors + + double lmp2mdi_length, mdi2lmp_length; + double lmp2mdi_energy, mdi2lmp_energy; + double lmp2mdi_force, mdi2lmp_force; + double lmp2mdi_pressure, mdi2lmp_pressure; + double lmp2mdi_velocity, mdi2lmp_velocity; + + // buffers for MDI comm + + int maxbuf; + double *buf3, *buf3all; + + // methods + + void reallocate(); + void unit_conversions(); +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +*/ diff --git a/src/MDI/fix_mdi_engine.cpp b/src/MDI/fix_mdi_engine.cpp index b08209080a..e68b9b54b4 100644 --- a/src/MDI/fix_mdi_engine.cpp +++ b/src/MDI/fix_mdi_engine.cpp @@ -17,96 +17,20 @@ ------------------------------------------------------------------------- */ #include "fix_mdi_engine.h" -#include "library_mdi.h" -#include "atom.h" -#include "comm.h" -#include "compute.h" -#include "domain.h" #include "error.h" -#include "force.h" -#include "integrate.h" -#include "irregular.h" -#include "memory.h" -#include "modify.h" #include "update.h" -#include -#include -#include - -enum { NONE, REAL, METAL }; // LAMMPS units which MDI supports +#include "mdi_engine.h" using namespace LAMMPS_NS; using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixMDIEngine::FixMDIEngine(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_pe(nullptr), id_ke(nullptr), pe(nullptr), ke(nullptr) +FixMDIEngine::FixMDIEngine(LAMMPS *_lmp, int narg, char **arg) : Fix(_lmp, narg, arg) { - if (narg != 3) error->all(FLERR, "Illegal fix mdi command"); - - // The 2 atomic-scale units LAMMPS has are: - // real: coords = Ang, eng = Kcal/mole, force = Kcal/mole/Ang - // metal: coords = Ang, eng = eV, force = eV/Ang - - lmpunits = NONE; - if (strcmp(update->unit_style, "real") == 0) lmpunits = REAL; - if (strcmp(update->unit_style, "metal") == 0) lmpunits = METAL; - if (lmpunits == NONE) error->all(FLERR, "MDI requires real or metal units"); - - // MDI setup - - most_recent_init = 0; - exit_flag = false; - local_exit_flag = false; - target_command = new char[MDI_COMMAND_LENGTH + 1]; - command = new char[MDI_COMMAND_LENGTH + 1]; - current_node = new char[MDI_COMMAND_LENGTH]; - target_node = new char[MDI_COMMAND_LENGTH]; - strncpy(target_node, "\0", MDI_COMMAND_LENGTH); - strncpy(current_node, "@DEFAULT", MDI_COMMAND_LENGTH); - - // register the execute_command function with MDI - - MDI_Set_execute_command_func(lammps_execute_mdi_command, this); - - // accept a communicator to the driver - // master = 1 for proc 0, otherwise 0 - - master = (comm->me == 0) ? 1 : 0; - - MDI_Accept_communicator(&driver_socket); - if (driver_socket <= 0) error->all(FLERR, "Unable to connect to driver"); - - // create computes for KE and PE - - id_pe = utils::strdup(std::string(id) + "_pe"); - modify->add_compute(fmt::format("{} all pe", id_pe)); - - id_ke = utils::strdup(std::string(id) + "_ke"); - modify->add_compute(fmt::format("{} all ke", id_ke)); - - // irregular class and data structs used by MDI - - irregular = new Irregular(lmp); - add_force = nullptr; -} - -/* ---------------------------------------------------------------------- */ - -FixMDIEngine::~FixMDIEngine() -{ - delete[] target_command; - delete[] command; - delete[] current_node; - delete[] target_node; - - modify->delete_compute(id_pe); - modify->delete_compute(id_ke); - delete irregular; - memory->destroy(add_force); + if (narg != 3) error->all(FLERR, "Illegal fix mdi/engine command"); } /* ---------------------------------------------------------------------- */ @@ -114,840 +38,64 @@ FixMDIEngine::~FixMDIEngine() int FixMDIEngine::setmask() { int mask = 0; - mask |= POST_INTEGRATE; mask |= POST_FORCE; mask |= MIN_PRE_FORCE; mask |= MIN_POST_FORCE; - + mask |= END_OF_STEP; return mask; } /* ---------------------------------------------------------------------- */ -void FixMDIEngine::exchange_forces() +void FixMDIEngine::setup(int /*vflag*/) { - double **f = atom->f; - const int *const mask = atom->mask; - const int nlocal = atom->nlocal; + // engine is now at FORCES node - // add forces from the driver - - for (int i = 0; i < nlocal; ++i) { - if (mask[i] & groupbit) { - f[i][0] += add_force[3 * (atom->tag[i] - 1) + 0]; - f[i][1] += add_force[3 * (atom->tag[i] - 1) + 1]; - f[i][2] += add_force[3 * (atom->tag[i] - 1) + 2]; - } - } -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::init() -{ - // confirm that two required computes are still available - - int icompute_pe = modify->find_compute(id_pe); - if (icompute_pe < 0) error->all(FLERR, "Potential energy ID for fix mdi/engine does not exist"); - int icompute_ke = modify->find_compute(id_ke); - if (icompute_pe < 0) error->all(FLERR, "Kinetic energy ID for fix mdi/engine does not exist"); - - pe = modify->compute[icompute_pe]; - ke = modify->compute[icompute_ke]; - - // one-time allocation of add_force array - - if (!add_force) { - int64_t ncoords = 3 * atom->natoms; - memory->create(add_force, ncoords, "mdi/engine:add_force"); - for (int64_t i = 0; i < ncoords; i++) add_force[i] = 0.0; - } -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::min_setup(int /* vflag */) -{ - engine_mode("@FORCES"); + mdi_engine->engine_node("@FORCES"); } /* ---------------------------------------------------------------------- */ void FixMDIEngine::post_integrate() { - engine_mode("@COORDS"); + // engine is now at COORDS node for MD + + mdi_engine->engine_node("@COORDS"); } /* ---------------------------------------------------------------------- */ -void FixMDIEngine::min_pre_force(int /* vflag */) +void FixMDIEngine::min_pre_force(int /*vflag*/) { - engine_mode("@COORDS"); + // engine is now at COORDS node for minimizer + + mdi_engine->engine_node("@COORDS"); } /* ---------------------------------------------------------------------- */ -void FixMDIEngine::min_post_force(int /* vflag */) +void FixMDIEngine::post_force(int /*vflag*/) { - engine_mode("@FORCES"); + // engine is now at FORCES node for MD + + mdi_engine->engine_node("@FORCES"); } /* ---------------------------------------------------------------------- */ -void FixMDIEngine::post_force(int /* vflag */) +void FixMDIEngine::min_post_force(int /*vflag*/) { - if (most_recent_init == 1) - engine_mode("@FORCES"); - else if (most_recent_init == 2) - engine_mode("@FORCES"); -} + // engine is now at FORCES node for minimizer -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- -// rest of file processes and responds to MDI driver commands -// ---------------------------------------------------------------------- -// ---------------------------------------------------------------------- - -/* ---------------------------------------------------------------------- - process a single command from driver ----------------------------------------------------------------------- */ - -int FixMDIEngine::execute_command(const char *command, MDI_Comm mdicomm) -{ - // confirm this command is supported at this node - - int command_exists = 1; - if (master) { - ierr = MDI_Check_command_exists(current_node, command, MDI_COMM_NULL, &command_exists); - } - if (ierr != 0) error->all(FLERR, "MDI: Unable to check whether current command is supported"); - if (command_exists != 1) - error->all(FLERR, "MDI: Received a command that is unsupported at current node"); - - // respond to any driver command - - if (strcmp(command, ">NATOMS") == 0) { - int64_t mdi_natoms = 0; - ierr = MDI_Recv((char *) &mdi_natoms, 1, MDI_INT64_T, mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: Unable to receive number of atoms from driver"); - error->all(FLERR, "MDI: '>NATOMS' driver command not (yet) supported"); - // FIXME: to import the number of atoms, more steps than below are needed for LAMMPS. - // also a check for overflow is needed in case natoms is 32-bit - atom->natoms = mdi_natoms; - MPI_Bcast(&atom->natoms, 1, MPI_LMP_BIGINT, 0, world); - - } else if (strcmp(command, "natoms; - ierr = MDI_Send((char *) &mdi_natoms, 1, MDI_INT64_T, mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send number of atoms to driver"); - - } else if (strcmp(command, "ntypes, 1, MDI_INT, mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send number of atom types to driver"); - - } else if (strcmp(command, "CELL") == 0) { - receive_cell(error); - - } else if (strcmp(command, "CELL_DISPL") == 0) { - receive_celldispl(error); - - } else if (strcmp(command, ">COORDS") == 0) { - receive_coordinates(error); - - } else if (strcmp(command, "FORCES") == 0) { - receive_forces(error, 0); - - // add forces received from the driver to current forces - - } else if (strcmp(command, ">+FORCES") == 0) { - receive_forces(error, 1); - - // initialize new MD simulation or minimization - // return control to return to mdi/engine - - } else if (strcmp(command, "@INIT_MD") == 0) { - if (most_recent_init != 0) error->all(FLERR, "MDI: MDI is already performing a simulation"); - most_recent_init = 1; - local_exit_flag = true; - - // initialize new energy minimization - // return control to return to mdi/engine - - } else if (strcmp(command, "@INIT_OPTG") == 0) { - if (most_recent_init != 0) error->all(FLERR, "MDI: MDI is already performing a simulation"); - most_recent_init = 2; - local_exit_flag = true; - - } else if (strcmp(command, "@") == 0) { - strncpy(target_node, "\0", MDI_COMMAND_LENGTH); - local_exit_flag = true; - - } else if (strcmp(command, "<@") == 0) { - ierr = MDI_Send(current_node, MDI_NAME_LENGTH, MDI_CHAR, mdicomm); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send node to driver"); - - } else if (strcmp(command, "etol = std::numeric_limits::max(); - update->ftol = std::numeric_limits::max(); - - // set the maximum number of force evaluations to 0 - update->max_eval = 0; - } - - } else if (strcmp(command, "@COORDS") == 0) { - strncpy(target_node, "@COORDS", MDI_COMMAND_LENGTH); - local_exit_flag = true; - - } else if (strcmp(command, "@FORCES") == 0) { - strncpy(target_node, "@FORCES", MDI_COMMAND_LENGTH); - local_exit_flag = true; - - } else if (strcmp(command, "EXIT") == 0) { - // exit the driver code - exit_flag = true; - - // are we in the middle of a geometry optimization? - if (most_recent_init == 2) { - // ensure that the energy and force tolerances are met - update->etol = std::numeric_limits::max(); - update->ftol = std::numeric_limits::max(); - - // set the maximum number of force evaluations to 0 - update->max_eval = 0; - } - - } else { - error->all(FLERR, "MDI: Unknown command from driver"); - } - - return 0; + mdi_engine->engine_node("@FORCES"); } /* ---------------------------------------------------------------------- */ -char *FixMDIEngine::engine_mode(const char *node) +void FixMDIEngine::end_of_step() { - /* - if (screen) - fprintf(screen,"MDI ENGINE MODE: %i\n",node); - if (logfile) - fprintf(logfile,"MDI ENGINE MODE: %i\n",node); - */ + // engine is now at ENDSTEP node for MD - // do not process commands if engine and driver are not at same node - // target_node = node that driver has set via a @ command - // current_node = node that engine (LAMMPS) has set - - strncpy(current_node, node, MDI_COMMAND_LENGTH); - if (strcmp(target_node, "\0") != 0 && strcmp(target_node, current_node) != 0) - local_exit_flag = true; - - // respond to commands from the driver - - while (!exit_flag && !local_exit_flag) { - - // read the next command from the driver - // all procs call this, but only proc 0 receives the command - - ierr = MDI_Recv_command(command, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to receive command from driver"); - - // broadcast command to the other MPI tasks - - MPI_Bcast(command, MDI_COMMAND_LENGTH, MPI_CHAR, 0, world); - - // execute the command - - this->execute_command(command, driver_socket); - - // check if the target node is something other than the current node - - if (strcmp(target_node, "\0") != 0 && strcmp(target_node, current_node) != 0) - local_exit_flag = true; - } - - // local exit occured so turn off local exit flag - - local_exit_flag = false; - - return command; -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::receive_coordinates(Error *error) -{ - // get conversion factor to atomic units - double posconv; - - // real: coords = Ang, eng = Kcal/mole, force = Kcal/mole/Ang - // metal: coords = Ang, eng = eV, force = eV/Ang - - if (lmpunits == REAL) { - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - posconv = force->angstrom / angstrom_to_bohr; - } else if (lmpunits == METAL) { - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - posconv = force->angstrom / angstrom_to_bohr; - } - - // create buffer to hold all coords - - double *buffer; - buffer = new double[3 * atom->natoms]; - - ierr = MDI_Recv((char *) buffer, 3 * atom->natoms, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to receive coordinates from driver"); - MPI_Bcast(buffer, 3 * atom->natoms, MPI_DOUBLE, 0, world); - - // pick local atoms from the buffer - - double **x = atom->x; - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) { - x[i][0] = buffer[3 * (atom->tag[i] - 1) + 0] * posconv; - x[i][1] = buffer[3 * (atom->tag[i] - 1) + 1] * posconv; - x[i][2] = buffer[3 * (atom->tag[i] - 1) + 2] * posconv; - } - - // ensure atoms are in current box & update box via shrink-wrap - // has to be be done before invoking Irregular::migrate_atoms() - // since it requires atoms be inside simulation box - - if (domain->triclinic) domain->x2lamda(atom->nlocal); - domain->pbc(); - domain->reset_box(); - if (domain->triclinic) domain->lamda2x(atom->nlocal); - - // move atoms to new processors via irregular() only needed if - // migrate_check() says an atom moves too far - - if (domain->triclinic) domain->x2lamda(atom->nlocal); - if (irregular->migrate_check()) irregular->migrate_atoms(); - if (domain->triclinic) domain->lamda2x(atom->nlocal); - - delete[] buffer; -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::send_coordinates(Error *error) -{ - // get conversion factor to atomic units - double posconv; - if (lmpunits == REAL) { - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - posconv = force->angstrom / angstrom_to_bohr; - } else if (lmpunits == METAL) { - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - posconv = force->angstrom / angstrom_to_bohr; - } - - int64_t ncoords = 3 * atom->natoms; - double *coords; - double *coords_reduced; - memory->create(coords, ncoords, "mdi/engine:coords"); - memory->create(coords_reduced, ncoords, "mdi/engine:coords_reduced"); - - // zero coords - - for (int64_t icoord = 0; icoord < ncoords; icoord++) coords[icoord] = 0.0; - - // copy local atoms into buffer at correct locations - - double **x = atom->x; - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) { - coords[3 * (atom->tag[i] - 1) + 0] = x[i][0] / posconv; - coords[3 * (atom->tag[i] - 1) + 1] = x[i][1] / posconv; - coords[3 * (atom->tag[i] - 1) + 2] = x[i][2] / posconv; - } - - MPI_Reduce(coords, coords_reduced, 3 * atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - - ierr = MDI_Send((char *) coords_reduced, 3 * atom->natoms, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send coordinates to driver"); - - memory->destroy(coords); - memory->destroy(coords_reduced); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::send_charges(Error *error) -{ - double *charges; - double *charges_reduced; - - memory->create(charges, atom->natoms, "mdi/engine:charges"); - memory->create(charges_reduced, atom->natoms, "mdi/engine:charges_reduced"); - - // zero the charges array - - for (int icharge = 0; icharge < atom->natoms; icharge++) charges[icharge] = 0.0; - - // pick local atoms from the buffer - - double *charge = atom->q; - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) { charges[atom->tag[i] - 1] = charge[i]; } - - MPI_Reduce(charges, charges_reduced, atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - - ierr = MDI_Send((char *) charges_reduced, atom->natoms, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send charges to driver"); - - memory->destroy(charges); - memory->destroy(charges_reduced); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::send_energy(Error *error) -{ - // get conversion factor to atomic units - double energy_conv = 1.0; - if (lmpunits == REAL) { - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - energy_conv = kelvin_to_hartree / force->boltz; - } else if (lmpunits == METAL) { - double ev_to_hartree; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - energy_conv = ev_to_hartree; - } - - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - - double potential_energy = pe->compute_scalar(); - double kinetic_energy = ke->compute_scalar(); - double total_energy; - double *send_energy = &total_energy; - - // convert the energy to atomic units - potential_energy *= energy_conv; - kinetic_energy *= energy_conv; - total_energy = potential_energy + kinetic_energy; - - ierr = MDI_Send((char *) send_energy, 1, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send potential energy to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::send_pe(Error *error) -{ - // get conversion factor to atomic units - double energy_conv; - if (lmpunits == REAL) { - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - energy_conv = kelvin_to_hartree / force->boltz; - } else if (lmpunits == METAL) { - double ev_to_hartree; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - energy_conv = ev_to_hartree; - } - - double potential_energy = pe->compute_scalar(); - double *send_energy = &potential_energy; - - // convert the energy to atomic units - potential_energy *= energy_conv; - - ierr = MDI_Send((char *) send_energy, 1, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send potential energy to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::send_ke(Error *error) -{ - // get conversion factor to atomic units - double energy_conv; - if (lmpunits == REAL) { - double kelvin_to_hartree; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - energy_conv = kelvin_to_hartree / force->boltz; - } else if (lmpunits == METAL) { - double ev_to_hartree; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - energy_conv = ev_to_hartree; - } - - double kinetic_energy = ke->compute_scalar(); - double *send_energy = &kinetic_energy; - - // convert the energy to atomic units - kinetic_energy *= energy_conv; - - ierr = MDI_Send((char *) send_energy, 1, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send potential energy to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::send_types(Error *error) -{ - int *const type = atom->type; - - ierr = MDI_Send((char *) type, atom->natoms, MDI_INT, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send atom types to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::send_labels(Error *error) -{ - char *labels = new char[atom->natoms * MDI_LABEL_LENGTH]; - memset(labels, ' ', atom->natoms * MDI_LABEL_LENGTH); - - for (int iatom = 0; iatom < atom->natoms; iatom++) { - std::string label = std::to_string(atom->type[iatom]); - int label_len = std::min(int(label.length()), MDI_LABEL_LENGTH); - strncpy(&labels[iatom * MDI_LABEL_LENGTH], label.c_str(), label_len); - } - - ierr = MDI_Send(labels, atom->natoms * MDI_LABEL_LENGTH, MDI_CHAR, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send atom types to driver"); - - delete[] labels; -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::send_masses(Error *error) -{ - double *const rmass = atom->rmass; - double *const mass = atom->mass; - int *const type = atom->type; - int nlocal = atom->nlocal; - - double *mass_by_atom; - double *mass_by_atom_reduced; - memory->create(mass_by_atom, atom->natoms, "mdi/engine:mass_by_atom"); - memory->create(mass_by_atom_reduced, atom->natoms, "mdi/engine:mass_by_atom_reduced"); - for (int iatom = 0; iatom < atom->natoms; iatom++) { mass_by_atom[iatom] = 0.0; } - - // determine the atomic masses - - if (rmass) { - for (int iatom = 0; iatom < nlocal; iatom++) { - mass_by_atom[atom->tag[iatom] - 1] = rmass[iatom]; - } - } else { - for (int iatom = 0; iatom < nlocal; iatom++) { - mass_by_atom[atom->tag[iatom] - 1] = mass[type[iatom]]; - } - } - - MPI_Reduce(mass_by_atom, mass_by_atom_reduced, atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - - // send the atomic masses to the driver - - ierr = MDI_Send((char *) mass_by_atom_reduced, atom->natoms, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send atom masses to driver"); - - memory->destroy(mass_by_atom); - memory->destroy(mass_by_atom_reduced); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::send_forces(Error *error) -{ - // get conversion factor to atomic units - double force_conv; - if (lmpunits == REAL) { - double kelvin_to_hartree; - double angstrom_to_bohr; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - force_conv = (kelvin_to_hartree / force->boltz) * (force->angstrom / angstrom_to_bohr); - } else if (lmpunits == METAL) { - double ev_to_hartree; - double angstrom_to_bohr; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - force_conv = ev_to_hartree / angstrom_to_bohr; - } - - double *forces; - double *forces_reduced; - double *x_buf; - - int nlocal = atom->nlocal; - int64_t ncoords = 3 * atom->natoms; - - memory->create(forces, ncoords, "mdi/engine:forces"); - memory->create(forces_reduced, ncoords, "mdi/engine:forces_reduced"); - x_buf = new double[3 * nlocal]; - - // zero the forces array - - for (int iforce = 0; iforce < 3 * atom->natoms; iforce++) forces[iforce] = 0.0; - - // if not at a node, calculate the forces - - if (strcmp(current_node, "@DEFAULT") == 0) { - // certain fixes, such as shake, move the coordinates - // to ensure that the coordinates do not change, store a copy - double **x = atom->x; - for (int i = 0; i < nlocal; i++) { - x_buf[3 * i + 0] = x[i][0]; - x_buf[3 * i + 1] = x[i][1]; - x_buf[3 * i + 2] = x[i][2]; - } - - // calculate the forces - update->whichflag = 1; // 1 for dynamics - update->nsteps = 1; - lmp->init(); - update->integrate->setup_minimal(1); - - if (strcmp(current_node, "@DEFAULT") == 0) { - // restore the original set of coordinates - double **x_new = atom->x; - for (int i = 0; i < nlocal; i++) { - x_new[i][0] = x_buf[3 * i + 0]; - x_new[i][1] = x_buf[3 * i + 1]; - x_new[i][2] = x_buf[3 * i + 2]; - } - } - } - - // pick local atoms from the buffer - double **f = atom->f; - for (int i = 0; i < nlocal; i++) { - forces[3 * (atom->tag[i] - 1) + 0] = f[i][0] * force_conv; - forces[3 * (atom->tag[i] - 1) + 1] = f[i][1] * force_conv; - forces[3 * (atom->tag[i] - 1) + 2] = f[i][2] * force_conv; - } - - // reduce the forces onto rank 0 - MPI_Reduce(forces, forces_reduced, 3 * atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); - - // send the forces through MDI - ierr = MDI_Send((char *) forces_reduced, 3 * atom->natoms, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send atom forces to driver"); - - memory->destroy(forces); - memory->destroy(forces_reduced); - delete[] x_buf; -} - -/* ---------------------------------------------------------------------- */ - -// Receive forces from the driver -// mode = 0: replace current forces with forces from driver -// mode = 1: add forces from driver to current forces - -void FixMDIEngine::receive_forces(Error *error, int mode) -{ - // get conversion factor to atomic units - double force_conv; - if (lmpunits == REAL) { - double kelvin_to_hartree; - double angstrom_to_bohr; - MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - force_conv = (kelvin_to_hartree / force->boltz) * (force->angstrom / angstrom_to_bohr); - } else if (lmpunits == METAL) { - double ev_to_hartree; - double angstrom_to_bohr; - MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - force_conv = ev_to_hartree / angstrom_to_bohr; - } - - int64_t ncoords = 3 * atom->natoms; - double *forces; - memory->create(forces, ncoords, "mdi/engine:forces"); - - ierr = MDI_Recv((char *) forces, 3 * atom->natoms, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to receive atom forces to driver"); - MPI_Bcast(forces, 3 * atom->natoms, MPI_DOUBLE, 0, world); - - // pick local atoms from the buffer - double **f = atom->f; - int nlocal = atom->nlocal; - - if (mode == 0) { // Replace - for (int i = 0; i < nlocal; i++) { - f[i][0] = forces[3 * (atom->tag[i] - 1) + 0] / force_conv; - f[i][1] = forces[3 * (atom->tag[i] - 1) + 1] / force_conv; - f[i][2] = forces[3 * (atom->tag[i] - 1) + 2] / force_conv; - } - } else { - for (int i = 0; i < nlocal; i++) { - f[i][0] += forces[3 * (atom->tag[i] - 1) + 0] / force_conv; - f[i][1] += forces[3 * (atom->tag[i] - 1) + 1] / force_conv; - f[i][2] += forces[3 * (atom->tag[i] - 1) + 2] / force_conv; - } - } - - memory->destroy(forces); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::send_cell(Error *error) -{ - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - - double celldata[9]; - - celldata[0] = domain->boxhi[0] - domain->boxlo[0]; - celldata[1] = 0.0; - celldata[2] = 0.0; - celldata[3] = domain->xy; - celldata[4] = domain->boxhi[1] - domain->boxlo[1]; - celldata[5] = 0.0; - celldata[6] = domain->xz; - celldata[7] = domain->yz; - celldata[8] = domain->boxhi[2] - domain->boxlo[2]; - - // convert the units to bohr - - double unit_conv = force->angstrom * angstrom_to_bohr; - for (int icell = 0; icell < 9; icell++) { celldata[icell] *= unit_conv; } - - ierr = MDI_Send((char *) celldata, 9, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send cell dimensions to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::receive_cell(Error *error) -{ - double celldata[9]; - - // receive the new cell vector from the driver - ierr = MDI_Recv((char *) celldata, 9, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send cell dimensions to driver"); - MPI_Bcast(&celldata[0], 9, MPI_DOUBLE, 0, world); - - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - double unit_conv = force->angstrom * angstrom_to_bohr; - for (int icell = 0; icell < 9; icell++) { celldata[icell] /= unit_conv; } - - // ensure that the new cell vector is orthogonal - double small = std::numeric_limits::min(); - if (fabs(celldata[1]) > small or fabs(celldata[2]) > small or fabs(celldata[3]) > small or - fabs(celldata[5]) > small or fabs(celldata[6]) > small or fabs(celldata[7]) > small) { - error->all(FLERR, - "MDI: LAMMPS currently only supports the >CELL command for orthogonal cell vectors"); - } - - // set the new LAMMPS cell dimensions - // This only works for orthogonal cell vectors. - // Supporting the more general case would be possible, - // but considerably more complex. - domain->boxhi[0] = celldata[0] + domain->boxlo[0]; - domain->boxhi[1] = celldata[4] + domain->boxlo[1]; - domain->boxhi[2] = celldata[8] + domain->boxlo[2]; - domain->xy = 0.0; - domain->xz = 0.0; - domain->yz = 0.0; -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::send_celldispl(Error *error) -{ - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - - double celldata[3]; - - celldata[0] = domain->boxlo[0]; - celldata[1] = domain->boxlo[1]; - celldata[2] = domain->boxlo[2]; - - // convert the units to bohr - - double unit_conv = force->angstrom * angstrom_to_bohr; - for (int icell = 0; icell < 3; icell++) { celldata[icell] *= unit_conv; } - - ierr = MDI_Send((char *) celldata, 3, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to send cell displacement to driver"); -} - -/* ---------------------------------------------------------------------- */ - -void FixMDIEngine::receive_celldispl(Error *error) -{ - // receive the cell displacement from the driver - double celldata[3]; - ierr = MDI_Recv((char *) celldata, 3, MDI_DOUBLE, driver_socket); - if (ierr != 0) error->all(FLERR, "MDI: Unable to receive cell displacement from driver"); - MPI_Bcast(&celldata[0], 3, MPI_DOUBLE, 0, world); - - double angstrom_to_bohr; - MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); - double unit_conv = force->angstrom * angstrom_to_bohr; - - double old_boxlo[3]; - old_boxlo[0] = domain->boxlo[0]; - old_boxlo[1] = domain->boxlo[1]; - old_boxlo[2] = domain->boxlo[2]; - - // adjust the values of boxlo and boxhi for the new cell displacement vector - domain->boxlo[0] = celldata[0] / unit_conv; - domain->boxlo[1] = celldata[1] / unit_conv; - domain->boxlo[2] = celldata[2] / unit_conv; - domain->boxhi[0] += domain->boxlo[0] - old_boxlo[0]; - domain->boxhi[1] += domain->boxlo[1] - old_boxlo[1]; - domain->boxhi[2] += domain->boxlo[2] - old_boxlo[2]; + mdi_engine->engine_node("@ENDSTEP"); } diff --git a/src/MDI/fix_mdi_engine.h b/src/MDI/fix_mdi_engine.h index 925292ae1f..f594341c24 100644 --- a/src/MDI/fix_mdi_engine.h +++ b/src/MDI/fix_mdi_engine.h @@ -13,7 +13,7 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(mdi/engine, FixMDIEngine); +FixStyle(MDI/ENGINE, FixMDIEngine); // clang-format on #else @@ -21,84 +21,23 @@ FixStyle(mdi/engine, FixMDIEngine); #define LMP_FIX_MDI_ENGINE_H #include "fix.h" -#include // IWYU pragma: export namespace LAMMPS_NS { class FixMDIEngine : public Fix { public: + class MDIEngine *mdi_engine; + FixMDIEngine(class LAMMPS *, int, char **); - ~FixMDIEngine() override; - int setmask() override; - void init() override; - - int execute_command(const char *command, MDI_Comm driver_socket); - char *engine_mode(const char *node); - - // receive and update forces - - void min_setup(int) override; - void post_integrate() override; - void post_force(int) override; - void min_pre_force(int) override; //@COORDS - void min_post_force(int) override; //@FORCES - - double *add_force; // stores forces added using +FORCE command - double potential_energy; // stores potential energy - double kinetic_energy; // stores kinetic energy - - // current command - - char *command; - - protected: - void exchange_forces(); - - private: - int lmpunits; // REAL or METAL - int master, ierr; - int driver_socket; - int most_recent_init; // which MDI init command was most recently received? - // 0 - none - // 1 - MD - // 2 - OPTG - bool exit_flag; - bool local_exit_flag; - char *current_node; - char *target_node; // is the code supposed to advance to a particular node? - // 0 - none - // 1 - @COORDS (before pre-force calculation) - // 2 - @PRE-FORCES (before final force calculation) - // 3 - @FORCES (before time integration) - // -1 - after MD_INIT command - // -2 - after MD_INIT command followed by @PRE-FORCES (actually @INIT_OPTG?) - - // command to be executed at the target node - - char *target_command; - - char *id_pe; - char *id_ke; - class Irregular *irregular; - class Minimize *minimizer; - class Compute *pe; - class Compute *ke; - - void send_types(Error *); - void send_labels(Error *); - void send_masses(Error *); - void receive_coordinates(Error *); - void send_coordinates(Error *); - void send_charges(Error *); - void send_energy(Error *); - void send_forces(Error *); - void send_pe(Error *); - void send_ke(Error *); - void receive_forces(Error *, int); - void send_cell(Error *); - void receive_cell(Error *); - void send_celldispl(Error *); - void receive_celldispl(Error *); + ~FixMDIEngine() {} + int setmask(); + void init() {} + void setup(int); + void post_integrate(); + void min_pre_force(int); + void post_force(int); + void min_post_force(int); + void end_of_step(); }; } // namespace LAMMPS_NS diff --git a/src/MDI/library_mdi.cpp b/src/MDI/library_mdi.cpp index 0e6bd05ead..ad2e995b4c 100644 --- a/src/MDI/library_mdi.cpp +++ b/src/MDI/library_mdi.cpp @@ -13,20 +13,24 @@ // ---------------------------------------------------------------------- // MolSSI Driver Interface functions +// these are added to LAMMPS library interface when MDI package is included // ---------------------------------------------------------------------- #include "library_mdi.h" // needed to enable MPI support + #define LAMMPS_LIB_MPI 1 #include "library.h" -#include "fix_mdi_engine.h" +#include "mdi_engine.h" #include using namespace LAMMPS_NS; +/* ---------------------------------------------------------------------- */ + /** Initialize an instance of LAMMPS as an MDI plugin * \verbatim embed:rst @@ -51,6 +55,7 @@ command-line argument, which must be provided by the MDI driver. int MDI_Plugin_init_lammps() { // initialize MDI + int mdi_argc; char **mdi_argv; if (MDI_Plugin_get_argc(&mdi_argc)) MPI_Abort(MPI_COMM_WORLD, 1); @@ -58,10 +63,12 @@ int MDI_Plugin_init_lammps() if (MDI_Init(&mdi_argc, &mdi_argv)) MPI_Abort(MPI_COMM_WORLD, 1); // get the MPI intra-communicator for this code + MPI_Comm mpi_world_comm = MPI_COMM_WORLD; if (MDI_MPI_get_world_comm(&mpi_world_comm)) MPI_Abort(MPI_COMM_WORLD, 1); // find the -in argument + int iarg = 0; char *filename; bool found_filename = false; @@ -74,6 +81,7 @@ int MDI_Plugin_init_lammps() found_filename = true; // remove -in argument from the command list + mdi_argc -= 2; for (int jarg = iarg; jarg < mdi_argc; jarg++) mdi_argv[jarg] = mdi_argv[jarg + 2]; } @@ -82,17 +90,29 @@ int MDI_Plugin_init_lammps() if (!found_filename) MPI_Abort(MPI_COMM_WORLD, 1); // create and run a LAMMPS instance + // lammps_open() expects a first arg (not used) which is executable name + // same as if called from main.cpp + void *lmp = nullptr; if (lammps_config_has_mpi_support() > 0) - lmp = lammps_open(mdi_argc, mdi_argv, mpi_world_comm, nullptr); + lmp = lammps_open(mdi_argc + 1, &mdi_argv[-1], mpi_world_comm, nullptr); else - lmp = lammps_open_no_mpi(mdi_argc, mdi_argv, nullptr); + lmp = lammps_open_no_mpi(mdi_argc + 1, &mdi_argv[-1], nullptr); + + // process the specified input script + // must contain "mdi engine" command + lammps_file(lmp, filename); + + // shut down the plugin + lammps_close(lmp); return 0; } +/* ---------------------------------------------------------------------- */ + /** Execute an MDI command * \verbatim embed:rst @@ -106,8 +126,9 @@ The function executes a single command from an external MDI driver. * \param comm MDI communicator that can be used to communicated with the driver. * \param class_obj pointer to an instance of an mdi/engine fix cast to ``void *``. * \return 0 on no error, 1 on error. */ + int lammps_execute_mdi_command(const char *command, MDI_Comm comm, void *class_obj) { - FixMDIEngine *mdi_fix = (FixMDIEngine *) class_obj; - return mdi_fix->execute_command(command, comm); + auto mdi_engine = (MDIEngine *) class_obj; + return mdi_engine->execute_command(command, comm); } diff --git a/src/MDI/mdi_command.cpp b/src/MDI/mdi_command.cpp new file mode 100644 index 0000000000..65e47e197a --- /dev/null +++ b/src/MDI/mdi_command.cpp @@ -0,0 +1,38 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/ 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 "mdi_command.h" + +#include "error.h" +#include "mdi_engine.h" +#include "mdi_plugin.h" + +#include + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- + mdi command: engine or plugin +---------------------------------------------------------------------- */ + +void MDICommand::command(int narg, char **arg) +{ + if (narg < 1) error->all(FLERR, "Illegal mdi command"); + + if (strcmp(arg[0], "engine") == 0) { + MDIEngine(lmp, narg - 1, &arg[1]); + } else if (strcmp(arg[0], "plugin") == 0) { + MDIPlugin(lmp, narg - 1, &arg[1]); + } else + error->all(FLERR, "Illegal mdi command"); +} diff --git a/src/MESSAGE/message.h b/src/MDI/mdi_command.h similarity index 63% rename from src/MESSAGE/message.h rename to src/MDI/mdi_command.h index ff832f1145..d944c66004 100644 --- a/src/MESSAGE/message.h +++ b/src/MDI/mdi_command.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -13,24 +13,23 @@ #ifdef COMMAND_CLASS // clang-format off -CommandStyle(message,Message); +CommandStyle(mdi,MDICommand); // clang-format on #else -#ifndef LMP_MESSAGE_H -#define LMP_MESSAGE_H +#ifndef LMP_MDI_COMMAND_H +#define LMP_MDI_COMMAND_H #include "command.h" +#include "mdi.h" namespace LAMMPS_NS { -class Message : public Command { +class MDICommand : public Command { public: - Message(class LAMMPS *lmp) : Command(lmp){}; - void command(int, char **) override; + MDICommand(LAMMPS *lmp) : Command(lmp) {} - private: - void quit(); + void command(int, char **) override; }; } // namespace LAMMPS_NS @@ -40,4 +39,10 @@ class Message : public Command { /* ERROR/WARNING messages: +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + */ diff --git a/src/MDI/mdi_engine.cpp b/src/MDI/mdi_engine.cpp index 4ae1c80a9a..f2b96cb69a 100644 --- a/src/MDI/mdi_engine.cpp +++ b/src/MDI/mdi_engine.cpp @@ -19,33 +19,446 @@ #include "mdi_engine.h" #include "atom.h" +#include "comm.h" +#include "compute.h" +#include "domain.h" #include "error.h" #include "fix_mdi_engine.h" +#include "force.h" +#include "group.h" +#include "input.h" #include "integrate.h" -#include "mdi.h" +#include "irregular.h" +#include "library.h" +#include "library_mdi.h" +#include "memory.h" #include "min.h" #include "modify.h" +#include "neighbor.h" #include "output.h" +#include "thermo.h" #include "timer.h" #include "update.h" #include #include +#include + using namespace LAMMPS_NS; +enum { NATIVE, REAL, METAL }; // LAMMPS units which MDI supports +enum { DEFAULT, MD, OPT }; // top-level MDI engine modes + +// per-atom data which engine commands access + +enum { TYPE, CHARGE, MASS, COORD, VELOCITY, FORCE, ADDFORCE }; + /* ---------------------------------------------------------------------- trigger LAMMPS to start acting as an MDI engine + either in standalone mode or plugin mode + MDI_Init() for standalone mode is in main.cpp + MDI_Init() for plugin mode is in library_mdi.cpp::MDI_Plugin_init_lammps() endlessly loop over receiving commands from driver and responding - much of the logic for this is in FixMDIEngine - when EXIT command is received, mdi/engine command exits + when EXIT command is received, mdi engine command exits ---------------------------------------------------------------------- */ -void MDIEngine::command(int narg, char ** /*arg*/) +MDIEngine::MDIEngine(LAMMPS *_lmp, int narg, char ** /*arg*/) : Pointers(_lmp) { - // list of nodes and commands that a MDI-compliant MD code should support + if (narg) error->all(FLERR, "Illegal mdi engine command"); - // default node and its commands + // check requirements for LAMMPS to work with MDI as an engine + + if (atom->tag_enable == 0) error->all(FLERR, "Cannot use MDI engine without atom IDs"); + + if (atom->natoms && atom->tag_consecutive() == 0) + error->all(FLERR, "MDI engine requires consecutive atom IDs"); + + // confirm LAMMPS is being run as an engine + + int role; + MDI_Get_role(&role); + if (role != MDI_ENGINE) + error->all(FLERR, "Must invoke LAMMPS as an MDI engine to use mdi engine"); + + // root = 1 for proc 0, otherwise 0 + + root = (comm->me == 0) ? 1 : 0; + + // MDI setup + + mdicmd = new char[MDI_COMMAND_LENGTH]; + node_engine = new char[MDI_COMMAND_LENGTH]; + strncpy(node_engine, "@DEFAULT", MDI_COMMAND_LENGTH); + node_driver = new char[MDI_COMMAND_LENGTH]; + strncpy(node_driver, "\0", MDI_COMMAND_LENGTH); + + // create computes for KE. PE, pressure + // pressure compute only calculates virial, no kinetic term + + id_ke = utils::strdup(std::string("MDI_ENGINE") + "_ke"); + ke = modify->add_compute(fmt::format("{} all ke", id_ke)); + + id_pe = utils::strdup(std::string("MDI_ENGINE") + "_pe"); + pe = modify->add_compute(fmt::format("{} all pe", id_pe)); + + id_press = utils::strdup(std::string("MDI_ENGINE") + "_press"); + press = modify->add_compute(fmt::format("{} all pressure NULL virial", id_press)); + + // irregular class used if >COORDS change dramatically + + irregular = new Irregular(lmp); + + // set unit conversion factors + + if (strcmp(update->unit_style, "real") == 0) + lmpunits = REAL; + else if (strcmp(update->unit_style, "metal") == 0) + lmpunits = METAL; + else + lmpunits = NATIVE; + + unit_conversions(); + + // internal state of engine + + flag_natoms = 0; + flag_types = flag_charges = flag_coords = flag_velocities = 0; + flag_cell = flag_cell_displ = 0; + + sys_types = nullptr; + sys_coords = sys_velocities = nullptr; + sys_charges = nullptr; + + buf1 = buf1all = nullptr; + buf3 = buf3all = nullptr; + ibuf1 = ibuf1all = nullptr; + + maxatom = 0; + sys_natoms = atom->natoms; + reallocate(); + + nsteps = 0; + + etol = ftol = 1.0e-6; + niterate = -1; + max_eval = std::numeric_limits::max(); + + nbytes = -1; + + actionflag = 0; + + // define MDI commands that LAMMPS engine recognizes + + mdi_commands(); + + // register the execute_command function with MDI + // only used when engine runs in plugin mode + + MDI_Set_execute_command_func(lammps_execute_mdi_command, this); + + // one-time operation to establish a connection with the driver + + MDI_Accept_communicator(&mdicomm); + if (mdicomm <= 0) error->all(FLERR, "Unable to connect to MDI driver"); + + // endless engine loop, responding to driver commands + + mode = DEFAULT; + node_match = true; + exit_command = false; + + while (true) { + + // top-level mdi engine only recognizes three nodes + // DEFAULT, INIT_MD, INIT_OPTG + + engine_node("@DEFAULT"); + + // MDI commands for dynamics or minimization + + if (strcmp(mdicmd, "@INIT_MD") == 0) { + mdi_md(); + if (exit_command) break; + + } else if (strcmp(mdicmd, "@INIT_OPTG") == 0) { + mdi_optg(); + if (exit_command) break; + + } else if (exit_command) { + break; + + } else + error->all(FLERR, fmt::format("MDI engine exited with invalid command: {}", mdicmd)); + } + + // clean up + + delete[] mdicmd; + delete[] node_engine; + delete[] node_driver; + + modify->delete_compute(id_ke); + modify->delete_compute(id_pe); + modify->delete_compute(id_press); + + delete[] id_ke; + delete[] id_pe; + delete[] id_press; + + delete irregular; + + // delete buffers + + deallocate(); +} + +/* ---------------------------------------------------------------------- + engine is now at this MDI node + loop over received commands so long as driver is also at this node + return when not the case or EXIT command received +---------------------------------------------------------------------- */ + +void MDIEngine::engine_node(const char *node) +{ + int ierr; + + // do not process commands if engine and driver request are not the same + + strncpy(node_engine, node, MDI_COMMAND_LENGTH); + + if (strcmp(node_driver, "\0") != 0 && strcmp(node_driver, node_engine) != 0) node_match = false; + + // respond to commands from the driver + + while (!exit_command && node_match) { + + // read the next command from the driver + // all procs call this, but only proc 0 receives the command + + ierr = MDI_Recv_command(mdicmd, mdicomm); + if (ierr) error->all(FLERR, "MDI: Unable to receive command from driver"); + + // broadcast command to the other MPI tasks + + MPI_Bcast(mdicmd, MDI_COMMAND_LENGTH, MPI_CHAR, 0, world); + + // execute the command + + execute_command(mdicmd, mdicomm); + + // check if driver request is now different than engine node + + if (strcmp(node_driver, "\0") != 0 && strcmp(node_driver, node_engine) != 0) node_match = false; + } + + // node exit was triggered so reset node_match + + node_match = true; +} + +/* ---------------------------------------------------------------------- + process a single driver command + called by engine_node() in loop + also called by MDI itself via lib::lammps_execute_mdi_command() + when LAMMPS is running as a plugin +---------------------------------------------------------------------- */ + +int MDIEngine::execute_command(const char *command, MDI_Comm mdicomm) +{ + int ierr; + + // confirm this command is supported at this node + // otherwise is error + + int command_exists; + if (root) { + ierr = MDI_Check_command_exists(node_engine, command, MDI_COMM_NULL, &command_exists); + if (ierr) error->one(FLERR, "MDI: Cannot confirm that command '{}' is supported", command); + } + + MPI_Bcast(&command_exists, 1, MPI_INT, 0, world); + if (!command_exists) + error->all(FLERR, "MDI: Received command '{}' unsupported by engine node {}", command, + node_engine); + + // --------------------------------------- + // respond to MDI standard commands + // receives first, sends second, node commands third + // --------------------------------------- + + if (strcmp(command, ">CELL") == 0) { + receive_cell(); + + } else if (strcmp(command, ">CELL_DISPL") == 0) { + receive_cell_displ(); + + } else if (strcmp(command, ">CHARGES") == 0) { + receive_charges(); + + } else if (strcmp(command, ">COORDS") == 0) { + receive_coords(); + + } else if (strcmp(command, ">FORCES") == 0) { + receive_double3(FORCE); + + } else if (strcmp(command, ">+FORCES") == 0) { + receive_double3(ADDFORCE); + + } else if (strcmp(command, ">NATOMS") == 0) { + receive_natoms(); + + } else if (strcmp(command, ">NSTEPS") == 0) { + receive_nsteps(); + + } else if (strcmp(command, ">TOLERANCE") == 0) { + receive_tolerance(); + + } else if (strcmp(command, ">TYPES") == 0) { + receive_types(); + + } else if (strcmp(command, ">VELOCITIES") == 0) { + if (strcmp(node_engine, "@DEFAULT") == 0) + receive_velocities(); + else + receive_double3(VELOCITY); + + // ----------------------------------------------- + + } else if (strcmp(command, "<@") == 0) { + ierr = MDI_Send(node_engine, MDI_NAME_LENGTH, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: <@ data"); + + } else if (strcmp(command, "all(FLERR, "MDI: MDI engine is already performing a simulation"); + mode = MD; + strncpy(node_driver, command, MDI_COMMAND_LENGTH); + node_match = false; + + } else if (strcmp(command, "@INIT_OPTG") == 0) { + if (mode != DEFAULT) error->all(FLERR, "MDI: MDI engine is already performing a simulation"); + mode = OPT; + strncpy(node_driver, command, MDI_COMMAND_LENGTH); + node_match = false; + + } else if (strcmp(command, "@") == 0) { + strncpy(node_driver, "\0", MDI_COMMAND_LENGTH); + node_match = false; + + } else if (strcmp(command, "@DEFAULT") == 0) { + mode = DEFAULT; + strncpy(node_driver, command, MDI_COMMAND_LENGTH); + node_match = false; + + } else if (strcmp(command, "@COORDS") == 0) { + strncpy(node_driver, command, MDI_COMMAND_LENGTH); + node_match = false; + + } else if (strcmp(command, "@FORCES") == 0) { + strncpy(node_driver, command, MDI_COMMAND_LENGTH); + node_match = false; + + } else if (strcmp(command, "@ENDSTEP") == 0) { + strncpy(node_driver, command, MDI_COMMAND_LENGTH); + node_match = false; + + // exit command + + } else if (strcmp(command, "EXIT") == 0) { + exit_command = true; + + // ------------------------------------------------------- + // custom LAMMPS commands + // ------------------------------------------------------- + + } else if (strcmp(command, "NBYTES") == 0) { + nbytes_command(); + } else if (strcmp(command, "COMMAND") == 0) { + single_command(); + } else if (strcmp(command, "COMMANDS") == 0) { + many_commands(); + } else if (strcmp(command, "INFILE") == 0) { + infile(); + } else if (strcmp(command, "all(FLERR, "MDI: Unknown command {} received from driver", command); + } + + return 0; +} + +/* ---------------------------------------------------------------------- + define which MDI commands the LAMMPS engine recognizes at each node + both standard MDI commands and custom LAMMPS commands + max length for a command is currently 11 chars +---------------------------------------------------------------------- */ + +void MDIEngine::mdi_commands() +{ + // default node, MDI standard commands MDI_Register_node("@DEFAULT"); MDI_Register_command("@DEFAULT", "<@"); @@ -53,287 +466,1317 @@ void MDIEngine::command(int narg, char ** /*arg*/) MDI_Register_command("@DEFAULT", "CELL"); MDI_Register_command("@DEFAULT", ">CELL_DISPL"); + MDI_Register_command("@DEFAULT", ">CHARGES"); MDI_Register_command("@DEFAULT", ">COORDS"); + MDI_Register_command("@DEFAULT", ">NATOMS"); + MDI_Register_command("@DEFAULT", ">NSTEPS"); + MDI_Register_command("@DEFAULT", ">TOLERANCE"); + MDI_Register_command("@DEFAULT", ">TYPES"); + MDI_Register_command("@DEFAULT", ">VELOCITIES"); + MDI_Register_command("@DEFAULT", "MD"); + MDI_Register_command("@DEFAULT", "OPTG"); MDI_Register_command("@DEFAULT", "@INIT_MD"); MDI_Register_command("@DEFAULT", "@INIT_OPTG"); MDI_Register_command("@DEFAULT", "EXIT"); + // default node, custom commands added by LAMMPS + + MDI_Register_command("@DEFAULT", "NBYTES"); + MDI_Register_command("@DEFAULT", "COMMAND"); + MDI_Register_command("@DEFAULT", "COMMANDS"); + MDI_Register_command("@DEFAULT", "INFILE"); + MDI_Register_command("@DEFAULT", "CELL"); - MDI_Register_command("@INIT_MD", ">CELL_DISPL"); - MDI_Register_command("@INIT_MD", ">COORDS"); - MDI_Register_command("@INIT_MD", ">FORCES"); - MDI_Register_command("@INIT_MD", ">+FORCES"); MDI_Register_command("@INIT_MD", "@"); - MDI_Register_command("@INIT_MD", "@COORDS"); MDI_Register_command("@INIT_MD", "@DEFAULT"); + MDI_Register_command("@INIT_MD", "@COORDS"); MDI_Register_command("@INIT_MD", "@FORCES"); + MDI_Register_command("@INIT_MD", "@ENDSTEP"); MDI_Register_command("@INIT_MD", "EXIT"); // node for setting up and running a minimization MDI_Register_node("@INIT_OPTG"); MDI_Register_command("@INIT_OPTG", "<@"); - MDI_Register_command("@INIT_OPTG", "CELL"); - MDI_Register_command("@INIT_OPTG", ">CELL_DISPL"); - MDI_Register_command("@INIT_OPTG", ">COORDS"); - MDI_Register_command("@INIT_OPTG", ">FORCES"); - MDI_Register_command("@INIT_OPTG", ">+FORCES"); MDI_Register_command("@INIT_OPTG", "@"); - MDI_Register_command("@INIT_OPTG", "@COORDS"); MDI_Register_command("@INIT_OPTG", "@DEFAULT"); + MDI_Register_command("@INIT_OPTG", "@COORDS"); MDI_Register_command("@INIT_OPTG", "@FORCES"); MDI_Register_command("@INIT_OPTG", "EXIT"); + // node at POST_INTEGRATE location in timestep + // only used if fix MDI/ENGINE is instantiated + + MDI_Register_node("@COORDS"); + MDI_Register_command("@COORDS", "<@"); + MDI_Register_command("@COORDS", "COORDS"); + MDI_Register_command("@COORDS", ">VELOCITIES"); + MDI_Register_command("@COORDS", "@"); + MDI_Register_command("@COORDS", "@DEFAULT"); + MDI_Register_command("@COORDS", "@COORDS"); + MDI_Register_command("@COORDS", "@FORCES"); + MDI_Register_command("@COORDS", "@ENDSTEP"); + MDI_Register_command("@COORDS", "EXIT"); + // node at POST_FORCE location in timestep + // only used if fix MDI/ENGINE is instantiated + // two register callbacks allow LAMMPS to interact more easily + // with drivers which don't know LAMMPS control flow MDI_Register_node("@FORCES"); MDI_Register_callback("@FORCES", ">FORCES"); MDI_Register_callback("@FORCES", ">+FORCES"); MDI_Register_command("@FORCES", "<@"); - MDI_Register_command("@FORCES", "CELL"); - MDI_Register_command("@FORCES", ">CELL_DISPL"); - MDI_Register_command("@FORCES", ">COORDS"); + MDI_Register_command("@FORCES", "FORCES"); MDI_Register_command("@FORCES", ">+FORCES"); + MDI_Register_command("@FORCES", ">VELOCITIES"); MDI_Register_command("@FORCES", "@"); - MDI_Register_command("@FORCES", "@COORDS"); MDI_Register_command("@FORCES", "@DEFAULT"); + MDI_Register_command("@FORCES", "@COORDS"); MDI_Register_command("@FORCES", "@FORCES"); + MDI_Register_command("@FORCES", "@ENDSTEP"); MDI_Register_command("@FORCES", "EXIT"); - // node at POST_INTEGRATE location in timestep + // node at END_OF_STEP location in timestep + // only used if fix MDI/ENGINE is instantiated - MDI_Register_node("@COORDS"); - MDI_Register_command("@COORDS", "<@"); - MDI_Register_command("@COORDS", "CELL"); - MDI_Register_command("@COORDS", ">CELL_DISPL"); - MDI_Register_command("@COORDS", ">COORDS"); - MDI_Register_command("@COORDS", ">FORCES"); - MDI_Register_command("@COORDS", ">+FORCES"); - MDI_Register_command("@COORDS", "@"); - MDI_Register_command("@COORDS", "@COORDS"); - MDI_Register_command("@COORDS", "@DEFAULT"); - MDI_Register_command("@COORDS", "@FORCES"); - MDI_Register_command("@COORDS", "EXIT"); - - // if the mdi/engine fix is not already present, add it now - - bool added_mdi_engine_fix = false; - auto fixes = modify->get_fix_by_style("mdi/engine"); - if (fixes.size() == 0) { - added_mdi_engine_fix = true; - mdi_fix = (FixMDIEngine *) modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine"); - } else - mdi_fix = (FixMDIEngine *) fixes.front(); - - // check that LAMMPS is setup as a compatible MDI engine - - if (narg > 0) error->all(FLERR, "Illegal mdi/engine command"); - - if (atom->tag_enable == 0) error->all(FLERR, "Cannot use mdi/engine without atom IDs"); - - if (atom->tag_consecutive() == 0) error->all(FLERR, "mdi/engine requires consecutive atom IDs"); - - // endless engine loop, responding to driver commands - - char *command; - - while (true) { - - // mdi/engine command only recognizes three nodes - // DEFAULT, INIT_MD, INIT_OPTG - - command = mdi_fix->engine_mode("@DEFAULT"); - - // MDI commands for dynamics or minimization - - if (strcmp(command, "@INIT_MD") == 0) { - command = mdi_md(); - if (strcmp(command, "EXIT")) break; - - } else if (strcmp(command, "@INIT_OPTG") == 0) { - command = mdi_optg(); - if (strcmp(command, "EXIT")) break; - - } else if (strcmp(command, "EXIT") == 0) { - break; - - } else - error->all(FLERR, "MDI node exited with invalid command: {}", command); - } - - // remove mdi/engine fix if instantiated here by mdi/engine - - if (added_mdi_engine_fix) modify->delete_fix("MDI_ENGINE_INTERNAL"); + MDI_Register_node("@ENDSTEP"); + MDI_Register_command("@ENDSTEP", "<@"); + MDI_Register_command("@ENDSTEP", "add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); + FixMDIEngine *mdi_fix = + dynamic_cast(modify->get_fix_by_id("MDI_ENGINE_INTERNAL")); + mdi_fix->mdi_engine = this; + + // initialize LAMMPS and setup() the simulation update->whichflag = 1; timer->init_timeout(); + update->nsteps = 1; - update->ntimestep = 0; - update->firststep = update->ntimestep; - update->laststep = update->ntimestep + update->nsteps; - update->beginstep = update->firststep; - update->endstep = update->laststep; + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->ntimestep + update->nsteps; lmp->init(); // engine is now at @INIT_MD node + // any @ command from driver will start the simulation - char *command = nullptr; - command = mdi_fix->engine_mode("@INIT_MD"); + engine_node("@INIT_MD"); + if (strcmp(mdicmd, "EXIT") == 0) return; - if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; - - // setup the MD simulation + // run one step at a time forever + // driver triggers exit with @ command other than @COORDS,@FORCES,@ENDSTEP update->integrate->setup(1); - command = mdi_fix->engine_mode("@FORCES"); - - if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; - - // run MD one step at a time + timer->init(); + timer->barrier_start(); while (true) { - update->whichflag = 1; - timer->init_timeout(); update->nsteps += 1; update->laststep += 1; update->endstep = update->laststep; output->next = update->ntimestep + 1; - // single MD timestep - update->integrate->run(1); - // done with MD if driver sends @DEFAULT or EXIT - - command = mdi_fix->command; - - if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; + if (strcmp(mdicmd, "@COORDS") != 0 && strcmp(mdicmd, "@FORCES") != 0 && + strcmp(mdicmd, "@ENDSTEP") != 0) + break; } - return nullptr; + timer->barrier_stop(); + update->integrate->cleanup(); + + modify->delete_fix("MDI_ENGINE_INTERNAL"); + + // clear flags + + flag_natoms = flag_types = 0; + flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; } /* ---------------------------------------------------------------------- - perform minimization under control of driver + run MD simulation for >NSTEPS ---------------------------------------------------------------------- */ -char *MDIEngine::mdi_optg() +void MDIEngine::md() { + // create or update system if requested prior to MD command - // setup the minimizer in a way that ensures optimization - // will continue until MDI driver exits + int flag_create = flag_natoms | flag_types; + if (flag_create) + create_system(); + else { + if (flag_cell || flag_cell_displ) adjust_box(); + if (flag_charges) adjust_charges(); + if (flag_coords) adjust_coords(); + if (flag_velocities) adjust_velocities(); + } - update->etol = std::numeric_limits::min(); - update->ftol = std::numeric_limits::min(); - update->nsteps = std::numeric_limits::max(); - update->max_eval = std::numeric_limits::max(); + // initialize LAMMPS and setup() the simulation + // run the simulation for nsteps + // clean up + + update->whichflag = 1; + timer->init_timeout(); + + update->nsteps = nsteps; + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->ntimestep + update->nsteps; + + lmp->init(); + update->integrate->setup(1); + + timer->init(); + timer->barrier_start(); + + update->integrate->run(nsteps); + + timer->barrier_stop(); + update->integrate->cleanup(); + + // clear flags + + flag_natoms = flag_types = 0; + flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; + + actionflag = 1; +} + +/* ---------------------------------------------------------------------- + perform minimization one iteration at a time, controlled by driver +---------------------------------------------------------------------- */ + +void MDIEngine::mdi_optg() +{ + // create or update system if requested prior to @INIT_OPTG + + int flag_create = flag_natoms | flag_types; + if (flag_create) + create_system(); + else { + if (flag_cell || flag_cell_displ) adjust_box(); + if (flag_charges) adjust_charges(); + if (flag_coords) adjust_coords(); + if (flag_velocities) adjust_velocities(); + } + + // add an instance of fix MDI/ENGINE + // delete the instance before this method returns + + modify->add_fix("MDI_ENGINE_INTERNAL all MDI/ENGINE"); + FixMDIEngine *mdi_fix = + dynamic_cast(modify->get_fix_by_id("MDI_ENGINE_INTERNAL")); + mdi_fix->mdi_engine = this; + + // initialize LAMMPS and setup() the simulation update->whichflag = 2; + timer->init_timeout(); + + update->nsteps = (niterate >= 0) ? niterate : max_eval; update->beginstep = update->firststep = update->ntimestep; update->endstep = update->laststep = update->firststep + update->nsteps; + update->etol = 0.0; + update->ftol = 0.0; + update->max_eval = std::numeric_limits::max(); + lmp->init(); // engine is now at @INIT_OPTG node + // any @ command from driver will start the minimization - char *command = nullptr; - command = mdi_fix->engine_mode("@INIT_OPTG"); + engine_node("@INIT_OPTG"); + if (strcmp(mdicmd, "EXIT") == 0) return; - if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; - - // setup the minimization + // run one iteration at a time forever + // driver triggers exit with @ command other than @COORDS,@FORCES + // two issues with running in this mode: + // @COORDS and @FORCES are not just triggered per min iteration + // but also for line search eng/force evals + // if driver triggers exit on step that is not multiple of thermo output + // then energy/virial not computed, and minimize->setup(); - // get new command + timer->init(); + timer->barrier_start(); - command = mdi_fix->command; + while (true) { + update->minimize->run(1); - if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; + if (strcmp(mdicmd, "@COORDS") != 0 && strcmp(mdicmd, "@FORCES") != 0) break; + } - // Start a minimization, which is configured to run (essentially) - // infinite steps. When the driver sends the EXIT command, - // the minimizer's energy and force tolerances are set to - // extremely large values, causing the minimization to end. + timer->barrier_stop(); + update->minimize->cleanup(); - update->minimize->iterate(update->nsteps); + modify->delete_fix("MDI_ENGINE_INTERNAL"); - // return if driver sends @DEFAULT or EXIT + // clear flags - command = mdi_fix->command; - - if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; - - error->all(FLERR, "MDI reached end of OPTG simulation with invalid command: {}", command); - return nullptr; + flag_natoms = flag_types = 0; + flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; +} + +/* ---------------------------------------------------------------------- + perform minimization to convergence using >TOLERANCE settings +---------------------------------------------------------------------- */ + +void MDIEngine::optg() +{ + // create or update system if requested prior to OPTG command + + int flag_create = flag_natoms | flag_types; + if (flag_create) + create_system(); + else { + if (flag_cell || flag_cell_displ) adjust_box(); + if (flag_charges) adjust_charges(); + if (flag_coords) adjust_coords(); + if (flag_velocities) adjust_velocities(); + } + + // initialize LAMMPS and setup() the simulation + // run the minimization using 4 >TOLERANCE parameters + // clean up + + update->whichflag = 2; + timer->init_timeout(); + + update->nsteps = (niterate >= 0) ? niterate : max_eval; + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->firststep + update->nsteps; + + update->etol = etol; + update->ftol = ftol; + update->max_eval = max_eval; + + lmp->init(); + update->minimize->setup(); + + timer->init(); + timer->barrier_start(); + + update->minimize->run(niterate); + + timer->barrier_stop(); + update->minimize->cleanup(); + + // clear flags + + flag_natoms = flag_types = 0; + flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; + + actionflag = 1; +} + +/* ---------------------------------------------------------------------- + evaluate() invoked by migrate_check() and migrate_atoms() if needed + // this can only be done if comm->style is not tiled + // also requires atoms be in box and lamda coords (for triclinic) + // finally invoke setup_minimal(1) to trigger exchange() & reneigh() + // NOTE: what this logic still lacks for comm->style tiled, + // is when to invoke migrate_atoms() if necessary, not easy to detect + + if (flag_create || neighbor->ago < 0) { + update->whichflag = 1; + lmp->init(); + update->integrate->setup(1); + update->whichflag = 0; + + } else if (flag_other) { + update->ntimestep++; + pe->addstep(update->ntimestep); + press->addstep(update->ntimestep); + + int nflag = neighbor->decide(); + + if (nflag == 0) { + comm->forward_comm(); + update->integrate->setup_minimal(0); + modify->clearstep_compute(); + output->thermo->compute(1); + + } else { + if (!comm->style) { + if (domain->triclinic) domain->x2lamda(atom->nlocal); + domain->pbc(); + domain->reset_box(); + if (irregular->migrate_check()) irregular->migrate_atoms(); + if (domain->triclinic) domain->lamda2x(atom->nlocal); + } + + update->integrate->setup_minimal(1); + modify->clearstep_compute(); + output->thermo->compute(1); + } + + modify->addstep_compute(update->ntimestep + 1); + } + + // clear flags that trigger next eval + + flag_natoms = flag_types = 0; + flag_cell = flag_cell_displ = flag_charges = flag_coords = flag_velocities = 0; +} + +/* ---------------------------------------------------------------------- + create a new system + >CELL, >NATOMS, >TYPES, >COORDS commands are required + >CELL_DISPL, >CHARGES, >VELOCITIES commands are optional +---------------------------------------------------------------------- */ + +void MDIEngine::create_system() +{ + // check requirements + + if (flag_cell == 0 || flag_natoms == 0 || flag_types == 0 || flag_coords == 0) + error->all(FLERR, + "MDI create_system requires >CELL, >NATOMS, >TYPES, >COORDS " + "MDI commands"); + + // remove all existing atoms via delete_atoms command + + lmp->input->one("delete_atoms group all"); + + // invoke lib->reset_box() + + double boxlo[3], boxhi[3]; + double xy, yz, xz; + + if (flag_cell_displ) { + boxlo[0] = sys_cell_displ[0]; + boxlo[1] = sys_cell_displ[1]; + boxlo[2] = sys_cell_displ[2]; + } else { + boxlo[0] = boxlo[1] = boxlo[2] = 0.0; + } + + boxhi[0] = boxlo[0] + sys_cell[0]; + boxhi[1] = boxlo[1] + sys_cell[4]; + boxhi[2] = boxlo[2] + sys_cell[8]; + + xy = sys_cell[3]; + yz = sys_cell[7]; + xz = sys_cell[6]; + + lammps_reset_box(lmp, boxlo, boxhi, xy, yz, xz); + + // invoke lib->create_atoms() + // optionally set charges if specified by ">CHARGES" + + if (flag_velocities) + lammps_create_atoms(lmp, sys_natoms, nullptr, sys_types, sys_coords, sys_velocities, nullptr, + 1); + else + lammps_create_atoms(lmp, sys_natoms, nullptr, sys_types, sys_coords, nullptr, nullptr, 1); + + if (flag_charges) lammps_scatter_atoms(lmp, (char *) "q", 1, 1, sys_charges); + + // new system + + update->ntimestep = 0; +} + +/* ---------------------------------------------------------------------- + adjust simulation box +---------------------------------------------------------------------- */ + +void MDIEngine::adjust_box() +{ + // convert atoms to lamda coords before changing box + + domain->x2lamda(atom->nlocal); + + // if >CELL command received, + // convert celldata to new boxlo, boxhi, and tilt factors + + if (flag_cell) { + domain->boxhi[0] = sys_cell[0] + domain->boxlo[0]; + domain->boxhi[1] = sys_cell[4] + domain->boxlo[1]; + domain->boxhi[2] = sys_cell[8] + domain->boxlo[2]; + domain->xy = sys_cell[3]; + domain->xz = sys_cell[6]; + domain->yz = sys_cell[7]; + } + + // if >CELL_DISPL command received, + // convert cell_displ to new boxlo and boxhi + + if (flag_cell_displ) { + double old_boxlo[3]; + old_boxlo[0] = domain->boxlo[0]; + old_boxlo[1] = domain->boxlo[1]; + old_boxlo[2] = domain->boxlo[2]; + + domain->boxlo[0] = sys_cell_displ[0]; + domain->boxlo[1] = sys_cell_displ[1]; + domain->boxlo[2] = sys_cell_displ[2]; + + domain->boxhi[0] += domain->boxlo[0] - old_boxlo[0]; + domain->boxhi[1] += domain->boxlo[1] - old_boxlo[1]; + domain->boxhi[2] += domain->boxlo[2] - old_boxlo[2]; + } + + // reset all Domain variables that depend on box size/shape + // convert atoms from lamda coords back to new box coords + + domain->set_global_box(); + domain->set_local_box(); + domain->lamda2x(atom->nlocal); +} + +/* ---------------------------------------------------------------------- + overwrite charges +---------------------------------------------------------------------- */ + +void MDIEngine::adjust_charges() +{ + double *q = atom->q; + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + q[i] = sys_charges[ilocal]; + } +} + +/* ---------------------------------------------------------------------- + overwrite coords +---------------------------------------------------------------------- */ + +void MDIEngine::adjust_coords() +{ + double **x = atom->x; + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + x[i][0] = sys_coords[3 * ilocal + 0]; + x[i][1] = sys_coords[3 * ilocal + 1]; + x[i][2] = sys_coords[3 * ilocal + 2]; + } +} + +/* ---------------------------------------------------------------------- + overwrite velocities +---------------------------------------------------------------------- */ + +void MDIEngine::adjust_velocities() +{ + double **v = atom->v; + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + v[i][0] = sys_velocities[3 * ilocal + 0]; + v[i][1] = sys_velocities[3 * ilocal + 1]; + v[i][2] = sys_velocities[3 * ilocal + 2]; + } +} + +// ---------------------------------------------------------------------- +// ----------------------------------------------------------------------/ +// MDI ">" driver commands that send data +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + +/* ---------------------------------------------------------------------- + >CELL command + reset simulation box edge vectors + in conjunction with >CELL_DISPL this can change box arbitrarily + can be done to create a new box + can be done incrementally during MD or OPTG +---------------------------------------------------------------------- */ + +void MDIEngine::receive_cell() +{ + actionflag = 0; + flag_cell = 1; + int ierr = MDI_Recv(sys_cell, 9, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL data"); + MPI_Bcast(sys_cell, 9, MPI_DOUBLE, 0, world); + + for (int icell = 0; icell < 9; icell++) sys_cell[icell] *= mdi2lmp_length; + + // error check that edge vectors match LAMMPS triclinic requirement + + if (sys_cell[1] != 0.0 || sys_cell[2] != 0.0 || sys_cell[5] != 0.0) + error->all(FLERR, "MDI: Received cell edges are not LAMMPS compatible"); +} + +/* ---------------------------------------------------------------------- + >CELL_DISPL command + reset simulation box lower left corner + in conjunction with >CELL this can change box arbitrarily + can be done to create a new box + can be done incrementally during MD or OPTG +---------------------------------------------------------------------- */ + +void MDIEngine::receive_cell_displ() +{ + actionflag = 0; + flag_cell_displ = 1; + int ierr = MDI_Recv(sys_cell_displ, 3, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >CELL_DISPLS data"); + MPI_Bcast(sys_cell_displ, 3, MPI_DOUBLE, 0, world); + + for (int icell = 0; icell < 3; icell++) sys_cell_displ[icell] *= mdi2lmp_length; +} + +/* ---------------------------------------------------------------------- + >CHARGES command +---------------------------------------------------------------------- */ + +void MDIEngine::receive_charges() +{ + actionflag = 0; + flag_charges = 1; + int ierr = MDI_Recv(sys_charges, sys_natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >CHARGES data"); + MPI_Bcast(sys_charges, sys_natoms, MPI_DOUBLE, 0, world); +} + +/* ---------------------------------------------------------------------- + >COORDS command +---------------------------------------------------------------------- */ + +void MDIEngine::receive_coords() +{ + actionflag = 0; + flag_coords = 1; + int n = 3 * sys_natoms; + int ierr = MDI_Recv(sys_coords, n, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >COORDS data"); + MPI_Bcast(sys_coords, n, MPI_DOUBLE, 0, world); + for (int i = 0; i < n; i++) sys_coords[i] *= mdi2lmp_length; +} + +/* ---------------------------------------------------------------------- + >NATOMS command + natoms cannot exceed 32-bit int for use with MDI +---------------------------------------------------------------------- */ + +void MDIEngine::receive_natoms() +{ + actionflag = 0; + flag_natoms = 1; + int ierr = MDI_Recv(&sys_natoms, 1, MDI_INT, mdicomm); + if (ierr) error->all(FLERR, "MDI: >NATOMS data"); + MPI_Bcast(&sys_natoms, 1, MPI_INT, 0, world); + if (sys_natoms < 0) error->all(FLERR, "MDI received natoms < 0"); + reallocate(); +} + +/* ---------------------------------------------------------------------- + >NSTEPS command + receive nsteps for timestepping +---------------------------------------------------------------------- */ + +void MDIEngine::receive_nsteps() +{ + int ierr = MDI_Recv(&nsteps, 1, MDI_INT, mdicomm); + if (ierr) error->all(FLERR, "MDI: >NSTEPS data"); + MPI_Bcast(&nsteps, 1, MPI_INT, 0, world); + if (nsteps < 0) error->all(FLERR, "MDI received nsteps < 0"); +} + +/* ---------------------------------------------------------------------- + >TOLERANCE command + receive 4 minimization tolerance params +---------------------------------------------------------------------- */ + +void MDIEngine::receive_tolerance() +{ + double params[4]; + int ierr = MDI_Recv(params, 4, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >TOLERANCE data"); + MPI_Bcast(params, 4, MPI_INT, 0, world); + + etol = params[0]; + ftol = params[1]; + niterate = static_cast(params[2]); + max_eval = static_cast(params[3]); + + if (etol < 0.0 || ftol < 0.0 || niterate < 0 || max_eval < 0) + error->all(FLERR, "MDI received invalid toleranace parameters"); +} + +/* ---------------------------------------------------------------------- + >TYPES command +---------------------------------------------------------------------- */ + +void MDIEngine::receive_types() +{ + actionflag = 0; + flag_types = 1; + int ierr = MDI_Recv(sys_types, sys_natoms, MDI_INT, mdicomm); + if (ierr) error->all(FLERR, "MDI: >TYPES data"); + MPI_Bcast(sys_types, sys_natoms, MPI_INT, 0, world); +} + +/* ---------------------------------------------------------------------- + >VELOCITIES command +---------------------------------------------------------------------- */ + +void MDIEngine::receive_velocities() +{ + actionflag = 0; + flag_velocities = 1; + int n = 3 * sys_natoms; + int ierr = MDI_Recv(sys_velocities, n, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: >VELOCITIES data"); + MPI_Bcast(sys_velocities, n, MPI_DOUBLE, 0, world); + for (int i = 0; i < n; i++) sys_coords[i] *= mdi2lmp_velocity; +} + +/* ---------------------------------------------------------------------- + receive vector of 3 doubles for all atoms + atoms are ordered by atomID, 1 to Natoms + used by >FORCES command +---------------------------------------------------------------------- */ + +void MDIEngine::receive_double3(int which) +{ + int n = 3 * atom->natoms; + int ierr = MDI_Recv(buf3, n, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: tag; + int nlocal = atom->nlocal; + + int ilocal; + + if (which == FORCE) { + double **f = atom->f; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + f[i][0] = buf3[3 * ilocal + 0] * mdi2lmp_force; + f[i][1] = buf3[3 * ilocal + 1] * mdi2lmp_force; + f[i][2] = buf3[3 * ilocal + 2] * mdi2lmp_force; + } + } else if (which == ADDFORCE) { + double **f = atom->f; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + f[i][0] += buf3[3 * ilocal + 0] * mdi2lmp_force; + f[i][1] += buf3[3 * ilocal + 1] * mdi2lmp_force; + f[i][2] += buf3[3 * ilocal + 2] * mdi2lmp_force; + } + } else if (which == VELOCITY) { + double **v = atom->v; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + v[i][0] = buf3[3 * ilocal + 0] * mdi2lmp_velocity; + v[i][1] = buf3[3 * ilocal + 1] * mdi2lmp_velocity; + v[i][2] = buf3[3 * ilocal + 2] * mdi2lmp_velocity; + } + } +} + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// MDI "<" driver commands that request data +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- + +/* ---------------------------------------------------------------------- + boxhi[0] - domain->boxlo[0]; + celldata[1] = 0.0; + celldata[2] = 0.0; + celldata[3] = domain->xy; + celldata[4] = domain->boxhi[1] - domain->boxlo[1]; + celldata[5] = 0.0; + celldata[6] = domain->xz; + celldata[7] = domain->yz; + celldata[8] = domain->boxhi[2] - domain->boxlo[2]; + + for (int icell = 0; icell < 9; icell++) celldata[icell] *= lmp2mdi_length; + + int ierr = MDI_Send(celldata, 9, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: boxlo[0]; + celldata[1] = domain->boxlo[1]; + celldata[2] = domain->boxlo[2]; + + for (int icell = 0; icell < 3; icell++) celldata[icell] *= lmp2mdi_length; + + int ierr = MDI_Send(celldata, 3, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: compute_scalar(); + double kinetic_energy = ke->compute_scalar(); + double total_energy = potential_energy + kinetic_energy; + total_energy *= lmp2mdi_energy; + + int ierr = MDI_Send(&total_energy, 1, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: natoms * MDI_LABEL_LENGTH]; + memset(labels, ' ', atom->natoms * MDI_LABEL_LENGTH); + + memset(ibuf1, 0, atom->natoms * sizeof(int)); + + // use atomID to index into ordered ibuf1 + + tagint *tag = atom->tag; + int *type = atom->type; + int nlocal = atom->nlocal; + + int ilocal; + + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + ibuf1[ilocal] = type[i]; + } + + MPI_Reduce(ibuf1, ibuf1all, atom->natoms, MPI_INT, MPI_SUM, 0, world); + + if (comm->me == 0) { + for (int iatom = 0; iatom < atom->natoms; iatom++) { + std::string label = std::to_string(ibuf1all[iatom]); + int label_len = std::min(int(label.length()), MDI_LABEL_LENGTH); + strncpy(&labels[iatom * MDI_LABEL_LENGTH], label.c_str(), label_len); + } + } + + int ierr = MDI_Send(labels, atom->natoms * MDI_LABEL_LENGTH, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: (atom->natoms); + int ierr = MDI_Send(&natoms, 1, MDI_INT, mdicomm); + if (ierr != 0) error->all(FLERR, "MDI: compute_scalar(); + potential_energy *= lmp2mdi_energy; + + int ierr = MDI_Send(&potential_energy, 1, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: compute_vector(); + for (int i = 0; i < 6; i++) vtensor[i] = press->vector[i] * lmp2mdi_pressure; + + int ierr = MDI_Send(vtensor, 6, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: natoms * sizeof(double)); + + // use atomID to index into ordered buf1 + + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + if (which == CHARGE) { + double *q = atom->q; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + buf1[ilocal] = q[i]; + } + } else if (which == MASS) { + double *mass = atom->mass; + double *rmass = atom->rmass; + if (rmass) { + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + buf1[ilocal] = rmass[i]; + } + } else { + int *type = atom->type; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + buf1[ilocal] = mass[type[i]]; + } + } + } + + MPI_Reduce(buf1, buf1all, atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); + + int ierr = MDI_Send(buf1all, atom->natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: natoms * sizeof(int)); + + // use atomID to index into ordered ibuf1 + + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + if (which == TYPE) { + int *type = atom->type; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + ibuf1[ilocal] = type[i]; + } + } + + MPI_Reduce(ibuf1, ibuf1all, atom->natoms, MPI_INT, MPI_SUM, 0, world); + + int ierr = MDI_Send(ibuf1all, atom->natoms, MDI_INT, mdicomm); + if (ierr) error->all(FLERR, "MDI: natoms * sizeof(double)); + + // use atomID to index into ordered buf3 + + tagint *tag = atom->tag; + int nlocal = atom->nlocal; + + int ilocal; + + if (which == COORD) { + double **x = atom->x; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + buf3[3 * ilocal + 0] = x[i][0] * lmp2mdi_length; + buf3[3 * ilocal + 1] = x[i][1] * lmp2mdi_length; + buf3[3 * ilocal + 2] = x[i][2] * lmp2mdi_length; + } + } else if (which == FORCE) { + double **f = atom->f; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + buf3[3 * ilocal + 0] = f[i][0] * lmp2mdi_force; + buf3[3 * ilocal + 1] = f[i][1] * lmp2mdi_force; + buf3[3 * ilocal + 2] = f[i][2] * lmp2mdi_force; + } + } else if (which == VELOCITY) { + double **v = atom->v; + for (int i = 0; i < nlocal; i++) { + ilocal = static_cast(tag[i]) - 1; + buf3[3 * ilocal + 0] = v[i][0] * lmp2mdi_velocity; + buf3[3 * ilocal + 1] = v[i][1] * lmp2mdi_velocity; + buf3[3 * ilocal + 2] = v[i][2] * lmp2mdi_velocity; + } + } + + MPI_Reduce(buf3, buf3all, 3 * atom->natoms, MPI_DOUBLE, MPI_SUM, 0, world); + + int ierr = MDI_Send(buf3all, 3 * atom->natoms, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: all(FLERR, "MDI: NBYTES data"); + MPI_Bcast(&nbytes, 1, MPI_INT, 0, world); +} + +/* ---------------------------------------------------------------------- + COMMAND command + store received value as string of length nbytes + invoke as a LAMMPS command +---------------------------------------------------------------------- */ + +void MDIEngine::single_command() +{ + if (nbytes < 0) error->all(FLERR, "MDI: COMMAND nbytes has not been set"); + + auto cmd = new char[nbytes + 1]; + int ierr = MDI_Recv(cmd, nbytes + 1, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: COMMAND data"); + MPI_Bcast(cmd, nbytes + 1, MPI_CHAR, 0, world); + cmd[nbytes] = '\0'; + + lammps_command(lmp, cmd); + + delete[] cmd; +} + +/* ---------------------------------------------------------------------- + COMMANDS command + store received value as multi-line string of length nbytes + invoke as multiple LAMMPS commands +---------------------------------------------------------------------- */ + +void MDIEngine::many_commands() +{ + if (nbytes < 0) error->all(FLERR, "MDI: COMMANDS nbytes has not been set"); + + auto cmds = new char[nbytes + 1]; + int ierr = MDI_Recv(cmds, nbytes + 1, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: COMMANDS data"); + MPI_Bcast(cmds, nbytes + 1, MPI_CHAR, 0, world); + cmds[nbytes] = '\0'; + + lammps_commands_string(lmp, cmds); + + delete[] cmds; +} + +/* ---------------------------------------------------------------------- + INFILE command + store received value as infile of length length_param + invoke as a LAMMPS input script +---------------------------------------------------------------------- */ + +void MDIEngine::infile() +{ + if (nbytes < 0) error->all(FLERR, "MDI: INFILE nbytes has not been set"); + + auto infile = new char[nbytes + 1]; + int ierr = MDI_Recv(infile, nbytes + 1, MDI_CHAR, mdicomm); + if (ierr) error->all(FLERR, "MDI: INFILE data for {}", infile); + MPI_Bcast(infile, nbytes + 1, MPI_CHAR, 0, world); + infile[nbytes] = '\0'; + + lammps_file(lmp, infile); + + delete[] infile; +} + +/* ---------------------------------------------------------------------- + compute_scalar(); + kinetic_energy *= lmp2mdi_energy; + + int ierr = MDI_Send(&kinetic_energy, 1, MDI_DOUBLE, mdicomm); + if (ierr) error->all(FLERR, "MDI: MAXSMALLINT) error->all(FLERR, "Natoms too large to use with mdi engine"); + + maxatom = sys_natoms; + + deallocate(); + allocate(); +} + +void MDIEngine::deallocate() +{ + memory->destroy(sys_types); + memory->destroy(sys_coords); + memory->destroy(sys_velocities); + memory->destroy(sys_charges); + + memory->destroy(ibuf1); + memory->destroy(buf1); + memory->destroy(buf3); + + memory->destroy(ibuf1all); + memory->destroy(buf1all); + memory->destroy(buf3all); +} + +void MDIEngine::allocate() +{ + memory->create(sys_types, maxatom, "mdi:sys_types"); + memory->create(sys_coords, 3 * maxatom, "mdi:sys_coords"); + memory->create(sys_velocities, 3 * maxatom, "mdi:sys_velocities"); + memory->create(sys_charges, maxatom, "mdi:sys_charges"); + + memory->create(ibuf1, maxatom, "mdi:ibuf1"); + memory->create(buf1, maxatom, "mdi:buf1"); + memory->create(buf3, 3 * maxatom, "mdi:buf3"); + + memory->create(ibuf1all, maxatom, "mdi:ibuf1all"); + memory->create(buf1all, maxatom, "mdi:buf1all"); + memory->create(buf3all, 3 * maxatom, "mdi:buf3all"); +} + +/* ---------------------------------------------------------------------- + MDI to/from LAMMPS conversion factors +------------------------------------------------------------------------- */ + +void MDIEngine::unit_conversions() +{ + double angstrom_to_bohr, kelvin_to_hartree, ev_to_hartree, second_to_aut; + + MDI_Conversion_factor("angstrom", "bohr", &angstrom_to_bohr); + MDI_Conversion_factor("kelvin_energy", "hartree", &kelvin_to_hartree); + MDI_Conversion_factor("electron_volt", "hartree", &ev_to_hartree); + MDI_Conversion_Factor("second", "atomic_unit_of_time", &second_to_aut); + + // length units + + mdi2lmp_length = 1.0; + lmp2mdi_length = 1.0; + + if (lmpunits == REAL || lmpunits == METAL) { + lmp2mdi_length = angstrom_to_bohr; + mdi2lmp_length = 1.0 / angstrom_to_bohr; + } + + // energy units + + mdi2lmp_energy = 1.0; + lmp2mdi_energy = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_energy = kelvin_to_hartree / force->boltz; + mdi2lmp_energy = force->boltz / kelvin_to_hartree; + } else if (lmpunits == METAL) { + lmp2mdi_energy = ev_to_hartree; + mdi2lmp_energy = 1.0 / ev_to_hartree; + } + + // force units = energy/length + + mdi2lmp_force = 1.0; + lmp2mdi_force = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_force = (kelvin_to_hartree / force->boltz) / angstrom_to_bohr; + mdi2lmp_force = 1.0 / lmp2mdi_force; + } else if (lmpunits == METAL) { + lmp2mdi_force = ev_to_hartree / angstrom_to_bohr; + mdi2lmp_force = angstrom_to_bohr / ev_to_hartree; + } + + // pressure or stress units = force/area = energy/volume + + mdi2lmp_pressure = 1.0; + lmp2mdi_pressure = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_pressure = (kelvin_to_hartree / force->boltz) / + (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; + mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; + } else if (lmpunits == METAL) { + lmp2mdi_pressure = + ev_to_hartree / (angstrom_to_bohr * angstrom_to_bohr * angstrom_to_bohr) / force->nktv2p; + mdi2lmp_pressure = 1.0 / lmp2mdi_pressure; + } + + // velocity units = distance/time + + mdi2lmp_velocity = 1.0; + lmp2mdi_velocity = 1.0; + + if (lmpunits == REAL) { + lmp2mdi_velocity = angstrom_to_bohr / (1.0e-15 * second_to_aut); + mdi2lmp_velocity = 1.0 / lmp2mdi_velocity; + } else if (lmpunits == METAL) { + lmp2mdi_velocity = angstrom_to_bohr / (1.0e-12 * second_to_aut); + mdi2lmp_velocity = 1.0 / lmp2mdi_velocity; + } } diff --git a/src/MDI/mdi_engine.h b/src/MDI/mdi_engine.h index 5202b811d8..65207e50eb 100644 --- a/src/MDI/mdi_engine.h +++ b/src/MDI/mdi_engine.h @@ -11,35 +11,135 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef COMMAND_CLASS -// clang-format off -CommandStyle(mdi/engine, MDIEngine); -// clang-format on -#else - #ifndef LMP_MDI_ENGINE_H #define LMP_MDI_ENGINE_H -#include "command.h" +#include "mdi.h" +#include "pointers.h" namespace LAMMPS_NS { -class MDIEngine : public Command { +class MDIEngine : protected Pointers { public: - MDIEngine(LAMMPS *lmp) : Command(lmp) {} + MDIEngine(class LAMMPS *, int, char **); - void command(int, char **) override; + int execute_command(const char *command, MDI_Comm mdicomm); + void engine_node(const char *node); private: - class FixMDIEngine *mdi_fix; + int lmpunits; // REAL or METAL or NATIVE + int root; // 1 for proc 0, otherwise 0 - char *mdi_md(); - char *mdi_optg(); + MDI_Comm mdicomm; // MDI communicator + + // state of MDI engine + + int mode; // which mode engine is in (DEFAULT,MD,OPTG) + char *mdicmd; // current MDI command being processed + char *node_engine; // which node engine is at + char *node_driver; // which node driver has requested + bool node_match; // true if driver and engine node currently match + bool exit_command; // true if EXIT command received from driver + + // unit conversion factors + + double lmp2mdi_length, mdi2lmp_length; + double lmp2mdi_energy, mdi2lmp_energy; + double lmp2mdi_velocity, mdi2lmp_velocity; + double lmp2mdi_force, mdi2lmp_force; + double lmp2mdi_pressure, mdi2lmp_pressure; + double lmp2mdi_virial, mdi2lmp_virial; + + // flags for data received by engine + // not acted on until a request to send + +#include + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- + trigger LAMMPS to load an MDI plugin engine + after loading the plugin library, it executes a LAMMPS command such as "run" + the command will use other LAMMPS commands, such as fix mdi/aimd + which act as an MDI driver, issuing MDI commands to the engine + when MDI_Launch_plugin() exits, the engine is shut down and + this class is destroyed +---------------------------------------------------------------------- */ + +MDIPlugin::MDIPlugin(LAMMPS *_lmp, int narg, char **arg) : Pointers(_lmp) +{ + if (narg < 1) error->all(FLERR, "Illegal mdi plugin command"); + + char *plugin_name = arg[0]; + + char *mdi_arg = nullptr; + char *infile_arg = nullptr; + char *extra_arg = nullptr; + lammps_command = nullptr; + + int iarg = 1; + while (iarg < narg) { + if (strcmp(arg[iarg], "mdi") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal mdi plugin command"); + mdi_arg = arg[iarg + 1]; + iarg += 2; + } else if (strcmp(arg[iarg], "infile") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal mdi plugin command"); + infile_arg = arg[iarg + 1]; + iarg += 2; + } else if (strcmp(arg[iarg], "extra") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal mdi plugin command"); + extra_arg = arg[iarg + 1]; + iarg += 2; + } else if (strcmp(arg[iarg], "command") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal mdi plugin command"); + int n = strlen(arg[iarg + 1]) + 1; + lammps_command = new char[n]; + strcpy(lammps_command, arg[iarg + 1]); + iarg += 2; + } else + error->all(FLERR, "Illegal mdi plugin command"); + } + + // error checks + + if (!mdi_arg || !infile_arg || !lammps_command) + error->all(FLERR, "MDI plugin must specify mdi, infile, command keywords"); + + // build full plugin_args string for args to plugin library + + int n = strlen(mdi_arg) + strlen(infile_arg) + strlen(extra_arg) + 16; + auto plugin_args = new char[n]; + plugin_args[0] = 0; + strcat(plugin_args, "-mdi \""); + strcat(plugin_args, mdi_arg); + strcat(plugin_args, "\" -in "); + strcat(plugin_args, infile_arg); + if (extra_arg) { + strcat(plugin_args, " "); + strcat(plugin_args, extra_arg); + } + + // launch the MDI plugin library + // path for lib was specified in -mdi command-line arg when LAMMPS started + // this calls back to plugin_wrapper, which must issue MDI EXIT at end + + MDI_Launch_plugin(plugin_name, plugin_args, &world, plugin_wrapper, (void *) this); + + delete[] plugin_args; +} + +/* ---------------------------------------------------------------------- + callback function from MDI_Launch_plugin() + this function wraps entire interaction of LAMMPS driver with the plugin +---------------------------------------------------------------------- */ + +int MDIPlugin::plugin_wrapper(void * /*pmpicomm*/, MDI_Comm mdicomm, void *vptr) +{ + auto ptr = (MDIPlugin *) vptr; + LAMMPS *lammps = ptr->lmp; + char *lammps_command = ptr->lammps_command; + + // invoke the specified LAMMPS command + // that operation will issue MDI commands to the plugin engine + + lammps->input->one(lammps_command); + delete[] lammps_command; + + // send MDI exit to plugin, which unloads the plugin + + MDI_Send_command("EXIT", mdicomm); + + return 0; +} diff --git a/src/MESSAGE/server.h b/src/MDI/mdi_plugin.h similarity index 55% rename from src/MESSAGE/server.h rename to src/MDI/mdi_plugin.h index e82ac7e8b0..3299658dc8 100644 --- a/src/MESSAGE/server.h +++ b/src/MDI/mdi_plugin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -11,30 +11,34 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef COMMAND_CLASS -// clang-format off -CommandStyle(server,Server); -// clang-format on -#else +#ifndef LMP_MDI_PLUGIN_H +#define LMP_MDI_PLUGIN_H -#ifndef LMP_SERVER_H -#define LMP_SERVER_H - -#include "command.h" +#include "mdi.h" +#include "pointers.h" namespace LAMMPS_NS { -class Server : public Command { +class MDIPlugin : protected Pointers { public: - Server(class LAMMPS *lmp) : Command(lmp){}; - void command(int, char **) override; + MDIPlugin(class LAMMPS *, int, char **); + + private: + char *lammps_command; + + static int plugin_wrapper(void *, MDI_Comm, void *); }; } // namespace LAMMPS_NS -#endif #endif /* ERROR/WARNING messages: +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + */ diff --git a/src/MESSAGE/Install.sh b/src/MESSAGE/Install.sh deleted file mode 100644 index 853dbddcdd..0000000000 --- a/src/MESSAGE/Install.sh +++ /dev/null @@ -1,67 +0,0 @@ -# Install/unInstall package files in LAMMPS -# mode = 0/1/2 for uninstall/install/update - -mode=$1 - -# arg1 = file, arg2 = file it depends on - -# enforce using portable C locale -LC_ALL=C -export LC_ALL - -action () { - if (test $mode = 0) then - rm -f ../$1 - elif (! cmp -s $1 ../$1) then - if (test -z "$2" || test -e ../$2) then - cp $1 .. - if (test $mode = 2) then - echo " updating src/$1" - fi - fi - elif (test -n "$2") then - if (test ! -e ../$2) then - rm -f ../$1 - fi - fi -} - -# all package files with no dependencies - -for file in *.cpp *.h; do - test -f ${file} && action $file -done - -# edit 2 Makefile.package files to include/exclude package info - -if (test $1 = 1) then - - if (test -e ../Makefile.package) then - sed -i -e 's/[^ \t]*message[^ \t]* //' ../Makefile.package - sed -i -e 's|^PKG_INC =[ \t]*|&-I../../lib/message/cslib/src |' ../Makefile.package - sed -i -e 's|^PKG_PATH =[ \t]*|&-L../../lib/message/cslib/src |' ../Makefile.package - sed -i -e 's|^PKG_LIB =[ \t]*|&-lmessage |' ../Makefile.package - sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(message_SYSINC) |' ../Makefile.package - sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(message_SYSLIB) |' ../Makefile.package - sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(message_SYSPATH) |' ../Makefile.package - fi - - if (test -e ../Makefile.package.settings) then - sed -i -e '/^include.*message.*$/d' ../Makefile.package.settings - # multiline form needed for BSD sed on Macs - sed -i -e '4 i \ -include ..\/..\/lib\/message\/Makefile.lammps -' ../Makefile.package.settings - fi - -elif (test $1 = 0) then - - if (test -e ../Makefile.package) then - sed -i -e 's/[^ \t]*message[^ \t]* //' ../Makefile.package - fi - - if (test -e ../Makefile.package.settings) then - sed -i -e '/^include.*message.*$/d' ../Makefile.package.settings - fi - -fi diff --git a/src/MESSAGE/fix_client_md.cpp b/src/MESSAGE/fix_client_md.cpp deleted file mode 100644 index 960f4e144b..0000000000 --- a/src/MESSAGE/fix_client_md.cpp +++ /dev/null @@ -1,309 +0,0 @@ -// clang-format off -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, 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 "fix_client_md.h" - -#include "atom.h" -#include "comm.h" -#include "domain.h" -#include "error.h" -#include "force.h" -#include "memory.h" -#include "update.h" - -#include - -// CSlib interface - -#include "cslib.h" - -using namespace LAMMPS_NS; -using namespace CSLIB_NS; -using namespace FixConst; - -enum{OTHER,REAL,METAL}; -enum{SETUP=1,STEP}; -enum{DIM=1,PERIODICITY,ORIGIN,BOX,NATOMS,NTYPES,TYPES,COORDS,UNITS,CHARGE}; -enum{FORCES=1,ENERGY,PRESSURE,ERROR}; - -/* ---------------------------------------------------------------------- */ - -FixClientMD::FixClientMD(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) -{ - if (lmp->clientserver != 1) - error->all(FLERR,"Fix client/md requires LAMMPS be running as a client"); - if (atom->map_style == Atom::MAP_NONE) - error->all(FLERR,"Fix client/md requires atom map"); - - if (sizeof(tagint) != 4) - error->all(FLERR,"Fix client/md only supports 32-bit atom IDs"); - - if (strcmp(update->unit_style,"real") == 0) units = REAL; - else if (strcmp(update->unit_style,"metal") == 0) units = METAL; - else units = OTHER; - - scalar_flag = 1; - global_freq = 1; - extscalar = 1; - energy_global_flag = virial_global_flag = 1; - thermo_energy = thermo_virial = 1; - - inv_nprocs = 1.0 / comm->nprocs; - if (domain->dimension == 2) - box[0][2] = box[1][2] = box[2][0] = box[2][1] = box[2][2] = 0.0; - - maxatom = 0; - xpbc = nullptr; - - // unit conversion factors for REAL - // otherwise not needed - // message received in METAL units, convert to local REAL units - - fconvert = econvert = pconvert = 1.0; - if (units == REAL) { - fconvert = econvert = 23.06035; // eV -> Kcal/mole - pconvert = 0.986923; // bars -> atmospheres - } -} - -/* ---------------------------------------------------------------------- */ - -FixClientMD::~FixClientMD() -{ - memory->destroy(xpbc); -} - -/* ---------------------------------------------------------------------- */ - -int FixClientMD::setmask() -{ - int mask = 0; - mask |= POST_FORCE; - mask |= MIN_POST_FORCE; - return mask; -} - -/* ---------------------------------------------------------------------- */ - -void FixClientMD::init() -{ - if (3*atom->natoms > INT_MAX) - error->all(FLERR,"Fix client/md max atoms is 1/3 of 2^31"); -} - -/* ---------------------------------------------------------------------- */ - -void FixClientMD::setup(int vflag) -{ - CSlib *cs = (CSlib *) lmp->cslib; - - // SETUP send at beginning of each run - // required fields: DIM, PERIODICTY, ORIGIN, BOX, NATOMS, NTYPES, TYPES, COORDS - // optional fields: others in enum above - - int nfields = 8; - if (units == OTHER) nfields++; - if (atom->q_flag) nfields++; - - cs->send(SETUP,nfields); - - cs->pack_int(DIM,domain->dimension); - cs->pack(PERIODICITY,1,3,domain->periodicity); - - pack_box(); - cs->pack(ORIGIN,4,3,domain->boxlo); - cs->pack(BOX,4,9,&box[0][0]); - - cs->pack_int(NATOMS,atom->natoms); - cs->pack_int(NTYPES,atom->ntypes); - - cs->pack_parallel(TYPES,1,atom->nlocal,atom->tag,1,atom->type); - pack_coords(); - cs->pack_parallel(COORDS,4,atom->nlocal,atom->tag,3,xpbc); - - if (units == OTHER) cs->pack_string(UNITS,update->unit_style); - - if (atom->q_flag) - cs->pack_parallel(CHARGE,4,atom->nlocal,atom->tag,1,atom->q); - - // receive initial forces, energy, virial - - receive_fev(vflag); - - if (server_error) { - char str[64]; - sprintf(str,"Fix client/md received server error %d\n",server_error); - error->all(FLERR,str); - } -} - -/* ---------------------------------------------------------------------- */ - -void FixClientMD::min_setup(int vflag) -{ - setup(vflag); -} - -/* ---------------------------------------------------------------------- */ - -void FixClientMD::post_force(int vflag) -{ - // virial setup - - v_init(vflag); - - // STEP send every step - // required fields: COORDS - // optional fields: ORIGIN, BOX - - // send coords - - CSlib *cs = (CSlib *) lmp->cslib; - - int nfields = 1; - if (domain->box_change) nfields += 2; - - cs->send(STEP,nfields); - - pack_coords(); - cs->pack_parallel(COORDS,4,atom->nlocal,atom->tag,3,xpbc); - - if (domain->box_change) { - pack_box(); - cs->pack(ORIGIN,4,3,domain->boxlo); - cs->pack(BOX,4,9,&box[0][0]); - } - - // receive forces, energy, virial - - receive_fev(vflag); - - if (server_error) { - char str[64]; - sprintf(str,"Fix client/md received server error %d\n",server_error); - error->all(FLERR,str); - } -} - -/* ---------------------------------------------------------------------- */ - -void FixClientMD::min_post_force(int vflag) -{ - post_force(vflag); -} - -/* ---------------------------------------------------------------------- - potential energy from server -------------------------------------------------------------------------- */ - -double FixClientMD::compute_scalar() -{ - return eng; -} - -/* ---------------------------------------------------------------------- - pack local coords into xpbc, enforcing PBC -------------------------------------------------------------------------- */ - -void FixClientMD::pack_coords() -{ - double **x = atom->x; - int nlocal = atom->nlocal; - - if (nlocal > maxatom) { - memory->destroy(xpbc); - maxatom = atom->nmax; - memory->create(xpbc,3*maxatom,"message:xpbc"); - } - - memcpy(xpbc,&x[0][0],3*nlocal*sizeof(double)); - - int j = 0; - for (int i = 0; i < nlocal; i++) { - domain->remap(&xpbc[j]); - j += 3; - } -} - -/* ---------------------------------------------------------------------- - pack box info into box = 3 edge vectors of simulation box -------------------------------------------------------------------------- */ - -void FixClientMD::pack_box() -{ - double *boxlo = domain->boxlo; - double *boxhi = domain->boxhi; - - box[0][0] = boxhi[0] - boxlo[0]; - box[0][1] = 0.0; - box[0][2] = 0.0; - box[1][0] = domain->xy; - box[1][1] = boxhi[1] - boxlo[1]; - box[1][2] = 0.0; - box[2][0] = domain->xz; - box[2][1] = domain->yz; - box[2][2] = boxhi[2] - boxlo[2]; -} - -/* ---------------------------------------------------------------------- - receive message from server - required fields: FORCES, ENERGY, PRESSURE - optional field: ERROR -------------------------------------------------------------------------- */ - -void FixClientMD::receive_fev(int vflag) -{ - CSlib *cs = (CSlib *) lmp->cslib; - - int nfield; - int *fieldID,*fieldtype,*fieldlen; - - cs->recv(nfield,fieldID,fieldtype,fieldlen); - - double *forces = (double *) cs->unpack(FORCES); - double **f = atom->f; - int nlocal = atom->nlocal; - bigint natoms = atom->natoms; - int m; - - int j = 0; - for (tagint id = 1; id <= natoms; id++) { - m = atom->map(id); - if (m < 0 || m >= nlocal) j += 3; - else { - f[m][0] += fconvert * forces[j++]; - f[m][1] += fconvert * forces[j++]; - f[m][2] += fconvert * forces[j++]; - } - } - - eng = econvert * cs->unpack_double(ENERGY); - - if (vflag) { - double *v = (double *) cs->unpack(PRESSURE); - - double nktv2p = force->nktv2p; - double volume = domain->xprd * domain->yprd * domain->zprd; - double factor = inv_nprocs * pconvert * volume / nktv2p; - - for (int i = 0; i < 6; i++) - virial[i] = factor * v[i]; - } - - // error return - - server_error = 0; - if (nfield == 4) server_error = cs->unpack_int(ERROR); -} diff --git a/src/MESSAGE/message.cpp b/src/MESSAGE/message.cpp deleted file mode 100644 index e1530fd081..0000000000 --- a/src/MESSAGE/message.cpp +++ /dev/null @@ -1,122 +0,0 @@ -// clang-format off -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, 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 "message.h" -#include -#include "error.h" - -// CSlib interface - -#include "cslib.h" - -using namespace LAMMPS_NS; -using namespace CSLIB_NS; - -/* ---------------------------------------------------------------------- */ - -void Message::command(int narg, char **arg) -{ - if (narg < 1) error->all(FLERR,"Illegal message command"); - - int clientserver=0; - if (strcmp(arg[0],"client") == 0) clientserver = 1; - else if (strcmp(arg[0],"server") == 0) clientserver = 2; - else if (strcmp(arg[0],"quit") == 0) clientserver = 0; - else error->all(FLERR,"Illegal message command"); - - // shutdown current client mode - - if (clientserver == 0) { - if (lmp->clientserver != 1) - error->all(FLERR,"Cannot message quit if not in client mode"); - quit(); - return; - } - - // setup client or server mode - - lmp->clientserver = clientserver; - - // validate supported protocols - - if (narg < 3) error->all(FLERR,"Illegal message command"); - - if ((strcmp(arg[1],"md") != 0) && (strcmp(arg[1],"mc") != 0)) - error->all(FLERR,"Unknown message protocol"); - - // instantiate CSlib with chosen communication mode - - if (strcmp(arg[2],"file") == 0 || strcmp(arg[2],"zmq") == 0 || - strcmp(arg[2],"mpi/two") == 0) { - if (narg != 4) error->all(FLERR,"Illegal message command"); - lmp->cslib = new CSlib(clientserver-1,arg[2],arg[3],&world); - - } else if (strcmp(arg[2],"mpi/one") == 0) { - if (narg != 3) error->all(FLERR,"Illegal message command"); - if (!lmp->cscomm) - error->all(FLERR,"Message mpi/one mode, but -mpi cmdline arg not used"); - lmp->cslib = new CSlib(clientserver-1,arg[2],&lmp->cscomm,&world); - - } else error->all(FLERR,"Illegal message command"); - - // perform initial handshake between client and server - // other code being coupled to must perform similar operation - // client sends protocol with msgID = 0 - // server matches it and replies - - CSlib *cs = (CSlib *) lmp->cslib; - - if (clientserver == 1) { - cs->send(0,1); - cs->pack_string(1,arg[1]); - - int nfield; - int *fieldID,*fieldtype,*fieldlen; - int msgID = cs->recv(nfield,fieldID,fieldtype,fieldlen); - if (msgID != 0) error->one(FLERR,"Bad initial client/server handshake"); - - } else { - int nfield; - int *fieldID,*fieldtype,*fieldlen; - int msgID = cs->recv(nfield,fieldID,fieldtype,fieldlen); - if (msgID != 0) error->one(FLERR,"Bad initial client/server handshake"); - char *pstr = cs->unpack_string(1); - if (strcmp(pstr,arg[1]) != 0) - error->one(FLERR,"Mismatch in client/server protocol"); - - cs->send(0,0); - } -} - -/* ---------------------------------------------------------------------- */ - -void Message::quit() -{ - CSlib *cs = (CSlib *) lmp->cslib; - - // send all-done message to server - // receive acknowledgement back - - cs->send(-1,0); - - int nfield; - int *fieldID,*fieldtype,*fieldlen; - cs->recv(nfield,fieldID,fieldtype,fieldlen); - - // clean-up - - delete cs; - lmp->cslib = nullptr; - lmp->clientserver = 0; -} diff --git a/src/MESSAGE/server.cpp b/src/MESSAGE/server.cpp deleted file mode 100644 index 76cd4ca4e4..0000000000 --- a/src/MESSAGE/server.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// clang-format off -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, 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 "server.h" -#include -#include "error.h" - -// customize by adding a new server protocol include and enum - -#include "server_md.h" -#include "server_mc.h" - -using namespace LAMMPS_NS; - -enum{MD,MC}; - -/* ---------------------------------------------------------------------- */ - -void Server::command(int narg, char **arg) -{ - if (narg != 1) error->all(FLERR,"Illegal server command"); - - if (lmp->clientserver != 2) - error->all(FLERR,"Message command not used to setup LAMMPS as a server"); - - // customize by adding a new server protocol - - int protocol; - if (strcmp(arg[0],"md") == 0) protocol = MD; - else if (strcmp(arg[0],"mc") == 0) protocol = MC; - else error->all(FLERR,"Unknown message protocol"); - - if (protocol == MD) { - ServerMD *server = new ServerMD(lmp); - server->loop(); - } else if (protocol == MC) { - ServerMC *server = new ServerMC(lmp); - server->loop(); - } -} diff --git a/src/MESSAGE/server_mc.cpp b/src/MESSAGE/server_mc.cpp deleted file mode 100644 index f549056b53..0000000000 --- a/src/MESSAGE/server_mc.cpp +++ /dev/null @@ -1,148 +0,0 @@ -// clang-format off -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, 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 "server_mc.h" -#include "atom.h" -#include "domain.h" -#include "update.h" -#include "integrate.h" -#include "input.h" -#include "output.h" -#include "thermo.h" -#include "error.h" - -// CSlib interface - -#include "cslib.h" - -using namespace LAMMPS_NS; -using namespace CSLIB_NS; - -enum{NATOMS=1,EINIT,DISPLACE,ACCEPT,RUN}; - -/* ---------------------------------------------------------------------- */ - -ServerMC::ServerMC(LAMMPS *lmp) : Pointers(lmp) {} - -/* ---------------------------------------------------------------------- */ - -void ServerMC::loop() -{ - int m; - double xold[3]; - tagint atomid; - - CSlib *cs = (CSlib *) lmp->cslib; - - if (domain->box_exist == 0) - error->all(FLERR,"Server command before simulation box is defined"); - - if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Server mc requires atom map"); - if (atom->tag_enable == 0) error->all(FLERR,"Server mc requires atom IDs"); - if (sizeof(tagint) != 4) error->all(FLERR,"Server mc requires 32-bit atom IDs"); - - // initialize LAMMPS for dynamics - - input->one("run 0"); - - // loop on messages - // receive a message, process it, send return message if necessary - - int msgID,nfield; - int *fieldID,*fieldtype,*fieldlen; - - while (1) { - msgID = cs->recv(nfield,fieldID,fieldtype,fieldlen); - if (msgID < 0) break; - - if (msgID == NATOMS) { - - cs->send(msgID,1); - cs->pack_int(1,atom->natoms); - - } else if (msgID == EINIT) { - - double dval; - output->thermo->evaluate_keyword((char *) "pe",&dval); - - cs->send(msgID,2); - cs->pack_double(1,dval); - double *coords = nullptr; - if (atom->nlocal) coords = &atom->x[0][0]; - cs->pack_parallel(2,4,atom->nlocal,atom->tag,3,coords); - - } else if (msgID == DISPLACE) { - - atomid = cs->unpack_int(1); - double *xnew = (double *) cs->unpack(2); - double **x = atom->x; - - m = atom->map(atomid); - if (m >= 0 && m < atom->nlocal) { - xold[0] = x[m][0]; - xold[1] = x[m][1]; - xold[2] = x[m][2]; - x[m][0] = xnew[0]; - x[m][1] = xnew[1]; - x[m][2] = xnew[2]; - } - - input->one("run 0"); - double dval; - output->thermo->evaluate_keyword((char *) "pe",&dval); - - cs->send(msgID,1); - cs->pack_double(1,dval); - - } else if (msgID == ACCEPT) { - - int accept = cs->unpack_int(1); - double **x = atom->x; - - if (!accept) { - m = atom->map(atomid); - if (m >= 0 && m < atom->nlocal) { - x[m][0] = xold[0]; - x[m][1] = xold[1]; - x[m][2] = xold[2]; - } - } - - cs->send(msgID,0); - - } else if (msgID == RUN) { - - int nsteps = cs->unpack_int(1); - - update->nsteps = nsteps; - update->firststep = update->ntimestep; - update->laststep = update->ntimestep + nsteps; - - update->integrate->setup(1); - update->integrate->run(nsteps); - - cs->send(msgID,0); - - } else error->all(FLERR,"Server received unrecognized message"); - } - - // final reply to client - - cs->send(0,0); - - // clean up - - delete cs; - lmp->cslib = nullptr; -} diff --git a/src/MESSAGE/server_mc.h b/src/MESSAGE/server_mc.h deleted file mode 100644 index 0b22ca392a..0000000000 --- a/src/MESSAGE/server_mc.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, 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. -------------------------------------------------------------------------- */ - -#ifndef LMP_SERVER_MC_H -#define LMP_SERVER_MC_H - -#include "pointers.h" - -namespace LAMMPS_NS { - -class ServerMC : protected Pointers { - public: - ServerMC(class LAMMPS *); - void loop(); -}; - -} // namespace LAMMPS_NS - -#endif diff --git a/src/MESSAGE/server_md.cpp b/src/MESSAGE/server_md.cpp deleted file mode 100644 index 80e349c89b..0000000000 --- a/src/MESSAGE/server_md.cpp +++ /dev/null @@ -1,391 +0,0 @@ -// clang-format off -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/, 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 "server_md.h" - -#include "atom.h" -#include "atom_vec.h" -#include "comm.h" -#include "domain.h" -#include "error.h" -#include "force.h" -#include "integrate.h" -#include "kspace.h" -#include "memory.h" -#include "neighbor.h" -#include "pair.h" -#include "update.h" - -#include - -// CSlib interface - -#include "cslib.h" - -using namespace LAMMPS_NS; -using namespace CSLIB_NS; - -enum{OTHER,REAL,METAL}; -enum{SETUP=1,STEP}; -enum{DIM=1,PERIODICITY,ORIGIN,BOX,NATOMS,NTYPES,TYPES,COORDS,UNITS,CHARGE}; -enum{FORCES=1,ENERGY,PRESSURE,ERROR}; - -/* ---------------------------------------------------------------------- */ - -ServerMD::ServerMD(LAMMPS *lmp) : Pointers(lmp) -{ - if (domain->box_exist == 0) - error->all(FLERR,"Server command before simulation box is defined"); - - if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Server md requires atom map"); - if (atom->tag_enable == 0) error->all(FLERR,"Server md requires atom IDs"); - if (sizeof(tagint) != 4) error->all(FLERR,"Server md requires 32-bit atom IDs"); - - if (strcmp(update->unit_style,"real") == 0) units = REAL; - else if (strcmp(update->unit_style,"metal") == 0) units = METAL; - else units = OTHER; - - // unit conversion factors for REAL - // otherwise not needed - // local computation in REAL units, send message in METAL units - - fconvert = econvert = pconvert = 1.0; - if (units == REAL) { - fconvert = econvert = 1.0 / 23.06035; // Kcal/mole -> eV - pconvert = 1.0 / 0.986923; // atmospheres -> bars - } - - fcopy = nullptr; -} - -/* ---------------------------------------------------------------------- */ - -ServerMD::~ServerMD() -{ - memory->destroy(fcopy); -} - -/* ---------------------------------------------------------------------- */ - -void ServerMD::loop() -{ - int j,m; - - // cs = instance of CSlib - - CSlib *cs = (CSlib *) lmp->cslib; - - // counters - - int forcecalls = 0; - int neighcalls = 0; - - // loop on messages - // receive a message, process it, send return message - - int msgID,nfield; - int *fieldID,*fieldtype,*fieldlen; - - while (1) { - msgID = cs->recv(nfield,fieldID,fieldtype,fieldlen); - if (msgID < 0) break; - - // SETUP receive at beginning of each run - // required fields: DIM, PERIODICTY, ORIGIN, BOX, - // NATOMS, NTYPES, TYPES, COORDS - // optional fields: others in enum above - - if (msgID == SETUP) { - - int dim = 0; - int *periodicity = nullptr; - int natoms = -1; - int ntypes = -1; - double *origin = nullptr; - double *box = nullptr; - int *types = nullptr; - double *coords = nullptr; - char *unit_style = nullptr; - double *charge = nullptr; - - for (int ifield = 0; ifield < nfield; ifield++) { - if (fieldID[ifield] == DIM) { - dim = cs->unpack_int(DIM); - if (dim != domain->dimension) - error->all(FLERR,"Server md dimension mis-match with client"); - } else if (fieldID[ifield] == PERIODICITY) { - periodicity = (int *) cs->unpack(PERIODICITY); - if (periodicity[0] != domain->periodicity[0] || - periodicity[1] != domain->periodicity[1] || - periodicity[2] != domain->periodicity[2]) - error->all(FLERR,"Server md periodicity mis-match with client"); - } else if (fieldID[ifield] == ORIGIN) { - origin = (double *) cs->unpack(ORIGIN); - } else if (fieldID[ifield] == BOX) { - box = (double *) cs->unpack(BOX); - } else if (fieldID[ifield] == NATOMS) { - natoms = cs->unpack_int(NATOMS); - if (3*natoms > INT_MAX) - error->all(FLERR,"Server md max atoms is 1/3 of 2^31"); - } else if (fieldID[ifield] == NTYPES) { - ntypes = cs->unpack_int(NTYPES); - if (ntypes != atom->ntypes) - error->all(FLERR,"Server md ntypes mis-match with client"); - } else if (fieldID[ifield] == TYPES) { - types = (int *) cs->unpack(TYPES); - } else if (fieldID[ifield] == COORDS) { - coords = (double *) cs->unpack(COORDS); - - } else if (fieldID[ifield] == UNITS) { - unit_style = (char *) cs->unpack(UNITS); - } else if (fieldID[ifield] == CHARGE) { - charge = (double *) cs->unpack(CHARGE); - } else error->all(FLERR,"Server md setup field unknown"); - } - - if (dim == 0 || !periodicity || !origin || !box || - natoms < 0 || ntypes < 0 || !types || !coords) - error->all(FLERR,"Required server md setup field not received"); - - if (unit_style && strcmp(unit_style,update->unit_style) != 0) - error->all(FLERR,"Server md does not match client units"); - - if (charge && atom->q_flag == 0) - error->all(FLERR,"Server md does not define atom attribute q"); - - // reset box, global and local - // reset proc decomposition - - if ((box[3] != 0.0 || box[6] != 0.0 || box[7] != 0.0) && - domain->triclinic == 0) - error->all(FLERR,"Server md is not initialized for a triclinic box"); - - box_change(origin,box); - - domain->set_initial_box(); - domain->set_global_box(); - comm->set_proc_grid(); - domain->set_local_box(); - - // clear all atoms - - atom->nlocal = 0; - atom->nghost = 0; - - // add atoms that are in my sub-box - - int nlocal = 0; - for (int i = 0; i < natoms; i++) { - if (!domain->ownatom(i+1,&coords[3*i],nullptr,0)) continue; - atom->avec->create_atom(types[i],&coords[3*i]); - atom->tag[nlocal] = i+1; - if (charge) atom->q[nlocal] = charge[i]; - nlocal++; - } - - int ntotal; - MPI_Allreduce(&atom->nlocal,&ntotal,1,MPI_INT,MPI_SUM,world); - if (ntotal != natoms) - error->all(FLERR,"Server md atom count does not match client"); - - atom->map_init(); - atom->map_set(); - atom->natoms = natoms; - - // allocate fcopy if needed - - if (units == REAL) { - memory->destroy(fcopy); - memory->create(fcopy,atom->nlocal,3,"server/md:fcopy"); - } - - // perform system setup() for dynamics - // also OK for minimization, since client runs minimizer - // return forces, energy, virial to client - - update->whichflag = 1; - lmp->init(); - update->integrate->setup_minimal(1); - neighcalls++; - forcecalls++; - - send_fev(msgID); - - // STEP receive at each timestep of run or minimization - // required fields: COORDS - // optional fields: ORIGIN, BOX - - } else if (msgID == STEP) { - - double *coords = nullptr; - double *origin = nullptr; - double *box = nullptr; - - for (int ifield = 0; ifield < nfield; ifield++) { - if (fieldID[ifield] == COORDS) { - coords = (double *) cs->unpack(COORDS); - } else if (fieldID[ifield] == ORIGIN) { - origin = (double *) cs->unpack(ORIGIN); - } else if (fieldID[ifield] == BOX) { - box = (double *) cs->unpack(BOX); - } else error->all(FLERR,"Server md step field unknown"); - } - - if (!coords) - error->all(FLERR,"Required server md step field not received"); - - // change box size/shape, only if origin and box received - // reset global/local box like FixDeform at end_of_step() - - if (origin && box) { - if ((box[3] != 0.0 || box[6] != 0.0 || box[7] != 0.0) && - domain->triclinic == 0) - error->all(FLERR,"Server md is not initialized for a triclinic box"); - box_change(origin,box); - domain->set_global_box(); - domain->set_local_box(); - } - - // assign received coords to owned atoms - // closest_image() insures xyz matches current server PBC - - double **x = atom->x; - int nlocal = atom->nlocal; - int nall = atom->natoms; - - j = 0; - for (tagint id = 1; id <= nall; id++) { - m = atom->map(id); - if (m < 0 || m >= nlocal) j += 3; - else { - domain->closest_image(x[m],&coords[j],x[m]); - j += 3; - } - } - - // if no need to reneighbor: - // ghost comm - // setup_minimal(0) which just computes forces - // else: - // setup_minimal(1) for pbc, reset_box, reneigh, forces - - int nflag = neighbor->decide(); - if (nflag == 0) { - comm->forward_comm(); - update->integrate->setup_minimal(0); - } else { - update->integrate->setup_minimal(1); - neighcalls++; - } - - forcecalls++; - - send_fev(msgID); - - } else error->all(FLERR,"Server MD received unrecognized message"); - } - - // final reply to client - - cs->send(0,0); - - // stats - - if (comm->me == 0) { - if (screen) { - fprintf(screen,"Server MD calls = %d\n",forcecalls); - fprintf(screen,"Server MD reneighborings = %d\n",neighcalls); - } - if (logfile) { - fprintf(logfile,"Server MD calls = %d\n",forcecalls); - fprintf(logfile,"Server MD reneighborings %d\n",neighcalls); - } - } - - // clean up - - delete cs; - lmp->cslib = nullptr; -} - -/* ---------------------------------------------------------------------- - box change due to received message -------------------------------------------------------------------------- */ - -void ServerMD::box_change(double *origin, double *box) -{ - domain->boxlo[0] = origin[0]; - domain->boxlo[1] = origin[1]; - domain->boxlo[2] = origin[2]; - - domain->boxhi[0] = origin[0] + box[0]; - domain->boxhi[1] = origin[1] + box[4]; - domain->boxhi[2] = origin[2] + box[8]; - - domain->xy = box[3]; - domain->xz = box[6]; - domain->yz = box[7]; -} - -/* ---------------------------------------------------------------------- - return message with forces, energy, pressure tensor - pressure tensor should be just pair and KSpace contributions - required fields: FORCES, ENERGY, PRESSURE - optional field: ERROR (not ever sending) -------------------------------------------------------------------------- */ - -void ServerMD::send_fev(int msgID) -{ - CSlib *cs = (CSlib *) lmp->cslib; - - cs->send(msgID,3); - - double *forces = nullptr; - if (atom->nlocal) { - if (units != REAL) forces = &atom->f[0][0]; - else { - double **f = atom->f; - int nlocal = atom->nlocal; - for (int i = 0; i < nlocal; i++) { - fcopy[i][0] = fconvert*f[i][0]; - fcopy[i][1] = fconvert*f[i][1]; - fcopy[i][2] = fconvert*f[i][2]; - } - forces = &fcopy[0][0]; - } - } - cs->pack_parallel(FORCES,4,atom->nlocal,atom->tag,3,forces); - - double eng = force->pair->eng_vdwl + force->pair->eng_coul; - double engall; - MPI_Allreduce(&eng,&engall,1,MPI_DOUBLE,MPI_SUM,world); - engall *= econvert; - cs->pack_double(ENERGY,engall); - - double v[6],vall[6]; - for (int i = 0; i < 6; i++) - v[i] = force->pair->virial[i]; - MPI_Allreduce(&v,&vall,6,MPI_DOUBLE,MPI_SUM,world); - - if (force->kspace) - for (int i = 0; i < 6; i++) - vall[i] += force->kspace->virial[i]; - - double nktv2p = force->nktv2p; - double volume = domain->xprd * domain->yprd * domain->zprd; - double factor = pconvert / volume * nktv2p; - for (int i = 0; i < 6; i++) vall[i] *= factor; - - cs->pack(PRESSURE,4,6,vall); -} diff --git a/src/MISC/fix_imd.cpp b/src/MISC/fix_imd.cpp index 1e2160ef07..da2a110e4d 100644 --- a/src/MISC/fix_imd.cpp +++ b/src/MISC/fix_imd.cpp @@ -566,7 +566,7 @@ FixIMD::~FixIMD() } #endif - taginthash_t *hashtable = (taginthash_t *)idmap; + auto hashtable = (taginthash_t *)idmap; memory->destroy(comm_buf); memory->destroy(force_buf); taginthash_destroy(hashtable); @@ -595,7 +595,7 @@ int FixIMD::setmask() void FixIMD::init() { if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; return; } @@ -699,17 +699,17 @@ void FixIMD::setup(int) error->all(FLERR,"LAMMPS terminated on error in setting up IMD connection."); /* initialize and build hashtable. */ - taginthash_t *hashtable=new taginthash_t; + auto hashtable=new taginthash_t; taginthash_init(hashtable, num_coords); idmap = (void *)hashtable; int tmp, ndata; - struct commdata *buf = static_cast(comm_buf); + auto buf = static_cast(comm_buf); if (me == 0) { MPI_Status status; MPI_Request request; - tagint *taglist = new tagint[num_coords]; + auto taglist = new tagint[num_coords]; int numtag=0; /* counter to map atom tags to a 0-based consecutive index list */ for (i=0; i < nlocal; ++i) { @@ -899,15 +899,15 @@ void FixIMD::post_force(int /*vflag*/) } case IMD_FCOORDS: { - float *dummy_coords = new float[3*length]; + auto dummy_coords = new float[3*length]; imd_recv_fcoords(clientsock, length, dummy_coords); delete[] dummy_coords; break; } case IMD_MDCOMM: { - int32 *imd_tags = new int32[length]; - float *imd_fdat = new float[3*length]; + auto imd_tags = new int32[length]; + auto imd_fdat = new float[3*length]; imd_recv_mdcomm(clientsock, length, imd_tags, imd_fdat); if (imd_forces < length) { /* grow holding space for forces, if needed. */ @@ -1014,7 +1014,7 @@ void FixIMD::post_force(int /*vflag*/) msgdata = new char[msglen]; imd_fill_header((IMDheader *)msgdata, IMD_FCOORDS, num_coords); /* array pointer, to the offset where we receive the coordinates. */ - float *recvcoord = (float *) (msgdata+IMDHEADERSIZE); + auto recvcoord = (float *) (msgdata+IMDHEADERSIZE); /* add local data */ if (unwrap_flag) { @@ -1207,7 +1207,7 @@ void * imdsock_create() { } int imdsock_bind(void * v, int port) { - imdsocket *s = (imdsocket *) v; + auto s = (imdsocket *) v; memset(&(s->addr), 0, sizeof(s->addr)); s->addr.sin_family = PF_INET; s->addr.sin_port = htons(port); @@ -1216,7 +1216,7 @@ int imdsock_bind(void * v, int port) { } int imdsock_listen(void * v) { - imdsocket *s = (imdsocket *) v; + auto s = (imdsocket *) v; return listen(s->sd, 5); } @@ -1250,7 +1250,7 @@ void *imdsock_accept(void * v) { } int imdsock_write(void * v, const void *buf, int len) { - imdsocket *s = (imdsocket *) v; + auto s = (imdsocket *) v; #if defined(_MSC_VER) || defined(__MINGW32__) return send(s->sd, (const char*) buf, len, 0); /* windows lacks the write() call */ #else @@ -1259,7 +1259,7 @@ int imdsock_write(void * v, const void *buf, int len) { } int imdsock_read(void * v, void *buf, int len) { - imdsocket *s = (imdsocket *) v; + auto s = (imdsocket *) v; #if defined(_MSC_VER) || defined(__MINGW32__) return recv(s->sd, (char*) buf, len, 0); /* windows lacks the read() call */ #else @@ -1269,7 +1269,7 @@ int imdsock_read(void * v, void *buf, int len) { } void imdsock_shutdown(void *v) { - imdsocket * s = (imdsocket *) v; + auto s = (imdsocket *) v; if (s == nullptr) return; @@ -1281,7 +1281,7 @@ void imdsock_shutdown(void *v) { } void imdsock_destroy(void * v) { - imdsocket * s = (imdsocket *) v; + auto s = (imdsocket *) v; if (s == nullptr) return; @@ -1294,7 +1294,7 @@ void imdsock_destroy(void * v) { } int imdsock_selread(void *v, int sec) { - imdsocket *s = (imdsocket *)v; + auto s = (imdsocket *)v; fd_set rfd; struct timeval tv; int rc; @@ -1313,7 +1313,7 @@ int imdsock_selread(void *v, int sec) { } int imdsock_selwrite(void *v, int sec) { - imdsocket *s = (imdsocket *)v; + auto s = (imdsocket *)v; fd_set wfd; struct timeval tv; int rc; diff --git a/src/MISC/fix_ipi.cpp b/src/MISC/fix_ipi.cpp index b82339713e..290ce38c02 100644 --- a/src/MISC/fix_ipi.cpp +++ b/src/MISC/fix_ipi.cpp @@ -416,7 +416,7 @@ void FixIPI::final_integrate() int nat=bsize/3; double **f= atom->f; - double *lbuf = new double[bsize]; + auto lbuf = new double[bsize]; // reassembles the force vector from the local arrays int nlocal = atom->nlocal; diff --git a/src/MISC/fix_pair_tracker.cpp b/src/MISC/fix_pair_tracker.cpp deleted file mode 100644 index 3616855869..0000000000 --- a/src/MISC/fix_pair_tracker.cpp +++ /dev/null @@ -1,350 +0,0 @@ -/* ---------------------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://www.lammps.org/ 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 "fix_pair_tracker.h" - -#include "atom.h" -#include "error.h" -#include "memory.h" -#include "tokenizer.h" -#include "update.h" - -#include - -using namespace LAMMPS_NS; -using namespace FixConst; - -#define DELTA 1000 - -/* ---------------------------------------------------------------------- */ - -FixPairTracker::FixPairTracker(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), nvalues(0), vector(nullptr), array(nullptr), pack_choice(nullptr) -{ - if (narg < 3) error->all(FLERR, "Illegal fix pair/tracker command"); - local_flag = 1; - - nevery = utils::inumeric(FLERR, arg[3], false, lmp); - if (nevery <= 0) error->all(FLERR, "Illegal fix pair/tracker command"); - local_freq = nevery; - - // If optional arguments included, this will be oversized - nvalues = narg - 4; - pack_choice = new FnPtrPack[nvalues]; - - tmin = -1; - type_filter = nullptr; - int iarg = 4; - nvalues = 0; - while (iarg < narg) { - if (strcmp(arg[iarg], "id1") == 0) { - pack_choice[nvalues++] = &FixPairTracker::pack_id1; - } else if (strcmp(arg[iarg], "id2") == 0) { - pack_choice[nvalues++] = &FixPairTracker::pack_id2; - - } else if (strcmp(arg[iarg], "time/created") == 0) { - pack_choice[nvalues++] = &FixPairTracker::pack_time_created; - } else if (strcmp(arg[iarg], "time/broken") == 0) { - pack_choice[nvalues++] = &FixPairTracker::pack_time_broken; - } else if (strcmp(arg[iarg], "time/total") == 0) { - pack_choice[nvalues++] = &FixPairTracker::pack_time_total; - - } else if (strcmp(arg[iarg], "x") == 0) { - pack_choice[nvalues++] = &FixPairTracker::pack_x; - } else if (strcmp(arg[iarg], "y") == 0) { - pack_choice[nvalues++] = &FixPairTracker::pack_y; - } else if (strcmp(arg[iarg], "z") == 0) { - pack_choice[nvalues++] = &FixPairTracker::pack_z; - - } else if (strcmp(arg[iarg], "r/min") == 0) { - pack_choice[nvalues++] = &FixPairTracker::pack_rmin; - } else if (strcmp(arg[iarg], "r/ave") == 0) { - pack_choice[nvalues++] = &FixPairTracker::pack_rave; - - } else if (strcmp(arg[iarg], "time/min") == 0) { - if (iarg + 1 >= narg) error->all(FLERR, "Invalid keyword in fix pair/tracker command"); - tmin = utils::numeric(FLERR, arg[iarg + 1], false, lmp); - iarg++; - - } else if (strcmp(arg[iarg], "type/include") == 0) { - if (iarg + 1 >= narg) error->all(FLERR, "Invalid keyword in fix pair/tracker command"); - int ntypes = atom->ntypes; - int i, j, itype, jtype; - int inlo, inhi, jnlo, jnhi; - - if (!type_filter) { - memory->create(type_filter, ntypes + 1, ntypes + 1, "fix/pair/tracker:type_filter"); - - for (i = 0; i <= ntypes; i++) { - for (j = 0; j <= ntypes; j++) type_filter[i][j] = 0; - } - } - - auto iwords = Tokenizer(arg[iarg + 1], ",").as_vector(); - auto jwords = Tokenizer(arg[iarg + 2], ",").as_vector(); - - for (const auto &ifield : iwords) { - utils::bounds(FLERR, ifield, 1, ntypes, inlo, inhi, error); - for (const auto &jfield : jwords) { - utils::bounds(FLERR, jfield, 1, ntypes, jnlo, jnhi, error); - - for (itype = inlo; itype <= inhi; itype++) { - for (jtype = jnlo; jtype <= jnhi; jtype++) { - type_filter[itype][jtype] = 1; - type_filter[jtype][itype] = 1; - } - } - } - } - iarg += 2; - - } else - error->all(FLERR, "Invalid keyword in fix pair/tracker command"); - - iarg++; - } - - if (nvalues == 1) - size_local_cols = 0; - else - size_local_cols = nvalues; - - nmax = 0; - ncount = 0; - vector = nullptr; - array = nullptr; -} - -/* ---------------------------------------------------------------------- */ - -FixPairTracker::~FixPairTracker() -{ - delete[] pack_choice; - - memory->destroy(vector); - memory->destroy(array); - memory->destroy(type_filter); -} - -/* ---------------------------------------------------------------------- */ - -int FixPairTracker::setmask() -{ - int mask = 0; - mask |= POST_FORCE; - return mask; -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::init() -{ - // Set size of array/vector - ncount = 0; - - if (ncount > nmax) reallocate(ncount); - - size_local_rows = ncount; -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::lost_contact(int i, int j, double time_tmp, double nstep_tmp, double rsum_tmp, - double rmin_tmp) -{ - - double time = update->atime + (update->ntimestep - update->atimestep) * update->dt; - if ((time - time_tmp) < tmin) return; - - if (type_filter) { - int *type = atom->type; - if (type_filter[type[i]][type[j]] == 0) return; - } - - int *mask = atom->mask; - if (!(mask[i] & groupbit)) return; - if (!(mask[j] & groupbit)) return; - - if (ncount == nmax) reallocate(ncount); - - index_i = i; - index_j = j; - - rmin = rmin_tmp; - rsum = rsum_tmp; - time_initial = time_tmp; - nstep_initial = nstep_tmp; - - // fill vector or array with local values - if (nvalues == 1) { - (this->*pack_choice[0])(0); - } else { - for (int k = 0; k < nvalues; k++) { (this->*pack_choice[k])(k); } - } - - ncount += 1; -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::post_force(int /*vflag*/) -{ - if (update->ntimestep % nevery == 0) { - size_local_rows = ncount; - ncount = 0; - } -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::reallocate(int n) -{ - // grow vector or array - while (nmax <= n) nmax += DELTA; - - if (nvalues == 1) { - memory->grow(vector, nmax, "fix_pair_tracker:vector"); - vector_local = vector; - } else { - memory->grow(array, nmax, nvalues, "fix_pair_tracker:array"); - array_local = array; - } -} - -/* ---------------------------------------------------------------------- - memory usage of local data -------------------------------------------------------------------------- */ - -double FixPairTracker::memory_usage() -{ - double bytes = nmax * (double) nvalues * sizeof(double); - bytes += nmax * 2 * sizeof(int); - return bytes; -} - -/* ---------------------------------------------------------------------- - one method for every keyword fix pair/tracker can output - the atom property is packed into a local vector or array -------------------------------------------------------------------------- */ - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::pack_time_created(int n) -{ - if (nvalues == 1) - vector[ncount] = time_initial; - else - array[ncount][n] = time_initial; -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::pack_time_broken(int n) -{ - double time = update->atime + (update->ntimestep - update->atimestep) * update->dt; - if (nvalues == 1) - vector[ncount] = time; - else - array[ncount][n] = time; -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::pack_time_total(int n) -{ - double time = update->atime + (update->ntimestep - update->atimestep) * update->dt; - if (nvalues == 1) - vector[ncount] = time - time_initial; - else - array[ncount][n] = time - time_initial; -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::pack_id1(int n) -{ - tagint *tag = atom->tag; - - if (nvalues == 1) - vector[ncount] = tag[index_i]; - else - array[ncount][n] = tag[index_i]; -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::pack_id2(int n) -{ - tagint *tag = atom->tag; - - if (nvalues == 1) - vector[ncount] = tag[index_j]; - else - array[ncount][n] = tag[index_j]; -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::pack_x(int n) -{ - double **x = atom->x; - - if (nvalues == 1) - vector[ncount] = (x[index_i][0] + x[index_j][0]) / 2; - else - array[ncount][n] = (x[index_i][0] + x[index_j][0]) / 2; -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::pack_y(int n) -{ - double **x = atom->x; - - if (nvalues == 1) - vector[ncount] = (x[index_i][1] + x[index_j][1]) / 2; - else - array[ncount][n] = (x[index_i][1] + x[index_j][1]) / 2; -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::pack_z(int n) -{ - double **x = atom->x; - - if (nvalues == 1) - vector[ncount] = (x[index_i][2] + x[index_j][2]) / 2; - else - array[ncount][n] = (x[index_i][2] + x[index_j][2]) / 2; -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::pack_rmin(int n) -{ - if (nvalues == 1) - vector[ncount] = rmin; - else - array[ncount][n] = rmin; -} - -/* ---------------------------------------------------------------------- */ - -void FixPairTracker::pack_rave(int n) -{ - if (nvalues == 1) - vector[ncount] = rsum / (update->ntimestep - nstep_initial); - else - array[ncount][n] = rsum / (update->ntimestep - nstep_initial); -} diff --git a/src/MISC/fix_srp.cpp b/src/MISC/fix_srp.cpp index 393be42bb2..1fb15aafd3 100644 --- a/src/MISC/fix_srp.cpp +++ b/src/MISC/fix_srp.cpp @@ -607,7 +607,7 @@ void FixSRP::write_restart(FILE *fp) void FixSRP::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; comm->cutghostuser = static_cast (list[n++]); btype = static_cast (list[n++]); diff --git a/src/MISC/pair_list.cpp b/src/MISC/pair_list.cpp index d7d59e90d3..f6ac2e3190 100644 --- a/src/MISC/pair_list.cpp +++ b/src/MISC/pair_list.cpp @@ -89,7 +89,7 @@ void PairList::compute(int eflag, int vflag) const int nlocal = atom->nlocal; const int newton_pair = force->newton_pair; const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; // NOLINT double fpair,epair; int i,j; diff --git a/src/MISC/pair_srp.cpp b/src/MISC/pair_srp.cpp index 84f7c330a8..3667d0a2c2 100644 --- a/src/MISC/pair_srp.cpp +++ b/src/MISC/pair_srp.cpp @@ -84,7 +84,7 @@ PairSRP::PairSRP(LAMMPS *lmp) : Pair(lmp), fix_id(nullptr) // will be invoked before other fixes that migrate atoms // this is checked for in FixSRP - f_srp = (FixSRP *) modify->add_fix(fmt::format("{:02d}_FIX_SRP all SRP",srp_instance)); + f_srp = dynamic_cast( modify->add_fix(fmt::format("{:02d}_FIX_SRP all SRP",srp_instance))); ++srp_instance; } diff --git a/src/MISC/pair_tracker.cpp b/src/MISC/pair_tracker.cpp index 502b04c49d..df49811a10 100644 --- a/src/MISC/pair_tracker.cpp +++ b/src/MISC/pair_tracker.cpp @@ -19,39 +19,41 @@ #include "fix.h" #include "fix_dummy.h" #include "fix_neigh_history.h" -#include "fix_pair_tracker.h" +#include "fix_store_local.h" #include "force.h" #include "memory.h" #include "modify.h" #include "neigh_list.h" #include "neighbor.h" +#include "tokenizer.h" #include "update.h" +#include "utils.h" -#include #include using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -PairTracker::PairTracker(LAMMPS *lmp) : Pair(lmp) +PairTracker::PairTracker(LAMMPS *lmp) : + Pair(lmp), onerad_dynamic(nullptr), onerad_frozen(nullptr), maxrad_dynamic(nullptr), + maxrad_frozen(nullptr), id_fix_store_local(nullptr), fix_dummy(nullptr), fix_history(nullptr), + fix_store_local(nullptr), type_filter(nullptr), output_data(nullptr), pack_choice(nullptr) { single_enable = 1; no_virial_fdotr_compute = 1; neighprev = 0; history = 1; - size_history = 4; + size_history = 3; nondefault_history_transfer = 1; finitecutflag = 0; + tmin = -1; // create dummy fix as placeholder for FixNeighHistory // this is so final order of Modify:fix will conform to input script - - fix_history = nullptr; - modify->add_fix("NEIGH_HISTORY_TRACK_DUMMY all DUMMY"); - fix_dummy = (FixDummy *) modify->fix[modify->nfix - 1]; + fix_dummy = dynamic_cast(modify->add_fix("NEIGH_HISTORY_TRACK_DUMMY all DUMMY")); } /* ---------------------------------------------------------------------- */ @@ -62,6 +64,7 @@ PairTracker::~PairTracker() modify->delete_fix("NEIGH_HISTORY_TRACK_DUMMY"); else modify->delete_fix("NEIGH_HISTORY_TRACK"); + if (id_fix_store_local) modify->delete_fix(id_fix_store_local); if (allocated) { memory->destroy(setflag); @@ -73,6 +76,12 @@ PairTracker::~PairTracker() delete[] maxrad_dynamic; delete[] maxrad_frozen; } + + delete[] pack_choice; + delete[] id_fix_store_local; + + memory->destroy(output_data); + memory->destroy(type_filter); } /* ---------------------------------------------------------------------- */ @@ -80,7 +89,7 @@ PairTracker::~PairTracker() void PairTracker::compute(int eflag, int vflag) { int i, j, ii, jj, inum, jnum, itype, jtype; - double xtmp, ytmp, ztmp, delx, dely, delz, time; + double xtmp, ytmp, ztmp, delx, dely, delz; double radi, radj, radsum, rsq, r; int *ilist, *jlist, *numneigh, **firstneigh; int *touch, **firsttouch; @@ -131,27 +140,23 @@ void PairTracker::compute(int eflag, int vflag) if (rsq >= radsum * radsum) { data = &alldata[size_history * jj]; - if (touch[jj] == 1) { - fix_pair_tracker->lost_contact(i, j, data[0], data[1], data[2], data[3]); - } + if (touch[jj] == 1) process_data(i, j, data); + touch[jj] = 0; - data[0] = 0.0; // initial time - data[1] = 0.0; // initial timestep - data[2] = 0.0; // sum of r, may overflow - data[3] = 0.0; // min of r + data[0] = 0.0; // initial timestep + data[1] = 0.0; // sum of r, may be inaccurate over long times + data[2] = 0.0; // min of r } else { data = &alldata[size_history * jj]; if (touch[jj] == 0) { - time = update->atime + (update->ntimestep - update->atimestep) * update->dt; - data[0] = time; - data[1] = (double) update->ntimestep; + data[0] = (double) update->ntimestep; + data[1] = r; data[2] = r; - data[3] = r; } else if (updateflag) { - data[2] += r; - if (data[3] > r) data[3] = r; + data[1] += r; + if (data[2] > r) data[2] = r; } touch[jj] = 1; } @@ -160,28 +165,23 @@ void PairTracker::compute(int eflag, int vflag) if (rsq >= cutsq[itype][jtype]) { data = &alldata[size_history * jj]; - if (touch[jj] == 1) { - fix_pair_tracker->lost_contact(i, j, data[0], data[1], data[2], data[3]); - } + if (touch[jj] == 1) process_data(i, j, data); touch[jj] = 0; - data[0] = 0.0; // initial time - data[1] = 0.0; // initial timestep - data[2] = 0.0; // sum of r, may overflow - data[3] = 0.0; // min of r + data[0] = 0.0; // initial timestep + data[1] = 0.0; // sum of r, may be inaccurate over long times + data[2] = 0.0; // min of r } else { data = &alldata[size_history * jj]; if (touch[jj] == 0) { - time = update->atime + (update->ntimestep - update->atimestep) * update->dt; - data[0] = time; - data[1] = (double) update->ntimestep; + data[0] = (double) update->ntimestep; + data[1] = r; data[2] = r; - data[3] = r; } else if (updateflag) { - data[2] += r; - if (data[3] > r) data[3] = r; + data[1] += r; + if (data[2] > r) data[2] = r; } touch[jj] = 1; } @@ -218,14 +218,89 @@ void PairTracker::allocate() void PairTracker::settings(int narg, char **arg) { - if (narg != 0 && narg != 1) error->all(FLERR, "Illegal pair_style command"); + if (narg < 2) error->all(FLERR, "Illegal pair_style command"); - if (narg == 1) { - if (strcmp(arg[0], "finite") == 0) + id_fix_store_local = utils::strdup(arg[0]); + store_local_freq = utils::inumeric(FLERR, arg[1], false, lmp); + + // If optional arguments included, this will be oversized + pack_choice = new FnPtrPack[narg - 1]; + + nvalues = 0; + int iarg = 2; + while (iarg < narg) { + if (strcmp(arg[iarg], "finite") == 0) { finitecutflag = 1; - else + } else if (strcmp(arg[iarg], "id1") == 0) { + pack_choice[nvalues++] = &PairTracker::pack_id1; + } else if (strcmp(arg[iarg], "id2") == 0) { + pack_choice[nvalues++] = &PairTracker::pack_id2; + } else if (strcmp(arg[iarg], "time/created") == 0) { + pack_choice[nvalues++] = &PairTracker::pack_time_created; + } else if (strcmp(arg[iarg], "time/broken") == 0) { + pack_choice[nvalues++] = &PairTracker::pack_time_broken; + } else if (strcmp(arg[iarg], "time/total") == 0) { + pack_choice[nvalues++] = &PairTracker::pack_time_total; + } else if (strcmp(arg[iarg], "x") == 0) { + pack_choice[nvalues++] = &PairTracker::pack_x; + } else if (strcmp(arg[iarg], "y") == 0) { + pack_choice[nvalues++] = &PairTracker::pack_y; + } else if (strcmp(arg[iarg], "z") == 0) { + pack_choice[nvalues++] = &PairTracker::pack_z; + } else if (strcmp(arg[iarg], "r/min") == 0) { + pack_choice[nvalues++] = &PairTracker::pack_rmin; + } else if (strcmp(arg[iarg], "r/ave") == 0) { + pack_choice[nvalues++] = &PairTracker::pack_rave; + } else if (strcmp(arg[iarg], "time/min") == 0) { + if (iarg + 1 >= narg) error->all(FLERR, "Invalid keyword in pair tracker command"); + tmin = utils::numeric(FLERR, arg[iarg + 1], false, lmp); + iarg++; + + } else if (strcmp(arg[iarg], "type/include") == 0) { + if (iarg + 1 >= narg) error->all(FLERR, "Invalid keyword in pair tracker command"); + int ntypes = atom->ntypes; + int i, j, itype, jtype; + int inlo, inhi, jnlo, jnhi; + + if (!type_filter) { + memory->create(type_filter, ntypes + 1, ntypes + 1, "pair/tracker:type_filter"); + + for (i = 0; i <= ntypes; i++) { + for (j = 0; j <= ntypes; j++) type_filter[i][j] = 0; + } + } + + auto iwords = Tokenizer(arg[iarg + 1], ",").as_vector(); + auto jwords = Tokenizer(arg[iarg + 2], ",").as_vector(); + + for (const auto &ifield : iwords) { + utils::bounds(FLERR, ifield, 1, ntypes, inlo, inhi, error); + for (const auto &jfield : jwords) { + utils::bounds(FLERR, jfield, 1, ntypes, jnlo, jnhi, error); + + for (itype = inlo; itype <= inhi; itype++) { + for (jtype = jnlo; jtype <= jnhi; jtype++) { + type_filter[itype][jtype] = 1; + type_filter[jtype][itype] = 1; + } + } + } + } + iarg += 2; + + } else { error->all(FLERR, "Illegal pair_style command"); + } + iarg++; } + + if (nvalues == 0) error->all(FLERR, "Must request at least one value to output"); + memory->create(output_data, nvalues, "pair/tracker:output_data"); + + fix_store_local = dynamic_cast(modify->get_fix_by_id(id_fix_store_local)); + if (!fix_store_local) + fix_store_local = dynamic_cast(modify->add_fix( + fmt::format("{} all STORE_LOCAL {} {}", id_fix_store_local, store_local_freq, nvalues))); } /* ---------------------------------------------------------------------- @@ -263,8 +338,6 @@ void PairTracker::coeff(int narg, char **arg) void PairTracker::init_style() { - int i; - // error and warning checks if (!atom->radius_flag && finitecutflag) @@ -283,44 +356,49 @@ void PairTracker::init_style() if (fix_history == nullptr) { modify->replace_fix("NEIGH_HISTORY_TRACK_DUMMY", fmt::format("NEIGH_HISTORY_TRACK all NEIGH_HISTORY {}", size_history), 1); - fix_history = (FixNeighHistory *) modify->get_fix_by_id("NEIGH_HISTORY_TRACK"); + fix_history = dynamic_cast(modify->get_fix_by_id("NEIGH_HISTORY_TRACK")); fix_history->pair = this; fix_history->use_bit_flag = 0; } else { - fix_history = (FixNeighHistory *) modify->get_fix_by_id("NEIGH_HISTORY_TRACK"); + fix_history = dynamic_cast(modify->get_fix_by_id("NEIGH_HISTORY_TRACK")); if (!fix_history) error->all(FLERR, "Could not find pair fix neigh history ID"); } if (finitecutflag) { - if (force->pair->beyond_contact) error->all(FLERR, "Pair tracker incompatible with granular pairstyles that extend beyond contact"); + + // check for FixFreeze and set freeze_group_bit + + auto fixlist = modify->get_fix_by_style("^freeze"); + if (fixlist.size() == 0) + freeze_group_bit = 0; + else if (fixlist.size() > 1) + error->all(FLERR, "Only one fix freeze command at a time allowed"); + else + freeze_group_bit = fixlist.front()->groupbit; + // check for FixPour and FixDeposit so can extract particle radii - int ipour; - for (ipour = 0; ipour < modify->nfix; ipour++) - if (strcmp(modify->fix[ipour]->style, "pour") == 0) break; - if (ipour == modify->nfix) ipour = -1; - - int idep; - for (idep = 0; idep < modify->nfix; idep++) - if (strcmp(modify->fix[idep]->style, "deposit") == 0) break; - if (idep == modify->nfix) idep = -1; + auto pours = modify->get_fix_by_style("^pour"); + auto deps = modify->get_fix_by_style("^deposit"); // set maxrad_dynamic and maxrad_frozen for each type // include future FixPour and FixDeposit particles as dynamic - int itype; - for (i = 1; i <= atom->ntypes; i++) { + int itype = 0; + for (int i = 1; i <= atom->ntypes; i++) { onerad_dynamic[i] = onerad_frozen[i] = 0.0; - if (ipour >= 0) { + for (auto &ipour : pours) { itype = i; - onerad_dynamic[i] = *((double *) modify->fix[ipour]->extract("radius", itype)); + double maxrad = *((double *) ipour->extract("radius", itype)); + if (maxrad > 0.0) onerad_dynamic[i] = maxrad; } - if (idep >= 0) { + for (auto &idep : deps) { itype = i; - onerad_dynamic[i] = *((double *) modify->fix[idep]->extract("radius", itype)); + double maxrad = *((double *) idep->extract("radius", itype)); + if (maxrad > 0.0) onerad_dynamic[i] = maxrad; } } @@ -329,7 +407,7 @@ void PairTracker::init_style() int *type = atom->type; int nlocal = atom->nlocal; - for (i = 0; i < nlocal; i++) + for (int i = 0; i < nlocal; i++) if (mask[i] & freeze_group_bit) onerad_frozen[type[i]] = MAX(onerad_frozen[type[i]], radius[i]); else @@ -338,11 +416,6 @@ void PairTracker::init_style() MPI_Allreduce(&onerad_dynamic[1], &maxrad_dynamic[1], atom->ntypes, MPI_DOUBLE, MPI_MAX, world); MPI_Allreduce(&onerad_frozen[1], &maxrad_frozen[1], atom->ntypes, MPI_DOUBLE, MPI_MAX, world); } - - auto trackfixes = modify->get_fix_by_style("pair/tracker"); - if (trackfixes.size() != 1) - error->all(FLERR, "Must use exactly one fix pair/tracker command with pair style tracker"); - fix_pair_tracker = (FixPairTracker *) trackfixes.front(); } /* ---------------------------------------------------------------------- @@ -354,8 +427,7 @@ double PairTracker::init_one(int i, int j) if (!allocated) allocate(); // always mix prefactors geometrically - - if (setflag[i][j] == 0) { cut[i][j] = mix_distance(cut[i][i], cut[j][j]); } + if (setflag[i][j] == 0) cut[i][j] = mix_distance(cut[i][i], cut[j][j]); cut[j][i] = cut[i][j]; @@ -384,7 +456,7 @@ void PairTracker::write_restart(FILE *fp) for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { fwrite(&setflag[i][j], sizeof(int), 1, fp); - if (setflag[i][j]) { fwrite(&cut[i][j], sizeof(double), 1, fp); } + if (setflag[i][j]) fwrite(&cut[i][j], sizeof(double), 1, fp); } } @@ -404,7 +476,7 @@ void PairTracker::read_restart(FILE *fp) if (me == 0) utils::sfread(FLERR, &setflag[i][j], sizeof(int), 1, fp, nullptr, error); MPI_Bcast(&setflag[i][j], 1, MPI_INT, 0, world); if (setflag[i][j]) { - if (me == 0) { utils::sfread(FLERR, &cut[i][j], sizeof(double), 1, fp, nullptr, error); } + if (me == 0) utils::sfread(FLERR, &cut[i][j], sizeof(double), 1, fp, nullptr, error); MPI_Bcast(&cut[i][j], 1, MPI_DOUBLE, 0, world); } } @@ -466,3 +538,91 @@ double PairTracker::radii2cut(double r1, double r2) double cut = r1 + r2; return cut; } + +/* ---------------------------------------------------------------------- */ + +void PairTracker::process_data(int i, int j, double *input_data) +{ + if ((update->ntimestep - input_data[0]) < tmin) return; + + if (type_filter) { + int *type = atom->type; + if (type_filter[type[i]][type[j]] == 0) return; + } + + for (int k = 0; k < nvalues; k++) (this->*pack_choice[k])(k, i, j, input_data); + fix_store_local->add_data(output_data, i, j); +} + +/* ---------------------------------------------------------------------- + one method for every keyword fix pair/tracker can output + the atom property is packed into a local vector or array +------------------------------------------------------------------------- */ + +void PairTracker::pack_time_created(int n, int /*i*/, int /*j*/, double *data) +{ + output_data[n] = data[0]; +} + +/* ---------------------------------------------------------------------- */ + +void PairTracker::pack_time_broken(int n, int /*i*/, int /*j*/, double * /*data*/) +{ + output_data[n] = update->ntimestep; +} + +/* ---------------------------------------------------------------------- */ + +void PairTracker::pack_time_total(int n, int /*i*/, int /*j*/, double *data) +{ + output_data[n] = update->ntimestep - data[0]; +} + +/* ---------------------------------------------------------------------- */ + +void PairTracker::pack_id1(int n, int i, int /*j*/, double * /*data*/) +{ + output_data[n] = atom->tag[i]; +} + +/* ---------------------------------------------------------------------- */ + +void PairTracker::pack_id2(int n, int /*i*/, int j, double * /*data*/) +{ + output_data[n] = atom->tag[j]; +} + +/* ---------------------------------------------------------------------- */ + +void PairTracker::pack_x(int n, int i, int j, double * /*data*/) +{ + output_data[n] = (atom->x[i][0] + atom->x[j][0]) * 0.5; +} + +/* ---------------------------------------------------------------------- */ + +void PairTracker::pack_y(int n, int i, int j, double * /*data*/) +{ + output_data[n] = (atom->x[i][1] + atom->x[j][1]) * 0.5; +} + +/* ---------------------------------------------------------------------- */ + +void PairTracker::pack_z(int n, int i, int j, double * /*data*/) +{ + output_data[n] = (atom->x[i][2] + atom->x[j][2]) * 0.5; +} + +/* ---------------------------------------------------------------------- */ + +void PairTracker::pack_rmin(int n, int /*i*/, int /*j*/, double *data) +{ + output_data[n] = data[2]; +} + +/* ---------------------------------------------------------------------- */ + +void PairTracker::pack_rave(int n, int /*i*/, int /*j*/, double *data) +{ + output_data[n] = data[1] / (update->ntimestep - data[0]); +} diff --git a/src/MISC/pair_tracker.h b/src/MISC/pair_tracker.h index 1942408659..75204112bf 100644 --- a/src/MISC/pair_tracker.h +++ b/src/MISC/pair_tracker.h @@ -40,6 +40,7 @@ class PairTracker : public Pair { double single(int, int, int, int, double, double, double, double &) override; double atom2cut(int) override; double radii2cut(double, double) override; + void transfer_history(double *, double *) override; protected: int sizeflag; @@ -50,12 +51,33 @@ class PairTracker : public Pair { double *onerad_dynamic, *onerad_frozen; double *maxrad_dynamic, *maxrad_frozen; int freeze_group_bit; + int store_local_freq; + char *id_fix_store_local; class FixDummy *fix_dummy; class FixNeighHistory *fix_history; - class FixPairTracker *fix_pair_tracker; + class FixStoreLocal *fix_store_local; - void transfer_history(double *, double *) override; + int **type_filter; + double tmin; + + int nvalues, ncount; + double *output_data; + typedef void (PairTracker::*FnPtrPack)(int, int, int, double *); + FnPtrPack *pack_choice; // ptrs to pack functions + + void pack_id1(int, int, int, double *); + void pack_id2(int, int, int, double *); + void pack_time_created(int, int, int, double *); + void pack_time_broken(int, int, int, double *); + void pack_time_total(int, int, int, double *); + void pack_x(int, int, int, double *); + void pack_y(int, int, int, double *); + void pack_z(int, int, int, double *); + void pack_rmin(int, int, int, double *); + void pack_rave(int, int, int, double *); + + void process_data(int, int, double *); void allocate(); }; @@ -72,20 +94,37 @@ Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. +E: Invalid keyword in pair tracker command + +Self-explanatory. + E: Incorrect args for pair coefficients Self-explanatory. Check the input script or data file. +E: Must request at least one value to output + +Must include at least one bond property to store in fix store/local + E: Pair tracker requires atom attribute radius for finite cutoffs The atom style defined does not have these attributes. +E: Pair tracker incompatible with granular pairstyles that extend beyond contact + +Self-explanatory. + E: Could not find pair fix neigh history ID The associated fix neigh/history is missing -E: Cannot use pair tracker without fix pair/tracker +E: Cannot use pair tracker without fix store/local -This pairstyle requires one to define a pair/tracker fix +The associated fix store/local does not exist + +E: Inconsistent number of output variables in fix store/local + +The number of values specified in fix store/local disagrees with +the number of values requested in pair tracker */ diff --git a/src/ML-HDNNP/pair_hdnnp.cpp b/src/ML-HDNNP/pair_hdnnp.cpp index 7522b301bf..f226bb601b 100644 --- a/src/ML-HDNNP/pair_hdnnp.cpp +++ b/src/ML-HDNNP/pair_hdnnp.cpp @@ -319,7 +319,7 @@ void PairHDNNP::handleExtrapolationWarnings() MPI_Status ms; // Get buffer size. MPI_Recv(&bs, 1, MPI_LONG, i, 0, world, &ms); - char *buf = new char[bs]; + auto buf = new char[bs]; // Receive buffer. MPI_Recv(buf, bs, MPI_BYTE, i, 0, world, &ms); interface->extractEWBuffer(buf, bs); @@ -331,7 +331,7 @@ void PairHDNNP::handleExtrapolationWarnings() // Get desired buffer length for all extrapolation warning entries. long bs = interface->getEWBufferSize(); // Allocate and fill buffer. - char *buf = new char[bs]; + auto buf = new char[bs]; interface->fillEWBuffer(buf, bs); // Send buffer size and buffer. MPI_Send(&bs, 1, MPI_LONG, 0, 0, world); diff --git a/src/ML-IAP/mliap_so3.cpp b/src/ML-IAP/mliap_so3.cpp index 0733ffa198..55418c9821 100644 --- a/src/ML-IAP/mliap_so3.cpp +++ b/src/ML-IAP/mliap_so3.cpp @@ -369,16 +369,16 @@ void MLIAP_SO3::compute_W(int nmax, double *arr) } int i, j, k, n = nmax; - double *outeig = new double[n]; - double *outeigvec = new double[n * n]; - double *arrinv = new double[n * n]; + auto outeig = new double[n]; + auto outeigvec = new double[n * n]; + auto arrinv = new double[n * n]; - double *sqrtD = new double[n * n]; - double *tempM = new double[n * n]; + auto sqrtD = new double[n * n]; + auto tempM = new double[n * n]; - double **temparr = new double *[n]; - double **tempvl = new double *[n]; - double *tempout = new double[n]; + auto temparr = new double *[n]; + auto tempvl = new double *[n]; + auto tempout = new double[n]; int info; diff --git a/src/ML-SNAP/pair_snap.cpp b/src/ML-SNAP/pair_snap.cpp index ed30bd714e..6a108ad3dd 100644 --- a/src/ML-SNAP/pair_snap.cpp +++ b/src/ML-SNAP/pair_snap.cpp @@ -692,7 +692,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) if (keywd == "rinner" || keywd == "drinner") { - if (nwords != nelements+1) + if (words.size() != nelements+1) error->all(FLERR,"Incorrect SNAP parameter file"); if (comm->me == 0) diff --git a/src/MOLECULE/angle_table.cpp b/src/MOLECULE/angle_table.cpp index 3ba430bb5c..eeb30c4d64 100644 --- a/src/MOLECULE/angle_table.cpp +++ b/src/MOLECULE/angle_table.cpp @@ -574,7 +574,7 @@ void AngleTable::spline(double *x, double *y, int n, double yp1, double ypn, dou { int i, k; double p, qn, sig, un; - double *u = new double[n]; + auto u = new double[n]; if (yp1 > 0.99e300) y2[0] = u[0] = 0.0; diff --git a/src/MOLECULE/bond_quartic.cpp b/src/MOLECULE/bond_quartic.cpp index b0028c05e9..88effd6a05 100644 --- a/src/MOLECULE/bond_quartic.cpp +++ b/src/MOLECULE/bond_quartic.cpp @@ -36,6 +36,7 @@ using MathConst::MY_CUBEROOT2; BondQuartic::BondQuartic(LAMMPS *_lmp) : Bond(_lmp), k(nullptr), b1(nullptr), b2(nullptr), rc(nullptr), u0(nullptr) { + partial_flag = 1; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/bond_table.cpp b/src/MOLECULE/bond_table.cpp index 72e21e5210..e1eac7c4c2 100644 --- a/src/MOLECULE/bond_table.cpp +++ b/src/MOLECULE/bond_table.cpp @@ -538,7 +538,7 @@ void BondTable::spline(double *x, double *y, int n, double yp1, double ypn, doub { int i, k; double p, qn, sig, un; - double *u = new double[n]; + auto u = new double[n]; if (yp1 > 0.99e300) y2[0] = u[0] = 0.0; diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp index ee053f4f12..0cfd624cbc 100644 --- a/src/MOLECULE/dihedral_charmm.cpp +++ b/src/MOLECULE/dihedral_charmm.cpp @@ -350,7 +350,7 @@ void DihedralCharmm::coeff(int narg, char **arg) void DihedralCharmm::init_style() { if (utils::strmatch(update->integrate_style, "^respa")) { - Respa *r = (Respa *) update->integrate; + auto r = dynamic_cast( update->integrate); if (r->level_pair >= 0 && (r->level_pair != r->level_dihedral)) error->all(FLERR, "Dihedral style charmm must be set to same r-RESPA level as 'pair'"); if (r->level_outer >= 0 && (r->level_outer != r->level_dihedral)) diff --git a/src/MOLECULE/dihedral_charmmfsw.cpp b/src/MOLECULE/dihedral_charmmfsw.cpp index 4b7f0b04f3..607fa8fa4a 100644 --- a/src/MOLECULE/dihedral_charmmfsw.cpp +++ b/src/MOLECULE/dihedral_charmmfsw.cpp @@ -369,7 +369,7 @@ void DihedralCharmmfsw::coeff(int narg, char **arg) void DihedralCharmmfsw::init_style() { if (utils::strmatch(update->integrate_style, "^respa")) { - Respa *r = (Respa *) update->integrate; + auto r = dynamic_cast( update->integrate); if (r->level_pair >= 0 && (r->level_pair != r->level_dihedral)) error->all(FLERR, "Dihedral style charmmfsw must be set to same r-RESPA level as 'pair'"); if (r->level_outer >= 0 && (r->level_outer != r->level_dihedral)) @@ -405,9 +405,9 @@ void DihedralCharmmfsw::init_style() int itmp; int *p_dihedflag = (int *) force->pair->extract("dihedflag", itmp); - double *p_cutljinner = (double *) force->pair->extract("cut_lj_inner", itmp); - double *p_cutlj = (double *) force->pair->extract("cut_lj", itmp); - double *p_cutcoul = (double *) force->pair->extract("cut_coul", itmp); + auto p_cutljinner = (double *) force->pair->extract("cut_lj_inner", itmp); + auto p_cutlj = (double *) force->pair->extract("cut_lj", itmp); + auto p_cutcoul = (double *) force->pair->extract("cut_coul", itmp); if (p_cutcoul == nullptr || p_cutljinner == nullptr || p_cutlj == nullptr || p_dihedflag == nullptr) diff --git a/src/MOLECULE/dihedral_table.cpp b/src/MOLECULE/dihedral_table.cpp index dbca4a85c1..ea0b30cbd5 100644 --- a/src/MOLECULE/dihedral_table.cpp +++ b/src/MOLECULE/dihedral_table.cpp @@ -80,11 +80,11 @@ static int solve_cyc_tridiag( const double diag[], size_t d_stride, size_t N, bool warn) { int status = GSL_SUCCESS; - double * delta = (double *) malloc (N * sizeof (double)); - double * gamma = (double *) malloc (N * sizeof (double)); - double * alpha = (double *) malloc (N * sizeof (double)); - double * c = (double *) malloc (N * sizeof (double)); - double * z = (double *) malloc (N * sizeof (double)); + auto delta = (double *) malloc (N * sizeof (double)); + auto gamma = (double *) malloc (N * sizeof (double)); + auto alpha = (double *) malloc (N * sizeof (double)); + auto c = (double *) malloc (N * sizeof (double)); + auto z = (double *) malloc (N * sizeof (double)); if (delta == nullptr || gamma == nullptr || alpha == nullptr || c == nullptr || z == nullptr) { if (warn) @@ -193,9 +193,9 @@ static int cyc_spline(double const *xa, double const *ya, int n, double period, double *y2a, bool warn) { - double *diag = new double[n]; - double *offdiag = new double[n]; - double *rhs = new double[n]; + auto diag = new double[n]; + auto offdiag = new double[n]; + auto rhs = new double[n]; double xa_im1, xa_ip1; // In the cyclic case, there are n equations with n unknows. @@ -812,9 +812,9 @@ void DihedralTable::coeff(int narg, char **arg) // We also want the angles to be sorted in increasing order. // This messy code fixes these problems with the user's data: { - double *phifile_tmp = new double[tb->ninput]; //temporary arrays - double *ffile_tmp = new double[tb->ninput]; //used for sorting - double *efile_tmp = new double[tb->ninput]; + auto phifile_tmp = new double[tb->ninput]; //temporary arrays + auto ffile_tmp = new double[tb->ninput]; //used for sorting + auto efile_tmp = new double[tb->ninput]; // After re-imaging, does the range of angles cross the 0 or 2*PI boundary? // If so, find the discontinuity: diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index 01231b4b0e..b384294a89 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -189,7 +189,7 @@ void FixCMAP::init() newton_bond = force->newton_bond; if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -203,9 +203,9 @@ void FixCMAP::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/MOLFILE/dump_molfile.cpp b/src/MOLFILE/dump_molfile.cpp index 35e87f94af..8cc28ab88e 100644 --- a/src/MOLFILE/dump_molfile.cpp +++ b/src/MOLFILE/dump_molfile.cpp @@ -98,7 +98,7 @@ DumpMolfile::DumpMolfile(LAMMPS *lmp, int narg, char **arg) mf = new MolfileInterface(arg[5],MFI::M_WRITE); - const char *path = (const char *) "."; + const char *path = (const char *) "."; // NOLINT if (narg > 6) path=arg[6]; @@ -274,29 +274,12 @@ void DumpMolfile::openfile() // if one file per timestep, replace '*' with current timestep - char *filecurrent = new char[strlen(filename) + 16]; - if (multifile == 0) { - strcpy(filecurrent,filename); - } else { - char *ptr = strchr(filename,'*'); - char *p1 = filename; - char *p2 = filecurrent; - while (p1 != ptr) - *p2++ = *p1++; + std::string filecurrent = filename; + if (multifile == 1) + filecurrent = utils::star_subst(filename, update->ntimestep, padflag); - if (padflag == 0) { - sprintf(p2,BIGINT_FORMAT "%s",update->ntimestep,ptr+1); - } else { - char bif[8],pad[16]; - strcpy(bif,BIGINT_FORMAT); - sprintf(pad,"%%0%d%s%%s",padflag,&bif[1]); - sprintf(p2,pad,update->ntimestep,ptr+1); - } - } - - if (mf->open(filecurrent,&natoms)) - error->one(FLERR,"Cannot open dump file"); - delete[] filecurrent; + if (mf->open(filecurrent.c_str(), &natoms)) + error->one(FLERR,"Cannot open dump file {}: {}", filecurrent, utils::getsyserror()); } } diff --git a/src/MOLFILE/molfile_interface.cpp b/src/MOLFILE/molfile_interface.cpp index 5fd398570e..a83d8ed46c 100644 --- a/src/MOLFILE/molfile_interface.cpp +++ b/src/MOLFILE/molfile_interface.cpp @@ -47,7 +47,7 @@ extern "C" { // callback function for plugin registration. static int plugin_register_cb(void *v, vmdplugin_t *p) { - plugin_reginfo_t *r = static_cast(v); + auto r = static_cast(v); // make sure we have the proper plugin type (native reader) // for the desired file type (called "name" at this level) if ((strcmp(MOLFILE_PLUGIN_TYPE,p->type) == 0) @@ -214,7 +214,7 @@ MolfileInterface::~MolfileInterface() forget_plugin(); if (_info) { - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); delete[] a; _info = nullptr; } @@ -278,7 +278,7 @@ int MolfileInterface::load_plugin(const char *filename) ((regfunc)rfunc)(®info, plugin_register_cb); // make some checks to see if the plugin is suitable or not. - molfile_plugin_t *plugin = static_cast(reginfo.p); + auto plugin = static_cast(reginfo.p); // if the callback found a matching plugin and copied the struct, // its name element will point to a different location now. @@ -398,7 +398,7 @@ int MolfileInterface::open(const char *name, int *natoms) { if (!_plugin || !_dso || !natoms) return E_FILE; - molfile_plugin_t *p = static_cast(_plugin); + auto p = static_cast(_plugin); if (_mode & M_WRITE) _ptr = p->open_file_write(name,_type,*natoms); @@ -412,7 +412,7 @@ int MolfileInterface::open(const char *name, int *natoms) // we need to deal with structure information, // so we allocate and initialize storage for it. if (_mode & (M_RSTRUCT|M_WSTRUCT)) { - molfile_atom_t *a = new molfile_atom_t[_natoms]; + auto a = new molfile_atom_t[_natoms]; _info = a; memset(_info,0,_natoms*sizeof(molfile_atom_t)); for (int i=0; i < _natoms; ++i) { @@ -431,7 +431,7 @@ int MolfileInterface::structure() { if (!_plugin || !_dso) return E_FILE; - molfile_plugin_t *p = static_cast(_plugin); + auto p = static_cast(_plugin); int optflags = MOLFILE_NOOPTIONS; @@ -443,10 +443,10 @@ int MolfileInterface::structure() optflags |= (_props & P_RADS) ? MOLFILE_RADIUS : 0; optflags |= (_props & P_ATMN) ? MOLFILE_ATOMICNUMBER : 0; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); p->write_structure(_ptr,optflags,a); } else if (_mode & M_RSTRUCT) { - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); p->read_structure(_ptr,&optflags,a); // mandatory properties _props = P_NAME|P_TYPE|P_RESN|P_RESI|P_SEGN|P_CHAI; @@ -467,7 +467,7 @@ int MolfileInterface::close() if (!_plugin || !_dso || !_ptr) return E_FILE; - molfile_plugin_t *p = static_cast(_plugin); + auto p = static_cast(_plugin); if (_mode & M_WRITE) { p->close_file_write(_ptr); @@ -476,7 +476,7 @@ int MolfileInterface::close() } if (_info) { - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); delete[] a; _info = nullptr; } @@ -494,8 +494,8 @@ int MolfileInterface::timestep(float *coords, float *vels, if (!_plugin || !_dso || !_ptr) return 1; - molfile_plugin_t *p = static_cast(_plugin); - molfile_timestep_t *t = new molfile_timestep_t; + auto p = static_cast(_plugin); + auto t = new molfile_timestep_t; int rv; if (_mode & M_WRITE) { @@ -710,7 +710,7 @@ int MolfileInterface::property(int propid, int idx, float *prop) if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); if (_mode & M_WSTRUCT) _props |= write_atom_property(a[idx], propid, *prop); @@ -727,7 +727,7 @@ int MolfileInterface::property(int propid, int *types, float *prop) if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); if (_mode & M_WSTRUCT) { for (int i=0; i < _natoms; ++i) @@ -747,7 +747,7 @@ int MolfileInterface::property(int propid, float *prop) if ((_info == nullptr) || (prop == nullptr)) return P_NONE; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); if (_mode & M_WSTRUCT) { for (int i=0; i < _natoms; ++i) @@ -768,7 +768,7 @@ int MolfileInterface::property(int propid, int idx, double *prop) if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); if (_mode & M_WSTRUCT) return write_atom_property(a[idx], propid, *prop); @@ -785,7 +785,7 @@ int MolfileInterface::property(int propid, int *types, double *prop) if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); if (_mode & M_WSTRUCT) { for (int i=0; i < _natoms; ++i) @@ -805,7 +805,7 @@ int MolfileInterface::property(int propid, double *prop) if ((_info == nullptr) || (prop == nullptr)) return P_NONE; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); if (_mode & M_WSTRUCT) { for (int i=0; i < _natoms; ++i) @@ -840,7 +840,7 @@ int MolfileInterface::property(int propid, int idx, int *prop) if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); if (_mode & M_WSTRUCT) { char buf[64]; @@ -865,7 +865,7 @@ int MolfileInterface::property(int propid, int *types, int *prop) if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); if (_mode & M_WSTRUCT) { char buf[64]; @@ -894,7 +894,7 @@ int MolfileInterface::property(int propid, int *prop) if ((_info == nullptr) || (prop == nullptr)) return P_NONE; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); if (_mode & M_WSTRUCT) { char buf[64]; @@ -925,7 +925,7 @@ int MolfileInterface::property(int propid, int idx, char *prop) if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); if (_mode & M_WSTRUCT) { _props |= write_atom_property(a[idx], propid, prop); @@ -943,7 +943,7 @@ int MolfileInterface::property(int propid, int *types, char **prop) if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); if (_mode & M_WSTRUCT) { for (int i=0; i < _natoms; ++i) { @@ -964,7 +964,7 @@ int MolfileInterface::property(int propid, char **prop) if ((_info == nullptr) || (prop == nullptr)) return P_NONE; - molfile_atom_t *a = static_cast(_info); + auto a = static_cast(_info); if (_mode & M_WSTRUCT) { for (int i=0; i < _natoms; ++i) { diff --git a/src/MOLFILE/reader_molfile.cpp b/src/MOLFILE/reader_molfile.cpp index 5f75ae50f5..7b12678329 100644 --- a/src/MOLFILE/reader_molfile.cpp +++ b/src/MOLFILE/reader_molfile.cpp @@ -78,7 +78,7 @@ void ReaderMolfile::settings(int narg, char **arg) if (me == 0) { mf = new MolfileInterface(arg[0],MFI::M_READ); - const char *path = (const char *) "."; + const char *path = (const char *) "."; // NOLINT if (narg > 1) path=arg[1]; @@ -220,12 +220,12 @@ bigint ReaderMolfile::read_header(double box[3][3], int &boxinfo, int &triclinic triclinic = 1; - const double la = static_cast(cell[0]); - const double lb = static_cast(cell[1]); - const double lc = static_cast(cell[2]); - const double alpha = static_cast(cell[3]); - const double beta = static_cast(cell[4]); - const double gamma = static_cast(cell[5]); + const auto la = static_cast(cell[0]); + const auto lb = static_cast(cell[1]); + const auto lc = static_cast(cell[2]); + const auto alpha = static_cast(cell[3]); + const auto beta = static_cast(cell[4]); + const auto gamma = static_cast(cell[5]); const double lx = la; const double xy = lb * cos(gamma/90.0*MY_PI2); diff --git a/src/MPIIO/dump_atom_mpiio.cpp b/src/MPIIO/dump_atom_mpiio.cpp index 522950ab8b..b3933cec36 100644 --- a/src/MPIIO/dump_atom_mpiio.cpp +++ b/src/MPIIO/dump_atom_mpiio.cpp @@ -69,19 +69,7 @@ void DumpAtomMPIIO::openfile() filecurrent = filename; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) { - sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, update->ntimestep, ptr + 1); - } else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); - sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = new char[strlen(filecurrent) + 1]; @@ -98,8 +86,8 @@ void DumpAtomMPIIO::openfile() } if (append_flag) { // append open - int err = MPI_File_open(world, filecurrent, MPI_MODE_CREATE | MPI_MODE_APPEND | MPI_MODE_WRONLY, - MPI_INFO_NULL, &mpifh); + int err = MPI_File_open(world, filecurrent, MPI_MODE_CREATE | MPI_MODE_APPEND | + MPI_MODE_WRONLY, MPI_INFO_NULL, &mpifh); if (err != MPI_SUCCESS) error->one(FLERR, "Cannot open dump file {}: {}", filecurrent, utils::getsyserror()); @@ -112,8 +100,8 @@ void DumpAtomMPIIO::openfile() } else { // replace open - int err = - MPI_File_open(world, filecurrent, MPI_MODE_CREATE | MPI_MODE_WRONLY, MPI_INFO_NULL, &mpifh); + int err = MPI_File_open(world, filecurrent, MPI_MODE_CREATE | MPI_MODE_WRONLY, + MPI_INFO_NULL, &mpifh); if (err != MPI_SUCCESS) error->one(FLERR, "Cannot open dump file {}: {}", filecurrent, utils::getsyserror()); @@ -224,20 +212,10 @@ void DumpAtomMPIIO::init_style() delete[] format; if (format_line_user) { - int n = strlen(format_line_user) + 2; - format = new char[n]; - strcpy(format, format_line_user); - strcat(format, "\n"); + format = utils::strdup(std::string(format_line_user) + "\n"); } else { - char *str; - if (image_flag == 0) - str = (char *) TAGINT_FORMAT " %d %g %g %g"; - else - str = (char *) TAGINT_FORMAT " %d %g %g %g %d %d %d"; - int n = strlen(str) + 2; - format = new char[n]; - strcpy(format, str); - strcat(format, "\n"); + if (image_flag == 0) format = utils::strdup(TAGINT_FORMAT " %d %g %g %g\n"); + else format = utils::strdup(TAGINT_FORMAT " %d %g %g %g %d %d %d\n"); } // setup boundary string @@ -246,14 +224,25 @@ void DumpAtomMPIIO::init_style() // setup column string + std::string default_columns; + if (scale_flag == 0 && image_flag == 0) - columns = (char *) "id type x y z"; + default_columns = "id type x y z"; else if (scale_flag == 0 && image_flag == 1) - columns = (char *) "id type x y z ix iy iz"; + default_columns = "id type x y z ix iy iz"; else if (scale_flag == 1 && image_flag == 0) - columns = (char *) "id type xs ys zs"; + default_columns = "id type xs ys zs"; else if (scale_flag == 1 && image_flag == 1) - columns = (char *) "id type xs ys zs ix iy iz"; + default_columns = "id type xs ys zs ix iy iz"; + + int icol = 0; + columns.clear(); + for (auto item : utils::split_words(default_columns)) { + if (columns.size()) columns += " "; + if (keyword_user[icol].size()) columns += keyword_user[icol]; + else columns += item; + ++icol; + } // setup function ptrs diff --git a/src/MPIIO/dump_cfg_mpiio.cpp b/src/MPIIO/dump_cfg_mpiio.cpp index 978709b787..7f2048861c 100644 --- a/src/MPIIO/dump_cfg_mpiio.cpp +++ b/src/MPIIO/dump_cfg_mpiio.cpp @@ -81,20 +81,7 @@ void DumpCFGMPIIO::openfile() filecurrent = filename; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar,'*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent,"%s" BIGINT_FORMAT "%s", - filestar,update->ntimestep,ptr+1); - else { - char bif[8],pad[16]; - strcpy(bif,BIGINT_FORMAT); - sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); - sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = new char[strlen(filecurrent)+1]; @@ -111,12 +98,10 @@ void DumpCFGMPIIO::openfile() } if (append_flag) { // append open - int err = MPI_File_open( world, filecurrent, MPI_MODE_CREATE | MPI_MODE_APPEND | MPI_MODE_WRONLY , MPI_INFO_NULL, &mpifh); - if (err != MPI_SUCCESS) { - char str[128]; - sprintf(str,"Cannot open dump file %s",filecurrent); - error->one(FLERR,str); - } + int err = MPI_File_open( world, filecurrent, MPI_MODE_CREATE | MPI_MODE_APPEND | + MPI_MODE_WRONLY, MPI_INFO_NULL, &mpifh); + if (err != MPI_SUCCESS) error->one(FLERR, "Cannot open dump file {}", filecurrent); + int myrank; MPI_Comm_rank(world,&myrank); if (myrank == 0) @@ -125,15 +110,11 @@ void DumpCFGMPIIO::openfile() MPI_File_set_size(mpifh,mpifo+headerSize+sumFileSize); currentFileSize = mpifo+headerSize+sumFileSize; - } - else { // replace open + } else { // replace open - int err = MPI_File_open( world, filecurrent, MPI_MODE_CREATE | MPI_MODE_WRONLY , MPI_INFO_NULL, &mpifh); - if (err != MPI_SUCCESS) { - char str[128]; - sprintf(str,"Cannot open dump file %s",filecurrent); - error->one(FLERR,str); - } + int err = MPI_File_open( world, filecurrent, MPI_MODE_CREATE | MPI_MODE_WRONLY, + MPI_INFO_NULL, &mpifh); + if (err != MPI_SUCCESS) error->one(FLERR, "Cannot open dump file {}", filecurrent); mpifo = 0; MPI_File_set_size(mpifh,(MPI_Offset) (headerSize+sumFileSize)); @@ -290,41 +271,32 @@ void DumpCFGMPIIO::write_header(bigint n) // for unwrapped coords, set to UNWRAPEXPAND (10.0) // so molecules are not split across periodic box boundaries + double scale = 1.0; + if (atom->peri_flag) scale = atom->pdscale; + else if (unwrapflag == 1) scale = UNWRAPEXPAND; + + auto header = fmt::format("Number of particles = {}\n",n); + header += fmt::format("A = {} Angstrom (basic length-scale)\n",scale); + header += fmt::format("H0(1,1) = {} A\n",domain->xprd); + header += fmt::format("H0(1,2) = 0 A\n"); + header += fmt::format("H0(1,3) = 0 A\n"); + header += fmt::format("H0(2,1) = {} A\n",domain->xy); + header += fmt::format("H0(2,2) = {} A\n",domain->yprd); + header += fmt::format("H0(2,3) = 0 A\n"); + header += fmt::format("H0(3,1) = {} A\n",domain->xz); + header += fmt::format("H0(3,2) = {} A\n",domain->yz); + header += fmt::format("H0(3,3) = {} A\n",domain->zprd); + header += fmt::format(".NO_VELOCITY.\n"); + header += fmt::format("entry_count = {}\n",nfield-2); + for (int i = 0; i < nfield-5; i++) + header += fmt::format("auxiliary[{}] = {}\n",i,auxname[i]); + if (performEstimate) { - - headerBuffer = (char *) malloc(MAX_TEXT_HEADER_SIZE); - - headerSize = 0; - - double scale = 1.0; - if (atom->peri_flag) scale = atom->pdscale; - else if (unwrapflag == 1) scale = UNWRAPEXPAND; - - char str[64]; - - sprintf(str,"Number of particles = %s\n",BIGINT_FORMAT); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),str,n); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"A = %g Angstrom (basic length-scale)\n",scale); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(1,1) = %g A\n",domain->xprd); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(1,2) = 0 A \n"); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(1,3) = 0 A \n"); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(2,1) = %g A \n",domain->xy); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(2,2) = %g A\n",domain->yprd); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(2,3) = 0 A \n"); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(3,1) = %g A \n",domain->xz); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(3,2) = %g A \n",domain->yz); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"H0(3,3) = %g A\n",domain->zprd); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),".NO_VELOCITY.\n"); - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"entry_count = %d\n",nfield-2); - for (int i = 0; i < nfield-5; i++) - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"auxiliary[%d] = %s\n",i,auxname[i]); - } - else { // write data - + headerSize = header.size(); + } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,headerBuffer,headerSize,MPI_CHAR,MPI_STATUS_IGNORE); - mpifo += headerSize; - free(headerBuffer); + MPI_File_write_at(mpifh,mpifo,(void *)header.c_str(),header.size(),MPI_CHAR,MPI_STATUS_IGNORE); + mpifo += header.size(); } } diff --git a/src/MPIIO/dump_custom_mpiio.cpp b/src/MPIIO/dump_custom_mpiio.cpp index 766bd976bc..a911ea1149 100644 --- a/src/MPIIO/dump_custom_mpiio.cpp +++ b/src/MPIIO/dump_custom_mpiio.cpp @@ -36,21 +36,9 @@ using namespace LAMMPS_NS; -#define MAX_TEXT_HEADER_SIZE 4096 #define DUMP_BUF_CHUNK_SIZE 16384 #define DUMP_BUF_INCREMENT_SIZE 4096 -// clang-format off -enum{ ID, MOL, TYPE, ELEMENT, MASS, - X, Y, Z, XS, YS, ZS, XSTRI, YSTRI, ZSTRI, XU, YU, ZU, XUTRI, YUTRI, ZUTRI, - XSU, YSU, ZSU, XSUTRI, YSUTRI, ZSUTRI, - IX, IY, IZ, VX, VY, VZ, FX, FY, FZ, - Q, MUX, MUY, MUZ, MU, RADIUS, DIAMETER, - OMEGAX, OMEGAY, OMEGAZ, ANGMOMX, ANGMOMY, ANGMOMZ, - TQX, TQY, TQZ, SPIN, ERADIUS, ERVEL, ERFORCE, - COMPUTE, FIX, VARIABLE }; -enum{ LT, LE, GT, GE, EQ, NEQ }; -// clang-format on /* ---------------------------------------------------------------------- */ DumpCustomMPIIO::DumpCustomMPIIO(LAMMPS *lmp, int narg, char **arg) @@ -71,7 +59,7 @@ DumpCustomMPIIO::~DumpCustomMPIIO() void DumpCustomMPIIO::openfile() { - if (singlefile_opened) { // single file already opened, so just return after resetting filesize + if (singlefile_opened) { // single file already opened, so just return after resetting filesize mpifo = currentFileSize; MPI_File_set_size(mpifh, mpifo + headerSize + sumFileSize); currentFileSize = mpifo + headerSize + sumFileSize; @@ -84,19 +72,7 @@ void DumpCustomMPIIO::openfile() filecurrent = filename; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar, '*'); - *ptr = '\0'; - if (padflag == 0) { - sprintf(filecurrent, "%s" BIGINT_FORMAT "%s", filestar, update->ntimestep, ptr + 1); - } else { - char bif[8], pad[16]; - strcpy(bif, BIGINT_FORMAT); - sprintf(pad, "%%s%%0%d%s%%s", padflag, &bif[1]); - sprintf(filecurrent, pad, filestar, update->ntimestep, ptr + 1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = new char[strlen(filecurrent) + 1]; @@ -229,6 +205,19 @@ void DumpCustomMPIIO::write() void DumpCustomMPIIO::init_style() { + // assemble ITEMS: column string from defaults and user values + + delete[] columns; + std::string combined; + int icol = 0; + for (auto item : utils::split_words(columns_default)) { + if (combined.size()) combined += " "; + if (keyword_user[icol].size()) combined += keyword_user[icol]; + else combined += item; + ++icol; + } + columns = utils::strdup(combined); + // format = copy of default or user-specified line format delete[] format; diff --git a/src/MPIIO/dump_xyz_mpiio.cpp b/src/MPIIO/dump_xyz_mpiio.cpp index e4bfe4ef13..b134fbd35b 100644 --- a/src/MPIIO/dump_xyz_mpiio.cpp +++ b/src/MPIIO/dump_xyz_mpiio.cpp @@ -38,17 +38,6 @@ using namespace LAMMPS_NS; #define DUMP_BUF_CHUNK_SIZE 16384 #define DUMP_BUF_INCREMENT_SIZE 4096 -enum{ID,MOL,TYPE,ELEMENT,MASS, - X,Y,Z,XS,YS,ZS,XSTRI,YSTRI,ZSTRI,XU,YU,ZU,XUTRI,YUTRI,ZUTRI, - XSU,YSU,ZSU,XSUTRI,YSUTRI,ZSUTRI, - IX,IY,IZ, - VX,VY,VZ,FX,FY,FZ, - Q,MUX,MUY,MUZ,MU,RADIUS,DIAMETER, - OMEGAX,OMEGAY,OMEGAZ,ANGMOMX,ANGMOMY,ANGMOMZ, - TQX,TQY,TQZ,SPIN,ERADIUS,ERVEL,ERFORCE, - COMPUTE,FIX,VARIABLE}; -enum{LT,LE,GT,GE,EQ,NEQ}; - /* ---------------------------------------------------------------------- */ DumpXYZMPIIO::DumpXYZMPIIO(LAMMPS *lmp, int narg, char **arg) : @@ -81,20 +70,7 @@ void DumpXYZMPIIO::openfile() filecurrent = filename; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar,'*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent,"%s" BIGINT_FORMAT "%s", - filestar,update->ntimestep,ptr+1); - else { - char bif[8],pad[16]; - strcpy(bif,BIGINT_FORMAT); - sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); - sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = new char[strlen(filecurrent)+1]; @@ -111,33 +87,25 @@ void DumpXYZMPIIO::openfile() } if (append_flag) { // append open - int err = MPI_File_open( world, filecurrent, MPI_MODE_CREATE | MPI_MODE_APPEND | MPI_MODE_WRONLY , MPI_INFO_NULL, &mpifh); - if (err != MPI_SUCCESS) { - char str[128]; - sprintf(str,"Cannot open dump file %s",filecurrent); - error->one(FLERR,str); - } + int err = MPI_File_open( world, filecurrent, MPI_MODE_CREATE | MPI_MODE_APPEND | + MPI_MODE_WRONLY , MPI_INFO_NULL, &mpifh); + if (err != MPI_SUCCESS) error->one(FLERR, "Cannot open dump file {}", filecurrent); + int myrank; MPI_Comm_rank(world,&myrank); - if (myrank == 0) - MPI_File_get_size(mpifh,&mpifo); + if (myrank == 0) MPI_File_get_size(mpifh,&mpifo); MPI_Bcast(&mpifo, 1, MPI_LMP_BIGINT, 0, world); MPI_File_set_size(mpifh,mpifo+headerSize+sumFileSize); currentFileSize = mpifo+headerSize+sumFileSize; - } - else { // replace open + } else { // replace open - int err = MPI_File_open( world, filecurrent, MPI_MODE_CREATE | MPI_MODE_WRONLY , MPI_INFO_NULL, &mpifh); - if (err != MPI_SUCCESS) { - char str[128]; - sprintf(str,"Cannot open dump file %s",filecurrent); - error->one(FLERR,str); - } + int err = MPI_File_open( world, filecurrent, MPI_MODE_CREATE | MPI_MODE_WRONLY, + MPI_INFO_NULL, &mpifh); + if (err != MPI_SUCCESS) error->one(FLERR, "Cannot open dump file {}",filecurrent); mpifo = 0; MPI_File_set_size(mpifh,(MPI_Offset) (headerSize+sumFileSize)); currentFileSize = (headerSize+sumFileSize); - } } @@ -221,8 +189,8 @@ void DumpXYZMPIIO::write() performEstimate = 0; write_data(nme,buf); - if (multifile) MPI_File_close(&mpifh); - if (multifile) delete [] filecurrent; + if (multifile) MPI_File_close(&mpifh); + if (multifile) delete[] filecurrent; } /* ---------------------------------------------------------------------- */ @@ -231,7 +199,7 @@ void DumpXYZMPIIO::init_style() { // format = copy of default or user-specified line format - delete [] format; + delete[] format; char *str; if (format_line_user) str = format_line_user; else str = format_default; @@ -246,10 +214,8 @@ void DumpXYZMPIIO::init_style() if (typenames == nullptr) { typenames = new char*[ntypes+1]; - for (int itype = 1; itype <= ntypes; itype++) { - typenames[itype] = new char[12]; - sprintf(typenames[itype],"%d",itype); - } + for (int itype = 1; itype <= ntypes; itype++) + typenames[itype] = utils::strdup(std::to_string(itype)); } // setup function ptr @@ -260,20 +226,16 @@ void DumpXYZMPIIO::init_style() void DumpXYZMPIIO::write_header(bigint n) { + auto header = fmt::format("{}\n Atoms. Timestep: {}", n, update->ntimestep); + if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time()); + header += "\n"; + if (performEstimate) { - - headerBuffer = (char *) malloc(MAX_TEXT_HEADER_SIZE); - - headerSize = 0; - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),BIGINT_FORMAT "\n",n); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"Atoms. Timestep: " BIGINT_FORMAT "\n",update->ntimestep); - } - else { // write data - + headerSize = header.size(); + } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,headerBuffer,headerSize,MPI_CHAR,MPI_STATUS_IGNORE); - mpifo += headerSize; - free(headerBuffer); + MPI_File_write_at(mpifh,mpifo,(void *)header.c_str(),header.size(),MPI_CHAR,MPI_STATUS_IGNORE); + mpifo += header.size(); } } diff --git a/src/Makefile b/src/Makefile index 6dfa0357ce..1b0992ab95 100644 --- a/src/Makefile +++ b/src/Makefile @@ -54,6 +54,7 @@ PACKAGE = \ awpmd \ bocs \ body \ + bpm \ brownian \ cg-dna \ cg-sdk \ @@ -93,7 +94,6 @@ PACKAGE = \ mdi \ meam \ mesont \ - message \ mgpt \ misc \ ml-hdnnp \ @@ -148,7 +148,8 @@ PACKMOST = \ asphere \ bocs \ body \ - brownian \ + bpm \ + brownian \ cg-dna \ cg-sdk \ class2 \ @@ -207,7 +208,6 @@ PACKLIB = \ kim \ kokkos \ latte \ - message \ mpiio \ mscg \ poems \ @@ -234,7 +234,7 @@ PACKLIB = \ PACKSYS = compress latboltz mpiio python -PACKINT = atc awpmd colvars gpu kokkos mesont message poems +PACKINT = atc awpmd colvars gpu kokkos mesont poems PACKEXT = \ adios \ diff --git a/src/NETCDF/dump_netcdf.cpp b/src/NETCDF/dump_netcdf.cpp index d68da35b0b..13dc869021 100644 --- a/src/NETCDF/dump_netcdf.cpp +++ b/src/NETCDF/dump_netcdf.cpp @@ -178,7 +178,7 @@ DumpNetCDF::DumpNetCDF(LAMMPS *lmp, int narg, char **arg) : for (int j = 0; j < DUMP_NC_MAX_DIMS; j++) { perat[inc].field[j] = -1; } - strncpy(perat[inc].name, mangled.c_str(), NC_FIELD_NAME_MAX); + strncpy(perat[inc].name, mangled.c_str(), NC_FIELD_NAME_MAX-1); n_perat++; } @@ -217,22 +217,9 @@ DumpNetCDF::~DumpNetCDF() void DumpNetCDF::openfile() { - char *filecurrent = filename; - if (multifile && !singlefile_opened) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar,'*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent,"%s" BIGINT_FORMAT "%s", filestar,update->ntimestep,ptr+1); - else { - char bif[8],pad[16]; - strcpy(bif,BIGINT_FORMAT); - sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); - sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1); - } - *ptr = '*'; - } + std::string filecurrent = filename; + if (multifile && !singlefile_opened) + filecurrent = utils::star_subst(filename, update->ntimestep, padflag); if (thermo && !singlefile_opened) { delete[] thermovar; @@ -291,7 +278,7 @@ void DumpNetCDF::openfile() if (singlefile_opened) return; singlefile_opened = 1; - NCERRX( nc_open(filecurrent, NC_WRITE, &ncid), filecurrent ); + NCERRX( nc_open(filecurrent.c_str(), NC_WRITE, &ncid), filecurrent.c_str() ); // dimensions NCERRX( nc_inq_dimid(ncid, NC_FRAME_STR, &frame_dim), NC_FRAME_STR ); @@ -356,7 +343,7 @@ void DumpNetCDF::openfile() if (singlefile_opened) return; singlefile_opened = 1; - NCERRX( nc_create(filecurrent, NC_64BIT_DATA, &ncid), filecurrent ); + NCERRX( nc_create(filecurrent.c_str(), NC_64BIT_DATA, &ncid), filecurrent.c_str() ); // dimensions NCERRX( nc_def_dim(ncid, NC_FRAME_STR, NC_UNLIMITED, &frame_dim), NC_FRAME_STR ); diff --git a/src/NETCDF/dump_netcdf_mpiio.cpp b/src/NETCDF/dump_netcdf_mpiio.cpp index ac281d26a3..dbf95953d7 100644 --- a/src/NETCDF/dump_netcdf_mpiio.cpp +++ b/src/NETCDF/dump_netcdf_mpiio.cpp @@ -177,7 +177,7 @@ DumpNetCDFMPIIO::DumpNetCDFMPIIO(LAMMPS *lmp, int narg, char **arg) : for (int j = 0; j < DUMP_NC_MPIIO_MAX_DIMS; j++) { perat[inc].field[j] = -1; } - strncpy(perat[inc].name, mangled.c_str(), NC_MPIIO_FIELD_NAME_MAX); + strncpy(perat[inc].name, mangled.c_str(), NC_MPIIO_FIELD_NAME_MAX-1); n_perat++; } @@ -214,22 +214,9 @@ DumpNetCDFMPIIO::~DumpNetCDFMPIIO() void DumpNetCDFMPIIO::openfile() { - char *filecurrent = filename; - if (multifile && !singlefile_opened) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar,'*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent,"%s" BIGINT_FORMAT "%s", filestar,update->ntimestep,ptr+1); - else { - char bif[8],pad[16]; - strcpy(bif,BIGINT_FORMAT); - sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); - sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1); - } - *ptr = '*'; - } + std::string filecurrent = filename; + if (multifile && !singlefile_opened) + filecurrent = utils::star_subst(filename, update->ntimestep, padflag); if (thermo && !singlefile_opened) { delete[] thermovar; @@ -287,7 +274,8 @@ void DumpNetCDFMPIIO::openfile() if (singlefile_opened) return; singlefile_opened = 1; - NCERRX( ncmpi_open(world, filecurrent, NC_WRITE, MPI_INFO_NULL, &ncid), filecurrent ); + NCERRX( ncmpi_open(world, filecurrent.c_str(), NC_WRITE, MPI_INFO_NULL, &ncid), + filecurrent.c_str() ); // dimensions NCERRX( ncmpi_inq_dimid(ncid, NC_FRAME_STR, &frame_dim), NC_FRAME_STR ); @@ -352,7 +340,8 @@ void DumpNetCDFMPIIO::openfile() if (singlefile_opened) return; singlefile_opened = 1; - NCERRX( ncmpi_create(world, filecurrent, NC_64BIT_DATA, MPI_INFO_NULL, &ncid), filecurrent ); + NCERRX( ncmpi_create(world, filecurrent.c_str(), NC_64BIT_DATA, MPI_INFO_NULL, &ncid), + filecurrent.c_str() ); // dimensions NCERRX( ncmpi_def_dim(ncid, NC_FRAME_STR, NC_UNLIMITED, &frame_dim), NC_FRAME_STR ); diff --git a/src/OPENMP/angle_charmm_omp.cpp b/src/OPENMP/angle_charmm_omp.cpp index 1c84828c63..2994cfad13 100644 --- a/src/OPENMP/angle_charmm_omp.cpp +++ b/src/OPENMP/angle_charmm_omp.cpp @@ -88,8 +88,8 @@ void AngleCharmmOMP::eval(int nfrom, int nto, ThrData * const thr) double rsq1,rsq2,r1,r2,c,s,a,a11,a12,a22; double delxUB,delyUB,delzUB,rsqUB,rUB,dr,rk,forceUB; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/angle_class2_omp.cpp b/src/OPENMP/angle_class2_omp.cpp index 54aa062d44..239b373004 100644 --- a/src/OPENMP/angle_class2_omp.cpp +++ b/src/OPENMP/angle_class2_omp.cpp @@ -89,8 +89,8 @@ void AngleClass2OMP::eval(int nfrom, int nto, ThrData * const thr) double rsq1,rsq2,r1,r2,c,s,a,a11,a12,a22,b1,b2; double vx11,vx12,vy11,vy12,vz11,vz12,vx21,vx22,vy21,vy22,vz21,vz22; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/angle_cosine_delta_omp.cpp b/src/OPENMP/angle_cosine_delta_omp.cpp index e60d0748df..48330a5087 100644 --- a/src/OPENMP/angle_cosine_delta_omp.cpp +++ b/src/OPENMP/angle_cosine_delta_omp.cpp @@ -86,8 +86,8 @@ void AngleCosineDeltaOMP::eval(int nfrom, int nto, ThrData * const thr) double eangle,f1[3],f3[3]; double rsq1,rsq2,r1,r2,c,a,cot,a11,a12,a22,b11,b12,b22,c0,s0,s; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/angle_cosine_omp.cpp b/src/OPENMP/angle_cosine_omp.cpp index d0c27dfab0..cd5a9fab58 100644 --- a/src/OPENMP/angle_cosine_omp.cpp +++ b/src/OPENMP/angle_cosine_omp.cpp @@ -86,8 +86,8 @@ void AngleCosineOMP::eval(int nfrom, int nto, ThrData * const thr) double eangle,f1[3],f3[3]; double rsq1,rsq2,r1,r2,c,a,a11,a12,a22; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/angle_cosine_periodic_omp.cpp b/src/OPENMP/angle_cosine_periodic_omp.cpp index 58db02d6f7..a97a9d7e89 100644 --- a/src/OPENMP/angle_cosine_periodic_omp.cpp +++ b/src/OPENMP/angle_cosine_periodic_omp.cpp @@ -89,8 +89,8 @@ void AngleCosinePeriodicOMP::eval(int nfrom, int nto, ThrData * const thr) double rsq1,rsq2,r1,r2,c,a,a11,a12,a22; double tn,tn_1,tn_2,un,un_1,un_2; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/angle_cosine_shift_exp_omp.cpp b/src/OPENMP/angle_cosine_shift_exp_omp.cpp index f2abf1f1b0..1f9b150a57 100644 --- a/src/OPENMP/angle_cosine_shift_exp_omp.cpp +++ b/src/OPENMP/angle_cosine_shift_exp_omp.cpp @@ -87,8 +87,8 @@ void AngleCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr) double rsq1,rsq2,r1,r2,c,s,a11,a12,a22; double exp2,aa,uumin,cccpsss,cssmscc; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/angle_cosine_shift_omp.cpp b/src/OPENMP/angle_cosine_shift_omp.cpp index 4d6e1ab81a..08649f01e2 100644 --- a/src/OPENMP/angle_cosine_shift_omp.cpp +++ b/src/OPENMP/angle_cosine_shift_omp.cpp @@ -86,8 +86,8 @@ void AngleCosineShiftOMP::eval(int nfrom, int nto, ThrData * const thr) double f1[3],f3[3]; double rsq1,rsq2,r1,r2,c,s,cps,a11,a12,a22; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; double eangle = 0.0; diff --git a/src/OPENMP/angle_cosine_squared_omp.cpp b/src/OPENMP/angle_cosine_squared_omp.cpp index 65b73216c7..6755426b71 100644 --- a/src/OPENMP/angle_cosine_squared_omp.cpp +++ b/src/OPENMP/angle_cosine_squared_omp.cpp @@ -87,8 +87,8 @@ void AngleCosineSquaredOMP::eval(int nfrom, int nto, ThrData * const thr) double dcostheta,tk; double rsq1,rsq2,r1,r2,c,a,a11,a12,a22; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/angle_fourier_omp.cpp b/src/OPENMP/angle_fourier_omp.cpp index d7a05f6850..b1e4cf1f0a 100644 --- a/src/OPENMP/angle_fourier_omp.cpp +++ b/src/OPENMP/angle_fourier_omp.cpp @@ -87,8 +87,8 @@ void AngleFourierOMP::eval(int nfrom, int nto, ThrData * const thr) double term; double rsq1,rsq2,r1,r2,c,c2,a,a11,a12,a22; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/angle_fourier_simple_omp.cpp b/src/OPENMP/angle_fourier_simple_omp.cpp index 670f8cfc83..b76e9c875e 100644 --- a/src/OPENMP/angle_fourier_simple_omp.cpp +++ b/src/OPENMP/angle_fourier_simple_omp.cpp @@ -93,8 +93,8 @@ void AngleFourierSimpleOMP::eval(int nfrom, int nto, ThrData *const thr) double term, sgn; double rsq1, rsq2, r1, r2, c, cn, th, nth, a, a11, a12, a22; - const dbl3_t *_noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t *_noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto *_noalias const x = (dbl3_t *) atom->x[0]; + auto *_noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t *_noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/angle_harmonic_omp.cpp b/src/OPENMP/angle_harmonic_omp.cpp index 2d1a34570d..a67f784624 100644 --- a/src/OPENMP/angle_harmonic_omp.cpp +++ b/src/OPENMP/angle_harmonic_omp.cpp @@ -87,8 +87,8 @@ void AngleHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr) double dtheta,tk; double rsq1,rsq2,r1,r2,c,s,a,a11,a12,a22; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/angle_quartic_omp.cpp b/src/OPENMP/angle_quartic_omp.cpp index 3770319323..6592584c99 100644 --- a/src/OPENMP/angle_quartic_omp.cpp +++ b/src/OPENMP/angle_quartic_omp.cpp @@ -87,8 +87,8 @@ void AngleQuarticOMP::eval(int nfrom, int nto, ThrData * const thr) double dtheta,dtheta2,dtheta3,dtheta4,tk; double rsq1,rsq2,r1,r2,c,s,a,a11,a12,a22; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/angle_sdk_omp.cpp b/src/OPENMP/angle_sdk_omp.cpp index 8fcfb3df08..e82121959b 100644 --- a/src/OPENMP/angle_sdk_omp.cpp +++ b/src/OPENMP/angle_sdk_omp.cpp @@ -89,8 +89,8 @@ void AngleSDKOMP::eval(int nfrom, int nto, ThrData * const thr) double dtheta,tk; double rsq1,rsq2,rsq3,r1,r2,c,s,a,a11,a12,a22; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/angle_table_omp.cpp b/src/OPENMP/angle_table_omp.cpp index cca34a67f7..d796ac23e3 100644 --- a/src/OPENMP/angle_table_omp.cpp +++ b/src/OPENMP/angle_table_omp.cpp @@ -88,8 +88,8 @@ void AngleTableOMP::eval(int nfrom, int nto, ThrData * const thr) double rsq1,rsq2,r1,r2,c,s,a,a11,a12,a22; double theta,u,mdu; //mdu: minus du, -du/dx=f - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int4_t * _noalias const anglelist = (int4_t *) neighbor->anglelist[0]; const int nlocal = atom->nlocal; eangle = 0.0; diff --git a/src/OPENMP/bond_class2_omp.cpp b/src/OPENMP/bond_class2_omp.cpp index 170e97d13d..9b7ed7169f 100644 --- a/src/OPENMP/bond_class2_omp.cpp +++ b/src/OPENMP/bond_class2_omp.cpp @@ -85,8 +85,8 @@ void BondClass2OMP::eval(int nfrom, int nto, ThrData * const thr) double delx,dely,delz,ebond,fbond; double rsq,r,dr,dr2,dr3,dr4,de_bond; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int nlocal = atom->nlocal; ebond = 0.0; diff --git a/src/OPENMP/bond_fene_expand_omp.cpp b/src/OPENMP/bond_fene_expand_omp.cpp index 56ea5b52a0..30c6f154b7 100644 --- a/src/OPENMP/bond_fene_expand_omp.cpp +++ b/src/OPENMP/bond_fene_expand_omp.cpp @@ -89,8 +89,8 @@ void BondFENEExpandOMP::eval(int nfrom, int nto, ThrData * const thr) double rsq,r0sq,rlogarg,sr2,sr6; double r,rshift,rshiftsq; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int nlocal = atom->nlocal; const int tid = thr->get_tid(); diff --git a/src/OPENMP/bond_fene_omp.cpp b/src/OPENMP/bond_fene_omp.cpp index 57afe43a18..ef1343ec90 100644 --- a/src/OPENMP/bond_fene_omp.cpp +++ b/src/OPENMP/bond_fene_omp.cpp @@ -88,8 +88,8 @@ void BondFENEOMP::eval(int nfrom, int nto, ThrData * const thr) double delx,dely,delz,ebond,fbond; double rsq,r0sq,rlogarg,sr2,sr6; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int nlocal = atom->nlocal; const int tid = thr->get_tid(); diff --git a/src/OPENMP/bond_gromos_omp.cpp b/src/OPENMP/bond_gromos_omp.cpp index bba8f15230..6089290386 100644 --- a/src/OPENMP/bond_gromos_omp.cpp +++ b/src/OPENMP/bond_gromos_omp.cpp @@ -81,8 +81,8 @@ void BondGromosOMP::eval(int nfrom, int nto, ThrData * const thr) int i1,i2,n,type; double delx,dely,delz,ebond,fbond; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int nlocal = atom->nlocal; ebond = 0.0; diff --git a/src/OPENMP/bond_harmonic_omp.cpp b/src/OPENMP/bond_harmonic_omp.cpp index 5ad816bf1b..cc9bbea5da 100644 --- a/src/OPENMP/bond_harmonic_omp.cpp +++ b/src/OPENMP/bond_harmonic_omp.cpp @@ -84,8 +84,8 @@ void BondHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr) double delx,dely,delz,ebond,fbond; double rsq,r,dr,rk; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int nlocal = atom->nlocal; ebond = 0.0; diff --git a/src/OPENMP/bond_harmonic_shift_cut_omp.cpp b/src/OPENMP/bond_harmonic_shift_cut_omp.cpp index 3d462a8305..702eae64d0 100644 --- a/src/OPENMP/bond_harmonic_shift_cut_omp.cpp +++ b/src/OPENMP/bond_harmonic_shift_cut_omp.cpp @@ -84,8 +84,8 @@ void BondHarmonicShiftCutOMP::eval(int nfrom, int nto, ThrData * const thr) double delx,dely,delz,ebond,fbond; double rsq,r,dr,rk; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int nlocal = atom->nlocal; ebond = 0.0; diff --git a/src/OPENMP/bond_harmonic_shift_omp.cpp b/src/OPENMP/bond_harmonic_shift_omp.cpp index 567287bcc7..375de2eff7 100644 --- a/src/OPENMP/bond_harmonic_shift_omp.cpp +++ b/src/OPENMP/bond_harmonic_shift_omp.cpp @@ -84,8 +84,8 @@ void BondHarmonicShiftOMP::eval(int nfrom, int nto, ThrData * const thr) double delx,dely,delz,ebond,fbond; double rsq,r,dr,rk; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int nlocal = atom->nlocal; ebond = 0.0; diff --git a/src/OPENMP/bond_morse_omp.cpp b/src/OPENMP/bond_morse_omp.cpp index 3e9c5a9b5b..b1938b926f 100644 --- a/src/OPENMP/bond_morse_omp.cpp +++ b/src/OPENMP/bond_morse_omp.cpp @@ -84,8 +84,8 @@ void BondMorseOMP::eval(int nfrom, int nto, ThrData * const thr) double delx,dely,delz,ebond,fbond; double rsq,r,dr,ralpha; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int nlocal = atom->nlocal; ebond = 0.0; diff --git a/src/OPENMP/bond_nonlinear_omp.cpp b/src/OPENMP/bond_nonlinear_omp.cpp index 4a011a1f8a..209c7d4719 100644 --- a/src/OPENMP/bond_nonlinear_omp.cpp +++ b/src/OPENMP/bond_nonlinear_omp.cpp @@ -84,8 +84,8 @@ void BondNonlinearOMP::eval(int nfrom, int nto, ThrData * const thr) double delx,dely,delz,ebond,fbond; double rsq,r,dr,drsq,lamdasq,denom,denomsq; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int nlocal = atom->nlocal; ebond = 0.0; diff --git a/src/OPENMP/bond_table_omp.cpp b/src/OPENMP/bond_table_omp.cpp index dcc13c85c9..011ba5cc49 100644 --- a/src/OPENMP/bond_table_omp.cpp +++ b/src/OPENMP/bond_table_omp.cpp @@ -85,8 +85,8 @@ void BondTableOMP::eval(int nfrom, int nto, ThrData * const thr) double rsq,r; double u,mdu; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int3_t * _noalias const bondlist = (int3_t *) neighbor->bondlist[0]; const int nlocal = atom->nlocal; ebond = 0.0; diff --git a/src/OPENMP/dihedral_charmm_omp.cpp b/src/OPENMP/dihedral_charmm_omp.cpp index 7efd6d367b..72d6a93a64 100644 --- a/src/OPENMP/dihedral_charmm_omp.cpp +++ b/src/OPENMP/dihedral_charmm_omp.cpp @@ -103,8 +103,8 @@ void DihedralCharmmOMP::eval(int nfrom, int nto, ThrData * const thr) ecoul = evdwl = edihedral = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * const atomtype = atom->type; const int5_t * _noalias const dihedrallist = (int5_t *) neighbor->dihedrallist[0]; diff --git a/src/OPENMP/dihedral_class2_omp.cpp b/src/OPENMP/dihedral_class2_omp.cpp index f843def3ec..e2bcfaa990 100644 --- a/src/OPENMP/dihedral_class2_omp.cpp +++ b/src/OPENMP/dihedral_class2_omp.cpp @@ -99,8 +99,8 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr) edihedral = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const dihedrallist = (int5_t *) neighbor->dihedrallist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/dihedral_cosine_shift_exp_omp.cpp b/src/OPENMP/dihedral_cosine_shift_exp_omp.cpp index 9da2a5b8b5..45ca6ee84f 100644 --- a/src/OPENMP/dihedral_cosine_shift_exp_omp.cpp +++ b/src/OPENMP/dihedral_cosine_shift_exp_omp.cpp @@ -95,8 +95,8 @@ void DihedralCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr) edihedral = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const dihedrallist = (int5_t *) neighbor->dihedrallist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/dihedral_fourier_omp.cpp b/src/OPENMP/dihedral_fourier_omp.cpp index a7c5264fa5..594cd3e922 100644 --- a/src/OPENMP/dihedral_fourier_omp.cpp +++ b/src/OPENMP/dihedral_fourier_omp.cpp @@ -92,8 +92,8 @@ void DihedralFourierOMP::eval(int nfrom, int nto, ThrData * const thr) edihedral = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const dihedrallist = (int5_t *) neighbor->dihedrallist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/dihedral_harmonic_omp.cpp b/src/OPENMP/dihedral_harmonic_omp.cpp index 6bbfd6ff12..dd93cfd126 100644 --- a/src/OPENMP/dihedral_harmonic_omp.cpp +++ b/src/OPENMP/dihedral_harmonic_omp.cpp @@ -94,8 +94,8 @@ void DihedralHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr) edihedral = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const dihedrallist = (int5_t *) neighbor->dihedrallist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/dihedral_helix_omp.cpp b/src/OPENMP/dihedral_helix_omp.cpp index c73622ed9d..d33f7fb4d0 100644 --- a/src/OPENMP/dihedral_helix_omp.cpp +++ b/src/OPENMP/dihedral_helix_omp.cpp @@ -97,8 +97,8 @@ void DihedralHelixOMP::eval(int nfrom, int nto, ThrData * const thr) edihedral = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const dihedrallist = (int5_t *) neighbor->dihedrallist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/dihedral_multi_harmonic_omp.cpp b/src/OPENMP/dihedral_multi_harmonic_omp.cpp index cf7e991c9d..d8de18e3c3 100644 --- a/src/OPENMP/dihedral_multi_harmonic_omp.cpp +++ b/src/OPENMP/dihedral_multi_harmonic_omp.cpp @@ -95,8 +95,8 @@ void DihedralMultiHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr) edihedral = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const dihedrallist = (int5_t *) neighbor->dihedrallist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/dihedral_nharmonic_omp.cpp b/src/OPENMP/dihedral_nharmonic_omp.cpp index f2ec46190e..11c0839529 100644 --- a/src/OPENMP/dihedral_nharmonic_omp.cpp +++ b/src/OPENMP/dihedral_nharmonic_omp.cpp @@ -94,8 +94,8 @@ void DihedralNHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr) edihedral = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const dihedrallist = (int5_t *) neighbor->dihedrallist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/dihedral_opls_omp.cpp b/src/OPENMP/dihedral_opls_omp.cpp index 543485aa0f..b3b5ea9178 100644 --- a/src/OPENMP/dihedral_opls_omp.cpp +++ b/src/OPENMP/dihedral_opls_omp.cpp @@ -96,8 +96,8 @@ void DihedralOPLSOMP::eval(int nfrom, int nto, ThrData * const thr) edihedral = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const dihedrallist = (int5_t *) neighbor->dihedrallist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/dihedral_quadratic_omp.cpp b/src/OPENMP/dihedral_quadratic_omp.cpp index f6582d3bc0..2c08dd4505 100644 --- a/src/OPENMP/dihedral_quadratic_omp.cpp +++ b/src/OPENMP/dihedral_quadratic_omp.cpp @@ -97,8 +97,8 @@ void DihedralQuadraticOMP::eval(int nfrom, int nto, ThrData * const thr) edihedral = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const dihedrallist = (int5_t *) neighbor->dihedrallist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/domain_omp.cpp b/src/OPENMP/domain_omp.cpp index af4d41a585..48b1118333 100644 --- a/src/OPENMP/domain_omp.cpp +++ b/src/OPENMP/domain_omp.cpp @@ -47,7 +47,7 @@ void DomainOMP::pbc() // verify owned atoms have valid numerical coords // may not if computed pairwise force between 2 atoms at same location - const double *_noalias const coord = &atom->x[0][0]; + const double *_noalias const coord = atom->x[0]; // NOLINT const int n3 = 3 * nlocal; int flag = 0; #if defined(_OPENMP) // clang-format off @@ -57,8 +57,8 @@ void DomainOMP::pbc() if (!std::isfinite(coord[i])) flag = 1; if (flag) error->one(FLERR, "Non-numeric atom coords - simulation unstable"); - dbl3_t *_noalias const x = (dbl3_t *) &atom->x[0][0]; - dbl3_t *_noalias const v = (dbl3_t *) &atom->v[0][0]; + auto *_noalias const x = (dbl3_t *) atom->x[0]; + auto *_noalias const v = (dbl3_t *) atom->v[0]; const double *_noalias const lo = (triclinic == 0) ? boxlo : boxlo_lamda; const double *_noalias const hi = (triclinic == 0) ? boxhi : boxhi_lamda; const double *_noalias const period = (triclinic == 0) ? prd : prd_lamda; @@ -162,7 +162,7 @@ void DomainOMP::lamda2x(int n) { const int num = n; if (!n) return; - dbl3_t *_noalias const x = (dbl3_t *) &atom->x[0][0]; + auto *_noalias const x = (dbl3_t *) atom->x[0]; #if defined(_OPENMP) #pragma omp parallel for LMP_DEFAULT_NONE schedule(static) @@ -183,7 +183,7 @@ void DomainOMP::x2lamda(int n) { const int num = n; if (!n) return; - dbl3_t *_noalias const x = (dbl3_t *) &atom->x[0][0]; + auto *_noalias const x = (dbl3_t *) atom->x[0]; #if defined(_OPENMP) #pragma omp parallel for LMP_DEFAULT_NONE schedule(static) diff --git a/src/OPENMP/fix_neigh_history_omp.cpp b/src/OPENMP/fix_neigh_history_omp.cpp index 4db6678721..ec101709c9 100644 --- a/src/OPENMP/fix_neigh_history_omp.cpp +++ b/src/OPENMP/fix_neigh_history_omp.cpp @@ -578,7 +578,7 @@ void FixNeighHistoryOMP::post_neighbor() for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; - rflag = sbmask(j); + rflag = histmask(j); j &= NEIGHMASK; jlist[jj] = j; diff --git a/src/OPENMP/fix_nh_asphere_omp.cpp b/src/OPENMP/fix_nh_asphere_omp.cpp index 9325038790..554a0d52b6 100644 --- a/src/OPENMP/fix_nh_asphere_omp.cpp +++ b/src/OPENMP/fix_nh_asphere_omp.cpp @@ -43,7 +43,7 @@ FixNHAsphereOMP::FixNHAsphereOMP(LAMMPS *lmp, int narg, char **arg) : void FixNHAsphereOMP::init() { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Compute nvt/nph/npt asphere requires atom style ellipsoid"); @@ -68,10 +68,10 @@ void FixNHAsphereOMP::init() void FixNHAsphereOMP::nve_v() { - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - dbl3_t * _noalias const angmom = (dbl3_t *) atom->angmom[0]; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; - const dbl3_t * _noalias const torque = (dbl3_t *) atom->torque[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + auto * _noalias const angmom = (dbl3_t *) atom->angmom[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; + const auto * _noalias const torque = (dbl3_t *) atom->torque[0]; const double * _noalias const rmass = atom->rmass; const int * _noalias const mask = atom->mask; const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal; @@ -101,9 +101,9 @@ void FixNHAsphereOMP::nve_v() void FixNHAsphereOMP::nve_x() { - dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - dbl3_t * _noalias const angmom = (dbl3_t *) atom->angmom[0]; + auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const v = (dbl3_t *) atom->v[0]; + auto * _noalias const angmom = (dbl3_t *) atom->angmom[0]; const double * _noalias const rmass = atom->rmass; const int * _noalias const mask = atom->mask; AtomVecEllipsoid::Bonus * _noalias const bonus = avec->bonus; @@ -154,8 +154,8 @@ void FixNHAsphereOMP::nve_x() void FixNHAsphereOMP::nh_v_temp() { - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - dbl3_t * _noalias const angmom = (dbl3_t *) atom->angmom[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + auto * _noalias const angmom = (dbl3_t *) atom->angmom[0]; const int * _noalias const mask = atom->mask; const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal; diff --git a/src/OPENMP/fix_nh_omp.cpp b/src/OPENMP/fix_nh_omp.cpp index c2601c1b22..29186af629 100644 --- a/src/OPENMP/fix_nh_omp.cpp +++ b/src/OPENMP/fix_nh_omp.cpp @@ -16,15 +16,17 @@ Contributing authors: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "fix_nh_omp.h" -#include + #include "atom.h" #include "compute.h" #include "domain.h" #include "error.h" #include "modify.h" +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -231,7 +233,7 @@ void FixNHOMP::nh_v_press() const double factor0 = exp(-dt4*(omega_dot[0]+mtk_term2)); const double factor1 = exp(-dt4*(omega_dot[1]+mtk_term2)); const double factor2 = exp(-dt4*(omega_dot[2]+mtk_term2)); - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; const int * _noalias const mask = atom->mask; const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal; @@ -283,8 +285,8 @@ void FixNHOMP::nh_v_press() void FixNHOMP::nve_v() { - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; const int * _noalias const mask = atom->mask; const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal; @@ -324,8 +326,8 @@ void FixNHOMP::nve_v() void FixNHOMP::nve_x() { - dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; + auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const v = (dbl3_t *) atom->v[0]; const int * _noalias const mask = atom->mask; const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal; @@ -348,7 +350,7 @@ void FixNHOMP::nve_x() void FixNHOMP::nh_v_temp() { - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; const int * _noalias const mask = atom->mask; const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal; diff --git a/src/OPENMP/fix_nh_sphere_omp.cpp b/src/OPENMP/fix_nh_sphere_omp.cpp index 2c00a8ffb7..788db2b6ee 100644 --- a/src/OPENMP/fix_nh_sphere_omp.cpp +++ b/src/OPENMP/fix_nh_sphere_omp.cpp @@ -16,12 +16,13 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "fix_nh_sphere_omp.h" + #include "atom.h" #include "compute.h" #include "error.h" +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -65,10 +66,10 @@ void FixNHSphereOMP::init() void FixNHSphereOMP::nve_v() { - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - dbl3_t * _noalias const omega = (dbl3_t *) atom->omega[0]; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; - const dbl3_t * _noalias const torque = (dbl3_t *) atom->torque[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + auto * _noalias const omega = (dbl3_t *) atom->omega[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; + const auto * _noalias const torque = (dbl3_t *) atom->torque[0]; const double * _noalias const radius = atom->radius; const double * _noalias const rmass = atom->rmass; const int * _noalias const mask = atom->mask; @@ -110,8 +111,8 @@ void FixNHSphereOMP::nve_v() void FixNHSphereOMP::nh_v_temp() { - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - dbl3_t * _noalias const omega = (dbl3_t *) atom->omega[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + auto * _noalias const omega = (dbl3_t *) atom->omega[0]; const int * _noalias const mask = atom->mask; const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal; diff --git a/src/OPENMP/fix_nve_omp.cpp b/src/OPENMP/fix_nve_omp.cpp index 1380d4ea18..6562e90270 100644 --- a/src/OPENMP/fix_nve_omp.cpp +++ b/src/OPENMP/fix_nve_omp.cpp @@ -34,9 +34,9 @@ void FixNVEOMP::initial_integrate(int /* vflag */) { // update v and x of atoms in group - dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; const int * const mask = atom->mask; const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal; @@ -81,8 +81,8 @@ void FixNVEOMP::final_integrate() { // update v of atoms in group - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; const int * const mask = atom->mask; const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal; diff --git a/src/OPENMP/fix_nvt_sllod_omp.cpp b/src/OPENMP/fix_nvt_sllod_omp.cpp index 3a36b0eff5..c9ee6c153f 100644 --- a/src/OPENMP/fix_nvt_sllod_omp.cpp +++ b/src/OPENMP/fix_nvt_sllod_omp.cpp @@ -78,7 +78,7 @@ void FixNVTSllodOMP::init() int i; for (i = 0; i < modify->nfix; i++) if (utils::strmatch(modify->fix[i]->style,"^deform")) { - if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP) + if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod/omp with inconsistent fix " "deform remap option"); break; @@ -100,7 +100,7 @@ void FixNVTSllodOMP::nh_v_temp() // calculate temperature since some computes require temp // computed on current nlocal atoms to remove bias - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; const int * _noalias const mask = atom->mask; const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal; diff --git a/src/OPENMP/fix_omp.cpp b/src/OPENMP/fix_omp.cpp index 6be7f7c1fc..4f5e990fcc 100644 --- a/src/OPENMP/fix_omp.cpp +++ b/src/OPENMP/fix_omp.cpp @@ -130,7 +130,7 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) #endif { const int tid = get_tid(); - Timer *t = new Timer(lmp); + auto t = new Timer(lmp); thr[tid] = new ThrData(tid,t); } } @@ -182,7 +182,7 @@ void FixOMP::init() #endif { const int tid = get_tid(); - Timer *t = new Timer(lmp); + auto t = new Timer(lmp); thr[tid] = new ThrData(tid,t); } } @@ -198,10 +198,8 @@ void FixOMP::init() && !utils::strmatch(update->integrate_style,"^respa/omp")) error->all(FLERR,"Must use respa/omp for r-RESPA with /omp styles"); - if (force->pair && force->pair->compute_flag) _pair_compute_flag = true; - else _pair_compute_flag = false; - if (force->kspace && force->kspace->compute_flag) _kspace_compute_flag = true; - else _kspace_compute_flag = false; + _pair_compute_flag = force->pair && force->pair->compute_flag; + _kspace_compute_flag = force->kspace && force->kspace->compute_flag; int check_hybrid, kspace_split; last_pair_hybrid = nullptr; diff --git a/src/OPENMP/fix_qeq_comb_omp.cpp b/src/OPENMP/fix_qeq_comb_omp.cpp index 82d0b0665a..84ca49b7e7 100644 --- a/src/OPENMP/fix_qeq_comb_omp.cpp +++ b/src/OPENMP/fix_qeq_comb_omp.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -36,45 +35,41 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixQEQCombOMP::FixQEQCombOMP(LAMMPS *lmp, int narg, char **arg) : - FixQEQComb(lmp, narg, arg) +FixQEQCombOMP::FixQEQCombOMP(LAMMPS *lmp, int narg, char **arg) : FixQEQComb(lmp, narg, arg) { - if (narg < 5) error->all(FLERR,"Illegal fix qeq/comb/omp command"); + if (narg < 5) error->all(FLERR, "Illegal fix qeq/comb/omp command"); } /* ---------------------------------------------------------------------- */ void FixQEQCombOMP::init() { - if (!atom->q_flag) - error->all(FLERR,"Fix qeq/comb/omp requires atom attribute q"); + if (!atom->q_flag) error->all(FLERR, "Fix qeq/comb/omp requires atom attribute q"); - if (nullptr != force->pair_match("comb3",0)) - error->all(FLERR,"No support for comb3 currently available in OPENMP"); + if (nullptr != force->pair_match("comb3", 0)) + error->all(FLERR, "No support for comb3 currently available in OPENMP"); - comb = (PairComb *) force->pair_match("comb/omp",1); + comb = dynamic_cast( force->pair_match("comb/omp", 1)); + if (comb == nullptr) comb = dynamic_cast( force->pair_match("comb", 1)); if (comb == nullptr) - comb = (PairComb *) force->pair_match("comb",1); - if (comb == nullptr) - error->all(FLERR,"Must use pair_style comb or " - "comb/omp with fix qeq/comb/omp"); + error->all(FLERR, "Must use pair_style comb or comb/omp with fix qeq/comb/omp"); - if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; - if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); + if (utils::strmatch(update->integrate_style, "^respa")) { + ilevel_respa = (dynamic_cast( update->integrate))->nlevels - 1; + if (respa_level >= 0) ilevel_respa = MIN(respa_level, ilevel_respa); } ngroup = group->count(igroup); - if (ngroup == 0) error->all(FLERR,"Fix qeq/comb group has no atoms"); + if (ngroup == 0) error->all(FLERR, "Fix qeq/comb group has no atoms"); } /* ---------------------------------------------------------------------- */ void FixQEQCombOMP::post_force(int /* vflag */) { - int i,ii,iloop,loopmax,inum,*ilist; - double heatpq,qmass,dtq,dtq2; - double enegchkall,enegmaxall; + int i, ii, iloop, loopmax, inum, *ilist; + double heatpq, qmass, dtq, dtq2; + double enegchkall, enegmaxall; if (update->ntimestep % nevery) return; @@ -88,28 +83,28 @@ void FixQEQCombOMP::post_force(int /* vflag */) memory->destroy(q1); memory->destroy(q2); nmax = atom->nmax; - memory->create(qf,nmax,"qeq:qf"); - memory->create(q1,nmax,"qeq:q1"); - memory->create(q2,nmax,"qeq:q2"); + memory->create(qf, nmax, "qeq:qf"); + memory->create(q1, nmax, "qeq:q1"); + memory->create(q2, nmax, "qeq:q2"); vector_atom = qf; } // more loops for first-time charge equilibrium iloop = 0; - if (firstflag) loopmax = 500; - else loopmax = 200; + if (firstflag) + loopmax = 500; + else + loopmax = 200; // charge-equilibration loop - if (me == 0 && fp) - fprintf(fp,"Charge equilibration on step " BIGINT_FORMAT "\n", - update->ntimestep); + if (me == 0 && fp) fmt::print(fp, "Charge equilibration on step {}\n", update->ntimestep); heatpq = 0.05; - qmass = 0.016; - dtq = 0.01; - dtq2 = 0.5*dtq*dtq/qmass; + qmass = 0.016; + dtq = 0.01; + dtq2 = 0.5 * dtq * dtq / qmass; double enegchk = 0.0; double enegtot = 0.0; @@ -126,54 +121,51 @@ void FixQEQCombOMP::post_force(int /* vflag */) q1[i] = q2[i] = qf[i] = 0.0; } - for (iloop = 0; iloop < loopmax; iloop ++) { + for (iloop = 0; iloop < loopmax; iloop++) { for (ii = 0; ii < inum; ii++) { i = ilist[ii]; if (mask[i] & groupbit) { - q1[i] += qf[i]*dtq2 - heatpq*q1[i]; - q[i] += q1[i]; + q1[i] += qf[i] * dtq2 - heatpq * q1[i]; + q[i] += q1[i]; } } comm->forward_comm(this); - if (comb) enegtot = comb->yasu_char(qf,igroup); + if (comb) enegtot = comb->yasu_char(qf, igroup); enegtot /= ngroup; enegchk = enegmax = 0.0; - for (ii = 0; ii < inum ; ii++) { + for (ii = 0; ii < inum; ii++) { i = ilist[ii]; if (mask[i] & groupbit) { - q2[i] = enegtot-qf[i]; - enegmax = MAX(enegmax,fabs(q2[i])); + q2[i] = enegtot - qf[i]; + enegmax = MAX(enegmax, fabs(q2[i])); enegchk += fabs(q2[i]); qf[i] = q2[i]; } } - MPI_Allreduce(&enegchk,&enegchkall,1,MPI_DOUBLE,MPI_SUM,world); - enegchk = enegchkall/ngroup; - MPI_Allreduce(&enegmax,&enegmaxall,1,MPI_DOUBLE,MPI_MAX,world); + MPI_Allreduce(&enegchk, &enegchkall, 1, MPI_DOUBLE, MPI_SUM, world); + enegchk = enegchkall / ngroup; + MPI_Allreduce(&enegmax, &enegmaxall, 1, MPI_DOUBLE, MPI_MAX, world); enegmax = enegmaxall; - if (enegchk <= precision && enegmax <= 100.0*precision) break; + if (enegchk <= precision && enegmax <= 100.0 * precision) break; if (me == 0 && fp) - fprintf(fp," iteration: %d, enegtot %.6g, " - "enegmax %.6g, fq deviation: %.6g\n", - iloop,enegtot,enegmax,enegchk); + fprintf(fp, " iteration: %d, enegtot %.6g, enegmax %.6g, fq deviation: %.6g\n", iloop, + enegtot, enegmax, enegchk); for (ii = 0; ii < inum; ii++) { i = ilist[ii]; - if (mask[i] & groupbit) - q1[i] += qf[i]*dtq2 - heatpq*q1[i]; + if (mask[i] & groupbit) q1[i] += qf[i] * dtq2 - heatpq * q1[i]; } } if (me == 0 && fp) { if (iloop == loopmax) - fprintf(fp,"Charges did not converge in %d iterations\n",iloop); + fprintf(fp, "Charges did not converge in %d iterations\n", iloop); else - fprintf(fp,"Charges converged in %d iterations to %.10f tolerance\n", - iloop,enegchk); + fprintf(fp, "Charges converged in %d iterations to %.10f tolerance\n", iloop, enegchk); } } diff --git a/src/OPENMP/fix_qeq_reaxff_omp.cpp b/src/OPENMP/fix_qeq_reaxff_omp.cpp index 2bcf639eae..27a4ed037b 100644 --- a/src/OPENMP/fix_qeq_reaxff_omp.cpp +++ b/src/OPENMP/fix_qeq_reaxff_omp.cpp @@ -118,7 +118,7 @@ void FixQEqReaxFFOMP::init() memory->create(aspc_b, aspc_order_max+2, "qeq/reaxff/aspc_b"); // Calculate damping factor - double o = double(aspc_order); + auto o = double(aspc_order); aspc_omega = (o+2.0) / (2*o+3.0); // Calculate B coefficients @@ -237,7 +237,7 @@ void FixQEqReaxFFOMP::init_storage() #if defined(_OPENMP) #pragma omp parallel for schedule(static) #endif - for (int i = 0; i < NN; i++) { + for (int i = 0; i < nn; i++) { Hdia_inv[i] = 1. / eta[atom->type[i]]; b_s[i] = -chi[atom->type[i]]; if (efield) b_s[i] -= chi_field[i]; @@ -254,17 +254,13 @@ void FixQEqReaxFFOMP::pre_force(int /* vflag */) { if (update->ntimestep % nevery) return; - int n = atom->nlocal; - if (reaxff) { nn = reaxff->list->inum; - NN = reaxff->list->inum + reaxff->list->gnum; ilist = reaxff->list->ilist; numneigh = reaxff->list->numneigh; firstneigh = reaxff->list->firstneigh; } else { nn = list->inum; - NN = list->inum + list->gnum; ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; @@ -274,7 +270,7 @@ void FixQEqReaxFFOMP::pre_force(int /* vflag */) // need to be atom->nmax in length if (atom->nmax > nmax) reallocate_storage(); - if (n > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE) + if (atom->nlocal > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE) reallocate_matrix(); if (efield) get_chi_field(); @@ -487,6 +483,9 @@ void FixQEqReaxFFOMP::sparse_matvec(sparse_matrix *A, double *x, double *b) { int i, j, itr_j; int ii; + int nlocal = atom->nlocal; + int nall = atom->nlocal + atom->nghost; + int nthreads = comm->nthreads; #if defined(_OPENMP) int tid = omp_get_thread_num(); @@ -505,15 +504,14 @@ void FixQEqReaxFFOMP::sparse_matvec(sparse_matrix *A, double *x, double *b) #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif - for (ii = nn; ii < NN; ++ii) { - i = ilist[ii]; + for (i = nlocal; i < nall; ++i) { if (atom->mask[i] & groupbit) b[i] = 0; } #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif - for (i = 0; i < NN; ++i) + for (i = 0; i < nall; ++i) for (int t=0; tnlocal; + int nall = atom->nlocal + atom->nghost; int nthreads = comm->nthreads; #if defined(_OPENMP) @@ -838,8 +838,7 @@ void FixQEqReaxFFOMP::dual_sparse_matvec(sparse_matrix *A, double *x1, double *x #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif - for (ii = nn; ii < NN; ++ii) { - i = ilist[ii]; + for (i = nlocal; i < nall; ++i) { if (atom->mask[i] & groupbit) { indxI = 2 * i; b[indxI] = 0; @@ -850,7 +849,7 @@ void FixQEqReaxFFOMP::dual_sparse_matvec(sparse_matrix *A, double *x1, double *x #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif - for (i = 0; i < NN; ++i) { + for (i = 0; i < nall; ++i) { indxI = 2 * i; for (int t=0; tnlocal; + int nall = atom->nlocal + atom->nghost; int nthreads = comm->nthreads; #if defined(_OPENMP) @@ -929,8 +930,7 @@ void FixQEqReaxFFOMP::dual_sparse_matvec(sparse_matrix *A, double *x, double *b) #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif - for (ii = nn; ii < NN; ++ii) { - i = ilist[ii]; + for (i = nlocal; i < nall; ++i) { if (atom->mask[i] & groupbit) { indxI = 2 * i; b[indxI] = 0; @@ -941,7 +941,7 @@ void FixQEqReaxFFOMP::dual_sparse_matvec(sparse_matrix *A, double *x, double *b) #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif - for (i = 0; i < NN; ++i) { + for (i = 0; i < nall; ++i) { indxI = 2 * i; for (int t=0; tx; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; const double * const * const torque_one = atom->torque; const int nlocal = atom->nlocal; @@ -606,9 +606,9 @@ void FixRigidNHOMP::remap() template void FixRigidNHOMP::set_xv_thr() { - dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; const double * _noalias const rmass = atom->rmass; const double * _noalias const mass = atom->mass; const int * _noalias const type = atom->type; @@ -633,9 +633,9 @@ void FixRigidNHOMP::set_xv_thr() const int ibody = body[i]; if (ibody < 0) continue; - const dbl3_t &xcmi = * ((dbl3_t *) xcm[ibody]); - const dbl3_t &vcmi = * ((dbl3_t *) vcm[ibody]); - const dbl3_t &omegai = * ((dbl3_t *) omega[ibody]); + const auto &xcmi = * ((dbl3_t *) xcm[ibody]); + const auto &vcmi = * ((dbl3_t *) vcm[ibody]); + const auto &omegai = * ((dbl3_t *) omega[ibody]); const int xbox = (xcmimage[i] & IMGMASK) - IMGMAX; const int ybox = (xcmimage[i] >> IMGBITS & IMGMASK) - IMGMAX; @@ -806,9 +806,9 @@ void FixRigidNHOMP::set_xv_thr() template void FixRigidNHOMP::set_v_thr() { - dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; const double * _noalias const rmass = atom->rmass; const double * _noalias const mass = atom->mass; const int * _noalias const type = atom->type; @@ -833,8 +833,8 @@ void FixRigidNHOMP::set_v_thr() const int ibody = body[i]; if (ibody < 0) continue; - const dbl3_t &vcmi = * ((dbl3_t *) vcm[ibody]); - const dbl3_t &omegai = * ((dbl3_t *) omega[ibody]); + const auto &vcmi = * ((dbl3_t *) vcm[ibody]); + const auto &omegai = * ((dbl3_t *) omega[ibody]); double delta[3],vx,vy,vz; MathExtra::matvec(ex_space[ibody],ey_space[ibody], diff --git a/src/OPENMP/fix_rigid_omp.cpp b/src/OPENMP/fix_rigid_omp.cpp index 97a2b50827..b5d73fe18a 100644 --- a/src/OPENMP/fix_rigid_omp.cpp +++ b/src/OPENMP/fix_rigid_omp.cpp @@ -109,7 +109,7 @@ void FixRigidOMP::initial_integrate(int vflag) void FixRigidOMP::compute_forces_and_torques() { double * const * _noalias const x = atom->x; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; const double * const * const torque_one = atom->torque; const int nlocal = atom->nlocal; @@ -326,9 +326,9 @@ void FixRigidOMP::final_integrate() template void FixRigidOMP::set_xv_thr() { - dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; const double * _noalias const rmass = atom->rmass; const double * _noalias const mass = atom->mass; const int * _noalias const type = atom->type; @@ -353,9 +353,9 @@ void FixRigidOMP::set_xv_thr() const int ibody = body[i]; if (ibody < 0) continue; - const dbl3_t &xcmi = * ((dbl3_t *) xcm[ibody]); - const dbl3_t &vcmi = * ((dbl3_t *) vcm[ibody]); - const dbl3_t &omegai = * ((dbl3_t *) omega[ibody]); + const auto &xcmi = * ((dbl3_t *) xcm[ibody]); + const auto &vcmi = * ((dbl3_t *) vcm[ibody]); + const auto &omegai = * ((dbl3_t *) omega[ibody]); const int xbox = (xcmimage[i] & IMGMASK) - IMGMAX; const int ybox = (xcmimage[i] >> IMGBITS & IMGMASK) - IMGMAX; @@ -526,9 +526,9 @@ void FixRigidOMP::set_xv_thr() template void FixRigidOMP::set_v_thr() { - dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; const double * _noalias const rmass = atom->rmass; const double * _noalias const mass = atom->mass; const int * _noalias const type = atom->type; @@ -553,8 +553,8 @@ void FixRigidOMP::set_v_thr() const int ibody = body[i]; if (ibody < 0) continue; - const dbl3_t &vcmi = * ((dbl3_t *) vcm[ibody]); - const dbl3_t &omegai = * ((dbl3_t *) omega[ibody]); + const auto &vcmi = * ((dbl3_t *) vcm[ibody]); + const auto &omegai = * ((dbl3_t *) omega[ibody]); double delta[3],vx,vy,vz; MathExtra::matvec(ex_space[ibody],ey_space[ibody], diff --git a/src/OPENMP/fix_rigid_small_omp.cpp b/src/OPENMP/fix_rigid_small_omp.cpp index 896bfdff38..62235b84a7 100644 --- a/src/OPENMP/fix_rigid_small_omp.cpp +++ b/src/OPENMP/fix_rigid_small_omp.cpp @@ -111,7 +111,7 @@ void FixRigidSmallOMP::initial_integrate(int vflag) void FixRigidSmallOMP::compute_forces_and_torques() { double * const * _noalias const x = atom->x; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; const double * const * const torque_one = atom->torque; const int nlocal = atom->nlocal; const int nthreads=comm->nthreads; @@ -273,9 +273,9 @@ void FixRigidSmallOMP::final_integrate() template void FixRigidSmallOMP::set_xv_thr() { - dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; const double * _noalias const rmass = atom->rmass; const double * _noalias const mass = atom->mass; const int * _noalias const type = atom->type; @@ -468,9 +468,9 @@ void FixRigidSmallOMP::set_xv_thr() template void FixRigidSmallOMP::set_v_thr() { - dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - const dbl3_t * _noalias const f = (dbl3_t *) atom->f[0]; + auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const v = (dbl3_t *) atom->v[0]; + const auto * _noalias const f = (dbl3_t *) atom->f[0]; const double * _noalias const rmass = atom->rmass; const double * _noalias const mass = atom->mass; const int * _noalias const type = atom->type; diff --git a/src/OPENMP/improper_class2_omp.cpp b/src/OPENMP/improper_class2_omp.cpp index ad53ecd735..9474b696f5 100644 --- a/src/OPENMP/improper_class2_omp.cpp +++ b/src/OPENMP/improper_class2_omp.cpp @@ -106,8 +106,8 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr) eimproper = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const improperlist = (int5_t *) neighbor->improperlist[0]; const int nlocal = atom->nlocal; @@ -506,8 +506,8 @@ void ImproperClass2OMP::angleangle_thr(int nfrom, int nto, ThrData * const thr) eimproper = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const improperlist = (int5_t *) neighbor->improperlist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/improper_cossq_omp.cpp b/src/OPENMP/improper_cossq_omp.cpp index 24d7919995..acb6cd0d46 100644 --- a/src/OPENMP/improper_cossq_omp.cpp +++ b/src/OPENMP/improper_cossq_omp.cpp @@ -91,8 +91,8 @@ void ImproperCossqOMP::eval(int nfrom, int nto, ThrData * const thr) eimproper = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const improperlist = (int5_t *) neighbor->improperlist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/improper_cvff_omp.cpp b/src/OPENMP/improper_cvff_omp.cpp index 3cceb856a9..47b9b930e1 100644 --- a/src/OPENMP/improper_cvff_omp.cpp +++ b/src/OPENMP/improper_cvff_omp.cpp @@ -93,8 +93,8 @@ void ImproperCvffOMP::eval(int nfrom, int nto, ThrData * const thr) eimproper = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const improperlist = (int5_t *) neighbor->improperlist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/improper_harmonic_omp.cpp b/src/OPENMP/improper_harmonic_omp.cpp index 97d8ad174d..9d341febff 100644 --- a/src/OPENMP/improper_harmonic_omp.cpp +++ b/src/OPENMP/improper_harmonic_omp.cpp @@ -92,8 +92,8 @@ void ImproperHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr) eimproper = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const improperlist = (int5_t *) neighbor->improperlist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/improper_umbrella_omp.cpp b/src/OPENMP/improper_umbrella_omp.cpp index 91c9237826..a07ac6a73f 100644 --- a/src/OPENMP/improper_umbrella_omp.cpp +++ b/src/OPENMP/improper_umbrella_omp.cpp @@ -91,8 +91,8 @@ void ImproperUmbrellaOMP::eval(int nfrom, int nto, ThrData * const thr) eimproper = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int5_t * _noalias const improperlist = (int5_t *) neighbor->improperlist[0]; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/npair_half_size_bin_newtoff_omp.cpp b/src/OPENMP/npair_half_size_bin_newtoff_omp.cpp index 445c2ff286..07082868f6 100644 --- a/src/OPENMP/npair_half_size_bin_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_size_bin_newtoff_omp.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_bin_newtoff_omp.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neigh_list.h" #include "npair_omp.h" @@ -40,8 +43,10 @@ NPairHalfSizeBinNewtoffOmp::NPairHalfSizeBinNewtoffOmp(LAMMPS *lmp) : void NPairHalfSizeBinNewtoffOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; + const int molecular = atom->molecular; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; const int history = list->history; - const int mask_history = 3 << SBBITS; + const int mask_history = 1 << HISTBITS; NPAIR_OMP_INIT; @@ -50,7 +55,8 @@ void NPairHalfSizeBinNewtoffOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,k,n,ibin; + int i,j,jh,k,n,ibin,which,imol,iatom; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutsq; int *neighptr; @@ -61,7 +67,14 @@ void NPairHalfSizeBinNewtoffOmp::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; int *ilist = list->ilist; int *numneigh = list->numneigh; @@ -81,6 +94,11 @@ void NPairHalfSizeBinNewtoffOmp::build(NeighList *list) ztmp = x[i][2]; radi = radius[i]; ibin = atom2bin[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over all atoms in surrounding bins in stencil including self // only store pair if i < j @@ -100,10 +118,23 @@ void NPairHalfSizeBinNewtoffOmp::build(NeighList *list) cutsq = (radsum+skin) * (radsum+skin); if (rsq <= cutsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } } diff --git a/src/OPENMP/npair_half_size_bin_newton_omp.cpp b/src/OPENMP/npair_half_size_bin_newton_omp.cpp index be110f07e0..42a74f13aa 100644 --- a/src/OPENMP/npair_half_size_bin_newton_omp.cpp +++ b/src/OPENMP/npair_half_size_bin_newton_omp.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_bin_newton_omp.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neigh_list.h" #include "npair_omp.h" @@ -39,8 +42,10 @@ NPairHalfSizeBinNewtonOmp::NPairHalfSizeBinNewtonOmp(LAMMPS *lmp) : void NPairHalfSizeBinNewtonOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; + const int molecular = atom->molecular; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; const int history = list->history; - const int mask_history = 3 << SBBITS; + const int mask_history = 1 << HISTBITS; NPAIR_OMP_INIT; @@ -49,7 +54,8 @@ void NPairHalfSizeBinNewtonOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,k,n,ibin; + int i,j,jh,k,n,ibin,which,imol,iatom; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutsq; int *neighptr; @@ -58,7 +64,14 @@ void NPairHalfSizeBinNewtonOmp::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; int *ilist = list->ilist; int *numneigh = list->numneigh; @@ -77,6 +90,11 @@ void NPairHalfSizeBinNewtonOmp::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over rest of atoms in i's bin, ghosts are at end of linked list // if j is owned atom, store it, since j is beyond i in linked list @@ -101,10 +119,23 @@ void NPairHalfSizeBinNewtonOmp::build(NeighList *list) cutsq = (radsum+skin) * (radsum+skin); if (rsq <= cutsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } @@ -123,10 +154,23 @@ void NPairHalfSizeBinNewtonOmp::build(NeighList *list) cutsq = (radsum+skin) * (radsum+skin); if (rsq <= cutsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } } diff --git a/src/OPENMP/npair_half_size_bin_newton_tri_omp.cpp b/src/OPENMP/npair_half_size_bin_newton_tri_omp.cpp index bc3bda1181..5a77de0796 100644 --- a/src/OPENMP/npair_half_size_bin_newton_tri_omp.cpp +++ b/src/OPENMP/npair_half_size_bin_newton_tri_omp.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_bin_newton_tri_omp.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neigh_list.h" #include "npair_omp.h" @@ -39,8 +42,10 @@ NPairHalfSizeBinNewtonTriOmp::NPairHalfSizeBinNewtonTriOmp(LAMMPS *lmp) : void NPairHalfSizeBinNewtonTriOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; + const int molecular = atom->molecular; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; const int history = list->history; - const int mask_history = 3 << SBBITS; + const int mask_history = 1 << HISTBITS; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -48,7 +53,8 @@ void NPairHalfSizeBinNewtonTriOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,k,n,ibin; + int i,j,jh,k,n,ibin,which,imol,iatom; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutsq; int *neighptr; @@ -59,7 +65,14 @@ void NPairHalfSizeBinNewtonTriOmp::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; int *ilist = list->ilist; int *numneigh = list->numneigh; @@ -78,6 +91,11 @@ void NPairHalfSizeBinNewtonTriOmp::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over all atoms in bins in stencil // pairs for atoms j "below" i are excluded @@ -107,10 +125,23 @@ void NPairHalfSizeBinNewtonTriOmp::build(NeighList *list) cutsq = (radsum+skin) * (radsum+skin); if (rsq <= cutsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } } diff --git a/src/OPENMP/npair_half_size_multi_newtoff_omp.cpp b/src/OPENMP/npair_half_size_multi_newtoff_omp.cpp index da2d7a7590..d58d250209 100644 --- a/src/OPENMP/npair_half_size_multi_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_size_multi_newtoff_omp.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_multi_newtoff_omp.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neighbor.h" #include "neigh_list.h" @@ -41,8 +44,10 @@ NPairHalfSizeMultiNewtoffOmp::NPairHalfSizeMultiNewtoffOmp(LAMMPS *lmp) : NPair( void NPairHalfSizeMultiNewtoffOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; + const int molecular = atom->molecular; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; const int history = list->history; - const int mask_history = 3 << SBBITS; + const int mask_history = 1 << HISTBITS; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -50,7 +55,9 @@ void NPairHalfSizeMultiNewtoffOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,k,n,itype,jtype,icollection,jcollection,ibin,jbin,ns; + int i,j,jh,k,n,itype,jtype,icollection,jcollection,ibin,jbin,ns; + int which,imol,iatom; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutdistsq; int *neighptr,*s; @@ -63,7 +70,14 @@ void NPairHalfSizeMultiNewtoffOmp::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; int *ilist = list->ilist; int *numneigh = list->numneigh; @@ -84,6 +98,11 @@ void NPairHalfSizeMultiNewtoffOmp::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } ibin = atom2bin[i]; @@ -104,27 +123,40 @@ void NPairHalfSizeMultiNewtoffOmp::build(NeighList *list) ns = nstencil_multi[icollection][jcollection]; for (k = 0; k < ns; k++) { - js = binhead_multi[jcollection][jbin + s[k]]; - for (j = js; j >=0; j = bins[j]) { - if (j <= i) continue; + js = binhead_multi[jcollection][jbin + s[k]]; + for (j = js; j >=0; j = bins[j]) { + if (j <= i) continue; jtype = type[j]; - if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; + if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; - delx = xtmp - x[j][0]; - dely = ytmp - x[j][1]; - delz = ztmp - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; - radsum = radi + radius[j]; - cutdistsq = (radsum+skin) * (radsum+skin); + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + radsum = radi + radius[j]; + cutdistsq = (radsum+skin) * (radsum+skin); - if (rsq <= cutdistsq) { - if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; - } - } + if (rsq <= cutdistsq) { + jh = j; + if (history && rsq < radsum*radsum) + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; + } + } } } diff --git a/src/OPENMP/npair_half_size_multi_newton_omp.cpp b/src/OPENMP/npair_half_size_multi_newton_omp.cpp index bcf87d385c..3190131442 100644 --- a/src/OPENMP/npair_half_size_multi_newton_omp.cpp +++ b/src/OPENMP/npair_half_size_multi_newton_omp.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_multi_newton_omp.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neighbor.h" #include "neigh_list.h" @@ -40,8 +43,10 @@ NPairHalfSizeMultiNewtonOmp::NPairHalfSizeMultiNewtonOmp(LAMMPS *lmp) : NPair(lm void NPairHalfSizeMultiNewtonOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; + const int molecular = atom->molecular; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; const int history = list->history; - const int mask_history = 3 << SBBITS; + const int mask_history = 1 << HISTBITS; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -49,7 +54,9 @@ void NPairHalfSizeMultiNewtonOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,k,n,itype,jtype,icollection,jcollection,ibin,jbin,ns; + int i,j,jh,k,n,itype,jtype,icollection,jcollection,ibin,jbin,ns; + int which,imol,iatom; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutdistsq; int *neighptr,*s; @@ -62,7 +69,14 @@ void NPairHalfSizeMultiNewtonOmp::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; int *ilist = list->ilist; int *numneigh = list->numneigh; @@ -83,6 +97,11 @@ void NPairHalfSizeMultiNewtonOmp::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } ibin = atom2bin[i]; @@ -107,7 +126,7 @@ void NPairHalfSizeMultiNewtonOmp::build(NeighList *list) // if j is owned atom, store it if j > i // if j is ghost, only store if j coords are "above and to the right" of i - for (j = js; j >= 0; j = bins[j]) { + for (j = js; j >= 0; j = bins[j]) { if(icollection != jcollection && j < i) continue; if (j >= nlocal) { @@ -121,19 +140,32 @@ void NPairHalfSizeMultiNewtonOmp::build(NeighList *list) jtype = type[j]; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; - delx = xtmp - x[j][0]; - dely = ytmp - x[j][1]; - delz = ztmp - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; - radsum = radi + radius[j]; - cutdistsq = (radsum+skin) * (radsum+skin); + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + radsum = radi + radius[j]; + cutdistsq = (radsum+skin) * (radsum+skin); - if (rsq <= cutdistsq) { - if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; - } + if (rsq <= cutdistsq) { + jh = j; + if (history && rsq < radsum*radsum) + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; + } } } @@ -142,31 +174,43 @@ void NPairHalfSizeMultiNewtonOmp::build(NeighList *list) // stencil is half if i same size as j // stencil is full if i smaller than j - s = stencil_multi[icollection][jcollection]; - ns = nstencil_multi[icollection][jcollection]; + s = stencil_multi[icollection][jcollection]; + ns = nstencil_multi[icollection][jcollection]; - for (k = 0; k < ns; k++) { - js = binhead_multi[jcollection][jbin + s[k]]; - for (j = js; j >= 0; j = bins[j]) { + for (k = 0; k < ns; k++) { + js = binhead_multi[jcollection][jbin + s[k]]; + for (j = js; j >= 0; j = bins[j]) { jtype = type[j]; - if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; + if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; delx = xtmp - x[j][0]; - dely = ytmp - x[j][1]; - delz = ztmp - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; - radsum = radi + radius[j]; - cutdistsq = (radsum+skin) * (radsum+skin); + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + radsum = radi + radius[j]; + cutdistsq = (radsum+skin) * (radsum+skin); - if (rsq <= cutdistsq) { - if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; - } - } + if (rsq <= cutdistsq) { + if (history && rsq < radsum*radsum) + j = j ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = j; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = j; + else if (which > 0) neighptr[n++] = j ^ (which << SBBITS); + } else neighptr[n++] = j; } + } + } } ilist[i] = i; diff --git a/src/OPENMP/npair_half_size_multi_newton_tri_omp.cpp b/src/OPENMP/npair_half_size_multi_newton_tri_omp.cpp index d38e52fe18..717e023f4a 100644 --- a/src/OPENMP/npair_half_size_multi_newton_tri_omp.cpp +++ b/src/OPENMP/npair_half_size_multi_newton_tri_omp.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_multi_newton_tri_omp.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neighbor.h" #include "neigh_list.h" @@ -41,8 +44,10 @@ NPairHalfSizeMultiNewtonTriOmp::NPairHalfSizeMultiNewtonTriOmp(LAMMPS *lmp) : void NPairHalfSizeMultiNewtonTriOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; + const int molecular = atom->molecular; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; const int history = list->history; - const int mask_history = 3 << SBBITS; + const int mask_history = 1 << HISTBITS; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -50,7 +55,9 @@ void NPairHalfSizeMultiNewtonTriOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,k,n,itype,jtype,icollection,jcollection,ibin,jbin,ns; + int i,j,jh,k,n,itype,jtype,icollection,jcollection,ibin,jbin,ns; + int which,imol,iatom; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutdistsq; int *neighptr,*s; @@ -63,7 +70,14 @@ void NPairHalfSizeMultiNewtonTriOmp::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; int *ilist = list->ilist; int *numneigh = list->numneigh; @@ -84,6 +98,11 @@ void NPairHalfSizeMultiNewtonTriOmp::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } ibin = atom2bin[i]; @@ -104,12 +123,12 @@ void NPairHalfSizeMultiNewtonTriOmp::build(NeighList *list) // (equal zyx and j <= i) // latter excludes self-self interaction but allows superposed atoms - s = stencil_multi[icollection][jcollection]; - ns = nstencil_multi[icollection][jcollection]; + s = stencil_multi[icollection][jcollection]; + ns = nstencil_multi[icollection][jcollection]; - for (k = 0; k < ns; k++) { - js = binhead_multi[jcollection][jbin + s[k]]; - for (j = js; j >= 0; j = bins[j]) { + for (k = 0; k < ns; k++) { + js = binhead_multi[jcollection][jbin + s[k]]; + for (j = js; j >= 0; j = bins[j]) { // if same size (same collection), use half stencil if(cutcollectionsq[icollection][icollection] == cutcollectionsq[jcollection][jcollection]){ @@ -126,21 +145,34 @@ void NPairHalfSizeMultiNewtonTriOmp::build(NeighList *list) jtype = type[j]; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; - delx = xtmp - x[j][0]; - dely = ytmp - x[j][1]; - delz = ztmp - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; - radsum = radi + radius[j]; - cutdistsq = (radsum+skin) * (radsum+skin); + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + radsum = radi + radius[j]; + cutdistsq = (radsum+skin) * (radsum+skin); - if (rsq <= cutdistsq) { - if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; - } - } + if (rsq <= cutdistsq) { + jh = j; + if (history && rsq < radsum*radsum) + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } + } + } } ilist[i] = i; diff --git a/src/OPENMP/npair_half_size_multi_old_newtoff_omp.cpp b/src/OPENMP/npair_half_size_multi_old_newtoff_omp.cpp index 65fca6ed17..37dbe9cc53 100644 --- a/src/OPENMP/npair_half_size_multi_old_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_size_multi_old_newtoff_omp.cpp @@ -13,8 +13,12 @@ ------------------------------------------------------------------------- */ #include "npair_half_size_multi_old_newtoff_omp.h" + #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neigh_list.h" #include "npair_omp.h" @@ -39,8 +43,10 @@ NPairHalfSizeMultiOldNewtoffOmp::NPairHalfSizeMultiOldNewtoffOmp(LAMMPS *lmp) : void NPairHalfSizeMultiOldNewtoffOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; + const int molecular = atom->molecular; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; const int history = list->history; - const int mask_history = 3 << SBBITS; + const int mask_history = 1 << HISTBITS; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -48,7 +54,8 @@ void NPairHalfSizeMultiOldNewtoffOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,k,n,itype,jtype,ibin,ns; + int i,j,jh,k,n,itype,jtype,ibin,ns,which,imol,iatom; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutdistsq; int *neighptr,*s; @@ -58,7 +65,14 @@ void NPairHalfSizeMultiOldNewtoffOmp::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; int *ilist = list->ilist; int *numneigh = list->numneigh; @@ -78,6 +92,11 @@ void NPairHalfSizeMultiOldNewtoffOmp::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over all atoms in other bins in stencil including self // only store pair if i < j @@ -106,10 +125,23 @@ void NPairHalfSizeMultiOldNewtoffOmp::build(NeighList *list) cutdistsq = (radsum+skin) * (radsum+skin); if (rsq <= cutdistsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } } diff --git a/src/OPENMP/npair_half_size_multi_old_newton_omp.cpp b/src/OPENMP/npair_half_size_multi_old_newton_omp.cpp index 907ce7dca8..789ed33e6b 100644 --- a/src/OPENMP/npair_half_size_multi_old_newton_omp.cpp +++ b/src/OPENMP/npair_half_size_multi_old_newton_omp.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_multi_old_newton_omp.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neigh_list.h" #include "npair_omp.h" @@ -39,8 +42,10 @@ NPairHalfSizeMultiOldNewtonOmp::NPairHalfSizeMultiOldNewtonOmp(LAMMPS *lmp) : void NPairHalfSizeMultiOldNewtonOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; + const int molecular = atom->molecular; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; const int history = list->history; - const int mask_history = 3 << SBBITS; + const int mask_history = 1 << HISTBITS; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -48,7 +53,8 @@ void NPairHalfSizeMultiOldNewtonOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,k,n,itype,jtype,ibin,ns; + int i,j,jh,k,n,itype,jtype,ibin,ns,which,imol,iatom; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutdistsq; int *neighptr,*s; @@ -58,7 +64,14 @@ void NPairHalfSizeMultiOldNewtonOmp::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; int *ilist = list->ilist; int *numneigh = list->numneigh; @@ -78,6 +91,11 @@ void NPairHalfSizeMultiOldNewtonOmp::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over rest of atoms in i's bin, ghosts are at end of linked list // if j is owned atom, store it, since j is beyond i in linked list @@ -102,10 +120,23 @@ void NPairHalfSizeMultiOldNewtonOmp::build(NeighList *list) cutdistsq = (radsum+skin) * (radsum+skin); if (rsq <= cutdistsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } @@ -132,10 +163,23 @@ void NPairHalfSizeMultiOldNewtonOmp::build(NeighList *list) cutdistsq = (radsum+skin) * (radsum+skin); if (rsq <= cutdistsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } } diff --git a/src/OPENMP/npair_half_size_multi_old_newton_tri_omp.cpp b/src/OPENMP/npair_half_size_multi_old_newton_tri_omp.cpp index a2bbf9cae0..8302d9fab2 100644 --- a/src/OPENMP/npair_half_size_multi_old_newton_tri_omp.cpp +++ b/src/OPENMP/npair_half_size_multi_old_newton_tri_omp.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_multi_old_newton_tri_omp.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neigh_list.h" #include "npair_omp.h" @@ -39,8 +42,10 @@ NPairHalfSizeMultiOldNewtonTriOmp::NPairHalfSizeMultiOldNewtonTriOmp(LAMMPS *lmp void NPairHalfSizeMultiOldNewtonTriOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; + const int molecular = atom->molecular; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; const int history = list->history; - const int mask_history = 3 << SBBITS; + const int mask_history = 1 << HISTBITS; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -48,7 +53,8 @@ void NPairHalfSizeMultiOldNewtonTriOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,k,n,itype,jtype,ibin,ns; + int i,j,jh,k,n,itype,jtype,ibin,ns,which,imol,iatom; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutdistsq; int *neighptr,*s; @@ -58,7 +64,14 @@ void NPairHalfSizeMultiOldNewtonTriOmp::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; int *ilist = list->ilist; int *numneigh = list->numneigh; @@ -78,6 +91,11 @@ void NPairHalfSizeMultiOldNewtonTriOmp::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over all atoms in bins, including self, in stencil // skip if i,j neighbor cutoff is less than bin distance @@ -115,10 +133,23 @@ void NPairHalfSizeMultiOldNewtonTriOmp::build(NeighList *list) cutdistsq = (radsum+skin) * (radsum+skin); if (rsq <= cutdistsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } } diff --git a/src/OPENMP/npair_half_size_nsq_newtoff_omp.cpp b/src/OPENMP/npair_half_size_nsq_newtoff_omp.cpp index f182492efe..7f4b22e729 100644 --- a/src/OPENMP/npair_half_size_nsq_newtoff_omp.cpp +++ b/src/OPENMP/npair_half_size_nsq_newtoff_omp.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_nsq_newtoff_omp.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "group.h" #include "my_page.h" #include "neigh_list.h" @@ -42,8 +45,10 @@ void NPairHalfSizeNsqNewtoffOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; + const int molecular = atom->molecular; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; const int history = list->history; - const int mask_history = 3 << SBBITS; + const int mask_history = 1 << HISTBITS; NPAIR_OMP_INIT; @@ -52,7 +57,8 @@ void NPairHalfSizeNsqNewtoffOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,n; + int i,j,jh,n,which,imol,iatom; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutsq; int *neighptr; @@ -61,9 +67,17 @@ void NPairHalfSizeNsqNewtoffOmp::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; + int nall = atom->nlocal + atom->nghost; + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; @@ -81,6 +95,11 @@ void NPairHalfSizeNsqNewtoffOmp::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over remaining atoms, owned and ghost @@ -96,10 +115,23 @@ void NPairHalfSizeNsqNewtoffOmp::build(NeighList *list) cutsq = (radsum+skin) * (radsum+skin); if (rsq <= cutsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } diff --git a/src/OPENMP/npair_half_size_nsq_newton_omp.cpp b/src/OPENMP/npair_half_size_nsq_newton_omp.cpp index fdea8f4468..9262b869af 100644 --- a/src/OPENMP/npair_half_size_nsq_newton_omp.cpp +++ b/src/OPENMP/npair_half_size_nsq_newton_omp.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_nsq_newton_omp.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "group.h" #include "my_page.h" #include "neigh_list.h" @@ -42,9 +45,11 @@ NPairHalfSizeNsqNewtonOmp::NPairHalfSizeNsqNewtonOmp(LAMMPS *lmp) : void NPairHalfSizeNsqNewtonOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; - const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0;; + const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; + const int molecular = atom->molecular; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; const int history = list->history; - const int mask_history = 3 << SBBITS; + const int mask_history = 1 << HISTBITS; NPAIR_OMP_INIT; @@ -53,7 +58,8 @@ void NPairHalfSizeNsqNewtonOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,n,itag,jtag; + int i,j,jh,n,itag,jtag,which,imol,iatom; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutsq; int *neighptr; @@ -64,6 +70,13 @@ void NPairHalfSizeNsqNewtonOmp::build(NeighList *list) int *type = atom->type; int *mask = atom->mask; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; + + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + int nall = atom->nlocal + atom->nghost; int *ilist = list->ilist; @@ -84,6 +97,11 @@ void NPairHalfSizeNsqNewtonOmp::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over remaining atoms, owned and ghost @@ -115,10 +133,23 @@ void NPairHalfSizeNsqNewtonOmp::build(NeighList *list) cutsq = (radsum+skin) * (radsum+skin); if (rsq <= cutsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >=0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } diff --git a/src/OPENMP/pair_adp_omp.cpp b/src/OPENMP/pair_adp_omp.cpp index cf9514e4d6..93a0fa1215 100644 --- a/src/OPENMP/pair_adp_omp.cpp +++ b/src/OPENMP/pair_adp_omp.cpp @@ -112,8 +112,8 @@ void PairADPOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; double * const rho_t = thr->get_rho(); double * const * const mu_t = thr->get_mu(); double * const * const lambda_t = thr->get_lambda(); diff --git a/src/OPENMP/pair_agni_omp.cpp b/src/OPENMP/pair_agni_omp.cpp index 814845108f..4719d7e4a4 100644 --- a/src/OPENMP/pair_agni_omp.cpp +++ b/src/OPENMP/pair_agni_omp.cpp @@ -80,8 +80,8 @@ void PairAGNIOMP::eval(int iifrom, int iito, ThrData * const thr) double rsq; int *ilist,*jlist,*numneigh,**firstneigh; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; ilist = list->ilist; diff --git a/src/OPENMP/pair_beck_omp.cpp b/src/OPENMP/pair_beck_omp.cpp index 5f9a9efa8a..dae9decc0e 100644 --- a/src/OPENMP/pair_beck_omp.cpp +++ b/src/OPENMP/pair_beck_omp.cpp @@ -88,8 +88,8 @@ void PairBeckOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; int *type = atom->type; int nlocal = atom->nlocal; double *special_lj = force->special_lj; diff --git a/src/OPENMP/pair_born_coul_long_omp.cpp b/src/OPENMP/pair_born_coul_long_omp.cpp index 99851bb943..9d52b6cc8c 100644 --- a/src/OPENMP/pair_born_coul_long_omp.cpp +++ b/src/OPENMP/pair_born_coul_long_omp.cpp @@ -95,8 +95,8 @@ void PairBornCoulLongOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_born_coul_msm_omp.cpp b/src/OPENMP/pair_born_coul_msm_omp.cpp index 0fe1456ec7..ec6cb989c3 100644 --- a/src/OPENMP/pair_born_coul_msm_omp.cpp +++ b/src/OPENMP/pair_born_coul_msm_omp.cpp @@ -93,8 +93,8 @@ void PairBornCoulMSMOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_born_coul_wolf_omp.cpp b/src/OPENMP/pair_born_coul_wolf_omp.cpp index 32d7830faf..af6771fd9c 100644 --- a/src/OPENMP/pair_born_coul_wolf_omp.cpp +++ b/src/OPENMP/pair_born_coul_wolf_omp.cpp @@ -90,8 +90,8 @@ void PairBornCoulWolfOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_born_omp.cpp b/src/OPENMP/pair_born_omp.cpp index ea6d64fc33..673136b00b 100644 --- a/src/OPENMP/pair_born_omp.cpp +++ b/src/OPENMP/pair_born_omp.cpp @@ -83,8 +83,8 @@ void PairBornOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; int *type = atom->type; int nlocal = atom->nlocal; double *special_lj = force->special_lj; diff --git a/src/OPENMP/pair_buck_coul_cut_omp.cpp b/src/OPENMP/pair_buck_coul_cut_omp.cpp index 0df45126bf..4f086932db 100644 --- a/src/OPENMP/pair_buck_coul_cut_omp.cpp +++ b/src/OPENMP/pair_buck_coul_cut_omp.cpp @@ -85,8 +85,8 @@ void PairBuckCoulCutOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; int *type = atom->type; int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_buck_coul_long_omp.cpp b/src/OPENMP/pair_buck_coul_long_omp.cpp index 396b4edd3c..0b4f26bf52 100644 --- a/src/OPENMP/pair_buck_coul_long_omp.cpp +++ b/src/OPENMP/pair_buck_coul_long_omp.cpp @@ -97,8 +97,8 @@ void PairBuckCoulLongOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; int *type = atom->type; int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_buck_coul_msm_omp.cpp b/src/OPENMP/pair_buck_coul_msm_omp.cpp index 6442f45eac..e859a0e284 100644 --- a/src/OPENMP/pair_buck_coul_msm_omp.cpp +++ b/src/OPENMP/pair_buck_coul_msm_omp.cpp @@ -94,8 +94,8 @@ void PairBuckCoulMSMOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; int *type = atom->type; int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_buck_omp.cpp b/src/OPENMP/pair_buck_omp.cpp index 88314f912a..285e2fadde 100644 --- a/src/OPENMP/pair_buck_omp.cpp +++ b/src/OPENMP/pair_buck_omp.cpp @@ -83,8 +83,8 @@ void PairBuckOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; int *type = atom->type; int nlocal = atom->nlocal; double *special_lj = force->special_lj; diff --git a/src/OPENMP/pair_colloid_omp.cpp b/src/OPENMP/pair_colloid_omp.cpp index ecd560bb8e..64a7d06322 100644 --- a/src/OPENMP/pair_colloid_omp.cpp +++ b/src/OPENMP/pair_colloid_omp.cpp @@ -88,8 +88,8 @@ void PairColloidOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const int tid = thr->get_tid(); diff --git a/src/OPENMP/pair_coul_cut_omp.cpp b/src/OPENMP/pair_coul_cut_omp.cpp index c1d672e637..884fe532be 100644 --- a/src/OPENMP/pair_coul_cut_omp.cpp +++ b/src/OPENMP/pair_coul_cut_omp.cpp @@ -85,8 +85,8 @@ void PairCoulCutOMP::eval(int iifrom, int iito, ThrData * const thr) ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_coul_cut_soft_omp.cpp b/src/OPENMP/pair_coul_cut_soft_omp.cpp index d5669b200a..6b16d71442 100644 --- a/src/OPENMP/pair_coul_cut_soft_omp.cpp +++ b/src/OPENMP/pair_coul_cut_soft_omp.cpp @@ -86,8 +86,8 @@ void PairCoulCutSoftOMP::eval(int iifrom, int iito, ThrData * const thr) ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_coul_debye_omp.cpp b/src/OPENMP/pair_coul_debye_omp.cpp index 757b7ec66e..622a84da95 100644 --- a/src/OPENMP/pair_coul_debye_omp.cpp +++ b/src/OPENMP/pair_coul_debye_omp.cpp @@ -85,8 +85,8 @@ void PairCoulDebyeOMP::eval(int iifrom, int iito, ThrData * const thr) ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_coul_diel_omp.cpp b/src/OPENMP/pair_coul_diel_omp.cpp index be2f771e67..4de5b69f7e 100644 --- a/src/OPENMP/pair_coul_diel_omp.cpp +++ b/src/OPENMP/pair_coul_diel_omp.cpp @@ -86,8 +86,8 @@ void PairCoulDielOMP::eval(int iifrom, int iito, ThrData * const thr) ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_coul_dsf_omp.cpp b/src/OPENMP/pair_coul_dsf_omp.cpp index 6df673ee80..e36c12172f 100644 --- a/src/OPENMP/pair_coul_dsf_omp.cpp +++ b/src/OPENMP/pair_coul_dsf_omp.cpp @@ -95,8 +95,8 @@ void PairCoulDSFOMP::eval(int iifrom, int iito, ThrData * const thr) ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int nlocal = atom->nlocal; const double * _noalias const special_coul = force->special_coul; diff --git a/src/OPENMP/pair_coul_long_omp.cpp b/src/OPENMP/pair_coul_long_omp.cpp index 9c15243f87..a54dc8c966 100644 --- a/src/OPENMP/pair_coul_long_omp.cpp +++ b/src/OPENMP/pair_coul_long_omp.cpp @@ -97,8 +97,8 @@ void PairCoulLongOMP::eval(int iifrom, int iito, ThrData * const thr) ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_coul_long_soft_omp.cpp b/src/OPENMP/pair_coul_long_soft_omp.cpp index 0c31d8020e..b7d9cfc2fa 100644 --- a/src/OPENMP/pair_coul_long_soft_omp.cpp +++ b/src/OPENMP/pair_coul_long_soft_omp.cpp @@ -96,8 +96,8 @@ void PairCoulLongSoftOMP::eval(int iifrom, int iito, ThrData * const thr) ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_coul_msm_omp.cpp b/src/OPENMP/pair_coul_msm_omp.cpp index 5165797fd6..bf18009117 100644 --- a/src/OPENMP/pair_coul_msm_omp.cpp +++ b/src/OPENMP/pair_coul_msm_omp.cpp @@ -95,8 +95,8 @@ void PairCoulMSMOMP::eval(int iifrom, int iito, ThrData * const thr) ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_coul_wolf_omp.cpp b/src/OPENMP/pair_coul_wolf_omp.cpp index 99d320353d..520fe790b7 100644 --- a/src/OPENMP/pair_coul_wolf_omp.cpp +++ b/src/OPENMP/pair_coul_wolf_omp.cpp @@ -90,8 +90,8 @@ void PairCoulWolfOMP::eval(int iifrom, int iito, ThrData * const thr) ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int nlocal = atom->nlocal; const double * _noalias const special_coul = force->special_coul; diff --git a/src/OPENMP/pair_dpd_omp.cpp b/src/OPENMP/pair_dpd_omp.cpp index db03581762..8d47a6d8b6 100644 --- a/src/OPENMP/pair_dpd_omp.cpp +++ b/src/OPENMP/pair_dpd_omp.cpp @@ -127,9 +127,9 @@ void PairDPDOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const v = (dbl3_t *) atom->v[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double *special_lj = force->special_lj; diff --git a/src/OPENMP/pair_dpd_tstat_omp.cpp b/src/OPENMP/pair_dpd_tstat_omp.cpp index 8a329321a8..7909a1b8c1 100644 --- a/src/OPENMP/pair_dpd_tstat_omp.cpp +++ b/src/OPENMP/pair_dpd_tstat_omp.cpp @@ -125,9 +125,9 @@ void PairDPDTstatOMP::eval(int iifrom, int iito, ThrData * const thr) double rsq,r,rinv,dot,wd,randnum,factor_dpd; int *ilist,*jlist,*numneigh,**firstneigh; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const dbl3_t * _noalias const v = (dbl3_t *) atom->v[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const v = (dbl3_t *) atom->v[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double *special_lj = force->special_lj; diff --git a/src/OPENMP/pair_eam_omp.cpp b/src/OPENMP/pair_eam_omp.cpp index 2653cfba63..b3c963c3df 100644 --- a/src/OPENMP/pair_eam_omp.cpp +++ b/src/OPENMP/pair_eam_omp.cpp @@ -104,8 +104,8 @@ void PairEAMOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; double * const rho_t = thr->get_rho(); const int tid = thr->get_tid(); const int nthreads = comm->nthreads; diff --git a/src/OPENMP/pair_edip_omp.cpp b/src/OPENMP/pair_edip_omp.cpp index da025d75d5..15619c277a 100644 --- a/src/OPENMP/pair_edip_omp.cpp +++ b/src/OPENMP/pair_edip_omp.cpp @@ -151,8 +151,8 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData *const thr) double *pre_thrPow2B_ij = prePow2B_ij + tid * leadDimInteractionList; double *pre_thrForceCoord = preForceCoord + tid * leadDimInteractionList; - const dbl3_t *_noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t *_noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto *_noalias const x = (dbl3_t *) atom->x[0]; + auto *_noalias const f = (dbl3_t *) thr->get_f()[0]; const int *_noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_eim_omp.cpp b/src/OPENMP/pair_eim_omp.cpp index 8c7b69c41b..aa6d2532f5 100644 --- a/src/OPENMP/pair_eim_omp.cpp +++ b/src/OPENMP/pair_eim_omp.cpp @@ -103,8 +103,8 @@ void PairEIMOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; double * const rho_t = thr->get_rho(); double * const fp_t = thr->get_fp(); const int tid = thr->get_tid(); diff --git a/src/OPENMP/pair_gauss_cut_omp.cpp b/src/OPENMP/pair_gauss_cut_omp.cpp index a36cb7c981..2460d66334 100644 --- a/src/OPENMP/pair_gauss_cut_omp.cpp +++ b/src/OPENMP/pair_gauss_cut_omp.cpp @@ -84,8 +84,8 @@ void PairGaussCutOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_gauss_omp.cpp b/src/OPENMP/pair_gauss_omp.cpp index eb8630d12c..3cdbb360e7 100644 --- a/src/OPENMP/pair_gauss_omp.cpp +++ b/src/OPENMP/pair_gauss_omp.cpp @@ -88,8 +88,8 @@ double PairGaussOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; double fxtmp,fytmp,fztmp; diff --git a/src/OPENMP/pair_gayberne_omp.cpp b/src/OPENMP/pair_gayberne_omp.cpp index 2476243305..e756e580a7 100644 --- a/src/OPENMP/pair_gayberne_omp.cpp +++ b/src/OPENMP/pair_gayberne_omp.cpp @@ -84,9 +84,9 @@ void PairGayBerneOMP::eval(int iifrom, int iito, ThrData * const thr) int *ilist,*jlist,*numneigh,**firstneigh; double *iquat,*jquat; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; - dbl3_t * _noalias const tor = (dbl3_t *) thr->get_torque()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; + auto * _noalias const tor = (dbl3_t *) thr->get_torque()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_gran_hertz_history_omp.cpp b/src/OPENMP/pair_gran_hertz_history_omp.cpp index 2ee0921688..66be06020f 100644 --- a/src/OPENMP/pair_gran_hertz_history_omp.cpp +++ b/src/OPENMP/pair_gran_hertz_history_omp.cpp @@ -57,7 +57,7 @@ void PairGranHertzHistoryOMP::compute(int eflag, int vflag) if (fix_rigid && neighbor->ago == 0) { int tmp; int *body = (int *) fix_rigid->extract("body",tmp); - double *mass_body = (double *) fix_rigid->extract("masstotal",tmp); + auto mass_body = (double *) fix_rigid->extract("masstotal",tmp); if (atom->nmax > nmax) { memory->destroy(mass_rigid); nmax = atom->nmax; diff --git a/src/OPENMP/pair_gran_hooke_history_omp.cpp b/src/OPENMP/pair_gran_hooke_history_omp.cpp index 64482fd634..8dad7f463a 100644 --- a/src/OPENMP/pair_gran_hooke_history_omp.cpp +++ b/src/OPENMP/pair_gran_hooke_history_omp.cpp @@ -54,7 +54,7 @@ void PairGranHookeHistoryOMP::compute(int eflag, int vflag) if (fix_rigid && neighbor->ago == 0) { int tmp; int *body = (int *) fix_rigid->extract("body",tmp); - double *mass_body = (double *) fix_rigid->extract("masstotal",tmp); + auto mass_body = (double *) fix_rigid->extract("masstotal",tmp); if (atom->nmax > nmax) { memory->destroy(mass_rigid); nmax = atom->nmax; diff --git a/src/OPENMP/pair_gran_hooke_omp.cpp b/src/OPENMP/pair_gran_hooke_omp.cpp index 85277f0719..bfe91b63da 100644 --- a/src/OPENMP/pair_gran_hooke_omp.cpp +++ b/src/OPENMP/pair_gran_hooke_omp.cpp @@ -53,7 +53,7 @@ void PairGranHookeOMP::compute(int eflag, int vflag) if (fix_rigid && neighbor->ago == 0) { int tmp; int *body = (int *) fix_rigid->extract("body",tmp); - double *mass_body = (double *) fix_rigid->extract("masstotal",tmp); + auto mass_body = (double *) fix_rigid->extract("masstotal",tmp); if (atom->nmax > nmax) { memory->destroy(mass_rigid); nmax = atom->nmax; diff --git a/src/OPENMP/pair_harmonic_cut_omp.cpp b/src/OPENMP/pair_harmonic_cut_omp.cpp index 4412a72bc3..d7540d7c11 100644 --- a/src/OPENMP/pair_harmonic_cut_omp.cpp +++ b/src/OPENMP/pair_harmonic_cut_omp.cpp @@ -79,8 +79,8 @@ void PairHarmonicCutOMP::compute(int eflag, int vflag) template void PairHarmonicCutOMP::eval(int iifrom, int iito, ThrData *const thr) { - const dbl3_t *_noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t *_noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto *_noalias const x = (dbl3_t *) atom->x[0]; + auto *_noalias const f = (dbl3_t *) thr->get_f()[0]; const int *_noalias const type = atom->type; const double *_noalias const special_lj = force->special_lj; const int *_noalias const ilist = list->ilist; diff --git a/src/OPENMP/pair_hbond_dreiding_lj_omp.cpp b/src/OPENMP/pair_hbond_dreiding_lj_omp.cpp index 6d2fc10a3a..66f1a85c39 100644 --- a/src/OPENMP/pair_hbond_dreiding_lj_omp.cpp +++ b/src/OPENMP/pair_hbond_dreiding_lj_omp.cpp @@ -130,8 +130,8 @@ void PairHbondDreidingLJOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const tagint * _noalias const tag = atom->tag; const int * _noalias const molindex = atom->molindex; const int * _noalias const molatom = atom->molatom; diff --git a/src/OPENMP/pair_hbond_dreiding_morse_omp.cpp b/src/OPENMP/pair_hbond_dreiding_morse_omp.cpp index badefcd985..f7cecda03a 100644 --- a/src/OPENMP/pair_hbond_dreiding_morse_omp.cpp +++ b/src/OPENMP/pair_hbond_dreiding_morse_omp.cpp @@ -129,8 +129,8 @@ void PairHbondDreidingMorseOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const tagint * _noalias const tag = atom->tag; const int * _noalias const type = atom->type; const int * _noalias const molindex = atom->molindex; diff --git a/src/OPENMP/pair_lj96_cut_omp.cpp b/src/OPENMP/pair_lj96_cut_omp.cpp index 177edcd00f..7ffa4f6a97 100644 --- a/src/OPENMP/pair_lj96_cut_omp.cpp +++ b/src/OPENMP/pair_lj96_cut_omp.cpp @@ -85,8 +85,8 @@ void PairLJ96CutOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp b/src/OPENMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp index 8f7152b97d..5addcd167a 100644 --- a/src/OPENMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp +++ b/src/OPENMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp @@ -85,8 +85,8 @@ void PairLJCharmmCoulCharmmImplicitOMP::eval(int iifrom, int iito, ThrData * con evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_charmm_coul_charmm_omp.cpp b/src/OPENMP/pair_lj_charmm_coul_charmm_omp.cpp index 0ccb471760..7a14e76ea2 100644 --- a/src/OPENMP/pair_lj_charmm_coul_charmm_omp.cpp +++ b/src/OPENMP/pair_lj_charmm_coul_charmm_omp.cpp @@ -87,8 +87,8 @@ void PairLJCharmmCoulCharmmOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_charmm_coul_long_omp.cpp b/src/OPENMP/pair_lj_charmm_coul_long_omp.cpp index 5fabdf7b1a..64cfb69882 100644 --- a/src/OPENMP/pair_lj_charmm_coul_long_omp.cpp +++ b/src/OPENMP/pair_lj_charmm_coul_long_omp.cpp @@ -81,8 +81,8 @@ template void PairLJCharmmCoulLongOMP::eval(int iifrom, int iito, ThrData * const thr) { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const double * _noalias const special_coul = force->special_coul; diff --git a/src/OPENMP/pair_lj_charmm_coul_long_soft_omp.cpp b/src/OPENMP/pair_lj_charmm_coul_long_soft_omp.cpp index 7f65e405f2..9e127120a9 100644 --- a/src/OPENMP/pair_lj_charmm_coul_long_soft_omp.cpp +++ b/src/OPENMP/pair_lj_charmm_coul_long_soft_omp.cpp @@ -81,8 +81,8 @@ template void PairLJCharmmCoulLongSoftOMP::eval(int iifrom, int iito, ThrData * const thr) { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const double * _noalias const special_coul = force->special_coul; diff --git a/src/OPENMP/pair_lj_charmm_coul_msm_omp.cpp b/src/OPENMP/pair_lj_charmm_coul_msm_omp.cpp index ee46f92e31..6bbb4040e3 100644 --- a/src/OPENMP/pair_lj_charmm_coul_msm_omp.cpp +++ b/src/OPENMP/pair_lj_charmm_coul_msm_omp.cpp @@ -87,8 +87,8 @@ template void PairLJCharmmCoulMSMOMP::eval(int iifrom, int iito, ThrData * const thr) { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const double * _noalias const special_coul = force->special_coul; diff --git a/src/OPENMP/pair_lj_class2_coul_cut_omp.cpp b/src/OPENMP/pair_lj_class2_coul_cut_omp.cpp index 1fc2abf8ba..e9086f27e3 100644 --- a/src/OPENMP/pair_lj_class2_coul_cut_omp.cpp +++ b/src/OPENMP/pair_lj_class2_coul_cut_omp.cpp @@ -87,8 +87,8 @@ void PairLJClass2CoulCutOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_class2_coul_long_omp.cpp b/src/OPENMP/pair_lj_class2_coul_long_omp.cpp index 01115c6cb2..eaa6ac4366 100644 --- a/src/OPENMP/pair_lj_class2_coul_long_omp.cpp +++ b/src/OPENMP/pair_lj_class2_coul_long_omp.cpp @@ -97,8 +97,8 @@ void PairLJClass2CoulLongOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_class2_omp.cpp b/src/OPENMP/pair_lj_class2_omp.cpp index 758cd8fae0..4cc9801357 100644 --- a/src/OPENMP/pair_lj_class2_omp.cpp +++ b/src/OPENMP/pair_lj_class2_omp.cpp @@ -84,8 +84,8 @@ void PairLJClass2OMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_lj_cubic_omp.cpp b/src/OPENMP/pair_lj_cubic_omp.cpp index e6e72096c9..d89e6cb711 100644 --- a/src/OPENMP/pair_lj_cubic_omp.cpp +++ b/src/OPENMP/pair_lj_cubic_omp.cpp @@ -88,8 +88,8 @@ void PairLJCubicOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.cpp b/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.cpp index 6d013c5f7c..a2bc25f4af 100644 --- a/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.cpp @@ -28,14 +28,14 @@ #include "omp_compat.h" using namespace LAMMPS_NS; -using namespace MathConst; +using MathConst::MY_PIS; -#define EPSILON 1e-6 +static constexpr double EPSILON = 1.0e-6; /* ---------------------------------------------------------------------- */ -PairLJCutCoulCutDielectricOMP::PairLJCutCoulCutDielectricOMP(LAMMPS *lmp) : - PairLJCutCoulCutDielectric(lmp), ThrOMP(lmp, THR_PAIR) +PairLJCutCoulCutDielectricOMP::PairLJCutCoulCutDielectricOMP(LAMMPS *_lmp) : + PairLJCutCoulCutDielectric(_lmp), ThrOMP(_lmp, THR_PAIR) { } @@ -106,11 +106,11 @@ void PairLJCutCoulCutDielectricOMP::eval(int iifrom, int iito, ThrData *const th evdwl = ecoul = 0.0; - const dbl3_t *_noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t *_noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto *_noalias const x = (dbl3_t *) atom->x[0]; + auto *_noalias const f = (dbl3_t *) thr->get_f()[0]; const double *_noalias const q = atom->q; const double *_noalias const eps = atom->epsilon; - const dbl3_t *_noalias const norm = (dbl3_t *) atom->mu[0]; + const auto *_noalias const norm = (dbl3_t *) atom->mu[0]; const double *_noalias const curvature = atom->curvature; const double *_noalias const area = atom->area; const int *_noalias const type = atom->type; @@ -169,8 +169,8 @@ void PairLJCutCoulCutDielectricOMP::eval(int iifrom, int iito, ThrData *const th r2inv = 1.0 / rsq; if (rsq < cut_coulsq[itype][jtype] && rsq > EPSILON) { - efield_i = q[j] * sqrt(r2inv); - forcecoul = qqrd2e * qtmp * efield_i; + efield_i = qqrd2e * q[j] * sqrt(r2inv); + forcecoul = qtmp * efield_i; epot_i = efield_i; } else epot_i = efield_i = forcecoul = 0.0; diff --git a/src/OPENMP/pair_lj_cut_coul_cut_omp.cpp b/src/OPENMP/pair_lj_cut_coul_cut_omp.cpp index e86bd88936..0df235b626 100644 --- a/src/OPENMP/pair_lj_cut_coul_cut_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_cut_omp.cpp @@ -86,8 +86,8 @@ void PairLJCutCoulCutOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_cut_coul_cut_soft_omp.cpp b/src/OPENMP/pair_lj_cut_coul_cut_soft_omp.cpp index b44d56d6f3..b1afa96bf5 100644 --- a/src/OPENMP/pair_lj_cut_coul_cut_soft_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_cut_soft_omp.cpp @@ -87,8 +87,8 @@ void PairLJCutCoulCutSoftOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_cut_coul_debye_dielectric_omp.cpp b/src/OPENMP/pair_lj_cut_coul_debye_dielectric_omp.cpp new file mode 100644 index 0000000000..032a2b4c3c --- /dev/null +++ b/src/OPENMP/pair_lj_cut_coul_debye_dielectric_omp.cpp @@ -0,0 +1,231 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/ 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: Trung Nguyen (U Chicago) +------------------------------------------------------------------------- */ + +#include "pair_lj_cut_coul_debye_dielectric_omp.h" + +#include "atom.h" +#include "comm.h" +#include "force.h" +#include "math_const.h" +#include "memory.h" +#include "neigh_list.h" + +#include + +#include "omp_compat.h" +using namespace LAMMPS_NS; +using MathConst::MY_PIS; + +static constexpr double EPSILON = 1.0e-6; + +/* ---------------------------------------------------------------------- */ + +PairLJCutCoulDebyeDielectricOMP::PairLJCutCoulDebyeDielectricOMP(LAMMPS *_lmp) : + PairLJCutCoulDebyeDielectric(_lmp), ThrOMP(_lmp, THR_PAIR) +{ +} + +/* ---------------------------------------------------------------------- */ + +void PairLJCutCoulDebyeDielectricOMP::compute(int eflag, int vflag) +{ + ev_init(eflag, vflag); + + if (atom->nmax > nmax) { + memory->destroy(efield); + memory->destroy(epot); + nmax = atom->nmax; + memory->create(efield, nmax, 3, "pair:efield"); + memory->create(epot, nmax, "pair:epot"); + } + + const int nall = atom->nlocal + atom->nghost; + const int nthreads = comm->nthreads; + const int inum = list->inum; + +#if defined(_OPENMP) +#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(eflag, vflag) +#endif + { + int ifrom, ito, tid; + + loop_setup_thr(ifrom, ito, tid, inum, nthreads); + ThrData *thr = fix->get_thr(tid); + thr->timer(Timer::START); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); + + if (evflag) { + if (eflag) { + if (force->newton_pair) + eval<1, 1, 1>(ifrom, ito, thr); + else + eval<1, 1, 0>(ifrom, ito, thr); + } else { + if (force->newton_pair) + eval<1, 0, 1>(ifrom, ito, thr); + else + eval<1, 0, 0>(ifrom, ito, thr); + } + } else { + if (force->newton_pair) + eval<0, 0, 1>(ifrom, ito, thr); + else + eval<0, 0, 0>(ifrom, ito, thr); + } + + thr->timer(Timer::PAIR); + reduce_thr(this, eflag, vflag, thr); + } // end of omp parallel region +} + +/* ---------------------------------------------------------------------- */ + +template +void PairLJCutCoulDebyeDielectricOMP::eval(int iifrom, int iito, ThrData *const thr) +{ + int i, j, ii, jj, jnum, itype, jtype; + double qtmp, etmp, xtmp, ytmp, ztmp, delx, dely, delz, evdwl, ecoul; + double fpair_i, fpair_j; + double rsq, r2inv, r6inv, forcecoul, forcelj, factor_coul, factor_lj, efield_i, epot_i; + double r, rinv, screening; + int *ilist, *jlist, *numneigh, **firstneigh; + + evdwl = ecoul = 0.0; + + const dbl3_t *_noalias const x = (dbl3_t *) atom->x[0]; + dbl3_t *_noalias const f = (dbl3_t *) thr->get_f()[0]; + const double *_noalias const q = atom->q; + const double *_noalias const eps = atom->epsilon; + const dbl3_t *_noalias const norm = (dbl3_t *) atom->mu[0]; + const double *_noalias const curvature = atom->curvature; + const double *_noalias const area = atom->area; + const int *_noalias const type = atom->type; + const int nlocal = atom->nlocal; + const double *_noalias const special_coul = force->special_coul; + const double *_noalias const special_lj = force->special_lj; + const double qqrd2e = force->qqrd2e; + double fxtmp, fytmp, fztmp, extmp, eytmp, eztmp; + + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + + // loop over neighbors of my atoms + + for (ii = iifrom; ii < iito; ++ii) { + + i = ilist[ii]; + qtmp = q[i]; + xtmp = x[i].x; + ytmp = x[i].y; + ztmp = x[i].z; + etmp = eps[i]; + itype = type[i]; + jlist = firstneigh[i]; + jnum = numneigh[i]; + fxtmp = fytmp = fztmp = 0.0; + extmp = eytmp = eztmp = 0.0; + + // self term Eq. (55) for I_{ii} and Eq. (52) and in Barros et al + double curvature_threshold = sqrt(area[i]); + if (curvature[i] < curvature_threshold) { + double sf = curvature[i] / (4.0 * MY_PIS * curvature_threshold) * area[i] * q[i]; + efield[i][0] = sf * norm[i].x; + efield[i][1] = sf * norm[i].y; + efield[i][2] = sf * norm[i].z; + } else { + efield[i][0] = efield[i][1] = efield[i][2] = 0; + } + + epot[i] = 0; + + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + factor_lj = special_lj[sbmask(j)]; + factor_coul = special_coul[sbmask(j)]; + j &= NEIGHMASK; + + delx = xtmp - x[j].x; + dely = ytmp - x[j].y; + delz = ztmp - x[j].z; + rsq = delx * delx + dely * dely + delz * delz; + jtype = type[j]; + + if (rsq < cutsq[itype][jtype]) { + r2inv = 1.0 / rsq; + + if (rsq < cut_coulsq[itype][jtype] && rsq > EPSILON) { + r = sqrt(rsq); + rinv = 1.0 / r; + screening = exp(-kappa * r); + efield_i = qqrd2e * q[j] * screening * (kappa + rinv); + forcecoul = qtmp * efield_i; + epot_i = efield_i; + } else + epot_i = efield_i = forcecoul = 0.0; + + if (rsq < cut_ljsq[itype][jtype]) { + r6inv = r2inv * r2inv * r2inv; + forcelj = r6inv * (lj1[itype][jtype] * r6inv - lj2[itype][jtype]); + } else + forcelj = 0.0; + + fpair_i = (factor_coul * etmp * forcecoul + factor_lj * forcelj) * r2inv; + + fxtmp += delx * fpair_i; + fytmp += dely * fpair_i; + fztmp += delz * fpair_i; + + efield_i *= (factor_coul * etmp * r2inv); + extmp += delx * efield_i; + eytmp += dely * efield_i; + eztmp += delz * efield_i; + epot[i] += epot_i; + + if (NEWTON_PAIR || j >= nlocal) { + fpair_j = (factor_coul * eps[j] * forcecoul + factor_lj * forcelj) * r2inv; + f[j].x -= delx * fpair_j; + f[j].y -= dely * fpair_j; + f[j].z -= delz * fpair_j; + } + + if (EFLAG) { + if (rsq < cut_coulsq[itype][jtype]) { + ecoul = factor_coul * qqrd2e * qtmp * q[j] * (etmp + eps[j]) * rinv * screening; + } else + ecoul = 0.0; + ecoul *= 0.5; + if (rsq < cut_ljsq[itype][jtype]) { + evdwl = r6inv * (lj3[itype][jtype] * r6inv - lj4[itype][jtype]) - offset[itype][jtype]; + evdwl *= factor_lj; + } else + evdwl = 0.0; + } + + if (EVFLAG) + ev_tally_thr(this, i, j, nlocal, NEWTON_PAIR, evdwl, ecoul, fpair_i, delx, dely, delz, + thr); + } + } + f[i].x += fxtmp; + f[i].y += fytmp; + f[i].z += fztmp; + efield[i][0] += extmp; + efield[i][1] += eytmp; + efield[i][2] += eztmp; + } +} diff --git a/src/OPENMP/pair_lj_cut_coul_debye_dielectric_omp.h b/src/OPENMP/pair_lj_cut_coul_debye_dielectric_omp.h new file mode 100644 index 0000000000..06a8ef6da0 --- /dev/null +++ b/src/OPENMP/pair_lj_cut_coul_debye_dielectric_omp.h @@ -0,0 +1,60 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/ Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS +// clang-format off +PairStyle(lj/cut/coul/debye/dielectric/omp,PairLJCutCoulDebyeDielectricOMP); +// clang-format on +#else + +#ifndef LMP_PAIR_LJ_CUT_COUL_DEBYE_DIELECTRIC_OMP_H +#define LMP_PAIR_LJ_CUT_COUL_DEBYE_DIELECTRIC_OMP_H + +#include "pair_lj_cut_coul_debye_dielectric.h" +#include "thr_omp.h" + +namespace LAMMPS_NS { + +class PairLJCutCoulDebyeDielectricOMP : public PairLJCutCoulDebyeDielectric, public ThrOMP { + public: + PairLJCutCoulDebyeDielectricOMP(class LAMMPS *); + ~PairLJCutCoulDebyeDielectricOMP() override = default; + void compute(int, int) override; + + protected: + template + void eval(int ifrom, int ito, ThrData *const thr); +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Incorrect args for pair coefficients + +Self-explanatory. Check the input script or data file. + +E: Pair style lj/cut/coul/debye/dielectric requires atom attribute q + +The atom style defined does not have this attribute. + +*/ diff --git a/src/OPENMP/pair_lj_cut_coul_debye_omp.cpp b/src/OPENMP/pair_lj_cut_coul_debye_omp.cpp index 9996149e58..7797d938b7 100644 --- a/src/OPENMP/pair_lj_cut_coul_debye_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_debye_omp.cpp @@ -87,8 +87,8 @@ void PairLJCutCoulDebyeOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_cut_coul_dsf_omp.cpp b/src/OPENMP/pair_lj_cut_coul_dsf_omp.cpp index 59cd3e7467..e305c1caf9 100644 --- a/src/OPENMP/pair_lj_cut_coul_dsf_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_dsf_omp.cpp @@ -97,8 +97,8 @@ void PairLJCutCoulDSFOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.cpp b/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.cpp index c076501d68..8e3880810c 100644 --- a/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.cpp @@ -19,6 +19,7 @@ #include "atom.h" #include "comm.h" +#include "ewald_const.h" #include "force.h" #include "math_const.h" #include "memory.h" @@ -28,20 +29,13 @@ #include "omp_compat.h" using namespace LAMMPS_NS; -using namespace MathConst; - -#define EWALD_F 1.12837917 -#define EWALD_P 0.3275911 -#define A1 0.254829592 -#define A2 -0.284496736 -#define A3 1.421413741 -#define A4 -1.453152027 -#define A5 1.061405429 +using namespace EwaldConst; +using MathConst::MY_PIS; /* ---------------------------------------------------------------------- */ -PairLJCutCoulLongDielectricOMP::PairLJCutCoulLongDielectricOMP(LAMMPS *lmp) : - PairLJCutCoulLongDielectric(lmp), ThrOMP(lmp, THR_PAIR) +PairLJCutCoulLongDielectricOMP::PairLJCutCoulLongDielectricOMP(LAMMPS *_lmp) : + PairLJCutCoulLongDielectric(_lmp), ThrOMP(_lmp, THR_PAIR) { } @@ -112,11 +106,11 @@ void PairLJCutCoulLongDielectricOMP::eval(int iifrom, int iito, ThrData *const t evdwl = ecoul = 0.0; - const dbl3_t *_noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t *_noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto *_noalias const x = (dbl3_t *) atom->x[0]; + auto *_noalias const f = (dbl3_t *) thr->get_f()[0]; const double *_noalias const q = atom->q; const double *_noalias const eps = atom->epsilon; - const dbl3_t *_noalias const norm = (dbl3_t *) atom->mu[0]; + const auto *_noalias const norm = (dbl3_t *) atom->mu[0]; const double *_noalias const curvature = atom->curvature; const double *_noalias const area = atom->area; const int *_noalias const type = atom->type; @@ -184,7 +178,7 @@ void PairLJCutCoulLongDielectricOMP::eval(int iifrom, int iito, ThrData *const t forcecoul = prefactor * (erfc + EWALD_F * grij * expm2); if (factor_coul < 1.0) forcecoul -= (1.0 - factor_coul) * prefactor; - prefactorE = q[j] / r; + prefactorE = qqrd2e * q[j] / r; efield_i = prefactorE * (erfc + EWALD_F * grij * expm2); if (factor_coul < 1.0) efield_i -= (1.0 - factor_coul) * prefactorE; epot_i = efield_i; @@ -203,7 +197,7 @@ void PairLJCutCoulLongDielectricOMP::eval(int iifrom, int iito, ThrData *const t prefactor = qtmp * q[j] * table; forcecoul -= (1.0 - factor_coul) * prefactor; - prefactorE = q[j] * table / qqrd2e; + prefactorE = q[j] * table; efield_i -= (1.0 - factor_coul) * prefactorE; } epot_i = efield_i; diff --git a/src/OPENMP/pair_lj_cut_coul_long_omp.cpp b/src/OPENMP/pair_lj_cut_coul_long_omp.cpp index c66ccb40cc..af551017b2 100644 --- a/src/OPENMP/pair_lj_cut_coul_long_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_long_omp.cpp @@ -97,8 +97,8 @@ void PairLJCutCoulLongOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_cut_coul_long_soft_omp.cpp b/src/OPENMP/pair_lj_cut_coul_long_soft_omp.cpp index 5911f38072..3ceb40b262 100644 --- a/src/OPENMP/pair_lj_cut_coul_long_soft_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_long_soft_omp.cpp @@ -97,8 +97,8 @@ void PairLJCutCoulLongSoftOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_cut_coul_msm_omp.cpp b/src/OPENMP/pair_lj_cut_coul_msm_omp.cpp index ccc92489b4..d573a349c1 100644 --- a/src/OPENMP/pair_lj_cut_coul_msm_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_msm_omp.cpp @@ -95,8 +95,8 @@ void PairLJCutCoulMSMOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_cut_coul_wolf_omp.cpp b/src/OPENMP/pair_lj_cut_coul_wolf_omp.cpp index 5c00a88702..55c2bc6c11 100644 --- a/src/OPENMP/pair_lj_cut_coul_wolf_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_wolf_omp.cpp @@ -89,8 +89,8 @@ void PairLJCutCoulWolfOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_cut_dipole_cut_omp.cpp b/src/OPENMP/pair_lj_cut_dipole_cut_omp.cpp index 3da8e9f59c..1cecb1c7c4 100644 --- a/src/OPENMP/pair_lj_cut_dipole_cut_omp.cpp +++ b/src/OPENMP/pair_lj_cut_dipole_cut_omp.cpp @@ -88,8 +88,8 @@ void PairLJCutDipoleCutOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; double * const * const torque = thr->get_torque(); const double * _noalias const q = atom->q; const dbl4_t * _noalias const mu = (dbl4_t *) atom->mu[0]; diff --git a/src/OPENMP/pair_lj_cut_omp.cpp b/src/OPENMP/pair_lj_cut_omp.cpp index e62c422e15..96ecd959e2 100644 --- a/src/OPENMP/pair_lj_cut_omp.cpp +++ b/src/OPENMP/pair_lj_cut_omp.cpp @@ -75,8 +75,8 @@ void PairLJCutOMP::compute(int eflag, int vflag) template void PairLJCutOMP::eval(int iifrom, int iito, ThrData * const thr) { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const double * _noalias const special_lj = force->special_lj; const int * _noalias const ilist = list->ilist; diff --git a/src/OPENMP/pair_lj_cut_soft_omp.cpp b/src/OPENMP/pair_lj_cut_soft_omp.cpp index ac39009ebe..c9b1a4bc42 100644 --- a/src/OPENMP/pair_lj_cut_soft_omp.cpp +++ b/src/OPENMP/pair_lj_cut_soft_omp.cpp @@ -75,8 +75,8 @@ void PairLJCutSoftOMP::compute(int eflag, int vflag) template void PairLJCutSoftOMP::eval(int iifrom, int iito, ThrData * const thr) { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const double * _noalias const special_lj = force->special_lj; const int * _noalias const ilist = list->ilist; diff --git a/src/OPENMP/pair_lj_cut_thole_long_omp.cpp b/src/OPENMP/pair_lj_cut_thole_long_omp.cpp index e81dfbe242..1034e8e0e5 100644 --- a/src/OPENMP/pair_lj_cut_thole_long_omp.cpp +++ b/src/OPENMP/pair_lj_cut_thole_long_omp.cpp @@ -98,8 +98,8 @@ void PairLJCutTholeLongOMP::compute(int eflag, int vflag) template void PairLJCutTholeLongOMP::eval(int iifrom, int iito, ThrData * const thr) { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * const q = atom->q; const int * _noalias const type = atom->type; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_lj_cut_tip4p_cut_omp.cpp b/src/OPENMP/pair_lj_cut_tip4p_cut_omp.cpp index 3c02a5898f..be6f77f7f5 100644 --- a/src/OPENMP/pair_lj_cut_tip4p_cut_omp.cpp +++ b/src/OPENMP/pair_lj_cut_tip4p_cut_omp.cpp @@ -139,8 +139,8 @@ void PairLJCutTIP4PCutOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_cut_tip4p_long_omp.cpp b/src/OPENMP/pair_lj_cut_tip4p_long_omp.cpp index 06858a7b52..b6948f0c8b 100644 --- a/src/OPENMP/pair_lj_cut_tip4p_long_omp.cpp +++ b/src/OPENMP/pair_lj_cut_tip4p_long_omp.cpp @@ -153,8 +153,8 @@ void PairLJCutTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const tagint * _noalias const tag = atom->tag; diff --git a/src/OPENMP/pair_lj_cut_tip4p_long_soft_omp.cpp b/src/OPENMP/pair_lj_cut_tip4p_long_soft_omp.cpp index 8ba108e3a4..49e76992f7 100644 --- a/src/OPENMP/pair_lj_cut_tip4p_long_soft_omp.cpp +++ b/src/OPENMP/pair_lj_cut_tip4p_long_soft_omp.cpp @@ -141,8 +141,8 @@ void PairLJCutTIP4PLongSoftOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_expand_omp.cpp b/src/OPENMP/pair_lj_expand_omp.cpp index e22c773f97..35d23aadc4 100644 --- a/src/OPENMP/pair_lj_expand_omp.cpp +++ b/src/OPENMP/pair_lj_expand_omp.cpp @@ -85,8 +85,8 @@ void PairLJExpandOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_lj_gromacs_coul_gromacs_omp.cpp b/src/OPENMP/pair_lj_gromacs_coul_gromacs_omp.cpp index ad75760f2b..096f60b1ec 100644 --- a/src/OPENMP/pair_lj_gromacs_coul_gromacs_omp.cpp +++ b/src/OPENMP/pair_lj_gromacs_coul_gromacs_omp.cpp @@ -87,8 +87,8 @@ void PairLJGromacsCoulGromacsOMP::eval(int iifrom, int iito, ThrData * const thr evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_lj_gromacs_omp.cpp b/src/OPENMP/pair_lj_gromacs_omp.cpp index fd1001e30b..f450d83705 100644 --- a/src/OPENMP/pair_lj_gromacs_omp.cpp +++ b/src/OPENMP/pair_lj_gromacs_omp.cpp @@ -85,8 +85,8 @@ void PairLJGromacsOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_lj_long_tip4p_long_omp.cpp b/src/OPENMP/pair_lj_long_tip4p_long_omp.cpp index 606e57188a..b0fdf3a393 100644 --- a/src/OPENMP/pair_lj_long_tip4p_long_omp.cpp +++ b/src/OPENMP/pair_lj_long_tip4p_long_omp.cpp @@ -718,8 +718,8 @@ template < const int EVFLAG, const int EFLAG, const int NEWTON_PAIR, const int CTABLE, const int LJTABLE, const int ORDER1, const int ORDER6 > void PairLJLongTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr) { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const tagint * _noalias const tag = atom->tag; @@ -1095,8 +1095,8 @@ void PairLJLongTIP4PLongOMP::eval_inner(int iifrom, int iito, ThrData * const th { double rsq, r2inv, forcecoul = 0.0, forcelj, cforce; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const tagint * _noalias const tag = atom->tag; @@ -1352,8 +1352,8 @@ void PairLJLongTIP4PLongOMP::eval_middle(int iifrom, int iito, ThrData * const t { double rsq, r2inv, forcecoul,forcelj, cforce; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const tagint * _noalias const tag = atom->tag; @@ -1622,8 +1622,8 @@ void PairLJLongTIP4PLongOMP::eval_outer(int iifrom, int iito, ThrData * const th double v[6]; dbl3_t x1,x2,xH1,xH2; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const tagint * _noalias const tag = atom->tag; diff --git a/src/OPENMP/pair_lj_relres_omp.cpp b/src/OPENMP/pair_lj_relres_omp.cpp index 250710cfa1..159b22bbb1 100644 --- a/src/OPENMP/pair_lj_relres_omp.cpp +++ b/src/OPENMP/pair_lj_relres_omp.cpp @@ -85,8 +85,8 @@ void PairLJRelResOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_lj_sdk_coul_long_omp.cpp b/src/OPENMP/pair_lj_sdk_coul_long_omp.cpp index 747aa88fa6..fff5d17b13 100644 --- a/src/OPENMP/pair_lj_sdk_coul_long_omp.cpp +++ b/src/OPENMP/pair_lj_sdk_coul_long_omp.cpp @@ -81,8 +81,8 @@ template void PairLJSDKCoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr) { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const double * _noalias const special_coul = force->special_coul; diff --git a/src/OPENMP/pair_lj_sdk_omp.cpp b/src/OPENMP/pair_lj_sdk_omp.cpp index 05a7bac568..909bb73fc8 100644 --- a/src/OPENMP/pair_lj_sdk_omp.cpp +++ b/src/OPENMP/pair_lj_sdk_omp.cpp @@ -88,8 +88,8 @@ void PairLJSDKOMP::eval_thr(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_lj_sf_dipole_sf_omp.cpp b/src/OPENMP/pair_lj_sf_dipole_sf_omp.cpp index 70ce7e5a23..36ac61a14c 100644 --- a/src/OPENMP/pair_lj_sf_dipole_sf_omp.cpp +++ b/src/OPENMP/pair_lj_sf_dipole_sf_omp.cpp @@ -92,8 +92,8 @@ void PairLJSFDipoleSFOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; double * const * const torque = thr->get_torque(); const double * _noalias const q = atom->q; const dbl4_t * _noalias const mu = (dbl4_t *) atom->mu[0]; diff --git a/src/OPENMP/pair_lj_smooth_linear_omp.cpp b/src/OPENMP/pair_lj_smooth_linear_omp.cpp index 21589a7480..49768a8641 100644 --- a/src/OPENMP/pair_lj_smooth_linear_omp.cpp +++ b/src/OPENMP/pair_lj_smooth_linear_omp.cpp @@ -85,8 +85,8 @@ void PairLJSmoothLinearOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_lj_smooth_omp.cpp b/src/OPENMP/pair_lj_smooth_omp.cpp index 6831459c7c..f142fb7930 100644 --- a/src/OPENMP/pair_lj_smooth_omp.cpp +++ b/src/OPENMP/pair_lj_smooth_omp.cpp @@ -85,8 +85,8 @@ void PairLJSmoothOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_meam_spline_omp.cpp b/src/OPENMP/pair_meam_spline_omp.cpp index 19da4c90ec..d704b9c19c 100644 --- a/src/OPENMP/pair_meam_spline_omp.cpp +++ b/src/OPENMP/pair_meam_spline_omp.cpp @@ -100,7 +100,7 @@ void PairMEAMSplineOMP::eval(int iifrom, int iito, ThrData * const thr) } // Allocate array for temporary bond info. - MEAM2Body *myTwoBodyInfo = new MEAM2Body[myMaxNeighbors]; + auto myTwoBodyInfo = new MEAM2Body[myMaxNeighbors]; const double * const * const x = atom->x; double * const * const forces = thr->get_f(); diff --git a/src/OPENMP/pair_morse_omp.cpp b/src/OPENMP/pair_morse_omp.cpp index 7078ffee30..76026e7598 100644 --- a/src/OPENMP/pair_morse_omp.cpp +++ b/src/OPENMP/pair_morse_omp.cpp @@ -84,8 +84,8 @@ void PairMorseOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_morse_smooth_linear_omp.cpp b/src/OPENMP/pair_morse_smooth_linear_omp.cpp index 85088dc30f..448a094993 100644 --- a/src/OPENMP/pair_morse_smooth_linear_omp.cpp +++ b/src/OPENMP/pair_morse_smooth_linear_omp.cpp @@ -86,8 +86,8 @@ void PairMorseSmoothLinearOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_nm_cut_coul_cut_omp.cpp b/src/OPENMP/pair_nm_cut_coul_cut_omp.cpp index b888dbdb82..0dc2d7f094 100644 --- a/src/OPENMP/pair_nm_cut_coul_cut_omp.cpp +++ b/src/OPENMP/pair_nm_cut_coul_cut_omp.cpp @@ -86,8 +86,8 @@ void PairNMCutCoulCutOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_nm_cut_coul_long_omp.cpp b/src/OPENMP/pair_nm_cut_coul_long_omp.cpp index bacf06a06a..9f09258ce8 100644 --- a/src/OPENMP/pair_nm_cut_coul_long_omp.cpp +++ b/src/OPENMP/pair_nm_cut_coul_long_omp.cpp @@ -97,8 +97,8 @@ void PairNMCutCoulLongOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_nm_cut_omp.cpp b/src/OPENMP/pair_nm_cut_omp.cpp index 6c4765023a..6fe77934f1 100644 --- a/src/OPENMP/pair_nm_cut_omp.cpp +++ b/src/OPENMP/pair_nm_cut_omp.cpp @@ -76,8 +76,8 @@ void PairNMCutOMP::compute(int eflag, int vflag) template void PairNMCutOMP::eval(int iifrom, int iito, ThrData * const thr) { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const double * _noalias const special_lj = force->special_lj; const int * _noalias const ilist = list->ilist; diff --git a/src/OPENMP/pair_reaxff_omp.cpp b/src/OPENMP/pair_reaxff_omp.cpp index 6d613abf60..f10f5885bd 100644 --- a/src/OPENMP/pair_reaxff_omp.cpp +++ b/src/OPENMP/pair_reaxff_omp.cpp @@ -134,7 +134,7 @@ void PairReaxFFOMP::init_style() "increased neighbor list skin."); if (fix_reaxff == nullptr) - fix_reaxff = (FixReaxFF *) modify->add_fix(fmt::format("{} all REAXFF",fix_id)); + fix_reaxff = dynamic_cast( modify->add_fix(fmt::format("{} all REAXFF",fix_id))); api->control->nthreads = comm->nthreads; } diff --git a/src/OPENMP/pair_resquared_omp.cpp b/src/OPENMP/pair_resquared_omp.cpp index af75e8b161..a02427f09f 100644 --- a/src/OPENMP/pair_resquared_omp.cpp +++ b/src/OPENMP/pair_resquared_omp.cpp @@ -82,9 +82,9 @@ void PairRESquaredOMP::eval(int iifrom, int iito, ThrData * const thr) int *ilist,*jlist,*numneigh,**firstneigh; RE2Vars wi,wj; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; - dbl3_t * _noalias const tor = (dbl3_t *) thr->get_torque()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; + auto * _noalias const tor = (dbl3_t *) thr->get_torque()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_soft_omp.cpp b/src/OPENMP/pair_soft_omp.cpp index b524d8a371..277810a60e 100644 --- a/src/OPENMP/pair_soft_omp.cpp +++ b/src/OPENMP/pair_soft_omp.cpp @@ -88,8 +88,8 @@ void PairSoftOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_sw_omp.cpp b/src/OPENMP/pair_sw_omp.cpp index 22cf2b4dba..f6d615b2a1 100644 --- a/src/OPENMP/pair_sw_omp.cpp +++ b/src/OPENMP/pair_sw_omp.cpp @@ -80,8 +80,8 @@ void PairSWOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const tagint * _noalias const tag = atom->tag; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_table_omp.cpp b/src/OPENMP/pair_table_omp.cpp index 72d5ecd4de..d60dfb58f1 100644 --- a/src/OPENMP/pair_table_omp.cpp +++ b/src/OPENMP/pair_table_omp.cpp @@ -86,8 +86,8 @@ void PairTableOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const int tid = thr->get_tid(); diff --git a/src/OPENMP/pair_tersoff_mod_c_omp.cpp b/src/OPENMP/pair_tersoff_mod_c_omp.cpp index cd59e06673..bfd55f3b0e 100644 --- a/src/OPENMP/pair_tersoff_mod_c_omp.cpp +++ b/src/OPENMP/pair_tersoff_mod_c_omp.cpp @@ -101,8 +101,8 @@ void PairTersoffMODCOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const tagint * _noalias const tag = atom->tag; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_tersoff_mod_omp.cpp b/src/OPENMP/pair_tersoff_mod_omp.cpp index de19aa3872..d7c64002c5 100644 --- a/src/OPENMP/pair_tersoff_mod_omp.cpp +++ b/src/OPENMP/pair_tersoff_mod_omp.cpp @@ -101,8 +101,8 @@ void PairTersoffMODOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const tagint * _noalias const tag = atom->tag; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_tersoff_omp.cpp b/src/OPENMP/pair_tersoff_omp.cpp index 2a3cfb5d54..50c002a01b 100644 --- a/src/OPENMP/pair_tersoff_omp.cpp +++ b/src/OPENMP/pair_tersoff_omp.cpp @@ -104,8 +104,8 @@ void PairTersoffOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const tagint * _noalias const tag = atom->tag; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_tersoff_table_omp.cpp b/src/OPENMP/pair_tersoff_table_omp.cpp index 94f9e72c3d..010a3f5610 100644 --- a/src/OPENMP/pair_tersoff_table_omp.cpp +++ b/src/OPENMP/pair_tersoff_table_omp.cpp @@ -112,8 +112,8 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr) double evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const int tid = thr->get_tid(); diff --git a/src/OPENMP/pair_tip4p_cut_omp.cpp b/src/OPENMP/pair_tip4p_cut_omp.cpp index fb3e907761..91d0063a01 100644 --- a/src/OPENMP/pair_tip4p_cut_omp.cpp +++ b/src/OPENMP/pair_tip4p_cut_omp.cpp @@ -138,8 +138,8 @@ void PairTIP4PCutOMP::eval(int iifrom, int iito, ThrData * const thr) ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const double * _noalias const special_coul = force->special_coul; diff --git a/src/OPENMP/pair_tip4p_long_omp.cpp b/src/OPENMP/pair_tip4p_long_omp.cpp index 2f08746db5..21d4484e99 100644 --- a/src/OPENMP/pair_tip4p_long_omp.cpp +++ b/src/OPENMP/pair_tip4p_long_omp.cpp @@ -153,8 +153,8 @@ void PairTIP4PLongOMP::eval(int iifrom, int iito, ThrData * const thr) ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const double * _noalias const special_coul = force->special_coul; diff --git a/src/OPENMP/pair_tip4p_long_soft_omp.cpp b/src/OPENMP/pair_tip4p_long_soft_omp.cpp index 3bbb0717ab..e2d8023d4b 100644 --- a/src/OPENMP/pair_tip4p_long_soft_omp.cpp +++ b/src/OPENMP/pair_tip4p_long_soft_omp.cpp @@ -140,8 +140,8 @@ void PairTIP4PLongSoftOMP::eval(int iifrom, int iito, ThrData * const thr) ecoul = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const q = atom->q; const int * _noalias const type = atom->type; const double * _noalias const special_coul = force->special_coul; diff --git a/src/OPENMP/pair_ufm_omp.cpp b/src/OPENMP/pair_ufm_omp.cpp index 2140de5546..aa7a7ed3ea 100644 --- a/src/OPENMP/pair_ufm_omp.cpp +++ b/src/OPENMP/pair_ufm_omp.cpp @@ -86,8 +86,8 @@ void PairUFMOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_vashishta_omp.cpp b/src/OPENMP/pair_vashishta_omp.cpp index 3e5a13ae06..e867e58a6d 100644 --- a/src/OPENMP/pair_vashishta_omp.cpp +++ b/src/OPENMP/pair_vashishta_omp.cpp @@ -80,8 +80,8 @@ void PairVashishtaOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const tagint * _noalias const tag = atom->tag; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_vashishta_table_omp.cpp b/src/OPENMP/pair_vashishta_table_omp.cpp index c40259af88..eb9e80b7a3 100644 --- a/src/OPENMP/pair_vashishta_table_omp.cpp +++ b/src/OPENMP/pair_vashishta_table_omp.cpp @@ -80,8 +80,8 @@ void PairVashishtaTableOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const tagint * _noalias const tag = atom->tag; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_yukawa_colloid_omp.cpp b/src/OPENMP/pair_yukawa_colloid_omp.cpp index a6fea6f0d4..f879eeddf9 100644 --- a/src/OPENMP/pair_yukawa_colloid_omp.cpp +++ b/src/OPENMP/pair_yukawa_colloid_omp.cpp @@ -84,8 +84,8 @@ void PairYukawaColloidOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const double * _noalias const radius = atom->radius; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; diff --git a/src/OPENMP/pair_yukawa_omp.cpp b/src/OPENMP/pair_yukawa_omp.cpp index ac7b2302ad..efaa42fb50 100644 --- a/src/OPENMP/pair_yukawa_omp.cpp +++ b/src/OPENMP/pair_yukawa_omp.cpp @@ -84,8 +84,8 @@ void PairYukawaOMP::eval(int iifrom, int iito, ThrData * const thr) evdwl = 0.0; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int nlocal = atom->nlocal; const double * _noalias const special_lj = force->special_lj; diff --git a/src/OPENMP/pair_zbl_omp.cpp b/src/OPENMP/pair_zbl_omp.cpp index 1ce0200b99..a1083e0658 100644 --- a/src/OPENMP/pair_zbl_omp.cpp +++ b/src/OPENMP/pair_zbl_omp.cpp @@ -76,8 +76,8 @@ void PairZBLOMP::compute(int eflag, int vflag) template void PairZBLOMP::eval(int iifrom, int iito, ThrData * const thr) { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; const int * _noalias const type = atom->type; const int * _noalias const ilist = list->ilist; const int * _noalias const numneigh = list->numneigh; diff --git a/src/OPENMP/pppm_cg_omp.cpp b/src/OPENMP/pppm_cg_omp.cpp index 1a245b1323..5dd78770f5 100644 --- a/src/OPENMP/pppm_cg_omp.cpp +++ b/src/OPENMP/pppm_cg_omp.cpp @@ -359,8 +359,8 @@ void PPPMCGOMP::make_rho() #endif { const double * _noalias const q = atom->q; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const p2g = (int3_t *) part2grid[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; @@ -441,7 +441,7 @@ void PPPMCGOMP::fieldforce_ik() // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; const double * _noalias const q = atom->q; const double qqrd2e = force->qqrd2e; const int nthreads = comm->nthreads; @@ -458,7 +458,7 @@ void PPPMCGOMP::fieldforce_ik() // get per thread data ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; FFT_SCALAR * const * const r1d = static_cast(thr->get_rho1d()); for (int j = ifrom; j < ito; ++j) { @@ -522,7 +522,7 @@ void PPPMCGOMP::fieldforce_ad() // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; const double * _noalias const q = atom->q; const double qqrd2e = force->qqrd2e; const int nthreads = comm->nthreads; @@ -540,7 +540,7 @@ void PPPMCGOMP::fieldforce_ad() // get per thread data ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; FFT_SCALAR * const * const r1d = static_cast(thr->get_rho1d()); FFT_SCALAR * const * const d1d = static_cast(thr->get_drho1d()); @@ -616,7 +616,7 @@ void PPPMCGOMP::fieldforce_peratom() // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; const double * _noalias const q = atom->q; const int nthreads = comm->nthreads; diff --git a/src/OPENMP/pppm_disp_omp.cpp b/src/OPENMP/pppm_disp_omp.cpp index 3c9767e85d..e4937002a6 100644 --- a/src/OPENMP/pppm_disp_omp.cpp +++ b/src/OPENMP/pppm_disp_omp.cpp @@ -344,8 +344,8 @@ void PPPMDispOMP::particle_map(double dxinv, double dyinv, int nxhi_o, int nyhi_o, int nzhi_o) { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const p2g = (int3_t *) part2grid[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; const double boxloz = boxlo[2]; @@ -426,8 +426,8 @@ void PPPMDispOMP::make_rho_c() #endif { const double * _noalias const q = atom->q; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const p2g = (int3_t *) part2grid[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; @@ -515,8 +515,8 @@ void PPPMDispOMP::make_rho_g() #pragma omp parallel LMP_DEFAULT_NONE #endif { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const int3_t * _noalias const p2g = (int3_t *) part2grid_6[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const p2g = (int3_t *) part2grid_6[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; @@ -619,8 +619,8 @@ void PPPMDispOMP::make_rho_a() #pragma omp parallel LMP_DEFAULT_NONE #endif { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const int3_t * _noalias const p2g = (int3_t *) part2grid_6[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const p2g = (int3_t *) part2grid_6[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; diff --git a/src/OPENMP/pppm_disp_tip4p_omp.cpp b/src/OPENMP/pppm_disp_tip4p_omp.cpp index 083577f16f..56f3f14c2c 100644 --- a/src/OPENMP/pppm_disp_tip4p_omp.cpp +++ b/src/OPENMP/pppm_disp_tip4p_omp.cpp @@ -338,8 +338,8 @@ void PPPMDispTIP4POMP::particle_map_c(double dxinv, double dyinv, if (atom->nlocal == 0) return; const int * _noalias const type = atom->type; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const p2g = (int3_t *) part2grid[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; const double boxloz = boxlo[2]; @@ -417,8 +417,8 @@ void PPPMDispTIP4POMP::particle_map(double dxinv, double dyinv, // no local atoms => nothing to do if (atom->nlocal == 0) return; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const p2g = (int3_t *) part2grid[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; const double boxloz = boxlo[2]; @@ -496,8 +496,8 @@ void PPPMDispTIP4POMP::make_rho_c() #endif { const double * _noalias const q = atom->q; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const p2g = (int3_t *) part2grid[0]; const int * _noalias const type = atom->type; dbl3_t xM; @@ -590,8 +590,8 @@ void PPPMDispTIP4POMP::make_rho_g() #pragma omp parallel LMP_DEFAULT_NONE #endif { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const int3_t * _noalias const p2g = (int3_t *) part2grid_6[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const p2g = (int3_t *) part2grid_6[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; @@ -692,8 +692,8 @@ void PPPMDispTIP4POMP::make_rho_a() #pragma omp parallel LMP_DEFAULT_NONE #endif { - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const int3_t * _noalias const p2g = (int3_t *) part2grid_6[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const p2g = (int3_t *) part2grid_6[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; @@ -789,9 +789,9 @@ void PPPMDispTIP4POMP::fieldforce_c_ik() // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; const double * _noalias const q = atom->q; - const int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const p2g = (int3_t *) part2grid[0]; const int * _noalias const type = atom->type; const double qqrd2e = force->qqrd2e; @@ -811,7 +811,7 @@ void PPPMDispTIP4POMP::fieldforce_c_ik() // get per thread data ThrData *thr = fix->get_thr(tid); - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; FFT_SCALAR * const * const r1d = static_cast(thr->get_rho1d()); for (i = ifrom; i < ito; ++i) { @@ -897,9 +897,9 @@ void PPPMDispTIP4POMP::fieldforce_c_ad() // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; const double * _noalias const q = atom->q; - const int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const p2g = (int3_t *) part2grid[0]; const int * _noalias const type = atom->type; const double qqrd2e = force->qqrd2e; @@ -920,7 +920,7 @@ void PPPMDispTIP4POMP::fieldforce_c_ad() // get per thread data ThrData *thr = fix->get_thr(tid); - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; FFT_SCALAR * const * const r1d = static_cast(thr->get_rho1d()); FFT_SCALAR * const * const d1d = static_cast(thr->get_drho1d()); @@ -1856,7 +1856,7 @@ void PPPMDispTIP4POMP::find_M_thr(int i, int &iH1, int &iH2, dbl3_t &xM) iH1 = domain->closest_image(i,iH1); iH2 = domain->closest_image(i,iH2); - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; double delx1 = x[iH1].x - x[i].x; double dely1 = x[iH1].y - x[i].y; diff --git a/src/OPENMP/pppm_omp.cpp b/src/OPENMP/pppm_omp.cpp index e82a6b0b13..221f0be836 100644 --- a/src/OPENMP/pppm_omp.cpp +++ b/src/OPENMP/pppm_omp.cpp @@ -358,8 +358,8 @@ void PPPMOMP::make_rho() #endif { const double * _noalias const q = atom->q; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const p2g = (int3_t *) part2grid[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; @@ -441,9 +441,9 @@ void PPPMOMP::fieldforce_ik() if (nlocal == 0) return; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; const double * _noalias const q = atom->q; - const int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const p2g = (int3_t *) part2grid[0]; const double qqrd2e = force->qqrd2e; const double boxlox = boxlo[0]; @@ -462,7 +462,7 @@ void PPPMOMP::fieldforce_ik() // get per thread data ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; FFT_SCALAR * const * const r1d = static_cast(thr->get_rho1d()); for (i = ifrom; i < ito; ++i) { @@ -527,9 +527,9 @@ void PPPMOMP::fieldforce_ad() // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; const double * _noalias const q = atom->q; - const int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const p2g = (int3_t *) part2grid[0]; const double qqrd2e = force->qqrd2e; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; @@ -548,7 +548,7 @@ void PPPMOMP::fieldforce_ad() // get per thread data ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; FFT_SCALAR * const * const r1d = static_cast(thr->get_rho1d()); FFT_SCALAR * const * const d1d = static_cast(thr->get_drho1d()); @@ -625,7 +625,7 @@ void PPPMOMP::fieldforce_peratom() // (dx,dy,dz) = distance to "lower left" grid pt // (mx,my,mz) = global coords of moving stencil pt - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; const double * _noalias const q = atom->q; #if defined(_OPENMP) diff --git a/src/OPENMP/pppm_tip4p_omp.cpp b/src/OPENMP/pppm_tip4p_omp.cpp index 9d8832681e..b9902df398 100644 --- a/src/OPENMP/pppm_tip4p_omp.cpp +++ b/src/OPENMP/pppm_tip4p_omp.cpp @@ -346,8 +346,8 @@ void PPPMTIP4POMP::particle_map() if (atom->nlocal == 0) return; const int * _noalias const type = atom->type; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + auto * _noalias const p2g = (int3_t *) part2grid[0]; const double boxlox = boxlo[0]; const double boxloy = boxlo[1]; const double boxloz = boxlo[2]; @@ -423,8 +423,8 @@ void PPPMTIP4POMP::make_rho() #endif { const double * _noalias const q = atom->q; - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; - const int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const p2g = (int3_t *) part2grid[0]; const int * _noalias const type = atom->type; dbl3_t xM; @@ -513,9 +513,9 @@ void PPPMTIP4POMP::fieldforce_ik() // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; const double * _noalias const q = atom->q; - const int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const p2g = (int3_t *) part2grid[0]; const int * _noalias const type = atom->type; const double qqrd2e = force->qqrd2e; @@ -536,7 +536,7 @@ void PPPMTIP4POMP::fieldforce_ik() // get per thread data ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; FFT_SCALAR * const * const r1d = static_cast(thr->get_rho1d()); for (i = ifrom; i < ito; ++i) { @@ -624,9 +624,9 @@ void PPPMTIP4POMP::fieldforce_ad() // (mx,my,mz) = global coords of moving stencil pt // ek = 3 components of E-field on particle - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; const double * _noalias const q = atom->q; - const int3_t * _noalias const p2g = (int3_t *) part2grid[0]; + const auto * _noalias const p2g = (int3_t *) part2grid[0]; const int * _noalias const type = atom->type; const double qqrd2e = force->qqrd2e; @@ -648,7 +648,7 @@ void PPPMTIP4POMP::fieldforce_ad() // get per thread data ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - dbl3_t * _noalias const f = (dbl3_t *) thr->get_f()[0]; + auto * _noalias const f = (dbl3_t *) thr->get_f()[0]; FFT_SCALAR * const * const r1d = static_cast(thr->get_rho1d()); FFT_SCALAR * const * const d1d = static_cast(thr->get_drho1d()); @@ -837,7 +837,7 @@ void PPPMTIP4POMP::find_M_thr(int i, int &iH1, int &iH2, dbl3_t &xM) iH1 = domain->closest_image(i,iH1); iH2 = domain->closest_image(i,iH2); - const dbl3_t * _noalias const x = (dbl3_t *) atom->x[0]; + const auto * _noalias const x = (dbl3_t *) atom->x[0]; double delx1 = x[iH1].x - x[i].x; double dely1 = x[iH1].y - x[i].y; diff --git a/src/OPENMP/reaxff_bond_orders_omp.cpp b/src/OPENMP/reaxff_bond_orders_omp.cpp index 38901807c2..258f207927 100644 --- a/src/OPENMP/reaxff_bond_orders_omp.cpp +++ b/src/OPENMP/reaxff_bond_orders_omp.cpp @@ -44,7 +44,7 @@ namespace ReaxFF { dbond_coefficients coef; int pk, k, j; - PairReaxFFOMP *pair_reax_ptr = static_cast(system->pair_ptr); + auto pair_reax_ptr = static_cast(system->pair_ptr); int tid = get_tid(); ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); diff --git a/src/OPENMP/thr_omp.cpp b/src/OPENMP/thr_omp.cpp index 73a5f97ca2..01f12ed17d 100644 --- a/src/OPENMP/thr_omp.cpp +++ b/src/OPENMP/thr_omp.cpp @@ -210,7 +210,7 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag, } if (evflag) { - Pair * const pair = (Pair *)style; + auto const pair = (Pair *)style; #if defined(_OPENMP) #pragma omp critical diff --git a/src/OPT/pair_eam_opt.cpp b/src/OPT/pair_eam_opt.cpp index 0fa145c6c5..24ebdd8b4c 100644 --- a/src/OPT/pair_eam_opt.cpp +++ b/src/OPT/pair_eam_opt.cpp @@ -96,8 +96,8 @@ void PairEAMOpt::eval() int* _noalias type = atom->type; int nlocal = atom->nlocal; - vec3_t* _noalias xx = (vec3_t*)x[0]; - vec3_t* _noalias ff = (vec3_t*)f[0]; + auto * _noalias xx = (vec3_t*)x[0]; + auto * _noalias ff = (vec3_t*)f[0]; double tmp_cutforcesq = cutforcesq; double tmp_rdr = rdr; @@ -112,10 +112,10 @@ void PairEAMOpt::eval() int ntypes = atom->ntypes; int ntypes2 = ntypes*ntypes; - fast_alpha_t* _noalias fast_alpha = + auto * _noalias fast_alpha = (fast_alpha_t*) malloc((size_t)ntypes2*(nr+1)*sizeof(fast_alpha_t)); for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) { - fast_alpha_t* _noalias tab = &fast_alpha[i*ntypes*nr+j*nr]; + auto * _noalias tab = &fast_alpha[i*ntypes*nr+j*nr]; if (type2rhor[i+1][j+1] >= 0) { for (int m = 1; m <= nr; m++) { tab[m].rhor0i = rhor_spline[type2rhor[i+1][j+1]][m][6]; @@ -133,12 +133,12 @@ void PairEAMOpt::eval() } } } - fast_alpha_t* _noalias tabeight = fast_alpha; + auto * _noalias tabeight = fast_alpha; - fast_gamma_t* _noalias fast_gamma = + auto * _noalias fast_gamma = (fast_gamma_t*) malloc((size_t)ntypes2*(nr+1)*sizeof(fast_gamma_t)); for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) { - fast_gamma_t* _noalias tab = &fast_gamma[i*ntypes*nr+j*nr]; + auto * _noalias tab = &fast_gamma[i*ntypes*nr+j*nr]; if (type2rhor[i+1][j+1] >= 0) { for (int m = 1; m <= nr; m++) { tab[m].rhor4i = rhor_spline[type2rhor[i+1][j+1]][m][2]; @@ -166,7 +166,7 @@ void PairEAMOpt::eval() } } } - fast_gamma_t* _noalias tabss = fast_gamma; + auto * _noalias tabss = fast_gamma; // zero out density @@ -188,7 +188,7 @@ void PairEAMOpt::eval() jnum = numneigh[i]; double tmprho = rho[i]; - fast_alpha_t* _noalias tabeighti = &tabeight[itype*ntypes*nr]; + auto * _noalias tabeighti = &tabeight[itype*ntypes*nr]; for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; @@ -271,7 +271,7 @@ void PairEAMOpt::eval() double tmpfy = 0.0; double tmpfz = 0.0; - fast_gamma_t* _noalias tabssi = &tabss[itype1*ntypes*nr]; + auto * _noalias tabssi = &tabss[itype1*ntypes*nr]; double* _noalias scale_i = scale[itype1+1]+1; numforce[i] = 0; diff --git a/src/OPT/pair_lj_charmm_coul_long_opt.cpp b/src/OPT/pair_lj_charmm_coul_long_opt.cpp index 186172035c..bfc904b853 100644 --- a/src/OPT/pair_lj_charmm_coul_long_opt.cpp +++ b/src/OPT/pair_lj_charmm_coul_long_opt.cpp @@ -98,8 +98,8 @@ void PairLJCharmmCoulLongOpt::eval() int** _noalias firstneigh = list->firstneigh; int* _noalias numneigh = list->numneigh; - vec3_t* _noalias xx = (vec3_t*)x[0]; - vec3_t* _noalias ff = (vec3_t*)f[0]; + auto * _noalias xx = (vec3_t*)x[0]; + auto * _noalias ff = (vec3_t*)f[0]; int ntypes = atom->ntypes; int ntypes2 = ntypes*ntypes; @@ -107,7 +107,7 @@ void PairLJCharmmCoulLongOpt::eval() double tmp_coef1 = 1.0/denom_lj; double tmp_coef2 = cut_ljsq - 3.0*cut_lj_innersq; - fast_alpha_t* _noalias fast_alpha = + auto * _noalias fast_alpha = (fast_alpha_t*)malloc(ntypes2*sizeof(fast_alpha_t)); for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) { fast_alpha_t& a = fast_alpha[i*ntypes+j]; @@ -117,7 +117,7 @@ void PairLJCharmmCoulLongOpt::eval() a.lj3 = lj3[i+1][j+1]; a.lj4 = lj4[i+1][j+1]; } - fast_alpha_t* _noalias tabsix = fast_alpha; + auto * _noalias tabsix = fast_alpha; // loop over neighbors of my atoms @@ -135,7 +135,7 @@ void PairLJCharmmCoulLongOpt::eval() double tmpfy = 0.0; double tmpfz = 0.0; - fast_alpha_t* _noalias tabsixi = (fast_alpha_t*) &tabsix[itype*ntypes]; + auto * _noalias tabsixi = (fast_alpha_t*) &tabsix[itype*ntypes]; for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; diff --git a/src/OPT/pair_lj_cut_opt.cpp b/src/OPT/pair_lj_cut_opt.cpp index f272e6fc78..9fbddd492a 100644 --- a/src/OPT/pair_lj_cut_opt.cpp +++ b/src/OPT/pair_lj_cut_opt.cpp @@ -78,13 +78,13 @@ void PairLJCutOpt::eval() int** _noalias firstneigh = list->firstneigh; int* _noalias numneigh = list->numneigh; - vec3_t* _noalias xx = (vec3_t*)x[0]; - vec3_t* _noalias ff = (vec3_t*)f[0]; + auto * _noalias xx = (vec3_t*)x[0]; + auto * _noalias ff = (vec3_t*)f[0]; int ntypes = atom->ntypes; int ntypes2 = ntypes*ntypes; - fast_alpha_t* _noalias fast_alpha = + auto * _noalias fast_alpha = (fast_alpha_t*) malloc(ntypes2*sizeof(fast_alpha_t)); for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) { fast_alpha_t& a = fast_alpha[i*ntypes+j]; @@ -95,7 +95,7 @@ void PairLJCutOpt::eval() a.lj4 = lj4[i+1][j+1]; a.offset = offset[i+1][j+1]; } - fast_alpha_t* _noalias tabsix = fast_alpha; + auto * _noalias tabsix = fast_alpha; // loop over neighbors of my atoms @@ -112,7 +112,7 @@ void PairLJCutOpt::eval() double tmpfy = 0.0; double tmpfz = 0.0; - fast_alpha_t* _noalias tabsixi = (fast_alpha_t*)&tabsix[itype*ntypes]; + auto * _noalias tabsixi = (fast_alpha_t*)&tabsix[itype*ntypes]; for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; diff --git a/src/OPT/pair_morse_opt.cpp b/src/OPT/pair_morse_opt.cpp index 04aace0d43..2c256073a2 100644 --- a/src/OPT/pair_morse_opt.cpp +++ b/src/OPT/pair_morse_opt.cpp @@ -79,13 +79,13 @@ void PairMorseOpt::eval() int** _noalias firstneigh = list->firstneigh; int* _noalias numneigh = list->numneigh; - vec3_t* _noalias xx = (vec3_t*)x[0]; - vec3_t* _noalias ff = (vec3_t*)f[0]; + auto * _noalias xx = (vec3_t*)x[0]; + auto * _noalias ff = (vec3_t*)f[0]; int ntypes = atom->ntypes; int ntypes2 = ntypes*ntypes; - fast_alpha_t* _noalias fast_alpha = + auto * _noalias fast_alpha = (fast_alpha_t*) malloc(ntypes2*sizeof(fast_alpha_t)); for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) { fast_alpha_t& a = fast_alpha[i*ntypes+j]; @@ -96,7 +96,7 @@ void PairMorseOpt::eval() a.d0 = d0[i+1][j+1]; a.offset = offset[i+1][j+1]; } - fast_alpha_t* _noalias tabsix = fast_alpha; + auto * _noalias tabsix = fast_alpha; // loop over neighbors of my atoms @@ -113,7 +113,7 @@ void PairMorseOpt::eval() double tmpfy = 0.0; double tmpfz = 0.0; - fast_alpha_t* _noalias tabsixi = (fast_alpha_t*)&tabsix[itype*ntypes]; + auto * _noalias tabsixi = (fast_alpha_t*)&tabsix[itype*ntypes]; for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; diff --git a/src/OPT/pair_ufm_opt.cpp b/src/OPT/pair_ufm_opt.cpp index 3502dfda6c..6809420f8a 100644 --- a/src/OPT/pair_ufm_opt.cpp +++ b/src/OPT/pair_ufm_opt.cpp @@ -78,13 +78,13 @@ void PairUFMOpt::eval() int** _noalias firstneigh = list->firstneigh; int* _noalias numneigh = list->numneigh; - vec3_t* _noalias xx = (vec3_t*)x[0]; - vec3_t* _noalias ff = (vec3_t*)f[0]; + auto * _noalias xx = (vec3_t*)x[0]; + auto * _noalias ff = (vec3_t*)f[0]; int ntypes = atom->ntypes; int ntypes2 = ntypes*ntypes; - fast_alpha_t* _noalias fast_alpha = + auto * _noalias fast_alpha = (fast_alpha_t*) malloc(ntypes2*sizeof(fast_alpha_t)); for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) { fast_alpha_t& a = fast_alpha[i*ntypes+j]; @@ -95,7 +95,7 @@ void PairUFMOpt::eval() a.scale = scale[i+1][j+1]; a.offset = offset[i+1][j+1]; } - fast_alpha_t* _noalias tabsix = fast_alpha; + auto * _noalias tabsix = fast_alpha; // loop over neighbors of my atoms @@ -112,7 +112,7 @@ void PairUFMOpt::eval() double tmpfy = 0.0; double tmpfz = 0.0; - fast_alpha_t* _noalias tabsixi = (fast_alpha_t*)&tabsix[itype*ntypes]; + auto * _noalias tabsixi = (fast_alpha_t*)&tabsix[itype*ntypes]; for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; diff --git a/src/ORIENT/fix_orient_bcc.cpp b/src/ORIENT/fix_orient_bcc.cpp index 9449f5bcd8..919927ea07 100644 --- a/src/ORIENT/fix_orient_bcc.cpp +++ b/src/ORIENT/fix_orient_bcc.cpp @@ -201,7 +201,7 @@ int FixOrientBCC::setmask() void FixOrientBCC::init() { if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -224,9 +224,9 @@ void FixOrientBCC::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } @@ -566,8 +566,8 @@ void FixOrientBCC::find_best_ref(double *displs, int which_crystal, int FixOrientBCC::compare(const void *pi, const void *pj) { - FixOrientBCC::Sort *ineigh = (FixOrientBCC::Sort *) pi; - FixOrientBCC::Sort *jneigh = (FixOrientBCC::Sort *) pj; + auto ineigh = (FixOrientBCC::Sort *) pi; + auto jneigh = (FixOrientBCC::Sort *) pj; if (ineigh->rsq < jneigh->rsq) return -1; else if (ineigh->rsq > jneigh->rsq) return 1; diff --git a/src/ORIENT/fix_orient_eco.cpp b/src/ORIENT/fix_orient_eco.cpp index 6f633316cf..7c8ff1f6aa 100644 --- a/src/ORIENT/fix_orient_eco.cpp +++ b/src/ORIENT/fix_orient_eco.cpp @@ -176,7 +176,7 @@ void FixOrientECO::init() { MPI_Bcast(&inv_norm_fac, 1, MPI_DOUBLE, 0, world); if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels - 1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels - 1; if (respa_level >= 0) ilevel_respa = MIN(respa_level, ilevel_respa); } @@ -197,9 +197,9 @@ void FixOrientECO::setup(int vflag) { if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa, 0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/ORIENT/fix_orient_fcc.cpp b/src/ORIENT/fix_orient_fcc.cpp index d631ca9bd8..f64889d141 100644 --- a/src/ORIENT/fix_orient_fcc.cpp +++ b/src/ORIENT/fix_orient_fcc.cpp @@ -199,7 +199,7 @@ int FixOrientFCC::setmask() void FixOrientFCC::init() { if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -222,9 +222,9 @@ void FixOrientFCC::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } @@ -564,8 +564,8 @@ void FixOrientFCC::find_best_ref(double *displs, int which_crystal, int FixOrientFCC::compare(const void *pi, const void *pj) { - FixOrientFCC::Sort *ineigh = (FixOrientFCC::Sort *) pi; - FixOrientFCC::Sort *jneigh = (FixOrientFCC::Sort *) pj; + auto ineigh = (FixOrientFCC::Sort *) pi; + auto jneigh = (FixOrientFCC::Sort *) pj; if (ineigh->rsq < jneigh->rsq) return -1; else if (ineigh->rsq > jneigh->rsq) return 1; diff --git a/src/PERI/compute_damage_atom.cpp b/src/PERI/compute_damage_atom.cpp index 80aff909ae..1e08e534c6 100644 --- a/src/PERI/compute_damage_atom.cpp +++ b/src/PERI/compute_damage_atom.cpp @@ -60,7 +60,7 @@ void ComputeDamageAtom::init() auto fixes = modify->get_fix_by_style("PERI_NEIGH"); if (fixes.size() == 0) error->all(FLERR,"Compute damage/atom requires a peridynamic potential"); - else fix_peri_neigh = (FixPeriNeigh *)fixes.front(); + else fix_peri_neigh = dynamic_cast(fixes.front()); } /* ---------------------------------------------------------------------- */ diff --git a/src/PERI/compute_dilatation_atom.cpp b/src/PERI/compute_dilatation_atom.cpp index 7bf2679443..9d44602756 100644 --- a/src/PERI/compute_dilatation_atom.cpp +++ b/src/PERI/compute_dilatation_atom.cpp @@ -83,7 +83,7 @@ void ComputeDilatationAtom::compute_peratom() int tmp; auto anypair = force->pair_match("^peri",0); - double *theta = (double *)anypair->extract("theta",tmp); + auto theta = (double *)anypair->extract("theta",tmp); int *mask = atom->mask; int nlocal = atom->nlocal; diff --git a/src/PERI/compute_plasticity_atom.cpp b/src/PERI/compute_plasticity_atom.cpp index e22c8765b4..425f6379e0 100644 --- a/src/PERI/compute_plasticity_atom.cpp +++ b/src/PERI/compute_plasticity_atom.cpp @@ -66,7 +66,7 @@ void ComputePlasticityAtom::init() auto fixes = modify->get_fix_by_style("PERI_NEIGH"); if (fixes.size() == 0) error->all(FLERR,"Compute plasticity/atom requires a peridynamic potential"); - else fix_peri_neigh = (FixPeriNeigh *)fixes.front(); + else fix_peri_neigh = dynamic_cast(fixes.front()); } /* ---------------------------------------------------------------------- */ diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp index 1d1c0d1c5e..51b8adf741 100644 --- a/src/PERI/fix_peri_neigh.cpp +++ b/src/PERI/fix_peri_neigh.cpp @@ -561,7 +561,7 @@ void FixPeriNeigh::write_restart(FILE *fp) void FixPeriNeigh::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; first = static_cast (list[n++]); maxpartner = static_cast (list[n++]); diff --git a/src/PERI/pair_peri.cpp b/src/PERI/pair_peri.cpp index 4ed281489b..3ce8eeb08e 100644 --- a/src/PERI/pair_peri.cpp +++ b/src/PERI/pair_peri.cpp @@ -130,7 +130,7 @@ void PairPeri::init_style() // if first init, create Fix needed for storing fixed neighbors if (!fix_peri_neigh) - fix_peri_neigh = (FixPeriNeigh *) modify->add_fix("PERI_NEIGH all PERI_NEIGH"); + fix_peri_neigh = dynamic_cast( modify->add_fix("PERI_NEIGH all PERI_NEIGH")); neighbor->add_request(this); } diff --git a/src/PHONON/dynamical_matrix.cpp b/src/PHONON/dynamical_matrix.cpp index 57b82fbe64..3723a7a467 100644 --- a/src/PHONON/dynamical_matrix.cpp +++ b/src/PHONON/dynamical_matrix.cpp @@ -269,11 +269,11 @@ void DynamicalMatrix::calculateMatrix() double *m = atom->mass; double **f = atom->f; - double **dynmat = new double*[3]; + auto dynmat = new double*[3]; for (int i=0; i<3; i++) dynmat[i] = new double[dynlenb]; - double **fdynmat = new double*[3]; + auto fdynmat = new double*[3]; for (int i=0; i<3; i++) fdynmat[i] = new double[dynlenb]; @@ -427,8 +427,7 @@ void DynamicalMatrix::displace_atom(int local_idx, int direction, int magnitude) void DynamicalMatrix::update_force() { neighbor->ago = 0; - if ((modify->get_fix_by_id("package_intel")) ? true : false) - neighbor->decide(); + if (modify->get_fix_by_id("package_intel")) neighbor->decide(); force_clear(); int n_pre_force = modify->n_pre_force; int n_pre_reverse = modify->n_pre_reverse; @@ -575,7 +574,7 @@ void DynamicalMatrix::create_groupmap() bigint natoms = atom->natoms; int *recv = new int[comm->nprocs]; int *displs = new int[comm->nprocs]; - bigint *temp_groupmap = new bigint[natoms]; + auto temp_groupmap = new bigint[natoms]; //find number of local atoms in the group (final_gid) for (bigint i=1; i<=natoms; i++) { @@ -584,7 +583,7 @@ void DynamicalMatrix::create_groupmap() gid += 1; // gid at the end of loop is final_Gid } //create an array of length final_gid - bigint *sub_groupmap = new bigint[gid]; + auto sub_groupmap = new bigint[gid]; gid = 0; //create a map between global atom id and group atom id for each proc diff --git a/src/PHONON/fix_phonon.cpp b/src/PHONON/fix_phonon.cpp index 3da204f6b8..37361be26a 100644 --- a/src/PHONON/fix_phonon.cpp +++ b/src/PHONON/fix_phonon.cpp @@ -183,23 +183,22 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) if (me == 0) { flog = fopen(logfile, "w"); if (flog == nullptr) - error->one(FLERR,"Can not open output file {}: {}", - logfile,utils::getsyserror()); - fprintf(flog,"############################################################\n"); - fprintf(flog,"# group name of the atoms under study : %s\n", group->names[igroup]); - fprintf(flog,"# total number of atoms in the group : %d\n", ngroup); - fprintf(flog,"# dimension of the system : %d D\n", sysdim); - fprintf(flog,"# number of atoms per unit cell : %d\n", nucell); - fprintf(flog,"# dimension of the FFT mesh : %d x %d x %d\n", nx, ny, nz); - fprintf(flog,"# number of wait steps before measurement : " BIGINT_FORMAT "\n", waitsteps); - fprintf(flog,"# frequency of the measurement : %d\n", nevery); - fprintf(flog,"# output result after this many measurement: %d\n", nfreq); - fprintf(flog,"# number of processors used by this run : %d\n", nprocs); - fprintf(flog,"############################################################\n"); - fprintf(flog,"# mapping information between lattice indices and atom id\n"); - fprintf(flog,"# nx ny nz nucell\n"); - fprintf(flog,"%d %d %d %d\n", nx, ny, nz, nucell); - fprintf(flog,"# l1 l2 l3 k atom_id\n"); + error->one(FLERR,"Can not open output file {}: {}", logfile,utils::getsyserror()); + fmt::print(flog,"############################################################\n"); + fmt::print(flog,"# group name of the atoms under study : {}\n", group->names[igroup]); + fmt::print(flog,"# total number of atoms in the group : {}\n", ngroup); + fmt::print(flog,"# dimension of the system : {} D\n", sysdim); + fmt::print(flog,"# number of atoms per unit cell : {}\n", nucell); + fmt::print(flog,"# dimension of the FFT mesh : {} x {} x {}\n", nx, ny, nz); + fmt::print(flog,"# number of wait steps before measurement : {}\n", waitsteps); + fmt::print(flog,"# frequency of the measurement : {}\n", nevery); + fmt::print(flog,"# output result after this many measurement: {}\n", nfreq); + fmt::print(flog,"# number of processors used by this run : {}\n", nprocs); + fmt::print(flog,"############################################################\n"); + fmt::print(flog,"# mapping information between lattice indices and atom id\n"); + fmt::print(flog,"# nx ny nz nucell\n"); + fmt::print(flog,"{} {} {} {}\n", nx, ny, nz, nucell); + fmt::print(flog,"# l1 l2 l3 k atom_id\n"); int ix, iy, iz, iu; for (idx = 0; idx < ngroup; ++idx) { itag = surf2tag[idx]; @@ -207,9 +206,9 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) iz = (idx/nucell)%nz; iy = (idx/(nucell*nz))%ny; ix = (idx/(nucell*nz*ny))%nx; - fprintf(flog,"%d %d %d %d " TAGINT_FORMAT "\n", ix, iy, iz, iu, itag); + fmt::print(flog,"{} {} {} {} {}\n", ix, iy, iz, iu, itag); } - fprintf(flog,"############################################################\n"); + fmt::print(flog,"############################################################\n"); fflush(flog); } surf2tag.clear(); @@ -672,7 +671,7 @@ void FixPhonon::postprocess( ) // to get Phi = KT.G^-1; normalization of FFTW data is done here double boltz = force->boltz, TempAve = 0.; - double *kbtsqrt = new double[sysdim]; + auto kbtsqrt = new double[sysdim]; double TempFac = inv_neval * inv_nTemp; double NormFac = TempFac * double(ntotal); @@ -696,7 +695,7 @@ void FixPhonon::postprocess( ) MPI_Gatherv(Phi_q[0],mynq*fft_dim2*2,MPI_DOUBLE,Phi_all[0],recvcnts,displs,MPI_DOUBLE,0,world); // to collect all basis info and averaged it on root - double *basis_root = new double[fft_dim]; + auto basis_root = new double[fft_dim]; if (fft_dim > sysdim) MPI_Reduce(&basis[1][0], &basis_root[sysdim], fft_dim-sysdim, MPI_DOUBLE, MPI_SUM, 0, world); if (me == 0) { // output dynamic matrix by root @@ -737,16 +736,16 @@ void FixPhonon::postprocess( ) fclose(fp_bin); // write log file, here however, it is the dynamical matrix that is written - fprintf(flog,"############################################################\n"); - fprintf(flog,"# Current time step : " BIGINT_FORMAT "\n", update->ntimestep); - fprintf(flog,"# Total number of measurements : %d\n", neval); - fprintf(flog,"# Average temperature of the measurement : %lg\n", TempAve); - fprintf(flog,"# Boltzmann constant under current units : %lg\n", boltz); - fprintf(flog,"# basis vector A1 = [%lg %lg %lg]\n", basevec[0], basevec[1], basevec[2]); - fprintf(flog,"# basis vector A2 = [%lg %lg %lg]\n", basevec[3], basevec[4], basevec[5]); - fprintf(flog,"# basis vector A3 = [%lg %lg %lg]\n", basevec[6], basevec[7], basevec[8]); - fprintf(flog,"############################################################\n"); - fprintf(flog,"# qx\t qy \t qz \t\t Phi(q)\n"); + fmt::print(flog,"############################################################\n"); + fmt::print(flog,"# Current time step : {}\n", update->ntimestep); + fmt::print(flog,"# Total number of measurements : {}\n", neval); + fmt::print(flog,"# Average temperature of the measurement : {}\n", TempAve); + fmt::print(flog,"# Boltzmann constant under current units : {}\n", boltz); + fmt::print(flog,"# basis vector A1 = [{} {} {}]\n", basevec[0], basevec[1], basevec[2]); + fmt::print(flog,"# basis vector A2 = [{} {} {}]\n", basevec[3], basevec[4], basevec[5]); + fmt::print(flog,"# basis vector A3 = [{} {} {}]\n", basevec[6], basevec[7], basevec[8]); + fmt::print(flog,"############################################################\n"); + fmt::print(flog,"# qx\t qy \t qz \t\t Phi(q)\n"); EnforceASR(); @@ -754,7 +753,8 @@ void FixPhonon::postprocess( ) for (idq = 0; idq < ntotal; ++idq) { ndim =0; for (idim = 0; idim < fft_dim; ++idim) - for (jdim = 0; jdim < fft_dim; ++jdim) Phi_all[idq][ndim++] *= M_inv_sqrt[idim/sysdim]*M_inv_sqrt[jdim/sysdim]; + for (jdim = 0; jdim < fft_dim; ++jdim) + Phi_all[idq][ndim++] *= M_inv_sqrt[idim/sysdim]*M_inv_sqrt[jdim/sysdim]; } idq =0; @@ -764,11 +764,10 @@ void FixPhonon::postprocess( ) double qy = double(iy)/double(ny); for (int iz = 0; iz < nz; ++iz) { double qz = double(iz)/double(nz); - fprintf(flog,"%lg %lg %lg", qx, qy, qz); + fmt::print(flog,"{} {} {}", qx, qy, qz); for (idim = 0; idim < fft_dim2; ++idim) - fprintf(flog, " %lg %lg", std::real(Phi_all[idq][idim]), - std::imag(Phi_all[idq][idim])); - fprintf(flog, "\n"); + fmt::print(flog, " {} {}", std::real(Phi_all[idq][idim]), std::imag(Phi_all[idq][idim])); + fmt::print(flog, "\n"); ++idq; } } diff --git a/src/PHONON/third_order.cpp b/src/PHONON/third_order.cpp index 3bcff07ea7..76d90c65bd 100644 --- a/src/PHONON/third_order.cpp +++ b/src/PHONON/third_order.cpp @@ -164,8 +164,8 @@ void ThirdOrder::command(int narg, char **arg) folded = 0; // set Neigborlist attributes to NULL - ijnum = NULL; - neighbortags = NULL; + ijnum = nullptr; + neighbortags = nullptr; // read options from end of input line if (style == REGULAR) options(narg-3,&arg[3]); @@ -287,8 +287,8 @@ void ThirdOrder::calculateMatrix() bigint j; bigint *firstneigh; - double *dynmat = new double[dynlenb]; - double *fdynmat = new double[dynlenb]; + auto dynmat = new double[dynlenb]; + auto fdynmat = new double[dynlenb]; memset(&dynmat[0],0,dynlenb*sizeof(double)); memset(&fdynmat[0],0,dynlenb*sizeof(double)); @@ -485,8 +485,7 @@ void ThirdOrder::displace_atom(int local_idx, int direction, int magnitude) void ThirdOrder::update_force() { neighbor->ago = 0; - if ((modify->get_fix_by_id("package_intel")) ? true : false) - neighbor->decide(); + if (modify->get_fix_by_id("package_intel")) neighbor->decide(); force_clear(); int n_post_force = modify->n_post_force; int n_pre_force = modify->n_pre_force; @@ -620,7 +619,7 @@ void ThirdOrder::create_groupmap() bigint natoms = atom->natoms; int *recv = new int[comm->nprocs]; int *displs = new int[comm->nprocs]; - bigint *temp_groupmap = new bigint[natoms]; + auto temp_groupmap = new bigint[natoms]; //find number of local atoms in the group (final_gid) for (bigint i=1; i<=natoms; i++) { @@ -629,7 +628,7 @@ void ThirdOrder::create_groupmap() gid += 1; // gid at the end of loop is final_Gid } //create an array of length final_gid - bigint *sub_groupmap = new bigint[gid]; + auto sub_groupmap = new bigint[gid]; gid = 0; //create a map between global atom id and group atom id for each proc @@ -717,8 +716,8 @@ void ThirdOrder::getNeighbortags() { } bigint nbytes = ((bigint) sizeof(bigint)) * sum; - bigint *data = (bigint *) memory->smalloc(nbytes, "thirdorder:firsttags"); - bigint *datarecv = (bigint *) memory->smalloc(nbytes, "thirdorder:neighbortags"); + auto data = (bigint *) memory->smalloc(nbytes, "thirdorder:firsttags"); + auto datarecv = (bigint *) memory->smalloc(nbytes, "thirdorder:neighbortags"); nbytes = ((bigint) sizeof(bigint *)) * natoms; firsttags = (bigint **) memory->smalloc(nbytes, "thirdorder:firsttags"); neighbortags = (bigint **) memory->smalloc(nbytes, "thirdorder:neighbortags"); diff --git a/src/PLUGIN/plugin.cpp b/src/PLUGIN/plugin.cpp index 3b28a32dbf..f8dfb8af22 100644 --- a/src/PLUGIN/plugin.cpp +++ b/src/PLUGIN/plugin.cpp @@ -135,7 +135,7 @@ int plugin_load(const char *file, LAMMPS *lmp) void plugin_register(lammpsplugin_t *plugin, void *ptr) { #if defined(LMP_PLUGIN) - LAMMPS *lmp = (LAMMPS *) ptr; + auto lmp = (LAMMPS *) ptr; int me = lmp->comm->me; if (plugin == nullptr) return; @@ -208,6 +208,14 @@ void plugin_register(lammpsplugin_t *plugin, void *ptr) } (*improper_map)[plugin->name] = (Force::ImproperCreator) plugin->creator.v1; + } else if (pstyle == "kspace") { + auto kspace_map = lmp->force->kspace_map; + if (kspace_map->find(plugin->name) != kspace_map->end()) { + if (lmp->comm->me == 0) + lmp->error->warning(FLERR, "Overriding built-in kspace style {} from plugin", plugin->name); + } + (*kspace_map)[plugin->name] = (Force::KSpaceCreator) plugin->creator.v1; + } else if (pstyle == "compute") { auto compute_map = lmp->modify->compute_map; if (compute_map->find(plugin->name) != compute_map->end()) { @@ -263,9 +271,9 @@ void plugin_unload(const char *style, const char *name, LAMMPS *lmp) // ignore unload request from unsupported style categories if ((strcmp(style, "pair") != 0) && (strcmp(style, "bond") != 0) && (strcmp(style, "angle") != 0) && (strcmp(style, "dihedral") != 0) && - (strcmp(style, "improper") != 0) && (strcmp(style, "compute") != 0) && - (strcmp(style, "fix") != 0) && (strcmp(style, "region") != 0) && - (strcmp(style, "command") != 0)) { + (strcmp(style, "improper") != 0) && (strcmp(style, "kspace") != 0) && + (strcmp(style, "compute") != 0) && (strcmp(style, "fix") != 0) && + (strcmp(style, "region") != 0) && (strcmp(style, "command") != 0)) { if (me == 0) utils::logmesg(lmp, "Ignoring unload: {} is not a supported plugin style\n", style); return; @@ -347,6 +355,12 @@ void plugin_unload(const char *style, const char *name, LAMMPS *lmp) if ((lmp->force->improper_style != nullptr) && (lmp->force->improper_match(name) != nullptr)) lmp->force->create_improper("none", 0); + } else if (pstyle == "kspace") { + + auto kspace_map = lmp->force->kspace_map; + auto found = kspace_map->find(name); + if (found != kspace_map->end()) kspace_map->erase(name); + } else if (pstyle == "compute") { auto compute_map = lmp->modify->compute_map; diff --git a/src/PLUMED/fix_plumed.cpp b/src/PLUMED/fix_plumed.cpp index dcf82a4374..85bf2df3bc 100644 --- a/src/PLUMED/fix_plumed.cpp +++ b/src/PLUMED/fix_plumed.cpp @@ -321,9 +321,9 @@ void FixPlumed::post_force(int /* vflag */) if (nlocal != atom->nlocal) { - if (charges) delete [] charges; - if (masses) delete [] masses; - if (gatindex) delete [] gatindex; + delete[] charges; + delete[] masses; + delete[] gatindex; nlocal=atom->nlocal; gatindex=new int [nlocal]; diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index d2df9b0159..7ac3570f2f 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -356,7 +356,9 @@ void FixPOEMS::init() for (auto ifix : modify->get_fix_list()) { if (utils::strmatch(ifix->style, "^poems")) pflag = true; if (pflag && (ifix->setmask() & POST_FORCE) && !ifix->rigid_flag) - if (comm->me == 0) error->warning(FLERR, "Fix {} alters forces after fix poems", ifix->id); + if (comm->me == 0) + error->warning(FLERR,"Fix {} with ID {} alters forces after fix poems", + ifix->style, ifix->id); } } diff --git a/src/PTM/compute_ptm_atom.cpp b/src/PTM/compute_ptm_atom.cpp index e024d45012..10341d3cd0 100644 --- a/src/PTM/compute_ptm_atom.cpp +++ b/src/PTM/compute_ptm_atom.cpp @@ -126,7 +126,7 @@ ComputePTMAtom::ComputePTMAtom(LAMMPS *lmp, int narg, char **arg) if (rmsd_threshold == 0) rmsd_threshold = INFINITY; - char* group_name = (char *)"all"; + auto group_name = (char *)"all"; if (narg > 5) { group_name = arg[5]; } @@ -192,7 +192,7 @@ static bool sorthelper_compare(ptmnbr_t const &a, ptmnbr_t const &b) { static int get_neighbours(void* vdata, size_t central_index, size_t atom_index, int num, size_t* nbr_indices, int32_t* numbers, double (*nbr_pos)[3]) { - ptmnbrdata_t* data = (ptmnbrdata_t*)vdata; + auto data = (ptmnbrdata_t*)vdata; int *mask = data->mask; int group2bit = data->group2bit; diff --git a/src/PTM/ptm_neighbour_ordering.cpp b/src/PTM/ptm_neighbour_ordering.cpp index cae938a7bb..bc95c33cb0 100644 --- a/src/PTM/ptm_neighbour_ordering.cpp +++ b/src/PTM/ptm_neighbour_ordering.cpp @@ -179,7 +179,7 @@ static int _calculate_neighbour_ordering(void* _voronoi_handle, int num_points, { assert(num_points <= PTM_MAX_INPUT_POINTS); - ptm_voro::voronoicell_neighbor* voronoi_handle = (ptm_voro::voronoicell_neighbor*)_voronoi_handle; + auto voronoi_handle = (ptm_voro::voronoicell_neighbor*)_voronoi_handle; double max_norm = 0; double points[PTM_MAX_INPUT_POINTS][3]; @@ -277,13 +277,13 @@ static int find_diamond_neighbours(void* _voronoi_handle, int num_points, double void* voronoi_initialize_local() { - ptm_voro::voronoicell_neighbor* ptr = new ptm_voro::voronoicell_neighbor; + auto ptr = new ptm_voro::voronoicell_neighbor; return (void*)ptr; } void voronoi_uninitialize_local(void* _ptr) { - ptm_voro::voronoicell_neighbor* ptr = (ptm_voro::voronoicell_neighbor*)_ptr; + auto ptr = (ptm_voro::voronoicell_neighbor*)_ptr; delete ptr; } diff --git a/src/PYTHON/pair_python.cpp b/src/PYTHON/pair_python.cpp index 43b6f9ea6c..9bf7066a0d 100644 --- a/src/PYTHON/pair_python.cpp +++ b/src/PYTHON/pair_python.cpp @@ -106,7 +106,7 @@ void PairPython::compute(int eflag, int vflag) // prepare access to compute_force and compute_energy functions PyUtils::GIL lock; - PyObject *py_pair_instance = (PyObject *) py_potential; + auto py_pair_instance = (PyObject *) py_potential; PyObject *py_compute_force = PyObject_GetAttrString(py_pair_instance,"compute_force"); if (!py_compute_force) { PyUtils::Print_Errors(); @@ -347,8 +347,8 @@ double PairPython::single(int /* i */, int /* j */, int itype, int jtype, // prepare access to compute_force and compute_energy functions PyUtils::GIL lock; - PyObject *py_compute_force = (PyObject *) get_member_function("compute_force"); - PyObject *py_compute_energy = (PyObject *) get_member_function("compute_energy"); + auto py_compute_force = (PyObject *) get_member_function("compute_force"); + auto py_compute_energy = (PyObject *) get_member_function("compute_energy"); PyObject *py_compute_args = Py_BuildValue("(dii)", rsq, itype, jtype); if (!py_compute_args) { @@ -383,7 +383,7 @@ double PairPython::single(int /* i */, int /* j */, int itype, int jtype, void * PairPython::get_member_function(const char * name) { PyUtils::GIL lock; - PyObject *py_pair_instance = (PyObject *) py_potential; + auto py_pair_instance = (PyObject *) py_potential; PyObject * py_mfunc = PyObject_GetAttrString(py_pair_instance, name); if (!py_mfunc) { PyUtils::Print_Errors(); diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index bc593d5b8a..5a7098814b 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -238,7 +238,7 @@ void PythonImpl::command(int narg, char **arg) // pFunc = function object for requested function - PyObject *pModule = (PyObject *) pyMain; + auto pModule = (PyObject *) pyMain; PyObject *pFunc = PyObject_GetAttrString(pModule, pfuncs[ifunc].name); if (!pFunc) { @@ -268,7 +268,7 @@ void PythonImpl::invoke_function(int ifunc, char *result) PyObject *pValue; char *str; - PyObject *pFunc = (PyObject *) pfuncs[ifunc].pFunc; + auto pFunc = (PyObject *) pfuncs[ifunc].pFunc; // create Python tuple of input arguments diff --git a/src/Purge.list b/src/Purge.list index 6753476ec5..a2fa9f1165 100644 --- a/src/Purge.list +++ b/src/Purge.list @@ -51,6 +51,17 @@ lmpinstalledpkgs.h lmpgitversion.h mliap_model_python_couple.cpp mliap_model_python_couple.h +# removed on 8 April 2022 +fix_client_md.cpp +fix_client_md.h +message.cpp +message.h +server.cpp +server.h +server_mc.cpp +server_mc.h +server_md.cpp +server_md.h # removed on 8 March 2022 fix_peri_neigh_omp.cpp fix_peri_neigh_omp.h diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index 20b7b90eee..b586ecb9d9 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -308,7 +308,7 @@ void FixQEq::init() error->warning(FLERR,"Fix efield is ignored during charge equilibration"); if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; // compute net charge and print warning if too large diff --git a/src/QEQ/fix_qeq_fire.cpp b/src/QEQ/fix_qeq_fire.cpp index 219106b702..d4dc68ace2 100644 --- a/src/QEQ/fix_qeq_fire.cpp +++ b/src/QEQ/fix_qeq_fire.cpp @@ -81,8 +81,8 @@ void FixQEqFire::init() if (comm->me == 0) error->warning(FLERR,"Fix qeq/fire tolerance may be too small for damped fires"); - comb3 = (PairComb3 *) force->pair_match("^comb3",0); - if (!comb3) comb = (PairComb *) force->pair_match("^comb",0); + comb3 = dynamic_cast( force->pair_match("^comb3",0)); + if (!comb3) comb = dynamic_cast( force->pair_match("^comb",0)); } /* ---------------------------------------------------------------------- */ diff --git a/src/QMMM/fix_qmmm.cpp b/src/QMMM/fix_qmmm.cpp index 8c59077c7d..df1a45ebcb 100644 --- a/src/QMMM/fix_qmmm.cpp +++ b/src/QMMM/fix_qmmm.cpp @@ -443,10 +443,7 @@ void FixQMMM::exchange_positions() MPI_Send(isend_buf, 4, MPI_INT, 1, QMMM_TAG_SIZE, qm_comm); MPI_Send(celldata, 9, MPI_DOUBLE, 1, QMMM_TAG_CELL, qm_comm); } - if (verbose > 0) { - if (screen) fputs("QMMM: exchange positions\n",screen); - if (logfile) fputs("QMMM: exchange positions\n",logfile); - } + if (verbose > 0) utils::logmesg(lmp, "QMMM: exchange positions\n"); } if (qmmm_role == QMMM_ROLE_MASTER) { @@ -537,10 +534,7 @@ void FixQMMM::exchange_forces() const int nlocal = atom->nlocal; const int natoms = (int) atom->natoms; - if ((comm->me) == 0 && (verbose > 0)) { - if (screen) fputs("QMMM: exchange forces\n",screen); - if (logfile) fputs("QMMM: exchange forces\n",logfile); - } + if ((comm->me) == 0 && (verbose > 0)) utils::logmesg(lmp, "QMMM: exchange forces\n"); if (qmmm_role == QMMM_ROLE_MASTER) { struct commdata *buf = static_cast(comm_buf); @@ -561,21 +555,14 @@ void FixQMMM::exchange_forces() // so we need to apply the scaling factor to get to the // supported internal units ("metal" or "real") for (int i=0; i < num_qm; ++i) { - if (verbose > 1) { - const char fmt[] = "[" TAGINT_FORMAT "]: QM(%g %g %g) MM(%g %g %g) /\\(%g %g %g)\n"; - if (screen) fprintf(screen, fmt, qm_remap[i], - qmmm_fscale*qm_force[3*i+0], qmmm_fscale*qm_force[3*i+1], qmmm_fscale*qm_force[3*i+2], - mm_force_on_qm_atoms[3*i+0], mm_force_on_qm_atoms[3*i+1], mm_force_on_qm_atoms[3*i+2], - qmmm_fscale*qm_force[3*i+0] - mm_force_on_qm_atoms[3*i+0], - qmmm_fscale*qm_force[3*i+1] - mm_force_on_qm_atoms[3*i+1], - qmmm_fscale*qm_force[3*i+2] - mm_force_on_qm_atoms[3*i+2]); - if (logfile) fprintf(logfile, fmt, qm_remap[i], - qmmm_fscale*qm_force[3*i+0], qmmm_fscale*qm_force[3*i+1], qmmm_fscale*qm_force[3*i+2], - mm_force_on_qm_atoms[3*i+0], mm_force_on_qm_atoms[3*i+1], mm_force_on_qm_atoms[3*i+2], - qmmm_fscale*qm_force[3*i+0] - mm_force_on_qm_atoms[3*i+0], - qmmm_fscale*qm_force[3*i+1] - mm_force_on_qm_atoms[3*i+1], - qmmm_fscale*qm_force[3*i+2] - mm_force_on_qm_atoms[3*i+2]); - } + if (verbose > 1) + utils::logmesg(lmp, "[{}]: QM({} {} {}) MM({} {} {}) /\\({} {} {})\n", qm_remap[i], + qmmm_fscale*qm_force[3*i+0], qmmm_fscale*qm_force[3*i+1], qmmm_fscale*qm_force[3*i+2], + mm_force_on_qm_atoms[3*i+0], mm_force_on_qm_atoms[3*i+1], mm_force_on_qm_atoms[3*i+2], + qmmm_fscale*qm_force[3*i+0] - mm_force_on_qm_atoms[3*i+0], + qmmm_fscale*qm_force[3*i+1] - mm_force_on_qm_atoms[3*i+1], + qmmm_fscale*qm_force[3*i+2] - mm_force_on_qm_atoms[3*i+2]); + buf[i].tag = qm_remap[i]; buf[i].x = qmmm_fscale*qm_force[3*i+0] - mm_force_on_qm_atoms[3*i+0]; buf[i].y = qmmm_fscale*qm_force[3*i+1] - mm_force_on_qm_atoms[3*i+1]; @@ -684,21 +671,9 @@ void FixQMMM::init() memory->create(qm_charge,num_qm,"qmmm:qm_charge"); memory->create(qm_force,3*num_qm,"qmmm:qm_force"); - const char fmt1[] = "Initializing QM/MM master with %d QM atoms\n"; - const char fmt2[] = "Initializing QM/MM master with %d MM atoms\n"; - const char fmt3[] = "Electrostatic coupling with %d atoms\n"; - - if (screen) { - fprintf(screen,fmt1,num_qm); - fprintf(screen,fmt2,num_mm); - if (qmmm_mode == QMMM_MODE_ELEC) fprintf(screen,fmt3,num_mm-num_qm); - } - - if (logfile) { - fprintf(logfile,fmt1,num_qm); - fprintf(logfile,fmt2,num_mm); - if (qmmm_mode == QMMM_MODE_ELEC) fprintf(logfile,fmt3,num_mm-num_qm); - } + utils::logmesg(lmp, "Initializing QM/MM master with {} QM atoms\n", num_qm); + utils::logmesg(lmp, "Initializing QM/MM master with {} MM atoms\n", num_mm); + utils::logmesg(lmp, "Electrostatic coupling with {} atoms\n", num_mm-num_qm); } else if (qmmm_role == QMMM_ROLE_SLAVE) { @@ -711,11 +686,7 @@ void FixQMMM::init() memory->create(qm_coord,3*num_qm,"qmmm:qm_coord"); memory->create(qm_force,3*num_qm,"qmmm:qm_force"); - const char fmt[] = "Initializing QM/MM slave with %d QM atoms\n"; - - if (screen) fprintf(screen,fmt,num_qm); - if (logfile) fprintf(logfile,fmt,num_qm); - + utils::logmesg(lmp, "Initializing QM/MM slave with {} QM atoms\n",num_qm); } // communication buffer @@ -769,15 +740,10 @@ void FixQMMM::init() qm_remap=taginthash_keys(qm_hash); if (verbose > 1) { - const char fmt[] = "qm_remap[%d]=" TAGINT_FORMAT - " qm_hash[" TAGINT_FORMAT "]=" TAGINT_FORMAT "\n"; // print hashtable and reverse mapping - for (i=0; i < num_qm; ++i) { - if (screen) fprintf(screen,fmt,i,qm_remap[i],qm_remap[i], - taginthash_lookup(qm_hash, qm_remap[i])); - if (logfile) fprintf(logfile,fmt,i,qm_remap[i],qm_remap[i], - taginthash_lookup(qm_hash, qm_remap[i])); - } + for (i=0; i < num_qm; ++i) + utils::logmesg(lmp, "qm_remap[{}]={} qm_hash[{}]={}\n", + i,qm_remap[i],qm_remap[i],taginthash_lookup(qm_hash, qm_remap[i])); } } else { @@ -815,7 +781,7 @@ void FixQMMM::setup(int) /* ---------------------------------------------------------------------- */ -void FixQMMM::post_force(int vflag) +void FixQMMM::post_force(int /*vflag*/) { exchange_forces(); } diff --git a/src/QTB/fix_qbmsst.cpp b/src/QTB/fix_qbmsst.cpp index 88588f6c01..8ce7b616b1 100644 --- a/src/QTB/fix_qbmsst.cpp +++ b/src/QTB/fix_qbmsst.cpp @@ -846,7 +846,7 @@ void FixQBMSST::write_restart(FILE *fp) void FixQBMSST::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; omega[direction] = list[n++]; e0 = list[n++]; v0 = list[n++]; diff --git a/src/QTB/fix_qtb.cpp b/src/QTB/fix_qtb.cpp index ab82759e79..f9faf2475c 100644 --- a/src/QTB/fix_qtb.cpp +++ b/src/QTB/fix_qtb.cpp @@ -218,7 +218,7 @@ void FixQTB::init() // respa if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } /* ---------------------------------------------------------------------- @@ -229,9 +229,9 @@ void FixQTB::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/REACTION/fix_bond_react.cpp b/src/REACTION/fix_bond_react.cpp index dd56e96e81..c05ad4f8b3 100644 --- a/src/REACTION/fix_bond_react.cpp +++ b/src/REACTION/fix_bond_react.cpp @@ -24,6 +24,7 @@ Contributing Author: Jacob Gissinger (jacob.r.gissinger@gmail.com) #include "comm.h" #include "domain.h" #include "error.h" +#include "fix_bond_history.h" #include "force.h" #include "group.h" #include "input.h" @@ -792,7 +793,7 @@ void FixBondReact::init() { if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; // check cutoff for iatomtype,jatomtype for (int i = 0; i < nreacts; i++) { @@ -3093,6 +3094,10 @@ void FixBondReact::update_everything() // next let's update bond info // cool thing is, newton_bond issues are already taken care of in templates // same with class2 improper issues, which is why this fix started in the first place + // also need to find any instances of bond history to update histories + auto histories = modify->get_fix_by_style("BOND_HISTORY"); + int n_histories = histories.size(); + for (int i = 0; i < update_num_mega; i++) { rxnID = update_mega_glove[0][i]; twomol = atom->molecules[reacted_mol[rxnID]]; @@ -3102,6 +3107,14 @@ void FixBondReact::update_everything() if (atom->map(update_mega_glove[jj+1][i]) < nlocal && atom->map(update_mega_glove[jj+1][i]) >= 0) { if (landlocked_atoms[j][rxnID] == 1) { delta_bonds -= num_bond[atom->map(update_mega_glove[jj+1][i])]; + // If deleting all bonds, first cache then remove all histories + if (n_histories > 0) + for (auto &ihistory: histories) { + for (int n = 0; n < num_bond[atom->map(update_mega_glove[jj+1][i])]; n++) + dynamic_cast(ihistory)->cache_history(atom->map(update_mega_glove[jj+1][i]), n); + for (int n = 0; n < num_bond[atom->map(update_mega_glove[jj+1][i])]; n++) + dynamic_cast(ihistory)->delete_history(atom->map(update_mega_glove[jj+1][i]), 0); + } num_bond[atom->map(update_mega_glove[jj+1][i])] = 0; } if (landlocked_atoms[j][rxnID] == 0) { @@ -3109,10 +3122,21 @@ void FixBondReact::update_everything() for (int n = 0; n < twomol->natoms; n++) { int nn = equivalences[n][1][rxnID]-1; if (n!=j && bond_atom[atom->map(update_mega_glove[jj+1][i])][p] == update_mega_glove[nn+1][i] && landlocked_atoms[n][rxnID] == 1) { + // Cache history information, shift history, then delete final element + if (n_histories > 0) + for (auto &ihistory: histories) + dynamic_cast(ihistory)->cache_history(atom->map(update_mega_glove[jj+1][i]), p); for (int m = p; m < num_bond[atom->map(update_mega_glove[jj+1][i])]-1; m++) { bond_type[atom->map(update_mega_glove[jj+1][i])][m] = bond_type[atom->map(update_mega_glove[jj+1][i])][m+1]; bond_atom[atom->map(update_mega_glove[jj+1][i])][m] = bond_atom[atom->map(update_mega_glove[jj+1][i])][m+1]; + if (n_histories > 0) + for (auto &ihistory: histories) + dynamic_cast(ihistory)->shift_history(atom->map(update_mega_glove[jj+1][i]),m,m+1); } + if (n_histories > 0) + for (auto &ihistory: histories) + dynamic_cast(ihistory)->delete_history(atom->map(update_mega_glove[jj+1][i]), + num_bond[atom->map(update_mega_glove[jj+1][i])]-1); num_bond[atom->map(update_mega_glove[jj+1][i])]--; delta_bonds--; } @@ -3131,6 +3155,10 @@ void FixBondReact::update_everything() for (int p = 0; p < twomol->num_bond[j]; p++) { bond_type[atom->map(update_mega_glove[jj+1][i])][p] = twomol->bond_type[j][p]; bond_atom[atom->map(update_mega_glove[jj+1][i])][p] = update_mega_glove[equivalences[twomol->bond_atom[j][p]-1][1][rxnID]][i]; + // Check cached history data to see if bond regenerated + if (n_histories > 0) + for (auto &ihistory: histories) + dynamic_cast(ihistory)->check_cache(atom->map(update_mega_glove[jj+1][i]), p); } } if (landlocked_atoms[j][rxnID] == 0) { @@ -3139,6 +3167,10 @@ void FixBondReact::update_everything() insert_num = num_bond[atom->map(update_mega_glove[jj+1][i])]; bond_type[atom->map(update_mega_glove[jj+1][i])][insert_num] = twomol->bond_type[j][p]; bond_atom[atom->map(update_mega_glove[jj+1][i])][insert_num] = update_mega_glove[equivalences[twomol->bond_atom[j][p]-1][1][rxnID]][i]; + // Check cached history data to see if bond regenerated + if (n_histories > 0) + for (auto &ihistory: histories) + dynamic_cast(ihistory)->check_cache(atom->map(update_mega_glove[jj+1][i]), insert_num); num_bond[atom->map(update_mega_glove[jj+1][i])]++; if (num_bond[atom->map(update_mega_glove[jj+1][i])] > atom->bond_per_atom) error->one(FLERR,"Bond/react topology/atom exceed system topology/atom"); @@ -3150,6 +3182,10 @@ void FixBondReact::update_everything() } } + if (n_histories > 0) + for (auto &ihistory: histories) + dynamic_cast(ihistory)->clear_cache(); + // Angles! First let's delete all angle info: if (force->angle && twomol->angleflag) { int *num_angle = atom->num_angle; @@ -3938,7 +3974,7 @@ void FixBondReact::ReadConstraints(char *line, int myrxn) double tmp[MAXCONARGS]; char **strargs,*ptr,*lptr; memory->create(strargs,MAXCONARGS,MAXLINE,"bond/react:strargs"); - char *constraint_type = new char[MAXLINE]; + auto constraint_type = new char[MAXLINE]; strcpy(constraintstr[myrxn],"("); // string for boolean constraint logic for (int i = 0; i < nconstraints[myrxn]; i++) { readline(line); diff --git a/src/REAXFF/compute_spec_atom.cpp b/src/REAXFF/compute_spec_atom.cpp index 66886cd1e2..1df4ae559b 100644 --- a/src/REAXFF/compute_spec_atom.cpp +++ b/src/REAXFF/compute_spec_atom.cpp @@ -40,7 +40,7 @@ ComputeSpecAtom::ComputeSpecAtom(LAMMPS *lmp, int narg, char **arg) : else size_peratom_cols = nvalues; // get reference to ReaxFF pair style - reaxff = (PairReaxFF *) force->pair_match("^reax..",0); + reaxff = dynamic_cast( force->pair_match("^reax..",0)); pack_choice = new FnPtrPack[nvalues]; diff --git a/src/REAXFF/fix_acks2_reaxff.cpp b/src/REAXFF/fix_acks2_reaxff.cpp index c3457d1712..bd93dec0b7 100644 --- a/src/REAXFF/fix_acks2_reaxff.cpp +++ b/src/REAXFF/fix_acks2_reaxff.cpp @@ -134,7 +134,7 @@ void FixACKS2ReaxFF::pertype_parameters(char *arg) eta = (double *) pair->extract("eta",tmp); gamma = (double *) pair->extract("gamma",tmp); bcut_acks2 = (double *) pair->extract("bcut_acks2",tmp); - double* bond_softness_ptr = (double *) pair->extract("bond_softness",tmp); + auto bond_softness_ptr = (double *) pair->extract("bond_softness",tmp); if (chi == nullptr || eta == nullptr || gamma == nullptr || bcut_acks2 == nullptr || bond_softness_ptr == nullptr) @@ -203,7 +203,8 @@ void FixACKS2ReaxFF::pertype_parameters(char *arg) void FixACKS2ReaxFF::allocate_storage() { nmax = atom->nmax; - int size = nmax*2 + 2; + NN = atom->nlocal + atom->nghost; + const int size = nmax*2 + 2; // 0 to nn-1: owned atoms related to H matrix // nn to NN-1: ghost atoms related to H matrix @@ -329,17 +330,15 @@ void FixACKS2ReaxFF::pre_force(int /*vflag*/) { if (update->ntimestep % nevery) return; - int n = atom->nlocal; + NN = atom->nlocal + atom->nghost; if (reaxff) { nn = reaxff->list->inum; - NN = reaxff->list->inum + reaxff->list->gnum; ilist = reaxff->list->ilist; numneigh = reaxff->list->numneigh; firstneigh = reaxff->list->firstneigh; } else { nn = list->inum; - NN = list->inum + list->gnum; ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; @@ -349,7 +348,7 @@ void FixACKS2ReaxFF::pre_force(int /*vflag*/) // need to be atom->nmax in length if (atom->nmax > nmax) reallocate_storage(); - if (n > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE) + if (atom->nlocal > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE) reallocate_matrix(); if (efield) get_chi_field(); @@ -626,8 +625,7 @@ void FixACKS2ReaxFF::sparse_matvec_acks2(sparse_matrix *H, sparse_matrix *X, dou } } - for (ii = nn; ii < NN; ++ii) { - i = ilist[ii]; + for (i = atom->nlocal; i < NN; ++i) { if (atom->mask[i] & groupbit) { b[i] = 0; b[NN + i] = 0; @@ -674,38 +672,34 @@ void FixACKS2ReaxFF::sparse_matvec_acks2(sparse_matrix *H, sparse_matrix *X, dou void FixACKS2ReaxFF::calculate_Q() { - int i, k; + pack_flag = 2; + comm->forward_comm(this); //Dist_vector(s); - for (int ii = 0; ii < nn; ++ii) { - i = ilist[ii]; + for (int i = 0; i < NN; ++i) { if (atom->mask[i] & groupbit) { - /* backup s */ - for (k = nprev-1; k > 0; --k) { - s_hist[i][k] = s_hist[i][k-1]; - s_hist_X[i][k] = s_hist_X[i][k-1]; + atom->q[i] = s[i]; + + if (i < atom->nlocal) { + + /* backup s */ + for (int k = nprev-1; k > 0; --k) { + s_hist[i][k] = s_hist[i][k-1]; + s_hist_X[i][k] = s_hist_X[i][k-1]; + } + s_hist[i][0] = s[i]; + s_hist_X[i][0] = s[NN+i]; } - s_hist[i][0] = s[i]; - s_hist_X[i][0] = s[NN+i]; } } // last two rows if (last_rows_flag) { for (int i = 0; i < 2; ++i) { - for (k = nprev-1; k > 0; --k) + for (int k = nprev-1; k > 0; --k) s_hist_last[i][k] = s_hist_last[i][k-1]; s_hist_last[i][0] = s[2*NN+i]; } } - - pack_flag = 2; - comm->forward_comm(this); //Dist_vector(s); - - for (int ii = 0; ii < NN; ++ii) { - i = ilist[ii]; - if (atom->mask[i] & groupbit) - atom->q[i] = s[i]; - } } /* ---------------------------------------------------------------------- */ diff --git a/src/REAXFF/fix_acks2_reaxff.h b/src/REAXFF/fix_acks2_reaxff.h index 2d21f80fe0..27ba196bbd 100644 --- a/src/REAXFF/fix_acks2_reaxff.h +++ b/src/REAXFF/fix_acks2_reaxff.h @@ -37,7 +37,7 @@ class FixACKS2ReaxFF : public FixQEqReaxFF { double *get_s() { return s; } protected: - int last_rows_rank, last_rows_flag; + int NN, last_rows_rank, last_rows_flag; double **s_hist_X, **s_hist_last; double *bcut_acks2, bond_softness, **bcut; // acks2 parameters diff --git a/src/REAXFF/fix_qeq_reaxff.cpp b/src/REAXFF/fix_qeq_reaxff.cpp index c2469ee9eb..4184607474 100644 --- a/src/REAXFF/fix_qeq_reaxff.cpp +++ b/src/REAXFF/fix_qeq_reaxff.cpp @@ -104,7 +104,7 @@ FixQEqReaxFF::FixQEqReaxFF(LAMMPS *lmp, int narg, char **arg) : shld = nullptr; nn = n_cap = 0; - NN = nmax = 0; + nmax = 0; m_fill = m_cap = 0; pack_flag = 0; s = nullptr; @@ -141,7 +141,7 @@ FixQEqReaxFF::FixQEqReaxFF(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - reaxff = (PairReaxFF *) force->pair_match("^reax..",0); + reaxff = dynamic_cast( force->pair_match("^reax..",0)); s_hist = t_hist = nullptr; atom->add_callback(Atom::GROW); @@ -319,7 +319,7 @@ void FixQEqReaxFF::reallocate_storage() void FixQEqReaxFF::allocate_matrix() { - int i,ii,n,m; + int i,ii,m; int mincap; double safezone; @@ -332,8 +332,7 @@ void FixQEqReaxFF::allocate_matrix() safezone = REAX_SAFE_ZONE; } - n = atom->nlocal; - n_cap = MAX((int)(n * safezone), mincap); + n_cap = MAX((int)(atom->nlocal * safezone), mincap); // determine the total space for the H matrix @@ -396,7 +395,7 @@ void FixQEqReaxFF::init() efield = nullptr; auto fixes = modify->get_fix_by_style("^efield"); - if (fixes.size() == 1) efield = (FixEfield *) fixes.front(); + if (fixes.size() == 1) efield = dynamic_cast( fixes.front()); else if (fixes.size() > 1) error->all(FLERR, "There may be only one fix efield instance used with fix {}", style); @@ -424,7 +423,7 @@ void FixQEqReaxFF::init() init_taper(); if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -493,13 +492,11 @@ void FixQEqReaxFF::setup_pre_force(int vflag) { if (reaxff) { nn = reaxff->list->inum; - NN = reaxff->list->inum + reaxff->list->gnum; ilist = reaxff->list->ilist; numneigh = reaxff->list->numneigh; firstneigh = reaxff->list->firstneigh; } else { nn = list->inum; - NN = list->inum + list->gnum; ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; @@ -537,7 +534,7 @@ void FixQEqReaxFF::init_storage() { if (efield) get_chi_field(); - for (int ii = 0; ii < NN; ii++) { + for (int ii = 0; ii < nn; ii++) { int i = ilist[ii]; if (atom->mask[i] & groupbit) { Hdia_inv[i] = 1. / eta[atom->type[i]]; @@ -561,13 +558,11 @@ void FixQEqReaxFF::pre_force(int /*vflag*/) if (reaxff) { nn = reaxff->list->inum; - NN = reaxff->list->inum + reaxff->list->gnum; ilist = reaxff->list->ilist; numneigh = reaxff->list->numneigh; firstneigh = reaxff->list->firstneigh; } else { nn = list->inum; - NN = list->inum + list->gnum; ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; @@ -791,11 +786,9 @@ void FixQEqReaxFF::sparse_matvec(sparse_matrix *A, double *x, double *b) b[i] = eta[atom->type[i]] * x[i]; } - for (ii = nn; ii < NN; ++ii) { - i = ilist[ii]; - if (atom->mask[i] & groupbit) + int nall = atom->nlocal + atom->nghost; + for (i = atom->nlocal; i < nall; ++i) b[i] = 0; - } for (ii = 0; ii < nn; ++ii) { i = ilist[ii]; @@ -1095,7 +1088,7 @@ void FixQEqReaxFF::get_chi_field() memset(&chi_field[0],0,atom->nmax*sizeof(double)); if (!efield) return; - const double * const *x = (const double * const *)atom->x; + const auto x = (const double * const *)atom->x; const int *mask = atom->mask; const imageint *image = atom->image; const int nlocal = atom->nlocal; diff --git a/src/REAXFF/fix_qeq_reaxff.h b/src/REAXFF/fix_qeq_reaxff.h index 5ebb410a10..f0f46ed4ce 100644 --- a/src/REAXFF/fix_qeq_reaxff.h +++ b/src/REAXFF/fix_qeq_reaxff.h @@ -59,7 +59,7 @@ class FixQEqReaxFF : public Fix { protected: int nevery, reaxflag; int matvecs; - int nn, NN, m_fill; + int nn, m_fill; int n_cap, nmax, m_cap; int pack_flag; int nlevels_respa; diff --git a/src/REAXFF/fix_reaxff_bonds.cpp b/src/REAXFF/fix_reaxff_bonds.cpp index 30c55d8f1a..4b96cb21a1 100644 --- a/src/REAXFF/fix_reaxff_bonds.cpp +++ b/src/REAXFF/fix_reaxff_bonds.cpp @@ -56,8 +56,8 @@ FixReaxFFBonds::FixReaxFFBonds(LAMMPS *lmp, int narg, char **arg) : if (!fp) error->one(FLERR,"Cannot open compressed file"); } else fp = fopen(arg[4],"w"); - if (!fp) error->one(FLERR,fmt::format("Cannot open fix reaxff/bonds file {}: " - "{}",arg[4],utils::getsyserror())); + if (!fp) error->one(FLERR,fmt::format("Cannot open fix reaxff/bonds file {}: {}", + arg[4],utils::getsyserror())); } if (atom->tag_consecutive() == 0) @@ -101,7 +101,7 @@ void FixReaxFFBonds::setup(int /*vflag*/) void FixReaxFFBonds::init() { - reaxff = (PairReaxFF *) force->pair_match("^reax..",0); + reaxff = dynamic_cast( force->pair_match("^reax..",0)); if (reaxff == nullptr) error->all(FLERR,"Cannot use fix reaxff/bonds without " "pair_style reaxff, reaxff/kk, or reaxff/omp"); } @@ -240,23 +240,21 @@ void FixReaxFFBonds::RecvBuffer(double *buf, int nbuf, int nbuf_local, { int i, j, k, itype; int inode, nlocal_tmp, numbonds; - tagint itag,jtag; + tagint itag; int nlocal = atom->nlocal; bigint ntimestep = update->ntimestep; - double sbotmp, nlptmp, avqtmp, abotmp; + double sbotmp, nlptmp, avqtmp; double cutof3 = reaxff->api->control->bg_cut; MPI_Request irequest, irequest2; if (me == 0) { - fprintf(fp,"# Timestep " BIGINT_FORMAT " \n",ntimestep); - fprintf(fp,"# \n"); - fprintf(fp,"# Number of particles %d \n",natoms); - fprintf(fp,"# \n"); - fprintf(fp,"# Max number of bonds per atom %d with " - "coarse bond order cutoff %5.3f \n",maxnum,cutof3); - fprintf(fp,"# Particle connection table and bond orders \n"); - fprintf(fp,"# id type nb id_1...id_nb mol bo_1...bo_nb abo nlp q \n"); + fmt::print(fp,"# Timestep {}\n#\n",ntimestep); + fmt::print(fp,"# Number of particles {}\n#\n",natoms); + fmt::print(fp,"# Max number of bonds per atom {} with coarse bond order cutoff {:5.3f}\n", + maxnum,cutof3); + fmt::print(fp,"# Particle connection table and bond orders\n" + "# id type nb id_1...id_nb mol bo_1...bo_nb abo nlp q\n"); } j = 2; @@ -278,30 +276,26 @@ void FixReaxFFBonds::RecvBuffer(double *buf, int nbuf, int nbuf_local, avqtmp = buf[j+3]; numbonds = nint(buf[j+4]); - fprintf(fp," " TAGINT_FORMAT " %d %d",itag,itype,numbonds); - - for (k = 5; k < 5+numbonds; k++) { - jtag = static_cast (buf[j+k]); - fprintf(fp," " TAGINT_FORMAT,jtag); - } + auto mesg = fmt::format(" {} {} {}",itag,itype,numbonds); + for (k = 5; k < 5+numbonds; k++) + mesg += " " + std::to_string(static_cast (buf[j+k])); j += (5+numbonds); - fprintf(fp," " TAGINT_FORMAT,static_cast (buf[j])); + mesg += " " + std::to_string(static_cast (buf[j])); j ++; - for (k = 0; k < numbonds; k++) { - abotmp = buf[j+k]; - fprintf(fp,"%14.3f",abotmp); - } + for (k = 0; k < numbonds; k++) mesg += fmt::format("{:14.3f}",buf[j+k]); j += (1+numbonds); - fprintf(fp,"%14.3f%14.3f%14.3f\n",sbotmp,nlptmp,avqtmp); + + mesg += fmt::format("{:14.3f}{:14.3f}{:14.3f}\n",sbotmp,nlptmp,avqtmp); + fmt::print(fp, mesg); } } } else { MPI_Isend(&buf[0],nbuf_local,MPI_DOUBLE,0,0,world,&irequest2); MPI_Wait(&irequest2,MPI_STATUS_IGNORE); } - if (me ==0) fprintf(fp,"# \n"); + if (me ==0) fputs("# \n",fp); } diff --git a/src/REAXFF/fix_reaxff_species.cpp b/src/REAXFF/fix_reaxff_species.cpp index 4451c4361d..b4d146c8da 100644 --- a/src/REAXFF/fix_reaxff_species.cpp +++ b/src/REAXFF/fix_reaxff_species.cpp @@ -41,10 +41,9 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) +FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { - if (narg < 7) error->all(FLERR,"Illegal fix reaxff/species command"); + if (narg < 7) error->all(FLERR, "Illegal fix reaxff/species command"); force_reneighbor = 0; @@ -59,32 +58,31 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : compressed = 0; nvalid = -1; - MPI_Comm_rank(world,&me); - MPI_Comm_size(world,&nprocs); + MPI_Comm_rank(world, &me); + MPI_Comm_size(world, &nprocs); ntypes = atom->ntypes; - nevery = utils::inumeric(FLERR,arg[3],false,lmp); - nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); - global_freq = nfreq = utils::inumeric(FLERR,arg[5],false,lmp); + nevery = utils::inumeric(FLERR, arg[3], false, lmp); + nrepeat = utils::inumeric(FLERR, arg[4], false, lmp); + global_freq = nfreq = utils::inumeric(FLERR, arg[5], false, lmp); comm_forward = 4; if (nevery <= 0 || nrepeat <= 0 || nfreq <= 0) - error->all(FLERR,"Illegal fix reaxff/species command"); - if (nfreq % nevery || nrepeat*nevery > nfreq) - error->all(FLERR,"Illegal fix reaxff/species command"); + error->all(FLERR, "Illegal fix reaxff/species command"); + if (nfreq % nevery || nrepeat * nevery > nfreq) + error->all(FLERR, "Illegal fix reaxff/species command"); // Neighbor lists must stay unchanged during averaging of bonds, // but may be updated when no averaging is performed. int rene_flag = 0; - if (nevery * nrepeat != 1 && (nfreq % neighbor->every != 0 || neighbor->every < nevery * nrepeat)) { + if (nevery * nrepeat != 1 && + (nfreq % neighbor->every != 0 || neighbor->every < nevery * nrepeat)) { int newneighborevery = nevery * nrepeat; - while (nfreq % newneighborevery != 0 && newneighborevery <= nfreq / 2) - newneighborevery++; + while (nfreq % newneighborevery != 0 && newneighborevery <= nfreq / 2) newneighborevery++; - if (nfreq % newneighborevery != 0) - newneighborevery = nfreq; + if (nfreq % newneighborevery != 0) newneighborevery = nfreq; neighbor->every = newneighborevery; rene_flag = 1; @@ -97,26 +95,29 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : } if (me == 0 && rene_flag) - error->warning(FLERR,"Resetting reneighboring criteria to 'delay {} every {} check no' " - "for fix reaxff/species",neighbor->delay, neighbor->every); + error->warning(FLERR, + "Resetting reneighboring criteria to 'delay {} every {} check no' " + "for fix reaxff/species", + neighbor->delay, neighbor->every); if (me == 0) { if (platform::has_compress_extension(arg[6])) { fp = platform::compressed_write(arg[6]); compressed = 1; - if (!fp) error->one(FLERR,"Cannot open compressed file"); - } else fp = fopen(arg[6],"w"); + if (!fp) error->one(FLERR, "Cannot open compressed file"); + } else + fp = fopen(arg[6], "w"); if (!fp) - error->one(FLERR,"Cannot open fix reaxff/species file {}: {}",arg[6],utils::getsyserror()); + error->one(FLERR, "Cannot open fix reaxff/species file {}: {}", arg[6], utils::getsyserror()); } x0 = nullptr; clusterID = nullptr; int ntmp = 1; - memory->create(x0,ntmp,"reaxff/species:x0"); - memory->create(clusterID,ntmp,"reaxff/species:clusterID"); + memory->create(x0, ntmp, "reaxff/species:x0"); + memory->create(clusterID, ntmp, "reaxff/species:clusterID"); vector_atom = clusterID; BOCut = nullptr; @@ -134,11 +135,10 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : int n, i, j, itype, jtype; double bo_cut; bg_cut = 0.30; - n = ntypes+1; - memory->create(BOCut,n,n,"reaxff/species:BOCut"); - for (i = 1; i < n; i ++) - for (j = 1; j < n; j ++) - BOCut[i][j] = bg_cut; + n = ntypes + 1; + memory->create(BOCut, n, n, "reaxff/species:BOCut"); + for (i = 1; i < n; i++) + for (j = 1; j < n; j++) BOCut[i][j] = bg_cut; // optional args eletype = nullptr; @@ -153,74 +153,68 @@ FixReaxFFSpecies::FixReaxFFSpecies(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { // set BO cutoff - if (strcmp(arg[iarg],"cutoff") == 0) { - if (iarg+4 > narg) error->all(FLERR,"Illegal fix reaxff/species command"); - itype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - jtype = utils::inumeric(FLERR,arg[iarg+2],false,lmp); - bo_cut = utils::numeric(FLERR,arg[iarg+3],false,lmp); - if (itype > ntypes || jtype > ntypes) - error->all(FLERR,"Illegal fix reaxff/species command"); - if (itype <= 0 || jtype <= 0) - error->all(FLERR,"Illegal fix reaxff/species command"); - if (bo_cut > 1.0 || bo_cut < 0.0) - error->all(FLERR,"Illegal fix reaxff/species command"); + if (strcmp(arg[iarg], "cutoff") == 0) { + if (iarg + 4 > narg) error->all(FLERR, "Illegal fix reaxff/species command"); + itype = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); + jtype = utils::inumeric(FLERR, arg[iarg + 2], false, lmp); + bo_cut = utils::numeric(FLERR, arg[iarg + 3], false, lmp); + if (itype > ntypes || jtype > ntypes) error->all(FLERR, "Illegal fix reaxff/species command"); + if (itype <= 0 || jtype <= 0) error->all(FLERR, "Illegal fix reaxff/species command"); + if (bo_cut > 1.0 || bo_cut < 0.0) error->all(FLERR, "Illegal fix reaxff/species command"); BOCut[itype][jtype] = bo_cut; BOCut[jtype][itype] = bo_cut; iarg += 4; // modify element type names - } else if (strcmp(arg[iarg],"element") == 0) { - if (iarg+ntypes+1 > narg) error->all(FLERR,"Illegal fix reaxff/species command"); + } else if (strcmp(arg[iarg], "element") == 0) { + if (iarg + ntypes + 1 > narg) error->all(FLERR, "Illegal fix reaxff/species command"); - eletype = (char**) malloc(ntypes*sizeof(char*)); + eletype = (char **) malloc(ntypes * sizeof(char *)); int len; - for (int i = 0; i < ntypes; i ++) { - len = strlen(arg[iarg+1+i])+1; - eletype[i] = (char*) malloc(len*sizeof(char)); - strcpy(eletype[i],arg[iarg+1+i]); + for (int i = 0; i < ntypes; i++) { + len = strlen(arg[iarg + 1 + i]) + 1; + eletype[i] = (char *) malloc(len * sizeof(char)); + strcpy(eletype[i], arg[iarg + 1 + i]); } eleflag = 1; iarg += ntypes + 1; // position of molecules - } else if (strcmp(arg[iarg],"position") == 0) { - if (iarg+3 > narg) error->all(FLERR,"Illegal fix reaxff/species command"); + } else if (strcmp(arg[iarg], "position") == 0) { + if (iarg + 3 > narg) error->all(FLERR, "Illegal fix reaxff/species command"); posflag = 1; - posfreq = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (posfreq < nfreq || (posfreq%nfreq != 0)) - error->all(FLERR,"Illegal fix reaxff/species command"); + posfreq = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); + if (posfreq < nfreq || (posfreq % nfreq != 0)) + error->all(FLERR, "Illegal fix reaxff/species command"); filepos = new char[255]; - strcpy(filepos,arg[iarg+2]); - if (strchr(filepos,'*')) { + strcpy(filepos, arg[iarg + 2]); + if (strchr(filepos, '*')) { multipos = 1; } else { if (me == 0) { pos = fopen(filepos, "w"); - if (pos == nullptr) error->one(FLERR,"Cannot open fix reaxff/species position file"); + if (pos == nullptr) error->one(FLERR, "Cannot open fix reaxff/species position file"); } singlepos_opened = 1; multipos = 0; } iarg += 3; - } else error->all(FLERR,"Illegal fix reaxff/species command"); + } else + error->all(FLERR, "Illegal fix reaxff/species command"); } if (!eleflag) { - memory->create(ele,ntypes+1,"reaxff/species:ele"); - ele[0]='C'; - if (ntypes > 1) - ele[1]='H'; - if (ntypes > 2) - ele[2]='O'; - if (ntypes > 3) - ele[3]='N'; + memory->create(ele, ntypes + 1, "reaxff/species:ele"); + ele[0] = 'C'; + if (ntypes > 1) ele[1] = 'H'; + if (ntypes > 2) ele[2] = 'O'; + if (ntypes > 3) ele[3] = 'N'; } vector_nmole = 0; vector_nspec = 0; - } /* ---------------------------------------------------------------------- */ @@ -238,19 +232,21 @@ FixReaxFFSpecies::~FixReaxFFSpecies() memory->destroy(MolType); memory->destroy(MolName); - if (filepos) - delete [] filepos; + delete[] filepos; if (me == 0) { - if (compressed) platform::pclose(fp); - else fclose(fp); + if (compressed) + platform::pclose(fp); + else + fclose(fp); if (posflag && multipos_opened) fclose(pos); } try { - modify->delete_compute(fmt::format("SPECATOM_{}",id)); - modify->delete_fix(fmt::format("SPECBOND_{}",id)); - } catch (std::exception &) {} + modify->delete_compute(fmt::format("SPECATOM_{}", id)); + modify->delete_fix(fmt::format("SPECBOND_{}", id)); + } catch (std::exception &) { + } } /* ---------------------------------------------------------------------- */ @@ -266,9 +262,8 @@ int FixReaxFFSpecies::setmask() void FixReaxFFSpecies::setup(int /*vflag*/) { - ntotal = static_cast (atom->natoms); - if (Name == nullptr) - memory->create(Name,ntypes,"reaxff/species:Name"); + ntotal = static_cast(atom->natoms); + if (Name == nullptr) memory->create(Name, ntypes, "reaxff/species:Name"); post_integrate(); } @@ -278,29 +273,31 @@ void FixReaxFFSpecies::setup(int /*vflag*/) void FixReaxFFSpecies::init() { if (atom->tag_enable == 0) - error->all(FLERR,"Cannot use fix reaxff/species unless atoms have IDs"); + error->all(FLERR, "Cannot use fix reaxff/species unless atoms have IDs"); - reaxff = (PairReaxFF *) force->pair_match("^reax..",0); - if (reaxff == nullptr) error->all(FLERR,"Cannot use fix reaxff/species without " - "pair_style reaxff, reaxff/kk, or reaxff/omp"); + reaxff = dynamic_cast( force->pair_match("^reax..", 0)); + if (reaxff == nullptr) + error->all(FLERR, + "Cannot use fix reaxff/species without " + "pair_style reaxff, reaxff/kk, or reaxff/omp"); reaxff->fixspecies_flag = 1; // reset next output timestep if not yet set or timestep has been reset - if (nvalid != update->ntimestep) - nvalid = update->ntimestep+nfreq; + if (nvalid != update->ntimestep) nvalid = update->ntimestep + nfreq; if (!setupflag) { // create a compute to store properties modify->add_compute(fmt::format("SPECATOM_{} all SPEC/ATOM q x y z vx vy vz abo01 abo02 " "abo03 abo04 abo05 abo06 abo07 abo08 abo09 abo10 abo11 " "abo12 abo13 abo14 abo15 abo16 abo17 abo18 abo19 abo20 " - "abo21 abo22 abo23 abo24",id)); + "abo21 abo22 abo23 abo24", + id)); // create a fix to point to fix_ave_atom for averaging stored properties - auto fixcmd = fmt::format("SPECBOND_{} all ave/atom {} {} {}",id,nevery,nrepeat,nfreq); - for (int i = 1; i < 32; ++i) fixcmd += fmt::format(" c_SPECATOM_{}[{}]",id,i); - f_SPECBOND = (FixAveAtom *) modify->add_fix(fixcmd); + auto fixcmd = fmt::format("SPECBOND_{} all ave/atom {} {} {}", id, nevery, nrepeat, nfreq); + for (int i = 1; i < 32; ++i) fixcmd += fmt::format(" c_SPECATOM_{}[{}]", id, i); + f_SPECBOND = dynamic_cast( modify->add_fix(fixcmd)); setupflag = 1; } } @@ -316,7 +313,7 @@ void FixReaxFFSpecies::init_list(int /*id*/, NeighList *ptr) void FixReaxFFSpecies::post_integrate() { - Output_ReaxFF_Bonds(update->ntimestep,fp); + Output_ReaxFF_Bonds(update->ntimestep, fp); if (me == 0) fflush(fp); } @@ -338,30 +335,27 @@ void FixReaxFFSpecies::Output_ReaxFF_Bonds(bigint ntimestep, FILE * /*fp*/) nmax = atom->nmax; memory->destroy(x0); memory->destroy(clusterID); - memory->create(x0,nmax,"reaxff/species:x0"); - memory->create(clusterID,nmax,"reaxff/species:clusterID"); + memory->create(x0, nmax, "reaxff/species:x0"); + memory->create(clusterID, nmax, "reaxff/species:clusterID"); vector_atom = clusterID; } - for (int i = 0; i < nmax; i++) { - x0[i].x = x0[i].y = x0[i].z = 0.0; - } + for (int i = 0; i < nmax; i++) { x0[i].x = x0[i].y = x0[i].z = 0.0; } Nmole = Nspec = 0; FindMolecule(); - SortMolecule (Nmole); + SortMolecule(Nmole); FindSpecies(Nmole, Nspec); vector_nmole = Nmole; vector_nspec = Nspec; - if (me == 0 && ntimestep >= 0) - WriteFormulas (Nmole, Nspec); + if (me == 0 && ntimestep >= 0) WriteFormulas(Nmole, Nspec); - if (posflag && ((ntimestep)%posfreq==0)) { + if (posflag && ((ntimestep) % posfreq == 0)) { WritePos(Nmole, Nspec); if (me == 0) fflush(pos); } @@ -379,8 +373,7 @@ AtomCoord FixReaxFFSpecies::chAnchor(AtomCoord in1, AtomCoord in2) if (in1.y < in2.y) return in1; else if (in1.y == in2.y) { - if (in1.z < in2.z) - return in1; + if (in1.z < in2.z) return in1; } } return in2; @@ -388,13 +381,13 @@ AtomCoord FixReaxFFSpecies::chAnchor(AtomCoord in1, AtomCoord in2) /* ---------------------------------------------------------------------- */ -void FixReaxFFSpecies::FindMolecule () +void FixReaxFFSpecies::FindMolecule() { - int i,j,ii,jj,inum,itype,jtype,loop,looptot; - int change,done,anychange; + int i, j, ii, jj, inum, itype, jtype, loop, looptot; + int change, done, anychange; int *mask = atom->mask; int *ilist; - double bo_tmp,bo_cut; + double bo_tmp, bo_cut; double **spec_atom = f_SPECBOND->array_atom; inum = reaxff->list->inum; @@ -407,14 +400,14 @@ void FixReaxFFSpecies::FindMolecule () x0[i].x = spec_atom[i][1]; x0[i].y = spec_atom[i][2]; x0[i].z = spec_atom[i][3]; - } - else clusterID[i] = 0.0; + } else + clusterID[i] = 0.0; } loop = 0; while (true) { comm->forward_comm(this); - loop ++; + loop++; change = 0; while (true) { @@ -432,14 +425,13 @@ void FixReaxFFSpecies::FindMolecule () if ((j == 0) || (j < i)) continue; if (!(mask[j] & groupbit)) continue; - if (clusterID[i] == clusterID[j] - && x0[i].x == x0[j].x - && x0[i].y == x0[j].y - && x0[i].z == x0[j].z) continue; + if (clusterID[i] == clusterID[j] && x0[i].x == x0[j].x && x0[i].y == x0[j].y && + x0[i].z == x0[j].z) + continue; jtype = atom->type[j]; bo_cut = BOCut[itype][jtype]; - bo_tmp = spec_atom[i][jj+7]; + bo_tmp = spec_atom[i][jj + 7]; if (bo_tmp > bo_cut) { clusterID[i] = clusterID[j] = MIN(clusterID[i], clusterID[j]); @@ -451,12 +443,11 @@ void FixReaxFFSpecies::FindMolecule () if (!done) change = 1; if (done) break; } - MPI_Allreduce(&change,&anychange,1,MPI_INT,MPI_MAX,world); + MPI_Allreduce(&change, &anychange, 1, MPI_INT, MPI_MAX, world); if (!anychange) break; - MPI_Allreduce(&loop,&looptot,1,MPI_INT,MPI_SUM,world); - if (looptot >= 400*nprocs) break; - + MPI_Allreduce(&loop, &looptot, 1, MPI_INT, MPI_SUM, world); + if (looptot >= 400 * nprocs) break; } } @@ -468,45 +459,45 @@ void FixReaxFFSpecies::SortMolecule(int &Nmole) molmap = nullptr; int n, idlo, idhi; - int *mask =atom->mask; + int *mask = atom->mask; int lo = ntotal; int hi = -ntotal; int flag = 0; for (n = 0; n < nlocal; n++) { if (!(mask[n] & groupbit)) continue; if (clusterID[n] == 0.0) flag = 1; - lo = MIN(lo,nint(clusterID[n])); - hi = MAX(hi,nint(clusterID[n])); + lo = MIN(lo, nint(clusterID[n])); + hi = MAX(hi, nint(clusterID[n])); } int flagall; - MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); + MPI_Allreduce(&flag, &flagall, 1, MPI_INT, MPI_SUM, world); if (flagall && me == 0) - error->warning(FLERR,"Atom with cluster ID = 0 included in " - "fix reaxff/species group"); - MPI_Allreduce(&lo,&idlo,1,MPI_INT,MPI_MIN,world); - MPI_Allreduce(&hi,&idhi,1,MPI_INT,MPI_MAX,world); + error->warning(FLERR, "Atom with cluster ID = 0 included in fix reaxff/species group"); + MPI_Allreduce(&lo, &idlo, 1, MPI_INT, MPI_MIN, world); + MPI_Allreduce(&hi, &idhi, 1, MPI_INT, MPI_MAX, world); if (idlo == ntotal) if (me == 0) - error->warning(FLERR,"Atom with cluster ID = maxmol " - "included in fix reaxff/species group"); + error->warning(FLERR, "Atom with cluster ID = maxmol included in fix reaxff/species group"); int nlen = idhi - idlo + 1; - memory->create(molmap,nlen,"reaxff/species:molmap"); + memory->create(molmap, nlen, "reaxff/species:molmap"); for (n = 0; n < nlen; n++) molmap[n] = 0; for (n = 0; n < nlocal; n++) { if (!(mask[n] & groupbit)) continue; - molmap[nint(clusterID[n])-idlo] = 1; + molmap[nint(clusterID[n]) - idlo] = 1; } int *molmapall; - memory->create(molmapall,nlen,"reaxff/species:molmapall"); - MPI_Allreduce(molmap,molmapall,nlen,MPI_INT,MPI_MAX,world); + memory->create(molmapall, nlen, "reaxff/species:molmapall"); + MPI_Allreduce(molmap, molmapall, nlen, MPI_INT, MPI_MAX, world); Nmole = 0; for (n = 0; n < nlen; n++) { - if (molmapall[n]) molmap[n] = Nmole++; - else molmap[n] = -1; + if (molmapall[n]) + molmap[n] = Nmole++; + else + molmap[n] = -1; } memory->destroy(molmapall); @@ -514,21 +505,19 @@ void FixReaxFFSpecies::SortMolecule(int &Nmole) for (n = 0; n < nlocal; n++) { if (mask[n] & groupbit) continue; if (nint(clusterID[n]) < idlo || nint(clusterID[n]) > idhi) continue; - if (molmap[nint(clusterID[n])-idlo] >= 0) flag = 1; + if (molmap[nint(clusterID[n]) - idlo] >= 0) flag = 1; } - MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); - if (flagall && comm->me == 0) - error->warning(FLERR,"One or more cluster has atoms not in group"); + MPI_Allreduce(&flag, &flagall, 1, MPI_INT, MPI_SUM, world); + if (flagall && comm->me == 0) error->warning(FLERR, "One or more cluster has atoms not in group"); for (n = 0; n < nlocal; n++) { if (!(mask[n] & groupbit)) continue; - clusterID[n] = molmap[nint(clusterID[n])-idlo] + 1; + clusterID[n] = molmap[nint(clusterID[n]) - idlo] + 1; } memory->destroy(molmap); molmap = nullptr; - } /* ---------------------------------------------------------------------- */ @@ -538,52 +527,50 @@ void FixReaxFFSpecies::FindSpecies(int Nmole, int &Nspec) int k, l, m, n, itype, cid; int flag_identity, flag_mol, flag_spec; int flag_tmp; - int *mask =atom->mask; + int *mask = atom->mask; int *Nameall, *NMolall; memory->destroy(MolName); MolName = nullptr; - memory->create(MolName,Nmole*(ntypes+1),"reaxff/species:MolName"); + memory->create(MolName, Nmole * (ntypes + 1), "reaxff/species:MolName"); memory->destroy(NMol); NMol = nullptr; - memory->create(NMol,Nmole,"reaxff/species:NMol"); - for (m = 0; m < Nmole; m ++) - NMol[m] = 1; + memory->create(NMol, Nmole, "reaxff/species:NMol"); + for (m = 0; m < Nmole; m++) NMol[m] = 1; - memory->create(Nameall,ntypes,"reaxff/species:Nameall"); - memory->create(NMolall,Nmole,"reaxff/species:NMolall"); + memory->create(Nameall, ntypes, "reaxff/species:Nameall"); + memory->create(NMolall, Nmole, "reaxff/species:NMolall"); - for (m = 1, Nspec = 0; m <= Nmole; m ++) { - for (n = 0; n < ntypes; n ++) Name[n] = 0; - for (n = 0, flag_mol = 0; n < nlocal; n ++) { + for (m = 1, Nspec = 0; m <= Nmole; m++) { + for (n = 0; n < ntypes; n++) Name[n] = 0; + for (n = 0, flag_mol = 0; n < nlocal; n++) { if (!(mask[n] & groupbit)) continue; cid = nint(clusterID[n]); if (cid == m) { - itype = atom->type[n]-1; - Name[itype] ++; + itype = atom->type[n] - 1; + Name[itype]++; flag_mol = 1; } } - MPI_Allreduce(&flag_mol,&flag_tmp,1,MPI_INT,MPI_MAX,world); + MPI_Allreduce(&flag_mol, &flag_tmp, 1, MPI_INT, MPI_MAX, world); flag_mol = flag_tmp; - MPI_Allreduce(Name,Nameall,ntypes,MPI_INT,MPI_SUM,world); + MPI_Allreduce(Name, Nameall, ntypes, MPI_INT, MPI_SUM, world); for (n = 0; n < ntypes; n++) Name[n] = Nameall[n]; if (flag_mol == 1) { flag_identity = 1; - for (k = 0; k < Nspec; k ++) { - flag_spec=0; - for (l = 0; l < ntypes; l ++) - if (MolName[ntypes*k+l] != Name[l]) flag_spec = 1; - if (flag_spec == 0) NMol[k] ++; + for (k = 0; k < Nspec; k++) { + flag_spec = 0; + for (l = 0; l < ntypes; l++) + if (MolName[ntypes * k + l] != Name[l]) flag_spec = 1; + if (flag_spec == 0) NMol[k]++; flag_identity *= flag_spec; } if (Nspec == 0 || flag_identity == 1) { - for (l = 0; l < ntypes; l ++) - MolName[ntypes*Nspec+l] = Name[l]; - Nspec ++; + for (l = 0; l < ntypes; l++) MolName[ntypes * Nspec + l] = Name[l]; + Nspec++; } } } @@ -592,11 +579,11 @@ void FixReaxFFSpecies::FindSpecies(int Nmole, int &Nspec) memory->destroy(nd); nd = nullptr; - memory->create(nd,Nspec,"reaxff/species:nd"); + memory->create(nd, Nspec, "reaxff/species:nd"); memory->destroy(MolType); MolType = nullptr; - memory->create(MolType,Nspec*(ntypes+2),"reaxff/species:MolType"); + memory->create(MolType, Nspec * (ntypes + 2), "reaxff/species:MolType"); } /* ---------------------------------------------------------------------- */ @@ -605,18 +592,17 @@ int FixReaxFFSpecies::CheckExistence(int id, int ntypes) { int i, j, molid, flag; - for (i = 0; i < Nmoltype; i ++) { + for (i = 0; i < Nmoltype; i++) { flag = 0; - for (j = 0; j < ntypes; j ++) { + for (j = 0; j < ntypes; j++) { molid = MolType[ntypes * i + j]; if (molid != MolName[ntypes * id + j]) flag = 1; } if (flag == 0) return i; } - for (i = 0; i < ntypes; i ++) - MolType[ntypes * Nmoltype + i] = MolName[ntypes *id + i]; + for (i = 0; i < ntypes; i++) MolType[ntypes * Nmoltype + i] = MolName[ntypes * id + i]; - Nmoltype ++; + Nmoltype++; return Nmoltype - 1; } @@ -627,62 +613,46 @@ void FixReaxFFSpecies::WriteFormulas(int Nmole, int Nspec) int i, j, itemp; bigint ntimestep = update->ntimestep; - fprintf(fp,"# Timestep No_Moles No_Specs "); + fprintf(fp, "# Timestep No_Moles No_Specs "); Nmoltype = 0; - for (i = 0; i < Nspec; i ++) - nd[i] = CheckExistence(i, ntypes); + for (i = 0; i < Nspec; i++) nd[i] = CheckExistence(i, ntypes); - for (i = 0; i < Nmoltype; i ++) { - for (j = 0;j < ntypes; j ++) { + for (i = 0; i < Nmoltype; i++) { + for (j = 0; j < ntypes; j++) { itemp = MolType[ntypes * i + j]; if (itemp != 0) { - if (eletype) fprintf(fp,"%s",eletype[j]); - else fprintf(fp,"%c",ele[j]); - if (itemp != 1) fprintf(fp,"%d",itemp); + if (eletype) + fprintf(fp, "%s", eletype[j]); + else + fprintf(fp, "%c", ele[j]); + if (itemp != 1) fprintf(fp, "%d", itemp); } } - fprintf(fp,"\t"); + fputs("\t", fp); } - fprintf(fp,"\n"); + fputs("\n", fp); - fprintf(fp,BIGINT_FORMAT,ntimestep); - fprintf(fp,"%11d%11d\t",Nmole,Nspec); - - for (i = 0; i < Nmoltype; i ++) - fprintf(fp," %d\t",NMol[i]); - fprintf(fp,"\n"); + fmt::print(fp, "{} {:11} {:11}\t", ntimestep, Nmole, Nspec); + for (i = 0; i < Nmoltype; i++) fprintf(fp, " %d\t", NMol[i]); + fprintf(fp, "\n"); } /* ---------------------------------------------------------------------- */ void FixReaxFFSpecies::OpenPos() { - char *filecurrent; - bigint ntimestep = update->ntimestep; - - filecurrent = (char*) malloc((strlen(filepos)+16)*sizeof(char)); - char *ptr = strchr(filepos,'*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent,"%s" BIGINT_FORMAT "%s",filepos,ntimestep,ptr+1); - else { - char bif[8],pad[16]; - strcpy(bif,BIGINT_FORMAT); - sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); - sprintf(filecurrent,pad,filepos,ntimestep,ptr+1); - } - *ptr = '*'; - if (me == 0) { - pos = fopen(filecurrent, "w"); - if (pos == nullptr) error->one(FLERR,"Cannot open fix reaxff/species position file"); - } else pos = nullptr; + auto filecurrent = utils::star_subst(filepos, update->ntimestep, padflag); + pos = fopen(filecurrent.c_str(), "w"); + if (pos == nullptr) + error->one(FLERR, "Cannot open fix reaxff/species position file {}: {}", filecurrent, + utils::getsyserror()); + } else + pos = nullptr; multipos_opened = 1; - - free(filecurrent); } /* ---------------------------------------------------------------------- */ @@ -692,7 +662,7 @@ void FixReaxFFSpecies::WritePos(int Nmole, int Nspec) int i, itype, cid; int count, count_tmp, m, n, k; int *Nameall; - int *mask =atom->mask; + int *mask = atom->mask; double avq, avq_tmp, avx[3], avx_tmp, box[3], halfbox[3]; double **spec_atom = f_SPECBOND->array_atom; @@ -702,101 +672,89 @@ void FixReaxFFSpecies::WritePos(int Nmole, int Nspec) box[1] = domain->boxhi[1] - domain->boxlo[1]; box[2] = domain->boxhi[2] - domain->boxlo[2]; - for (int j = 0; j < 3; j++) - halfbox[j] = box[j] / 2; + for (int j = 0; j < 3; j++) halfbox[j] = box[j] / 2; if (me == 0) { - fprintf(pos,"Timestep " BIGINT_FORMAT " NMole %d NSpec %d xlo %f " - "xhi %f ylo %f yhi %f zlo %f zhi %f\n", - update->ntimestep,Nmole, Nspec, - domain->boxlo[0],domain->boxhi[0], - domain->boxlo[1],domain->boxhi[1], - domain->boxlo[2],domain->boxhi[2]); + fmt::print(pos, + "Timestep {} NMole {} NSpec {} xlo {:f} " + "xhi {:f} ylo {:f} yhi {:f} zlo {:f} zhi {:f}\n", + update->ntimestep, Nmole, Nspec, domain->boxlo[0], domain->boxhi[0], + domain->boxlo[1], domain->boxhi[1], domain->boxlo[2], domain->boxhi[2]); - fprintf(pos,"ID\tAtom_Count\tType\tAve_q\t\tCoM_x\t\tCoM_y\t\tCoM_z\n"); + fprintf(pos, "ID\tAtom_Count\tType\tAve_q\t\tCoM_x\t\tCoM_y\t\tCoM_z\n"); } Nameall = nullptr; - memory->create(Nameall,ntypes,"reaxff/species:Nameall"); + memory->create(Nameall, ntypes, "reaxff/species:Nameall"); - for (m = 1; m <= Nmole; m ++) { + for (m = 1; m <= Nmole; m++) { count = 0; avq = 0.0; - for (n = 0; n < 3; n++) - avx[n] = 0.0; - for (n = 0; n < ntypes; n ++) - Name[n] = 0; + for (n = 0; n < 3; n++) avx[n] = 0.0; + for (n = 0; n < ntypes; n++) Name[n] = 0; - for (i = 0; i < nlocal; i ++) { + for (i = 0; i < nlocal; i++) { if (!(mask[i] & groupbit)) continue; cid = nint(clusterID[i]); if (cid == m) { - itype = atom->type[i]-1; - Name[itype] ++; - count ++; + itype = atom->type[i] - 1; + Name[itype]++; + count++; avq += spec_atom[i][0]; - if ((x0[i].x - spec_atom[i][1]) > halfbox[0]) - spec_atom[i][1] += box[0]; - if ((spec_atom[i][1] - x0[i].x) > halfbox[0]) - spec_atom[i][1] -= box[0]; - if ((x0[i].y - spec_atom[i][2]) > halfbox[1]) - spec_atom[i][2] += box[1]; - if ((spec_atom[i][2] - x0[i].y) > halfbox[1]) - spec_atom[i][2] -= box[1]; - if ((x0[i].z - spec_atom[i][3]) > halfbox[2]) - spec_atom[i][3] += box[2]; - if ((spec_atom[i][3] - x0[i].z) > halfbox[2]) - spec_atom[i][3] -= box[2]; - for (n = 0; n < 3; n++) - avx[n] += spec_atom[i][n+1]; + if ((x0[i].x - spec_atom[i][1]) > halfbox[0]) spec_atom[i][1] += box[0]; + if ((spec_atom[i][1] - x0[i].x) > halfbox[0]) spec_atom[i][1] -= box[0]; + if ((x0[i].y - spec_atom[i][2]) > halfbox[1]) spec_atom[i][2] += box[1]; + if ((spec_atom[i][2] - x0[i].y) > halfbox[1]) spec_atom[i][2] -= box[1]; + if ((x0[i].z - spec_atom[i][3]) > halfbox[2]) spec_atom[i][3] += box[2]; + if ((spec_atom[i][3] - x0[i].z) > halfbox[2]) spec_atom[i][3] -= box[2]; + for (n = 0; n < 3; n++) avx[n] += spec_atom[i][n + 1]; } } avq_tmp = 0.0; - MPI_Allreduce(&avq,&avq_tmp,1,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(&avq, &avq_tmp, 1, MPI_DOUBLE, MPI_SUM, world); avq = avq_tmp; for (n = 0; n < 3; n++) { avx_tmp = 0.0; - MPI_Reduce(&avx[n],&avx_tmp,1,MPI_DOUBLE,MPI_SUM,0,world); + MPI_Reduce(&avx[n], &avx_tmp, 1, MPI_DOUBLE, MPI_SUM, 0, world); avx[n] = avx_tmp; } - MPI_Reduce(&count,&count_tmp,1,MPI_INT,MPI_SUM,0,world); + MPI_Reduce(&count, &count_tmp, 1, MPI_INT, MPI_SUM, 0, world); count = count_tmp; - MPI_Reduce(Name,Nameall,ntypes,MPI_INT,MPI_SUM,0,world); + MPI_Reduce(Name, Nameall, ntypes, MPI_INT, MPI_SUM, 0, world); for (n = 0; n < ntypes; n++) Name[n] = Nameall[n]; if (me == 0) { - fprintf(pos,"%d\t%d\t",m,count); + fprintf(pos, "%d\t%d\t", m, count); for (n = 0; n < ntypes; n++) { if (Name[n] != 0) { - if (eletype) fprintf(pos,"%s",eletype[n]); - else fprintf(pos,"%c",ele[n]); - if (Name[n] != 1) fprintf(pos,"%d",Name[n]); + if (eletype) + fprintf(pos, "%s", eletype[n]); + else + fprintf(pos, "%c", ele[n]); + if (Name[n] != 1) fprintf(pos, "%d", Name[n]); } } if (count > 0) { avq /= count; for (k = 0; k < 3; k++) { avx[k] /= count; - if (avx[k] >= domain->boxhi[k]) - avx[k] -= box[k]; - if (avx[k] < domain->boxlo[k]) - avx[k] += box[k]; + if (avx[k] >= domain->boxhi[k]) avx[k] -= box[k]; + if (avx[k] < domain->boxlo[k]) avx[k] += box[k]; avx[k] -= domain->boxlo[k]; avx[k] /= box[k]; } - fprintf(pos,"\t%.8f \t%.8f \t%.8f \t%.8f", - avq,avx[0],avx[1],avx[2]); + fprintf(pos, "\t%.8f \t%.8f \t%.8f \t%.8f", avq, avx[0], avx[1], avx[2]); } - fprintf(pos,"\n"); + fprintf(pos, "\n"); } } - if (me == 0 && !multipos) fprintf(pos,"#\n"); + if (me == 0 && !multipos) fprintf(pos, "#\n"); memory->destroy(Nameall); } @@ -804,12 +762,9 @@ void FixReaxFFSpecies::WritePos(int Nmole, int Nspec) double FixReaxFFSpecies::compute_vector(int n) { - if (n == 0) - return vector_nmole; - if (n == 1) - return vector_nspec; + if (n == 0) return vector_nmole; + if (n == 1) return vector_nspec; return 0.0; - } /* ---------------------------------------------------------------------- */ @@ -817,25 +772,27 @@ double FixReaxFFSpecies::compute_vector(int n) int FixReaxFFSpecies::nint(const double &r) { int i = 0; - if (r>0.0) i = static_cast(r+0.5); - else if (r<0.0) i = static_cast(r-0.5); + if (r > 0.0) + i = static_cast(r + 0.5); + else if (r < 0.0) + i = static_cast(r - 0.5); return i; } /* ---------------------------------------------------------------------- */ -int FixReaxFFSpecies::pack_forward_comm(int n, int *list, double *buf, - int /*pbc_flag*/, int * /*pbc*/) +int FixReaxFFSpecies::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, + int * /*pbc*/) { - int i,j,m; + int i, j, m; m = 0; for (i = 0; i < n; i++) { j = list[i]; buf[m] = clusterID[j]; - buf[m+1] = x0[j].x; - buf[m+2] = x0[j].y; - buf[m+3] = x0[j].z; + buf[m + 1] = x0[j].x; + buf[m + 2] = x0[j].y; + buf[m + 3] = x0[j].z; m += 4; } return m; @@ -845,15 +802,15 @@ int FixReaxFFSpecies::pack_forward_comm(int n, int *list, double *buf, void FixReaxFFSpecies::unpack_forward_comm(int n, int first, double *buf) { - int i,m,last; + int i, m, last; m = 0; last = first + n; for (i = first; i < last; i++) { clusterID[i] = buf[m]; - x0[i].x = buf[m+1]; - x0[i].y = buf[m+2]; - x0[i].z = buf[m+3]; + x0[i].x = buf[m + 1]; + x0[i].y = buf[m + 2]; + x0[i].z = buf[m + 3]; m += 4; } } @@ -864,7 +821,7 @@ double FixReaxFFSpecies::memory_usage() { double bytes; - bytes = 4*nmax*sizeof(double); // clusterID + x0 + bytes = 4 * nmax * sizeof(double); // clusterID + x0 return bytes; } diff --git a/src/REAXFF/pair_reaxff.cpp b/src/REAXFF/pair_reaxff.cpp index 94646fd8a7..e78edea9a9 100644 --- a/src/REAXFF/pair_reaxff.cpp +++ b/src/REAXFF/pair_reaxff.cpp @@ -351,7 +351,7 @@ void PairReaxFF::init_style() api->system->acks2_flag = acks2_fixes.size(); if (api->system->acks2_flag) - api->workspace->s = ((FixACKS2ReaxFF *)acks2_fixes.front())->get_s(); + api->workspace->s = (dynamic_cast(acks2_fixes.front()))->get_s(); api->system->n = atom->nlocal; // my atoms api->system->N = atom->nlocal + atom->nghost; // mine + ghosts @@ -373,7 +373,7 @@ void PairReaxFF::init_style() "increased neighbor list skin."); if (fix_reaxff == nullptr) - fix_reaxff = (FixReaxFF *) modify->add_fix(fmt::format("{} all REAXFF",fix_id)); + fix_reaxff = dynamic_cast( modify->add_fix(fmt::format("{} all REAXFF",fix_id))); } /* ---------------------------------------------------------------------- */ @@ -467,7 +467,7 @@ void PairReaxFF::compute(int eflag, int vflag) if (api->system->acks2_flag) { auto ifix = modify->get_fix_by_style("^acks2/reax").front(); - api->workspace->s = ((FixACKS2ReaxFF*) ifix)->get_s(); + api->workspace->s = (dynamic_cast( ifix))->get_s(); } // setup data structures diff --git a/src/REPLICA/compute_event_displace.cpp b/src/REPLICA/compute_event_displace.cpp index cfb6307e63..6a8791de71 100644 --- a/src/REPLICA/compute_event_displace.cpp +++ b/src/REPLICA/compute_event_displace.cpp @@ -69,7 +69,7 @@ void ComputeEventDisplace::init() int ifix = modify->find_fix(id_event); if (ifix < 0) error->all(FLERR, "Could not find compute event/displace fix ID"); - fix_event = (FixEvent*) modify->fix[ifix]; + fix_event = dynamic_cast( modify->fix[ifix]); if (strcmp(fix_event->style,"EVENT/PRD") != 0 && strcmp(fix_event->style,"EVENT/TAD") != 0 && diff --git a/src/REPLICA/fix_event_hyper.cpp b/src/REPLICA/fix_event_hyper.cpp index 5f68506db5..9cdb881d06 100644 --- a/src/REPLICA/fix_event_hyper.cpp +++ b/src/REPLICA/fix_event_hyper.cpp @@ -79,7 +79,7 @@ void FixEventHyper::write_restart(FILE *fp) void FixEventHyper::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; event_number = (int) ubuf(list[n++]).i; event_timestep = (bigint) ubuf(list[n++]).i; diff --git a/src/REPLICA/fix_event_prd.cpp b/src/REPLICA/fix_event_prd.cpp index 3256d01923..9e1aee90e6 100644 --- a/src/REPLICA/fix_event_prd.cpp +++ b/src/REPLICA/fix_event_prd.cpp @@ -82,7 +82,7 @@ void FixEventPRD::write_restart(FILE *fp) void FixEventPRD::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; event_number = static_cast (list[n++]); event_timestep = static_cast (list[n++]); diff --git a/src/REPLICA/fix_event_tad.cpp b/src/REPLICA/fix_event_tad.cpp index f51401fae1..1ab34d3eed 100644 --- a/src/REPLICA/fix_event_tad.cpp +++ b/src/REPLICA/fix_event_tad.cpp @@ -78,7 +78,7 @@ void FixEventTAD::write_restart(FILE *fp) void FixEventTAD::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; event_number = static_cast (list[n++]); event_timestep = static_cast (list[n++]); diff --git a/src/REPLICA/fix_grem.cpp b/src/REPLICA/fix_grem.cpp index 743d31fe96..1d0dceda96 100644 --- a/src/REPLICA/fix_grem.cpp +++ b/src/REPLICA/fix_grem.cpp @@ -166,8 +166,8 @@ void FixGrem::init() error->all(FLERR,"Fix id for nvt or npt fix does not exist"); Fix *nh = modify->fix[ifix]; - double *t_start = (double *)nh->extract("t_start",ifix); - double *t_stop = (double *)nh->extract("t_stop",ifix); + auto t_start = (double *)nh->extract("t_start",ifix); + auto t_stop = (double *)nh->extract("t_stop",ifix); if ((t_start != nullptr) && (t_stop != nullptr) && (ifix == 0)) { tbath = *t_start; if (*t_start != *t_stop) @@ -178,8 +178,8 @@ void FixGrem::init() pressref = 0.0; if (pressflag) { int *p_flag = (int *)nh->extract("p_flag",ifix); - double *p_start = (double *) nh->extract("p_start",ifix); - double *p_stop = (double *) nh->extract("p_stop",ifix); + auto p_start = (double *) nh->extract("p_start",ifix); + auto p_stop = (double *) nh->extract("p_stop",ifix); if ((p_flag != nullptr) && (p_start != nullptr) && (p_stop != nullptr) && (ifix == 1)) { ifix = 0; diff --git a/src/REPLICA/fix_pimd.cpp b/src/REPLICA/fix_pimd.cpp index b84558acdb..87dc802dbf 100644 --- a/src/REPLICA/fix_pimd.cpp +++ b/src/REPLICA/fix_pimd.cpp @@ -615,7 +615,7 @@ void FixPIMD::comm_init() if (buf_beads) { for (int i = 0; i < np; i++) - if (buf_beads[i]) delete[] buf_beads[i]; + delete[] buf_beads[i]; delete[] buf_beads; } diff --git a/src/REPLICA/hyper.cpp b/src/REPLICA/hyper.cpp index d391604530..00c594e7a3 100644 --- a/src/REPLICA/hyper.cpp +++ b/src/REPLICA/hyper.cpp @@ -60,10 +60,10 @@ void Hyper::command(int narg, char **arg) int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); t_event = utils::inumeric(FLERR,arg[1],false,lmp); - char *id_fix = new char[strlen(arg[2])+1]; + auto id_fix = new char[strlen(arg[2])+1]; strcpy(id_fix,arg[2]); - char *id_compute = new char[strlen(arg[3])+1]; + auto id_compute = new char[strlen(arg[3])+1]; strcpy(id_compute,arg[3]); options(narg-4,&arg[4]); @@ -89,7 +89,7 @@ void Hyper::command(int narg, char **arg) } else { int ifix = modify->find_fix(id_fix); if (ifix < 0) error->all(FLERR,"Could not find fix ID for hyper"); - fix_hyper = (FixHyper *) modify->fix[ifix]; + fix_hyper = dynamic_cast( modify->fix[ifix]); int dim; int *hyperflag = (int *) fix_hyper->extract("hyperflag",dim); if (hyperflag == nullptr || *hyperflag == 0) @@ -101,7 +101,7 @@ void Hyper::command(int narg, char **arg) // create FixEventHyper class to store event and pre-quench states - fix_event = (FixEventHyper *) modify->add_fix("hyper_event all EVENT/HYPER"); + fix_event = dynamic_cast( modify->add_fix("hyper_event all EVENT/HYPER")); // create Finish for timing output @@ -112,7 +112,7 @@ void Hyper::command(int narg, char **arg) int icompute = modify->find_compute(id_compute); if (icompute < 0) error->all(FLERR,"Could not find compute ID for hyper"); - compute_event = (ComputeEventDisplace *) modify->compute[icompute]; + compute_event = dynamic_cast( modify->compute[icompute]); compute_event->reset_extra_compute_fix("hyper_event"); // reset reneighboring criteria since will perform minimizations diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index 3136bdae7c..a811dabfd5 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -178,7 +178,7 @@ void NEB::run() if (fixes.size() != 1) error->all(FLERR,"NEB requires use of exactly one fix neb instance"); - fneb = (FixNEB *) fixes[0]; + fneb = dynamic_cast( fixes[0]); if (verbose) numall =7; else numall = 4; memory->create(all,nreplica,numall,"neb:all"); @@ -423,7 +423,7 @@ void NEB::readfile(char *file, int flag) error->all(FLERR,"Incorrectly formatted NEB file"); } - char *buffer = new char[CHUNK*MAXLINE]; + auto buffer = new char[CHUNK*MAXLINE]; double fraction = ireplica/(nreplica-1.0); double **x = atom->x; int nlocal = atom->nlocal; @@ -625,56 +625,29 @@ void NEB::print_status() } if (me_universe == 0) { - const double todeg=180.0/MY_PI; - FILE *uscreen = universe->uscreen; - FILE *ulogfile = universe->ulogfile; - if (uscreen) { - fprintf(uscreen,BIGINT_FORMAT " %12.8g %12.8g ", - update->ntimestep,fmaxreplica,fmaxatom); - fprintf(uscreen,"%12.8g %12.8g %12.8g ", - gradvnorm0,gradvnorm1,gradvnormc); - fprintf(uscreen,"%12.8g %12.8g %12.8g ",ebf,ebr,endpt); - for (int i = 0; i < nreplica; i++) - fprintf(uscreen,"%12.8g %12.8g ",rdist[i],all[i][0]); - if (verbose) { - fprintf(uscreen,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g", - NAN,180-acos(all[0][5])*todeg,180-acos(all[0][6])*todeg, - all[0][3],freplica[0],fmaxatomInRepl[0]); - for (int i = 1; i < nreplica-1; i++) - fprintf(uscreen,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g", - 180-acos(all[i][4])*todeg,180-acos(all[i][5])*todeg, - 180-acos(all[i][6])*todeg,all[i][3],freplica[i], - fmaxatomInRepl[i]); - fprintf(uscreen,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g", - NAN,180-acos(all[nreplica-1][5])*todeg,NAN,all[nreplica-1][3], - freplica[nreplica-1],fmaxatomInRepl[nreplica-1]); - } - fprintf(uscreen,"\n"); + constexpr double todeg=180.0/MY_PI; + std::string mesg = fmt::format("{} {:12.8g} {:12.8g} ",update->ntimestep,fmaxreplica,fmaxatom); + mesg += fmt::format("{:12.8g} {:12.8g} {:12.8g} ",gradvnorm0,gradvnorm1,gradvnormc); + mesg += fmt::format("{:12.8g} {:12.8g} {:12.8g} ",ebf,ebr,endpt); + for (int i = 0; i < nreplica; i++) mesg += fmt::format("{:12.8g} {:12.8g} ",rdist[i],all[i][0]); + if (verbose) { + mesg += fmt::format("{:12.5g} {:12.5g} {:12.5g} {:12.5g} {:12.5g} {:12.5g}", + NAN,180-acos(all[0][5])*todeg,180-acos(all[0][6])*todeg, + all[0][3],freplica[0],fmaxatomInRepl[0]); + for (int i = 1; i < nreplica-1; i++) + mesg += fmt::format("{:12.5g} {:12.5g} {:12.5g} {:12.5g} {:12.5g} {:12.5g}", + 180-acos(all[i][4])*todeg,180-acos(all[i][5])*todeg, + 180-acos(all[i][6])*todeg,all[i][3],freplica[i],fmaxatomInRepl[i]); + mesg += fmt::format("{:12.5g} {:12.5g} {:12.5g} {:12.5g} {:12.5g} {:12.5g}", + NAN,180-acos(all[nreplica-1][5])*todeg,NAN,all[nreplica-1][3], + freplica[nreplica-1],fmaxatomInRepl[nreplica-1]); } + mesg += "\n"; - if (ulogfile) { - fprintf(ulogfile,BIGINT_FORMAT " %12.8g %12.8g ", - update->ntimestep,fmaxreplica,fmaxatom); - fprintf(ulogfile,"%12.8g %12.8g %12.8g ", - gradvnorm0,gradvnorm1,gradvnormc); - fprintf(ulogfile,"%12.8g %12.8g %12.8g ",ebf,ebr,endpt); - for (int i = 0; i < nreplica; i++) - fprintf(ulogfile,"%12.8g %12.8g ",rdist[i],all[i][0]); - if (verbose) { - fprintf(ulogfile,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g", - NAN,180-acos(all[0][5])*todeg,180-acos(all[0][6])*todeg, - all[0][3],freplica[0],fmaxatomInRepl[0]); - for (int i = 1; i < nreplica-1; i++) - fprintf(ulogfile,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g", - 180-acos(all[i][4])*todeg,180-acos(all[i][5])*todeg, - 180-acos(all[i][6])*todeg,all[i][3],freplica[i], - fmaxatomInRepl[i]); - fprintf(ulogfile,"%12.5g %12.5g %12.5g %12.5g %12.5g %12.5g", - NAN,180-acos(all[nreplica-1][5])*todeg,NAN,all[nreplica-1][3], - freplica[nreplica-1],fmaxatomInRepl[nreplica-1]); - } - fprintf(ulogfile,"\n"); - fflush(ulogfile); + if (universe->uscreen) fputs(mesg.c_str(), universe->uscreen); + if (universe->ulogfile) { + fputs(mesg.c_str(), universe->ulogfile); + fflush(universe->ulogfile); } } } diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index 501e7675a8..671bb49b64 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -167,7 +167,7 @@ void PRD::command(int narg, char **arg) // create FixEventPRD class to store event and pre-quench states - fix_event = (FixEventPRD *) modify->add_fix("prd_event all EVENT/PRD"); + fix_event = dynamic_cast( modify->add_fix("prd_event all EVENT/PRD")); // create Finish for timing output @@ -416,18 +416,10 @@ void PRD::command(int narg, char **arg) neighbor->ndanger = ndanger; if (me_universe == 0) { - if (universe->uscreen) - fprintf(universe->uscreen, - "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT - " atoms\n", - timer->get_wall(Timer::TOTAL),nprocs_universe, - nsteps,atom->natoms); - if (universe->ulogfile) - fprintf(universe->ulogfile, - "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT - " atoms\n", - timer->get_wall(Timer::TOTAL),nprocs_universe, - nsteps,atom->natoms); + auto mesg = fmt::format("Loop time of {} on {} procs for {} steps with {} atoms\n", + timer->get_wall(Timer::TOTAL), nprocs_universe, nsteps,atom->natoms); + if (universe->uscreen) fmt::print(universe->uscreen, mesg); + if (universe->ulogfile) fmt::print(universe->ulogfile, mesg); } if (me == 0) utils::logmesg(lmp,"\nPRD done\n"); @@ -729,24 +721,13 @@ void PRD::log_event() { timer->set_wall(Timer::TOTAL, time_start); if (universe->me == 0) { - if (universe->uscreen) - fprintf(universe->uscreen, - BIGINT_FORMAT " %.3f " BIGINT_FORMAT " %d %d %d %d\n", - fix_event->event_timestep, - timer->elapsed(Timer::TOTAL), - fix_event->clock, - fix_event->event_number,fix_event->correlated_event, - fix_event->ncoincident, - fix_event->replica_number); - if (universe->ulogfile) - fprintf(universe->ulogfile, - BIGINT_FORMAT " %.3f " BIGINT_FORMAT " %d %d %d %d\n", - fix_event->event_timestep, - timer->elapsed(Timer::TOTAL), - fix_event->clock, - fix_event->event_number,fix_event->correlated_event, - fix_event->ncoincident, - fix_event->replica_number); + auto mesg = fmt::format("{} {:.3f} {} {} {} {} {}\n", fix_event->event_timestep, + timer->elapsed(Timer::TOTAL), fix_event->clock, + fix_event->event_number, fix_event->correlated_event, + fix_event->ncoincident, fix_event->replica_number); + + if (universe->uscreen) fmt::print(universe->uscreen, mesg); + if (universe->ulogfile) fmt::print(universe->ulogfile, mesg); } } diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index 0b1cc915c6..91ea2a0a29 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -131,11 +131,11 @@ void TAD::command(int narg, char **arg) // create FixEventTAD object to store last event - fix_event = (FixEventTAD *) modify->add_fix("tad_event all EVENT/TAD"); + fix_event = dynamic_cast( modify->add_fix("tad_event all EVENT/TAD")); // create FixStore object to store revert state - fix_revert = (FixStore *) modify->add_fix("tad_revert all STORE peratom 0 7"); + fix_revert = dynamic_cast( modify->add_fix("tad_revert all STORE peratom 0 7")); // create Finish for timing output @@ -364,18 +364,10 @@ void TAD::command(int narg, char **arg) neighbor->ndanger = ndanger; if (me_universe == 0) { - if (universe->uscreen) - fprintf(universe->uscreen, - "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT - " atoms\n", - timer->get_wall(Timer::TOTAL),nprocs_universe, - nsteps,atom->natoms); - if (universe->ulogfile) - fprintf(universe->ulogfile, - "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT - " atoms\n", - timer->get_wall(Timer::TOTAL),nprocs_universe, - nsteps,atom->natoms); + auto mesg = fmt::format("Loop time of {} on {} procs for {} steps with {} atoms\n", + timer->get_wall(Timer::TOTAL), nprocs_universe, nsteps,atom->natoms); + if (universe->uscreen) fmt::print(universe->uscreen, mesg); + if (universe->ulogfile) fmt::print(universe->ulogfile, mesg); } if ((me_universe == 0) && ulogfile_neb) fclose(ulogfile_neb); @@ -507,24 +499,13 @@ void TAD::log_event(int ievent) timer->set_wall(Timer::TOTAL, time_start); if (universe->me == 0) { double tfrac = 0.0; - if (universe->uscreen) - fprintf(universe->uscreen, - BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n", - fix_event->event_timestep, - timer->elapsed(Timer::TOTAL), - fix_event->event_number,ievent, - "E ", - fix_event->ebarrier,tfrac, - fix_event->tlo,deltfirst); - if (universe->ulogfile) - fprintf(universe->ulogfile, - BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n", - fix_event->event_timestep, - timer->elapsed(Timer::TOTAL), - fix_event->event_number,ievent, - "E ", - fix_event->ebarrier,tfrac, - fix_event->tlo,deltfirst); + auto mesg = fmt::format("{} {:.3f} {} {} {} {:.3f} {:.3f} {:.3f} {:.3f}\n", + fix_event->event_timestep, timer->elapsed(Timer::TOTAL), + fix_event->event_number, ievent, "E ", fix_event->ebarrier, + tfrac, fix_event->tlo, deltfirst); + + if (universe->uscreen) fmt::print(universe->uscreen, mesg); + if (universe->ulogfile) fmt::print(universe->ulogfile, mesg); } // dump snapshot of quenched coords @@ -863,7 +844,7 @@ void TAD::add_event() int ievent = n_event_list++; fix_event_list[ievent] - = (FixEventTAD *) modify->add_fix(fmt::format("tad_event_{} all EVENT/TAD", ievent)); + = dynamic_cast( modify->add_fix(fmt::format("tad_event_{} all EVENT/TAD", ievent))); // store quenched state for new event @@ -891,7 +872,7 @@ void TAD::compute_tlo(int ievent) // update first event - char* statstr = (char *) "D "; + auto statstr = (char *) "D "; if (ievent == 0) { deltfirst = deltlo; @@ -909,26 +890,14 @@ void TAD::compute_tlo(int ievent) if (universe->me == 0) { double tfrac = 0.0; if (ievent > 0) tfrac = delthi/deltstop; + auto mesg = fmt::format("{} {:.3f} {} {} {} {:.3f} {:.3f} {:.3f} {:.3f}\n", + fix_event_list[ievent]->event_timestep, timer->elapsed(Timer::TOTAL), + fix_event->event_number, ievent, statstr, ebarrier, tfrac, + fix_event->tlo, deltlo); - if (universe->uscreen) - fprintf(universe->uscreen, - BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n", - fix_event_list[ievent]->event_timestep, - timer->elapsed(Timer::TOTAL), - fix_event->event_number, - ievent,statstr,ebarrier,tfrac, - fix_event->tlo,deltlo); - - if (universe->ulogfile) - fprintf(universe->ulogfile, - BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n", - fix_event_list[ievent]->event_timestep, - timer->elapsed(Timer::TOTAL), - fix_event->event_number, - ievent,statstr,ebarrier,tfrac, - fix_event->tlo,deltlo); + if (universe->uscreen) fmt::print(universe->uscreen, mesg); + if (universe->ulogfile) fmt::print(universe->ulogfile, mesg); } - } /* ---------------------------------------------------------------------- diff --git a/src/REPLICA/temper.cpp b/src/REPLICA/temper.cpp index f31705213e..1bac1aea92 100644 --- a/src/REPLICA/temper.cpp +++ b/src/REPLICA/temper.cpp @@ -366,17 +366,15 @@ void Temper::scale_velocities(int t_partner, int t_me) void Temper::print_status() { - if (universe->uscreen) { - fprintf(universe->uscreen,BIGINT_FORMAT,update->ntimestep); - for (int i = 0; i < nworlds; i++) - fprintf(universe->uscreen," %d",world2temp[i]); - fprintf(universe->uscreen,"\n"); - } + std::string status = std::to_string(update->ntimestep); + for (int i = 0; i < nworlds; i++) + status += " " + std::to_string(world2temp[i]); + + status += "\n"; + + if (universe->uscreen) fputs(status.c_str(), universe->uscreen); if (universe->ulogfile) { - fprintf(universe->ulogfile,BIGINT_FORMAT,update->ntimestep); - for (int i = 0; i < nworlds; i++) - fprintf(universe->ulogfile," %d",world2temp[i]); - fprintf(universe->ulogfile,"\n"); + fputs(status.c_str(), universe->ulogfile); fflush(universe->ulogfile); } } diff --git a/src/REPLICA/temper_grem.cpp b/src/REPLICA/temper_grem.cpp index d50d0c6b4d..72dd331491 100644 --- a/src/REPLICA/temper_grem.cpp +++ b/src/REPLICA/temper_grem.cpp @@ -82,7 +82,7 @@ void TemperGrem::command(int narg, char **arg) if (strcmp(arg[3],modify->fix[whichfix]->id) == 0) break; if (whichfix == modify->nfix) error->universe_all(FLERR,"Tempering fix ID is not defined"); - fix_grem = (FixGrem*)(modify->fix[whichfix]); + fix_grem = dynamic_cast(modify->fix[whichfix]); // Check input values lambdas should be equal, assign other gREM values if (lambda != fix_grem->lambda) @@ -103,7 +103,7 @@ void TemperGrem::command(int narg, char **arg) int pressflag = fix_grem->pressflag; // fix_grem does all the checking... if (pressflag) { - double *p_start = (double *) nh->extract("p_start",ifix); + auto p_start = (double *) nh->extract("p_start",ifix); pressref = p_start[0]; } @@ -374,17 +374,15 @@ void TemperGrem::command(int narg, char **arg) void TemperGrem::print_status() { - if (universe->uscreen) { - fprintf(universe->uscreen,BIGINT_FORMAT,update->ntimestep); - for (int i = 0; i < nworlds; i++) - fprintf(universe->uscreen," %d",world2lambda[i]); - fprintf(universe->uscreen,"\n"); - } + std::string status = std::to_string(update->ntimestep); + for (int i = 0; i < nworlds; i++) + status += " " + std::to_string(world2lambda[i]); + + status += "\n"; + + if (universe->uscreen) fputs(status.c_str(), universe->uscreen); if (universe->ulogfile) { - fprintf(universe->ulogfile,BIGINT_FORMAT,update->ntimestep); - for (int i = 0; i < nworlds; i++) - fprintf(universe->ulogfile," %d",world2lambda[i]); - fprintf(universe->ulogfile,"\n"); + fputs(status.c_str(), universe->ulogfile); fflush(universe->ulogfile); } } diff --git a/src/REPLICA/temper_npt.cpp b/src/REPLICA/temper_npt.cpp index 700aa582db..eaf429380f 100644 --- a/src/REPLICA/temper_npt.cpp +++ b/src/REPLICA/temper_npt.cpp @@ -381,17 +381,15 @@ void TemperNPT::scale_velocities(int t_partner, int t_me) void TemperNPT::print_status() { - if (universe->uscreen) { - fprintf(universe->uscreen,BIGINT_FORMAT,update->ntimestep); - for (int i = 0; i < nworlds; i++) - fprintf(universe->uscreen," %d",world2temp[i]); - fprintf(universe->uscreen,"\n"); - } + std::string status = std::to_string(update->ntimestep); + for (int i = 0; i < nworlds; i++) + status += " " + std::to_string(world2temp[i]); + + status += "\n"; + + if (universe->uscreen) fputs(status.c_str(), universe->uscreen); if (universe->ulogfile) { - fprintf(universe->ulogfile,BIGINT_FORMAT,update->ntimestep); - for (int i = 0; i < nworlds; i++) - fprintf(universe->ulogfile," %d",world2temp[i]); - fprintf(universe->ulogfile,"\n"); + fputs(status.c_str(), universe->ulogfile); fflush(universe->ulogfile); } } diff --git a/src/RIGID/compute_erotate_rigid.cpp b/src/RIGID/compute_erotate_rigid.cpp index 4217aa8e0a..6e51e4853f 100644 --- a/src/RIGID/compute_erotate_rigid.cpp +++ b/src/RIGID/compute_erotate_rigid.cpp @@ -66,8 +66,8 @@ double ComputeERotateRigid::compute_scalar() if (strncmp(modify->fix[irfix]->style,"rigid",5) == 0) { if (strstr(modify->fix[irfix]->style,"/small")) { - scalar = ((FixRigidSmall *) modify->fix[irfix])->extract_erotational(); - } else scalar = ((FixRigid *) modify->fix[irfix])->extract_erotational(); + scalar = (dynamic_cast( modify->fix[irfix]))->extract_erotational(); + } else scalar = (dynamic_cast( modify->fix[irfix]))->extract_erotational(); } scalar *= force->mvv2e; return scalar; diff --git a/src/RIGID/compute_ke_rigid.cpp b/src/RIGID/compute_ke_rigid.cpp index 48f04e9cff..1b858dea15 100644 --- a/src/RIGID/compute_ke_rigid.cpp +++ b/src/RIGID/compute_ke_rigid.cpp @@ -65,8 +65,8 @@ double ComputeKERigid::compute_scalar() if (strncmp(modify->fix[irfix]->style,"rigid",5) == 0) { if (strstr(modify->fix[irfix]->style,"/small")) { - scalar = ((FixRigidSmall *) modify->fix[irfix])->extract_ke(); - } else scalar = ((FixRigid *) modify->fix[irfix])->extract_ke(); + scalar = (dynamic_cast( modify->fix[irfix]))->extract_ke(); + } else scalar = (dynamic_cast( modify->fix[irfix]))->extract_ke(); } scalar *= force->mvv2e; return scalar; diff --git a/src/RIGID/compute_rigid_local.cpp b/src/RIGID/compute_rigid_local.cpp index 44708c7730..21b232fdfe 100644 --- a/src/RIGID/compute_rigid_local.cpp +++ b/src/RIGID/compute_rigid_local.cpp @@ -111,7 +111,7 @@ void ComputeRigidLocal::init() int ifix = modify->find_fix(idrigid); if (ifix < 0) error->all(FLERR,"FixRigidSmall ID for compute rigid/local does not exist"); - fixrigid = (FixRigidSmall *) modify->fix[ifix]; + fixrigid = dynamic_cast( modify->fix[ifix]); int flag = 0; if (strstr(fixrigid->style,"rigid/") == nullptr) flag = 1; diff --git a/src/RIGID/fix_ehex.cpp b/src/RIGID/fix_ehex.cpp index 866d5b81b7..01fe76757b 100644 --- a/src/RIGID/fix_ehex.cpp +++ b/src/RIGID/fix_ehex.cpp @@ -196,7 +196,7 @@ void FixEHEX::init() if (cnt_shake > 1) error->all(FLERR,"Multiple instances of fix shake/rattle detected (not supported yet)"); else if (cnt_shake == 1) { - fshake = ((FixShake*) modify->fix[id_shake]); + fshake = (dynamic_cast( modify->fix[id_shake])); } else if (cnt_shake == 0) error->all(FLERR, "Fix ehex was configured with keyword constrain, but shake/rattle was not defined"); diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 6b211d05bf..f21d46d576 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -156,7 +156,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Variable {} for fix rigid/small custom does not exist", arg[4]+2); if (input->variable->atomstyle(ivariable) == 0) error->all(FLERR,"Fix rigid custom variable {} is not atom-style variable", arg[4]+2); - double *value = new double[nlocal]; + auto value = new double[nlocal]; input->variable->compute_atom(ivariable,0,value,1,0); int minval = INT_MAX; for (i = 0; i < nlocal; i++) @@ -676,9 +676,9 @@ void FixRigid::init() // atom style pointers to particles that store extra info - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - avec_line = (AtomVecLine *) atom->style_match("line"); - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + avec_line = dynamic_cast( atom->style_match("line")); + avec_tri = dynamic_cast( atom->style_match("tri")); // warn if more than one rigid fix // if earlyflag, warn if any post-force fixes come after a rigid fix @@ -693,7 +693,8 @@ void FixRigid::init() for (auto ifix : modify->get_fix_list()) { if (ifix->rigid_flag) rflag = true; if ((comm->me == 0) && rflag && (ifix->setmask() & POST_FORCE) && !ifix->rigid_flag) - error->warning(FLERR,"Fix {} alters forces after fix rigid", ifix->id); + error->warning(FLERR,"Fix {} with ID {} alters forces after fix rigid", + ifix->style, ifix->id); } } @@ -736,7 +737,7 @@ void FixRigid::init() dtq = 0.5 * update->dt; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = ((Respa *) update->integrate)->step; + step_respa = (dynamic_cast( update->integrate))->step; // setup rigid bodies, using current atom info. if reinitflag is not set, // do the initialization only once, b/c properties may not be re-computable @@ -2287,7 +2288,7 @@ void FixRigid::readfile(int which, double *vec, double **array1, double **array2 if (nlines == 0) return; else if (nlines < 0) error->all(FLERR,"Fix rigid infile has incorrect format"); - char *buffer = new char[CHUNK*MAXLINE]; + auto buffer = new char[CHUNK*MAXLINE]; int nread = 0; while (nread < nlines) { nchunk = MIN(nlines-nread,CHUNK); diff --git a/src/RIGID/fix_rigid_nh.cpp b/src/RIGID/fix_rigid_nh.cpp index 943d7225ba..622a2f86b0 100644 --- a/src/RIGID/fix_rigid_nh.cpp +++ b/src/RIGID/fix_rigid_nh.cpp @@ -172,7 +172,7 @@ FixRigidNH::~FixRigidNH() deallocate_order(); } - if (rfix) delete [] rfix; + delete[] rfix; if (tcomputeflag) modify->delete_compute(id_temp); delete [] id_temp; @@ -270,7 +270,7 @@ void FixRigidNH::init() for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = ((FixDeform *) modify->fix[i])->dimflag; + int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2])) error->all(FLERR,"Cannot use fix rigid npt/nph and fix deform on " @@ -303,7 +303,7 @@ void FixRigidNH::init() // rfix[] = indices to each fix rigid // this will include self - if (rfix) delete [] rfix; + delete[] rfix; nrigidfix = 0; rfix = nullptr; @@ -1162,7 +1162,7 @@ void FixRigidNH::write_restart(FILE *fp) void FixRigidNH::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; int flag = static_cast (list[n++]); if (flag) { diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp index 8b773a30ea..bd8db90827 100644 --- a/src/RIGID/fix_rigid_nh_small.cpp +++ b/src/RIGID/fix_rigid_nh_small.cpp @@ -184,7 +184,7 @@ FixRigidNHSmall::~FixRigidNHSmall() deallocate_order(); } - if (rfix) delete [] rfix; + delete[] rfix; if (tcomputeflag) modify->delete_compute(id_temp); delete [] id_temp; @@ -268,7 +268,7 @@ void FixRigidNHSmall::init() for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = ((FixDeform *) modify->fix[i])->dimflag; + int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2])) error->all(FLERR,"Cannot use fix rigid npt/nph and fix deform on " @@ -301,7 +301,7 @@ void FixRigidNHSmall::init() // rfix[] = indices to each fix rigid // this will include self - if (rfix) delete [] rfix; + delete[] rfix; nrigidfix = 0; rfix = nullptr; @@ -1272,7 +1272,7 @@ void FixRigidNHSmall::write_restart(FILE *fp) void FixRigidNHSmall::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; int flag = static_cast (list[n++]); if (flag) { diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 5c524c832b..ec3e58d5f5 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -139,7 +139,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (input->variable->atomstyle(ivariable) == 0) error->all(FLERR,"Fix rigid/small custom variable {} is not atom-style variable", arg[4]+2); - double *value = new double[nlocal]; + auto value = new double[nlocal]; input->variable->compute_atom(ivariable,0,value,1,0); int minval = INT_MAX; for (i = 0; i < nlocal; i++) @@ -432,9 +432,9 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : // atom style pointers to particles that store extra info - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - avec_line = (AtomVecLine *) atom->style_match("line"); - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + avec_line = dynamic_cast( atom->style_match("line")); + avec_tri = dynamic_cast( atom->style_match("tri")); // compute per body forces and torques inside final_integrate() by default @@ -538,7 +538,8 @@ void FixRigidSmall::init() for (auto ifix : modify->get_fix_list()) { if (ifix->rigid_flag) rflag = true; if ((comm->me == 0) && rflag && (ifix->setmask() & POST_FORCE) && !ifix->rigid_flag) - error->warning(FLERR,"Fix {} alters forces after fix rigid", ifix->id); + error->warning(FLERR,"Fix {} with ID {} alters forces after fix rigid/small", + ifix->style, ifix->id); } } @@ -581,7 +582,7 @@ void FixRigidSmall::init() dtq = 0.5 * update->dt; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = ((Respa *) update->integrate)->step; + step_respa = (dynamic_cast( update->integrate))->step; } /* ---------------------------------------------------------------------- @@ -1572,8 +1573,7 @@ void FixRigidSmall::create_bodies(tagint *bodyID) int *proclist; memory->create(proclist,ncount,"rigid/small:proclist"); - InRvous *inbuf = (InRvous *) - memory->smalloc(ncount*sizeof(InRvous),"rigid/small:inbuf"); + auto inbuf = (InRvous *) memory->smalloc(ncount*sizeof(InRvous),"rigid/small:inbuf"); // setup buf to pass to rendezvous comm // one BodyMsg datum for each constituent atom @@ -1606,7 +1606,7 @@ void FixRigidSmall::create_bodies(tagint *bodyID) 0,proclist, rendezvous_body,0,buf,sizeof(OutRvous), (void *) this); - OutRvous *outbuf = (OutRvous *) buf; + auto outbuf = (OutRvous *) buf; memory->destroy(proclist); memory->sfree(inbuf); @@ -1648,7 +1648,7 @@ int FixRigidSmall::rendezvous_body(int n, char *inbuf, double *x,*xown,*rsqclose; double **bbox,**ctr; - FixRigidSmall *frsptr = (FixRigidSmall *) ptr; + auto frsptr = (FixRigidSmall *) ptr; Memory *memory = frsptr->memory; Error *error = frsptr->error; MPI_Comm world = frsptr->world; @@ -1660,7 +1660,7 @@ int FixRigidSmall::rendezvous_body(int n, char *inbuf, // key = body ID // value = index into Ncount-length data structure - InRvous *in = (InRvous *) inbuf; + auto in = (InRvous *) inbuf; std::map hash; tagint id; @@ -1755,8 +1755,7 @@ int FixRigidSmall::rendezvous_body(int n, char *inbuf, int nout = n; memory->create(proclist,nout,"rigid/small:proclist"); - OutRvous *out = (OutRvous *) - memory->smalloc(nout*sizeof(OutRvous),"rigid/small:out"); + auto out = (OutRvous *) memory->smalloc(nout*sizeof(OutRvous),"rigid/small:out"); for (i = 0; i < nout; i++) { proclist[i] = in[i].me; @@ -2498,7 +2497,7 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody) if (nlines == 0) return; else if (nlines < 0) error->all(FLERR,"Fix rigid infile has incorrect format"); - char *buffer = new char[CHUNK*MAXLINE]; + auto buffer = new char[CHUNK*MAXLINE]; int nread = 0; while (nread < nlines) { nchunk = MIN(nlines-nread,CHUNK); diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index f012789414..d74f72fb69 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -367,10 +367,10 @@ void FixShake::init() if (utils::strmatch(update->integrate_style,"^respa")) { if (update->whichflag > 0) { auto fixes = modify->get_fix_by_style("^RESPA"); - if (fixes.size() > 0) fix_respa = (FixRespa *) fixes.front(); + if (fixes.size() > 0) fix_respa = dynamic_cast( fixes.front()); else error->all(FLERR,"Run style respa did not create fix RESPA"); } - Respa *respa_style = (Respa *) update->integrate; + auto respa_style = dynamic_cast( update->integrate); nlevels_respa = respa_style->nlevels; loop_respa = respa_style->loop; step_respa = respa_style->step; @@ -1035,8 +1035,7 @@ void FixShake::atom_owners() int *proclist; memory->create(proclist,nlocal,"shake:proclist"); - IDRvous *idbuf = (IDRvous *) - memory->smalloc((bigint) nlocal*sizeof(IDRvous),"shake:idbuf"); + auto idbuf = (IDRvous *) memory->smalloc((bigint) nlocal*sizeof(IDRvous),"shake:idbuf"); // setup input buf to rendezvous comm // input datums = pairs of bonded atoms @@ -1085,8 +1084,7 @@ void FixShake::partner_info(int *npartner, tagint **partner_tag, int *proclist; memory->create(proclist,nsend,"special:proclist"); - PartnerInfo *inbuf = (PartnerInfo *) - memory->smalloc((bigint) nsend*sizeof(PartnerInfo),"special:inbuf"); + auto inbuf = (PartnerInfo *) memory->smalloc((bigint) nsend*sizeof(PartnerInfo),"special:inbuf"); // set values in 4 partner arrays for all partner atoms I own // also setup input buf to rendezvous comm @@ -1164,7 +1162,7 @@ void FixShake::partner_info(int *npartner, tagint **partner_tag, rendezvous_partners_info, 0,buf,sizeof(PartnerInfo), (void *) this); - PartnerInfo *outbuf = (PartnerInfo *) buf; + auto outbuf = (PartnerInfo *) buf; memory->destroy(proclist); memory->sfree(inbuf); @@ -1214,8 +1212,7 @@ void FixShake::nshake_info(int *npartner, tagint **partner_tag, int *proclist; memory->create(proclist,nsend,"special:proclist"); - NShakeInfo *inbuf = (NShakeInfo *) - memory->smalloc((bigint) nsend*sizeof(NShakeInfo),"special:inbuf"); + auto inbuf = (NShakeInfo *) memory->smalloc((bigint) nsend*sizeof(NShakeInfo),"special:inbuf"); // set partner_nshake for all partner atoms I own // also setup input buf to rendezvous comm @@ -1252,7 +1249,7 @@ void FixShake::nshake_info(int *npartner, tagint **partner_tag, 0,proclist, rendezvous_nshake,0,buf,sizeof(NShakeInfo), (void *) this); - NShakeInfo *outbuf = (NShakeInfo *) buf; + auto outbuf = (NShakeInfo *) buf; memory->destroy(proclist); memory->sfree(inbuf); @@ -1293,8 +1290,7 @@ void FixShake::shake_info(int *npartner, tagint **partner_tag, int *proclist; memory->create(proclist,nsend,"special:proclist"); - ShakeInfo *inbuf = (ShakeInfo *) - memory->smalloc((bigint) nsend*sizeof(ShakeInfo),"special:inbuf"); + auto inbuf = (ShakeInfo *) memory->smalloc((bigint) nsend*sizeof(ShakeInfo),"special:inbuf"); // set 3 shake arrays for all partner atoms I own // also setup input buf to rendezvous comm @@ -1345,7 +1341,7 @@ void FixShake::shake_info(int *npartner, tagint **partner_tag, 0,proclist, rendezvous_shake,0,buf,sizeof(ShakeInfo), (void *) this); - ShakeInfo *outbuf = (ShakeInfo *) buf; + auto outbuf = (ShakeInfo *) buf; memory->destroy(proclist); memory->sfree(inbuf); @@ -1377,7 +1373,7 @@ int FixShake::rendezvous_ids(int n, char *inbuf, int &flag, int *& /*proclist*/, char *& /*outbuf*/, void *ptr) { - FixShake *fsptr = (FixShake *) ptr; + auto fsptr = (FixShake *) ptr; Memory *memory = fsptr->memory; tagint *atomIDs; @@ -1386,7 +1382,7 @@ int FixShake::rendezvous_ids(int n, char *inbuf, memory->create(atomIDs,n,"special:atomIDs"); memory->create(procowner,n,"special:procowner"); - IDRvous *in = (IDRvous *) inbuf; + auto in = (IDRvous *) inbuf; for (int i = 0; i < n; i++) { atomIDs[i] = in[i].atomID; @@ -1417,7 +1413,7 @@ int FixShake::rendezvous_partners_info(int n, char *inbuf, { int i,m; - FixShake *fsptr = (FixShake *) ptr; + auto fsptr = (FixShake *) ptr; Atom *atom = fsptr->atom; Memory *memory = fsptr->memory; @@ -1437,7 +1433,7 @@ int FixShake::rendezvous_partners_info(int n, char *inbuf, // proclist = owner of atomID in caller decomposition // outbuf = info about owned atomID = 4 values - PartnerInfo *in = (PartnerInfo *) inbuf; + auto in = (PartnerInfo *) inbuf; int *procowner = fsptr->procowner; memory->create(proclist,n,"shake:proclist"); @@ -1472,7 +1468,7 @@ int FixShake::rendezvous_nshake(int n, char *inbuf, { int i,m; - FixShake *fsptr = (FixShake *) ptr; + auto fsptr = (FixShake *) ptr; Atom *atom = fsptr->atom; Memory *memory = fsptr->memory; @@ -1492,7 +1488,7 @@ int FixShake::rendezvous_nshake(int n, char *inbuf, // proclist = owner of atomID in caller decomposition // outbuf = info about owned atomID - NShakeInfo *in = (NShakeInfo *) inbuf; + auto in = (NShakeInfo *) inbuf; int *procowner = fsptr->procowner; memory->create(proclist,n,"shake:proclist"); @@ -1526,7 +1522,7 @@ int FixShake::rendezvous_shake(int n, char *inbuf, { int i,m; - FixShake *fsptr = (FixShake *) ptr; + auto fsptr = (FixShake *) ptr; Atom *atom = fsptr->atom; Memory *memory = fsptr->memory; @@ -1546,7 +1542,7 @@ int FixShake::rendezvous_shake(int n, char *inbuf, // proclist = owner of atomID in caller decomposition // outbuf = info about owned atomID - ShakeInfo *in = (ShakeInfo *) inbuf; + auto in = (ShakeInfo *) inbuf; int *procowner = fsptr->procowner; memory->create(proclist,n,"shake:proclist"); @@ -2564,8 +2560,7 @@ void FixShake::stats() if (me == 0) { const int width = log10((MAX(MAX(1,nb),na)))+2; - auto mesg = fmt::format("SHAKE stats (type/ave/delta/count) on step {}\n", - update->ntimestep); + auto mesg = fmt::format("SHAKE stats (type/ave/delta/count) on step {}\n", update->ntimestep); for (i = 1; i < nb; i++) { const auto bcnt = b_count_all[i]; if (bcnt) @@ -3031,9 +3026,9 @@ void FixShake::shake_end_of_step(int vflag) { // apply correction to all rRESPA levels for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - ((Respa *) update->integrate)->copy_flevel_f(ilevel); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); FixShake::post_force_respa(vflag,ilevel,loop_respa[ilevel]-1); - ((Respa *) update->integrate)->copy_f_flevel(ilevel); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); } if (!rattle) dtf_inner = step_respa[0] * force->ftm2v; } diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp index 38bba33adf..63a3d8c839 100644 --- a/src/SHOCK/fix_append_atoms.cpp +++ b/src/SHOCK/fix_append_atoms.cpp @@ -264,8 +264,8 @@ int FixAppendAtoms::get_spatial() else failed = 0; count++; } - double *pos = new double[count-2]; - double *val = new double[count-2]; + auto pos = new double[count-2]; + auto val = new double[count-2]; for (int loop=0; loop < count-2; loop++) { pos[loop] = fix->compute_vector(2*loop); val[loop] = fix->compute_vector(2*loop+1); diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp index ae1d0f4cd5..35010fc31c 100644 --- a/src/SHOCK/fix_msst.cpp +++ b/src/SHOCK/fix_msst.cpp @@ -302,7 +302,7 @@ void FixMSST::init() if (dftb) { for (int i = 0; i < modify->nfix; i++) if (utils::strmatch(modify->fix[i]->style,"^external$")) - fix_external = (FixExternal *) modify->fix[i]; + fix_external = dynamic_cast( modify->fix[i]); if (fix_external == nullptr) error->all(FLERR,"Fix msst dftb cannot be used w/out fix external"); } @@ -815,7 +815,7 @@ void FixMSST::write_restart(FILE *fp) void FixMSST::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; omega[direction] = list[n++]; e0 = list[n++]; v0 = list[n++]; diff --git a/src/SHOCK/fix_nphug.cpp b/src/SHOCK/fix_nphug.cpp index ff1025c840..46a3ccf0ef 100644 --- a/src/SHOCK/fix_nphug.cpp +++ b/src/SHOCK/fix_nphug.cpp @@ -395,7 +395,7 @@ int FixNPHug::size_restart_global() void FixNPHug::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; e0 = list[n++]; v0 = list[n++]; p0 = list[n++]; diff --git a/src/SHOCK/fix_wall_piston.cpp b/src/SHOCK/fix_wall_piston.cpp index be2d51f2c4..d27a58e6d9 100644 --- a/src/SHOCK/fix_wall_piston.cpp +++ b/src/SHOCK/fix_wall_piston.cpp @@ -202,8 +202,7 @@ void FixWallPiston::post_integrate() if (zloflag) { zlo = z0 + 0.5 * paccelz * tt; vz = paccelz * t; } - } - else if (rampNL1flag) { + } else if (rampNL1flag) { paccelz = maxvz / tott; angfreq = MY_2PI / (0.5 * tott); @@ -211,11 +210,8 @@ void FixWallPiston::post_integrate() zlo = z0 + paccelz * (0.5*tt + 1.0/(angfreq*angfreq) - 1.0/(angfreq*angfreq)*cos(angfreq*t)); vz = paccelz * (t + 1.0/angfreq*sin(angfreq*t)); - } - else error->all(FLERR, - "NL ramp in wall/piston only implemented in zlo for now"); - } - else if (rampNL2flag) { + } else error->all(FLERR, "NL ramp in wall/piston only implemented in zlo for now"); + } else if (rampNL2flag) { paccelz = maxvz / tott; angfreq = 3.0*MY_2PI / tott; @@ -225,55 +221,35 @@ void FixWallPiston::post_integrate() 1.0/(6.0*angfreq*angfreq)*(1.0-cos(2.0*angfreq*t))); vz = paccelz * (t + 4.0/(3.0*angfreq)*sin(angfreq*t) + 1.0/(3.0*angfreq)*sin(2.0*angfreq*t)); - } - else error->all(FLERR, - "NL ramp in wall/piston only implemented in zlo for now"); - } - else if (rampNL3flag) { + } else error->all(FLERR, "NL ramp in wall/piston only implemented in zlo for now"); + } else if (rampNL3flag) { paccelz = maxvz / tott; if (zloflag) { zlo = z0 + paccelz*tott*tott/2.5 * (t2p5 ); vz = paccelz * tott * (t1p5 ); - } - else error->all(FLERR, - "NL ramp in wall/piston only implemented in zlo for now"); - } - else if (rampNL4flag) { + } else error->all(FLERR, "NL ramp in wall/piston only implemented in zlo for now"); + } else if (rampNL4flag) { paccelz = maxvz / tott; if (zloflag) { zlo = z0 + paccelz/tott/3.0 * (ttt); vz = paccelz / tott * (tt); - } - else error->all(FLERR, - "NL ramp in wall/piston only implemented in zlo for now"); - } - else if (rampNL5flag) { + } else error->all(FLERR, "NL ramp in wall/piston only implemented in zlo for now"); + } else if (rampNL5flag) { paccelz = maxvz / tott; if (zloflag) { zlo = z0 + paccelz/tott/tott/4.0 * (tttt); vz = paccelz / tott / tott * (ttt); - } - else error->all(FLERR, - "NL ramp in wall/piston only implemented in zlo for now"); - } - else { + } else error->all(FLERR, "NL ramp in wall/piston only implemented in zlo for now"); + } else { if (zloflag) { zlo = z0 + vz * t; } } - if (update->ntimestep % 1000 == 0) - if (comm->me == 0) { - if (screen) - fprintf(screen,"SHOCK: step " BIGINT_FORMAT - " t %g zpos %g vz %g az %g zlo %g\n", - update->ntimestep, t, zlo, vz, paccelz, domain->boxlo[2]); - if (logfile) - fprintf(logfile,"SHOCK: step " BIGINT_FORMAT - " t %g zpos %g vz %g az %g zlo %g\n", - update->ntimestep, t, zlo, vz, paccelz, domain->boxlo[2]); - } + if ((update->ntimestep % 1000 == 0) && (comm->me == 0)) + utils::logmesg(lmp,"SHOCK: step {} t {} zpos {} vz {} az {} zlo {}\n", + update->ntimestep, t, zlo, vz, paccelz, domain->boxlo[2]); // VIRIAL PRESSURE CONTRIBUTION? diff --git a/src/SPIN/compute_spin.cpp b/src/SPIN/compute_spin.cpp index 174cec7d59..a6dfdf79d2 100644 --- a/src/SPIN/compute_spin.cpp +++ b/src/SPIN/compute_spin.cpp @@ -84,7 +84,7 @@ void ComputeSpin::init() // loop 1: obtain # of Pairs, and # of Pair/Spin styles - PairHybrid *hybrid = (PairHybrid *)force->pair_match("^hybrid",0); + PairHybrid *hybrid = dynamic_cast(force->pair_match("^hybrid",0)); if (force->pair_match("^spin",0,0)) { // only one Pair/Spin style pair = force->pair_match("^spin",0,0); if (hybrid == nullptr) npairs = 1; @@ -112,11 +112,11 @@ void ComputeSpin::init() int count = 0; if (npairspin == 1) { count = 1; - spin_pairs[0] = (PairSpin *) force->pair_match("^spin",0,0); + spin_pairs[0] = dynamic_cast( force->pair_match("^spin",0,0)); } else if (npairspin > 1) { for (int i = 0; ipair_match("^spin",0,i)) { - spin_pairs[count] = (PairSpin *) force->pair_match("^spin",0,i); + spin_pairs[count] = dynamic_cast( force->pair_match("^spin",0,i)); count++; } } @@ -141,7 +141,7 @@ void ComputeSpin::init() for (iforce = 0; iforce < modify->nfix; iforce++) { if (utils::strmatch(modify->fix[iforce]->style,"^precession/spin")) { precession_spin_flag = 1; - lockprecessionspin = (FixPrecessionSpin *) modify->fix[iforce]; + lockprecessionspin = dynamic_cast( modify->fix[iforce]); } } } diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index 7d9af83d12..a29ce8aa2c 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -119,9 +119,9 @@ void FixLangevinSpin::init() void FixLangevinSpin::setup(int vflag) { if (utils::strmatch(update->integrate_style,"^respa")) { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); } else post_force(vflag); } diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index 970af9c4fb..062f3c1b00 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -178,7 +178,7 @@ void FixNVESpin::init() // loop 1: obtain # of Pairs, and # of Pair/Spin styles npairspin = 0; - PairHybrid *hybrid = (PairHybrid *)force->pair_match("^hybrid",0); + PairHybrid *hybrid = dynamic_cast(force->pair_match("^hybrid",0)); if (force->pair_match("^spin",0,0)) { // only one Pair/Spin style pair = force->pair_match("^spin",0,0); if (hybrid == nullptr) npairs = 1; @@ -206,11 +206,11 @@ void FixNVESpin::init() int count1 = 0; if (npairspin == 1) { count1 = 1; - spin_pairs[0] = (PairSpin *) force->pair_match("^spin",0,0); + spin_pairs[0] = dynamic_cast( force->pair_match("^spin",0,0)); } else if (npairspin > 1) { for (int i = 0; ipair_match("^spin",0,i)) { - spin_pairs[count1] = (PairSpin *) force->pair_match("^spin",0,i); + spin_pairs[count1] = dynamic_cast( force->pair_match("^spin",0,i)); count1++; } } @@ -254,7 +254,7 @@ void FixNVESpin::init() for (iforce = 0; iforce < modify->nfix; iforce++) { if (utils::strmatch(modify->fix[iforce]->style,"^precession/spin")) { precession_spin_flag = 1; - lockprecessionspin[count2] = (FixPrecessionSpin *) modify->fix[iforce]; + lockprecessionspin[count2] = dynamic_cast( modify->fix[iforce]); count2++; } } @@ -287,7 +287,7 @@ void FixNVESpin::init() for (iforce = 0; iforce < modify->nfix; iforce++) { if (utils::strmatch(modify->fix[iforce]->style,"^langevin/spin")) { maglangevin_flag = 1; - locklangevinspin[count2] = (FixLangevinSpin *) modify->fix[iforce]; + locklangevinspin[count2] = dynamic_cast( modify->fix[iforce]); count2++; } } @@ -301,7 +301,7 @@ void FixNVESpin::init() for (iforce = 0; iforce < modify->nfix; iforce++) { if (utils::strmatch(modify->fix[iforce]->style,"^setforce/spin")) { setforce_spin_flag = 1; - locksetforcespin = (FixSetForceSpin *) modify->fix[iforce]; + locksetforcespin = dynamic_cast( modify->fix[iforce]); } } diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index 44cb6e1071..6f4bc10b87 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -273,7 +273,7 @@ void FixPrecessionSpin::init() K6h = K6/hbar; if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -305,9 +305,9 @@ void FixPrecessionSpin::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index 8c375e632b..692883fc0a 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -172,7 +172,7 @@ void NEBSpin::run() if (fixes.size() != 1) error->all(FLERR,"NEBSpin requires use of exactly one fix neb/spin instance"); - fneb = (FixNEBSpin *) fixes[0]; + fneb = dynamic_cast( fixes[0]); if (verbose) numall =7; else numall = 4; memory->create(all,nreplica,numall,"neb:all"); @@ -418,7 +418,7 @@ void NEBSpin::readfile(char *file, int flag) error->all(FLERR,"Incorrectly formatted NEB file"); } - char *buffer = new char[CHUNK*MAXLINE]; + auto buffer = new char[CHUNK*MAXLINE]; double fraction = ireplica/(nreplica-1.0); double **x = atom->x; double **sp = atom->sp; @@ -799,10 +799,8 @@ void NEBSpin::print_status() FILE *uscreen = universe->uscreen; FILE *ulogfile = universe->ulogfile; if (uscreen) { - fprintf(uscreen,BIGINT_FORMAT " %12.8g %12.8g ", - update->ntimestep,fmaxreplica,fmaxatom); - fprintf(uscreen,"%12.8g %12.8g %12.8g ", - gradvnorm0,gradvnorm1,gradvnormc); + fmt::print(uscreen,"{} {:12.8g} {:12.8g} ",update->ntimestep,fmaxreplica,fmaxatom); + fprintf(uscreen,"%12.8g %12.8g %12.8g ",gradvnorm0,gradvnorm1,gradvnormc); fprintf(uscreen,"%12.8g %12.8g %12.8g ",ebf,ebr,endpt); for (int i = 0; i < nreplica; i++) fprintf(uscreen,"%12.8g %12.8g ",rdist[i],all[i][0]); @@ -815,10 +813,8 @@ void NEBSpin::print_status() } if (ulogfile) { - fprintf(ulogfile,BIGINT_FORMAT " %12.8g %12.8g ", - update->ntimestep,fmaxreplica,fmaxatom); - fprintf(ulogfile,"%12.8g %12.8g %12.8g ", - gradvnorm0,gradvnorm1,gradvnormc); + fmt::print(ulogfile,"{} {:12.8} {:12.8g} ",update->ntimestep,fmaxreplica,fmaxatom); + fprintf(ulogfile,"%12.8g %12.8g %12.8g ",gradvnorm0,gradvnorm1,gradvnormc); fprintf(ulogfile,"%12.8g %12.8g %12.8g ",ebf,ebr,endpt); for (int i = 0; i < nreplica; i++) fprintf(ulogfile,"%12.8g %12.8g ",rdist[i],all[i][0]); diff --git a/src/SPIN/pair_spin.cpp b/src/SPIN/pair_spin.cpp index c2fb771def..d236e910c7 100644 --- a/src/SPIN/pair_spin.cpp +++ b/src/SPIN/pair_spin.cpp @@ -96,7 +96,7 @@ void PairSpin::init_style() auto fixes = modify->get_fix_by_style("^nve/spin"); if (fixes.size() == 1) - lattice_flag = ((FixNVESpin *) fixes.front())->lattice_flag; + lattice_flag = (dynamic_cast( fixes.front()))->lattice_flag; else if (fixes.size() > 1) error->warning(FLERR,"Using multiple instances of fix nve/spin or neb/spin"); diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index 1b588262e4..dd27da08ea 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -289,9 +289,9 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : // atom style pointers to particles that store bonus info - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - avec_line = (AtomVecLine *) atom->style_match("line"); - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + avec_line = dynamic_cast( atom->style_match("line")); + avec_tri = dynamic_cast( atom->style_match("tri")); // fix parameters @@ -369,7 +369,7 @@ void FixSRD::init() if (strcmp(modify->fix[m]->style, "wall/srd") == 0) { if (wallexist) error->all(FLERR, "Cannot use fix wall/srd more than once"); wallexist = 1; - wallfix = (FixWallSRD *) modify->fix[m]; + wallfix = dynamic_cast( modify->fix[m]); nwall = wallfix->nwall; wallvarflag = wallfix->varflag; wallwhich = wallfix->wallwhich; @@ -394,7 +394,7 @@ void FixSRD::init() if (fixes[i]->box_change & BOX_CHANGE_SHAPE) change_shape = 1; if (strcmp(fixes[i]->style, "deform") == 0) { deformflag = 1; - FixDeform *deform = (FixDeform *) modify->fix[i]; + auto deform = dynamic_cast( modify->fix[i]); if ((deform->box_change & BOX_CHANGE_SHAPE) && deform->remapflag != Domain::V_REMAP) error->all(FLERR, "Using fix srd with inconsistent fix deform remap option"); } @@ -3942,6 +3942,7 @@ double FixSRD::distance(int i, int j) } /* ---------------------------------------------------------------------- */ +#ifdef SRD_DEBUG void FixSRD::print_collision(int i, int j, int ibounce, double t_remain, double dt, double *xscoll, double *xbcoll, double *norm, int type) @@ -3951,8 +3952,7 @@ void FixSRD::print_collision(int i, int j, int ibounce, double t_remain, double double **v = atom->v; if (type != WALL) { - printf("COLLISION between SRD " TAGINT_FORMAT " and BIG " TAGINT_FORMAT "\n", atom->tag[i], - atom->tag[j]); + fmt::print("COLLISION between SRD {} and BIG {}\n", atom->tag[i], atom->tag[j]); printf(" bounce # = %d\n", ibounce + 1); printf(" local indices: %d %d\n", i, j); printf(" timestep = %g\n", dt); @@ -3993,7 +3993,7 @@ void FixSRD::print_collision(int i, int j, int ibounce, double t_remain, double } else { int dim = wallwhich[j] / 2; - printf("COLLISION between SRD " TAGINT_FORMAT " and WALL %d\n", atom->tag[i], j); + fmt::print("COLLISION between SRD {} and WALL {}\n", atom->tag[i], j); printf(" bounce # = %d\n", ibounce + 1); printf(" local indices: %d %d\n", i, j); printf(" timestep = %g\n", dt); @@ -4025,3 +4025,6 @@ void FixSRD::print_collision(int i, int j, int ibounce, double t_remain, double printf(" separation at end = %g\n", rend); } } +#else +void FixSRD::print_collision(int, int, int, double, double, double *, double *, double *, int) {} +#endif diff --git a/src/UEF/compute_pressure_uef.cpp b/src/UEF/compute_pressure_uef.cpp index 5105a58ddf..da35b7635d 100644 --- a/src/UEF/compute_pressure_uef.cpp +++ b/src/UEF/compute_pressure_uef.cpp @@ -57,7 +57,7 @@ void ComputePressureUef::init() if (i==modify->nfix) error->all(FLERR,"Can't use compute pressure/uef without defining a fix nvt/npt/uef"); ifix_uef=i; - ((FixNHUef*) modify->fix[ifix_uef])->get_ext_flags(ext_flags); + (dynamic_cast( modify->fix[ifix_uef]))->get_ext_flags(ext_flags); if (strcmp(temperature->style,"temp/uef") != 0) error->warning(FLERR,"The temperature used in compute pressure/ued is not of style temp/uef"); @@ -127,7 +127,7 @@ void ComputePressureUef::compute_vector() else { double r[3][3]; - ( (FixNHUef*) modify->fix[ifix_uef])->get_rot(r); + ( dynamic_cast( modify->fix[ifix_uef]))->get_rot(r); virial_rot(virial,r); } if (keflag) { @@ -158,7 +158,7 @@ void ComputePressureUef::compute_vector() ------------------------------------------------------------------------- */ void ComputePressureUef::update_rot() { - ( (FixNHUef*) modify->fix[ifix_uef])->get_rot(rot); + ( dynamic_cast( modify->fix[ifix_uef]))->get_rot(rot); } /* ---------------------------------------------------------------------- diff --git a/src/UEF/compute_temp_uef.cpp b/src/UEF/compute_temp_uef.cpp index 23536330c0..8d02317267 100644 --- a/src/UEF/compute_temp_uef.cpp +++ b/src/UEF/compute_temp_uef.cpp @@ -61,7 +61,7 @@ void ComputeTempUef::compute_vector() ComputeTemp::compute_vector(); if (rot_flag) { double rot[3][3]; - ( (FixNHUef*) modify->fix[ifix_uef])->get_rot(rot); + ( dynamic_cast( modify->fix[ifix_uef]))->get_rot(rot); virial_rot(vector,rot); } diff --git a/src/UEF/dump_cfg_uef.cpp b/src/UEF/dump_cfg_uef.cpp index aea0bad8cf..c87e1632ef 100644 --- a/src/UEF/dump_cfg_uef.cpp +++ b/src/UEF/dump_cfg_uef.cpp @@ -68,8 +68,8 @@ void DumpCFGUef::write_header(bigint n) // so molecules are not split across periodic box boundaries double box[3][3],rot[3][3]; - ((FixNHUef*) modify->fix[ifix_uef])->get_box(box); - ((FixNHUef*) modify->fix[ifix_uef])->get_rot(rot); + (dynamic_cast( modify->fix[ifix_uef]))->get_box(box); + (dynamic_cast( modify->fix[ifix_uef]))->get_rot(rot); // rot goes from "lab frame" to "upper triangular frame" // it's transpose takes the simulation box to the flow frame for (int i=0;i<3;i++) @@ -86,7 +86,7 @@ void DumpCFGUef::write_header(bigint n) if (atom->peri_flag) scale = atom->pdscale; else if (unwrapflag == 1) scale = UNWRAPEXPAND; - fprintf(fp,"Number of particles = " BIGINT_FORMAT "\n",n); + fmt::print(fp,"Number of particles = {}\n",n); fprintf(fp,"A = %g Angstrom (basic length-scale)\n",scale); // in box[][] columns are cell edges // in H0, rows are cell edges diff --git a/src/UEF/fix_nh_uef.cpp b/src/UEF/fix_nh_uef.cpp index a88b389611..e1342adc17 100644 --- a/src/UEF/fix_nh_uef.cpp +++ b/src/UEF/fix_nh_uef.cpp @@ -272,9 +272,9 @@ void FixNHUef::setup(int j) error->all(FLERR,"Initial box is not close enough to the expected uef box"); uefbox->get_rot(rot); - ((ComputeTempUef*) temperature)->yes_rot(); - ((ComputePressureUef*) pressure)->in_fix = true; - ((ComputePressureUef*) pressure)->update_rot(); + (dynamic_cast( temperature))->yes_rot(); + (dynamic_cast( pressure))->in_fix = true; + (dynamic_cast( pressure))->update_rot(); FixNH::setup(j); } @@ -286,12 +286,12 @@ void FixNHUef::initial_integrate(int vflag) inv_rotate_x(rot); inv_rotate_v(rot); inv_rotate_f(rot); - ((ComputeTempUef*) temperature)->no_rot(); + (dynamic_cast( temperature))->no_rot(); FixNH::initial_integrate(vflag); rotate_x(rot); rotate_v(rot); rotate_f(rot); - ((ComputeTempUef*) temperature)->yes_rot(); + (dynamic_cast( temperature))->yes_rot(); } /* ---------------------------------------------------------------------- @@ -302,12 +302,12 @@ void FixNHUef::initial_integrate_respa(int vflag, int ilevel, int iloop) inv_rotate_x(rot); inv_rotate_v(rot); inv_rotate_f(rot); - ((ComputeTempUef*) temperature)->no_rot(); + (dynamic_cast( temperature))->no_rot(); FixNH::initial_integrate_respa(vflag,ilevel,iloop); rotate_x(rot); rotate_v(rot); rotate_f(rot); - ((ComputeTempUef*) temperature)->yes_rot(); + (dynamic_cast( temperature))->yes_rot(); } /* ---------------------------------------------------------------------- @@ -316,14 +316,14 @@ void FixNHUef::initial_integrate_respa(int vflag, int ilevel, int iloop) void FixNHUef::final_integrate() { // update rot here since it must directly follow the virial calculation - ((ComputePressureUef*) pressure)->update_rot(); + (dynamic_cast( pressure))->update_rot(); inv_rotate_v(rot); inv_rotate_f(rot); - ((ComputeTempUef*) temperature)->no_rot(); + (dynamic_cast( temperature))->no_rot(); FixNH::final_integrate(); rotate_v(rot); rotate_f(rot); - ((ComputeTempUef*) temperature)->yes_rot(); + (dynamic_cast( temperature))->yes_rot(); } /* ---------------------------------------------------------------------- @@ -708,7 +708,7 @@ void FixNHUef::restart(char *buf) { int n = size_restart_global(); FixNH::restart(buf); - double *list = (double *) buf; + auto list = (double *) buf; strain[0] = list[n-2]; strain[1] = list[n-1]; uefbox->set_strain(strain[0],strain[1]); diff --git a/src/VTK/dump_vtk.cpp b/src/VTK/dump_vtk.cpp index 54dc0d4b0e..fd7f4b2c2b 100644 --- a/src/VTK/dump_vtk.cpp +++ b/src/VTK/dump_vtk.cpp @@ -96,8 +96,8 @@ enum{VTK,VTP,VTU,PVTP,PVTU}; // file formats #define ONEFIELD 32 #define DELTA 1048576 -#if (VTK_MAJOR_VERSION < 5) || (VTK_MAJOR_VERSION > 8) -#error This code has only been tested with VTK 5, 6, 7, and 8 +#if (VTK_MAJOR_VERSION < 5) || (VTK_MAJOR_VERSION > 9) +#error This code has only been tested with VTK 5, 6, 7, 8, and 9 #elif VTK_MAJOR_VERSION > 6 #define InsertNextTupleValue InsertNextTypedTuple #endif @@ -1009,13 +1009,13 @@ void DumpVTK::write_data(int n, double *mybuf) /* ---------------------------------------------------------------------- */ void DumpVTK::setFileCurrent() { - delete [] filecurrent; + delete[] filecurrent; filecurrent = nullptr; char *filestar = filename; if (multiproc) { if (multiproc > 1) { // if dump_modify fileper or nfile was used - delete [] multiname_ex; + delete[] multiname_ex; multiname_ex = nullptr; char *ptr = strchr(filename,'%'); if (ptr) { @@ -1034,26 +1034,13 @@ void DumpVTK::setFileCurrent() { } if (multifile == 0) { - filecurrent = new char[strlen(filestar) + 1]; - strcpy(filecurrent, filestar); + filecurrent = utils::strdup(filestar); } else { - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar,'*'); - *ptr = '\0'; - if (padflag == 0) { - sprintf(filecurrent,"%s" BIGINT_FORMAT "%s", - filestar,update->ntimestep,ptr+1); - } else { - char bif[8],pad[16]; - strcpy(bif,BIGINT_FORMAT); - sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); - sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filestar, update->ntimestep, padflag)); } // filename of domain box data file - delete [] domainfilecurrent; + delete[] domainfilecurrent; domainfilecurrent = nullptr; if (multiproc) { // remove '%' character @@ -1074,21 +1061,9 @@ void DumpVTK::setFileCurrent() { domainfilecurrent = new char[strlen(filestar) + 1]; strcpy(domainfilecurrent, filestar); } else { - domainfilecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar,'*'); - *ptr = '\0'; - if (padflag == 0) { - sprintf(domainfilecurrent,"%s" BIGINT_FORMAT "%s", - filestar,update->ntimestep,ptr+1); - } else { - char bif[8],pad[16]; - strcpy(bif,BIGINT_FORMAT); - sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); - sprintf(domainfilecurrent,pad,filestar,update->ntimestep,ptr+1); - } - *ptr = '*'; + domainfilecurrent = utils::strdup(utils::star_subst(filestar, update->ntimestep, padflag)); } - delete [] filestar; + delete[] filestar; filestar = nullptr; } else { domainfilecurrent = new char[strlen(filecurrent) + 16]; @@ -1100,7 +1075,7 @@ void DumpVTK::setFileCurrent() { // filename of parallel file if (multiproc && me == 0) { - delete [] parallelfilecurrent; + delete[] parallelfilecurrent; parallelfilecurrent = nullptr; // remove '%' character and add 'p' to file extension @@ -1119,24 +1094,11 @@ void DumpVTK::setFileCurrent() { *ptr++= 0; if (multifile == 0) { - parallelfilecurrent = new char[strlen(filestar) + 1]; - strcpy(parallelfilecurrent, filestar); + parallelfilecurrent = utils::strdup(filestar); } else { - parallelfilecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar,'*'); - *ptr = '\0'; - if (padflag == 0) { - sprintf(parallelfilecurrent,"%s" BIGINT_FORMAT "%s", - filestar,update->ntimestep,ptr+1); - } else { - char bif[8],pad[16]; - strcpy(bif,BIGINT_FORMAT); - sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); - sprintf(parallelfilecurrent,pad,filestar,update->ntimestep,ptr+1); - } - *ptr = '*'; + parallelfilecurrent = utils::strdup(utils::star_subst(filestar, update->ntimestep, padflag)); } - delete [] filestar; + delete[] filestar; filestar = nullptr; } } @@ -1954,7 +1916,12 @@ void DumpVTK::identify_vectors() name.count(vector3_starts[v3s]+2) ) { std::string vectorName = name[vector3_starts[v3s]]; - vectorName.erase(vectorName.find_first_of('x')); + std::string::size_type erase_start = vectorName.find_first_of('x'); + if (erase_start == 0) { + vectorName.erase(0,1); + } else { + vectorName.erase(erase_start); + } name[vector3_starts[v3s]] = vectorName; vector_set.insert(vector3_starts[v3s]); } diff --git a/src/angle_deprecated.cpp b/src/angle_deprecated.cpp index 9a4ca8c877..55e1651b94 100644 --- a/src/angle_deprecated.cpp +++ b/src/angle_deprecated.cpp @@ -34,7 +34,7 @@ void AngleDeprecated::settings(int, char **) // called, our style was just added at the end of the list of substyles if (utils::strmatch(my_style,"^hybrid")) { - AngleHybrid *hybrid = (AngleHybrid *)force->angle; + auto hybrid = dynamic_cast(force->angle); my_style = hybrid->keywords[hybrid->nstyles]; } diff --git a/src/arg_info.cpp b/src/arg_info.cpp index 4bdbfc8c92..86becc1da5 100644 --- a/src/arg_info.cpp +++ b/src/arg_info.cpp @@ -103,7 +103,7 @@ ArgInfo::ArgInfo(const std::string &arg, int allowed) : type(NONE), dim(0), inde char *ArgInfo::copy_name() { - char *dest = new char[name.size() + 1]; + auto dest = new char[name.size() + 1]; strcpy(dest, name.c_str()); // NOLINT return dest; } diff --git a/src/atom.cpp b/src/atom.cpp index 00b9701689..7fc126269c 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -128,6 +128,7 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) omega = angmom = torque = nullptr; radius = rmass = nullptr; ellipsoid = line = tri = body = nullptr; + quat = nullptr; // molecular systems @@ -426,6 +427,10 @@ void Atom::peratom_create() add_peratom("tri",&tri,INT,0); add_peratom("body",&body,INT,0); + // BPM package + + add_peratom("quat",&quat,DOUBLE,4); + // MOLECULE package add_peratom("molecule",&molecule,tagintsize,0); @@ -646,6 +651,7 @@ void Atom::set_atomflag_defaults() // identical list as 2nd customization in atom.h sphere_flag = ellipsoid_flag = line_flag = tri_flag = body_flag = 0; + quat_flag = 0; peri_flag = electron_flag = 0; wavepacket_flag = sph_flag = 0; molecule_flag = molindex_flag = molatom_flag = 0; @@ -796,7 +802,7 @@ AtomVec *Atom::style_match(const char *style) { if (strcmp(atom_style,style) == 0) return avec; else if (strcmp(atom_style,"hybrid") == 0) { - auto avec_hybrid = (AtomVecHybrid *) avec; + auto avec_hybrid = dynamic_cast( avec); for (int i = 0; i < avec_hybrid->nstyles; i++) if (strcmp(avec_hybrid->keywords[i],style) == 0) return avec_hybrid->styles[i]; @@ -1841,7 +1847,7 @@ int Atom::shape_consistency(int itype, double one[3] = {-1.0, -1.0, -1.0}; double *shape; - auto avec_ellipsoid = (AtomVecEllipsoid *) style_match("ellipsoid"); + auto avec_ellipsoid = dynamic_cast( style_match("ellipsoid")); auto bonus = avec_ellipsoid->bonus; int flag = 0; @@ -1889,8 +1895,7 @@ void Atom::add_molecule(int narg, char **arg) int index = 1; while (true) { molecules = (Molecule **) - memory->srealloc(molecules,(nmolecule+1)*sizeof(Molecule *), - "atom::molecules"); + memory->srealloc(molecules,(nmolecule+1)*sizeof(Molecule *), "atom::molecules"); molecules[nmolecule] = new Molecule(lmp,narg,arg,index); molecules[nmolecule]->nset = 0; molecules[nmolecule-ifile+1]->nset++; @@ -1920,8 +1925,7 @@ int Atom::find_molecule(char *id) called by fixes and commands that add molecules ------------------------------------------------------------------------- */ -void Atom::add_molecule_atom(Molecule *onemol, int iatom, - int ilocal, tagint offset) +void Atom::add_molecule_atom(Molecule *onemol, int iatom, int ilocal, tagint offset) { if (onemol->qflag && q_flag) q[ilocal] = onemol->q[iatom]; if (onemol->radiusflag && radius_flag) radius[ilocal] = onemol->radius[iatom]; @@ -1936,6 +1940,19 @@ void Atom::add_molecule_atom(Molecule *onemol, int iatom, onemol->avec_body->set_quat(ilocal,onemol->quat_external); } + // initialize custom per-atom properties to zero if present + + for (int i = 0; i < nivector; ++i) + ivector[i][ilocal] = 0; + for (int i = 0; i < ndvector; ++i) + dvector[i][ilocal] = 0.0; + for (int i = 0; i < niarray; ++i) + for (int j = 0; j < icols[i]; ++j) + iarray[i][ilocal][j] = 0; + for (int i = 0; i < ndarray; ++i) + for (int j = 0; j < dcols[i]; ++j) + darray[i][ilocal][j] = 0.0; + if (molecular != Atom::MOLECULAR) return; // add bond topology info @@ -2216,7 +2233,7 @@ void Atom::setup_sort_bins() #ifdef LMP_GPU if (userbinsize == 0.0) { - FixGPU *fix = (FixGPU *)modify->get_fix_by_id("package_gpu"); + FixGPU *fix = dynamic_cast(modify->get_fix_by_id("package_gpu")); if (fix) { const double subx = domain->subhi[0] - domain->sublo[0]; const double suby = domain->subhi[1] - domain->sublo[1]; @@ -2614,6 +2631,10 @@ length of the data area, and a short description. - int - 1 - 1 if the particle is a body particle, 0 if not + * - quat + - double + - 4 + - four quaternion components of the particles * - i_name - int - 1 @@ -2669,6 +2690,7 @@ void *Atom::extract(const char *name) if (strcmp(name,"line") == 0) return (void *) line; if (strcmp(name,"tri") == 0) return (void *) tri; if (strcmp(name,"body") == 0) return (void *) body; + if (strcmp(name,"quat") == 0) return (void *) quat; if (strcmp(name,"vfrac") == 0) return (void *) vfrac; if (strcmp(name,"s0") == 0) return (void *) s0; @@ -2791,6 +2813,7 @@ int Atom::extract_datatype(const char *name) if (strcmp(name,"line") == 0) return LAMMPS_INT; if (strcmp(name,"tri") == 0) return LAMMPS_INT; if (strcmp(name,"body") == 0) return LAMMPS_INT; + if (strcmp(name,"quat") == 0) return LAMMPS_DOUBLE_2D; if (strcmp(name,"vfrac") == 0) return LAMMPS_DOUBLE; if (strcmp(name,"s0") == 0) return LAMMPS_DOUBLE; diff --git a/src/atom.h b/src/atom.h index 2c1acb7805..06e65a4358 100644 --- a/src/atom.h +++ b/src/atom.h @@ -79,6 +79,7 @@ class Atom : protected Pointers { double *radius; double **omega, **angmom, **torque; int *ellipsoid, *line, *tri, *body; + double **quat; // molecular systems @@ -180,7 +181,7 @@ class Atom : protected Pointers { int molecule_flag, molindex_flag, molatom_flag; int q_flag, mu_flag; - int rmass_flag, radius_flag, omega_flag, torque_flag, angmom_flag; + int rmass_flag, radius_flag, omega_flag, torque_flag, angmom_flag, quat_flag; int vfrac_flag, spin_flag, eradius_flag, ervel_flag, erforce_flag; int cs_flag, csforce_flag, vforce_flag, ervelforce_flag, etag_flag; int rho_flag, esph_flag, cv_flag, vest_flag; @@ -202,6 +203,10 @@ class Atom : protected Pointers { double pdscale; + // DIELECTRIC package + + int dielectric_flag; + // end of customization section // -------------------------------------------------------------------- diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index aa646ecabb..6d1412cbd4 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -2387,7 +2387,7 @@ void AtomVec::setup_fields() else threads = nullptr; for (int i = 0; i < ngrow; i++) { Atom::PerAtom *field = &atom->peratom[mgrow.index[i]]; - threads[i] = (field->threadflag) ? true : false; + threads[i] = field->threadflag == 1; } // set style-specific sizes diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index 6308153be6..8d62b6b7e7 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -105,7 +105,7 @@ void AtomVecBody::process_args(int narg, char **arg) if (narg < 1) error->all(FLERR,"Invalid atom_style body command"); - if (false) { + if (false) { // NOLINT bptr = nullptr; #define BODY_CLASS diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp index 87d42403e6..dd83619da8 100644 --- a/src/atom_vec_hybrid.cpp +++ b/src/atom_vec_hybrid.cpp @@ -213,7 +213,7 @@ void AtomVecHybrid::process_args(int narg, char **arg) char *ptr; for (int idup = 0; idup < ndupfield; idup++) { - char *dup = (char *) dupfield[idup]; + auto dup = (char *) dupfield[idup]; ptr = strstr(concat_grow,dup); if ((ptr && strstr(ptr+1,dup)) && (comm->me == 0)) error->warning(FLERR,fmt::format("Per-atom {} is used in multiple sub-" diff --git a/src/atom_vec_sphere.cpp b/src/atom_vec_sphere.cpp index 5a69944501..0ca87db80e 100644 --- a/src/atom_vec_sphere.cpp +++ b/src/atom_vec_sphere.cpp @@ -6,7 +6,7 @@ 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 distributead under + 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. @@ -95,7 +95,7 @@ void AtomVecSphere::init() for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"adapt") == 0) { - FixAdapt *fix = (FixAdapt *) modify->fix[i]; + auto fix = dynamic_cast( modify->fix[i]); if (fix->diamflag && radvary == 0) error->all(FLERR,"Fix adapt changes particle radii " "but atom_style sphere is not dynamic"); diff --git a/src/balance.cpp b/src/balance.cpp index f2fcda2712..c2f3ee2d5c 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -355,7 +355,7 @@ void Balance::command(int narg, char **arg) // set disable = 0, so weights migrate with atoms for imbfinal calculation if (domain->triclinic) domain->x2lamda(atom->nlocal); - Irregular *irregular = new Irregular(lmp); + auto irregular = new Irregular(lmp); if (wtflag) fixstore->disable = 0; if (style == BISECTION) irregular->migrate_atoms(1,1,rcb->sendproc); else irregular->migrate_atoms(1); @@ -496,8 +496,8 @@ void Balance::weight_storage(char *prefix) if (prefix) cmd = prefix; cmd += "IMBALANCE_WEIGHTS"; - fixstore = (FixStore *) modify->get_fix_by_id(cmd); - if (!fixstore) fixstore = (FixStore *) modify->add_fix(cmd + " all STORE peratom 0 1"); + fixstore = dynamic_cast( modify->get_fix_by_id(cmd)); + if (!fixstore) fixstore = dynamic_cast( modify->add_fix(cmd + " all STORE peratom 0 1")); // do not carry weights with atoms during normal atom migration diff --git a/src/bond.cpp b/src/bond.cpp index c94e809899..4c4eafe751 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -27,6 +27,10 @@ using namespace LAMMPS_NS; enum { NONE, LINEAR, SPLINE }; +// allocate space for static class instance variable and initialize it + +int Bond::instance_total = 0; + /* ----------------------------------------------------------------------- set bond contribution to Vdwl energy to 0.0 a particular bond style can override this @@ -34,13 +38,18 @@ enum { NONE, LINEAR, SPLINE }; Bond::Bond(LAMMPS *_lmp) : Pointers(_lmp) { + instance_me = instance_total++; + energy = 0.0; virial[0] = virial[1] = virial[2] = virial[3] = virial[4] = virial[5] = 0.0; writedata = 1; + comm_forward = comm_reverse = comm_reverse_off = 0; + allocated = 0; suffix_flag = Suffix::NONE; born_matrix_enable = 0; + partial_flag = 0; maxeatom = maxvatom = 0; eatom = nullptr; diff --git a/src/bond.h b/src/bond.h index 095c0ef2e9..5ba0a6fc28 100644 --- a/src/bond.h +++ b/src/bond.h @@ -23,14 +23,22 @@ class Bond : protected Pointers { friend class FixOMP; public: + static int instance_total; // # of Bond classes ever instantiated + int allocated; int *setflag; + int partial_flag; // 1 if bond type can be set to 0 and deleted int writedata; // 1 if writes coeffs to data file double energy; // accumulated energies double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz double *eatom, **vatom; // accumulated per-atom energy/virial int born_matrix_enable; + + int comm_forward; // size of forward communication (0 if none) + int comm_reverse; // size of reverse communication (0 if none) + int comm_reverse_off; // size of reverse comm even if newton off + int reinitflag; // 1 if compatible with fix adapt and alike // KOKKOS host/device flag and data masks @@ -56,6 +64,10 @@ class Bond : protected Pointers { virtual double memory_usage(); virtual void *extract(const char *, int &) { return nullptr; } virtual void reinit(); + virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;} + virtual void unpack_forward_comm(int, int, double *) {} + virtual int pack_reverse_comm(int, int, double *) {return 0;} + virtual void unpack_reverse_comm(int, int *, double *) {} virtual void born_matrix(int/*btype*/, double/*rsq*/, int/*at1*/, int/*at2*/, double& du, double& du2) { @@ -66,6 +78,7 @@ class Bond : protected Pointers { void write_file(int, char **); protected: + int instance_me; // which Bond class instantiation I am int suffix_flag; // suffix compatibility flag int evflag; diff --git a/src/bond_deprecated.cpp b/src/bond_deprecated.cpp index 4f5ec58071..98bf6ea9ae 100644 --- a/src/bond_deprecated.cpp +++ b/src/bond_deprecated.cpp @@ -35,7 +35,7 @@ void BondDeprecated::settings(int, char **) // called, our style was just added at the end of the list of substyles if (utils::strmatch(my_style,"^hybrid")) { - BondHybrid *hybrid = (BondHybrid *)force->bond; + auto hybrid = dynamic_cast(force->bond); my_style = hybrid->keywords[hybrid->nstyles]; } diff --git a/src/change_box.cpp b/src/change_box.cpp index bbac78ab3d..08af5f11c9 100644 --- a/src/change_box.cpp +++ b/src/change_box.cpp @@ -372,7 +372,7 @@ void ChangeBox::command(int narg, char **arg) if (domain->triclinic) domain->x2lamda(atom->nlocal); domain->reset_box(); - Irregular *irregular = new Irregular(lmp); + auto irregular = new Irregular(lmp); irregular->migrate_atoms(1); delete irregular; if (domain->triclinic) domain->lamda2x(atom->nlocal); diff --git a/src/comm.cpp b/src/comm.cpp index 48dae2368a..9f46031185 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -218,6 +218,9 @@ void Comm::init() if (force->pair) maxforward = MAX(maxforward,force->pair->comm_forward); if (force->pair) maxreverse = MAX(maxreverse,force->pair->comm_reverse); + if (force->bond) maxforward = MAX(maxforward,force->bond->comm_forward); + if (force->bond) maxreverse = MAX(maxreverse,force->bond->comm_reverse); + for (const auto &fix : fix_list) { maxforward = MAX(maxforward,fix->comm_forward); maxreverse = MAX(maxreverse,fix->comm_reverse); @@ -235,6 +238,7 @@ void Comm::init() if (force->newton == 0) maxreverse = 0; if (force->pair) maxreverse = MAX(maxreverse,force->pair->comm_reverse_off); + if (force->bond) maxreverse = MAX(maxreverse,force->bond->comm_reverse_off); // maxexchange_atom = size of an exchanged atom, set by AtomVec // only needs to be set if size > BUFEXTRA @@ -550,7 +554,7 @@ void Comm::set_proc_grid(int outflag) // create ProcMap class to create 3d grid and map procs to it - ProcMap *pmap = new ProcMap(lmp); + auto pmap = new ProcMap(lmp); // create 3d grid of processors // produces procgrid and coregrid (if relevant) @@ -732,7 +736,8 @@ double Comm::get_comm_cutoff() error->warning(FLERR,"Communication cutoff adjusted to {}",maxcommcutoff); } - // Check maximum interval size for neighbor multi + // check maximum interval size for neighbor multi + if (neighbor->interval_collection_flag) { for (int i = 0; i < neighbor->ncollections; i++){ maxcommcutoff = MAX(maxcommcutoff, neighbor->collection2cut[i]); @@ -1010,7 +1015,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, { // irregular comm of inbuf from caller decomp to rendezvous decomp - Irregular *irregular = new Irregular(lmp); + auto irregular = new Irregular(lmp); int nrvous; if (inorder) nrvous = irregular->create_data_grouped(n,procs); @@ -1018,8 +1023,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer - char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, - "rendezvous:inbuf"); + auto inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); irregular->exchange_data(inbuf,insize,inbuf_rvous); bigint irregular1_bytes = irregular->memory_usage(); @@ -1032,14 +1036,12 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, int flag; int *procs_rvous; char *outbuf_rvous; - int nrvous_out = callback(nrvous,inbuf_rvous,flag, - procs_rvous,outbuf_rvous,ptr); + int nrvous_out = callback(nrvous,inbuf_rvous,flag, procs_rvous,outbuf_rvous,ptr); if (flag != 1) memory->sfree(inbuf_rvous); // outbuf_rvous = inbuf_vous if (flag == 0) { if (statflag) rendezvous_stats(n,0,nrvous,nrvous_out,insize,outsize, - (bigint) nrvous_out*sizeof(int) + - irregular1_bytes); + (bigint) nrvous_out*sizeof(int) + irregular1_bytes); return 0; // all nout_rvous are 0, no 2nd comm stage } @@ -1049,14 +1051,12 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, irregular = new Irregular(lmp); int nout; - if (outorder) - nout = irregular->create_data_grouped(nrvous_out,procs_rvous); + if (outorder) nout = irregular->create_data_grouped(nrvous_out,procs_rvous); else nout = irregular->create_data(nrvous_out,procs_rvous); // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer - outbuf = (char *) memory->smalloc((bigint) nout*outsize+1, - "rendezvous:outbuf"); + outbuf = (char *) memory->smalloc((bigint) nout*outsize+1, "rendezvous:outbuf"); irregular->exchange_data(outbuf_rvous,outsize,outbuf); bigint irregular2_bytes = irregular->memory_usage(); @@ -1163,8 +1163,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // all2all comm of inbuf from caller decomp to rendezvous decomp // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer - char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, - "rendezvous:inbuf"); + auto inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); memset(inbuf_rvous,0,(bigint) nrvous*insize*sizeof(char)); MPI_Alltoallv(inbuf_a2a,sendcount,sdispls,MPI_CHAR, @@ -1183,8 +1182,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, int *procs_rvous; char *outbuf_rvous; - int nrvous_out = callback(nrvous,inbuf_rvous,flag, - procs_rvous,outbuf_rvous,ptr); + int nrvous_out = callback(nrvous,inbuf_rvous,flag, procs_rvous,outbuf_rvous,ptr); if (flag != 1) memory->sfree(inbuf_rvous); // outbuf_rvous = inbuf_vous if (flag == 0) { @@ -1205,8 +1203,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer - outbuf_a2a = (char *) memory->smalloc((bigint) nrvous_out*outsize+1, - "rendezvous:outbuf"); + outbuf_a2a = (char *) memory->smalloc((bigint) nrvous_out*outsize+1, "rendezvous:outbuf"); memory->create(offsets,nprocs,"rendezvous:offsets"); for (int i = 0; i < nprocs; i++) procs_a2a[i] = 0; @@ -1224,8 +1221,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, offset += outsize; } - all2all2_bytes = nprocs*sizeof(int) + nprocs*sizeof(bigint) + - (bigint)nrvous_out*outsize; + all2all2_bytes = nprocs*sizeof(int) + nprocs*sizeof(bigint) + (bigint)nrvous_out*outsize; } else { procs_a2a = procs_rvous; diff --git a/src/comm.h b/src/comm.h index 3d8d217136..be0e79ad82 100644 --- a/src/comm.h +++ b/src/comm.h @@ -80,10 +80,12 @@ class Comm : protected Pointers { virtual void exchange() = 0; // move atoms to new procs virtual void borders() = 0; // setup list of atoms to comm - // forward/reverse comm from a Pair, Fix, Compute, Dump + // forward/reverse comm from a Pair, Bond, Fix, Compute, Dump virtual void forward_comm(class Pair *) = 0; virtual void reverse_comm(class Pair *) = 0; + virtual void forward_comm(class Bond *) = 0; + virtual void reverse_comm(class Bond *) = 0; virtual void forward_comm(class Fix *, int size = 0) = 0; virtual void reverse_comm(class Fix *, int size = 0) = 0; virtual void reverse_comm_variable(class Fix *) = 0; diff --git a/src/comm_brick.cpp b/src/comm_brick.cpp index c2ff19ec74..b4a0cddda8 100644 --- a/src/comm_brick.cpp +++ b/src/comm_brick.cpp @@ -20,6 +20,7 @@ #include "atom.h" #include "atom_vec.h" +#include "bond.h" #include "compute.h" #include "domain.h" #include "dump.h" @@ -490,8 +491,7 @@ void CommBrick::setup() return how many procs away are needed to encompass cutghost away from loc ------------------------------------------------------------------------- */ -int CommBrick::updown(int dim, int dir, int loc, - double prd, int periodicity, double *split) +int CommBrick::updown(int dim, int dir, int loc, double prd, int periodicity, double *split) { int index,count; double frac,delta; @@ -552,19 +552,15 @@ void CommBrick::forward_comm(int /*dummy*/) if (comm_x_only) { if (size_forward_recv[iswap]) { buf = x[firstrecv[iswap]]; - MPI_Irecv(buf,size_forward_recv[iswap],MPI_DOUBLE, - recvproc[iswap],0,world,&request); + MPI_Irecv(buf,size_forward_recv[iswap],MPI_DOUBLE,recvproc[iswap],0,world,&request); } - n = avec->pack_comm(sendnum[iswap],sendlist[iswap], - buf_send,pbc_flag[iswap],pbc[iswap]); + n = avec->pack_comm(sendnum[iswap],sendlist[iswap],buf_send,pbc_flag[iswap],pbc[iswap]); if (n) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world); if (size_forward_recv[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); } else if (ghost_velocity) { if (size_forward_recv[iswap]) - MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE, - recvproc[iswap],0,world,&request); - n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap], - buf_send,pbc_flag[iswap],pbc[iswap]); + MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,recvproc[iswap],0,world,&request); + n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],buf_send,pbc_flag[iswap],pbc[iswap]); if (n) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world); if (size_forward_recv[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_recv); @@ -572,8 +568,7 @@ void CommBrick::forward_comm(int /*dummy*/) if (size_forward_recv[iswap]) MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE, recvproc[iswap],0,world,&request); - n = avec->pack_comm(sendnum[iswap],sendlist[iswap], - buf_send,pbc_flag[iswap],pbc[iswap]); + n = avec->pack_comm(sendnum[iswap],sendlist[iswap],buf_send,pbc_flag[iswap],pbc[iswap]); if (n) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world); if (size_forward_recv[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_recv); @@ -585,12 +580,10 @@ void CommBrick::forward_comm(int /*dummy*/) avec->pack_comm(sendnum[iswap],sendlist[iswap], x[firstrecv[iswap]],pbc_flag[iswap],pbc[iswap]); } else if (ghost_velocity) { - avec->pack_comm_vel(sendnum[iswap],sendlist[iswap], - buf_send,pbc_flag[iswap],pbc[iswap]); + avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],buf_send,pbc_flag[iswap],pbc[iswap]); avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_send); } else { - avec->pack_comm(sendnum[iswap],sendlist[iswap], - buf_send,pbc_flag[iswap],pbc[iswap]); + avec->pack_comm(sendnum[iswap],sendlist[iswap],buf_send,pbc_flag[iswap],pbc[iswap]); avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_send); } } @@ -618,18 +611,15 @@ void CommBrick::reverse_comm() if (sendproc[iswap] != me) { if (comm_f_only) { if (size_reverse_recv[iswap]) - MPI_Irecv(buf_recv,size_reverse_recv[iswap],MPI_DOUBLE, - sendproc[iswap],0,world,&request); + MPI_Irecv(buf_recv,size_reverse_recv[iswap],MPI_DOUBLE,sendproc[iswap],0,world,&request); if (size_reverse_send[iswap]) { buf = f[firstrecv[iswap]]; - MPI_Send(buf,size_reverse_send[iswap],MPI_DOUBLE, - recvproc[iswap],0,world); + MPI_Send(buf,size_reverse_send[iswap],MPI_DOUBLE,recvproc[iswap],0,world); } if (size_reverse_recv[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); } else { if (size_reverse_recv[iswap]) - MPI_Irecv(buf_recv,size_reverse_recv[iswap],MPI_DOUBLE, - sendproc[iswap],0,world,&request); + MPI_Irecv(buf_recv,size_reverse_recv[iswap],MPI_DOUBLE,sendproc[iswap],0,world,&request); n = avec->pack_reverse(recvnum[iswap],firstrecv[iswap],buf_send); if (n) MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world); if (size_reverse_recv[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); @@ -639,8 +629,7 @@ void CommBrick::reverse_comm() } else { if (comm_f_only) { if (sendnum[iswap]) - avec->unpack_reverse(sendnum[iswap],sendlist[iswap], - f[firstrecv[iswap]]); + avec->unpack_reverse(sendnum[iswap],sendlist[iswap],f[firstrecv[iswap]]); } else { avec->pack_reverse(recvnum[iswap],firstrecv[iswap],buf_send); avec->unpack_reverse(sendnum[iswap],sendlist[iswap],buf_send); @@ -733,25 +722,21 @@ void CommBrick::exchange() if (procgrid[dim] == 1) nrecv = 0; else { MPI_Sendrecv(&nsend,1,MPI_INT,procneigh[dim][0],0, - &nrecv1,1,MPI_INT,procneigh[dim][1],0,world, - MPI_STATUS_IGNORE); + &nrecv1,1,MPI_INT,procneigh[dim][1],0,world,MPI_STATUS_IGNORE); nrecv = nrecv1; if (procgrid[dim] > 2) { MPI_Sendrecv(&nsend,1,MPI_INT,procneigh[dim][1],0, - &nrecv2,1,MPI_INT,procneigh[dim][0],0,world, - MPI_STATUS_IGNORE); + &nrecv2,1,MPI_INT,procneigh[dim][0],0,world,MPI_STATUS_IGNORE); nrecv += nrecv2; } if (nrecv > maxrecv) grow_recv(nrecv); - MPI_Irecv(buf_recv,nrecv1,MPI_DOUBLE,procneigh[dim][1],0, - world,&request); + MPI_Irecv(buf_recv,nrecv1,MPI_DOUBLE,procneigh[dim][1],0,world,&request); MPI_Send(buf_send,nsend,MPI_DOUBLE,procneigh[dim][0],0,world); MPI_Wait(&request,MPI_STATUS_IGNORE); if (procgrid[dim] > 2) { - MPI_Irecv(&buf_recv[nrecv1],nrecv2,MPI_DOUBLE,procneigh[dim][0],0, - world,&request); + MPI_Irecv(&buf_recv[nrecv1],nrecv2,MPI_DOUBLE,procneigh[dim][0],0,world,&request); MPI_Send(buf_send,nsend,MPI_DOUBLE,procneigh[dim][1],0,world); MPI_Wait(&request,MPI_STATUS_IGNORE); } @@ -925,11 +910,9 @@ void CommBrick::borders() if (nsend*size_border > maxsend) grow_send(nsend*size_border,0); if (ghost_velocity) - n = avec->pack_border_vel(nsend,sendlist[iswap],buf_send, - pbc_flag[iswap],pbc[iswap]); + n = avec->pack_border_vel(nsend,sendlist[iswap],buf_send,pbc_flag[iswap],pbc[iswap]); else - n = avec->pack_border(nsend,sendlist[iswap],buf_send, - pbc_flag[iswap],pbc[iswap]); + n = avec->pack_border(nsend,sendlist[iswap],buf_send,pbc_flag[iswap],pbc[iswap]); // swap atoms with other proc // no MPI calls except SendRecv if nsend/nrecv = 0 @@ -938,8 +921,7 @@ void CommBrick::borders() if (sendproc[iswap] != me) { MPI_Sendrecv(&nsend,1,MPI_INT,sendproc[iswap],0, - &nrecv,1,MPI_INT,recvproc[iswap],0,world, - MPI_STATUS_IGNORE); + &nrecv,1,MPI_INT,recvproc[iswap],0,world,MPI_STATUS_IGNORE); if (nrecv*size_border > maxrecv) grow_recv(nrecv*size_border); if (nrecv) MPI_Irecv(buf_recv,nrecv*size_border,MPI_DOUBLE, recvproc[iswap],0,world,&request); @@ -1013,16 +995,14 @@ void CommBrick::forward_comm(Pair *pair) // pack buffer - n = pair->pack_forward_comm(sendnum[iswap],sendlist[iswap], - buf_send,pbc_flag[iswap],pbc[iswap]); + n = pair->pack_forward_comm(sendnum[iswap],sendlist[iswap],buf_send,pbc_flag[iswap],pbc[iswap]); // exchange with another proc // if self, set recv buffer to send buffer if (sendproc[iswap] != me) { if (recvnum[iswap]) - MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE, - recvproc[iswap],0,world,&request); + MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world,&request); if (sendnum[iswap]) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world); if (recvnum[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); @@ -1059,8 +1039,7 @@ void CommBrick::reverse_comm(Pair *pair) if (sendproc[iswap] != me) { if (sendnum[iswap]) - MPI_Irecv(buf_recv,nsize*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0, - world,&request); + MPI_Irecv(buf_recv,nsize*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world,&request); if (recvnum[iswap]) MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world); if (sendnum[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); @@ -1073,6 +1052,80 @@ void CommBrick::reverse_comm(Pair *pair) } } +/* ---------------------------------------------------------------------- + forward communication invoked by a Bond + nsize used only to set recv buffer limit +------------------------------------------------------------------------- */ + +void CommBrick::forward_comm(Bond *bond) +{ + int iswap,n; + double *buf; + MPI_Request request; + + int nsize = bond->comm_forward; + + for (iswap = 0; iswap < nswap; iswap++) { + + // pack buffer + + n = bond->pack_forward_comm(sendnum[iswap],sendlist[iswap],buf_send,pbc_flag[iswap],pbc[iswap]); + + // exchange with another proc + // if self, set recv buffer to send buffer + + if (sendproc[iswap] != me) { + if (recvnum[iswap]) + MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world,&request); + if (sendnum[iswap]) + MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world); + if (recvnum[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); + buf = buf_recv; + } else buf = buf_send; + + // unpack buffer + + bond->unpack_forward_comm(recvnum[iswap],firstrecv[iswap],buf); + } +} + +/* ---------------------------------------------------------------------- + reverse communication invoked by a Bond + nsize used only to set recv buffer limit +------------------------------------------------------------------------- */ + +void CommBrick::reverse_comm(Bond *bond) +{ + int iswap,n; + double *buf; + MPI_Request request; + + int nsize = MAX(bond->comm_reverse,bond->comm_reverse_off); + + for (iswap = nswap-1; iswap >= 0; iswap--) { + + // pack buffer + + n = bond->pack_reverse_comm(recvnum[iswap],firstrecv[iswap],buf_send); + + // exchange with another proc + // if self, set recv buffer to send buffer + + if (sendproc[iswap] != me) { + if (sendnum[iswap]) + MPI_Irecv(buf_recv,nsize*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world,&request); + if (recvnum[iswap]) + MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world); + if (sendnum[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); + buf = buf_recv; + } else buf = buf_send; + + // unpack buffer + + bond->unpack_reverse_comm(sendnum[iswap],sendlist[iswap],buf); + } +} + /* ---------------------------------------------------------------------- forward communication invoked by a Fix size/nsize used only to set recv buffer limit @@ -1095,16 +1148,14 @@ void CommBrick::forward_comm(Fix *fix, int size) // pack buffer - n = fix->pack_forward_comm(sendnum[iswap],sendlist[iswap], - buf_send,pbc_flag[iswap],pbc[iswap]); + n = fix->pack_forward_comm(sendnum[iswap],sendlist[iswap],buf_send,pbc_flag[iswap],pbc[iswap]); // exchange with another proc // if self, set recv buffer to send buffer if (sendproc[iswap] != me) { if (recvnum[iswap]) - MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0, - world,&request); + MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world,&request); if (sendnum[iswap]) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world); if (recvnum[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); @@ -1146,8 +1197,7 @@ void CommBrick::reverse_comm(Fix *fix, int size) if (sendproc[iswap] != me) { if (sendnum[iswap]) - MPI_Irecv(buf_recv,nsize*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0, - world,&request); + MPI_Irecv(buf_recv,nsize*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world,&request); if (recvnum[iswap]) MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world); if (sendnum[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); @@ -1185,13 +1235,11 @@ void CommBrick::reverse_comm_variable(Fix *fix) if (sendproc[iswap] != me) { MPI_Sendrecv(&nsend,1,MPI_INT,recvproc[iswap],0, - &nrecv,1,MPI_INT,sendproc[iswap],0,world, - MPI_STATUS_IGNORE); + &nrecv,1,MPI_INT,sendproc[iswap],0,world,MPI_STATUS_IGNORE); if (sendnum[iswap]) { if (nrecv > maxrecv) grow_recv(nrecv); - MPI_Irecv(buf_recv,maxrecv,MPI_DOUBLE,sendproc[iswap],0, - world,&request); + MPI_Irecv(buf_recv,maxrecv,MPI_DOUBLE,sendproc[iswap],0,world,&request); } if (recvnum[iswap]) MPI_Send(buf_send,nsend,MPI_DOUBLE,recvproc[iswap],0,world); @@ -1230,8 +1278,7 @@ void CommBrick::forward_comm(Compute *compute) if (sendproc[iswap] != me) { if (recvnum[iswap]) - MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0, - world,&request); + MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world,&request); if (sendnum[iswap]) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world); if (recvnum[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); @@ -1268,8 +1315,7 @@ void CommBrick::reverse_comm(Compute *compute) if (sendproc[iswap] != me) { if (sendnum[iswap]) - MPI_Irecv(buf_recv,nsize*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0, - world,&request); + MPI_Irecv(buf_recv,nsize*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world,&request); if (recvnum[iswap]) MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world); if (sendnum[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); @@ -1307,8 +1353,7 @@ void CommBrick::forward_comm(Dump *dump) if (sendproc[iswap] != me) { if (recvnum[iswap]) - MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0, - world,&request); + MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world,&request); if (sendnum[iswap]) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world); if (recvnum[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); @@ -1345,8 +1390,7 @@ void CommBrick::reverse_comm(Dump *dump) if (sendproc[iswap] != me) { if (sendnum[iswap]) - MPI_Irecv(buf_recv,nsize*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0, - world,&request); + MPI_Irecv(buf_recv,nsize*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world,&request); if (recvnum[iswap]) MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world); if (sendnum[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); @@ -1394,11 +1438,9 @@ void CommBrick::forward_comm_array(int nsize, double **array) if (sendproc[iswap] != me) { if (recvnum[iswap]) - MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0, - world,&request); + MPI_Irecv(buf_recv,nsize*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world,&request); if (sendnum[iswap]) - MPI_Send(buf_send,nsize*sendnum[iswap],MPI_DOUBLE, - sendproc[iswap],0,world); + MPI_Send(buf_send,nsize*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world); if (recvnum[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); buf = buf_recv; } else buf = buf_send; @@ -1444,21 +1486,18 @@ int CommBrick::exchange_variable(int n, double *inbuf, double *&outbuf) nrecv += nrecv1; if (procgrid[dim] > 2) { MPI_Sendrecv(&nsend,1,MPI_INT,procneigh[dim][1],0, - &nrecv2,1,MPI_INT,procneigh[dim][0],0,world, - MPI_STATUS_IGNORE); + &nrecv2,1,MPI_INT,procneigh[dim][0],0,world,MPI_STATUS_IGNORE); nrecv += nrecv2; } else nrecv2 = 0; if (nrecv > maxrecv) grow_recv(nrecv); - MPI_Irecv(&buf_recv[nsend],nrecv1,MPI_DOUBLE,procneigh[dim][1],0, - world,&request); + MPI_Irecv(&buf_recv[nsend],nrecv1,MPI_DOUBLE,procneigh[dim][1],0,world,&request); MPI_Send(buf_recv,nsend,MPI_DOUBLE,procneigh[dim][0],0,world); MPI_Wait(&request,MPI_STATUS_IGNORE); if (procgrid[dim] > 2) { - MPI_Irecv(&buf_recv[nsend+nrecv1],nrecv2,MPI_DOUBLE,procneigh[dim][0],0, - world,&request); + MPI_Irecv(&buf_recv[nsend+nrecv1],nrecv2,MPI_DOUBLE,procneigh[dim][0],0,world,&request); MPI_Send(buf_recv,nsend,MPI_DOUBLE,procneigh[dim][1],0,world); MPI_Wait(&request,MPI_STATUS_IGNORE); } diff --git a/src/comm_brick.h b/src/comm_brick.h index c641ba7e7b..5f18a6c58f 100644 --- a/src/comm_brick.h +++ b/src/comm_brick.h @@ -22,6 +22,7 @@ class CommBrick : public Comm { public: CommBrick(class LAMMPS *); CommBrick(class LAMMPS *, class Comm *); + ~CommBrick() override; void init() override; @@ -33,6 +34,8 @@ class CommBrick : public Comm { void forward_comm(class Pair *) override; // forward comm from a Pair void reverse_comm(class Pair *) override; // reverse comm from a Pair + void forward_comm(class Bond *) override; // forward comm from a Bond + void reverse_comm(class Bond *) override; // reverse comm from a Bond void forward_comm(class Fix *, int size = 0) override; // forward comm from a Fix void reverse_comm(class Fix *, int size = 0) override; // reverse comm from a Fix void reverse_comm_variable(class Fix *) override; // variable size reverse comm from a Fix diff --git a/src/comm_tiled.cpp b/src/comm_tiled.cpp index a7af454a8e..8088ada44b 100644 --- a/src/comm_tiled.cpp +++ b/src/comm_tiled.cpp @@ -21,6 +21,7 @@ #include "atom.h" #include "atom_vec.h" +#include "bond.h" #include "compute.h" #include "domain.h" #include "dump.h" @@ -512,16 +513,14 @@ void CommTiled::setup() MIN(sbox_multi[3+idim]+cutghostmulti[icollection][idim],subhi[idim]); else sbox_multi[3+idim] = - MIN(sbox_multi[3+idim]-prd[idim]+cutghostmulti[icollection][idim], - subhi[idim]); + MIN(sbox_multi[3+idim]-prd[idim]+cutghostmulti[icollection][idim],subhi[idim]); } else { if (i < noverlap1) sbox_multi[idim] = MAX(sbox_multi[idim]-cutghostmulti[icollection][idim],sublo[idim]); else sbox_multi[idim] = - MAX(sbox_multi[idim]+prd[idim]-cutghostmulti[icollection][idim], - sublo[idim]); + MAX(sbox_multi[idim]+prd[idim]-cutghostmulti[icollection][idim],sublo[idim]); sbox_multi[3+idim] = subhi[idim]; } @@ -588,16 +587,14 @@ void CommTiled::setup() MIN(sbox_multiold[3+idim]+cutghostmultiold[itype][idim],subhi[idim]); else sbox_multiold[3+idim] = - MIN(sbox_multiold[3+idim]-prd[idim]+cutghostmultiold[itype][idim], - subhi[idim]); + MIN(sbox_multiold[3+idim]-prd[idim]+cutghostmultiold[itype][idim],subhi[idim]); } else { if (i < noverlap1) sbox_multiold[idim] = MAX(sbox_multiold[idim]-cutghostmultiold[itype][idim],sublo[idim]); else sbox_multiold[idim] = - MAX(sbox_multiold[idim]+prd[idim]-cutghostmultiold[itype][idim], - sublo[idim]); + MAX(sbox_multiold[idim]+prd[idim]-cutghostmultiold[itype][idim],sublo[idim]); sbox_multiold[3+idim] = subhi[idim]; } @@ -747,8 +744,7 @@ void CommTiled::forward_comm(int /*dummy*/) } if (sendself[iswap]) { avec->pack_comm(sendnum[iswap][nsend],sendlist[iswap][nsend], - x[firstrecv[iswap][nrecv]],pbc_flag[iswap][nsend], - pbc[iswap][nsend]); + x[firstrecv[iswap][nrecv]],pbc_flag[iswap][nsend],pbc[iswap][nsend]); } if (recvother[iswap]) MPI_Waitall(nrecv,requests,MPI_STATUS_IGNORE); @@ -756,8 +752,7 @@ void CommTiled::forward_comm(int /*dummy*/) if (recvother[iswap]) { for (i = 0; i < nrecv; i++) MPI_Irecv(&buf_recv[size_forward*forward_recv_offset[iswap][i]], - size_forward_recv[iswap][i], - MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); + size_forward_recv[iswap][i],MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); } if (sendother[iswap]) { for (i = 0; i < nsend; i++) { @@ -769,15 +764,13 @@ void CommTiled::forward_comm(int /*dummy*/) if (sendself[iswap]) { avec->pack_comm_vel(sendnum[iswap][nsend],sendlist[iswap][nsend], buf_send,pbc_flag[iswap][nsend],pbc[iswap][nsend]); - avec->unpack_comm_vel(recvnum[iswap][nrecv],firstrecv[iswap][nrecv], - buf_send); + avec->unpack_comm_vel(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); } if (recvother[iswap]) { for (i = 0; i < nrecv; i++) { MPI_Waitany(nrecv,requests,&irecv,MPI_STATUS_IGNORE); avec->unpack_comm_vel(recvnum[iswap][irecv],firstrecv[iswap][irecv], - &buf_recv[size_forward* - forward_recv_offset[iswap][irecv]]); + &buf_recv[size_forward*forward_recv_offset[iswap][irecv]]); } } @@ -785,8 +778,7 @@ void CommTiled::forward_comm(int /*dummy*/) if (recvother[iswap]) { for (i = 0; i < nrecv; i++) MPI_Irecv(&buf_recv[size_forward*forward_recv_offset[iswap][i]], - size_forward_recv[iswap][i], - MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); + size_forward_recv[iswap][i],MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); } if (sendother[iswap]) { for (i = 0; i < nsend; i++) { @@ -798,15 +790,13 @@ void CommTiled::forward_comm(int /*dummy*/) if (sendself[iswap]) { avec->pack_comm(sendnum[iswap][nsend],sendlist[iswap][nsend], buf_send,pbc_flag[iswap][nsend],pbc[iswap][nsend]); - avec->unpack_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv], - buf_send); + avec->unpack_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); } if (recvother[iswap]) { for (i = 0; i < nrecv; i++) { MPI_Waitany(nrecv,requests,&irecv,MPI_STATUS_IGNORE); avec->unpack_comm(recvnum[iswap][irecv],firstrecv[iswap][irecv], - &buf_recv[size_forward* - forward_recv_offset[iswap][irecv]]); + &buf_recv[size_forward*forward_recv_offset[iswap][irecv]]); } } } @@ -839,8 +829,7 @@ void CommTiled::reverse_comm() if (sendother[iswap]) { for (i = 0; i < nsend; i++) { MPI_Irecv(&buf_recv[size_reverse*reverse_recv_offset[iswap][i]], - size_reverse_recv[iswap][i],MPI_DOUBLE, - sendproc[iswap][i],0,world,&requests[i]); + size_reverse_recv[iswap][i],MPI_DOUBLE,sendproc[iswap][i],0,world,&requests[i]); } } if (recvother[iswap]) { @@ -856,8 +845,7 @@ void CommTiled::reverse_comm() for (i = 0; i < nsend; i++) { MPI_Waitany(nsend,requests,&irecv,MPI_STATUS_IGNORE); avec->unpack_reverse(sendnum[iswap][irecv],sendlist[iswap][irecv], - &buf_recv[size_reverse* - reverse_recv_offset[iswap][irecv]]); + &buf_recv[size_reverse*reverse_recv_offset[iswap][irecv]]); } } @@ -865,28 +853,23 @@ void CommTiled::reverse_comm() if (sendother[iswap]) { for (i = 0; i < nsend; i++) MPI_Irecv(&buf_recv[size_reverse*reverse_recv_offset[iswap][i]], - size_reverse_recv[iswap][i],MPI_DOUBLE, - sendproc[iswap][i],0,world,&requests[i]); + size_reverse_recv[iswap][i],MPI_DOUBLE,sendproc[iswap][i],0,world,&requests[i]); } if (recvother[iswap]) { for (i = 0; i < nrecv; i++) { - n = avec->pack_reverse(recvnum[iswap][i],firstrecv[iswap][i], - buf_send); + n = avec->pack_reverse(recvnum[iswap][i],firstrecv[iswap][i],buf_send); MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap][i],0,world); } } if (sendself[iswap]) { - avec->pack_reverse(recvnum[iswap][nrecv],firstrecv[iswap][nrecv], - buf_send); - avec->unpack_reverse(sendnum[iswap][nsend],sendlist[iswap][nsend], - buf_send); + avec->pack_reverse(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); + avec->unpack_reverse(sendnum[iswap][nsend],sendlist[iswap][nsend],buf_send); } if (sendother[iswap]) { for (i = 0; i < nsend; i++) { MPI_Waitany(nsend,requests,&irecv,MPI_STATUS_IGNORE); avec->unpack_reverse(sendnum[iswap][irecv],sendlist[iswap][irecv], - &buf_recv[size_reverse* - reverse_recv_offset[iswap][irecv]]); + &buf_recv[size_reverse*reverse_recv_offset[iswap][irecv]]); } } } @@ -989,8 +972,7 @@ void CommTiled::exchange() if (!nexch) continue; for (m = 0; m < nexch; m++) - MPI_Irecv(&exchnum[dim][m],1,MPI_INT, - exchproc[dim][m],0,world,&requests[m]); + MPI_Irecv(&exchnum[dim][m],1,MPI_INT,exchproc[dim][m],0,world,&requests[m]); for (m = 0; m < nexch; m++) MPI_Send(&nsend,1,MPI_INT,exchproc[dim][m],0,world); MPI_Waitall(nexch,requests,MPI_STATUS_IGNORE); @@ -1001,8 +983,7 @@ void CommTiled::exchange() offset = 0; for (m = 0; m < nexch; m++) { - MPI_Irecv(&buf_recv[offset],exchnum[dim][m], - MPI_DOUBLE,exchproc[dim][m],0,world,&requests[m]); + MPI_Irecv(&buf_recv[offset],exchnum[dim][m],MPI_DOUBLE,exchproc[dim][m],0,world,&requests[m]); offset += exchnum[dim][m]; } for (m = 0; m < nexch; m++) @@ -1233,8 +1214,7 @@ void CommTiled::borders() if (recvother[iswap]) for (m = 0; m < nrecv; m++) - MPI_Irecv(&recvnum[iswap][m],1,MPI_INT, - recvproc[iswap][m],0,world,&requests[m]); + MPI_Irecv(&recvnum[iswap][m],1,MPI_INT,recvproc[iswap][m],0,world,&requests[m]); if (sendother[iswap]) for (m = 0; m < nsend; m++) MPI_Send(&sendnum[iswap][m],1,MPI_INT,sendproc[iswap][m],0,world); @@ -1294,17 +1274,14 @@ void CommTiled::borders() } if (sendself[iswap]) { avec->pack_border_vel(sendnum[iswap][nsend],sendlist[iswap][nsend], - buf_send,pbc_flag[iswap][nsend], - pbc[iswap][nsend]); - avec->unpack_border_vel(recvnum[iswap][nrecv],firstrecv[iswap][nrecv], - buf_send); + buf_send,pbc_flag[iswap][nsend],pbc[iswap][nsend]); + avec->unpack_border_vel(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); } if (recvother[iswap]) { for (i = 0; i < nrecv; i++) { MPI_Waitany(nrecv,requests,&m,MPI_STATUS_IGNORE); avec->unpack_border_vel(recvnum[iswap][m],firstrecv[iswap][m], - &buf_recv[size_border* - forward_recv_offset[iswap][m]]); + &buf_recv[size_border*forward_recv_offset[iswap][m]]); } } @@ -1325,15 +1302,13 @@ void CommTiled::borders() if (sendself[iswap]) { avec->pack_border(sendnum[iswap][nsend],sendlist[iswap][nsend], buf_send,pbc_flag[iswap][nsend],pbc[iswap][nsend]); - avec->unpack_border(recvnum[iswap][nrecv],firstrecv[iswap][nrecv], - buf_send); + avec->unpack_border(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); } if (recvother[iswap]) { for (i = 0; i < nrecv; i++) { MPI_Waitany(nrecv,requests,&m,MPI_STATUS_IGNORE); avec->unpack_border(recvnum[iswap][m],firstrecv[iswap][m], - &buf_recv[size_border* - forward_recv_offset[iswap][m]]); + &buf_recv[size_border*forward_recv_offset[iswap][m]]); } } } @@ -1351,10 +1326,8 @@ void CommTiled::borders() // For molecular systems we lose some bits for local atom indices due // to encoding of special pairs in neighbor lists. Check for overflows. - if ((atom->molecular != Atom::ATOMIC) - && ((atom->nlocal + atom->nghost) > NEIGHMASK)) - error->one(FLERR,"Per-processor number of atoms is too large for " - "molecular neighbor lists"); + if ((atom->molecular != Atom::ATOMIC) && ((atom->nlocal + atom->nghost) > NEIGHMASK)) + error->one(FLERR,"Per-processor number of atoms is too large for molecular neighbor lists"); // insure send/recv buffers are long enough for all forward & reverse comm // send buf is for one forward or reverse sends to one proc @@ -1388,8 +1361,7 @@ void CommTiled::forward_comm(Pair *pair) if (recvother[iswap]) { for (i = 0; i < nrecv; i++) MPI_Irecv(&buf_recv[nsize*forward_recv_offset[iswap][i]], - nsize*recvnum[iswap][i], - MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); + nsize*recvnum[iswap][i],MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); } if (sendother[iswap]) { @@ -1402,17 +1374,14 @@ void CommTiled::forward_comm(Pair *pair) if (sendself[iswap]) { pair->pack_forward_comm(sendnum[iswap][nsend],sendlist[iswap][nsend], - buf_send,pbc_flag[iswap][nsend], - pbc[iswap][nsend]); - pair->unpack_forward_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv], - buf_send); + buf_send,pbc_flag[iswap][nsend],pbc[iswap][nsend]); + pair->unpack_forward_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); } if (recvother[iswap]) { for (i = 0; i < nrecv; i++) { MPI_Waitany(nrecv,requests,&irecv,MPI_STATUS_IGNORE); pair->unpack_forward_comm(recvnum[iswap][irecv],firstrecv[iswap][irecv], - &buf_recv[nsize* - forward_recv_offset[iswap][irecv]]); + &buf_recv[nsize*forward_recv_offset[iswap][irecv]]); } } } @@ -1436,28 +1405,107 @@ void CommTiled::reverse_comm(Pair *pair) if (sendother[iswap]) { for (i = 0; i < nsend; i++) MPI_Irecv(&buf_recv[nsize*reverse_recv_offset[iswap][i]], - nsize*sendnum[iswap][i],MPI_DOUBLE, - sendproc[iswap][i],0,world,&requests[i]); + nsize*sendnum[iswap][i],MPI_DOUBLE,sendproc[iswap][i],0,world,&requests[i]); } if (recvother[iswap]) { for (i = 0; i < nrecv; i++) { - n = pair->pack_reverse_comm(recvnum[iswap][i],firstrecv[iswap][i], - buf_send); + n = pair->pack_reverse_comm(recvnum[iswap][i],firstrecv[iswap][i],buf_send); MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap][i],0,world); } } if (sendself[iswap]) { - pair->pack_reverse_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv], - buf_send); - pair->unpack_reverse_comm(sendnum[iswap][nsend],sendlist[iswap][nsend], - buf_send); + pair->pack_reverse_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); + pair->unpack_reverse_comm(sendnum[iswap][nsend],sendlist[iswap][nsend],buf_send); } if (sendother[iswap]) { for (i = 0; i < nsend; i++) { MPI_Waitany(nsend,requests,&irecv,MPI_STATUS_IGNORE); pair->unpack_reverse_comm(sendnum[iswap][irecv],sendlist[iswap][irecv], - &buf_recv[nsize* - reverse_recv_offset[iswap][irecv]]); + &buf_recv[nsize*reverse_recv_offset[iswap][irecv]]); + } + } + } +} + +/* ---------------------------------------------------------------------- + forward communication invoked by a Bond + nsize used only to set recv buffer limit +------------------------------------------------------------------------- */ + +void CommTiled::forward_comm(Bond *bond) +{ + int i,irecv,n,nsend,nrecv; + + int nsize = bond->comm_forward; + + for (int iswap = 0; iswap < nswap; iswap++) { + nsend = nsendproc[iswap] - sendself[iswap]; + nrecv = nrecvproc[iswap] - sendself[iswap]; + + if (recvother[iswap]) { + for (i = 0; i < nrecv; i++) + MPI_Irecv(&buf_recv[nsize*forward_recv_offset[iswap][i]], + nsize*recvnum[iswap][i],MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); + } + + if (sendother[iswap]) { + for (i = 0; i < nsend; i++) { + n = bond->pack_forward_comm(sendnum[iswap][i],sendlist[iswap][i], + buf_send,pbc_flag[iswap][i],pbc[iswap][i]); + MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap][i],0,world); + } + } + + if (sendself[iswap]) { + bond->pack_forward_comm(sendnum[iswap][nsend],sendlist[iswap][nsend], + buf_send,pbc_flag[iswap][nsend],pbc[iswap][nsend]); + bond->unpack_forward_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); + } + if (recvother[iswap]) { + for (i = 0; i < nrecv; i++) { + MPI_Waitany(nrecv,requests,&irecv,MPI_STATUS_IGNORE); + bond->unpack_forward_comm(recvnum[iswap][irecv],firstrecv[iswap][irecv], + &buf_recv[nsize*forward_recv_offset[iswap][irecv]]); + } + } + } +} + +/* ---------------------------------------------------------------------- + reverse communication invoked by a Bond + nsize used only to set recv buffer limit +------------------------------------------------------------------------- */ + +void CommTiled::reverse_comm(Bond *bond) +{ + int i,irecv,n,nsend,nrecv; + + int nsize = MAX(bond->comm_reverse,bond->comm_reverse_off); + + for (int iswap = nswap-1; iswap >= 0; iswap--) { + nsend = nsendproc[iswap] - sendself[iswap]; + nrecv = nrecvproc[iswap] - sendself[iswap]; + + if (sendother[iswap]) { + for (i = 0; i < nsend; i++) + MPI_Irecv(&buf_recv[nsize*reverse_recv_offset[iswap][i]], + nsize*sendnum[iswap][i],MPI_DOUBLE,sendproc[iswap][i],0,world,&requests[i]); + } + if (recvother[iswap]) { + for (i = 0; i < nrecv; i++) { + n = bond->pack_reverse_comm(recvnum[iswap][i],firstrecv[iswap][i],buf_send); + MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap][i],0,world); + } + } + if (sendself[iswap]) { + bond->pack_reverse_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); + bond->unpack_reverse_comm(sendnum[iswap][nsend],sendlist[iswap][nsend],buf_send); + } + if (sendother[iswap]) { + for (i = 0; i < nsend; i++) { + MPI_Waitany(nsend,requests,&irecv,MPI_STATUS_IGNORE); + bond->unpack_reverse_comm(sendnum[iswap][irecv],sendlist[iswap][irecv], + &buf_recv[nsize*reverse_recv_offset[iswap][irecv]]); } } } @@ -1486,8 +1534,7 @@ void CommTiled::forward_comm(Fix *fix, int size) if (recvother[iswap]) { for (i = 0; i < nrecv; i++) MPI_Irecv(&buf_recv[nsize*forward_recv_offset[iswap][i]], - nsize*recvnum[iswap][i], - MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); + nsize*recvnum[iswap][i],MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); } if (sendother[iswap]) { for (i = 0; i < nsend; i++) { @@ -1498,17 +1545,14 @@ void CommTiled::forward_comm(Fix *fix, int size) } if (sendself[iswap]) { fix->pack_forward_comm(sendnum[iswap][nsend],sendlist[iswap][nsend], - buf_send,pbc_flag[iswap][nsend], - pbc[iswap][nsend]); - fix->unpack_forward_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv], - buf_send); + buf_send,pbc_flag[iswap][nsend],pbc[iswap][nsend]); + fix->unpack_forward_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); } if (recvother[iswap]) { for (i = 0; i < nrecv; i++) { MPI_Waitany(nrecv,requests,&irecv,MPI_STATUS_IGNORE); fix->unpack_forward_comm(recvnum[iswap][irecv],firstrecv[iswap][irecv], - &buf_recv[nsize* - forward_recv_offset[iswap][irecv]]); + &buf_recv[nsize*forward_recv_offset[iswap][irecv]]); } } } @@ -1537,28 +1581,23 @@ void CommTiled::reverse_comm(Fix *fix, int size) if (sendother[iswap]) { for (i = 0; i < nsend; i++) MPI_Irecv(&buf_recv[nsize*reverse_recv_offset[iswap][i]], - nsize*sendnum[iswap][i],MPI_DOUBLE, - sendproc[iswap][i],0,world,&requests[i]); + nsize*sendnum[iswap][i],MPI_DOUBLE,sendproc[iswap][i],0,world,&requests[i]); } if (recvother[iswap]) { for (i = 0; i < nrecv; i++) { - n = fix->pack_reverse_comm(recvnum[iswap][i],firstrecv[iswap][i], - buf_send); + n = fix->pack_reverse_comm(recvnum[iswap][i],firstrecv[iswap][i],buf_send); MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap][i],0,world); } } if (sendself[iswap]) { - fix->pack_reverse_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv], - buf_send); - fix->unpack_reverse_comm(sendnum[iswap][nsend],sendlist[iswap][nsend], - buf_send); + fix->pack_reverse_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); + fix->unpack_reverse_comm(sendnum[iswap][nsend],sendlist[iswap][nsend],buf_send); } if (sendother[iswap]) { for (i = 0; i < nsend; i++) { MPI_Waitany(nsend,requests,&irecv,MPI_STATUS_IGNORE); fix->unpack_reverse_comm(sendnum[iswap][irecv],sendlist[iswap][irecv], - &buf_recv[nsize* - reverse_recv_offset[iswap][irecv]]); + &buf_recv[nsize*reverse_recv_offset[iswap][irecv]]); } } } @@ -1594,31 +1633,26 @@ void CommTiled::forward_comm(Compute *compute) if (recvother[iswap]) { for (i = 0; i < nrecv; i++) MPI_Irecv(&buf_recv[nsize*forward_recv_offset[iswap][i]], - nsize*recvnum[iswap][i], - MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); + nsize*recvnum[iswap][i],MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); } if (sendother[iswap]) { for (i = 0; i < nsend; i++) { n = compute->pack_forward_comm(sendnum[iswap][i],sendlist[iswap][i], - buf_send,pbc_flag[iswap][i], - pbc[iswap][i]); + buf_send,pbc_flag[iswap][i],pbc[iswap][i]); MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap][i],0,world); } } if (sendself[iswap]) { compute->pack_forward_comm(sendnum[iswap][nsend],sendlist[iswap][nsend], - buf_send,pbc_flag[iswap][nsend], - pbc[iswap][nsend]); - compute->unpack_forward_comm(recvnum[iswap][nrecv], - firstrecv[iswap][nrecv],buf_send); + buf_send,pbc_flag[iswap][nsend],pbc[iswap][nsend]); + compute->unpack_forward_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); } if (recvother[iswap]) { for (i = 0; i < nrecv; i++) { MPI_Waitany(nrecv,requests,&irecv,MPI_STATUS_IGNORE); compute-> unpack_forward_comm(recvnum[iswap][irecv],firstrecv[iswap][irecv], - &buf_recv[nsize* - forward_recv_offset[iswap][irecv]]); + &buf_recv[nsize*forward_recv_offset[iswap][irecv]]); } } } @@ -1642,29 +1676,24 @@ void CommTiled::reverse_comm(Compute *compute) if (sendother[iswap]) { for (i = 0; i < nsend; i++) MPI_Irecv(&buf_recv[nsize*reverse_recv_offset[iswap][i]], - nsize*sendnum[iswap][i],MPI_DOUBLE, - sendproc[iswap][i],0,world,&requests[i]); + nsize*sendnum[iswap][i],MPI_DOUBLE,sendproc[iswap][i],0,world,&requests[i]); } if (recvother[iswap]) { for (i = 0; i < nrecv; i++) { - n = compute->pack_reverse_comm(recvnum[iswap][i],firstrecv[iswap][i], - buf_send); + n = compute->pack_reverse_comm(recvnum[iswap][i],firstrecv[iswap][i],buf_send); MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap][i],0,world); } } if (sendself[iswap]) { - compute->pack_reverse_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv], - buf_send); - compute->unpack_reverse_comm(sendnum[iswap][nsend],sendlist[iswap][nsend], - buf_send); + compute->pack_reverse_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); + compute->unpack_reverse_comm(sendnum[iswap][nsend],sendlist[iswap][nsend],buf_send); } if (sendother[iswap]) { for (i = 0; i < nsend; i++) { MPI_Waitany(nsend,requests,&irecv,MPI_STATUS_IGNORE); compute-> unpack_reverse_comm(sendnum[iswap][irecv],sendlist[iswap][irecv], - &buf_recv[nsize* - reverse_recv_offset[iswap][irecv]]); + &buf_recv[nsize*reverse_recv_offset[iswap][irecv]]); } } } @@ -1688,21 +1717,18 @@ void CommTiled::forward_comm(Dump *dump) if (recvother[iswap]) { for (i = 0; i < nrecv; i++) MPI_Irecv(&buf_recv[nsize*forward_recv_offset[iswap][i]], - nsize*recvnum[iswap][i], - MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); + nsize*recvnum[iswap][i],MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); } if (sendother[iswap]) { for (i = 0; i < nsend; i++) { n = dump->pack_forward_comm(sendnum[iswap][i],sendlist[iswap][i], - buf_send,pbc_flag[iswap][i], - pbc[iswap][i]); + buf_send,pbc_flag[iswap][i],pbc[iswap][i]); MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap][i],0,world); } } if (sendself[iswap]) { dump->pack_forward_comm(sendnum[iswap][nsend],sendlist[iswap][nsend], - buf_send,pbc_flag[iswap][nsend], - pbc[iswap][nsend]); + buf_send,pbc_flag[iswap][nsend],pbc[iswap][nsend]); dump->unpack_forward_comm(recvnum[iswap][nrecv], firstrecv[iswap][nrecv],buf_send); } @@ -1710,8 +1736,7 @@ void CommTiled::forward_comm(Dump *dump) for (i = 0; i < nrecv; i++) { MPI_Waitany(nrecv,requests,&irecv,MPI_STATUS_IGNORE); dump->unpack_forward_comm(recvnum[iswap][irecv],firstrecv[iswap][irecv], - &buf_recv[nsize* - forward_recv_offset[iswap][irecv]]); + &buf_recv[nsize*forward_recv_offset[iswap][irecv]]); } } } @@ -1735,28 +1760,23 @@ void CommTiled::reverse_comm(Dump *dump) if (sendother[iswap]) { for (i = 0; i < nsend; i++) MPI_Irecv(&buf_recv[nsize*reverse_recv_offset[iswap][i]], - nsize*sendnum[iswap][i],MPI_DOUBLE, - sendproc[iswap][i],0,world,&requests[i]); + nsize*sendnum[iswap][i],MPI_DOUBLE,sendproc[iswap][i],0,world,&requests[i]); } if (recvother[iswap]) { for (i = 0; i < nrecv; i++) { - n = dump->pack_reverse_comm(recvnum[iswap][i],firstrecv[iswap][i], - buf_send); + n = dump->pack_reverse_comm(recvnum[iswap][i],firstrecv[iswap][i],buf_send); MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap][i],0,world); } } if (sendself[iswap]) { - dump->pack_reverse_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv], - buf_send); - dump->unpack_reverse_comm(sendnum[iswap][nsend],sendlist[iswap][nsend], - buf_send); + dump->pack_reverse_comm(recvnum[iswap][nrecv],firstrecv[iswap][nrecv],buf_send); + dump->unpack_reverse_comm(sendnum[iswap][nsend],sendlist[iswap][nsend],buf_send); } if (sendother[iswap]) { for (i = 0; i < nsend; i++) { MPI_Waitany(nsend,requests,&irecv,MPI_STATUS_IGNORE); dump->unpack_reverse_comm(sendnum[iswap][irecv],sendlist[iswap][irecv], - &buf_recv[nsize* - reverse_recv_offset[iswap][irecv]]); + &buf_recv[nsize*reverse_recv_offset[iswap][irecv]]); } } } @@ -1788,8 +1808,7 @@ void CommTiled::forward_comm_array(int nsize, double **array) if (recvother[iswap]) { for (i = 0; i < nrecv; i++) MPI_Irecv(&buf_recv[nsize*forward_recv_offset[iswap][i]], - nsize*recvnum[iswap][i], - MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); + nsize*recvnum[iswap][i],MPI_DOUBLE,recvproc[iswap][i],0,world,&requests[i]); } if (sendother[iswap]) { for (i = 0; i < nsend; i++) { @@ -1799,8 +1818,7 @@ void CommTiled::forward_comm_array(int nsize, double **array) for (k = 0; k < nsize; k++) buf_send[m++] = array[j][k]; } - MPI_Send(buf_send,nsize*sendnum[iswap][i], - MPI_DOUBLE,sendproc[iswap][i],0,world); + MPI_Send(buf_send,nsize*sendnum[iswap][i],MPI_DOUBLE,sendproc[iswap][i],0,world); } } if (sendself[iswap]) { @@ -1919,8 +1937,7 @@ void CommTiled::box_drop_tiled(int /*idim*/, double *lo, double *hi, int &indexm box_drop_tiled_recurse(lo,hi,0,nprocs-1,indexme); } -void CommTiled::box_drop_tiled_recurse(double *lo, double *hi, - int proclower, int procupper, +void CommTiled::box_drop_tiled_recurse(double *lo, double *hi, int proclower, int procupper, int &indexme) { // end recursion when partition is a single proc @@ -1958,8 +1975,7 @@ void CommTiled::box_drop_tiled_recurse(double *lo, double *hi, return other box owned by proc as lo/hi corner pts ------------------------------------------------------------------------- */ -void CommTiled::box_other_brick(int idim, int idir, - int proc, double *lo, double *hi) +void CommTiled::box_other_brick(int idim, int idir, int proc, double *lo, double *hi) { lo[0] = sublo[0]; lo[1] = sublo[1]; lo[2] = sublo[2]; hi[0] = subhi[0]; hi[1] = subhi[1]; hi[2] = subhi[2]; @@ -2006,8 +2022,7 @@ void CommTiled::box_other_brick(int idim, int idir, return other box owned by proc as lo/hi corner pts ------------------------------------------------------------------------- */ -void CommTiled::box_other_tiled(int /*idim*/, int /*idir*/, - int proc, double *lo, double *hi) +void CommTiled::box_other_tiled(int /*idim*/, int /*idir*/, int proc, double *lo, double *hi) { double (*split)[2] = rcbinfo[proc].mysplit; @@ -2136,8 +2151,7 @@ int CommTiled::point_drop_tiled(int idim, double *x) recursive point drop thru RCB tree ------------------------------------------------------------------------- */ -int CommTiled::point_drop_tiled_recurse(double *x, - int proclower, int procupper) +int CommTiled::point_drop_tiled_recurse(double *x, int proclower, int procupper) { // end recursion when partition is a single proc // return proc @@ -2195,8 +2209,7 @@ void CommTiled::coord2proc_setup() memcpy(&rcbone.mysplit[0][0],&mysplit[0][0],6*sizeof(double)); rcbone.cutfrac = rcbcutfrac; rcbone.dim = rcbcutdim; - MPI_Allgather(&rcbone,sizeof(RCBinfo),MPI_CHAR, - rcbinfo,sizeof(RCBinfo),MPI_CHAR,world); + MPI_Allgather(&rcbone,sizeof(RCBinfo),MPI_CHAR,rcbinfo,sizeof(RCBinfo),MPI_CHAR,world); } /* ---------------------------------------------------------------------- diff --git a/src/comm_tiled.h b/src/comm_tiled.h index 270130844b..be79ec60a5 100644 --- a/src/comm_tiled.h +++ b/src/comm_tiled.h @@ -22,6 +22,7 @@ class CommTiled : public Comm { public: CommTiled(class LAMMPS *); CommTiled(class LAMMPS *, class Comm *); + ~CommTiled() override; void init() override; @@ -33,6 +34,8 @@ class CommTiled : public Comm { void forward_comm(class Pair *) override; // forward comm from a Pair void reverse_comm(class Pair *) override; // reverse comm from a Pair + void forward_comm(class Bond *) override; // forward comm from a Bond + void reverse_comm(class Bond *) override; // reverse comm from a Bond void forward_comm(class Fix *, int size = 0) override; // forward comm from a Fix void reverse_comm(class Fix *, int size = 0) override; // reverse comm from a Fix void reverse_comm_variable(class Fix *) override; // variable size reverse comm from a Fix diff --git a/src/compute_angle.cpp b/src/compute_angle.cpp index a7980c3885..e4db464f28 100644 --- a/src/compute_angle.cpp +++ b/src/compute_angle.cpp @@ -37,7 +37,7 @@ ComputeAngle::ComputeAngle(LAMMPS *lmp, int narg, char **arg) : // check if bond style hybrid exists - angle = (AngleHybrid *) force->angle_match("hybrid"); + angle = dynamic_cast( force->angle_match("hybrid")); if (!angle) error->all(FLERR,"Angle style for compute angle command is not hybrid"); size_vector = nsub = angle->nstyles; @@ -60,7 +60,7 @@ void ComputeAngle::init() { // recheck angle style in case it has been changed - angle = (AngleHybrid *) force->angle_match("hybrid"); + angle = dynamic_cast( force->angle_match("hybrid")); if (!angle) error->all(FLERR,"Angle style for compute angle command is not hybrid"); if (angle->nstyles != nsub) diff --git a/src/compute_angmom_chunk.cpp b/src/compute_angmom_chunk.cpp index 1351d379b7..49435c49fc 100644 --- a/src/compute_angmom_chunk.cpp +++ b/src/compute_angmom_chunk.cpp @@ -69,7 +69,7 @@ ComputeAngmomChunk::~ComputeAngmomChunk() void ComputeAngmomChunk::init() { - cchunk = (ComputeChunkAtom *) modify->get_compute_by_id(idchunk); + cchunk = dynamic_cast( modify->get_compute_by_id(idchunk)); if (!cchunk) error->all(FLERR, "Chunk/atom compute does not exist for compute angmom/chunk"); if (strcmp(cchunk->style, "chunk/atom") != 0) error->all(FLERR, "Compute angmom/chunk does not use chunk/atom compute"); @@ -187,7 +187,7 @@ void ComputeAngmomChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_bond.cpp b/src/compute_bond.cpp index 90d451c9f8..38f15211e0 100644 --- a/src/compute_bond.cpp +++ b/src/compute_bond.cpp @@ -37,7 +37,7 @@ ComputeBond::ComputeBond(LAMMPS *lmp, int narg, char **arg) : // check if bond style hybrid exists - bond = (BondHybrid *) force->bond_match("hybrid"); + bond = dynamic_cast( force->bond_match("hybrid")); if (!bond) error->all(FLERR,"Bond style for compute bond command is not hybrid"); size_vector = nsub = bond->nstyles; @@ -60,7 +60,7 @@ void ComputeBond::init() { // recheck bond style in case it has been changed - bond = (BondHybrid *) force->bond_match("hybrid"); + bond = dynamic_cast( force->bond_match("hybrid")); if (!bond) error->all(FLERR,"Bond style for compute bond command is not hybrid"); if (bond->nstyles != nsub) diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index 535720c575..446e306675 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -151,7 +151,7 @@ void ComputeCentroAtom::compute_peratom() int nhalf = nnn / 2; int npairs = nnn * (nnn - 1) / 2; - double *pairs = new double[npairs]; + auto pairs = new double[npairs]; // compute centro-symmetry parameter for each atom in group // use full neighbor list diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index daa8fc64e7..d9358d5f10 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -545,8 +545,8 @@ void ComputeChunkAtom::init() if ((idsflag == ONCE || lockcount) && !fixstore) { id_fix = utils::strdup(id + std::string("_COMPUTE_STORE")); - fixstore = (FixStore *) modify->add_fix(fmt::format("{} {} STORE peratom 1 1", - id_fix, group->names[igroup])); + fixstore = dynamic_cast( modify->add_fix(fmt::format("{} {} STORE peratom 1 1", + id_fix, group->names[igroup]))); } if ((idsflag != ONCE && !lockcount) && fixstore) { @@ -1084,8 +1084,8 @@ void ComputeChunkAtom::compress_chunk_ids() void ComputeChunkAtom::idring(int n, char *cbuf, void *ptr) { - ComputeChunkAtom *cptr = (ComputeChunkAtom *)ptr; - tagint *list = (tagint *) cbuf; + auto cptr = (ComputeChunkAtom *)ptr; + auto list = (tagint *) cbuf; std::map *hash = cptr->hash; for (int i = 0; i < n; i++) (*hash)[list[i]] = 0; } diff --git a/src/compute_chunk_spread_atom.cpp b/src/compute_chunk_spread_atom.cpp index 0bcfa3265c..3781e83aa7 100644 --- a/src/compute_chunk_spread_atom.cpp +++ b/src/compute_chunk_spread_atom.cpp @@ -184,7 +184,7 @@ void ComputeChunkSpreadAtom::init_chunk() int icompute = modify->find_compute(idchunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for compute chunk/spread/atom"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute chunk/spread/atom does not use chunk/atom compute"); } diff --git a/src/compute_com_chunk.cpp b/src/compute_com_chunk.cpp index 1fac12d9ba..8124a7dccd 100644 --- a/src/compute_com_chunk.cpp +++ b/src/compute_com_chunk.cpp @@ -75,7 +75,7 @@ void ComputeCOMChunk::init() int icompute = modify->find_compute(idchunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for compute com/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute com/chunk does not use chunk/atom compute"); } @@ -180,7 +180,7 @@ void ComputeCOMChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_coord_atom.cpp b/src/compute_coord_atom.cpp index 4487e82985..e7cd73df19 100644 --- a/src/compute_coord_atom.cpp +++ b/src/compute_coord_atom.cpp @@ -129,7 +129,7 @@ void ComputeCoordAtom::init() { if (cstyle == ORIENT) { int iorientorder = modify->find_compute(id_orientorder); - c_orientorder = (ComputeOrientOrderAtom *) (modify->compute[iorientorder]); + c_orientorder = dynamic_cast (modify->compute[iorientorder]); cutsq = c_orientorder->cutsq; l = c_orientorder->qlcomp; // communicate real and imaginary 2*l+1 components of the normalized vector diff --git a/src/compute_dihedral.cpp b/src/compute_dihedral.cpp index a411ce1a8b..86fd1b116e 100644 --- a/src/compute_dihedral.cpp +++ b/src/compute_dihedral.cpp @@ -37,10 +37,9 @@ ComputeDihedral::ComputeDihedral(LAMMPS *lmp, int narg, char **arg) : // check if dihedral style hybrid exists - dihedral = (DihedralHybrid *) force->dihedral_match("hybrid"); + dihedral = dynamic_cast( force->dihedral_match("hybrid")); if (!dihedral) - error->all(FLERR, - "Dihedral style for compute dihedral command is not hybrid"); + error->all(FLERR, "Dihedral style for compute dihedral command is not hybrid"); size_vector = nsub = dihedral->nstyles; emine = new double[nsub]; @@ -61,10 +60,9 @@ void ComputeDihedral::init() { // recheck dihedral style in case it has been changed - dihedral = (DihedralHybrid *) force->dihedral_match("hybrid"); + dihedral = dynamic_cast( force->dihedral_match("hybrid")); if (!dihedral) - error->all(FLERR, - "Dihedral style for compute dihedral command is not hybrid"); + error->all(FLERR, "Dihedral style for compute dihedral command is not hybrid"); if (dihedral->nstyles != nsub) error->all(FLERR,"Dihedral style for compute dihedral command has changed"); } diff --git a/src/compute_dipole_chunk.cpp b/src/compute_dipole_chunk.cpp index 161f4a5c2b..f1afcc01fd 100644 --- a/src/compute_dipole_chunk.cpp +++ b/src/compute_dipole_chunk.cpp @@ -94,7 +94,7 @@ void ComputeDipoleChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute dipole/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute dipole/chunk does not use chunk/atom compute"); @@ -232,7 +232,7 @@ void ComputeDipoleChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index c72570b9c6..ba9b5c997f 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -74,8 +74,8 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : // id = compute-ID + COMPUTE_STORE, fix group = compute group id_fix = utils::strdup(std::string(id) + "_COMPUTE_STORE"); - fix = (FixStore *) modify->add_fix(fmt::format("{} {} STORE peratom 1 3", - id_fix, group->names[igroup])); + fix = dynamic_cast( modify->add_fix(fmt::format("{} {} STORE peratom 1 3", + id_fix, group->names[igroup]))); // calculate xu,yu,zu for fix store array // skip if reset from restart file @@ -120,7 +120,7 @@ void ComputeDisplaceAtom::init() { // set fix which stores original atom coords - fix = (FixStore *) modify->get_fix_by_id(id_fix); + fix = dynamic_cast( modify->get_fix_by_id(id_fix)); if (!fix) error->all(FLERR,"Could not find compute displace/atom fix with ID {}", id_fix); if (refreshflag) { diff --git a/src/compute_gyration_chunk.cpp b/src/compute_gyration_chunk.cpp index fe6022cd47..f79325274f 100644 --- a/src/compute_gyration_chunk.cpp +++ b/src/compute_gyration_chunk.cpp @@ -95,7 +95,7 @@ void ComputeGyrationChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute gyration/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute gyration/chunk does not use chunk/atom compute"); } @@ -286,7 +286,7 @@ void ComputeGyrationChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_improper.cpp b/src/compute_improper.cpp index 42bb247ac0..3e0780be49 100644 --- a/src/compute_improper.cpp +++ b/src/compute_improper.cpp @@ -37,10 +37,9 @@ ComputeImproper::ComputeImproper(LAMMPS *lmp, int narg, char **arg) : // check if improper style hybrid exists - improper = (ImproperHybrid *) force->improper_match("hybrid"); + improper = dynamic_cast( force->improper_match("hybrid")); if (!improper) - error->all(FLERR, - "Improper style for compute improper command is not hybrid"); + error->all(FLERR, "Improper style for compute improper command is not hybrid"); size_vector = nsub = improper->nstyles; emine = new double[nsub]; @@ -61,10 +60,9 @@ void ComputeImproper::init() { // recheck improper style in case it has been changed - improper = (ImproperHybrid *) force->improper_match("hybrid"); + improper = dynamic_cast( force->improper_match("hybrid")); if (!improper) - error->all(FLERR, - "Improper style for compute improper command is not hybrid"); + error->all(FLERR, "Improper style for compute improper command is not hybrid"); if (improper->nstyles != nsub) error->all(FLERR,"Improper style for compute improper command has changed"); } diff --git a/src/compute_inertia_chunk.cpp b/src/compute_inertia_chunk.cpp index e60192b3ab..ceca61c1b7 100644 --- a/src/compute_inertia_chunk.cpp +++ b/src/compute_inertia_chunk.cpp @@ -74,7 +74,7 @@ void ComputeInertiaChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute inertia/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute inertia/chunk does not use chunk/atom compute"); } @@ -189,7 +189,7 @@ void ComputeInertiaChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_msd.cpp b/src/compute_msd.cpp index 229b965761..7b2059a0a0 100644 --- a/src/compute_msd.cpp +++ b/src/compute_msd.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -28,11 +27,9 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), - id_fix(nullptr) +ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), id_fix(nullptr) { - if (narg < 3) error->all(FLERR,"Illegal compute msd command"); + if (narg < 3) error->all(FLERR, "Illegal compute msd command"); vector_flag = 1; size_vector = 4; @@ -47,28 +44,33 @@ ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) : int iarg = 3; while (iarg < narg) { - if (strcmp(arg[iarg],"com") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal compute msd command"); - comflag = utils::logical(FLERR,arg[iarg+1],false,lmp); + if (strcmp(arg[iarg], "com") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute msd command"); + comflag = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else if (strcmp(arg[iarg],"average") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal compute msd command"); - avflag = utils::logical(FLERR,arg[iarg+1],false,lmp); + } else if (strcmp(arg[iarg], "average") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal compute msd command"); + avflag = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else error->all(FLERR,"Illegal compute msd command"); + } else + error->all(FLERR, "Illegal compute msd command"); } + if (group->dynamic[igroup]) + error->all(FLERR, "Compute {} is not compatible with dynamic groups", style); + // create a new fix STORE style for reference positions // id = compute-ID + COMPUTE_STORE, fix group = compute group id_fix = utils::strdup(id + std::string("_COMPUTE_STORE")); - fix = (FixStore *) modify->add_fix(fmt::format("{} {} STORE peratom 1 3", - id_fix, group->names[igroup])); + fix = dynamic_cast( modify->add_fix( + fmt::format("{} {} STORE peratom 1 3", id_fix, group->names[igroup]))); // calculate xu,yu,zu for fix store array // skip if reset from restart file - if (fix->restart_reset) fix->restart_reset = 0; + if (fix->restart_reset) + fix->restart_reset = 0; else { double **xoriginal = fix->astore; @@ -78,15 +80,17 @@ ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) : int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) - if (mask[i] & groupbit) domain->unmap(x[i],image[i],xoriginal[i]); - else xoriginal[i][0] = xoriginal[i][1] = xoriginal[i][2] = 0.0; + if (mask[i] & groupbit) + domain->unmap(x[i], image[i], xoriginal[i]); + else + xoriginal[i][0] = xoriginal[i][1] = xoriginal[i][2] = 0.0; // adjust for COM if requested if (comflag) { double cm[3]; masstotal = group->mass(igroup); - group->xcm(igroup,masstotal,cm); + group->xcm(igroup, masstotal, cm); for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { xoriginal[i][0] -= cm[0]; @@ -123,8 +127,8 @@ void ComputeMSD::init() { // set fix which stores reference atom coords - fix = (FixStore *) modify->get_fix_by_id(id_fix); - if (!fix) error->all(FLERR,"Could not find compute msd fix with ID {}", id_fix); + fix = dynamic_cast( modify->get_fix_by_id(id_fix)); + if (!fix) error->all(FLERR, "Could not find compute msd fix with ID {}", id_fix); // nmsd = # of atoms in group @@ -141,8 +145,10 @@ void ComputeMSD::compute_vector() // cm = current center of mass double cm[3]; - if (comflag) group->xcm(igroup,masstotal,cm); - else cm[0] = cm[1] = cm[2] = 0.0; + if (comflag) + group->xcm(igroup, masstotal, cm); + else + cm[0] = cm[1] = cm[2] = 0.0; // dx,dy,dz = displacement of atom from reference position // reference unwrapped position is stored by fix @@ -161,8 +167,8 @@ void ComputeMSD::compute_vector() double yprd = domain->yprd; double zprd = domain->zprd; - double dx,dy,dz; - int xbox,ybox,zbox; + double dx, dy, dz; + int xbox, ybox, zbox; double msd[4]; msd[0] = msd[1] = msd[2] = msd[3] = 0.0; @@ -174,36 +180,34 @@ void ComputeMSD::compute_vector() double navfac; if (avflag) { naverage++; - navfac = 1.0/(naverage+1); + navfac = 1.0 / (naverage + 1); } - if (domain->triclinic == 0) { for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { xbox = (image[i] & IMGMASK) - IMGMAX; ybox = (image[i] >> IMGBITS & IMGMASK) - IMGMAX; zbox = (image[i] >> IMG2BITS) - IMGMAX; - xtmp = x[i][0] + xbox*xprd - cm[0]; - ytmp = x[i][1] + ybox*yprd - cm[1]; - ztmp = x[i][2] + zbox*zprd - cm[2]; + xtmp = x[i][0] + xbox * xprd - cm[0]; + ytmp = x[i][1] + ybox * yprd - cm[1]; + ztmp = x[i][2] + zbox * zprd - cm[2]; // use running average position for reference if requested if (avflag) { - xoriginal[i][0] = (xoriginal[i][0]*naverage + xtmp)*navfac; - xoriginal[i][1] = (xoriginal[i][1]*naverage + ytmp)*navfac; - xoriginal[i][2] = (xoriginal[i][2]*naverage + ztmp)*navfac; + xoriginal[i][0] = (xoriginal[i][0] * naverage + xtmp) * navfac; + xoriginal[i][1] = (xoriginal[i][1] * naverage + ytmp) * navfac; + xoriginal[i][2] = (xoriginal[i][2] * naverage + ztmp) * navfac; } dx = xtmp - xoriginal[i][0]; dy = ytmp - xoriginal[i][1]; dz = ztmp - xoriginal[i][2]; - msd[0] += dx*dx; - msd[1] += dy*dy; - msd[2] += dz*dz; - msd[3] += dx*dx + dy*dy + dz*dz; - + msd[0] += dx * dx; + msd[1] += dy * dy; + msd[2] += dz * dz; + msd[3] += dx * dx + dy * dy + dz * dz; } } else { for (int i = 0; i < nlocal; i++) @@ -211,29 +215,29 @@ void ComputeMSD::compute_vector() xbox = (image[i] & IMGMASK) - IMGMAX; ybox = (image[i] >> IMGBITS & IMGMASK) - IMGMAX; zbox = (image[i] >> IMG2BITS) - IMGMAX; - xtmp = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox - cm[0]; - ytmp = x[i][1] + h[1]*ybox + h[3]*zbox - cm[1]; - ztmp = x[i][2] + h[2]*zbox - cm[2]; + xtmp = x[i][0] + h[0] * xbox + h[5] * ybox + h[4] * zbox - cm[0]; + ytmp = x[i][1] + h[1] * ybox + h[3] * zbox - cm[1]; + ztmp = x[i][2] + h[2] * zbox - cm[2]; // use running average position for reference if requested if (avflag) { - xoriginal[i][0] = (xoriginal[i][0]*naverage + xtmp)*navfac; - xoriginal[i][1] = (xoriginal[i][0]*naverage + xtmp)*navfac; - xoriginal[i][2] = (xoriginal[i][0]*naverage + xtmp)*navfac; + xoriginal[i][0] = (xoriginal[i][0] * naverage + xtmp) * navfac; + xoriginal[i][1] = (xoriginal[i][0] * naverage + xtmp) * navfac; + xoriginal[i][2] = (xoriginal[i][0] * naverage + xtmp) * navfac; } dx = xtmp - xoriginal[i][0]; dy = ytmp - xoriginal[i][1]; dz = ztmp - xoriginal[i][2]; - msd[0] += dx*dx; - msd[1] += dy*dy; - msd[2] += dz*dz; - msd[3] += dx*dx + dy*dy + dz*dz; + msd[0] += dx * dx; + msd[1] += dy * dy; + msd[2] += dz * dz; + msd[3] += dx * dx + dy * dy + dz * dz; } } - MPI_Allreduce(msd,vector,4,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(msd, vector, 4, MPI_DOUBLE, MPI_SUM, world); if (nmsd) { vector[0] /= nmsd; vector[1] /= nmsd; diff --git a/src/compute_msd_chunk.cpp b/src/compute_msd_chunk.cpp index cea6da100d..8624520cf7 100644 --- a/src/compute_msd_chunk.cpp +++ b/src/compute_msd_chunk.cpp @@ -57,8 +57,8 @@ ComputeMSDChunk::ComputeMSDChunk(LAMMPS *lmp, int narg, char **arg) : // otherwise size reset and init will be done in setup() id_fix = utils::strdup(std::string(id) + "_COMPUTE_STORE"); - fix = (FixStore *) modify->add_fix(fmt::format("{} {} STORE global 1 1", - id_fix,group->names[igroup])); + fix = dynamic_cast( modify->add_fix(fmt::format("{} {} STORE global 1 1", + id_fix,group->names[igroup]))); } /* ---------------------------------------------------------------------- */ @@ -85,7 +85,7 @@ void ComputeMSDChunk::init() int icompute = modify->find_compute(idchunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for compute msd/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute msd/chunk does not use chunk/atom compute"); @@ -93,7 +93,7 @@ void ComputeMSDChunk::init() // if firstflag, will be created in setup() if (!firstflag) { - fix = (FixStore *) modify->get_fix_by_id(id_fix); + fix = dynamic_cast( modify->get_fix_by_id(id_fix)); if (!fix) error->all(FLERR,"Could not find compute msd/chunk fix with ID {}", id_fix); } } @@ -235,7 +235,7 @@ void ComputeMSDChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_omega_chunk.cpp b/src/compute_omega_chunk.cpp index 1422614ae1..bf00dda6a8 100644 --- a/src/compute_omega_chunk.cpp +++ b/src/compute_omega_chunk.cpp @@ -81,7 +81,7 @@ void ComputeOmegaChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute omega/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute omega/chunk does not use chunk/atom compute"); } @@ -313,7 +313,7 @@ void ComputeOmegaChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp index ef1de29309..ad14b552a4 100644 --- a/src/compute_pressure.cpp +++ b/src/compute_pressure.cpp @@ -202,7 +202,7 @@ void ComputePressure::init() vptr = new double*[nvirial]; nvirial = 0; if (pairhybridflag && force->pair) { - PairHybrid *ph = (PairHybrid *) force->pair; + auto ph = dynamic_cast( force->pair); ph->no_virial_fdotr_compute = 1; vptr[nvirial++] = pairhybrid->virial; } diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index d4cec70fe4..606da288de 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -216,40 +216,40 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) : pack_choice[i] = &ComputePropertyAtom::pack_angmomz; } else if (strcmp(arg[iarg],"shapex") == 0) { - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); if (!avec_ellipsoid) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_shapex; } else if (strcmp(arg[iarg],"shapey") == 0) { - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); if (!avec_ellipsoid) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_shapey; } else if (strcmp(arg[iarg],"shapez") == 0) { - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); if (!avec_ellipsoid) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_shapez; } else if (strcmp(arg[iarg],"quatw") == 0) { - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - avec_body = (AtomVecBody *) atom->style_match("body"); - if (!avec_ellipsoid && !avec_body) + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + avec_body = dynamic_cast( atom->style_match("body")); + if (!avec_ellipsoid && !avec_body && !atom->quat_flag) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_quatw; } else if (strcmp(arg[iarg],"quati") == 0) { - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - avec_body = (AtomVecBody *) atom->style_match("body"); - if (!avec_ellipsoid && !avec_body) + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + avec_body = dynamic_cast( atom->style_match("body")); + if (!avec_ellipsoid && !avec_body && !atom->quat_flag) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_quati; } else if (strcmp(arg[iarg],"quatj") == 0) { - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - avec_body = (AtomVecBody *) atom->style_match("body"); - if (!avec_ellipsoid && !avec_body) + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + avec_body = dynamic_cast( atom->style_match("body")); + if (!avec_ellipsoid && !avec_body && !atom->quat_flag) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_quatj; } else if (strcmp(arg[iarg],"quatk") == 0) { - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - avec_body = (AtomVecBody *) atom->style_match("body"); - if (!avec_ellipsoid && !avec_body) + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + avec_body = dynamic_cast( atom->style_match("body")); + if (!avec_ellipsoid && !avec_body && !atom->quat_flag) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_quatk; @@ -267,65 +267,65 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) : pack_choice[i] = &ComputePropertyAtom::pack_tqz; } else if (strcmp(arg[iarg],"end1x") == 0) { - avec_line = (AtomVecLine *) atom->style_match("line"); + avec_line = dynamic_cast( atom->style_match("line")); if (!avec_line) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_end1x; } else if (strcmp(arg[iarg],"end1y") == 0) { - avec_line = (AtomVecLine *) atom->style_match("line"); + avec_line = dynamic_cast( atom->style_match("line")); if (!avec_line) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_end1y; } else if (strcmp(arg[iarg],"end1z") == 0) { - avec_line = (AtomVecLine *) atom->style_match("line"); + avec_line = dynamic_cast( atom->style_match("line")); if (!avec_line) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_end1z; } else if (strcmp(arg[iarg],"end2x") == 0) { - avec_line = (AtomVecLine *) atom->style_match("line"); + avec_line = dynamic_cast( atom->style_match("line")); if (!avec_line) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_end2x; } else if (strcmp(arg[iarg],"end2y") == 0) { - avec_line = (AtomVecLine *) atom->style_match("line"); + avec_line = dynamic_cast( atom->style_match("line")); if (!avec_line) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_end2y; } else if (strcmp(arg[iarg],"end2z") == 0) { - avec_line = (AtomVecLine *) atom->style_match("line"); + avec_line = dynamic_cast( atom->style_match("line")); if (!avec_line) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_end2z; } else if (strcmp(arg[iarg],"corner1x") == 0) { - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_tri = dynamic_cast( atom->style_match("tri")); if (!avec_tri) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_corner1x; } else if (strcmp(arg[iarg],"corner1y") == 0) { - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_tri = dynamic_cast( atom->style_match("tri")); if (!avec_tri) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_corner1y; } else if (strcmp(arg[iarg],"corner1z") == 0) { - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_tri = dynamic_cast( atom->style_match("tri")); if (!avec_tri) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_corner1z; } else if (strcmp(arg[iarg],"corner2x") == 0) { - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_tri = dynamic_cast( atom->style_match("tri")); if (!avec_tri) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_corner2x; } else if (strcmp(arg[iarg],"corner2y") == 0) { - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_tri = dynamic_cast( atom->style_match("tri")); if (!avec_tri) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_corner2y; } else if (strcmp(arg[iarg],"corner2z") == 0) { - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_tri = dynamic_cast( atom->style_match("tri")); if (!avec_tri) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_corner2z; } else if (strcmp(arg[iarg],"corner3x") == 0) { - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_tri = dynamic_cast( atom->style_match("tri")); if (!avec_tri) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_corner3x; } else if (strcmp(arg[iarg],"corner3y") == 0) { - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_tri = dynamic_cast( atom->style_match("tri")); if (!avec_tri) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_corner3y; } else if (strcmp(arg[iarg],"corner3z") == 0) { - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_tri = dynamic_cast( atom->style_match("tri")); if (!avec_tri) error->all(FLERR,"Compute property/atom for atom property that isn't allocated"); pack_choice[i] = &ComputePropertyAtom::pack_corner3z; @@ -409,10 +409,10 @@ ComputePropertyAtom::~ComputePropertyAtom() void ComputePropertyAtom::init() { - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - avec_line = (AtomVecLine *) atom->style_match("line"); - avec_tri = (AtomVecTri *) atom->style_match("tri"); - avec_body = (AtomVecBody *) atom->style_match("body"); + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + avec_line = dynamic_cast( atom->style_match("line")); + avec_tri = dynamic_cast( atom->style_match("tri")); + avec_body = dynamic_cast( atom->style_match("body")); // NOTE: could reset custom vector/array indices here, like dump custom does // in case have been deleted @@ -1334,7 +1334,7 @@ void ComputePropertyAtom::pack_quatw(int n) n += nvalues; } - } else { + } else if (avec_body) { AtomVecBody::Bonus *bonus = avec_body->bonus; int *body = atom->body; int *mask = atom->mask; @@ -1346,6 +1346,17 @@ void ComputePropertyAtom::pack_quatw(int n) else buf[n] = 0.0; n += nvalues; } + } else { + double **quat = atom->quat; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) + buf[n] = quat[i][0]; + else buf[n] = 0.0; + n += nvalues; + } } } @@ -1366,7 +1377,7 @@ void ComputePropertyAtom::pack_quati(int n) n += nvalues; } - } else { + } else if (avec_body) { AtomVecBody::Bonus *bonus = avec_body->bonus; int *body = atom->body; int *mask = atom->mask; @@ -1378,6 +1389,17 @@ void ComputePropertyAtom::pack_quati(int n) else buf[n] = 0.0; n += nvalues; } + } else { + double **quat = atom->quat; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) + buf[n] = quat[i][1]; + else buf[n] = 0.0; + n += nvalues; + } } } @@ -1398,7 +1420,7 @@ void ComputePropertyAtom::pack_quatj(int n) n += nvalues; } - } else { + } else if (avec_body) { AtomVecBody::Bonus *bonus = avec_body->bonus; int *body = atom->body; int *mask = atom->mask; @@ -1410,6 +1432,17 @@ void ComputePropertyAtom::pack_quatj(int n) else buf[n] = 0.0; n += nvalues; } + } else { + double **quat = atom->quat; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) + buf[n] = quat[i][2]; + else buf[n] = 0.0; + n += nvalues; + } } } @@ -1430,7 +1463,7 @@ void ComputePropertyAtom::pack_quatk(int n) n += nvalues; } - } else { + } else if (avec_body) { AtomVecBody::Bonus *bonus = avec_body->bonus; int *body = atom->body; int *mask = atom->mask; @@ -1442,6 +1475,17 @@ void ComputePropertyAtom::pack_quatk(int n) else buf[n] = 0.0; n += nvalues; } + } else { + double **quat = atom->quat; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) + buf[n] = quat[i][3]; + else buf[n] = 0.0; + n += nvalues; + } } } diff --git a/src/compute_property_chunk.cpp b/src/compute_property_chunk.cpp index 1fc430d13c..3154e01516 100644 --- a/src/compute_property_chunk.cpp +++ b/src/compute_property_chunk.cpp @@ -115,7 +115,7 @@ void ComputePropertyChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute property/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute property/chunk does not use chunk/atom compute"); } @@ -196,7 +196,7 @@ void ComputePropertyChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_reduce_chunk.cpp b/src/compute_reduce_chunk.cpp index 84af9056aa..1749503254 100644 --- a/src/compute_reduce_chunk.cpp +++ b/src/compute_reduce_chunk.cpp @@ -229,7 +229,7 @@ void ComputeReduceChunk::init_chunk() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute reduce/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute reduce/chunk does not use chunk/atom compute"); } @@ -451,7 +451,7 @@ void ComputeReduceChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_temp_chunk.cpp b/src/compute_temp_chunk.cpp index 8798835071..bd17e3995d 100644 --- a/src/compute_temp_chunk.cpp +++ b/src/compute_temp_chunk.cpp @@ -164,7 +164,7 @@ void ComputeTempChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute temp/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute temp/chunk does not use chunk/atom compute"); @@ -774,7 +774,7 @@ void ComputeTempChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_temp_deform.cpp b/src/compute_temp_deform.cpp index cd467c0069..3259ccd090 100644 --- a/src/compute_temp_deform.cpp +++ b/src/compute_temp_deform.cpp @@ -67,7 +67,7 @@ void ComputeTempDeform::init() auto fixes = modify->get_fix_by_style("^deform"); if (fixes.size() > 0) { - if (((FixDeform *) fixes[0])->remapflag == Domain::X_REMAP && comm->me == 0) + if ((dynamic_cast( fixes[0]))->remapflag == Domain::X_REMAP && comm->me == 0) error->warning(FLERR, "Using compute temp/deform with inconsistent fix deform remap option"); } else error->warning(FLERR, "Using compute temp/deform with no fix deform defined"); } diff --git a/src/compute_torque_chunk.cpp b/src/compute_torque_chunk.cpp index 508956bb27..79c0ce5aed 100644 --- a/src/compute_torque_chunk.cpp +++ b/src/compute_torque_chunk.cpp @@ -73,7 +73,7 @@ void ComputeTorqueChunk::init() if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for " "compute torque/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute torque/chunk does not use chunk/atom compute"); } @@ -185,7 +185,7 @@ void ComputeTorqueChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/compute_vacf.cpp b/src/compute_vacf.cpp index b6fbbedc48..ce3ba557aa 100644 --- a/src/compute_vacf.cpp +++ b/src/compute_vacf.cpp @@ -40,7 +40,7 @@ ComputeVACF::ComputeVACF(LAMMPS *lmp, int narg, char **arg) : // id = compute-ID + COMPUTE_STORE, fix group = compute group id_fix = utils::strdup(id + std::string("_COMPUTE_STORE")); - fix = (FixStore *) modify->add_fix(fmt::format("{} {} STORE peratom 1 3", id_fix, group->names[igroup])); + fix = dynamic_cast( modify->add_fix(fmt::format("{} {} STORE peratom 1 3", id_fix, group->names[igroup]))); // store current velocities in fix store array // skip if reset from restart file @@ -84,7 +84,7 @@ void ComputeVACF::init() { // set fix which stores original atom velocities - fix = (FixStore *) modify->get_fix_by_id(id_fix); + fix = dynamic_cast( modify->get_fix_by_id(id_fix)); if (!fix) error->all(FLERR,"Could not find compute vacf fix ID {}", id_fix); // nvacf = # of atoms in group diff --git a/src/compute_vcm_chunk.cpp b/src/compute_vcm_chunk.cpp index 8148ed3356..5ac73f8d1e 100644 --- a/src/compute_vcm_chunk.cpp +++ b/src/compute_vcm_chunk.cpp @@ -73,7 +73,7 @@ void ComputeVCMChunk::init() int icompute = modify->find_compute(idchunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for compute vcm/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute vcm/chunk does not use chunk/atom compute"); } @@ -175,7 +175,7 @@ void ComputeVCMChunk::lock_disable() { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->lockcount--; } } diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index f21d1fc23d..c19d9f3368 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -553,7 +553,7 @@ void CreateAtoms::command(int narg, char **arg) if (domain->triclinic) domain->x2lamda(atom->nlocal); domain->reset_box(); - Irregular *irregular = new Irregular(lmp); + auto irregular = new Irregular(lmp); irregular->migrate_atoms(1); delete irregular; if (domain->triclinic) domain->lamda2x(atom->nlocal); @@ -654,7 +654,7 @@ void CreateAtoms::add_random() // warm up the generator 30x to avoid correlations in first-particle // positions if runs are repeated with consecutive seeds - RanPark *random = new RanPark(lmp,seed); + auto random = new RanPark(lmp,seed); for (int ii=0; ii < 30; ii++) random->uniform(); // bounding box for atom creation diff --git a/src/create_box.cpp b/src/create_box.cpp index 34d840dfd3..73b60eb799 100644 --- a/src/create_box.cpp +++ b/src/create_box.cpp @@ -72,7 +72,7 @@ void CreateBox::command(int narg, char **arg) } else { domain->triclinic = 1; - RegPrism *region = (RegPrism *) domain->regions[iregion]; + auto region = dynamic_cast( domain->regions[iregion]); domain->boxlo[0] = region->xlo; domain->boxhi[0] = region->xhi; domain->boxlo[1] = region->ylo; diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index 11d3523cd0..8524d44b07 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -132,11 +132,11 @@ void DeleteAtoms::command(int narg, char **arg) // reset bonus data counts - AtomVecEllipsoid *avec_ellipsoid = - (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - AtomVecLine *avec_line = (AtomVecLine *) atom->style_match("line"); - AtomVecTri *avec_tri = (AtomVecTri *) atom->style_match("tri"); - AtomVecBody *avec_body = (AtomVecBody *) atom->style_match("body"); + auto avec_ellipsoid = + dynamic_cast( atom->style_match("ellipsoid")); + auto avec_line = dynamic_cast( atom->style_match("line")); + auto avec_tri = dynamic_cast( atom->style_match("tri")); + auto avec_body = dynamic_cast( atom->style_match("body")); bigint nlocal_bonus; if (atom->nellipsoids > 0) { @@ -428,7 +428,7 @@ void DeleteAtoms::delete_porosity(int narg, char **arg) int seed = utils::inumeric(FLERR,arg[4],false,lmp); options(narg-5,&arg[5]); - RanMars *random = new RanMars(lmp,seed + comm->me); + auto random = new RanMars(lmp,seed + comm->me); // allocate and initialize deletion list @@ -594,8 +594,8 @@ void DeleteAtoms::recount_topology() void DeleteAtoms::bondring(int nbuf, char *cbuf, void *ptr) { - DeleteAtoms *daptr = (DeleteAtoms *) ptr; - tagint *list = (tagint *) cbuf; + auto daptr = (DeleteAtoms *) ptr; + auto list = (tagint *) cbuf; std::map *hash = daptr->hash; int *num_bond = daptr->atom->num_bond; @@ -711,8 +711,8 @@ void DeleteAtoms::bondring(int nbuf, char *cbuf, void *ptr) void DeleteAtoms::molring(int n, char *cbuf, void *ptr) { - DeleteAtoms *daptr = (DeleteAtoms *)ptr; - tagint *list = (tagint *) cbuf; + auto daptr = (DeleteAtoms *)ptr; + auto list = (tagint *) cbuf; int *dlist = daptr->dlist; std::map *hash = daptr->hash; int nlocal = daptr->atom->nlocal; diff --git a/src/delete_bonds.cpp b/src/delete_bonds.cpp index 9947434da3..2dcbd4af56 100644 --- a/src/delete_bonds.cpp +++ b/src/delete_bonds.cpp @@ -19,8 +19,10 @@ #include "comm.h" #include "domain.h" #include "error.h" +#include "fix_bond_history.h" #include "force.h" #include "group.h" +#include "modify.h" #include "special.h" #include @@ -116,6 +118,10 @@ void DeleteBonds::command(int narg, char **arg) iarg++; } + // find instances of bond history to delete data + auto histories = modify->get_fix_by_style("BOND_HISTORY"); + int n_histories = histories.size(); + // border swap to insure type and mask is current for off-proc atoms // enforce PBC before in case atoms are outside box @@ -331,6 +337,11 @@ void DeleteBonds::command(int narg, char **arg) n = atom->num_bond[i]; atom->bond_type[i][m] = atom->bond_type[i][n-1]; atom->bond_atom[i][m] = atom->bond_atom[i][n-1]; + if (n_histories > 0) + for (auto &ihistory: histories) { + dynamic_cast(ihistory)->shift_history(i,m,n-1); + dynamic_cast(ihistory)->delete_history(i,n-1); + } atom->num_bond[i]--; } else m++; } else m++; @@ -431,32 +442,28 @@ void DeleteBonds::command(int narg, char **arg) if (atom->avec->bonds_allow) { bigint nbonds = 0; for (i = 0; i < nlocal; i++) nbonds += atom->num_bond[i]; - MPI_Allreduce(&nbonds,&atom->nbonds,1,MPI_LMP_BIGINT, - MPI_SUM,world); + MPI_Allreduce(&nbonds,&atom->nbonds,1,MPI_LMP_BIGINT,MPI_SUM,world); if (force->newton_bond == 0) atom->nbonds /= 2; } if (atom->avec->angles_allow) { bigint nangles = 0; for (i = 0; i < nlocal; i++) nangles += atom->num_angle[i]; - MPI_Allreduce(&nangles,&atom->nangles,1,MPI_LMP_BIGINT, - MPI_SUM,world); + MPI_Allreduce(&nangles,&atom->nangles,1,MPI_LMP_BIGINT,MPI_SUM,world); if (force->newton_bond == 0) atom->nangles /= 3; } if (atom->avec->dihedrals_allow) { bigint ndihedrals = 0; for (i = 0; i < nlocal; i++) ndihedrals += atom->num_dihedral[i]; - MPI_Allreduce(&ndihedrals,&atom->ndihedrals, - 1,MPI_LMP_BIGINT,MPI_SUM,world); + MPI_Allreduce(&ndihedrals,&atom->ndihedrals,1,MPI_LMP_BIGINT,MPI_SUM,world); if (force->newton_bond == 0) atom->ndihedrals /= 4; } if (atom->avec->impropers_allow) { bigint nimpropers = 0; for (i = 0; i < nlocal; i++) nimpropers += atom->num_improper[i]; - MPI_Allreduce(&nimpropers,&atom->nimpropers, - 1,MPI_LMP_BIGINT,MPI_SUM,world); + MPI_Allreduce(&nimpropers,&atom->nimpropers,1,MPI_LMP_BIGINT,MPI_SUM,world); if (force->newton_bond == 0) atom->nimpropers /= 4; } @@ -535,21 +542,18 @@ void DeleteBonds::command(int narg, char **arg) } if (comm->me == 0) { + constexpr auto fmtstr = " {} total {}, {} turned on, {} turned off\n"; if (atom->avec->bonds_allow) - utils::logmesg(lmp," {} total bonds, {} turned on, {} turned off\n", - atom->nbonds,bond_on,bond_off); + utils::logmesg(lmp,fmtstr,atom->nbonds,"bonds",bond_on,bond_off); if (atom->avec->angles_allow) - utils::logmesg(lmp," {} total angles, {} turned on, {} turned off\n", - atom->nangles,angle_on,angle_off); + utils::logmesg(lmp,fmtstr,atom->nangles,"angles",angle_on,angle_off); if (atom->avec->dihedrals_allow) - utils::logmesg(lmp," {} total dihedrals, {} turned on, {} turned off\n", - atom->ndihedrals,dihedral_on,dihedral_off); + utils::logmesg(lmp,fmtstr,atom->ndihedrals,"dihedrals",dihedral_on,dihedral_off); if (atom->avec->impropers_allow) - utils::logmesg(lmp," {} total impropers, {} turned on, {} turned off\n", - atom->nimpropers,improper_on,improper_off); + utils::logmesg(lmp,fmtstr,atom->nimpropers,"impropers",improper_on,improper_off); } // re-compute special list if requested diff --git a/src/deprecated.cpp b/src/deprecated.cpp index fb2fa887b1..4e19f39894 100644 --- a/src/deprecated.cpp +++ b/src/deprecated.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -31,24 +30,27 @@ void Deprecated::command(int narg, char **arg) const std::string cmd = input->command; if (cmd == "DEPRECATED") { - if (lmp->comm->me == 0) - utils::logmesg(lmp,"\nCommand 'DEPRECATED' is a dummy command\n\n"); + if (lmp->comm->me == 0) utils::logmesg(lmp, "\nCommand 'DEPRECATED' is a dummy command\n\n"); return; } else if (cmd == "reset_ids") { if (lmp->comm->me == 0) - utils::logmesg(lmp,"\n'reset_ids' has been renamed to 'reset_atom_ids'\n\n"); - } else if (utils::strmatch(cmd,"^kim_")) { + utils::logmesg(lmp, "\n'reset_ids' has been renamed to 'reset_atom_ids'\n\n"); + } else if (utils::strmatch(cmd, "^kim_")) { if (lmp->comm->me == 0) - utils::logmesg(lmp,"\nWARNING: 'kim_' has been renamed to " - "'kim '. Please update your input.\n\n"); + utils::logmesg(lmp, + "\nWARNING: 'kim_' has been renamed to 'kim '. " + "Please update your input.\n\n"); std::string newcmd("kim"); newcmd += " " + cmd.substr(4); - for (int i=0; i < narg; ++i) { - newcmd.append(1,' '); - newcmd.append(arg[i]); + for (int i = 0; i < narg; ++i) { + newcmd.append(1, ' '); + newcmd.append(arg[i]); } input->one(newcmd); return; + } else if ((cmd == "message") || (cmd == "server")) { + if (lmp->comm->me == 0) + utils::logmesg(lmp, "\nThe MESSAGE package has been replaced by the MDI package.\n\n"); } - error->all(FLERR,"This command is no longer available"); + error->all(FLERR, "This command is no longer available"); } diff --git a/src/deprecated.h b/src/deprecated.h index 609d0f9326..9f91a4cc27 100644 --- a/src/deprecated.h +++ b/src/deprecated.h @@ -20,6 +20,8 @@ CommandStyle(kim_interactions,Deprecated); CommandStyle(kim_param,Deprecated); CommandStyle(kim_property,Deprecated); CommandStyle(kim_query,Deprecated); +CommandStyle(message,Deprecated); +CommandStyle(server,Deprecated); // clang-format on #else diff --git a/src/dihedral_deprecated.cpp b/src/dihedral_deprecated.cpp index b1964d5210..57ea7f1afa 100644 --- a/src/dihedral_deprecated.cpp +++ b/src/dihedral_deprecated.cpp @@ -37,7 +37,7 @@ void DihedralDeprecated::settings(int, char **) // of the list of substyles if (utils::strmatch(my_style,"^hybrid")) { - DihedralHybrid *hybrid = (DihedralHybrid *)force->dihedral; + auto hybrid = dynamic_cast(force->dihedral); my_style = hybrid->keywords[hybrid->nstyles]; } diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp index c63f3c6592..75298604c9 100644 --- a/src/displace_atoms.cpp +++ b/src/displace_atoms.cpp @@ -177,7 +177,7 @@ void DisplaceAtoms::command(int narg, char **arg) // makes atom result independent of what proc owns it via random->reset() if (style == RANDOM) { - RanPark *random = new RanPark(lmp,1); + auto random = new RanPark(lmp,1); double dx = xscale*utils::numeric(FLERR,arg[2],false,lmp); double dy = yscale*utils::numeric(FLERR,arg[3],false,lmp); @@ -263,11 +263,10 @@ void DisplaceAtoms::command(int narg, char **arg) // AtomVec pointers to retrieve per-atom storage of extra quantities - AtomVecEllipsoid *avec_ellipsoid = - (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - AtomVecLine *avec_line = (AtomVecLine *) atom->style_match("line"); - AtomVecTri *avec_tri = (AtomVecTri *) atom->style_match("tri"); - AtomVecBody *avec_body = (AtomVecBody *) atom->style_match("body"); + auto avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + auto avec_line = dynamic_cast( atom->style_match("line")); + auto avec_tri = dynamic_cast( atom->style_match("tri")); + auto avec_body = dynamic_cast( atom->style_match("body")); double **x = atom->x; int *ellipsoid = atom->ellipsoid; @@ -345,7 +344,7 @@ void DisplaceAtoms::command(int narg, char **arg) if (domain->triclinic) domain->x2lamda(atom->nlocal); domain->reset_box(); - Irregular *irregular = new Irregular(lmp); + auto irregular = new Irregular(lmp); irregular->migrate_atoms(1); delete irregular; if (domain->triclinic) domain->lamda2x(atom->nlocal); diff --git a/src/domain.cpp b/src/domain.cpp index 29244dff6a..d3804d75bd 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -100,7 +100,7 @@ Domain::Domain(LAMMPS *lmp) : Pointers(lmp) boxhi_lamda[0] = boxhi_lamda[1] = boxhi_lamda[2] = 1.0; lattice = nullptr; - char **args = new char*[2]; + auto args = new char*[2]; args[0] = (char *) "none"; args[1] = (char *) "1.0"; set_lattice(2,args); @@ -186,7 +186,7 @@ void Domain::init() for (const auto &fix : fixes) if (utils::strmatch(fix->style,"^deform")) { deform_flag = 1; - if (((FixDeform *) fix)->remapflag == Domain::V_REMAP) { + if ((dynamic_cast( fix))->remapflag == Domain::V_REMAP) { deform_vremap = 1; deform_groupbit = fix->groupbit; } diff --git a/src/dump.cpp b/src/dump.cpp index f11f21f71e..c9a98cb239 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -150,19 +150,19 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) Dump::~Dump() { - delete [] id; - delete [] style; - delete [] filename; - delete [] multiname; + delete[] id; + delete[] style; + delete[] filename; + delete[] multiname; - delete [] format; - delete [] format_default; - delete [] format_line_user; - delete [] format_float_user; - delete [] format_int_user; - delete [] format_bigint_user; + delete[] format; + delete[] format_default; + delete[] format_line_user; + delete[] format_float_user; + delete[] format_int_user; + delete[] format_bigint_user; - delete [] refresh; + delete[] refresh; // format_column_user is deallocated by child classes that use it @@ -270,12 +270,12 @@ void Dump::init() reorderflag = 1; double range = maxall-minall + EPSILON; idlo = static_cast (range*me/nprocs + minall); - tagint idhi = static_cast (range*(me+1)/nprocs + minall); + auto idhi = static_cast (range*(me+1)/nprocs + minall); - tagint lom1 = static_cast ((idlo-1-minall)/range * nprocs); - tagint lo = static_cast ((idlo-minall)/range * nprocs); - tagint him1 = static_cast ((idhi-1-minall)/range * nprocs); - tagint hi = static_cast ((idhi-minall)/range * nprocs); + auto lom1 = static_cast ((idlo-1-minall)/range * nprocs); + auto lo = static_cast ((idlo-minall)/range * nprocs); + auto him1 = static_cast ((idhi-1-minall)/range * nprocs); + auto hi = static_cast ((idhi-minall)/range * nprocs); if (me && me == lom1) idlo--; else if (me && me != lo) idlo++; if (me+1 == him1) idhi--; @@ -549,20 +549,7 @@ void Dump::openfile() if (multiproc) filecurrent = multiname; if (multifile) { - char *filestar = filecurrent; - filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar,'*'); - *ptr = '\0'; - if (padflag == 0) - sprintf(filecurrent,"%s" BIGINT_FORMAT "%s", - filestar,update->ntimestep,ptr+1); - else { - char bif[8],pad[16]; - strcpy(bif,BIGINT_FORMAT); - sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); - sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1); - } - *ptr = '*'; + filecurrent = utils::strdup(utils::star_subst(filecurrent, update->ntimestep, padflag)); if (maxfiles > 0) { if (numfiles < maxfiles) { nameslist[numfiles] = utils::strdup(filecurrent); @@ -594,7 +581,7 @@ void Dump::openfile() // delete string with timestep replaced - if (multifile) delete [] filecurrent; + if (multifile) delete[] filecurrent; } /* ---------------------------------------------------------------------- @@ -854,7 +841,7 @@ int Dump::idcompare(const int i, const int j, void *ptr) int Dump::bufcompare(const int i, const int j, void *ptr) { - Dump *dptr = (Dump *) ptr; + auto dptr = (Dump *) ptr; double *bufsort = dptr->bufsort; const int size_one = dptr->size_one; const int sortcolm1 = dptr->sortcolm1; @@ -875,7 +862,7 @@ int Dump::bufcompare(const int i, const int j, void *ptr) int Dump::bufcompare_reverse(const int i, const int j, void *ptr) { - Dump *dptr = (Dump *) ptr; + auto dptr = (Dump *) ptr; double *bufsort = dptr->bufsort; const int size_one = dptr->size_one; const int sortcolm1 = dptr->sortcolm1; @@ -951,7 +938,7 @@ void Dump::balance() // post recvs first int nswap = 0; - MPI_Request *request = new MPI_Request[nprocs]; + auto request = new MPI_Request[nprocs]; // find which proc starting atom belongs to @@ -1032,7 +1019,7 @@ void Dump::balance() memory->destroy(tmp); memory->destroy(proc_offsets); memory->destroy(proc_new_offsets); - delete [] request; + delete[] request; } /* ---------------------------------------------------------------------- @@ -1072,7 +1059,7 @@ void Dump::modify_params(int narg, char **arg) if (strcmp(id,output->dump[idump]->id) == 0) break; int n; if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { - delete [] output->var_dump[idump]; + delete[] output->var_dump[idump]; output->var_dump[idump] = utils::strdup(&arg[iarg+1][2]); n = 0; } else { @@ -1090,7 +1077,7 @@ void Dump::modify_params(int narg, char **arg) if (strcmp(id,output->dump[idump]->id) == 0) break; double delta; if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { - delete [] output->var_dump[idump]; + delete[] output->var_dump[idump]; output->var_dump[idump] = utils::strdup(&arg[iarg+1][2]); delta = 0.0; } else { @@ -1120,7 +1107,7 @@ void Dump::modify_params(int narg, char **arg) MPI_Comm_free(&clustercomm); MPI_Comm_split(world,icluster,0,&clustercomm); - delete [] multiname; + delete[] multiname; char *ptr = strchr(filename,'%'); *ptr = '\0'; multiname = utils::strdup(fmt::format("{}{}{}", filename, icluster, ptr+1)); @@ -1137,14 +1124,38 @@ void Dump::modify_params(int narg, char **arg) flush_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; + } else if (strcmp(arg[iarg],"colname") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); + if (strcmp(arg[iarg+1],"default") == 0) { + for (auto item : keyword_user) item.clear(); + iarg += 2; + } else { + if (iarg+3 > narg) error->all(FLERR,"Illegal dump_modify command"); + int icol = -1; + if (utils::is_integer(arg[iarg + 1])) { + icol = utils::inumeric(FLERR,arg[iarg + 1],false,lmp); + if (icol < 0) icol = keyword_user.size() + icol + 1; + icol--; + } else { + try { + icol = key2col.at(arg[iarg + 1]); + } catch (std::out_of_range &) { + icol = -1; + } + } + if ((icol < 0) || (icol >= (int)keyword_user.size())) + error->all(FLERR, "Illegal thermo_modify command"); + keyword_user[icol] = arg[iarg+2]; + iarg += 3; + } } else if (strcmp(arg[iarg],"format") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); if (strcmp(arg[iarg+1],"none") == 0) { - delete [] format_line_user; - delete [] format_int_user; - delete [] format_bigint_user; - delete [] format_float_user; + delete[] format_line_user; + delete[] format_int_user; + delete[] format_bigint_user; + delete[] format_float_user; format_line_user = nullptr; format_int_user = nullptr; format_bigint_user = nullptr; @@ -1159,7 +1170,7 @@ void Dump::modify_params(int narg, char **arg) if (iarg+3 > narg) error->all(FLERR,"Illegal dump_modify command"); if (strcmp(arg[iarg+1],"line") == 0) { - delete [] format_line_user; + delete[] format_line_user; format_line_user = utils::strdup(arg[iarg+2]); iarg += 3; } else { // pass other format options to child classes @@ -1170,7 +1181,7 @@ void Dump::modify_params(int narg, char **arg) } else if (strcmp(arg[iarg],"header") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); - header_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); + write_header_flag = utils::logical(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"maxfiles") == 0) { @@ -1217,7 +1228,7 @@ void Dump::modify_params(int narg, char **arg) MPI_Comm_free(&clustercomm); MPI_Comm_split(world,icluster,0,&clustercomm); - delete [] multiname; + delete[] multiname; char *ptr = strchr(filename,'%'); *ptr = '\0'; multiname = utils::strdup(fmt::format("{}{}{}", filename, icluster, ptr+1)); diff --git a/src/dump.h b/src/dump.h index bce32c9d65..c8712e5909 100644 --- a/src/dump.h +++ b/src/dump.h @@ -16,6 +16,8 @@ #include "pointers.h" // IWYU pragma: export +#include + namespace LAMMPS_NS { class Dump : protected Pointers { @@ -64,7 +66,6 @@ class Dump : protected Pointers { char *multiname; // filename with % converted to cluster ID MPI_Comm clustercomm; // MPI communicator within my cluster of procs - int header_flag; // 0 = item, 2 = xyz int flush_flag; // 0 if no flush, 1 if flush every dump int sort_flag; // 1 if sorted output int balance_flag; // 1 if load balanced output @@ -100,6 +101,8 @@ class Dump : protected Pointers { char *format_bigint_user; char **format_column_user; enum { INT, DOUBLE, STRING, BIGINT }; + std::map key2col; + std::vector keyword_user; FILE *fp; // file to write dump to int size_one; // # of quantities for one atom diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp index 0dbd3b3278..f52ba94f33 100644 --- a/src/dump_atom.cpp +++ b/src/dump_atom.cpp @@ -38,6 +38,9 @@ DumpAtom::DumpAtom(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) buffer_allow = 1; buffer_flag = 1; format_default = nullptr; + key2col = { { "id", 0 }, { "type", 1 }, { "x", 2 }, { "y", 3 }, + { "z", 4 }, { "ix", 5 }, { "iy", 6 }, { "iz", 7 } }; + keyword_user = { "", "", "", "", "", "", "", "" }; } /* ---------------------------------------------------------------------- */ @@ -64,14 +67,25 @@ void DumpAtom::init_style() // setup column string + std::string default_columns; + if (scale_flag == 0 && image_flag == 0) - columns = (char *) "id type x y z"; + default_columns = "id type x y z"; else if (scale_flag == 0 && image_flag == 1) - columns = (char *) "id type x y z ix iy iz"; + default_columns = "id type x y z ix iy iz"; else if (scale_flag == 1 && image_flag == 0) - columns = (char *) "id type xs ys zs"; + default_columns = "id type xs ys zs"; else if (scale_flag == 1 && image_flag == 1) - columns = (char *) "id type xs ys zs ix iy iz"; + default_columns = "id type xs ys zs ix iy iz"; + + int icol = 0; + columns.clear(); + for (auto item : utils::split_words(default_columns)) { + if (columns.size()) columns += " "; + if (keyword_user[icol].size()) columns += keyword_user[icol]; + else columns += item; + ++icol; + } // setup function ptrs @@ -201,9 +215,9 @@ void DumpAtom::header_unit_style_binary() void DumpAtom::header_columns_binary() { - int len = strlen(columns); + int len = columns.size(); fwrite(&len, sizeof(int), 1, fp); - fwrite(columns, sizeof(char), len, fp); + fwrite(columns.c_str(), sizeof(char), len, fp); } /* ---------------------------------------------------------------------- */ @@ -289,19 +303,19 @@ void DumpAtom::header_item(bigint ndump) { if (unit_flag && !unit_count) { ++unit_count; - fprintf(fp,"ITEM: UNITS\n%s\n",update->unit_style); + fmt::print(fp,"ITEM: UNITS\n{}\n",update->unit_style); } - if (time_flag) fprintf(fp,"ITEM: TIME\n%.16g\n",compute_time()); + if (time_flag) fmt::print(fp,"ITEM: TIME\n{:.16}\n",compute_time()); - fprintf(fp,"ITEM: TIMESTEP\n"); - fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); - fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); - fprintf(fp,BIGINT_FORMAT "\n",ndump); - fprintf(fp,"ITEM: BOX BOUNDS %s\n",boundstr); - fprintf(fp,"%-1.16e %-1.16e\n",boxxlo,boxxhi); - fprintf(fp,"%-1.16e %-1.16e\n",boxylo,boxyhi); - fprintf(fp,"%-1.16e %-1.16e\n",boxzlo,boxzhi); - fprintf(fp,"ITEM: ATOMS %s\n",columns); + fmt::print(fp, "ITEM: TIMESTEP\n{}\nITEM: NUMBER OF ATOMS\n{}\n", update->ntimestep, ndump); + + fmt::print(fp,"ITEM: BOX BOUNDS {}\n" + "{:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e}\n", + boundstr,boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi); + + fmt::print(fp,"ITEM: ATOMS {}\n",columns); } /* ---------------------------------------------------------------------- */ @@ -310,19 +324,19 @@ void DumpAtom::header_item_triclinic(bigint ndump) { if (unit_flag && !unit_count) { ++unit_count; - fprintf(fp,"ITEM: UNITS\n%s\n",update->unit_style); + fmt::print(fp,"ITEM: UNITS\n{}\n",update->unit_style); } - if (time_flag) fprintf(fp,"ITEM: TIME\n%.16g\n",compute_time()); + if (time_flag) fmt::print(fp,"ITEM: TIME\n{:.16}\n",compute_time()); - fprintf(fp,"ITEM: TIMESTEP\n"); - fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); - fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); - fprintf(fp,BIGINT_FORMAT "\n",ndump); - fprintf(fp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxxlo,boxxhi,boxxy); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxylo,boxyhi,boxxz); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxzlo,boxzhi,boxyz); - fprintf(fp,"ITEM: ATOMS %s\n",columns); + fmt::print(fp, "ITEM: TIMESTEP\n{}\nITEM: NUMBER OF ATOMS\n{}\n", update->ntimestep, ndump); + + fmt::print(fp,"ITEM: BOX BOUNDS xy xz yz {}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n", + boundstr,boxxlo,boxxhi,boxxy,boxylo,boxyhi,boxxz,boxzlo,boxzhi,boxyz); + + fmt::print(fp,"ITEM: ATOMS {}\n",columns); } /* ---------------------------------------------------------------------- */ diff --git a/src/dump_atom.h b/src/dump_atom.h index 1e1a9315d7..3c67e3de54 100644 --- a/src/dump_atom.h +++ b/src/dump_atom.h @@ -36,7 +36,7 @@ class DumpAtom : public Dump { int scale_flag; // 1 if atom coords are scaled, 0 if no int image_flag; // 1 if append box count to atom coords, 0 if no - char *columns; // column labels + std::string columns; // column labels void init_style() override; int modify_param(int, char **) override; diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index d52dac745f..4cb71ef923 100644 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -53,26 +53,26 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : if (strcmp(earg[2],"xs") == 0) { if (strcmp(earg[3],"ysu") == 0 || strcmp(earg[4],"zsu") == 0) - error->all(FLERR, - "Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu"); + error->all(FLERR,"Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu"); unwrapflag = 0; } else { if (strcmp(earg[3],"ys") == 0 || strcmp(earg[4],"zs") == 0) - error->all(FLERR, - "Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu"); + error->all(FLERR,"Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu"); unwrapflag = 1; } // setup auxiliary property name strings // convert 'X_ID[m]' (X=c,f,v) to 'X_ID_m' - if (nfield > 5) auxname = new char*[nfield]; + if (nfield > 5) auxname = new char*[nfield-5]; else auxname = nullptr; int i = 0; + key2col.clear(); + keyword_user.resize(nfield-5); for (int iarg = 5; iarg < nfield; iarg++, i++) { - ArgInfo argi(earg[iarg],ArgInfo::COMPUTE|ArgInfo::FIX|ArgInfo::VARIABLE - |ArgInfo::DNAME|ArgInfo::INAME); + ArgInfo argi(earg[iarg],ArgInfo::COMPUTE|ArgInfo::FIX|ArgInfo::VARIABLE| + ArgInfo::DNAME|ArgInfo::INAME); if (argi.get_dim() == 1) { std::string newarg = fmt::format("{}_{}_{}", earg[iarg][0], argi.get_name(), argi.get_index1()); @@ -80,6 +80,8 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : } else { auxname[i] = utils::strdup(earg[iarg]); } + key2col[earg[iarg]] = i; + keyword_user[i].clear(); } } @@ -88,8 +90,8 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : DumpCFG::~DumpCFG() { if (auxname) { - for (int i = 0; i < nfield-5; i++) delete [] auxname[i]; - delete [] auxname; + for (int i = 0; i < nfield-5; i++) delete[] auxname[i]; + delete[] auxname; } } @@ -123,21 +125,25 @@ void DumpCFG::write_header(bigint n) if (atom->peri_flag) scale = atom->pdscale; else if (unwrapflag == 1) scale = UNWRAPEXPAND; - fprintf(fp,"Number of particles = " BIGINT_FORMAT "\n", n); - fprintf(fp,"A = %g Angstrom (basic length-scale)\n",scale); - fprintf(fp,"H0(1,1) = %g A\n",domain->xprd); - fprintf(fp,"H0(1,2) = 0 A \n"); - fprintf(fp,"H0(1,3) = 0 A \n"); - fprintf(fp,"H0(2,1) = %g A \n",domain->xy); - fprintf(fp,"H0(2,2) = %g A\n",domain->yprd); - fprintf(fp,"H0(2,3) = 0 A \n"); - fprintf(fp,"H0(3,1) = %g A \n",domain->xz); - fprintf(fp,"H0(3,2) = %g A \n",domain->yz); - fprintf(fp,"H0(3,3) = %g A\n",domain->zprd); - fprintf(fp,".NO_VELOCITY.\n"); - fprintf(fp,"entry_count = %d\n",nfield-2); + auto header = fmt::format("Number of particles = {}\n",n); + header += fmt::format("A = {:g} Angstrom (basic length-scale)\n",scale); + header += fmt::format("H0(1,1) = {:g} A\n",domain->xprd); + header += fmt::format("H0(1,2) = 0 A\n"); + header += fmt::format("H0(1,3) = 0 A\n"); + header += fmt::format("H0(2,1) = {:g} A\n",domain->xy); + header += fmt::format("H0(2,2) = {:g} A\n",domain->yprd); + header += fmt::format("H0(2,3) = 0 A\n"); + header += fmt::format("H0(3,1) = {:g} A\n",domain->xz); + header += fmt::format("H0(3,2) = {:g} A\n",domain->yz); + header += fmt::format("H0(3,3) = {:g} A\n",domain->zprd); + header += fmt::format(".NO_VELOCITY.\n"); + header += fmt::format("entry_count = {}\n",nfield-2); for (int i = 0; i < nfield-5; i++) - fprintf(fp,"auxiliary[%d] = %s\n",i,auxname[i]); + if (keyword_user[i].size()) + header += fmt::format("auxiliary[{}] = {}\n",i,keyword_user[i]); + else + header += fmt::format("auxiliary[{}] = {}\n",i,auxname[i]); + fmt::print(fp, header); } /* ---------------------------------------------------------------------- diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 5d371d3145..5c8b133700 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -55,14 +55,11 @@ enum{LT,LE,GT,GE,EQ,NEQ,XOR}; DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), idregion(nullptr), thresh_array(nullptr), thresh_op(nullptr), thresh_value(nullptr), - thresh_last(nullptr), thresh_fix(nullptr), - thresh_fixID(nullptr), thresh_first(nullptr), - earg(nullptr), vtype(nullptr), vformat(nullptr), columns(nullptr), choose(nullptr), - dchoose(nullptr), clist(nullptr), field2index(nullptr), - argindex(nullptr), id_compute(nullptr), - compute(nullptr), id_fix(nullptr), fix(nullptr), - id_variable(nullptr), variable(nullptr), - vbuf(nullptr), id_custom(nullptr), custom(nullptr), custom_flag(nullptr), + thresh_last(nullptr), thresh_fix(nullptr), thresh_fixID(nullptr), thresh_first(nullptr), + earg(nullptr), vtype(nullptr), vformat(nullptr), columns(nullptr), columns_default(nullptr), + choose(nullptr), dchoose(nullptr), clist(nullptr), field2index(nullptr), argindex(nullptr), + id_compute(nullptr), compute(nullptr), id_fix(nullptr), fix(nullptr), id_variable(nullptr), + variable(nullptr), vbuf(nullptr), id_custom(nullptr), custom(nullptr), custom_flag(nullptr), typenames(nullptr), pack_choice(nullptr) { if (narg == 5) error->all(FLERR,"No dump custom arguments specified"); @@ -180,13 +177,14 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : // setup column string cols.clear(); + keyword_user.resize(nfield); for (int iarg = 0; iarg < nfield; iarg++) { + key2col[earg[iarg]] = iarg; + keyword_user[iarg].clear(); + if (cols.size()) cols += " "; cols += earg[iarg]; - cols += " "; } - // remove trailing blank and copy - cols.resize(cols.size()-1); - columns = utils::strdup(cols); + columns_default = utils::strdup(cols); } /* ---------------------------------------------------------------------- */ @@ -257,6 +255,7 @@ DumpCustom::~DumpCustom() delete[] format_column_user; } + delete[] columns_default; delete[] columns; } @@ -264,6 +263,19 @@ DumpCustom::~DumpCustom() void DumpCustom::init_style() { + // assemble ITEMS: column string from defaults and user values + + delete[] columns; + std::string combined; + int icol = 0; + for (auto item : utils::split_words(columns_default)) { + if (combined.size()) combined += " "; + if (keyword_user[icol].size()) combined += keyword_user[icol]; + else combined += item; + ++icol; + } + columns = utils::strdup(combined); + // format = copy of default or user-specified line format delete[] format; @@ -507,19 +519,21 @@ void DumpCustom::header_item(bigint ndump) { if (unit_flag && !unit_count) { ++unit_count; - fprintf(fp,"ITEM: UNITS\n%s\n",update->unit_style); + fmt::print(fp,"ITEM: UNITS\n{}\n",update->unit_style); } - if (time_flag) fprintf(fp,"ITEM: TIME\n%.16g\n",compute_time()); + if (time_flag) fmt::print(fp,"ITEM: TIME\n{:.16}\n",compute_time()); - fprintf(fp,"ITEM: TIMESTEP\n"); - fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); - fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); - fprintf(fp,BIGINT_FORMAT "\n",ndump); - fprintf(fp,"ITEM: BOX BOUNDS %s\n",boundstr); - fprintf(fp,"%-1.16e %-1.16e\n",boxxlo,boxxhi); - fprintf(fp,"%-1.16e %-1.16e\n",boxylo,boxyhi); - fprintf(fp,"%-1.16e %-1.16e\n",boxzlo,boxzhi); - fprintf(fp,"ITEM: ATOMS %s\n",columns); + fmt::print(fp,"ITEM: TIMESTEP\n{}\n" + "ITEM: NUMBER OF ATOMS\n{}\n", + update->ntimestep, ndump); + + fmt::print(fp,"ITEM: BOX BOUNDS {}\n" + "{:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e}\n", + boundstr,boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi); + + fmt::print(fp,"ITEM: ATOMS {}\n",columns); } /* ---------------------------------------------------------------------- */ @@ -528,19 +542,21 @@ void DumpCustom::header_item_triclinic(bigint ndump) { if (unit_flag && !unit_count) { ++unit_count; - fprintf(fp,"ITEM: UNITS\n%s\n",update->unit_style); + fmt::print(fp,"ITEM: UNITS\n{}\n",update->unit_style); } - if (time_flag) fprintf(fp,"ITEM: TIME\n%.16g\n",compute_time()); + if (time_flag) fmt::print(fp,"ITEM: TIME\n{:.16}\n",compute_time()); - fprintf(fp,"ITEM: TIMESTEP\n"); - fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); - fprintf(fp,"ITEM: NUMBER OF ATOMS\n"); - fprintf(fp,BIGINT_FORMAT "\n",ndump); - fprintf(fp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxxlo,boxxhi,boxxy); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxylo,boxyhi,boxxz); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxzlo,boxzhi,boxyz); - fprintf(fp,"ITEM: ATOMS %s\n",columns); + fmt::print(fp,"ITEM: TIMESTEP\n{}\n" + "ITEM: NUMBER OF ATOMS\n{}\n", + update->ntimestep, ndump); + + fmt::print(fp,"ITEM: BOX BOUNDS xy xz yz {}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n", + boundstr,boxxlo,boxxhi,boxxy,boxylo,boxyhi,boxxz,boxzlo,boxzhi,boxyz); + + fmt::print(fp,"ITEM: ATOMS {}\n",columns); } /* ---------------------------------------------------------------------- */ @@ -1724,7 +1740,7 @@ int DumpCustom::modify_param(int narg, char **arg) int i = utils::inumeric(FLERR,arg[1],false,lmp) - 1; if (i < 0 || i >= nfield) error->all(FLERR,"Illegal dump_modify command"); - if (format_column_user[i]) delete[] format_column_user[i]; + delete[] format_column_user[i]; format_column_user[i] = utils::strdup(arg[2]); } return 3; @@ -2022,7 +2038,7 @@ int DumpCustom::modify_param(int narg, char **arg) std::string threshid = fmt::format("{}{}_DUMP_STORE",id,nthreshlast); thresh_fixID[nthreshlast] = utils::strdup(threshid); threshid += fmt::format(" {} STORE peratom 1 1", group->names[igroup]); - thresh_fix[nthreshlast] = (FixStore *) modify->add_fix(threshid); + thresh_fix[nthreshlast] = dynamic_cast( modify->add_fix(threshid)); thresh_last[nthreshlast] = nthreshlast; thresh_first[nthreshlast] = 1; diff --git a/src/dump_custom.h b/src/dump_custom.h index 5a99cca009..0dcfd82bba 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -60,6 +60,7 @@ class DumpCustom : public Dump { char **vformat; // format string for each vector element // char *columns; // column labels + char *columns_default; // int nchoose; // # of selected atoms int maxlocal; // size of atom selection and variable arrays diff --git a/src/dump_image.cpp b/src/dump_image.cpp index 0179878111..7a7f89801a 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -332,17 +332,17 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : // error checks and setup for lineflag, triflag, bodyflag, fixflag if (lineflag) { - avec_line = (AtomVecLine *) atom->style_match("line"); + avec_line = dynamic_cast( atom->style_match("line")); if (!avec_line) error->all(FLERR,"Dump image line requires atom style line"); } if (triflag) { - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_tri = dynamic_cast( atom->style_match("tri")); if (!avec_tri) error->all(FLERR,"Dump image tri requires atom style tri"); } if (bodyflag) { - avec_body = (AtomVecBody *) atom->style_match("body"); + avec_body = dynamic_cast( atom->style_match("body")); if (!avec_body) error->all(FLERR,"Dump image body yes requires atom style body"); } diff --git a/src/dump_local.cpp b/src/dump_local.cpp index 67586c625a..012e8b95dd 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -242,8 +242,7 @@ int DumpLocal::modify_param(int narg, char **arg) // use of &str[1] removes leading '%' from BIGINT_FORMAT string char *ptr = strchr(format_int_user,'d'); if (ptr == nullptr) - error->all(FLERR, - "Dump_modify int format does not contain d character"); + error->all(FLERR, "Dump_modify int format does not contain d character"); char str[8]; sprintf(str,"%s",BIGINT_FORMAT); *ptr = '\0'; @@ -258,7 +257,7 @@ int DumpLocal::modify_param(int narg, char **arg) int i = utils::inumeric(FLERR,arg[1],false,lmp) - 1; if (i < 0 || i >= nfield) error->all(FLERR,"Illegal dump_modify command"); - if (format_column_user[i]) delete[] format_column_user[i]; + delete[] format_column_user[i]; format_column_user[i] = utils::strdup(arg[2]); } return 3; @@ -273,26 +272,29 @@ void DumpLocal::write_header(bigint ndump) if (me == 0) { if (unit_flag && !unit_count) { ++unit_count; - fprintf(fp,"ITEM: UNITS\n%s\n",update->unit_style); + fmt::print(fp,"ITEM: UNITS\n{}\n",update->unit_style); } - if (time_flag) fprintf(fp,"ITEM: TIME\n%.16g\n",compute_time()); + if (time_flag) fmt::print(fp,"ITEM: TIME\n{:.16}\n",compute_time()); + + fmt::print(fp,"ITEM: TIMESTEP\n{}\n" + "ITEM: NUMBER OF {}\n{}\n", + update->ntimestep, label, ndump); - fprintf(fp,"ITEM: TIMESTEP\n"); - fprintf(fp,BIGINT_FORMAT "\n",update->ntimestep); - fprintf(fp,"ITEM: NUMBER OF %s\n",label); - fprintf(fp,BIGINT_FORMAT "\n",ndump); if (domain->triclinic) { - fprintf(fp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxxlo,boxxhi,boxxy); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxylo,boxyhi,boxxz); - fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxzlo,boxzhi,boxyz); + fmt::print(fp,"ITEM: BOX BOUNDS xy xz yz {}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e} {:>1.16e}\n", + boundstr,boxxlo,boxxhi,boxxy,boxylo,boxyhi,boxxz,boxzlo,boxzhi,boxyz); } else { - fprintf(fp,"ITEM: BOX BOUNDS %s\n",boundstr); - fprintf(fp,"%-1.16e %-1.16e\n",boxxlo,boxxhi); - fprintf(fp,"%-1.16e %-1.16e\n",boxylo,boxyhi); - fprintf(fp,"%-1.16e %-1.16e\n",boxzlo,boxzhi); + fmt::print(fp,"ITEM: BOX BOUNDS {}\n" + "{:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e}\n" + "{:>1.16e} {:>1.16e}\n", + boundstr,boxxlo,boxxhi,boxylo,boxyhi,boxzlo,boxzhi); } - fprintf(fp,"ITEM: %s %s\n",label,columns); + + fmt::print(fp,"ITEM: {} {}\n", label, columns); } } diff --git a/src/dump_xyz.cpp b/src/dump_xyz.cpp index e90243fd1f..12ab962a82 100644 --- a/src/dump_xyz.cpp +++ b/src/dump_xyz.cpp @@ -41,7 +41,7 @@ DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), sort_flag = 1; sortcol = 0; - if (format_default) delete [] format_default; + delete[] format_default; format_default = utils::strdup("%s %g %g %g"); @@ -130,10 +130,10 @@ int DumpXYZ::modify_param(int narg, char **arg) void DumpXYZ::write_header(bigint n) { if (me == 0) { - if (time_flag) { - double tcurrent = update->atime + (update->ntimestep-update->atimestep) + update->dt; - fmt::print(fp,"{}\n Atoms. Timestep: {} Time: {:.6f}\n", n, update->ntimestep, tcurrent); - } else fmt::print(fp,"{}\n Atoms. Timestep: {}\n", n, update->ntimestep); + auto header = fmt::format("{}\n Atoms. Timestep: {}", n, update->ntimestep); + if (time_flag) header += fmt::format(" Time: {:.6f}", compute_time()); + header += "\n"; + fmt::print(fp, header); } } diff --git a/src/finish.cpp b/src/finish.cpp index cc0cad7f92..ea472682a2 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -341,7 +341,7 @@ void Finish::end(int flag) } #ifdef LMP_OPENMP - FixOMP *fixomp = (FixOMP *) modify->get_fix_by_id("package_omp"); + FixOMP *fixomp = dynamic_cast( modify->get_fix_by_id("package_omp")); // print thread breakdown only with full timer detail diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index 766dc9cd74..2632ccf597 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -247,8 +247,8 @@ void FixAdapt::post_constructor() if (diamflag && atom->radius_flag) { id_fix_diam = utils::strdup(id + std::string("_FIX_STORE_DIAM")); - fix_diam = (FixStore *) modify->add_fix(fmt::format("{} {} STORE peratom 1 1", - id_fix_diam,group->names[igroup])); + fix_diam = dynamic_cast( modify->add_fix(fmt::format("{} {} STORE peratom 1 1", + id_fix_diam,group->names[igroup]))); if (fix_diam->restart_reset) fix_diam->restart_reset = 0; else { double *vec = fix_diam->vstore; @@ -265,8 +265,8 @@ void FixAdapt::post_constructor() if (chgflag && atom->q_flag) { id_fix_chg = utils::strdup(id + std::string("_FIX_STORE_CHG")); - fix_chg = (FixStore *) modify->add_fix(fmt::format("{} {} STORE peratom 1 1", - id_fix_chg,group->names[igroup])); + fix_chg = dynamic_cast( modify->add_fix(fmt::format("{} {} STORE peratom 1 1", + id_fix_chg,group->names[igroup]))); if (fix_chg->restart_reset) fix_chg->restart_reset = 0; else { double *vec = fix_chg->vstore; @@ -348,7 +348,7 @@ void FixAdapt::init() // if pair hybrid, test that ilo,ihi,jlo,jhi are valid for sub-style if (utils::strmatch(force->pair_style,"^hybrid")) { - PairHybrid *pair = (PairHybrid *) force->pair; + auto pair = dynamic_cast( force->pair); for (i = ad->ilo; i <= ad->ihi; i++) for (j = MAX(ad->jlo,i); j <= ad->jhi; j++) if (!pair->check_ijtype(i,j,pstyle)) @@ -431,16 +431,16 @@ void FixAdapt::init() if (id_fix_diam) { int ifix = modify->find_fix(id_fix_diam); if (ifix < 0) error->all(FLERR,"Could not find fix adapt storage fix ID"); - fix_diam = (FixStore *) modify->fix[ifix]; + fix_diam = dynamic_cast( modify->fix[ifix]); } if (id_fix_chg) { int ifix = modify->find_fix(id_fix_chg); if (ifix < 0) error->all(FLERR,"Could not find fix adapt storage fix ID"); - fix_chg = (FixStore *) modify->fix[ifix]; + fix_chg = dynamic_cast( modify->fix[ifix]); } if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -700,7 +700,7 @@ void FixAdapt::write_restart(FILE *fp) void FixAdapt::restart(char *buf) { - double *dbuf = (double *) buf; + auto dbuf = (double *) buf; previous_diam_scale = dbuf[0]; previous_chg_scale = dbuf[1]; diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 1aff86fb58..0487854ade 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -195,7 +195,7 @@ void FixAddForce::init() error->all(FLERR,"Must use variable energy with fix addforce"); if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -207,9 +207,9 @@ void FixAddForce::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index b6cb17b8c9..46c0abfc8f 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -309,7 +309,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : int icompute = modify->find_compute(idchunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for fix ave/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Fix ave/chunk does not use chunk/atom compute"); @@ -432,7 +432,7 @@ FixAveChunk::~FixAveChunk() if (nrepeat > 1 || ave == RUNNING || ave == WINDOW) { int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (ave == RUNNING || ave == WINDOW) cchunk->unlock(this); cchunk->lockcount--; } @@ -478,7 +478,7 @@ void FixAveChunk::init() int icompute = modify->find_compute(idchunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for fix ave/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (biasflag) { int i = modify->find_compute(id_bias); @@ -941,7 +941,7 @@ void FixAveChunk::end_of_step() if (overwrite) platform::fseek(fp,filepos); double count = 0.0; for (m = 0; m < nchunk; m++) count += count_total[m]; - fprintf(fp,BIGINT_FORMAT " %d %g\n",ntimestep,nchunk,count); + fmt::print(fp,"{} {} {}\n",ntimestep,nchunk,count); int compress = cchunk->compress; int *chunkID = cchunk->chunkID; diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index 486b991b77..17182c8667 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -487,7 +487,7 @@ void FixAveCorrelate::end_of_step() if (fp && me == 0) { clearerr(fp); if (overwrite) platform::fseek(fp,filepos); - fprintf(fp,BIGINT_FORMAT " %d\n",ntimestep,nrepeat); + fmt::print(fp,"{} {}\n",ntimestep,nrepeat); for (i = 0; i < nrepeat; i++) { fprintf(fp,"%d %d %d",i+1,i*nevery,count[i]); if (count[i]) diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index 5a7c6d4ccb..c2acd652ad 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -815,7 +815,7 @@ void FixAveHisto::end_of_step() if (fp && me == 0) { clearerr(fp); if (overwrite) platform::fseek(fp,filepos); - fprintf(fp,BIGINT_FORMAT " %d %g %g %g %g\n",ntimestep,nbins, + fmt::print(fp,"{} {} {} {} {} {}\n",ntimestep,nbins, stats_total[0],stats_total[1],stats_total[2],stats_total[3]); if (stats_total[0] != 0.0) for (i = 0; i < nbins; i++) diff --git a/src/fix_ave_histo_weight.cpp b/src/fix_ave_histo_weight.cpp index 16a64e093e..f90551b52f 100644 --- a/src/fix_ave_histo_weight.cpp +++ b/src/fix_ave_histo_weight.cpp @@ -468,7 +468,7 @@ void FixAveHistoWeight::end_of_step() if (fp && me == 0) { clearerr(fp); if (overwrite) platform::fseek(fp,filepos); - fprintf(fp,BIGINT_FORMAT " %d %g %g %g %g\n",ntimestep,nbins, + fmt::print(fp,"{} {} {} {} {} {}\n",ntimestep,nbins, stats_total[0],stats_total[1],stats_total[2],stats_total[3]); if (stats_total[0] != 0.0) for (i = 0; i < nbins; i++) diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index 98b066ef0b..ee08c859f4 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -669,11 +669,10 @@ void FixAveTime::invoke_scalar(bigint ntimestep) if (fp && me == 0) { clearerr(fp); if (overwrite) platform::fseek(fp,filepos); - fprintf(fp,BIGINT_FORMAT,ntimestep); + fmt::print(fp,"{}",ntimestep); for (i = 0; i < nvalues; i++) fprintf(fp,format,vector_total[i]/norm); fprintf(fp,"\n"); - if (ferror(fp)) - error->one(FLERR,"Error writing out time averaged data"); + if (ferror(fp)) error->one(FLERR,"Error writing out time averaged data"); fflush(fp); @@ -881,7 +880,7 @@ void FixAveTime::invoke_vector(bigint ntimestep) if (fp && me == 0) { if (overwrite) platform::fseek(fp,filepos); - fprintf(fp,BIGINT_FORMAT " %d\n",ntimestep,nrows); + fmt::print(fp,"{} {}\n",ntimestep,nrows); for (i = 0; i < nrows; i++) { fprintf(fp,"%d",i+1); for (j = 0; j < nvalues; j++) fprintf(fp,format,array_total[i][j]/norm); diff --git a/src/fix_aveforce.cpp b/src/fix_aveforce.cpp index cd8009c81b..2d172adb9b 100644 --- a/src/fix_aveforce.cpp +++ b/src/fix_aveforce.cpp @@ -157,7 +157,7 @@ void FixAveForce::init() else varflag = CONSTANT; if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; if (respa_level >= 0) ilevel_respa = MIN(respa_level,nlevels_respa-1); else ilevel_respa = nlevels_respa-1; } @@ -171,9 +171,9 @@ void FixAveForce::setup(int vflag) post_force(vflag); else for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - ((Respa *) update->integrate)->copy_flevel_f(ilevel); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); } } diff --git a/src/fix_bond_history.cpp b/src/fix_bond_history.cpp new file mode 100644 index 0000000000..67489e6402 --- /dev/null +++ b/src/fix_bond_history.cpp @@ -0,0 +1,365 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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 "fix_bond_history.h" + +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "group.h" +#include "memory.h" +#include "modify.h" +#include "neighbor.h" + +#include +#include + +using namespace LAMMPS_NS; +using namespace FixConst; + +#define LB_FACTOR 1.5 +#define DELTA 8192 + +/* ---------------------------------------------------------------------- */ + +FixBondHistory::FixBondHistory(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg), bondstore(nullptr), id_fix(nullptr), id_array(nullptr) + +{ + if (narg != 5) error->all(FLERR, "Illegal fix bond/history command"); + update_flag = utils::inumeric(FLERR, arg[3], false, lmp); + ndata = utils::inumeric(FLERR, arg[4], false, lmp); + nbond = atom->bond_per_atom; + + if (nbond == 0) error->all(FLERR, "Cannot store bond variables without any bonds"); + + stored_flag = false; + restart_global = 1; + create_attribute = 1; + + // Flag whether bond arrays are updated such that data may need to be + // copied to atom arrays before exchanging atoms + // Prevents sequential calls to pre_exchange() without post_neighbor() + updated_bond_flag = 0; + + maxbond = 0; + allocate(); +} + +/* ---------------------------------------------------------------------- */ + +FixBondHistory::~FixBondHistory() +{ + if (id_fix && modify->nfix) modify->delete_fix(id_fix); + delete[] id_fix; + delete[] id_array; + + memory->destroy(bondstore); +} + +/* ---------------------------------------------------------------------- */ + +int FixBondHistory::setmask() +{ + int mask = 0; + mask |= PRE_EXCHANGE; + mask |= POST_NEIGHBOR; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixBondHistory::post_constructor() +{ + // Store saved bond quantities for each atom using fix property atom + + id_fix = utils::strdup(id + std::string("_FIX_PROP_ATOM")); + id_array = utils::strdup(std::string("d2_") + id); + modify->add_fix(fmt::format("{} {} property/atom {} {}", id_fix, group->names[igroup], id_array, + nbond * ndata)); + int tmp1, tmp2; + index = atom->find_custom(&id_array[3], tmp1, tmp2); +} + +/* ---------------------------------------------------------------------- */ + +void FixBondHistory::update_atom_value(int i, int m, int idata, double value) +{ + if (idata >= ndata || m > nbond) error->all(FLERR, "Index exceeded in fix bond history"); + atom->darray[index][i][m * ndata + idata] = value; +} + +/* ---------------------------------------------------------------------- */ + +double FixBondHistory::get_atom_value(int i, int m, int idata) +{ + if (idata >= ndata || m > nbond) error->all(FLERR, "Index exceeded in fix bond history"); + return atom->darray[index][i][m * ndata + idata]; +} + +/* ---------------------------------------------------------------------- */ + +void FixBondHistory::setup_pre_exchange() +{ + pre_exchange(); +} + +/* ---------------------------------------------------------------------- + If stored values are updated, need to copy to atom arrays before exchanging + If bondstore array has been allocated, call before nlist rebuild + Also call prior to irregular communication in other fixes (e.g. deform) +------------------------------------------------------------------------- */ + +void FixBondHistory::pre_exchange() +{ + if (!update_flag) return; + if (!stored_flag) return; + if (!updated_bond_flag) return; + + int i1, i2, n, m, idata; + int **bondlist = neighbor->bondlist; + int nbondlist = neighbor->nbondlist; + double **stored = atom->darray[index]; + + int nlocal = atom->nlocal; + tagint **bond_atom = atom->bond_atom; + int *num_bond = atom->num_bond; + tagint *tag = atom->tag; + + for (n = 0; n < nbondlist; n++) { + i1 = bondlist[n][0]; + i2 = bondlist[n][1]; + + // skip bond if already broken + if (bondlist[n][2] <= 0) { continue; } + + if (i1 < nlocal) { + for (m = 0; m < num_bond[i1]; m++) { + if (bond_atom[i1][m] == tag[i2]) { + for (idata = 0; idata < ndata; idata++) { + stored[i1][m * ndata + idata] = bondstore[n][idata]; + } + } + } + } + + if (i2 < nlocal) { + for (m = 0; m < num_bond[i2]; m++) { + if (bond_atom[i2][m] == tag[i1]) { + for (idata = 0; idata < ndata; idata++) { + stored[i2][m * ndata + idata] = bondstore[n][idata]; + } + } + } + } + } + + updated_bond_flag = 0; +} + +/* ---------------------------------------------------------------------- */ + +void FixBondHistory::allocate() +{ + //Ideally would just ask ntopo for maxbond, but protected + if (comm->nprocs == 1) + maxbond = atom->nbonds; + else + maxbond = static_cast(LB_FACTOR * atom->nbonds / comm->nprocs); + memory->create(bondstore, maxbond, ndata, "fix_bond_store:bondstore"); +} + +/* ---------------------------------------------------------------------- */ + +void FixBondHistory::setup_post_neighbor() +{ + //Grow array if number of bonds has increased + while (neighbor->nbondlist >= maxbond) { + maxbond += DELTA; + memory->grow(bondstore, maxbond, ndata, "fix_bond_store:bondstore"); + } + + pre_exchange(); + post_neighbor(); +} + +/* ---------------------------------------------------------------------- + called after neighbor list is build + build array of stored bond quantities from fix property atom +------------------------------------------------------------------------- */ + +void FixBondHistory::post_neighbor() +{ + //Grow array if number of bonds has increased + while (neighbor->nbondlist >= maxbond) { + maxbond += DELTA; + memory->grow(bondstore, maxbond, ndata, "fix_bond_store:bondstore"); + } + + int i1, i2, n, m, idata; + int **bondlist = neighbor->bondlist; + int nbondlist = neighbor->nbondlist; + double **stored = atom->darray[index]; + + int nlocal = atom->nlocal; + tagint **bond_atom = atom->bond_atom; + int *num_bond = atom->num_bond; + tagint *tag = atom->tag; + + for (n = 0; n < nbondlist; n++) { + i1 = bondlist[n][0]; + i2 = bondlist[n][1]; + + // skip bond if already broken + if (bondlist[n][2] <= 0) { continue; } + + if (i1 < nlocal) { + for (m = 0; m < num_bond[i1]; m++) { + if (bond_atom[i1][m] == tag[i2]) { + for (idata = 0; idata < ndata; idata++) { + bondstore[n][idata] = stored[i1][m * ndata + idata]; + } + } + } + } + + if (i2 < nlocal) { + for (m = 0; m < num_bond[i2]; m++) { + if (bond_atom[i2][m] == tag[i1]) { + for (idata = 0; idata < ndata; idata++) { + bondstore[n][idata] = stored[i2][m * ndata + idata]; + } + } + } + } + } + + updated_bond_flag = 1; +} + +/* ---------------------------------------------------------------------- */ + +double FixBondHistory::memory_usage() +{ + return maxbond * ndata * sizeof(double); +} + +/* ---------------------------------------------------------------------- */ + +void FixBondHistory::write_restart(FILE *fp) +{ + int n = 0; + double list[1]; + list[n++] = stored_flag; + + if (comm->me == 0) { + int size = n * sizeof(double); + fwrite(&size, sizeof(int), 1, fp); + fwrite(list, sizeof(double), n, fp); + } +} + +/* ---------------------------------------------------------------------- */ + +void FixBondHistory::restart(char *buf) +{ + int n = 0; + double *list = (double *) buf; + stored_flag = static_cast(list[n++]); +} + +/* ---------------------------------------------------------------------- + initialize bond values to zero, called when atom is created +------------------------------------------------------------------------- */ + +void FixBondHistory::set_arrays(int i) +{ + double **stored = atom->darray[index]; + for (int m = 0; m < nbond; m++) + for (int idata = 0; idata < ndata; idata++) stored[i][m * ndata + idata] = 0.0; +} + +/* ---------------------------------------------------------------------- + Delete bond by zeroing data +------------------------------------------------------------------------- */ + +void FixBondHistory::delete_history(int i, int m) +{ + double **stored = atom->darray[index]; + for (int idata = 0; idata < ndata; idata++) stored[i][m * ndata + idata] = 0.0; +} + +/* ---------------------------------------------------------------------- + Shift bond data to a new location +------------------------------------------------------------------------- */ + +void FixBondHistory::shift_history(int i, int m, int k) +{ + if (m == k) return; + + double **stored = atom->darray[index]; + for (int idata = 0; idata < ndata; idata++) + stored[i][m * ndata + idata] = stored[i][k * ndata + idata]; +} + +/* ---------------------------------------------------------------------- + Temporarily caches history for a deleted bond which + could be recreated before the cache is emptied + NOTE: the cache methods still need to be tested, need an example first +------------------------------------------------------------------------- */ + +void FixBondHistory::cache_history(int i, int m) +{ + // Order tags to create a unique key pair + tagint max_tag = MAX(atom->tag[i], atom->bond_atom[i][m]); + tagint min_tag = MIN(atom->tag[i], atom->bond_atom[i][m]); + auto key = std::make_pair(min_tag, max_tag); + + // Copy data to vector + double **stored = atom->darray[index]; + std::vector data; + for (int idata = 0; idata < ndata; idata++) data.push_back(stored[i][m * ndata + idata]); + + // Add data to cache + cached_histories.insert(std::make_pair(key, data)); +} + +/* ---------------------------------------------------------------------- + Checks to see if a newly created bond has cached history +------------------------------------------------------------------------- */ + +void FixBondHistory::check_cache(int i, int m) +{ + // Order tags to create a unique key pair + tagint max_tag = MAX(atom->tag[i], atom->bond_atom[i][m]); + tagint min_tag = MIN(atom->tag[i], atom->bond_atom[i][m]); + auto key = std::make_pair(min_tag, max_tag); + + // Check if it exists, if so, copy data + double **stored = atom->darray[index]; + std::vector data; + auto pos = cached_histories.find(key); + if (pos != cached_histories.end()) { + data = pos->second; + for (int idata = 0; idata < ndata; idata++) stored[i][m * ndata + idata] = data[idata]; + } +} + +/* ---------------------------------------------------------------------- + Delete saved memory +------------------------------------------------------------------------- */ + +void FixBondHistory::clear_cache() +{ + cached_histories.clear(); +} diff --git a/src/fix_bond_history.h b/src/fix_bond_history.h new file mode 100644 index 0000000000..511bc57bd2 --- /dev/null +++ b/src/fix_bond_history.h @@ -0,0 +1,94 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS +// clang-format off +FixStyle(BOND_HISTORY,FixBondHistory); +// clang-format on +#else + +#ifndef LMP_FIX_BOND_HISTORY_H +#define LMP_FIX_BOND_HISTORY_H + +#include "fix.h" + +#include +#include +#include + +namespace LAMMPS_NS { + +class FixBondHistory : public Fix { + public: + FixBondHistory(class LAMMPS *, int, char **); + ~FixBondHistory() override; + int setmask() override; + void post_constructor() override; + void setup_post_neighbor() override; + void setup_pre_exchange() override; + void post_neighbor() override; + void pre_exchange() override; + double memory_usage() override; + void write_restart(FILE *fp) override; + void restart(char *buf) override; + void set_arrays(int); + + void update_atom_value(int, int, int, double); + double get_atom_value(int, int, int); + + // methods to reorder/delete elements of atom->bond_atom + void delete_history(int, int); + void shift_history(int, int, int); + void cache_history(int, int); + void check_cache(int, int); + void clear_cache(); + + // if data is temporarily stored while the bond_atom array + // is being reordered, use map of vectors with pairs for keys + // to enable quick look up + std::map, std::vector> cached_histories; + + double **bondstore; + int stored_flag; + + protected: + void allocate(); + + int update_flag; //Flag whether history values can evolve + int updated_bond_flag; + int nbond, maxbond, ndata; + int index; + char *id_fix; + char *id_array; +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +UNDOCUMENTED + +E: Index exceeded in fix bond history + +Bond requested non-existant data + +E: Cannot store bond variables without any bonds + +Atoms must have a nonzero number of bonds to store data + +*/ diff --git a/src/fix_deposit.cpp b/src/fix_deposit.cpp index 034cecd55a..fd6eb3e36a 100644 --- a/src/fix_deposit.cpp +++ b/src/fix_deposit.cpp @@ -844,7 +844,7 @@ void FixDeposit::write_restart(FILE *fp) void FixDeposit::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; seed = static_cast(list[n++]); ninserted = static_cast(list[n++]); diff --git a/src/fix_deprecated.cpp b/src/fix_deprecated.cpp index e33198091b..017ae9ff1b 100644 --- a/src/fix_deprecated.cpp +++ b/src/fix_deprecated.cpp @@ -46,10 +46,12 @@ FixDeprecated::FixDeprecated(LAMMPS *lmp, int narg, char **arg) : } else if (my_style == "lb/pc") { utils::logmesg(lmp,"\nFix style 'lb/pc' has been removed from the LATBOLTZ" " package; 'fix nve' can be used in its place.\n\n"); - } - else if (my_style == "lb/rigid/pc/sphere") { + } else if (my_style == "lb/rigid/pc/sphere") { utils::logmesg(lmp,"\nFix style 'lb/rigid/pc/sphere' has been removed from" " the LATBOLTZ package; 'fix rigid' can be used in its place.\n\n"); + } else if (my_style == "client/md") { + if (lmp->comm->me == 0) + utils::logmesg(lmp, "\nThe MESSAGE package has been replaced by the MDI package.\n\n"); } error->all(FLERR,"This fix style is no longer available"); } diff --git a/src/fix_deprecated.h b/src/fix_deprecated.h index 84da35a749..db7f47abcc 100644 --- a/src/fix_deprecated.h +++ b/src/fix_deprecated.h @@ -19,6 +19,7 @@ FixStyle(ave/spatial,FixDeprecated); FixStyle(ave/spatial/sphere,FixDeprecated); FixStyle(lb/pc,FixDeprecated); FixStyle(lb/rigid/pc/sphere,FixDeprecated); +FixStyle(client/md,FixDeprecated); // clang-format on #else diff --git a/src/fix_efield.cpp b/src/fix_efield.cpp index 6fa3fc5297..a17a122e9d 100644 --- a/src/fix_efield.cpp +++ b/src/fix_efield.cpp @@ -210,7 +210,7 @@ void FixEfield::init() error->all(FLERR,"Must use variable energy with fix efield"); if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -222,9 +222,9 @@ void FixEfield::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_enforce2d.cpp b/src/fix_enforce2d.cpp index abff16d21e..cc3b79c45d 100644 --- a/src/fix_enforce2d.cpp +++ b/src/fix_enforce2d.cpp @@ -93,11 +93,11 @@ void FixEnforce2D::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - int nlevels_respa = ((Respa *) update->integrate)->nlevels; + int nlevels_respa = (dynamic_cast( update->integrate))->nlevels; for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - ((Respa *) update->integrate)->copy_flevel_f(ilevel); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); } } } diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index b206bae5b8..cf559043cf 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -181,7 +181,7 @@ int FixGravity::setmask() void FixGravity::init() { if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } @@ -245,9 +245,9 @@ void FixGravity::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_group.cpp b/src/fix_group.cpp index 672a69cbc3..1291721f0a 100644 --- a/src/fix_group.cpp +++ b/src/fix_group.cpp @@ -122,7 +122,7 @@ void FixGroup::init() error->all(FLERR,"Group dynamic parent group cannot be dynamic"); if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; // set current indices for region and variable and custom property diff --git a/src/fix_halt.cpp b/src/fix_halt.cpp index 263386e2b0..08713cf6ad 100644 --- a/src/fix_halt.cpp +++ b/src/fix_halt.cpp @@ -107,15 +107,14 @@ FixHalt::FixHalt(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"path") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix halt command"); ++iarg; - int len = strlen(arg[iarg])+1; delete[] dlimit_path; - dlimit_path = new char[len]; - // strip off quotes, if present + // strip off outer quotes, if present + int len = strlen(arg[iarg])+1; if ( ((arg[iarg][0] == '"') || (arg[iarg][0] == '\'')) && (arg[iarg][0] == arg[iarg][len-2])) { - strcpy(dlimit_path,&arg[iarg][1]); - dlimit_path[len-3] = '\0'; - } else strcpy(dlimit_path,arg[iarg]); + arg[iarg][len-2] = '\0'; + dlimit_path = utils::strdup(arg[iarg]+1); + } else dlimit_path = utils::strdup(arg[iarg]); ++iarg; } else error->all(FLERR,"Illegal fix halt command"); } diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp index 838d9bdaab..3f99d14a8c 100644 --- a/src/fix_indent.cpp +++ b/src/fix_indent.cpp @@ -155,7 +155,7 @@ void FixIndent::init() } if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -167,9 +167,9 @@ void FixIndent::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 6e770689dc..98b8f5274a 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -270,7 +270,7 @@ void FixLangevin::init() } if (ascale) { - avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec = dynamic_cast( atom->style_match("ellipsoid")); if (!avec) error->all(FLERR,"Fix langevin angmom requires atom style ellipsoid"); @@ -306,7 +306,7 @@ void FixLangevin::init() else tbiasflag = NOBIAS; if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; if (utils::strmatch(update->integrate_style,"^respa") && gjfflag) error->all(FLERR,"Fix langevin gjf and respa are not compatible"); @@ -365,9 +365,9 @@ void FixLangevin::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); } if (gjfflag) { double dtfm; diff --git a/src/fix_lineforce.cpp b/src/fix_lineforce.cpp index 90901534ad..d9408efb48 100644 --- a/src/fix_lineforce.cpp +++ b/src/fix_lineforce.cpp @@ -62,11 +62,11 @@ void FixLineForce::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - int nlevels_respa = ((Respa *) update->integrate)->nlevels; + int nlevels_respa = (dynamic_cast( update->integrate))->nlevels; for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - ((Respa *) update->integrate)->copy_flevel_f(ilevel); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); } } } diff --git a/src/fix_move.cpp b/src/fix_move.cpp index f7bc4d3640..75f2eb1796 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -40,21 +39,19 @@ using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; -enum{LINEAR,WIGGLE,ROTATE,VARIABLE}; -enum{EQUAL,ATOM}; +enum { LINEAR, WIGGLE, ROTATE, VARIABLE, TRANSROT }; +enum { EQUAL, ATOM }; -#define INERTIA 0.2 // moment of inertia prefactor for ellipsoid +#define INERTIA 0.2 // moment of inertia prefactor for ellipsoid /* ---------------------------------------------------------------------- */ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), - xvarstr(nullptr), yvarstr(nullptr), zvarstr(nullptr), vxvarstr(nullptr), - vyvarstr(nullptr), vzvarstr(nullptr), - xoriginal(nullptr), toriginal(nullptr), qoriginal(nullptr), - displace(nullptr), velocity(nullptr) + Fix(lmp, narg, arg), xvarstr(nullptr), yvarstr(nullptr), zvarstr(nullptr), vxvarstr(nullptr), + vyvarstr(nullptr), vzvarstr(nullptr), xoriginal(nullptr), toriginal(nullptr), + qoriginal(nullptr), displace(nullptr), velocity(nullptr) { - if (narg < 4) error->all(FLERR,"Illegal fix move command"); + if (narg < 4) error->all(FLERR, "Illegal fix move command"); restart_global = 1; restart_peratom = 1; @@ -71,125 +68,162 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : int iarg = 0; - if (strcmp(arg[3],"linear") == 0) { - if (narg < 7) error->all(FLERR,"Illegal fix move command"); + if (strcmp(arg[3], "linear") == 0) { + if (narg < 7) error->all(FLERR, "Illegal fix move command"); iarg = 7; mstyle = LINEAR; - if (strcmp(arg[4],"NULL") == 0) vxflag = 0; + if (strcmp(arg[4], "NULL") == 0) + vxflag = 0; else { vxflag = 1; - vx = utils::numeric(FLERR,arg[4],false,lmp); + vx = utils::numeric(FLERR, arg[4], false, lmp); } - if (strcmp(arg[5],"NULL") == 0) vyflag = 0; + if (strcmp(arg[5], "NULL") == 0) + vyflag = 0; else { vyflag = 1; - vy = utils::numeric(FLERR,arg[5],false,lmp); + vy = utils::numeric(FLERR, arg[5], false, lmp); } - if (strcmp(arg[6],"NULL") == 0) vzflag = 0; + if (strcmp(arg[6], "NULL") == 0) + vzflag = 0; else { vzflag = 1; - vz = utils::numeric(FLERR,arg[6],false,lmp); + vz = utils::numeric(FLERR, arg[6], false, lmp); } - } else if (strcmp(arg[3],"wiggle") == 0) { - if (narg < 8) error->all(FLERR,"Illegal fix move command"); + } else if (strcmp(arg[3], "wiggle") == 0) { + if (narg < 8) error->all(FLERR, "Illegal fix move command"); iarg = 8; mstyle = WIGGLE; - if (strcmp(arg[4],"NULL") == 0) axflag = 0; + if (strcmp(arg[4], "NULL") == 0) + axflag = 0; else { axflag = 1; - ax = utils::numeric(FLERR,arg[4],false,lmp); + ax = utils::numeric(FLERR, arg[4], false, lmp); } - if (strcmp(arg[5],"NULL") == 0) ayflag = 0; + if (strcmp(arg[5], "NULL") == 0) + ayflag = 0; else { ayflag = 1; - ay = utils::numeric(FLERR,arg[5],false,lmp); + ay = utils::numeric(FLERR, arg[5], false, lmp); } - if (strcmp(arg[6],"NULL") == 0) azflag = 0; + if (strcmp(arg[6], "NULL") == 0) + azflag = 0; else { azflag = 1; - az = utils::numeric(FLERR,arg[6],false,lmp); + az = utils::numeric(FLERR, arg[6], false, lmp); } - period = utils::numeric(FLERR,arg[7],false,lmp); - if (period <= 0.0) error->all(FLERR,"Illegal fix move command"); + period = utils::numeric(FLERR, arg[7], false, lmp); + if (period <= 0.0) error->all(FLERR, "Illegal fix move command"); - } else if (strcmp(arg[3],"rotate") == 0) { - if (narg < 11) error->all(FLERR,"Illegal fix move command"); + } else if (strcmp(arg[3], "rotate") == 0) { + if (narg < 11) error->all(FLERR, "Illegal fix move command"); iarg = 11; mstyle = ROTATE; - point[0] = utils::numeric(FLERR,arg[4],false,lmp); - point[1] = utils::numeric(FLERR,arg[5],false,lmp); - point[2] = utils::numeric(FLERR,arg[6],false,lmp); - axis[0] = utils::numeric(FLERR,arg[7],false,lmp); - axis[1] = utils::numeric(FLERR,arg[8],false,lmp); - axis[2] = utils::numeric(FLERR,arg[9],false,lmp); - period = utils::numeric(FLERR,arg[10],false,lmp); - if (period <= 0.0) error->all(FLERR,"Illegal fix move command"); + point[0] = utils::numeric(FLERR, arg[4], false, lmp); + point[1] = utils::numeric(FLERR, arg[5], false, lmp); + point[2] = utils::numeric(FLERR, arg[6], false, lmp); + axis[0] = utils::numeric(FLERR, arg[7], false, lmp); + axis[1] = utils::numeric(FLERR, arg[8], false, lmp); + axis[2] = utils::numeric(FLERR, arg[9], false, lmp); + period = utils::numeric(FLERR, arg[10], false, lmp); + if (period <= 0.0) error->all(FLERR, "Illegal fix move command"); - } else if (strcmp(arg[3],"variable") == 0) { - if (narg < 10) error->all(FLERR,"Illegal fix move command"); + } else if (strcmp(arg[3], "transrot") == 0) { + if (narg < 11) error->all(FLERR, "Illegal fix move command"); + iarg = 14; + mstyle = TRANSROT; + vxflag = vyflag = vzflag = 1; + vx = utils::numeric(FLERR, arg[4], false, lmp); + vy = utils::numeric(FLERR, arg[5], false, lmp); + vz = utils::numeric(FLERR, arg[6], false, lmp); + point[0] = utils::numeric(FLERR, arg[7], false, lmp); + point[1] = utils::numeric(FLERR, arg[8], false, lmp); + point[2] = utils::numeric(FLERR, arg[9], false, lmp); + axis[0] = utils::numeric(FLERR, arg[10], false, lmp); + axis[1] = utils::numeric(FLERR, arg[11], false, lmp); + axis[2] = utils::numeric(FLERR, arg[12], false, lmp); + period = utils::numeric(FLERR, arg[13], false, lmp); + if (period <= 0.0) error->all(FLERR, "Illegal fix move command"); + + } else if (strcmp(arg[3], "variable") == 0) { + if (narg < 10) error->all(FLERR, "Illegal fix move command"); iarg = 10; mstyle = VARIABLE; - if (strcmp(arg[4],"NULL") == 0) xvarstr = nullptr; - else if (utils::strmatch(arg[4],"^v_")) { - xvarstr = utils::strdup(arg[4]+2); - } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[5],"NULL") == 0) yvarstr = nullptr; - else if (utils::strmatch(arg[5],"^v_")) { - yvarstr = utils::strdup(arg[5]+2); - } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[6],"NULL") == 0) zvarstr = nullptr; - else if (utils::strmatch(arg[6],"^v_")) { - zvarstr = utils::strdup(arg[6]+2); - } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[7],"NULL") == 0) vxvarstr = nullptr; - else if (utils::strmatch(arg[7],"^v_")) { - vxvarstr = utils::strdup(arg[7]+2); - } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[8],"NULL") == 0) vyvarstr = nullptr; - else if (utils::strmatch(arg[8],"^v_")) { - vyvarstr = utils::strdup(arg[8]+2); - } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[9],"NULL") == 0) vzvarstr = nullptr; - else if (utils::strmatch(arg[9],"^v_")) { - vzvarstr = utils::strdup(arg[9]+2); - } else error->all(FLERR,"Illegal fix move command"); + if (strcmp(arg[4], "NULL") == 0) + xvarstr = nullptr; + else if (utils::strmatch(arg[4], "^v_")) { + xvarstr = utils::strdup(arg[4] + 2); + } else + error->all(FLERR, "Illegal fix move command"); + if (strcmp(arg[5], "NULL") == 0) + yvarstr = nullptr; + else if (utils::strmatch(arg[5], "^v_")) { + yvarstr = utils::strdup(arg[5] + 2); + } else + error->all(FLERR, "Illegal fix move command"); + if (strcmp(arg[6], "NULL") == 0) + zvarstr = nullptr; + else if (utils::strmatch(arg[6], "^v_")) { + zvarstr = utils::strdup(arg[6] + 2); + } else + error->all(FLERR, "Illegal fix move command"); + if (strcmp(arg[7], "NULL") == 0) + vxvarstr = nullptr; + else if (utils::strmatch(arg[7], "^v_")) { + vxvarstr = utils::strdup(arg[7] + 2); + } else + error->all(FLERR, "Illegal fix move command"); + if (strcmp(arg[8], "NULL") == 0) + vyvarstr = nullptr; + else if (utils::strmatch(arg[8], "^v_")) { + vyvarstr = utils::strdup(arg[8] + 2); + } else + error->all(FLERR, "Illegal fix move command"); + if (strcmp(arg[9], "NULL") == 0) + vzvarstr = nullptr; + else if (utils::strmatch(arg[9], "^v_")) { + vzvarstr = utils::strdup(arg[9] + 2); + } else + error->all(FLERR, "Illegal fix move command"); - } else error->all(FLERR,"Illegal fix move command"); + } else + error->all(FLERR, "Illegal fix move command"); // optional args int scaleflag = 1; while (iarg < narg) { - if (strcmp(arg[iarg],"units") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0; - else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1; - else error->all(FLERR,"Illegal fix move command"); + if (strcmp(arg[iarg], "units") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal fix move command"); + if (strcmp(arg[iarg + 1], "box") == 0) + scaleflag = 0; + else if (strcmp(arg[iarg + 1], "lattice") == 0) + scaleflag = 1; + else + error->all(FLERR, "Illegal fix move command"); iarg += 2; - } else error->all(FLERR,"Illegal fix move command"); + } else + error->all(FLERR, "Illegal fix move command"); } // error checks and warnings if (domain->dimension == 2) { - if (mstyle == LINEAR && vzflag && vz != 0.0) - error->all(FLERR,"Fix move cannot set linear z motion for 2d problem"); + if (((mstyle == LINEAR) || (mstyle == TRANSROT)) && vzflag && (vz != 0.0)) + error->all(FLERR, "Fix move cannot set linear z motion for 2d problem"); if (mstyle == WIGGLE && azflag && az != 0.0) - error->all(FLERR,"Fix move cannot set wiggle z motion for 2d problem"); - if (mstyle == ROTATE && (axis[0] != 0.0 || axis[1] != 0.0)) - error->all(FLERR, - "Fix move cannot rotate around non z-axis for 2d problem"); + error->all(FLERR, "Fix move cannot set wiggle z motion for 2d problem"); + if (((mstyle == ROTATE) || (mstyle == TRANSROT)) && (axis[0] != 0.0 || axis[1] != 0.0)) + error->all(FLERR, "Fix move cannot rotate around non z-axis for 2d problem"); if (mstyle == VARIABLE && (zvarstr || vzvarstr)) - error->all(FLERR, - "Fix move cannot define z or vz variable for 2d problem"); + error->all(FLERR, "Fix move cannot define z or vz variable for 2d problem"); } // setup scaling and apply scaling factors to velocity & amplitude - if ((mstyle == LINEAR || mstyle == WIGGLE || mstyle == ROTATE) && - scaleflag) { + if ((mstyle != VARIABLE) && scaleflag) { double xscale = domain->lattice->xlattice; double yscale = domain->lattice->ylattice; double zscale = domain->lattice->zlattice; @@ -206,22 +240,29 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : point[0] *= xscale; point[1] *= yscale; point[2] *= zscale; + } else if (mstyle == TRANSROT) { + vx *= xscale; + vy *= yscale; + vz *= zscale; + point[0] *= xscale; + point[1] *= yscale; + point[2] *= zscale; } } // set omega_rotate from period - if (mstyle == WIGGLE || mstyle == ROTATE) omega_rotate = MY_2PI / period; + if ((mstyle == WIGGLE) || (mstyle == ROTATE) || (mstyle == TRANSROT)) + omega_rotate = MY_2PI / period; // runit = unit vector along rotation axis - if (mstyle == ROTATE) { - double len = sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]); - if (len == 0.0) - error->all(FLERR,"Zero length rotation vector with fix move"); - runit[0] = axis[0]/len; - runit[1] = axis[1]/len; - runit[2] = axis[2]/len; + if ((mstyle == ROTATE) || (mstyle == TRANSROT)) { + double len = sqrt(axis[0] * axis[0] + axis[1] * axis[1] + axis[2] * axis[2]); + if (len == 0.0) error->all(FLERR, "Zero length rotation vector with fix move"); + runit[0] = axis[0] / len; + runit[1] = axis[1] / len; + runit[2] = axis[2] / len; } // set flags for extra attributes particles may store @@ -254,10 +295,10 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : // AtomVec pointers to retrieve per-atom storage of extra quantities - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - avec_line = (AtomVecLine *) atom->style_match("line"); - avec_tri = (AtomVecTri *) atom->style_match("tri"); - avec_body = (AtomVecBody *) atom->style_match("body"); + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + avec_line = dynamic_cast( atom->style_match("line")); + avec_tri = dynamic_cast( atom->style_match("tri")); + avec_body = dynamic_cast( atom->style_match("body")); // xoriginal = initial unwrapped positions of atoms // toriginal = initial theta of lines @@ -273,15 +314,18 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { - if (mask[i] & groupbit) domain->unmap(x[i],image[i],xoriginal[i]); - else xoriginal[i][0] = xoriginal[i][1] = xoriginal[i][2] = 0.0; + if (mask[i] & groupbit) + domain->unmap(x[i], image[i], xoriginal[i]); + else + xoriginal[i][0] = xoriginal[i][1] = xoriginal[i][2] = 0.0; } if (theta_flag) { for (int i = 0; i < nlocal; i++) { if ((mask[i] & groupbit) && line[i] >= 0) toriginal[i] = avec_line->bonus[line[i]].theta; - else toriginal[i] = 0.0; + else + toriginal[i] = 0.0; } } @@ -302,8 +346,8 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : qoriginal[i][1] = quat[1]; qoriginal[i][2] = quat[2]; qoriginal[i][3] = quat[3]; - } else qoriginal[i][0] = qoriginal[i][1] = - qoriginal[i][2] = qoriginal[i][3] = 0.0; + } else + qoriginal[i][0] = qoriginal[i][1] = qoriginal[i][2] = qoriginal[i][3] = 0.0; } } @@ -325,8 +369,8 @@ FixMove::~FixMove() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,Atom::GROW); - atom->delete_callback(id,Atom::RESTART); + atom->delete_callback(id, Atom::GROW); + atom->delete_callback(id, Atom::RESTART); // delete locally stored arrays @@ -336,12 +380,12 @@ FixMove::~FixMove() memory->destroy(displace); memory->destroy(velocity); - delete [] xvarstr; - delete [] yvarstr; - delete [] zvarstr; - delete [] vxvarstr; - delete [] vyvarstr; - delete [] vzvarstr; + delete[] xvarstr; + delete[] yvarstr; + delete[] zvarstr; + delete[] vxvarstr; + delete[] vyvarstr; + delete[] vzvarstr; } /* ---------------------------------------------------------------------- */ @@ -371,51 +415,63 @@ void FixMove::init() if (mstyle == VARIABLE) { if (xvarstr) { xvar = input->variable->find(xvarstr); - if (xvar < 0) error->all(FLERR, - "Variable name for fix move does not exist"); - if (input->variable->equalstyle(xvar)) xvarstyle = EQUAL; - else if (input->variable->atomstyle(xvar)) xvarstyle = ATOM; - else error->all(FLERR,"Variable for fix move is invalid style"); + if (xvar < 0) error->all(FLERR, "Variable name for fix move does not exist"); + if (input->variable->equalstyle(xvar)) + xvarstyle = EQUAL; + else if (input->variable->atomstyle(xvar)) + xvarstyle = ATOM; + else + error->all(FLERR, "Variable for fix move is invalid style"); } if (yvarstr) { yvar = input->variable->find(yvarstr); - if (yvar < 0) error->all(FLERR, - "Variable name for fix move does not exist"); - if (input->variable->equalstyle(yvar)) yvarstyle = EQUAL; - else if (input->variable->atomstyle(yvar)) yvarstyle = ATOM; - else error->all(FLERR,"Variable for fix move is invalid style"); + if (yvar < 0) error->all(FLERR, "Variable name for fix move does not exist"); + if (input->variable->equalstyle(yvar)) + yvarstyle = EQUAL; + else if (input->variable->atomstyle(yvar)) + yvarstyle = ATOM; + else + error->all(FLERR, "Variable for fix move is invalid style"); } if (zvarstr) { zvar = input->variable->find(zvarstr); - if (zvar < 0) error->all(FLERR, - "Variable name for fix move does not exist"); - if (input->variable->equalstyle(zvar)) zvarstyle = EQUAL; - else if (input->variable->atomstyle(zvar)) zvarstyle = ATOM; - else error->all(FLERR,"Variable for fix move is invalid style"); + if (zvar < 0) error->all(FLERR, "Variable name for fix move does not exist"); + if (input->variable->equalstyle(zvar)) + zvarstyle = EQUAL; + else if (input->variable->atomstyle(zvar)) + zvarstyle = ATOM; + else + error->all(FLERR, "Variable for fix move is invalid style"); } if (vxvarstr) { vxvar = input->variable->find(vxvarstr); - if (vxvar < 0) error->all(FLERR, - "Variable name for fix move does not exist"); - if (input->variable->equalstyle(vxvar)) vxvarstyle = EQUAL; - else if (input->variable->atomstyle(vxvar)) vxvarstyle = ATOM; - else error->all(FLERR,"Variable for fix move is invalid style"); + if (vxvar < 0) error->all(FLERR, "Variable name for fix move does not exist"); + if (input->variable->equalstyle(vxvar)) + vxvarstyle = EQUAL; + else if (input->variable->atomstyle(vxvar)) + vxvarstyle = ATOM; + else + error->all(FLERR, "Variable for fix move is invalid style"); } if (vyvarstr) { vyvar = input->variable->find(vyvarstr); - if (vyvar < 0) error->all(FLERR, - "Variable name for fix move does not exist"); - if (input->variable->equalstyle(vyvar)) vyvarstyle = EQUAL; - else if (input->variable->atomstyle(vyvar)) vyvarstyle = ATOM; - else error->all(FLERR,"Variable for fix move is invalid style"); + if (vyvar < 0) error->all(FLERR, "Variable name for fix move does not exist"); + if (input->variable->equalstyle(vyvar)) + vyvarstyle = EQUAL; + else if (input->variable->atomstyle(vyvar)) + vyvarstyle = ATOM; + else + error->all(FLERR, "Variable for fix move is invalid style"); } if (vzvarstr) { vzvar = input->variable->find(vzvarstr); - if (vzvar < 0) error->all(FLERR, - "Variable name for fix move does not exist"); - if (input->variable->equalstyle(vzvar)) vzvarstyle = EQUAL; - else if (input->variable->atomstyle(vzvar)) vzvarstyle = ATOM; - else error->all(FLERR,"Variable for fix move is invalid style"); + if (vzvar < 0) error->all(FLERR, "Variable name for fix move does not exist"); + if (input->variable->equalstyle(vzvar)) + vzvarstyle = EQUAL; + else if (input->variable->atomstyle(vzvar)) + vzvarstyle = ATOM; + else + error->all(FLERR, "Variable for fix move is invalid style"); } if (xvarstr && xvarstyle == ATOM) displaceflag = 1; @@ -429,13 +485,17 @@ void FixMove::init() maxatom = atom->nmax; memory->destroy(displace); memory->destroy(velocity); - if (displaceflag) memory->create(displace,maxatom,3,"move:displace"); - else displace = nullptr; - if (velocityflag) memory->create(velocity,maxatom,3,"move:velocity"); - else velocity = nullptr; + if (displaceflag) + memory->create(displace, maxatom, 3, "move:displace"); + else + displace = nullptr; + if (velocityflag) + memory->create(velocity, maxatom, 3, "move:velocity"); + else + velocity = nullptr; - if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + if (utils::strmatch(update->integrate_style, "^respa")) + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } /* ---------------------------------------------------------------------- @@ -445,11 +505,11 @@ void FixMove::init() void FixMove::initial_integrate(int /*vflag*/) { int flag; - double ddotr,dx,dy,dz; - double dtfm,theta_new; - double xold[3],a[3],b[3],c[3],d[3],disp[3],w[3],ex[3],ey[3],ez[3]; - double inertia_ellipsoid[3],qrotate[4]; - double *quat,*inertia,*shape; + double ddotr, dx, dy, dz; + double dtfm, theta_new; + double xold[3], a[3], b[3], c[3], d[3], disp[3], w[3], ex[3], ey[3], ez[3]; + double inertia_ellipsoid[3], qrotate[4]; + double *quat, *inertia, *shape; double delta = (update->ntimestep - time_origin) * dt; @@ -481,7 +541,7 @@ void FixMove::initial_integrate(int /*vflag*/) if (vxflag) { v[i][0] = vx; - x[i][0] = xoriginal[i][0] + vx*delta; + x[i][0] = xoriginal[i][0] + vx * delta; } else if (rmass) { dtfm = dtf / rmass[i]; v[i][0] += dtfm * f[i][0]; @@ -494,7 +554,7 @@ void FixMove::initial_integrate(int /*vflag*/) if (vyflag) { v[i][1] = vy; - x[i][1] = xoriginal[i][1] + vy*delta; + x[i][1] = xoriginal[i][1] + vy * delta; } else if (rmass) { dtfm = dtf / rmass[i]; v[i][1] += dtfm * f[i][1]; @@ -507,7 +567,7 @@ void FixMove::initial_integrate(int /*vflag*/) if (vzflag) { v[i][2] = vz; - x[i][2] = xoriginal[i][2] + vz*delta; + x[i][2] = xoriginal[i][2] + vz * delta; } else if (rmass) { dtfm = dtf / rmass[i]; v[i][2] += dtfm * f[i][2]; @@ -518,7 +578,7 @@ void FixMove::initial_integrate(int /*vflag*/) x[i][2] += dtv * v[i][2]; } - domain->remap_near(x[i],xold); + domain->remap_near(x[i], xold); } } @@ -536,8 +596,8 @@ void FixMove::initial_integrate(int /*vflag*/) xold[2] = x[i][2]; if (axflag) { - v[i][0] = ax*omega_rotate*cosine; - x[i][0] = xoriginal[i][0] + ax*sine; + v[i][0] = ax * omega_rotate * cosine; + x[i][0] = xoriginal[i][0] + ax * sine; } else if (rmass) { dtfm = dtf / rmass[i]; v[i][0] += dtfm * f[i][0]; @@ -549,8 +609,8 @@ void FixMove::initial_integrate(int /*vflag*/) } if (ayflag) { - v[i][1] = ay*omega_rotate*cosine; - x[i][1] = xoriginal[i][1] + ay*sine; + v[i][1] = ay * omega_rotate * cosine; + x[i][1] = xoriginal[i][1] + ay * sine; } else if (rmass) { dtfm = dtf / rmass[i]; v[i][1] += dtfm * f[i][1]; @@ -562,8 +622,8 @@ void FixMove::initial_integrate(int /*vflag*/) } if (azflag) { - v[i][2] = az*omega_rotate*cosine; - x[i][2] = xoriginal[i][2] + az*sine; + v[i][2] = az * omega_rotate * cosine; + x[i][2] = xoriginal[i][2] + az * sine; } else if (rmass) { dtfm = dtf / rmass[i]; v[i][2] += dtfm * f[i][2]; @@ -574,7 +634,7 @@ void FixMove::initial_integrate(int /*vflag*/) x[i][2] += dtv * v[i][2]; } - domain->remap_near(x[i],xold); + domain->remap_near(x[i], xold); } } @@ -597,12 +657,12 @@ void FixMove::initial_integrate(int /*vflag*/) double cosine = cos(arg); double sine = sin(arg); - double qcosine = cos(0.5*arg); - double qsine = sin(0.5*arg); + double qcosine = cos(0.5 * arg); + double qsine = sin(0.5 * arg); qrotate[0] = qcosine; - qrotate[1] = runit[0]*qsine; - qrotate[2] = runit[1]*qsine; - qrotate[3] = runit[2]*qsine; + qrotate[1] = runit[0] * qsine; + qrotate[2] = runit[1] * qsine; + qrotate[3] = runit[2] * qsine; for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { @@ -613,26 +673,26 @@ void FixMove::initial_integrate(int /*vflag*/) d[0] = xoriginal[i][0] - point[0]; d[1] = xoriginal[i][1] - point[1]; d[2] = xoriginal[i][2] - point[2]; - ddotr = d[0]*runit[0] + d[1]*runit[1] + d[2]*runit[2]; - c[0] = ddotr*runit[0]; - c[1] = ddotr*runit[1]; - c[2] = ddotr*runit[2]; + ddotr = d[0] * runit[0] + d[1] * runit[1] + d[2] * runit[2]; + c[0] = ddotr * runit[0]; + c[1] = ddotr * runit[1]; + c[2] = ddotr * runit[2]; a[0] = d[0] - c[0]; a[1] = d[1] - c[1]; a[2] = d[2] - c[2]; - b[0] = runit[1]*a[2] - runit[2]*a[1]; - b[1] = runit[2]*a[0] - runit[0]*a[2]; - b[2] = runit[0]*a[1] - runit[1]*a[0]; - disp[0] = a[0]*cosine + b[0]*sine; - disp[1] = a[1]*cosine + b[1]*sine; - disp[2] = a[2]*cosine + b[2]*sine; + b[0] = runit[1] * a[2] - runit[2] * a[1]; + b[1] = runit[2] * a[0] - runit[0] * a[2]; + b[2] = runit[0] * a[1] - runit[1] * a[0]; + disp[0] = a[0] * cosine + b[0] * sine; + disp[1] = a[1] * cosine + b[1] * sine; + disp[2] = a[2] * cosine + b[2] * sine; x[i][0] = point[0] + c[0] + disp[0]; x[i][1] = point[1] + c[1] + disp[1]; x[i][2] = point[2] + c[2] + disp[2]; - v[i][0] = omega_rotate * (runit[1]*disp[2] - runit[2]*disp[1]); - v[i][1] = omega_rotate * (runit[2]*disp[0] - runit[0]*disp[2]); - v[i][2] = omega_rotate * (runit[0]*disp[1] - runit[1]*disp[0]); + v[i][0] = omega_rotate * (runit[1] * disp[2] - runit[2] * disp[1]); + v[i][1] = omega_rotate * (runit[2] * disp[0] - runit[0] * disp[2]); + v[i][2] = omega_rotate * (runit[0] * disp[1] - runit[1] * disp[0]); // set any extra attributes affected by rotation @@ -646,9 +706,9 @@ void FixMove::initial_integrate(int /*vflag*/) if (line_flag && line[i] >= 0.0) flag = 1; if (tri_flag && tri[i] >= 0.0) flag = 1; if (flag) { - omega[i][0] = omega_rotate*runit[0]; - omega[i][1] = omega_rotate*runit[1]; - omega[i][2] = omega_rotate*runit[2]; + omega[i][0] = omega_rotate * runit[0]; + omega[i][1] = omega_rotate * runit[1]; + omega[i][2] = omega_rotate * runit[2]; } } @@ -660,11 +720,11 @@ void FixMove::initial_integrate(int /*vflag*/) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; shape = avec_ellipsoid->bonus[ellipsoid[i]].shape; inertia_ellipsoid[0] = - INERTIA*rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]); + INERTIA * rmass[i] * (shape[1] * shape[1] + shape[2] * shape[2]); inertia_ellipsoid[1] = - INERTIA*rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]); + INERTIA * rmass[i] * (shape[0] * shape[0] + shape[2] * shape[2]); inertia_ellipsoid[2] = - INERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]); + INERTIA * rmass[i] * (shape[0] * shape[0] + shape[1] * shape[1]); inertia = inertia_ellipsoid; } else if (tri_flag && tri[i] >= 0) { quat = avec_tri->bonus[tri[i]].quat; @@ -674,18 +734,18 @@ void FixMove::initial_integrate(int /*vflag*/) inertia = avec_body->bonus[body[i]].inertia; } if (quat) { - w[0] = omega_rotate*runit[0]; - w[1] = omega_rotate*runit[1]; - w[2] = omega_rotate*runit[2]; - MathExtra::q_to_exyz(quat,ex,ey,ez); - MathExtra::omega_to_angmom(w,ex,ey,ez,inertia,angmom[i]); + w[0] = omega_rotate * runit[0]; + w[1] = omega_rotate * runit[1]; + w[2] = omega_rotate * runit[2]; + MathExtra::q_to_exyz(quat, ex, ey, ez); + MathExtra::omega_to_angmom(w, ex, ey, ez, inertia, angmom[i]); } } // theta for lines if (theta_flag && line[i] >= 0.0) { - theta_new = fmod(toriginal[i]+arg,MY_2PI); + theta_new = fmod(toriginal[i] + arg, MY_2PI); avec_line->bonus[atom->line[i]].theta = theta_new; } @@ -699,11 +759,149 @@ void FixMove::initial_integrate(int /*vflag*/) quat = avec_tri->bonus[tri[i]].quat; else if (body_flag && body[i] >= 0) quat = avec_body->bonus[body[i]].quat; - if (quat) MathExtra::quatquat(qrotate,qoriginal[i],quat); + if (quat) MathExtra::quatquat(qrotate, qoriginal[i], quat); } } - domain->remap_near(x[i],xold); + domain->remap_near(x[i], xold); + } + } + + // for rotate by right-hand rule around omega: + // P = point = vector = point of rotation + // R = vector = axis of rotation + // w = omega of rotation (from period) + // X0 = xoriginal = initial coord of atom + // R0 = runit = unit vector for R + // D = X0 - P = vector from P to X0 + // C = (D dot R0) R0 = projection of atom coord onto R line + // A = D - C = vector from R line to X0 + // B = R0 cross A = vector perp to A in plane of rotation + // A,B define plane of circular rotation around R line + // X = P + C + A cos(w*dt) + B sin(w*dt) + // V = w R0 cross (A cos(w*dt) + B sin(w*dt)) + // + // add translation after rotation + + } else if (mstyle == TRANSROT) { + double arg = omega_rotate * delta; + double cosine = cos(arg); + double sine = sin(arg); + + double qcosine = cos(0.5 * arg); + double qsine = sin(0.5 * arg); + qrotate[0] = qcosine; + qrotate[1] = runit[0] * qsine; + qrotate[2] = runit[1] * qsine; + qrotate[3] = runit[2] * qsine; + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + xold[0] = x[i][0]; + xold[1] = x[i][1]; + xold[2] = x[i][2]; + + d[0] = xoriginal[i][0] - point[0]; + d[1] = xoriginal[i][1] - point[1]; + d[2] = xoriginal[i][2] - point[2]; + ddotr = d[0] * runit[0] + d[1] * runit[1] + d[2] * runit[2]; + c[0] = ddotr * runit[0]; + c[1] = ddotr * runit[1]; + c[2] = ddotr * runit[2]; + a[0] = d[0] - c[0]; + a[1] = d[1] - c[1]; + a[2] = d[2] - c[2]; + b[0] = runit[1] * a[2] - runit[2] * a[1]; + b[1] = runit[2] * a[0] - runit[0] * a[2]; + b[2] = runit[0] * a[1] - runit[1] * a[0]; + disp[0] = a[0] * cosine + b[0] * sine; + disp[1] = a[1] * cosine + b[1] * sine; + disp[2] = a[2] * cosine + b[2] * sine; + + x[i][0] = point[0] + c[0] + disp[0]; + x[i][1] = point[1] + c[1] + disp[1]; + x[i][2] = point[2] + c[2] + disp[2]; + v[i][0] = omega_rotate * (runit[1] * disp[2] - runit[2] * disp[1]); + v[i][1] = omega_rotate * (runit[2] * disp[0] - runit[0] * disp[2]); + v[i][2] = omega_rotate * (runit[0] * disp[1] - runit[1] * disp[0]); + + // set any extra attributes affected by rotation + + if (extra_flag) { + + // omega for spheres, lines, tris + + if (omega_flag) { + flag = 0; + if (radius_flag && radius[i] > 0.0) flag = 1; + if (line_flag && line[i] >= 0.0) flag = 1; + if (tri_flag && tri[i] >= 0.0) flag = 1; + if (flag) { + omega[i][0] = omega_rotate * runit[0]; + omega[i][1] = omega_rotate * runit[1]; + omega[i][2] = omega_rotate * runit[2]; + } + } + + // angmom for ellipsoids, tris, and bodies + + if (angmom_flag) { + quat = inertia = nullptr; + if (ellipsoid_flag && ellipsoid[i] >= 0) { + quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; + shape = avec_ellipsoid->bonus[ellipsoid[i]].shape; + inertia_ellipsoid[0] = + INERTIA * rmass[i] * (shape[1] * shape[1] + shape[2] * shape[2]); + inertia_ellipsoid[1] = + INERTIA * rmass[i] * (shape[0] * shape[0] + shape[2] * shape[2]); + inertia_ellipsoid[2] = + INERTIA * rmass[i] * (shape[0] * shape[0] + shape[1] * shape[1]); + inertia = inertia_ellipsoid; + } else if (tri_flag && tri[i] >= 0) { + quat = avec_tri->bonus[tri[i]].quat; + inertia = avec_tri->bonus[tri[i]].inertia; + } else if (body_flag && body[i] >= 0) { + quat = avec_body->bonus[body[i]].quat; + inertia = avec_body->bonus[body[i]].inertia; + } + if (quat) { + w[0] = omega_rotate * runit[0]; + w[1] = omega_rotate * runit[1]; + w[2] = omega_rotate * runit[2]; + MathExtra::q_to_exyz(quat, ex, ey, ez); + MathExtra::omega_to_angmom(w, ex, ey, ez, inertia, angmom[i]); + } + } + + // theta for lines + + if (theta_flag && line[i] >= 0.0) { + theta_new = fmod(toriginal[i] + arg, MY_2PI); + avec_line->bonus[atom->line[i]].theta = theta_new; + } + + // quats for ellipsoids, tris, and bodies + + if (quat_flag) { + quat = nullptr; + if (ellipsoid_flag && ellipsoid[i] >= 0) + quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; + else if (tri_flag && tri[i] >= 0) + quat = avec_tri->bonus[tri[i]].quat; + else if (body_flag && body[i] >= 0) + quat = avec_body->bonus[body[i]].quat; + if (quat) MathExtra::quatquat(qrotate, qoriginal[i], quat); + } + } + + v[i][0] += vx; + x[i][0] += vx * delta; + v[i][1] += vy; + x[i][1] += vy * delta; + v[i][2] += vz; + x[i][2] += vz * delta; + + domain->remap_near(x[i], xold); } } @@ -720,11 +918,11 @@ void FixMove::initial_integrate(int /*vflag*/) maxatom = atom->nmax; if (displaceflag) { memory->destroy(displace); - memory->create(displace,maxatom,3,"move:displace"); + memory->create(displace, maxatom, 3, "move:displace"); } if (velocityflag) { memory->destroy(velocity); - memory->create(velocity,maxatom,3,"move:velocity"); + memory->create(velocity, maxatom, 3, "move:velocity"); } } @@ -733,28 +931,40 @@ void FixMove::initial_integrate(int /*vflag*/) modify->clearstep_compute(); if (xvarstr) { - if (xvarstyle == EQUAL) dx = input->variable->compute_equal(xvar); - else input->variable->compute_atom(xvar,igroup,&displace[0][0],3,0); + if (xvarstyle == EQUAL) + dx = input->variable->compute_equal(xvar); + else + input->variable->compute_atom(xvar, igroup, &displace[0][0], 3, 0); } if (yvarstr) { - if (yvarstyle == EQUAL) dy = input->variable->compute_equal(yvar); - else input->variable->compute_atom(yvar,igroup,&displace[0][1],3,0); + if (yvarstyle == EQUAL) + dy = input->variable->compute_equal(yvar); + else + input->variable->compute_atom(yvar, igroup, &displace[0][1], 3, 0); } if (zvarstr) { - if (zvarstyle == EQUAL) dz = input->variable->compute_equal(zvar); - else input->variable->compute_atom(zvar,igroup,&displace[0][2],3,0); + if (zvarstyle == EQUAL) + dz = input->variable->compute_equal(zvar); + else + input->variable->compute_atom(zvar, igroup, &displace[0][2], 3, 0); } if (vxvarstr) { - if (vxvarstyle == EQUAL) vx = input->variable->compute_equal(vxvar); - else input->variable->compute_atom(vxvar,igroup,&velocity[0][0],3,0); + if (vxvarstyle == EQUAL) + vx = input->variable->compute_equal(vxvar); + else + input->variable->compute_atom(vxvar, igroup, &velocity[0][0], 3, 0); } if (vyvarstr) { - if (vyvarstyle == EQUAL) vy = input->variable->compute_equal(vyvar); - else input->variable->compute_atom(vyvar,igroup,&velocity[0][1],3,0); + if (vyvarstyle == EQUAL) + vy = input->variable->compute_equal(vyvar); + else + input->variable->compute_atom(vyvar, igroup, &velocity[0][1], 3, 0); } if (vzvarstr) { - if (vzvarstyle == EQUAL) vz = input->variable->compute_equal(vzvar); - else input->variable->compute_atom(vzvar,igroup,&velocity[0][2],3,0); + if (vzvarstyle == EQUAL) + vz = input->variable->compute_equal(vzvar); + else + input->variable->compute_atom(vzvar, igroup, &velocity[0][2], 3, 0); } modify->addstep_compute(update->ntimestep + 1); @@ -768,16 +978,24 @@ void FixMove::initial_integrate(int /*vflag*/) xold[2] = x[i][2]; if (xvarstr && vxvarstr) { - if (vxvarstyle == EQUAL) v[i][0] = vx; - else v[i][0] = velocity[i][0]; - if (xvarstyle == EQUAL) x[i][0] = xoriginal[i][0] + dx; - else x[i][0] = xoriginal[i][0] + displace[i][0]; + if (vxvarstyle == EQUAL) + v[i][0] = vx; + else + v[i][0] = velocity[i][0]; + if (xvarstyle == EQUAL) + x[i][0] = xoriginal[i][0] + dx; + else + x[i][0] = xoriginal[i][0] + displace[i][0]; } else if (xvarstr) { - if (xvarstyle == EQUAL) x[i][0] = xoriginal[i][0] + dx; - else x[i][0] = xoriginal[i][0] + displace[i][0]; + if (xvarstyle == EQUAL) + x[i][0] = xoriginal[i][0] + dx; + else + x[i][0] = xoriginal[i][0] + displace[i][0]; } else if (vxvarstr) { - if (vxvarstyle == EQUAL) v[i][0] = vx; - else v[i][0] = velocity[i][0]; + if (vxvarstyle == EQUAL) + v[i][0] = vx; + else + v[i][0] = velocity[i][0]; x[i][0] += dtv * v[i][0]; } else { if (rmass) { @@ -791,16 +1009,24 @@ void FixMove::initial_integrate(int /*vflag*/) } if (yvarstr && vyvarstr) { - if (vyvarstyle == EQUAL) v[i][1] = vy; - else v[i][1] = velocity[i][1]; - if (yvarstyle == EQUAL) x[i][1] = xoriginal[i][1] + dy; - else x[i][1] = xoriginal[i][1] + displace[i][1]; + if (vyvarstyle == EQUAL) + v[i][1] = vy; + else + v[i][1] = velocity[i][1]; + if (yvarstyle == EQUAL) + x[i][1] = xoriginal[i][1] + dy; + else + x[i][1] = xoriginal[i][1] + displace[i][1]; } else if (yvarstr) { - if (yvarstyle == EQUAL) x[i][1] = xoriginal[i][1] + dy; - else x[i][1] = xoriginal[i][1] + displace[i][1]; + if (yvarstyle == EQUAL) + x[i][1] = xoriginal[i][1] + dy; + else + x[i][1] = xoriginal[i][1] + displace[i][1]; } else if (vyvarstr) { - if (vyvarstyle == EQUAL) v[i][1] = vy; - else v[i][1] = velocity[i][1]; + if (vyvarstyle == EQUAL) + v[i][1] = vy; + else + v[i][1] = velocity[i][1]; x[i][1] += dtv * v[i][1]; } else { if (rmass) { @@ -814,16 +1040,24 @@ void FixMove::initial_integrate(int /*vflag*/) } if (zvarstr && vzvarstr) { - if (vzvarstyle == EQUAL) v[i][2] = vz; - else v[i][2] = velocity[i][2]; - if (zvarstyle == EQUAL) x[i][2] = xoriginal[i][2] + dz; - else x[i][2] = xoriginal[i][2] + displace[i][2]; + if (vzvarstyle == EQUAL) + v[i][2] = vz; + else + v[i][2] = velocity[i][2]; + if (zvarstyle == EQUAL) + x[i][2] = xoriginal[i][2] + dz; + else + x[i][2] = xoriginal[i][2] + displace[i][2]; } else if (zvarstr) { - if (zvarstyle == EQUAL) x[i][2] = xoriginal[i][2] + dz; - else x[i][2] = xoriginal[i][2] + displace[i][2]; + if (zvarstyle == EQUAL) + x[i][2] = xoriginal[i][2] + dz; + else + x[i][2] = xoriginal[i][2] + displace[i][2]; } else if (vzvarstr) { - if (vzvarstyle == EQUAL) v[i][2] = vz; - else v[i][2] = velocity[i][2]; + if (vzvarstyle == EQUAL) + v[i][2] = vz; + else + v[i][2] = velocity[i][2]; x[i][2] += dtv * v[i][2]; } else { if (rmass) { @@ -836,7 +1070,7 @@ void FixMove::initial_integrate(int /*vflag*/) x[i][2] += dtv * v[i][2]; } - domain->remap_near(x[i],xold); + domain->remap_near(x[i], xold); } } } @@ -851,22 +1085,40 @@ void FixMove::final_integrate() double dtfm; int xflag = 1; - if (mstyle == LINEAR && vxflag) xflag = 0; - else if (mstyle == WIGGLE && axflag) xflag = 0; - else if (mstyle == ROTATE) xflag = 0; - else if (mstyle == VARIABLE && (xvarstr || vxvarstr)) xflag = 0; + if (mstyle == LINEAR && vxflag) + xflag = 0; + else if (mstyle == WIGGLE && axflag) + xflag = 0; + else if (mstyle == ROTATE) + xflag = 0; + else if (mstyle == TRANSROT) + xflag = 0; + else if (mstyle == VARIABLE && (xvarstr || vxvarstr)) + xflag = 0; int yflag = 1; - if (mstyle == LINEAR && vyflag) yflag = 0; - else if (mstyle == WIGGLE && ayflag) yflag = 0; - else if (mstyle == ROTATE) yflag = 0; - else if (mstyle == VARIABLE && (yvarstr || vyvarstr)) yflag = 0; + if (mstyle == LINEAR && vyflag) + yflag = 0; + else if (mstyle == WIGGLE && ayflag) + yflag = 0; + else if (mstyle == ROTATE) + yflag = 0; + else if (mstyle == TRANSROT) + yflag = 0; + else if (mstyle == VARIABLE && (yvarstr || vyvarstr)) + yflag = 0; int zflag = 1; - if (mstyle == LINEAR && vzflag) zflag = 0; - else if (mstyle == WIGGLE && azflag) zflag = 0; - else if (mstyle == ROTATE) zflag = 0; - else if (mstyle == VARIABLE && (zvarstr || vzvarstr)) zflag = 0; + if (mstyle == LINEAR && vzflag) + zflag = 0; + else if (mstyle == WIGGLE && azflag) + zflag = 0; + else if (mstyle == ROTATE) + zflag = 0; + else if (mstyle == TRANSROT) + zflag = 0; + else if (mstyle == VARIABLE && (zvarstr || vzvarstr)) + zflag = 0; double **v = atom->v; double **f = atom->f; @@ -918,14 +1170,14 @@ void FixMove::initial_integrate_respa(int vflag, int ilevel, int /*iloop*/) // outermost level - update v and x // all other levels - nothing - if (ilevel == nlevels_respa-1) initial_integrate(vflag); + if (ilevel == nlevels_respa - 1) initial_integrate(vflag); } /* ---------------------------------------------------------------------- */ void FixMove::final_integrate_respa(int ilevel, int /*iloop*/) { - if (ilevel == nlevels_respa-1) final_integrate(); + if (ilevel == nlevels_respa - 1) final_integrate(); } /* ---------------------------------------------------------------------- @@ -934,11 +1186,11 @@ void FixMove::final_integrate_respa(int ilevel, int /*iloop*/) double FixMove::memory_usage() { - double bytes = (double)atom->nmax*3 * sizeof(double); - if (theta_flag) bytes += (double)atom->nmax * sizeof(double); - if (quat_flag) bytes += (double)atom->nmax*4 * sizeof(double); - if (displaceflag) bytes += (double)atom->nmax*3 * sizeof(double); - if (velocityflag) bytes += (double)atom->nmax*3 * sizeof(double); + double bytes = (double) atom->nmax * 3 * sizeof(double); + if (theta_flag) bytes += (double) atom->nmax * sizeof(double); + if (quat_flag) bytes += (double) atom->nmax * 4 * sizeof(double); + if (displaceflag) bytes += (double) atom->nmax * 3 * sizeof(double); + if (velocityflag) bytes += (double) atom->nmax * 3 * sizeof(double); return bytes; } @@ -954,8 +1206,8 @@ void FixMove::write_restart(FILE *fp) if (comm->me == 0) { int size = n * sizeof(double); - fwrite(&size,sizeof(int),1,fp); - fwrite(list,sizeof(double),n,fp); + fwrite(&size, sizeof(int), 1, fp); + fwrite(list, sizeof(double), n, fp); } } @@ -966,9 +1218,9 @@ void FixMove::write_restart(FILE *fp) void FixMove::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; - time_origin = static_cast (list[n++]); + time_origin = static_cast(list[n++]); } /* ---------------------------------------------------------------------- @@ -977,9 +1229,9 @@ void FixMove::restart(char *buf) void FixMove::grow_arrays(int nmax) { - memory->grow(xoriginal,nmax,3,"move:xoriginal"); - if (theta_flag) memory->grow(toriginal,nmax,"move:toriginal"); - if (quat_flag) memory->grow(qoriginal,nmax,4,"move:qoriginal"); + memory->grow(xoriginal, nmax, 3, "move:xoriginal"); + if (theta_flag) memory->grow(toriginal, nmax, "move:toriginal"); + if (quat_flag) memory->grow(qoriginal, nmax, 4, "move:qoriginal"); array_atom = xoriginal; } @@ -1028,50 +1280,51 @@ void FixMove::set_arrays(int i) // current time still equal fix creation time if (update->ntimestep == time_origin) { - domain->unmap(x[i],image[i],xoriginal[i]); + domain->unmap(x[i], image[i], xoriginal[i]); return; } // backup particle to time_origin - if (mstyle == VARIABLE) - error->all(FLERR,"Cannot add atoms to fix move variable"); + if (mstyle == VARIABLE) error->all(FLERR, "Cannot add atoms to fix move variable"); - domain->unmap(x[i],image[i],xoriginal[i]); + domain->unmap(x[i], image[i], xoriginal[i]); double delta = (update->ntimestep - time_origin) * update->dt; if (mstyle == LINEAR) { if (vxflag) xoriginal[i][0] -= vx * delta; if (vyflag) xoriginal[i][1] -= vy * delta; if (vzflag) xoriginal[i][2] -= vz * delta; + } else if (mstyle == WIGGLE) { double arg = omega_rotate * delta; double sine = sin(arg); - if (axflag) xoriginal[i][0] -= ax*sine; - if (ayflag) xoriginal[i][1] -= ay*sine; - if (azflag) xoriginal[i][2] -= az*sine; + if (axflag) xoriginal[i][0] -= ax * sine; + if (ayflag) xoriginal[i][1] -= ay * sine; + if (azflag) xoriginal[i][2] -= az * sine; + } else if (mstyle == ROTATE) { - double a[3],b[3],c[3],d[3],disp[3],ddotr; - double arg = - omega_rotate * delta; + double a[3], b[3], c[3], d[3], disp[3], ddotr; + double arg = -omega_rotate * delta; double sine = sin(arg); double cosine = cos(arg); d[0] = x[i][0] - point[0]; d[1] = x[i][1] - point[1]; d[2] = x[i][2] - point[2]; - ddotr = d[0]*runit[0] + d[1]*runit[1] + d[2]*runit[2]; - c[0] = ddotr*runit[0]; - c[1] = ddotr*runit[1]; - c[2] = ddotr*runit[2]; + ddotr = d[0] * runit[0] + d[1] * runit[1] + d[2] * runit[2]; + c[0] = ddotr * runit[0]; + c[1] = ddotr * runit[1]; + c[2] = ddotr * runit[2]; a[0] = d[0] - c[0]; a[1] = d[1] - c[1]; a[2] = d[2] - c[2]; - b[0] = runit[1]*a[2] - runit[2]*a[1]; - b[1] = runit[2]*a[0] - runit[0]*a[2]; - b[2] = runit[0]*a[1] - runit[1]*a[0]; - disp[0] = a[0]*cosine + b[0]*sine; - disp[1] = a[1]*cosine + b[1]*sine; - disp[2] = a[2]*cosine + b[2]*sine; + b[0] = runit[1] * a[2] - runit[2] * a[1]; + b[1] = runit[2] * a[0] - runit[0] * a[2]; + b[2] = runit[0] * a[1] - runit[1] * a[0]; + disp[0] = a[0] * cosine + b[0] * sine; + disp[1] = a[1] * cosine + b[1] * sine; + disp[2] = a[2] * cosine + b[2] * sine; xoriginal[i][0] = point[0] + c[0] + disp[0]; xoriginal[i][1] = point[1] + c[1] + disp[1]; @@ -1085,7 +1338,64 @@ void FixMove::set_arrays(int i) if (theta_flag && line[i] >= 0.0) { theta = avec_line->bonus[atom->line[i]].theta; - toriginal[i] = theta - 0.0; // NOTE: edit this line + toriginal[i] = theta - 0.0; // NOTE: edit this line + } + + // quats for ellipsoids, tris, and bodies + + if (quat_flag) { + quat = nullptr; + if (ellipsoid_flag && ellipsoid[i] >= 0) + quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; + else if (tri_flag && tri[i] >= 0) + quat = avec_tri->bonus[tri[i]].quat; + else if (body_flag && body[i] >= 0) + quat = avec_body->bonus[body[i]].quat; + if (quat) { + // qoriginal = f(quat,-delta); // NOTE: edit this line + } + } + } + xoriginal[i][0] -= vx * delta; + xoriginal[i][1] -= vy * delta; + xoriginal[i][2] -= vz * delta; + + } else if (mstyle == TRANSROT) { + double a[3], b[3], c[3], d[3], disp[3], ddotr; + double arg = -omega_rotate * delta; + double sine = sin(arg); + double cosine = cos(arg); + d[0] = x[i][0] - point[0]; + d[1] = x[i][1] - point[1]; + d[2] = x[i][2] - point[2]; + ddotr = d[0] * runit[0] + d[1] * runit[1] + d[2] * runit[2]; + c[0] = ddotr * runit[0]; + c[1] = ddotr * runit[1]; + c[2] = ddotr * runit[2]; + + a[0] = d[0] - c[0]; + a[1] = d[1] - c[1]; + a[2] = d[2] - c[2]; + b[0] = runit[1] * a[2] - runit[2] * a[1]; + b[1] = runit[2] * a[0] - runit[0] * a[2]; + b[2] = runit[0] * a[1] - runit[1] * a[0]; + disp[0] = a[0] * cosine + b[0] * sine; + disp[1] = a[1] * cosine + b[1] * sine; + disp[2] = a[2] * cosine + b[2] * sine; + + xoriginal[i][0] = point[0] + c[0] + disp[0]; + xoriginal[i][1] = point[1] + c[1] + disp[1]; + xoriginal[i][2] = point[2] + c[2] + disp[2]; + + // set theta and quat extra attributes affected by rotation + + if (extra_flag) { + + // theta for lines + + if (theta_flag && line[i] >= 0.0) { + theta = avec_line->bonus[atom->line[i]].theta; + toriginal[i] = theta - 0.0; // NOTE: edit this line } // quats for ellipsoids, tris, and bodies @@ -1180,7 +1490,7 @@ void FixMove::unpack_restart(int nlocal, int nth) // 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]); + for (int i = 0; i < nth; i++) m += static_cast(extra[nlocal][m]); m++; xoriginal[nlocal][0] = extra[nlocal][m++]; @@ -1217,5 +1527,5 @@ int FixMove::size_restart(int /*nlocal*/) void FixMove::reset_dt() { - error->all(FLERR,"Resetting timestep size is not allowed with fix move"); + error->all(FLERR, "Resetting timestep size is not allowed with fix move"); } diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 05df4d078c..7413b590a7 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -628,14 +628,16 @@ void FixNeighHistory::post_neighbor() j = jlist[jj]; if (use_bit_flag) { - rflag = sbmask(j) | pair->beyond_contact; - j &= NEIGHMASK; + rflag = histmask(j) | pair->beyond_contact; + j &= HISTMASK; jlist[jj] = j; } else { rflag = 1; - j &= NEIGHMASK; } + // Remove special bond bits + j &= NEIGHMASK; + // rflag = 1 if r < radsum in npair_size() method or if pair interactions extend further // preserve neigh history info if tag[j] is in old-neigh partner list // this test could be more geometrically precise for two sphere/line/tri diff --git a/src/fix_neigh_history.h b/src/fix_neigh_history.h index ba31f7cd3c..f932b174e9 100644 --- a/src/fix_neigh_history.h +++ b/src/fix_neigh_history.h @@ -93,7 +93,8 @@ class FixNeighHistory : public Fix { virtual void pre_exchange_no_newton(); void allocate_pages(); - inline int sbmask(int j) const { return j >> SBBITS & 3; } + // Shift by HISTBITS and check the first bit + inline int histmask(int j) const { return j >> HISTBITS & 1; } }; } // namespace LAMMPS_NS diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 28c0cafc60..cb0408a50c 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -648,7 +648,7 @@ void FixNH::init() if (pstat_flag) for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = ((FixDeform *) modify->fix[i])->dimflag; + int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5])) @@ -721,8 +721,8 @@ void FixNH::init() else kspace_flag = 0; if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = ((Respa *) update->integrate)->nlevels; - step_respa = ((Respa *) update->integrate)->step; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; + step_respa = (dynamic_cast( update->integrate))->step; dto = 0.5*step_respa[0]; } @@ -1352,7 +1352,7 @@ int FixNH::pack_restart_data(double *list) void FixNH::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; int flag = static_cast (list[n++]); if (flag) { int m = static_cast (list[n++]); diff --git a/src/fix_nve.cpp b/src/fix_nve.cpp index 0ac89f5e26..728036128a 100644 --- a/src/fix_nve.cpp +++ b/src/fix_nve.cpp @@ -55,7 +55,7 @@ void FixNVE::init() dtf = 0.5 * update->dt * force->ftm2v; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = ((Respa *) update->integrate)->step; + step_respa = (dynamic_cast( update->integrate))->step; } /* ---------------------------------------------------------------------- diff --git a/src/fix_nve_limit.cpp b/src/fix_nve_limit.cpp index 9aba474789..cb6d7c7302 100644 --- a/src/fix_nve_limit.cpp +++ b/src/fix_nve_limit.cpp @@ -67,7 +67,7 @@ void FixNVELimit::init() ncount = 0; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = ((Respa *) update->integrate)->step; + step_respa = (dynamic_cast( update->integrate))->step; // warn if using fix shake, which will lead to invalid constraint forces diff --git a/src/fix_nve_noforce.cpp b/src/fix_nve_noforce.cpp index de24c7fef0..d043dcbd4a 100644 --- a/src/fix_nve_noforce.cpp +++ b/src/fix_nve_noforce.cpp @@ -49,7 +49,7 @@ void FixNVENoforce::init() dtv = update->dt; if (utils::strmatch(update->integrate_style,"^respa")) - step_respa = ((Respa *) update->integrate)->step; + step_respa = (dynamic_cast( update->integrate))->step; } /* ---------------------------------------------------------------------- */ diff --git a/src/fix_nvt_sllod.cpp b/src/fix_nvt_sllod.cpp index bc5d3f7298..8c5116c070 100644 --- a/src/fix_nvt_sllod.cpp +++ b/src/fix_nvt_sllod.cpp @@ -73,7 +73,7 @@ void FixNVTSllod::init() int i; for (i = 0; i < modify->nfix; i++) if (strncmp(modify->fix[i]->style,"deform",6) == 0) { - if (((FixDeform *) modify->fix[i])->remapflag != Domain::V_REMAP) + if ((dynamic_cast( modify->fix[i]))->remapflag != Domain::V_REMAP) error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform " "remap option"); break; diff --git a/src/fix_planeforce.cpp b/src/fix_planeforce.cpp index baad522ec6..0d91f2b90e 100644 --- a/src/fix_planeforce.cpp +++ b/src/fix_planeforce.cpp @@ -62,11 +62,11 @@ void FixPlaneForce::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - int nlevels_respa = ((Respa *) update->integrate)->nlevels; + int nlevels_respa = (dynamic_cast( update->integrate))->nlevels; for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - ((Respa *) update->integrate)->copy_flevel_f(ilevel); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); } } } diff --git a/src/fix_press_berendsen.cpp b/src/fix_press_berendsen.cpp index e03e943eb5..f80acce8c4 100644 --- a/src/fix_press_berendsen.cpp +++ b/src/fix_press_berendsen.cpp @@ -270,7 +270,7 @@ void FixPressBerendsen::init() for (int i = 0; i < modify->nfix; i++) if (strcmp(modify->fix[i]->style,"deform") == 0) { - int *dimflag = ((FixDeform *) modify->fix[i])->dimflag; + int *dimflag = (dynamic_cast( modify->fix[i]))->dimflag; if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2])) error->all(FLERR,"Cannot use fix press/berendsen and " diff --git a/src/fix_print.cpp b/src/fix_print.cpp index df5b5f77ff..47810c7e48 100644 --- a/src/fix_print.cpp +++ b/src/fix_print.cpp @@ -158,7 +158,7 @@ void FixPrint::end_of_step() modify->clearstep_compute(); - strcpy(copy,text); + strncpy(copy,text,maxcopy); input->substitute(copy,work,maxcopy,maxwork,0); if (var_print) { diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index f7b9662c24..a6a1b997e3 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -1,4 +1,3 @@ -// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories @@ -26,21 +25,20 @@ using namespace LAMMPS_NS; using namespace FixConst; -enum{MOLECULE,CHARGE,RMASS,IVEC,DVEC,IARRAY,DARRAY}; +enum { MOLECULE, CHARGE, RMASS, IVEC, DVEC, IARRAY, DARRAY }; /* ---------------------------------------------------------------------- */ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), - nvalue(0), styles(nullptr), index(nullptr), astyle(nullptr) + Fix(lmp, narg, arg), nvalue(0), styles(nullptr), index(nullptr), astyle(nullptr) { - if (narg < 4) error->all(FLERR,"Illegal fix property/atom command"); + if (narg < 4) error->all(FLERR, "Illegal fix property/atom command"); restart_peratom = 1; wd_section = 1; int iarg = 3; - nvalue = narg-iarg; + nvalue = narg - iarg; styles = new int[nvalue]; cols = new int[nvalue]; index = new int[nvalue]; @@ -53,33 +51,30 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : values_peratom = 0; while (iarg < narg) { - if (strcmp(arg[iarg],"mol") == 0) { + if (strcmp(arg[iarg], "mol") == 0) { if (atom->molecule_flag) - error->all(FLERR,"Fix property/atom mol when atom_style already has molecule attribute"); - if (molecule_flag) - error->all(FLERR,"Fix property/atom cannot specify mol twice"); + error->all(FLERR, "Fix property/atom mol when atom_style already has molecule attribute"); + if (molecule_flag) error->all(FLERR, "Fix property/atom cannot specify mol twice"); styles[nvalue] = MOLECULE; cols[nvalue] = 0; atom->molecule_flag = molecule_flag = 1; values_peratom++; nvalue++; iarg++; - } else if (strcmp(arg[iarg],"q") == 0) { + } else if (strcmp(arg[iarg], "q") == 0) { if (atom->q_flag) - error->all(FLERR,"Fix property/atom q when atom_style already has charge attribute"); - if (q_flag) - error->all(FLERR,"Fix property/atom cannot specify q twice"); + error->all(FLERR, "Fix property/atom q when atom_style already has charge attribute"); + if (q_flag) error->all(FLERR, "Fix property/atom cannot specify q twice"); styles[nvalue] = CHARGE; cols[nvalue] = 0; atom->q_flag = q_flag = 1; values_peratom++; nvalue++; iarg++; - } else if (strcmp(arg[iarg],"rmass") == 0) { + } else if (strcmp(arg[iarg], "rmass") == 0) { if (atom->rmass_flag) - error->all(FLERR,"Fix property/atom rmass when atom_style already has rmass attribute"); - if (rmass_flag) - error->all(FLERR,"Fix property/atom cannot specify rmass twice"); + error->all(FLERR, "Fix property/atom rmass when atom_style already has rmass attribute"); + if (rmass_flag) error->all(FLERR, "Fix property/atom cannot specify rmass twice"); styles[nvalue] = RMASS; cols[nvalue] = 0; atom->rmass_flag = rmass_flag = 1; @@ -87,51 +82,49 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : nvalue++; iarg++; - // custom atom vector + // custom atom vector - } else if (utils::strmatch(arg[iarg],"^i_")) { + } else if (utils::strmatch(arg[iarg], "^i_")) { styles[nvalue] = IVEC; - int flag,ncols; - index[nvalue] = atom->find_custom(&arg[iarg][2],flag,ncols); - if (index[nvalue] >= 0) - error->all(FLERR,"Fix property/atom vector name already exists"); + int flag, ncols; + index[nvalue] = atom->find_custom(&arg[iarg][2], flag, ncols); + if (index[nvalue] >= 0) error->all(FLERR, "Fix property/atom vector name already exists"); if (ReadData::is_data_section(id)) - error->all(FLERR,"Fix property/atom fix ID must not be a data file section name"); - index[nvalue] = atom->add_custom(&arg[iarg][2],0,0); + error->all(FLERR, "Fix property/atom fix ID must not be a data file section name"); + index[nvalue] = atom->add_custom(&arg[iarg][2], 0, 0); cols[nvalue] = 0; values_peratom++; nvalue++; iarg++; - } else if (utils::strmatch(arg[iarg],"^d_")) { + } else if (utils::strmatch(arg[iarg], "^d_")) { styles[nvalue] = DVEC; - int flag,ncols; - index[nvalue] = atom->find_custom(&arg[iarg][2],flag,ncols); - if (index[nvalue] >= 0) - error->all(FLERR,"Fix property/atom vector name already exists"); + int flag, ncols; + index[nvalue] = atom->find_custom(&arg[iarg][2], flag, ncols); + if (index[nvalue] >= 0) error->all(FLERR, "Fix property/atom vector name already exists"); if (ReadData::is_data_section(id)) - error->all(FLERR,"Fix property/atom fix ID must not be a data file section name"); - index[nvalue] = atom->add_custom(&arg[iarg][2],1,0); + error->all(FLERR, "Fix property/atom fix ID must not be a data file section name"); + index[nvalue] = atom->add_custom(&arg[iarg][2], 1, 0); cols[nvalue] = 0; values_peratom++; nvalue++; iarg++; - // custom atom array + // custom atom array - } else if (utils::strmatch(arg[iarg],"^[id]2_")) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix property/atom command"); + } else if (utils::strmatch(arg[iarg], "^[id]2_")) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal fix property/atom command"); - int which,flag,ncols; - which = atom->find_custom(&arg[iarg][3],flag,ncols); + int which, flag, ncols; + which = atom->find_custom(&arg[iarg][3], flag, ncols); if (which >= 0) - error->all(FLERR,"Fix property/atom array name {} already exists", &arg[iarg][3]); + error->all(FLERR, "Fix property/atom array name {} already exists", &arg[iarg][3]); if (ReadData::is_data_section(id)) - error->all(FLERR,"Fix property/atom fix ID must not be a data file section name"); + error->all(FLERR, "Fix property/atom fix ID must not be a data file section name"); - ncols = utils::inumeric(FLERR,arg[iarg+1],true,lmp); + ncols = utils::inumeric(FLERR, arg[iarg + 1], true, lmp); if (ncols < 1) - error->all(FLERR,"Invalid array columns number {} in fix property/atom", ncols); + error->all(FLERR, "Invalid array columns number {} in fix property/atom", ncols); if (arg[iarg][0] == 'i') { which = 0; @@ -140,26 +133,28 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : which = 1; styles[nvalue] = DARRAY; } - index[nvalue] = atom->add_custom(&arg[iarg][3],which,ncols); + index[nvalue] = atom->add_custom(&arg[iarg][3], which, ncols); cols[nvalue] = ncols; values_peratom += ncols; nvalue++; iarg += 2; - // no match + // no match - } else break; + } else + break; } // optional args border = 0; while (iarg < narg) { - if (strcmp(arg[iarg],"ghost") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix property/atom command"); - border = utils::logical(FLERR,arg[iarg+1],false,lmp); + if (strcmp(arg[iarg], "ghost") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal fix property/atom command"); + border = utils::logical(FLERR, arg[iarg + 1], false, lmp); iarg += 2; - } else error->all(FLERR,"Illegal fix property/atom command"); + } else + error->all(FLERR, "Illegal fix property/atom command"); } if (border) comm_border = values_peratom; @@ -169,12 +164,9 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : if (border == 0) { int flag = 0; for (int i = 0; i < nvalue; i++) - if (styles[i] == MOLECULE - || styles[i] == CHARGE - || styles[i] == RMASS) flag = 1; + if (styles[i] == MOLECULE || styles[i] == CHARGE || styles[i] == RMASS) flag = 1; if (flag && comm->me == 0) - error->warning(FLERR,"Fix property/atom mol or charge or rmass " - "w/out ghost communication"); + error->warning(FLERR, "Fix property/atom mol or charge or rmass w/out ghost communication"); } // store current atom style @@ -197,9 +189,9 @@ FixPropertyAtom::~FixPropertyAtom() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,Atom::GROW); - atom->delete_callback(id,Atom::RESTART); - if (border) atom->delete_callback(id,Atom::BORDER); + atom->delete_callback(id, Atom::GROW); + atom->delete_callback(id, Atom::RESTART); + if (border) atom->delete_callback(id, Atom::BORDER); // deallocate per-atom vectors in Atom class // set ptrs to a null pointer, so they no longer exist for Atom class @@ -218,20 +210,20 @@ FixPropertyAtom::~FixPropertyAtom() memory->destroy(atom->rmass); atom->rmass = nullptr; } else if (styles[nv] == IVEC) { - atom->remove_custom(index[nv],0,cols[nv]); + atom->remove_custom(index[nv], 0, cols[nv]); } else if (styles[nv] == DVEC) { - atom->remove_custom(index[nv],1,cols[nv]); + atom->remove_custom(index[nv], 1, cols[nv]); } else if (styles[nv] == IARRAY) { - atom->remove_custom(index[nv],0,cols[nv]); + atom->remove_custom(index[nv], 0, cols[nv]); } else if (styles[nv] == DARRAY) { - atom->remove_custom(index[nv],1,cols[nv]); + atom->remove_custom(index[nv], 1, cols[nv]); } } - delete [] styles; - delete [] cols; - delete [] index; - delete [] astyle; + delete[] styles; + delete[] cols; + delete[] index; + delete[] astyle; } /* ---------------------------------------------------------------------- */ @@ -249,8 +241,8 @@ void FixPropertyAtom::init() // error if atom style has changed since fix was defined // 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"); + if (strcmp(astyle, atom->atom_style) != 0) + error->all(FLERR, "Atom style was redefined after using fix property/atom"); } /* ---------------------------------------------------------------------- @@ -260,7 +252,7 @@ void FixPropertyAtom::init() void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, tagint id_offset) { - int j,k,m,ncol; + int j, k, m, ncol; tagint itag; char *next; @@ -278,18 +270,18 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, tagint tagint map_tag_max = atom->map_tag_max; for (int i = 0; i < n; i++) { - next = strchr(buf,'\n'); + next = strchr(buf, '\n'); *next = '\0'; try { ValueTokenizer values(buf); - if ((int)values.count() != values_peratom+1) - error->all(FLERR,"Incorrect format in {} section of data file: {}" - " expected {} and got {}",keyword,buf,values_peratom+1,values.count()); + if ((int) values.count() != values_peratom + 1) + error->all(FLERR, "Incorrect format in {} section of data file: {} expected {} and got {}", + keyword, buf, values_peratom + 1, values.count()); itag = values.next_tagint() + id_offset; if (itag <= 0 || itag > map_tag_max) - error->all(FLERR,"Invalid atom ID {} in {} section of data file",itag, keyword); + error->all(FLERR, "Invalid atom ID {} in {} section of data file", itag, keyword); // assign words in line to per-atom vectors @@ -307,17 +299,16 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, tagint atom->dvector[index[j]][m] = values.next_double(); } else if (styles[j] == IARRAY) { ncol = cols[j]; - for (k = 0; k < ncol; k++) - atom->iarray[index[j]][m][k] = values.next_int(); + for (k = 0; k < ncol; k++) atom->iarray[index[j]][m][k] = values.next_int(); } else if (styles[j] == DARRAY) { ncol = cols[j]; - for (k = 0; k < ncol; k++) - atom->darray[index[j]][m][k] = values.next_double(); + for (k = 0; k < ncol; k++) atom->darray[index[j]][m][k] = values.next_double(); } } } } catch (TokenizerException &e) { - error->all(FLERR,"Invalid format in {} section of data file '{}': {}",keyword, buf,e.what()); + error->all(FLERR, "Invalid format in {} section of data file '{}': {}", keyword, buf, + e.what()); } buf = next + 1; } @@ -357,7 +348,7 @@ void FixPropertyAtom::write_data_section_size(int /*mth*/, int &nx, int &ny) void FixPropertyAtom::write_data_section_pack(int /*mth*/, double **buf) { - int i,k,ncol; + int i, k, ncol; // 1st column = atom tag // rest of columns = per-atom values @@ -393,15 +384,13 @@ void FixPropertyAtom::write_data_section_pack(int /*mth*/, double **buf) int **iarray = atom->iarray[index[nv]]; ncol = cols[nv]; for (i = 0; i < nlocal; i++) - for (k = 0; k < ncol; k++) - buf[i][icol+k] = ubuf(iarray[i][k]).d; + for (k = 0; k < ncol; k++) buf[i][icol + k] = ubuf(iarray[i][k]).d; icol += ncol; } else if (styles[nv] == DARRAY) { double **darray = atom->darray[index[nv]]; ncol = cols[nv]; for (i = 0; i < nlocal; i++) - for (k = 0; k < ncol; k++) - buf[i][icol+k] = darray[i][k]; + for (k = 0; k < ncol; k++) buf[i][icol + k] = darray[i][k]; icol += ncol; } } @@ -416,21 +405,30 @@ void FixPropertyAtom::write_data_section_pack(int /*mth*/, double **buf) void FixPropertyAtom::write_data_section_keyword(int /*mth*/, FILE *fp) { - if (nvalue == 1 && styles[0] == MOLECULE) fprintf(fp,"\nMolecules\n\n"); - else if (nvalue == 1 && styles[0] == CHARGE) fprintf(fp,"\nCharges\n\n"); + if (nvalue == 1 && styles[0] == MOLECULE) + fprintf(fp, "\nMolecules\n\n"); + else if (nvalue == 1 && styles[0] == CHARGE) + fprintf(fp, "\nCharges\n\n"); else { - fprintf(fp,"\n%s #",id); + fprintf(fp, "\n%s #", id); // write column hint as comment for (int i = 0; i < nvalue; ++i) { - if (styles[i] == MOLECULE) fputs(" mol",fp); - else if (styles[i] == CHARGE) fputs(" q",fp); - else if (styles[i] == RMASS) fputs(" rmass",fp); - else if (styles[i] == IVEC) fprintf(fp," i_%s", atom->ivname[index[i]]); - else if (styles[i] == DVEC) fprintf(fp, " d_%s", atom->dvname[index[i]]); - else if (styles[i] == IARRAY) fprintf(fp, " i_%s", atom->ianame[index[i]]); - else if (styles[i] == DARRAY) fprintf(fp, " d_%s", atom->daname[index[i]]); + if (styles[i] == MOLECULE) + fputs(" mol", fp); + else if (styles[i] == CHARGE) + fputs(" q", fp); + else if (styles[i] == RMASS) + fputs(" rmass", fp); + else if (styles[i] == IVEC) + fprintf(fp, " i_%s", atom->ivname[index[i]]); + else if (styles[i] == DVEC) + fprintf(fp, " d_%s", atom->dvname[index[i]]); + else if (styles[i] == IARRAY) + fprintf(fp, " i_%s", atom->ianame[index[i]]); + else if (styles[i] == DARRAY) + fprintf(fp, " d_%s", atom->daname[index[i]]); } - fputs("\n\n",fp); + fputs("\n\n", fp); } } @@ -441,38 +439,36 @@ void FixPropertyAtom::write_data_section_keyword(int /*mth*/, FILE *fp) only called by proc 0 ------------------------------------------------------------------------- */ -void FixPropertyAtom::write_data_section(int /*mth*/, FILE *fp, - int n, double **buf, int /*index*/) +void FixPropertyAtom::write_data_section(int /*mth*/, FILE *fp, int n, double **buf, int /*index*/) { - int k,icol,ncol,nv; + int k, icol, ncol, nv; + std::string line; for (int i = 0; i < n; i++) { - fprintf(fp,TAGINT_FORMAT,(tagint) ubuf(buf[i][0]).i); + line = fmt::format("{}", (tagint) ubuf(buf[i][0]).i); icol = 1; for (nv = 0; nv < nvalue; nv++) { if (styles[nv] == MOLECULE) - fprintf(fp," " TAGINT_FORMAT,(tagint) ubuf(buf[i][icol++]).i); + line += fmt::format(" {}", (tagint) ubuf(buf[i][icol++]).i); else if (styles[nv] == CHARGE) - fprintf(fp," %g",buf[i][icol++]); + line += fmt::format(" {}", buf[i][icol++]); else if (styles[nv] == RMASS) - fprintf(fp," %g",buf[i][icol++]); + line += fmt::format(" {}", buf[i][icol++]); else if (styles[nv] == IVEC) - fprintf(fp," %d",(int) ubuf(buf[i][icol++]).i); + line += fmt::format(" {}", (int) ubuf(buf[i][icol++]).i); else if (styles[nv] == DVEC) - fprintf(fp," %g",buf[i][icol++]); + line += fmt::format(" {}", buf[i][icol++]); else if (styles[nv] == IARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - fprintf(fp," %d",(int) ubuf(buf[i][icol+k]).i); + for (k = 0; k < ncol; k++) line += fmt::format(" {}", (int) ubuf(buf[i][icol + k]).i); icol += ncol; } else if (styles[nv] == DARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - fprintf(fp," %g",buf[i][icol+k]); + for (k = 0; k < ncol; k++) line += fmt::format(" {}", buf[i][icol + k]); icol += ncol; } } - fprintf(fp,"\n"); + fmt::print(fp, line + "\n"); } } @@ -484,13 +480,20 @@ double FixPropertyAtom::memory_usage() { double bytes = 0.0; for (int m = 0; m < nvalue; m++) { - if (styles[m] == MOLECULE) bytes = atom->nmax * sizeof(tagint); - else if (styles[m] == CHARGE) bytes = atom->nmax * sizeof(double); - else if (styles[m] == RMASS) bytes = atom->nmax * sizeof(double); - else if (styles[m] == IVEC) bytes = atom->nmax * sizeof(int); - else if (styles[m] == DVEC) bytes = atom->nmax * sizeof(double); - else if (styles[m] == IARRAY) bytes = (size_t) atom->nmax * cols[m] * sizeof(int); - else if (styles[m] == DARRAY) bytes = (size_t) atom->nmax * cols[m] * sizeof(double); + if (styles[m] == MOLECULE) + bytes = atom->nmax * sizeof(tagint); + else if (styles[m] == CHARGE) + bytes = atom->nmax * sizeof(double); + else if (styles[m] == RMASS) + bytes = atom->nmax * sizeof(double); + else if (styles[m] == IVEC) + bytes = atom->nmax * sizeof(int); + else if (styles[m] == DVEC) + bytes = atom->nmax * sizeof(double); + else if (styles[m] == IARRAY) + bytes = (size_t) atom->nmax * cols[m] * sizeof(int); + else if (styles[m] == DARRAY) + bytes = (size_t) atom->nmax * cols[m] * sizeof(double); } return bytes; } @@ -506,33 +509,33 @@ void FixPropertyAtom::grow_arrays(int nmax) { for (int nv = 0; nv < nvalue; nv++) { if (styles[nv] == MOLECULE) { - memory->grow(atom->molecule,nmax,"atom:molecule"); - size_t nbytes = (nmax-nmax_old) * sizeof(tagint); - memset(&atom->molecule[nmax_old],0,nbytes); + memory->grow(atom->molecule, nmax, "atom:molecule"); + size_t nbytes = (nmax - nmax_old) * sizeof(tagint); + memset(&atom->molecule[nmax_old], 0, nbytes); } else if (styles[nv] == CHARGE) { - memory->grow(atom->q,nmax,"atom:q"); - size_t nbytes = (nmax-nmax_old) * sizeof(double); - memset(&atom->q[nmax_old],0,nbytes); + memory->grow(atom->q, nmax, "atom:q"); + size_t nbytes = (nmax - nmax_old) * sizeof(double); + memset(&atom->q[nmax_old], 0, nbytes); } else if (styles[nv] == RMASS) { - memory->grow(atom->rmass,nmax,"atom:rmass"); - size_t nbytes = (nmax-nmax_old) * sizeof(double); - memset(&atom->rmass[nmax_old],0,nbytes); + memory->grow(atom->rmass, nmax, "atom:rmass"); + size_t nbytes = (nmax - nmax_old) * sizeof(double); + memset(&atom->rmass[nmax_old], 0, nbytes); } else if (styles[nv] == IVEC) { - memory->grow(atom->ivector[index[nv]],nmax,"atom:ivector"); - size_t nbytes = (nmax-nmax_old) * sizeof(int); - memset(&atom->ivector[index[nv]][nmax_old],0,nbytes); + memory->grow(atom->ivector[index[nv]], nmax, "atom:ivector"); + size_t nbytes = (nmax - nmax_old) * sizeof(int); + memset(&atom->ivector[index[nv]][nmax_old], 0, nbytes); } else if (styles[nv] == DVEC) { - memory->grow(atom->dvector[index[nv]],nmax,"atom:dvector"); - size_t nbytes = (nmax-nmax_old) * sizeof(double); - memset(&atom->dvector[index[nv]][nmax_old],0,nbytes); + memory->grow(atom->dvector[index[nv]], nmax, "atom:dvector"); + size_t nbytes = (nmax - nmax_old) * sizeof(double); + memset(&atom->dvector[index[nv]][nmax_old], 0, nbytes); } else if (styles[nv] == IARRAY) { - memory->grow(atom->iarray[index[nv]],nmax,cols[nv],"atom:iarray"); - size_t nbytes = (size_t) (nmax-nmax_old) * cols[nv] * sizeof(int); - if (nbytes) memset(&atom->iarray[index[nv]][nmax_old][0],0,nbytes); + memory->grow(atom->iarray[index[nv]], nmax, cols[nv], "atom:iarray"); + size_t nbytes = (size_t) (nmax - nmax_old) * cols[nv] * sizeof(int); + if (nbytes) memset(&atom->iarray[index[nv]][nmax_old][0], 0, nbytes); } else if (styles[nv] == DARRAY) { - memory->grow(atom->darray[index[nv]],nmax,cols[nv],"atom:darray"); - size_t nbytes = (size_t) (nmax-nmax_old) * cols[nv] * sizeof(double); - if (nbytes) memset(&atom->darray[index[nv]][nmax_old][0],0,nbytes); + memory->grow(atom->darray[index[nv]], nmax, cols[nv], "atom:darray"); + size_t nbytes = (size_t) (nmax - nmax_old) * cols[nv] * sizeof(double); + if (nbytes) memset(&atom->darray[index[nv]][nmax_old][0], 0, nbytes); } } @@ -545,7 +548,7 @@ void FixPropertyAtom::grow_arrays(int nmax) void FixPropertyAtom::copy_arrays(int i, int j, int /*delflag*/) { - int k,ncol; + int k, ncol; for (int nv = 0; nv < nvalue; nv++) { if (styles[nv] == MOLECULE) @@ -560,12 +563,10 @@ void FixPropertyAtom::copy_arrays(int i, int j, int /*delflag*/) atom->dvector[index[nv]][j] = atom->dvector[index[nv]][i]; else if (styles[nv] == IARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - atom->iarray[index[nv]][j][k] = atom->iarray[index[nv]][i][k]; + for (k = 0; k < ncol; k++) atom->iarray[index[nv]][j][k] = atom->iarray[index[nv]][i][k]; } else if (styles[nv] == DARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - atom->darray[index[nv]][j][k] = atom->darray[index[nv]][i][k]; + for (k = 0; k < ncol; k++) atom->darray[index[nv]][j][k] = atom->darray[index[nv]][i][k]; } } } @@ -576,7 +577,7 @@ void FixPropertyAtom::copy_arrays(int i, int j, int /*delflag*/) int FixPropertyAtom::pack_border(int n, int *list, double *buf) { - int i,j,k,ncol; + int i, j, k, ncol; int m = 0; for (int nv = 0; nv < nvalue; nv++) { @@ -615,16 +616,14 @@ int FixPropertyAtom::pack_border(int n, int *list, double *buf) ncol = cols[nv]; for (i = 0; i < n; i++) { j = list[i]; - for (k = 0; k < ncol; k++) - buf[m++] = ubuf(iarray[j][k]).d; + for (k = 0; k < ncol; k++) buf[m++] = ubuf(iarray[j][k]).d; } } else if (styles[nv] == DARRAY) { double **darray = atom->darray[index[nv]]; ncol = cols[nv]; for (i = 0; i < n; i++) { j = list[i]; - for (k = 0; k < ncol; k++) - buf[m++] = darray[j][k]; + for (k = 0; k < ncol; k++) buf[m++] = darray[j][k]; } } } @@ -638,49 +637,42 @@ int FixPropertyAtom::pack_border(int n, int *list, double *buf) int FixPropertyAtom::unpack_border(int n, int first, double *buf) { - int i,k,last,ncol; + int i, k, last, ncol; int m = 0; for (int nv = 0; nv < nvalue; nv++) { if (styles[nv] == MOLECULE) { tagint *molecule = atom->molecule; last = first + n; - for (i = first; i < last; i++) - molecule[i] = (tagint) ubuf(buf[m++]).i; + for (i = first; i < last; i++) molecule[i] = (tagint) ubuf(buf[m++]).i; } else if (styles[nv] == CHARGE) { double *q = atom->q; last = first + n; - for (i = first; i < last; i++) - q[i] = buf[m++]; + for (i = first; i < last; i++) q[i] = buf[m++]; } else if (styles[nv] == RMASS) { double *rmass = atom->rmass; last = first + n; - for (i = first; i < last; i++) - rmass[i] = buf[m++]; + for (i = first; i < last; i++) rmass[i] = buf[m++]; } else if (styles[nv] == IVEC) { int *ivector = atom->ivector[index[nv]]; last = first + n; - for (i = first; i < last; i++) - ivector[i] = (int) ubuf(buf[m++]).i; + for (i = first; i < last; i++) ivector[i] = (int) ubuf(buf[m++]).i; } else if (styles[nv] == DVEC) { double *dvector = atom->dvector[index[nv]]; last = first + n; - for (i = first; i < last; i++) - dvector[i] = buf[m++]; + for (i = first; i < last; i++) dvector[i] = buf[m++]; } else if (styles[nv] == IARRAY) { int **iarray = atom->iarray[index[nv]]; ncol = cols[nv]; last = first + n; for (i = first; i < last; i++) - for (k = 0; k < ncol; k++) - iarray[i][k] = (int) ubuf(buf[m++]).i; + for (k = 0; k < ncol; k++) iarray[i][k] = (int) ubuf(buf[m++]).i; } else if (styles[nv] == DARRAY) { double **darray = atom->darray[index[nv]]; ncol = cols[nv]; last = first + n; for (i = first; i < last; i++) - for (k = 0; k < ncol; k++) - darray[i][k] = buf[m++]; + for (k = 0; k < ncol; k++) darray[i][k] = buf[m++]; } } @@ -693,23 +685,26 @@ int FixPropertyAtom::unpack_border(int n, int first, double *buf) int FixPropertyAtom::pack_exchange(int i, double *buf) { - int k,ncol; + int k, ncol; int m = 0; for (int nv = 0; nv < nvalue; nv++) { - if (styles[nv] == MOLECULE) buf[m++] = ubuf(atom->molecule[i]).d; - else if (styles[nv] == CHARGE) buf[m++] = atom->q[i]; - else if (styles[nv] == RMASS) buf[m++] = atom->rmass[i]; - else if (styles[nv] == IVEC) buf[m++] = ubuf(atom->ivector[index[nv]][i]).d; - else if (styles[nv] == DVEC) buf[m++] = atom->dvector[index[nv]][i]; + if (styles[nv] == MOLECULE) + buf[m++] = ubuf(atom->molecule[i]).d; + else if (styles[nv] == CHARGE) + buf[m++] = atom->q[i]; + else if (styles[nv] == RMASS) + buf[m++] = atom->rmass[i]; + else if (styles[nv] == IVEC) + buf[m++] = ubuf(atom->ivector[index[nv]][i]).d; + else if (styles[nv] == DVEC) + buf[m++] = atom->dvector[index[nv]][i]; else if (styles[nv] == IARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - buf[m++] = ubuf(atom->iarray[index[nv]][i][k]).d; + for (k = 0; k < ncol; k++) buf[m++] = ubuf(atom->iarray[index[nv]][i][k]).d; } else if (styles[nv] == DARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - buf[m++] = atom->darray[index[nv]][i][k]; + for (k = 0; k < ncol; k++) buf[m++] = atom->darray[index[nv]][i][k]; } } @@ -722,7 +717,7 @@ int FixPropertyAtom::pack_exchange(int i, double *buf) int FixPropertyAtom::unpack_exchange(int nlocal, double *buf) { - int k,ncol; + int k, ncol; int m = 0; for (int nv = 0; nv < nvalue; nv++) { @@ -738,12 +733,10 @@ int FixPropertyAtom::unpack_exchange(int nlocal, double *buf) atom->dvector[index[nv]][nlocal] = buf[m++]; else if (styles[nv] == IARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - atom->iarray[index[nv]][nlocal][k] = (int) ubuf(buf[m++]).i; + for (k = 0; k < ncol; k++) atom->iarray[index[nv]][nlocal][k] = (int) ubuf(buf[m++]).i; } else if (styles[nv] == DARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - atom->darray[index[nv]][nlocal][k] = buf[m++]; + for (k = 0; k < ncol; k++) atom->darray[index[nv]][nlocal][k] = buf[m++]; } } @@ -756,31 +749,34 @@ int FixPropertyAtom::unpack_exchange(int nlocal, double *buf) int FixPropertyAtom::pack_restart(int i, double *buf) { - int k,ncol; + int k, ncol; // pack buf[0] this way because other fixes unpack it - buf[0] = values_peratom+1; + buf[0] = values_peratom + 1; int m = 1; for (int nv = 0; nv < nvalue; nv++) { - if (styles[nv] == MOLECULE) buf[m++] = ubuf(atom->molecule[i]).d; - else if (styles[nv] == CHARGE) buf[m++] = atom->q[i]; - else if (styles[nv] == RMASS) buf[m++] = atom->rmass[i]; - else if (styles[nv] == IVEC) buf[m++] = ubuf(atom->ivector[index[nv]][i]).d; - else if (styles[nv] == DVEC) buf[m++] = atom->dvector[index[nv]][i]; + if (styles[nv] == MOLECULE) + buf[m++] = ubuf(atom->molecule[i]).d; + else if (styles[nv] == CHARGE) + buf[m++] = atom->q[i]; + else if (styles[nv] == RMASS) + buf[m++] = atom->rmass[i]; + else if (styles[nv] == IVEC) + buf[m++] = ubuf(atom->ivector[index[nv]][i]).d; + else if (styles[nv] == DVEC) + buf[m++] = atom->dvector[index[nv]][i]; else if (styles[nv] == IARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - buf[m++] = ubuf(atom->iarray[index[nv]][i][k]).d; + for (k = 0; k < ncol; k++) buf[m++] = ubuf(atom->iarray[index[nv]][i][k]).d; } else if (styles[nv] == DARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - buf[m++] = atom->darray[index[nv]][i][k]; + for (k = 0; k < ncol; k++) buf[m++] = atom->darray[index[nv]][i][k]; } } - return values_peratom+1; + return values_peratom + 1; } /* ---------------------------------------------------------------------- @@ -789,14 +785,14 @@ int FixPropertyAtom::pack_restart(int i, double *buf) void FixPropertyAtom::unpack_restart(int nlocal, int nth) { - int k,ncol; + int k, ncol; 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]); + for (int i = 0; i < nth; i++) m += static_cast(extra[nlocal][m]); m++; for (int nv = 0; nv < nvalue; nv++) { @@ -816,8 +812,7 @@ void FixPropertyAtom::unpack_restart(int nlocal, int nth) atom->iarray[index[nv]][nlocal][k] = (int) ubuf(extra[nlocal][m++]).i; } else if (styles[nv] == DARRAY) { ncol = cols[nv]; - for (k = 0; k < ncol; k++) - atom->darray[index[nv]][nlocal][k] = extra[nlocal][m++]; + for (k = 0; k < ncol; k++) atom->darray[index[nv]][nlocal][k] = extra[nlocal][m++]; } } } @@ -828,7 +823,7 @@ void FixPropertyAtom::unpack_restart(int nlocal, int nth) int FixPropertyAtom::maxsize_restart() { - return values_peratom+1; + return values_peratom + 1; } /* ---------------------------------------------------------------------- @@ -837,5 +832,5 @@ int FixPropertyAtom::maxsize_restart() int FixPropertyAtom::size_restart(int /*nlocal*/) { - return values_peratom+1; + return values_peratom + 1; } diff --git a/src/fix_property_atom.h b/src/fix_property_atom.h index 500ad6316c..16b282913f 100644 --- a/src/fix_property_atom.h +++ b/src/fix_property_atom.h @@ -27,6 +27,7 @@ namespace LAMMPS_NS { class FixPropertyAtom : public Fix { public: FixPropertyAtom(class LAMMPS *, int, char **); + ~FixPropertyAtom() override; int setmask() override; void init() override; diff --git a/src/fix_recenter.cpp b/src/fix_recenter.cpp index 76e59014be..1f2fedc842 100644 --- a/src/fix_recenter.cpp +++ b/src/fix_recenter.cpp @@ -146,7 +146,7 @@ void FixRecenter::init() } if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp index 6b190df997..8b97715ff6 100644 --- a/src/fix_restrain.cpp +++ b/src/fix_restrain.cpp @@ -185,7 +185,7 @@ int FixRestrain::setmask() void FixRestrain::init() { if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -197,9 +197,9 @@ void FixRestrain::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp index 75b79617b6..a6e796f072 100644 --- a/src/fix_setforce.cpp +++ b/src/fix_setforce.cpp @@ -168,7 +168,7 @@ void FixSetForce::init() else varflag = CONSTANT; if (utils::strmatch(update->integrate_style,"^respa")) { - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; if (respa_level >= 0) ilevel_respa = MIN(respa_level,nlevels_respa-1); else ilevel_respa = nlevels_respa-1; } @@ -197,9 +197,9 @@ void FixSetForce::setup(int vflag) post_force(vflag); else for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { - ((Respa *) update->integrate)->copy_flevel_f(ilevel); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel); post_force_respa(vflag,ilevel,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel); } } diff --git a/src/fix_spring.cpp b/src/fix_spring.cpp index dc3001c0fc..46310ef181 100644 --- a/src/fix_spring.cpp +++ b/src/fix_spring.cpp @@ -130,7 +130,7 @@ void FixSpring::init() if (styleflag == COUPLE) masstotal2 = group->mass(igroup2); if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -142,9 +142,9 @@ void FixSpring::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_spring_chunk.cpp b/src/fix_spring_chunk.cpp index 90db93b9ad..411f056645 100644 --- a/src/fix_spring_chunk.cpp +++ b/src/fix_spring_chunk.cpp @@ -68,7 +68,7 @@ FixSpringChunk::~FixSpringChunk() int icompute = modify->find_compute(idchunk); if (icompute >= 0) { - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); cchunk->unlock(this); cchunk->lockcount--; } @@ -97,14 +97,14 @@ void FixSpringChunk::init() int icompute = modify->find_compute(idchunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for fix spring/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Fix spring/chunk does not use chunk/atom compute"); icompute = modify->find_compute(idcom); if (icompute < 0) error->all(FLERR,"Com/chunk compute does not exist for fix spring/chunk"); - ccom = (ComputeCOMChunk *) modify->compute[icompute]; + ccom = dynamic_cast( modify->compute[icompute]); if (strcmp(ccom->style,"com/chunk") != 0) error->all(FLERR,"Fix spring/chunk does not use com/chunk compute"); @@ -114,7 +114,7 @@ void FixSpringChunk::init() error->all(FLERR,"Fix spring chunk chunkID not same as comID chunkID"); if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -126,9 +126,9 @@ void FixSpringChunk::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } @@ -262,7 +262,7 @@ void FixSpringChunk::write_restart(FILE *fp) void FixSpringChunk::restart(char *buf) { - double *list = (double *) buf; + auto list = (double *) buf; int n = list[0]; memory->destroy(com0); @@ -271,7 +271,7 @@ void FixSpringChunk::restart(char *buf) int icompute = modify->find_compute(idchunk); if (icompute < 0) error->all(FLERR,"Chunk/atom compute does not exist for fix spring/chunk"); - cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + cchunk = dynamic_cast( modify->compute[icompute]); if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Fix spring/chunk does not use chunk/atom compute"); nchunk = cchunk->setup_chunks(); diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index 5ea8bffd01..180f7427ec 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -122,7 +122,7 @@ int FixSpringSelf::setmask() void FixSpringSelf::init() { if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -134,9 +134,9 @@ void FixSpringSelf::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_store.cpp b/src/fix_store.cpp index eb23fbad97..759e71a955 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -187,7 +187,7 @@ void FixStore::restart(char *buf) { // first 2 values in buf are vec/array sizes - double *dbuf = (double *) buf; + auto dbuf = (double *) buf; int nrow_restart = dbuf[0]; int ncol_restart = dbuf[1]; diff --git a/src/fix_store_force.cpp b/src/fix_store_force.cpp index f7832cd599..8e696c075c 100644 --- a/src/fix_store_force.cpp +++ b/src/fix_store_force.cpp @@ -70,7 +70,7 @@ int FixStoreForce::setmask() void FixStoreForce::init() { if (utils::strmatch(update->integrate_style,"^respa")) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + nlevels_respa = (dynamic_cast( update->integrate))->nlevels; } /* ---------------------------------------------------------------------- */ @@ -80,9 +80,9 @@ void FixStoreForce::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_flevel_f(nlevels_respa-1); post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + (dynamic_cast( update->integrate))->copy_f_flevel(nlevels_respa-1); } } diff --git a/src/fix_store_local.cpp b/src/fix_store_local.cpp new file mode 100644 index 0000000000..a61e8b58b0 --- /dev/null +++ b/src/fix_store_local.cpp @@ -0,0 +1,125 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/ 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 "fix_store_local.h" + +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "memory.h" +#include "update.h" + +using namespace LAMMPS_NS; +using namespace FixConst; + +#define DELTA 1024 + +/* ---------------------------------------------------------------------- */ + +FixStoreLocal::FixStoreLocal(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg), nvalues(0), vector(nullptr), array(nullptr) +{ + if (narg != 5) error->all(FLERR, "Illegal fix store/local command"); + local_flag = 1; + + nreset = utils::inumeric(FLERR, arg[3], false, lmp); + if (nreset <= 0) error->all(FLERR, "Illegal fix store/local command"); + local_freq = nreset; + + nvalues = utils::inumeric(FLERR, arg[4], false, lmp); + + if (nvalues <= 0) error->all(FLERR, "Illegal fix store/local command"); + if (nvalues == 1) + size_local_cols = 0; + else + size_local_cols = nvalues; + size_local_rows = 0; + + vector = nullptr; + array = nullptr; + nmax = 0; + ncount = 0; +} + +/* ---------------------------------------------------------------------- */ + +FixStoreLocal::~FixStoreLocal() +{ + memory->destroy(vector); + memory->destroy(array); +} + +/* ---------------------------------------------------------------------- */ + +int FixStoreLocal::setmask() +{ + int mask = 0; + mask |= POST_FORCE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixStoreLocal::add_data(double *input_data, int i, int j) +{ + int *mask = atom->mask; + if (!(mask[i] & groupbit)) return; + if (!(mask[j] & groupbit)) return; + + if (ncount >= nmax) reallocate(ncount); + + // fill vector or array with local values + if (nvalues == 1) { + vector[ncount] = input_data[0]; + } else { + for (int n = 0; n < nvalues; n++) array[ncount][n] = input_data[n]; + } + + ncount += 1; +} + +/* ---------------------------------------------------------------------- */ + +void FixStoreLocal::post_force(int /*vflag*/) +{ + if (update->ntimestep % nreset == 0) { + size_local_rows = ncount; + ncount = 0; + } +} + +/* ---------------------------------------------------------------------- */ + +void FixStoreLocal::reallocate(int n) +{ + // grow vector or array + while (nmax <= n) nmax += DELTA; + + if (nvalues == 1) { + memory->grow(vector, nmax, "fix_store_local:vector"); + vector_local = vector; + } else { + memory->grow(array, nmax, nvalues, "fix_store_local:array"); + array_local = array; + } +} + +/* ---------------------------------------------------------------------- + memory usage of local data +------------------------------------------------------------------------- */ + +double FixStoreLocal::memory_usage() +{ + double bytes = (double) nmax * (double) nvalues * sizeof(double); + return bytes; +} diff --git a/src/MISC/fix_pair_tracker.h b/src/fix_store_local.h similarity index 60% rename from src/MISC/fix_pair_tracker.h rename to src/fix_store_local.h index a9743b3b50..dc9d83b9dd 100644 --- a/src/MISC/fix_pair_tracker.h +++ b/src/fix_store_local.h @@ -13,56 +13,37 @@ #ifdef FIX_CLASS // clang-format off -FixStyle(pair/tracker,FixPairTracker); +FixStyle(STORE_LOCAL,FixStoreLocal); // clang-format on #else -#ifndef LMP_FIX_PAIR_TRACKING_H -#define LMP_FIX_PAIR_TRACKING_H +#ifndef LMP_FIX_STORE_LOCAL_H +#define LMP_FIX_STORE_LOCAL_H #include "fix.h" namespace LAMMPS_NS { -class FixPairTracker : public Fix { +class FixStoreLocal : public Fix { public: - FixPairTracker(class LAMMPS *, int, char **); - ~FixPairTracker() override; + FixStoreLocal(class LAMMPS *, int, char **); + ~FixStoreLocal() override; int setmask() override; - void init() override; void post_force(int) override; double memory_usage() override; - void lost_contact(int, int, double, double, double, double); + void add_data(double *, int, int); + int nvalues; private: - int nvalues, nmax; - int index_i, index_j; - double tmin, rmin, rsum, time_initial, nstep_initial; + int nmax; double *vector; double **array; - int **type_filter; int ncount; + int nreset; void reallocate(int); - - typedef void (FixPairTracker::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions - - void pack_id1(int); - void pack_id2(int); - - void pack_time_created(int); - void pack_time_broken(int); - void pack_time_total(int); - - void pack_x(int); - void pack_y(int); - void pack_z(int); - - void pack_rmin(int); - void pack_rave(int); }; } // namespace LAMMPS_NS @@ -78,8 +59,13 @@ Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. -E: Invalid keyword in fix pair/tracker command +E: Invalid keyword in fix store/local command Self-explanatory. +E: Unused instance of fix store/local + +Instance of fix store/local is not associated with any other LAMMPS +class such as a bond style, pair style, etc. + */ diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp index 19ec4b52bd..26c14e842d 100644 --- a/src/fix_temp_berendsen.cpp +++ b/src/fix_temp_berendsen.cpp @@ -258,7 +258,7 @@ void FixTempBerendsen::write_restart(FILE *fp) void FixTempBerendsen::restart(char *buf) { - double *list = (double *) buf; + auto list = (double *) buf; energy = list[0]; } diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index 2b3db70d4b..41fb49e3f4 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -256,7 +256,7 @@ void FixTempRescale::write_restart(FILE *fp) void FixTempRescale::restart(char *buf) { int n = 0; - double *list = (double *) buf; + auto list = (double *) buf; energy = list[n++]; } diff --git a/src/fix_update_special_bonds.cpp b/src/fix_update_special_bonds.cpp new file mode 100644 index 0000000000..c31aefd28d --- /dev/null +++ b/src/fix_update_special_bonds.cpp @@ -0,0 +1,176 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, 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 "fix_update_special_bonds.h" + +#include "atom.h" +#include "atom_vec.h" +#include "error.h" +#include "force.h" +#include "neigh_list.h" +#include "neighbor.h" +#include "pair.h" + +#include + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixUpdateSpecialBonds::FixUpdateSpecialBonds(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg) +{ + if (narg != 3) error->all(FLERR, "Illegal fix update/special/bonds command"); +} + +/* ---------------------------------------------------------------------- */ + +int FixUpdateSpecialBonds::setmask() +{ + int mask = 0; + mask |= PRE_EXCHANGE; + mask |= PRE_FORCE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixUpdateSpecialBonds::setup(int /*vflag*/) +{ + // Require atoms know about all of their bonds and if they break + if (force->newton_bond) error->all(FLERR, "Fix update/special/bonds requires Newton bond off"); + + if (!atom->avec->bonds_allow) error->all(FLERR, "Fix update/special/bonds requires atom bonds"); + + // special lj must be 0 1 1 to censor pair forces between bonded particles + // special coulomb must be 1 1 1 to ensure all pairs are included in the + // neighbor list and 1-3 and 1-4 special bond lists are skipped + if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 || force->special_lj[3] != 1.0) + error->all(FLERR, "Fix update/special/bonds requires special LJ weights = 0,1,1"); + if (force->special_coul[1] != 1.0 || force->special_coul[2] != 1.0 || + force->special_coul[3] != 1.0) + error->all(FLERR, "Fix update/special/bonds requires special Coulomb weights = 1,1,1"); + + new_broken_pairs.clear(); + broken_pairs.clear(); +} + +/* ---------------------------------------------------------------------- + Update special bond list and atom bond arrays, empty broken bond list +------------------------------------------------------------------------- */ + +void FixUpdateSpecialBonds::pre_exchange() +{ + int i, j, m, n1, n3; + tagint tagi, tagj; + int nlocal = atom->nlocal; + + tagint *slist; + int **nspecial = atom->nspecial; + tagint **special = atom->special; + + for (auto const &it : broken_pairs) { + tagi = it.first; + tagj = it.second; + + i = atom->map(tagi); + j = atom->map(tagj); + + // remove i from special bond list for atom j and vice versa + if (i < nlocal) { + slist = special[i]; + n1 = nspecial[i][0]; + for (m = 0; m < n1; m++) + if (slist[m] == tagj) break; + n3 = nspecial[i][2]; + for (; m < n3 - 1; m++) slist[m] = slist[m + 1]; + nspecial[i][0]--; + nspecial[i][1]--; + nspecial[i][2]--; + } + + if (j < nlocal) { + slist = special[j]; + n1 = nspecial[j][0]; + for (m = 0; m < n1; m++) + if (slist[m] == tagi) break; + n3 = nspecial[j][2]; + for (; m < n3 - 1; m++) slist[m] = slist[m + 1]; + nspecial[j][0]--; + nspecial[j][1]--; + nspecial[j][2]--; + } + } + + broken_pairs.clear(); +} + +/* ---------------------------------------------------------------------- + Loop neighbor list and update special bond lists for recently broken bonds +------------------------------------------------------------------------- */ + +void FixUpdateSpecialBonds::pre_force(int /*vflag*/) +{ + int i1, i2, j, jj, jnum; + int *jlist, *numneigh, **firstneigh; + tagint tag1, tag2; + + int nlocal = atom->nlocal; + + tagint *tag = atom->tag; + NeighList *list = force->pair->list; // may need to be generalized to work with pair hybrid* + numneigh = list->numneigh; + firstneigh = list->firstneigh; + + // In theory could communicate a list of broken bonds to neighboring processors here + // to remove restriction that users use Newton bond off + + for (auto const &it : new_broken_pairs) { + tag1 = it.first; + tag2 = it.second; + i1 = atom->map(tag1); + i2 = atom->map(tag2); + + // Loop through atoms of owned atoms i j + if (i1 < nlocal) { + jlist = firstneigh[i1]; + jnum = numneigh[i1]; + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + j &= SPECIALMASK; // Clear special bond bits + if (tag[j] == tag2) jlist[jj] = j; + } + } + + if (i2 < nlocal) { + jlist = firstneigh[i2]; + jnum = numneigh[i2]; + for (jj = 0; jj < jnum; jj++) { + j = jlist[jj]; + j &= SPECIALMASK; // Clear special bond bits + if (tag[j] == tag1) jlist[jj] = j; + } + } + } + new_broken_pairs.clear(); +} + +/* ---------------------------------------------------------------------- */ + +void FixUpdateSpecialBonds::add_broken_bond(int i, int j) +{ + auto tag_pair = std::make_pair(atom->tag[i], atom->tag[j]); + new_broken_pairs.push_back(tag_pair); + broken_pairs.push_back(tag_pair); +} diff --git a/src/fix_update_special_bonds.h b/src/fix_update_special_bonds.h new file mode 100644 index 0000000000..d6cf2fb837 --- /dev/null +++ b/src/fix_update_special_bonds.h @@ -0,0 +1,73 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + https://www.lammps.org/, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS +// clang-format off +FixStyle(UPDATE_SPECIAL_BONDS,FixUpdateSpecialBonds); +// clang-format on +#else + +#ifndef LMP_FIX_UPDATE_SPECIAL_BONDS_H +#define LMP_FIX_UPDATE_SPECIAL_BONDS_H + +#include "fix.h" + +#include +#include + +namespace LAMMPS_NS { + +class FixUpdateSpecialBonds : public Fix { + public: + FixUpdateSpecialBonds(class LAMMPS *, int, char **); + int setmask() override; + void setup(int) override; + void pre_exchange() override; + void pre_force(int) override; + void add_broken_bond(int, int); + + protected: + // Create two arrays to store bonds broken this timestep (new) + // and since the last neighbor list build + std::vector> new_broken_pairs; + std::vector> broken_pairs; +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal fix censor/bonded/pairs command + +Self-explanatory. + +E: Fix censor/bonded/pairs requires Newton bond off + +Self-explanatory. + +E: Fix censor/bonded/pairs requires atom bonds + +Self-explanatory. + +E: Fix censor/bonded/pairs must be used without special bonds + +Self-explanatory. Look at the atom modify special command. + +E: Fix censor/bonded/pairs requires special_bonds = 0,0,0 + +Self-explanatory. + +*/ diff --git a/src/fix_viscous.cpp b/src/fix_viscous.cpp index a13100ee48..f0c6faa419 100644 --- a/src/fix_viscous.cpp +++ b/src/fix_viscous.cpp @@ -82,7 +82,7 @@ void FixViscous::init() int max_respa = 0; if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = max_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = max_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,max_respa); } } @@ -94,9 +94,9 @@ void FixViscous::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index 0c3623857e..2156ac321c 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -261,7 +261,7 @@ void FixWall::init() for (int m = 0; m < nwall; m++) precompute(m); if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -273,9 +273,9 @@ void FixWall::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) { if (!fldflag) post_force(vflag); } else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp index 909f777dce..8f5a27e4a5 100644 --- a/src/fix_wall_region.cpp +++ b/src/fix_wall_region.cpp @@ -189,7 +189,7 @@ void FixWallRegion::init() } if (utils::strmatch(update->integrate_style,"^respa")) { - ilevel_respa = ((Respa *) update->integrate)->nlevels-1; + ilevel_respa = (dynamic_cast( update->integrate))->nlevels-1; if (respa_level >= 0) ilevel_respa = MIN(respa_level,ilevel_respa); } } @@ -201,9 +201,9 @@ void FixWallRegion::setup(int vflag) if (utils::strmatch(update->integrate_style,"^verlet")) post_force(vflag); else { - ((Respa *) update->integrate)->copy_flevel_f(ilevel_respa); + (dynamic_cast( update->integrate))->copy_flevel_f(ilevel_respa); post_force_respa(vflag,ilevel_respa,0); - ((Respa *) update->integrate)->copy_f_flevel(ilevel_respa); + (dynamic_cast( update->integrate))->copy_f_flevel(ilevel_respa); } } diff --git a/src/force.cpp b/src/force.cpp index 35bd8644ee..40c4eff92e 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -223,7 +223,7 @@ void Force::create_pair(const std::string &style, int trysuffix) { delete[] pair_style; if (pair) delete pair; - if (pair_restart) delete[] pair_restart; + delete[] pair_restart; pair_style = nullptr; pair = nullptr; pair_restart = nullptr; @@ -298,7 +298,7 @@ Pair *Force::pair_match(const std::string &word, int exact, int nsub) else if (!exact && utils::strmatch(pair_style, word)) return pair; else if (utils::strmatch(pair_style, "^hybrid")) { - PairHybrid *hybrid = (PairHybrid *) pair; + auto hybrid = dynamic_cast( pair); count = 0; for (int i = 0; i < hybrid->nstyles; i++) if ((exact && (word == hybrid->keywords[i])) || @@ -324,7 +324,7 @@ char *Force::pair_match_ptr(Pair *ptr) if (ptr == pair) return pair_style; if (utils::strmatch(pair_style, "^hybrid")) { - PairHybrid *hybrid = (PairHybrid *) pair; + auto hybrid = dynamic_cast( pair); for (int i = 0; i < hybrid->nstyles; i++) if (ptr == hybrid->styles[i]) return hybrid->keywords[i]; } @@ -393,7 +393,7 @@ Bond *Force::bond_match(const std::string &style) if (style == bond_style) return bond; else if (strcmp(bond_style, "hybrid") == 0) { - BondHybrid *hybrid = (BondHybrid *) bond; + auto hybrid = dynamic_cast( bond); for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } @@ -461,7 +461,7 @@ Angle *Force::angle_match(const std::string &style) if (style == angle_style) return angle; else if (utils::strmatch(angle_style, "^hybrid")) { - AngleHybrid *hybrid = (AngleHybrid *) angle; + auto hybrid = dynamic_cast( angle); for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } @@ -529,7 +529,7 @@ Dihedral *Force::dihedral_match(const std::string &style) if (style == dihedral_style) return dihedral; else if (utils::strmatch(dihedral_style, "^hybrid")) { - DihedralHybrid *hybrid = (DihedralHybrid *) dihedral; + auto hybrid = dynamic_cast( dihedral); for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } @@ -597,7 +597,7 @@ Improper *Force::improper_match(const std::string &style) if (style == improper_style) return improper; else if (utils::strmatch(improper_style, "^hybrid")) { - ImproperHybrid *hybrid = (ImproperHybrid *) improper; + auto hybrid = dynamic_cast( improper); for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } diff --git a/src/gridcomm.cpp b/src/gridcomm.cpp index dcf5fc6fe2..57cbb130f5 100644 --- a/src/gridcomm.cpp +++ b/src/gridcomm.cpp @@ -609,10 +609,9 @@ void GridComm::setup_tiled(int &nbuf1, int &nbuf2) } } - Irregular *irregular = new Irregular(lmp); + auto irregular = new Irregular(lmp); int nrecv_request = irregular->create_data(nsend_request,proclist,1); - Request *rrequest = - (Request *) memory->smalloc(nrecv_request*sizeof(Request),"GridComm:rrequest"); + auto rrequest = (Request *) memory->smalloc(nrecv_request*sizeof(Request),"GridComm:rrequest"); irregular->exchange_data((char *) srequest,sizeof(Request),(char *) rrequest); irregular->destroy_data(); @@ -620,8 +619,7 @@ void GridComm::setup_tiled(int &nbuf1, int &nbuf2) // overlap box used to setup my Send data struct and respond to requests send = (Send *) memory->smalloc(nrecv_request*sizeof(Send),"GridComm:send"); - sresponse = (Response *) - memory->smalloc(nrecv_request*sizeof(Response),"GridComm:sresponse"); + sresponse = (Response *) memory->smalloc(nrecv_request*sizeof(Response),"GridComm:sresponse"); memory->destroy(proclist); memory->create(proclist,nrecv_request,"GridComm:proclist"); @@ -652,8 +650,7 @@ void GridComm::setup_tiled(int &nbuf1, int &nbuf2) int nsend_response = nrecv_request; int nrecv_response = irregular->create_data(nsend_response,proclist,1); - Response *rresponse = - (Response *) memory->smalloc(nrecv_response*sizeof(Response),"GridComm:rresponse"); + auto rresponse = (Response *) memory->smalloc(nrecv_response*sizeof(Response),"GridComm:rresponse"); irregular->exchange_data((char *) sresponse,sizeof(Response),(char *) rresponse); irregular->destroy_data(); delete irregular; @@ -992,7 +989,7 @@ forward_comm_tiled(T *ptr, int nper, int nbyte, int which, { int i,m,offset; - char *buf2 = (char *) vbuf2; + auto buf2 = (char *) vbuf2; // post all receives @@ -1091,7 +1088,7 @@ reverse_comm_tiled(T *ptr, int nper, int nbyte, int which, { int i,m,offset; - char *buf2 = (char *) vbuf2; + auto buf2 = (char *) vbuf2; // post all receives diff --git a/src/group.cpp b/src/group.cpp index 0dc0a560dd..9aec2c8382 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -675,8 +675,8 @@ void Group::add_molecules(int /*igroup*/, int bit) void Group::molring(int n, char *cbuf, void *ptr) { - Group *gptr = (Group *) ptr; - tagint *list = (tagint *) cbuf; + auto gptr = (Group *) ptr; + auto list = (tagint *) cbuf; std::map *hash = gptr->hash; int nlocal = gptr->atom->nlocal; tagint *molecule = gptr->atom->molecule; diff --git a/src/hashlittle.cpp b/src/hashlittle.cpp index 3aeb0825de..37f8cf03b1 100644 --- a/src/hashlittle.cpp +++ b/src/hashlittle.cpp @@ -153,7 +153,7 @@ uint32_t LAMMPS_NS::hashlittle(const void *key, size_t length, uint32_t initval) u.ptr = key; if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) { - const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */ + const uint32_t *k = (const uint32_t *)key; /* NOLINT read 32-bit chunks */ /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */ while (length > 12) @@ -197,7 +197,7 @@ uint32_t LAMMPS_NS::hashlittle(const void *key, size_t length, uint32_t initval) #else /* make valgrind happy */ - const uint8_t *k8 = (const uint8_t *)k; + const uint8_t *k8 = (const uint8_t *)k; /* NOLINT */ switch(length) { case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; @@ -218,7 +218,7 @@ uint32_t LAMMPS_NS::hashlittle(const void *key, size_t length, uint32_t initval) #endif /* !valgrind */ } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { - const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */ + const uint16_t *k = (const uint16_t *)key; /* NOLINT read 16-bit chunks */ const uint8_t *k8; /*--------------- all but last block: aligned reads and different mixing */ @@ -233,7 +233,7 @@ uint32_t LAMMPS_NS::hashlittle(const void *key, size_t length, uint32_t initval) } /*----------------------------- handle the last (probably partial) block */ - k8 = (const uint8_t *)k; + k8 = (const uint8_t *)k; /* NOLINT */ switch(length) { case 12: c+=k[4]+(((uint32_t)k[5])<<16); @@ -265,7 +265,7 @@ uint32_t LAMMPS_NS::hashlittle(const void *key, size_t length, uint32_t initval) } } else { /* need to read the key one byte at a time */ - const uint8_t *k = (const uint8_t *)key; + const uint8_t *k = (const uint8_t *)key; /* NOLINT */ /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ while (length > 12) diff --git a/src/image.cpp b/src/image.cpp index ee686bd653..b542290e0d 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -1105,7 +1105,7 @@ void Image::write_PNG(FILE *fp) png_set_text(png_ptr,info_ptr,text_ptr,1); png_write_info(png_ptr,info_ptr); - png_bytep *row_pointers = new png_bytep[height]; + auto row_pointers = new png_bytep[height]; for (int i=0; i < height; ++i) row_pointers[i] = (png_bytep) &writeBuffer[(height-i-1)*3*width]; diff --git a/src/improper_deprecated.cpp b/src/improper_deprecated.cpp index 7e03825346..b1e3d3511b 100644 --- a/src/improper_deprecated.cpp +++ b/src/improper_deprecated.cpp @@ -37,7 +37,7 @@ void ImproperDeprecated::settings(int, char **) // of the list of substyles if (utils::strmatch(my_style,"^hybrid")) { - ImproperHybrid *hybrid = (ImproperHybrid *)force->improper; + auto hybrid = dynamic_cast(force->improper); my_style = hybrid->keywords[hybrid->nstyles]; } diff --git a/src/info.cpp b/src/info.cpp index 1beadff753..5e53864253 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -414,7 +414,7 @@ void Info::command(int narg, char **arg) atom->natoms, atom->ntypes, force->pair_style); if (force->pair && utils::strmatch(force->pair_style,"^hybrid")) { - PairHybrid *hybrid = (PairHybrid *)force->pair; + auto hybrid = dynamic_cast(force->pair); fmt::print(out,"Hybrid sub-styles:"); for (int i=0; i < hybrid->nstyles; ++i) fmt::print(out," {}", hybrid->keywords[i]); @@ -785,13 +785,13 @@ bool Info::is_active(const char *category, const char *name) if (strcmp(category,"package") == 0) { if (strcmp(name,"gpu") == 0) { - return (modify->get_fix_by_id("package_gpu")) ? true : false; + return modify->get_fix_by_id("package_gpu") != nullptr; } else if (strcmp(name,"intel") == 0) { - return (modify->get_fix_by_id("package_intel")) ? true : false; + return modify->get_fix_by_id("package_intel") != nullptr; } else if (strcmp(name,"kokkos") == 0) { - return (lmp->kokkos && lmp->kokkos->kokkos_exists) ? true : false; + return lmp->kokkos && lmp->kokkos->kokkos_exists; } else if (strcmp(name,"omp") == 0) { - return (modify->get_fix_by_id("package_omp")) ? true : false; + return modify->get_fix_by_id("package_omp") != nullptr; } else error->all(FLERR,"Unknown name for info package category: {}", name); } else if (strcmp(category,"newton") == 0) { @@ -1053,7 +1053,7 @@ static void print_columns(FILE *fp, std::map *styles) // std::map keys are already sorted int pos = 80; - for (typename std::map::iterator it = styles->begin(); it != styles->end(); ++it) { + for (auto it = styles->begin(); it != styles->end(); ++it) { const std::string &style_name = it->first; // skip "internal" styles diff --git a/src/input.cpp b/src/input.cpp index 689c016b68..6c4fc56776 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -168,7 +168,7 @@ Input::~Input() memory->sfree(line); memory->sfree(copy); memory->sfree(work); - if (labelstr) delete[] labelstr; + delete[] labelstr; memory->sfree(arg); delete[] infiles; delete variable; @@ -891,7 +891,7 @@ void Input::ifthenelse() int ncommands = last-first + 1; if (ncommands <= 0) error->all(FLERR,"Illegal if command"); - char **commands = new char*[ncommands]; + auto commands = new char*[ncommands]; ncommands = 0; for (int i = first; i <= last; i++) { n = strlen(arg[i]) + 1; @@ -944,7 +944,7 @@ void Input::ifthenelse() int ncommands = last-first + 1; if (ncommands <= 0) error->all(FLERR,"Illegal if command"); - char **commands = new char*[ncommands]; + auto commands = new char*[ncommands]; ncommands = 0; for (int i = first; i <= last; i++) { n = strlen(arg[i]) + 1; @@ -1026,7 +1026,7 @@ void Input::jump() if (narg == 2) { label_active = 1; - if (labelstr) delete[] labelstr; + delete[] labelstr; labelstr = utils::strdup(arg[1]); } } diff --git a/src/library.cpp b/src/library.cpp index c2ae52a809..8ab97321ba 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -290,7 +290,7 @@ multiple LAMMPS instances concurrently or sequentially. See void lammps_close(void *handle) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; delete lmp; } @@ -440,7 +440,7 @@ and :cpp:func:`Input::file()`. void lammps_file(void *handle, const char *filename) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -477,7 +477,7 @@ passing a string without a command. char *lammps_command(void *handle, const char *cmd) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; char *result = nullptr; BEGIN_CAPTURE @@ -548,7 +548,7 @@ executing. void lammps_commands_string(void *handle, const char *str) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; // copy str and convert from CR-LF (DOS-style) to LF (Unix style) line int n = strlen(str); @@ -624,9 +624,9 @@ the size of a ``bigint`` integer. double lammps_get_natoms(void *handle) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; - double natoms = static_cast(lmp->atom->natoms); + auto natoms = static_cast(lmp->atom->natoms); if (natoms > 9.0e15) return 0; // TODO:XXX why not -1? return natoms; } @@ -650,7 +650,7 @@ a ``double``, so it can also return information that is computed on-the-fly. double lammps_get_thermo(void *handle, const char *keyword) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; double dval = 0.0; BEGIN_CAPTURE @@ -690,7 +690,7 @@ void lammps_extract_box(void *handle, double *boxlo, double *boxhi, double *xy, double *yz, double *xz, int *pflags, int *boxflag) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; Domain *domain = lmp->domain; BEGIN_CAPTURE @@ -752,7 +752,7 @@ are created. void lammps_reset_box(void *handle, double *boxlo, double *boxhi, double xy, double yz, double xz) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; Domain *domain = lmp->domain; BEGIN_CAPTURE @@ -813,7 +813,7 @@ system it will be set to zero. void lammps_memory_usage(void *handle, double *meminfo) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; Info info(lmp); info.get_memory_info(meminfo); } @@ -993,7 +993,7 @@ not recognized, the function returns -1. int lammps_extract_setting(void *handle, const char *keyword) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; // This can be customized by adding keywords and documenting them in the section above. if (strcmp(keyword,"bigint") == 0) return sizeof(bigint); @@ -1438,7 +1438,7 @@ report the "native" data type. The following tables are provided: void *lammps_extract_global(void *handle, const char *name) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; if (strcmp(name,"units") == 0) return (void *) lmp->update->unit_style; if (strcmp(name,"dt") == 0) return (void *) &lmp->update->dt; @@ -1450,7 +1450,7 @@ void *lammps_extract_global(void *handle, const char *name) if (strcmp(name,"atimestep") == 0) return (void *) &lmp->update->atimestep; if (utils::strmatch(lmp->update->integrate_style,"^respa")) { - Respa *respa = (Respa *)lmp->update->integrate; + auto respa = dynamic_cast(lmp->update->integrate); if (strcmp(name,"respa_levels") == 0) return (void *) &respa->nlevels; if (strcmp(name,"respa_dt") == 0) return (void *) respa->step; } @@ -1537,7 +1537,7 @@ to then decide how to cast the (void*) pointer and access the data. int lammps_extract_atom_datatype(void *handle, const char *name) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; return lmp->atom->extract_datatype(name); } @@ -1571,7 +1571,7 @@ of the :cpp:func:`Atom::extract() ` function. void *lammps_extract_atom(void *handle, const char *name) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; return lmp->atom->extract(name); } @@ -1685,7 +1685,7 @@ lists the available options. void *lammps_extract_compute(void *handle, const char *id, int style, int type) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -1871,7 +1871,7 @@ The following table lists the available options. void *lammps_extract_fix(void *handle, const char *id, int style, int type, int nrow, int ncol) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -1881,19 +1881,19 @@ void *lammps_extract_fix(void *handle, const char *id, int style, int type, if (style == LMP_STYLE_GLOBAL) { if (type == LMP_TYPE_SCALAR) { if (!fix->scalar_flag) return nullptr; - double *dptr = (double *) malloc(sizeof(double)); + auto dptr = (double *) malloc(sizeof(double)); *dptr = fix->compute_scalar(); return (void *) dptr; } if (type == LMP_TYPE_VECTOR) { if (!fix->vector_flag) return nullptr; - double *dptr = (double *) malloc(sizeof(double)); + auto dptr = (double *) malloc(sizeof(double)); *dptr = fix->compute_vector(nrow); return (void *) dptr; } if (type == LMP_TYPE_ARRAY) { if (!fix->array_flag) return nullptr; - double *dptr = (double *) malloc(sizeof(double)); + auto dptr = (double *) malloc(sizeof(double)); *dptr = fix->compute_array(nrow,ncol); return (void *) dptr; } @@ -1995,7 +1995,7 @@ a char pointer. void *lammps_extract_variable(void *handle, const char *name, const char *group) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -2003,7 +2003,7 @@ void *lammps_extract_variable(void *handle, const char *name, const char *group) if (ivar < 0) return nullptr; if (lmp->input->variable->equalstyle(ivar)) { - double *dptr = (double *) malloc(sizeof(double)); + auto dptr = (double *) malloc(sizeof(double)); *dptr = lmp->input->variable->compute_equal(ivar); return (void *) dptr; } else if (lmp->input->variable->atomstyle(ivar)) { @@ -2011,7 +2011,7 @@ void *lammps_extract_variable(void *handle, const char *name, const char *group) int igroup = lmp->group->find(group); if (igroup < 0) return nullptr; int nlocal = lmp->atom->nlocal; - double *vector = (double *) malloc(nlocal*sizeof(double)); + auto vector = (double *) malloc(nlocal*sizeof(double)); lmp->input->variable->compute_atom(ivar,igroup,vector,1,0); return (void *) vector; } else { @@ -2039,7 +2039,7 @@ void *lammps_extract_variable(void *handle, const char *name, const char *group) */ int lammps_set_variable(void *handle, char *name, char *str) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; int err = -1; BEGIN_CAPTURE @@ -2078,7 +2078,7 @@ int lammps_set_variable(void *handle, char *name, char *str) void lammps_gather_atoms(void *handle, char *name, int type, int count, void *data) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -2213,7 +2213,7 @@ void lammps_gather_atoms(void *handle, char *name, int type, int count, void *da void lammps_gather_atoms_concat(void *handle, char *name, int type, int count, void *data) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -2362,7 +2362,7 @@ void lammps_gather_atoms_concat(void *handle, char *name, int type, int count, v void lammps_gather_atoms_subset(void *handle, char *name, int type, int count, int ndata, int *ids, void *data) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -2500,7 +2500,7 @@ void lammps_gather_atoms_subset(void *handle, char *name, int type, int count, void lammps_scatter_atoms(void *handle, char *name, int type, int count, void *data) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -2576,7 +2576,7 @@ void lammps_scatter_atoms(void *handle, char *name, int type, int count, void *d double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; - double *dptr = (double *) data; + auto dptr = (double *) data; if (count == 1) { for (i = 0; i < natoms; i++) @@ -2619,7 +2619,7 @@ void lammps_scatter_atoms(void *handle, char *name, int type, int count, void *d void lammps_scatter_atoms_subset(void *handle, char *name, int type, int count, int ndata, int *ids, void *data) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -2699,7 +2699,7 @@ void lammps_scatter_atoms_subset(void *handle, char *name, int type, int count, double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; - double *dptr = (double *) data; + auto dptr = (double *) data; if (count == 1) { for (i = 0; i < ndata; i++) { @@ -2800,7 +2800,7 @@ Below is a brief C code demonstrating accessing this collected bond information. void lammps_gather_bonds(void *handle, void *data) { - LAMMPS *lmp = (LAMMPS *)handle; + auto lmp = (LAMMPS *)handle; BEGIN_CAPTURE { void *val = lammps_extract_global(handle,"nbonds"); bigint nbonds = *(bigint *)val; @@ -2861,7 +2861,7 @@ void lammps_gather_bonds(void *handle, void *data) void lammps_gather(void *handle, char *name, int type, int count, void *data) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -3096,7 +3096,7 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data) void lammps_gather_concat(void *handle, char *name, int type, int count, void *data) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -3350,7 +3350,7 @@ void lammps_gather_subset(void *handle, char *name, int type, int count, int ndata, int *ids, void *data) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -3596,7 +3596,7 @@ void lammps_gather_subset(void *handle, char *name, void lammps_scatter(void *handle, char *name, int type, int count, void *data) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -3767,7 +3767,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data) double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; - double *dptr = (double *) data; + auto dptr = (double *) data; if (count == 1) { for (i = 0; i < natoms; i++) @@ -3814,7 +3814,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data) void lammps_scatter_subset(void *handle, char *name,int type, int count, int ndata, int *ids, void *data) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -3991,7 +3991,7 @@ void lammps_scatter_subset(void *handle, char *name,int type, int count, double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; - double *dptr = (double *) data; + auto dptr = (double *) data; if (count == 1) { for (i = 0; i < ndata; i++) { @@ -4074,7 +4074,7 @@ int lammps_create_atoms(void *handle, int n, const tagint *id, const int *type, const double *x, const double *v, const imageint *image, int bexpand) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; bigint natoms_prev = lmp->atom->natoms; BEGIN_CAPTURE @@ -4196,7 +4196,7 @@ int lammps_create_atoms(void *handle, int n, const tagint *id, const int *type, * \return return neighbor list index if found, otherwise -1 */ int lammps_find_pair_neighlist(void *handle, const char *style, int exact, int nsub, int reqid) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; Pair *pair = lmp->force->pair_match(style, exact, nsub); if (pair != nullptr) { @@ -4226,7 +4226,7 @@ int lammps_find_pair_neighlist(void *handle, const char *style, int exact, int n * \return return neighbor list index if found, otherwise -1 */ int lammps_find_fix_neighlist(void *handle, const char *id, int reqid) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; auto fix = lmp->modify->get_fix_by_id(id); if (!fix) return -1; @@ -4255,7 +4255,7 @@ int lammps_find_fix_neighlist(void *handle, const char *id, int reqid) { * \return return neighbor list index if found, otherwise -1 */ int lammps_find_compute_neighlist(void* handle, const char *id, int reqid) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; auto compute = lmp->modify->get_compute_by_id(id); if (!compute) return -1; @@ -4279,7 +4279,7 @@ int lammps_find_compute_neighlist(void* handle, const char *id, int reqid) { * not a valid index */ int lammps_neighlist_num_elements(void *handle, int idx) { - LAMMPS * lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; Neighbor * neighbor = lmp->neighbor; if (idx < 0 || idx >= neighbor->nlist) { @@ -4304,7 +4304,7 @@ int lammps_neighlist_num_elements(void *handle, int idx) { * \param[out] neighbors pointer to array of neighbor atom local indices or NULL */ void lammps_neighlist_element_neighbors(void *handle, int idx, int element, int *iatom, int *numneigh, int **neighbors) { - LAMMPS * lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; Neighbor * neighbor = lmp->neighbor; *iatom = -1; *numneigh = 0; @@ -4348,7 +4348,7 @@ growing with every new LAMMPS release. int lammps_version(void *handle) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; return lmp->num_ver; } @@ -4662,7 +4662,7 @@ Valid categories are: *atom*\ , *integrate*\ , *minimize*\ , * \return 1 if included, 0 if not. */ int lammps_has_style(void *handle, const char *category, const char *name) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; Info info(lmp); return info.has_style(category, name) ? 1 : 0; } @@ -4683,7 +4683,7 @@ categories. * \return number of styles in category */ int lammps_style_count(void *handle, const char *category) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; Info info(lmp); return info.get_available_styles(category).size(); } @@ -4709,7 +4709,7 @@ int lammps_style_count(void *handle, const char *category) { */ int lammps_style_name(void *handle, const char *category, int idx, char *buffer, int buf_size) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; Info info(lmp); auto styles = info.get_available_styles(category); @@ -4741,7 +4741,7 @@ the given *name* exists. Valid categories are: *compute*\ , *dump*\ , * \return 1 if included, 0 if not. */ int lammps_has_id(void *handle, const char *category, const char *name) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; if (strcmp(category,"compute") == 0) { int ncompute = lmp->modify->ncompute; @@ -4806,7 +4806,7 @@ categories. * \return number of IDs in category */ int lammps_id_count(void *handle, const char *category) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; if (strcmp(category,"compute") == 0) { return lmp->modify->ncompute; } else if (strcmp(category,"dump") == 0) { @@ -4850,7 +4850,7 @@ set to an empty string, otherwise 1. */ int lammps_id_name(void *handle, const char *category, int idx, char *buffer, int buf_size) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; if (strcmp(category,"compute") == 0) { if ((idx >=0) && (idx < lmp->modify->ncompute)) { @@ -5065,8 +5065,8 @@ external code. void lammps_set_fix_external_callback(void *handle, const char *id, FixExternalFnPtr funcptr, void *ptr) { - LAMMPS *lmp = (LAMMPS *) handle; - FixExternal::FnPtr callback = (FixExternal::FnPtr) funcptr; + auto lmp = (LAMMPS *) handle; + auto callback = (FixExternal::FnPtr) funcptr; BEGIN_CAPTURE { @@ -5076,7 +5076,7 @@ void lammps_set_fix_external_callback(void *handle, const char *id, FixExternalF if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style 'external'", id); - FixExternal *fext = (FixExternal *) fix; + auto fext = dynamic_cast( fix); fext->set_callback(callback, ptr); } END_CAPTURE @@ -5126,7 +5126,7 @@ external code. double **lammps_fix_external_get_force(void *handle, const char *id) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; double **fexternal = nullptr; BEGIN_CAPTURE @@ -5174,7 +5174,7 @@ external code. void lammps_fix_external_set_energy_global(void *handle, const char *id, double eng) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -5184,7 +5184,7 @@ void lammps_fix_external_set_energy_global(void *handle, const char *id, double if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); - FixExternal *fext = (FixExternal*) fix; + auto fext = dynamic_cast( fix); fext->set_energy_global(eng); } END_CAPTURE @@ -5222,7 +5222,7 @@ external code. void lammps_fix_external_set_virial_global(void *handle, const char *id, double *virial) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -5232,7 +5232,7 @@ void lammps_fix_external_set_virial_global(void *handle, const char *id, double if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); - FixExternal * fext = (FixExternal*) fix; + auto fext = dynamic_cast( fix); fext->set_virial_global(virial); } END_CAPTURE @@ -5270,7 +5270,7 @@ external code. void lammps_fix_external_set_energy_peratom(void *handle, const char *id, double *eng) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -5280,7 +5280,7 @@ void lammps_fix_external_set_energy_peratom(void *handle, const char *id, double if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); - FixExternal *fext = (FixExternal*) fix; + auto fext = dynamic_cast( fix); fext->set_energy_peratom(eng); } END_CAPTURE @@ -5321,7 +5321,7 @@ external code. void lammps_fix_external_set_virial_peratom(void *handle, const char *id, double **virial) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -5331,7 +5331,7 @@ void lammps_fix_external_set_virial_peratom(void *handle, const char *id, double if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); - FixExternal * fext = (FixExternal*) fix; + auto fext = dynamic_cast( fix); fext->set_virial_peratom(virial); } END_CAPTURE @@ -5365,7 +5365,7 @@ external code. void lammps_fix_external_set_vector_length(void *handle, const char *id, int len) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -5375,7 +5375,7 @@ void lammps_fix_external_set_vector_length(void *handle, const char *id, int len if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); - FixExternal *fext = (FixExternal*) fix; + auto fext = dynamic_cast( fix); fext->set_vector_length(len); } END_CAPTURE @@ -5419,7 +5419,7 @@ external code. void lammps_fix_external_set_vector(void *handle, const char *id, int idx, double val) { - LAMMPS *lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -5429,7 +5429,7 @@ void lammps_fix_external_set_vector(void *handle, const char *id, int idx, doubl if (strcmp("external",fix->style) != 0) lmp->error->all(FLERR,"Fix '{}' is not of style external!", id); - FixExternal * fext = (FixExternal*) fix; + auto fext = dynamic_cast( fix); fext->set_vector(idx, val); } END_CAPTURE @@ -5482,7 +5482,7 @@ void lammps_free(void *ptr) int lammps_is_running(void *handle) { - LAMMPS * lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; return lmp->update->whichflag; } @@ -5495,7 +5495,7 @@ int lammps_is_running(void *handle) void lammps_force_timeout(void *handle) { - LAMMPS * lmp = (LAMMPS *) handle; + auto lmp = (LAMMPS *) handle; return lmp->timer->force_timeout(); } diff --git a/src/lmptype.h b/src/lmptype.h index f46956e7d2..e02cd74734 100644 --- a/src/lmptype.h +++ b/src/lmptype.h @@ -55,11 +55,15 @@ namespace LAMMPS_NS { -// reserve 2 hi bits in molecular system neigh list for special bonds flag -// max local + ghost atoms per processor = 2^30 - 1 +// reserve 2 highest bits in molecular system neigh list for special bonds flag +// reserve 3rd highest bit in neigh list for fix neigh/history flag +// max local + ghost atoms per processor = 2^29 - 1 #define SBBITS 30 -#define NEIGHMASK 0x3FFFFFFF +#define HISTBITS 29 +#define NEIGHMASK 0x1FFFFFFF +#define HISTMASK 0xDFFFFFFF +#define SPECIALMASK 0x3FFFFFFF // default to 32-bit smallint and other ints, 64-bit bigint diff --git a/src/main.cpp b/src/main.cpp index 095e1752da..19ccbb465a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -72,7 +72,7 @@ int main(int argc, char **argv) #ifdef LAMMPS_EXCEPTIONS try { - LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm); + auto lammps = new LAMMPS(argc, argv, lammps_comm); lammps->input->file(); delete lammps; } catch (LAMMPSAbortException &ae) { @@ -94,7 +94,7 @@ int main(int argc, char **argv) } #else try { - LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm); + auto lammps = new LAMMPS(argc, argv, lammps_comm); lammps->input->file(); delete lammps; } catch (fmt::format_error &fe) { diff --git a/src/math_extra.cpp b/src/math_extra.cpp index 54f6204182..15d6e472c9 100644 --- a/src/math_extra.cpp +++ b/src/math_extra.cpp @@ -143,6 +143,58 @@ void richardson(double *q, double *m, double *w, double *moments, double dtq) MathExtra::qnormalize(q); } +/* ---------------------------------------------------------------------- + Richardson iteration to update quaternion from angular velocity + return new normalized quaternion q + also returns updated omega at 1/2 step + Assumes spherical particles - no need to rotate to match moments +------------------------------------------------------------------------- */ + +void richardson_sphere(double *q, double *w, double dtq) +{ + // full update from dq/dt = 1/2 w q + + double wq[4]; + MathExtra::vecquat(w,q,wq); + + double qfull[4]; + qfull[0] = q[0] + dtq * wq[0]; + qfull[1] = q[1] + dtq * wq[1]; + qfull[2] = q[2] + dtq * wq[2]; + qfull[3] = q[3] + dtq * wq[3]; + MathExtra::qnormalize(qfull); + + // 1st half update from dq/dt = 1/2 w q + + double qhalf[4]; + qhalf[0] = q[0] + 0.5*dtq * wq[0]; + qhalf[1] = q[1] + 0.5*dtq * wq[1]; + qhalf[2] = q[2] + 0.5*dtq * wq[2]; + qhalf[3] = q[3] + 0.5*dtq * wq[3]; + MathExtra::qnormalize(qhalf); + + // re-compute q at 1/2 step + // recompute wq + + MathExtra::vecquat(w,qhalf,wq); + + // 2nd half update from dq/dt = 1/2 w q + + qhalf[0] += 0.5*dtq * wq[0]; + qhalf[1] += 0.5*dtq * wq[1]; + qhalf[2] += 0.5*dtq * wq[2]; + qhalf[3] += 0.5*dtq * wq[3]; + MathExtra::qnormalize(qhalf); + + // corrected Richardson update + + q[0] = 2.0*qhalf[0] - qfull[0]; + q[1] = 2.0*qhalf[1] - qfull[1]; + q[2] = 2.0*qhalf[2] - qfull[2]; + q[3] = 2.0*qhalf[3] - qfull[3]; + MathExtra::qnormalize(q); +} + /* ---------------------------------------------------------------------- apply evolution operators to quat, quat momentum Miller et al., J Chem Phys. 116, 8649-8659 (2002) diff --git a/src/math_extra.h b/src/math_extra.h index 7c71e4c11b..55d680b0f2 100644 --- a/src/math_extra.h +++ b/src/math_extra.h @@ -76,6 +76,7 @@ void write3(const double mat[3][3]); int mldivide3(const double mat[3][3], const double *vec, double *ans); void rotate(double matrix[3][3], int i, int j, int k, int l, double s, double tau); void richardson(double *q, double *m, double *w, double *moments, double dtq); +void richardson_sphere(double *q, double *w, double dtq); void no_squish_rotate(int k, double *p, double *q, double *inertia, double dt); // shape matrix operations @@ -91,6 +92,7 @@ inline void vecquat(double *a, double *b, double *c); inline void quatvec(double *a, double *b, double *c); inline void quatquat(double *a, double *b, double *c); inline void invquatvec(double *a, double *b, double *c); +inline void quatrotvec(double *a, double *b, double *c); inline void axisangle_to_quat(const double *v, const double angle, double *quat); void angmom_to_omega(double *m, double *ex, double *ey, double *ez, double *idiag, double *w); @@ -651,6 +653,29 @@ inline void MathExtra::invquatvec(double *a, double *b, double *c) c[2] = -a[3] * b[0] + a[2] * b[1] - a[1] * b[2] + a[0] * b[3]; } +/* ---------------------------------------------------------------------- + quaternion rotation of vector: c = a*b*conj(a) + a is a quaternion + b is a three component vector + c is a three component vector +------------------------------------------------------------------------- */ + +inline void MathExtra::quatrotvec(double *a, double *b, double *c) +{ + double temp[4]; + + // temp = a*b + temp[0] = -a[1]*b[0] - a[2]*b[1] - a[3]*b[2]; + temp[1] = a[0]*b[0] + a[2]*b[2] - a[3]*b[1]; + temp[2] = a[0]*b[1] + a[3]*b[0] - a[1]*b[2]; + temp[3] = a[0]*b[2] + a[1]*b[1] - a[2]*b[0]; + + // c = temp*conj(a) + c[0] = -a[1]*temp[0] + a[0]*temp[1] - a[3]*temp[2] + a[2]*temp[3]; + c[1] = -a[2]*temp[0] + a[3]*temp[1] + a[0]*temp[2] - a[1]*temp[3]; + c[2] = -a[3]*temp[0] - a[2]*temp[1] + a[1]*temp[2] + a[0]*temp[3]; +} + /* ---------------------------------------------------------------------- compute quaternion from axis-angle rotation v MUST be a unit vector diff --git a/src/min.cpp b/src/min.cpp index 0c71607bd8..1adb88184a 100644 --- a/src/min.cpp +++ b/src/min.cpp @@ -121,7 +121,7 @@ void Min::init() // create fix needed for storing atom-based quantities // will delete it at end of run - fix_minimize = (FixMinimize *) modify->add_fix("MINIMIZE all MINIMIZE"); + fix_minimize = dynamic_cast( modify->add_fix("MINIMIZE all MINIMIZE")); // clear out extra global and per-atom dof // will receive requests for new per-atom dof during pair init() diff --git a/src/modify.cpp b/src/modify.cpp index 7c6f8e4ae3..7554079e2a 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -249,11 +249,11 @@ void Modify::init() for (i = 0; i < nfix; i++) if (!fix[i]->dynamic_group_allow && group->dynamic[fix[i]->igroup]) - error->all(FLERR, "Fix {} does not allow use with a dynamic group", fix[i]->id); + error->all(FLERR, "Fix {} does not allow use with a dynamic group", fix[i]->style); for (i = 0; i < ncompute; i++) if (!compute[i]->dynamic_group_allow && group->dynamic[compute[i]->igroup]) - error->all(FLERR, "Compute {} does not allow use with a dynamic group", compute[i]->id); + error->all(FLERR, "Compute {} does not allow use with a dynamic group", compute[i]->style); // warn if any particle is time integrated more than once diff --git a/src/molecule.cpp b/src/molecule.cpp index d6c839dfc4..816b2686ab 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -477,7 +477,7 @@ void Molecule::read(int flag) itensor[5] *= scale5; } else if (values.contains("body")) { bodyflag = 1; - avec_body = (AtomVecBody *) atom->style_match("body"); + avec_body = dynamic_cast( atom->style_match("body")); if (!avec_body) error->all(FLERR,"Molecule file requires atom style body"); nibody = values.next_int(); diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 98c773915b..2c7ce0004b 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -22,6 +22,7 @@ #include "accelerator_kokkos.h" #include "atom.h" #include "atom_vec.h" +#include "bond.h" #include "citeme.h" #include "comm.h" #include "compute.h" @@ -469,12 +470,12 @@ void Neighbor::init() 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 ((dynamic_cast( update->integrate))->level_inner >= 0) respa = 1; + if ((dynamic_cast( update->integrate))->level_middle >= 0) respa = 2; } if (respa) { - double *cut_respa = ((Respa *) update->integrate)->cutoff; + double *cut_respa = (dynamic_cast( update->integrate))->cutoff; cut_inner_sq = (cut_respa[1] + skin) * (cut_respa[1] + skin); cut_middle_sq = (cut_respa[3] + skin) * (cut_respa[3] + skin); cut_middle_inside_sq = (cut_respa[0] - skin) * (cut_respa[0] - skin); @@ -880,13 +881,13 @@ int Neighbor::init_pair() } if (requests[i]->pair && i < nrequest_original) { - Pair *pair = (Pair *) requests[i]->requestor; + auto pair = (Pair *) requests[i]->requestor; pair->init_list(requests[i]->id,lists[i]); } else if (requests[i]->fix && i < nrequest_original) { Fix *fix = (Fix *) requests[i]->requestor; fix->init_list(requests[i]->id,lists[i]); } else if (requests[i]->compute && i < nrequest_original) { - Compute *compute = (Compute *) requests[i]->requestor; + auto compute = (Compute *) requests[i]->requestor; compute->init_list(requests[i]->id,lists[i]); } } @@ -1468,7 +1469,7 @@ void Neighbor::init_topology() // bonds,etc can only be broken for atom->molecular = Atom::MOLECULAR, not Atom::TEMPLATE // SHAKE sets bonds and angles negative // gcmc sets all bonds, angles, etc negative - // bond_quartic sets bonds to 0 + // partial_flag sets bonds to 0 // delete_bonds sets all interactions negative int bond_off = 0; @@ -1477,7 +1478,9 @@ void Neighbor::init_topology() if (utils::strmatch(modify->fix[i]->style,"^shake") || utils::strmatch(modify->fix[i]->style,"^rattle")) bond_off = angle_off = 1; - if (force->bond && force->bond_match("quartic")) bond_off = 1; + if (force->bond) + if (force->bond->partial_flag) + bond_off = 1; if (atom->avec->bonds_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { @@ -2677,7 +2680,7 @@ void Neighbor::modify_params(int narg, char **arg) void Neighbor::modify_params(const std::string &modcmd) { auto args = utils::split_words(modcmd); - char **newarg = new char*[args.size()]; + auto newarg = new char*[args.size()]; int i=0; for (const auto &arg : args) { newarg[i++] = (char *)arg.c_str(); diff --git a/src/npair_half_size_bin_newtoff.cpp b/src/npair_half_size_bin_newtoff.cpp index e836503190..de063c1eb9 100644 --- a/src/npair_half_size_bin_newtoff.cpp +++ b/src/npair_half_size_bin_newtoff.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_bin_newtoff.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neigh_list.h" @@ -35,7 +38,8 @@ NPairHalfSizeBinNewtoff::NPairHalfSizeBinNewtoff(LAMMPS *lmp) : NPair(lmp) {} void NPairHalfSizeBinNewtoff::build(NeighList *list) { - int i,j,k,n,ibin; + int i,j,jh,k,n,ibin,which,imol,iatom,moltemplate; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutsq; int *neighptr; @@ -44,17 +48,26 @@ void NPairHalfSizeBinNewtoff::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; int nlocal = atom->nlocal; if (includegroup) nlocal = atom->nfirst; + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + if (molecular == Atom::TEMPLATE) moltemplate = 1; + else moltemplate = 0; + int history = list->history; int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - int mask_history = 3 << SBBITS; + int mask_history = 1 << HISTBITS; int inum = 0; ipage->reset(); @@ -68,6 +81,11 @@ void NPairHalfSizeBinNewtoff::build(NeighList *list) ztmp = x[i][2]; radi = radius[i]; ibin = atom2bin[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over all atoms in surrounding bins in stencil including self // only store pair if i < j @@ -87,10 +105,23 @@ void NPairHalfSizeBinNewtoff::build(NeighList *list) cutsq = (radsum+skin) * (radsum+skin); if (rsq <= cutsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } } diff --git a/src/npair_half_size_bin_newton.cpp b/src/npair_half_size_bin_newton.cpp index b6a786b0cf..fbf5ce14d4 100644 --- a/src/npair_half_size_bin_newton.cpp +++ b/src/npair_half_size_bin_newton.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_bin_newton.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neigh_list.h" @@ -34,7 +37,8 @@ NPairHalfSizeBinNewton::NPairHalfSizeBinNewton(LAMMPS *lmp) : NPair(lmp) {} void NPairHalfSizeBinNewton::build(NeighList *list) { - int i,j,k,n,ibin; + int i,j,jh,k,n,ibin,which,imol,iatom,moltemplate; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutsq; int *neighptr; @@ -43,17 +47,26 @@ void NPairHalfSizeBinNewton::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; int nlocal = atom->nlocal; if (includegroup) nlocal = atom->nfirst; + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + if (molecular == Atom::TEMPLATE) moltemplate = 1; + else moltemplate = 0; + int history = list->history; int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - int mask_history = 3 << SBBITS; + int mask_history = 1 << HISTBITS; int inum = 0; ipage->reset(); @@ -66,6 +79,11 @@ void NPairHalfSizeBinNewton::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over rest of atoms in i's bin, ghosts are at end of linked list // if j is owned atom, store it, since j is beyond i in linked list @@ -90,10 +108,23 @@ void NPairHalfSizeBinNewton::build(NeighList *list) cutsq = (radsum+skin) * (radsum+skin); if (rsq <= cutsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } @@ -112,10 +143,23 @@ void NPairHalfSizeBinNewton::build(NeighList *list) cutsq = (radsum+skin) * (radsum+skin); if (rsq <= cutsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } } diff --git a/src/npair_half_size_bin_newton_tri.cpp b/src/npair_half_size_bin_newton_tri.cpp index a86feb6f40..15728a596a 100644 --- a/src/npair_half_size_bin_newton_tri.cpp +++ b/src/npair_half_size_bin_newton_tri.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_bin_newton_tri.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neigh_list.h" @@ -35,7 +38,8 @@ NPairHalfSizeBinNewtonTri::NPairHalfSizeBinNewtonTri(LAMMPS *lmp) : void NPairHalfSizeBinNewtonTri::build(NeighList *list) { - int i,j,k,n,ibin; + int i,j,jh,k,n,ibin,which,imol,iatom,moltemplate; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutsq; int *neighptr; @@ -44,17 +48,26 @@ void NPairHalfSizeBinNewtonTri::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; int nlocal = atom->nlocal; if (includegroup) nlocal = atom->nfirst; + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + if (molecular == Atom::TEMPLATE) moltemplate = 1; + else moltemplate = 0; + int history = list->history; int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - int mask_history = 3 << SBBITS; + int mask_history = 1 << HISTBITS; int inum = 0; ipage->reset(); @@ -67,6 +80,11 @@ void NPairHalfSizeBinNewtonTri::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over all atoms in bins in stencil // pairs for atoms j "below" i are excluded @@ -96,10 +114,23 @@ void NPairHalfSizeBinNewtonTri::build(NeighList *list) cutsq = (radsum+skin) * (radsum+skin); if (rsq <= cutsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } } diff --git a/src/npair_half_size_multi_newtoff.cpp b/src/npair_half_size_multi_newtoff.cpp index 4c9d9b3f62..ecb70cd6c4 100644 --- a/src/npair_half_size_multi_newtoff.cpp +++ b/src/npair_half_size_multi_newtoff.cpp @@ -15,7 +15,10 @@ es certain rights in this software. This software is distributed under #include "npair_half_size_multi_newtoff.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neighbor.h" #include "neigh_list.h" @@ -37,7 +40,9 @@ NPairHalfSizeMultiNewtoff::NPairHalfSizeMultiNewtoff(LAMMPS *lmp) : NPair(lmp) { void NPairHalfSizeMultiNewtoff::build(NeighList *list) { - int i,j,k,n,itype,jtype,icollection,jcollection,ibin,jbin,ns; + int i,j,jh,k,n,itype,jtype,icollection,jcollection,ibin,jbin,ns; + int which,imol,iatom,moltemplate; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutdistsq; int *neighptr,*s; @@ -48,17 +53,26 @@ void NPairHalfSizeMultiNewtoff::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; int nlocal = atom->nlocal; if (includegroup) nlocal = atom->nfirst; + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + if (molecular == Atom::TEMPLATE) moltemplate = 1; + else moltemplate = 0; + int history = list->history; int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - int mask_history = 3 << SBBITS; + int mask_history = 1 << HISTBITS; int inum = 0; ipage->reset(); @@ -72,6 +86,11 @@ void NPairHalfSizeMultiNewtoff::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } ibin = atom2bin[i]; @@ -92,27 +111,40 @@ void NPairHalfSizeMultiNewtoff::build(NeighList *list) ns = nstencil_multi[icollection][jcollection]; for (k = 0; k < ns; k++) { - js = binhead_multi[jcollection][jbin + s[k]]; - for (j = js; j >= 0; j = bins[j]) { - if (j <= i) continue; + js = binhead_multi[jcollection][jbin + s[k]]; + for (j = js; j >= 0; j = bins[j]) { + if (j <= i) continue; jtype = type[j]; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; - delx = xtmp - x[j][0]; - dely = ytmp - x[j][1]; - delz = ztmp - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; - radsum = radi + radius[j]; - cutdistsq = (radsum+skin) * (radsum+skin); + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + radsum = radi + radius[j]; + cutdistsq = (radsum+skin) * (radsum+skin); - if (rsq <= cutdistsq) { - if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; - } - } + if (rsq <= cutdistsq) { + jh = j; + if (history && rsq < radsum*radsum) + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; + } + } } } diff --git a/src/npair_half_size_multi_newton.cpp b/src/npair_half_size_multi_newton.cpp index 8af60aa435..ee100596bc 100644 --- a/src/npair_half_size_multi_newton.cpp +++ b/src/npair_half_size_multi_newton.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_multi_newton.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neighbor.h" #include "neigh_list.h" @@ -36,7 +39,9 @@ NPairHalfSizeMultiNewton::NPairHalfSizeMultiNewton(LAMMPS *lmp) : NPair(lmp) {} void NPairHalfSizeMultiNewton::build(NeighList *list) { - int i,j,k,n,itype,jtype,icollection,jcollection,ibin,jbin,ns,js; + int i,j,jh,k,n,itype,jtype,icollection,jcollection,ibin,jbin,ns,js; + int which,imol,iatom,moltemplate; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutdistsq; int *neighptr,*s; @@ -46,17 +51,26 @@ void NPairHalfSizeMultiNewton::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; int nlocal = atom->nlocal; if (includegroup) nlocal = atom->nfirst; + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + if (molecular == Atom::TEMPLATE) moltemplate = 1; + else moltemplate = 0; + int history = list->history; int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - int mask_history = 3 << SBBITS; + int mask_history = 1 << HISTBITS; int inum = 0; ipage->reset(); @@ -70,6 +84,11 @@ void NPairHalfSizeMultiNewton::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } ibin = atom2bin[i]; @@ -94,33 +113,46 @@ void NPairHalfSizeMultiNewton::build(NeighList *list) // if j is owned atom, store it if j > i // if j is ghost, only store if j coords are "above and to the right" of i - for (j = js; j >= 0; j = bins[j]) { + for (j = js; j >= 0; j = bins[j]) { if ((icollection != jcollection) && (j < i)) continue; - if (j >= nlocal) { - if (x[j][2] < ztmp) continue; - if (x[j][2] == ztmp) { - if (x[j][1] < ytmp) continue; - if (x[j][1] == ytmp && x[j][0] < xtmp) continue; - } - } + if (j >= nlocal) { + if (x[j][2] < ztmp) continue; + if (x[j][2] == ztmp) { + if (x[j][1] < ytmp) continue; + if (x[j][1] == ytmp && x[j][0] < xtmp) continue; + } + } jtype = type[j]; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; - delx = xtmp - x[j][0]; - dely = ytmp - x[j][1]; - delz = ztmp - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; - radsum = radi + radius[j]; - cutdistsq = (radsum+skin) * (radsum+skin); + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + radsum = radi + radius[j]; + cutdistsq = (radsum+skin) * (radsum+skin); - if (rsq <= cutdistsq) { - if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; - } + if (rsq <= cutdistsq) { + jh = j; + if (history && rsq < radsum*radsum) + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; + } } } @@ -129,30 +161,43 @@ void NPairHalfSizeMultiNewton::build(NeighList *list) // stencil is half if i same size as j // stencil is full if i smaller than j - s = stencil_multi[icollection][jcollection]; - ns = nstencil_multi[icollection][jcollection]; + s = stencil_multi[icollection][jcollection]; + ns = nstencil_multi[icollection][jcollection]; - for (k = 0; k < ns; k++) { - js = binhead_multi[jcollection][jbin + s[k]]; - for (j = js; j >= 0; j = bins[j]) { + for (k = 0; k < ns; k++) { + js = binhead_multi[jcollection][jbin + s[k]]; + for (j = js; j >= 0; j = bins[j]) { jtype = type[j]; if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; delx = xtmp - x[j][0]; - dely = ytmp - x[j][1]; - delz = ztmp - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; - radsum = radi + radius[j]; - cutdistsq = (radsum+skin) * (radsum+skin); + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + radsum = radi + radius[j]; + cutdistsq = (radsum+skin) * (radsum+skin); - if (rsq <= cutdistsq) { - if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; - } - } + if (rsq <= cutdistsq) { + jh = j; + if (history && rsq < radsum*radsum) + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; + } + } } } diff --git a/src/npair_half_size_multi_newton_tri.cpp b/src/npair_half_size_multi_newton_tri.cpp index 20d4d8b421..9a170948b9 100644 --- a/src/npair_half_size_multi_newton_tri.cpp +++ b/src/npair_half_size_multi_newton_tri.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_multi_newton_tri.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neighbor.h" #include "neigh_list.h" @@ -36,7 +39,9 @@ NPairHalfSizeMultiNewtonTri::NPairHalfSizeMultiNewtonTri(LAMMPS *lmp) : NPair(lm void NPairHalfSizeMultiNewtonTri::build(NeighList *list) { - int i,j,k,n,itype,jtype,icollection,jcollection,ibin,jbin,ns,js; + int i,j,jh,k,n,itype,jtype,icollection,jcollection,ibin,jbin,ns,js; + int which,imol,iatom,moltemplate; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutdistsq; int *neighptr,*s; @@ -46,17 +51,26 @@ void NPairHalfSizeMultiNewtonTri::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; int nlocal = atom->nlocal; if (includegroup) nlocal = atom->nfirst; + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + if (molecular == Atom::TEMPLATE) moltemplate = 1; + else moltemplate = 0; + int history = list->history; int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - int mask_history = 3 << SBBITS; + int mask_history = 1 << HISTBITS; int inum = 0; ipage->reset(); @@ -70,6 +84,11 @@ void NPairHalfSizeMultiNewtonTri::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } ibin = atom2bin[i]; @@ -119,10 +138,23 @@ void NPairHalfSizeMultiNewtonTri::build(NeighList *list) cutdistsq = (radsum+skin) * (radsum+skin); if (rsq <= cutdistsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } } diff --git a/src/npair_half_size_multi_old_newtoff.cpp b/src/npair_half_size_multi_old_newtoff.cpp index d98b0a635d..4f8e4a8078 100644 --- a/src/npair_half_size_multi_old_newtoff.cpp +++ b/src/npair_half_size_multi_old_newtoff.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_multi_old_newtoff.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neigh_list.h" @@ -36,7 +39,8 @@ NPairHalfSizeMultiOldNewtoff::NPairHalfSizeMultiOldNewtoff(LAMMPS *lmp) : NPair( void NPairHalfSizeMultiOldNewtoff::build(NeighList *list) { - int i,j,k,n,itype,jtype,ibin,ns; + int i,j,jh,k,n,itype,jtype,ibin,ns,which,imol,iatom,moltemplate; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutdistsq; int *neighptr,*s; @@ -46,17 +50,26 @@ void NPairHalfSizeMultiOldNewtoff::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; int nlocal = atom->nlocal; if (includegroup) nlocal = atom->nfirst; + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + if (molecular == Atom::TEMPLATE) moltemplate = 1; + else moltemplate = 0; + int history = list->history; int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - int mask_history = 3 << SBBITS; + int mask_history = 1 << HISTBITS; int inum = 0; ipage->reset(); @@ -70,6 +83,11 @@ void NPairHalfSizeMultiOldNewtoff::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over all atoms in other bins in stencil including self // only store pair if i < j @@ -98,10 +116,23 @@ void NPairHalfSizeMultiOldNewtoff::build(NeighList *list) cutdistsq = (radsum+skin) * (radsum+skin); if (rsq <= cutdistsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } } diff --git a/src/npair_half_size_multi_old_newton.cpp b/src/npair_half_size_multi_old_newton.cpp index 8ea894db4c..753c8c7d44 100644 --- a/src/npair_half_size_multi_old_newton.cpp +++ b/src/npair_half_size_multi_old_newton.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_multi_old_newton.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neigh_list.h" @@ -35,7 +38,8 @@ NPairHalfSizeMultiOldNewton::NPairHalfSizeMultiOldNewton(LAMMPS *lmp) : NPair(lm void NPairHalfSizeMultiOldNewton::build(NeighList *list) { - int i,j,k,n,itype,jtype,ibin,ns; + int i,j,jh,k,n,itype,jtype,ibin,ns,which,imol,iatom,moltemplate; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutdistsq; int *neighptr,*s; @@ -45,17 +49,26 @@ void NPairHalfSizeMultiOldNewton::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; int nlocal = atom->nlocal; if (includegroup) nlocal = atom->nfirst; + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + if (molecular == Atom::TEMPLATE) moltemplate = 1; + else moltemplate = 0; + int history = list->history; int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - int mask_history = 3 << SBBITS; + int mask_history = 1 << HISTBITS; int inum = 0; ipage->reset(); @@ -69,6 +82,11 @@ void NPairHalfSizeMultiOldNewton::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over rest of atoms in i's bin, ghosts are at end of linked list // if j is owned atom, store it, since j is beyond i in linked list @@ -94,10 +112,23 @@ void NPairHalfSizeMultiOldNewton::build(NeighList *list) cutdistsq = (radsum+skin) * (radsum+skin); if (rsq <= cutdistsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } @@ -124,10 +155,22 @@ void NPairHalfSizeMultiOldNewton::build(NeighList *list) cutdistsq = (radsum+skin) * (radsum+skin); if (rsq <= cutdistsq) { - if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else + if (history && rsq < radsum*radsum) + j = j ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = j; + else if (domain->minimum_image_check(delx,dely,delz)) neighptr[n++] = j; + else if (which > 0) neighptr[n++] = j ^ (which << SBBITS); + } else neighptr[n++] = j; } } } diff --git a/src/npair_half_size_multi_old_newton_tri.cpp b/src/npair_half_size_multi_old_newton_tri.cpp index cf7495de1b..ee7a11a36e 100644 --- a/src/npair_half_size_multi_old_newton_tri.cpp +++ b/src/npair_half_size_multi_old_newton_tri.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_multi_old_newton_tri.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "my_page.h" #include "neigh_list.h" @@ -34,7 +37,8 @@ NPairHalfSizeMultiOldNewtonTri::NPairHalfSizeMultiOldNewtonTri(LAMMPS *lmp) : NP void NPairHalfSizeMultiOldNewtonTri::build(NeighList *list) { - int i,j,k,n,itype,jtype,ibin,ns; + int i,j,jh,k,n,itype,jtype,ibin,ns,which,imol,iatom,moltemplate; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutdistsq; int *neighptr,*s; @@ -44,17 +48,26 @@ void NPairHalfSizeMultiOldNewtonTri::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; int nlocal = atom->nlocal; if (includegroup) nlocal = atom->nfirst; + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + if (molecular == Atom::TEMPLATE) moltemplate = 1; + else moltemplate = 0; + int history = list->history; int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - int mask_history = 3 << SBBITS; + int mask_history = 1 << HISTBITS; int inum = 0; ipage->reset(); @@ -68,7 +81,11 @@ void NPairHalfSizeMultiOldNewtonTri::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; - + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over all atoms in bins, including self, in stencil // skip if i,j neighbor cutoff is less than bin distance @@ -106,10 +123,23 @@ void NPairHalfSizeMultiOldNewtonTri::build(NeighList *list) cutdistsq = (radsum+skin) * (radsum+skin); if (rsq <= cutdistsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } } diff --git a/src/npair_half_size_nsq_newtoff.cpp b/src/npair_half_size_nsq_newtoff.cpp index e8eac6f54b..9ace347901 100644 --- a/src/npair_half_size_nsq_newtoff.cpp +++ b/src/npair_half_size_nsq_newtoff.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_nsq_newtoff.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "group.h" #include "my_page.h" #include "neigh_list.h" @@ -35,7 +38,8 @@ NPairHalfSizeNsqNewtoff::NPairHalfSizeNsqNewtoff(LAMMPS *lmp) : NPair(lmp) {} void NPairHalfSizeNsqNewtoff::build(NeighList *list) { - int i,j,n,bitmask; + int i,j,jh,n,bitmask,which,imol,iatom,moltemplate; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutsq; int *neighptr; @@ -44,7 +48,10 @@ void NPairHalfSizeNsqNewtoff::build(NeighList *list) double *radius = atom->radius; int *type = atom->type; int *mask = atom->mask; + tagint *tag = atom->tag; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; int nlocal = atom->nlocal; int nall = nlocal + atom->nghost; if (includegroup) { @@ -52,13 +59,19 @@ void NPairHalfSizeNsqNewtoff::build(NeighList *list) bitmask = group->bitmask[includegroup]; } + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + if (molecular == Atom::TEMPLATE) moltemplate = 1; + else moltemplate = 0; + int history = list->history; int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - int mask_history = 3 << SBBITS; + int mask_history = 1 << HISTBITS; int inum = 0; ipage->reset(); @@ -71,6 +84,11 @@ void NPairHalfSizeNsqNewtoff::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over remaining atoms, owned and ghost @@ -86,10 +104,23 @@ void NPairHalfSizeNsqNewtoff::build(NeighList *list) cutsq = (radsum+skin) * (radsum+skin); if (rsq <= cutsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } diff --git a/src/npair_half_size_nsq_newton.cpp b/src/npair_half_size_nsq_newton.cpp index 7f90596755..05409a0bab 100644 --- a/src/npair_half_size_nsq_newton.cpp +++ b/src/npair_half_size_nsq_newton.cpp @@ -15,7 +15,10 @@ #include "npair_half_size_nsq_newton.h" #include "atom.h" +#include "atom_vec.h" +#include "domain.h" #include "error.h" +#include "molecule.h" #include "group.h" #include "my_page.h" #include "neigh_list.h" @@ -36,7 +39,8 @@ NPairHalfSizeNsqNewton::NPairHalfSizeNsqNewton(LAMMPS *lmp) : NPair(lmp) {} void NPairHalfSizeNsqNewton::build(NeighList *list) { - int i,j,n,itag,jtag,bitmask; + int i,j,jh,n,itag,jtag,bitmask,which,imol,iatom,moltemplate; + tagint tagprev; double xtmp,ytmp,ztmp,delx,dely,delz,rsq; double radi,radsum,cutsq; int *neighptr; @@ -47,6 +51,8 @@ void NPairHalfSizeNsqNewton::build(NeighList *list) int *type = atom->type; int *mask = atom->mask; tagint *molecule = atom->molecule; + tagint **special = atom->special; + int **nspecial = atom->nspecial; int nlocal = atom->nlocal; int nall = nlocal + atom->nghost; if (includegroup) { @@ -54,13 +60,19 @@ void NPairHalfSizeNsqNewton::build(NeighList *list) bitmask = group->bitmask[includegroup]; } + int *molindex = atom->molindex; + int *molatom = atom->molatom; + Molecule **onemols = atom->avec->onemols; + if (molecular == Atom::TEMPLATE) moltemplate = 1; + else moltemplate = 0; + int history = list->history; int *ilist = list->ilist; int *numneigh = list->numneigh; int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - int mask_history = 3 << SBBITS; + int mask_history = 1 << HISTBITS; int inum = 0; ipage->reset(); @@ -74,6 +86,11 @@ void NPairHalfSizeNsqNewton::build(NeighList *list) ytmp = x[i][1]; ztmp = x[i][2]; radi = radius[i]; + if (moltemplate) { + imol = molindex[i]; + iatom = molatom[i]; + tagprev = tag[i] - iatom - 1; + } // loop over remaining atoms, owned and ghost @@ -105,10 +122,23 @@ void NPairHalfSizeNsqNewton::build(NeighList *list) cutsq = (radsum+skin) * (radsum+skin); if (rsq <= cutsq) { + jh = j; if (history && rsq < radsum*radsum) - neighptr[n++] = j ^ mask_history; - else - neighptr[n++] = j; + jh = jh ^ mask_history; + + if (molecular != Atom::ATOMIC) { + if (!moltemplate) + which = find_special(special[i],nspecial[i],tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], + onemols[imol]->nspecial[iatom], + tag[j]-tagprev); + else which = 0; + if (which == 0) neighptr[n++] = jh; + else if (domain->minimum_image_check(delx,dely,delz)) + neighptr[n++] = jh; + else if (which > 0) neighptr[n++] = jh ^ (which << SBBITS); + } else neighptr[n++] = jh; } } diff --git a/src/output.cpp b/src/output.cpp index 7a1eaaf807..9444164b63 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -66,7 +66,7 @@ Output::Output(LAMMPS *lmp) : Pointers(lmp) // create default Thermo class - char **newarg = new char*[1]; + auto newarg = new char*[1]; newarg[0] = (char *) "one"; thermo = new Thermo(lmp,1,newarg); delete[] newarg; @@ -192,7 +192,7 @@ void Output::setup(int memflag) // decide whether to write snapshot and/or calculate next step for dump if (ndump && update->restrict_output == 0) { - next_time_dump_any = MAXBIGINT; + next_dump_any = next_time_dump_any = MAXBIGINT; for (int idump = 0; idump < ndump; idump++) { @@ -256,8 +256,7 @@ void Output::setup(int memflag) if (mode_dump[idump] && (dump[idump]->clearstep || var_dump[idump])) next_time_dump_any = MIN(next_time_dump_any,next_dump[idump]); - if (idump) next_dump_any = MIN(next_dump_any,next_dump[idump]); - else next_dump_any = next_dump[0]; + next_dump_any = MIN(next_dump_any,next_dump[idump]); } // if no dumps, set next_dump_any to last+1 so will not influence next @@ -276,7 +275,7 @@ void Output::setup(int memflag) (ntimestep/restart_every_single)*restart_every_single + restart_every_single; else { - bigint nextrestart = static_cast + auto nextrestart = static_cast (input->variable->compute_equal(ivar_restart_single)); if (nextrestart <= ntimestep) error->all(FLERR,"Restart variable returned a bad timestep"); @@ -289,7 +288,7 @@ void Output::setup(int memflag) (ntimestep/restart_every_double)*restart_every_double + restart_every_double; else { - bigint nextrestart = static_cast + auto nextrestart = static_cast (input->variable->compute_equal(ivar_restart_double)); if (nextrestart <= ntimestep) error->all(FLERR,"Restart variable returned a bad timestep"); @@ -356,9 +355,9 @@ void Output::setup(int memflag) // what other command may have added it if (next_dump_any == ntimestep) { + next_dump_any = next_time_dump_any = MAXBIGINT; for (int idump = 0; idump < ndump; idump++) { - next_time_dump_any = MAXBIGINT; if (next_dump[idump] == ntimestep) { if (last_dump[idump] == ntimestep) continue; @@ -381,8 +380,7 @@ void Output::setup(int memflag) if (mode_dump[idump] && (dump[idump]->clearstep || var_dump[idump])) next_time_dump_any = MIN(next_time_dump_any,next_dump[idump]); - if (idump) next_dump_any = MIN(next_dump_any,next_dump[idump]); - else next_dump_any = next_dump[0]; + next_dump_any = MIN(next_dump_any,next_dump[idump]); } } @@ -403,7 +401,7 @@ void Output::setup(int memflag) if (restart_every_single) next_restart_single += restart_every_single; else { modify->clearstep_compute(); - bigint nextrestart = static_cast + auto nextrestart = static_cast (input->variable->compute_equal(ivar_restart_single)); if (nextrestart <= ntimestep) error->all(FLERR,"Restart variable returned a bad timestep"); @@ -424,7 +422,7 @@ void Output::setup(int memflag) if (restart_every_double) next_restart_double += restart_every_double; else { modify->clearstep_compute(); - bigint nextrestart = static_cast + auto nextrestart = static_cast (input->variable->compute_equal(ivar_restart_double)); if (nextrestart <= ntimestep) error->all(FLERR,"Restart variable returned a bad timestep"); @@ -650,7 +648,7 @@ int Output::check_time_dumps(bigint ntimestep) } else { modify->clearstep_compute(); update->ntimestep--; - bigint nextrestart = static_cast + auto nextrestart = static_cast (input->variable->compute_equal(ivar_restart_single)); if (nextrestart < ntimestep) error->all(FLERR,"Restart variable returned a bad timestep"); @@ -669,7 +667,7 @@ int Output::check_time_dumps(bigint ntimestep) } else { modify->clearstep_compute(); update->ntimestep--; - bigint nextrestart = static_cast + auto nextrestart = static_cast (input->variable->compute_equal(ivar_restart_double)); if (nextrestart < ntimestep) error->all(FLERR,"Restart variable returned a bad timestep"); diff --git a/src/pair_deprecated.cpp b/src/pair_deprecated.cpp index b691744cd4..691eff124f 100644 --- a/src/pair_deprecated.cpp +++ b/src/pair_deprecated.cpp @@ -36,7 +36,7 @@ void PairDeprecated::settings(int, char **) // called, our style was just added at the end of the list of substyles if (utils::strmatch(my_style,"^hybrid")) { - PairHybrid *hybrid = (PairHybrid *)force->pair; + auto hybrid = dynamic_cast(force->pair); my_style = hybrid->keywords[hybrid->nstyles]; } diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 2d2fc564ce..d0a3a2b053 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -51,8 +51,8 @@ PairHybrid::~PairHybrid() for (int m = 0; m < nstyles; m++) { delete styles[m]; delete[] keywords[m]; - if (special_lj[m]) delete[] special_lj[m]; - if (special_coul[m]) delete[] special_coul[m]; + delete[] special_lj[m]; + delete[] special_coul[m]; } } delete[] styles; @@ -115,7 +115,7 @@ void PairHybrid::compute(int eflag, int vflag) Respa *respa = nullptr; respaflag = 0; if (utils::strmatch(update->integrate_style,"^respa")) { - respa = (Respa *) update->integrate; + respa = dynamic_cast( update->integrate); if (respa->nhybrid_styles > 0) respaflag = 1; } @@ -275,8 +275,8 @@ void PairHybrid::settings(int narg, char **arg) for (int m = 0; m < nstyles; m++) { delete styles[m]; delete[] keywords[m]; - if (special_lj[m]) delete[] special_lj[m]; - if (special_coul[m]) delete[] special_coul[m]; + delete[] special_lj[m]; + delete[] special_coul[m]; } delete[] styles; delete[] keywords; @@ -1051,7 +1051,7 @@ void PairHybrid::set_special(int m) double * PairHybrid::save_special() { - double *saved = new double[8]; + auto saved = new double[8]; for (int i = 0; i < 4; ++i) { saved[i] = force->special_lj[i]; @@ -1092,7 +1092,7 @@ void *PairHybrid::extract(const char *str, int &dim) if (couldim != -1 && dim != couldim) error->all(FLERR, "Coulomb styles of pair hybrid sub-styles do not match"); - double *p_newvalue = (double *) ptr; + auto p_newvalue = (double *) ptr; double newvalue = *p_newvalue; if (cutptr && (newvalue != cutvalue)) error->all(FLERR, diff --git a/src/pair_hybrid_scaled.cpp b/src/pair_hybrid_scaled.cpp index a2a7184ddd..bc86f66b24 100644 --- a/src/pair_hybrid_scaled.cpp +++ b/src/pair_hybrid_scaled.cpp @@ -67,7 +67,7 @@ void PairHybridScaled::compute(int eflag, int vflag) const int nvars = scalevars.size(); if (nvars > 0) { - double *vals = new double[nvars]; + auto vals = new double[nvars]; for (int k = 0; k < nvars; ++k) { int m = input->variable->find(scalevars[k].c_str()); if (m < 0) @@ -130,7 +130,7 @@ void PairHybridScaled::compute(int eflag, int vflag) Respa *respa = nullptr; respaflag = 0; if (utils::strmatch(update->integrate_style, "^respa")) { - respa = (Respa *) update->integrate; + respa = dynamic_cast( update->integrate); if (respa->nhybrid_styles > 0) respaflag = 1; } @@ -250,8 +250,8 @@ void PairHybridScaled::settings(int narg, char **arg) for (int m = 0; m < nstyles; m++) { delete styles[m]; delete[] keywords[m]; - if (special_lj[m]) delete[] special_lj[m]; - if (special_coul[m]) delete[] special_coul[m]; + delete[] special_lj[m]; + delete[] special_coul[m]; } delete[] styles; delete[] keywords; @@ -385,7 +385,7 @@ double PairHybridScaled::single(int i, int j, int itype, int jtype, double rsq, const int nvars = scalevars.size(); if (nvars > 0) { - double *vals = new double[nvars]; + auto vals = new double[nvars]; for (int k = 0; k < nvars; ++k) { int m = input->variable->find(scalevars[k].c_str()); if (m < 0) diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp index 0866d19fec..f41e5ef740 100644 --- a/src/pair_lj_cut.cpp +++ b/src/pair_lj_cut.cpp @@ -479,7 +479,7 @@ void PairLJCut::init_style() int list_style = NeighConst::REQ_DEFAULT; if (update->whichflag == 1 && utils::strmatch(update->integrate_style, "^respa")) { - auto respa = (Respa *) update->integrate; + auto respa = dynamic_cast( update->integrate); if (respa->level_inner >= 0) list_style = NeighConst::REQ_RESPA_INOUT; if (respa->level_middle >= 0) list_style = NeighConst::REQ_RESPA_ALL; } @@ -488,8 +488,8 @@ void PairLJCut::init_style() // set rRESPA cutoffs if (utils::strmatch(update->integrate_style, "^respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; + (dynamic_cast( update->integrate))->level_inner >= 0) + cut_respa = (dynamic_cast( update->integrate))->cutoff; else cut_respa = nullptr; } diff --git a/src/pair_table.cpp b/src/pair_table.cpp index 7b77a847f1..aefe9c4c4f 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -873,7 +873,7 @@ void PairTable::spline(double *x, double *y, int n, double yp1, double ypn, doub { int i, k; double p, qn, sig, un; - double *u = new double[n]; + auto u = new double[n]; if (yp1 > 0.99e30) y2[0] = u[0] = 0.0; diff --git a/src/platform.cpp b/src/platform.cpp index b2bca69934..8645bca6e1 100644 --- a/src/platform.cpp +++ b/src/platform.cpp @@ -678,7 +678,7 @@ std::string platform::current_directory() if (_getcwd(buf, MAX_PATH)) { cwd = buf; } delete[] buf; #else - char *buf = new char[PATH_MAX]; + auto buf = new char[PATH_MAX]; if (::getcwd(buf, PATH_MAX)) { cwd = buf; } delete[] buf; #endif diff --git a/src/procmap.cpp b/src/procmap.cpp index 3fc8a2263e..801a18c7a5 100644 --- a/src/procmap.cpp +++ b/src/procmap.cpp @@ -163,7 +163,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid, char node_name[MPI_MAX_PROCESSOR_NAME]; MPI_Get_processor_name(node_name,&name_length); node_name[name_length] = '\0'; - char *node_names = new char[MPI_MAX_PROCESSOR_NAME*nprocs]; + auto node_names = new char[MPI_MAX_PROCESSOR_NAME*nprocs]; MPI_Allgather(node_name,MPI_MAX_PROCESSOR_NAME,MPI_CHAR,node_names, MPI_MAX_PROCESSOR_NAME,MPI_CHAR,world); std::string node_string = std::string(node_name); diff --git a/src/random_park.cpp b/src/random_park.cpp index 34a5378a35..34f8396e44 100644 --- a/src/random_park.cpp +++ b/src/random_park.cpp @@ -94,7 +94,7 @@ void RanPark::reset(int ibase, double *coord) { int i; - char *str = (char *) &ibase; + auto str = (char *) &ibase; int n = sizeof(int); unsigned int hash = 0; diff --git a/src/rcb.cpp b/src/rcb.cpp index 92eafebc28..ef326793cc 100644 --- a/src/rcb.cpp +++ b/src/rcb.cpp @@ -1130,8 +1130,8 @@ void RCB::compute_old(int dimension, int n, double **x, double *wt, void box_merge(void *in, void *inout, int * /*len*/, MPI_Datatype * /*dptr*/) { - RCB::BBox *box1 = (RCB::BBox *) in; - RCB::BBox *box2 = (RCB::BBox *) inout; + auto box1 = (RCB::BBox *) in; + auto box2 = (RCB::BBox *) inout; for (int i = 0; i < 3; i++) { if (box1->lo[i] < box2->lo[i]) box2->lo[i] = box1->lo[i]; @@ -1160,8 +1160,8 @@ void box_merge(void *in, void *inout, int * /*len*/, MPI_Datatype * /*dptr*/) void median_merge(void *in, void *inout, int * /*len*/, MPI_Datatype * /*dptr*/) { - RCB::Median *med1 = (RCB::Median *) in; - RCB::Median *med2 = (RCB::Median *) inout; + auto med1 = (RCB::Median *) in; + auto med2 = (RCB::Median *) inout; med2->totallo += med1->totallo; if (med1->valuelo > med2->valuelo) { @@ -1209,8 +1209,7 @@ void RCB::invert(int sortflag) int *proclist; memory->create(proclist,nsend,"RCB:proclist"); - Invert *sinvert = - (Invert *) memory->smalloc(nsend*sizeof(Invert),"RCB:sinvert"); + auto sinvert = (Invert *) memory->smalloc(nsend*sizeof(Invert),"RCB:sinvert"); int m = 0; for (int i = nkeep; i < nfinal; i++) { @@ -1225,8 +1224,7 @@ void RCB::invert(int sortflag) // nrecv = # of my dots to send to other procs int nrecv = irregular->create_data(nsend,proclist,sortflag); - Invert *rinvert = - (Invert *) memory->smalloc(nrecv*sizeof(Invert),"RCB:rinvert"); + auto rinvert = (Invert *) memory->smalloc(nrecv*sizeof(Invert),"RCB:rinvert"); irregular->exchange_data((char *) sinvert,sizeof(Invert),(char *) rinvert); irregular->destroy_data(); diff --git a/src/read_data.cpp b/src/read_data.cpp index a46602d84a..5505b5a5a0 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -99,11 +99,11 @@ ReadData::ReadData(LAMMPS *lmp) : Command(lmp) // pointers to atom styles that store bonus info nellipsoids = 0; - avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid"); + avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); nlines = 0; - avec_line = (AtomVecLine *) atom->style_match("line"); + avec_line = dynamic_cast( atom->style_match("line")); ntris = 0; - avec_tri = (AtomVecTri *) atom->style_match("tri"); + avec_tri = dynamic_cast( atom->style_match("tri")); nbodies = 0; avec_body = (AtomVecBody *) atom->style_match("body"); } @@ -871,7 +871,7 @@ void ReadData::command(int narg, char **arg) if (addflag != NONE) { if (domain->triclinic) domain->x2lamda(atom->nlocal); - Irregular *irregular = new Irregular(lmp); + auto irregular = new Irregular(lmp); irregular->migrate_atoms(1); delete irregular; if (domain->triclinic) domain->lamda2x(atom->nlocal); @@ -887,7 +887,7 @@ void ReadData::command(int narg, char **arg) if (domain->nonperiodic == 2) { if (domain->triclinic) domain->x2lamda(atom->nlocal); domain->reset_box(); - Irregular *irregular = new Irregular(lmp); + auto irregular = new Irregular(lmp); irregular->migrate_atoms(1); delete irregular; if (domain->triclinic) domain->lamda2x(atom->nlocal); @@ -1013,114 +1013,80 @@ void ReadData::header(int firstpass) // search line for header keyword and set corresponding variable // customize for new header lines - // check for triangles before angles so "triangles" not matched as "angles" + int extra_flag_value = 0; - int rv; + auto words = utils::split_words(line); if (utils::strmatch(line,"^\\s*\\d+\\s+atoms\\s")) { - rv = sscanf(line,BIGINT_FORMAT,&natoms); - if (rv != 1) - error->all(FLERR,"Could not parse 'atoms' line in data file header"); + natoms = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->natoms = natoms; else if (firstpass) atom->natoms += natoms; } else if (utils::strmatch(line,"^\\s*\\d+\\s+ellipsoids\\s")) { - if (!avec_ellipsoid) - error->all(FLERR,"No ellipsoids allowed with this atom style"); - rv = sscanf(line,BIGINT_FORMAT,&nellipsoids); - if (rv != 1) - error->all(FLERR,"Could not parse 'ellipsoids' line in data file header"); + if (!avec_ellipsoid) error->all(FLERR,"No ellipsoids allowed with this atom style"); + nellipsoids = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nellipsoids = nellipsoids; else if (firstpass) atom->nellipsoids += nellipsoids; } else if (utils::strmatch(line,"^\\s*\\d+\\s+lines\\s")) { - if (!avec_line) - error->all(FLERR,"No lines allowed with this atom style"); - rv = sscanf(line,BIGINT_FORMAT,&nlines); - if (rv != 1) - error->all(FLERR,"Could not parse 'lines' line in data file header"); + if (!avec_line) error->all(FLERR,"No lines allowed with this atom style"); + nlines = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nlines = nlines; else if (firstpass) atom->nlines += nlines; } else if (utils::strmatch(line,"^\\s*\\d+\\s+triangles\\s")) { - if (!avec_tri) - error->all(FLERR,"No triangles allowed with this atom style"); - rv = sscanf(line,BIGINT_FORMAT,&ntris); - if (rv != 1) - error->all(FLERR,"Could not parse 'triangles' line in data file header"); + if (!avec_tri) error->all(FLERR,"No triangles allowed with this atom style"); + ntris = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->ntris = ntris; else if (firstpass) atom->ntris += ntris; } else if (utils::strmatch(line,"^\\s*\\d+\\s+bodies\\s")) { - if (!avec_body) - error->all(FLERR,"No bodies allowed with this atom style"); - rv = sscanf(line,BIGINT_FORMAT,&nbodies); - if (rv != 1) - error->all(FLERR,"Could not parse 'bodies' line in data file header"); + if (!avec_body) error->all(FLERR,"No bodies allowed with this atom style"); + nbodies = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nbodies = nbodies; else if (firstpass) atom->nbodies += nbodies; } else if (utils::strmatch(line,"^\\s*\\d+\\s+bonds\\s")) { - rv = sscanf(line,BIGINT_FORMAT,&nbonds); - if (rv != 1) - error->all(FLERR,"Could not parse 'bonds' line in data file header"); + nbonds = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nbonds = nbonds; else if (firstpass) atom->nbonds += nbonds; } else if (utils::strmatch(line,"^\\s*\\d+\\s+angles\\s")) { - rv = sscanf(line,BIGINT_FORMAT,&nangles); - if (rv != 1) - error->all(FLERR,"Could not parse 'angles' line in data file header"); + nangles = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nangles = nangles; else if (firstpass) atom->nangles += nangles; } else if (utils::strmatch(line,"^\\s*\\d+\\s+dihedrals\\s")) { - rv = sscanf(line,BIGINT_FORMAT,&ndihedrals); - if (rv != 1) - error->all(FLERR,"Could not parse 'dihedrals' line in data file header"); + ndihedrals = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->ndihedrals = ndihedrals; else if (firstpass) atom->ndihedrals += ndihedrals; } else if (utils::strmatch(line,"^\\s*\\d+\\s+impropers\\s")) { - rv = sscanf(line,BIGINT_FORMAT,&nimpropers); - if (rv != 1) - error->all(FLERR,"Could not parse 'impropers' line in data file header"); + nimpropers = utils::bnumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nimpropers = nimpropers; else if (firstpass) atom->nimpropers += nimpropers; // Atom class type settings are only set by first data file } else if (utils::strmatch(line,"^\\s*\\d+\\s+atom\\s+types\\s")) { - rv = sscanf(line,"%d",&ntypes); - if (rv != 1) - error->all(FLERR,"Could not parse 'atom types' line in data file header"); + ntypes = utils::inumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->ntypes = ntypes + extra_atom_types; } else if (utils::strmatch(line,"\\s*\\d+\\s+bond\\s+types\\s")) { - rv = sscanf(line,"%d",&nbondtypes); - if (rv != 1) - error->all(FLERR,"Could not parse 'bond types' line in data file header"); + nbondtypes = utils::inumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nbondtypes = nbondtypes + extra_bond_types; } else if (utils::strmatch(line,"^\\s*\\d+\\s+angle\\s+types\\s")) { - rv = sscanf(line,"%d",&nangletypes); - if (rv != 1) - error->all(FLERR,"Could not parse 'angle types' line in data file header"); + nangletypes = utils::inumeric(FLERR, words[0], false, lmp); if (addflag == NONE) atom->nangletypes = nangletypes + extra_angle_types; } else if (utils::strmatch(line,"^\\s*\\d+\\s+dihedral\\s+types\\s")) { - rv = sscanf(line,"%d",&ndihedraltypes); - if (rv != 1) - error->all(FLERR,"Could not parse 'dihedral types' line in data file header"); - if (addflag == NONE) - atom->ndihedraltypes = ndihedraltypes + extra_dihedral_types; + ndihedraltypes = utils::inumeric(FLERR, words[0], false, lmp); + if (addflag == NONE) atom->ndihedraltypes = ndihedraltypes + extra_dihedral_types; } else if (utils::strmatch(line,"^\\s*\\d+\\s+improper\\s+types\\s")) { - rv = sscanf(line,"%d",&nimpropertypes); - if (rv != 1) - error->all(FLERR,"Could not parse 'improper types' line in data file header"); - if (addflag == NONE) - atom->nimpropertypes = nimpropertypes + extra_improper_types; + nimpropertypes = utils::inumeric(FLERR, words[0], false, lmp); + if (addflag == NONE) atom->nimpropertypes = nimpropertypes + extra_improper_types; // these settings only used by first data file // also, these are obsolescent. we parse them to maintain backward @@ -1129,45 +1095,41 @@ void ReadData::header(int firstpass) // the input and the data file, we use the larger of the two. } else if (strstr(line,"extra bond per atom")) { - if (addflag == NONE) sscanf(line,"%d",&extra_flag_value); + if (addflag == NONE) extra_flag_value = utils::inumeric(FLERR, words[0], false, lmp); atom->extra_bond_per_atom = MAX(atom->extra_bond_per_atom,extra_flag_value); } else if (strstr(line,"extra angle per atom")) { - if (addflag == NONE) sscanf(line,"%d",&extra_flag_value); + if (addflag == NONE) extra_flag_value = utils::inumeric(FLERR, words[0], false, lmp); atom->extra_angle_per_atom = MAX(atom->extra_angle_per_atom,extra_flag_value); } else if (strstr(line,"extra dihedral per atom")) { - if (addflag == NONE) sscanf(line,"%d",&extra_flag_value); + if (addflag == NONE) extra_flag_value = utils::inumeric(FLERR, words[0], false, lmp); atom->extra_dihedral_per_atom = MAX(atom->extra_dihedral_per_atom,extra_flag_value); } else if (strstr(line,"extra improper per atom")) { - if (addflag == NONE) sscanf(line,"%d",&extra_flag_value); + if (addflag == NONE) extra_flag_value = utils::inumeric(FLERR, words[0], false, lmp); atom->extra_improper_per_atom = MAX(atom->extra_improper_per_atom,extra_flag_value); } else if (strstr(line,"extra special per atom")) { - if (addflag == NONE) sscanf(line,"%d",&extra_flag_value); + if (addflag == NONE) extra_flag_value = utils::inumeric(FLERR, words[0], false, lmp); force->special_extra = MAX(force->special_extra,extra_flag_value); // local copy of box info // so can treat differently for first vs subsequent data files } else if (utils::strmatch(line,"^\\s*\\f+\\s+\\f+\\s+xlo\\s+xhi\\s")) { - rv = sscanf(line,"%lg %lg",&boxlo[0],&boxhi[0]); - if (rv != 2) - error->all(FLERR,"Could not parse 'xlo xhi' line in data file header"); + boxlo[0] = utils::numeric(FLERR, words[0], false, lmp); + boxhi[0] = utils::numeric(FLERR, words[1], false, lmp); } else if (utils::strmatch(line,"^\\s*\\f+\\s+\\f+\\s+ylo\\s+yhi\\s")) { - rv = sscanf(line,"%lg %lg",&boxlo[1],&boxhi[1]); - if (rv != 2) - error->all(FLERR,"Could not parse 'ylo yhi' line in data file header"); + boxlo[1] = utils::numeric(FLERR, words[0], false, lmp); + boxhi[1] = utils::numeric(FLERR, words[1], false, lmp); } else if (utils::strmatch(line,"^\\s*\\f+\\s+\\f+\\s+zlo\\s+zhi\\s")) { - rv = sscanf(line,"%lg %lg",&boxlo[2],&boxhi[2]); - if (rv != 2) - error->all(FLERR,"Could not parse 'zlo zhi' line in data file header"); + boxlo[2] = utils::numeric(FLERR, words[0], false, lmp); + boxhi[2] = utils::numeric(FLERR, words[1], false, lmp); - } else if (utils::strmatch(line,"^\\s*\\f+\\s+\\f+\\s+\\f+" - "\\s+xy\\s+xz\\s+yz\\s")) { + } else if (utils::strmatch(line,"^\\s*\\f+\\s+\\f+\\s+\\f+\\s+xy\\s+xz\\s+yz\\s")) { triclinic = 1; - rv = sscanf(line,"%lg %lg %lg",&xy,&xz,&yz); - if (rv != 3) - error->all(FLERR,"Could not parse 'xy xz yz' line in data file header"); + xy = utils::numeric(FLERR, words[0], false, lmp); + xz = utils::numeric(FLERR, words[1], false, lmp); + yz = utils::numeric(FLERR, words[2], false, lmp); } else break; } @@ -1776,7 +1738,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) void ReadData::mass() { char *next; - char *buf = new char[ntypes*MAXLINE]; + auto buf = new char[ntypes*MAXLINE]; int eof = utils::read_lines_from_file(fp,ntypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); @@ -1796,7 +1758,7 @@ void ReadData::mass() void ReadData::paircoeffs() { char *next; - char *buf = new char[ntypes*MAXLINE]; + auto buf = new char[ntypes*MAXLINE]; int eof = utils::read_lines_from_file(fp,ntypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); @@ -1822,7 +1784,7 @@ void ReadData::pairIJcoeffs() char *next; int nsq = ntypes * (ntypes+1) / 2; - char *buf = new char[nsq * MAXLINE]; + auto buf = new char[nsq * MAXLINE]; int eof = utils::read_lines_from_file(fp,nsq,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); @@ -1848,7 +1810,7 @@ void ReadData::bondcoeffs() if (!nbondtypes) return; char *next; - char *buf = new char[nbondtypes*MAXLINE]; + auto buf = new char[nbondtypes*MAXLINE]; int eof = utils::read_lines_from_file(fp,nbondtypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); @@ -1873,7 +1835,7 @@ void ReadData::anglecoeffs(int which) if (!nangletypes) return; char *next; - char *buf = new char[nangletypes*MAXLINE]; + auto buf = new char[nangletypes*MAXLINE]; int eof = utils::read_lines_from_file(fp,nangletypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); @@ -1899,7 +1861,7 @@ void ReadData::dihedralcoeffs(int which) if (!ndihedraltypes) return; char *next; - char *buf = new char[ndihedraltypes*MAXLINE]; + auto buf = new char[ndihedraltypes*MAXLINE]; int eof = utils::read_lines_from_file(fp,ndihedraltypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); @@ -1929,7 +1891,7 @@ void ReadData::impropercoeffs(int which) if (!nimpropertypes) return; char *next; - char *buf = new char[nimpropertypes*MAXLINE]; + auto buf = new char[nimpropertypes*MAXLINE]; int eof = utils::read_lines_from_file(fp,nimpropertypes,MAXLINE,buf,me,world); if (eof) error->all(FLERR,"Unexpected end of data file"); diff --git a/src/read_dump.cpp b/src/read_dump.cpp index f3ca55f94f..f1dc8fc62e 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -233,7 +233,7 @@ void ReadDump::setup_reader(int narg, char **arg) // create Nreader reader classes per reader // match readerstyle to options in style_reader.h - if (false) { + if (false) { // NOLINT return; // dummy line to enable else-if macro expansion #define READER_CLASS @@ -1078,7 +1078,7 @@ void ReadDump::migrate_old_atoms() for (int i = 0; i < nlocal; i++) procassign[i] = tag[i] % nprocs; - Irregular *irregular = new Irregular(lmp); + auto irregular = new Irregular(lmp); irregular->migrate_atoms(1,1,procassign); delete irregular; @@ -1101,7 +1101,7 @@ void ReadDump::migrate_new_atoms() procassign[i] = mtag % nprocs; } - Irregular *irregular = new Irregular(lmp); + auto irregular = new Irregular(lmp); int nrecv = irregular->create_data(nnew,procassign,1); int newmaxnew = MAX(nrecv,maxnew); newmaxnew = MAX(newmaxnew,1); // avoid null pointer @@ -1138,7 +1138,7 @@ void ReadDump::migrate_atoms_by_coords() if (triclinic) domain->x2lamda(atom->nlocal); domain->reset_box(); - Irregular *irregular = new Irregular(lmp); + auto irregular = new Irregular(lmp); irregular->migrate_atoms(1); delete irregular; if (triclinic) domain->lamda2x(atom->nlocal); diff --git a/src/read_restart.cpp b/src/read_restart.cpp index f8ac14534b..dea062ed87 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -434,7 +434,7 @@ void ReadRestart::command(int narg, char **arg) atom->map_set(); } if (domain->triclinic) domain->x2lamda(atom->nlocal); - Irregular *irregular = new Irregular(lmp); + auto irregular = new Irregular(lmp); irregular->migrate_atoms(1); delete irregular; if (domain->triclinic) domain->lamda2x(atom->nlocal); @@ -445,7 +445,7 @@ void ReadRestart::command(int narg, char **arg) if (nextra) { memory->destroy(atom->extra); memory->create(atom->extra,atom->nmax,nextra,"atom:extra"); - auto fix = (FixReadRestart *) modify->get_fix_by_id("_read_restart"); + auto fix = dynamic_cast( modify->get_fix_by_id("_read_restart")); int *count = fix->count; double **extra = fix->extra; double **atom_extra = atom->extra; @@ -759,7 +759,7 @@ void ReadRestart::header() } else if (flag == ATOM_STYLE) { char *style = read_string(); int nargcopy = read_int(); - char **argcopy = new char*[nargcopy]; + auto argcopy = new char*[nargcopy]; for (int i = 0; i < nargcopy; i++) argcopy[i] = read_string(); atom->create_avec(style,nargcopy,argcopy,1); @@ -879,7 +879,7 @@ void ReadRestart::type_arrays() if (flag == MASS) { read_int(); - double *mass = new double[atom->ntypes+1]; + auto mass = new double[atom->ntypes+1]; read_double_vec(atom->ntypes,&mass[1]); atom->set_mass(mass); delete[] mass; @@ -1100,7 +1100,7 @@ void ReadRestart::file_layout() void ReadRestart::magic_string() { int n = strlen(MAGIC_STRING) + 1; - char *str = new char[n]; + auto str = new char[n]; int count; if (me == 0) count = fread(str,sizeof(char),n,fp); @@ -1142,7 +1142,7 @@ void ReadRestart::check_eof_magic() if (revision < 1) return; int n = strlen(MAGIC_STRING) + 1; - char *str = new char[n]; + auto str = new char[n]; // read magic string at end of file and restore file pointer @@ -1210,7 +1210,7 @@ char *ReadRestart::read_string() { int n = read_int(); if (n < 0) error->all(FLERR,"Illegal size string or corrupt restart"); - char *value = new char[n]; + auto value = new char[n]; if (me == 0) utils::sfread(FLERR,value,sizeof(char),n,fp,nullptr,error); MPI_Bcast(value,n,MPI_CHAR,0,world); return value; diff --git a/src/reader_native.cpp b/src/reader_native.cpp index 32b2279a60..911de417eb 100644 --- a/src/reader_native.cpp +++ b/src/reader_native.cpp @@ -101,9 +101,7 @@ int ReaderNative::read_time(bigint &ntimestep) error->one(FLERR,"Dump file is incorrectly formatted"); read_lines(1); - int rv = sscanf(line,BIGINT_FORMAT,&ntimestep); - if (rv != 1) - error->one(FLERR,"Dump file is incorrectly formatted"); + ntimestep = utils::bnumeric(FLERR, utils::trim(line), true, lmp); } return 0; } @@ -140,16 +138,12 @@ void ReaderNative::skip() } else { read_lines(2); - bigint natoms; - int rv = sscanf(line,BIGINT_FORMAT,&natoms); - if (rv != 1) error->one(FLERR,"Dump file is incorrectly formatted"); - + bigint nremain = utils::bnumeric(FLERR, utils::trim(line), true, lmp); read_lines(5); // invoke read_lines() in chunks no larger than MAXSMALLINT int nchunk; - bigint nremain = natoms; while (nremain) { nchunk = MIN(nremain,MAXSMALLINT); read_lines(nchunk); @@ -230,16 +224,13 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, return natoms; } - if (is_known_magic_str() && revision > 0x0001) { // newer format includes units string, columns string // and time read_buf(&len, sizeof(int), 1); - if (len > 0) { - // has units - unit_style = read_binary_str(len); - } + // has units + if (len > 0) unit_style = read_binary_str(len); char flag = 0; read_buf(&flag, sizeof(char), 1); @@ -259,12 +250,9 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, ichunk = 0; iatom_chunk = 0; } else { - int rv; read_lines(2); - rv = sscanf(line,BIGINT_FORMAT,&natoms); - if (rv != 1) - error->one(FLERR,"Dump file is incorrectly formatted"); + natoms = utils::bnumeric(FLERR, utils::trim(line), true, lmp); boxinfo = 1; triclinic = 0; @@ -272,20 +260,27 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, read_lines(1); if (line[strlen("ITEM: BOX BOUNDS ")] == 'x') triclinic = 1; - read_lines(1); - if (!triclinic) rv = 2 - sscanf(line,"%lg %lg",&box[0][0],&box[0][1]); - else rv = 3 - sscanf(line,"%lg %lg %lg",&box[0][0],&box[0][1],&box[0][2]); - if (rv != 0) error->one(FLERR,"Dump file is incorrectly formatted"); + try { + read_lines(1); + ValueTokenizer values(line); + box[0][0] = values.next_double(); + box[0][1] = values.next_double(); + if (triclinic) box[0][2] = values.next_double(); - read_lines(1); - if (!triclinic) rv = 2 - sscanf(line,"%lg %lg",&box[1][0],&box[1][1]); - else rv = 3 - sscanf(line,"%lg %lg %lg",&box[1][0],&box[1][1],&box[1][2]); - if (rv != 0) error->one(FLERR,"Dump file is incorrectly formatted"); + read_lines(1); + values = ValueTokenizer(line); + box[1][0] = values.next_double(); + box[1][1] = values.next_double(); + if (triclinic) box[1][2] = values.next_double(); - read_lines(1); - if (!triclinic) rv = 2 - sscanf(line,"%lg %lg",&box[2][0],&box[2][1]); - else rv = 3 - sscanf(line,"%lg %lg %lg",&box[2][0],&box[2][1],&box[2][2]); - if (rv != 0) error->one(FLERR,"Dump file is incorrectly formatted"); + read_lines(1); + values = ValueTokenizer(line); + box[2][0] = values.next_double(); + box[2][1] = values.next_double(); + if (triclinic) box[2][2] = values.next_double(); + } catch (std::exception &e) { + error->one(FLERR, "Dump file is incorrectly formatted: {}", e.what()); + } read_lines(1); @@ -295,7 +290,7 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, // extract column labels and match to requested fields - labelline = &line[strlen("ITEM: ATOMS ")]; + labelline = line + strlen("ITEM: ATOMS "); } Tokenizer tokens(labelline); diff --git a/src/rerun.cpp b/src/rerun.cpp index 83971f6adc..b788cfcaec 100644 --- a/src/rerun.cpp +++ b/src/rerun.cpp @@ -122,7 +122,7 @@ void Rerun::command(int narg, char **arg) // pass list of filenames to ReadDump // along with post-"dump" args and post-"format" args - ReadDump *rd = new ReadDump(lmp); + auto rd = new ReadDump(lmp); rd->store_files(nfile,arg); if (nremain) diff --git a/src/reset_atom_ids.cpp b/src/reset_atom_ids.cpp index 822490ffc8..5a6e5170bd 100644 --- a/src/reset_atom_ids.cpp +++ b/src/reset_atom_ids.cpp @@ -386,8 +386,7 @@ void ResetIDs::sort() int *proclist; memory->create(proclist,nlocal,"special:proclist"); - AtomRvous *atombuf = (AtomRvous *) - memory->smalloc((bigint) nlocal*sizeof(AtomRvous),"resetIDs:idbuf"); + auto atombuf = (AtomRvous *) memory->smalloc((bigint) nlocal*sizeof(AtomRvous),"resetIDs:idbuf"); int ibinx,ibiny,ibinz,iproc; bigint ibin; @@ -413,10 +412,9 @@ void ResetIDs::sort() // perform rendezvous operation, send atombuf to other procs char *buf; - int nreturn = comm->rendezvous(1,nlocal,(char *) atombuf,sizeof(AtomRvous), - 0,proclist, + int nreturn = comm->rendezvous(1,nlocal,(char *) atombuf,sizeof(AtomRvous),0,proclist, sort_bins,0,buf,sizeof(IDRvous),(void *) this); - IDRvous *outbuf = (IDRvous *) buf; + auto outbuf = (IDRvous *) buf; memory->destroy(proclist); memory->sfree(atombuf); @@ -439,13 +437,11 @@ void ResetIDs::sort() outbuf = list of N IDRvous datums, sent back to sending proc ------------------------------------------------------------------------- */ -int ResetIDs::sort_bins(int n, char *inbuf, - int &flag, int *&proclist, char *&outbuf, - void *ptr) +int ResetIDs::sort_bins(int n, char *inbuf, int &flag, int *&proclist, char *&outbuf, void *ptr) { int i,ibin,index; - ResetIDs *rptr = (ResetIDs *) ptr; + auto rptr = (ResetIDs *) ptr; Memory *memory = rptr->memory; Error *error = rptr->error; MPI_Comm world = rptr->world; @@ -470,7 +466,7 @@ int ResetIDs::sort_bins(int n, char *inbuf, count[ibin] = 0; } - AtomRvous *in = (AtomRvous *) inbuf; + auto in = (AtomRvous *) inbuf; for (i = 0; i < n; i++) { if (in[i].ibin < binlo || in[i].ibin >= binhi) { @@ -530,8 +526,7 @@ int ResetIDs::sort_bins(int n, char *inbuf, int nout = n; memory->create(proclist,nout,"resetIDs:proclist"); - IDRvous *out = (IDRvous *) - memory->smalloc(nout*sizeof(IDRvous),"resetIDs:out"); + auto out = (IDRvous *) memory->smalloc(nout*sizeof(IDRvous),"resetIDs:out"); tagint one = nprev + 1; for (ibin = 0; ibin < nbins; ibin++) { @@ -593,7 +588,7 @@ int compare_coords(const void *iptr, const void *jptr) int compare_coords(const int i, const int j, void *ptr) { - ResetIDs::AtomRvous *rvous = (ResetIDs::AtomRvous *) ptr; + auto rvous = (ResetIDs::AtomRvous *) ptr; double *xi = rvous[i].x; double *xj = rvous[j].x; if (xi[0] < xj[0]) return -1; diff --git a/src/reset_mol_ids.cpp b/src/reset_mol_ids.cpp index a29ea98e18..30a817433e 100644 --- a/src/reset_mol_ids.cpp +++ b/src/reset_mol_ids.cpp @@ -152,13 +152,13 @@ void ResetMolIDs::create_computes(char *fixid, char *groupid) idfrag = fmt::format("{}_reset_mol_ids_FRAGMENT_ATOM",fixid); auto use_single = singleflag ? "yes" : "no"; - cfa = (ComputeFragmentAtom *) - modify->add_compute(fmt::format("{} {} fragment/atom single {}",idfrag,groupid,use_single)); + cfa = dynamic_cast( + modify->add_compute(fmt::format("{} {} fragment/atom single {}",idfrag,groupid,use_single))); idchunk = fmt::format("{}_reset_mol_ids_CHUNK_ATOM",fixid); if (compressflag) - cca = (ComputeChunkAtom *) - modify->add_compute(fmt::format("{} {} chunk/atom molecule compress yes",idchunk,groupid)); + cca = dynamic_cast( + modify->add_compute(fmt::format("{} {} chunk/atom molecule compress yes",idchunk,groupid))); } /* ---------------------------------------------------------------------- @@ -231,7 +231,7 @@ void ResetMolIDs::reset() for (int i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { - tagint newid = static_cast(chunkIDs[i]); + auto newid = static_cast(chunkIDs[i]); if (singleexist) { if (newid == 1) newid = 0; else newid += offset - 1; diff --git a/src/respa.cpp b/src/respa.cpp index 9690105d40..97356eac47 100644 --- a/src/respa.cpp +++ b/src/respa.cpp @@ -121,7 +121,7 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : // the hybrid keyword requires a hybrid pair style if (!utils::strmatch(force->pair_style, "^hybrid")) error->all(FLERR, "Illegal run_style respa command"); - PairHybrid *hybrid = (PairHybrid *) force->pair; + auto hybrid = dynamic_cast( force->pair); nhybrid_styles = hybrid->nstyles; // each hybrid sub-style needs to be assigned to a respa level if (iarg + nhybrid_styles > narg) error->all(FLERR, "Illegal run_style respa command"); @@ -296,7 +296,7 @@ void Respa::init() std::string cmd = fmt::format("RESPA all RESPA {}", nlevels); if (atom->torque_flag) cmd += " torque"; - fix_respa = (FixRespa *) modify->add_fix(cmd); + fix_respa = dynamic_cast( modify->add_fix(cmd)); // insure respa inner/middle/outer is using Pair class that supports it diff --git a/src/set.cpp b/src/set.cpp index d0de0b4e62..904863a596 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -50,7 +50,7 @@ enum{TYPE,TYPE_FRACTION,TYPE_RATIO,TYPE_SUBSET, THETA,THETA_RANDOM,ANGMOM,OMEGA, DIAMETER,DENSITY,VOLUME,IMAGE,BOND,ANGLE,DIHEDRAL,IMPROPER, SPH_E,SPH_CV,SPH_RHO,EDPD_TEMP,EDPD_CV,CC,SMD_MASS_DENSITY, - SMD_CONTACT_RADIUS,DPDTHETA,IVEC,DVEC,IARRAY,DARRAY}; + SMD_CONTACT_RADIUS,DPDTHETA,EPSILON,IVEC,DVEC,IARRAY,DARRAY}; #define BIG INT_MAX @@ -303,7 +303,7 @@ void Set::command(int narg, char **arg) else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (utils::strmatch(arg[iarg+4],"^v_")) varparse(arg[iarg+4],4); else wvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); - if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag) + if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag && !atom->quat_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(QUAT); iarg += 5; @@ -311,7 +311,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"quat/random") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); - if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag) + if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag && !atom->quat_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0) error->all(FLERR,"Invalid random number seed in set command"); @@ -568,6 +568,19 @@ void Set::command(int narg, char **arg) set(DPDTHETA); iarg += 2; + } else if (strcmp(arg[iarg],"epsilon") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); + if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; + else if (utils::strmatch(arg[iarg+1],"^v_")) varparse(arg[iarg+1],1); + else { + dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); + if (dvalue < 0.0) error->all(FLERR,"Illegal set command"); + } + if (!atom->dielectric_flag) + error->all(FLERR,"Cannot set epsilon for this atom style"); + set(EPSILON); + iarg += 2; + } else { // set custom per-atom vector or array or error out @@ -767,11 +780,10 @@ void Set::set(int keyword) // loop over selected atoms - AtomVecEllipsoid *avec_ellipsoid = - (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - AtomVecLine *avec_line = (AtomVecLine *) atom->style_match("line"); - AtomVecTri *avec_tri = (AtomVecTri *) atom->style_match("tri"); - AtomVecBody *avec_body = (AtomVecBody *) atom->style_match("body"); + auto avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + auto avec_line = dynamic_cast( atom->style_match("line")); + auto avec_tri = dynamic_cast( atom->style_match("tri")); + auto avec_body = dynamic_cast( atom->style_match("body")); int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) { @@ -934,31 +946,44 @@ void Set::set(int keyword) sp[i][3] = dvalue; } - // set quaternion orientation of ellipsoid or tri or body particle - // set quaternion orientation of ellipsoid or tri or body particle + // set quaternion orientation of ellipsoid or tri or body particle or sphere/bpm // enforce quat rotation vector in z dir for 2d systems else if (keyword == QUAT) { double *quat = nullptr; + double **quat2 = nullptr; if (avec_ellipsoid && atom->ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat; else if (avec_tri && atom->tri[i] >= 0) quat = avec_tri->bonus[atom->tri[i]].quat; else if (avec_body && atom->body[i] >= 0) quat = avec_body->bonus[atom->body[i]].quat; + else if (atom->quat_flag) + quat2 = atom->quat; else error->one(FLERR,"Cannot set quaternion for atom that has none"); if (domain->dimension == 2 && (xvalue != 0.0 || yvalue != 0.0)) - error->one(FLERR,"Cannot set quaternion with xy components " - "for 2d system"); + error->one(FLERR,"Cannot set quaternion with xy components for 2d system"); - double theta2 = MY_PI2 * wvalue/180.0; - double sintheta2 = sin(theta2); - quat[0] = cos(theta2); - quat[1] = xvalue * sintheta2; - quat[2] = yvalue * sintheta2; - quat[3] = zvalue * sintheta2; - MathExtra::qnormalize(quat); + const double theta2 = MY_PI2 * wvalue/180.0; + const double sintheta2 = sin(theta2); + double temp[4]; + temp[0] = cos(theta2); + temp[1] = xvalue * sintheta2; + temp[2] = yvalue * sintheta2; + temp[3] = zvalue * sintheta2; + MathExtra::qnormalize(temp); + if (atom->quat_flag) { + quat2[i][0] = temp[0]; + quat2[i][1] = temp[1]; + quat2[i][2] = temp[2]; + quat2[i][3] = temp[3]; + } else { + quat[0] = temp[0]; + quat[1] = temp[1]; + quat[2] = temp[2]; + quat[3] = temp[3]; + } } // set theta of line particle @@ -1000,6 +1025,22 @@ void Set::set(int keyword) (((imageint) (zbox + IMGMAX) & IMGMASK) << IMG2BITS); } + // set the local dielectric constant + + else if (keyword == EPSILON) { + if (dvalue >= 0.0) { + + // compute the unscaled charge value (i.e. atom->q_unscaled) + // assign the new local dielectric constant + // update both the scaled and unscaled charge values + + double q_unscaled = atom->q[i] * atom->epsilon[i]; + atom->epsilon[i] = dvalue; + atom->q[i] = q_unscaled / dvalue; + atom->q_unscaled[i] = q_unscaled; + } + } + // set value for custom property vector or array else if (keyword == IVEC) { @@ -1055,17 +1096,16 @@ void Set::setrandom(int keyword) { int i; - AtomVecEllipsoid *avec_ellipsoid = - (AtomVecEllipsoid *) atom->style_match("ellipsoid"); - AtomVecLine *avec_line = (AtomVecLine *) atom->style_match("line"); - AtomVecTri *avec_tri = (AtomVecTri *) atom->style_match("tri"); - AtomVecBody *avec_body = (AtomVecBody *) atom->style_match("body"); + auto avec_ellipsoid = dynamic_cast( atom->style_match("ellipsoid")); + auto avec_line = dynamic_cast( atom->style_match("line")); + auto avec_tri = dynamic_cast( atom->style_match("tri")); + auto avec_body = dynamic_cast( atom->style_match("body")); double **x = atom->x; int seed = ivalue; - RanPark *ranpark = new RanPark(lmp,1); - RanMars *ranmars = new RanMars(lmp,seed + comm->me); + auto ranpark = new RanPark(lmp,1); + auto ranmars = new RanMars(lmp,seed + comm->me); // set approx fraction of atom types to newtype @@ -1220,6 +1260,7 @@ void Set::setrandom(int keyword) } else if (keyword == QUAT_RANDOM) { int nlocal = atom->nlocal; double *quat; + double **quat2; if (domain->dimension == 3) { double s,t1,t2,theta1,theta2; @@ -1231,6 +1272,8 @@ void Set::setrandom(int keyword) quat = avec_tri->bonus[atom->tri[i]].quat; else if (avec_body && atom->body[i] >= 0) quat = avec_body->bonus[atom->body[i]].quat; + else if (atom->quat_flag) + quat2 = atom->quat; else error->one(FLERR,"Cannot set quaternion for atom that has none"); @@ -1240,10 +1283,17 @@ void Set::setrandom(int keyword) t2 = sqrt(s); theta1 = 2.0*MY_PI*ranpark->uniform(); theta2 = 2.0*MY_PI*ranpark->uniform(); - quat[0] = cos(theta2)*t2; - quat[1] = sin(theta1)*t1; - quat[2] = cos(theta1)*t1; - quat[3] = sin(theta2)*t2; + if (atom->quat_flag) { + quat2[i][0] = cos(theta2)*t2; + quat2[i][1] = sin(theta1)*t1; + quat2[i][2] = cos(theta1)*t1; + quat2[i][3] = sin(theta2)*t2; + } else { + quat[0] = cos(theta2)*t2; + quat[1] = sin(theta1)*t1; + quat[2] = cos(theta1)*t1; + quat[3] = sin(theta2)*t2; + } count++; } @@ -1255,15 +1305,24 @@ void Set::setrandom(int keyword) quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat; else if (avec_body && atom->body[i] >= 0) quat = avec_body->bonus[atom->body[i]].quat; + else if (atom->quat_flag) + quat2 = atom->quat; else error->one(FLERR,"Cannot set quaternion for atom that has none"); ranpark->reset(seed,x[i]); theta2 = MY_PI*ranpark->uniform(); - quat[0] = cos(theta2); - quat[1] = 0.0; - quat[2] = 0.0; - quat[3] = sin(theta2); + if (atom->quat_flag) { + quat2[i][0] = cos(theta2); + quat2[i][1] = 0.0; + quat2[i][2] = 0.0; + quat2[i][3] = sin(theta2); + } else { + quat[0] = cos(theta2); + quat[1] = 0.0; + quat[2] = 0.0; + quat[3] = sin(theta2); + } count++; } } diff --git a/src/special.cpp b/src/special.cpp index ceba160be2..4aa80bc443 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -165,8 +165,7 @@ void Special::atom_owners() int *proclist; memory->create(proclist,nlocal,"special:proclist"); - IDRvous *idbuf = (IDRvous *) - memory->smalloc((bigint) nlocal*sizeof(IDRvous),"special:idbuf"); + auto idbuf = (IDRvous *) memory->smalloc((bigint) nlocal*sizeof(IDRvous),"special:idbuf"); // setup input buf for rendezvous comm // one datum for each owned atom: datum = owning proc, atomID @@ -215,8 +214,7 @@ void Special::onetwo_build_newton() int *proclist; memory->create(proclist,nsend,"special:proclist"); - PairRvous *inbuf = (PairRvous *) - memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); + auto inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); // setup input buf to rendezvous comm // one datum for each unowned bond partner: bond partner ID, atomID @@ -239,7 +237,7 @@ void Special::onetwo_build_newton() char *buf; int nreturn = comm->rendezvous(RVOUS,nsend,(char *) inbuf,sizeof(PairRvous), 0,proclist, rendezvous_pairs,0,buf,sizeof(PairRvous), (void *) this); - PairRvous *outbuf = (PairRvous *) buf; + auto outbuf = (PairRvous *) buf; memory->destroy(proclist); memory->sfree(inbuf); @@ -341,8 +339,7 @@ void Special::onethree_build() int *proclist; memory->create(proclist,nsend,"special:proclist"); - PairRvous *inbuf = (PairRvous *) - memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); + auto inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); // setup input buf to rendezvous comm // datums = pairs of onetwo partners where either is unknown @@ -371,7 +368,7 @@ void Special::onethree_build() char *buf; int nreturn = comm->rendezvous(RVOUS,nsend,(char *) inbuf,sizeof(PairRvous), 0,proclist, rendezvous_pairs,0,buf,sizeof(PairRvous), (void *) this); - PairRvous *outbuf = (PairRvous *) buf; + auto outbuf = (PairRvous *) buf; memory->destroy(proclist); memory->sfree(inbuf); @@ -444,8 +441,7 @@ void Special::onefour_build() int *proclist; memory->create(proclist,nsend,"special:proclist"); - PairRvous *inbuf = (PairRvous *) - memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); + auto inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); // setup input buf to rendezvous comm // datums = pairs of onethree and onetwo partners where onethree is unknown @@ -473,7 +469,7 @@ void Special::onefour_build() char *buf; int nreturn = comm->rendezvous(RVOUS,nsend,(char *) inbuf,sizeof(PairRvous), 0,proclist, rendezvous_pairs,0,buf,sizeof(PairRvous), (void *) this); - PairRvous *outbuf = (PairRvous *) buf; + auto outbuf = (PairRvous *) buf; memory->destroy(proclist); memory->sfree(inbuf); @@ -688,10 +684,10 @@ void Special::combine() utils::logmesg(lmp,"{:>6} = max # of special neighbors\n",atom->maxspecial); if (lmp->kokkos) { - AtomKokkos* atomKK = (AtomKokkos*) atom; + auto atomKK = dynamic_cast( atom); atomKK->modified(Host,SPECIAL_MASK); atomKK->sync(Device,SPECIAL_MASK); - MemoryKokkos* memoryKK = (MemoryKokkos*) memory; + auto memoryKK = dynamic_cast( memory); memoryKK->grow_kokkos(atomKK->k_special,atom->special, atom->nmax,atom->maxspecial,"atom:special"); atomKK->modified(Device,SPECIAL_MASK); @@ -825,8 +821,7 @@ void Special::angle_trim() int *proclist; memory->create(proclist,nsend,"special:proclist"); - PairRvous *inbuf = (PairRvous *) - memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); + auto inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); // setup input buf to rendezvous comm // datums = pairs of onetwo partners where either is unknown @@ -894,7 +889,7 @@ void Special::angle_trim() char *buf; int nreturn = comm->rendezvous(RVOUS,nsend,(char *) inbuf,sizeof(PairRvous), 0,proclist, rendezvous_pairs,0,buf,sizeof(PairRvous), (void *) this); - PairRvous *outbuf = (PairRvous *) buf; + auto outbuf = (PairRvous *) buf; memory->destroy(proclist); memory->sfree(inbuf); @@ -1067,8 +1062,7 @@ void Special::dihedral_trim() int *proclist; memory->create(proclist,nsend,"special:proclist"); - PairRvous *inbuf = (PairRvous *) - memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); + auto inbuf = (PairRvous *) memory->smalloc((bigint) nsend*sizeof(PairRvous),"special:inbuf"); // setup input buf to rendezvous comm // datums = pairs of onefour atom IDs in a dihedral defined for my atoms @@ -1105,7 +1099,7 @@ void Special::dihedral_trim() char *buf; int nreturn = comm->rendezvous(RVOUS,nsend,(char *) inbuf,sizeof(PairRvous), 0,proclist, rendezvous_pairs,0,buf,sizeof(PairRvous), (void *) this); - PairRvous *outbuf = (PairRvous *) buf; + auto outbuf = (PairRvous *) buf; memory->destroy(proclist); memory->sfree(inbuf); @@ -1197,11 +1191,9 @@ void Special::dihedral_trim() no outbuf ------------------------------------------------------------------------- */ -int Special::rendezvous_ids(int n, char *inbuf, - int &flag, int *& /*proclist*/, char *& /*outbuf*/, - void *ptr) +int Special::rendezvous_ids(int n, char *inbuf, int &flag, int *& /*proclist*/, char *& /*outbuf*/, void *ptr) { - Special *sptr = (Special *) ptr; + auto sptr = (Special *) ptr; Memory *memory = sptr->memory; int *procowner; @@ -1210,7 +1202,7 @@ int Special::rendezvous_ids(int n, char *inbuf, memory->create(procowner,n,"special:procowner"); memory->create(atomIDs,n,"special:atomIDs"); - IDRvous *in = (IDRvous *) inbuf; + auto in = (IDRvous *) inbuf; for (int i = 0; i < n; i++) { procowner[i] = in[i].me; @@ -1239,7 +1231,7 @@ int Special::rendezvous_ids(int n, char *inbuf, int Special::rendezvous_pairs(int n, char *inbuf, int &flag, int *&proclist, char *&outbuf, void *ptr) { - Special *sptr = (Special *) ptr; + auto sptr = (Special *) ptr; Atom *atom = sptr->atom; Memory *memory = sptr->memory; @@ -1258,7 +1250,7 @@ int Special::rendezvous_pairs(int n, char *inbuf, int &flag, int *&proclist, // proclist = owner of atomID in caller decomposition - PairRvous *in = (PairRvous *) inbuf; + auto in = (PairRvous *) inbuf; int *procowner = sptr->procowner; memory->create(proclist,n,"special:proclist"); diff --git a/src/text_file_reader.cpp b/src/text_file_reader.cpp index 317b44e36e..6e6b14a519 100644 --- a/src/text_file_reader.cpp +++ b/src/text_file_reader.cpp @@ -42,8 +42,9 @@ using namespace LAMMPS_NS; * \param filetype Description of file type for error messages */ TextFileReader::TextFileReader(const std::string &filename, const std::string &filetype) : - filetype(filetype), closefp(true), ignore_comments(true) + filetype(filetype), closefp(true), line(nullptr), ignore_comments(true) { + set_bufsize(1024); fp = fopen(filename.c_str(), "r"); if (fp == nullptr) { @@ -70,8 +71,9 @@ This function is useful in combination with :cpp:func:`utils::open_potential`. * \param filetype Description of file type for error messages */ TextFileReader::TextFileReader(FILE *fp, std::string filetype) : - filetype(std::move(filetype)), closefp(false), fp(fp), ignore_comments(true) + filetype(std::move(filetype)), closefp(false), line(nullptr), fp(fp), ignore_comments(true) { + set_bufsize(1024); if (fp == nullptr) throw FileReaderException("Invalid file descriptor"); } @@ -80,6 +82,20 @@ TextFileReader::TextFileReader(FILE *fp, std::string filetype) : TextFileReader::~TextFileReader() { if (closefp) fclose(fp); + delete[] line; +} + +/** adjust line buffer size */ + +void TextFileReader::set_bufsize(int newsize) +{ + if (newsize < 100) { + throw FileReaderException( + fmt::format("line buffer size {} for {} file too small, must be > 100", newsize, filetype)); + } + delete[] line; + bufsize = newsize; + line = new char[bufsize]; } /** Reset file to the beginning */ @@ -93,7 +109,7 @@ void TextFileReader::rewind() void TextFileReader::skip_line() { - char *ptr = fgets(line, MAXLINE, fp); + char *ptr = fgets(line, bufsize, fp); if (ptr == nullptr) { // EOF throw EOFException(fmt::format("Missing line in {} file!", filetype)); @@ -120,7 +136,7 @@ char *TextFileReader::next_line(int nparams) int n = 0; int nwords = 0; - char *ptr = fgets(line, MAXLINE, fp); + char *ptr = fgets(line, bufsize, fp); if (ptr == nullptr) { // EOF @@ -134,7 +150,7 @@ char *TextFileReader::next_line(int nparams) if (nwords > 0) n = strlen(line); while (nwords == 0 || nwords < nparams) { - ptr = fgets(&line[n], MAXLINE - n, fp); + ptr = fgets(&line[n], bufsize - n, fp); if (ptr == nullptr) { // EOF diff --git a/src/text_file_reader.h b/src/text_file_reader.h index 30ec9351be..017a721e67 100644 --- a/src/text_file_reader.h +++ b/src/text_file_reader.h @@ -26,8 +26,8 @@ namespace LAMMPS_NS { class TextFileReader { std::string filetype; bool closefp; - static constexpr int MAXLINE = 1024; - char line[MAXLINE]; + int bufsize; + char *line; FILE *fp; public: @@ -35,9 +35,13 @@ class TextFileReader { TextFileReader(const std::string &filename, const std::string &filetype); TextFileReader(FILE *fp, std::string filetype); + TextFileReader() = delete; + TextFileReader(const TextFileReader &) = delete; + TextFileReader(const TextFileReader &&) = delete; + TextFileReader &operator=(const TextFileReader &) = delete; + virtual ~TextFileReader(); - ~TextFileReader(); - + void set_bufsize(int); void rewind(); void skip_line(); char *next_line(int nparams = 0); diff --git a/src/thermo.cpp b/src/thermo.cpp index e1534f11bd..a7d76017f8 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -252,8 +252,12 @@ void Thermo::init() format[i] += format_this + " "; else if (lineflag == YAMLLINE) format[i] += format_this + ", "; - else - format[i] += fmt::format("{:<8} = {} ", keyword[i], format_this); + else { + if (keyword_user[i].size()) + format[i] += fmt::format("{:<8} = {} ", keyword_user[i], format_this); + else + format[i] += fmt::format("{:<8} = {} ", keyword[i], format_this); + } } // chop off trailing blank or add closing bracket if needed and then add newline @@ -324,11 +328,13 @@ void Thermo::header() std::string hdr; if (lineflag == YAMLLINE) hdr = "---\nkeywords: ["; for (int i = 0; i < nfield; i++) { + auto head = keyword[i]; + if (keyword_user[i].size()) head = keyword_user[i]; if (lineflag == ONELINE) { if (vtype[i] == FLOAT) - hdr += fmt::format("{:^14} ", keyword[i]); + hdr += fmt::format("{:^14} ", head); else if ((vtype[i] == INT) || (vtype[i] == BIGINT)) - hdr += fmt::format("{:^11} ", keyword[i]); + hdr += fmt::format("{:^11} ", head); } else if (lineflag == YAMLLINE) { hdr += keyword[i]; hdr += ", "; @@ -622,6 +628,29 @@ void Thermo::modify_params(int narg, char **arg) error->all(FLERR, "Illegal thermo_modify command"); iarg += 2; + } else if (strcmp(arg[iarg], "colname") == 0) { + if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); + if (strcmp(arg[iarg + 1], "default") == 0) { + for (auto item : keyword_user) item.clear(); + iarg += 2; + } else { + if (iarg + 3 > narg) error->all(FLERR, "Illegal thermo_modify command"); + int icol = -1; + if (utils::is_integer(arg[iarg + 1])) { + icol = utils::inumeric(FLERR,arg[iarg + 1],false,lmp); + if (icol < 0) icol = nfield_initial + icol + 1; + icol--; + } else { + try { + icol = key2col.at(arg[iarg + 1]); + } catch (std::out_of_range &) { + icol = -1; + } + } + if ((icol < 0) || (icol >= nfield_initial)) error->all(FLERR, "Illegal thermo_modify command"); + keyword_user[icol] = arg[iarg+2]; + iarg += 3; + } } else if (strcmp(arg[iarg], "format") == 0) { if (iarg + 2 > narg) error->all(FLERR, "Illegal thermo_modify command"); @@ -630,7 +659,7 @@ void Thermo::modify_params(int narg, char **arg) format_int_user.clear(); format_bigint_user.clear(); format_float_user.clear(); - for (int i = 0; i < nfield_initial + 1; ++i) format_column_user[i].clear(); + for (auto item : format_column_user) item.clear(); iarg += 2; continue; } @@ -646,14 +675,24 @@ void Thermo::modify_params(int narg, char **arg) found = format_int_user.find('d', found); if (found == std::string::npos) error->all(FLERR, "Thermo_modify int format does not contain a d conversion character"); - format_bigint_user = - format_int_user.replace(found, 1, std::string(BIGINT_FORMAT).substr(1)); + format_bigint_user = format_int_user.replace(found, 1, std::string(BIGINT_FORMAT).substr(1)); } else if (strcmp(arg[iarg + 1], "float") == 0) { format_float_user = arg[iarg + 2]; } else { - int i = utils::inumeric(FLERR, arg[iarg + 1], false, lmp) - 1; - if (i < 0 || i >= nfield_initial + 1) error->all(FLERR, "Illegal thermo_modify command"); - format_column_user[i] = arg[iarg + 2]; + int icol = -1; + if (utils::is_integer(arg[iarg + 1])) { + icol = utils::inumeric(FLERR, arg[iarg + 1], false, lmp); + if (icol < 0) icol = nfield_initial + icol + 1; + icol--; + } else { + try { + icol = key2col.at(arg[iarg + 1]); + } catch (std::out_of_range &) { + icol = -1; + } + } + if (icol < 0 || icol >= nfield_initial + 1) error->all(FLERR, "Illegal thermo_modify command"); + format_column_user[icol] = arg[iarg + 2]; } iarg += 3; @@ -675,10 +714,12 @@ void Thermo::allocate() keyword.resize(n); format.resize(n); format_column_user.resize(n); + keyword_user.resize(n); for (int i = 0; i < n; i++) { keyword[i].clear(); format[i].clear(); format_column_user[i].clear(); + keyword_user[i].clear(); } vfunc = new FnPtr[n]; @@ -702,6 +743,12 @@ void Thermo::allocate() nvariable = 0; id_variable = new char *[n]; variables = new int[n]; + + int i = 0; + key2col.clear(); + for (auto item : utils::split_words(line)) { + key2col[item] = i++; + } } /* ---------------------------------------------------------------------- diff --git a/src/thermo.h b/src/thermo.h index b0a2309312..c36eac3d8f 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -15,6 +15,7 @@ #define LMP_THERMO_H #include "pointers.h" +#include namespace LAMMPS_NS { @@ -22,6 +23,7 @@ class Thermo : protected Pointers { friend class MinCG; // accesses compute_pe friend class DumpNetCDF; // accesses thermo properties friend class DumpNetCDFMPIIO; // accesses thermo properties + friend class DumpYAML; // accesses thermo properties public: char *style; @@ -47,8 +49,9 @@ class Thermo : protected Pointers { int nfield, nfield_initial; int *vtype; std::string line; - std::vector keyword, format, format_column_user; + std::vector keyword, format, format_column_user, keyword_user; std::string format_line_user, format_float_user, format_int_user, format_bigint_user; + std::map key2col; int normvalue; // use this for normflag unless natoms = 0 int normuserflag; // 0 if user has not set, 1 if has diff --git a/src/utils.cpp b/src/utils.cpp index ed119db886..a8e1b14104 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -744,7 +744,7 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, int mod char *utils::strdup(const std::string &text) { - char *tmp = new char[text.size() + 1]; + auto tmp = new char[text.size() + 1]; strcpy(tmp, text.c_str()); // NOLINT return tmp; } @@ -791,18 +791,30 @@ std::string utils::trim(const std::string &line) std::string utils::trim_comment(const std::string &line) { - auto end = line.find_first_of('#'); + auto end = line.find('#'); if (end != std::string::npos) { return line.substr(0, end); } return {line}; } +/* ---------------------------------------------------------------------- + Replace '*' with number and optional zero-padding +------------------------------------------------------------------------- */ + +std::string utils::star_subst(const std::string &name, bigint step, int pad) +{ + auto star = name.find('*'); + if (star == std::string::npos) return name; + + return fmt::format("{}{:0{}}{}",name.substr(0,star),step,pad,name.substr(star+1)); +} + /* ---------------------------------------------------------------------- Replace UTF-8 encoded chars with known ASCII equivalents ------------------------------------------------------------------------- */ std::string utils::utf8_subst(const std::string &line) { - const unsigned char *const in = (const unsigned char *) line.c_str(); + const auto *const in = (const unsigned char *) line.c_str(); const int len = line.size(); std::string out; diff --git a/src/utils.h b/src/utils.h index 6811dbe874..86f31508e7 100644 --- a/src/utils.h +++ b/src/utils.h @@ -368,13 +368,27 @@ namespace utils { std::string trim(const std::string &line); - /*! Return string with anything from '#' onward removed + /*! Return string with anything from the first '#' character onward removed * * \param line string that should be trimmed * \return new string without comment (string) */ std::string trim_comment(const std::string &line); + /*! Replace first '*' character in a string with a number, optionally zero-padded + * + * If there is no '*' character in the string, return the original string. + * If the number requires more characters than the value of the *pad* + * argument, do not add zeros; otherwise add as many zeroes as needed to + * the left to make the the number representation *pad* characters wide. + * + * \param name string with file containing a '*' (or not) + * \param step step number to replace the (first) '*' + * \param pad zero-padding (may be zero) + * \return processed string */ + + std::string star_subst(const std::string &name, bigint step, int pad); + /*! Check if a string will likely have UTF-8 encoded characters * * UTF-8 uses the 7-bit standard ASCII table for the first 127 characters and diff --git a/src/variable.cpp b/src/variable.cpp index 58a505b9ec..42afda5cd8 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -24,6 +24,7 @@ #include "group.h" #include "info.h" #include "input.h" +#include "library.h" #include "lmppython.h" #include "math_const.h" #include "memory.h" @@ -63,7 +64,7 @@ enum{DONE,ADD,SUBTRACT,MULTIPLY,DIVIDE,CARAT,MODULO,UNARY, SQRT,EXP,LN,LOG,ABS,SIN,COS,TAN,ASIN,ACOS,ATAN,ATAN2, RANDOM,NORMAL,CEIL,FLOOR,ROUND,RAMP,STAGGER,LOGFREQ,LOGFREQ2, LOGFREQ3,STRIDE,STRIDE2,VDISPLACE,SWIGGLE,CWIGGLE,GMASK,RMASK, - GRMASK,IS_ACTIVE,IS_DEFINED,IS_AVAILABLE,IS_FILE, + GRMASK,IS_ACTIVE,IS_DEFINED,IS_AVAILABLE,IS_FILE,EXTRACT_SETTING, VALUE,ATOMARRAY,TYPEARRAY,INTARRAY,BIGINTARRAY,VECTORARRAY}; // customize by adding a special function @@ -131,11 +132,11 @@ Variable::Variable(LAMMPS *lmp) : Pointers(lmp) Variable::~Variable() { for (int i = 0; i < nvar; i++) { - delete [] names[i]; + delete[] names[i]; delete reader[i]; - if (style[i] == LOOP || style[i] == ULOOP) delete [] data[i][0]; - else for (int j = 0; j < num[i]; j++) delete [] data[i][j]; - delete [] data[i]; + if (style[i] == LOOP || style[i] == ULOOP) delete[] data[i][0]; + else for (int j = 0; j < num[i]; j++) delete[] data[i][j]; + delete[] data[i]; if (style[i] == VECTOR) memory->destroy(vecs[i].values); } memory->sfree(names); @@ -274,8 +275,7 @@ void Variable::set(int narg, char **arg) if (universe->me == 0) { FILE *fp = fopen("tmp.lammps.variable","w"); if (fp == nullptr) - error->one(FLERR,"Cannot open temporary file for world counter: " - + utils::getsyserror()); + error->one(FLERR,"Cannot open temporary file for world counter: " + utils::getsyserror()); fprintf(fp,"%d\n",universe->nworlds); fclose(fp); fp = nullptr; @@ -284,8 +284,7 @@ void Variable::set(int narg, char **arg) for (int jvar = 0; jvar < nvar; jvar++) if (num[jvar] && (style[jvar] == UNIVERSE || style[jvar] == ULOOP) && num[nvar] != num[jvar]) - error->all(FLERR, - "All universe/uloop variables must have same # of values"); + error->all(FLERR,"All universe/uloop variables must have same # of values"); // STRING // replace pre-existing var if also style STRING (allows it to be reset) @@ -297,8 +296,8 @@ void Variable::set(int narg, char **arg) int maxcopy = strlen(arg[2]) + 1; int maxwork = maxcopy; - char *scopy = (char *) memory->smalloc(maxcopy,"var:string/copy"); - char *work = (char *) memory->smalloc(maxwork,"var:string/work"); + auto scopy = (char *) memory->smalloc(maxcopy,"var:string/copy"); + auto work = (char *) memory->smalloc(maxwork,"var:string/work"); strcpy(scopy,arg[2]); input->substitute(scopy,work,maxcopy,maxwork,1); memory->sfree(work); @@ -307,7 +306,7 @@ void Variable::set(int narg, char **arg) if (ivar >= 0) { if (style[ivar] != STRING) error->all(FLERR,"Cannot redefine variable as a different style"); - delete [] data[ivar][0]; + delete[] data[ivar][0]; copy(1,&scopy,data[ivar]); replaceflag = 1; } else { @@ -410,7 +409,7 @@ void Variable::set(int narg, char **arg) if (ivar >= 0) { if (style[ivar] != EQUAL) error->all(FLERR,"Cannot redefine variable as a different style"); - delete [] data[ivar][0]; + delete[] data[ivar][0]; data[ivar][0] = utils::strdup(arg[2]); replaceflag = 1; } else { @@ -436,7 +435,7 @@ void Variable::set(int narg, char **arg) if (ivar >= 0) { if (style[ivar] != ATOM) error->all(FLERR,"Cannot redefine variable as a different style"); - delete [] data[ivar][0]; + delete[] data[ivar][0]; data[ivar][0] = utils::strdup(arg[2]); replaceflag = 1; } else { @@ -460,7 +459,7 @@ void Variable::set(int narg, char **arg) if (ivar >= 0) { if (style[ivar] != VECTOR) error->all(FLERR,"Cannot redefine variable as a different style"); - delete [] data[ivar][0]; + delete[] data[ivar][0]; data[ivar][0] = utils::strdup(arg[2]); replaceflag = 1; } else { @@ -486,7 +485,7 @@ void Variable::set(int narg, char **arg) if (ivar >= 0) { if (style[ivar] != PYTHON) error->all(FLERR,"Cannot redefine variable as a different style"); - delete [] data[ivar][0]; + delete[] data[ivar][0]; data[ivar][0] = utils::strdup(arg[2]); replaceflag = 1; } else { @@ -533,8 +532,7 @@ void Variable::set(int narg, char **arg) if (replaceflag) return; if (!utils::is_id(arg[0])) - error->all(FLERR,"Variable name '{}' must have only alphanu" - "meric characters or underscores",arg[0]); + error->all(FLERR,"Variable name '{}' must have only letters, numbers, or underscores",arg[0]); names[nvar] = utils::strdup(arg[0]); nvar++; } @@ -546,7 +544,7 @@ void Variable::set(int narg, char **arg) void Variable::set(const std::string &setcmd) { std::vector args = utils::split_words(setcmd); - char **newarg = new char*[args.size()]; + auto newarg = new char*[args.size()]; int i=0; for (const auto &arg : args) { newarg[i++] = (char *)arg.c_str(); @@ -562,12 +560,12 @@ void Variable::set(const std::string &setcmd) void Variable::set(char *name, int narg, char **arg) { - char **newarg = new char*[2+narg]; + auto newarg = new char*[2+narg]; newarg[0] = name; newarg[1] = (char *) "index"; for (int i = 0; i < narg; i++) newarg[2+i] = arg[i]; set(2+narg,newarg); - delete [] newarg; + delete[] newarg; } /* ---------------------------------------------------------------------- @@ -582,7 +580,7 @@ int Variable::set_string(const char *name, const char *str) int ivar = find(name); if (ivar < 0) return -1; if (style[ivar] != STRING) return -1; - delete [] data[ivar][0]; + delete[] data[ivar][0]; data[ivar][0] = utils::strdup(str); return 0; } @@ -605,8 +603,7 @@ int Variable::next(int narg, char **arg) for (int iarg = 0; iarg < narg; iarg++) { ivar = find(arg[iarg]); if (ivar < 0) - error->all(FLERR,"Invalid variable '{}' in next command", - arg[iarg]); + error->all(FLERR,"Invalid variable '{}' in next command",arg[iarg]); if (style[ivar] == ULOOP && style[find(arg[0])] == UNIVERSE) continue; else if (style[ivar] == UNIVERSE && style[find(arg[0])] == ULOOP) continue; else if (style[ivar] != style[find(arg[0])]) @@ -631,8 +628,7 @@ int Variable::next(int narg, char **arg) for (iarg = 0; iarg < narg; iarg++) if (strcmp(arg[iarg],names[i]) == 0) break; if (iarg == narg) - error->universe_one(FLERR,"Next command must list all " - "universe and uloop variables"); + error->universe_one(FLERR,"Next command must list all universe and uloop variables"); } // increment all variables in list @@ -724,8 +720,8 @@ int Variable::next(int narg, char **arg) random = nullptr; if (nextindex < 0) - error->one(FLERR,"Unexpected error while incrementing uloop " - "style variable. Please contact LAMMPS developers."); + error->one(FLERR,"Unexpected error while incrementing uloop style variable. " + "Please contact the LAMMPS developers."); //printf("READ %d %d\n",universe->me,nextindex); fp = fopen("tmp.lammps.variable.lock","w"); @@ -735,12 +731,10 @@ int Variable::next(int narg, char **arg) fp = nullptr; rename("tmp.lammps.variable.lock","tmp.lammps.variable"); if (universe->uscreen) - fprintf(universe->uscreen, - "Increment via next: value %d on partition %d\n", + fprintf(universe->uscreen, "Increment via next: value %d on partition %d\n", nextindex+1,universe->iworld); if (universe->ulogfile) - fprintf(universe->ulogfile, - "Increment via next: value %d on partition %d\n", + fprintf(universe->ulogfile, "Increment via next: value %d on partition %d\n", nextindex+1,universe->iworld); } MPI_Bcast(&nextindex,1,MPI_INT,0,world); @@ -903,7 +897,7 @@ char *Variable::retrieve(const char *name) sprintf(padstr,"%%0%dd",pad[ivar]); sprintf(result,padstr,which[ivar]+1); } - delete [] data[ivar][0]; + delete[] data[ivar][0]; str = data[ivar][0] = utils::strdup(result); } else if (style[ivar] == EQUAL) { double answer = evaluate(data[ivar][0],nullptr,ivar); @@ -919,13 +913,12 @@ char *Variable::retrieve(const char *name) } else if (style[ivar] == GETENV) { const char *result = getenv(data[ivar][0]); if (result == nullptr) result = (const char *) ""; - delete [] data[ivar][1]; + delete[] data[ivar][1]; str = data[ivar][1] = utils::strdup(result); } else if (style[ivar] == PYTHON) { int ifunc = python->variable_match(data[ivar][0],name,0); if (ifunc < 0) - error->all(FLERR,"Python variable {} does not match " - "Python function {}", name, data[ivar][0]); + error->all(FLERR,"Python variable {} does not match Python function {}", name, data[ivar][0]); python->invoke_function(ifunc,data[ivar][1]); str = data[ivar][1]; // if Python func returns a string longer than VALUELENGTH @@ -993,8 +986,7 @@ double Variable::compute_equal(const std::string &str) if sumflag, add variable values to existing result ------------------------------------------------------------------------- */ -void Variable::compute_atom(int ivar, int igroup, - double *result, int stride, int sumflag) +void Variable::compute_atom(int ivar, int igroup, double *result, int stride, int sumflag) { Tree *tree = nullptr; double *vstore; @@ -1127,10 +1119,10 @@ void Variable::internal_set(int ivar, double value) void Variable::remove(int n) { - delete [] names[n]; - if (style[n] == LOOP || style[n] == ULOOP) delete [] data[n][0]; - else for (int i = 0; i < num[n]; i++) delete [] data[n][i]; - delete [] data[n]; + delete[] names[n]; + if (style[n] == LOOP || style[n] == ULOOP) delete[] data[n][0]; + else for (int i = 0; i < num[n]; i++) delete[] data[n][i]; + delete[] data[n]; delete reader[n]; for (int i = n+1; i < nvar; i++) { @@ -1261,7 +1253,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) treestack[ntreestack++] = newtree; } else argstack[nargstack++] = evaluate(contents,nullptr,ivar); - delete [] contents; + delete[] contents; // ---------------- // number: push value onto stack @@ -1284,18 +1276,18 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) int istop = i - 1; int n = istop - istart + 1; - char *number = new char[n+1]; + auto number = new char[n+1]; strncpy(number,&str[istart],n); number[n] = '\0'; if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = atof(number); treestack[ntreestack++] = newtree; } else argstack[nargstack++] = atof(number); - delete [] number; + delete[] number; // ---------------- // letter: c_ID, c_ID[], c_ID[][], f_ID, f_ID[], f_ID[][], @@ -1315,7 +1307,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) int istop = i-1; int n = istop - istart + 1; - char *word = new char[n+1]; + auto word = new char[n+1]; strncpy(word,&str[istart],n); word[n] = '\0'; @@ -1373,7 +1365,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) value1 = compute->scalar; if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; treestack[ntreestack++] = newtree; @@ -1398,7 +1390,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) index1 > compute->size_vector) value1 = 0.0; else value1 = compute->vector[index1-1]; if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; treestack[ntreestack++] = newtree; @@ -1425,7 +1417,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) index1 > compute->size_array_rows) value1 = 0.0; else value1 = compute->array[index1-1][index2-1]; if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; treestack[ntreestack++] = newtree; @@ -1449,7 +1441,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) compute->invoked_flag |= Compute::INVOKED_VECTOR; } - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VECTORARRAY; newtree->array = compute->vector; newtree->nvector = compute->size_vector; @@ -1474,7 +1466,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) compute->invoked_flag |= Compute::INVOKED_ARRAY; } - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VECTORARRAY; newtree->array = &compute->array[0][index1-1]; newtree->nvector = compute->size_array_rows; @@ -1494,8 +1486,8 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) compute->invoked_flag |= Compute::INVOKED_PERATOM; } - peratom2global(1,nullptr,compute->vector_atom,1,index1, - tree,treestack,ntreestack,argstack,nargstack); + peratom2global(1,nullptr,compute->vector_atom,1,index1,tree, + treestack,ntreestack,argstack,nargstack); // c_ID[i][j] = scalar from per-atom array @@ -1503,24 +1495,20 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) compute->size_peratom_cols > 0) { if (index2 > compute->size_peratom_cols) - print_var_error(FLERR,"Variable formula compute " - "array is accessed out-of-range",ivar,0); + print_var_error(FLERR,"Variable formula compute array is accessed out-of-range",ivar,0); if (update->whichflag == 0) { if (compute->invoked_peratom != update->ntimestep) - print_var_error(FLERR,"Compute used in variable " - "between runs is not current",ivar); + print_var_error(FLERR,"Compute used in variable between runs is not current",ivar); } else if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) { compute->compute_peratom(); compute->invoked_flag |= Compute::INVOKED_PERATOM; } if (compute->array_atom) - peratom2global(1,nullptr,&compute->array_atom[0][index2-1], - compute->size_peratom_cols,index1, + peratom2global(1,nullptr,&compute->array_atom[0][index2-1],compute->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); else - peratom2global(1,nullptr,nullptr, - compute->size_peratom_cols,index1, + peratom2global(1,nullptr,nullptr,compute->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); // c_ID = vector from per-atom vector @@ -1540,7 +1528,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) compute->invoked_flag |= Compute::INVOKED_PERATOM; } - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = ATOMARRAY; newtree->array = compute->vector_atom; newtree->nstride = 1; @@ -1565,7 +1553,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) compute->invoked_flag |= Compute::INVOKED_PERATOM; } - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = ATOMARRAY; if (compute->array_atom) newtree->array = &compute->array_atom[0][index1-1]; @@ -1621,12 +1609,11 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (nbracket == 0 && fix->scalar_flag && lowercase) { if (update->whichflag > 0 && update->ntimestep % fix->global_freq) - print_var_error(FLERR,"Fix in variable not computed " - "at a compatible time",ivar); + print_var_error(FLERR,"Fix in variable not computed at a compatible time",ivar); value1 = fix->compute_scalar(); if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; treestack[ntreestack++] = newtree; @@ -1638,15 +1625,13 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (index1 > fix->size_vector && fix->size_vector_variable == 0) - print_var_error(FLERR,"Variable formula fix vector is " - "accessed out-of-range",ivar,0); + print_var_error(FLERR,"Variable formula fix vector is accessed out-of-range",ivar,0); if (update->whichflag > 0 && update->ntimestep % fix->global_freq) - print_var_error(FLERR,"Fix in variable not computed " - "at a compatible time",ivar); + print_var_error(FLERR,"Fix in variable not computed at a compatible time",ivar); value1 = fix->compute_vector(index1-1); if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; treestack[ntreestack++] = newtree; @@ -1658,18 +1643,15 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (index1 > fix->size_array_rows && fix->size_array_rows_variable == 0) - print_var_error(FLERR,"Variable formula fix array is " - "accessed out-of-range",ivar,0); + print_var_error(FLERR,"Variable formula fix array is accessed out-of-range",ivar,0); if (index2 > fix->size_array_cols) - print_var_error(FLERR,"Variable formula fix array is " - "accessed out-of-range",ivar,0); + print_var_error(FLERR,"Variable formula fix array is accessed out-of-range",ivar,0); if (update->whichflag > 0 && update->ntimestep % fix->global_freq) - print_var_error(FLERR,"Fix in variable not computed at a " - "compatible time",ivar); + print_var_error(FLERR,"Fix in variable not computed at a compatible time",ivar); value1 = fix->compute_array(index1-1,index2-1); if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; treestack[ntreestack++] = newtree; @@ -1680,17 +1662,13 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && fix->vector_flag) { if (update->whichflag > 0 && update->ntimestep % fix->global_freq) - print_var_error(FLERR,"Fix in variable not computed at " - "compatible time",ivar); + print_var_error(FLERR,"Fix in variable not computed at compatible time",ivar); if (tree == nullptr) - print_var_error(FLERR,"Fix global vector in " - "equal-style variable formula",ivar); + print_var_error(FLERR,"Fix global vector in equal-style variable formula",ivar); if (treetype == ATOM) - print_var_error(FLERR,"Fix global vector in " - "atom-style variable formula",ivar); + print_var_error(FLERR,"Fix global vector in atom-style variable formula",ivar); if (fix->size_vector == 0) - print_var_error(FLERR,"Variable formula " - "fix vector is zero length",ivar); + print_var_error(FLERR,"Variable formula fix vector is zero length",ivar); int nvec = fix->size_vector; double *vec; @@ -1698,7 +1676,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) for (int m = 0; m < nvec; m++) vec[m] = fix->compute_vector(m); - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VECTORARRAY; newtree->array = vec; newtree->nvector = nvec; @@ -1711,17 +1689,13 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 1 && fix->array_flag) { if (update->whichflag > 0 && update->ntimestep % fix->global_freq) - print_var_error(FLERR,"Fix in variable not computed " - "at a compatible time",ivar); + print_var_error(FLERR,"Fix in variable not computed at a compatible time",ivar); if (tree == nullptr) - print_var_error(FLERR,"Fix global vector in " - "equal-style variable formula",ivar); + print_var_error(FLERR,"Fix global vector in equal-style variable formula",ivar); if (treetype == ATOM) - print_var_error(FLERR,"Fix global vector in " - "atom-style variable formula",ivar); + print_var_error(FLERR,"Fix global vector in atom-style variable formula",ivar); if (fix->size_array_rows == 0) - print_var_error(FLERR,"Variable formula fix array is " - "zero length",ivar); + print_var_error(FLERR,"Variable formula fix array is zero length",ivar); int nvec = fix->size_array_rows; double *vec; @@ -1729,7 +1703,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) for (int m = 0; m < nvec; m++) vec[m] = fix->compute_array(m,index1-1); - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VECTORARRAY; newtree->array = vec; newtree->nvector = nvec; @@ -1744,8 +1718,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (update->whichflag > 0 && update->ntimestep % fix->peratom_freq) - print_var_error(FLERR,"Fix in variable not computed " - "at a compatible time",ivar); + print_var_error(FLERR,"Fix in variable not computed at a compatible time",ivar); peratom2global(1,nullptr,fix->vector_atom,1,index1, tree,treestack,ntreestack,argstack,nargstack); @@ -1756,20 +1729,16 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) fix->size_peratom_cols > 0) { if (index2 > fix->size_peratom_cols) - print_var_error(FLERR,"Variable formula fix array is " - "accessed out-of-range",ivar,0); + print_var_error(FLERR,"Variable formula fix array is accessed out-of-range",ivar,0); if (update->whichflag > 0 && update->ntimestep % fix->peratom_freq) - print_var_error(FLERR,"Fix in variable not computed " - "at a compatible time",ivar); + print_var_error(FLERR,"Fix in variable not computed at a compatible time",ivar); if (fix->array_atom) - peratom2global(1,nullptr,&fix->array_atom[0][index2-1], - fix->size_peratom_cols,index1, + peratom2global(1,nullptr,&fix->array_atom[0][index2-1],fix->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); else - peratom2global(1,nullptr,nullptr, - fix->size_peratom_cols,index1, + peratom2global(1,nullptr,nullptr,fix->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); // f_ID = vector from per-atom vector @@ -1778,14 +1747,12 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) fix->size_peratom_cols == 0) { if (tree == nullptr) - print_var_error(FLERR,"Per-atom fix in " - "equal-style variable formula",ivar); + print_var_error(FLERR,"Per-atom fix in equal-style variable formula",ivar); if (update->whichflag > 0 && update->ntimestep % fix->peratom_freq) - print_var_error(FLERR,"Fix in variable not computed at " - "compatible time",ivar); + print_var_error(FLERR,"Fix in variable not computed at compatible time",ivar); - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = ATOMARRAY; newtree->array = fix->vector_atom; newtree->nstride = 1; @@ -1797,17 +1764,14 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) fix->size_peratom_cols > 0) { if (tree == nullptr) - print_var_error(FLERR,"Per-atom fix in " - "equal-style variable formula",ivar); + print_var_error(FLERR,"Per-atom fix in equal-style variable formula",ivar); if (index1 > fix->size_peratom_cols) - print_var_error(FLERR,"Variable formula fix array " - "is accessed out-of-range",ivar,0); + print_var_error(FLERR,"Variable formula fix array is accessed out-of-range",ivar,0); if (update->whichflag > 0 && update->ntimestep % fix->peratom_freq) - print_var_error(FLERR,"Fix in variable not computed at " - "compatible time",ivar); + print_var_error(FLERR,"Fix in variable not computed at compatible time",ivar); - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = ATOMARRAY; if (fix->array_atom) newtree->array = &fix->array_atom[0][index1-1]; @@ -1824,8 +1788,8 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) int ivar = find(word+2); if (ivar < 0) - print_var_error(FLERR,fmt::format("Invalid variable reference " - "{} in variable formula",word),ivar); + print_var_error(FLERR,fmt::format("Invalid variable reference {} in variable formula",word), + ivar); if (eval_in_progress[ivar]) print_var_error(FLERR,"has a circular dependency",ivar); @@ -1851,7 +1815,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) value1 = dvalue[ivar]; if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; treestack[ntreestack++] = newtree; @@ -1865,10 +1829,9 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) char *var = retrieve(word+2); if (var == nullptr) - print_var_error(FLERR,"Invalid variable evaluation in " - "variable formula",ivar); + print_var_error(FLERR,"Invalid variable evaluation in variable formula",ivar); if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = atof(var); treestack[ntreestack++] = newtree; @@ -1880,11 +1843,9 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && style[ivar] == ATOM) { if (tree == nullptr) - print_var_error(FLERR,"Atom-style variable in " - "equal-style variable formula",ivar); + print_var_error(FLERR,"Atom-style variable in equal-style variable formula",ivar); if (treetype == VECTOR) - print_var_error(FLERR,"Atom-style variable in " - "vector-style variable formula",ivar); + print_var_error(FLERR,"Atom-style variable in vector-style variable formula",ivar); Tree *newtree = nullptr; evaluate(data[ivar][0],&newtree,ivar); @@ -1895,13 +1856,11 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && style[ivar] == ATOMFILE) { if (tree == nullptr) - print_var_error(FLERR,"Atomfile-style variable in " - "equal-style variable formula",ivar); + print_var_error(FLERR,"Atomfile-style variable in equal-style variable formula",ivar); if (treetype == VECTOR) - print_var_error(FLERR,"Atomfile-style variable in " - "vector-style variable formula",ivar); + print_var_error(FLERR,"Atomfile-style variable in vector-style variable formula",ivar); - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = ATOMARRAY; newtree->array = reader[ivar]->fixstore->vstore; newtree->nstride = 1; @@ -1913,16 +1872,14 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && style[ivar] == VECTOR) { if (tree == nullptr) - print_var_error(FLERR,"Vector-style variable in " - "equal-style variable formula",ivar); + print_var_error(FLERR,"Vector-style variable in equal-style variable formula",ivar); if (treetype == ATOM) - print_var_error(FLERR,"Vector-style variable in " - "atom-style variable formula",ivar); + print_var_error(FLERR,"Vector-style variable in atom-style variable formula",ivar); double *vec; int nvec = compute_vector(ivar,&vec); - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VECTORARRAY; newtree->array = vec; newtree->nvector = nvec; @@ -1938,8 +1895,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) double *result; memory->create(result,atom->nlocal,"variable:result"); compute_atom(ivar,0,result,1,0); - peratom2global(1,nullptr,result,1,index, - tree,treestack,ntreestack,argstack,nargstack); + peratom2global(1,nullptr,result,1,index,tree,treestack,ntreestack,argstack,nargstack); memory->destroy(result); // v_name[N] = scalar from atomfile-style variable @@ -1957,19 +1913,17 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) double *vec; int nvec = compute_vector(ivar,&vec); if (index <= 0 || index > nvec) - print_var_error(FLERR,"Invalid index into " - "vector-style variable",ivar); + print_var_error(FLERR,"Invalid index into vector-style variable",ivar); int m = index; // convert from tagint to int if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = vec[m-1]; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = vec[m-1]; - } else print_var_error(FLERR,"Mismatched variable in " - "variable formula",ivar); + } else print_var_error(FLERR,"Mismatched variable in variable formula",ivar); // ---------------- // math/group/special function or atom value/vector or @@ -1987,16 +1941,12 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) i = find_matching_paren(str,i,contents,ivar); i++; - if (math_function(word,contents,tree,treestack,ntreestack, - argstack,nargstack,ivar)); - else if (group_function(word,contents,tree,treestack,ntreestack, - argstack,nargstack,ivar)); - else if (special_function(word,contents,tree,treestack,ntreestack, - argstack,nargstack,ivar)); - else print_var_error(FLERR,fmt::format("Invalid math/group/special " - "function '{}()'in variable " - "formula", word),ivar); - delete [] contents; + if (math_function(word,contents,tree,treestack,ntreestack,argstack,nargstack,ivar)); + else if (group_function(word,contents,tree,treestack,ntreestack,argstack,nargstack,ivar)); + else if (special_function(word,contents,tree,treestack,ntreestack,argstack,nargstack,ivar)); + else print_var_error(FLERR,fmt::format("Invalid math/group/special function '{}()' " + "in variable formula", word),ivar); + delete[] contents; // ---------------- // atom value @@ -2004,15 +1954,13 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (str[i] == '[') { if (domain->box_exist == 0) - print_var_error(FLERR,"Variable evaluation before " - "simulation box is defined",ivar); + print_var_error(FLERR,"Variable evaluation before simulation box is defined",ivar); ptr = &str[i]; tagint id = int_between_brackets(ptr,1); i = ptr-str+1; - peratom2global(0,word,nullptr,0,id, - tree,treestack,ntreestack,argstack,nargstack); + peratom2global(0,word,nullptr,0,id,tree,treestack,ntreestack,argstack,nargstack); // ---------------- // atom vector @@ -2020,8 +1968,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (is_atom_vector(word)) { if (domain->box_exist == 0) - print_var_error(FLERR,"Variable evaluation before " - "simulation box is defined",ivar); + print_var_error(FLERR,"Variable evaluation before simulation box is defined",ivar); atom_vector(word,tree,treestack,ntreestack); @@ -2032,7 +1979,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (constants.find(word) != constants.end()) { value1 = constants[word]; if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; treestack[ntreestack++] = newtree; @@ -2044,15 +1991,14 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else { if (domain->box_exist == 0) - print_var_error(FLERR,"Variable evaluation before " - "simulation box is defined",ivar); + print_var_error(FLERR,"Variable evaluation before simulation box is defined",ivar); int flag = output->thermo->evaluate_keyword(word,&value1); if (flag) - print_var_error(FLERR,fmt::format("Invalid thermo keyword '{}' in " - "variable formula",word),ivar); + print_var_error(FLERR,fmt::format("Invalid thermo keyword '{}' in variable formula", + word),ivar); if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; treestack[ntreestack++] = newtree; @@ -2060,7 +2006,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } } - delete [] word; + delete[] word; // ---------------- // math operator, including end-of-string @@ -2129,7 +2075,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) opprevious = opstack[--nopstack]; if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = opprevious; if ((opprevious == UNARY) || (opprevious == NOT)) { newtree->first = treestack[--ntreestack]; @@ -2162,8 +2108,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (value2 == 0.0) argstack[nargstack++] = 1.0; else if ((value1 == 0.0) && (value2 < 0.0)) - print_var_error(FLERR,"Invalid power expression in " - "variable formula",ivar,0); + print_var_error(FLERR,"Invalid power expression in variable formula",ivar,0); else argstack[nargstack++] = pow(value1,value2); } else if (opprevious == UNARY) { argstack[nargstack++] = -value2; @@ -2592,8 +2537,8 @@ double Variable::collapse_tree(Tree *tree) } if (tree->type == STAGGER) { - bigint ivalue1 = static_cast (collapse_tree(tree->first)); - bigint ivalue2 = static_cast (collapse_tree(tree->second)); + auto ivalue1 = static_cast (collapse_tree(tree->first)); + auto ivalue2 = static_cast (collapse_tree(tree->second)); if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0; tree->type = VALUE; if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2) @@ -2606,9 +2551,9 @@ double Variable::collapse_tree(Tree *tree) } if (tree->type == LOGFREQ) { - bigint ivalue1 = static_cast (collapse_tree(tree->first)); - bigint ivalue2 = static_cast (collapse_tree(tree->second)); - bigint ivalue3 = static_cast (collapse_tree(tree->extra[0])); + auto ivalue1 = static_cast (collapse_tree(tree->first)); + auto ivalue2 = static_cast (collapse_tree(tree->second)); + auto ivalue3 = static_cast (collapse_tree(tree->extra[0])); if (tree->first->type != VALUE || tree->second->type != VALUE || tree->extra[0]->type != VALUE) return 0.0; tree->type = VALUE; @@ -2626,9 +2571,9 @@ double Variable::collapse_tree(Tree *tree) } if (tree->type == LOGFREQ2) { - bigint ivalue1 = static_cast (collapse_tree(tree->first)); - bigint ivalue2 = static_cast (collapse_tree(tree->second)); - bigint ivalue3 = static_cast (collapse_tree(tree->extra[0])); + auto ivalue1 = static_cast (collapse_tree(tree->first)); + auto ivalue2 = static_cast (collapse_tree(tree->second)); + auto ivalue3 = static_cast (collapse_tree(tree->extra[0])); if (tree->first->type != VALUE || tree->second->type != VALUE || tree->extra[0]->type != VALUE) return 0.0; tree->type = VALUE; @@ -2650,9 +2595,9 @@ double Variable::collapse_tree(Tree *tree) } if (tree->type == LOGFREQ3) { - bigint ivalue1 = static_cast (collapse_tree(tree->first)); - bigint ivalue2 = static_cast (collapse_tree(tree->second)); - bigint ivalue3 = static_cast (collapse_tree(tree->extra[0])); + auto ivalue1 = static_cast (collapse_tree(tree->first)); + auto ivalue2 = static_cast (collapse_tree(tree->second)); + auto ivalue3 = static_cast (collapse_tree(tree->extra[0])); if (tree->first->type != VALUE || tree->second->type != VALUE || tree->extra[0]->type != VALUE) return 0.0; tree->type = VALUE; @@ -2679,9 +2624,9 @@ double Variable::collapse_tree(Tree *tree) } if (tree->type == STRIDE) { - bigint ivalue1 = static_cast (collapse_tree(tree->first)); - bigint ivalue2 = static_cast (collapse_tree(tree->second)); - bigint ivalue3 = static_cast (collapse_tree(tree->extra[0])); + auto ivalue1 = static_cast (collapse_tree(tree->first)); + auto ivalue2 = static_cast (collapse_tree(tree->second)); + auto ivalue3 = static_cast (collapse_tree(tree->extra[0])); if (tree->first->type != VALUE || tree->second->type != VALUE || tree->extra[0]->type != VALUE) return 0.0; tree->type = VALUE; @@ -2697,12 +2642,12 @@ double Variable::collapse_tree(Tree *tree) } if (tree->type == STRIDE2) { - bigint ivalue1 = static_cast (collapse_tree(tree->first)); - bigint ivalue2 = static_cast (collapse_tree(tree->second)); - bigint ivalue3 = static_cast (collapse_tree(tree->extra[0])); - bigint ivalue4 = static_cast (collapse_tree(tree->extra[1])); - bigint ivalue5 = static_cast (collapse_tree(tree->extra[2])); - bigint ivalue6 = static_cast (collapse_tree(tree->extra[3])); + auto ivalue1 = static_cast (collapse_tree(tree->first)); + auto ivalue2 = static_cast (collapse_tree(tree->second)); + auto ivalue3 = static_cast (collapse_tree(tree->extra[0])); + auto ivalue4 = static_cast (collapse_tree(tree->extra[1])); + auto ivalue5 = static_cast (collapse_tree(tree->extra[2])); + auto ivalue6 = static_cast (collapse_tree(tree->extra[3])); if (tree->first->type != VALUE || tree->second->type != VALUE || tree->extra[0]->type != VALUE || tree->extra[1]->type != VALUE || tree->extra[2]->type != VALUE || tree->extra[3]->type != VALUE) @@ -2966,8 +2911,8 @@ double Variable::eval_tree(Tree *tree, int i) } if (tree->type == STAGGER) { - bigint ivalue1 = static_cast (eval_tree(tree->first,i)); - bigint ivalue2 = static_cast (eval_tree(tree->second,i)); + auto ivalue1 = static_cast (eval_tree(tree->first,i)); + auto ivalue2 = static_cast (eval_tree(tree->second,i)); if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2) error->one(FLERR,"Invalid math function in variable formula"); bigint lower = update->ntimestep/ivalue1 * ivalue1; @@ -2978,9 +2923,9 @@ double Variable::eval_tree(Tree *tree, int i) } if (tree->type == LOGFREQ) { - bigint ivalue1 = static_cast (eval_tree(tree->first,i)); - bigint ivalue2 = static_cast (eval_tree(tree->second,i)); - bigint ivalue3 = static_cast (eval_tree(tree->extra[0],i)); + auto ivalue1 = static_cast (eval_tree(tree->first,i)); + auto ivalue2 = static_cast (eval_tree(tree->second,i)); + auto ivalue3 = static_cast (eval_tree(tree->extra[0],i)); if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3) error->one(FLERR,"Invalid math function in variable formula"); if (update->ntimestep < ivalue1) arg = ivalue1; @@ -2995,9 +2940,9 @@ double Variable::eval_tree(Tree *tree, int i) } if (tree->type == LOGFREQ2) { - bigint ivalue1 = static_cast (eval_tree(tree->first,i)); - bigint ivalue2 = static_cast (eval_tree(tree->second,i)); - bigint ivalue3 = static_cast (eval_tree(tree->extra[0],i)); + auto ivalue1 = static_cast (eval_tree(tree->first,i)); + auto ivalue2 = static_cast (eval_tree(tree->second,i)); + auto ivalue3 = static_cast (eval_tree(tree->extra[0],i)); if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 ) error->all(FLERR,"Invalid math function in variable formula"); if (update->ntimestep < ivalue1) arg = ivalue1; @@ -3016,9 +2961,9 @@ double Variable::eval_tree(Tree *tree, int i) } if (tree->type == STRIDE) { - bigint ivalue1 = static_cast (eval_tree(tree->first,i)); - bigint ivalue2 = static_cast (eval_tree(tree->second,i)); - bigint ivalue3 = static_cast (eval_tree(tree->extra[0],i)); + auto ivalue1 = static_cast (eval_tree(tree->first,i)); + auto ivalue2 = static_cast (eval_tree(tree->second,i)); + auto ivalue3 = static_cast (eval_tree(tree->extra[0],i)); if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2) error->one(FLERR,"Invalid math function in variable formula"); if (update->ntimestep < ivalue1) arg = ivalue1; @@ -3031,12 +2976,12 @@ double Variable::eval_tree(Tree *tree, int i) } if (tree->type == STRIDE2) { - bigint ivalue1 = static_cast (eval_tree(tree->first,i)); - bigint ivalue2 = static_cast (eval_tree(tree->second,i)); - bigint ivalue3 = static_cast (eval_tree(tree->extra[0],i)); - bigint ivalue4 = static_cast (eval_tree(tree->extra[1],i)); - bigint ivalue5 = static_cast (eval_tree(tree->extra[2],i)); - bigint ivalue6 = static_cast (eval_tree(tree->extra[3],i)); + auto ivalue1 = static_cast (eval_tree(tree->first,i)); + auto ivalue2 = static_cast (eval_tree(tree->second,i)); + auto ivalue3 = static_cast (eval_tree(tree->extra[0],i)); + auto ivalue4 = static_cast (eval_tree(tree->extra[1],i)); + auto ivalue5 = static_cast (eval_tree(tree->extra[2],i)); + auto ivalue6 = static_cast (eval_tree(tree->extra[3],i)); if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2) error->one(FLERR,"Invalid math function in variable formula"); if (ivalue4 < 0 || ivalue5 < 0 || ivalue6 <= 0 || ivalue4 > ivalue5) @@ -3103,17 +3048,13 @@ double Variable::eval_tree(Tree *tree, int i) } if (tree->type == RMASK) { - if (domain->regions[tree->ivalue1]->match(atom->x[i][0], - atom->x[i][1], - atom->x[i][2])) return 1.0; + if (domain->regions[tree->ivalue1]->match(atom->x[i][0], atom->x[i][1], atom->x[i][2])) return 1.0; else return 0.0; } if (tree->type == GRMASK) { if ((atom->mask[i] & tree->ivalue1) && - (domain->regions[tree->ivalue2]->match(atom->x[i][0], - atom->x[i][1], - atom->x[i][2]))) return 1.0; + (domain->regions[tree->ivalue2]->match(atom->x[i][0], atom->x[i][1], atom->x[i][2]))) return 1.0; else return 0.0; } @@ -3131,10 +3072,8 @@ int Variable::size_tree_vector(Tree *tree) { int nsize = 0; if (tree->type == VECTORARRAY) nsize = tree->nvector; - if (tree->first) nsize = compare_tree_vector(nsize, - size_tree_vector(tree->first)); - if (tree->second) nsize = compare_tree_vector(nsize, - size_tree_vector(tree->second)); + if (tree->first) nsize = compare_tree_vector(nsize, size_tree_vector(tree->first)); + if (tree->second) nsize = compare_tree_vector(nsize, size_tree_vector(tree->second)); if (tree->nextra) { for (int i = 0; i < tree->nextra; i++) nsize = compare_tree_vector(nsize,size_tree_vector(tree->extra[i])); @@ -3164,7 +3103,7 @@ void Variable::free_tree(Tree *tree) if (tree->second) free_tree(tree->second); if (tree->nextra) { for (int i = 0; i < tree->nextra; i++) free_tree(tree->extra[i]); - delete [] tree->extra; + delete[] tree->extra; } if (tree->selfalloc) memory->destroy(tree->array); @@ -3223,8 +3162,7 @@ tagint Variable::int_between_brackets(char *&ptr, int varallow) varflag = 1; while (*ptr && *ptr != ']') { if (!isalnum(*ptr) && *ptr != '_') - error->all(FLERR,"Variable name between brackets must be " - "alphanumeric or underscore characters"); + error->all(FLERR,"Variable name between brackets must be letters, numbers, or underscores"); ptr++; } @@ -3278,9 +3216,8 @@ tagint Variable::int_between_brackets(char *&ptr, int varallow) swiggle(x,y,z),cwiggle(x,y,z) ------------------------------------------------------------------------- */ -int Variable::math_function(char *word, char *contents, Tree **tree, - Tree **treestack, int &ntreestack, - double *argstack, int &nargstack, int ivar) +int Variable::math_function(char *word, char *contents, Tree **tree, Tree **treestack, + int &ntreestack, double *argstack, int &nargstack, int ivar) { // word not a match to any math function @@ -3349,8 +3286,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, if (tree) newtree->type = SQRT; else { if (value1 < 0.0) - print_var_error(FLERR,"Sqrt of negative value in " - "variable formula",ivar,0); + print_var_error(FLERR,"Sqrt of negative value in variable formula",ivar,0); argstack[nargstack++] = sqrt(value1); } @@ -3365,8 +3301,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, if (tree) newtree->type = LN; else { if (value1 <= 0.0) - print_var_error(FLERR,"Log of zero/negative value in " - "variable formula",ivar,0); + print_var_error(FLERR,"Log of zero/negative value in variable formula",ivar,0); argstack[nargstack++] = log(value1); } } else if (strcmp(word,"log") == 0) { @@ -3375,8 +3310,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, if (tree) newtree->type = LOG; else { if (value1 <= 0.0) - print_var_error(FLERR,"Log of zero/negative value in " - "variable formula",ivar,0); + print_var_error(FLERR,"Log of zero/negative value in variable formula",ivar,0); argstack[nargstack++] = log10(value1); } } else if (strcmp(word,"abs") == 0) { @@ -3481,8 +3415,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, if (narg != 2) print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (update->whichflag == 0) - print_var_error(FLERR,"Cannot use ramp in " - "variable formula between runs",ivar); + print_var_error(FLERR,"Cannot use ramp in variable formula between runs",ivar); if (tree) newtree->type = RAMP; else { double delta = update->ntimestep - update->beginstep; @@ -3496,8 +3429,8 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = STAGGER; else { - bigint ivalue1 = static_cast (value1); - bigint ivalue2 = static_cast (value2); + auto ivalue1 = static_cast (value1); + auto ivalue2 = static_cast (value2); if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2) print_var_error(FLERR,"Invalid math function in variable formula",ivar); bigint lower = update->ntimestep/ivalue1 * ivalue1; @@ -3513,9 +3446,9 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = LOGFREQ; else { - bigint ivalue1 = static_cast (value1); - bigint ivalue2 = static_cast (value2); - bigint ivalue3 = static_cast (values[0]); + auto ivalue1 = static_cast (value1); + auto ivalue2 = static_cast (value2); + auto ivalue3 = static_cast (values[0]); if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3) print_var_error(FLERR,"Invalid math function in variable formula",ivar); double value; @@ -3535,9 +3468,9 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = LOGFREQ2; else { - bigint ivalue1 = static_cast (value1); - bigint ivalue2 = static_cast (value2); - bigint ivalue3 = static_cast (values[0]); + auto ivalue1 = static_cast (value1); + auto ivalue2 = static_cast (value2); + auto ivalue3 = static_cast (values[0]); if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 ) print_var_error(FLERR,"Invalid math function in variable formula",ivar); double value; @@ -3560,9 +3493,9 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = LOGFREQ3; else { - bigint ivalue1 = static_cast (value1); - bigint ivalue2 = static_cast (value2); - bigint ivalue3 = static_cast (values[0]); + auto ivalue1 = static_cast (value1); + auto ivalue2 = static_cast (value2); + auto ivalue3 = static_cast (values[0]); if (ivalue1 <= 0 || ivalue2 <= 1 || ivalue3 <= 0 || ivalue3-ivalue1+1 < ivalue2 ) print_var_error(FLERR,"Invalid math function in variable formula",ivar); @@ -3591,9 +3524,9 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = STRIDE; else { - bigint ivalue1 = static_cast (value1); - bigint ivalue2 = static_cast (value2); - bigint ivalue3 = static_cast (values[0]); + auto ivalue1 = static_cast (value1); + auto ivalue2 = static_cast (value2); + auto ivalue3 = static_cast (values[0]); if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2) error->one(FLERR,"Invalid math function in variable formula"); double value; @@ -3611,12 +3544,12 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = STRIDE2; else { - bigint ivalue1 = static_cast (value1); - bigint ivalue2 = static_cast (value2); - bigint ivalue3 = static_cast (values[0]); - bigint ivalue4 = static_cast (values[1]); - bigint ivalue5 = static_cast (values[2]); - bigint ivalue6 = static_cast (values[3]); + auto ivalue1 = static_cast (value1); + auto ivalue2 = static_cast (value2); + auto ivalue3 = static_cast (values[0]); + auto ivalue4 = static_cast (values[1]); + auto ivalue5 = static_cast (values[2]); + auto ivalue6 = static_cast (values[3]); if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2) error->one(FLERR,"Invalid math function in variable formula"); if (ivalue4 < 0 || ivalue5 < 0 || ivalue6 <= 0 || ivalue4 > ivalue5) @@ -3648,8 +3581,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, if (narg != 2) print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (update->whichflag == 0) - print_var_error(FLERR,"Cannot use vdisplace in " - "variable formula between runs",ivar); + print_var_error(FLERR,"Cannot use vdisplace in variable formula between runs",ivar); if (tree) newtree->type = VDISPLACE; else { double delta = update->ntimestep - update->beginstep; @@ -3661,8 +3593,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, if (narg != 3) print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (update->whichflag == 0) - print_var_error(FLERR,"Cannot use swiggle in " - "variable formula between runs",ivar); + print_var_error(FLERR,"Cannot use swiggle in variable formula between runs",ivar); if (tree) newtree->type = CWIGGLE; else { if (values[0] == 0.0) @@ -3677,8 +3608,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, if (narg != 3) print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (update->whichflag == 0) - print_var_error(FLERR,"Cannot use cwiggle in " - "variable formula between runs",ivar); + print_var_error(FLERR,"Cannot use cwiggle in variable formula between runs",ivar); if (tree) newtree->type = CWIGGLE; else { if (values[0] == 0.0) @@ -3692,7 +3622,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, // delete stored args - for (int i = 0; i < narg; i++) delete [] args[i]; + for (int i = 0; i < narg; i++) delete[] args[i]; return 1; } @@ -3710,9 +3640,8 @@ int Variable::math_function(char *word, char *contents, Tree **tree, torque(group,dim),inertia(group,dim),omega(group,dim) ------------------------------------------------------------------------- */ -int Variable::group_function(char *word, char *contents, Tree **tree, - Tree **treestack, int &ntreestack, - double *argstack, int &nargstack, int ivar) +int Variable::group_function(char *word, char *contents, Tree **tree, Tree **treestack, + int &ntreestack, double *argstack, int &nargstack, int ivar) { // word not a match to any group function @@ -3772,8 +3701,7 @@ int Variable::group_function(char *word, char *contents, Tree **tree, int iregion = region_function(args[2],ivar); double masstotal = group->mass(igroup,iregion); group->xcm(igroup,masstotal,xcm,iregion); - } else print_var_error(FLERR,"Invalid group function in " - "variable formula",ivar); + } else print_var_error(FLERR,"Invalid group function in variable formula",ivar); if (strcmp(args[1],"x") == 0) value = xcm[0]; else if (strcmp(args[1],"y") == 0) value = xcm[1]; else if (strcmp(args[1],"z") == 0) value = xcm[2]; @@ -3789,8 +3717,7 @@ int Variable::group_function(char *word, char *contents, Tree **tree, int iregion = region_function(args[2],ivar); double masstotal = group->mass(igroup,iregion); group->vcm(igroup,masstotal,vcm,iregion); - } else print_var_error(FLERR,"Invalid group function in " - "variable formula",ivar); + } else print_var_error(FLERR,"Invalid group function in variable formula",ivar); if (strcmp(args[1],"x") == 0) value = vcm[0]; else if (strcmp(args[1],"y") == 0) value = vcm[1]; else if (strcmp(args[1],"z") == 0) value = vcm[2]; @@ -3832,8 +3759,7 @@ int Variable::group_function(char *word, char *contents, Tree **tree, double masstotal = group->mass(igroup,iregion); group->xcm(igroup,masstotal,xcm,iregion); value = group->gyration(igroup,masstotal,xcm,iregion); - } else print_var_error(FLERR,"Invalid group function in " - "variable formula",ivar); + } else print_var_error(FLERR,"Invalid group function in variable formula",ivar); } else if (strcmp(word,"ke") == 0) { if (narg == 1) value = group->ke(igroup); @@ -3852,8 +3778,7 @@ int Variable::group_function(char *word, char *contents, Tree **tree, double masstotal = group->mass(igroup,iregion); group->xcm(igroup,masstotal,xcm,iregion); group->angmom(igroup,xcm,lmom,iregion); - } else print_var_error(FLERR,"Invalid group function in " - "variable formula",ivar); + } else print_var_error(FLERR,"Invalid group function in variable formula",ivar); if (strcmp(args[1],"x") == 0) value = lmom[0]; else if (strcmp(args[1],"y") == 0) value = lmom[1]; else if (strcmp(args[1],"z") == 0) value = lmom[2]; @@ -3871,8 +3796,7 @@ int Variable::group_function(char *word, char *contents, Tree **tree, double masstotal = group->mass(igroup,iregion); group->xcm(igroup,masstotal,xcm,iregion); group->torque(igroup,xcm,tq,iregion); - } else print_var_error(FLERR,"Invalid group function in " - "variable formula",ivar); + } else print_var_error(FLERR,"Invalid group function in variable formula",ivar); if (strcmp(args[1],"x") == 0) value = tq[0]; else if (strcmp(args[1],"y") == 0) value = tq[1]; else if (strcmp(args[1],"z") == 0) value = tq[2]; @@ -3890,8 +3814,7 @@ int Variable::group_function(char *word, char *contents, Tree **tree, double masstotal = group->mass(igroup,iregion); group->xcm(igroup,masstotal,xcm,iregion); group->inertia(igroup,xcm,inertia,iregion); - } else print_var_error(FLERR,"Invalid group function in " - "variable formula",ivar); + } else print_var_error(FLERR,"Invalid group function in variable formula",ivar); if (strcmp(args[1],"xx") == 0) value = inertia[0][0]; else if (strcmp(args[1],"yy") == 0) value = inertia[1][1]; else if (strcmp(args[1],"zz") == 0) value = inertia[2][2]; @@ -3916,8 +3839,7 @@ int Variable::group_function(char *word, char *contents, Tree **tree, group->angmom(igroup,xcm,angmom,iregion); group->inertia(igroup,xcm,inertia,iregion); group->omega(angmom,inertia,omega); - } else print_var_error(FLERR,"Invalid group function in " - "variable formula",ivar); + } else print_var_error(FLERR,"Invalid group function in variable formula",ivar); if (strcmp(args[1],"x") == 0) value = omega[0]; else if (strcmp(args[1],"y") == 0) value = omega[1]; else if (strcmp(args[1],"z") == 0) value = omega[2]; @@ -3926,12 +3848,12 @@ int Variable::group_function(char *word, char *contents, Tree **tree, // delete stored args - for (int i = 0; i < narg; i++) delete [] args[i]; + for (int i = 0; i < narg; i++) delete[] args[i]; // save value in tree or on argstack if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value; treestack[ntreestack++] = newtree; @@ -3970,21 +3892,19 @@ int Variable::region_function(char *id, int ivar) gmask(x),rmask(x),grmask(x,y),next(x) ------------------------------------------------------------------------- */ -int Variable::special_function(char *word, char *contents, Tree **tree, - Tree **treestack, int &ntreestack, - double *argstack, int &nargstack, int ivar) +int Variable::special_function(char *word, char *contents, Tree **tree, Tree **treestack, + int &ntreestack, double *argstack, int &nargstack, int ivar) { double sx,sxx; double value,sy,sxy; // word not a match to any special function - if (strcmp(word,"sum") && strcmp(word,"min") && strcmp(word,"max") && - strcmp(word,"ave") && strcmp(word,"trap") && strcmp(word,"slope") && - strcmp(word,"gmask") && strcmp(word,"rmask") && - strcmp(word,"grmask") && strcmp(word,"next") && - strcmp(word,"is_active") && strcmp(word,"is_defined") && - strcmp(word,"is_available") && strcmp(word,"is_file")) + if (strcmp(word,"sum") && strcmp(word,"min") && strcmp(word,"max") && strcmp(word,"ave") && + strcmp(word,"trap") && strcmp(word,"slope") && strcmp(word,"gmask") && strcmp(word,"rmask") && + strcmp(word,"grmask") && strcmp(word,"next") && strcmp(word,"is_active") && + strcmp(word,"is_defined") && strcmp(word,"is_available") && strcmp(word,"is_file") && + strcmp(word,"extract_setting")) return 0; // parse contents for comma-separated args @@ -4085,11 +4005,9 @@ int Variable::special_function(char *word, char *contents, Tree **tree, nstride = 1; } else if (index && fix->array_flag) { if (index > fix->size_array_cols) - print_var_error(FLERR,"Variable formula fix array " - "is accessed out-of-range",ivar); + print_var_error(FLERR,"Variable formula fix array is accessed out-of-range",ivar); if (update->whichflag > 0 && update->ntimestep % fix->global_freq) - print_var_error(FLERR,"Fix in variable not computed at " - "compatible time",ivar); + print_var_error(FLERR,"Fix in variable not computed at compatible time",ivar); nvec = fix->size_array_rows; nstride = fix->size_array_cols; } else print_var_error(FLERR,"Mismatched fix in variable formula",ivar); @@ -4105,15 +4023,12 @@ int Variable::special_function(char *word, char *contents, Tree **tree, } else index = 0; if (index) - print_var_error(FLERR,"Invalid special function in " - "variable formula",ivar); + print_var_error(FLERR,"Invalid special function in variable formula",ivar); ivar = find(&args[0][2]); if (ivar < 0) - print_var_error(FLERR,"Invalid special function in " - "variable formula",ivar); + print_var_error(FLERR,"Invalid special function in variable formula",ivar); if (style[ivar] != VECTOR) - print_var_error(FLERR,"Mis-matched special function variable " - "in variable formula",ivar); + print_var_error(FLERR,"Mis-matched special function variable in variable formula",ivar); if (eval_in_progress[ivar]) print_var_error(FLERR,"has a circular dependency",ivar); @@ -4125,8 +4040,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Cannot compute average of empty vector",ivar); - } else print_var_error(FLERR,"Invalid special function in " - "variable formula",ivar); + } else print_var_error(FLERR,"Invalid special function in variable formula",ivar); value = 0.0; if (method == SLOPE) sx = sxx = sy = sxy = 0.0; @@ -4215,7 +4129,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // save value in tree or on argstack if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value; treestack[ntreestack++] = newtree; @@ -4225,8 +4139,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, } else if (strcmp(word,"gmask") == 0) { if (tree == nullptr) - print_var_error(FLERR,"Gmask function in equal-style " - "variable formula",ivar); + print_var_error(FLERR,"Gmask function in equal-style variable formula",ivar); if (narg != 1) print_var_error(FLERR,"Invalid special function in variable formula",ivar); @@ -4234,30 +4147,28 @@ int Variable::special_function(char *word, char *contents, Tree **tree, if (igroup == -1) print_var_error(FLERR,"Group ID in variable formula does not exist",ivar); - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = GMASK; newtree->ivalue1 = group->bitmask[igroup]; treestack[ntreestack++] = newtree; } else if (strcmp(word,"rmask") == 0) { if (tree == nullptr) - print_var_error(FLERR,"Rmask function in equal-style " - "variable formula",ivar); + print_var_error(FLERR,"Rmask function in equal-style variable formula",ivar); if (narg != 1) print_var_error(FLERR,"Invalid special function in variable formula",ivar); int iregion = region_function(args[0],ivar); domain->regions[iregion]->prematch(); - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = RMASK; newtree->ivalue1 = iregion; treestack[ntreestack++] = newtree; } else if (strcmp(word,"grmask") == 0) { if (tree == nullptr) - print_var_error(FLERR,"Grmask function in equal-style " - "variable formula",ivar); + print_var_error(FLERR,"Grmask function in equal-style variable formula",ivar); if (narg != 2) print_var_error(FLERR,"Invalid special function in variable formula",ivar); @@ -4267,7 +4178,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, int iregion = region_function(args[1],ivar); domain->regions[iregion]->prematch(); - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = GRMASK; newtree->ivalue1 = group->bitmask[igroup]; newtree->ivalue2 = iregion; @@ -4296,7 +4207,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, if (done) remove(ivar); if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value; treestack[ntreestack++] = newtree; @@ -4308,8 +4219,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, } else if (style[ivar] == ATOMFILE) { if (tree == nullptr) - print_var_error(FLERR,"Atomfile variable in " - "equal-style variable formula",ivar); + print_var_error(FLERR,"Atomfile variable in equal-style variable formula",ivar); double *result; memory->create(result,atom->nlocal,"variable:result"); @@ -4318,20 +4228,18 @@ int Variable::special_function(char *word, char *contents, Tree **tree, int done = reader[ivar]->read_peratom(); if (done) remove(ivar); - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = ATOMARRAY; newtree->array = result; newtree->nstride = 1; newtree->selfalloc = 1; treestack[ntreestack++] = newtree; - } else print_var_error(FLERR,"Invalid variable style in " - "special function next",ivar); + } else print_var_error(FLERR,"Invalid variable style in special function next",ivar); } else if (strcmp(word,"is_active") == 0) { if (narg != 2) - print_var_error(FLERR,"Invalid is_active() function in " - "variable formula",ivar); + print_var_error(FLERR,"Invalid is_active() function in variable formula",ivar); Info info(lmp); value = (info.is_active(args[0],args[1])) ? 1.0 : 0.0; @@ -4339,7 +4247,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // save value in tree or on argstack if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value; treestack[ntreestack++] = newtree; @@ -4347,8 +4255,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, } else if (strcmp(word,"is_available") == 0) { if (narg != 2) - print_var_error(FLERR,"Invalid is_available() function in " - "variable formula",ivar); + print_var_error(FLERR,"Invalid is_available() function in variable formula",ivar); Info info(lmp); value = (info.is_available(args[0],args[1])) ? 1.0 : 0.0; @@ -4356,7 +4263,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // save value in tree or on argstack if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value; treestack[ntreestack++] = newtree; @@ -4364,8 +4271,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, } else if (strcmp(word,"is_defined") == 0) { if (narg != 2) - print_var_error(FLERR,"Invalid is_defined() function in " - "variable formula",ivar); + print_var_error(FLERR,"Invalid is_defined() function in variable formula",ivar); Info info(lmp); value = (info.is_defined(args[0],args[1])) ? 1.0 : 0.0; @@ -4373,7 +4279,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // save value in tree or on argstack if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value; treestack[ntreestack++] = newtree; @@ -4381,8 +4287,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, } else if (strcmp(word,"is_file") == 0) { if (narg != 1) - print_var_error(FLERR,"Invalid is_file() function in " - "variable formula",ivar); + print_var_error(FLERR,"Invalid is_file() function in variable formula",ivar); FILE *fp = fopen(args[0],"r"); value = (fp == nullptr) ? 0.0 : 1.0; @@ -4391,7 +4296,21 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // save value in tree or on argstack if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); + newtree->type = VALUE; + newtree->value = value; + treestack[ntreestack++] = newtree; + } else argstack[nargstack++] = value; + + } else if (strcmp(word,"extract_setting") == 0) { + if (narg != 1) print_var_error(FLERR,"Invalid extract_setting() function in variable formula",ivar); + + value = lammps_extract_setting(lmp, args[0]); + + // save value in tree or on argstack + + if (tree) { + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value; treestack[ntreestack++] = newtree; @@ -4400,7 +4319,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // delete stored args - for (int i = 0; i < narg; i++) delete [] args[i]; + for (int i = 0; i < narg; i++) delete[] args[i]; return 1; } @@ -4415,17 +4334,14 @@ int Variable::special_function(char *word, char *contents, Tree **tree, id,mass,type,mol,x,y,z,vx,vy,vz,fx,fy,fz,q ------------------------------------------------------------------------- */ -void Variable::peratom2global(int flag, char *word, - double *vector, int nstride, tagint id, - Tree **tree, Tree **treestack, int &ntreestack, - double *argstack, int &nargstack) +void Variable::peratom2global(int flag, char *word, double *vector, int nstride, tagint id, Tree **tree, + Tree **treestack, int &ntreestack, double *argstack, int &nargstack) { // error check for ID larger than any atom // int_between_brackets() already checked for ID <= 0 if (atom->map_style == Atom::MAP_NONE) - error->all(FLERR, - "Indexed per-atom vector in variable formula without atom map"); + error->all(FLERR, "Indexed per-atom vector in variable formula without atom map"); if (id > atom->map_tag_max) error->all(FLERR,"Variable atom ID is too large"); @@ -4474,7 +4390,7 @@ void Variable::peratom2global(int flag, char *word, MPI_Allreduce(&mine,&value,1,MPI_DOUBLE,MPI_SUM,world); if (tree) { - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = VALUE; newtree->value = value; treestack[ntreestack++] = newtree; @@ -4515,13 +4431,12 @@ int Variable::is_atom_vector(char *word) id,mass,type,mol,x,y,z,vx,vy,vz,fx,fy,fz,q ------------------------------------------------------------------------- */ -void Variable::atom_vector(char *word, Tree **tree, - Tree **treestack, int &ntreestack) +void Variable::atom_vector(char *word, Tree **tree, Tree **treestack, int &ntreestack) { if (tree == nullptr) error->all(FLERR,"Atom vector in equal-style variable formula"); - Tree *newtree = new Tree(); + auto newtree = new Tree(); newtree->type = ATOMARRAY; newtree->nstride = 3; treestack[ntreestack++] = newtree; @@ -4712,7 +4627,7 @@ double Variable::evaluate_boolean(char *str) argstack[nargstack].flag = 0; nargstack++; - delete [] contents; + delete[] contents; // ---------------- // number: push value onto stack @@ -4843,8 +4758,8 @@ double Variable::evaluate_boolean(char *str) } else { if (strcmp(str1,str2) == 0) argstack[nargstack].value = 1.0; else argstack[nargstack].value = 0.0; - delete [] str1; - delete [] str2; + delete[] str1; + delete[] str2; } } else if (opprevious == NE) { if (flag1 != flag2) @@ -4855,8 +4770,8 @@ double Variable::evaluate_boolean(char *str) } else { if (strcmp(str1,str2) != 0) argstack[nargstack].value = 1.0; else argstack[nargstack].value = 0.0; - delete [] str1; - delete [] str2; + delete[] str1; + delete[] str2; } } else if (opprevious == LT) { if (flag2) error->all(FLERR,"Invalid Boolean syntax in if command"); @@ -4925,8 +4840,7 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : if (me == 0) { fp = fopen(file,"r"); if (fp == nullptr) - error->one(FLERR,"Cannot open file variable file {}: {}", - file, utils::getsyserror()); + error->one(FLERR,"Cannot open file variable file {}: {}", file, utils::getsyserror()); } // if atomfile-style variable, must store per-atom values read from file @@ -4942,7 +4856,7 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : error->all(FLERR,"Cannot use atomfile-style variable unless an atom map exists"); id_fix = utils::strdup(std::string(name) + "_VARIABLE_STORE"); - fixstore = (FixStore *) modify->add_fix(std::string(id_fix) + " all STORE peratom 0 1"); + fixstore = dynamic_cast( modify->add_fix(std::string(id_fix) + " all STORE peratom 0 1")); buffer = new char[CHUNK*MAXLINE]; } } @@ -4960,8 +4874,8 @@ VarReader::~VarReader() if (fixstore) { if (modify) modify->delete_fix(id_fix); - delete [] id_fix; - delete [] buffer; + delete[] id_fix; + delete[] buffer; } } @@ -5057,12 +4971,10 @@ int VarReader::read_peratom() tag = words.next_bigint(); value = words.next_double(); } catch (TokenizerException &e) { - error->all(FLERR,"Invalid atomfile line '{}': {}", - buf,e.what()); + error->all(FLERR,"Invalid atomfile line '{}': {}",buf,e.what()); } if ((tag <= 0) || (tag > map_tag_max)) - error->all(FLERR,"Invalid atom ID {} in variable " - "file", tag); + error->all(FLERR,"Invalid atom ID {} in variable file", tag); if ((m = atom->map(tag)) >= 0) vstore[m] = value; buf = next + 1; } diff --git a/src/write_coeff.cpp b/src/write_coeff.cpp index 0aca596ae6..4a46f4c2db 100644 --- a/src/write_coeff.cpp +++ b/src/write_coeff.cpp @@ -30,6 +30,8 @@ using namespace LAMMPS_NS; enum { REGULAR_MODE, CLASS2_MODE }; +static constexpr int BUF_SIZE = 256; + /* ---------------------------------------------------------------------- called as write_coeff command in input script ------------------------------------------------------------------------- */ @@ -47,7 +49,7 @@ void WriteCoeff::command(int narg, char **arg) lmp->init(); if (comm->me == 0) { - char str[256], coeff[256]; + char str[BUF_SIZE], coeff[BUF_SIZE]; FILE *one = fopen(file, "wb+"); if (one == nullptr) @@ -88,7 +90,7 @@ void WriteCoeff::command(int narg, char **arg) while (true) { int coeff_mode = REGULAR_MODE; - if (fgets(str, 256, one) == nullptr) break; + if (fgets(str, BUF_SIZE, one) == nullptr) break; // some coeffs need special treatment if (strstr(str, "class2") != nullptr) { @@ -100,20 +102,20 @@ void WriteCoeff::command(int narg, char **arg) coeff_mode = CLASS2_MODE; } - const char *section = (const char *) ""; + const char * section = (const char *) ""; // NOLINT fputs(str, two); // style - utils::sfgets(FLERR, str, 256, one, file, error); // coeff + utils::sfgets(FLERR, str, BUF_SIZE, one, file, error); // coeff int n = strlen(str); - strcpy(coeff, str); + strncpy(coeff, str, BUF_SIZE); coeff[n - 1] = '\0'; - utils::sfgets(FLERR, str, 256, one, file, error); + utils::sfgets(FLERR, str, BUF_SIZE, one, file, error); while (strcmp(str, "end\n") != 0) { if (coeff_mode == REGULAR_MODE) { fprintf(two, "%s %s", coeff, str); - utils::sfgets(FLERR, str, 256, one, file, error); + utils::sfgets(FLERR, str, BUF_SIZE, one, file, error); } else if (coeff_mode == CLASS2_MODE) { @@ -125,7 +127,7 @@ void WriteCoeff::command(int narg, char **arg) // all but the the last section end with an empty line. // skip it and read and parse the next section title - utils::sfgets(FLERR, str, 256, one, file, error); + utils::sfgets(FLERR, str, BUF_SIZE, one, file, error); if (strcmp(str, "BondBond Coeffs\n") == 0) section = (const char *) "bb"; @@ -145,8 +147,8 @@ void WriteCoeff::command(int narg, char **arg) section = (const char *) "aa"; // gobble up one more empty line - utils::sfgets(FLERR, str, 256, one, file, error); - utils::sfgets(FLERR, str, 256, one, file, error); + utils::sfgets(FLERR, str, BUF_SIZE, one, file, error); + utils::sfgets(FLERR, str, BUF_SIZE, one, file, error); } // parse type number and skip over it @@ -156,7 +158,7 @@ void WriteCoeff::command(int narg, char **arg) while ((*p != '\0') && isdigit(*p)) ++p; fprintf(two, "%s %d %s %s", coeff, type, section, p); - utils::sfgets(FLERR, str, 256, one, file, error); + utils::sfgets(FLERR, str, BUF_SIZE, one, file, error); } } fputc('\n', two); diff --git a/src/write_dump.cpp b/src/write_dump.cpp index eba081582e..b29da81463 100644 --- a/src/write_dump.cpp +++ b/src/write_dump.cpp @@ -47,7 +47,7 @@ void WriteDump::command(int narg, char **arg) Dump *dump = nullptr; - char **dumpargs = new char*[modindex+2]; + auto dumpargs = new char*[modindex+2]; dumpargs[0] = (char *) "WRITE_DUMP"; // dump id dumpargs[1] = arg[0]; // group dumpargs[2] = arg[1]; // dump style @@ -56,7 +56,7 @@ void WriteDump::command(int narg, char **arg) for (int i = 2; i < modindex; ++i) dumpargs[i+2] = arg[i]; - if (false) { + if (false) { // NOLINT return; // dummy branch to enable else-if macro expansion #define DUMP_CLASS @@ -74,10 +74,10 @@ void WriteDump::command(int narg, char **arg) // set multifile_override for DumpImage so that filename needs no "*" if (strcmp(arg[1],"image") == 0) - ((DumpImage *) dump)->multifile_override = 1; + (dynamic_cast( dump))->multifile_override = 1; if (strcmp(arg[1],"cfg") == 0) - ((DumpCFG *) dump)->multifile_override = 1; + (dynamic_cast( dump))->multifile_override = 1; if ((update->first_update == 0) && (comm->me == 0)) error->warning(FLERR,"Calling write_dump before a full system init."); diff --git a/tools/binary2txt.cpp b/tools/binary2txt.cpp index d3c5dba1b5..b675fb5b5d 100644 --- a/tools/binary2txt.cpp +++ b/tools/binary2txt.cpp @@ -83,7 +83,7 @@ int main(int narg, char **arg) } n = strlen(arg[iarg]) + 1 + 4; - char *filetxt = new char[n]; + auto filetxt = new char[n]; strcpy(filetxt, arg[iarg]); strcat(filetxt, ".txt"); FILE *fptxt = fopen(filetxt, "w"); @@ -226,7 +226,7 @@ int main(int narg, char **arg) // extend buffer to fit chunk size if (n > maxbuf) { - if (buf) delete[] buf; + delete[] buf; buf = new double[n]; maxbuf = n; } @@ -260,6 +260,6 @@ int main(int narg, char **arg) unit_style = nullptr; } - if (buf) delete[] buf; + delete[] buf; return 0; } diff --git a/tools/msi2lmp/README b/tools/msi2lmp/README index bd658d897e..401ec536fd 100644 --- a/tools/msi2lmp/README +++ b/tools/msi2lmp/README @@ -81,13 +81,10 @@ This program uses the .car and .mdf files from MSI/Biosyms's INSIGHT -- msi2lmp.exe is the name of the executable -- is the base name of the .car and .mdf files - -- -2001 - Output lammps files for LAMMPS version 2001 (F90 version) - Default is to write output for the C++ version of LAMMPS -- -print (or -p) - # is the print level 0 - silent except for error messages - 1 - minimal (default) + # is the print level 0 - silent except for error messages + 1 - minimal (default) 2 - verbose (usual for developing and checking new data files for consistency) 3 - even more verbose (additional debug info) diff --git a/unittest/commands/test_variables.cpp b/unittest/commands/test_variables.cpp index 57a5d4f0ca..0533de7329 100644 --- a/unittest/commands/test_variables.cpp +++ b/unittest/commands/test_variables.cpp @@ -207,7 +207,7 @@ TEST_F(VariableTest, CreateDelete) command("variable ten4 uloop 2");); TEST_FAILURE(".*ERROR: Incorrect conversion in format string.*", command("variable ten11 format two \"%08f\"");); - TEST_FAILURE(".*ERROR: Variable name 'ten@12' must have only alphanumeric characters or.*", + TEST_FAILURE(".*ERROR: Variable name 'ten@12' must have only letters, numbers, or undersc.*", command("variable ten@12 index one two three");); TEST_FAILURE(".*ERROR: Variable evaluation before simulation box is defined.*", variable->compute_equal("c_thermo_press");); diff --git a/unittest/force-styles/tests/fix-timestep-move_linear.yaml b/unittest/force-styles/tests/fix-timestep-move_linear.yaml new file mode 100644 index 0000000000..6abef11272 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-move_linear.yaml @@ -0,0 +1,74 @@ +--- +lammps_version: 24 Mar 2022 +date_generated: Sun Apr 3 03:06:24 2022 +epsilon: 2e-14 +skip_tests: +prerequisites: ! | + atom full + fix move +pre_commands: ! "" +post_commands: ! | + fix test solute move linear 1.0 1.0 1.0 +input_file: in.fourmol +natoms: 29 +run_pos: ! |2 + 1 1.7200631633077317e+00 4.4726588069312836e+00 1.8279913975585156e+00 + 2 2.3019708395540222e+00 4.9515239068888608e+00 1.1431026442709245e+00 + 3 1.3056462211944140e+00 3.2440473127136711e+00 1.3776619853110796e+00 + 4 4.2283858353148673e-01 3.4915333140468068e+00 7.5128731549594785e-01 + 5 1.1049823864064074e+00 2.9356812874307137e+00 2.4022773187148436e+00 + 6 2.2941260793770599e+00 2.2271928265665291e+00 7.1569059321421302e-01 + 7 2.3401987106287963e+00 1.9908722649924213e+00 -4.6331132243045614e-01 + 8 3.1641187171852803e+00 1.5162469404461476e+00 1.3234017623263132e+00 + 9 3.3777459838125838e+00 1.7463366133047700e+00 2.2687764473032632e+00 + 10 4.0185283555536984e+00 5.7160331534826425e-01 1.0326647272886698e+00 + 11 3.7929780509347664e+00 1.2895245923125742e-02 1.1593733568143261e-01 + 12 5.0030247876861225e+00 1.5107668003242725e+00 3.8113414684627522e-01 + 13 6.0447273787895934e+00 1.0986800145255375e+00 3.6155527316791636e-01 + 14 4.6033152817257079e+00 1.5921023849403642e+00 -6.5544135388230629e-01 + 15 4.9756315249791303e+00 2.5633426972296931e+00 7.5623492454009922e-01 + 16 4.6517554244980310e+00 -3.9571104249784383e-01 2.0329083359991782e+00 + 17 4.2309964792710639e+00 -1.0229189433193842e-01 3.1491948328949437e+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 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 2 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 3 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 4 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 5 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 6 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 7 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 8 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 9 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 10 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 11 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 12 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 13 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 14 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 15 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 16 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 17 1.0000000000000000e+00 1.0000000000000000e+00 1.0000000000000000e+00 + 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-move_rotate.yaml b/unittest/force-styles/tests/fix-timestep-move_rotate.yaml new file mode 100644 index 0000000000..b4ac0113eb --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-move_rotate.yaml @@ -0,0 +1,74 @@ +--- +lammps_version: 24 Mar 2022 +date_generated: Sun Apr 3 03:06:24 2022 +epsilon: 2e-14 +skip_tests: +prerequisites: ! | + atom full + fix move +pre_commands: ! "" +post_commands: ! | + fix test solute move rotate -0.18 1.1 -1.8 0.1 0.5 1.0 1.0 +input_file: in.fourmol +natoms: 29 +run_pos: ! |2 + 1 -2.7993683669226810e-01 2.4726588069312840e+00 -1.7200860244148450e-01 + 2 3.0197083955402271e-01 2.9515239068888608e+00 -8.5689735572907566e-01 + 3 -6.9435377880558635e-01 1.2440473127136713e+00 -6.2233801468892025e-01 + 4 -1.5771614164685133e+00 1.4915333140468072e+00 -1.2487126845040524e+00 + 5 -8.9501761359359322e-01 9.3568128743071388e-01 4.0227731871484329e-01 + 6 2.9412607937705959e-01 2.2719282656652884e-01 -1.2843094067857868e+00 + 7 3.4019871062879570e-01 -9.1277350075789077e-03 -2.4633113224304561e+00 + 8 1.1641187171852796e+00 -4.8375305955385284e-01 -6.7659823767368665e-01 + 9 1.3777459838125827e+00 -2.5366338669523070e-01 2.6877644730326344e-01 + 10 2.0185283555536979e+00 -1.4283966846517369e+00 -9.6733527271132957e-01 + 11 1.7929780509347653e+00 -1.9871047540768751e+00 -1.8840626643185665e+00 + 12 3.0030247876861216e+00 -4.8923319967572887e-01 -1.6188658531537241e+00 + 13 4.0447273787895925e+00 -9.0131998547446424e-01 -1.6384447268320823e+00 + 14 2.6033152817257070e+00 -4.0789761505963706e-01 -2.6554413538823054e+00 + 15 2.9756315249791299e+00 5.6334269722969144e-01 -1.2437650754599001e+00 + 16 2.6517554244980293e+00 -2.3957110424978456e+00 3.2908335999179084e-02 + 17 2.2309964792710621e+00 -2.1022918943319393e+00 1.1491948328949442e+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 -3.1271203016537847e+00 -1.4706662994868196e+00 1.0480451799087882e+00 + 2 -7.7244053214512371e+00 2.1699325352629488e+00 -3.1252573548635093e-01 + 3 2.4896794778365781e+00 -3.5382955941894649e+00 1.5201798493110743e+00 + 4 -6.4869308833104955e-01 -8.1292033418525875e+00 4.1294709797593985e+00 + 5 7.0834056891986288e+00 -5.2350417705319234e+00 1.9091803163460987e+00 + 6 6.3288343933688544e+00 2.3652656077349734e+00 -1.8155162432043723e+00 + 7 4.3519048787150751e+00 3.2831045265140744e+00 -2.0767427511285446e+00 + 8 1.2009192080844477e+01 6.8948882185832456e+00 -4.6483633173760710e+00 + 9 1.3367134079812072e+01 7.5614941211688285e+00 -5.1174604685656222e+00 + 10 1.6483139579874326e+01 1.1840191844735013e+01 -7.5684098803549391e+00 + 11 1.7044817849532322e+01 1.1090811320459508e+01 -7.2498874451829867e+00 + 12 9.4026927142316001e+00 1.7715611543038719e+01 -9.7980750429425196e+00 + 13 1.1654554684130250e+01 2.3557507710224332e+01 -1.2944209323525191e+01 + 14 6.0462972823495269e+00 1.6058458836709743e+01 -8.6338591465898240e+00 + 15 4.5607069302660133e+00 1.7352314681858498e+01 -9.1322280339558510e+00 + 16 2.4697122832464643e+01 1.4824797394989091e+01 -9.8821109807410092e+00 + 17 2.6178917667758348e+01 1.1844754445814953e+01 -8.5402689896833106e+00 + 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-move_transrot.yaml b/unittest/force-styles/tests/fix-timestep-move_transrot.yaml new file mode 100644 index 0000000000..8f6629c5be --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-move_transrot.yaml @@ -0,0 +1,74 @@ +--- +lammps_version: 24 Mar 2022 +date_generated: Sun Apr 3 03:07:42 2022 +epsilon: 2e-14 +skip_tests: +prerequisites: ! | + atom full + fix move +pre_commands: ! "" +post_commands: ! | + fix test solute move transrot 0.1 0.2 -0.1 -0.18 1.1 -1.8 0.1 0.5 1.0 1.0 +input_file: in.fourmol +natoms: 29 +run_pos: ! |2 + 1 -7.9936836692268087e-02 2.8726588069312839e+00 -3.7200860244148448e-01 + 2 5.0197083955402277e-01 3.3515239068888607e+00 -1.0568973557290757e+00 + 3 -4.9435377880558634e-01 1.6440473127136714e+00 -8.2233801468892032e-01 + 4 -1.3771614164685133e+00 1.8915333140468071e+00 -1.4487126845040523e+00 + 5 -6.9501761359359326e-01 1.3356812874307140e+00 2.0227731871484328e-01 + 6 4.9412607937705960e-01 6.2719282656652886e-01 -1.4843094067857867e+00 + 7 5.4019871062879576e-01 3.9087226499242111e-01 -2.6633113224304563e+00 + 8 1.3641187171852796e+00 -8.3753059553852816e-02 -8.7659823767368672e-01 + 9 1.5777459838125827e+00 1.4633661330476933e-01 6.8776447303263433e-02 + 10 2.2185283555536981e+00 -1.0283966846517369e+00 -1.1673352727113295e+00 + 11 1.9929780509347652e+00 -1.5871047540768752e+00 -2.0840626643185667e+00 + 12 3.2030247876861218e+00 -8.9233199675728847e-02 -1.8188658531537241e+00 + 13 4.2447273787895927e+00 -5.0131998547446421e-01 -1.8384447268320823e+00 + 14 2.8033152817257072e+00 -7.8976150596370420e-03 -2.8554413538823056e+00 + 15 3.1756315249791300e+00 9.6334269722969146e-01 -1.4437650754599001e+00 + 16 2.8517554244980294e+00 -1.9957110424978457e+00 -1.6709166400082093e-01 + 17 2.4309964792710623e+00 -1.7022918943319394e+00 9.4919483289494422e-01 + 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 -3.0271203016537847e+00 -1.2706662994868196e+00 9.4804517990878823e-01 + 2 -7.6244053214512375e+00 2.3699325352629490e+00 -4.1252573548635096e-01 + 3 2.5896794778365781e+00 -3.3382955941894648e+00 1.4201798493110742e+00 + 4 -5.4869308833104957e-01 -7.9292033418525874e+00 4.0294709797593988e+00 + 5 7.1834056891986284e+00 -5.0350417705319233e+00 1.8091803163460987e+00 + 6 6.4288343933688541e+00 2.5652656077349736e+00 -1.9155162432043724e+00 + 7 4.4519048787150748e+00 3.4831045265140745e+00 -2.1767427511285447e+00 + 8 1.2109192080844476e+01 7.0948882185832458e+00 -4.7483633173760706e+00 + 9 1.3467134079812071e+01 7.7614941211688286e+00 -5.2174604685656218e+00 + 10 1.6583139579874327e+01 1.2040191844735013e+01 -7.6684098803549388e+00 + 11 1.7144817849532323e+01 1.1290811320459508e+01 -7.3498874451829863e+00 + 12 9.5026927142315998e+00 1.7915611543038718e+01 -9.8980750429425193e+00 + 13 1.1754554684130250e+01 2.3757507710224331e+01 -1.3044209323525191e+01 + 14 6.1462972823495265e+00 1.6258458836709742e+01 -8.7338591465898237e+00 + 15 4.6607069302660129e+00 1.7552314681858498e+01 -9.2322280339558507e+00 + 16 2.4797122832464645e+01 1.5024797394989090e+01 -9.9821109807410089e+00 + 17 2.6278917667758350e+01 1.2044754445814952e+01 -8.6402689896833103e+00 + 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-move_variable.yaml b/unittest/force-styles/tests/fix-timestep-move_variable.yaml new file mode 100644 index 0000000000..22accc9d3c --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-move_variable.yaml @@ -0,0 +1,80 @@ +--- +lammps_version: 24 Mar 2022 +date_generated: Sun Apr 3 03:16:48 2022 +epsilon: 2e-14 +skip_tests: +prerequisites: ! | + atom full + fix move +pre_commands: ! | + variable vx equal 1.0 + variable x equal vdisplace(0.0,v_vx) + variable vy equal 0.0 + variable y equal 0.0 + variable vz equal 0.0 + variable z equal 0.0 +post_commands: ! | + fix test solute move variable v_x v_y v_z v_vx v_vy v_vz +input_file: in.fourmol +natoms: 29 +run_pos: ! |2 + 1 1.7200631633077317e+00 2.4726588069312840e+00 -1.7200860244148433e-01 + 2 2.3019708395540222e+00 2.9515239068888608e+00 -8.5689735572907566e-01 + 3 1.3056462211944140e+00 1.2440473127136711e+00 -6.2233801468892025e-01 + 4 4.2283858353148673e-01 1.4915333140468066e+00 -1.2487126845040522e+00 + 5 1.1049823864064074e+00 9.3568128743071344e-01 4.0227731871484346e-01 + 6 2.2941260793770599e+00 2.2719282656652909e-01 -1.2843094067857870e+00 + 7 2.3401987106287963e+00 -9.1277350075786561e-03 -2.4633113224304561e+00 + 8 3.1641187171852803e+00 -4.8375305955385234e-01 -6.7659823767368688e-01 + 9 3.3777459838125838e+00 -2.5366338669522998e-01 2.6877644730326306e-01 + 10 4.0185283555536984e+00 -1.4283966846517357e+00 -9.6733527271133024e-01 + 11 3.7929780509347664e+00 -1.9871047540768743e+00 -1.8840626643185674e+00 + 12 5.0030247876861225e+00 -4.8923319967572748e-01 -1.6188658531537248e+00 + 13 6.0447273787895934e+00 -9.0131998547446246e-01 -1.6384447268320836e+00 + 14 4.6033152817257079e+00 -4.0789761505963579e-01 -2.6554413538823063e+00 + 15 4.9756315249791303e+00 5.6334269722969288e-01 -1.2437650754599008e+00 + 16 4.6517554244980310e+00 -2.3957110424978438e+00 3.2908335999178327e-02 + 17 4.2309964792710639e+00 -2.1022918943319384e+00 1.1491948328949437e+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 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 2 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 3 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 4 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 5 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 6 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 7 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 8 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 9 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 10 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 11 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 12 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 13 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 14 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 15 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 16 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 17 1.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 + 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-move_wiggle.yaml b/unittest/force-styles/tests/fix-timestep-move_wiggle.yaml new file mode 100644 index 0000000000..c07f0634d6 --- /dev/null +++ b/unittest/force-styles/tests/fix-timestep-move_wiggle.yaml @@ -0,0 +1,74 @@ +--- +lammps_version: 24 Mar 2022 +date_generated: Sun Apr 3 03:06:24 2022 +epsilon: 2e-14 +skip_tests: +prerequisites: ! | + atom full + fix move +pre_commands: ! "" +post_commands: ! | + fix test solute move wiggle 1.0 0.5 -1.0 1.0 +input_file: in.fourmol +natoms: 29 +run_pos: ! |2 + 1 -2.7993683669226882e-01 2.4726588069312836e+00 -1.7200860244148383e-01 + 2 3.0197083955402154e-01 2.9515239068888603e+00 -8.5689735572907522e-01 + 3 -6.9435377880558646e-01 1.2440473127136709e+00 -6.2233801468891981e-01 + 4 -1.5771614164685137e+00 1.4915333140468063e+00 -1.2487126845040517e+00 + 5 -8.9501761359359300e-01 9.3568128743071322e-01 4.0227731871484396e-01 + 6 2.9412607937705959e-01 2.2719282656652884e-01 -1.2843094067857865e+00 + 7 3.4019871062879559e-01 -9.1277350075789007e-03 -2.4633113224304557e+00 + 8 1.1641187171852800e+00 -4.8375305955385256e-01 -6.7659823767368643e-01 + 9 1.3777459838125834e+00 -2.5366338669523020e-01 2.6877644730326355e-01 + 10 2.0185283555536984e+00 -1.4283966846517360e+00 -9.6733527271132980e-01 + 11 1.7929780509347661e+00 -1.9871047540768745e+00 -1.8840626643185669e+00 + 12 3.0030247876861220e+00 -4.8923319967572770e-01 -1.6188658531537243e+00 + 13 4.0447273787895925e+00 -9.0131998547446268e-01 -1.6384447268320832e+00 + 14 2.6033152817257070e+00 -4.0789761505963601e-01 -2.6554413538823058e+00 + 15 2.9756315249791299e+00 5.6334269722969266e-01 -1.2437650754599003e+00 + 16 2.6517554244980301e+00 -2.3957110424978443e+00 3.2908335999178820e-02 + 17 2.2309964792710635e+00 -2.1022918943319389e+00 1.1491948328949442e+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.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 2 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 3 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 4 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 5 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 6 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 7 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 8 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 9 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 10 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 11 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 12 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 13 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 14 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 15 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 16 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 17 6.2831853071795862e+00 3.1415926535897931e+00 -6.2831853071795862e+00 + 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/mol-pair-dpd.yaml b/unittest/force-styles/tests/mol-pair-dpd.yaml index 52aa755489..9fab36f51a 100644 --- a/unittest/force-styles/tests/mol-pair-dpd.yaml +++ b/unittest/force-styles/tests/mol-pair-dpd.yaml @@ -2,7 +2,7 @@ lammps_version: 17 Feb 2022 date_generated: Fri Mar 18 22:17:29 2022 epsilon: 5e-14 -skip_tests: gpu intel single +skip_tests: gpu intel kokkos_omp single prerequisites: ! | atom full pair dpd diff --git a/unittest/force-styles/tests/mol-pair-dpd_tstat.yaml b/unittest/force-styles/tests/mol-pair-dpd_tstat.yaml index 09d52366ba..2619c97e0b 100644 --- a/unittest/force-styles/tests/mol-pair-dpd_tstat.yaml +++ b/unittest/force-styles/tests/mol-pair-dpd_tstat.yaml @@ -2,7 +2,7 @@ lammps_version: 10 Feb 2021 date_generated: Fri Feb 26 23:08:44 2021 epsilon: 5e-14 -skip_tests: gpu intel single +skip_tests: gpu intel kokkos_omp single prerequisites: ! | atom full pair dpd/tstat diff --git a/unittest/python/python-formats.py b/unittest/python/python-formats.py index ca877b8305..c3dc6d52dc 100644 --- a/unittest/python/python-formats.py +++ b/unittest/python/python-formats.py @@ -2,11 +2,18 @@ import os import unittest from lammps.formats import LogFile, AvgChunkFile +import yaml +try: + from yaml import CSafeLoader as Loader, CSafeDumper as Dumper +except ImportError: + from yaml import SafeLoader, SafeDumper + EXAMPLES_DIR=os.path.abspath(os.path.join(__file__, '..', '..', '..', 'examples')) DEFAULT_STYLE_EXAMPLE_LOG="melt/log.8Apr21.melt.g++.1" MULTI_STYLE_EXAMPLE_LOG="peptide/log.27Nov18.peptide.g++.1" AVG_CHUNK_FILE="VISCOSITY/profile.13Oct16.nemd.2d.g++.1" +YAML_STYLE_EXAMPLE_LOG="yaml/log.7Apr22.yaml.g++.1" class Logfiles(unittest.TestCase): def testLogFileNotFound(self): @@ -58,6 +65,27 @@ class Logfiles(unittest.TestCase): self.assertEqual(run0["Step"], list(range(0,350, 50))) + def testYamlLogFile(self): + log = LogFile(os.path.join(EXAMPLES_DIR, YAML_STYLE_EXAMPLE_LOG)) + self.assertEqual(len(log.runs), 2) + run = log.runs[0] + self.assertEqual(len(run.keys()), 12) + self.assertIn("Step", run) + self.assertIn("Temp", run) + self.assertIn("E_vdwl", run) + self.assertIn("E_coul", run) + self.assertIn("E_bond", run) + self.assertIn("E_angle", run) + self.assertIn("Press", run) + self.assertEqual(len(run["Step"]), 11) + self.assertEqual(len(run["Temp"]), 11) + self.assertEqual(len(run["E_vdwl"]), 11) + self.assertEqual(len(run["E_coul"]), 11) + self.assertEqual(len(run["E_bond"]), 11) + self.assertEqual(len(run["E_angle"]), 11) + self.assertEqual(len(run["Press"]), 11) + self.assertEqual(log.runs[0]["Step"], [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]) + class AvgChunkFiles(unittest.TestCase): def testAvgChunkFileNotFound(self): @@ -87,5 +115,54 @@ class AvgChunkFiles(unittest.TestCase): self.assertEqual(len(chunk['coord'][0]), 1) +from lammps import lammps +has_dump_yaml = False +try: + machine=None + if 'LAMMPS_MACHINE_NAME' in os.environ: + machine=os.environ['LAMMPS_MACHINE_NAME'] + lmp=lammps(name=machine) + has_dump_yaml = lmp.has_style("atom","full") and lmp.has_style("dump", "yaml") + lmp.close() +except: + pass + +@unittest.skipIf(not has_dump_yaml, "Either atom_style full or dump_style yaml are not available") +class PythonDump(unittest.TestCase): + def setUp(self): + machine = None + if 'LAMMPS_MACHINE_NAME' in os.environ: + machine=os.environ['LAMMPS_MACHINE_NAME'] + self.lmp = lammps(name=machine, cmdargs=['-nocite', '-log','none', '-echo','screen']) + + def tearDown(self): + del self.lmp + + def testDumpYaml(self): + dumpfile = os.path.join(os.path.abspath('.'), 'dump.yaml') + self.lmp.command('shell cd ' + os.environ['TEST_INPUT_DIR']) + self.lmp.command("newton on on") + self.lmp.file("in.fourmol") + self.lmp.command("dump 1 all yaml 2 " + dumpfile + " id type mol q x y z vx vy vz") + self.lmp.command("dump_modify 1 time yes sort id units yes") + self.lmp.command("run 4 post no") + with open(dumpfile) as d: + traj = tuple(yaml.load_all(d, Loader=Loader)) + self.assertEqual(len(traj), 3) + self.assertEqual(traj[0]['timestep'], 0) + self.assertEqual(traj[0]['time'], 0) + self.assertEqual(traj[0]['natoms'], 29) + self.assertEqual(traj[0]['units'], 'real') + self.assertEqual(len(traj[0]['boundary']), 6) + self.assertEqual(traj[0]['boundary'][0], 'p') + self.assertEqual(traj[1]['timestep'], 2) + self.assertEqual(traj[1]['time'], 0.2) + self.assertEqual(traj[2]['timestep'], 4) + self.assertEqual(traj[2]['time'], 0.4) + self.assertEqual(traj[0]['keywords'],['id', 'type', 'mol', 'q', 'x', 'y', 'z', + 'vx', 'vy', 'vz']) + self.assertEqual(traj[0]['data'][0],[1, 3, 1, -0.47, -0.279937, 2.47266, -0.172009, + 0.000778678, 0.000589703, -0.000221795]) + if __name__ == "__main__": unittest.main() diff --git a/unittest/utils/test_utils.cpp b/unittest/utils/test_utils.cpp index dccbdb4118..900ce6814c 100644 --- a/unittest/utils/test_utils.cpp +++ b/unittest/utils/test_utils.cpp @@ -78,6 +78,25 @@ TEST(Utils, trim_comment) ASSERT_THAT(trimmed, StrEq("some text ")); } +TEST(Utils, star_subst) +{ + std::string starred = "beforeafter"; + std::string subst = utils::star_subst(starred, 1234, 0); + ASSERT_THAT(subst, StrEq("beforeafter")); + + starred = "before*after"; + subst = utils::star_subst(starred, 1234, 6); + ASSERT_THAT(subst, StrEq("before001234after")); + + starred = "before*"; + subst = utils::star_subst(starred, 1234, 0); + ASSERT_THAT(subst, StrEq("before1234")); + + starred = "*after"; + subst = utils::star_subst(starred, 1234, 2); + ASSERT_THAT(subst, StrEq("1234after")); +} + TEST(Utils, has_utf8) { const char ascii_string[] = " -2";