diff --git a/.gitattributes b/.gitattributes index c93225ca26..660c85d619 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,3 +2,4 @@ .gitignore export-ignore .github export-ignore .lgtm.yml export-ignore +SECURITY.md export-ignore diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8457af3af9..afdac828f8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -13,29 +13,37 @@ lib/kim/* @ellio167 lib/mesont/* @iafoss # whole packages -src/COMPRESS/* @akohlmey +src/COMPRESS/* @rbberger src/GPU/* @ndtrung81 src/KOKKOS/* @stanmoore1 src/KIM/* @ellio167 src/LATTE/* @cnegre src/MESSAGE/* @sjplimp +src/MLIAP/* @athomps +src/SNAP/* @athomps src/SPIN/* @julient31 +src/USER-BROWNIAN/* @samueljmcameron src/USER-CGDNA/* @ohenrich src/USER-CGSDK/* @akohlmey src/USER-COLVARS/* @giacomofiorin +src/USER-FEP/* @agiliopadua +src/USER-HDNNP/* @singraber src/USER-INTEL/* @wmbrownintel src/USER-MANIFOLD/* @Pakketeretet2 +src/USER-MDI/* @taylor-a-barnes src/USER-MEAMC/* @martok src/USER-MESONT/* @iafoss src/USER-MOFFF/* @hheenen src/USER-MOLFILE/* @akohlmey src/USER-NETCDF/* @pastewka +src/USER-PACE/* @yury-lysogorskiy src/USER-PLUMED/* @gtribello src/USER-PHONON/* @lingtikong src/USER-PTM/* @pmla src/USER-OMP/* @akohlmey src/USER-QMMM/* @akohlmey src/USER-REAXC/* @hasanmetin +src/USER-REACTION/* @jrgissing src/USER-SCAFACOS/* @rhalver src/USER-TALLY/* @akohlmey src/USER-UEF/* @danicholson @@ -47,7 +55,6 @@ src/GPU/pair_vashishta_gpu.* @andeplane src/KOKKOS/pair_vashishta_kokkos.* @andeplane src/MANYBODY/pair_vashishta_table.* @andeplane src/MANYBODY/pair_atm.* @sergeylishchuk -src/USER-REACTION/fix_bond_react.* @jrgissing src/USER-MISC/*_grem.* @dstelter92 src/USER-MISC/compute_stress_mop*.* @RomainVermorel @@ -122,6 +129,8 @@ tools/emacs/* @HaoZeke tools/singularity/* @akohlmey @rbberger tools/code_standard/* @rbberger tools/valgrind/* @akohlmey +tools/swig/* @akohlmey +tools/offline/* @rbberger # tests unittest/* @akohlmey @rbberger @@ -130,7 +139,7 @@ unittest/* @akohlmey @rbberger cmake/* @junghans @rbberger cmake/Modules/Packages/USER-COLVARS.cmake @junghans @rbberger @giacomofiorin cmake/Modules/Packages/KIM.cmake @junghans @rbberger @ellio167 -cmake/presets/*.cmake @junghans @rbberger @akohlmey +cmake/presets/*.cmake @akohlmey # python python/* @rbberger @@ -142,6 +151,7 @@ fortran/* @akohlmey doc/utils/*/* @rbberger doc/Makefile @rbberger doc/README @rbberger +examples/plugin/* @akohlmey # for releases src/version.h @sjplimp diff --git a/README b/README index 5b832790f3..bb0f335848 100644 --- a/README +++ b/README @@ -14,10 +14,10 @@ LAMMPS is a classical molecular dynamics simulation code designed to run efficiently on parallel computers. It was developed at Sandia National Laboratories, a US Department of Energy facility, with funding from the DOE. It is an open-source code, distributed freely -under the terms of the GNU Public License (GPL). +under the terms of the GNU Public License (GPL) version 2. The primary author of the code is Steve Plimpton, who can be emailed -at sjplimp@sandia.gov. The LAMMPS WWW Site at lammps.sandia.gov has +at sjplimp@sandia.gov. The LAMMPS WWW Site at www.lammps.org has more information about the code and its uses. The LAMMPS distribution includes the following files and directories: @@ -37,14 +37,14 @@ tools pre- and post-processing tools Point your browser at any of these files to get started: -https://lammps.sandia.gov/doc/Manual.html LAMMPS manual -https://lammps.sandia.gov/doc/Intro.html hi-level introduction -https://lammps.sandia.gov/doc/Build.html how to build LAMMPS -https://lammps.sandia.gov/doc/Run_head.html how to run LAMMPS -https://lammps.sandia.gov/doc/Commands_all.html Table of available commands -https://lammps.sandia.gov/doc/Library.html LAMMPS library interfaces -https://lammps.sandia.gov/doc/Modify.html how to modify and extend LAMMPS -https://lammps.sandia.gov/doc/Developer.html LAMMPS developer info +https://docs.lammps.org/Manual.html LAMMPS manual +https://docs.lammps.org/Intro.html hi-level introduction +https://docs.lammps.org/Build.html how to build LAMMPS +https://docs.lammps.org/Run_head.html how to run LAMMPS +https://docs.lammps.org/Commands_all.html Table of available commands +https://docs.lammps.org/Library.html LAMMPS library interfaces +https://docs.lammps.org/Modify.html how to modify and extend LAMMPS +https://docs.lammps.org/Developer.html LAMMPS developer info You can also create these doc pages locally: diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..9f65e2f88e --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,35 @@ +# Security Policy + +LAMMPS is designed as a user-level application to conduct computer +simulations for research using classical mechanics. As such LAMMPS +depends to some degrees on users providing correctly formatted input and +LAMMPS needs to read and write files based on uncontrolled user input. +As a parallel application for use in high-performance computing +environments, performance critical steps are also done without checking +data. + +LAMMPS also is interfaced to a number of external libraries, including +libraries with experimental research software, that are not validated +and tested by the LAMMPS developers, so it is easy to import bad +behavior from calling functions in one of those libraries. + +Thus is is quite easy to crash LAMMPS through malicious input and do all +kinds of filesystem manipulations. And because of that LAMMPS should +**NEVER** be compiled or **run** as superuser, either from a "root" or +"administrator" account directly or indirectly via "sudo" or "su". + +Therefore what could be seen as a security vulnerability is usually +either a user mistake or a bug in the code. Bugs can be reported in +the LAMMPS project +[issue tracker on GitHub](https://github.com/lammps/lammps/issues). + + +# Version Updates + +LAMMPS follows continuous release development model. We aim to keep all +release versions (stable or patch) fully functional and employ a variety +of automatic testing procedures to detect failures of existing +functionality from adding new features before releases are made. Thus +bugfixes and updates are only integrated into the current development +branch and thus the next (patch) release and users are recommended to +update regularly. diff --git a/bench/POTENTIALS/README b/bench/POTENTIALS/README index d42726c184..a9e319a6c4 100644 --- a/bench/POTENTIALS/README +++ b/bench/POTENTIALS/README @@ -1,7 +1,7 @@ These are input scripts used to run benchmark tests for many of the interatomic potentials in LAMMPS. The results of running these scripts on different machines are shown on the Potentials section of -the Benchmark page of the LAMMPS WWW site (lammps.sandia.gov/bench). +the Benchmark page of the LAMMPS WWW site (https://www.lammps.org/bench.html). Examples are shown below of how to run these scripts. Log files for running them on 1 and 4 processors of a Linux box are included in the diff --git a/bench/README b/bench/README index 0806fcded6..7d5aced119 100644 --- a/bench/README +++ b/bench/README @@ -2,7 +2,7 @@ LAMMPS benchmark problems 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 (lammps.sandia.gov/bench). +Benchmark page of the LAMMPS WWW site (https://www.lammps.org/bench.html). This directory also has several sub-directories: @@ -11,7 +11,7 @@ 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 -the Benchmark page of the LAMMPS WWW site: lammps.sandia.gov/bench. +the Benchmark page of the LAMMPS WWW site: https://www.lammps.org/bench.html The remainder of this file refers to the 5 problems in the top-level of this directory and how to run them on CPUs, either in serial or diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index b3dcd36913..8dafa7e476 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -7,6 +7,11 @@ cmake_minimum_required(VERSION 3.10) if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() +# set policy to silence warnings about missing executable permissions in +# pythonx.y-config when cross-compiling. review occasionally if it may be set to NEW +if (POLICY CMP0109) + cmake_policy(SET CMP0109 OLD) +endif() ######################################## project(lammps CXX) @@ -104,6 +109,12 @@ endif() option(BUILD_TOOLS "Build and install LAMMPS tools (msi2lmp, binary2txt, chain)" OFF) option(BUILD_LAMMPS_SHELL "Build and install the LAMMPS shell" OFF) +# allow enabling clang-tidy for C++ files +set(ENABLE_CLANG_TIDY OFF CACHE BOOL "Include clang-tidy processing when compiling") +if(ENABLE_CLANG_TIDY) + set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=*-header-filter=.*" CACHE STRING "") +endif() + include(GNUInstallDirs) file(GLOB ALL_SOURCES ${LAMMPS_SOURCE_DIR}/[^.]*.cpp) file(GLOB MAIN_SOURCES ${LAMMPS_SOURCE_DIR}/main.cpp) @@ -121,7 +132,7 @@ set(STANDARD_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE PLUGIN QEQ REPLICA RIGID SHOCK SPIN SNAP SRD KIM PYTHON MSCG MPIIO VORONOI USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-MESODPD USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD - USER-LB USER-MANIFOLD USER-MEAMC USER-MESONT USER-MGPT USER-MISC USER-MOFFF + USER-LB USER-MANIFOLD USER-MDI USER-MEAMC USER-MESONT USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-PHONON USER-PLUMED USER-PTM USER-QTB USER-REACTION USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-VTK USER-QUIP USER-QMMM USER-YAFF USER-PACE USER-BROWNIAN) @@ -324,8 +335,8 @@ else() set(CUDA_REQUEST_PIC) endif() -foreach(PKG_WITH_INCL KSPACE PYTHON MLIAP VORONOI USER-COLVARS USER-MOLFILE USER-NETCDF USER-PLUMED USER-QMMM - USER-QUIP USER-SCAFACOS USER-SMD USER-VTK KIM LATTE MESSAGE MSCG COMPRESS USER-PACE) +foreach(PKG_WITH_INCL KSPACE PYTHON MLIAP VORONOI USER-COLVARS USER-MDI USER-MOLFILE USER-NETCDF USER-PLUMED + USER-QMMM USER-QUIP USER-SCAFACOS USER-SMD USER-VTK KIM LATTE MESSAGE MSCG COMPRESS USER-PACE) if(PKG_${PKG_WITH_INCL}) include(Packages/${PKG_WITH_INCL}) endif() diff --git a/cmake/Modules/CodingStandard.cmake b/cmake/Modules/CodingStandard.cmake index 646bdcdd4a..6bb607be12 100644 --- a/cmake/Modules/CodingStandard.cmake +++ b/cmake/Modules/CodingStandard.cmake @@ -15,6 +15,11 @@ if(Python3_EXECUTABLE) ${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/whitespace.py . WORKING_DIRECTORY ${LAMMPS_DIR} COMMENT "Check for whitespace errors") + add_custom_target( + check-homepage + ${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/homepage.py . + WORKING_DIRECTORY ${LAMMPS_DIR} + COMMENT "Check for homepage URL errors") add_custom_target( check-permissions ${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/permissions.py . @@ -25,6 +30,11 @@ if(Python3_EXECUTABLE) ${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/whitespace.py -f . WORKING_DIRECTORY ${LAMMPS_DIR} COMMENT "Fix whitespace errors") + add_custom_target( + fix-homepage + ${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/homepage.py -f . + WORKING_DIRECTORY ${LAMMPS_DIR} + COMMENT "Fix homepage URL errors") add_custom_target( fix-permissions ${Python3_EXECUTABLE} ${LAMMPS_TOOLS_DIR}/coding_standard/permissions.py -f . diff --git a/cmake/Modules/Packages/USER-MDI.cmake b/cmake/Modules/Packages/USER-MDI.cmake new file mode 100644 index 0000000000..88d7b5e498 --- /dev/null +++ b/cmake/Modules/Packages/USER-MDI.cmake @@ -0,0 +1,118 @@ +find_package(mdi QUIET) +if(${mdi_FOUND}) + set(DOWNLOAD_MDI_DEFAULT OFF) +else() + set(DOWNLOAD_MDI_DEFAULT ON) +endif() +option(DOWNLOAD_MDI "Download and compile the MDI library instead of using an already installed one" ${DOWNLOAD_MDI_DEFAULT}) + +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") + mark_as_advanced(MDI_URL) + mark_as_advanced(MDI_MD5) + enable_language(C) + + # only ON/OFF are allowed for "mpi" flag when building MDI library + # so translate boolean value of BUILD_MPI + # always disable MPI when cross-compiling to Windows. + if((BUILD_MPI) AND NOT((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)) + set(MDI_USE_MPI ON) + else() + set(MDI_USE_MPI OFF) + endif() + + # detect if we have python development support and thus can enable python plugins + set(MDI_USE_PYTHON_PLUGINS OFF) + if(CMAKE_VERSION VERSION_LESS 3.12) + find_package(PythonLibs QUIET) # Deprecated since version 3.12 + if (PYTHONLIBS_FOUND) + set(MDI_USE_PYTHON_PLUGINS ON) + endif() + else() + find_package(Python QUIET COMPONENTS Development) + if (Python_Development_FOUND) + set(MDI_USE_PYTHON_PLUGINS ON) + endif() + endif() + + # download/ build MDI library + # always build static library with -fpic + # support cross-compilation and ninja-build + include(ExternalProject) + ExternalProject_Add(mdi_build + URL ${MDI_URL} + URL_MD5 ${MDI_MD5} + CMAKE_ARGS ${CMAKE_REQUEST_PIC} + -DCMAKE_INSTALL_PREFIX= + -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + -Dlanguage=C + -Dlibtype=STATIC + -Dmpi=${MDI_USE_MPI} + -Dpython_plugins=${MDI_USE_PYTHON_PLUGINS} + UPDATE_COMMAND "" + INSTALL_COMMAND "" + BUILD_BYPRODUCTS "/MDI_Library/libmdi.a" + ) + + # where is the compiled library? + ExternalProject_get_property(mdi_build BINARY_DIR) + set(MDI_BINARY_DIR "${BINARY_DIR}/MDI_Library") + # workaround for older CMake versions + file(MAKE_DIRECTORY ${MDI_BINARY_DIR}) + + # create imported target for the MDI library + add_library(LAMMPS::MDI UNKNOWN IMPORTED) + add_dependencies(LAMMPS::MDI mdi_build) + set_target_properties(LAMMPS::MDI PROPERTIES + IMPORTED_LOCATION "${MDI_BINARY_DIR}/libmdi.a" + INTERFACE_INCLUDE_DIRECTORIES ${MDI_BINARY_DIR} + ) + + set(MDI_DEP_LIBS "") + # if compiling with python plugins we need + # to add python libraries as dependency. + if(MDI_USE_PYTHON_PLUGINS) + if(CMAKE_VERSION VERSION_LESS 3.12) + list(APPEND MDI_DEP_LIBS ${PYTHON_LIBRARIES}) + else() + list(APPEND MDI_DEP_LIBS Python::Python) + endif() + + endif() + # need to add support for dlopen/dlsym, except when compiling for Windows. + if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + list(APPEND MDI_DEP_LIBS "${CMAKE_DL_LIBS}") + endif() + if(MDI_DEP_LIBS) + set_target_properties(LAMMPS::MDI PROPERTIES + IMPORTED_LINK_INTERFACE_LIBRARIES "${MDI_DEP_LIBS}") + endif() + + target_link_libraries(lammps PRIVATE LAMMPS::MDI) + target_link_libraries(lmp PRIVATE LAMMPS::MDI) + +else() + + find_package(mdi) + if(NOT mdi_FOUND) + message(FATAL_ERROR "MDI library not found. Help CMake to find it " + "by setting mdi_LIBRARY and mdi_INCLUDE_DIR, or set DOWNLOAD_MDI=ON " + "to download and compile it") + endif() + + # Link the lammps library against MDI + target_include_directories(lammps PRIVATE ${mdi_INCLUDE_DIR}) + target_link_libraries(lammps PRIVATE ${mdi_LIBRARY}) + + # Link the lammps executable against MDI + target_include_directories(lmp PRIVATE ${mdi_INCLUDE_DIR}) + target_link_libraries(lmp PRIVATE ${mdi_LIBRARY}) +endif() + +target_compile_definitions(lammps PRIVATE -DLMP_USER_MDI) +target_compile_definitions(lmp PRIVATE -DLMP_USER_MDI) diff --git a/cmake/Modules/Packages/USER-PACE.cmake b/cmake/Modules/Packages/USER-PACE.cmake index 2d88d3a313..ccc7423355 100644 --- a/cmake/Modules/Packages/USER-PACE.cmake +++ b/cmake/Modules/Packages/USER-PACE.cmake @@ -14,13 +14,12 @@ execute_process( WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) - file(GLOB PACE_EVALUATOR_INCLUDE_DIR ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE) file(GLOB PACE_EVALUATOR_SOURCES ${CMAKE_BINARY_DIR}/lammps-user-pace-*/USER-PACE/*.cpp) list(FILTER PACE_EVALUATOR_SOURCES EXCLUDE REGEX pair_pace.cpp) add_library(pace STATIC ${PACE_EVALUATOR_SOURCES}) -set_target_properties(pace PROPERTIES OUTPUT_NAME lammps_pace${LAMMPS_MACHINE}) +set_target_properties(pace PROPERTIES CXX_EXTENSIONS ON OUTPUT_NAME lammps_pace${LAMMPS_MACHINE}) target_include_directories(pace PUBLIC ${PACE_EVALUATOR_INCLUDE_DIR}) target_link_libraries(lammps PRIVATE pace) diff --git a/cmake/Modules/YAML.cmake b/cmake/Modules/YAML.cmake index c50773568c..77ee804111 100644 --- a/cmake/Modules/YAML.cmake +++ b/cmake/Modules/YAML.cmake @@ -6,15 +6,27 @@ set(YAML_MD5 "bb15429d8fb787e7d3f1c83ae129a999" CACHE STRING "MD5 checksum of li mark_as_advanced(YAML_URL) mark_as_advanced(YAML_MD5) +# support cross-compilation to windows +if(CMAKE_CROSSCOMPILING AND (CMAKE_SYSTEM_NAME STREQUAL "Windows")) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86") + set(YAML_CROSS_HOST --host=i686-mingw64) + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(YAML_CROSS_HOST --host=x86_64-mingw64) + else() + message(FATAL_ERROR "Unsupported cross-compilation " + " for ${CMAKE_SYSTEM_NAME}/${CMAKE_SYSTEM_PROCESSOR}" + " on ${CMAKE_HOST_SYSTEM}/${CMAKE_HOST_SYSTEM_PROCESSOR}") + endif() +endif() + ExternalProject_Add(libyaml URL ${YAML_URL} URL_MD5 ${YAML_MD5} SOURCE_DIR "${CMAKE_BINARY_DIR}/yaml-src" BINARY_DIR "${CMAKE_BINARY_DIR}/yaml-build" CONFIGURE_COMMAND /configure ${CONFIGURE_REQUEST_PIC} - CXX=${CMAKE_CXX_COMPILER} - CC=${CMAKE_C_COMPILER} - --prefix= --disable-shared + CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER} + --prefix= --disable-shared ${YAML_CROSS_HOST} BUILD_BYPRODUCTS /lib/libyaml${CMAKE_STATIC_LIBRARY_SUFFIX} TEST_COMMAND "") diff --git a/cmake/pkgconfig/liblammps.pc.in b/cmake/pkgconfig/liblammps.pc.in index ca2c6191b7..42c8fddadd 100644 --- a/cmake/pkgconfig/liblammps.pc.in +++ b/cmake/pkgconfig/liblammps.pc.in @@ -24,7 +24,7 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Name: liblammps@LAMMPS_MACHINE@ Description: Large-scale Atomic/Molecular Massively Parallel Simulator Library -URL: http://lammps.sandia.gov +URL: https://www.lammps.org Version: @PROJECT_VERSION@ Requires: Libs: -L${libdir} -llammps@LAMMPS_MACHINE@ diff --git a/cmake/presets/all_off.cmake b/cmake/presets/all_off.cmake index 9be6cfe54b..7c0d1baeb7 100644 --- a/cmake/presets/all_off.cmake +++ b/cmake/presets/all_off.cmake @@ -5,13 +5,13 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MESSAGE MISC MLIAP MOLECULE MPIIO MSCG OPT PERI PLUGIN POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI - USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-INTEL - USER-LB USER-MANIFOLD USER-MEAMC USER-MESODPD USER-MESONT USER-MGPT - USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP USER-PACE USER-PHONON - USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP USER-REACTION USER-REAXC - USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF - USER-VTK USER-YAFF) + USER-ADIOS USER-ATC USER-AWPMD USER-BROWNIAN USER-BOCS USER-CGDNA USER-CGSDK + USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD + USER-INTEL USER-LB USER-MANIFOLD USER-MDI USER-MEAMC USER-MESODPD USER-MESONT + USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP USER-PACE + USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP USER-REACTION + USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY + USER-UEF USER-VTK USER-YAFF) foreach(PKG ${ALL_PACKAGES}) set(PKG_${PKG} OFF CACHE BOOL "" FORCE) diff --git a/cmake/presets/all_on.cmake b/cmake/presets/all_on.cmake index 411fb09d6b..5647c61833 100644 --- a/cmake/presets/all_on.cmake +++ b/cmake/presets/all_on.cmake @@ -7,13 +7,13 @@ set(ALL_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU GRANULAR KIM KOKKOS KSPACE LATTE MANYBODY MC MESSAGE MISC MLIAP MOLECULE MPIIO MSCG OPT PERI PLUGIN POEMS PYTHON QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI - USER-ADIOS USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK USER-COLVARS - USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD USER-INTEL - USER-LB USER-MANIFOLD USER-MEAMC USER-MESODPD USER-MESONT USER-MGPT - USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP USER-PACE USER-PHONON - USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP USER-REACTION USER-REAXC - USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF - USER-VTK USER-YAFF) + USER-ADIOS USER-ATC USER-AWPMD USER-BROWNIAN USER-BOCS USER-CGDNA USER-CGSDK + USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-H5MD + USER-INTEL USER-LB USER-MANIFOLD USER-MDI USER-MEAMC USER-MESODPD USER-MESONT + USER-MGPT USER-MISC USER-MOFFF USER-MOLFILE USER-NETCDF USER-OMP USER-PACE + USER-PHONON USER-PLUMED USER-PTM USER-QMMM USER-QTB USER-QUIP USER-REACTION + USER-REAXC USER-SCAFACOS USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY + USER-UEF USER-VTK USER-YAFF) foreach(PKG ${ALL_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) diff --git a/cmake/presets/clang.cmake b/cmake/presets/clang.cmake index 47df6dcc6f..9ea077b14c 100644 --- a/cmake/presets/clang.cmake +++ b/cmake/presets/clang.cmake @@ -4,10 +4,18 @@ set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "" FORCE) set(CMAKE_C_COMPILER "clang" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) + set(MPI_CXX "clang++" CACHE STRING "" FORCE) set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE) -unset(HAVE_OMP_H_INCLUDE CACHE) +unset(HAVE_OMP_H_INCLUDE CACHE) set(OpenMP_C "clang" CACHE STRING "" FORCE) set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "" FORCE) set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE) diff --git a/cmake/presets/download.cmake b/cmake/presets/download.cmake index 84629ce785..ebab6ab658 100644 --- a/cmake/presets/download.cmake +++ b/cmake/presets/download.cmake @@ -1,7 +1,7 @@ -# preset that turns on packages with automatic downloads of sources of potentials -# compilation of libraries like Plumed or ScaFaCoS can take a considerable amount of time. +# Preset that turns on packages with automatic downloads of sources or potentials. +# Compilation of libraries like Plumed or ScaFaCoS can take a considerable amount of time. -set(ALL_PACKAGES KIM LATTE MSCG VORONOI USER-PLUMED USER-SCAFACOS USER-SMD USER-MESONT) +set(ALL_PACKAGES KIM LATTE MSCG VORONOI USER-PLUMED USER-SCAFACOS USER-SMD USER-MESONT USER-MDI USER-PACE) foreach(PKG ${ALL_PACKAGES}) set(PKG_${PKG} ON CACHE BOOL "" FORCE) @@ -9,9 +9,11 @@ endforeach() set(DOWNLOAD_KIM ON CACHE BOOL "" FORCE) set(DOWNLOAD_LATTE ON CACHE BOOL "" FORCE) +set(DOWNLOAD_MDI ON CACHE BOOL "" FORCE) set(DOWNLOAD_MSCG ON CACHE BOOL "" FORCE) set(DOWNLOAD_VORO ON CACHE BOOL "" FORCE) set(DOWNLOAD_EIGEN3 ON CACHE BOOL "" FORCE) +set(DOWNLOAD_PACE ON CACHE BOOL "" FORCE) set(DOWNLOAD_PLUMED ON CACHE BOOL "" FORCE) set(DOWNLOAD_SCAFACOS ON CACHE BOOL "" FORCE) diff --git a/cmake/presets/intel.cmake b/cmake/presets/intel.cmake index d101a0f699..9baf873608 100644 --- a/cmake/presets/intel.cmake +++ b/cmake/presets/intel.cmake @@ -3,10 +3,20 @@ set(CMAKE_CXX_COMPILER "icpc" CACHE STRING "" FORCE) set(CMAKE_C_COMPILER "icc" CACHE STRING "" FORCE) set(CMAKE_Fortran_COMPILER "ifort" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) + set(MPI_CXX "icpc" CACHE STRING "" FORCE) set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE) -unset(HAVE_OMP_H_INCLUDE CACHE) +unset(HAVE_OMP_H_INCLUDE CACHE) set(OpenMP_C "icc" CACHE STRING "" FORCE) set(OpenMP_C_FLAGS "-qopenmp" CACHE STRING "" FORCE) set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE) diff --git a/cmake/presets/mingw-cross.cmake b/cmake/presets/mingw-cross.cmake index 32b17d43c2..e622211190 100644 --- a/cmake/presets/mingw-cross.cmake +++ b/cmake/presets/mingw-cross.cmake @@ -1,11 +1,11 @@ set(WIN_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS CORESHELL DIPOLE GPU GRANULAR KSPACE LATTE MANYBODY MC MISC MLIAP MOLECULE OPT PERI POEMS QEQ REPLICA RIGID SHOCK SNAP SPIN SRD VORONOI - USER-ATC USER-AWPMD USER-BOCS USER-CGDNA USER-CGSDK + USER-ATC USER-AWPMD USER-BOCS USER-BROWNIAN USER-CGDNA USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE USER-EFF USER-FEP USER-INTEL USER-MANIFOLD USER-MEAMC USER-MESODPD USER-MESONT USER-MISC USER-MGPT USER-MOFFF USER-MOLFILE USER-OMP - USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC + USER-PACE USER-PHONON USER-PTM USER-QTB USER-REACTION USER-REAXC USER-SDPD USER-SMD USER-SMTBQ USER-SPH USER-TALLY USER-UEF USER-YAFF) diff --git a/cmake/presets/nolib.cmake b/cmake/presets/nolib.cmake index c9abb00a15..17d6e09df3 100644 --- a/cmake/presets/nolib.cmake +++ b/cmake/presets/nolib.cmake @@ -4,7 +4,7 @@ set(PACKAGES_WITH_LIB COMPRESS GPU KIM KOKKOS LATTE MESSAGE MPIIO MSCG PYTHON VORONOI USER-ADIOS USER-ATC USER-AWPMD USER-H5MD USER-LB USER-MOLFILE USER-MESONT - USER-NETCDF USER-PACE USER-PLUMED USER-QMMM USER-QUIP USER-SCAFACOS + USER-MDI USER-NETCDF USER-PACE USER-PLUMED USER-QMMM USER-QUIP USER-SCAFACOS USER-SMD USER-VTK) foreach(PKG ${PACKAGES_WITH_LIB}) diff --git a/cmake/presets/oneapi.cmake b/cmake/presets/oneapi.cmake index ef04167305..403494c409 100644 --- a/cmake/presets/oneapi.cmake +++ b/cmake/presets/oneapi.cmake @@ -1,12 +1,22 @@ -# preset that will enable the LLVM based Intel compilers with support for MPI and OpenMP (on Linux boxes) +# preset that will enable the LLVM based Intel compilers with support for MPI and OpenMP and Fortran (on Linux boxes) set(CMAKE_CXX_COMPILER "icpx" CACHE STRING "" FORCE) set(CMAKE_C_COMPILER "icx" CACHE STRING "" FORCE) set(CMAKE_Fortran_COMPILER "ifx" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG" CACHE STRING "" FORCE) +set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE) + set(MPI_CXX "icpx" CACHE STRING "" FORCE) set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE) -unset(HAVE_OMP_H_INCLUDE CACHE) +unset(HAVE_OMP_H_INCLUDE CACHE) set(OpenMP_C "icx" CACHE STRING "" FORCE) set(OpenMP_C_FLAGS "-qopenmp" CACHE STRING "" FORCE) set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE) diff --git a/doc/Makefile b/doc/Makefile index e49d42ca77..f63f91454c 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -68,7 +68,6 @@ help: @echo "Please use \`make ' where is one of" @echo " html create HTML pages in html dir" @echo " pdf create Manual.pdf in this dir" - @echo " fetch fetch HTML and PDF files from LAMMPS web site" @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)" @@ -185,13 +184,6 @@ pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) @rm -rf latex/PDF/.[sg]* @echo "Build finished. Manual.pdf is in this directory." -fetch: - @rm -rf html_www Manual_www.pdf - @curl -s -o Manual_www.pdf http://lammps.sandia.gov/doc/Manual.pdf - @curl -s -o lammps-doc.tar.gz http://lammps.sandia.gov/tars/lammps-doc.tar.gz - @tar xzf lammps-doc.tar.gz - @rm -f lammps-doc.tar.gz - anchor_check : $(ANCHORCHECK) @(\ . $(VENV)/bin/activate ;\ diff --git a/doc/README b/doc/README index 8af4021a60..fed2e515b3 100644 --- a/doc/README +++ b/doc/README @@ -25,16 +25,11 @@ github-development-workflow.md notes on the LAMMPS development workflow include-file-conventions.md notes on LAMMPS' include file conventions documentation_conventions.md notes on writing documentation for LAMMPS -If you downloaded a LAMMPS tarball from lammps.sandia.gov, then the html +If you downloaded a LAMMPS tarball from www.lammps.org, then the html folder and the PDF manual should be included. If you downloaded LAMMPS -from GitHub then you either need to download them or build them. +from GitHub then you either need to build them. -(a) You can "fetch" the current HTML and PDF files from the LAMMPS web -site. Just type "make fetch". This should create a html_www directory -and Manual_www.pdf file. These will always represent the latest published -patch/development version of LAMMPS. - -(b) You can build the HTML and PDF files yourself, by typing "make html" +You can build the HTML and PDF files yourself, by typing "make html" or by "make pdf", respectively. This requires various tools and files. Some of them have to be installed (more on that below). For the rest the build process will attempt to download and install into a python virtual @@ -78,4 +73,4 @@ the tool 'ebook-convert' from the 'calibre' e-book management software ---------------- More details this can be found in the manual itself. The online -version is at: https://lammps.sandia.gov/doc/Manual_build.html +version is at: https://docs.lammps.org/Build_manual.html diff --git a/doc/lammps.1 b/doc/lammps.1 index c10950643d..11438ac5c3 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,4 +1,4 @@ -.TH LAMMPS "8 April 2021" "2021-04-08" +.TH LAMMPS "14 May 2021" "2021-05-14" .SH NAME .B LAMMPS \- Molecular Dynamics Simulator. diff --git a/doc/src/Build_development.rst b/doc/src/Build_development.rst index 9c5f5ea61e..ea5c969056 100644 --- a/doc/src/Build_development.rst +++ b/doc/src/Build_development.rst @@ -28,6 +28,28 @@ variable VERBOSE set to 1: ---------- +.. _clang-tidy: + +Enable static code analysis with clang-tidy +------------------------------------------- + +The `clang-tidy tool `_ is a +static code analysis tool to diagnose (and potentially fix) typical +programming errors or coding style violations. It has a modular framework +of tests that can be adjusted to help identifying problems before they +become bugs and also assist in modernizing large code bases (like LAMMPS). +It can be enabled for all C++ code with the following CMake flag + +.. code-block:: bash + + -D ENABLE_CLANG_TIDY=value # value = no (default) or yes + +With this flag enabled all source files will be processed twice, first to +be compiled and then to be analyzed. Please note that the analysis can be +significantly more time consuming than the compilation itself. + +---------- + .. _iwyu_processing: Report missing and unneeded '#include' statements @@ -447,12 +469,24 @@ The following options are available. .. code-block:: bash - make check-whitespace # generate coverage report in HTML format - make fix-whitespace # generate coverage report in XML format - make check-permissions # delete folder with HTML format coverage report - make fix-permissions # delete all collected coverage data and HTML output + make check-whitespace # search for files with whitespace issues + make fix-whitespace # correct whitespace issues in files + make check-homepage # search for files with old LAMMPS homepage URLs + make fix-homepage # correct LAMMPS homepage URLs in files + make check-permissions # search for files with permissions issues + make fix-permissions # correct permissions issues in files -For the code in the ``unittest`` tree we are using the `clang-format` -tool (Clang version 8.0 or later is required). If available, the source -code files in the ``unittest`` tree can be updated to conform to the -formatting settings using ``make format-tests``. +For the code in the ``unittest`` and ``src`` trees we are transitioning +to use the `clang-format` tool to assist with having a consistent source +code style. The `clang-format` command bundled with Clang version 8.0 +or later is required. The configuration is in files ``.clang-format`` +in the respective folders. Since the modifications from `clang-format` +can be significant and - especially for "legacy style code" - also is +not always improving readability, a large number of files currently have +a ``// clang-format off`` at the top, which will disable the processing. +Over time, files will be refactored and updated to that `clang-format` +may be applied to them (at least in part). + +If `clang-format` is available, the source code files in the ``unittest`` +tree can be updated to conform to the formatting settings using +``make format-tests`` and the files in ``src`` with ``make format-src``. diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index 4e23067387..25ef36b430 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -49,6 +49,7 @@ This is the list of packages that may require additional steps. * :ref:`USER-COLVARS ` * :ref:`USER-H5MD ` * :ref:`USER-INTEL ` + * :ref:`USER-MDI ` * :ref:`USER-MESONT ` * :ref:`USER-MOLFILE ` * :ref:`USER-NETCDF ` @@ -1539,6 +1540,35 @@ TBB and MKL. ---------- +.. _user-mdi: + +USER-MDI package +----------------------------- + +.. tabs:: + + .. tab:: CMake build + + .. code-block:: bash + + -D DOWNLOAD_MDI=value # download MDI Library for build, value = no (default) or yes + + .. tab:: Traditional make + + Before building LAMMPS, you must build the MDI Library in + ``lib/mdi``\ . You can do this by executing a command like one + of the following from the ``lib/mdi`` directory: + + .. code-block:: bash + + $ python Install.py -m gcc # build using gcc compiler + $ python Install.py -m icc # build using icc compiler + + The build should produce two files: ``lib/mdi/includelink/mdi.h`` + and ``lib/mdi/liblink/libmdi.so``\ . + +---------- + .. _user-mesont: USER-MESONT package diff --git a/doc/src/Build_manual.rst b/doc/src/Build_manual.rst index 3bf0337b31..e379153e6f 100644 --- a/doc/src/Build_manual.rst +++ b/doc/src/Build_manual.rst @@ -28,29 +28,18 @@ If you downloaded LAMMPS as a tarball from `the LAMMPS website `_, the html folder and the PDF files should be included. If you downloaded LAMMPS from the public git repository, then the HTML -and PDF files are not included. Instead you need to create them, in one -of two ways: - -a. You can "fetch" the current HTML and PDF files from the LAMMPS web - site. Just type ``make fetch``. This should download a ``html_www`` - directory and a ``Manual_www.pdf`` file. Note that if new LAMMPS features - have been added more recently than the date of your LAMMPS version, the - fetched documentation will include those changes (but your source code - will not, unless you update your local repository). - -b. You can build the HTML or PDF files yourself, by typing ``make html`` - or ``make pdf`` in the ``doc`` folder. This requires various tools - and files. Some of them have to be installed (see below). For the - rest the build process will attempt to download and install them into - a python virtual environment and local folders. +and PDF files are not included. You can build the HTML or PDF files yourself, +by typing ``make html`` or ``make pdf`` in the ``doc`` folder. This requires +various tools and files. Some of them have to be installed (see below). For +the rest the build process will attempt to download and install them into +a python virtual environment and local folders. A current version of the manual (latest patch release, aka unstable branch) is is available online at: -`https://lammps.sandia.gov/doc/Manual.html -`_ A version of the manual -corresponding to the ongoing development (aka master branch) is -available online at: `https://docs.lammps.org/ -`_ +`https://docs.lammps.org/Manual.html `_. +A version of the manual corresponding to the ongoing development (aka master branch) +is available online at: `https://docs.lammps.org/latest/ +`_ Build using GNU make -------------------- @@ -257,4 +246,4 @@ the file ``lammps/doc/utils/sphinx-config/false_positives.txt``. .. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html -.. _lws: https://lammps.sandia.gov +.. _lws: https://www.lammps.org diff --git a/doc/src/Commands_all.rst b/doc/src/Commands_all.rst index b43fd0ed56..c708228be7 100644 --- a/doc/src/Commands_all.rst +++ b/doc/src/Commands_all.rst @@ -67,6 +67,7 @@ An alphabetic list of all general LAMMPS commands. * :doc:`lattice ` * :doc:`log ` * :doc:`mass ` + * :doc:`mdi/engine ` * :doc:`message ` * :doc:`minimize ` * :doc:`min_modify ` diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 65f4f542cd..0dbe8f5bec 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -101,6 +101,7 @@ OPT. * :doc:`lb/viscous ` * :doc:`lineforce ` * :doc:`manifoldforce ` + * :doc:`mdi/engine ` * :doc:`meso/move ` * :doc:`momentum (k) ` * :doc:`momentum/chunk ` diff --git a/doc/src/Errors_bugs.rst b/doc/src/Errors_bugs.rst index d2714c86b1..1ea368a5a3 100644 --- a/doc/src/Errors_bugs.rst +++ b/doc/src/Errors_bugs.rst @@ -5,8 +5,8 @@ If you are confident that you have found a bug in LAMMPS, please follow the steps outlined below: * Check the `New features and bug fixes - `_ section of the `LAMMPS WWW site - `_ or the + `_ section of the `LAMMPS WWW site + `_ or the `GitHub Releases page `_ to see if the bug has already been addressed in a patch release. * Check that your issue can be reproduced with the latest development @@ -17,7 +17,7 @@ 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 `_ + * Check the `mailing list archives `_ to see if the issue has been discussed before. If none of these steps yields any useful information, please file a new diff --git a/doc/src/Errors_common.rst b/doc/src/Errors_common.rst index 4d4483efec..11e517f513 100644 --- a/doc/src/Errors_common.rst +++ b/doc/src/Errors_common.rst @@ -39,7 +39,7 @@ figure out your physics or numerical mistakes, like choosing too big a timestep, specifying erroneous force field coefficients, or putting 2 atoms on top of each other! If you run into errors that LAMMPS does not catch that you think it should flag, please send an email to -the `developers `_. +the `developers `_. If you get an error message about an invalid command in your input script, you can determine what command is causing the problem by diff --git a/doc/src/Errors_messages.rst b/doc/src/Errors_messages.rst index aa38b3c0ba..d532ce7a31 100644 --- a/doc/src/Errors_messages.rst +++ b/doc/src/Errors_messages.rst @@ -3871,7 +3871,7 @@ Doc page with :doc:`WARNING messages ` *Fix orient/fcc found self twice* The neighbor lists used by fix orient/fcc are messed up. If this error occurs, it is likely a bug, so send an email to the - `developers `_. + `developers `_. *Fix peri neigh does not exist* Somehow a fix that the pair style defines has been deleted. diff --git a/doc/src/Examples.rst b/doc/src/Examples.rst index 8bfc4ad573..3eb25d5b30 100644 --- a/doc/src/Examples.rst +++ b/doc/src/Examples.rst @@ -18,7 +18,7 @@ files and image files. If you uncomment the :doc:`dump ` command in the input script, a text dump file will be produced, which can be animated by various -`visualization programs `_. +`visualization programs `_. If you uncomment the :doc:`dump image ` command in the input script, and assuming you have built LAMMPS with a JPG library, JPG @@ -27,7 +27,7 @@ be quickly post-processed into a movie using commands described on the :doc:`dump image ` doc page. Animations of many of the examples can be viewed on the Movies section -of the `LAMMPS web site `_. +of the `LAMMPS web site `_. There are two kinds of sub-directories in the examples folder. Lower case named directories contain one or a few simple, quick-to-run @@ -166,7 +166,7 @@ Here is how you can run and visualize one of the sample problems: Running the simulation produces the files *dump.indent* and *log.lammps*\ . You can visualize the dump file of snapshots with a variety of third-party tools highlighted on the -`Visualization `_ page of the LAMMPS +`Visualization `_ page of the LAMMPS web site. If you uncomment the :doc:`dump image ` line(s) in the input diff --git a/doc/src/Howto.rst b/doc/src/Howto.rst index ff75b751b1..8d8b7fb059 100644 --- a/doc/src/Howto.rst +++ b/doc/src/Howto.rst @@ -3,7 +3,7 @@ Howto discussions These doc pages describe how to perform various tasks with LAMMPS, both for users and developers. The -`glossary `_ website page also lists MD +`glossary `_ website page also lists MD terminology with links to corresponding LAMMPS manual pages. The example input scripts included in the examples directory of the LAMMPS distribution and highlighted on the :doc:`Examples ` doc page @@ -23,6 +23,7 @@ General howto Howto_library Howto_couple Howto_client_server + Howto_mdi Settings howto ============== diff --git a/doc/src/Howto_mdi.rst b/doc/src/Howto_mdi.rst new file mode 100644 index 0000000000..7cfcd01a50 --- /dev/null +++ b/doc/src/Howto_mdi.rst @@ -0,0 +1,132 @@ +Using LAMMPS with the MDI library for code coupling +=================================================== + +.. note:: + + This Howto doc 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 +`_, +developed by the `Molecular Sciences Software Institute (MolSSI) +`_. + +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 +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. + +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. + +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. + +------------- + +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: + +.. 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" + +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: + +.. 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" + +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. + +After both codes initialize themselves to model the same system, this is +what occurs each timestep: + +* 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 ` doc 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 diff --git a/doc/src/Howto_wsl.rst b/doc/src/Howto_wsl.rst index 874be46c37..28251ba5ee 100644 --- a/doc/src/Howto_wsl.rst +++ b/doc/src/Howto_wsl.rst @@ -201,7 +201,7 @@ build configuration and any binaries generated during compilation. There are countless ways to compile LAMMPS. It is beyond the scope of this tutorial. If you want to find out more about what can be enabled, please -consult the extensive `documentation `_. +consult the extensive `documentation `_. To compile a minimal version of LAMMPS, we're going to use a preset. Presets are a way to specify a collection of CMake options using a file. diff --git a/doc/src/Install_git.rst b/doc/src/Install_git.rst index 3c10171ea3..1a07b7f917 100644 --- a/doc/src/Install_git.rst +++ b/doc/src/Install_git.rst @@ -78,7 +78,7 @@ this is as follows. $ git checkout tagID Stable versions and what tagID to use for a particular stable version -are discussed on `this page `_. +are discussed on `this page `_. Note that this command will print some warnings, because in order to get back to the latest revision and to be able to update with ``git pull`` again, you will need to do ``git checkout unstable`` (or diff --git a/doc/src/Install_patch.rst b/doc/src/Install_patch.rst index b1f36b19e0..f1f37f86c2 100644 --- a/doc/src/Install_patch.rst +++ b/doc/src/Install_patch.rst @@ -10,7 +10,7 @@ If you prefer to download a tarball, as described on the :doc:`tarball download ` page, you can stay current by downloading "patch files" when new patch releases are made. A link to a patch file is posted on the -`bug fixes and new feature page `_ +`bug fixes and new feature page `_ of the LAMMPS website, along with a list of changed files and details about what is in the new patch release. This page explains how to apply the patch file to your local diff --git a/doc/src/Install_tarball.rst b/doc/src/Install_tarball.rst index 6f87df8a21..921ce8785a 100644 --- a/doc/src/Install_tarball.rst +++ b/doc/src/Install_tarball.rst @@ -4,10 +4,10 @@ Download source and documentation as a tarball You can download a current LAMMPS tarball from the `download page `_ of the `LAMMPS website `_. -.. _download: https://lammps.sandia.gov/download.html -.. _bug: https://lammps.sandia.gov/bug.html -.. _older: https://lammps.sandia.gov/tars -.. _lws: https://lammps.sandia.gov +.. _download: https://www.lammps.org/download.html +.. _bug: https://www.lammps.org/bug.html +.. _older: https://www.lammps.org/tars +.. _lws: https://www.lammps.org You have two choices of tarballs, either the most recent stable release or the most current patch release. Stable releases occur a diff --git a/doc/src/Intro_authors.rst b/doc/src/Intro_authors.rst index 6d2b4b7ef2..6af3996d1e 100644 --- a/doc/src/Intro_authors.rst +++ b/doc/src/Intro_authors.rst @@ -11,14 +11,14 @@ University: * Richard Berger, richard.berger at temple.edu .. _sjp: http://www.cs.sandia.gov/~sjplimp -.. _lws: https://lammps.sandia.gov +.. _lws: https://www.lammps.org Past developers include Paul Crozier and Mark Stevens, both at Sandia, and Ray Shan, now at Materials Design. ---------- -The `Authors page `_ of the +The `Authors page `_ of the `LAMMPS website `_ has a comprehensive list of all the individuals who have contributed code for a new feature or command or tool to LAMMPS. @@ -46,7 +46,7 @@ general-purpose as it is without their expertise and efforts. ---------- -As discussed on the `History page `_ of the website, LAMMPS +As discussed on the `History page `_ of the website, LAMMPS originated as a cooperative project between DOE labs and industrial partners. Folks involved in the design and testing of the original version of LAMMPS were the following: diff --git a/doc/src/Intro_citing.rst b/doc/src/Intro_citing.rst index e758992e2b..978def9f15 100644 --- a/doc/src/Intro_citing.rst +++ b/doc/src/Intro_citing.rst @@ -38,8 +38,8 @@ In addition there are DOIs for individual stable releases. Currently there are: Home page ^^^^^^^^^ -The LAMMPS website at `https://lammps.sandia.gov/ -`_ is the canonical location for information +The LAMMPS website at `https://www.lammps.org/ +`_ is the canonical location for information about LAMMPS and its features. Citing contributions diff --git a/doc/src/Intro_nonfeatures.rst b/doc/src/Intro_nonfeatures.rst index 767f8e1f61..d034ccb443 100644 --- a/doc/src/Intro_nonfeatures.rst +++ b/doc/src/Intro_nonfeatures.rst @@ -33,7 +33,7 @@ Here are suggestions on how to perform these tasks: linear bead-spring polymer chains. The moltemplate program is a true molecular builder that will generate complex molecular models. See the :doc:`Tools ` doc page for details on tools packaged with - LAMMPS. The `Pre/post processing page `_ of the LAMMPS website + LAMMPS. The `Pre/post processing page `_ of the LAMMPS website describes a variety of third party tools for this task. Furthermore, some LAMMPS internal commands allow to reconstruct, or selectively add topology information, as well as provide the option to insert molecule @@ -67,7 +67,7 @@ Here are suggestions on how to perform these tasks: them to an external program, `FFmpeg `_ to generate movies from them. For high-quality, interactive visualization there are many excellent and free tools available. See the - `Visualization Tools `_ page of the + `Visualization Tools `_ page of the LAMMPS website for visualization packages that can process LAMMPS output data. * **Plotting:** See the next bullet about Pizza.py as well as the diff --git a/doc/src/Intro_overview.rst b/doc/src/Intro_overview.rst index efaff8a914..8ab85a0d99 100644 --- a/doc/src/Intro_overview.rst +++ b/doc/src/Intro_overview.rst @@ -16,10 +16,10 @@ shared-memory boxes and distributed-memory clusters and supercomputers. .. _mpi: https://en.wikipedia.org/wiki/Message_Passing_Interface -.. _lws: https://lammps.sandia.gov +.. _lws: https://www.lammps.org LAMMPS is written in C++. Earlier versions were written in F77 and -F90. See the `History page `_ of +F90. See the `History page `_ of the website for details. All versions can be downloaded from the `LAMMPS website `_. diff --git a/doc/src/Intro_website.rst b/doc/src/Intro_website.rst index 201020a4f8..3fccaf4dca 100644 --- a/doc/src/Intro_website.rst +++ b/doc/src/Intro_website.rst @@ -5,31 +5,31 @@ The `LAMMPS website `_ has a variety of additional info about LAMMPS, beyond what is in this manual. Some other useful resources available online are listed below. -.. _lws: https://lammps.sandia.gov +.. _lws: https://www.lammps.org * `Brief intro and recently added significant features `_ -* `List of features `_ -* `List of non-features `_ -* `Recent bug fixes and new features `_ +* `List of features `_ +* `List of non-features `_ +* `Recent bug fixes and new features `_ -* `Download info `_ +* `Download info `_ * `GitHub site `_ * `SourceForge site `_ -* `LAMMPS open-source license `_ +* `LAMMPS open-source license `_ -* `Glossary of terms relevant to LAMMPS `_ -* `LAMMPS highlights with images `_ -* `LAMMPS highlights with movies `_ -* `Mail list `_ -* `Workshops `_ -* `Tutorials `_ +* `Glossary of terms relevant to LAMMPS `_ +* `LAMMPS highlights with images `_ +* `LAMMPS highlights with movies `_ +* `Mail list `_ +* `Workshops `_ +* `Tutorials `_ -* `Pre- and post-processing tools for LAMMPS `_ -* `Other software usable with LAMMPS `_ -* `Viz tools usable with LAMMPS `_ +* `Pre- and post-processing tools for LAMMPS `_ +* `Other software usable with LAMMPS `_ +* `Viz tools usable with LAMMPS `_ -* `Benchmark performance `_ -* `Publications that have cited LAMMPS `_ -* `Authors of LAMMPS `_ -* `History of LAMMPS development `_ -* `Funding for LAMMPS `_ +* `Benchmark performance `_ +* `Publications that have cited LAMMPS `_ +* `Authors of LAMMPS `_ +* `History of LAMMPS development `_ +* `Funding for LAMMPS `_ diff --git a/doc/src/Manual.rst b/doc/src/Manual.rst index 9198f545bc..6bbcdacb5e 100644 --- a/doc/src/Manual.rst +++ b/doc/src/Manual.rst @@ -15,7 +15,7 @@ the GNU Public License (GPL). 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 `_ where users can +`mailing list `_ where users can post questions, and a `GitHub site `_ where all LAMMPS development is coordinated. @@ -30,11 +30,13 @@ please :ref:`see this note `. ----------- -The manual is organized in two parts: +The manual is organized in three parts: 1) the :ref:`User Guide ` for how to install -and use LAMMPS and 2) the :ref:`Programmer Guide ` +and use LAMMPS, 2) the :ref:`Programmer Guide ` for how to write programs using the LAMMPS library from different -programming languages and how to modify and extend LAMMPS. +programming languages and how to modify and extend LAMMPS, and 3) the +:ref:`Command Reference ` which includes detailed +descriptions of all commands included in the LAMMPS code. .. only:: html @@ -42,7 +44,7 @@ programming languages and how to modify and extend LAMMPS. :doc:`this page ` since it gives quick access the documentation for all LAMMPS commands. -.. _lws: https://lammps.sandia.gov +.. _lws: https://www.lammps.org ---------- @@ -89,10 +91,15 @@ Programmer Guide Modify Developer +***************** +Command Reference +***************** + +.. _command_reference: .. toctree:: - :caption: Index - :name: index - :hidden: + :name: reference + :maxdepth: 1 + :caption: Command Reference commands_list fixes @@ -118,10 +125,10 @@ Indices and tables .. admonition:: Web Browser Compatibility The HTML version of the manual makes use of advanced features present - int "modern" web browsers. This can lead to incompatibilities with older + in "modern" web browsers. This can lead to incompatibilities with older web browsers (released more than 4 years ago) and specific vendor browsers (e.g. Internet Explorer on Windows; Microsoft Edge works well though) where parts of the pages are not rendered as expected (e.g. the layout is broken or mathematical expressions not typeset). In that case we recommend to install/use a different/newer web browser or use - the `PDF version of the manual `_. + the `PDF version of the manual `_. diff --git a/doc/src/Manual_version.rst b/doc/src/Manual_version.rst index 5ad816b3ed..a57c8512a6 100644 --- a/doc/src/Manual_version.rst +++ b/doc/src/Manual_version.rst @@ -5,7 +5,7 @@ The LAMMPS "version" is the date when it was released, such as 1 May 2014. LAMMPS is updated continuously. Whenever we fix a bug or add a feature, we release it in the next *patch* release, which are typically made every couple of weeks. Info on patch releases are on -`this website page `_. Every few +`this website page `_. Every few months, the latest patch release is subjected to more thorough testing and labeled as a *stable* version. diff --git a/doc/src/Modify_contribute.rst b/doc/src/Modify_contribute.rst index 4998712a3d..4382753c42 100644 --- a/doc/src/Modify_contribute.rst +++ b/doc/src/Modify_contribute.rst @@ -2,7 +2,7 @@ Submitting new features for inclusion in LAMMPS =============================================== We encourage users to submit new features or modifications for LAMMPS to -`the core developers `_ so they +`the core developers `_ so they can be added to the LAMMPS distribution. The preferred way to manage and coordinate this is via the LAMMPS project on `GitHub `_. Please see the :doc:`GitHub @@ -10,15 +10,15 @@ Tutorial ` for a demonstration on how to do that. An alternative is to contact the LAMMPS developers or the indicated developer of a package or feature directly and send in your contribution via e-mail, but that can add a significant delay on getting your -contribution included, depending on how busy the developer is you -contact, how complex a task it would be to integrate that code, and how +contribution included, depending on how busy the respective developer +is, how complex a task it would be to integrate that code, and how many - if any - changes are required before the code can be included. For any larger modifications or programming project, you are encouraged -to contact the LAMMPS developers ahead of time, in order to discuss -implementation strategies and coding guidelines, that will make it -easier to integrate your contribution and result in less work for -everybody involved. You are also encouraged to search through the list +to contact the LAMMPS developers ahead of time in order to discuss +implementation strategies and coding guidelines. That will make it +easier to integrate your contribution and results in less work for +everybody involved. You are also encouraged to search through the list of `open issues on GitHub `_ and submit a new issue for a planned feature, so you would not duplicate the work of others (and possibly get scooped by them) or have your work @@ -31,21 +31,22 @@ 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, so this is **NOT** for people that look for help with compiling, installing, or using LAMMPS. Please contact the `lammps-users mailing -list `_ for those purposes instead. +list `_ for those purposes instead. How quickly your contribution will be integrated depends largely on how -much effort it will cause to integrate and test it, how much it requires -changes to the core codebase, and of how much interest it is to the -larger LAMMPS community. Please see below for a checklist of typical -requirements. Once you have prepared everything, see the :doc:`LAMMPS GitHub -Tutorial ` page for instructions on -how to submit your changes or new files through a GitHub pull -request. If you prefer to submit patches or full files, you should first -make certain, that your code works correctly with the latest patch-level -version of LAMMPS and contains all bug fixes from it. Then create a -gzipped tar file of all changed or added files or a corresponding patch -file using 'diff -u' or 'diff -c' and compress it with gzip. Please only -use gzip compression, as this works well on all platforms. +much effort it will cause to integrate and test it, how many and what +kind of changes it requires to the core codebase, and of how much +interest it is to the larger LAMMPS community. Please see below for a +checklist of typical requirements. Once you have prepared everything, +see the :doc:`LAMMPS GitHub Tutorial ` page for +instructions on how to submit your changes or new files through a GitHub +pull request. If you prefer to submit patches or full files, you should +first make certain, that your code works correctly with the latest +patch-level version of LAMMPS and contains all bug fixes from it. Then +create a gzipped tar file of all changed or added files or a +corresponding patch file using 'diff -u' or 'diff -c' and compress it +with gzip. Please only use gzip compression, as this works well and is +available on all platforms. If the new features/files are broadly useful we may add them as core files to LAMMPS or as part of a :doc:`standard package `. Else we will add them as a @@ -57,13 +58,16 @@ added to the LAMMPS distribution. All the standard and user packages are listed and described on the :doc:`Packages details ` doc page. Note that by providing us files to release, you are agreeing to make -them open-source, i.e. we can release them under the terms of the GPL, -used as a license for the rest of LAMMPS. See the :doc:`LAMMPS license -` doc page for details. +them open-source, i.e. we can release them under the terms of the GPL +(version 2), used as a license for the rest of LAMMPS. And as part of +a LGPL (version 2.1) distribution that we make available to developers +on request only and with files that are authorized for that kind of +distribution removed (e.g. interface to FFTW). See the +:doc:`LAMMPS license ` doc page for details. With user packages and files, all we are really providing (aside from the fame and fortune that accompanies having your name in the source -code and on the `Authors page `_ +code and on the `Authors page `_ of the `LAMMPS WWW site `_), is a means for you to distribute your work to the LAMMPS user community, and a mechanism for others to easily try out your new feature. This may help you find bugs or make @@ -77,13 +81,13 @@ unusual event). If you prefer to actively develop and support your add-on feature yourself, then you may wish to make it available for download from your own website, as a user package that LAMMPS users can add to - their copy of LAMMPS. See the `Offsite LAMMPS packages and tools `_ page of the LAMMPS web + their copy of LAMMPS. See the `Offsite LAMMPS packages and tools `_ page of the LAMMPS web site for examples of groups that do this. We are happy to advertise your package and web site from that page. Simply email the - `developers `_ with info about + `developers `_ with info about your package and we will post it there. -.. _lws: https://lammps.sandia.gov +.. _lws: https://www.lammps.org The previous sections of this doc page describe how to add new "style" files of various kinds to LAMMPS. Packages are simply collections of @@ -92,7 +96,7 @@ LAMMPS input script. If designed correctly, these additions typically do not require changes to the main core of LAMMPS; they are simply add-on files. If you think your new feature requires non-trivial changes in core LAMMPS files, you should `communicate with the -developers `_, since we may or +developers `_, since we may or may not want to include those changes for some reason. An example of a trivial change is making a parent-class method "virtual" when you derive a new child class from it. @@ -112,7 +116,7 @@ packages in the src directory for examples. If you are uncertain, please ask. your contribution(s) to be added to main LAMMPS code or one of its standard packages, it needs to be written in a style compatible with other LAMMPS source files. This means: 2-character indentation per - level, **no tabs**\ , no lines over 80 characters. I/O is done via + level, **no tabs**\ , no lines over 100 characters. I/O is done via the C-style stdio library (mixing of stdio and iostreams is generally discouraged), class header files should not import any system headers outside of , STL containers should be avoided in headers, @@ -131,6 +135,31 @@ packages in the src directory for examples. If you are uncertain, please ask. LAMMPS source files, including the use of the error class for error and warning messages. +* To simplify reformatting contributed code in a way that is compatible + with the LAMMPS formatting styles, you can use clang-format (version 8 + or later). The LAMMPS distribution includes a suitable ``.clang-format`` + file which will be applied if you run ``clang-format -i some_file.cpp`` + on your files inside the LAMMPS src tree. Please only reformat files + that you have contributed. For header files containing a + ``SomeStyle(keyword, ClassName)`` macros it is required to have this + macro embedded with a pair of ``// clang-format off``, ``// clang-format on`` + commends and the line must be terminated with a semi-colon (;). + Example: + + .. code-block:: c++ + + #ifdef COMMAND_CLASS + // clang-format off + CommandStyle(run,Run); + // clang-format on + #else + + #ifndef LMP_RUN_H + [...] + + You may also use ``// clang-format on/off`` throughout your file + to protect sections of the file from being reformatted. + * If you want your contribution to be added as a user-contributed feature, and it's a single file (actually a \*.cpp and \*.h file) it can rapidly be added to the USER-MISC directory. Send us the one-line diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index d6f40b3228..5463fff1aa 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -82,6 +82,7 @@ page gives those details. * :ref:`USER-INTEL ` * :ref:`USER-LB ` * :ref:`USER-MANIFOLD ` + * :ref:`USER-MDI ` * :ref:`USER-MEAMC ` * :ref:`USER-MESODPD ` * :ref:`USER-MESONT ` @@ -132,8 +133,8 @@ particle models including ellipsoids, 2d lines, and 3d triangles. * `doc/PDF/pair_resquared_extra.pdf `_ * examples/ASPHERE * examples/ellipse -* https://lammps.sandia.gov/movies.html#line -* https://lammps.sandia.gov/movies.html#tri +* https://www.lammps.org/movies.html#line +* https://www.lammps.org/movies.html#tri ---------- @@ -329,7 +330,7 @@ This package has :ref:`specific installation instructions ` on the :doc:`Bu * :doc:`package gpu ` * :doc:`Commands ` pages (:doc:`pair `, :doc:`kspace `) for styles followed by (g) -* `Benchmarks page `_ of web site +* `Benchmarks page `_ of web site ---------- @@ -355,11 +356,11 @@ potentials. * examples/granregion * examples/pour * bench/in.chute -* https://lammps.sandia.gov/pictures.html#jamming -* https://lammps.sandia.gov/movies.html#hopper -* https://lammps.sandia.gov/movies.html#dem -* https://lammps.sandia.gov/movies.html#brazil -* https://lammps.sandia.gov/movies.html#granregion +* https://www.lammps.org/pictures.html#jamming +* https://www.lammps.org/movies.html#hopper +* https://www.lammps.org/movies.html#dem +* https://www.lammps.org/movies.html#brazil +* https://www.lammps.org/movies.html#granregion ---------- @@ -446,7 +447,7 @@ time via the "-sf kk" or "-suffix kk" :doc:`command-line switches ` :ref:`USER-INTEL `, and :ref:`USER-OMP ` packages, which have styles optimized for CPUs, KNLs, and GPUs. -You must have a C++11 compatible compiler to use this package. +You must have a C++14 compatible compiler to use this package. KOKKOS makes extensive use of advanced C++ features, which can expose compiler bugs, especially when compiling for maximum performance at high optimization levels. Please see the file @@ -478,7 +479,7 @@ This package has :ref:`specific installation instructions ` on the :doc: * Search the :doc:`commands ` pages (:doc:`fix `, :doc:`compute `, :doc:`pair `, :doc:`bond, angle, dihedral, improper `, :doc:`kspace `) for styles followed by (k) -* `Benchmarks page `_ of web site +* `Benchmarks page `_ of web site ---------- @@ -602,7 +603,7 @@ bonds, for performing atomic swaps, and performing grand-canonical MC * :doc:`fix tfmc ` * :doc:`fix widom ` * :doc:`pair_style dsmc ` -* https://lammps.sandia.gov/movies.html#gcmc +* https://www.lammps.org/movies.html#gcmc ---------- @@ -659,8 +660,8 @@ listing, "ls src/MISC", to see the list of commands. * :doc:`fix viscosity ` * examples/KAPPA * examples/VISCOSITY -* https://lammps.sandia.gov/pictures.html#ttm -* https://lammps.sandia.gov/movies.html#evaporation +* https://www.lammps.org/pictures.html#ttm +* https://www.lammps.org/movies.html#evaporation ---------- @@ -815,7 +816,7 @@ This package has :ref:`specific installation instructions ` on the :doc:`Bu * :doc:`OPT package ` * :doc:`Section 2.6 -sf opt ` * Search the :doc:`pair style ` page for styles followed by (t) -* `Benchmarks page `_ of web site +* `Benchmarks page `_ of web site ---------- @@ -846,7 +847,7 @@ Foster (UTSA). * :doc:`compute damage/atom ` * :doc:`compute plasticity/atom ` * examples/peri -* https://lammps.sandia.gov/movies.html#peri +* https://www.lammps.org/movies.html#peri ---------- @@ -1007,8 +1008,8 @@ Also several computes which calculate properties of rigid bodies. * examples/ASPHERE * examples/rigid * bench/in.rhodo -* https://lammps.sandia.gov/movies.html#box -* https://lammps.sandia.gov/movies.html#star +* https://www.lammps.org/movies.html#box +* https://www.lammps.org/movies.html#star ---------- @@ -1109,9 +1110,9 @@ colloidal particles. * :doc:`fix wall/srd ` * examples/srd * examples/ASPHERE -* https://lammps.sandia.gov/movies.html#tri -* https://lammps.sandia.gov/movies.html#line -* https://lammps.sandia.gov/movies.html#poly +* https://www.lammps.org/movies.html#tri +* https://www.lammps.org/movies.html#line +* https://www.lammps.org/movies.html#poly ---------- @@ -1203,7 +1204,7 @@ This package has :ref:`specific installation instructions ` on the :do * src/USER-ATC/README * :doc:`fix atc ` * examples/USER/atc -* https://lammps.sandia.gov/pictures.html#atc +* https://www.lammps.org/pictures.html#atc ---------- @@ -1336,7 +1337,7 @@ acids. * :doc:`pair_style lj/sdk/\* ` * :doc:`angle_style sdk ` * examples/USER/cgsdk -* https://lammps.sandia.gov/pictures.html#cg +* https://www.lammps.org/pictures.html#cg ---------- @@ -1573,7 +1574,7 @@ tools/eff; see its README file. * examples/USER/eff * tools/eff/README * tools/eff -* https://lammps.sandia.gov/movies.html#eff +* https://www.lammps.org/movies.html#eff ---------- @@ -1682,7 +1683,7 @@ This package has :ref:`specific installation instructions ` on the : * Search the :doc:`commands ` pages (:doc:`fix `, :doc:`compute `, :doc:`pair `, :doc:`bond, angle, dihedral, improper `, :doc:`kspace `) for styles followed by (i) * src/USER-INTEL/TEST -* `Benchmarks page `_ of web site +* `Benchmarks page `_ of web site ---------- @@ -1787,7 +1788,29 @@ Waltham, MA, USA) * :doc:`fix nve/manifold/rattle ` * :doc:`fix nvt/manifold/rattle ` * examples/USER/manifold -* https://lammps.sandia.gov/movies.html#manifold +* https://www.lammps.org/movies.html#manifold + +---------- + +.. _PKG-USER-MDI: + +USER-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 +(MDI) library `_. + +**Author:** Taylor Barnes - MolSSI, taylor.a.barnes at gmail.com + +**Supporting info:** + +* src/USER-MDI/README +* :doc:`mdi/engine ` +* :doc:`fix mdi/engine ` +* examples/USER/mdi ---------- @@ -1843,10 +1866,10 @@ algorithm. * :doc:`pair_style tdpd ` * :doc:`fix mvv/dpd ` * examples/USER/mesodpd -* https://lammps.sandia.gov/movies.html#mesodpd +* https://www.lammps.org/movies.html#mesodpd * examples/USER/meso -* http://lammps.sandia.gov/movies.html#mesodpd +* http://www.lammps.org/movies.html#mesodpd ---------- @@ -2062,7 +2085,7 @@ This package has :ref:`specific installation instructions ` on the :do * Search the :doc:`commands ` pages (:doc:`fix `, :doc:`compute `, :doc:`pair `, :doc:`bond, angle, dihedral, improper `, :doc:`kspace `) for styles followed by (o) -* `Benchmarks page `_ of web site +* `Benchmarks page `_ of web site ---------- @@ -2245,8 +2268,8 @@ molecules, and chiral-sensitive reactions. * src/USER-REACTION/README * :doc:`fix bond/react ` * examples/USER/reaction -* `2017 LAMMPS Workshop `_ -* `2019 LAMMPS Workshop `_ +* `2017 LAMMPS Workshop `_ +* `2019 LAMMPS Workshop `_ * reacter.org ---------- @@ -2373,7 +2396,7 @@ This package has :ref:`specific installation instructions ` on the :do * src/USER-SMD/README * doc/PDF/SMD_LAMMPS_userguide.pdf * examples/USER/smd -* https://lammps.sandia.gov/movies.html#smd +* https://www.lammps.org/movies.html#smd ---------- @@ -2430,7 +2453,7 @@ Dynamics, Ernst Mach Institute, Germany). * src/USER-SPH/README * doc/PDF/SPH_LAMMPS_userguide.pdf * examples/USER/sph -* https://lammps.sandia.gov/movies.html#sph +* https://www.lammps.org/movies.html#sph ---------- diff --git a/doc/src/Packages_standard.rst b/doc/src/Packages_standard.rst index 81623c8d4a..8fc1e7df7a 100644 --- a/doc/src/Packages_standard.rst +++ b/doc/src/Packages_standard.rst @@ -39,13 +39,13 @@ package: +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ | :ref:`DIPOLE ` | point dipole particles | :doc:`pair_style lj/.../dipole ` | dipole | no | +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ -| :ref:`GPU ` | GPU-enabled styles | :doc:`Section gpu ` | `Benchmarks `_ | int | +| :ref:`GPU ` | GPU-enabled styles | :doc:`Section gpu ` | `Benchmarks `_ | int | +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ | :ref:`GRANULAR ` | granular systems | :doc:`Howto granular ` | pour | no | +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ | :ref:`KIM ` | OpenKIM wrapper | :doc:`pair_style kim ` | kim | ext | +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ -| :ref:`KOKKOS ` | Kokkos-enabled styles | :doc:`Speed kokkos ` | `Benchmarks `_ | no | +| :ref:`KOKKOS ` | Kokkos-enabled styles | :doc:`Speed kokkos ` | `Benchmarks `_ | no | +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ | :ref:`KSPACE ` | long-range Coulombic solvers | :doc:`kspace_style ` | peptide | no | +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ @@ -67,7 +67,7 @@ package: +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ | :ref:`MSCG ` | multi-scale coarse-graining wrapper | :doc:`fix mscg ` | mscg | ext | +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ -| :ref:`OPT ` | optimized pair styles | :doc:`Speed opt ` | `Benchmarks `_ | no | +| :ref:`OPT ` | optimized pair styles | :doc:`Speed opt ` | `Benchmarks `_ | no | +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ | :ref:`PERI ` | Peridynamics models | :doc:`pair_style peri ` | peri | no | +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ diff --git a/doc/src/Packages_user.rst b/doc/src/Packages_user.rst index 23325e8357..ad9ebc58d1 100644 --- a/doc/src/Packages_user.rst +++ b/doc/src/Packages_user.rst @@ -59,12 +59,14 @@ package: +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-H5MD ` | dump output via HDF5 | :doc:`dump h5md ` | n/a | ext | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ -| :ref:`USER-INTEL ` | optimized Intel CPU and KNL styles | :doc:`Speed intel ` | `Benchmarks `_ | no | +| :ref:`USER-INTEL ` | optimized Intel CPU and KNL styles | :doc:`Speed intel ` | `Benchmarks `_ | no | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-LB ` | Lattice Boltzmann fluid | :doc:`fix lb/fluid ` | USER/lb | no | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-MANIFOLD ` | motion on 2d surfaces | :doc:`fix manifoldforce ` | USER/manifold | no | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ +| :ref:`USER-MDI ` | client-server coupling | :doc:`MDI Howto ` | USER/mdi | ext | ++------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-MEAMC ` | modified EAM potential (C++) | :doc:`pair_style meam/c ` | meamc | no | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-MESODPD ` | mesoscale DPD models | :doc:`pair_style edpd ` | USER/mesodpd | no | @@ -81,7 +83,7 @@ package: +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-NETCDF ` | dump output via NetCDF | :doc:`dump netcdf ` | n/a | ext | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ -| :ref:`USER-OMP ` | OpenMP-enabled styles | :doc:`Speed omp ` | `Benchmarks `_ | no | +| :ref:`USER-OMP ` | OpenMP-enabled styles | :doc:`Speed omp ` | `Benchmarks `_ | no | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ | :ref:`USER-PACE ` | Fast implementation of Atomic Cluster Expansion (ACE) potential | :doc:`pair pace ` | USER/pace | ext | +------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+ diff --git a/doc/src/Run_options.rst b/doc/src/Run_options.rst index 25756d9be0..d8adfcc5be 100644 --- a/doc/src/Run_options.rst +++ b/doc/src/Run_options.rst @@ -10,6 +10,7 @@ letter abbreviation can be used: * :ref:`-i or -in ` * :ref:`-k or -kokkos ` * :ref:`-l or -log ` +* :ref:`-mdi ` * :ref:`-m or -mpicolor ` * :ref:`-c or -cite ` * :ref:`-nc or -nocite ` @@ -196,9 +197,23 @@ Option -plog will override the name of the partition log files file.N. ---------- +.. _mdi: + +**-mdi 'multiple flags'** + +This flag is only recognized and used when LAMMPS has support for the MolSSI +Driver Interface (MDI) included as part of the :ref:`USER-MDI ` +package. This flag is specific to the MDI library and controls how LAMMPS +interacts with MDI. There are usually multiple flags that have to follow it +and those have to be placed in quotation marks. For more information about +how to launch LAMMPS in MDI client/server mode please refer to the +:doc:`MDI Howto `. + +---------- + .. _mpicolor: -**-mpicolor** color +**-mpicolor color** If used, this must be the first command-line argument after the LAMMPS executable name. It is only used when LAMMPS is launched by an mpirun @@ -223,7 +238,7 @@ links with from the lib/message directory. See the .. _cite: -**-cite style or file name** +**-cite style** or **file name** Select how and where to output a reminder about citing contributions to the LAMMPS code that were used during the run. Available styles are diff --git a/doc/src/Speed.rst b/doc/src/Speed.rst index 0528ff32d8..ccabc0adb6 100644 --- a/doc/src/Speed.rst +++ b/doc/src/Speed.rst @@ -12,7 +12,7 @@ accelerator packages provided with LAMMPS that contain code optimized for certain kinds of hardware, including multi-core CPUs, GPUs, and Intel Xeon Phi co-processors. -The `Benchmark page `_ of the LAMMPS +The `Benchmark page `_ of the LAMMPS web site gives performance results for the various accelerator packages discussed on the :doc:`Speed packages ` doc page, for several of the standard LAMMPS benchmark problems, as a diff --git a/doc/src/Speed_bench.rst b/doc/src/Speed_bench.rst index 66db03e360..aa6128894a 100644 --- a/doc/src/Speed_bench.rst +++ b/doc/src/Speed_bench.rst @@ -1,7 +1,7 @@ Benchmarks ========== -Current LAMMPS performance is discussed on the `Benchmarks page `_ of the `LAMMPS website `_ +Current LAMMPS performance is discussed on the `Benchmarks page `_ of the `LAMMPS website `_ where timings and parallel efficiency are listed. The page has several sections, which are briefly described below: @@ -43,11 +43,11 @@ to build LAMMPS and run on that kind of hardware. The bench/POTENTIALS directory has input files which correspond to the table of results on the -`Potentials `_ section of +`Potentials `_ section of the Benchmarks web page. So you can also run those test problems on your machine. -The `billion-atom `_ section +The `billion-atom `_ section of the Benchmarks web page has performance data for very large benchmark runs of simple Lennard-Jones (LJ) models, which use the bench/in.lj input script. @@ -73,4 +73,4 @@ estimate parallel performance for multi-node runs using the same logic as for all-MPI mode, except that now you will typically need many more atoms/node to achieve good scalability. -.. _lws: https://lammps.sandia.gov +.. _lws: https://www.lammps.org diff --git a/doc/src/Speed_gpu.rst b/doc/src/Speed_gpu.rst index 709a3ad3bb..4acf8c93c1 100644 --- a/doc/src/Speed_gpu.rst +++ b/doc/src/Speed_gpu.rst @@ -152,7 +152,7 @@ in OpenCL mode on CPUs (which uses vectorization and multithreading) is usually resulting in inferior performance compared to using LAMMPS' native threading and vectorization support in the USER-OMP and USER-INTEL packages. -See the `Benchmark page `_ of the +See the `Benchmark page `_ of the LAMMPS web site for performance of the GPU package on various hardware, including the Titan HPC platform at ORNL. diff --git a/doc/src/Speed_kokkos.rst b/doc/src/Speed_kokkos.rst index 708678e537..5548307de5 100644 --- a/doc/src/Speed_kokkos.rst +++ b/doc/src/Speed_kokkos.rst @@ -406,7 +406,7 @@ Generally speaking, the following rules of thumb apply: package also can increase the vector length of vector instructions by switching to single or mixed precision mode. -See the `Benchmark page `_ of the +See the `Benchmark page `_ of the LAMMPS web site for performance of the KOKKOS package on different hardware. diff --git a/doc/src/Speed_packages.rst b/doc/src/Speed_packages.rst index 6210242413..f5da991f0b 100644 --- a/doc/src/Speed_packages.rst +++ b/doc/src/Speed_packages.rst @@ -145,7 +145,7 @@ sub-directories with Make.py commands and input scripts for using all the accelerator packages on various machines. See the README files in those directories. -As mentioned above, the `Benchmark page `_ of the LAMMPS web site gives +As mentioned above, the `Benchmark page `_ of the LAMMPS web site gives performance results for the various accelerator packages for several of the standard LAMMPS benchmark problems, as a function of problem size and number of compute nodes, on different hardware platforms. diff --git a/doc/src/Tools.rst b/doc/src/Tools.rst index a790c33ec2..4d46d32037 100644 --- a/doc/src/Tools.rst +++ b/doc/src/Tools.rst @@ -6,15 +6,15 @@ molecular dynamics computations. Additional pre- and post-processing steps are often necessary to setup and analyze a simulation. A list of such tools can be found on the `LAMMPS webpage `_ at these links: -* `Pre/Post processing `_ -* `Offsite LAMMPS packages & tools `_ +* `Pre/Post processing `_ +* `Offsite LAMMPS packages & tools `_ * `Pizza.py toolkit `_ The last link for `Pizza.py `_ is a Python-based tool developed at Sandia which provides tools for doing setup, analysis, plotting, and visualization for LAMMPS simulations. -.. _lws: https://lammps.sandia.gov +.. _lws: https://www.lammps.org .. _pizza: https://pizza.sandia.gov .. _python: https://www.python.org diff --git a/doc/src/angle_table.rst b/doc/src/angle_table.rst index cad9f5a82f..b8aeae780b 100644 --- a/doc/src/angle_table.rst +++ b/doc/src/angle_table.rst @@ -69,7 +69,6 @@ parenthesized comments): HAM (keyword is the first text on line) N 181 FP 0 0 EQ 90.0 (N, FP, EQ parameters) (blank line) - N 181 FP 0 0 (N, FP parameters) 1 0.0 200.5 2.5 (index, angle, energy, derivative) 2 1.0 198.0 2.5 ... diff --git a/doc/src/atom_modify.rst b/doc/src/atom_modify.rst index a4e4ec1500..c142fb6519 100644 --- a/doc/src/atom_modify.rst +++ b/doc/src/atom_modify.rst @@ -80,7 +80,7 @@ LAMMPS commands require a map, even for atomic systems, and will generate an error if one does not exist. The *map* keyword thus allows you to force the creation of a map. The *yes* value will create either an *array* or *hash* style map, as explained in the next -paragraph. The *array* and *hash* values create an atom-style or +paragraph. The *array* and *hash* values create an array-style or hash-style map respectively. For an *array*\ -style map, each processor stores a lookup table of diff --git a/doc/src/comm_modify.rst b/doc/src/comm_modify.rst index 4e9e6325c1..27b370c941 100644 --- a/doc/src/comm_modify.rst +++ b/doc/src/comm_modify.rst @@ -34,7 +34,7 @@ Examples comm_modify mode multi reduce/multi comm_modify mode multi group solvent - comm_modift mode multi cutoff/multi 1 10.0 cutoff/multi 2*4 15.0 + comm_modify mode multi cutoff/multi 1 10.0 cutoff/multi 2*4 15.0 comm_modify vel yes comm_modify mode single cutoff 5.0 vel yes comm_modify cutoff/multi * 0.0 @@ -75,8 +75,8 @@ communicated. in *multi/old*, a similar technique is used but atoms are grouped by atom type. See the :doc:`neighbor multi ` and :doc:`neighbor multi/old ` commands for neighbor list construction options that may also be beneficial for -simulations of this kind. The *multi* communiction mode is only compatable -with the *multi* neighbor style. The *multi/old* communication mode is compatble +simulations of this kind. The *multi* communication mode is only compatible +with the *multi* neighbor style. The *multi/old* communication mode is comparable with both the *multi* and *multi/old* neighbor styles. The *cutoff* keyword allows you to extend the ghost cutoff distance @@ -97,18 +97,18 @@ warning is printed, if this bond based estimate is larger than the communication cutoff used. The *cutoff/multi* option is equivalent to *cutoff*\ , but applies to -communication mode *multi* instead. Since the communication -cutoffs are determined per atom collections, a collection specifier is needed and -cutoff for one or multiple collections can be extended. Also ranges of collections -using the usual asterisk notation can be given. -Collections are indexed from 1 to N where N is the total number of collections. +communication mode *multi* instead. Since the communication cutoffs are +determined per atom collections, a collection specifier is needed and +cutoff for one or multiple collections can be extended. Also ranges of +collections using the usual asterisk notation can be given. Collections +are indexed from 1 to N where N is the total number of collections. Note that the arguments for *cutoff/multi* are parsed right before each -simulation to account for potential changes in the number of collections. -Custom cutoffs are preserved between runs but if collections are redefined, -one may want to respecify communication cutoffs. -For granular pair styles,the default cutoff is set to the sum of the -current maximum atomic radii for each collection. -The *cutoff/multi/old* option is similar to *cutoff/multi* except it +simulation to account for potential changes in the number of +collections. Custom cutoffs are preserved between runs but if +collections are redefined, one may want to re-specify the communication +cutoffs. For granular pair styles,the default cutoff is set to the sum +of the current maximum atomic radii for each collection. The +*cutoff/multi/old* option is similar to *cutoff/multi* except it operates on atom types as opposed to collections. The *reduce/multi* option applies to *multi* and sets the communication @@ -147,7 +147,7 @@ ghost cutoff should be set. In the last scenario, a :doc:`fix ` or :doc:`compute ` or :doc:`pairwise potential ` needs to calculate with ghost atoms beyond the normal pairwise cutoff for some computation it -performs (e.g. locate neighbors of ghost atoms in a multibody pair +performs (e.g. locate neighbors of ghost atoms in a manybody pair potential). Setting the ghost cutoff appropriately can insure it will find the needed atoms. diff --git a/doc/src/commands_list.rst b/doc/src/commands_list.rst index e30d5c52dc..75affe7ce6 100644 --- a/doc/src/commands_list.rst +++ b/doc/src/commands_list.rst @@ -59,6 +59,7 @@ Commands lattice log mass + mdi_engine message min_modify min_spin diff --git a/doc/src/fix.rst b/doc/src/fix.rst index 41c9732c62..d54594d5af 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -244,6 +244,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:`meso/move ` - move mesoscopic SPH/SDPD particles in a prescribed fashion * :doc:`momentum ` - zero the linear and/or angular momentum of a group of atoms * :doc:`momentum/chunk ` - zero the linear and/or angular momentum of a chunk of atoms diff --git a/doc/src/fix_grem.rst b/doc/src/fix_grem.rst index e57f1889e1..85702b909f 100644 --- a/doc/src/fix_grem.rst +++ b/doc/src/fix_grem.rst @@ -92,6 +92,11 @@ The :doc:`thermo_modify ` *press* option is supported by this fix to add the rescaled kinetic pressure as part of :doc:`thermodynamic output `. +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the effective +temperature :math:`T_{eff}`. The scalar value calculated by this +fix is "intensive". + Restrictions """""""""""" diff --git a/doc/src/fix_mdi_engine.rst b/doc/src/fix_mdi_engine.rst new file mode 100644 index 0000000000..76506f3e19 --- /dev/null +++ b/doc/src/fix_mdi_engine.rst @@ -0,0 +1,59 @@ +.. 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 USER-MDI package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package +` doc page for more info. + +Related commands +"""""""""""""""" + +:doc:`mdi/engine ` + +Default +""""""" + +none diff --git a/doc/src/fix_wall_gran_region.rst b/doc/src/fix_wall_gran_region.rst index 0a252b162a..35995fedf0 100644 --- a/doc/src/fix_wall_gran_region.rst +++ b/doc/src/fix_wall_gran_region.rst @@ -65,7 +65,7 @@ non-granular particles and simpler wall geometries, respectively. Here are snapshots of example models using this command. Corresponding input scripts can be found in examples/granregion. Movies of these -simulations are `here on the Movies page `_ +simulations are `here on the Movies page `_ of the LAMMPS web site. .. |wallgran1| image:: img/gran_funnel.png diff --git a/doc/src/mdi_engine.rst b/doc/src/mdi_engine.rst new file mode 100644 index 0000000000..b39999606d --- /dev/null +++ b/doc/src/mdi_engine.rst @@ -0,0 +1,88 @@ +.. 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 +` doc 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 + * - ` doc page for more info. + +Related commands +"""""""""""""""" + +:doc:`fix mdi/engine ` + +Default +""""""" + +None diff --git a/doc/src/neigh_modify.rst b/doc/src/neigh_modify.rst index 208eca22ec..25c2c2ac77 100644 --- a/doc/src/neigh_modify.rst +++ b/doc/src/neigh_modify.rst @@ -221,14 +221,15 @@ 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 all atom types must be included in exactly one of the N collections. -The *collection/interval* option provides a similar capability. -This command allows a user to define collections by specifying a -series of cutoff intervals. LAMMPS will automatically sort atoms into these intervals -based on their type-dependent cutoffs or their finite size. -You must first specify the number of collections N to be -defined followed by N values representing the upper cutoff of each interval. -This command is particularly useful for granular pairstyles where the interaction distance -of particles depends on their radius and may not depend on their atom type. +The *collection/interval* option provides a similar capability. This +command allows a user to define collections by specifying a series of +cutoff intervals. LAMMPS will automatically sort atoms into these +intervals based on their type-dependent cutoffs or their finite size. +You must first specify the number of collections N to be defined +followed by N values representing the upper cutoff of each interval. +This command is particularly useful for granular pair styles where the +interaction distance of particles depends on their radius and may not +depend on their atom type. Restrictions """""""""""" diff --git a/doc/src/pair_lj_cut_tip4p.rst b/doc/src/pair_lj_cut_tip4p.rst index 4f55f3b14e..5f3b4e48e7 100644 --- a/doc/src/pair_lj_cut_tip4p.rst +++ b/doc/src/pair_lj_cut_tip4p.rst @@ -145,6 +145,22 @@ specified since a Coulombic cutoff cannot be specified for an individual I,J type pair. All type pairs use the same global Coulombic cutoff specified in the pair_style command. +.. warning:: + + Because of how these pair styles implement the coulomb interactions + by implicitly defining a fourth site for the negative charge + of the TIP4P and similar water models, special care must be taken + when using these pair styles with other computations that also use + charges. Unless they are specially set up to also handle the implicit + definition of the 4th site, results are likely incorrect. Example: + :doc:`compute dipole/chunk `. For the same + reason, when using one of these pair styles with + :doc:`pair_style hybrid `, **all** coulomb interactions + should be handled by a single sub-style with TIP4P support. All other + instances and styles will "see" the M point charges at the position + of the Oxygen atom and thus compute incorrect forces and energies. + LAMMPS will print a warning when it detects one of these issues. + ---------- A version of these styles with a soft core, *lj/cut/tip4p/long/soft*\ , suitable diff --git a/doc/utils/sphinx-config/_static/css/lammps.css b/doc/utils/sphinx-config/_static/css/lammps.css index b69405365a..900054eeeb 100644 --- a/doc/utils/sphinx-config/_static/css/lammps.css +++ b/doc/utils/sphinx-config/_static/css/lammps.css @@ -35,6 +35,10 @@ hr { display: none; } +#command-reference.section h2 { + display: none; +} + .ui.tabular.menu .item { padding-right: 1em; padding-left: 1em; diff --git a/doc/utils/sphinx-config/conf.py.in b/doc/utils/sphinx-config/conf.py.in index cbe275f556..0a13b10754 100644 --- a/doc/utils/sphinx-config/conf.py.in +++ b/doc/utils/sphinx-config/conf.py.in @@ -253,7 +253,7 @@ html_show_sourcelink = False # Output file base name for HTML help builder. htmlhelp_basename = 'LAMMPSdoc' -html_add_permalinks = '' +html_permalinks = True if 'epub' in sys.argv: html_math_renderer = 'imgmath' diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index aa932fbc2d..6133729b8a 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -47,6 +47,7 @@ Agnolin Ai Aidan aij +aimd airebo Aj ajs @@ -196,6 +197,7 @@ Ballenegger Bammann Banna Barashev +barnes barostat Barostats barostatted @@ -1207,6 +1209,7 @@ Halver Hamaker Hamel Hammerschmidt +Hanley haptic Hara Harpertown @@ -1269,6 +1272,7 @@ holonomic Homebrew hooke Hookean +hostname hotpink Houlle howto @@ -1728,6 +1732,7 @@ Lmpsdata lmptype LMT ln +localhost localTemp localvectors Loewen @@ -1858,6 +1863,8 @@ mc McLachlan md mdf +MDI +mdi mdpd mDPD meam @@ -2843,6 +2850,8 @@ Runge runtime Rutuparna rx +rxnave +rxnsum ry rz Ryckaert @@ -3143,6 +3152,7 @@ Tanmoy Tartakovsky taskset taubi +taylor tb tchain Tchain diff --git a/examples/ASPHERE/README b/examples/ASPHERE/README index ced5ead8c3..1aa9552bec 100644 --- a/examples/ASPHERE/README +++ b/examples/ASPHERE/README @@ -10,7 +10,7 @@ systems. Some of the directories include a Python script, which can be used with the Pizza.py tool to create the data file, e.g. for collections of rigid bodies. -The web site for Pizza.py is http://pizza.sandia.gov +The web site for Pizza.py is https://pizza.sandia.gov For example, If you have Pizza.py installed you can type "pizza.py -f box.py", which creates the data.box data file in the box dir. @@ -18,7 +18,7 @@ box.py", which creates the data.box data file in the box dir. If you uncomment the dump or dump image lines in the input scripts the runs will produce dump files or JPG images which you can view or animate. See the Movies page of the LAMMPS web site -(http://lammps.sandia.gov/movies.html), for animations of these +(https://www.lammps.org/movies.html), for animations of these scripts. Most were done using the dump image command. A few were done using the gl tool in Pizza.py; the Pizza.py scripts that do the animation are given in the directory, e.g. as line.viz.py. diff --git a/examples/ASPHERE/box/in.box b/examples/ASPHERE/box/in.box index 2ec09faf56..6018458231 100644 --- a/examples/ASPHERE/box/in.box +++ b/examples/ASPHERE/box/in.box @@ -67,7 +67,7 @@ delete_atoms overlap 1.0 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/box/in.box.mp b/examples/ASPHERE/box/in.box.mp index 2953552595..ce1591c7dc 100644 --- a/examples/ASPHERE/box/in.box.mp +++ b/examples/ASPHERE/box/in.box.mp @@ -67,7 +67,7 @@ delete_atoms overlap 1.0 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/dimer/in.dimer b/examples/ASPHERE/dimer/in.dimer index 9e514d83f1..224db9937d 100644 --- a/examples/ASPHERE/dimer/in.dimer +++ b/examples/ASPHERE/dimer/in.dimer @@ -61,7 +61,7 @@ delete_atoms overlap 0.5 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/dimer/in.dimer.mp b/examples/ASPHERE/dimer/in.dimer.mp index 2970df022b..a637acaf87 100644 --- a/examples/ASPHERE/dimer/in.dimer.mp +++ b/examples/ASPHERE/dimer/in.dimer.mp @@ -61,7 +61,7 @@ delete_atoms overlap 0.5 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/ellipsoid/in.ellipsoid b/examples/ASPHERE/ellipsoid/in.ellipsoid index 241f010771..5e9a20f6e0 100644 --- a/examples/ASPHERE/ellipsoid/in.ellipsoid +++ b/examples/ASPHERE/ellipsoid/in.ellipsoid @@ -72,7 +72,7 @@ delete_atoms overlap 1.6 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/ellipsoid/in.ellipsoid.mp b/examples/ASPHERE/ellipsoid/in.ellipsoid.mp index 52c30db0a9..7ce01ad4e1 100644 --- a/examples/ASPHERE/ellipsoid/in.ellipsoid.mp +++ b/examples/ASPHERE/ellipsoid/in.ellipsoid.mp @@ -72,7 +72,7 @@ delete_atoms overlap 1.6 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/line/in.line.srd b/examples/ASPHERE/line/in.line.srd index 6ec1998d31..a32bde0b76 100644 --- a/examples/ASPHERE/line/in.line.srd +++ b/examples/ASPHERE/line/in.line.srd @@ -34,7 +34,7 @@ reset_timestep 0 velocity small create 1.44 87287 loop geom -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes neigh_modify exclude molecule/intra big include big diff --git a/examples/ASPHERE/poly/in.poly b/examples/ASPHERE/poly/in.poly index 3496a774bb..68bd2a6bbc 100644 --- a/examples/ASPHERE/poly/in.poly +++ b/examples/ASPHERE/poly/in.poly @@ -70,7 +70,7 @@ delete_atoms overlap 1.0 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/poly/in.poly.mp b/examples/ASPHERE/poly/in.poly.mp index 1c6a1faee3..8fa5d24a55 100644 --- a/examples/ASPHERE/poly/in.poly.mp +++ b/examples/ASPHERE/poly/in.poly.mp @@ -70,7 +70,7 @@ delete_atoms overlap 1.0 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/star/in.star b/examples/ASPHERE/star/in.star index 6711e7a0a7..a098810199 100644 --- a/examples/ASPHERE/star/in.star +++ b/examples/ASPHERE/star/in.star @@ -67,7 +67,7 @@ delete_atoms overlap 0.5 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/star/in.star.mp b/examples/ASPHERE/star/in.star.mp index de5f23dfb6..53cb924e42 100644 --- a/examples/ASPHERE/star/in.star.mp +++ b/examples/ASPHERE/star/in.star.mp @@ -67,7 +67,7 @@ delete_atoms overlap 0.5 small big reset_timestep 0 -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes comm_modify mode multi group big vel yes diff --git a/examples/ASPHERE/tri/in.tri.srd b/examples/ASPHERE/tri/in.tri.srd index e7ef6ef59a..9bfc9d7b65 100644 --- a/examples/ASPHERE/tri/in.tri.srd +++ b/examples/ASPHERE/tri/in.tri.srd @@ -33,7 +33,7 @@ reset_timestep 0 velocity small create 1.44 87287 loop geom -neighbor 0.3 bin +neighbor 0.3 multi neigh_modify delay 0 every 1 check yes neigh_modify exclude molecule/intra big include big diff --git a/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp b/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp index 6f2f951a39..8b6a257755 100644 --- a/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp +++ b/examples/COUPLE/fortran2/LAMMPS-wrapper.cpp @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp index 6f2f951a39..8b6a257755 100644 --- a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp +++ b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper.cpp @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp index 131dc8696c..5f94363346 100644 --- a/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp +++ b/examples/COUPLE/fortran_dftb/LAMMPS-wrapper2.cpp @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/examples/COUPLE/lammps_mc/mc.cpp b/examples/COUPLE/lammps_mc/mc.cpp index 0ceead08c2..27d356f264 100644 --- a/examples/COUPLE/lammps_mc/mc.cpp +++ b/examples/COUPLE/lammps_mc/mc.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov ------------------------------------------------------------------------- */ diff --git a/examples/COUPLE/lammps_mc/mc.h b/examples/COUPLE/lammps_mc/mc.h index e9d88523fc..fd3eff24f8 100644 --- a/examples/COUPLE/lammps_mc/mc.h +++ b/examples/COUPLE/lammps_mc/mc.h @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov ------------------------------------------------------------------------- */ diff --git a/examples/COUPLE/lammps_mc/random_park.cpp b/examples/COUPLE/lammps_mc/random_park.cpp index f08d3a4894..1c9018dee3 100644 --- a/examples/COUPLE/lammps_mc/random_park.cpp +++ b/examples/COUPLE/lammps_mc/random_park.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/examples/COUPLE/lammps_mc/random_park.h b/examples/COUPLE/lammps_mc/random_park.h index 0dc2081768..c4dfa40ee4 100644 --- a/examples/COUPLE/lammps_mc/random_park.h +++ b/examples/COUPLE/lammps_mc/random_park.h @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/examples/COUPLE/lammps_nwchem/nwchem_wrap.py b/examples/COUPLE/lammps_nwchem/nwchem_wrap.py index 6fddc35da8..28b7239f8f 100644 --- a/examples/COUPLE/lammps_nwchem/nwchem_wrap.py +++ b/examples/COUPLE/lammps_nwchem/nwchem_wrap.py @@ -2,7 +2,7 @@ # ---------------------------------------------------------------------- # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -# http://lammps.sandia.gov, Sandia National Laboratories +# https://www.lammps.org/ Sandia National Laboratories # Steve Plimpton, sjplimp@sandia.gov # ---------------------------------------------------------------------- diff --git a/examples/COUPLE/lammps_vasp/vasp_wrap.py b/examples/COUPLE/lammps_vasp/vasp_wrap.py index 1e2c52aa46..bef8e899b9 100644 --- a/examples/COUPLE/lammps_vasp/vasp_wrap.py +++ b/examples/COUPLE/lammps_vasp/vasp_wrap.py @@ -2,7 +2,7 @@ # ---------------------------------------------------------------------- # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -# http://lammps.sandia.gov, Sandia National Laboratories +# https://www.lammps.org/ Sandia National Laboratories # Steve Plimpton, sjplimp@sandia.gov # ---------------------------------------------------------------------- diff --git a/examples/COUPLE/multiple/multiple.cpp b/examples/COUPLE/multiple/multiple.cpp index e61f17031f..5e875bf879 100644 --- a/examples/COUPLE/multiple/multiple.cpp +++ b/examples/COUPLE/multiple/multiple.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/examples/COUPLE/plugin/liblammpsplugin.c b/examples/COUPLE/plugin/liblammpsplugin.c index a66d87dfcc..474b0a86c2 100644 --- a/examples/COUPLE/plugin/liblammpsplugin.c +++ b/examples/COUPLE/plugin/liblammpsplugin.c @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/examples/COUPLE/plugin/liblammpsplugin.h b/examples/COUPLE/plugin/liblammpsplugin.h index 83d0dfa557..c70316d8e6 100644 --- a/examples/COUPLE/plugin/liblammpsplugin.h +++ b/examples/COUPLE/plugin/liblammpsplugin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/examples/COUPLE/simple/simple.cpp b/examples/COUPLE/simple/simple.cpp index f5ce7d91f3..c05266975e 100644 --- a/examples/COUPLE/simple/simple.cpp +++ b/examples/COUPLE/simple/simple.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/examples/README b/examples/README index 074a1cfaf3..9efac36a47 100644 --- a/examples/README +++ b/examples/README @@ -37,7 +37,7 @@ produce dump snapshots of the running simulation in any of 3 formats. If you uncomment the dump command in the input script, a text dump file will be produced, which can be animated by various visualization -programs (see http://lammps.sandia.gov/viz.html) such as Ovito, VMD, +programs (see https://www.lammps.org/viz.html) such as Ovito, VMD, or AtomEye. If you uncomment the dump image command in the input script, and diff --git a/examples/USER/cgdna/examples/oxDNA2/unique_bp/generate_unique.py b/examples/USER/cgdna/examples/oxDNA2/unique_bp/generate_unique.py index 131f51e9b4..2cd6f46aec 100644 --- a/examples/USER/cgdna/examples/oxDNA2/unique_bp/generate_unique.py +++ b/examples/USER/cgdna/examples/oxDNA2/unique_bp/generate_unique.py @@ -2,7 +2,7 @@ """ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/examples/USER/cgdna/util/generate.py b/examples/USER/cgdna/util/generate.py index e175455970..d2ba3ba980 100644 --- a/examples/USER/cgdna/util/generate.py +++ b/examples/USER/cgdna/util/generate.py @@ -2,7 +2,7 @@ """ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/examples/USER/cgsdk/sds-monolayer/in.sds-hybrid b/examples/USER/cgsdk/sds-monolayer/in.sds-hybrid index 3a9fcc13a9..eb3eca9c96 100644 --- a/examples/USER/cgsdk/sds-monolayer/in.sds-hybrid +++ b/examples/USER/cgsdk/sds-monolayer/in.sds-hybrid @@ -37,10 +37,11 @@ atom_modify first charged kspace_style pppm/cg 0.00001 kspace_modify order 3 -comm_modify mode multi neighbor 2.0 multi neigh_modify delay 4 every 2 check yes +comm_modify mode multi + timestep 10.0 fix 1 all nvt temp 310.0 310.0 100.0 diff --git a/examples/USER/diffraction/Output/log.cite b/examples/USER/diffraction/Output/log.cite index 6a807fe927..51017908a0 100644 --- a/examples/USER/diffraction/Output/log.cite +++ b/examples/USER/diffraction/Output/log.cite @@ -1,5 +1,5 @@ This LAMMPS simulation made specific use of work described in the -following references. See http://lammps.sandia.gov/cite.html +following references. See https://www.lammps.org/cite.html for details. compute_xrd command: diff --git a/examples/USER/mdi/README b/examples/USER/mdi/README new file mode 100644 index 0000000000..086341f785 --- /dev/null +++ b/examples/USER/mdi/README @@ -0,0 +1,24 @@ +This dir contains scripts that demonstrate how to use LAMMPS as an +MDI engine. LAMMPS as an engine performs the MD timestepping. +The driver is a simple Python script. Every timestep the driver +sends one or more commands to LAMMPS. + +-------------- + +The Script.sh file has comands to perform some very simple example +runs. + +-------------- + +More complex calculations using LAMMPS as an MDI engine will +typically require the use of an MDI driver. Several MDI drivers +support calculations with LAMMPS, and include: + +Ab Initio Molecular Dynamics (AIMD) Driver: +https://github.com/MolSSI-MDI/MDI_AIMD_Driver + +Nudged Elastic Band (NEB) Driver: +https://github.com/MolSSI-MDI/MDI_NEB_Driver + +Metadynamics Driver: +https://github.com/MolSSI-MDI/MDI_Metadynamics diff --git a/examples/USER/mdi/Script.sh b/examples/USER/mdi/Script.sh new file mode 100644 index 0000000000..9e3f6e5f62 --- /dev/null +++ b/examples/USER/mdi/Script.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# sample launch scripts + + +# TCP, running LAMMPS on one proc + +python driver.py -mdi "-name driver -role DRIVER -method TCP -port 8021" & +../../../src/lmp_mdi -mdi "-name LAMMPS -role ENGINE -method TCP -port 8021 -hostname localhost" -in lammps.in > lammps.out & +wait + + +# TCP, running LAMMPS on two procs + +python driver.py -mdi "-name driver -role DRIVER -method TCP -port 8021" & +mpiexec -n 2 ../../../src/lmp_mdi -mdi "-name LAMMPS -role ENGINE -method TCP -port 8021 -hostname localhost" -in lammps.in > lammps.out & +wait diff --git a/examples/USER/mdi/driver.py b/examples/USER/mdi/driver.py new file mode 100644 index 0000000000..934f6f7be1 --- /dev/null +++ b/examples/USER/mdi/driver.py @@ -0,0 +1,24 @@ +import sys +import mdi + +use_mpi4py = False +try: + from mpi4py import MPI + use_mpi4py = True +except: + pass + +# Initialize the MDI Library +mdi.MDI_Init(sys.argv[2]) + +# Connect to the engine +comm = mdi.MDI_Accept_communicator() + +# Determine the name of the engine +mdi.MDI_Send_Command(" @@ -46,19 +46,20 @@ AngleZero2::~AngleZero2() void AngleZero2::compute(int eflag, int vflag) { - ev_init(eflag,vflag); + ev_init(eflag, vflag); } /* ---------------------------------------------------------------------- */ void AngleZero2::settings(int narg, char **arg) { - if ((narg != 0) && (narg != 1)) - error->all(FLERR,"Illegal angle_style command"); + if ((narg != 0) && (narg != 1)) error->all(FLERR, "Illegal angle_style command"); if (narg == 1) { - if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0; - else error->all(FLERR,"Illegal angle_style command"); + if (strcmp("nocoeff", arg[0]) == 0) + coeffflag = 0; + else + error->all(FLERR, "Illegal angle_style command"); } } @@ -69,8 +70,8 @@ void AngleZero2::allocate() allocated = 1; int n = atom->nangletypes; - memory->create(theta0,n+1,"angle:theta0"); - memory->create(setflag,n+1,"angle:setflag"); + memory->create(theta0, n + 1, "angle:theta0"); + memory->create(setflag, n + 1, "angle:setflag"); for (int i = 1; i <= n; i++) setflag[i] = 0; } @@ -81,27 +82,26 @@ void AngleZero2::allocate() void AngleZero2::coeff(int narg, char **arg) { if ((narg < 1) || (coeffflag && narg > 2)) - error->all(FLERR,"Incorrect args for angle coefficients"); + error->all(FLERR, "Incorrect args for angle coefficients"); if (!allocated) allocate(); - int ilo,ihi; - utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); + int ilo, ihi; + utils::bounds(FLERR, arg[0], 1, atom->nangletypes, ilo, ihi, error); double theta0_one = 0.0; - if (coeffflag && (narg == 2)) - theta0_one = utils::numeric(FLERR,arg[1],false,lmp); + if (coeffflag && (narg == 2)) theta0_one = utils::numeric(FLERR, arg[1], false, lmp); // convert theta0 from degrees to radians int count = 0; for (int i = ilo; i <= ihi; i++) { setflag[i] = 1; - theta0[i] = theta0_one/180.0 * MY_PI; + theta0[i] = theta0_one / 180.0 * MY_PI; count++; } - if (count == 0) error->all(FLERR,"Incorrect args for angle coefficients"); + if (count == 0) error->all(FLERR, "Incorrect args for angle coefficients"); } /* ---------------------------------------------------------------------- */ @@ -115,8 +115,9 @@ double AngleZero2::equilibrium_angle(int i) proc 0 writes out coeffs to restart file ------------------------------------------------------------------------- */ -void AngleZero2::write_restart(FILE *fp) { - fwrite(&theta0[1],sizeof(double),atom->nangletypes,fp); +void AngleZero2::write_restart(FILE *fp) +{ + fwrite(&theta0[1], sizeof(double), atom->nangletypes, fp); } /* ---------------------------------------------------------------------- @@ -128,9 +129,9 @@ void AngleZero2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR, &theta0[1], sizeof(double), atom->nangletypes, fp, nullptr, error); } - MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); + MPI_Bcast(&theta0[1], atom->nangletypes, MPI_DOUBLE, 0, world); for (int i = 1; i <= atom->nangletypes; i++) setflag[i] = 1; } @@ -140,8 +141,7 @@ void AngleZero2::read_restart(FILE *fp) void AngleZero2::write_data(FILE *fp) { - for (int i = 1; i <= atom->nangletypes; i++) - fprintf(fp,"%d %g\n",i,theta0[i]/MY_PI*180.0); + for (int i = 1; i <= atom->nangletypes; i++) fprintf(fp, "%d %g\n", i, theta0[i] / MY_PI * 180.0); } /* ---------------------------------------------------------------------- */ diff --git a/examples/plugins/angle_zero2.h b/examples/plugins/angle_zero2.h index 15a16b197f..4c9e6e9b24 100644 --- a/examples/plugins/angle_zero2.h +++ b/examples/plugins/angle_zero2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -40,7 +40,7 @@ class AngleZero2 : public Angle { void allocate(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/examples/plugins/bond_zero2.cpp b/examples/plugins/bond_zero2.cpp index b015a60ed3..768f176c63 100644 --- a/examples/plugins/bond_zero2.cpp +++ b/examples/plugins/bond_zero2.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -44,19 +44,20 @@ BondZero2::~BondZero2() void BondZero2::compute(int eflag, int vflag) { - ev_init(eflag,vflag); + ev_init(eflag, vflag); } /* ---------------------------------------------------------------------- */ void BondZero2::settings(int narg, char **arg) { - if ((narg != 0) && (narg != 1)) - error->all(FLERR,"Illegal bond_style command"); + if ((narg != 0) && (narg != 1)) error->all(FLERR, "Illegal bond_style command"); if (narg == 1) { - if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0; - else error->all(FLERR,"Illegal bond_style command"); + if (strcmp("nocoeff", arg[0]) == 0) + coeffflag = 0; + else + error->all(FLERR, "Illegal bond_style command"); } } @@ -67,8 +68,8 @@ void BondZero2::allocate() allocated = 1; int n = atom->nbondtypes; - memory->create(r0,n+1,"bond:r0"); - memory->create(setflag,n+1,"bond:setflag"); + memory->create(r0, n + 1, "bond:r0"); + memory->create(setflag, n + 1, "bond:setflag"); for (int i = 1; i <= n; i++) setflag[i] = 0; } @@ -79,16 +80,15 @@ void BondZero2::allocate() void BondZero2::coeff(int narg, char **arg) { if ((narg < 1) || (coeffflag && narg > 2)) - error->all(FLERR,"Incorrect args for bond coefficients"); + 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); + int ilo, ihi; + utils::bounds(FLERR, arg[0], 1, atom->nbondtypes, ilo, ihi, error); double r0_one = 0.0; - if (coeffflag && (narg == 2)) - r0_one = utils::numeric(FLERR,arg[1],false,lmp); + if (coeffflag && (narg == 2)) r0_one = utils::numeric(FLERR, arg[1], false, lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -97,7 +97,7 @@ void BondZero2::coeff(int narg, char **arg) count++; } - if (count == 0) error->all(FLERR,"Incorrect args for bond coefficients"); + if (count == 0) error->all(FLERR, "Incorrect args for bond coefficients"); } /* ---------------------------------------------------------------------- @@ -113,8 +113,9 @@ double BondZero2::equilibrium_distance(int i) proc 0 writes out coeffs to restart file ------------------------------------------------------------------------- */ -void BondZero2::write_restart(FILE *fp) { - fwrite(&r0[1],sizeof(double),atom->nbondtypes,fp); +void BondZero2::write_restart(FILE *fp) +{ + fwrite(&r0[1], sizeof(double), atom->nbondtypes, fp); } /* ---------------------------------------------------------------------- @@ -126,9 +127,9 @@ void BondZero2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR, &r0[1], sizeof(double), atom->nbondtypes, fp, nullptr, error); } - MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); + MPI_Bcast(&r0[1], atom->nbondtypes, MPI_DOUBLE, 0, world); for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1; } @@ -139,14 +140,12 @@ void BondZero2::read_restart(FILE *fp) void BondZero2::write_data(FILE *fp) { - for (int i = 1; i <= atom->nbondtypes; i++) - fprintf(fp,"%d %g\n",i,r0[i]); + for (int i = 1; i <= atom->nbondtypes; i++) fprintf(fp, "%d %g\n", i, r0[i]); } /* ---------------------------------------------------------------------- */ -double BondZero2::single(int /*type*/, double /*rsq*/, int /*i*/, int /*j*/, - double & /*fforce*/) +double BondZero2::single(int /*type*/, double /*rsq*/, int /*i*/, int /*j*/, double & /*fforce*/) { return 0.0; } @@ -156,6 +155,6 @@ double BondZero2::single(int /*type*/, double /*rsq*/, int /*i*/, int /*j*/, void *BondZero2::extract(const char *str, int &dim) { dim = 1; - if (strcmp(str,"r0")==0) return (void*) r0; + if (strcmp(str, "r0") == 0) return (void *) r0; return nullptr; } diff --git a/examples/plugins/bond_zero2.h b/examples/plugins/bond_zero2.h index 37609561a7..247d3e2f63 100644 --- a/examples/plugins/bond_zero2.h +++ b/examples/plugins/bond_zero2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -41,7 +41,7 @@ class BondZero2 : public Bond { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/examples/plugins/dihedral_zero2.cpp b/examples/plugins/dihedral_zero2.cpp index 00d9817c96..a597d7a48e 100644 --- a/examples/plugins/dihedral_zero2.cpp +++ b/examples/plugins/dihedral_zero2.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -36,28 +36,27 @@ DihedralZero2::DihedralZero2(LAMMPS *lmp) : Dihedral(lmp), coeffflag(1) DihedralZero2::~DihedralZero2() { - if (allocated && !copymode) { - memory->destroy(setflag); - } + if (allocated && !copymode) { memory->destroy(setflag); } } /* ---------------------------------------------------------------------- */ void DihedralZero2::compute(int eflag, int vflag) { - ev_init(eflag,vflag); + ev_init(eflag, vflag); } /* ---------------------------------------------------------------------- */ void DihedralZero2::settings(int narg, char **arg) { - if ((narg != 0) && (narg != 1)) - error->all(FLERR,"Illegal dihedral_style command"); + if ((narg != 0) && (narg != 1)) error->all(FLERR, "Illegal dihedral_style command"); if (narg == 1) { - if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0; - else error->all(FLERR,"Illegal dihedral_style command"); + if (strcmp("nocoeff", arg[0]) == 0) + coeffflag = 0; + else + error->all(FLERR, "Illegal dihedral_style command"); } } @@ -68,7 +67,7 @@ void DihedralZero2::allocate() allocated = 1; int n = atom->ndihedraltypes; - memory->create(setflag,n+1,"dihedral:setflag"); + memory->create(setflag, n + 1, "dihedral:setflag"); for (int i = 1; i <= n; i++) setflag[i] = 0; } @@ -79,12 +78,12 @@ void DihedralZero2::allocate() void DihedralZero2::coeff(int narg, char **arg) { if ((narg < 1) || (coeffflag && narg > 1)) - error->all(FLERR,"Incorrect args for dihedral coefficients"); + error->all(FLERR, "Incorrect args for dihedral coefficients"); if (!allocated) allocate(); - int ilo,ihi; - utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); + int ilo, ihi; + utils::bounds(FLERR, arg[0], 1, atom->ndihedraltypes, ilo, ihi, error); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -92,7 +91,7 @@ void DihedralZero2::coeff(int narg, char **arg) count++; } - if (count == 0) error->all(FLERR,"Incorrect args for dihedral coefficients"); + if (count == 0) error->all(FLERR, "Incorrect args for dihedral coefficients"); } /* ---------------------------------------------------------------------- @@ -115,7 +114,7 @@ void DihedralZero2::read_restart(FILE * /*fp*/) proc 0 writes to data file ------------------------------------------------------------------------- */ -void DihedralZero2::write_data(FILE *fp) { - for (int i = 1; i <= atom->ndihedraltypes; i++) - fprintf(fp,"%d\n",i); +void DihedralZero2::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->ndihedraltypes; i++) fprintf(fp, "%d\n", i); } diff --git a/examples/plugins/dihedral_zero2.h b/examples/plugins/dihedral_zero2.h index 510e384340..c343849f7d 100644 --- a/examples/plugins/dihedral_zero2.h +++ b/examples/plugins/dihedral_zero2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -40,7 +40,7 @@ class DihedralZero2 : public Dihedral { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/examples/plugins/fix_nve2.cpp b/examples/plugins/fix_nve2.cpp index bb6f53b810..498cb40d21 100644 --- a/examples/plugins/fix_nve2.cpp +++ b/examples/plugins/fix_nve2.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,23 +12,21 @@ ------------------------------------------------------------------------- */ #include "fix_nve2.h" -#include #include "atom.h" -#include "force.h" -#include "update.h" -#include "respa.h" #include "error.h" +#include "force.h" +#include "respa.h" +#include "update.h" +#include using namespace LAMMPS_NS; using namespace FixConst; /* ---------------------------------------------------------------------- */ -FixNVE2::FixNVE2(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) +FixNVE2::FixNVE2(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { - if (strcmp(style,"nve/sphere") != 0 && narg < 3) - error->all(FLERR,"Illegal fix nve command"); + if (strcmp(style, "nve/sphere") != 0 && narg < 3) error->all(FLERR, "Illegal fix nve command"); dynamic_group_allow = 1; time_integrate = 1; @@ -53,8 +51,7 @@ void FixNVE2::init() dtv = update->dt; dtf = 0.5 * update->dt * force->ftm2v; - if (strstr(update->integrate_style,"respa")) - step_respa = ((Respa *) update->integrate)->step; + if (strstr(update->integrate_style, "respa")) step_respa = ((Respa *) update->integrate)->step; } /* ---------------------------------------------------------------------- @@ -150,8 +147,10 @@ void FixNVE2::initial_integrate_respa(int vflag, int ilevel, int /*iloop*/) // innermost level - NVE update of v and x // all other levels - NVE update of v - if (ilevel == 0) initial_integrate(vflag); - else final_integrate(); + if (ilevel == 0) + initial_integrate(vflag); + else + final_integrate(); } /* ---------------------------------------------------------------------- */ diff --git a/examples/plugins/fix_nve2.h b/examples/plugins/fix_nve2.h index f1b2244128..423946f8c0 100644 --- a/examples/plugins/fix_nve2.h +++ b/examples/plugins/fix_nve2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, 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,7 +13,7 @@ #ifdef FIX_CLASS -FixStyle(nve2,FixNVE2) +FixStyle(nve2, FixNVE2) #else @@ -37,17 +37,17 @@ class FixNVE2 : public Fix { virtual void reset_dt(); protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; }; -} +} // namespace LAMMPS_NS #endif #endif -/* ERROR/WARNING messages: + /* ERROR/WARNING messages: E: Illegal ... command diff --git a/examples/plugins/helloplugin.cpp b/examples/plugins/helloplugin.cpp index f4a49c1a5a..9f3406a282 100644 --- a/examples/plugins/helloplugin.cpp +++ b/examples/plugins/helloplugin.cpp @@ -9,25 +9,24 @@ #include namespace LAMMPS_NS { - class Hello : public Command { - public: - Hello(class LAMMPS *lmp) : Command(lmp) {}; - void command(int, char **); - }; -} +class Hello : public Command { + public: + Hello(class LAMMPS *lmp) : Command(lmp){}; + void command(int, char **); +}; +} // namespace LAMMPS_NS using namespace LAMMPS_NS; void Hello::command(int argc, char **argv) { - if (argc != 1) error->all(FLERR,"Illegal hello command"); - if (comm->me == 0) - utils::logmesg(lmp,fmt::format("Hello, {}!\n",argv[0])); + if (argc != 1) error->all(FLERR, "Illegal hello command"); + if (comm->me == 0) utils::logmesg(lmp, fmt::format("Hello, {}!\n", argv[0])); } static Command *hellocreator(LAMMPS *lmp) { - return new Hello(lmp); + return new Hello(lmp); } extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc) @@ -36,11 +35,11 @@ extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc) lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc; plugin.version = LAMMPS_VERSION; - plugin.style = "command"; - plugin.name = "hello"; - plugin.info = "Hello world command v1.1"; - plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)"; + plugin.style = "command"; + plugin.name = "hello"; + plugin.info = "Hello world command v1.1"; + plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)"; plugin.creator.v1 = (lammpsplugin_factory1 *) &hellocreator; - plugin.handle = handle; - (*register_plugin)(&plugin,lmp); + plugin.handle = handle; + (*register_plugin)(&plugin, lmp); } diff --git a/examples/plugins/improper_zero2.cpp b/examples/plugins/improper_zero2.cpp index 2370b32a02..9b0335df8b 100644 --- a/examples/plugins/improper_zero2.cpp +++ b/examples/plugins/improper_zero2.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -36,28 +36,27 @@ ImproperZero2::ImproperZero2(LAMMPS *lmp) : Improper(lmp), coeffflag(1) ImproperZero2::~ImproperZero2() { - if (allocated && !copymode) { - memory->destroy(setflag); - } + if (allocated && !copymode) { memory->destroy(setflag); } } /* ---------------------------------------------------------------------- */ void ImproperZero2::compute(int eflag, int vflag) { - ev_init(eflag,vflag); + ev_init(eflag, vflag); } /* ---------------------------------------------------------------------- */ void ImproperZero2::settings(int narg, char **arg) { - if ((narg != 0) && (narg != 1)) - error->all(FLERR,"Illegal improper_style command"); + if ((narg != 0) && (narg != 1)) error->all(FLERR, "Illegal improper_style command"); if (narg == 1) { - if (strcmp("nocoeff",arg[0]) == 0) coeffflag=0; - else error->all(FLERR,"Illegal improper_style command"); + if (strcmp("nocoeff", arg[0]) == 0) + coeffflag = 0; + else + error->all(FLERR, "Illegal improper_style command"); } } @@ -68,7 +67,7 @@ void ImproperZero2::allocate() allocated = 1; int n = atom->nimpropertypes; - memory->create(setflag,n+1,"improper:setflag"); + memory->create(setflag, n + 1, "improper:setflag"); for (int i = 1; i <= n; i++) setflag[i] = 0; } @@ -79,12 +78,12 @@ void ImproperZero2::allocate() void ImproperZero2::coeff(int narg, char **arg) { if ((narg < 1) || (coeffflag && narg > 1)) - error->all(FLERR,"Incorrect args for improper coefficients"); + error->all(FLERR, "Incorrect args for improper coefficients"); if (!allocated) allocate(); - int ilo,ihi; - utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); + int ilo, ihi; + utils::bounds(FLERR, arg[0], 1, atom->nimpropertypes, ilo, ihi, error); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -92,7 +91,7 @@ void ImproperZero2::coeff(int narg, char **arg) count++; } - if (count == 0) error->all(FLERR,"Incorrect args for improper coefficients"); + if (count == 0) error->all(FLERR, "Incorrect args for improper coefficients"); } /* ---------------------------------------------------------------------- @@ -115,8 +114,7 @@ void ImproperZero2::read_restart(FILE * /*fp*/) proc 0 writes to data file ------------------------------------------------------------------------- */ -void ImproperZero2::write_data(FILE *fp) { - for (int i = 1; i <= atom->nimpropertypes; i++) - fprintf(fp,"%d\n",i); +void ImproperZero2::write_data(FILE *fp) +{ + for (int i = 1; i <= atom->nimpropertypes; i++) fprintf(fp, "%d\n", i); } - diff --git a/examples/plugins/improper_zero2.h b/examples/plugins/improper_zero2.h index 64dd94920a..21cbd87c03 100644 --- a/examples/plugins/improper_zero2.h +++ b/examples/plugins/improper_zero2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -36,7 +36,7 @@ class ImproperZero2 : public Improper { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/examples/plugins/morse2plugin.cpp b/examples/plugins/morse2plugin.cpp index a4151dcc3d..13dc3507f1 100644 --- a/examples/plugins/morse2plugin.cpp +++ b/examples/plugins/morse2plugin.cpp @@ -12,12 +12,12 @@ using namespace LAMMPS_NS; static Pair *morse2creator(LAMMPS *lmp) { - return new PairMorse2(lmp); + return new PairMorse2(lmp); } static Pair *morse2ompcreator(LAMMPS *lmp) { - return new PairMorse2OMP(lmp); + return new PairMorse2OMP(lmp); } extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc) @@ -27,17 +27,17 @@ extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc) // register plain morse2 pair style plugin.version = LAMMPS_VERSION; - plugin.style = "pair"; - plugin.name = "morse2"; - plugin.info = "Morse2 variant pair style v1.0"; - plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)"; + plugin.style = "pair"; + plugin.name = "morse2"; + plugin.info = "Morse2 variant pair style v1.0"; + plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)"; plugin.creator.v1 = (lammpsplugin_factory1 *) &morse2creator; - plugin.handle = handle; - (*register_plugin)(&plugin,lmp); + plugin.handle = handle; + (*register_plugin)(&plugin, lmp); // also register morse2/omp pair style. only need to update changed fields - plugin.name = "morse2/omp"; - plugin.info = "Morse2 variant pair style for OpenMP v1.0"; + plugin.name = "morse2/omp"; + plugin.info = "Morse2 variant pair style for OpenMP v1.0"; plugin.creator.v1 = (lammpsplugin_factory1 *) &morse2ompcreator; - (*register_plugin)(&plugin,lmp); + (*register_plugin)(&plugin, lmp); } diff --git a/examples/plugins/nve2plugin.cpp b/examples/plugins/nve2plugin.cpp index d17db1dfc7..3c622f925c 100644 --- a/examples/plugins/nve2plugin.cpp +++ b/examples/plugins/nve2plugin.cpp @@ -11,7 +11,7 @@ using namespace LAMMPS_NS; static Fix *nve2creator(LAMMPS *lmp, int argc, char **argv) { - return new FixNVE2(lmp, argc, argv); + return new FixNVE2(lmp, argc, argv); } extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc) @@ -20,11 +20,11 @@ extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc) lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc; plugin.version = LAMMPS_VERSION; - plugin.style = "fix"; - plugin.name = "nve2"; - plugin.info = "NVE2 variant fix style v1.0"; - plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)"; + plugin.style = "fix"; + plugin.name = "nve2"; + plugin.info = "NVE2 variant fix style v1.0"; + plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)"; plugin.creator.v2 = (lammpsplugin_factory2 *) &nve2creator; - plugin.handle = handle; - (*register_plugin)(&plugin,lmp); + plugin.handle = handle; + (*register_plugin)(&plugin, lmp); } diff --git a/examples/plugins/pair_morse2.cpp b/examples/plugins/pair_morse2.cpp index a235ad297c..738fd53e87 100644 --- a/examples/plugins/pair_morse2.cpp +++ b/examples/plugins/pair_morse2.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,14 +13,14 @@ #include "pair_morse2.h" -#include -#include #include "atom.h" #include "comm.h" -#include "force.h" -#include "neigh_list.h" -#include "memory.h" #include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include +#include using namespace LAMMPS_NS; @@ -52,13 +52,13 @@ PairMorse2::~PairMorse2() void PairMorse2::compute(int eflag, int vflag) { - int i,j,ii,jj,inum,jnum,itype,jtype; - double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair; - double rsq,r,dr,dexp,factor_lj; - int *ilist,*jlist,*numneigh,**firstneigh; + int i, j, ii, jj, inum, jnum, itype, jtype; + double xtmp, ytmp, ztmp, delx, dely, delz, evdwl, fpair; + double rsq, r, dr, dexp, factor_lj; + int *ilist, *jlist, *numneigh, **firstneigh; evdwl = 0.0; - ev_init(eflag,vflag); + ev_init(eflag, vflag); double **x = atom->x; double **f = atom->f; @@ -91,32 +91,30 @@ void PairMorse2::compute(int eflag, int vflag) delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; delz = ztmp - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; + rsq = delx * delx + dely * dely + delz * delz; jtype = type[j]; if (rsq < cutsq[itype][jtype]) { r = sqrt(rsq); dr = r - r0[itype][jtype]; dexp = exp(-alpha[itype][jtype] * dr); - fpair = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r; + fpair = factor_lj * morse1[itype][jtype] * (dexp * dexp - dexp) / r; - f[i][0] += delx*fpair; - f[i][1] += dely*fpair; - f[i][2] += delz*fpair; + 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; + f[j][0] -= delx * fpair; + f[j][1] -= dely * fpair; + f[j][2] -= delz * fpair; } if (eflag) { - evdwl = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) - - offset[itype][jtype]; + evdwl = d0[itype][jtype] * (dexp * dexp - 2.0 * dexp) - offset[itype][jtype]; evdwl *= factor_lj; } - if (evflag) ev_tally(i,j,nlocal,newton_pair, - evdwl,0.0,fpair,delx,dely,delz); + if (evflag) ev_tally(i, j, nlocal, newton_pair, evdwl, 0.0, fpair, delx, dely, delz); } } } @@ -133,19 +131,18 @@ void PairMorse2::allocate() allocated = 1; int n = atom->ntypes; - memory->create(setflag,n+1,n+1,"pair:setflag"); + 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; + for (int j = i; j <= n; j++) setflag[i][j] = 0; - memory->create(cutsq,n+1,n+1,"pair:cutsq"); + memory->create(cutsq, n + 1, n + 1, "pair:cutsq"); - memory->create(cut,n+1,n+1,"pair:cut"); - memory->create(d0,n+1,n+1,"pair:d0"); - memory->create(alpha,n+1,n+1,"pair:alpha"); - memory->create(r0,n+1,n+1,"pair:r0"); - memory->create(morse1,n+1,n+1,"pair:morse1"); - memory->create(offset,n+1,n+1,"pair:offset"); + memory->create(cut, n + 1, n + 1, "pair:cut"); + memory->create(d0, n + 1, n + 1, "pair:d0"); + memory->create(alpha, n + 1, n + 1, "pair:alpha"); + memory->create(r0, n + 1, n + 1, "pair:r0"); + memory->create(morse1, n + 1, n + 1, "pair:morse1"); + memory->create(offset, n + 1, n + 1, "pair:offset"); } /* ---------------------------------------------------------------------- @@ -154,14 +151,14 @@ void PairMorse2::allocate() void PairMorse2::settings(int narg, char **arg) { - if (narg != 1) error->all(FLERR,"Illegal pair_style command"); + if (narg != 1) error->all(FLERR, "Illegal pair_style command"); - cut_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR, arg[0], false, lmp); // reset cutoffs that have been explicitly set if (allocated) { - int i,j; + int i, j; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) if (setflag[i][j]) cut[i][j] = cut_global; @@ -174,24 +171,23 @@ void PairMorse2::settings(int narg, char **arg) void PairMorse2::coeff(int narg, char **arg) { - if (narg < 5 || narg > 6) - error->all(FLERR,"Incorrect args for pair coefficients"); + if (narg < 5 || narg > 6) 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); + 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 d0_one = utils::numeric(FLERR,arg[2],false,lmp); - double alpha_one = utils::numeric(FLERR,arg[3],false,lmp); - double r0_one = utils::numeric(FLERR,arg[4],false,lmp); + double d0_one = utils::numeric(FLERR, arg[2], false, lmp); + double alpha_one = utils::numeric(FLERR, arg[3], false, lmp); + double r0_one = utils::numeric(FLERR, arg[4], false, lmp); double cut_one = cut_global; - if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); + if (narg == 6) cut_one = utils::numeric(FLERR, arg[5], false, lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { - for (int j = MAX(jlo,i); j <= jhi; j++) { + for (int j = MAX(jlo, i); j <= jhi; j++) { d0[i][j] = d0_one; alpha[i][j] = alpha_one; r0[i][j] = r0_one; @@ -201,24 +197,24 @@ void PairMorse2::coeff(int narg, char **arg) } } - if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); + if (count == 0) error->all(FLERR, "Incorrect args for pair coefficients"); } - /* ---------------------------------------------------------------------- init for one type pair i,j and corresponding j,i ------------------------------------------------------------------------- */ double PairMorse2::init_one(int i, int j) { - 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"); - morse1[i][j] = 2.0*d0[i][j]*alpha[i][j]; + morse1[i][j] = 2.0 * d0[i][j] * alpha[i][j]; if (offset_flag) { double alpha_dr = -alpha[i][j] * (cut[i][j] - r0[i][j]); - offset[i][j] = d0[i][j] * (exp(2.0*alpha_dr) - 2.0*exp(alpha_dr)); - } else offset[i][j] = 0.0; + offset[i][j] = d0[i][j] * (exp(2.0 * alpha_dr) - 2.0 * exp(alpha_dr)); + } else + offset[i][j] = 0.0; d0[j][i] = d0[i][j]; alpha[j][i] = alpha[i][j]; @@ -237,15 +233,15 @@ void PairMorse2::write_restart(FILE *fp) { write_restart_settings(fp); - int i,j; + 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); + fwrite(&setflag[i][j], sizeof(int), 1, fp); if (setflag[i][j]) { - fwrite(&d0[i][j],sizeof(double),1,fp); - fwrite(&alpha[i][j],sizeof(double),1,fp); - fwrite(&r0[i][j],sizeof(double),1,fp); - fwrite(&cut[i][j],sizeof(double),1,fp); + fwrite(&d0[i][j], sizeof(double), 1, fp); + fwrite(&alpha[i][j], sizeof(double), 1, fp); + fwrite(&r0[i][j], sizeof(double), 1, fp); + fwrite(&cut[i][j], sizeof(double), 1, fp); } } } @@ -260,23 +256,23 @@ void PairMorse2::read_restart(FILE *fp) allocate(); - int i,j; + int i, j; int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - 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 (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,&d0[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR, &d0[i][j], sizeof(double), 1, fp, nullptr, error); + utils::sfread(FLERR, &alpha[i][j], sizeof(double), 1, fp, nullptr, error); + utils::sfread(FLERR, &r0[i][j], sizeof(double), 1, fp, nullptr, error); + utils::sfread(FLERR, &cut[i][j], sizeof(double), 1, fp, nullptr, error); } - MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); - MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); - MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world); - MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); + MPI_Bcast(&d0[i][j], 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&alpha[i][j], 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&r0[i][j], 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&cut[i][j], 1, MPI_DOUBLE, 0, world); } } } @@ -287,9 +283,9 @@ void PairMorse2::read_restart(FILE *fp) void PairMorse2::write_restart_settings(FILE *fp) { - fwrite(&cut_global,sizeof(double),1,fp); - fwrite(&offset_flag,sizeof(int),1,fp); - fwrite(&mix_flag,sizeof(int),1,fp); + fwrite(&cut_global, sizeof(double), 1, fp); + fwrite(&offset_flag, sizeof(int), 1, fp); + fwrite(&mix_flag, sizeof(int), 1, fp); } /* ---------------------------------------------------------------------- @@ -299,13 +295,13 @@ void PairMorse2::write_restart_settings(FILE *fp) void PairMorse2::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR, &cut_global, sizeof(double), 1, fp, nullptr, error); + utils::sfread(FLERR, &offset_flag, sizeof(int), 1, fp, nullptr, error); + utils::sfread(FLERR, &mix_flag, sizeof(int), 1, fp, nullptr, error); } - MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); - MPI_Bcast(&offset_flag,1,MPI_INT,0,world); - MPI_Bcast(&mix_flag,1,MPI_INT,0,world); + MPI_Bcast(&cut_global, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&offset_flag, 1, MPI_INT, 0, world); + MPI_Bcast(&mix_flag, 1, MPI_INT, 0, world); } /* ---------------------------------------------------------------------- @@ -315,7 +311,7 @@ void PairMorse2::read_restart_settings(FILE *fp) void PairMorse2::write_data(FILE *fp) { for (int i = 1; i <= atom->ntypes; i++) - fprintf(fp,"%d %g %g %g\n",i,d0[i][i],alpha[i][i],r0[i][i]); + fprintf(fp, "%d %g %g %g\n", i, d0[i][i], alpha[i][i], r0[i][i]); } /* ---------------------------------------------------------------------- @@ -326,25 +322,23 @@ void PairMorse2::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 %g\n", - i,j,d0[i][j],alpha[i][j],r0[i][j],cut[i][j]); + fprintf(fp, "%d %d %g %g %g %g\n", i, j, d0[i][j], alpha[i][j], r0[i][j], cut[i][j]); } /* ---------------------------------------------------------------------- */ double PairMorse2::single(int /*i*/, int /*j*/, int itype, int jtype, double rsq, - double /*factor_coul*/, double factor_lj, - double &fforce) + double /*factor_coul*/, double factor_lj, double &fforce) { - double r,dr,dexp,phi; + double r, dr, dexp, phi; r = sqrt(rsq); dr = r - r0[itype][jtype]; dexp = exp(-alpha[itype][jtype] * dr); - fforce = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r; + fforce = factor_lj * morse1[itype][jtype] * (dexp * dexp - dexp) / r; - phi = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) - offset[itype][jtype]; - return factor_lj*phi; + phi = d0[itype][jtype] * (dexp * dexp - 2.0 * dexp) - offset[itype][jtype]; + return factor_lj * phi; } /* ---------------------------------------------------------------------- */ @@ -352,8 +346,8 @@ double PairMorse2::single(int /*i*/, int /*j*/, int itype, int jtype, double rsq void *PairMorse2::extract(const char *str, int &dim) { dim = 2; - if (strcmp(str,"d0") == 0) return (void *) d0; - if (strcmp(str,"r0") == 0) return (void *) r0; - if (strcmp(str,"alpha") == 0) return (void *) alpha; + if (strcmp(str, "d0") == 0) return (void *) d0; + if (strcmp(str, "r0") == 0) return (void *) r0; + if (strcmp(str, "alpha") == 0) return (void *) alpha; return nullptr; } diff --git a/examples/plugins/pair_morse2.h b/examples/plugins/pair_morse2.h index c20f381c63..753743fc4e 100644 --- a/examples/plugins/pair_morse2.h +++ b/examples/plugins/pair_morse2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -39,14 +39,14 @@ class PairMorse2 : public Pair { protected: double cut_global; double **cut; - double **d0,**alpha,**r0; + double **d0, **alpha, **r0; double **morse1; double **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/examples/plugins/pair_morse2_omp.cpp b/examples/plugins/pair_morse2_omp.cpp index 14438c764b..9c81bad970 100644 --- a/examples/plugins/pair_morse2_omp.cpp +++ b/examples/plugins/pair_morse2_omp.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. @@ -27,8 +27,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -PairMorse2OMP::PairMorse2OMP(LAMMPS *lmp) : - PairMorse2(lmp), ThrOMP(lmp, THR_PAIR) +PairMorse2OMP::PairMorse2OMP(LAMMPS *lmp) : PairMorse2(lmp), ThrOMP(lmp, THR_PAIR) { suffix_flag |= Suffix::OMP; respa_enable = 0; @@ -38,14 +37,14 @@ PairMorse2OMP::PairMorse2OMP(LAMMPS *lmp) : void PairMorse2OMP::compute(int eflag, int vflag) { - ev_init(eflag,vflag); + ev_init(eflag, vflag); 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) +#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(eflag, vflag) #endif { int ifrom, ito, tid; @@ -57,38 +56,44 @@ void PairMorse2OMP::compute(int eflag, int vflag) if (evflag) { if (eflag) { - if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr); - else eval<1,1,0>(ifrom, ito, thr); + 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); + 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); + 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 + } // end of omp parallel region } template -void PairMorse2OMP::eval(int iifrom, int iito, ThrData * const thr) +void PairMorse2OMP::eval(int iifrom, int iito, ThrData *const thr) { - int i,j,ii,jj,jnum,itype,jtype; - double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair; - double rsq,r,dr,dexp,factor_lj; - int *ilist,*jlist,*numneigh,**firstneigh; + int i, j, ii, jj, jnum, itype, jtype; + double xtmp, ytmp, ztmp, delx, dely, delz, evdwl, fpair; + double rsq, r, dr, dexp, factor_lj; + int *ilist, *jlist, *numneigh, **firstneigh; 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 int * _noalias const type = atom->type; + const dbl3_t *_noalias const x = (dbl3_t *) atom->x[0]; + dbl3_t *_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; - double fxtmp,fytmp,fztmp; + const double *_noalias const special_lj = force->special_lj; + double fxtmp, fytmp, fztmp; ilist = list->ilist; numneigh = list->numneigh; @@ -105,7 +110,7 @@ void PairMorse2OMP::eval(int iifrom, int iito, ThrData * const thr) itype = type[i]; jlist = firstneigh[i]; jnum = numneigh[i]; - fxtmp=fytmp=fztmp=0.0; + fxtmp = fytmp = fztmp = 0.0; for (jj = 0; jj < jnum; jj++) { j = jlist[jj]; @@ -115,32 +120,31 @@ void PairMorse2OMP::eval(int iifrom, int iito, ThrData * const thr) delx = xtmp - x[j].x; dely = ytmp - x[j].y; delz = ztmp - x[j].z; - rsq = delx*delx + dely*dely + delz*delz; + rsq = delx * delx + dely * dely + delz * delz; jtype = type[j]; if (rsq < cutsq[itype][jtype]) { r = sqrt(rsq); dr = r - r0[itype][jtype]; dexp = exp(-alpha[itype][jtype] * dr); - fpair = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r; + fpair = factor_lj * morse1[itype][jtype] * (dexp * dexp - dexp) / r; - fxtmp += delx*fpair; - fytmp += dely*fpair; - fztmp += delz*fpair; + fxtmp += delx * fpair; + fytmp += dely * fpair; + fztmp += delz * fpair; if (NEWTON_PAIR || j < nlocal) { - f[j].x -= delx*fpair; - f[j].y -= dely*fpair; - f[j].z -= delz*fpair; + f[j].x -= delx * fpair; + f[j].y -= dely * fpair; + f[j].z -= delz * fpair; } if (EFLAG) { - evdwl = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) - - offset[itype][jtype]; + evdwl = d0[itype][jtype] * (dexp * dexp - 2.0 * dexp) - offset[itype][jtype]; evdwl *= factor_lj; } - if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR, - evdwl,0.0,fpair,delx,dely,delz,thr); + if (EVFLAG) + ev_tally_thr(this, i, j, nlocal, NEWTON_PAIR, evdwl, 0.0, fpair, delx, dely, delz, thr); } } f[i].x += fxtmp; diff --git a/examples/plugins/pair_morse2_omp.h b/examples/plugins/pair_morse2_omp.h index c5ed7b5765..6c27f42125 100644 --- a/examples/plugins/pair_morse2_omp.h +++ b/examples/plugins/pair_morse2_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -33,9 +33,9 @@ class PairMorse2OMP : public PairMorse2, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif diff --git a/examples/plugins/pair_zero2.cpp b/examples/plugins/pair_zero2.cpp index d8e23c902d..c5197a67a6 100644 --- a/examples/plugins/pair_zero2.cpp +++ b/examples/plugins/pair_zero2.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,8 +19,8 @@ #include "atom.h" #include "comm.h" -#include "memory.h" #include "error.h" +#include "memory.h" #include @@ -28,11 +28,12 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -PairZero2::PairZero2(LAMMPS *lmp) : Pair(lmp) { - coeffflag=1; - writedata=1; - single_enable=1; - respa_enable=1; +PairZero2::PairZero2(LAMMPS *lmp) : Pair(lmp) +{ + coeffflag = 1; + writedata = 1; + single_enable = 1; + respa_enable = 1; } /* ---------------------------------------------------------------------- */ @@ -50,15 +51,15 @@ PairZero2::~PairZero2() void PairZero2::compute(int eflag, int vflag) { - ev_init(eflag,vflag); - if (vflag_fdotr) virial_fdotr_compute(); + ev_init(eflag, vflag); + if (vflag_fdotr) virial_fdotr_compute(); } /* ---------------------------------------------------------------------- */ void PairZero2::compute_outer(int eflag, int vflag) { - ev_init(eflag,vflag); + ev_init(eflag, vflag); } /* ---------------------------------------------------------------------- @@ -70,13 +71,12 @@ void PairZero2::allocate() allocated = 1; int n = atom->ntypes; - memory->create(setflag,n+1,n+1,"pair:setflag"); + 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; + for (int j = i; j <= n; j++) setflag[i][j] = 0; - memory->create(cutsq,n+1,n+1,"pair:cutsq"); - memory->create(cut,n+1,n+1,"pair:cut"); + memory->create(cutsq, n + 1, n + 1, "pair:cutsq"); + memory->create(cut, n + 1, n + 1, "pair:cut"); } /* ---------------------------------------------------------------------- @@ -85,22 +85,22 @@ void PairZero2::allocate() void PairZero2::settings(int narg, char **arg) { - if ((narg != 1) && (narg != 2)) - error->all(FLERR,"Illegal pair_style command"); + if ((narg != 1) && (narg != 2)) error->all(FLERR, "Illegal pair_style command"); - cut_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR, arg[0], false, lmp); if (narg == 2) { - if (strcmp("nocoeff",arg[1]) == 0) coeffflag=0; - else error->all(FLERR,"Illegal pair_style command"); + if (strcmp("nocoeff", arg[1]) == 0) + coeffflag = 0; + else + error->all(FLERR, "Illegal pair_style command"); } // reset cutoffs that have been explicitly set if (allocated) { - int i,j; + int i, j; for (i = 1; i <= atom->ntypes; i++) - for (j = i+1; j <= atom->ntypes; j++) - cut[i][j] = cut_global; + for (j = i + 1; j <= atom->ntypes; j++) cut[i][j] = cut_global; } } @@ -111,27 +111,27 @@ void PairZero2::settings(int narg, char **arg) void PairZero2::coeff(int narg, char **arg) { if ((narg < 2) || (coeffflag && narg > 3)) - error->all(FLERR,"Incorrect args for pair coefficients"); + 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); + 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 cut_one = cut_global; - if (coeffflag && (narg == 3)) cut_one = utils::numeric(FLERR,arg[2],false,lmp); + if (coeffflag && (narg == 3)) cut_one = utils::numeric(FLERR, arg[2], false, lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { - for (int j = MAX(jlo,i); j <= jhi; j++) { + for (int j = MAX(jlo, i); j <= jhi; j++) { cut[i][j] = cut_one; setflag[i][j] = 1; count++; } } - if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); + if (count == 0) error->all(FLERR, "Incorrect args for pair coefficients"); } /* ---------------------------------------------------------------------- @@ -140,9 +140,7 @@ void PairZero2::coeff(int narg, char **arg) double PairZero2::init_one(int i, int j) { - 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]); } return cut[i][j]; } @@ -155,13 +153,11 @@ void PairZero2::write_restart(FILE *fp) { write_restart_settings(fp); - int i,j; + 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(&cut[i][j],sizeof(double),1,fp); - } + fwrite(&setflag[i][j], sizeof(int), 1, fp); + if (setflag[i][j]) { fwrite(&cut[i][j], sizeof(double), 1, fp); } } } @@ -174,17 +170,15 @@ void PairZero2::read_restart(FILE *fp) read_restart_settings(fp); allocate(); - int i,j; + int i, j; int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - 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 (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); - } - MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); + 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); } } } @@ -195,8 +189,8 @@ void PairZero2::read_restart(FILE *fp) void PairZero2::write_restart_settings(FILE *fp) { - fwrite(&cut_global,sizeof(double),1,fp); - fwrite(&coeffflag,sizeof(int),1,fp); + fwrite(&cut_global, sizeof(double), 1, fp); + fwrite(&coeffflag, sizeof(int), 1, fp); } /* ---------------------------------------------------------------------- @@ -207,11 +201,11 @@ void PairZero2::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&coeffflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR, &cut_global, sizeof(double), 1, fp, nullptr, error); + utils::sfread(FLERR, &coeffflag, sizeof(int), 1, fp, nullptr, error); } - MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); - MPI_Bcast(&coeffflag,1,MPI_INT,0,world); + MPI_Bcast(&cut_global, 1, MPI_DOUBLE, 0, world); + MPI_Bcast(&coeffflag, 1, MPI_INT, 0, world); } /* ---------------------------------------------------------------------- @@ -220,8 +214,7 @@ void PairZero2::read_restart_settings(FILE *fp) void PairZero2::write_data(FILE *fp) { - for (int i = 1; i <= atom->ntypes; i++) - fprintf(fp,"%d\n",i); + for (int i = 1; i <= atom->ntypes; i++) fprintf(fp, "%d\n", i); } /* ---------------------------------------------------------------------- @@ -231,17 +224,14 @@ void PairZero2::write_data(FILE *fp) void PairZero2::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\n",i,j,cut[i][j]); + for (int j = i; j <= atom->ntypes; j++) fprintf(fp, "%d %d %g\n", i, j, cut[i][j]); } /* ---------------------------------------------------------------------- */ -double PairZero2::single(int /*i*/, int /*j*/, int /* itype */, int /* jtype */, - double /* rsq */, double /*factor_coul*/, - double /* factor_lj */, double &fforce) +double PairZero2::single(int /*i*/, int /*j*/, int /* itype */, int /* jtype */, double /* rsq */, + double /*factor_coul*/, double /* factor_lj */, double &fforce) { fforce = 0.0; return 0.0; } - diff --git a/examples/plugins/pair_zero2.h b/examples/plugins/pair_zero2.h index 39aa160913..9f96b7757c 100644 --- a/examples/plugins/pair_zero2.h +++ b/examples/plugins/pair_zero2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -53,7 +53,7 @@ class PairZero2 : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/examples/plugins/zero2plugin.cpp b/examples/plugins/zero2plugin.cpp index f181eae781..cd3c024219 100644 --- a/examples/plugins/zero2plugin.cpp +++ b/examples/plugins/zero2plugin.cpp @@ -4,37 +4,37 @@ #include -#include "pair_zero2.h" -#include "bond_zero2.h" #include "angle_zero2.h" +#include "bond_zero2.h" #include "dihedral_zero2.h" #include "improper_zero2.h" +#include "pair_zero2.h" using namespace LAMMPS_NS; static Pair *pairzerocreator(LAMMPS *lmp) { - return new PairZero2(lmp); + return new PairZero2(lmp); } static Bond *bondzerocreator(LAMMPS *lmp) { - return new BondZero2(lmp); + return new BondZero2(lmp); } static Angle *anglezerocreator(LAMMPS *lmp) { - return new AngleZero2(lmp); + return new AngleZero2(lmp); } static Dihedral *dihedralzerocreator(LAMMPS *lmp) { - return new DihedralZero2(lmp); + return new DihedralZero2(lmp); } static Improper *improperzerocreator(LAMMPS *lmp) { - return new ImproperZero2(lmp); + return new ImproperZero2(lmp); } extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc) @@ -44,35 +44,35 @@ extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc) // register zero2 pair style plugin.version = LAMMPS_VERSION; - plugin.style = "pair"; - plugin.name = "zero2"; - plugin.info = "Zero2 variant pair style v1.0"; - plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)"; + plugin.style = "pair"; + plugin.name = "zero2"; + plugin.info = "Zero2 variant pair style v1.0"; + plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)"; plugin.creator.v1 = (lammpsplugin_factory1 *) &pairzerocreator; - plugin.handle = handle; - (*register_plugin)(&plugin,lmp); + plugin.handle = handle; + (*register_plugin)(&plugin, lmp); // register zero2 bond style - plugin.style = "bond"; - plugin.info = "Zero2 variant bond style v1.0"; + plugin.style = "bond"; + plugin.info = "Zero2 variant bond style v1.0"; plugin.creator.v1 = (lammpsplugin_factory1 *) &bondzerocreator; - (*register_plugin)(&plugin,lmp); + (*register_plugin)(&plugin, lmp); // register zero2 angle style - plugin.style = "angle"; - plugin.info = "Zero2 variant angle style v1.0"; + plugin.style = "angle"; + plugin.info = "Zero2 variant angle style v1.0"; plugin.creator.v1 = (lammpsplugin_factory1 *) &anglezerocreator; - (*register_plugin)(&plugin,lmp); + (*register_plugin)(&plugin, lmp); // register zero2 dihedral style - plugin.style = "dihedral"; - plugin.info = "Zero2 variant dihedral style v1.0"; + plugin.style = "dihedral"; + plugin.info = "Zero2 variant dihedral style v1.0"; plugin.creator.v1 = (lammpsplugin_factory1 *) &dihedralzerocreator; - (*register_plugin)(&plugin,lmp); + (*register_plugin)(&plugin, lmp); // register zero2 improper style - plugin.style = "improper"; - plugin.info = "Zero2 variant improper style v1.0"; + plugin.style = "improper"; + plugin.info = "Zero2 variant improper style v1.0"; plugin.creator.v1 = (lammpsplugin_factory1 *) &improperzerocreator; - (*register_plugin)(&plugin,lmp); + (*register_plugin)(&plugin, lmp); } diff --git a/examples/reax/HNS/README.txt b/examples/reax/HNS/README.txt index 95ffbb0ebb..2af416442c 100644 --- a/examples/reax/HNS/README.txt +++ b/examples/reax/HNS/README.txt @@ -15,7 +15,7 @@ Questions: Mitchell Wood, mitwood@sandia.gov The file is read line by line looking for keywords to set up this run. It will read in the configuration given by the argument of the read_data command, which is supplied in this distribution. The type of simulation is set by the 'fix' commands, dynamic charges are controlled with 'fix qeq' and the integration style is given as 'fix nve' here. - More information about each of the individual commands can be found online at lammps.sandia.gov in the user manual section. + More information about each of the individual commands can be found online at www.lammps.org in the user manual section. *There are four free variables in this file, three of which control the size of the simulation and the last will dictate how many MD time steps are taken. *The size of the system is controlled by the 'replicate' command given the values of $x, $y and $z. @@ -27,7 +27,7 @@ Questions: Mitchell Wood, mitwood@sandia.gov lmp_serial -in in.reaxc.hns -v x 2 -v y 2 -v z 2 -v t 100 2) LAMMPS Data file for crystalline HNS - This file matches the LAMMPS data format, more information about this data structure can be found at lammps.sandia.gov + This file matches the LAMMPS data format, more information about this data structure can be found at www.lammps.org This particular data file is of the energetic material Hexanitrostilbene (HNS) with atom_style charge (id type q x y z). The file contains eight molecules (2 unit cells). diff --git a/fortran/lammps.f90 b/fortran/lammps.f90 index 9e6ca22d5a..21909e1288 100644 --- a/fortran/lammps.f90 +++ b/fortran/lammps.f90 @@ -1,6 +1,6 @@ ! ------------------------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/gpu/README b/lib/gpu/README index eb22839a59..3185db3af6 100644 --- a/lib/gpu/README +++ b/lib/gpu/README @@ -29,7 +29,7 @@ LAMMPS styles and neighbor list builds using CUDA, OpenCL, or ROCm HIP. Pair styles supported by this library are marked in the list of Pair style potentials with a "g". See the online version at: -https://lammps.sandia.gov/doc/Commands_pair.html +https://docs.lammps.org/Commands_pair.html In addition the (plain) pppm kspace style is supported as well. diff --git a/lib/mdi/.gitignore b/lib/mdi/.gitignore new file mode 100644 index 0000000000..7fcc712431 --- /dev/null +++ b/lib/mdi/.gitignore @@ -0,0 +1,69 @@ +# Prerequisites +*.d + +# Object files +*.o +*.ko +*.obj +*.elf + +# Linker output +*.ilk +*.map +*.exp + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# Debug files +*.dSYM/ +*.su +*.idb +*.pdb + +# Kernel Module Compile Results +*.mod* +*.cmd +.tmp_versions/ +modules.order +Module.symvers +Mkfile.old +dkms.conf + +# Emacs temporary files +*~ + +# MacOS +.DS_Store + +# pip +*.egg-info + +# MDI files +MDI_Library/ +build/ +libmdi.a +mdi.h +includelink +liblink \ No newline at end of file diff --git a/lib/mdi/Install.py b/lib/mdi/Install.py new file mode 100644 index 0000000000..1c411d349e --- /dev/null +++ b/lib/mdi/Install.py @@ -0,0 +1,211 @@ +#!/usr/bin/env python + +# install.py tool to do a generic build of a library +# soft linked to by many of the lib/Install.py files +# used to automate the steps described in the corresponding lib/README + +from __future__ import print_function +import sys,os,subprocess +import glob + +sys.path.append('..') +from install_helpers import checkmd5sum + +# help message + +help = """ +Syntax from src dir: make lib-libname args="-m machine -e suffix" +Syntax from lib dir: python Install.py -m machine -e suffix + +libname = name of lib dir (e.g. atc, h5md, meam, poems, etc) +specify -m and optionally -e, order does not matter + + -m = peform a clean followed by "make -f Makefile.machine" + machine = suffix of a lib/Makefile.* file + -e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix + does not alter existing Makefile.machine + +Examples: + +make lib-poems args="-m serial" # build POEMS lib with same settings as in the serial Makefile in src +make lib-colvars args="-m mpi" # build USER-COLVARS lib with same settings as in the mpi Makefile in src +make lib-meam args="-m ifort" # build MEAM lib with custom Makefile.ifort (using Intel Fortran) +""" + +# settings + +version = "1.2.9" +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', \ + } + +# print error message or help + +def error(str=None): + if not str: print(help) + else: print("ERROR",str) + sys.exit() + + # expand to full path name +# process leading '~' or relative path + +def fullpath(path): + return os.path.abspath(os.path.expanduser(path)) + +def which(program): + def is_exe(fpath): + return os.path.isfile(fpath) and os.access(fpath, os.X_OK) + + fpath, fname = os.path.split(program) + if fpath: + if is_exe(program): + return program + else: + for path in os.environ["PATH"].split(os.pathsep): + path = path.strip('"') + exe_file = os.path.join(path, program) + if is_exe(exe_file): + return exe_file + + return None + +def geturl(url,fname): + success = False + + if which('curl') != None: + cmd = 'curl -L -o "%s" %s' % (fname,url) + try: + subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + success = True + except subprocess.CalledProcessError as e: + print("Calling curl failed with: %s" % e.output.decode('UTF-8')) + + if not success and which('wget') != None: + cmd = 'wget -O "%s" %s' % (fname,url) + try: + subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + success = True + except subprocess.CalledProcessError as e: + print("Calling wget failed with: %s" % e.output.decode('UTF-8')) + + if not success: + error("Failed to download source code with 'curl' or 'wget'") + return + +# parse args + +args = sys.argv[1:] +nargs = len(args) +if nargs == 0: error() + +machine = None +extraflag = 0 + +iarg = 0 +while iarg < nargs: + if args[iarg] == "-m": + if iarg+2 > nargs: error() + machine = args[iarg+1] + iarg += 2 + elif args[iarg] == "-e": + if iarg+2 > nargs: error() + extraflag = 1 + suffix = args[iarg+1] + iarg += 2 + else: error() + +# set lib from working dir + +cwd = os.getcwd() +lib = os.path.basename(cwd) + +# download and unpack MDI_Library tarball + +homepath = "." +homedir = "%s/MDI_Library" % homepath + +print("Downloading MDI_Library ...") +mditar = "%s/v%s.tar.gz" % (homepath,version) +geturl(url, mditar) + +# verify downloaded archive integrity via md5 checksum, if known. +if version in checksums: + if not checkmd5sum(checksums[version], mditar): + sys.exit("Checksum for MDI library does not match") + +print("Unpacking MDI_Library tarball ...") +if os.path.exists("%s/v%s" % (homepath,version)): + cmd = 'rm -rf "%s/v%s"' % (homepath,version) + subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) +cmd = 'cd "%s"; tar -xzvf v%s.tar.gz' % (homepath,version) +subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) +os.remove("%s/v%s.tar.gz" % (homepath,version)) +if os.path.basename(homedir) != version: + if os.path.exists(homedir): + cmd = 'rm -rf "%s"' % homedir + subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True) + os.rename("%s/MDI_Library-%s" % (homepath,version),homedir) + +# create Makefile.auto as copy of Makefile.machine +# reset EXTRAMAKE if requested + +if not os.path.exists("Makefile.%s" % machine): + error("lib/%s/Makefile.%s does not exist" % (lib,machine)) + +lines = open("Makefile.%s" % machine,'r').readlines() +fp = open("Makefile.auto",'w') + +has_extramake = False +for line in lines: + words = line.split() + if len(words) == 3 and words[0] == "EXTRAMAKE" and words[1] == '=': + has_extramake = True + if extraflag: + line = line.replace(words[2],"Makefile.lammps.%s" % suffix) + fp.write(line) + +fp.close() + +# make the library via Makefile.auto optionally with parallel make + +try: + import multiprocessing + n_cpus = multiprocessing.cpu_count() +except: + n_cpus = 1 + +print("Building lib%s.so ..." % lib) +cmd = "make -f Makefile.auto clean; make -f Makefile.auto -j%d" % n_cpus +txt = subprocess.check_output(cmd,shell=True,stderr=subprocess.STDOUT) +print(txt.decode('UTF-8')) + +# create 2 links in lib/mdi to MDI Library src dir + +print("Creating links to MDI Library include and lib files") +if os.path.isfile("includelink") or os.path.islink("includelink"): + os.remove("includelink") +if os.path.isfile("liblink") or os.path.islink("liblink"): + os.remove("liblink") +os.symlink(os.path.join(homedir, 'MDI_Library'), 'includelink') +os.symlink(os.path.join(homepath, 'build', 'MDI_Library'), 'liblink') + +# Append the -rpath option to Makefile.lammps + +dir_path = os.path.dirname(os.path.realpath(__file__)) +rpath_option = "-Wl,-rpath=" + str(dir_path) + "/liblink" +makefile_lammps = open(str(dir_path) + "/Makefile.lammps", "a") +makefile_lammps.write(str(rpath_option) + "\n") +makefile_lammps.close() + + +shared_files = glob.glob( os.path.join( homepath, "liblink", "lib%s.so*" % lib) ) +if len(shared_files) > 0: + print("Build was successful") +else: + error("Build of lib/%s/lib%s.so was NOT successful" % (lib,lib)) +if has_extramake and not os.path.exists("Makefile.lammps"): + print("lib/%s/Makefile.lammps was NOT created" % lib) diff --git a/lib/mdi/Makefile.g++ b/lib/mdi/Makefile.g++ new file mode 100644 index 0000000000..15cc9c3a3b --- /dev/null +++ b/lib/mdi/Makefile.g++ @@ -0,0 +1,18 @@ +SHELL = /bin/sh + +# which file will be copied to Makefile.lammps + +EXTRAMAKE = Makefile.lammps.empty + +# ------ MAKE PROCEDURE ------ + +lib: $(OBJ) + mkdir -p build + cd build; cmake -Dlibtype=SHARED -Dlanguage=CXX -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ ../MDI_Library; make + @cp $(EXTRAMAKE) Makefile.lammps + +# ------ CLEAN ------ + +clean: + -rm *.o *.h $(LIB) + -rm -r build diff --git a/lib/mdi/Makefile.gcc b/lib/mdi/Makefile.gcc new file mode 100644 index 0000000000..ef8a96f5ad --- /dev/null +++ b/lib/mdi/Makefile.gcc @@ -0,0 +1,18 @@ +SHELL = /bin/sh + +# which file will be copied to Makefile.lammps + +EXTRAMAKE = Makefile.lammps.empty + +# ------ MAKE PROCEDURE ------ + +lib: $(OBJ) + mkdir -p build + cd build; cmake -Dlibtype=SHARED -Dlanguage=C -D CMAKE_C_COMPILER=gcc ../MDI_Library; make + @cp $(EXTRAMAKE) Makefile.lammps + +# ------ CLEAN ------ + +clean: + -rm *.o *.h $(LIB) + -rm -r build diff --git a/lib/mdi/Makefile.icc b/lib/mdi/Makefile.icc new file mode 100644 index 0000000000..d70ff28f97 --- /dev/null +++ b/lib/mdi/Makefile.icc @@ -0,0 +1,18 @@ +SHELL = /bin/sh + +# which file will be copied to Makefile.lammps + +EXTRAMAKE = Makefile.lammps.empty + +# ------ MAKE PROCEDURE ------ + +lib: $(OBJ) + mkdir -p build + cd build; cmake -Dlibtype=SHARED -Dlanguage=C -D CMAKE_C_COMPILER=icc -D CMAKE_CXX_COMPILER=icc ../MDI_Library; make + @cp $(EXTRAMAKE) Makefile.lammps + +# ------ CLEAN ------ + +clean: + -rm *.o *.h $(LIB) + -rm -r build diff --git a/lib/mdi/Makefile.lammps.empty b/lib/mdi/Makefile.lammps.empty new file mode 100644 index 0000000000..3aabe162d2 --- /dev/null +++ b/lib/mdi/Makefile.lammps.empty @@ -0,0 +1,5 @@ +# Settings that the LAMMPS build will import when this package library is used + +mdi_SYSINC = +mdi_SYSLIB = +mdi_SYSPATH = \ No newline at end of file diff --git a/lib/mdi/Makefile.mpi b/lib/mdi/Makefile.mpi new file mode 100644 index 0000000000..cff60f5e0b --- /dev/null +++ b/lib/mdi/Makefile.mpi @@ -0,0 +1,18 @@ +SHELL = /bin/sh + +# which file will be copied to Makefile.lammps + +EXTRAMAKE = Makefile.lammps.empty + +# ------ MAKE PROCEDURE ------ + +lib: $(OBJ) + mkdir -p build + cd build; cmake -Dlibtype=SHARED -Dlanguage=CXX -D CMAKE_C_COMPILER=mpicc -D CMAKE_CXX_COMPILER=mpicxx ../MDI_Library; make + @cp $(EXTRAMAKE) Makefile.lammps + +# ------ CLEAN ------ + +clean: + -rm *.o *.h $(LIB) + -rm -r build diff --git a/lib/mesont/CNTPot.f90 b/lib/mesont/CNTPot.f90 index c74b485274..4a130074fd 100644 --- a/lib/mesont/CNTPot.f90 +++ b/lib/mesont/CNTPot.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/mesont/ExportCNT.f90 b/lib/mesont/ExportCNT.f90 index bd89e2f036..20166a956e 100644 --- a/lib/mesont/ExportCNT.f90 +++ b/lib/mesont/ExportCNT.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/mesont/LinFun2.f90 b/lib/mesont/LinFun2.f90 index 5ced49e531..8d01a25eda 100644 --- a/lib/mesont/LinFun2.f90 +++ b/lib/mesont/LinFun2.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/mesont/Spline1.f90 b/lib/mesont/Spline1.f90 index 47acbecb70..bd796e35cc 100644 --- a/lib/mesont/Spline1.f90 +++ b/lib/mesont/Spline1.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/mesont/Spline2.f90 b/lib/mesont/Spline2.f90 index 883a5cbbee..b449f25c07 100644 --- a/lib/mesont/Spline2.f90 +++ b/lib/mesont/Spline2.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/mesont/TPMForceField.f90 b/lib/mesont/TPMForceField.f90 index 37f66e0014..a7312e09f8 100644 --- a/lib/mesont/TPMForceField.f90 +++ b/lib/mesont/TPMForceField.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/mesont/TPMGeom.f90 b/lib/mesont/TPMGeom.f90 index c866512b90..c5b8fcfaa7 100644 --- a/lib/mesont/TPMGeom.f90 +++ b/lib/mesont/TPMGeom.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/mesont/TPMLib.f90 b/lib/mesont/TPMLib.f90 index e35f75e917..3a186917c0 100644 --- a/lib/mesont/TPMLib.f90 +++ b/lib/mesont/TPMLib.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/mesont/TPMM0.f90 b/lib/mesont/TPMM0.f90 index f5b55e487a..bd2e598b69 100644 --- a/lib/mesont/TPMM0.f90 +++ b/lib/mesont/TPMM0.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/mesont/TPMM1.f90 b/lib/mesont/TPMM1.f90 index d0fec22cf9..d6c8a193db 100644 --- a/lib/mesont/TPMM1.f90 +++ b/lib/mesont/TPMM1.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/mesont/TubePotBase.f90 b/lib/mesont/TubePotBase.f90 index 6330d7ffb0..dbb15c1457 100644 --- a/lib/mesont/TubePotBase.f90 +++ b/lib/mesont/TubePotBase.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/mesont/TubePotMono.f90 b/lib/mesont/TubePotMono.f90 index c97131ab11..65e58ecf7a 100644 --- a/lib/mesont/TubePotMono.f90 +++ b/lib/mesont/TubePotMono.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/lib/mesont/TubePotTrue.f90 b/lib/mesont/TubePotTrue.f90 index 9b6a21bc13..2cb300cc32 100644 --- a/lib/mesont/TubePotTrue.f90 +++ b/lib/mesont/TubePotTrue.f90 @@ -1,6 +1,6 @@ ! ------------ ---------------------------------------------------------- ! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -! http://lammps.sandia.gov, Sandia National Laboratories +! https://www.lammps.org/ Sandia National Laboratories ! Steve Plimpton, sjplimp@sandia.gov ! ! Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/python/examples/pylammps/README.md b/python/examples/pylammps/README.md index a0f60b52f1..7ee8c8ac90 100644 --- a/python/examples/pylammps/README.md +++ b/python/examples/pylammps/README.md @@ -4,7 +4,7 @@ This folder contains examples showcasing the usage of the PyLammps Python interface and Jupyter notebooks. To use this you will need LAMMPS compiled as a shared library and the LAMMPS Python package installed. -An extensive guide on how to achieve this is documented in the [LAMMPS manual](https://lammps.sandia.gov/doc/Python_install.html). There is also a [PyLammps tutorial](https://lammps.sandia.gov/doc/Howto_pylammps.html). +An extensive guide on how to achieve this is documented in the [LAMMPS manual](https://docs.lammps.org/Python_install.html). There is also a [PyLammps tutorial](https://docs.lammps.org/Howto_pylammps.html). The following will show one way of creating a Python virtual environment which has both LAMMPS and its Python package installed: diff --git a/python/examples/pylammps/interface_usage.ipynb b/python/examples/pylammps/interface_usage.ipynb index 36cc7c77db..18902caec9 100644 --- a/python/examples/pylammps/interface_usage.ipynb +++ b/python/examples/pylammps/interface_usage.ipynb @@ -13,7 +13,7 @@ "source": [ "## Prerequisites\n", "\n", - "Before running this example, make sure your Python environment can find the LAMMPS shared library (`liblammps.so`) and the LAMMPS Python package is installed. If you followed the [README](README.md) in this folder, this should already be the case. You can also find more information about how to compile LAMMPS and install the LAMMPS Python package in the [LAMMPS manual](https://lammps.sandia.gov/doc/Python_install.html). There is also a dedicated [PyLammps HowTo](https://lammps.sandia.gov/doc/Howto_pylammps.html)." + "Before running this example, make sure your Python environment can find the LAMMPS shared library (`liblammps.so`) and the LAMMPS Python package is installed. If you followed the [README](README.md) in this folder, this should already be the case. You can also find more information about how to compile LAMMPS and install the LAMMPS Python package in the [LAMMPS manual](https://docs.lammps.org/Python_install.html). There is also a dedicated [PyLammps HowTo](https://docs.lammps.org/Howto_pylammps.html)." ] }, { diff --git a/python/examples/pylammps/interface_usage_bonds.ipynb b/python/examples/pylammps/interface_usage_bonds.ipynb index 54df488de9..0203ceb5c4 100644 --- a/python/examples/pylammps/interface_usage_bonds.ipynb +++ b/python/examples/pylammps/interface_usage_bonds.ipynb @@ -13,7 +13,7 @@ "source": [ "## Prerequisites\n", "\n", - "Before running this example, make sure your Python environment can find the LAMMPS shared library (`liblammps.so`) and the LAMMPS Python package is installed. If you followed the [README](README.md) in this folder, this should already be the case. You can also find more information about how to compile LAMMPS and install the LAMMPS Python package in the [LAMMPS manual](https://lammps.sandia.gov/doc/Python_install.html). There is also a dedicated [PyLammps HowTo](https://lammps.sandia.gov/doc/Howto_pylammps.html)." + "Before running this example, make sure your Python environment can find the LAMMPS shared library (`liblammps.so`) and the LAMMPS Python package is installed. If you followed the [README](README.md) in this folder, this should already be the case. You can also find more information about how to compile LAMMPS and install the LAMMPS Python package in the [LAMMPS manual](https://docs.lammps.org/Python_install.html). There is also a dedicated [PyLammps HowTo](https://docs.lammps.org/Howto_pylammps.html)." ] }, { diff --git a/python/examples/pylammps/simple.ipynb b/python/examples/pylammps/simple.ipynb index aecf89d3d9..170a33ebbc 100644 --- a/python/examples/pylammps/simple.ipynb +++ b/python/examples/pylammps/simple.ipynb @@ -20,7 +20,7 @@ "source": [ "## Prerequisites\n", "\n", - "Before Running this example, make sure your Python environment can find the LAMMPS shared library (`liblammps.so`) and the LAMMPS Python package is installed. If you followed the [README](README.md) in this folder, this should already be the case. You can also find more information about how to compile LAMMPS and install the LAMMPS Python package in the [LAMMPS manual](https://lammps.sandia.gov/doc/Python_install.html). There is also a dedicated [PyLammps HowTo](https://lammps.sandia.gov/doc/Howto_pylammps.html)." + "Before Running this example, make sure your Python environment can find the LAMMPS shared library (`liblammps.so`) and the LAMMPS Python package is installed. If you followed the [README](README.md) in this folder, this should already be the case. You can also find more information about how to compile LAMMPS and install the LAMMPS Python package in the [LAMMPS manual](https://docs.lammps.org/Python_install.html). There is also a dedicated [PyLammps HowTo](https://docs.lammps.org/Howto_pylammps.html)." ] }, { @@ -111,7 +111,7 @@ "source": [ "## Visualizing the initial state\n", "\n", - "`IPyLammps` allows you to visualize the current simulation state with the [image](https://lammps.sandia.gov/doc/Python_module.html#lammps.IPyLammps.image) command. Here we use it to create an image of the initial state of the system." + "`IPyLammps` allows you to visualize the current simulation state with the [image](https://docs.lammps.org/Python_module.html#lammps.IPyLammps.image) command. Here we use it to create an image of the initial state of the system." ] }, { diff --git a/python/install.py b/python/install.py index fbff02a1b5..10bd4f6de1 100644 --- a/python/install.py +++ b/python/install.py @@ -112,7 +112,7 @@ setup_kwargs= dict(name="lammps", version=verstr, author="Steve Plimpton", author_email="sjplimp@sandia.gov", - url="https://lammps.sandia.gov", + url="https://www.lammps.org", description="LAMMPS Molecular Dynamics Python package", license="GPL", packages=pkgs, diff --git a/python/lammps/constants.py b/python/lammps/constants.py index e5504691fe..f21bb69732 100644 --- a/python/lammps/constants.py +++ b/python/lammps/constants.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------- # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -# http://lammps.sandia.gov, Sandia National Laboratories +# https://www.lammps.org/ Sandia National Laboratories # Steve Plimpton, sjplimp@sandia.gov # # Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/python/lammps/core.py b/python/lammps/core.py index 1e8f739943..800a1eab29 100644 --- a/python/lammps/core.py +++ b/python/lammps/core.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------- # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -# http://lammps.sandia.gov, Sandia National Laboratories +# https://www.lammps.org/ Sandia National Laboratories # Steve Plimpton, sjplimp@sandia.gov # # Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/python/lammps/data.py b/python/lammps/data.py index 426da47ab2..731a8c514a 100644 --- a/python/lammps/data.py +++ b/python/lammps/data.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------- # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -# http://lammps.sandia.gov, Sandia National Laboratories +# https://www.lammps.org/ Sandia National Laboratories # Steve Plimpton, sjplimp@sandia.gov # # Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/python/lammps/formats.py b/python/lammps/formats.py index b5dc5d307c..641e17be3e 100644 --- a/python/lammps/formats.py +++ b/python/lammps/formats.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------- # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -# http://lammps.sandia.gov, Sandia National Laboratories +# https://www.lammps.org/ Sandia National Laboratories # Steve Plimpton, sjplimp@sandia.gov # # Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/python/lammps/mliap/loader.py b/python/lammps/mliap/loader.py index b875d8d834..8588c2b4bf 100644 --- a/python/lammps/mliap/loader.py +++ b/python/lammps/mliap/loader.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------- # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -# http://lammps.sandia.gov, Sandia National Laboratories +# https://www.lammps.org/ Sandia National Laboratories # Steve Plimpton, sjplimp@sandia.gov # # Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/python/lammps/mliap/pytorch.py b/python/lammps/mliap/pytorch.py index aa2cf1c97c..7ec6c2552a 100644 --- a/python/lammps/mliap/pytorch.py +++ b/python/lammps/mliap/pytorch.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------- # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -# http://lammps.sandia.gov, Sandia National Laboratories +# https://www.lammps.org/ Sandia National Laboratories # Steve Plimpton, sjplimp@sandia.gov # # Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/python/lammps/numpy_wrapper.py b/python/lammps/numpy_wrapper.py index 4aca11cdc7..399affa51a 100644 --- a/python/lammps/numpy_wrapper.py +++ b/python/lammps/numpy_wrapper.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------- # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -# http://lammps.sandia.gov, Sandia National Laboratories +# https://www.lammps.org/ Sandia National Laboratories # Steve Plimpton, sjplimp@sandia.gov # # Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/python/lammps/pylammps.py b/python/lammps/pylammps.py index dae2efcbe7..f9bdd1720a 100644 --- a/python/lammps/pylammps.py +++ b/python/lammps/pylammps.py @@ -1,6 +1,6 @@ # ---------------------------------------------------------------------- # LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -# http://lammps.sandia.gov, Sandia National Laboratories +# https://www.lammps.org/ Sandia National Laboratories # Steve Plimpton, sjplimp@sandia.gov # # Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/python/setup.py b/python/setup.py index 2f2b67b6f1..2ccbb373e3 100644 --- a/python/setup.py +++ b/python/setup.py @@ -26,7 +26,7 @@ setup( version = get_lammps_version(), author = "Steve Plimpton", author_email = "sjplimp@sandia.gov", - url = "https://lammps.sandia.gov", + url = "https://www.lammps.org", description = "LAMMPS Molecular Dynamics Python package", license = "GPL", packages=pkgs, diff --git a/src/.clang-format b/src/.clang-format new file mode 100644 index 0000000000..d5bb8c37a3 --- /dev/null +++ b/src/.clang-format @@ -0,0 +1,32 @@ +--- +Language: Cpp +BasedOnStyle: LLVM +AccessModifierOffset: -1 +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: false +AllowShortBlocksOnASingleLine: true +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: WithoutElse +AllowShortLambdasOnASingleLine: None +AllowShortLoopsOnASingleLine: true +BraceWrapping: + AfterFunction: true +BreakBeforeBraces: Custom +BreakConstructorInitializers: AfterColon +BreakInheritanceList: AfterColon +ColumnLimit: 100 +IndentCaseLabels: true +IndentWidth: 2 +NamespaceIndentation: Inner +ObjCBlockIndentWidth: 2 +PenaltyBreakAssignment: 4 +ReflowComments: false +SpaceAfterCStyleCast: true +SpacesBeforeTrailingComments: 4 +SpacesInContainerLiterals: false +Standard: Cpp11 +TabWidth: 2 +UseTab: Never +... diff --git a/src/.gitignore b/src/.gitignore index 20a0bde94e..9c2a4b041b 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -27,6 +27,13 @@ /*_ssa.h /*_ssa.cpp +/fix_mdi_engine.cpp +/fix_mdi_engine.h +/library_mdi.cpp +/library_mdi.h +/mdi_engine.cpp +/mdi_engine.h + /fix_brownian*.cpp /fix_brownian*.h /fix_propel_self.cpp @@ -549,6 +556,8 @@ /fix_bond_react.h /fix_bond_swap.cpp /fix_bond_swap.h +/fix_charge_regulation.cpp +/fix_charge_regulation.h /fix_client_md.cpp /fix_client_md.h /fix_cmap.cpp @@ -807,6 +816,8 @@ /gridcomm.h /group_ndx.cpp /group_ndx.h +/gz_file_writer.cpp +/gz_file_writer.h /ndx_group.cpp /ndx_group.h /hyper.cpp @@ -1179,6 +1190,7 @@ /python_impl.cpp /python_impl.h /python_compat.h +/python_utils.h /fix_python_move.cpp /fix_python_move.h /fix_python_invoke.cpp @@ -1270,6 +1282,8 @@ /write_dump.h /xdr_compat.cpp /xdr_compat.h +/zstd_file_writer.cpp +/zstd_file_writer.h /atom_vec_smd.cpp /atom_vec_smd.h @@ -1425,5 +1439,3 @@ /pair_smtbq.h /pair_vashishta*.cpp /pair_vashishta*.h -/zstd_file_writer.cpp -/zstd_file_writer.h diff --git a/src/ASPHERE/compute_erotate_asphere.cpp b/src/ASPHERE/compute_erotate_asphere.cpp index d7c38ae40a..d2118e60ca 100644 --- a/src/ASPHERE/compute_erotate_asphere.cpp +++ b/src/ASPHERE/compute_erotate_asphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/compute_erotate_asphere.h b/src/ASPHERE/compute_erotate_asphere.h index 93244dd7e6..0805770bb6 100644 --- a/src/ASPHERE/compute_erotate_asphere.h +++ b/src/ASPHERE/compute_erotate_asphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(erotate/asphere,ComputeERotateAsphere) - +// clang-format off +ComputeStyle(erotate/asphere,ComputeERotateAsphere); +// clang-format on #else #ifndef LMP_COMPUTE_EROTATE_ASPHERE_H @@ -37,7 +37,7 @@ class ComputeERotateAsphere : public Compute { class AtomVecTri *avec_tri; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/compute_temp_asphere.cpp b/src/ASPHERE/compute_temp_asphere.cpp index 9afae4d2d9..abf0157f84 100644 --- a/src/ASPHERE/compute_temp_asphere.cpp +++ b/src/ASPHERE/compute_temp_asphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/compute_temp_asphere.h b/src/ASPHERE/compute_temp_asphere.h index 61d3162d6c..18c0768fd0 100644 --- a/src/ASPHERE/compute_temp_asphere.h +++ b/src/ASPHERE/compute_temp_asphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/asphere,ComputeTempAsphere) - +// clang-format off +ComputeStyle(temp/asphere,ComputeTempAsphere); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_ASPHERE_H @@ -42,13 +42,13 @@ class ComputeTempAsphere : public Compute { int mode; double tfactor; char *id_bias; - class Compute *tbias; // ptr to additional bias compute + class Compute *tbias; // ptr to additional bias compute class AtomVecEllipsoid *avec; void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_nh_asphere.cpp b/src/ASPHERE/fix_nh_asphere.cpp index e5ca89efb0..357aee9696 100644 --- a/src/ASPHERE/fix_nh_asphere.cpp +++ b/src/ASPHERE/fix_nh_asphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/fix_nh_asphere.h b/src/ASPHERE/fix_nh_asphere.h index 4c82a1b83c..cc4020ecf5 100644 --- a/src/ASPHERE/fix_nh_asphere.h +++ b/src/ASPHERE/fix_nh_asphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -33,7 +33,7 @@ class FixNHAsphere : public FixNH { void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/ASPHERE/fix_nph_asphere.cpp b/src/ASPHERE/fix_nph_asphere.cpp index 538e467133..6ca263b8e6 100644 --- a/src/ASPHERE/fix_nph_asphere.cpp +++ b/src/ASPHERE/fix_nph_asphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/fix_nph_asphere.h b/src/ASPHERE/fix_nph_asphere.h index 7e68e31048..5fed646f63 100644 --- a/src/ASPHERE/fix_nph_asphere.h +++ b/src/ASPHERE/fix_nph_asphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nph/asphere,FixNPHAsphere) - +// clang-format off +FixStyle(nph/asphere,FixNPHAsphere); +// clang-format on #else #ifndef LMP_FIX_NPH_ASPHERE_H @@ -30,7 +30,7 @@ class FixNPHAsphere : public FixNHAsphere { ~FixNPHAsphere() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_npt_asphere.cpp b/src/ASPHERE/fix_npt_asphere.cpp index 99909e5a2a..e7648bc32b 100644 --- a/src/ASPHERE/fix_npt_asphere.cpp +++ b/src/ASPHERE/fix_npt_asphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/fix_npt_asphere.h b/src/ASPHERE/fix_npt_asphere.h index 5a3867e4eb..43410b78da 100644 --- a/src/ASPHERE/fix_npt_asphere.h +++ b/src/ASPHERE/fix_npt_asphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt/asphere,FixNPTAsphere) - +// clang-format off +FixStyle(npt/asphere,FixNPTAsphere); +// clang-format on #else #ifndef LMP_FIX_NPT_ASPHERE_H @@ -30,7 +30,7 @@ class FixNPTAsphere : public FixNHAsphere { ~FixNPTAsphere() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_nve_asphere.cpp b/src/ASPHERE/fix_nve_asphere.cpp index 62bb1db172..cd70cce871 100644 --- a/src/ASPHERE/fix_nve_asphere.cpp +++ b/src/ASPHERE/fix_nve_asphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/fix_nve_asphere.h b/src/ASPHERE/fix_nve_asphere.h index f3b3e66429..fa7547af4b 100644 --- a/src/ASPHERE/fix_nve_asphere.h +++ b/src/ASPHERE/fix_nve_asphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/asphere,FixNVEAsphere) - +// clang-format off +FixStyle(nve/asphere,FixNVEAsphere); +// clang-format on #else #ifndef LMP_FIX_NVE_ASPHERE_H @@ -36,7 +36,7 @@ class FixNVEAsphere : public FixNVE { class AtomVecEllipsoid *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_nve_asphere_noforce.cpp b/src/ASPHERE/fix_nve_asphere_noforce.cpp index af4cd1312c..7a489989f1 100644 --- a/src/ASPHERE/fix_nve_asphere_noforce.cpp +++ b/src/ASPHERE/fix_nve_asphere_noforce.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/fix_nve_asphere_noforce.h b/src/ASPHERE/fix_nve_asphere_noforce.h index eb65a928c8..90b84a79d6 100644 --- a/src/ASPHERE/fix_nve_asphere_noforce.h +++ b/src/ASPHERE/fix_nve_asphere_noforce.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/asphere/noforce,FixNVEAsphereNoforce) - +// clang-format off +FixStyle(nve/asphere/noforce,FixNVEAsphereNoforce); +// clang-format on #else #ifndef LMP_FIX_NVE_ASPHERE_NOFORCE_H @@ -35,7 +35,7 @@ class FixNVEAsphereNoforce : public FixNVENoforce { class AtomVecEllipsoid *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_nve_line.cpp b/src/ASPHERE/fix_nve_line.cpp index 6b2e87b828..da64444b4f 100644 --- a/src/ASPHERE/fix_nve_line.cpp +++ b/src/ASPHERE/fix_nve_line.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/fix_nve_line.h b/src/ASPHERE/fix_nve_line.h index aa1711bbe7..c706072a18 100644 --- a/src/ASPHERE/fix_nve_line.h +++ b/src/ASPHERE/fix_nve_line.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/line,FixNVELine) - +// clang-format off +FixStyle(nve/line,FixNVELine); +// clang-format on #else #ifndef LMP_FIX_NVE_LINE_H @@ -34,11 +34,11 @@ class FixNVELine : public FixNVE { void final_integrate(); private: - double MINUSPI,TWOPI; + double MINUSPI, TWOPI; class AtomVecLine *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_nve_tri.cpp b/src/ASPHERE/fix_nve_tri.cpp index 53532af020..72287a1807 100644 --- a/src/ASPHERE/fix_nve_tri.cpp +++ b/src/ASPHERE/fix_nve_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/fix_nve_tri.h b/src/ASPHERE/fix_nve_tri.h index b7f07755b5..1fc11c5d7e 100644 --- a/src/ASPHERE/fix_nve_tri.h +++ b/src/ASPHERE/fix_nve_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/tri,FixNVETri) - +// clang-format off +FixStyle(nve/tri,FixNVETri); +// clang-format on #else #ifndef LMP_FIX_NVE_TRI_H @@ -38,7 +38,7 @@ class FixNVETri : public FixNVE { class AtomVecTri *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_nvt_asphere.cpp b/src/ASPHERE/fix_nvt_asphere.cpp index ef6d97ec99..dc98d97dcf 100644 --- a/src/ASPHERE/fix_nvt_asphere.cpp +++ b/src/ASPHERE/fix_nvt_asphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/fix_nvt_asphere.h b/src/ASPHERE/fix_nvt_asphere.h index cd03b3ff63..24b070ba78 100644 --- a/src/ASPHERE/fix_nvt_asphere.h +++ b/src/ASPHERE/fix_nvt_asphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/asphere,FixNVTAsphere) - +// clang-format off +FixStyle(nvt/asphere,FixNVTAsphere); +// clang-format on #else #ifndef LMP_FIX_NVT_ASPHERE_H @@ -30,7 +30,7 @@ class FixNVTAsphere : public FixNHAsphere { ~FixNVTAsphere() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp index dc1fdbed7d..08af6ee3c9 100644 --- a/src/ASPHERE/pair_gayberne.cpp +++ b/src/ASPHERE/pair_gayberne.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/pair_gayberne.h b/src/ASPHERE/pair_gayberne.h index 8e07156ce0..59ee1a0f97 100644 --- a/src/ASPHERE/pair_gayberne.h +++ b/src/ASPHERE/pair_gayberne.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gayberne,PairGayBerne) - +// clang-format off +PairStyle(gayberne,PairGayBerne); +// clang-format on #else #ifndef LMP_PAIR_GAYBERNE_H @@ -41,38 +41,35 @@ class PairGayBerne : public Pair { void write_data_all(FILE *); protected: - enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE}; + enum { SPHERE_SPHERE, SPHERE_ELLIPSE, ELLIPSE_SPHERE, ELLIPSE_ELLIPSE }; double cut_global; double **cut; - double gamma,upsilon,mu; // Gay-Berne parameters - double **shape1; // per-type radii in x, y and z - double **shape2; // per-type radii in x, y and z SQUARED - double *lshape; // precalculation based on the shape - double **well; // well depth scaling along each axis ^ -1.0/mu - double **epsilon,**sigma; // epsilon and sigma values for atom-type pairs + double gamma, upsilon, mu; // Gay-Berne parameters + double **shape1; // per-type radii in x, y and z + double **shape2; // per-type radii in x, y and z SQUARED + double *lshape; // precalculation based on the shape + double **well; // well depth scaling along each axis ^ -1.0/mu + double **epsilon, **sigma; // epsilon and sigma values for atom-type pairs int **form; - double **lj1,**lj2,**lj3,**lj4; + double **lj1, **lj2, **lj3, **lj4; double **offset; int *setwell; class AtomVecEllipsoid *avec; void allocate(); - double gayberne_analytic(const int i, const int j, double a1[3][3], - double a2[3][3], double b1[3][3], double b2[3][3], - double g1[3][3], double g2[3][3], double *r12, - const double rsq, double *fforce, double *ttor, + double gayberne_analytic(const int i, const int j, double a1[3][3], double a2[3][3], + double b1[3][3], double b2[3][3], double g1[3][3], double g2[3][3], + double *r12, const double rsq, double *fforce, double *ttor, double *rtor); - double gayberne_lj(const int i, const int j, double a1[3][3], - double b1[3][3],double g1[3][3],double *r12, - const double rsq, double *fforce, double *ttor); - void compute_eta_torque(double m[3][3], double m2[3][3], - double *s, double ans[3][3]); + double gayberne_lj(const int i, const int j, double a1[3][3], double b1[3][3], double g1[3][3], + double *r12, const double rsq, double *fforce, double *ttor); + void compute_eta_torque(double m[3][3], double m2[3][3], double *s, double ans[3][3]); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/pair_line_lj.cpp b/src/ASPHERE/pair_line_lj.cpp index 876ee88141..c8a3e04dca 100644 --- a/src/ASPHERE/pair_line_lj.cpp +++ b/src/ASPHERE/pair_line_lj.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/pair_line_lj.h b/src/ASPHERE/pair_line_lj.h index 05e5a92cb1..ac345ba3e4 100644 --- a/src/ASPHERE/pair_line_lj.h +++ b/src/ASPHERE/pair_line_lj.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(line/lj,PairLineLJ) - +// clang-format off +PairStyle(line/lj,PairLineLJ); +// clang-format on #else #ifndef LMP_PAIR_LINE_LJ_H @@ -37,28 +37,28 @@ class PairLineLJ : public Pair { protected: double cut_global; double *subsize; - double **epsilon,**sigma,**cutsub,**cutsubsq; + double **epsilon, **sigma, **cutsub, **cutsubsq; double **cut; - double **lj1,**lj2,**lj3,**lj4; // for sphere/sphere interactions + double **lj1, **lj2, **lj3, **lj4; // for sphere/sphere interactions class AtomVecLine *avec; - double *size; // per-type size of sub-particles to tile line segment + double *size; // per-type size of sub-particles to tile line segment struct Discrete { - double dx,dy; + double dx, dy; }; - Discrete *discrete; // list of all discretes for all lines - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + Discrete *discrete; // list of all discretes for all lines + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors void allocate(); void discretize(int, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/pair_resquared.cpp b/src/ASPHERE/pair_resquared.cpp index 870b446601..5c0602a453 100644 --- a/src/ASPHERE/pair_resquared.cpp +++ b/src/ASPHERE/pair_resquared.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/pair_resquared.h b/src/ASPHERE/pair_resquared.h index 073c8b840a..b548311ed5 100644 --- a/src/ASPHERE/pair_resquared.h +++ b/src/ASPHERE/pair_resquared.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(resquared,PairRESquared) - +// clang-format off +PairStyle(resquared,PairRESquared); +// clang-format on #else #ifndef LMP_PAIR_RESQUARED_H @@ -39,19 +39,19 @@ class PairRESquared : public Pair { void read_restart_settings(FILE *); protected: - enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE}; + enum { SPHERE_SPHERE, SPHERE_ELLIPSE, ELLIPSE_SPHERE, ELLIPSE_ELLIPSE }; double cut_global; double **cut; - double **shape1; // per-type radii in x, y and z - double **shape2; // per-type radii in x, y and z SQUARED - double *lshape; // product of the radii - double **well; // well depth scaling along each axis - double **epsilon,**sigma; // epsilon and sigma values for atom-type pairs + double **shape1; // per-type radii in x, y and z + double **shape2; // per-type radii in x, y and z SQUARED + double *lshape; // product of the radii + double **well; // well depth scaling along each axis + double **epsilon, **sigma; // epsilon and sigma values for atom-type pairs int **form; - double **lj1,**lj2,**lj3,**lj4; + double **lj1, **lj2, **lj3, **lj4; double **offset; int *setwell; class AtomVecEllipsoid *avec; @@ -61,38 +61,35 @@ class PairRESquared : public Pair { struct RE2Vars { // per particle precomputations for energy, force, torque - double A[3][3]; // Rotation matrix (lab->body) - double aTe[3][3]; // A'*E - double gamma[3][3]; // A'*S^2*A + double A[3][3]; // Rotation matrix (lab->body) + double aTe[3][3]; // A'*E + double gamma[3][3]; // A'*S^2*A // per particle precomputations for torque - double sa[3][3]; // S^2*A; - double lA[3][3][3]; // -A*rotation generator (x,y, or z) - double lAtwo[3][3][3]; // A'*S^2*lA - double lAsa[3][3][3]; // lAtwo+lA'*sa + double sa[3][3]; // S^2*A; + double lA[3][3][3]; // -A*rotation generator (x,y, or z) + double lAtwo[3][3][3]; // A'*S^2*lA + double lAsa[3][3][3]; // lAtwo+lA'*sa }; void allocate(); - void precompute_i(const int i,RE2Vars &ws); + void precompute_i(const int i, RE2Vars &ws); double det_prime(const double m[3][3], const double m2[3][3]); - double resquared_analytic(const int i, const int j, - const RE2Vars &wi, const RE2Vars &wj, - const double *r, const double rsq, - double *fforce, double *ttor, + double resquared_analytic(const int i, const int j, const RE2Vars &wi, const RE2Vars &wj, + const double *r, const double rsq, double *fforce, double *ttor, double *rtor); - double resquared_lj(const int i, const int j, const RE2Vars &wi, - const double *r, const double rsq, double *fforce, - double *ttor, bool calc_torque); + double resquared_lj(const int i, const int j, const RE2Vars &wi, const double *r, + const double rsq, double *fforce, double *ttor, bool calc_torque); - double cr60; // 60^1/3 - double b_alpha; // 45/56 - double solv_f_a; // 3.0/(4.0*PI*-36) - double solv_f_r; // 3.0/(4.0*PI*2025) + double cr60; // 60^1/3 + double b_alpha; // 45/56 + double solv_f_a; // 3.0/(4.0*PI*-36) + double solv_f_r; // 3.0/(4.0*PI*2025) }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/pair_tri_lj.cpp b/src/ASPHERE/pair_tri_lj.cpp index 6e3abb6387..8585b5792b 100644 --- a/src/ASPHERE/pair_tri_lj.cpp +++ b/src/ASPHERE/pair_tri_lj.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ASPHERE/pair_tri_lj.h b/src/ASPHERE/pair_tri_lj.h index a92e0e1f89..beda914f4a 100644 --- a/src/ASPHERE/pair_tri_lj.h +++ b/src/ASPHERE/pair_tri_lj.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tri/lj,PairTriLJ) - +// clang-format off +PairStyle(tri/lj,PairTriLJ); +// clang-format on #else #ifndef LMP_PAIR_TRI_LJ_H @@ -37,26 +37,26 @@ class PairTriLJ : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; class AtomVecTri *avec; struct Discrete { - double dx,dy,dz; + double dx, dy, dz; double sigma; }; - Discrete *discrete; // list of all discretes for all lines - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + Discrete *discrete; // list of all discretes for all lines + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors void allocate(); void discretize(int, double, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/body_nparticle.cpp b/src/BODY/body_nparticle.cpp index cd1ad51b0d..ccd0c55619 100644 --- a/src/BODY/body_nparticle.cpp +++ b/src/BODY/body_nparticle.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/body_nparticle.h b/src/BODY/body_nparticle.h index 0853dfb341..0c4c590673 100644 --- a/src/BODY/body_nparticle.h +++ b/src/BODY/body_nparticle.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,16 +12,16 @@ ------------------------------------------------------------------------- */ #ifdef BODY_CLASS - -BodyStyle(nparticle,BodyNparticle) - +// clang-format off +BodyStyle(nparticle,BodyNparticle); +// clang-format on #else #ifndef LMP_BODY_NPARTICLE_H #define LMP_BODY_NPARTICLE_H -#include "body.h" #include "atom_vec_body.h" +#include "body.h" namespace LAMMPS_NS { @@ -49,7 +49,7 @@ class BodyNparticle : public Body { double **imdata; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/body_rounded_polygon.cpp b/src/BODY/body_rounded_polygon.cpp index bf72aec10f..88cf03e76b 100644 --- a/src/BODY/body_rounded_polygon.cpp +++ b/src/BODY/body_rounded_polygon.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/body_rounded_polygon.h b/src/BODY/body_rounded_polygon.h index 3bd5925069..b76a0afaff 100644 --- a/src/BODY/body_rounded_polygon.h +++ b/src/BODY/body_rounded_polygon.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,16 +12,16 @@ ------------------------------------------------------------------------- */ #ifdef BODY_CLASS - -BodyStyle(rounded/polygon,BodyRoundedPolygon) - +// clang-format off +BodyStyle(rounded/polygon,BodyRoundedPolygon); +// clang-format on #else #ifndef LMP_BODY_ROUNDED_POLYGON_H #define LMP_BODY_ROUNDED_POLYGON_H -#include "body.h" #include "atom_vec_body.h" +#include "body.h" namespace LAMMPS_NS { @@ -53,7 +53,7 @@ class BodyRoundedPolygon : public Body { double **imdata; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/body_rounded_polyhedron.cpp b/src/BODY/body_rounded_polyhedron.cpp index 1d07c1362c..aa71b89529 100644 --- a/src/BODY/body_rounded_polyhedron.cpp +++ b/src/BODY/body_rounded_polyhedron.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/body_rounded_polyhedron.h b/src/BODY/body_rounded_polyhedron.h index ef4508180c..47c0943299 100644 --- a/src/BODY/body_rounded_polyhedron.h +++ b/src/BODY/body_rounded_polyhedron.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,16 +12,16 @@ ------------------------------------------------------------------------- */ #ifdef BODY_CLASS - -BodyStyle(rounded/polyhedron,BodyRoundedPolyhedron) - +// clang-format off +BodyStyle(rounded/polyhedron,BodyRoundedPolyhedron); +// clang-format on #else #ifndef LMP_BODY_ROUNDED_POLYHEDRON_H #define LMP_BODY_ROUNDED_POLYHEDRON_H -#include "body.h" #include "atom_vec_body.h" +#include "body.h" namespace LAMMPS_NS { @@ -55,7 +55,7 @@ class BodyRoundedPolyhedron : public Body { double **imdata; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/compute_body_local.cpp b/src/BODY/compute_body_local.cpp index e393566b2f..d8837fa1ea 100644 --- a/src/BODY/compute_body_local.cpp +++ b/src/BODY/compute_body_local.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/compute_body_local.h b/src/BODY/compute_body_local.h index ddbaf3b797..b0016aebaf 100644 --- a/src/BODY/compute_body_local.h +++ b/src/BODY/compute_body_local.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(body/local,ComputeBodyLocal) - +// clang-format off +ComputeStyle(body/local,ComputeBodyLocal); +// clang-format on #else #ifndef LMP_COMPUTE_BODY_LOCAL_H @@ -34,7 +34,7 @@ class ComputeBodyLocal : public Compute { private: int nvalues; - int *which,*index; + int *which, *index; int nmax; @@ -45,7 +45,7 @@ class ComputeBodyLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/compute_temp_body.cpp b/src/BODY/compute_temp_body.cpp index fb16723b23..d8dfc0d279 100644 --- a/src/BODY/compute_temp_body.cpp +++ b/src/BODY/compute_temp_body.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/compute_temp_body.h b/src/BODY/compute_temp_body.h index 1b272eefa7..19115ad209 100644 --- a/src/BODY/compute_temp_body.h +++ b/src/BODY/compute_temp_body.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/body,ComputeTempBody) - +// clang-format off +ComputeStyle(temp/body,ComputeTempBody); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_BODY_H @@ -40,13 +40,13 @@ class ComputeTempBody : public Compute { int mode; double tfactor; char *id_bias; - class Compute *tbias; // ptr to additional bias compute + class Compute *tbias; // ptr to additional bias compute class AtomVecBody *avec; void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/fix_nh_body.cpp b/src/BODY/fix_nh_body.cpp index e63e276060..e9339400cc 100644 --- a/src/BODY/fix_nh_body.cpp +++ b/src/BODY/fix_nh_body.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/fix_nh_body.h b/src/BODY/fix_nh_body.h index 8a80dd4148..f5fb545e05 100644 --- a/src/BODY/fix_nh_body.h +++ b/src/BODY/fix_nh_body.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -33,7 +33,7 @@ class FixNHBody : public FixNH { void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/BODY/fix_nph_body.cpp b/src/BODY/fix_nph_body.cpp index ca3923d278..31964df496 100644 --- a/src/BODY/fix_nph_body.cpp +++ b/src/BODY/fix_nph_body.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/fix_nph_body.h b/src/BODY/fix_nph_body.h index 6dcbb470ad..da59bd93e2 100644 --- a/src/BODY/fix_nph_body.h +++ b/src/BODY/fix_nph_body.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nph/body,FixNPHBody) - +// clang-format off +FixStyle(nph/body,FixNPHBody); +// clang-format on #else #ifndef LMP_FIX_NPH_BODY_H @@ -30,7 +30,7 @@ class FixNPHBody : public FixNHBody { ~FixNPHBody() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/fix_npt_body.cpp b/src/BODY/fix_npt_body.cpp index 3aacfe7f65..97e06d6166 100644 --- a/src/BODY/fix_npt_body.cpp +++ b/src/BODY/fix_npt_body.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/fix_npt_body.h b/src/BODY/fix_npt_body.h index cd4eaff073..e5d6b44da6 100644 --- a/src/BODY/fix_npt_body.h +++ b/src/BODY/fix_npt_body.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt/body,FixNPTBody) - +// clang-format off +FixStyle(npt/body,FixNPTBody); +// clang-format on #else #ifndef LMP_FIX_NPT_BODY_H @@ -30,7 +30,7 @@ class FixNPTBody : public FixNHBody { ~FixNPTBody() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/fix_nve_body.cpp b/src/BODY/fix_nve_body.cpp index 68dccfac2c..c00356f037 100644 --- a/src/BODY/fix_nve_body.cpp +++ b/src/BODY/fix_nve_body.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/fix_nve_body.h b/src/BODY/fix_nve_body.h index efb48df2ea..504a86e0d0 100644 --- a/src/BODY/fix_nve_body.h +++ b/src/BODY/fix_nve_body.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/body,FixNVEBody) - +// clang-format off +FixStyle(nve/body,FixNVEBody); +// clang-format on #else #ifndef LMP_FIX_NVE_BODY_H @@ -36,7 +36,7 @@ class FixNVEBody : public FixNVE { class AtomVecBody *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/fix_nvt_body.cpp b/src/BODY/fix_nvt_body.cpp index 6209e1db2f..a0d269da8c 100644 --- a/src/BODY/fix_nvt_body.cpp +++ b/src/BODY/fix_nvt_body.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/fix_nvt_body.h b/src/BODY/fix_nvt_body.h index df27086222..e5fef9d30d 100644 --- a/src/BODY/fix_nvt_body.h +++ b/src/BODY/fix_nvt_body.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/body,FixNVTBody) - +// clang-format off +FixStyle(nvt/body,FixNVTBody); +// clang-format on #else #ifndef LMP_FIX_NVT_BODY_H @@ -30,7 +30,7 @@ class FixNVTBody : public FixNHBody { ~FixNVTBody() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index 0b50b985da..ec506b15f0 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/fix_wall_body_polygon.h b/src/BODY/fix_wall_body_polygon.h index e1b900bd7b..7da2655c9c 100644 --- a/src/BODY/fix_wall_body_polygon.h +++ b/src/BODY/fix_wall_body_polygon.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/body/polygon,FixWallBodyPolygon) - +// clang-format off +FixStyle(wall/body/polygon,FixWallBodyPolygon); +// clang-format on #else #ifndef LMP_FIX_WALL_BODY_POLYGON_H @@ -35,66 +35,61 @@ class FixWallBodyPolygon : public Fix { void reset_dt(); struct Contact { - int ibody, jbody; // body (i.e. atom) indices (not tags) - int vertex; // vertex of the first polygon - int edge; // edge of the second polygon - double xv[3]; // coordinates of the vertex - double xe[3]; // coordinates of the projection of the vertex on the edge - double separation;// separation at contact + int ibody, jbody; // body (i.e. atom) indices (not tags) + int vertex; // vertex of the first polygon + int edge; // edge of the second polygon + double xv[3]; // coordinates of the vertex + double xe[3]; // coordinates of the projection of the vertex on the edge + double separation; // separation at contact }; protected: - int wallstyle,pairstyle,wiggle,axis; - double kn; // normal repulsion strength - double c_n; // normal damping coefficient - double c_t; // tangential damping coefficient - double lo,hi,cylradius; - double amplitude,period,omega; + int wallstyle, pairstyle, wiggle, axis; + double kn; // normal repulsion strength + double c_n; // normal damping coefficient + double c_t; // tangential damping coefficient + double lo, hi, cylradius; + double amplitude, period, omega; double dt; int time_origin; class AtomVecBody *avec; class BodyRoundedPolygon *bptr; - double **discrete; // list of all sub-particles for all bodies - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + double **discrete; // list of all sub-particles for all bodies + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors - double **edge; // list of all edge for all bodies - int nedge; // number of edge in list - int edmax; // allocated size of edge list - int *ednum; // number of edges per line, 0 if uninit - int *edfirst; // index of first edge per each line - int ednummax; // allocated size of ednum,edfirst vectors + double **edge; // list of all edge for all bodies + int nedge; // number of edge in list + int edmax; // allocated size of edge list + int *ednum; // number of edges per line, 0 if uninit + int *edfirst; // index of first edge per each line + int ednummax; // allocated size of ednum,edfirst vectors - double *enclosing_radius; // enclosing radii for all bodies - double *rounded_radius; // rounded radii for all bodies + double *enclosing_radius; // enclosing radii for all bodies + double *rounded_radius; // rounded radii for all bodies void body2space(int); - int vertex_against_wall(int ibody, double wall_pos, double** x, - double** f, double** torque, int side, - Contact* contact_list, int &num_contacts, - double* facc); - - int compute_distance_to_wall(double* x0, double rradi, double wall_pos, - int side, double &d, double hi[3], int &contact); - double contact_separation(const Contact& c1, const Contact& c2); - void contact_forces(Contact& contact, double j_a, double** x, - double** v, double** angmom, double** f, double** torque, - double* vwall, double* facc); - void sum_torque(double* xm, double *x, double fx, - double fy, double fz, double* torque); - void total_velocity(double* p, double *xcm, double* vcm, double *angmom, - double *inertia, double *quat, double* vi); - void distance(const double* x2, const double* x1, double& r); + int vertex_against_wall(int ibody, double wall_pos, double **x, double **f, double **torque, + int side, Contact *contact_list, int &num_contacts, double *facc); + int compute_distance_to_wall(double *x0, double rradi, double wall_pos, int side, double &d, + double hi[3], int &contact); + double contact_separation(const Contact &c1, const Contact &c2); + void contact_forces(Contact &contact, double j_a, double **x, double **v, double **angmom, + double **f, double **torque, double *vwall, double *facc); + void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque); + void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia, + double *quat, double *vi); + void distance(const double *x2, const double *x1, double &r); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index 2958a715ac..522860b469 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/fix_wall_body_polyhedron.h b/src/BODY/fix_wall_body_polyhedron.h index e3e7c64669..54c290b255 100644 --- a/src/BODY/fix_wall_body_polyhedron.h +++ b/src/BODY/fix_wall_body_polyhedron.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/body/polyhedron,FixWallBodyPolyhedron) - +// clang-format off +FixStyle(wall/body/polyhedron,FixWallBodyPolyhedron); +// clang-format on #else #ifndef LMP_FIX_WALL_BODY_POLYHERON_H @@ -35,78 +35,72 @@ class FixWallBodyPolyhedron : public Fix { void reset_dt(); struct Contact { - int ibody, jbody; // body (i.e. atom) indices (not tags) - int vertex; // vertex of the first polygon - int edge; // edge of the second polygon - double xv[3]; // coordinates of the vertex - double xe[3]; // coordinates of the projection of the vertex on the edge - double separation;// separation at contact + int ibody, jbody; // body (i.e. atom) indices (not tags) + int vertex; // vertex of the first polygon + int edge; // edge of the second polygon + double xv[3]; // coordinates of the vertex + double xe[3]; // coordinates of the projection of the vertex on the edge + double separation; // separation at contact }; protected: - int wallstyle,pairstyle,wiggle,axis; - double kn,c_n,c_t; - double lo,hi,cylradius; - double amplitude,period,omega; + int wallstyle, pairstyle, wiggle, axis; + double kn, c_n, c_t; + double lo, hi, cylradius; + double amplitude, period, omega; double dt; int time_origin; class AtomVecBody *avec; class BodyRoundedPolyhedron *bptr; - double **discrete; // list of all sub-particles for all bodies - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + double **discrete; // list of all sub-particles for all bodies + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors - double **edge; // list of all edge for all bodies - int nedge; // number of edge in list - int edmax; // allocated size of edge list - int *ednum; // number of edges per line, 0 if uninit - int *edfirst; // index of first edge per each line - int ednummax; // allocated size of ednum,edfirst vectors + double **edge; // list of all edge for all bodies + int nedge; // number of edge in list + int edmax; // allocated size of edge list + int *ednum; // number of edges per line, 0 if uninit + int *edfirst; // index of first edge per each line + int ednummax; // allocated size of ednum,edfirst vectors - double **face; // list of all edge for all bodies - int nface; // number of faces in list - int facmax; // allocated size of face list - int *facnum; // number of faces per line, 0 if uninit - int *facfirst; // index of first face per each line - int facnummax; // allocated size of facnum,facfirst vectors + double **face; // list of all edge for all bodies + int nface; // number of faces in list + int facmax; // allocated size of face list + int *facnum; // number of faces per line, 0 if uninit + int *facfirst; // index of first face per each line + int facnummax; // allocated size of facnum,facfirst vectors - double *enclosing_radius; // enclosing radii for all bodies - double *rounded_radius; // rounded radii for all bodies + double *enclosing_radius; // enclosing radii for all bodies + double *rounded_radius; // rounded radii for all bodies void body2space(int); - int edge_against_wall(int ibody, double wall_pos, int side, double* vwall, - double** x, double** f, double** torque, Contact* contact_list, - int &num_contacts, double* facc); - int sphere_against_wall(int i, double wall_pos, int side, double* vwall, - double** x, double** v, double** f, double** angmom, double** torque); + int edge_against_wall(int ibody, double wall_pos, int side, double *vwall, double **x, double **f, + double **torque, Contact *contact_list, int &num_contacts, double *facc); + int sphere_against_wall(int i, double wall_pos, int side, double *vwall, double **x, double **v, + double **f, double **angmom, double **torque); - int compute_distance_to_wall(int ibody, int edge_index, double *xmi, - double rounded_radius_i, double wall_pos, int side, - double* vwall, int &contact); - double contact_separation(const Contact& c1, const Contact& c2); - void contact_forces(int ibody, double j_a, double *xi, double *xj, - double delx, double dely, double delz, - double fx, double fy, double fz, double** x, double** v, - double** angmom, double** f, double** torque, double* vwall); - - void contact_forces(Contact& contact, double j_a, double** x, - double** v, double** angmom, double** f, double** torque, - double* vwall, double* facc); - void sum_torque(double* xm, double *x, double fx, - double fy, double fz, double* torque); - void total_velocity(double* p, double *xcm, double* vcm, double *angmom, - double *inertia, double *quat, double* vi); - void distance(const double* x2, const double* x1, double& r); + int compute_distance_to_wall(int ibody, int edge_index, double *xmi, double rounded_radius_i, + double wall_pos, int side, double *vwall, int &contact); + double contact_separation(const Contact &c1, const Contact &c2); + void contact_forces(int ibody, double j_a, double *xi, double *xj, double delx, double dely, + double delz, double fx, double fy, double fz, double **x, double **v, + double **angmom, double **f, double **torque, double *vwall); + void contact_forces(Contact &contact, double j_a, double **x, double **v, double **angmom, + double **f, double **torque, double *vwall, double *facc); + void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque); + void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia, + double *quat, double *vi); + void distance(const double *x2, const double *x1, double &r); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/pair_body_nparticle.cpp b/src/BODY/pair_body_nparticle.cpp index 68321f3b70..8c7c671cb8 100644 --- a/src/BODY/pair_body_nparticle.cpp +++ b/src/BODY/pair_body_nparticle.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/pair_body_nparticle.h b/src/BODY/pair_body_nparticle.h index d396291df2..dad44a38e3 100644 --- a/src/BODY/pair_body_nparticle.h +++ b/src/BODY/pair_body_nparticle.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(body/nparticle,PairBodyNparticle) - +// clang-format off +PairStyle(body/nparticle,PairBodyNparticle); +// clang-format on #else #ifndef LMP_PAIR_BODY_NPARTICLE_H @@ -37,24 +37,24 @@ class PairBodyNparticle : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; class AtomVecBody *avec; class BodyNparticle *bptr; - double **discrete; // list of all sub-particles for all bodies - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + double **discrete; // list of all sub-particles for all bodies + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors void allocate(); void body2space(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/pair_body_rounded_polygon.cpp b/src/BODY/pair_body_rounded_polygon.cpp index 7185dc2b54..7dc7956586 100644 --- a/src/BODY/pair_body_rounded_polygon.cpp +++ b/src/BODY/pair_body_rounded_polygon.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/pair_body_rounded_polygon.h b/src/BODY/pair_body_rounded_polygon.h index 98eda90a88..b5a9d7969e 100644 --- a/src/BODY/pair_body_rounded_polygon.h +++ b/src/BODY/pair_body_rounded_polygon.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(body/rounded/polygon,PairBodyRoundedPolygon) - +// clang-format off +PairStyle(body/rounded/polygon,PairBodyRoundedPolygon); +// clang-format on #else #ifndef LMP_PAIR_BODY_ROUNDED_POLYGON_H @@ -35,81 +35,76 @@ class PairBodyRoundedPolygon : public Pair { double init_one(int, int); struct Contact { - int ibody, jbody; // body (i.e. atom) indices (not tags) - int vertex; // vertex of the first polygon - int edge; // edge of the second polygon - double xv[3]; // coordinates of the vertex - double xe[3]; // coordinates of the projection of the vertex on the edge - double separation;// separation at contact + int ibody, jbody; // body (i.e. atom) indices (not tags) + int vertex; // vertex of the first polygon + int edge; // edge of the second polygon + double xv[3]; // coordinates of the vertex + double xe[3]; // coordinates of the projection of the vertex on the edge + double separation; // separation at contact }; protected: - double **k_n; // normal repulsion strength - double **k_na; // normal attraction strength - double c_n; // normal damping coefficient - double c_t; // tangential damping coefficient - double mu; // normal friction coefficient during gross sliding - double delta_ua; // contact line (area for 3D models) modification factor - double cut_inner; // cutoff for interaction between vertex-edge surfaces + double **k_n; // normal repulsion strength + double **k_na; // normal attraction strength + double c_n; // normal damping coefficient + double c_t; // tangential damping coefficient + double mu; // normal friction coefficient during gross sliding + double delta_ua; // contact line (area for 3D models) modification factor + double cut_inner; // cutoff for interaction between vertex-edge surfaces class AtomVecBody *avec; class BodyRoundedPolygon *bptr; - double **discrete; // list of all sub-particles for all bodies - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + double **discrete; // list of all sub-particles for all bodies + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors - double **edge; // list of all edge for all bodies - int nedge; // number of edge in list - int edmax; // allocated size of edge list - int *ednum; // number of edges per line, 0 if uninit - int *edfirst; // index of first edge per each line - int ednummax; // allocated size of ednum,edfirst vectors + double **edge; // list of all edge for all bodies + int nedge; // number of edge in list + int edmax; // allocated size of edge list + int *ednum; // number of edges per line, 0 if uninit + int *edfirst; // index of first edge per each line + int ednummax; // allocated size of ednum,edfirst vectors - double *enclosing_radius; // enclosing radii for all bodies - double *rounded_radius; // rounded radii for all bodies - double *maxerad; // per-type maximum enclosing radius + double *enclosing_radius; // enclosing radii for all bodies + double *rounded_radius; // rounded radii for all bodies + double *maxerad; // per-type maximum enclosing radius void allocate(); void body2space(int); // sphere-sphere interaction - void sphere_against_sphere(int i, int j, double delx, double dely, double delz, - double rsq, double k_n, double k_na, - double** x, double** v, double** f, int evflag); + void sphere_against_sphere(int i, int j, double delx, double dely, double delz, double rsq, + double k_n, double k_na, double **x, double **v, double **f, + int evflag); // vertex-edge interaction - int vertex_against_edge(int i, int j, double k_n, double k_na, - double** x, double** f, double** torque, - tagint* tag, Contact* contact_list, - int &num_contacts, double &evdwl, double* facc); + int vertex_against_edge(int i, int j, double k_n, double k_na, double **x, double **f, + double **torque, tagint *tag, Contact *contact_list, int &num_contacts, + double &evdwl, double *facc); // compute distance between a point and an edge from another body - int compute_distance_to_vertex(int ibody, int edge_index, double* xmi, - double rounded_radius, double* x0, - double x0_rounded_radius, double cut_inner, - double &d, double hi[3], double &t, - int &contact); + int compute_distance_to_vertex(int ibody, int edge_index, double *xmi, double rounded_radius, + double *x0, double x0_rounded_radius, double cut_inner, double &d, + double hi[3], double &t, int &contact); // compute contact forces if contact points are detected - void contact_forces(Contact& contact, double j_a, - double** x, double** v, double** angmom, double** f, - double** torque, double &evdwl, double* facc); + void contact_forces(Contact &contact, double j_a, double **x, double **v, double **angmom, + double **f, double **torque, double &evdwl, double *facc); // compute the separation between two contacts - double contact_separation(const Contact& c1, const Contact& c2); + double contact_separation(const Contact &c1, const Contact &c2); // accumulate torque to a body given a force at a given point - void sum_torque(double* xm, double *x, double fx, - double fy, double fz, double* torque); + void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque); // helper functions - int opposite_sides(double* x1, double* x2, double* a, double* b); - void total_velocity(double* p, double *xcm, double* vcm, double *angmom, - double *inertia, double *quat, double* vi); - inline void distance(const double* x2, const double* x1, double& r); + int opposite_sides(double *x1, double *x2, double *a, double *b); + void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia, + double *quat, double *vi); + inline void distance(const double *x2, const double *x1, double &r); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/pair_body_rounded_polyhedron.cpp b/src/BODY/pair_body_rounded_polyhedron.cpp index d9d1350329..65179ecb80 100644 --- a/src/BODY/pair_body_rounded_polyhedron.cpp +++ b/src/BODY/pair_body_rounded_polyhedron.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/BODY/pair_body_rounded_polyhedron.h b/src/BODY/pair_body_rounded_polyhedron.h index 332432e533..4cc225a296 100644 --- a/src/BODY/pair_body_rounded_polyhedron.h +++ b/src/BODY/pair_body_rounded_polyhedron.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(body/rounded/polyhedron,PairBodyRoundedPolyhedron) - +// clang-format off +PairStyle(body/rounded/polyhedron,PairBodyRoundedPolyhedron); +// clang-format on #else #ifndef LMP_PAIR_BODY_ROUNDED_POLYHEDRON_H @@ -34,145 +34,131 @@ class PairBodyRoundedPolyhedron : public Pair { void init_style(); double init_one(int, int); - virtual void kernel_force(double R, int itype, int jtype, - double& energy, double& fpair); + virtual void kernel_force(double R, int itype, int jtype, double &energy, double &fpair); struct Contact { - int ibody, jbody; // body (i.e. atom) indices (not tags) - int type; // 0 = VERTEX-FACE; 1 = EDGE-EDGE - double fx,fy,fz; // unscaled cohesive forces at contact - double xi[3]; // coordinates of the contact point on ibody - double xj[3]; // coordinates of the contact point on jbody - double separation; // contact surface separation + int ibody, jbody; // body (i.e. atom) indices (not tags) + int type; // 0 = VERTEX-FACE; 1 = EDGE-EDGE + double fx, fy, fz; // unscaled cohesive forces at contact + double xi[3]; // coordinates of the contact point on ibody + double xj[3]; // coordinates of the contact point on jbody + double separation; // contact surface separation int unique; }; protected: - double **k_n; // normal repulsion strength - double **k_na; // normal attraction strength - double c_n; // normal damping coefficient - double c_t; // tangential damping coefficient - double mu; // normal friction coefficient during gross sliding - double A_ua; // characteristic contact area - double cut_inner; // cutoff for interaction between vertex-edge surfaces + double **k_n; // normal repulsion strength + double **k_na; // normal attraction strength + double c_n; // normal damping coefficient + double c_t; // tangential damping coefficient + double mu; // normal friction coefficient during gross sliding + double A_ua; // characteristic contact area + double cut_inner; // cutoff for interaction between vertex-edge surfaces class AtomVecBody *avec; class BodyRoundedPolyhedron *bptr; - double **discrete; // list of all sub-particles for all bodies - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + double **discrete; // list of all sub-particles for all bodies + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors - double **edge; // list of all edge for all bodies - int nedge; // number of edge in list - int edmax; // allocated size of edge list - int *ednum; // number of edges per line, 0 if uninit - int *edfirst; // index of first edge per each line - int ednummax; // allocated size of ednum,edfirst vectors + double **edge; // list of all edge for all bodies + int nedge; // number of edge in list + int edmax; // allocated size of edge list + int *ednum; // number of edges per line, 0 if uninit + int *edfirst; // index of first edge per each line + int ednummax; // allocated size of ednum,edfirst vectors - double **face; // list of all edge for all bodies - int nface; // number of faces in list - int facmax; // allocated size of face list - int *facnum; // number of faces per line, 0 if uninit - int *facfirst; // index of first face per each line - int facnummax; // allocated size of facnum,facfirst vectors + double **face; // list of all edge for all bodies + int nface; // number of faces in list + int facmax; // allocated size of face list + int *facnum; // number of faces per line, 0 if uninit + int *facfirst; // index of first face per each line + int facnummax; // allocated size of facnum,facfirst vectors - double *enclosing_radius; // enclosing radii for all bodies - double *rounded_radius; // rounded radii for all bodies - double *maxerad; // per-type maximum enclosing radius + double *enclosing_radius; // enclosing radii for all bodies + double *rounded_radius; // rounded radii for all bodies + double *maxerad; // per-type maximum enclosing radius void allocate(); void body2space(int); // sphere-sphere interaction - void sphere_against_sphere(int ibody, int jbody, int itype, int jtype, - double delx, double dely, double delz, double rsq, - double** v, double** f, int evflag); + void sphere_against_sphere(int ibody, int jbody, int itype, int jtype, double delx, double dely, + double delz, double rsq, double **v, double **f, int evflag); // sphere-edge interaction - void sphere_against_edge(int ibody, int jbody, int itype, int jtype, - double** x, double** v, double** f, double** torque, - double** angmom, int evflag); + void sphere_against_edge(int ibody, int jbody, int itype, int jtype, double **x, double **v, + double **f, double **torque, double **angmom, int evflag); // sphere-face interaction - void sphere_against_face(int ibody, int jbody, int itype, int jtype, - double** x, double** v, double** f, double** torque, - double** angmom, int evflag); + void sphere_against_face(int ibody, int jbody, int itype, int jtype, double **x, double **v, + double **f, double **torque, double **angmom, int evflag); // edge-edge interactions - int edge_against_edge(int ibody, int jbody, int itype, int jtype, - double** x,Contact* contact_list, int &num_contacts, - double &evdwl, double* facc); + int edge_against_edge(int ibody, int jbody, int itype, int jtype, double **x, + Contact *contact_list, int &num_contacts, double &evdwl, double *facc); // edge-face interactions - int edge_against_face(int ibody, int jbody, int itype, int jtype, - double** x, Contact* contact_list, int &num_contacts, - double &evdwl, double* facc); + int edge_against_face(int ibody, int jbody, int itype, int jtype, double **x, + Contact *contact_list, int &num_contacts, double &evdwl, double *facc); // a face vs. a single edge - int interaction_face_to_edge(int ibody, int face_index, double* xmi, - double rounded_radius_i, int jbody, int edge_index, - double* xmj, double rounded_radius_j, - int itype, int jtype, double cut_inner, - Contact* contact_list, int &num_contacts, - double& energy, double* facc); + int interaction_face_to_edge(int ibody, int face_index, double *xmi, double rounded_radius_i, + int jbody, int edge_index, double *xmj, double rounded_radius_j, + int itype, int jtype, double cut_inner, Contact *contact_list, + int &num_contacts, double &energy, double *facc); // an edge vs. an edge from another body - int interaction_edge_to_edge(int ibody, int edge_index_i, double* xmi, - double rounded_radius_i, int jbody, int edge_index_j, - double* xmj, double rounded_radius_j, - int itype, int jtype, double cut_inner, - Contact* contact_list, int &num_contacts, - double& energy, double* facc); + int interaction_edge_to_edge(int ibody, int edge_index_i, double *xmi, double rounded_radius_i, + int jbody, int edge_index_j, double *xmj, double rounded_radius_j, + int itype, int jtype, double cut_inner, Contact *contact_list, + int &num_contacts, double &energy, double *facc); // compute contact forces if contact points are detected - void contact_forces(int ibody, int jbody, double *xi, double *xj, - double delx, double dely, double delz, double fx, double fy, double fz, - double** x, double** v, double** angmom, double** f, double** torque, - double* facc); + void contact_forces(int ibody, int jbody, double *xi, double *xj, double delx, double dely, + double delz, double fx, double fy, double fz, double **x, double **v, + double **angmom, double **f, double **torque, double *facc); // compute force and torque between two bodies given a pair of interacting points - void pair_force_and_torque(int ibody, int jbody, double* pi, double* pj, - double r, double contact_dist, int itype, int jtype, - double** x, double** v, double** f, double** torque, - double** angmom, int jflag, double& energy, double* facc); + void pair_force_and_torque(int ibody, int jbody, double *pi, double *pj, double r, + double contact_dist, int itype, int jtype, double **x, double **v, + double **f, double **torque, double **angmom, int jflag, + double &energy, double *facc); // rescale the cohesive forces if a contact area is detected - void rescale_cohesive_forces(double** x, double** f, double** torque, - Contact* contact_list, int &num_contacts, - int itype, int jtype, double* facc); + void rescale_cohesive_forces(double **x, double **f, double **torque, Contact *contact_list, + int &num_contacts, int itype, int jtype, double *facc); // compute the separation between two contacts - double contact_separation(const Contact& c1, const Contact& c2); + double contact_separation(const Contact &c1, const Contact &c2); // detect the unique contact points (as there may be double counts) - void find_unique_contacts(Contact* contact_list, int& num_contacts); + void find_unique_contacts(Contact *contact_list, int &num_contacts); // accumulate torque to a body given a force at a given point - void sum_torque(double* xm, double *x, double fx, double fy, double fz, double* torque); + void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque); // find the intersection point (if any) between an edge and a face - int edge_face_intersect(double* x1, double* x2, double* x3, double* a, double* b, - double* hi1, double* hi2, double& d1, double& d2, - int& inside_a, int& inside_b); + int edge_face_intersect(double *x1, double *x2, double *x3, double *a, double *b, double *hi1, + double *hi2, double &d1, double &d2, int &inside_a, int &inside_b); // helper functions - int opposite_sides(double* n, double* x0, double* a, double* b); - void project_pt_plane(const double* q, const double* p, - const double* n, double* q_proj, double &d); - void project_pt_plane(const double* q, const double* x1, const double* x2, - const double* x3, double* q_proj, double &d, int& inside); - void project_pt_line(const double* q, const double* xi1, const double* xi2, - double* h, double& d, double& t); - void inside_polygon(int ibody, int face_index, double* xmi, - const double* q1, const double* q2, int& inside1, int& inside2); + int opposite_sides(double *n, double *x0, double *a, double *b); + void project_pt_plane(const double *q, const double *p, const double *n, double *q_proj, + double &d); + void project_pt_plane(const double *q, const double *x1, const double *x2, const double *x3, + double *q_proj, double &d, int &inside); + void project_pt_line(const double *q, const double *xi1, const double *xi2, double *h, double &d, + double &t); + void inside_polygon(int ibody, int face_index, double *xmi, const double *q1, const double *q2, + int &inside1, int &inside2); - void distance_bt_edges(const double* x1, const double* x2, - const double* x3, const double* x4, - double* h1, double* h2, double& t1, double& t2, double& r); - void total_velocity(double* p, double *xcm, double* vcm, double *angmom, - double *inertia, double *quat, double* vi); + void distance_bt_edges(const double *x1, const double *x2, const double *x3, const double *x4, + double *h1, double *h2, double &t1, double &t2, double &r); + void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia, + double *quat, double *vi); void sanity_check(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/angle_class2.cpp b/src/CLASS2/angle_class2.cpp index 65d7511bf0..82e31440f5 100644 --- a/src/CLASS2/angle_class2.cpp +++ b/src/CLASS2/angle_class2.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CLASS2/angle_class2.h b/src/CLASS2/angle_class2.h index cfefe507b7..9af64ac754 100644 --- a/src/CLASS2/angle_class2.h +++ b/src/CLASS2/angle_class2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(class2,AngleClass2) - +// clang-format off +AngleStyle(class2,AngleClass2); +// clang-format on #else #ifndef LMP_ANGLE_CLASS2_H @@ -37,15 +37,15 @@ class AngleClass2 : public Angle { double single(int, int, int, int); protected: - double *theta0,*k2,*k3,*k4; - double *bb_k,*bb_r1,*bb_r2; - double *ba_k1,*ba_k2,*ba_r1,*ba_r2; - int *setflag_a,*setflag_bb,*setflag_ba; + double *theta0, *k2, *k3, *k4; + double *bb_k, *bb_r1, *bb_r2; + double *ba_k1, *ba_k2, *ba_r1, *ba_r2; + int *setflag_a, *setflag_bb, *setflag_ba; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/bond_class2.cpp b/src/CLASS2/bond_class2.cpp index ecebe10fcd..1a4c525ac6 100644 --- a/src/CLASS2/bond_class2.cpp +++ b/src/CLASS2/bond_class2.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CLASS2/bond_class2.h b/src/CLASS2/bond_class2.h index bf15f34cd4..75c1d52c1f 100644 --- a/src/CLASS2/bond_class2.h +++ b/src/CLASS2/bond_class2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(class2,BondClass2) - +// clang-format off +BondStyle(class2,BondClass2); +// clang-format on #else #ifndef LMP_BOND_CLASS2_H @@ -38,12 +38,12 @@ class BondClass2 : public Bond { virtual void *extract(const char *, int &); protected: - double *r0,*k2,*k3,*k4; + double *r0, *k2, *k3, *k4; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/dihedral_class2.cpp b/src/CLASS2/dihedral_class2.cpp index df8e96d5b5..13cfdc7550 100644 --- a/src/CLASS2/dihedral_class2.cpp +++ b/src/CLASS2/dihedral_class2.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CLASS2/dihedral_class2.h b/src/CLASS2/dihedral_class2.h index 4169b4a0f6..4cf71f6a71 100644 --- a/src/CLASS2/dihedral_class2.h +++ b/src/CLASS2/dihedral_class2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(class2,DihedralClass2) - +// clang-format off +DihedralStyle(class2,DihedralClass2); +// clang-format on #else #ifndef LMP_DIHEDRAL_CLASS2_H @@ -35,22 +35,22 @@ class DihedralClass2 : public Dihedral { void write_data(FILE *); protected: - double *k1,*k2,*k3; - double *phi1,*phi2,*phi3; - double *mbt_f1,*mbt_f2,*mbt_f3,*mbt_r0; - double *ebt_f1_1,*ebt_f2_1,*ebt_f3_1,*ebt_r0_1; - double *ebt_f1_2,*ebt_f2_2,*ebt_f3_2,*ebt_r0_2; - double *at_f1_1,*at_f2_1,*at_f3_1,*at_theta0_1; - double *at_f1_2,*at_f2_2,*at_f3_2,*at_theta0_2; - double *aat_k,*aat_theta0_1,*aat_theta0_2; - double *bb13t_k,*bb13t_r10,*bb13t_r30; - int *setflag_d,*setflag_mbt,*setflag_ebt; - int *setflag_at,*setflag_aat,*setflag_bb13t; + double *k1, *k2, *k3; + double *phi1, *phi2, *phi3; + double *mbt_f1, *mbt_f2, *mbt_f3, *mbt_r0; + double *ebt_f1_1, *ebt_f2_1, *ebt_f3_1, *ebt_r0_1; + double *ebt_f1_2, *ebt_f2_2, *ebt_f3_2, *ebt_r0_2; + double *at_f1_1, *at_f2_1, *at_f3_1, *at_theta0_1; + double *at_f1_2, *at_f2_2, *at_f3_2, *at_theta0_2; + double *aat_k, *aat_theta0_1, *aat_theta0_2; + double *bb13t_k, *bb13t_r10, *bb13t_r30; + int *setflag_d, *setflag_mbt, *setflag_ebt; + int *setflag_at, *setflag_aat, *setflag_bb13t; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/improper_class2.cpp b/src/CLASS2/improper_class2.cpp index ac5185e897..f9e4c7bee5 100644 --- a/src/CLASS2/improper_class2.cpp +++ b/src/CLASS2/improper_class2.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CLASS2/improper_class2.h b/src/CLASS2/improper_class2.h index 4fb94f257f..fc845cbf51 100644 --- a/src/CLASS2/improper_class2.h +++ b/src/CLASS2/improper_class2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(class2,ImproperClass2) - +// clang-format off +ImproperStyle(class2,ImproperClass2); +// clang-format on #else #ifndef LMP_IMPROPER_CLASS2_H @@ -35,9 +35,9 @@ class ImproperClass2 : public Improper { void write_data(FILE *); protected: - double *k0,*chi0; - double *aa_k1,*aa_k2,*aa_k3,*aa_theta0_1,*aa_theta0_2,*aa_theta0_3; - int *setflag_i,*setflag_aa; + double *k0, *chi0; + double *aa_k1, *aa_k2, *aa_k3, *aa_theta0_1, *aa_theta0_2, *aa_theta0_3; + int *setflag_i, *setflag_aa; void allocate(); void angleangle(int, int); @@ -45,7 +45,7 @@ class ImproperClass2 : public Improper { double dot(double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp index a0cb122494..84e571436f 100644 --- a/src/CLASS2/pair_lj_class2.cpp +++ b/src/CLASS2/pair_lj_class2.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + 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 diff --git a/src/CLASS2/pair_lj_class2.h b/src/CLASS2/pair_lj_class2.h index a0402373c1..8a2e4e506a 100644 --- a/src/CLASS2/pair_lj_class2.h +++ b/src/CLASS2/pair_lj_class2.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + 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 @@ -10,9 +10,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2,PairLJClass2) - +// clang-format off +PairStyle(lj/class2,PairLJClass2); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_H @@ -47,14 +47,14 @@ class PairLJClass2 : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/pair_lj_class2_coul_cut.cpp b/src/CLASS2/pair_lj_class2_coul_cut.cpp index a767b70e82..c4ac5ae7c8 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.cpp +++ b/src/CLASS2/pair_lj_class2_coul_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CLASS2/pair_lj_class2_coul_cut.h b/src/CLASS2/pair_lj_class2_coul_cut.h index 9fc8b57de7..cfb718c65f 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.h +++ b/src/CLASS2/pair_lj_class2_coul_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/coul/cut,PairLJClass2CoulCut) - +// clang-format off +PairStyle(lj/class2/coul/cut,PairLJClass2CoulCut); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_COUL_CUT_H @@ -43,16 +43,16 @@ class PairLJClass2CoulCut : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index 9bebae15c8..63265509c9 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CLASS2/pair_lj_class2_coul_long.h b/src/CLASS2/pair_lj_class2_coul_long.h index 47e8077afe..f91d3ec54a 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.h +++ b/src/CLASS2/pair_lj_class2_coul_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/coul/long,PairLJClass2CoulLong) - +// clang-format off +PairStyle(lj/class2/coul/long,PairLJClass2CoulLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_COUL_LONG_H @@ -48,17 +48,17 @@ class PairLJClass2CoulLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; double g_ewald; double *cut_respa; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/fix_wall_colloid.cpp b/src/COLLOID/fix_wall_colloid.cpp index ad2cd66f95..b4441d94e4 100644 --- a/src/COLLOID/fix_wall_colloid.cpp +++ b/src/COLLOID/fix_wall_colloid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COLLOID/fix_wall_colloid.h b/src/COLLOID/fix_wall_colloid.h index 92691a95e9..4c287052c0 100644 --- a/src/COLLOID/fix_wall_colloid.h +++ b/src/COLLOID/fix_wall_colloid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/colloid,FixWallColloid) - +// clang-format off +FixStyle(wall/colloid,FixWallColloid); +// clang-format on #else #ifndef LMP_FIX_WALL_COLLOID_H @@ -32,10 +32,10 @@ class FixWallColloid : public FixWall { void wall_particle(int, int, double); private: - double coeff1[6],coeff2[6],coeff3[6],coeff4[6]; + double coeff1[6], coeff2[6], coeff3[6], coeff4[6]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_brownian.cpp b/src/COLLOID/pair_brownian.cpp index cdfb379087..0640ae3e73 100644 --- a/src/COLLOID/pair_brownian.cpp +++ b/src/COLLOID/pair_brownian.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COLLOID/pair_brownian.h b/src/COLLOID/pair_brownian.h index 8d3795c7fa..0e81f808b6 100644 --- a/src/COLLOID/pair_brownian.h +++ b/src/COLLOID/pair_brownian.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(brownian,PairBrownian) - +// clang-format off +PairStyle(brownian,PairBrownian); +// clang-format on #else #ifndef LMP_PAIR_BROWNIAN_H @@ -39,9 +39,9 @@ class PairBrownian : public Pair { void read_restart_settings(FILE *); protected: - double cut_inner_global,cut_global; - double t_target,mu; - int flaglog,flagfld; + double cut_inner_global, cut_global; + double t_target, mu; + int flaglog, flagfld; int flagHI, flagVF; int flagdeform, flagwall; double vol_P; @@ -49,16 +49,16 @@ class PairBrownian : public Pair { class FixWall *wallfix; int seed; - double **cut_inner,**cut; - double R0,RT0; + double **cut_inner, **cut; + double R0, RT0; class RanMars *random; - void set_3_orthogonal_vectors(double*,double*,double*); + void set_3_orthogonal_vectors(double *, double *, double *); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_brownian_poly.cpp b/src/COLLOID/pair_brownian_poly.cpp index 15afd56886..0c3b9f1ed0 100644 --- a/src/COLLOID/pair_brownian_poly.cpp +++ b/src/COLLOID/pair_brownian_poly.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COLLOID/pair_brownian_poly.h b/src/COLLOID/pair_brownian_poly.h index 875ce5b75d..6a9c628e40 100644 --- a/src/COLLOID/pair_brownian_poly.h +++ b/src/COLLOID/pair_brownian_poly.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(brownian/poly,PairBrownianPoly) - +// clang-format off +PairStyle(brownian/poly,PairBrownianPoly); +// clang-format on #else #ifndef LMP_PAIR_BROWNIAN_POLY_H @@ -33,7 +33,7 @@ class PairBrownianPoly : public PairBrownian { void init_style(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_colloid.cpp b/src/COLLOID/pair_colloid.cpp index f71ad922a0..2c9887e8a5 100644 --- a/src/COLLOID/pair_colloid.cpp +++ b/src/COLLOID/pair_colloid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COLLOID/pair_colloid.h b/src/COLLOID/pair_colloid.h index 6b52abe7db..6e570dd1f2 100644 --- a/src/COLLOID/pair_colloid.h +++ b/src/COLLOID/pair_colloid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(colloid,PairColloid) - +// clang-format off +PairStyle(colloid,PairColloid); +// clang-format on #else #ifndef LMP_PAIR_COLLOID_H @@ -41,19 +41,19 @@ class PairColloid : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - enum {SMALL_SMALL,SMALL_LARGE,LARGE_LARGE}; + enum { SMALL_SMALL, SMALL_LARGE, LARGE_LARGE }; double cut_global; double **cut; - double **a12,**d1,**d2,**diameter,**a1,**a2,**offset; - double **sigma,**sigma3,**sigma6; - double **lj1,**lj2,**lj3,**lj4; + double **a12, **d1, **d2, **diameter, **a1, **a2, **offset; + double **sigma, **sigma3, **sigma6; + double **lj1, **lj2, **lj3, **lj4; int **form; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_lubricate.cpp b/src/COLLOID/pair_lubricate.cpp index 64b7aa2e30..a1d2b13ed0 100644 --- a/src/COLLOID/pair_lubricate.cpp +++ b/src/COLLOID/pair_lubricate.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COLLOID/pair_lubricate.h b/src/COLLOID/pair_lubricate.h index 2c66b7e324..4fbc3c77a7 100644 --- a/src/COLLOID/pair_lubricate.h +++ b/src/COLLOID/pair_lubricate.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lubricate,PairLubricate) - +// clang-format off +PairStyle(lubricate,PairLubricate); +// clang-format on #else #ifndef LMP_PAIR_LUBRICATE_H @@ -44,22 +44,22 @@ class PairLubricate : public Pair { void unpack_forward_comm(int, int, double *); protected: - double mu,cut_inner_global,cut_global; + double mu, cut_inner_global, cut_global; double rad; - int flaglog,flagfld,shearing; + int flaglog, flagfld, shearing; int flagdeform, flagwall; double vol_P; class FixWall *wallfix; int flagVF, flagHI; double Ef[3][3]; - double R0,RT0,RS0; - double **cut_inner,**cut; + double R0, RT0, RS0; + double **cut_inner, **cut; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_lubricateU.cpp b/src/COLLOID/pair_lubricateU.cpp index c047ce6a07..f9fa3b4351 100644 --- a/src/COLLOID/pair_lubricateU.cpp +++ b/src/COLLOID/pair_lubricateU.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COLLOID/pair_lubricateU.h b/src/COLLOID/pair_lubricateU.h index f588e21cda..c857b1ccc1 100644 --- a/src/COLLOID/pair_lubricateU.h +++ b/src/COLLOID/pair_lubricateU.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lubricateU,PairLubricateU) - +// clang-format off +PairStyle(lubricateU,PairLubricateU); +// clang-format on #else #ifndef LMP_PAIR_LUBRICATEU_H @@ -41,7 +41,7 @@ class PairLubricateU : public Pair { void unpack_forward_comm(int, int, double *); protected: - double cut_inner_global,cut_global; + double cut_inner_global, cut_global; double mu; double rad; int flaglog; @@ -50,16 +50,16 @@ class PairLubricateU : public Pair { double vol_P; class FixWall *wallfix; - double gdot,Ef[3][3]; - double **cut_inner,**cut; + double gdot, Ef[3][3]; + double **cut_inner, **cut; void allocate(); - double R0,RT0,RS0; + double R0, RT0, RS0; int nmax; - double **fl,**Tl,**xl; + double **fl, **Tl, **xl; int cgmax; - double *bcg,*xcg,*rcg,*rcg1,*pcg,*RU; + double *bcg, *xcg, *rcg, *rcg1, *pcg, *RU; void compute_RE(); virtual void compute_RE(double **); @@ -71,10 +71,10 @@ class PairLubricateU : public Pair { void stage_two(double **); void copy_vec_uo(int, double *, double **, double **); void copy_uo_vec(int, double **, double **, double *); - double dot_vec_vec(int , double *, double *); + double dot_vec_vec(int, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_lubricateU_poly.cpp b/src/COLLOID/pair_lubricateU_poly.cpp index 49c77e9b60..1449c84ae4 100644 --- a/src/COLLOID/pair_lubricateU_poly.cpp +++ b/src/COLLOID/pair_lubricateU_poly.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COLLOID/pair_lubricateU_poly.h b/src/COLLOID/pair_lubricateU_poly.h index 35d5ad082a..af47e731c1 100644 --- a/src/COLLOID/pair_lubricateU_poly.h +++ b/src/COLLOID/pair_lubricateU_poly.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lubricateU/poly,PairLubricateUPoly) - +// clang-format off +PairStyle(lubricateU/poly,PairLubricateUPoly); +// clang-format on #else #ifndef LMP_PAIR_LUBRICATEU_POLY_H @@ -43,7 +43,7 @@ class PairLubricateUPoly : public PairLubricateU { void compute_Fh(double **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_lubricate_poly.cpp b/src/COLLOID/pair_lubricate_poly.cpp index b437bc2bfb..af4a9220d0 100644 --- a/src/COLLOID/pair_lubricate_poly.cpp +++ b/src/COLLOID/pair_lubricate_poly.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COLLOID/pair_lubricate_poly.h b/src/COLLOID/pair_lubricate_poly.h index add7d2e3e3..6fc79a2a3d 100644 --- a/src/COLLOID/pair_lubricate_poly.h +++ b/src/COLLOID/pair_lubricate_poly.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lubricate/poly,PairLubricatePoly) - +// clang-format off +PairStyle(lubricate/poly,PairLubricatePoly); +// clang-format on #else #ifndef LMP_PAIR_LUBRICATE_POLY_H @@ -32,7 +32,7 @@ class PairLubricatePoly : public PairLubricate { void init_style(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_yukawa_colloid.cpp b/src/COLLOID/pair_yukawa_colloid.cpp index 5b1a4e4e83..323390169a 100644 --- a/src/COLLOID/pair_yukawa_colloid.cpp +++ b/src/COLLOID/pair_yukawa_colloid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COLLOID/pair_yukawa_colloid.h b/src/COLLOID/pair_yukawa_colloid.h index 72ee88e7b6..fa0dce0d63 100644 --- a/src/COLLOID/pair_yukawa_colloid.h +++ b/src/COLLOID/pair_yukawa_colloid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(yukawa/colloid,PairYukawaColloid) - +// clang-format off +PairStyle(yukawa/colloid,PairYukawaColloid); +// clang-format on #else #ifndef LMP_PAIR_YUKAWA_COLLOID_H @@ -34,7 +34,7 @@ class PairYukawaColloid : public PairYukawa { double single(int, int, int, int, double, double, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_atom_gz.cpp b/src/COMPRESS/dump_atom_gz.cpp index d4edb07a3a..aab9be34e8 100644 --- a/src/COMPRESS/dump_atom_gz.cpp +++ b/src/COMPRESS/dump_atom_gz.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COMPRESS/dump_atom_gz.h b/src/COMPRESS/dump_atom_gz.h index 7aa42ced5a..777c34345a 100644 --- a/src/COMPRESS/dump_atom_gz.h +++ b/src/COMPRESS/dump_atom_gz.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(atom/gz,DumpAtomGZ) - +// clang-format off +DumpStyle(atom/gz,DumpAtomGZ); +// clang-format on #else #ifndef LMP_DUMP_ATOM_GZ_H @@ -41,7 +41,7 @@ class DumpAtomGZ : public DumpAtom { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_atom_zstd.cpp b/src/COMPRESS/dump_atom_zstd.cpp index 561c784739..bb837fc7ef 100644 --- a/src/COMPRESS/dump_atom_zstd.cpp +++ b/src/COMPRESS/dump_atom_zstd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COMPRESS/dump_atom_zstd.h b/src/COMPRESS/dump_atom_zstd.h index a1ff05f040..4a85089167 100644 --- a/src/COMPRESS/dump_atom_zstd.h +++ b/src/COMPRESS/dump_atom_zstd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,9 +18,9 @@ #ifdef LAMMPS_ZSTD #ifdef DUMP_CLASS - -DumpStyle(atom/zstd,DumpAtomZstd) - +// clang-format off +DumpStyle(atom/zstd,DumpAtomZstd); +// clang-format on #else #ifndef LMP_DUMP_ATOM_ZSTD_H @@ -47,7 +47,7 @@ class DumpAtomZstd : public DumpAtom { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_cfg_gz.cpp b/src/COMPRESS/dump_cfg_gz.cpp index 277db7dd23..37c4fb3536 100644 --- a/src/COMPRESS/dump_cfg_gz.cpp +++ b/src/COMPRESS/dump_cfg_gz.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COMPRESS/dump_cfg_gz.h b/src/COMPRESS/dump_cfg_gz.h index 2294198340..ccd40141eb 100644 --- a/src/COMPRESS/dump_cfg_gz.h +++ b/src/COMPRESS/dump_cfg_gz.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(cfg/gz,DumpCFGGZ) - +// clang-format off +DumpStyle(cfg/gz,DumpCFGGZ); +// clang-format on #else #ifndef LMP_DUMP_CFG_GZ_H @@ -41,7 +41,7 @@ class DumpCFGGZ : public DumpCFG { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_cfg_zstd.cpp b/src/COMPRESS/dump_cfg_zstd.cpp index defee75ee8..eb725491bb 100644 --- a/src/COMPRESS/dump_cfg_zstd.cpp +++ b/src/COMPRESS/dump_cfg_zstd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COMPRESS/dump_cfg_zstd.h b/src/COMPRESS/dump_cfg_zstd.h index 1caf5ce657..ddcb06f00e 100644 --- a/src/COMPRESS/dump_cfg_zstd.h +++ b/src/COMPRESS/dump_cfg_zstd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -17,9 +17,9 @@ #ifdef LAMMPS_ZSTD #ifdef DUMP_CLASS - -DumpStyle(cfg/zstd,DumpCFGZstd) - +// clang-format off +DumpStyle(cfg/zstd,DumpCFGZstd); +// clang-format on #else #ifndef LMP_DUMP_CFG_ZSTD_H @@ -46,7 +46,7 @@ class DumpCFGZstd : public DumpCFG { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_custom_gz.cpp b/src/COMPRESS/dump_custom_gz.cpp index 844cfac1c3..3fa9fb4516 100644 --- a/src/COMPRESS/dump_custom_gz.cpp +++ b/src/COMPRESS/dump_custom_gz.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COMPRESS/dump_custom_gz.h b/src/COMPRESS/dump_custom_gz.h index a8e499891c..10455eb8db 100644 --- a/src/COMPRESS/dump_custom_gz.h +++ b/src/COMPRESS/dump_custom_gz.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(custom/gz,DumpCustomGZ) - +// clang-format off +DumpStyle(custom/gz,DumpCustomGZ); +// clang-format on #else #ifndef LMP_DUMP_CUSTOM_GZ_H @@ -41,7 +41,7 @@ class DumpCustomGZ : public DumpCustom { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_custom_zstd.cpp b/src/COMPRESS/dump_custom_zstd.cpp index d097b29ad1..9580644567 100644 --- a/src/COMPRESS/dump_custom_zstd.cpp +++ b/src/COMPRESS/dump_custom_zstd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COMPRESS/dump_custom_zstd.h b/src/COMPRESS/dump_custom_zstd.h index 679a908192..fb8c7c7543 100644 --- a/src/COMPRESS/dump_custom_zstd.h +++ b/src/COMPRESS/dump_custom_zstd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,9 +18,9 @@ #ifdef LAMMPS_ZSTD #ifdef DUMP_CLASS - -DumpStyle(custom/zstd,DumpCustomZstd) - +// clang-format off +DumpStyle(custom/zstd,DumpCustomZstd); +// clang-format on #else #ifndef LMP_DUMP_CUSTOM_ZSTD_H @@ -48,7 +48,7 @@ class DumpCustomZstd : public DumpCustom { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_local_gz.cpp b/src/COMPRESS/dump_local_gz.cpp index 6af26fd944..4d5faeeb9e 100644 --- a/src/COMPRESS/dump_local_gz.cpp +++ b/src/COMPRESS/dump_local_gz.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COMPRESS/dump_local_gz.h b/src/COMPRESS/dump_local_gz.h index 93b605e0b9..a6b1b118b7 100644 --- a/src/COMPRESS/dump_local_gz.h +++ b/src/COMPRESS/dump_local_gz.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(local/gz,DumpLocalGZ) - +// clang-format off +DumpStyle(local/gz,DumpLocalGZ); +// clang-format on #else #ifndef LMP_DUMP_LOCAL_GZ_H @@ -41,7 +41,7 @@ class DumpLocalGZ : public DumpLocal { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_local_zstd.cpp b/src/COMPRESS/dump_local_zstd.cpp index ec00800e37..4f386a8231 100644 --- a/src/COMPRESS/dump_local_zstd.cpp +++ b/src/COMPRESS/dump_local_zstd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COMPRESS/dump_local_zstd.h b/src/COMPRESS/dump_local_zstd.h index 9d192679ee..c14e58fd71 100644 --- a/src/COMPRESS/dump_local_zstd.h +++ b/src/COMPRESS/dump_local_zstd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,9 +18,9 @@ #ifdef LAMMPS_ZSTD #ifdef DUMP_CLASS - -DumpStyle(local/zstd,DumpLocalZstd) - +// clang-format off +DumpStyle(local/zstd,DumpLocalZstd); +// clang-format on #else #ifndef LMP_DUMP_LOCAL_ZSTD_H @@ -47,7 +47,7 @@ class DumpLocalZstd : public DumpLocal { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_xyz_gz.cpp b/src/COMPRESS/dump_xyz_gz.cpp index 1a51432d83..ac4efebe4b 100644 --- a/src/COMPRESS/dump_xyz_gz.cpp +++ b/src/COMPRESS/dump_xyz_gz.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COMPRESS/dump_xyz_gz.h b/src/COMPRESS/dump_xyz_gz.h index 02903ddb8e..5fe60ced6f 100644 --- a/src/COMPRESS/dump_xyz_gz.h +++ b/src/COMPRESS/dump_xyz_gz.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(xyz/gz,DumpXYZGZ) - +// clang-format off +DumpStyle(xyz/gz,DumpXYZGZ); +// clang-format on #else #ifndef LMP_DUMP_XYZ_GZ_H @@ -41,7 +41,7 @@ class DumpXYZGZ : public DumpXYZ { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_xyz_zstd.cpp b/src/COMPRESS/dump_xyz_zstd.cpp index 8866dcfffb..f1ca6586d4 100644 --- a/src/COMPRESS/dump_xyz_zstd.cpp +++ b/src/COMPRESS/dump_xyz_zstd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COMPRESS/dump_xyz_zstd.h b/src/COMPRESS/dump_xyz_zstd.h index 56204c350b..add279c4e7 100644 --- a/src/COMPRESS/dump_xyz_zstd.h +++ b/src/COMPRESS/dump_xyz_zstd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,9 +18,9 @@ #ifdef LAMMPS_ZSTD #ifdef DUMP_CLASS - -DumpStyle(xyz/zstd,DumpXYZZstd) - +// clang-format off +DumpStyle(xyz/zstd,DumpXYZZstd); +// clang-format on #else #ifndef LMP_DUMP_XYZ_ZSTD_H @@ -47,7 +47,7 @@ class DumpXYZZstd : public DumpXYZ { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/gz_file_writer.cpp b/src/COMPRESS/gz_file_writer.cpp index 36b9161cc1..d56c389d60 100644 --- a/src/COMPRESS/gz_file_writer.cpp +++ b/src/COMPRESS/gz_file_writer.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COMPRESS/gz_file_writer.h b/src/COMPRESS/gz_file_writer.h index 669931399b..48ad0f42a8 100644 --- a/src/COMPRESS/gz_file_writer.h +++ b/src/COMPRESS/gz_file_writer.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -29,18 +29,18 @@ namespace LAMMPS_NS { class GzFileWriter : public FileWriter { int compression_level; - gzFile gzFp; // file pointer for the compressed output stream -public: - GzFileWriter(); - virtual ~GzFileWriter(); - virtual void open(const std::string &path, bool append = false) override; - virtual void close() override; - virtual void flush() override; - virtual size_t write(const void * buffer, size_t length) override; - virtual bool isopen() const override; + gzFile gzFp; // file pointer for the compressed output stream + public: + GzFileWriter(); + virtual ~GzFileWriter(); + virtual void open(const std::string &path, bool append = false) override; + virtual void close() override; + virtual void flush() override; + virtual size_t write(const void *buffer, size_t length) override; + virtual bool isopen() const override; - void setCompressionLevel(int level); + void setCompressionLevel(int level); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/COMPRESS/zstd_file_writer.cpp b/src/COMPRESS/zstd_file_writer.cpp index 3356fc1ad5..609a78b216 100644 --- a/src/COMPRESS/zstd_file_writer.cpp +++ b/src/COMPRESS/zstd_file_writer.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/COMPRESS/zstd_file_writer.h b/src/COMPRESS/zstd_file_writer.h index 030a01690a..9161e3f902 100644 --- a/src/COMPRESS/zstd_file_writer.h +++ b/src/COMPRESS/zstd_file_writer.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -31,23 +31,24 @@ class ZstdFileWriter : public FileWriter { int compression_level; int checksum_flag; - ZSTD_CCtx * cctx; - FILE * fp; - char * out_buffer; + ZSTD_CCtx *cctx; + FILE *fp; + char *out_buffer; size_t out_buffer_size; -public: - ZstdFileWriter(); - virtual ~ZstdFileWriter(); - virtual void open(const std::string &path, bool append = false) override; - virtual void close() override; - virtual void flush() override; - virtual size_t write(const void * buffer, size_t length) override; - virtual bool isopen() const override; - void setCompressionLevel(int level); - void setChecksum(bool enabled); + public: + ZstdFileWriter(); + virtual ~ZstdFileWriter(); + virtual void open(const std::string &path, bool append = false) override; + virtual void close() override; + virtual void flush() override; + virtual size_t write(const void *buffer, size_t length) override; + virtual bool isopen() const override; + + void setCompressionLevel(int level); + void setChecksum(bool enabled); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/compute_temp_cs.cpp b/src/CORESHELL/compute_temp_cs.cpp index 4bf74a3b7e..ed6634f4b0 100644 --- a/src/CORESHELL/compute_temp_cs.cpp +++ b/src/CORESHELL/compute_temp_cs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CORESHELL/compute_temp_cs.h b/src/CORESHELL/compute_temp_cs.h index c05d96415b..70c681a264 100644 --- a/src/CORESHELL/compute_temp_cs.h +++ b/src/CORESHELL/compute_temp_cs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/cs,ComputeTempCS) - +// clang-format off +ComputeStyle(temp/cs,ComputeTempCS); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_CS_H @@ -44,11 +44,11 @@ class ComputeTempCS : public Compute { void unpack_reverse_comm(int, int *, double *); private: - int groupbit_c,groupbit_s; + int groupbit_c, groupbit_s; int nshells; int firstflag; int maxatom; - int cgroup,sgroup; + int cgroup, sgroup; double tfactor; double **vint; @@ -60,7 +60,7 @@ class ComputeTempCS : public Compute { void vcm_pairs(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_born_coul_dsf_cs.cpp b/src/CORESHELL/pair_born_coul_dsf_cs.cpp index b311276724..42df5d4fb5 100644 --- a/src/CORESHELL/pair_born_coul_dsf_cs.cpp +++ b/src/CORESHELL/pair_born_coul_dsf_cs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CORESHELL/pair_born_coul_dsf_cs.h b/src/CORESHELL/pair_born_coul_dsf_cs.h index a3bd036fc6..ac9cf2676b 100644 --- a/src/CORESHELL/pair_born_coul_dsf_cs.h +++ b/src/CORESHELL/pair_born_coul_dsf_cs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/dsf/cs,PairBornCoulDSFCS) - +// clang-format off +PairStyle(born/coul/dsf/cs,PairBornCoulDSFCS); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_DSF_CS_H @@ -30,7 +30,7 @@ class PairBornCoulDSFCS : public PairBornCoulDSF { virtual void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_born_coul_long_cs.cpp b/src/CORESHELL/pair_born_coul_long_cs.cpp index 8d98cef09d..2a89241e5f 100644 --- a/src/CORESHELL/pair_born_coul_long_cs.cpp +++ b/src/CORESHELL/pair_born_coul_long_cs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CORESHELL/pair_born_coul_long_cs.h b/src/CORESHELL/pair_born_coul_long_cs.h index fdf50e0d88..c015a56641 100644 --- a/src/CORESHELL/pair_born_coul_long_cs.h +++ b/src/CORESHELL/pair_born_coul_long_cs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/long/cs,PairBornCoulLongCS) - +// clang-format off +PairStyle(born/coul/long/cs,PairBornCoulLongCS); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_LONG_CS_H @@ -30,7 +30,7 @@ class PairBornCoulLongCS : public PairBornCoulLong { virtual void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_born_coul_wolf_cs.cpp b/src/CORESHELL/pair_born_coul_wolf_cs.cpp index 38a972d0ff..237c167552 100644 --- a/src/CORESHELL/pair_born_coul_wolf_cs.cpp +++ b/src/CORESHELL/pair_born_coul_wolf_cs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CORESHELL/pair_born_coul_wolf_cs.h b/src/CORESHELL/pair_born_coul_wolf_cs.h index a6e2625942..70b1c5a261 100644 --- a/src/CORESHELL/pair_born_coul_wolf_cs.h +++ b/src/CORESHELL/pair_born_coul_wolf_cs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/wolf/cs,PairBornCoulWolfCS) - +// clang-format off +PairStyle(born/coul/wolf/cs,PairBornCoulWolfCS); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_WOLF_CS_H @@ -30,7 +30,7 @@ class PairBornCoulWolfCS : public PairBornCoulWolf { virtual void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_buck_coul_long_cs.cpp b/src/CORESHELL/pair_buck_coul_long_cs.cpp index f40c807510..44a2f37ae8 100644 --- a/src/CORESHELL/pair_buck_coul_long_cs.cpp +++ b/src/CORESHELL/pair_buck_coul_long_cs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CORESHELL/pair_buck_coul_long_cs.h b/src/CORESHELL/pair_buck_coul_long_cs.h index bdca1fe5a8..12dfe12dc6 100644 --- a/src/CORESHELL/pair_buck_coul_long_cs.h +++ b/src/CORESHELL/pair_buck_coul_long_cs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/coul/long/cs,PairBuckCoulLongCS) - +// clang-format off +PairStyle(buck/coul/long/cs,PairBuckCoulLongCS); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_LONG_CS_H @@ -30,7 +30,7 @@ class PairBuckCoulLongCS : public PairBuckCoulLong { virtual void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_coul_long_cs.cpp b/src/CORESHELL/pair_coul_long_cs.cpp index d6917cbb78..9e2b87b659 100644 --- a/src/CORESHELL/pair_coul_long_cs.cpp +++ b/src/CORESHELL/pair_coul_long_cs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CORESHELL/pair_coul_long_cs.h b/src/CORESHELL/pair_coul_long_cs.h index 377c025000..9b0780d247 100644 --- a/src/CORESHELL/pair_coul_long_cs.h +++ b/src/CORESHELL/pair_coul_long_cs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/long/cs,PairCoulLongCS) - +// clang-format off +PairStyle(coul/long/cs,PairCoulLongCS); +// clang-format on #else #ifndef LMP_PAIR_COUL_LONG_CS_H @@ -30,7 +30,7 @@ class PairCoulLongCS : public PairCoulLong { virtual void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_coul_wolf_cs.cpp b/src/CORESHELL/pair_coul_wolf_cs.cpp index 0cf19ac331..6f83b66ed8 100644 --- a/src/CORESHELL/pair_coul_wolf_cs.cpp +++ b/src/CORESHELL/pair_coul_wolf_cs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CORESHELL/pair_coul_wolf_cs.h b/src/CORESHELL/pair_coul_wolf_cs.h index b6369d4091..811287548a 100644 --- a/src/CORESHELL/pair_coul_wolf_cs.h +++ b/src/CORESHELL/pair_coul_wolf_cs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/wolf/cs,PairCoulWolfCS) - +// clang-format off +PairStyle(coul/wolf/cs,PairCoulWolfCS); +// clang-format on #else #ifndef LMP_PAIR_COUL_WOLF_CS_H_ @@ -26,11 +26,11 @@ namespace LAMMPS_NS { class PairCoulWolfCS : public PairCoulWolf { public: - PairCoulWolfCS( class LAMMPS *); - virtual void compute( int, int); + PairCoulWolfCS(class LAMMPS *); + virtual void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif /* LMP_PAIR_COUL_WOLF_CS_H_ */ diff --git a/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp b/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp index 3db604c328..266b91d5e3 100644 --- a/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp +++ b/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CORESHELL/pair_lj_class2_coul_long_cs.h b/src/CORESHELL/pair_lj_class2_coul_long_cs.h index 50833881ec..c08cdb9700 100644 --- a/src/CORESHELL/pair_lj_class2_coul_long_cs.h +++ b/src/CORESHELL/pair_lj_class2_coul_long_cs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/coul/long/cs,PairLJClass2CoulLongCS) - +// clang-format off +PairStyle(lj/class2/coul/long/cs,PairLJClass2CoulLongCS); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_COUL_LONG_CS_H @@ -34,7 +34,7 @@ class PairLJClass2CoulLongCS : public PairLJClass2CoulLong { void compute_outer(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp b/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp index fe2d30e1ac..52a37f7fa0 100644 --- a/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp +++ b/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/CORESHELL/pair_lj_cut_coul_long_cs.h b/src/CORESHELL/pair_lj_cut_coul_long_cs.h index e9fbc151d0..47cf2316da 100644 --- a/src/CORESHELL/pair_lj_cut_coul_long_cs.h +++ b/src/CORESHELL/pair_lj_cut_coul_long_cs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/long/cs,PairLJCutCoulLongCS) - +// clang-format off +PairStyle(lj/cut/coul/long/cs,PairLJCutCoulLongCS); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_LONG_CS_H @@ -34,7 +34,7 @@ class PairLJCutCoulLongCS : public PairLJCutCoulLong { virtual void compute_outer(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/DEPEND/.clang-format b/src/DEPEND/.clang-format new file mode 100644 index 0000000000..f5574832df --- /dev/null +++ b/src/DEPEND/.clang-format @@ -0,0 +1,31 @@ +--- +BasedOnStyle: LLVM +AccessModifierOffset: -1 +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: false +AllowShortBlocksOnASingleLine: true +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: WithoutElse +AllowShortLambdasOnASingleLine: None +AllowShortLoopsOnASingleLine: true +BraceWrapping: + AfterFunction: true +BreakBeforeBraces: Custom +BreakConstructorInitializers: AfterColon +BreakInheritanceList: AfterColon +ColumnLimit: 80 +IndentCaseLabels: true +IndentWidth: 4 +NamespaceIndentation: Inner +ObjCBlockIndentWidth: 2 +PenaltyBreakAssignment: 4 +ReflowComments: false +SpaceAfterCStyleCast: false +SpacesBeforeTrailingComments: 4 +SpacesInContainerLiterals: false +Standard: Cpp11 +TabWidth: 2 +UseTab: Never +... diff --git a/src/DEPEND/fastdep.c b/src/DEPEND/fastdep.c index 3a6d3a0173..e235ef98cf 100644 --- a/src/DEPEND/fastdep.c +++ b/src/DEPEND/fastdep.c @@ -28,16 +28,16 @@ */ #include -#include #include -#include +#include #include +#include const char version[] = "2.1"; /* store list of accepted extensions for object targets */ -static const char *extensions[] = { ".cpp", ".c", ".cu" }; -static const int numextensions = sizeof(extensions)/sizeof(const char *); +static const char *extensions[] = {".cpp", ".c", ".cu"}; +static const int numextensions = sizeof(extensions) / sizeof(const char *); /* strdup() is not part of ANSI C. provide a replacement for portability */ static char *my_strdup(const char *src) @@ -47,8 +47,8 @@ static char *my_strdup(const char *src) if (src == NULL) return NULL; len = strlen(src); - ptr = (char *)malloc(len+1); - if (ptr) memcpy(ptr,src,len+1); + ptr = (char *)malloc(len + 1); + if (ptr) memcpy(ptr, src, len + 1); return ptr; } @@ -60,8 +60,7 @@ static char *my_strdup(const char *src) char *trim_path(char *path) { int last = strlen(path) - 1; - while ((path[last] == '/') || (path[last] == '\\')) - --last; + while ((path[last] == '/') || (path[last] == '\\')) --last; path[++last] = '\0'; return path; } @@ -73,13 +72,13 @@ int file_exists(const char *path) struct _stat s; if (path == NULL) return 0; - if (_stat(path,&s) != 0) return 0; + if (_stat(path, &s) != 0) return 0; return 1; #else struct stat s; if (path == NULL) return 0; - if (stat(path,&s) != 0) return 0; + if (stat(path, &s) != 0) return 0; return 1; #endif } @@ -87,14 +86,14 @@ int file_exists(const char *path) /* simple integer square root */ static int isqrt(int n) { - int b = 0; + int b = 0; - while(n >= 0) { - n = n - b; - b = b + 1; - n = n - b; - } - return b - 1; + while (n >= 0) { + n = n - b; + b = b + 1; + n = n - b; + } + return b - 1; } /* determine next available prime number */ @@ -105,10 +104,10 @@ static int next_prime(const int num) /* nprime has to be larger than num and odd */ nprime = num + (num & 1) + 1; /* there is always a prime between n and 2n */ - while (nprime < 2*num) { + while (nprime < 2 * num) { /* brute force division test on odd factors up to sqrt(nprime) */ - root = isqrt(nprime)+1; - for (factor = 3; factor < root; factor +=2) { + root = isqrt(nprime) + 1; + for (factor = 3; factor < root; factor += 2) { if (nprime % factor == 0) break; } /* if the loop didn't exit early, we have found a prime */ @@ -216,7 +215,7 @@ static void llist_append(llist_t *ll, const char *key) if ((ll == NULL) || (key == NULL)) return; ll->tail->key = my_strdup(key); - ll->count ++; + ll->count++; tmp = (llnode_t *)malloc(sizeof(llnode_t)); tmp->key = NULL; tmp->next = NULL; @@ -237,19 +236,18 @@ static void llist_print(llist_t *ll) tmp = ll->head; if (tmp->next) { - fputs(tmp->key,stdout); + fputs(tmp->key, stdout); tmp = tmp->next; } while (tmp->next) { - fputc(':',stdout); - fputs(tmp->key,stdout); + fputc(':', stdout); + fputs(tmp->key, stdout); tmp = tmp->next; } - fputc('\n',stdout); + fputc('\n', stdout); } - /************************************************************************ * set functions ************************************************************************/ @@ -260,8 +258,8 @@ static set_t *set_init(int num) set_t *s = (set_t *)malloc(sizeof(set_t)); s->nbuckets = next_prime(num); - s->buckets = malloc(s->nbuckets*sizeof(llnode_t)); - memset(s->buckets,0,s->nbuckets*sizeof(llnode_t)); + s->buckets = malloc(s->nbuckets * sizeof(llnode_t)); + memset(s->buckets, 0, s->nbuckets * sizeof(llnode_t)); s->count = 0; return s; @@ -299,10 +297,10 @@ static void set_add(set_t *s, const char *key) idx = hash_func(key) % s->nbuckets; tmp = s->buckets + idx; while (tmp->next != NULL) { - if (strcmp(tmp->key,key) == 0) return; + if (strcmp(tmp->key, key) == 0) return; tmp = tmp->next; } - s->count ++; + s->count++; tmp->key = my_strdup(key); tmp->next = (llnode_t *)malloc(sizeof(llnode_t)); tmp = tmp->next; @@ -321,7 +319,7 @@ static int set_find(set_t *s, const char *key) idx = hash_func(key) % s->nbuckets; tmp = s->buckets + idx; while (tmp->next != NULL) { - if (strcmp(tmp->key,key) == 0) return 1; + if (strcmp(tmp->key, key) == 0) return 1; tmp = tmp->next; } return 0; @@ -344,8 +342,8 @@ static map_t *map_init(int num) if (!m) return NULL; m->nbuckets = next_prime(num); - m->buckets = malloc(m->nbuckets*sizeof(mapnode_t)); - memset(m->buckets,0,m->nbuckets*sizeof(mapnode_t)); + m->buckets = malloc(m->nbuckets * sizeof(mapnode_t)); + memset(m->buckets, 0, m->nbuckets * sizeof(mapnode_t)); m->count = 0; return m; @@ -385,13 +383,13 @@ static void map_add(map_t *m, const char *key, const char *val) idx = hash_func(key) % m->nbuckets; tmp = m->buckets + idx; while (tmp->next != NULL) { - if (strcmp(tmp->key,key) == 0) break; + if (strcmp(tmp->key, key) == 0) break; tmp = tmp->next; } /* add new entry to map */ if (tmp->next == NULL) { - m->count ++; + m->count++; tmp->key = my_strdup(key); tmp->val = set_init(50); /* XXX: chosen arbitrarily */ tmp->next = (mapnode_t *)malloc(sizeof(mapnode_t)); @@ -399,7 +397,7 @@ static void map_add(map_t *m, const char *key, const char *val) tmp->next->val = NULL; tmp->next->next = NULL; } - set_add(tmp->val,val); + set_add(tmp->val, val); } /* return an entry in the map */ @@ -413,7 +411,7 @@ static set_t *map_find(map_t *m, const char *key) idx = hash_func(key) % m->nbuckets; tmp = m->buckets + idx; while (tmp->next != NULL) { - if (strcmp(tmp->key,key) == 0) return tmp->val; + if (strcmp(tmp->key, key) == 0) return tmp->val; tmp = tmp->next; } return NULL; @@ -459,11 +457,11 @@ static void make_path(const char *file, llist_t *paths, char *buffer) /************************************************************************/ static void find_includes(llnode_t *head, llist_t *todo, llist_t *paths, - set_t *incl, map_t *deps) + set_t *incl, map_t *deps) { FILE *fp; llnode_t *tmp; - char *buffer,*full,*ptr,*end; + char *buffer, *full, *ptr, *end; const char *file; buffer = (char *)malloc(4096); @@ -472,16 +470,16 @@ static void find_includes(llnode_t *head, llist_t *todo, llist_t *paths, tmp = head; while (tmp->next != NULL) { file = tmp->key; - fp = fopen(file,"r"); + fp = fopen(file, "r"); if (fp == NULL) { perror("Cannot read source"); - fprintf(stderr,"For file: %s\n",file); + fprintf(stderr, "For file: %s\n", file); exit(EXIT_FAILURE); } /* read file line by line and look for #include "..." */ while (!feof(fp) && !ferror(fp)) { - if (fgets(buffer,4096,fp) == NULL) continue; + if (fgets(buffer, 4096, fp) == NULL) continue; ptr = buffer; while (*ptr == ' ' || *ptr == '\t') ++ptr; if (*ptr != '#') continue; @@ -500,7 +498,7 @@ static void find_includes(llnode_t *head, llist_t *todo, llist_t *paths, end = ptr; while (*end != '"') { if (*end == '\0') { - fprintf(stderr,"Unmatched '\"': %s\n",buffer); + fprintf(stderr, "Unmatched '\"': %s\n", buffer); exit(EXIT_FAILURE); } ++end; @@ -508,18 +506,18 @@ static void find_includes(llnode_t *head, llist_t *todo, llist_t *paths, *end = '\0'; /* get full path to include file */ - make_path(ptr,paths,full); + make_path(ptr, paths, full); /* skip, if not found or unreadable. */ if (full[0] == '\0') continue; /* if this is a yet unknown include, add to the * todo list, if append is enabled */ - if (set_find(incl,full) == 0) { - set_add(incl,full); - llist_append(todo,full); + if (set_find(incl, full) == 0) { + set_add(incl, full); + llist_append(todo, full); } - map_add(deps,file,full); + map_add(deps, file, full); } fclose(fp); tmp = tmp->next; @@ -534,26 +532,25 @@ static void add_depend(const char *source, set_t *incl, map_t *deps) { set_t *mydeps; llnode_t *tmp; - int i,num; + int i, num; if (source == NULL) return; - mydeps = map_find(deps,source); + mydeps = map_find(deps, source); if (mydeps != NULL) { num = mydeps->nbuckets; for (i = 0; i < num; ++i) { tmp = mydeps->buckets + i; while (tmp->next != NULL) { - if (set_find(incl,tmp->key) == 0) { - set_add(incl,tmp->key); - add_depend(tmp->key,incl,deps); + if (set_find(incl, tmp->key) == 0) { + set_add(incl, tmp->key); + add_depend(tmp->key, incl, deps); } tmp = tmp->next; } } } - } /************************************************************************/ @@ -564,23 +561,23 @@ static void do_depend(llnode_t *head, map_t *deps) set_t *incl; const char *source; char *target, *ptr; - int i,num,ext; + int i, num, ext; tmp = head; while (tmp->next != NULL) { source = tmp->key; - target = strrchr(source,'/'); + target = strrchr(source, '/'); if (target == NULL) { target = my_strdup(source); } else { - target = my_strdup(target+1); + target = my_strdup(target + 1); } ext = 0; - ptr = strrchr(target,'.'); + ptr = strrchr(target, '.'); if (ptr != NULL) { for (i = 0; i < numextensions; ++i) { - if (strcmp(ptr,extensions[i]) == 0) ++ext; + if (strcmp(ptr, extensions[i]) == 0) ++ext; } if (ext > 0) { ptr[1] = 'o'; @@ -589,23 +586,23 @@ static void do_depend(llnode_t *head, map_t *deps) } if (ext > 0) { - fputs(target,stdout); - fputs(" : ",stdout); - fputs(source,stdout); + fputs(target, stdout); + fputs(" : ", stdout); + fputs(source, stdout); incl = set_init(50); - add_depend(source,incl,deps); + add_depend(source, incl, deps); num = incl->nbuckets; for (i = 0; i < num; ++i) { lnk = incl->buckets + i; while (lnk->next != NULL) { - fputc(' ',stdout); - fputs(lnk->key,stdout); + fputc(' ', stdout); + fputs(lnk->key, stdout); lnk = lnk->next; } } - fputc('\n',stdout); + fputc('\n', stdout); set_free(incl); } @@ -614,74 +611,71 @@ static void do_depend(llnode_t *head, map_t *deps) } } - - /************************************************************************/ int main(int argc, char **argv) { - llist_t *paths,*src,*todo; + llist_t *paths, *src, *todo; set_t *incl; map_t *deps; if (argc < 2) { - fprintf(stderr,"FastDep v%s for LAMMPS\n" + fprintf(stderr, + "FastDep v%s for LAMMPS\n" "Usage: %s [-I ...] -- [ ...]\n", - version,argv[0]); - fprintf(stderr,"Supported extensions: %d, %s, %s\n",numextensions, + version, argv[0]); + fprintf(stderr, "Supported extensions: %d, %s, %s\n", numextensions, extensions[0], extensions[1]); return 1; } /* hash tables for all known included files and dependencies * we guesstimate a little over 2x as many entries as sources. */ - incl = set_init(2*argc); - deps = map_init(2*argc); + incl = set_init(2 * argc); + deps = map_init(2 * argc); /* list of include search paths. prefixed by "." and "..". */ paths = llist_init(); - llist_append(paths,"."); - llist_append(paths,".."); + llist_append(paths, "."); + llist_append(paths, ".."); while (++argv, --argc > 0) { if (strncmp(*argv, "-I", 2) == 0) { if ((*argv)[2] != '\0') { - llist_append(paths,trim_path(*argv+2)); + llist_append(paths, trim_path(*argv + 2)); } else { ++argv; --argc; if (argc > 0) { - if (strcmp(*argv,"--") == 0) { + if (strcmp(*argv, "--") == 0) { break; } else { - llist_append(paths,trim_path(*argv)); + llist_append(paths, trim_path(*argv)); } } } - } else if (strcmp(*argv,"--") == 0) { + } else if (strcmp(*argv, "--") == 0) { break; } /* ignore all unrecognized arguments before '--'. */ } src = llist_init(); - while (++argv, --argc > 0) { - llist_append(src,*argv); - } + while (++argv, --argc > 0) { llist_append(src, *argv); } /* process files to look for includes */ todo = llist_init(); - find_includes(src->head,todo,paths,incl,deps); - find_includes(todo->head,todo,paths,incl,deps); + find_includes(src->head, todo, paths, incl, deps); + find_includes(todo->head, todo, paths, incl, deps); llist_free(todo); - fprintf(stdout,"# FastDep v%s for LAMMPS\n",version); - fputs("# Search path: ",stdout); + fprintf(stdout, "# FastDep v%s for LAMMPS\n", version); + fputs("# Search path: ", stdout); llist_print(paths); - fprintf(stdout,"# % 5d sources\n# % 5d includes\n# % 5d depfiles\n", - llist_size(src),set_size(incl),map_size(deps)); + fprintf(stdout, "# % 5d sources\n# % 5d includes\n# % 5d depfiles\n", + llist_size(src), set_size(incl), map_size(deps)); set_free(incl); - do_depend(src->head,deps); + do_depend(src->head, deps); llist_free(src); llist_free(paths); diff --git a/src/DIPOLE/atom_vec_dipole.cpp b/src/DIPOLE/atom_vec_dipole.cpp index d4eb345537..a38e1d6d01 100644 --- a/src/DIPOLE/atom_vec_dipole.cpp +++ b/src/DIPOLE/atom_vec_dipole.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/DIPOLE/atom_vec_dipole.h b/src/DIPOLE/atom_vec_dipole.h index 5239b8c13b..d47e39beb5 100644 --- a/src/DIPOLE/atom_vec_dipole.h +++ b/src/DIPOLE/atom_vec_dipole.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(dipole,AtomVecDipole) - +// clang-format off +AtomStyle(dipole,AtomVecDipole); +// clang-format on #else #ifndef LMP_ATOM_VEC_DIPOLE_H @@ -35,7 +35,7 @@ class AtomVecDipole : public AtomVec { double **mu; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/DIPOLE/pair_lj_cut_dipole_cut.cpp b/src/DIPOLE/pair_lj_cut_dipole_cut.cpp index d19c1d22b3..e4b9e592eb 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_cut.cpp +++ b/src/DIPOLE/pair_lj_cut_dipole_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/DIPOLE/pair_lj_cut_dipole_cut.h b/src/DIPOLE/pair_lj_cut_dipole_cut.h index 70e898f3eb..11bc49f358 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_cut.h +++ b/src/DIPOLE/pair_lj_cut_dipole_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/dipole/cut,PairLJCutDipoleCut) - +// clang-format off +PairStyle(lj/cut/dipole/cut,PairLJCutDipoleCut); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_DIPOLE_CUT_H @@ -39,16 +39,16 @@ class PairLJCutDipoleCut : public Pair { void read_restart_settings(FILE *); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/DIPOLE/pair_lj_cut_dipole_long.cpp b/src/DIPOLE/pair_lj_cut_dipole_long.cpp index 09f319f553..e286568f31 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_long.cpp +++ b/src/DIPOLE/pair_lj_cut_dipole_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/DIPOLE/pair_lj_cut_dipole_long.h b/src/DIPOLE/pair_lj_cut_dipole_long.h index 9997aa05fb..26ff54f73e 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_long.h +++ b/src/DIPOLE/pair_lj_cut_dipole_long.h @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/dipole/long,PairLJCutDipoleLong) - +// clang-format off +PairStyle(lj/cut/dipole/long,PairLJCutDipoleLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_DIPOLE_LONG_H @@ -43,10 +43,10 @@ class PairLJCutDipoleLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; + double **cut_lj, **cut_ljsq; double cut_coulsq; double **epsilon; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **lj1, **lj2, **lj3, **lj4, **offset; double g_ewald; int ewald_order; virtual void *extract(const char *, int &); @@ -54,7 +54,7 @@ class PairLJCutDipoleLong : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/DIPOLE/pair_lj_long_dipole_long.cpp b/src/DIPOLE/pair_lj_long_dipole_long.cpp index 38a0ac1db5..8530cc3e95 100644 --- a/src/DIPOLE/pair_lj_long_dipole_long.cpp +++ b/src/DIPOLE/pair_lj_long_dipole_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/DIPOLE/pair_lj_long_dipole_long.h b/src/DIPOLE/pair_lj_long_dipole_long.h index 012b2b546e..3669834cc7 100644 --- a/src/DIPOLE/pair_lj_long_dipole_long.h +++ b/src/DIPOLE/pair_lj_long_dipole_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/long/dipole/long,PairLJLongDipoleLong) - +// clang-format off +PairStyle(lj/long/dipole/long,PairLJLongDipoleLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_LONG_DIPOLE_LONG_H @@ -56,7 +56,7 @@ class PairLJLongDipoleLong : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index 66a3e85941..71ab3f4cb4 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/fix_gpu.h b/src/GPU/fix_gpu.h index 594a9fc144..4e344c85c7 100644 --- a/src/GPU/fix_gpu.h +++ b/src/GPU/fix_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(GPU,FixGPU) - +// clang-format off +FixStyle(GPU,FixGPU); +// clang-format on #else #ifndef LMP_FIX_GPU_H @@ -37,8 +37,8 @@ class FixGPU : public Fix { void post_force_respa(int, int, int); double memory_usage(); - double binsize(const double subx, const double suby, - const double subz, const int nlocal, const double cut); + double binsize(const double subx, const double suby, const double subz, const int nlocal, + const double cut); private: int _gpu_mode; @@ -47,7 +47,7 @@ class FixGPU : public Fix { double _binsize; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/fix_nh_gpu.cpp b/src/GPU/fix_nh_gpu.cpp index c41099c6d2..82d1717597 100644 --- a/src/GPU/fix_nh_gpu.cpp +++ b/src/GPU/fix_nh_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/fix_nh_gpu.h b/src/GPU/fix_nh_gpu.h index 6c764b7687..7a08b0382c 100644 --- a/src/GPU/fix_nh_gpu.h +++ b/src/GPU/fix_nh_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -42,7 +42,7 @@ class FixNHGPU : public FixNH { virtual void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/GPU/fix_npt_gpu.cpp b/src/GPU/fix_npt_gpu.cpp index ce601548d4..94907678e8 100644 --- a/src/GPU/fix_npt_gpu.cpp +++ b/src/GPU/fix_npt_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/fix_npt_gpu.h b/src/GPU/fix_npt_gpu.h index 1b9f7066ac..d771acdd01 100644 --- a/src/GPU/fix_npt_gpu.h +++ b/src/GPU/fix_npt_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt/gpu,FixNPTGPU) - +// clang-format off +FixStyle(npt/gpu,FixNPTGPU); +// clang-format on #else #ifndef LMP_FIX_NPT_GPU_H @@ -34,7 +34,7 @@ class FixNPTGPU : public FixNHGPU { ~FixNPTGPU() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/fix_nve_asphere_gpu.cpp b/src/GPU/fix_nve_asphere_gpu.cpp index bf6cfda67d..1323e8b054 100644 --- a/src/GPU/fix_nve_asphere_gpu.cpp +++ b/src/GPU/fix_nve_asphere_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/fix_nve_asphere_gpu.h b/src/GPU/fix_nve_asphere_gpu.h index 55b412c851..d3fd0fb05a 100644 --- a/src/GPU/fix_nve_asphere_gpu.h +++ b/src/GPU/fix_nve_asphere_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/asphere/gpu,FixNVEAsphereGPU) - +// clang-format off +FixStyle(nve/asphere/gpu,FixNVEAsphereGPU); +// clang-format on #else #ifndef LMP_FIX_NVE_ASPHERE_GPU_H @@ -46,7 +46,7 @@ class FixNVEAsphereGPU : public FixNVE { class AtomVecEllipsoid *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/fix_nve_gpu.cpp b/src/GPU/fix_nve_gpu.cpp index 9c6705deac..49edae58a6 100644 --- a/src/GPU/fix_nve_gpu.cpp +++ b/src/GPU/fix_nve_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/fix_nve_gpu.h b/src/GPU/fix_nve_gpu.h index 671e3a1376..adeaeeff50 100644 --- a/src/GPU/fix_nve_gpu.h +++ b/src/GPU/fix_nve_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/gpu,FixNVEGPU) - +// clang-format off +FixStyle(nve/gpu,FixNVEGPU); +// clang-format on #else #ifndef LMP_FIX_NVE_GPU_H @@ -44,7 +44,7 @@ class FixNVEGPU : public FixNVE { int _nlocal_max, _respa_on; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/fix_nvt_gpu.cpp b/src/GPU/fix_nvt_gpu.cpp index 191039e343..7c8336333a 100644 --- a/src/GPU/fix_nvt_gpu.cpp +++ b/src/GPU/fix_nvt_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/fix_nvt_gpu.h b/src/GPU/fix_nvt_gpu.h index 2623f92197..af0ab1de86 100644 --- a/src/GPU/fix_nvt_gpu.h +++ b/src/GPU/fix_nvt_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/gpu,FixNVTGPU) - +// clang-format off +FixStyle(nvt/gpu,FixNVTGPU); +// clang-format on #else #ifndef LMP_FIX_NVT_GPU_H @@ -34,7 +34,7 @@ class FixNVTGPU : public FixNHGPU { ~FixNVTGPU() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/gpu_extra.h b/src/GPU/gpu_extra.h index 81d2a6a511..bd55d11021 100644 --- a/src/GPU/gpu_extra.h +++ b/src/GPU/gpu_extra.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,90 +18,79 @@ #ifndef LMP_GPU_EXTRA_H #define LMP_GPU_EXTRA_H -#include "modify.h" #include "error.h" +#include "modify.h" // ---------------------- OPENMP PREPROCESSOR STUFF ------------------ #if defined(_OPENMP) - #if !defined(LAL_USE_OMP) - #define LAL_USE_OMP 1 - #endif +#if !defined(LAL_USE_OMP) +#define LAL_USE_OMP 1 +#endif - #if !defined(LAL_USE_OMP_SIMD) - #if (_OPENMP >= 201307) - #define LAL_USE_OMP_SIMD 1 - #else - #define LAL_USE_OMP_SIMD 0 - #endif - #endif +#if !defined(LAL_USE_OMP_SIMD) +#if (_OPENMP >= 201307) +#define LAL_USE_OMP_SIMD 1 #else - #if !defined(LAL_USE_OMP) - #define LAL_USE_OMP 0 - #endif +#define LAL_USE_OMP_SIMD 0 +#endif +#endif +#else +#if !defined(LAL_USE_OMP) +#define LAL_USE_OMP 0 +#endif - #if !defined(LAL_USE_OMP_SIMD) - #define LAL_USE_OMP_SIMD 0 - #endif +#if !defined(LAL_USE_OMP_SIMD) +#define LAL_USE_OMP_SIMD 0 +#endif #endif namespace GPU_EXTRA { - inline void check_flag(int error_flag, LAMMPS_NS::Error *error, - MPI_Comm &world) { - int all_success; - MPI_Allreduce(&error_flag, &all_success, 1, MPI_INT, MPI_MIN, world); - if (all_success != 0) { - if (all_success == -1) - error->all(FLERR, - "The package gpu command is required for gpu styles"); - else if (all_success == -2) - error->all(FLERR, - "Could not find/initialize a specified accelerator device"); - else if (all_success == -3) - error->all(FLERR,"Insufficient memory on accelerator"); - else if (all_success == -4) - error->all(FLERR,"GPU library not compiled for this accelerator"); - else if (all_success == -5) - error->all(FLERR, - "Double precision is not supported on this accelerator"); - else if (all_success == -6) - error->all(FLERR,"Unable to initialize accelerator for use"); - else if (all_success == -7) - error->all(FLERR, - "Accelerator sharing is not currently supported on system"); - else if (all_success == -8) - error->all(FLERR, - "GPU particle split must be set to 1 for this pair style."); - else if (all_success == -9) - error->all(FLERR, - "CPU neighbor lists must be used for ellipsoid/sphere mix."); - else if (all_success == -10) - error->all(FLERR, - "Invalid threads_per_atom specified."); - else if (all_success == -11) - error->all(FLERR, - "Invalid custom OpenCL parameter string."); - else if (all_success == -12) - error->all(FLERR, - "Invalid OpenCL platform ID."); - else if (all_success == -13) - error->all(FLERR, - "Invalid device configuration."); - else if (all_success == -15) - error->all(FLERR, - "P3M built for FP64 and GPU device is FP32 only."); - else - error->all(FLERR,"Unknown error in GPU library"); - } - } - - inline void gpu_ready(LAMMPS_NS::Modify *modify, LAMMPS_NS::Error *error) { - int ifix = modify->find_fix("package_gpu"); - if (ifix < 0) - error->all(FLERR,"The package gpu command is required for gpu styles"); +inline void check_flag(int error_flag, LAMMPS_NS::Error *error, MPI_Comm &world) +{ + int all_success; + MPI_Allreduce(&error_flag, &all_success, 1, MPI_INT, MPI_MIN, world); + if (all_success != 0) { + if (all_success == -1) + error->all(FLERR, "The package gpu command is required for gpu styles"); + else if (all_success == -2) + error->all(FLERR, "Could not find/initialize a specified accelerator device"); + else if (all_success == -3) + error->all(FLERR, "Insufficient memory on accelerator"); + else if (all_success == -4) + error->all(FLERR, "GPU library not compiled for this accelerator"); + else if (all_success == -5) + error->all(FLERR, "Double precision is not supported on this accelerator"); + else if (all_success == -6) + error->all(FLERR, "Unable to initialize accelerator for use"); + else if (all_success == -7) + error->all(FLERR, "Accelerator sharing is not currently supported on system"); + else if (all_success == -8) + error->all(FLERR, "GPU particle split must be set to 1 for this pair style."); + else if (all_success == -9) + error->all(FLERR, "CPU neighbor lists must be used for ellipsoid/sphere mix."); + else if (all_success == -10) + error->all(FLERR, "Invalid threads_per_atom specified."); + else if (all_success == -11) + error->all(FLERR, "Invalid custom OpenCL parameter string."); + else if (all_success == -12) + error->all(FLERR, "Invalid OpenCL platform ID."); + else if (all_success == -13) + error->all(FLERR, "Invalid device configuration."); + else if (all_success == -15) + error->all(FLERR, "P3M built for FP64 and GPU device is FP32 only."); + else + error->all(FLERR, "Unknown error in GPU library"); } } +inline void gpu_ready(LAMMPS_NS::Modify *modify, LAMMPS_NS::Error *error) +{ + int ifix = modify->find_fix("package_gpu"); + if (ifix < 0) error->all(FLERR, "The package gpu command is required for gpu styles"); +} +} // namespace GPU_EXTRA + #endif /* ERROR/WARNING messages: diff --git a/src/GPU/pair_beck_gpu.cpp b/src/GPU/pair_beck_gpu.cpp index 463123b0a3..be2f8f35e3 100644 --- a/src/GPU/pair_beck_gpu.cpp +++ b/src/GPU/pair_beck_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_beck_gpu.h b/src/GPU/pair_beck_gpu.h index 3500c7f765..835bc7e54f 100644 --- a/src/GPU/pair_beck_gpu.h +++ b/src/GPU/pair_beck_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(beck/gpu,PairBeckGPU) - +// clang-format off +PairStyle(beck/gpu,PairBeckGPU); +// clang-format on #else #ifndef LMP_PAIR_BECK_GPU_H @@ -33,14 +33,14 @@ class PairBeckGPU : public PairBeck { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_born_coul_long_cs_gpu.cpp b/src/GPU/pair_born_coul_long_cs_gpu.cpp index 5782ff5969..b36b4a68c7 100644 --- a/src/GPU/pair_born_coul_long_cs_gpu.cpp +++ b/src/GPU/pair_born_coul_long_cs_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_born_coul_long_cs_gpu.h b/src/GPU/pair_born_coul_long_cs_gpu.h index db8d015bce..228eae6c9b 100644 --- a/src/GPU/pair_born_coul_long_cs_gpu.h +++ b/src/GPU/pair_born_coul_long_cs_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/long/cs/gpu,PairBornCoulLongCSGPU) - +// clang-format off +PairStyle(born/coul/long/cs/gpu,PairBornCoulLongCSGPU); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_LONG_CS_GPU_H @@ -33,14 +33,14 @@ class PairBornCoulLongCSGPU : public PairBornCoulLongCS { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_born_coul_long_gpu.cpp b/src/GPU/pair_born_coul_long_gpu.cpp index 5b27e96cbd..49cbd7cc25 100644 --- a/src/GPU/pair_born_coul_long_gpu.cpp +++ b/src/GPU/pair_born_coul_long_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_born_coul_long_gpu.h b/src/GPU/pair_born_coul_long_gpu.h index d9734fc401..89c44005c2 100644 --- a/src/GPU/pair_born_coul_long_gpu.h +++ b/src/GPU/pair_born_coul_long_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/long/gpu,PairBornCoulLongGPU) - +// clang-format off +PairStyle(born/coul/long/gpu,PairBornCoulLongGPU); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_LONG_GPU_H @@ -33,14 +33,14 @@ class PairBornCoulLongGPU : public PairBornCoulLong { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_born_coul_wolf_cs_gpu.cpp b/src/GPU/pair_born_coul_wolf_cs_gpu.cpp index 0c3e36265f..7b189abcd9 100644 --- a/src/GPU/pair_born_coul_wolf_cs_gpu.cpp +++ b/src/GPU/pair_born_coul_wolf_cs_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_born_coul_wolf_cs_gpu.h b/src/GPU/pair_born_coul_wolf_cs_gpu.h index 92f6b163ab..13a98ba3c0 100644 --- a/src/GPU/pair_born_coul_wolf_cs_gpu.h +++ b/src/GPU/pair_born_coul_wolf_cs_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/wolf/cs/gpu,PairBornCoulWolfCSGPU) - +// clang-format off +PairStyle(born/coul/wolf/cs/gpu,PairBornCoulWolfCSGPU); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_WOLF_CS_GPU_H @@ -33,14 +33,14 @@ class PairBornCoulWolfCSGPU : public PairBornCoulWolfCS { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_born_coul_wolf_gpu.cpp b/src/GPU/pair_born_coul_wolf_gpu.cpp index 1cd91e2d61..e7f2492d8c 100644 --- a/src/GPU/pair_born_coul_wolf_gpu.cpp +++ b/src/GPU/pair_born_coul_wolf_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_born_coul_wolf_gpu.h b/src/GPU/pair_born_coul_wolf_gpu.h index 6ca528c606..c4c002e841 100644 --- a/src/GPU/pair_born_coul_wolf_gpu.h +++ b/src/GPU/pair_born_coul_wolf_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/wolf/gpu,PairBornCoulWolfGPU) - +// clang-format off +PairStyle(born/coul/wolf/gpu,PairBornCoulWolfGPU); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_WOLF_GPU_H @@ -33,14 +33,14 @@ class PairBornCoulWolfGPU : public PairBornCoulWolf { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_born_gpu.cpp b/src/GPU/pair_born_gpu.cpp index f7d383b528..b5a2da0a6c 100644 --- a/src/GPU/pair_born_gpu.cpp +++ b/src/GPU/pair_born_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_born_gpu.h b/src/GPU/pair_born_gpu.h index 31aa978761..b958da28f0 100644 --- a/src/GPU/pair_born_gpu.h +++ b/src/GPU/pair_born_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/gpu,PairBornGPU) - +// clang-format off +PairStyle(born/gpu,PairBornGPU); +// clang-format on #else #ifndef LMP_PAIR_BORN_GPU_H @@ -34,14 +34,14 @@ class PairBornGPU : public PairBorn { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_buck_coul_cut_gpu.cpp b/src/GPU/pair_buck_coul_cut_gpu.cpp index fe3e8f092c..48c45a517b 100644 --- a/src/GPU/pair_buck_coul_cut_gpu.cpp +++ b/src/GPU/pair_buck_coul_cut_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_buck_coul_cut_gpu.h b/src/GPU/pair_buck_coul_cut_gpu.h index 9e81a88b19..69965a1a53 100644 --- a/src/GPU/pair_buck_coul_cut_gpu.h +++ b/src/GPU/pair_buck_coul_cut_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/coul/cut/gpu,PairBuckCoulCutGPU) - +// clang-format off +PairStyle(buck/coul/cut/gpu,PairBuckCoulCutGPU); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_CUT_GPU_H @@ -33,14 +33,14 @@ class PairBuckCoulCutGPU : public PairBuckCoulCut { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_buck_coul_long_gpu.cpp b/src/GPU/pair_buck_coul_long_gpu.cpp index 0c23141060..4eeda468dc 100644 --- a/src/GPU/pair_buck_coul_long_gpu.cpp +++ b/src/GPU/pair_buck_coul_long_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_buck_coul_long_gpu.h b/src/GPU/pair_buck_coul_long_gpu.h index 741aaeb641..231462d4c4 100644 --- a/src/GPU/pair_buck_coul_long_gpu.h +++ b/src/GPU/pair_buck_coul_long_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/coul/long/gpu,PairBuckCoulLongGPU) - +// clang-format off +PairStyle(buck/coul/long/gpu,PairBuckCoulLongGPU); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_LONG_GPU_H @@ -33,14 +33,14 @@ class PairBuckCoulLongGPU : public PairBuckCoulLong { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_buck_gpu.cpp b/src/GPU/pair_buck_gpu.cpp index 81bd987850..cf9e54a366 100644 --- a/src/GPU/pair_buck_gpu.cpp +++ b/src/GPU/pair_buck_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_buck_gpu.h b/src/GPU/pair_buck_gpu.h index 5b29bc7125..c3b91cbbc1 100644 --- a/src/GPU/pair_buck_gpu.h +++ b/src/GPU/pair_buck_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/gpu,PairBuckGPU) - +// clang-format off +PairStyle(buck/gpu,PairBuckGPU); +// clang-format on #else #ifndef LMP_PAIR_BUCK_GPU_H @@ -34,14 +34,14 @@ class PairBuckGPU : public PairBuck { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_colloid_gpu.cpp b/src/GPU/pair_colloid_gpu.cpp index d5391aeede..5139645956 100644 --- a/src/GPU/pair_colloid_gpu.cpp +++ b/src/GPU/pair_colloid_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_colloid_gpu.h b/src/GPU/pair_colloid_gpu.h index 6face4ea25..6e49b8e2ed 100644 --- a/src/GPU/pair_colloid_gpu.h +++ b/src/GPU/pair_colloid_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(colloid/gpu,PairColloidGPU) - +// clang-format off +PairStyle(colloid/gpu,PairColloidGPU); +// clang-format on #else #ifndef LMP_PAIR_COLLOID_GPU_H @@ -33,14 +33,14 @@ class PairColloidGPU : public PairColloid { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_coul_cut_gpu.cpp b/src/GPU/pair_coul_cut_gpu.cpp index ef9b2dff4d..43227b7031 100644 --- a/src/GPU/pair_coul_cut_gpu.cpp +++ b/src/GPU/pair_coul_cut_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_coul_cut_gpu.h b/src/GPU/pair_coul_cut_gpu.h index 10b1f4510e..9c6d8eb6d6 100644 --- a/src/GPU/pair_coul_cut_gpu.h +++ b/src/GPU/pair_coul_cut_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/cut/gpu,PairCoulCutGPU) - +// clang-format off +PairStyle(coul/cut/gpu,PairCoulCutGPU); +// clang-format on #else #ifndef LMP_PAIR_COUL_CUT_GPU_H @@ -34,14 +34,14 @@ class PairCoulCutGPU : public PairCoulCut { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_coul_debye_gpu.cpp b/src/GPU/pair_coul_debye_gpu.cpp index ca5cb7df9a..ab9bcd802f 100644 --- a/src/GPU/pair_coul_debye_gpu.cpp +++ b/src/GPU/pair_coul_debye_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_coul_debye_gpu.h b/src/GPU/pair_coul_debye_gpu.h index 1fe4a05c8d..6e0efe8808 100644 --- a/src/GPU/pair_coul_debye_gpu.h +++ b/src/GPU/pair_coul_debye_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/debye/gpu,PairCoulDebyeGPU) - +// clang-format off +PairStyle(coul/debye/gpu,PairCoulDebyeGPU); +// clang-format on #else #ifndef LMP_PAIR_COUL_DEBYE_GPU_H @@ -34,14 +34,14 @@ class PairCoulDebyeGPU : public PairCoulDebye { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_coul_dsf_gpu.cpp b/src/GPU/pair_coul_dsf_gpu.cpp index d988a47681..77f6cd0a93 100644 --- a/src/GPU/pair_coul_dsf_gpu.cpp +++ b/src/GPU/pair_coul_dsf_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_coul_dsf_gpu.h b/src/GPU/pair_coul_dsf_gpu.h index 413ef2468e..b1da9f0742 100644 --- a/src/GPU/pair_coul_dsf_gpu.h +++ b/src/GPU/pair_coul_dsf_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/dsf/gpu,PairCoulDSFGPU) - +// clang-format off +PairStyle(coul/dsf/gpu,PairCoulDSFGPU); +// clang-format on #else #ifndef LMP_PAIR_COUL_DSF_GPU_H @@ -33,14 +33,14 @@ class PairCoulDSFGPU : public PairCoulDSF { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_coul_long_cs_gpu.cpp b/src/GPU/pair_coul_long_cs_gpu.cpp index f924f2c925..f1a3f4caa3 100644 --- a/src/GPU/pair_coul_long_cs_gpu.cpp +++ b/src/GPU/pair_coul_long_cs_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_coul_long_cs_gpu.h b/src/GPU/pair_coul_long_cs_gpu.h index 8e712e384c..b26e1c5eb9 100644 --- a/src/GPU/pair_coul_long_cs_gpu.h +++ b/src/GPU/pair_coul_long_cs_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/long/cs/gpu,PairCoulLongCSGPU) - +// clang-format off +PairStyle(coul/long/cs/gpu,PairCoulLongCSGPU); +// clang-format on #else #ifndef LMP_PAIR_COUL_LONG_CS_GPU_H @@ -34,14 +34,14 @@ class PairCoulLongCSGPU : public PairCoulLongCS { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_coul_long_gpu.cpp b/src/GPU/pair_coul_long_gpu.cpp index e1d51b1359..404031fd4b 100644 --- a/src/GPU/pair_coul_long_gpu.cpp +++ b/src/GPU/pair_coul_long_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_coul_long_gpu.h b/src/GPU/pair_coul_long_gpu.h index 6e580302de..8dbd0f936a 100644 --- a/src/GPU/pair_coul_long_gpu.h +++ b/src/GPU/pair_coul_long_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/long/gpu,PairCoulLongGPU) - +// clang-format off +PairStyle(coul/long/gpu,PairCoulLongGPU); +// clang-format on #else #ifndef LMP_PAIR_COUL_LONG_GPU_H @@ -34,14 +34,14 @@ class PairCoulLongGPU : public PairCoulLong { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_dpd_gpu.cpp b/src/GPU/pair_dpd_gpu.cpp index f66fc6d594..5c1c48b805 100644 --- a/src/GPU/pair_dpd_gpu.cpp +++ b/src/GPU/pair_dpd_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_dpd_gpu.h b/src/GPU/pair_dpd_gpu.h index a83d30101c..72d2c249da 100644 --- a/src/GPU/pair_dpd_gpu.h +++ b/src/GPU/pair_dpd_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dpd/gpu,PairDPDGPU) - +// clang-format off +PairStyle(dpd/gpu,PairDPDGPU); +// clang-format on #else #ifndef LMP_PAIR_DPD_GPU_H @@ -33,14 +33,14 @@ class PairDPDGPU : public PairDPD { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_dpd_tstat_gpu.cpp b/src/GPU/pair_dpd_tstat_gpu.cpp index 957bb938f3..8f6c0c505a 100644 --- a/src/GPU/pair_dpd_tstat_gpu.cpp +++ b/src/GPU/pair_dpd_tstat_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_dpd_tstat_gpu.h b/src/GPU/pair_dpd_tstat_gpu.h index e59e767f6a..132360bb1b 100644 --- a/src/GPU/pair_dpd_tstat_gpu.h +++ b/src/GPU/pair_dpd_tstat_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dpd/tstat/gpu,PairDPDTstatGPU) - +// clang-format off +PairStyle(dpd/tstat/gpu,PairDPDTstatGPU); +// clang-format on #else #ifndef LMP_PAIR_DPD_TSTAT_GPU_H @@ -33,14 +33,14 @@ class PairDPDTstatGPU : public PairDPDTstat { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp index fe2cc92450..76f7540313 100644 --- a/src/GPU/pair_eam_alloy_gpu.cpp +++ b/src/GPU/pair_eam_alloy_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_eam_alloy_gpu.h b/src/GPU/pair_eam_alloy_gpu.h index 250e1f5540..80125a8425 100644 --- a/src/GPU/pair_eam_alloy_gpu.h +++ b/src/GPU/pair_eam_alloy_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/alloy/gpu,PairEAMAlloyGPU) - +// clang-format off +PairStyle(eam/alloy/gpu,PairEAMAlloyGPU); +// clang-format on #else #ifndef LMP_PAIR_EAM_ALLOY_GPU_H @@ -25,7 +25,7 @@ PairStyle(eam/alloy/gpu,PairEAMAlloyGPU) namespace LAMMPS_NS { class PairEAMAlloyGPU : public PairEAM { -public: + public: PairEAMAlloyGPU(class LAMMPS *); virtual ~PairEAMAlloyGPU(); void coeff(int, char **); @@ -38,7 +38,7 @@ public: int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void read_file(char *); @@ -50,7 +50,7 @@ public: bool fp_single; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp index b92e348ddf..e5767c1538 100644 --- a/src/GPU/pair_eam_fs_gpu.cpp +++ b/src/GPU/pair_eam_fs_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_eam_fs_gpu.h b/src/GPU/pair_eam_fs_gpu.h index 819f37e554..2e5bb46cad 100644 --- a/src/GPU/pair_eam_fs_gpu.h +++ b/src/GPU/pair_eam_fs_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/fs/gpu,PairEAMFSGPU) - +// clang-format off +PairStyle(eam/fs/gpu,PairEAMFSGPU); +// clang-format on #else #ifndef LMP_PAIR_EAM_FS_GPU_H @@ -25,7 +25,7 @@ PairStyle(eam/fs/gpu,PairEAMFSGPU) namespace LAMMPS_NS { class PairEAMFSGPU : public PairEAM { -public: + public: PairEAMFSGPU(class LAMMPS *); virtual ~PairEAMFSGPU(); void coeff(int, char **); @@ -38,7 +38,7 @@ public: int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void read_file(char *); @@ -50,7 +50,7 @@ public: bool fp_single; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_eam_gpu.cpp b/src/GPU/pair_eam_gpu.cpp index 2ed72a3b08..b56b60d2c3 100644 --- a/src/GPU/pair_eam_gpu.cpp +++ b/src/GPU/pair_eam_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_eam_gpu.h b/src/GPU/pair_eam_gpu.h index 857b5d59b1..1c781dd60a 100644 --- a/src/GPU/pair_eam_gpu.h +++ b/src/GPU/pair_eam_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/gpu,PairEAMGPU) - +// clang-format off +PairStyle(eam/gpu,PairEAMGPU); +// clang-format on #else #ifndef LMP_PAIR_EAM_GPU_H @@ -26,7 +26,6 @@ namespace LAMMPS_NS { class PairEAMGPU : public PairEAM { public: - PairEAMGPU(class LAMMPS *); virtual ~PairEAMGPU(); void compute(int, int); @@ -38,7 +37,7 @@ class PairEAMGPU : public PairEAM { int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: int gpu_mode; @@ -47,7 +46,7 @@ class PairEAMGPU : public PairEAM { bool fp_single; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_gauss_gpu.cpp b/src/GPU/pair_gauss_gpu.cpp index 8431ce1b67..728ddef7f5 100644 --- a/src/GPU/pair_gauss_gpu.cpp +++ b/src/GPU/pair_gauss_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_gauss_gpu.h b/src/GPU/pair_gauss_gpu.h index 5fe30a68bd..3abf57ade6 100644 --- a/src/GPU/pair_gauss_gpu.h +++ b/src/GPU/pair_gauss_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gauss/gpu,PairGaussGPU) - +// clang-format off +PairStyle(gauss/gpu,PairGaussGPU); +// clang-format on #else #ifndef LMP_PAIR_GAUSS_GPU_H @@ -34,14 +34,14 @@ class PairGaussGPU : public PairGauss { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_gayberne_gpu.cpp b/src/GPU/pair_gayberne_gpu.cpp index d7adb5c657..8977125679 100644 --- a/src/GPU/pair_gayberne_gpu.cpp +++ b/src/GPU/pair_gayberne_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_gayberne_gpu.h b/src/GPU/pair_gayberne_gpu.h index d86a9c2187..37c8d59214 100644 --- a/src/GPU/pair_gayberne_gpu.h +++ b/src/GPU/pair_gayberne_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gayberne/gpu,PairGayBerneGPU) - +// clang-format off +PairStyle(gayberne/gpu,PairGayBerneGPU); +// clang-format on #else #ifndef LMP_PAIR_GAYBERNE_GPU_H @@ -42,7 +42,7 @@ class PairGayBerneGPU : public PairGayBerne { double **quat; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj96_cut_gpu.cpp b/src/GPU/pair_lj96_cut_gpu.cpp index 016147cb6e..29579fa0ab 100644 --- a/src/GPU/pair_lj96_cut_gpu.cpp +++ b/src/GPU/pair_lj96_cut_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj96_cut_gpu.h b/src/GPU/pair_lj96_cut_gpu.h index 2296e04212..eec6eab572 100644 --- a/src/GPU/pair_lj96_cut_gpu.h +++ b/src/GPU/pair_lj96_cut_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj96/cut/gpu,PairLJ96CutGPU) - +// clang-format off +PairStyle(lj96/cut/gpu,PairLJ96CutGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_96_GPU_H @@ -33,14 +33,14 @@ class PairLJ96CutGPU : public PairLJ96Cut { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp b/src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp index e15600fd81..68688e9f03 100644 --- a/src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp +++ b/src/GPU/pair_lj_charmm_coul_charmm_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_charmm_coul_charmm_gpu.h b/src/GPU/pair_lj_charmm_coul_charmm_gpu.h index 3e84d9abaf..fe3d13d59e 100644 --- a/src/GPU/pair_lj_charmm_coul_charmm_gpu.h +++ b/src/GPU/pair_lj_charmm_coul_charmm_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/charmm/gpu,PairLJCharmmCoulCharmmGPU) - +// clang-format off +PairStyle(lj/charmm/coul/charmm/gpu,PairLJCharmmCoulCharmmGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_CHARMM_GPU_H @@ -33,14 +33,14 @@ class PairLJCharmmCoulCharmmGPU : public PairLJCharmmCoulCharmm { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp index 1fc8ba1c5f..cc4da87ace 100644 --- a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.h b/src/GPU/pair_lj_charmm_coul_long_gpu.h index 910646a2c8..4c7313ab0f 100644 --- a/src/GPU/pair_lj_charmm_coul_long_gpu.h +++ b/src/GPU/pair_lj_charmm_coul_long_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/long/gpu,PairLJCharmmCoulLongGPU) - +// clang-format off +PairStyle(lj/charmm/coul/long/gpu,PairLJCharmmCoulLongGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_GPU_H @@ -33,14 +33,14 @@ class PairLJCharmmCoulLongGPU : public PairLJCharmmCoulLong { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.cpp b/src/GPU/pair_lj_class2_coul_long_gpu.cpp index 87dda4f190..91dae0ac47 100644 --- a/src/GPU/pair_lj_class2_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_class2_coul_long_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.h b/src/GPU/pair_lj_class2_coul_long_gpu.h index 6c171c0498..8b18d659dd 100644 --- a/src/GPU/pair_lj_class2_coul_long_gpu.h +++ b/src/GPU/pair_lj_class2_coul_long_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/coul/long/gpu,PairLJClass2CoulLongGPU) - +// clang-format off +PairStyle(lj/class2/coul/long/gpu,PairLJClass2CoulLongGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_COUL_LONG_GPU_H @@ -33,14 +33,14 @@ class PairLJClass2CoulLongGPU : public PairLJClass2CoulLong { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_class2_gpu.cpp b/src/GPU/pair_lj_class2_gpu.cpp index 4e224cb2d3..cee6c1fa6f 100644 --- a/src/GPU/pair_lj_class2_gpu.cpp +++ b/src/GPU/pair_lj_class2_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_class2_gpu.h b/src/GPU/pair_lj_class2_gpu.h index 46eda57f17..44e24c13f0 100644 --- a/src/GPU/pair_lj_class2_gpu.h +++ b/src/GPU/pair_lj_class2_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/gpu,PairLJClass2GPU) - +// clang-format off +PairStyle(lj/class2/gpu,PairLJClass2GPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_GPU_H @@ -33,14 +33,14 @@ class PairLJClass2GPU : public PairLJClass2 { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cubic_gpu.cpp b/src/GPU/pair_lj_cubic_gpu.cpp index 1c9b9a0820..d006804c4a 100644 --- a/src/GPU/pair_lj_cubic_gpu.cpp +++ b/src/GPU/pair_lj_cubic_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_cubic_gpu.h b/src/GPU/pair_lj_cubic_gpu.h index 855c1282e5..30dd23671b 100644 --- a/src/GPU/pair_lj_cubic_gpu.h +++ b/src/GPU/pair_lj_cubic_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cubic/gpu,PairLJCubicGPU) - +// clang-format off +PairStyle(lj/cubic/gpu,PairLJCubicGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUBIC_GPU_H @@ -33,14 +33,14 @@ class PairLJCubicGPU : public PairLJCubic { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp index 0a1076aef8..af3b1a8982 100644 --- a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.h b/src/GPU/pair_lj_cut_coul_cut_gpu.h index 7efe61f18a..7ccf2b4e0a 100644 --- a/src/GPU/pair_lj_cut_coul_cut_gpu.h +++ b/src/GPU/pair_lj_cut_coul_cut_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/cut/gpu,PairLJCutCoulCutGPU) - +// clang-format off +PairStyle(lj/cut/coul/cut/gpu,PairLJCutCoulCutGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_CUT_GPU_H @@ -33,14 +33,14 @@ class PairLJCutCoulCutGPU : public PairLJCutCoulCut { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_coul_debye_gpu.cpp b/src/GPU/pair_lj_cut_coul_debye_gpu.cpp index 75a16ae210..26eec08d39 100644 --- a/src/GPU/pair_lj_cut_coul_debye_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_debye_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_cut_coul_debye_gpu.h b/src/GPU/pair_lj_cut_coul_debye_gpu.h index 12ac8b64cc..a6803eef1d 100644 --- a/src/GPU/pair_lj_cut_coul_debye_gpu.h +++ b/src/GPU/pair_lj_cut_coul_debye_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/debye/gpu,PairLJCutCoulDebyeGPU) - +// clang-format off +PairStyle(lj/cut/coul/debye/gpu,PairLJCutCoulDebyeGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_DEBYE_GPU_H @@ -33,14 +33,14 @@ class PairLJCutCoulDebyeGPU : public PairLJCutCoulDebye { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp b/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp index e3500ce60d..85cbd40623 100644 --- a/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_cut_coul_dsf_gpu.h b/src/GPU/pair_lj_cut_coul_dsf_gpu.h index e86d008c29..d39a97bed1 100644 --- a/src/GPU/pair_lj_cut_coul_dsf_gpu.h +++ b/src/GPU/pair_lj_cut_coul_dsf_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/dsf/gpu,PairLJCutCoulDSFGPU) - +// clang-format off +PairStyle(lj/cut/coul/dsf/gpu,PairLJCutCoulDSFGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_DSF_GPU_H @@ -33,14 +33,14 @@ class PairLJCutCoulDSFGPU : public PairLJCutCoulDSF { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.cpp b/src/GPU/pair_lj_cut_coul_long_gpu.cpp index 3ac52c08c5..0e41d80731 100644 --- a/src/GPU/pair_lj_cut_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_long_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.h b/src/GPU/pair_lj_cut_coul_long_gpu.h index eefb1c928d..ef2ed3633c 100644 --- a/src/GPU/pair_lj_cut_coul_long_gpu.h +++ b/src/GPU/pair_lj_cut_coul_long_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/long/gpu,PairLJCutCoulLongGPU) - +// clang-format off +PairStyle(lj/cut/coul/long/gpu,PairLJCutCoulLongGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_LONG_GPU_H @@ -34,14 +34,14 @@ class PairLJCutCoulLongGPU : public PairLJCutCoulLong { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_coul_msm_gpu.cpp b/src/GPU/pair_lj_cut_coul_msm_gpu.cpp index f92c83bcf7..41d8f56d07 100644 --- a/src/GPU/pair_lj_cut_coul_msm_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_msm_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_cut_coul_msm_gpu.h b/src/GPU/pair_lj_cut_coul_msm_gpu.h index b8d7382333..0b6851d56f 100644 --- a/src/GPU/pair_lj_cut_coul_msm_gpu.h +++ b/src/GPU/pair_lj_cut_coul_msm_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/msm/gpu,PairLJCutCoulMSMGPU) - +// clang-format off +PairStyle(lj/cut/coul/msm/gpu,PairLJCutCoulMSMGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_MSM_GPU_H @@ -33,14 +33,14 @@ class PairLJCutCoulMSMGPU : public PairLJCutCoulMSM { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp b/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp index b15822bde9..5e80595244 100644 --- a/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_cut_dipole_cut_gpu.h b/src/GPU/pair_lj_cut_dipole_cut_gpu.h index 6ddfff47f0..6a04332761 100644 --- a/src/GPU/pair_lj_cut_dipole_cut_gpu.h +++ b/src/GPU/pair_lj_cut_dipole_cut_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/dipole/cut/gpu,PairLJCutDipoleCutGPU) - +// clang-format off +PairStyle(lj/cut/dipole/cut/gpu,PairLJCutDipoleCutGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_DIPOLE_CUT_GPU_H @@ -33,14 +33,14 @@ class PairLJCutDipoleCutGPU : public PairLJCutDipoleCut { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_dipole_long_gpu.cpp b/src/GPU/pair_lj_cut_dipole_long_gpu.cpp index d9d38d4cb0..cc611e2226 100644 --- a/src/GPU/pair_lj_cut_dipole_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_dipole_long_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_cut_dipole_long_gpu.h b/src/GPU/pair_lj_cut_dipole_long_gpu.h index 44695fcd28..c87e01ed86 100644 --- a/src/GPU/pair_lj_cut_dipole_long_gpu.h +++ b/src/GPU/pair_lj_cut_dipole_long_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/dipole/long/gpu,PairLJCutDipoleLongGPU) - +// clang-format off +PairStyle(lj/cut/dipole/long/gpu,PairLJCutDipoleLongGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_DIPOLE_LONG_GPU_H @@ -33,14 +33,14 @@ class PairLJCutDipoleLongGPU : public PairLJCutDipoleLong { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_gpu.cpp b/src/GPU/pair_lj_cut_gpu.cpp index 65fed01321..23883ec0f3 100644 --- a/src/GPU/pair_lj_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_cut_gpu.h b/src/GPU/pair_lj_cut_gpu.h index b86946f149..edc1436cdf 100644 --- a/src/GPU/pair_lj_cut_gpu.h +++ b/src/GPU/pair_lj_cut_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/gpu,PairLJCutGPU) - +// clang-format off +PairStyle(lj/cut/gpu,PairLJCutGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_LIGHT_GPU_H @@ -34,14 +34,14 @@ class PairLJCutGPU : public PairLJCut { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp index 67dcd6d0b6..685c222571 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.h b/src/GPU/pair_lj_cut_tip4p_long_gpu.h index 87ddce85bb..c2db10c9eb 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.h +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/tip4p/long/gpu,PairLJCutTIP4PLongGPU) - +// clang-format off +PairStyle(lj/cut/tip4p/long/gpu,PairLJCutTIP4PLongGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_TIP4P_LONG_GPU_H @@ -36,13 +36,13 @@ class PairLJCutTIP4PLongGPU : public PairLJCutTIP4PLong { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_expand_coul_long_gpu.cpp b/src/GPU/pair_lj_expand_coul_long_gpu.cpp index d5a23507ae..88493519a6 100644 --- a/src/GPU/pair_lj_expand_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_expand_coul_long_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_expand_coul_long_gpu.h b/src/GPU/pair_lj_expand_coul_long_gpu.h index 662da29786..02582e7b5e 100644 --- a/src/GPU/pair_lj_expand_coul_long_gpu.h +++ b/src/GPU/pair_lj_expand_coul_long_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/expand/coul/long/gpu,PairLJExpandCoulLongGPU) - +// clang-format off +PairStyle(lj/expand/coul/long/gpu,PairLJExpandCoulLongGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_EXPAND_COUL_LONG_GPU_H @@ -34,14 +34,14 @@ class PairLJExpandCoulLongGPU : public PairLJExpandCoulLong { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_expand_gpu.cpp b/src/GPU/pair_lj_expand_gpu.cpp index 234173651d..fd0114dbe1 100644 --- a/src/GPU/pair_lj_expand_gpu.cpp +++ b/src/GPU/pair_lj_expand_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_expand_gpu.h b/src/GPU/pair_lj_expand_gpu.h index 7e1536f366..9edb217baa 100644 --- a/src/GPU/pair_lj_expand_gpu.h +++ b/src/GPU/pair_lj_expand_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/expand/gpu,PairLJExpandGPU) - +// clang-format off +PairStyle(lj/expand/gpu,PairLJExpandGPU); +// clang-format on #else #ifndef LMP_PAIR_LJE_LIGHT_GPU_H @@ -34,14 +34,14 @@ class PairLJExpandGPU : public PairLJExpand { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_gromacs_gpu.cpp b/src/GPU/pair_lj_gromacs_gpu.cpp index df5d6aee89..80b59a791a 100644 --- a/src/GPU/pair_lj_gromacs_gpu.cpp +++ b/src/GPU/pair_lj_gromacs_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_gromacs_gpu.h b/src/GPU/pair_lj_gromacs_gpu.h index 689abc0223..5df649c2c3 100644 --- a/src/GPU/pair_lj_gromacs_gpu.h +++ b/src/GPU/pair_lj_gromacs_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/gromacs/gpu,PairLJGromacsGPU) - +// clang-format off +PairStyle(lj/gromacs/gpu,PairLJGromacsGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_GROMACS_GPU_H @@ -33,14 +33,14 @@ class PairLJGromacsGPU : public PairLJGromacs { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp index 5b7cb1fa67..d3055e01cb 100644 --- a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.h b/src/GPU/pair_lj_sdk_coul_long_gpu.h index 10a45c3c8d..b3148efa0e 100644 --- a/src/GPU/pair_lj_sdk_coul_long_gpu.h +++ b/src/GPU/pair_lj_sdk_coul_long_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/sdk/coul/long/gpu,PairLJSDKCoulLongGPU) - +// clang-format off +PairStyle(lj/sdk/coul/long/gpu,PairLJSDKCoulLongGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_SDK_COUL_LONG_GPU_H @@ -28,20 +28,19 @@ class PairLJSDKCoulLongGPU : public PairLJSDKCoulLong { public: PairLJSDKCoulLongGPU(LAMMPS *lmp); ~PairLJSDKCoulLongGPU(); - template - void cpu_compute(int, int, int *, int *, int **); + template void cpu_compute(int, int, int *, int *, int **); void compute(int, int); void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_sdk_gpu.cpp b/src/GPU/pair_lj_sdk_gpu.cpp index 1cfacfde83..5938d8318c 100644 --- a/src/GPU/pair_lj_sdk_gpu.cpp +++ b/src/GPU/pair_lj_sdk_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_sdk_gpu.h b/src/GPU/pair_lj_sdk_gpu.h index dcbb82bca6..f71bf64efb 100644 --- a/src/GPU/pair_lj_sdk_gpu.h +++ b/src/GPU/pair_lj_sdk_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/sdk/gpu,PairLJSDKGPU) - +// clang-format off +PairStyle(lj/sdk/gpu,PairLJSDKGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_SDK_GPU_H @@ -28,20 +28,19 @@ class PairLJSDKGPU : public PairLJSDK { public: PairLJSDKGPU(LAMMPS *lmp); ~PairLJSDKGPU(); - template - void cpu_compute(int, int, int *, int *, int **); + template void cpu_compute(int, int, int *, int *, int **); void compute(int, int); void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp b/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp index 033c0c1d62..52ceaa78c6 100644 --- a/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp +++ b/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_sf_dipole_sf_gpu.h b/src/GPU/pair_lj_sf_dipole_sf_gpu.h index 050fa472fc..5aaec1e92b 100644 --- a/src/GPU/pair_lj_sf_dipole_sf_gpu.h +++ b/src/GPU/pair_lj_sf_dipole_sf_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/sf/dipole/sf/gpu,PairLJSFDipoleSFGPU) - +// clang-format off +PairStyle(lj/sf/dipole/sf/gpu,PairLJSFDipoleSFGPU); +// clang-format on #else #ifndef LMP_PAIR_LJ_SF_DIPOLE_SF_GPU_H @@ -33,14 +33,14 @@ class PairLJSFDipoleSFGPU : public PairLJSFDipoleSF { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_smooth_gpu.cpp b/src/GPU/pair_lj_smooth_gpu.cpp index 1613e18fa3..ee32624f64 100644 --- a/src/GPU/pair_lj_smooth_gpu.cpp +++ b/src/GPU/pair_lj_smooth_gpu.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_lj_smooth_gpu.h b/src/GPU/pair_lj_smooth_gpu.h index 2b7f978f0c..2624e54a20 100644 --- a/src/GPU/pair_lj_smooth_gpu.h +++ b/src/GPU/pair_lj_smooth_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_mie_cut_gpu.cpp b/src/GPU/pair_mie_cut_gpu.cpp index f2cfbc2637..c41b76b1b9 100644 --- a/src/GPU/pair_mie_cut_gpu.cpp +++ b/src/GPU/pair_mie_cut_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_mie_cut_gpu.h b/src/GPU/pair_mie_cut_gpu.h index 4520895ed5..c168c69c42 100644 --- a/src/GPU/pair_mie_cut_gpu.h +++ b/src/GPU/pair_mie_cut_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(mie/cut/gpu,PairMIECutGPU) - +// clang-format off +PairStyle(mie/cut/gpu,PairMIECutGPU); +// clang-format on #else #ifndef LMP_PAIR_MIE_CUT_GPU_H @@ -33,14 +33,14 @@ class PairMIECutGPU : public PairMIECut { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_morse_gpu.cpp b/src/GPU/pair_morse_gpu.cpp index 024346afb2..3f4ea6c84d 100644 --- a/src/GPU/pair_morse_gpu.cpp +++ b/src/GPU/pair_morse_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_morse_gpu.h b/src/GPU/pair_morse_gpu.h index 663b4b8c6b..09d6c53e3b 100644 --- a/src/GPU/pair_morse_gpu.h +++ b/src/GPU/pair_morse_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(morse/gpu,PairMorseGPU) - +// clang-format off +PairStyle(morse/gpu,PairMorseGPU); +// clang-format on #else #ifndef LMP_PAIR_MORSE_GPU_H @@ -33,14 +33,14 @@ class PairMorseGPU : public PairMorse { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_resquared_gpu.cpp b/src/GPU/pair_resquared_gpu.cpp index 18817bf551..58843d1a21 100644 --- a/src/GPU/pair_resquared_gpu.cpp +++ b/src/GPU/pair_resquared_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_resquared_gpu.h b/src/GPU/pair_resquared_gpu.h index 40bbee1f4f..9096e88f3d 100644 --- a/src/GPU/pair_resquared_gpu.h +++ b/src/GPU/pair_resquared_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(resquared/gpu,PairRESquaredGPU) - +// clang-format off +PairStyle(resquared/gpu,PairRESquaredGPU); +// clang-format on #else #ifndef LMP_PAIR_RESQUARED_GPU_H @@ -42,7 +42,7 @@ class PairRESquaredGPU : public PairRESquared { double **quat; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_soft_gpu.cpp b/src/GPU/pair_soft_gpu.cpp index 0c963e947c..e8d2d3be26 100644 --- a/src/GPU/pair_soft_gpu.cpp +++ b/src/GPU/pair_soft_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_soft_gpu.h b/src/GPU/pair_soft_gpu.h index 401d1035fd..3e84d2e58a 100644 --- a/src/GPU/pair_soft_gpu.h +++ b/src/GPU/pair_soft_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(soft/gpu,PairSoftGPU) - +// clang-format off +PairStyle(soft/gpu,PairSoftGPU); +// clang-format on #else #ifndef LMP_PAIR_SOFT_GPU_H @@ -34,14 +34,14 @@ class PairSoftGPU : public PairSoft { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_sw_gpu.cpp b/src/GPU/pair_sw_gpu.cpp index 1603704b9b..d4b322c0a0 100644 --- a/src/GPU/pair_sw_gpu.cpp +++ b/src/GPU/pair_sw_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_sw_gpu.h b/src/GPU/pair_sw_gpu.h index a5eea58cf9..8f9abe6478 100644 --- a/src/GPU/pair_sw_gpu.h +++ b/src/GPU/pair_sw_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(sw/gpu,PairSWGPU) - +// clang-format off +PairStyle(sw/gpu,PairSWGPU); +// clang-format on #else #ifndef LMP_PAIR_SW_GPU_H @@ -32,7 +32,7 @@ class PairSWGPU : public PairSW { double init_one(int, int); void init_style(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void allocate(); @@ -41,7 +41,7 @@ class PairSWGPU : public PairSW { double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_table_gpu.cpp b/src/GPU/pair_table_gpu.cpp index fb1a130398..1fbf0bea6a 100644 --- a/src/GPU/pair_table_gpu.cpp +++ b/src/GPU/pair_table_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_table_gpu.h b/src/GPU/pair_table_gpu.h index 255e7a9cce..6623a4c41c 100644 --- a/src/GPU/pair_table_gpu.h +++ b/src/GPU/pair_table_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(table/gpu,PairTableGPU) - +// clang-format off +PairStyle(table/gpu,PairTableGPU); +// clang-format on #else #ifndef LMP_PAIR_TABLE_GPU_H @@ -33,14 +33,14 @@ class PairTableGPU : public PairTable { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_tersoff_gpu.cpp b/src/GPU/pair_tersoff_gpu.cpp index 55576de4ec..7b3f953840 100644 --- a/src/GPU/pair_tersoff_gpu.cpp +++ b/src/GPU/pair_tersoff_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_tersoff_gpu.h b/src/GPU/pair_tersoff_gpu.h index c44ed5f5f2..9f981f8ca4 100644 --- a/src/GPU/pair_tersoff_gpu.h +++ b/src/GPU/pair_tersoff_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/gpu,PairTersoffGPU) - +// clang-format off +PairStyle(tersoff/gpu,PairTersoffGPU); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_GPU_H @@ -32,7 +32,7 @@ class PairTersoffGPU : public PairTersoff { double init_one(int, int); void init_style(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void allocate(); @@ -42,7 +42,7 @@ class PairTersoffGPU : public PairTersoff { int *gpulist; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_tersoff_mod_gpu.cpp b/src/GPU/pair_tersoff_mod_gpu.cpp index 5d79a68af4..4f3f769d89 100644 --- a/src/GPU/pair_tersoff_mod_gpu.cpp +++ b/src/GPU/pair_tersoff_mod_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_tersoff_mod_gpu.h b/src/GPU/pair_tersoff_mod_gpu.h index 7a9ebb6a8a..31abc0c258 100644 --- a/src/GPU/pair_tersoff_mod_gpu.h +++ b/src/GPU/pair_tersoff_mod_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/mod/gpu,PairTersoffMODGPU) - +// clang-format off +PairStyle(tersoff/mod/gpu,PairTersoffMODGPU); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_MOD_GPU_H @@ -32,7 +32,7 @@ class PairTersoffMODGPU : public PairTersoffMOD { double init_one(int, int); void init_style(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void allocate(); @@ -42,7 +42,7 @@ class PairTersoffMODGPU : public PairTersoffMOD { int *gpulist; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_tersoff_zbl_gpu.cpp b/src/GPU/pair_tersoff_zbl_gpu.cpp index 9594845fd0..7139e07f7d 100644 --- a/src/GPU/pair_tersoff_zbl_gpu.cpp +++ b/src/GPU/pair_tersoff_zbl_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_tersoff_zbl_gpu.h b/src/GPU/pair_tersoff_zbl_gpu.h index 9e0547b495..a52b633302 100644 --- a/src/GPU/pair_tersoff_zbl_gpu.h +++ b/src/GPU/pair_tersoff_zbl_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/zbl/gpu,PairTersoffZBLGPU) - +// clang-format off +PairStyle(tersoff/zbl/gpu,PairTersoffZBLGPU); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_ZBL_GPU_H @@ -32,7 +32,7 @@ class PairTersoffZBLGPU : public PairTersoffZBL { double init_one(int, int); void init_style(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void allocate(); @@ -42,7 +42,7 @@ class PairTersoffZBLGPU : public PairTersoffZBL { int *gpulist; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_ufm_gpu.cpp b/src/GPU/pair_ufm_gpu.cpp index cdf53d6cc6..fce59c036c 100644 --- a/src/GPU/pair_ufm_gpu.cpp +++ b/src/GPU/pair_ufm_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_ufm_gpu.h b/src/GPU/pair_ufm_gpu.h index 766a0a1e75..0ebd6b7537 100644 --- a/src/GPU/pair_ufm_gpu.h +++ b/src/GPU/pair_ufm_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,9 +18,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(ufm/gpu,PairUFMGPU) - +// clang-format off +PairStyle(ufm/gpu,PairUFMGPU); +// clang-format on #else #ifndef LMP_PAIR_UFM_GPU_H @@ -40,14 +40,14 @@ class PairUFMGPU : public PairUFM { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_vashishta_gpu.cpp b/src/GPU/pair_vashishta_gpu.cpp index 4c47b66b4a..277ac036cd 100644 --- a/src/GPU/pair_vashishta_gpu.cpp +++ b/src/GPU/pair_vashishta_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_vashishta_gpu.h b/src/GPU/pair_vashishta_gpu.h index 540b7306ba..4f194bffc7 100644 --- a/src/GPU/pair_vashishta_gpu.h +++ b/src/GPU/pair_vashishta_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(vashishta/gpu,PairVashishtaGPU) - +// clang-format off +PairStyle(vashishta/gpu,PairVashishtaGPU); +// clang-format on #else #ifndef LMP_PAIR_VASHISHTA_GPU_H @@ -32,7 +32,7 @@ class PairVashishtaGPU : public PairVashishta { double init_one(int, int); void init_style(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void allocate(); @@ -41,7 +41,7 @@ class PairVashishtaGPU : public PairVashishta { double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_yukawa_colloid_gpu.cpp b/src/GPU/pair_yukawa_colloid_gpu.cpp index 4e4e555134..386ec895c9 100644 --- a/src/GPU/pair_yukawa_colloid_gpu.cpp +++ b/src/GPU/pair_yukawa_colloid_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_yukawa_colloid_gpu.h b/src/GPU/pair_yukawa_colloid_gpu.h index d11a45af19..4af9dd1b63 100644 --- a/src/GPU/pair_yukawa_colloid_gpu.h +++ b/src/GPU/pair_yukawa_colloid_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(yukawa/colloid/gpu,PairYukawaColloidGPU) - +// clang-format off +PairStyle(yukawa/colloid/gpu,PairYukawaColloidGPU); +// clang-format on #else #ifndef LMP_PAIR_YUKAWA_COLLOID_GPU_H @@ -33,14 +33,14 @@ class PairYukawaColloidGPU : public PairYukawaColloid { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_yukawa_gpu.cpp b/src/GPU/pair_yukawa_gpu.cpp index 104adef8d5..444d7f475f 100644 --- a/src/GPU/pair_yukawa_gpu.cpp +++ b/src/GPU/pair_yukawa_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_yukawa_gpu.h b/src/GPU/pair_yukawa_gpu.h index d7bcccc9c1..a8a9194784 100644 --- a/src/GPU/pair_yukawa_gpu.h +++ b/src/GPU/pair_yukawa_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(yukawa/gpu,PairYukawaGPU) - +// clang-format off +PairStyle(yukawa/gpu,PairYukawaGPU); +// clang-format on #else #ifndef LMP_PAIR_YUKAWA_GPU_H @@ -33,14 +33,14 @@ class PairYukawaGPU : public PairYukawa { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_zbl_gpu.cpp b/src/GPU/pair_zbl_gpu.cpp index 267b9252bd..b7642a41a7 100644 --- a/src/GPU/pair_zbl_gpu.cpp +++ b/src/GPU/pair_zbl_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pair_zbl_gpu.h b/src/GPU/pair_zbl_gpu.h index ec1c3044f0..39811598b3 100644 --- a/src/GPU/pair_zbl_gpu.h +++ b/src/GPU/pair_zbl_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(zbl/gpu,PairZBLGPU) - +// clang-format off +PairStyle(zbl/gpu,PairZBLGPU); +// clang-format on #else #ifndef LMP_PAIR_ZBL_GPU_H @@ -33,14 +33,14 @@ class PairZBLGPU : public PairZBL { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index d6a827354c..b98b105045 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GPU/pppm_gpu.h b/src/GPU/pppm_gpu.h index f6f4ab0ef2..9e39c50151 100644 --- a/src/GPU/pppm_gpu.h +++ b/src/GPU/pppm_gpu.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/gpu,PPPMGPU) - +// clang-format off +KSpaceStyle(pppm/gpu,PPPMGPU); +// clang-format on #else #ifndef LMP_PPPM_GPU_H @@ -51,12 +51,11 @@ class PPPMGPU : public PPPM { void pack_reverse_grid(int, void *, int, int *); void unpack_reverse_grid(int, void *, int, int *); - FFT_SCALAR ***create_3d_offset(int, int, int, int, int, int, const char *, - FFT_SCALAR *, int); + FFT_SCALAR ***create_3d_offset(int, int, int, int, int, int, const char *, FFT_SCALAR *, int); void destroy_3d_offset(FFT_SCALAR ***, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/fix_freeze.cpp b/src/GRANULAR/fix_freeze.cpp index 6a16bbb1f6..1e952ef132 100644 --- a/src/GRANULAR/fix_freeze.cpp +++ b/src/GRANULAR/fix_freeze.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GRANULAR/fix_freeze.h b/src/GRANULAR/fix_freeze.h index 4cf36ffc4e..2fc5fda71e 100644 --- a/src/GRANULAR/fix_freeze.h +++ b/src/GRANULAR/fix_freeze.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(freeze,FixFreeze) - +// clang-format off +FixStyle(freeze,FixFreeze); +// clang-format on #else #ifndef LMP_FIX_FREEZE_H @@ -36,10 +36,10 @@ class FixFreeze : public Fix { protected: int force_flag; - double foriginal[3],foriginal_all[3]; + double foriginal[3], foriginal_all[3]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 68f37c7a25..a2f4d91840 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GRANULAR/fix_pour.h b/src/GRANULAR/fix_pour.h index 8ea69a936a..7c0bd5aff8 100644 --- a/src/GRANULAR/fix_pour.h +++ b/src/GRANULAR/fix_pour.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(pour,FixPour) - +// clang-format off +FixStyle(pour,FixPour); +// clang-format on #else #ifndef LMP_FIX_POUR_H @@ -36,39 +36,39 @@ class FixPour : public Fix { void *extract(const char *, int &); private: - int ninsert,ntype,seed; - int iregion,mode,idnext,dstyle,npoly,rigidflag,shakeflag; - int ignoreflag,ignoreline,ignoretri; - double radius_one,radius_max; - double radius_lo,radius_hi; - double *radius_poly,*frac_poly; - double density_lo,density_hi; + int ninsert, ntype, seed; + int iregion, mode, idnext, dstyle, npoly, rigidflag, shakeflag; + int ignoreflag, ignoreline, ignoretri; + double radius_one, radius_max; + double radius_lo, radius_hi; + double *radius_poly, *frac_poly; + double density_lo, density_hi; double volfrac; int maxattempt; int region_style; double rate; - double vxlo,vxhi,vylo,vyhi,vy,vz; - double xlo,xhi,ylo,yhi,zlo,zhi; - double xc,yc,rc; + double vxlo, vxhi, vylo, vyhi, vy, vz; + double xlo, xhi, ylo, yhi, zlo, zhi; + double xc, yc, rc; double grav; - char *idrigid,*idshake; + char *idrigid, *idshake; class Molecule **onemols; - int nmol,natom_max; + int nmol, natom_max; double molradius_max; double *molfrac; double **coords; imageint *imageflags; - class Fix *fixrigid,*fixshake; + class Fix *fixrigid, *fixshake; double oneradius; - int me,nprocs; - int *recvcounts,*displs; - int nfreq,ninserted,nper; + int me, nprocs; + int *recvcounts, *displs; + int nfreq, ninserted, nper; bigint nfirst; - double lo_current,hi_current; - tagint maxtag_all,maxmol_all; - class RanPark *random,*random2; + double lo_current, hi_current; + tagint maxtag_all, maxmol_all; + class RanPark *random, *random2; void find_maxid(); int overlap(int); @@ -78,7 +78,7 @@ class FixPour : public Fix { void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 136472f1cd..52311f64a7 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index 560067aa11..9a7c4055a1 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/gran,FixWallGran) - +// clang-format off +FixStyle(wall/gran,FixWallGran); +// clang-format on #else #ifndef LMP_FIX_WALL_GRAN_H @@ -26,9 +26,8 @@ namespace LAMMPS_NS { class FixWallGran : public Fix { public: - - enum {HOOKE,HOOKE_HISTORY,HERTZ_HISTORY,GRANULAR}; - enum {NORMAL_NONE, NORMAL_HOOKE, NORMAL_HERTZ, HERTZ_MATERIAL, DMT, JKR}; + enum { HOOKE, HOOKE_HISTORY, HERTZ_HISTORY, GRANULAR }; + enum { NORMAL_NONE, NORMAL_HOOKE, NORMAL_HERTZ, HERTZ_MATERIAL, DMT, JKR }; FixWallGran(class LAMMPS *, int, char **); virtual ~FixWallGran(); @@ -50,25 +49,22 @@ class FixWallGran : public Fix { virtual int maxsize_restart(); void reset_dt(); - void hooke(double, double, double, double, double *, double *, - double *, double *, double *, double, double, double*); - void hooke_history(double, double, double, double, double *, - double *, double *, double *, double *, double, - double, double *, double *); - void hertz_history(double, double, double, double, double *, - double, double *, double *, double *, double *, - double, double, double *, double *); - void granular(double, double, double, double, double *, double, - double *, double *, double *, double *, double, - double, double *, double *); + void hooke(double, double, double, double, double *, double *, double *, double *, double *, + double, double, double *); + void hooke_history(double, double, double, double, double *, double *, double *, double *, + double *, double, double, double *, double *); + void hertz_history(double, double, double, double, double *, double, double *, double *, double *, + double *, double, double, double *, double *); + void granular(double, double, double, double, double *, double, double *, double *, double *, + double *, double, double, double *, double *); double pulloff_distance(double); protected: - int wallstyle,wiggle,wshear,axis; - int pairstyle,nlevels_respa; + int wallstyle, wiggle, wshear, axis; + int pairstyle, nlevels_respa; bigint time_origin; - double kn,kt,gamman,gammat,xmu; + double kn, kt, gamman, gammat, xmu; // for granular model choices int normal_model, damping_model; @@ -93,8 +89,8 @@ class FixWallGran : public Fix { double roll_coeffs[3]; double twist_coeffs[3]; - double lo,hi,cylradius; - double amplitude,period,omega,vshear; + double lo, hi, cylradius; + double amplitude, period, omega, vshear; double dt; char *idregion; @@ -119,7 +115,7 @@ class FixWallGran : public Fix { void clear_stored_contacts(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 38fb8a68c2..0a92bac543 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GRANULAR/fix_wall_gran_region.h b/src/GRANULAR/fix_wall_gran_region.h index 2be9b1f693..e7f9dc89ef 100644 --- a/src/GRANULAR/fix_wall_gran_region.h +++ b/src/GRANULAR/fix_wall_gran_region.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/gran/region,FixWallGranRegion) - +// clang-format off +FixStyle(wall/gran/region,FixWallGranRegion); +// clang-format on #else #ifndef LMP_FIX_WALL_GRAN_REGION_H @@ -30,7 +30,7 @@ class FixWallGranRegion : public FixWallGran { ~FixWallGranRegion(); void post_force(int); void write_restart(FILE *); - void restart(char* ); + void restart(char *); void init(); double memory_usage(); @@ -51,20 +51,20 @@ class FixWallGranRegion : public FixWallGran { // shear history for multiple contacts per particle - int tmax; // max # of region walls one particle can touch - int *ncontact; // # of shear contacts per particle - int **walls; // which wall each contact is with - double ***history_many; // history per particle per contact - int *c2r; // contact to region mapping - // c2r[i] = index of Ith contact in - // region-contact[] list of contacts - int motion_resetflag; // used by restart to indicate that region - // vel info is to be reset + int tmax; // max # of region walls one particle can touch + int *ncontact; // # of shear contacts per particle + int **walls; // which wall each contact is with + double ***history_many; // history per particle per contact + int *c2r; // contact to region mapping + // c2r[i] = index of Ith contact in + // region-contact[] list of contacts + int motion_resetflag; // used by restart to indicate that region + // vel info is to be reset void update_contacts(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/pair_gran_hertz_history.cpp b/src/GRANULAR/pair_gran_hertz_history.cpp index 56e9691fad..2fa0f5acb8 100644 --- a/src/GRANULAR/pair_gran_hertz_history.cpp +++ b/src/GRANULAR/pair_gran_hertz_history.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GRANULAR/pair_gran_hertz_history.h b/src/GRANULAR/pair_gran_hertz_history.h index b813149c7c..1b02567119 100644 --- a/src/GRANULAR/pair_gran_hertz_history.h +++ b/src/GRANULAR/pair_gran_hertz_history.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gran/hertz/history,PairGranHertzHistory) - +// clang-format off +PairStyle(gran/hertz/history,PairGranHertzHistory); +// clang-format on #else #ifndef LMP_PAIR_GRAN_HERTZ_HISTORY_H @@ -32,7 +32,7 @@ class PairGranHertzHistory : public PairGranHookeHistory { double single(int, int, int, int, double, double, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/pair_gran_hooke.cpp b/src/GRANULAR/pair_gran_hooke.cpp index eb5ccec680..1ef69e041d 100644 --- a/src/GRANULAR/pair_gran_hooke.cpp +++ b/src/GRANULAR/pair_gran_hooke.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GRANULAR/pair_gran_hooke.h b/src/GRANULAR/pair_gran_hooke.h index a2d9cf4c3e..c43394012b 100644 --- a/src/GRANULAR/pair_gran_hooke.h +++ b/src/GRANULAR/pair_gran_hooke.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gran/hooke,PairGranHooke) - +// clang-format off +PairStyle(gran/hooke,PairGranHooke); +// clang-format on #else #ifndef LMP_PAIR_GRAN_HOOKE_H @@ -31,7 +31,7 @@ class PairGranHooke : public PairGranHookeHistory { double single(int, int, int, int, double, double, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp index fb9d6b81b9..753cceb247 100644 --- a/src/GRANULAR/pair_gran_hooke_history.cpp +++ b/src/GRANULAR/pair_gran_hooke_history.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GRANULAR/pair_gran_hooke_history.h b/src/GRANULAR/pair_gran_hooke_history.h index b8010cf5e0..22557bba6a 100644 --- a/src/GRANULAR/pair_gran_hooke_history.h +++ b/src/GRANULAR/pair_gran_hooke_history.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gran/hooke/history,PairGranHookeHistory) - +// clang-format off +PairStyle(gran/hooke/history,PairGranHookeHistory); +// clang-format on #else #ifndef LMP_PAIR_GRAN_HOOKE_HISTORY_H @@ -43,10 +43,10 @@ class PairGranHookeHistory : public Pair { void unpack_forward_comm(int, int, double *); double memory_usage(); double atom2cut(int); - double radii2cut(double,double); + double radii2cut(double, double); protected: - double kn,kt,gamman,gammat,xmu; + double kn, kt, gamman, gammat, xmu; int dampflag; double dt; int freeze_group_bit; @@ -54,8 +54,8 @@ class PairGranHookeHistory : public Pair { int limit_damping; int neighprev; - double *onerad_dynamic,*onerad_frozen; - double *maxrad_dynamic,*maxrad_frozen; + double *onerad_dynamic, *onerad_frozen; + double *maxrad_dynamic, *maxrad_frozen; int size_history; @@ -71,7 +71,7 @@ class PairGranHookeHistory : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 318656fc42..cca349b819 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index e5e76d175e..3430f0ebb7 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(granular,PairGranular) - +// clang-format off +PairStyle(granular,PairGranular); +// clang-format on #else #ifndef LMP_PAIR_GRANULAR_H @@ -41,7 +41,7 @@ class PairGranular : public Pair { void unpack_forward_comm(int, int, double *); double memory_usage(); double atom2cut(int); - double radii2cut(double,double); + double radii2cut(double, double); protected: double dt; @@ -49,8 +49,8 @@ class PairGranular : public Pair { int use_history; int neighprev; - double *onerad_dynamic,*onerad_frozen; - double *maxrad_dynamic,*maxrad_frozen; + double *onerad_dynamic, *onerad_frozen; + double *maxrad_dynamic, *maxrad_frozen; double **cut; class FixDummy *fix_dummy; @@ -63,7 +63,7 @@ class PairGranular : public Pair { int nmax; // allocated size of mass_rigid void allocate(); - void transfer_history(double*, double*); + void transfer_history(double *, double *); private: int size_history; @@ -102,7 +102,7 @@ class PairGranular : public Pair { double pulloff_distance(double, double, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KIM/fix_store_kim.cpp b/src/KIM/fix_store_kim.cpp index 6b702c15d5..3d2306c654 100644 --- a/src/KIM/fix_store_kim.cpp +++ b/src/KIM/fix_store_kim.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KIM/fix_store_kim.h b/src/KIM/fix_store_kim.h index 7244bd1b5f..266f280003 100644 --- a/src/KIM/fix_store_kim.h +++ b/src/KIM/fix_store_kim.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -56,9 +56,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(STORE/KIM,FixStoreKIM) - +// clang-format off +FixStyle(STORE/KIM,FixStoreKIM); +// clang-format on #else #ifndef LMP_FIX_STORE_KIM_H @@ -74,17 +74,17 @@ class FixStoreKIM : public Fix { ~FixStoreKIM(); int setmask(); - void setptr(const std::string &, void *); + void setptr(const std::string &, void *); void *getptr(const std::string &); private: - void *simulator_model; // pointer to KIM simulator model class - void *model_name; // string of KIM model name - void *model_units; // string of unit conversion origin or null pointer - void *user_units; // string of unit conversion target or null pointer + void *simulator_model; // pointer to KIM simulator model class + void *model_name; // string of KIM model name + void *model_units; // string of unit conversion origin or null pointer + void *user_units; // string of unit conversion target or null pointer }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KIM/kim_command.cpp b/src/KIM/kim_command.cpp index 2de86556b3..f0d320c21a 100644 --- a/src/KIM/kim_command.cpp +++ b/src/KIM/kim_command.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KIM/kim_command.h b/src/KIM/kim_command.h index f54ce58c22..98a9420c31 100644 --- a/src/KIM/kim_command.h +++ b/src/KIM/kim_command.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -54,9 +54,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(kim,KimCommand) - +// clang-format off +CommandStyle(kim,KimCommand); +// clang-format on #else #ifndef LMP_KIM_COMMAND_H @@ -68,11 +68,11 @@ namespace LAMMPS_NS { class KimCommand : public Command { public: - KimCommand(class LAMMPS *lmp) : Command(lmp) {}; + KimCommand(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KIM/kim_init.cpp b/src/KIM/kim_init.cpp index f22335b411..ea3dc46da4 100644 --- a/src/KIM/kim_init.cpp +++ b/src/KIM/kim_init.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KIM/kim_init.h b/src/KIM/kim_init.h index 866744e236..fa042f2723 100644 --- a/src/KIM/kim_init.h +++ b/src/KIM/kim_init.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -68,10 +68,11 @@ namespace LAMMPS_NS { class KimInit : protected Pointers { public: - KimInit(class LAMMPS *lmp) : Pointers(lmp) {}; + KimInit(class LAMMPS *lmp) : Pointers(lmp){}; void command(int, char **); - enum model_type_enum {MO, SM}; + enum model_type_enum { MO, SM }; static void write_log_cite(class LAMMPS *, model_type_enum, char *); + private: model_type_enum model_type; bool unit_conversion_mode; @@ -81,7 +82,7 @@ class KimInit : protected Pointers { void do_variables(const std::string &, const std::string &); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index d1afd92a1f..9a3aee87c0 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KIM/kim_interactions.h b/src/KIM/kim_interactions.h index 46fc95bff9..719e04b433 100644 --- a/src/KIM/kim_interactions.h +++ b/src/KIM/kim_interactions.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -65,15 +65,16 @@ namespace LAMMPS_NS { class KimInteractions : protected Pointers { public: - KimInteractions(class LAMMPS *lmp) : Pointers(lmp) {}; + KimInteractions(class LAMMPS *lmp) : Pointers(lmp){}; void command(int, char **); + private: void do_setup(int, char **); int species_to_atomic_no(const std::string &species) const; void KIM_SET_TYPE_PARAMETERS(const std::string &input_line) const; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KIM/kim_param.cpp b/src/KIM/kim_param.cpp index 8d3921f30c..d538ff3c8e 100644 --- a/src/KIM/kim_param.cpp +++ b/src/KIM/kim_param.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KIM/kim_param.h b/src/KIM/kim_param.h index b19d2c507b..8a4b3f474a 100644 --- a/src/KIM/kim_param.h +++ b/src/KIM/kim_param.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -60,17 +60,15 @@ #include "pointers.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { -class KimParam : protected Pointers -{ -public: +class KimParam : protected Pointers { + public: KimParam(class LAMMPS *lmp); void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KIM/kim_property.cpp b/src/KIM/kim_property.cpp index cea783b729..8145533107 100644 --- a/src/KIM/kim_property.cpp +++ b/src/KIM/kim_property.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KIM/kim_property.h b/src/KIM/kim_property.h index 7b5c999c66..6d3cfe8966 100644 --- a/src/KIM/kim_property.h +++ b/src/KIM/kim_property.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -58,17 +58,15 @@ #include "pointers.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { -class KimProperty : protected Pointers -{ -public: +class KimProperty : protected Pointers { + public: KimProperty(class LAMMPS *lmp); void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KIM/kim_query.cpp b/src/KIM/kim_query.cpp index 05381b8fab..c1669650cc 100644 --- a/src/KIM/kim_query.cpp +++ b/src/KIM/kim_query.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KIM/kim_query.h b/src/KIM/kim_query.h index 5d71856ee0..2d9def5735 100644 --- a/src/KIM/kim_query.h +++ b/src/KIM/kim_query.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -64,11 +64,11 @@ namespace LAMMPS_NS { class KimQuery : protected Pointers { public: - KimQuery(class LAMMPS *lmp) : Pointers(lmp) {}; + KimQuery(class LAMMPS *lmp) : Pointers(lmp){}; void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KIM/kim_units.cpp b/src/KIM/kim_units.cpp index b51d19bb99..82bbc46227 100644 --- a/src/KIM/kim_units.cpp +++ b/src/KIM/kim_units.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KIM/kim_units.h b/src/KIM/kim_units.h index caf88d7c76..e5e9c2809a 100644 --- a/src/KIM/kim_units.h +++ b/src/KIM/kim_units.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -57,8 +57,6 @@ #include -int lammps_unit_conversion(const std::string &unit_type_str, - const std::string &from_system_str, - const std::string &to_system_str, - double &conversion_factor); +int lammps_unit_conversion(const std::string &unit_type_str, const std::string &from_system_str, + const std::string &to_system_str, double &conversion_factor); #endif diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index aafc83aeaf..be52d98183 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index b769107b71..dab9dfdb4c 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -54,9 +54,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(kim,PairKIM) - +// clang-format off +PairStyle(kim,PairKIM); +// clang-format on #else #ifndef LMP_PAIR_KIM_H @@ -74,24 +74,25 @@ namespace LAMMPS_NS { class PairKIM : public Pair { public: - PairKIM(class LAMMPS*); + PairKIM(class LAMMPS *); ~PairKIM(); // LAMMPS Pair class virtual function prototypes virtual void compute(int, int); - virtual void settings(int, char**); - virtual void coeff(int, char**); + virtual void settings(int, char **); + virtual void coeff(int, char **); virtual void init_style(); virtual void init_list(int id, NeighList *ptr); virtual double init_one(int, int); - virtual int pack_reverse_comm(int, int, double*); - virtual void unpack_reverse_comm(int, int*, double*); + virtual int pack_reverse_comm(int, int, double *); + virtual void unpack_reverse_comm(int, int *, double *); virtual double memory_usage(); // Get the KIM_Model object KIM_Model *get_kim_model(); // Get the atom type list std::string get_atom_type_list(); + protected: // (nearly) all bool flags are not initialized in constructor, but set // explicitly in the indicated function. All other data members are @@ -100,7 +101,7 @@ class PairKIM : public Pair { int init_style_call_count; // values set in settings() - char* kim_modelname; + char *kim_modelname; // list of args that map atom species to KIM elements std::string atom_type_list; @@ -109,17 +110,17 @@ class PairKIM : public Pair { // values set in allocate(), called by coeff() virtual void allocate(); - int* lmps_map_species_to_unique; + int *lmps_map_species_to_unique; // values set in coeff(), after calling allocate() - char** lmps_unique_elements; // names of unique elements given - // in pair_coeff command + char **lmps_unique_elements; // names of unique elements given + // in pair_coeff command int lmps_num_unique_elements; // values set in set_lmps_flags(), called from init_style() bool lmps_using_newton; bool lmps_using_molecular; - enum unit_sys {REAL, METAL, SI, CGS, ELECTRON}; + enum unit_sys { REAL, METAL, SI, CGS, ELECTRON }; unit_sys lmps_units; KIM_LengthUnit lengthUnit; KIM_EnergyUnit energyUnit; @@ -127,8 +128,8 @@ class PairKIM : public Pair { KIM_TemperatureUnit temperatureUnit; KIM_TimeUnit timeUnit; - KIM_Model * pkim; - KIM_ComputeArguments * pargs; + KIM_Model *pkim; + KIM_ComputeArguments *pargs; // values set in set_kim_model_has_flags(), called by kim_init() KIM_SupportStatus kim_model_support_for_energy; @@ -139,23 +140,23 @@ class PairKIM : public Pair { // values set in kim_init() bool kim_init_ok; int lmps_local_tot_num_atoms; - double kim_global_influence_distance; // KIM Model cutoff value + double kim_global_influence_distance; // KIM Model cutoff value int kim_number_of_neighbor_lists; - double const * kim_cutoff_values; - int const * modelWillNotRequestNeighborsOfNoncontributingParticles; - class NeighList ** neighborLists; + double const *kim_cutoff_values; + int const *modelWillNotRequestNeighborsOfNoncontributingParticles; + class NeighList **neighborLists; // values set in init_style() bool kim_particle_codes_ok; int *kim_particle_codes; // values set in compute() - int lmps_maxalloc; // max allocated memory value - int* kim_particleSpecies; // array of KIM particle species - int* kim_particleContributing; // array of KIM particle contributing - int* lmps_stripped_neigh_list; // neighbors of one atom, used when LAMMPS - // is in molecular mode - int** lmps_stripped_neigh_ptr; // pointer into lists + int lmps_maxalloc; // max allocated memory value + int *kim_particleSpecies; // array of KIM particle species + int *kim_particleContributing; // array of KIM particle contributing + int *lmps_stripped_neigh_list; // neighbors of one atom, used when LAMMPS + // is in molecular mode + int **lmps_stripped_neigh_ptr; // pointer into lists // KIM specific helper functions virtual void set_contributing(); @@ -166,14 +167,12 @@ class PairKIM : public Pair { virtual void set_kim_model_has_flags(); virtual int check_for_routine_compatibility(); // static methods used as callbacks from KIM - static int get_neigh( - void const * const dataObject, - int const numberOfCutoffs, double const * const cutoffs, - int const neighborListIndex, int const particleNumber, - int * const numberOfNeighbors, - int const ** const neighborsOfParticle); + static int get_neigh(void const *const dataObject, int const numberOfCutoffs, + double const *const cutoffs, int const neighborListIndex, + int const particleNumber, int *const numberOfNeighbors, + int const **const neighborsOfParticle); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KOKKOS/angle_charmm_kokkos.cpp b/src/KOKKOS/angle_charmm_kokkos.cpp index b363062c20..74ced2a934 100644 --- a/src/KOKKOS/angle_charmm_kokkos.cpp +++ b/src/KOKKOS/angle_charmm_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/angle_charmm_kokkos.h b/src/KOKKOS/angle_charmm_kokkos.h index 7abb1d0ad2..0a606401a8 100644 --- a/src/KOKKOS/angle_charmm_kokkos.h +++ b/src/KOKKOS/angle_charmm_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(charmm/kk,AngleCharmmKokkos) -AngleStyle(charmm/kk/device,AngleCharmmKokkos) -AngleStyle(charmm/kk/host,AngleCharmmKokkos) - +// clang-format off +AngleStyle(charmm/kk,AngleCharmmKokkos); +AngleStyle(charmm/kk/device,AngleCharmmKokkos); +AngleStyle(charmm/kk/host,AngleCharmmKokkos); +// clang-format on #else #ifndef LMP_ANGLE_CHARMM_KOKKOS_H diff --git a/src/KOKKOS/angle_class2_kokkos.cpp b/src/KOKKOS/angle_class2_kokkos.cpp index a640289c76..146e8b40ea 100644 --- a/src/KOKKOS/angle_class2_kokkos.cpp +++ b/src/KOKKOS/angle_class2_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/angle_class2_kokkos.h b/src/KOKKOS/angle_class2_kokkos.h index adc5ec7f4a..1a7650fddf 100644 --- a/src/KOKKOS/angle_class2_kokkos.h +++ b/src/KOKKOS/angle_class2_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(class2/kk,AngleClass2Kokkos) -AngleStyle(class2/kk/device,AngleClass2Kokkos) -AngleStyle(class2/kk/host,AngleClass2Kokkos) - +// clang-format off +AngleStyle(class2/kk,AngleClass2Kokkos); +AngleStyle(class2/kk/device,AngleClass2Kokkos); +AngleStyle(class2/kk/host,AngleClass2Kokkos); +// clang-format on #else #ifndef LMP_ANGLE_CLASS2_KOKKOS_H diff --git a/src/KOKKOS/angle_cosine_kokkos.cpp b/src/KOKKOS/angle_cosine_kokkos.cpp index 9f70df3baf..8b3360988f 100644 --- a/src/KOKKOS/angle_cosine_kokkos.cpp +++ b/src/KOKKOS/angle_cosine_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/angle_cosine_kokkos.h b/src/KOKKOS/angle_cosine_kokkos.h index 0d1eb863e1..6510cc8ecd 100644 --- a/src/KOKKOS/angle_cosine_kokkos.h +++ b/src/KOKKOS/angle_cosine_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine/kk,AngleCosineKokkos) -AngleStyle(cosine/kk/device,AngleCosineKokkos) -AngleStyle(cosine/kk/host,AngleCosineKokkos) - +// clang-format off +AngleStyle(cosine/kk,AngleCosineKokkos); +AngleStyle(cosine/kk/device,AngleCosineKokkos); +AngleStyle(cosine/kk/host,AngleCosineKokkos); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_KOKKOS_H diff --git a/src/KOKKOS/angle_harmonic_kokkos.cpp b/src/KOKKOS/angle_harmonic_kokkos.cpp index 088f1072dc..6342c2f46f 100644 --- a/src/KOKKOS/angle_harmonic_kokkos.cpp +++ b/src/KOKKOS/angle_harmonic_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/angle_harmonic_kokkos.h b/src/KOKKOS/angle_harmonic_kokkos.h index a826e28ff1..df8b75c8bf 100644 --- a/src/KOKKOS/angle_harmonic_kokkos.h +++ b/src/KOKKOS/angle_harmonic_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(harmonic/kk,AngleHarmonicKokkos) -AngleStyle(harmonic/kk/device,AngleHarmonicKokkos) -AngleStyle(harmonic/kk/host,AngleHarmonicKokkos) - +// clang-format off +AngleStyle(harmonic/kk,AngleHarmonicKokkos); +AngleStyle(harmonic/kk/device,AngleHarmonicKokkos); +AngleStyle(harmonic/kk/host,AngleHarmonicKokkos); +// clang-format on #else #ifndef LMP_ANGLE_HARMONIC_KOKKOS_H diff --git a/src/KOKKOS/atom_kokkos.cpp b/src/KOKKOS/atom_kokkos.cpp index 98b33368b7..a8527989d7 100644 --- a/src/KOKKOS/atom_kokkos.cpp +++ b/src/KOKKOS/atom_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_kokkos.h b/src/KOKKOS/atom_kokkos.h index c4845173f2..e807180f35 100644 --- a/src/KOKKOS/atom_kokkos.h +++ b/src/KOKKOS/atom_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_angle_kokkos.cpp b/src/KOKKOS/atom_vec_angle_kokkos.cpp index 67538314c3..c713427aa7 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.cpp +++ b/src/KOKKOS/atom_vec_angle_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_angle_kokkos.h b/src/KOKKOS/atom_vec_angle_kokkos.h index fcaaf5659e..e80c0caca8 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.h +++ b/src/KOKKOS/atom_vec_angle_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(angle/kk,AtomVecAngleKokkos) -AtomStyle(angle/kk/device,AtomVecAngleKokkos) -AtomStyle(angle/kk/host,AtomVecAngleKokkos) - +// clang-format off +AtomStyle(angle/kk,AtomVecAngleKokkos); +AtomStyle(angle/kk/device,AtomVecAngleKokkos); +AtomStyle(angle/kk/host,AtomVecAngleKokkos); +// clang-format on #else #ifndef LMP_ATOM_VEC_ANGLE_KOKKOS_H diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.cpp b/src/KOKKOS/atom_vec_atomic_kokkos.cpp index d370aa1926..eec2486763 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.cpp +++ b/src/KOKKOS/atom_vec_atomic_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.h b/src/KOKKOS/atom_vec_atomic_kokkos.h index 30a6c43b7e..77d7719baa 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.h +++ b/src/KOKKOS/atom_vec_atomic_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale AtomicKokkos/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(atomic/kk,AtomVecAtomicKokkos) -AtomStyle(atomic/kk/device,AtomVecAtomicKokkos) -AtomStyle(atomic/kk/host,AtomVecAtomicKokkos) - +// clang-format off +AtomStyle(atomic/kk,AtomVecAtomicKokkos); +AtomStyle(atomic/kk/device,AtomVecAtomicKokkos); +AtomStyle(atomic/kk/host,AtomVecAtomicKokkos); +// clang-format on #else #ifndef LMP_ATOM_VEC_ATOMIC_KOKKOS_H diff --git a/src/KOKKOS/atom_vec_bond_kokkos.cpp b/src/KOKKOS/atom_vec_bond_kokkos.cpp index feb5552023..7582a01730 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.cpp +++ b/src/KOKKOS/atom_vec_bond_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_bond_kokkos.h b/src/KOKKOS/atom_vec_bond_kokkos.h index e73299dff0..8038775d02 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.h +++ b/src/KOKKOS/atom_vec_bond_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(bond/kk,AtomVecBondKokkos) -AtomStyle(bond/kk/device,AtomVecBondKokkos) -AtomStyle(bond/kk/host,AtomVecBondKokkos) - +// clang-format off +AtomStyle(bond/kk,AtomVecBondKokkos); +AtomStyle(bond/kk/device,AtomVecBondKokkos); +AtomStyle(bond/kk/host,AtomVecBondKokkos); +// clang-format on #else #ifndef LMP_ATOM_VEC_BOND_KOKKOS_H diff --git a/src/KOKKOS/atom_vec_charge_kokkos.cpp b/src/KOKKOS/atom_vec_charge_kokkos.cpp index 298d717c77..3bb0985afe 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.cpp +++ b/src/KOKKOS/atom_vec_charge_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_charge_kokkos.h b/src/KOKKOS/atom_vec_charge_kokkos.h index 00cf079039..db1d5cb85b 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.h +++ b/src/KOKKOS/atom_vec_charge_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(charge/kk,AtomVecChargeKokkos) -AtomStyle(charge/kk/device,AtomVecChargeKokkos) -AtomStyle(charge/kk/host,AtomVecChargeKokkos) - +// clang-format off +AtomStyle(charge/kk,AtomVecChargeKokkos); +AtomStyle(charge/kk/device,AtomVecChargeKokkos); +AtomStyle(charge/kk/host,AtomVecChargeKokkos); +// clang-format on #else #ifndef LMP_ATOM_VEC_CHARGE_KOKKOS_H diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.cpp b/src/KOKKOS/atom_vec_dpd_kokkos.cpp index 504712ff0d..4358a49358 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.cpp +++ b/src/KOKKOS/atom_vec_dpd_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.h b/src/KOKKOS/atom_vec_dpd_kokkos.h index 2ac6ff1c9b..80a51430fa 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.h +++ b/src/KOKKOS/atom_vec_dpd_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale AtomicKokkos/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(dpd/kk,AtomVecDPDKokkos) -AtomStyle(dpd/kk/device,AtomVecDPDKokkos) -AtomStyle(dpd/kk/host,AtomVecDPDKokkos) - +// clang-format off +AtomStyle(dpd/kk,AtomVecDPDKokkos); +AtomStyle(dpd/kk/device,AtomVecDPDKokkos); +AtomStyle(dpd/kk/host,AtomVecDPDKokkos); +// clang-format on #else #ifndef LMP_ATOM_VEC_DPD_KOKKOS_H diff --git a/src/KOKKOS/atom_vec_full_kokkos.cpp b/src/KOKKOS/atom_vec_full_kokkos.cpp index 7a914d6841..45ce316d3f 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.cpp +++ b/src/KOKKOS/atom_vec_full_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_full_kokkos.h b/src/KOKKOS/atom_vec_full_kokkos.h index 0a0f779884..7246344b9f 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.h +++ b/src/KOKKOS/atom_vec_full_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(full/kk,AtomVecFullKokkos) -AtomStyle(full/kk/device,AtomVecFullKokkos) -AtomStyle(full/kk/host,AtomVecFullKokkos) - +// clang-format off +AtomStyle(full/kk,AtomVecFullKokkos); +AtomStyle(full/kk/device,AtomVecFullKokkos); +AtomStyle(full/kk/host,AtomVecFullKokkos); +// clang-format on #else #ifndef LMP_ATOM_VEC_FULL_KOKKOS_H diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp index c962ed0c71..6b9f6852ad 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.h b/src/KOKKOS/atom_vec_hybrid_kokkos.h index c70da508c8..8b19c9dc76 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.h +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(hybrid/kk,AtomVecHybridKokkos) - +// clang-format off +AtomStyle(hybrid/kk,AtomVecHybridKokkos); +// clang-format on #else #ifndef LMP_ATOM_VEC_HYBRID_KOKKOS_H diff --git a/src/KOKKOS/atom_vec_kokkos.cpp b/src/KOKKOS/atom_vec_kokkos.cpp index 4f2ac5f625..1255712a21 100644 --- a/src/KOKKOS/atom_vec_kokkos.cpp +++ b/src/KOKKOS/atom_vec_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_kokkos.h b/src/KOKKOS/atom_vec_kokkos.h index 55ebf3d960..c596d80e94 100644 --- a/src/KOKKOS/atom_vec_kokkos.h +++ b/src/KOKKOS/atom_vec_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.cpp b/src/KOKKOS/atom_vec_molecular_kokkos.cpp index d49403b8df..016e3f80e3 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.cpp +++ b/src/KOKKOS/atom_vec_molecular_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.h b/src/KOKKOS/atom_vec_molecular_kokkos.h index 7872dab52c..b07fefb7f4 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.h +++ b/src/KOKKOS/atom_vec_molecular_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(molecular/kk,AtomVecMolecularKokkos) -AtomStyle(molecular/kk/device,AtomVecMolecularKokkos) -AtomStyle(molecular/kk/host,AtomVecMolecularKokkos) - +// clang-format off +AtomStyle(molecular/kk,AtomVecMolecularKokkos); +AtomStyle(molecular/kk/device,AtomVecMolecularKokkos); +AtomStyle(molecular/kk/host,AtomVecMolecularKokkos); +// clang-format on #else #ifndef LMP_ATOM_VEC_MOLECULAR_KOKKOS_H diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.cpp b/src/KOKKOS/atom_vec_sphere_kokkos.cpp index 4dcc8dd510..6b29af824a 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.cpp +++ b/src/KOKKOS/atom_vec_sphere_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.h b/src/KOKKOS/atom_vec_sphere_kokkos.h index 6edda5dcdf..6d8f779421 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.h +++ b/src/KOKKOS/atom_vec_sphere_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(sphere/kk,AtomVecSphereKokkos) -AtomStyle(sphere/kk/device,AtomVecSphereKokkos) -AtomStyle(sphere/kk/host,AtomVecSphereKokkos) - +// clang-format off +AtomStyle(sphere/kk,AtomVecSphereKokkos); +AtomStyle(sphere/kk/device,AtomVecSphereKokkos); +AtomStyle(sphere/kk/host,AtomVecSphereKokkos); +// clang-format on #else #ifndef LMP_ATOM_VEC_SPHERE_KOKKOS_H diff --git a/src/KOKKOS/atom_vec_spin_kokkos.cpp b/src/KOKKOS/atom_vec_spin_kokkos.cpp index bb48474a9a..c8f0663806 100644 --- a/src/KOKKOS/atom_vec_spin_kokkos.cpp +++ b/src/KOKKOS/atom_vec_spin_kokkos.cpp @@ -1,7 +1,8 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/atom_vec_spin_kokkos.h b/src/KOKKOS/atom_vec_spin_kokkos.h index c5f9a826ec..615322329e 100644 --- a/src/KOKKOS/atom_vec_spin_kokkos.h +++ b/src/KOKKOS/atom_vec_spin_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(spin/kk,AtomVecSpinKokkos) -AtomStyle(spin/kk/device,AtomVecSpinKokkos) -AtomStyle(spin/kk/host,AtomVecSpinKokkos) - +// clang-format off +AtomStyle(spin/kk,AtomVecSpinKokkos); +AtomStyle(spin/kk/device,AtomVecSpinKokkos); +AtomStyle(spin/kk/host,AtomVecSpinKokkos); +// clang-format on #else #ifndef LMP_ATOM_VEC_SPIN_KOKKOS_H diff --git a/src/KOKKOS/bond_class2_kokkos.cpp b/src/KOKKOS/bond_class2_kokkos.cpp index aca385423e..e538c8e045 100644 --- a/src/KOKKOS/bond_class2_kokkos.cpp +++ b/src/KOKKOS/bond_class2_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/bond_class2_kokkos.h b/src/KOKKOS/bond_class2_kokkos.h index 15d3af7570..d0d8b5cd89 100644 --- a/src/KOKKOS/bond_class2_kokkos.h +++ b/src/KOKKOS/bond_class2_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(class2/kk,BondClass2Kokkos) -BondStyle(class2/kk/device,BondClass2Kokkos) -BondStyle(class2/kk/host,BondClass2Kokkos) - +// clang-format off +BondStyle(class2/kk,BondClass2Kokkos); +BondStyle(class2/kk/device,BondClass2Kokkos); +BondStyle(class2/kk/host,BondClass2Kokkos); +// clang-format on #else #ifndef LMP_BOND_CLASS2_KOKKOS_H diff --git a/src/KOKKOS/bond_fene_kokkos.cpp b/src/KOKKOS/bond_fene_kokkos.cpp index 4a7e2003b1..96daff4fed 100644 --- a/src/KOKKOS/bond_fene_kokkos.cpp +++ b/src/KOKKOS/bond_fene_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/bond_fene_kokkos.h b/src/KOKKOS/bond_fene_kokkos.h index 751c7f8312..5f5d0055e4 100644 --- a/src/KOKKOS/bond_fene_kokkos.h +++ b/src/KOKKOS/bond_fene_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(fene/kk,BondFENEKokkos) -BondStyle(fene/kk/device,BondFENEKokkos) -BondStyle(fene/kk/host,BondFENEKokkos) - +// clang-format off +BondStyle(fene/kk,BondFENEKokkos); +BondStyle(fene/kk/device,BondFENEKokkos); +BondStyle(fene/kk/host,BondFENEKokkos); +// clang-format on #else #ifndef LMP_BOND_FENE_KOKKOS_H diff --git a/src/KOKKOS/bond_harmonic_kokkos.cpp b/src/KOKKOS/bond_harmonic_kokkos.cpp index ccbafd28c6..9b99ab0f4c 100644 --- a/src/KOKKOS/bond_harmonic_kokkos.cpp +++ b/src/KOKKOS/bond_harmonic_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/bond_harmonic_kokkos.h b/src/KOKKOS/bond_harmonic_kokkos.h index b337dff0db..be0da91232 100644 --- a/src/KOKKOS/bond_harmonic_kokkos.h +++ b/src/KOKKOS/bond_harmonic_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(harmonic/kk,BondHarmonicKokkos) -BondStyle(harmonic/kk/device,BondHarmonicKokkos) -BondStyle(harmonic/kk/host,BondHarmonicKokkos) - +// clang-format off +BondStyle(harmonic/kk,BondHarmonicKokkos); +BondStyle(harmonic/kk/device,BondHarmonicKokkos); +BondStyle(harmonic/kk/host,BondHarmonicKokkos); +// clang-format on #else #ifndef LMP_BOND_HARMONIC_KOKKOS_H diff --git a/src/KOKKOS/comm_kokkos.cpp b/src/KOKKOS/comm_kokkos.cpp index e3ba5467b0..fd5318e1d1 100644 --- a/src/KOKKOS/comm_kokkos.cpp +++ b/src/KOKKOS/comm_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/comm_kokkos.h b/src/KOKKOS/comm_kokkos.h index b66de5a0d0..e252173141 100644 --- a/src/KOKKOS/comm_kokkos.h +++ b/src/KOKKOS/comm_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/comm_tiled_kokkos.cpp b/src/KOKKOS/comm_tiled_kokkos.cpp index e62b839bd7..7c4dff4819 100644 --- a/src/KOKKOS/comm_tiled_kokkos.cpp +++ b/src/KOKKOS/comm_tiled_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/comm_tiled_kokkos.h b/src/KOKKOS/comm_tiled_kokkos.h index 28f88de7b3..8877feec75 100644 --- a/src/KOKKOS/comm_tiled_kokkos.h +++ b/src/KOKKOS/comm_tiled_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/compute_coord_atom_kokkos.cpp b/src/KOKKOS/compute_coord_atom_kokkos.cpp index b447d2cd7b..b71cd1ec4a 100644 --- a/src/KOKKOS/compute_coord_atom_kokkos.cpp +++ b/src/KOKKOS/compute_coord_atom_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/compute_coord_atom_kokkos.h b/src/KOKKOS/compute_coord_atom_kokkos.h index 37b9d1f683..49e56546dc 100644 --- a/src/KOKKOS/compute_coord_atom_kokkos.h +++ b/src/KOKKOS/compute_coord_atom_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(coord/atom/kk,ComputeCoordAtomKokkos) -ComputeStyle(coord/atom/kk/device,ComputeCoordAtomKokkos) -ComputeStyle(coord/atom/kk/host,ComputeCoordAtomKokkos) - +// clang-format off +ComputeStyle(coord/atom/kk,ComputeCoordAtomKokkos); +ComputeStyle(coord/atom/kk/device,ComputeCoordAtomKokkos); +ComputeStyle(coord/atom/kk/host,ComputeCoordAtomKokkos); +// clang-format on #else #ifndef LMP_COMPUTE_COORD_ATOM_KOKKOS_H diff --git a/src/KOKKOS/compute_orientorder_atom_kokkos.cpp b/src/KOKKOS/compute_orientorder_atom_kokkos.cpp index 65c4737ab4..131e9933e8 100644 --- a/src/KOKKOS/compute_orientorder_atom_kokkos.cpp +++ b/src/KOKKOS/compute_orientorder_atom_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/compute_orientorder_atom_kokkos.h b/src/KOKKOS/compute_orientorder_atom_kokkos.h index 80f2ddb221..7ecb7388d3 100644 --- a/src/KOKKOS/compute_orientorder_atom_kokkos.h +++ b/src/KOKKOS/compute_orientorder_atom_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(orientorder/atom/kk,ComputeOrientOrderAtomKokkos) -ComputeStyle(orientorder/atom/kk/device,ComputeOrientOrderAtomKokkos) -ComputeStyle(orientorder/atom/kk/host,ComputeOrientOrderAtomKokkos) - +// clang-format off +ComputeStyle(orientorder/atom/kk,ComputeOrientOrderAtomKokkos); +ComputeStyle(orientorder/atom/kk/device,ComputeOrientOrderAtomKokkos); +ComputeStyle(orientorder/atom/kk/host,ComputeOrientOrderAtomKokkos); +// clang-format on #else #ifndef LMP_COMPUTE_ORIENTORDER_ATOM_KOKKOS_H diff --git a/src/KOKKOS/compute_temp_kokkos.cpp b/src/KOKKOS/compute_temp_kokkos.cpp index e85ae631a4..e9198dc9db 100644 --- a/src/KOKKOS/compute_temp_kokkos.cpp +++ b/src/KOKKOS/compute_temp_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/compute_temp_kokkos.h b/src/KOKKOS/compute_temp_kokkos.h index 61c7501784..792e2e17db 100644 --- a/src/KOKKOS/compute_temp_kokkos.h +++ b/src/KOKKOS/compute_temp_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/kk,ComputeTempKokkos) -ComputeStyle(temp/kk/device,ComputeTempKokkos) -ComputeStyle(temp/kk/host,ComputeTempKokkos) - +// clang-format off +ComputeStyle(temp/kk,ComputeTempKokkos); +ComputeStyle(temp/kk/device,ComputeTempKokkos); +ComputeStyle(temp/kk/host,ComputeTempKokkos); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_KOKKOS_H diff --git a/src/KOKKOS/dihedral_charmm_kokkos.cpp b/src/KOKKOS/dihedral_charmm_kokkos.cpp index a17c0f5ecd..f4b3e8ce61 100644 --- a/src/KOKKOS/dihedral_charmm_kokkos.cpp +++ b/src/KOKKOS/dihedral_charmm_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/dihedral_charmm_kokkos.h b/src/KOKKOS/dihedral_charmm_kokkos.h index dbd9986bf9..7821823e64 100644 --- a/src/KOKKOS/dihedral_charmm_kokkos.h +++ b/src/KOKKOS/dihedral_charmm_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(charmm/kk,DihedralCharmmKokkos) -DihedralStyle(charmm/kk/device,DihedralCharmmKokkos) -DihedralStyle(charmm/kk/host,DihedralCharmmKokkos) - +// clang-format off +DihedralStyle(charmm/kk,DihedralCharmmKokkos); +DihedralStyle(charmm/kk/device,DihedralCharmmKokkos); +DihedralStyle(charmm/kk/host,DihedralCharmmKokkos); +// clang-format on #else #ifndef LMP_DIHEDRAL_CHARMM_KOKKOS_H diff --git a/src/KOKKOS/dihedral_class2_kokkos.cpp b/src/KOKKOS/dihedral_class2_kokkos.cpp index bae2e39268..65c6903608 100644 --- a/src/KOKKOS/dihedral_class2_kokkos.cpp +++ b/src/KOKKOS/dihedral_class2_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/dihedral_class2_kokkos.h b/src/KOKKOS/dihedral_class2_kokkos.h index ef2b7f68ab..746b7f8de0 100644 --- a/src/KOKKOS/dihedral_class2_kokkos.h +++ b/src/KOKKOS/dihedral_class2_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(class2/kk,DihedralClass2Kokkos) -DihedralStyle(class2/kk/device,DihedralClass2Kokkos) -DihedralStyle(class2/kk/host,DihedralClass2Kokkos) - +// clang-format off +DihedralStyle(class2/kk,DihedralClass2Kokkos); +DihedralStyle(class2/kk/device,DihedralClass2Kokkos); +DihedralStyle(class2/kk/host,DihedralClass2Kokkos); +// clang-format on #else #ifndef LMP_DIHEDRAL_CLASS2_KOKKOS_H diff --git a/src/KOKKOS/dihedral_harmonic_kokkos.cpp b/src/KOKKOS/dihedral_harmonic_kokkos.cpp index 000956fb1d..a61a76496a 100644 --- a/src/KOKKOS/dihedral_harmonic_kokkos.cpp +++ b/src/KOKKOS/dihedral_harmonic_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/dihedral_harmonic_kokkos.h b/src/KOKKOS/dihedral_harmonic_kokkos.h index 1c50a9a4a5..3c9beb8852 100644 --- a/src/KOKKOS/dihedral_harmonic_kokkos.h +++ b/src/KOKKOS/dihedral_harmonic_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(harmonic/kk,DihedralHarmonicKokkos) -DihedralStyle(harmonic/kk/device,DihedralHarmonicKokkos) -DihedralStyle(harmonic/kk/host,DihedralHarmonicKokkos) - +// clang-format off +DihedralStyle(harmonic/kk,DihedralHarmonicKokkos); +DihedralStyle(harmonic/kk/device,DihedralHarmonicKokkos); +DihedralStyle(harmonic/kk/host,DihedralHarmonicKokkos); +// clang-format on #else #ifndef LMP_DIHEDRAL_HARMONIC_KOKKOS_H diff --git a/src/KOKKOS/dihedral_opls_kokkos.cpp b/src/KOKKOS/dihedral_opls_kokkos.cpp index 13bdc0f222..69faf0ee38 100644 --- a/src/KOKKOS/dihedral_opls_kokkos.cpp +++ b/src/KOKKOS/dihedral_opls_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/dihedral_opls_kokkos.h b/src/KOKKOS/dihedral_opls_kokkos.h index 2ec2c4e4fa..e2a0827dc9 100644 --- a/src/KOKKOS/dihedral_opls_kokkos.h +++ b/src/KOKKOS/dihedral_opls_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(opls/kk,DihedralOPLSKokkos) -DihedralStyle(opls/kk/device,DihedralOPLSKokkos) -DihedralStyle(opls/kk/host,DihedralOPLSKokkos) - +// clang-format off +DihedralStyle(opls/kk,DihedralOPLSKokkos); +DihedralStyle(opls/kk/device,DihedralOPLSKokkos); +DihedralStyle(opls/kk/host,DihedralOPLSKokkos); +// clang-format on #else #ifndef LMP_DIHEDRAL_OPLS_KOKKOS_H diff --git a/src/KOKKOS/domain_kokkos.cpp b/src/KOKKOS/domain_kokkos.cpp index 0d03f6c910..82e1684de9 100644 --- a/src/KOKKOS/domain_kokkos.cpp +++ b/src/KOKKOS/domain_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/domain_kokkos.h b/src/KOKKOS/domain_kokkos.h index be0a036d06..591d2ef7b9 100644 --- a/src/KOKKOS/domain_kokkos.h +++ b/src/KOKKOS/domain_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fft3d_kokkos.cpp b/src/KOKKOS/fft3d_kokkos.cpp index a8b366d389..737c2f20b5 100644 --- a/src/KOKKOS/fft3d_kokkos.cpp +++ b/src/KOKKOS/fft3d_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fft3d_kokkos.h b/src/KOKKOS/fft3d_kokkos.h index 9a20580d4a..387574b198 100644 --- a/src/KOKKOS/fft3d_kokkos.h +++ b/src/KOKKOS/fft3d_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fftdata_kokkos.h b/src/KOKKOS/fftdata_kokkos.h index ba62670bdf..8a853c33af 100644 --- a/src/KOKKOS/fftdata_kokkos.h +++ b/src/KOKKOS/fftdata_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_deform_kokkos.cpp b/src/KOKKOS/fix_deform_kokkos.cpp index 35e432999b..bf7fdfb429 100644 --- a/src/KOKKOS/fix_deform_kokkos.cpp +++ b/src/KOKKOS/fix_deform_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_deform_kokkos.h b/src/KOKKOS/fix_deform_kokkos.h index 4388030ec3..90bdab1439 100644 --- a/src/KOKKOS/fix_deform_kokkos.h +++ b/src/KOKKOS/fix_deform_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(deform/kk,FixDeformKokkos) -FixStyle(deform/kk/device,FixDeformKokkos) -FixStyle(deform/kk/host,FixDeformKokkos) - +// clang-format off +FixStyle(deform/kk,FixDeformKokkos); +FixStyle(deform/kk/device,FixDeformKokkos); +FixStyle(deform/kk/host,FixDeformKokkos); +// clang-format on #else #ifndef LMP_FIX_DEFORM_KOKKOS_H diff --git a/src/KOKKOS/fix_dpd_energy_kokkos.cpp b/src/KOKKOS/fix_dpd_energy_kokkos.cpp index f5231cd24c..d45af7df71 100644 --- a/src/KOKKOS/fix_dpd_energy_kokkos.cpp +++ b/src/KOKKOS/fix_dpd_energy_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_dpd_energy_kokkos.h b/src/KOKKOS/fix_dpd_energy_kokkos.h index ddf33a5181..0f88e279dd 100644 --- a/src/KOKKOS/fix_dpd_energy_kokkos.h +++ b/src/KOKKOS/fix_dpd_energy_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(dpd/energy/kk,FixDPDenergyKokkos) -FixStyle(dpd/energy/kk/device,FixDPDenergyKokkos) -FixStyle(dpd/energy/kk/host,FixDPDenergyKokkos) - +// clang-format off +FixStyle(dpd/energy/kk,FixDPDenergyKokkos); +FixStyle(dpd/energy/kk/device,FixDPDenergyKokkos); +FixStyle(dpd/energy/kk/host,FixDPDenergyKokkos); +// clang-format on #else #ifndef LMP_FIX_DPDE_KOKKOS_H diff --git a/src/KOKKOS/fix_enforce2d_kokkos.cpp b/src/KOKKOS/fix_enforce2d_kokkos.cpp index e4cf0e5309..ea2ebf3f47 100644 --- a/src/KOKKOS/fix_enforce2d_kokkos.cpp +++ b/src/KOKKOS/fix_enforce2d_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_enforce2d_kokkos.h b/src/KOKKOS/fix_enforce2d_kokkos.h index df07a87f73..0dc613d729 100644 --- a/src/KOKKOS/fix_enforce2d_kokkos.h +++ b/src/KOKKOS/fix_enforce2d_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(enforce2d/kk,FixEnforce2DKokkos) -FixStyle(enforce2d/kk/device,FixEnforce2DKokkos) -FixStyle(enforce2d/kk/host,FixEnforce2DKokkos) - +// clang-format off +FixStyle(enforce2d/kk,FixEnforce2DKokkos); +FixStyle(enforce2d/kk/device,FixEnforce2DKokkos); +FixStyle(enforce2d/kk/host,FixEnforce2DKokkos); +// clang-format on #else #ifndef LMP_FIX_ENFORCE2D_KOKKOS_H diff --git a/src/KOKKOS/fix_eos_table_rx_kokkos.cpp b/src/KOKKOS/fix_eos_table_rx_kokkos.cpp index 095661a32b..e7cc76647d 100644 --- a/src/KOKKOS/fix_eos_table_rx_kokkos.cpp +++ b/src/KOKKOS/fix_eos_table_rx_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_eos_table_rx_kokkos.h b/src/KOKKOS/fix_eos_table_rx_kokkos.h index 4ca94f86cf..da54f38905 100644 --- a/src/KOKKOS/fix_eos_table_rx_kokkos.h +++ b/src/KOKKOS/fix_eos_table_rx_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(eos/table/rx/kk,FixEOStableRXKokkos) -FixStyle(eos/table/rx/kk/device,FixEOStableRXKokkos) -FixStyle(eos/table/rx/kk/host,FixEOStableRXKokkos) - +// clang-format off +FixStyle(eos/table/rx/kk,FixEOStableRXKokkos); +FixStyle(eos/table/rx/kk/device,FixEOStableRXKokkos); +FixStyle(eos/table/rx/kk/host,FixEOStableRXKokkos); +// clang-format on #else #ifndef LMP_FIX_EOS_TABLE_RX_KOKKOS_H diff --git a/src/KOKKOS/fix_freeze_kokkos.cpp b/src/KOKKOS/fix_freeze_kokkos.cpp index 4104bdc38c..190a054f8b 100644 --- a/src/KOKKOS/fix_freeze_kokkos.cpp +++ b/src/KOKKOS/fix_freeze_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_freeze_kokkos.h b/src/KOKKOS/fix_freeze_kokkos.h index 4fdcb26c52..c7f1e304d2 100644 --- a/src/KOKKOS/fix_freeze_kokkos.h +++ b/src/KOKKOS/fix_freeze_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(freeze/kk,FixFreezeKokkos) -FixStyle(freeze/kk/device,FixFreezeKokkos) -FixStyle(freeze/kk/host,FixFreezeKokkos) - +// clang-format off +FixStyle(freeze/kk,FixFreezeKokkos); +FixStyle(freeze/kk/device,FixFreezeKokkos); +FixStyle(freeze/kk/host,FixFreezeKokkos); +// clang-format on #else #ifndef LMP_FIX_FREEZE_KOKKOS_H diff --git a/src/KOKKOS/fix_gravity_kokkos.cpp b/src/KOKKOS/fix_gravity_kokkos.cpp index a13be32187..ec6afbc133 100644 --- a/src/KOKKOS/fix_gravity_kokkos.cpp +++ b/src/KOKKOS/fix_gravity_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_gravity_kokkos.h b/src/KOKKOS/fix_gravity_kokkos.h index 1b9deaf247..87acdb55ff 100644 --- a/src/KOKKOS/fix_gravity_kokkos.h +++ b/src/KOKKOS/fix_gravity_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(gravity/kk,FixGravityKokkos) -FixStyle(gravity/kk/device,FixGravityKokkos) -FixStyle(gravity/kk/host,FixGravityKokkos) - +// clang-format off +FixStyle(gravity/kk,FixGravityKokkos); +FixStyle(gravity/kk/device,FixGravityKokkos); +FixStyle(gravity/kk/host,FixGravityKokkos); +// clang-format on #else #ifndef LMP_FIX_GRAVITY_KOKKOS_H diff --git a/src/KOKKOS/fix_langevin_kokkos.cpp b/src/KOKKOS/fix_langevin_kokkos.cpp index 054302b9c5..1e2930626e 100644 --- a/src/KOKKOS/fix_langevin_kokkos.cpp +++ b/src/KOKKOS/fix_langevin_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_langevin_kokkos.h b/src/KOKKOS/fix_langevin_kokkos.h index f6e1c47a08..b1b017a435 100644 --- a/src/KOKKOS/fix_langevin_kokkos.h +++ b/src/KOKKOS/fix_langevin_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(langevin/kk,FixLangevinKokkos) -FixStyle(langevin/kk/device,FixLangevinKokkos) -FixStyle(langevin/kk/host,FixLangevinKokkos) - +// clang-format off +FixStyle(langevin/kk,FixLangevinKokkos); +FixStyle(langevin/kk/device,FixLangevinKokkos); +FixStyle(langevin/kk/host,FixLangevinKokkos); +// clang-format on #else #ifndef LMP_FIX_LANGEVIN_KOKKOS_H diff --git a/src/KOKKOS/fix_minimize_kokkos.cpp b/src/KOKKOS/fix_minimize_kokkos.cpp index 11b70741d0..f78e55f10a 100644 --- a/src/KOKKOS/fix_minimize_kokkos.cpp +++ b/src/KOKKOS/fix_minimize_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_minimize_kokkos.h b/src/KOKKOS/fix_minimize_kokkos.h index 0a6587c6da..02509a117b 100644 --- a/src/KOKKOS/fix_minimize_kokkos.h +++ b/src/KOKKOS/fix_minimize_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(MINIMIZE/kk,FixMinimizeKokkos) -FixStyle(MINIMIZE/kk/device,FixMinimizeKokkos) -FixStyle(MINIMIZE/kk/host,FixMinimizeKokkos) - +// clang-format off +FixStyle(MINIMIZE/kk,FixMinimizeKokkos); +FixStyle(MINIMIZE/kk/device,FixMinimizeKokkos); +FixStyle(MINIMIZE/kk/host,FixMinimizeKokkos); +// clang-format on #else #ifndef LMP_FIX_MINIMIZE_KOKKOS_H diff --git a/src/KOKKOS/fix_momentum_kokkos.cpp b/src/KOKKOS/fix_momentum_kokkos.cpp index 25900e80c9..a92c5f46ac 100644 --- a/src/KOKKOS/fix_momentum_kokkos.cpp +++ b/src/KOKKOS/fix_momentum_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_momentum_kokkos.h b/src/KOKKOS/fix_momentum_kokkos.h index 4892f40aa4..9acdd95c52 100644 --- a/src/KOKKOS/fix_momentum_kokkos.h +++ b/src/KOKKOS/fix_momentum_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(momentum/kk,FixMomentumKokkos) -FixStyle(momentum/kk/device,FixMomentumKokkos) -FixStyle(momentum/kk/host,FixMomentumKokkos) - +// clang-format off +FixStyle(momentum/kk,FixMomentumKokkos); +FixStyle(momentum/kk/device,FixMomentumKokkos); +FixStyle(momentum/kk/host,FixMomentumKokkos); +// clang-format on #else #ifndef LMP_FIX_MOMENTUM_KOKKOS_H diff --git a/src/KOKKOS/fix_neigh_history_kokkos.cpp b/src/KOKKOS/fix_neigh_history_kokkos.cpp index 3d351f7a73..611a8a40ef 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.cpp +++ b/src/KOKKOS/fix_neigh_history_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_neigh_history_kokkos.h b/src/KOKKOS/fix_neigh_history_kokkos.h index 513d29be2d..67d264cf9a 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.h +++ b/src/KOKKOS/fix_neigh_history_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(NEIGH_HISTORY/KK,FixNeighHistoryKokkos) -FixStyle(NEIGH_HISTORY/KK/DEVICE,FixNeighHistoryKokkos) -FixStyle(NEIGH_HISTORY/KK/HOST,FixNeighHistoryKokkos) - +// clang-format off +FixStyle(NEIGH_HISTORY/KK,FixNeighHistoryKokkos); +FixStyle(NEIGH_HISTORY/KK/DEVICE,FixNeighHistoryKokkos); +FixStyle(NEIGH_HISTORY/KK/HOST,FixNeighHistoryKokkos); +// clang-format on #else #ifndef LMP_FIX_NEIGH_HISTORY_KOKKOS_H diff --git a/src/KOKKOS/fix_nh_kokkos.cpp b/src/KOKKOS/fix_nh_kokkos.cpp index 7228daa4b6..1d32d4f63e 100644 --- a/src/KOKKOS/fix_nh_kokkos.cpp +++ b/src/KOKKOS/fix_nh_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_nh_kokkos.h b/src/KOKKOS/fix_nh_kokkos.h index 06c4fecab1..00f0b1f769 100644 --- a/src/KOKKOS/fix_nh_kokkos.h +++ b/src/KOKKOS/fix_nh_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_nph_kokkos.cpp b/src/KOKKOS/fix_nph_kokkos.cpp index e2c3bd8d14..81a79473b7 100644 --- a/src/KOKKOS/fix_nph_kokkos.cpp +++ b/src/KOKKOS/fix_nph_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_nph_kokkos.h b/src/KOKKOS/fix_nph_kokkos.h index c9feccba29..a85394bb5b 100644 --- a/src/KOKKOS/fix_nph_kokkos.h +++ b/src/KOKKOS/fix_nph_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nph/kk,FixNPHKokkos) -FixStyle(nph/kk/device,FixNPHKokkos) -FixStyle(nph/kk/host,FixNPHKokkos) - +// clang-format off +FixStyle(nph/kk,FixNPHKokkos); +FixStyle(nph/kk/device,FixNPHKokkos); +FixStyle(nph/kk/host,FixNPHKokkos); +// clang-format on #else #ifndef LMP_FIX_NPH_KOKKOS_H diff --git a/src/KOKKOS/fix_npt_kokkos.cpp b/src/KOKKOS/fix_npt_kokkos.cpp index 565703aa35..127c9f3453 100644 --- a/src/KOKKOS/fix_npt_kokkos.cpp +++ b/src/KOKKOS/fix_npt_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_npt_kokkos.h b/src/KOKKOS/fix_npt_kokkos.h index a04eb0ba92..778d2e7f44 100644 --- a/src/KOKKOS/fix_npt_kokkos.h +++ b/src/KOKKOS/fix_npt_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt/kk,FixNPTKokkos) -FixStyle(npt/kk/device,FixNPTKokkos) -FixStyle(npt/kk/host,FixNPTKokkos) - +// clang-format off +FixStyle(npt/kk,FixNPTKokkos); +FixStyle(npt/kk/device,FixNPTKokkos); +FixStyle(npt/kk/host,FixNPTKokkos); +// clang-format on #else #ifndef LMP_FIX_NPT_KOKKOS_H diff --git a/src/KOKKOS/fix_nve_kokkos.cpp b/src/KOKKOS/fix_nve_kokkos.cpp index 3dbff9a7b6..5ceb86f6a4 100644 --- a/src/KOKKOS/fix_nve_kokkos.cpp +++ b/src/KOKKOS/fix_nve_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_nve_kokkos.h b/src/KOKKOS/fix_nve_kokkos.h index 5894b7c07e..59d39c73d6 100644 --- a/src/KOKKOS/fix_nve_kokkos.h +++ b/src/KOKKOS/fix_nve_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/kk,FixNVEKokkos) -FixStyle(nve/kk/device,FixNVEKokkos) -FixStyle(nve/kk/host,FixNVEKokkos) - +// clang-format off +FixStyle(nve/kk,FixNVEKokkos); +FixStyle(nve/kk/device,FixNVEKokkos); +FixStyle(nve/kk/host,FixNVEKokkos); +// clang-format on #else #ifndef LMP_FIX_NVE_KOKKOS_H diff --git a/src/KOKKOS/fix_nve_sphere_kokkos.cpp b/src/KOKKOS/fix_nve_sphere_kokkos.cpp index d52ae9b95f..787171b6ce 100644 --- a/src/KOKKOS/fix_nve_sphere_kokkos.cpp +++ b/src/KOKKOS/fix_nve_sphere_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_nve_sphere_kokkos.h b/src/KOKKOS/fix_nve_sphere_kokkos.h index 41d5964f7f..a40ec2331f 100644 --- a/src/KOKKOS/fix_nve_sphere_kokkos.h +++ b/src/KOKKOS/fix_nve_sphere_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/sphere/kk,FixNVESphereKokkos) -FixStyle(nve/sphere/kk/device,FixNVESphereKokkos) -FixStyle(nve/sphere/kk/host,FixNVESphereKokkos) - +// clang-format off +FixStyle(nve/sphere/kk,FixNVESphereKokkos); +FixStyle(nve/sphere/kk/device,FixNVESphereKokkos); +FixStyle(nve/sphere/kk/host,FixNVESphereKokkos); +// clang-format on #else #ifndef LMP_FIX_NVE_SPHERE_KOKKOS_H diff --git a/src/KOKKOS/fix_nvt_kokkos.cpp b/src/KOKKOS/fix_nvt_kokkos.cpp index 8eeffcb9f8..92fec733fa 100644 --- a/src/KOKKOS/fix_nvt_kokkos.cpp +++ b/src/KOKKOS/fix_nvt_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_nvt_kokkos.h b/src/KOKKOS/fix_nvt_kokkos.h index 8ca680eb61..f1644909e3 100644 --- a/src/KOKKOS/fix_nvt_kokkos.h +++ b/src/KOKKOS/fix_nvt_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/kk,FixNVTKokkos) -FixStyle(nvt/kk/device,FixNVTKokkos) -FixStyle(nvt/kk/host,FixNVTKokkos) - +// clang-format off +FixStyle(nvt/kk,FixNVTKokkos); +FixStyle(nvt/kk/device,FixNVTKokkos); +FixStyle(nvt/kk/host,FixNVTKokkos); +// clang-format on #else diff --git a/src/KOKKOS/fix_property_atom_kokkos.cpp b/src/KOKKOS/fix_property_atom_kokkos.cpp index 739a0080bf..841b791c5c 100644 --- a/src/KOKKOS/fix_property_atom_kokkos.cpp +++ b/src/KOKKOS/fix_property_atom_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_property_atom_kokkos.h b/src/KOKKOS/fix_property_atom_kokkos.h index ade4375654..c3e6c31dc1 100644 --- a/src/KOKKOS/fix_property_atom_kokkos.h +++ b/src/KOKKOS/fix_property_atom_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(property/atom/kk,FixPropertyAtomKokkos) - +// clang-format off +FixStyle(property/atom/kk,FixPropertyAtomKokkos); +// clang-format on #else #ifndef LMP_FIX_PROPERTY_ATOM_KOKKOS_H diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reax_kokkos.cpp index 7e4d99e1c3..cace20c098 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reax_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.h b/src/KOKKOS/fix_qeq_reax_kokkos.h index e0205ce801..aa4ae354cd 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.h +++ b/src/KOKKOS/fix_qeq_reax_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(qeq/reax/kk,FixQEqReaxKokkos) -FixStyle(qeq/reax/kk/device,FixQEqReaxKokkos) -FixStyle(qeq/reax/kk/host,FixQEqReaxKokkos) - +// clang-format off +FixStyle(qeq/reax/kk,FixQEqReaxKokkos); +FixStyle(qeq/reax/kk/device,FixQEqReaxKokkos); +FixStyle(qeq/reax/kk/host,FixQEqReaxKokkos); +// clang-format on #else #ifndef LMP_FIX_QEQ_REAX_KOKKOS_H diff --git a/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp b/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp index e493884a69..3da59ce972 100644 --- a/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp +++ b/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_reaxc_bonds_kokkos.h b/src/KOKKOS/fix_reaxc_bonds_kokkos.h index d8a5d3a1cc..8c1bb9bef9 100644 --- a/src/KOKKOS/fix_reaxc_bonds_kokkos.h +++ b/src/KOKKOS/fix_reaxc_bonds_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(reax/c/bonds/kk,FixReaxCBondsKokkos) -FixStyle(reax/c/bonds/kk/device,FixReaxCBondsKokkos) -FixStyle(reax/c/bonds/kk/host,FixReaxCBondsKokkos) - +// clang-format off +FixStyle(reax/c/bonds/kk,FixReaxCBondsKokkos); +FixStyle(reax/c/bonds/kk/device,FixReaxCBondsKokkos); +FixStyle(reax/c/bonds/kk/host,FixReaxCBondsKokkos); +// clang-format on #else #ifndef LMP_FIX_REAXC_BONDS_KOKKOS_H diff --git a/src/KOKKOS/fix_reaxc_species_kokkos.cpp b/src/KOKKOS/fix_reaxc_species_kokkos.cpp index 0a225a641d..85cd3b23ba 100644 --- a/src/KOKKOS/fix_reaxc_species_kokkos.cpp +++ b/src/KOKKOS/fix_reaxc_species_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_reaxc_species_kokkos.h b/src/KOKKOS/fix_reaxc_species_kokkos.h index 8e5f961f17..1a5f204132 100644 --- a/src/KOKKOS/fix_reaxc_species_kokkos.h +++ b/src/KOKKOS/fix_reaxc_species_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(reax/c/species/kk,FixReaxCSpeciesKokkos) -FixStyle(reax/c/species/kk/device,FixReaxCSpeciesKokkos) -FixStyle(reax/c/species/kk/host,FixReaxCSpeciesKokkos) - +// clang-format off +FixStyle(reax/c/species/kk,FixReaxCSpeciesKokkos); +FixStyle(reax/c/species/kk/device,FixReaxCSpeciesKokkos); +FixStyle(reax/c/species/kk/host,FixReaxCSpeciesKokkos); +// clang-format on #else #ifndef LMP_FIX_REAXC_SPECIES_KOKKOS_H diff --git a/src/KOKKOS/fix_rx_kokkos.cpp b/src/KOKKOS/fix_rx_kokkos.cpp index e512f19d1d..7bc7bf95c3 100644 --- a/src/KOKKOS/fix_rx_kokkos.cpp +++ b/src/KOKKOS/fix_rx_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_rx_kokkos.h b/src/KOKKOS/fix_rx_kokkos.h index 1f7b66a18c..cb9a0d3d38 100644 --- a/src/KOKKOS/fix_rx_kokkos.h +++ b/src/KOKKOS/fix_rx_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rx/kk,FixRxKokkos) -FixStyle(rx/kk/device,FixRxKokkos) -FixStyle(rx/kk/host,FixRxKokkos) - +// clang-format off +FixStyle(rx/kk,FixRxKokkos); +FixStyle(rx/kk/device,FixRxKokkos); +FixStyle(rx/kk/host,FixRxKokkos); +// clang-format on #else #ifndef LMP_FIX_RX_KOKKOS_H diff --git a/src/KOKKOS/fix_setforce_kokkos.cpp b/src/KOKKOS/fix_setforce_kokkos.cpp index 30899bf402..a2657569c5 100644 --- a/src/KOKKOS/fix_setforce_kokkos.cpp +++ b/src/KOKKOS/fix_setforce_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_setforce_kokkos.h b/src/KOKKOS/fix_setforce_kokkos.h index 5a8ba19d97..fc165c4d2f 100644 --- a/src/KOKKOS/fix_setforce_kokkos.h +++ b/src/KOKKOS/fix_setforce_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(setforce/kk,FixSetForceKokkos) -FixStyle(setforce/kk/device,FixSetForceKokkos) -FixStyle(setforce/kk/host,FixSetForceKokkos) - +// clang-format off +FixStyle(setforce/kk,FixSetForceKokkos); +FixStyle(setforce/kk/device,FixSetForceKokkos); +FixStyle(setforce/kk/host,FixSetForceKokkos); +// clang-format on #else #ifndef LMP_FIX_SET_FORCE_KOKKOS_H diff --git a/src/KOKKOS/fix_shake_kokkos.cpp b/src/KOKKOS/fix_shake_kokkos.cpp index 4180a33aff..804da9fd22 100644 --- a/src/KOKKOS/fix_shake_kokkos.cpp +++ b/src/KOKKOS/fix_shake_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_shake_kokkos.h b/src/KOKKOS/fix_shake_kokkos.h index ea3756856c..b95c042ac1 100644 --- a/src/KOKKOS/fix_shake_kokkos.h +++ b/src/KOKKOS/fix_shake_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(shake/kk,FixShakeKokkos) -FixStyle(shake/kk/device,FixShakeKokkos) -FixStyle(shake/kk/host,FixShakeKokkos) - +// clang-format off +FixStyle(shake/kk,FixShakeKokkos); +FixStyle(shake/kk/device,FixShakeKokkos); +FixStyle(shake/kk/host,FixShakeKokkos); +// clang-format on #else #ifndef LMP_FIX_SHAKE_KOKKOS_H diff --git a/src/KOKKOS/fix_shardlow_kokkos.cpp b/src/KOKKOS/fix_shardlow_kokkos.cpp index fa4828dece..fb2e9e2108 100644 --- a/src/KOKKOS/fix_shardlow_kokkos.cpp +++ b/src/KOKKOS/fix_shardlow_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_shardlow_kokkos.h b/src/KOKKOS/fix_shardlow_kokkos.h index 1c5813bcfd..bab8f08cb9 100644 --- a/src/KOKKOS/fix_shardlow_kokkos.h +++ b/src/KOKKOS/fix_shardlow_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(shardlow/kk,FixShardlowKokkos) -FixStyle(shardlow/kk/device,FixShardlowKokkos) -FixStyle(shardlow/kk/host,FixShardlowKokkos) - +// clang-format off +FixStyle(shardlow/kk,FixShardlowKokkos); +FixStyle(shardlow/kk/device,FixShardlowKokkos); +FixStyle(shardlow/kk/host,FixShardlowKokkos); +// clang-format on #else #ifndef LMP_FIX_SHARDLOW_KOKKOS_H diff --git a/src/KOKKOS/fix_wall_lj93_kokkos.cpp b/src/KOKKOS/fix_wall_lj93_kokkos.cpp index 9b8b146ba3..f34a79430b 100644 --- a/src/KOKKOS/fix_wall_lj93_kokkos.cpp +++ b/src/KOKKOS/fix_wall_lj93_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_wall_lj93_kokkos.h b/src/KOKKOS/fix_wall_lj93_kokkos.h index ceaeb4d3bd..e7c12f3a70 100644 --- a/src/KOKKOS/fix_wall_lj93_kokkos.h +++ b/src/KOKKOS/fix_wall_lj93_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/lj93/kk,FixWallLJ93Kokkos) -FixStyle(wall/lj93/kk/device,FixWallLJ93Kokkos) -FixStyle(wall/lj93/kk/host,FixWallLJ93Kokkos) - +// clang-format off +FixStyle(wall/lj93/kk,FixWallLJ93Kokkos); +FixStyle(wall/lj93/kk/device,FixWallLJ93Kokkos); +FixStyle(wall/lj93/kk/host,FixWallLJ93Kokkos); +// clang-format on #else #ifndef LMP_FIX_WALL_LJ93_KOKKOS_H diff --git a/src/KOKKOS/fix_wall_reflect_kokkos.cpp b/src/KOKKOS/fix_wall_reflect_kokkos.cpp index f910086c49..15aca43b57 100644 --- a/src/KOKKOS/fix_wall_reflect_kokkos.cpp +++ b/src/KOKKOS/fix_wall_reflect_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/fix_wall_reflect_kokkos.h b/src/KOKKOS/fix_wall_reflect_kokkos.h index e1f3f4f9b4..caf43120f4 100644 --- a/src/KOKKOS/fix_wall_reflect_kokkos.h +++ b/src/KOKKOS/fix_wall_reflect_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/reflect/kk,FixWallReflectKokkos) -FixStyle(wall/reflect/kk/device,FixWallReflectKokkos) -FixStyle(wall/reflect/kk/host,FixWallReflectKokkos) - +// clang-format off +FixStyle(wall/reflect/kk,FixWallReflectKokkos); +FixStyle(wall/reflect/kk/device,FixWallReflectKokkos); +FixStyle(wall/reflect/kk/host,FixWallReflectKokkos); +// clang-format on #else #ifndef LMP_FIX_WALL_REFLECT_KOKKOS_H diff --git a/src/KOKKOS/gridcomm_kokkos.cpp b/src/KOKKOS/gridcomm_kokkos.cpp index 23dded2edc..4a0985219b 100644 --- a/src/KOKKOS/gridcomm_kokkos.cpp +++ b/src/KOKKOS/gridcomm_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/gridcomm_kokkos.h b/src/KOKKOS/gridcomm_kokkos.h index 270ad98ad0..d1f4ccb5e9 100644 --- a/src/KOKKOS/gridcomm_kokkos.h +++ b/src/KOKKOS/gridcomm_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/improper_class2_kokkos.cpp b/src/KOKKOS/improper_class2_kokkos.cpp index 6ae51216a4..e58ddb49e3 100644 --- a/src/KOKKOS/improper_class2_kokkos.cpp +++ b/src/KOKKOS/improper_class2_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/improper_class2_kokkos.h b/src/KOKKOS/improper_class2_kokkos.h index b22b2361fa..c9cb384df1 100644 --- a/src/KOKKOS/improper_class2_kokkos.h +++ b/src/KOKKOS/improper_class2_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(class2/kk,ImproperClass2Kokkos) -ImproperStyle(class2/kk/device,ImproperClass2Kokkos) -ImproperStyle(class2/kk/host,ImproperClass2Kokkos) - +// clang-format off +ImproperStyle(class2/kk,ImproperClass2Kokkos); +ImproperStyle(class2/kk/device,ImproperClass2Kokkos); +ImproperStyle(class2/kk/host,ImproperClass2Kokkos); +// clang-format on #else #ifndef LMP_IMPROPER_CLASS2_KOKKOS_H diff --git a/src/KOKKOS/improper_harmonic_kokkos.cpp b/src/KOKKOS/improper_harmonic_kokkos.cpp index f0977745da..8dfe891f26 100644 --- a/src/KOKKOS/improper_harmonic_kokkos.cpp +++ b/src/KOKKOS/improper_harmonic_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/improper_harmonic_kokkos.h b/src/KOKKOS/improper_harmonic_kokkos.h index e15600dbf7..8d89efaff8 100644 --- a/src/KOKKOS/improper_harmonic_kokkos.h +++ b/src/KOKKOS/improper_harmonic_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(harmonic/kk,ImproperHarmonicKokkos) -ImproperStyle(harmonic/kk/device,ImproperHarmonicKokkos) -ImproperStyle(harmonic/kk/host,ImproperHarmonicKokkos) - +// clang-format off +ImproperStyle(harmonic/kk,ImproperHarmonicKokkos); +ImproperStyle(harmonic/kk/device,ImproperHarmonicKokkos); +ImproperStyle(harmonic/kk/host,ImproperHarmonicKokkos); +// clang-format on #else #ifndef LMP_IMPROPER_HARMONIC_KOKKOS_H diff --git a/src/KOKKOS/kissfft_kokkos.cpp b/src/KOKKOS/kissfft_kokkos.cpp index 35c25311ef..f0695edb10 100644 --- a/src/KOKKOS/kissfft_kokkos.cpp +++ b/src/KOKKOS/kissfft_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/kissfft_kokkos.h b/src/KOKKOS/kissfft_kokkos.h index 89e132e85a..48180828a3 100644 --- a/src/KOKKOS/kissfft_kokkos.h +++ b/src/KOKKOS/kissfft_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index 67202612a4..fd171b61af 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/kokkos.h b/src/KOKKOS/kokkos.h index 0994ff6e01..22060ecc09 100644 --- a/src/KOKKOS/kokkos.h +++ b/src/KOKKOS/kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/kokkos_base.h b/src/KOKKOS/kokkos_base.h index 855ccf9108..8212ab70f4 100644 --- a/src/KOKKOS/kokkos_base.h +++ b/src/KOKKOS/kokkos_base.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/kokkos_base_fft.h b/src/KOKKOS/kokkos_base_fft.h index c087a4d3f6..1bd8878821 100644 --- a/src/KOKKOS/kokkos_base_fft.h +++ b/src/KOKKOS/kokkos_base_fft.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/kokkos_few.h b/src/KOKKOS/kokkos_few.h index 4c62b13fea..48f6ed7390 100644 --- a/src/KOKKOS/kokkos_few.h +++ b/src/KOKKOS/kokkos_few.h @@ -1,3 +1,4 @@ +// clang-format off #ifndef KOKKOS_FEW_H #define KOKKOS_FEW_H diff --git a/src/KOKKOS/kokkos_type.h b/src/KOKKOS/kokkos_type.h index a00c43bd2d..c9e5736410 100644 --- a/src/KOKKOS/kokkos_type.h +++ b/src/KOKKOS/kokkos_type.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/math_special_kokkos.cpp b/src/KOKKOS/math_special_kokkos.cpp index 59da5273f9..89f6586581 100644 --- a/src/KOKKOS/math_special_kokkos.cpp +++ b/src/KOKKOS/math_special_kokkos.cpp @@ -1,3 +1,4 @@ +// clang-format off #include "math_special_kokkos.h" #include diff --git a/src/KOKKOS/math_special_kokkos.h b/src/KOKKOS/math_special_kokkos.h index 02b05739ee..802d1c2979 100644 --- a/src/KOKKOS/math_special_kokkos.h +++ b/src/KOKKOS/math_special_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/memory_kokkos.h b/src/KOKKOS/memory_kokkos.h index 186168b9b1..58c3c08e2a 100644 --- a/src/KOKKOS/memory_kokkos.h +++ b/src/KOKKOS/memory_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -252,7 +253,7 @@ TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, data.resize(n1); bigint nbytes = ((bigint) sizeof(typename TYPE::value_type *)) * n1; - array = (typename TYPE::value_type **) smalloc(nbytes,name); + array = (typename TYPE::value_type **) srealloc(array,nbytes,name); for (int i = 0; i < n1; i++) if (data.h_view.extent(1)==0) diff --git a/src/KOKKOS/min_cg_kokkos.cpp b/src/KOKKOS/min_cg_kokkos.cpp index f285fea4a3..32f97437c7 100644 --- a/src/KOKKOS/min_cg_kokkos.cpp +++ b/src/KOKKOS/min_cg_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/min_cg_kokkos.h b/src/KOKKOS/min_cg_kokkos.h index 1c51be7e72..105887f14e 100644 --- a/src/KOKKOS/min_cg_kokkos.h +++ b/src/KOKKOS/min_cg_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef MINIMIZE_CLASS - -MinimizeStyle(cg/kk,MinCGKokkos) -MinimizeStyle(cg/kk/device,MinCGKokkos) -MinimizeStyle(cg/kk/host,MinCGKokkos) - +// clang-format off +MinimizeStyle(cg/kk,MinCGKokkos); +MinimizeStyle(cg/kk/device,MinCGKokkos); +MinimizeStyle(cg/kk/host,MinCGKokkos); +// clang-format on #else #ifndef LMP_MIN_CG_KOKKOS_H diff --git a/src/KOKKOS/min_kokkos.cpp b/src/KOKKOS/min_kokkos.cpp index 383b94f67c..aaf883c881 100644 --- a/src/KOKKOS/min_kokkos.cpp +++ b/src/KOKKOS/min_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/min_kokkos.h b/src/KOKKOS/min_kokkos.h index 8cfb3c7c24..3d06010517 100644 --- a/src/KOKKOS/min_kokkos.h +++ b/src/KOKKOS/min_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/min_linesearch_kokkos.cpp b/src/KOKKOS/min_linesearch_kokkos.cpp index a3cc5fd0ee..ae7e551612 100644 --- a/src/KOKKOS/min_linesearch_kokkos.cpp +++ b/src/KOKKOS/min_linesearch_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/min_linesearch_kokkos.h b/src/KOKKOS/min_linesearch_kokkos.h index 6a82c43b93..852d6cdaa8 100644 --- a/src/KOKKOS/min_linesearch_kokkos.h +++ b/src/KOKKOS/min_linesearch_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/modify_kokkos.cpp b/src/KOKKOS/modify_kokkos.cpp index 40ed1cdfdc..868de3e11e 100644 --- a/src/KOKKOS/modify_kokkos.cpp +++ b/src/KOKKOS/modify_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/modify_kokkos.h b/src/KOKKOS/modify_kokkos.h index 99fbb26c5c..9b75b7c607 100644 --- a/src/KOKKOS/modify_kokkos.h +++ b/src/KOKKOS/modify_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/nbin_kokkos.cpp b/src/KOKKOS/nbin_kokkos.cpp index cf6f2ca144..64d67285b6 100644 --- a/src/KOKKOS/nbin_kokkos.cpp +++ b/src/KOKKOS/nbin_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/nbin_kokkos.h b/src/KOKKOS/nbin_kokkos.h index 508e786750..d2c5617ff7 100644 --- a/src/KOKKOS/nbin_kokkos.h +++ b/src/KOKKOS/nbin_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,15 +13,15 @@ ------------------------------------------------------------------------- */ #ifdef NBIN_CLASS - +// clang-format off NBinStyle(kk/host, NBinKokkos, - NB_STANDARD | NB_KOKKOS_HOST) + NB_STANDARD | NB_KOKKOS_HOST); NBinStyle(kk/device, NBinKokkos, - NB_STANDARD | NB_KOKKOS_DEVICE) - + NB_STANDARD | NB_KOKKOS_DEVICE); +// clang-format on #else #ifndef LMP_NBIN_KOKKOS_H diff --git a/src/KOKKOS/nbin_ssa_kokkos.cpp b/src/KOKKOS/nbin_ssa_kokkos.cpp index 81cc26581e..d42b88ab79 100644 --- a/src/KOKKOS/nbin_ssa_kokkos.cpp +++ b/src/KOKKOS/nbin_ssa_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/nbin_ssa_kokkos.h b/src/KOKKOS/nbin_ssa_kokkos.h index 0288d6e609..825733c2b0 100644 --- a/src/KOKKOS/nbin_ssa_kokkos.h +++ b/src/KOKKOS/nbin_ssa_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,15 +13,15 @@ ------------------------------------------------------------------------- */ #ifdef NBIN_CLASS - +// clang-format off NBinStyle(ssa/kk/host, NBinSSAKokkos, - NB_STANDARD | NB_SSA | NB_KOKKOS_HOST) + NB_STANDARD | NB_SSA | NB_KOKKOS_HOST); NBinStyle(ssa/kk/device, NBinSSAKokkos, - NB_STANDARD | NB_SSA | NB_KOKKOS_DEVICE) - + NB_STANDARD | NB_SSA | NB_KOKKOS_DEVICE); +// clang-format on #else #ifndef LMP_NBIN_SSA_KOKKOS_H diff --git a/src/KOKKOS/neigh_bond_kokkos.cpp b/src/KOKKOS/neigh_bond_kokkos.cpp index 0e2bd5a0ef..eed0026af3 100644 --- a/src/KOKKOS/neigh_bond_kokkos.cpp +++ b/src/KOKKOS/neigh_bond_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/neigh_bond_kokkos.h b/src/KOKKOS/neigh_bond_kokkos.h index ed62a5d859..887ead95f6 100644 --- a/src/KOKKOS/neigh_bond_kokkos.h +++ b/src/KOKKOS/neigh_bond_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/neigh_list_kokkos.cpp b/src/KOKKOS/neigh_list_kokkos.cpp index 2ce712112b..153bc558fa 100644 --- a/src/KOKKOS/neigh_list_kokkos.cpp +++ b/src/KOKKOS/neigh_list_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/neigh_list_kokkos.h b/src/KOKKOS/neigh_list_kokkos.h index 727295ead1..04e5e7e17f 100644 --- a/src/KOKKOS/neigh_list_kokkos.h +++ b/src/KOKKOS/neigh_list_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/neighbor_kokkos.cpp b/src/KOKKOS/neighbor_kokkos.cpp index 5394929e73..e4a2b02cc0 100644 --- a/src/KOKKOS/neighbor_kokkos.cpp +++ b/src/KOKKOS/neighbor_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/neighbor_kokkos.h b/src/KOKKOS/neighbor_kokkos.h index 74b82e88ce..1a560e2129 100644 --- a/src/KOKKOS/neighbor_kokkos.h +++ b/src/KOKKOS/neighbor_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/npair_copy_kokkos.cpp b/src/KOKKOS/npair_copy_kokkos.cpp index 09b8715475..5750b5c50f 100644 --- a/src/KOKKOS/npair_copy_kokkos.cpp +++ b/src/KOKKOS/npair_copy_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/npair_copy_kokkos.h b/src/KOKKOS/npair_copy_kokkos.h index eb330fb1ea..61e4fffdde 100644 --- a/src/KOKKOS/npair_copy_kokkos.h +++ b/src/KOKKOS/npair_copy_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,15 +13,15 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(copy/kk/device, NPairCopyKokkos, - NP_COPY | NP_KOKKOS_DEVICE) + NP_COPY | NP_KOKKOS_DEVICE); NPairStyle(copy/kk/host, NPairCopyKokkos, - NP_COPY | NP_KOKKOS_HOST) - + NP_COPY | NP_KOKKOS_HOST); +// clang-format on #else #ifndef LMP_NPAIR_COPY_KOKKOS_H diff --git a/src/KOKKOS/npair_halffull_kokkos.cpp b/src/KOKKOS/npair_halffull_kokkos.cpp index 9e2082036a..53bd132cac 100644 --- a/src/KOKKOS/npair_halffull_kokkos.cpp +++ b/src/KOKKOS/npair_halffull_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/npair_halffull_kokkos.h b/src/KOKKOS/npair_halffull_kokkos.h index cd7571b2c9..553f10c27b 100644 --- a/src/KOKKOS/npair_halffull_kokkos.h +++ b/src/KOKKOS/npair_halffull_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,32 +13,32 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off // Newton typedef NPairHalffullKokkos NPairKokkosHalffullNewtonDevice; NPairStyle(halffull/newton/kk/device, NPairKokkosHalffullNewtonDevice, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_KOKKOS_DEVICE) + NP_ORTHO | NP_TRI | NP_KOKKOS_DEVICE); typedef NPairHalffullKokkos NPairKokkosHalffullNewtonHost; NPairStyle(halffull/newton/kk/host, NPairKokkosHalffullNewtonHost, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_KOKKOS_HOST) + NP_ORTHO | NP_TRI | NP_KOKKOS_HOST); typedef NPairHalffullKokkos NPairKokkosHalffullNewtonDevice; NPairStyle(halffull/newton/skip/kk/device, NPairKokkosHalffullNewtonDevice, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_SKIP | NP_KOKKOS_DEVICE) + NP_ORTHO | NP_TRI | NP_SKIP | NP_KOKKOS_DEVICE); typedef NPairHalffullKokkos NPairKokkosHalffullNewtonHost; NPairStyle(halffull/newton/skip/kk/host, NPairKokkosHalffullNewtonHost, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_SKIP | NP_KOKKOS_HOST) + NP_ORTHO | NP_TRI | NP_SKIP | NP_KOKKOS_HOST); // Newtoff @@ -45,25 +46,25 @@ typedef NPairHalffullKokkos NPairKokkosHalffullNewtoffDevice; NPairStyle(halffull/newtoff/kk/device, NPairKokkosHalffullNewtoffDevice, NP_HALF_FULL | NP_NEWTOFF | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_KOKKOS_DEVICE) + NP_ORTHO | NP_TRI | NP_KOKKOS_DEVICE); typedef NPairHalffullKokkos NPairKokkosHalffullNewtoffHost; NPairStyle(halffull/newtoff/kk/host, NPairKokkosHalffullNewtoffHost, NP_HALF_FULL | NP_NEWTOFF | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_KOKKOS_HOST) + NP_ORTHO | NP_TRI | NP_KOKKOS_HOST); typedef NPairHalffullKokkos NPairKokkosHalffullNewtoffDevice; NPairStyle(halffull/newtoff/skip/kk/device, NPairKokkosHalffullNewtoffDevice, NP_HALF_FULL | NP_NEWTOFF | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_SKIP | NP_KOKKOS_DEVICE) + NP_ORTHO | NP_TRI | NP_SKIP | NP_KOKKOS_DEVICE); typedef NPairHalffullKokkos NPairKokkosHalffullNewtoffHost; NPairStyle(halffull/newtoff/skip/kk/host, NPairKokkosHalffullNewtoffHost, NP_HALF_FULL | NP_NEWTOFF | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_SKIP | NP_KOKKOS_HOST) + NP_ORTHO | NP_TRI | NP_SKIP | NP_KOKKOS_HOST); //************ Ghost ************** @@ -73,25 +74,25 @@ typedef NPairHalffullKokkos NPairKokkosHalffullNewtonGhostDevic NPairStyle(halffull/newton/ghost/kk/device, NPairKokkosHalffullNewtonGhostDevice, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_DEVICE) + NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_DEVICE); typedef NPairHalffullKokkos NPairKokkosHalffullNewtonHost; NPairStyle(halffull/newton/ghost/kk/host, NPairKokkosHalffullNewtonHost, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_HOST) + NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_HOST); typedef NPairHalffullKokkos NPairKokkosHalffullNewtonGhostDevice; NPairStyle(halffull/newton/skip/ghost/kk/device, NPairKokkosHalffullNewtonGhostDevice, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_GHOST | NP_SKIP | NP_KOKKOS_DEVICE) + NP_ORTHO | NP_TRI | NP_GHOST | NP_SKIP | NP_KOKKOS_DEVICE); typedef NPairHalffullKokkos NPairKokkosHalffullNewtonHost; NPairStyle(halffull/newton/skip/ghost/kk/host, NPairKokkosHalffullNewtonHost, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_GHOST | NP_SKIP | NP_KOKKOS_HOST) + NP_ORTHO | NP_TRI | NP_GHOST | NP_SKIP | NP_KOKKOS_HOST); // Newtoff @@ -99,26 +100,26 @@ typedef NPairHalffullKokkos NPairKokkosHalffullNewtoffGhostDevi NPairStyle(halffull/newtoff/ghost/kk/device, NPairKokkosHalffullNewtoffGhostDevice, NP_HALF_FULL | NP_NEWTOFF | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_DEVICE) + NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_DEVICE); typedef NPairHalffullKokkos NPairKokkosHalffullNewtoffHost; NPairStyle(halffull/newtoff/ghost/kk/host, NPairKokkosHalffullNewtoffHost, NP_HALF_FULL | NP_NEWTOFF | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_HOST) + NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_HOST); typedef NPairHalffullKokkos NPairKokkosHalffullNewtoffGhostDevice; NPairStyle(halffull/newtoff/skip/ghost/kk/device, NPairKokkosHalffullNewtoffGhostDevice, NP_HALF_FULL | NP_NEWTOFF | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_GHOST | NP_SKIP | NP_KOKKOS_DEVICE) + NP_ORTHO | NP_TRI | NP_GHOST | NP_SKIP | NP_KOKKOS_DEVICE); typedef NPairHalffullKokkos NPairKokkosHalffullNewtoffHost; NPairStyle(halffull/newtoff/skip/ghost/kk/host, NPairKokkosHalffullNewtoffHost, NP_HALF_FULL | NP_NEWTOFF | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_GHOST | NP_SKIP | NP_KOKKOS_HOST) - + NP_ORTHO | NP_TRI | NP_GHOST | NP_SKIP | NP_KOKKOS_HOST); +// clang-format on #else #ifndef LMP_NPAIR_HALFFULL_KOKKOS_H diff --git a/src/KOKKOS/npair_kokkos.cpp b/src/KOKKOS/npair_kokkos.cpp index d16be55e9d..7d6a39abe5 100644 --- a/src/KOKKOS/npair_kokkos.cpp +++ b/src/KOKKOS/npair_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/npair_kokkos.h b/src/KOKKOS/npair_kokkos.h index 2f5ee8f70a..b6fc41db02 100644 --- a/src/KOKKOS/npair_kokkos.h +++ b/src/KOKKOS/npair_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,77 +13,77 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off typedef NPairKokkos NPairKokkosFullBinHost; NPairStyle(full/bin/kk/host, NPairKokkosFullBinHost, - NP_FULL | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) + NP_FULL | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); typedef NPairKokkos NPairKokkosFullBinDevice; NPairStyle(full/bin/kk/device, NPairKokkosFullBinDevice, - NP_FULL | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) + NP_FULL | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); typedef NPairKokkos NPairKokkosFullBinGhostHost; NPairStyle(full/bin/ghost/kk/host, NPairKokkosFullBinGhostHost, - NP_FULL | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI) + NP_FULL | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI); typedef NPairKokkos NPairKokkosFullBinGhostDevice; NPairStyle(full/bin/ghost/kk/device, NPairKokkosFullBinGhostDevice, - NP_FULL | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI) + NP_FULL | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI); typedef NPairKokkos NPairKokkosHalfBinHost; NPairStyle(half/bin/kk/host, NPairKokkosHalfBinHost, - NP_HALF | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_ORTHO) + NP_HALF | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_ORTHO); typedef NPairKokkos NPairKokkosHalfBinDevice; NPairStyle(half/bin/kk/device, NPairKokkosHalfBinDevice, - NP_HALF | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_ORTHO) + NP_HALF | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_ORTHO); typedef NPairKokkos NPairKokkosHalfBinHostTri; NPairStyle(half/bin/kk/host, NPairKokkosHalfBinHostTri, - NP_HALF | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_TRI) + NP_HALF | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_TRI); typedef NPairKokkos NPairKokkosHalfBinDeviceTri; NPairStyle(half/bin/kk/device, NPairKokkosHalfBinDeviceTri, - NP_HALF | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_TRI) + NP_HALF | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_TRI); typedef NPairKokkos NPairKokkosHalfBinGhostHost; NPairStyle(half/bin/ghost/kk/host, NPairKokkosHalfBinGhostHost, - NP_HALF | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI) + NP_HALF | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI); typedef NPairKokkos NPairKokkosHalfBinGhostDevice; NPairStyle(half/bin/ghost/kk/device, NPairKokkosHalfBinGhostDevice, - NP_HALF | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI) + NP_HALF | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI); typedef NPairKokkos NPairKokkosHalfSizeBinHost; NPairStyle(half/size/bin/kk/host, NPairKokkosHalfSizeBinHost, - NP_HALF | NP_SIZE | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_ORTHO) + NP_HALF | NP_SIZE | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_ORTHO); typedef NPairKokkos NPairKokkosHalfSizeBinDevice; NPairStyle(half/size/bin/kk/device, NPairKokkosHalfSizeBinDevice, - NP_HALF | NP_SIZE | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_ORTHO) + NP_HALF | NP_SIZE | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_ORTHO); typedef NPairKokkos NPairKokkosHalfSizeBinHostTri; NPairStyle(half/size/bin/kk/host, NPairKokkosHalfSizeBinHostTri, - NP_HALF | NP_SIZE | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_TRI) + NP_HALF | NP_SIZE | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_TRI); typedef NPairKokkos NPairKokkosHalfSizeBinDeviceTri; NPairStyle(half/size/bin/kk/device, NPairKokkosHalfSizeBinDeviceTri, - NP_HALF | NP_SIZE | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_TRI) - + NP_HALF | NP_SIZE | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_KOKKOS_H diff --git a/src/KOKKOS/npair_skip_kokkos.cpp b/src/KOKKOS/npair_skip_kokkos.cpp index 293c2738a4..fb9b0730c5 100644 --- a/src/KOKKOS/npair_skip_kokkos.cpp +++ b/src/KOKKOS/npair_skip_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/npair_skip_kokkos.h b/src/KOKKOS/npair_skip_kokkos.h index 61ea2e57e1..729a478ff2 100644 --- a/src/KOKKOS/npair_skip_kokkos.h +++ b/src/KOKKOS/npair_skip_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,35 +13,35 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off typedef NPairSkipKokkos NPairKokkosSkipDevice; NPairStyle(skip/kk/device, NPairKokkosSkipDevice, NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_KOKKOS_DEVICE) + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_KOKKOS_DEVICE); typedef NPairSkipKokkos NPairKokkosSkipGhostDevice; NPairStyle(skip/ghost/kk/device, NPairKokkosSkipGhostDevice, NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_DEVICE) + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_DEVICE); typedef NPairSkipKokkos NPairKokkosSkipHost; NPairStyle(skip/kk/host, NPairKokkosSkipHost, NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_KOKKOS_HOST) + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_KOKKOS_HOST); typedef NPairSkipKokkos NPairKokkosSkipGhostHost; NPairStyle(skip/ghost/kk/host, NPairKokkosSkipGhostHost, NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_HOST) - + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_GHOST | NP_KOKKOS_HOST); +// clang-format on #else #ifndef LMP_NPAIR_SKIP_KOKKOS_H diff --git a/src/KOKKOS/npair_ssa_kokkos.cpp b/src/KOKKOS/npair_ssa_kokkos.cpp index 34f0d501ce..0246d141fb 100644 --- a/src/KOKKOS/npair_ssa_kokkos.cpp +++ b/src/KOKKOS/npair_ssa_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/npair_ssa_kokkos.h b/src/KOKKOS/npair_ssa_kokkos.h index a1ccc21319..559831548e 100644 --- a/src/KOKKOS/npair_ssa_kokkos.h +++ b/src/KOKKOS/npair_ssa_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,17 +13,17 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off typedef NPairSSAKokkos NPairSSAKokkosHost; NPairStyle(half/bin/newton/ssa/kk/host, NPairSSAKokkosHost, - NP_HALF | NP_BIN | NP_NEWTON | NP_ORTHO | NP_SSA | NP_GHOST | NP_KOKKOS_HOST) + NP_HALF | NP_BIN | NP_NEWTON | NP_ORTHO | NP_SSA | NP_GHOST | NP_KOKKOS_HOST); typedef NPairSSAKokkos NPairSSAKokkosDevice; NPairStyle(half/bin/newton/ssa/kk/device, NPairSSAKokkosDevice, - NP_HALF | NP_BIN | NP_NEWTON | NP_ORTHO | NP_SSA | NP_GHOST | NP_KOKKOS_DEVICE) - + NP_HALF | NP_BIN | NP_NEWTON | NP_ORTHO | NP_SSA | NP_GHOST | NP_KOKKOS_DEVICE); +// clang-format on #else #ifndef LMP_NPAIR_SSA_KOKKOS_H diff --git a/src/KOKKOS/pack_kokkos.h b/src/KOKKOS/pack_kokkos.h index 3baad002b6..244af8f796 100644 --- a/src/KOKKOS/pack_kokkos.h +++ b/src/KOKKOS/pack_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- SPARTA - Stochastic PArallel Rarefied-gas Time-accurate Analyzer http://sparta.sandia.gov diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp index 975c191c3d..6fe8922a96 100644 --- a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -49,10 +50,6 @@ PairBuckCoulCutKokkos::PairBuckCoulCutKokkos(LAMMPS *lmp):PairBuckCo execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_ljsq = nullptr; - cut_coulsq = nullptr; - } /* ---------------------------------------------------------------------- */ @@ -60,23 +57,15 @@ PairBuckCoulCutKokkos::PairBuckCoulCutKokkos(LAMMPS *lmp):PairBuckCo template PairBuckCoulCutKokkos::~PairBuckCoulCutKokkos() { + if (copymode) return; - if (!copymode) { + if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - k_cutsq = DAT::tdual_ffloat_2d(); - k_cut_ljsq = DAT::tdual_ffloat_2d(); - k_cut_coulsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - memory->sfree(cut_ljsq); - memory->sfree(cut_coulsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; - cut_ljsq = nullptr; - cut_coulsq = nullptr; + memoryKK->destroy_kokkos(k_cutsq,cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq,cut_ljsq); + memoryKK->destroy_kokkos(k_cut_coulsq,cut_coulsq); } - } /* ---------------------------------------------------------------------- */ @@ -249,15 +238,19 @@ void PairBuckCoulCutKokkos::allocate() PairBuckCoulCut::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(); + memory->destroy(cut_ljsq); memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); + memory->destroy(cut_coulsq); memoryKK->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq"); d_cut_coulsq = k_cut_coulsq.template view(); + k_params = Kokkos::DualView("PairBuckCoulCut::params",n+1,n+1); params = k_params.template view(); } diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.h b/src/KOKKOS/pair_buck_coul_cut_kokkos.h index fd4594bdfb..c41defe486 100644 --- a/src/KOKKOS/pair_buck_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/coul/cut/kk,PairBuckCoulCutKokkos) -PairStyle(buck/coul/cut/kk/device,PairBuckCoulCutKokkos) -PairStyle(buck/coul/cut/kk/host,PairBuckCoulCutKokkos) - +// clang-format off +PairStyle(buck/coul/cut/kk,PairBuckCoulCutKokkos); +PairStyle(buck/coul/cut/kk/device,PairBuckCoulCutKokkos); +PairStyle(buck/coul/cut/kk/host,PairBuckCoulCutKokkos); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_CUT_KOKKOS_H @@ -53,8 +54,6 @@ class PairBuckCoulCutKokkos : public PairBuckCoulCut { }; protected: - void cleanup_copy() {} - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp index 2812abb026..01ad5c7ad8 100644 --- a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -56,10 +57,6 @@ PairBuckCoulLongKokkos::PairBuckCoulLongKokkos(LAMMPS *lmp):PairBuck execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_ljsq = nullptr; - cut_coulsq = 0.0; - } /* ---------------------------------------------------------------------- */ @@ -67,37 +64,18 @@ PairBuckCoulLongKokkos::PairBuckCoulLongKokkos(LAMMPS *lmp):PairBuck template PairBuckCoulLongKokkos::~PairBuckCoulLongKokkos() { - if (!copymode) { + if (copymode) return; + + if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - k_cutsq = DAT::tdual_ffloat_2d(); - k_cut_ljsq = DAT::tdual_ffloat_2d(); - k_cut_coulsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - memory->sfree(cut_ljsq); - //memory->sfree(cut_coulsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; - cut_ljsq = nullptr; - //cut_coulsq = nullptr; + memoryKK->destroy_kokkos(k_cutsq,cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq,cut_ljsq); } } /* ---------------------------------------------------------------------- */ -template -void PairBuckCoulLongKokkos::cleanup_copy() { - allocated = 0; - cutsq = nullptr; - cut_ljsq = nullptr; - eatom = nullptr; - vatom = nullptr; - ftable = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairBuckCoulLongKokkos::compute(int eflag_in, int vflag_in) { @@ -124,7 +102,6 @@ void PairBuckCoulLongKokkos::compute(int eflag_in, int vflag_in) atomKK->sync(execution_space,datamask_read); k_cutsq.template sync(); k_cut_ljsq.template sync(); - k_cut_coulsq.template sync(); k_params.template sync(); if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); else atomKK->modified(execution_space,F_MASK); @@ -313,8 +290,7 @@ void PairBuckCoulLongKokkos::allocate() memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); - memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); - d_cut_coulsq = k_cut_coulsq.template view(); + d_cut_coulsq = typename AT::t_ffloat_2d("pair:cut_coulsq",n+1,n+1); k_params = Kokkos::DualView("PairBuckCoulLong::params",n+1,n+1); params = k_params.template view(); @@ -445,6 +421,8 @@ void PairBuckCoulLongKokkos::init_style() { PairBuckCoulLong::init_style(); + Kokkos::deep_copy(d_cut_coulsq,cut_coulsq); + // error if rRESPA with inner levels if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { @@ -486,7 +464,6 @@ double PairBuckCoulLongKokkos::init_one(int i, int j) { double cutone = PairBuckCoulLong::init_one(i,j); double cut_ljsqm = cut_ljsq[i][j]; - double cut_coulsqm = cut_coulsq; k_params.h_view(i,j).a = a[i][j]; k_params.h_view(i,j).c = c[i][j]; @@ -495,29 +472,25 @@ double PairBuckCoulLongKokkos::init_one(int i, int j) k_params.h_view(i,j).buck2 = buck2[i][j]; k_params.h_view(i,j).offset = offset[i][j]; k_params.h_view(i,j).cut_ljsq = cut_ljsqm; - k_params.h_view(i,j).cut_coulsq = cut_coulsqm; + k_params.h_view(i,j).cut_coulsq = cut_coulsq; k_params.h_view(j,i) = k_params.h_view(i,j); if (i(); k_cut_ljsq.h_view(i,j) = cut_ljsqm; k_cut_ljsq.template modify(); - k_cut_coulsq.h_view(i,j) = cut_coulsqm; - k_cut_coulsq.template modify(); k_params.template modify(); return cutone; - } - namespace LAMMPS_NS { template class PairBuckCoulLongKokkos; #ifdef LMP_KOKKOS_GPU diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.h b/src/KOKKOS/pair_buck_coul_long_kokkos.h index 1511035472..d855709fc1 100644 --- a/src/KOKKOS/pair_buck_coul_long_kokkos.h +++ b/src/KOKKOS/pair_buck_coul_long_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/coul/long/kk,PairBuckCoulLongKokkos) -PairStyle(buck/coul/long/kk/device,PairBuckCoulLongKokkos) -PairStyle(buck/coul/long/kk/host,PairBuckCoulLongKokkos) - +// clang-format off +PairStyle(buck/coul/long/kk,PairBuckCoulLongKokkos); +PairStyle(buck/coul/long/kk/device,PairBuckCoulLongKokkos); +PairStyle(buck/coul/long/kk/host,PairBuckCoulLongKokkos); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_LONG_KOKKOS_H @@ -54,8 +55,6 @@ class PairBuckCoulLongKokkos : public PairBuckCoulLong { }; protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, @@ -102,7 +101,6 @@ class PairBuckCoulLongKokkos : public PairBuckCoulLong { typename AT::t_ffloat_2d d_cutsq; typename AT::tdual_ffloat_2d k_cut_ljsq; typename AT::t_ffloat_2d d_cut_ljsq; - typename AT::tdual_ffloat_2d k_cut_coulsq; typename AT::t_ffloat_2d d_cut_coulsq; typename AT::t_ffloat_1d_randomread diff --git a/src/KOKKOS/pair_buck_kokkos.cpp b/src/KOKKOS/pair_buck_kokkos.cpp index b51bde119c..2f7a486997 100644 --- a/src/KOKKOS/pair_buck_kokkos.cpp +++ b/src/KOKKOS/pair_buck_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -47,7 +48,6 @@ PairBuckKokkos::PairBuckKokkos(LAMMPS *lmp) : PairBuck(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -55,14 +55,12 @@ PairBuckKokkos::PairBuckKokkos(LAMMPS *lmp) : PairBuck(lmp) template PairBuckKokkos::~PairBuckKokkos() { - if (!copymode) { + if (copymode) return; + + if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - k_cutsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; + memoryKK->destroy_kokkos(k_cutsq,cutsq); } } diff --git a/src/KOKKOS/pair_buck_kokkos.h b/src/KOKKOS/pair_buck_kokkos.h index 370079973f..e1859c2522 100644 --- a/src/KOKKOS/pair_buck_kokkos.h +++ b/src/KOKKOS/pair_buck_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/kk,PairBuckKokkos) -PairStyle(buck/kk/device,PairBuckKokkos) -PairStyle(buck/kk/host,PairBuckKokkos) - +// clang-format off +PairStyle(buck/kk,PairBuckKokkos); +PairStyle(buck/kk/device,PairBuckKokkos); +PairStyle(buck/kk/host,PairBuckKokkos); +// clang-format on #else #ifndef LMP_PAIR_BUCK_KOKKOS_H @@ -52,8 +53,6 @@ class PairBuckKokkos : public PairBuck { }; protected: - void cleanup_copy() {} - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const; diff --git a/src/KOKKOS/pair_coul_cut_kokkos.cpp b/src/KOKKOS/pair_coul_cut_kokkos.cpp index ff4028a792..89390576e7 100644 --- a/src/KOKKOS/pair_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_coul_cut_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -38,7 +39,6 @@ PairCoulCutKokkos::PairCoulCutKokkos(LAMMPS *lmp) : PairCoulCut(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -46,19 +46,13 @@ PairCoulCutKokkos::PairCoulCutKokkos(LAMMPS *lmp) : PairCoulCut(lmp) template PairCoulCutKokkos::~PairCoulCutKokkos() { - if (allocated) + if (copymode) return; + + if (allocated) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); memoryKK->destroy_kokkos(k_cutsq, cutsq); -} - -/* ---------------------------------------------------------------------- */ - -template -void PairCoulCutKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - eatom = nullptr; - vatom = nullptr; + } } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_coul_cut_kokkos.h b/src/KOKKOS/pair_coul_cut_kokkos.h index 947a133c7c..b76e793487 100644 --- a/src/KOKKOS/pair_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_coul_cut_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/cut/kk,PairCoulCutKokkos) -PairStyle(coul/cut/kk/device,PairCoulCutKokkos) -PairStyle(coul/cut/kk/host,PairCoulCutKokkos) - +// clang-format off +PairStyle(coul/cut/kk,PairCoulCutKokkos); +PairStyle(coul/cut/kk/device,PairCoulCutKokkos); +PairStyle(coul/cut/kk/host,PairCoulCutKokkos); +// clang-format on #else #ifndef LMP_PAIR_COUL_CUT_KOKKOS_H @@ -53,8 +54,6 @@ class PairCoulCutKokkos : public PairCoulCut { }; protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, diff --git a/src/KOKKOS/pair_coul_debye_kokkos.cpp b/src/KOKKOS/pair_coul_debye_kokkos.cpp index e380a874ff..55d0754328 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_coul_debye_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -47,8 +48,6 @@ PairCoulDebyeKokkos::PairCoulDebyeKokkos(LAMMPS *lmp):PairCoulDebye( execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - } /* ---------------------------------------------------------------------- */ @@ -56,19 +55,13 @@ PairCoulDebyeKokkos::PairCoulDebyeKokkos(LAMMPS *lmp):PairCoulDebye( template PairCoulDebyeKokkos::~PairCoulDebyeKokkos() { - if (allocated) - memoryKK->destroy_kokkos(k_cutsq, cutsq); -} + if (copymode) return; -/* ---------------------------------------------------------------------- */ - -template -void PairCoulDebyeKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - eatom = nullptr; - vatom = nullptr; + if (allocated) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_cutsq,cutsq); + } } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_coul_debye_kokkos.h b/src/KOKKOS/pair_coul_debye_kokkos.h index c594ffe655..88f5bc9693 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.h +++ b/src/KOKKOS/pair_coul_debye_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/debye/kk,PairCoulDebyeKokkos) -PairStyle(coul/debye/kk/device,PairCoulDebyeKokkos) -PairStyle(coul/debye/kk/host,PairCoulDebyeKokkos) - +// clang-format off +PairStyle(coul/debye/kk,PairCoulDebyeKokkos); +PairStyle(coul/debye/kk/device,PairCoulDebyeKokkos); +PairStyle(coul/debye/kk/host,PairCoulDebyeKokkos); +// clang-format on #else #ifndef LMP_PAIR_COUL_DEBYE_KOKKOS_H @@ -53,8 +54,6 @@ class PairCoulDebyeKokkos : public PairCoulDebye { }; protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, diff --git a/src/KOKKOS/pair_coul_dsf_kokkos.cpp b/src/KOKKOS/pair_coul_dsf_kokkos.cpp index 4981d3240f..8cfdb709f5 100644 --- a/src/KOKKOS/pair_coul_dsf_kokkos.cpp +++ b/src/KOKKOS/pair_coul_dsf_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_coul_dsf_kokkos.h b/src/KOKKOS/pair_coul_dsf_kokkos.h index f42b99aa44..357b8d1382 100644 --- a/src/KOKKOS/pair_coul_dsf_kokkos.h +++ b/src/KOKKOS/pair_coul_dsf_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/dsf/kk,PairCoulDSFKokkos) -PairStyle(coul/dsf/kk/device,PairCoulDSFKokkos) -PairStyle(coul/dsf/kk/host,PairCoulDSFKokkos) - +// clang-format off +PairStyle(coul/dsf/kk,PairCoulDSFKokkos); +PairStyle(coul/dsf/kk/device,PairCoulDSFKokkos); +PairStyle(coul/dsf/kk/host,PairCoulDSFKokkos); +// clang-format on #else #ifndef LMP_PAIR_COUL_DSF_KOKKOS_H diff --git a/src/KOKKOS/pair_coul_long_kokkos.cpp b/src/KOKKOS/pair_coul_long_kokkos.cpp index 4075108823..f45366df22 100644 --- a/src/KOKKOS/pair_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_coul_long_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -56,9 +57,6 @@ PairCoulLongKokkos::PairCoulLongKokkos(LAMMPS *lmp):PairCoulLong(lmp execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_coulsq = 0.0; - } /* ---------------------------------------------------------------------- */ @@ -66,31 +64,17 @@ PairCoulLongKokkos::PairCoulLongKokkos(LAMMPS *lmp):PairCoulLong(lmp template PairCoulLongKokkos::~PairCoulLongKokkos() { - if (!copymode) { + if (copymode) return; + + if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - k_cutsq = DAT::tdual_ffloat_2d(); - k_cut_coulsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; + memoryKK->destroy_kokkos(k_cutsq,cutsq); } } /* ---------------------------------------------------------------------- */ -template -void PairCoulLongKokkos::cleanup_copy() { - allocated = 0; - cutsq = nullptr; - eatom = nullptr; - vatom = nullptr; - ftable = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairCoulLongKokkos::compute(int eflag_in, int vflag_in) { @@ -116,7 +100,6 @@ void PairCoulLongKokkos::compute(int eflag_in, int vflag_in) atomKK->sync(execution_space,datamask_read); k_cutsq.template sync(); - k_cut_coulsq.template sync(); k_params.template sync(); if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); else atomKK->modified(execution_space,F_MASK); @@ -271,8 +254,7 @@ void PairCoulLongKokkos::allocate() memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); - memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); - d_cut_coulsq = k_cut_coulsq.template view(); + d_cut_coulsq = typename AT::t_ffloat_2d("pair:cut_coulsq",n+1,n+1); k_params = Kokkos::DualView("PairCoulLong::params",n+1,n+1); params = k_params.template view(); @@ -403,6 +385,8 @@ void PairCoulLongKokkos::init_style() { PairCoulLong::init_style(); + Kokkos::deep_copy(d_cut_coulsq,cut_coulsq); + // error if rRESPA with inner levels if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { @@ -443,28 +427,23 @@ template double PairCoulLongKokkos::init_one(int i, int j) { double cutone = PairCoulLong::init_one(i,j); - double cut_coulsqm = cut_coulsq; - k_params.h_view(i,j).cut_coulsq = cut_coulsqm; + k_params.h_view(i,j).cut_coulsq = cut_coulsq; k_params.h_view(j,i) = k_params.h_view(i,j); if (i(); - k_cut_coulsq.h_view(i,j) = cut_coulsqm; - k_cut_coulsq.template modify(); k_params.template modify(); return cutone; - } - namespace LAMMPS_NS { template class PairCoulLongKokkos; #ifdef LMP_KOKKOS_GPU diff --git a/src/KOKKOS/pair_coul_long_kokkos.h b/src/KOKKOS/pair_coul_long_kokkos.h index 358c4eed2e..85d6028808 100644 --- a/src/KOKKOS/pair_coul_long_kokkos.h +++ b/src/KOKKOS/pair_coul_long_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/long/kk,PairCoulLongKokkos) -PairStyle(coul/long/kk/device,PairCoulLongKokkos) -PairStyle(coul/long/kk/host,PairCoulLongKokkos) - +// clang-format off +PairStyle(coul/long/kk,PairCoulLongKokkos); +PairStyle(coul/long/kk/device,PairCoulLongKokkos); +PairStyle(coul/long/kk/host,PairCoulLongKokkos); +// clang-format on #else #ifndef LMP_PAIR_COUL_LONG_KOKKOS_H @@ -54,8 +55,6 @@ class PairCoulLongKokkos : public PairCoulLong { }; protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, @@ -100,9 +99,7 @@ class PairCoulLongKokkos : public PairCoulLong { typename AT::tdual_ffloat_2d k_cutsq; typename AT::t_ffloat_2d d_cutsq; - typename AT::tdual_ffloat_2d k_cut_ljsq; typename AT::t_ffloat_2d d_cut_ljsq; - typename AT::tdual_ffloat_2d k_cut_coulsq; typename AT::t_ffloat_2d d_cut_coulsq; typename AT::t_ffloat_1d_randomread diff --git a/src/KOKKOS/pair_coul_wolf_kokkos.cpp b/src/KOKKOS/pair_coul_wolf_kokkos.cpp index 44d9222baf..e652c50a39 100644 --- a/src/KOKKOS/pair_coul_wolf_kokkos.cpp +++ b/src/KOKKOS/pair_coul_wolf_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_coul_wolf_kokkos.h b/src/KOKKOS/pair_coul_wolf_kokkos.h index 0c06908eed..0ff8b4dc90 100644 --- a/src/KOKKOS/pair_coul_wolf_kokkos.h +++ b/src/KOKKOS/pair_coul_wolf_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/wolf/kk,PairCoulWolfKokkos) -PairStyle(coul/wolf/kk/device,PairCoulWolfKokkos) -PairStyle(coul/wolf/kk/host,PairCoulWolfKokkos) - +// clang-format off +PairStyle(coul/wolf/kk,PairCoulWolfKokkos); +PairStyle(coul/wolf/kk/device,PairCoulWolfKokkos); +PairStyle(coul/wolf/kk/host,PairCoulWolfKokkos); +// clang-format on #else #ifndef LMP_PAIR_COUL_WOLF_KOKKOS_H diff --git a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp index 529dead5c8..b84396d6f1 100644 --- a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h index 778c117d81..58e7797de5 100644 --- a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h +++ b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dpd/fdt/energy/kk,PairDPDfdtEnergyKokkos) -PairStyle(dpd/fdt/energy/kk/device,PairDPDfdtEnergyKokkos) -PairStyle(dpd/fdt/energy/kk/host,PairDPDfdtEnergyKokkos) - +// clang-format off +PairStyle(dpd/fdt/energy/kk,PairDPDfdtEnergyKokkos); +PairStyle(dpd/fdt/energy/kk/device,PairDPDfdtEnergyKokkos); +PairStyle(dpd/fdt/energy/kk/host,PairDPDfdtEnergyKokkos); +// clang-format on #else #ifndef LMP_PAIR_DPD_FDT_ENERGY_KOKKOS_H diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.cpp b/src/KOKKOS/pair_eam_alloy_kokkos.cpp index 53dd174a4f..a8e65c4a92 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.cpp +++ b/src/KOKKOS/pair_eam_alloy_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.h b/src/KOKKOS/pair_eam_alloy_kokkos.h index c0d4ffbc18..4d533c9bf6 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.h +++ b/src/KOKKOS/pair_eam_alloy_kokkos.h @@ -1,7 +1,8 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,11 +14,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/alloy/kk,PairEAMAlloyKokkos) -PairStyle(eam/alloy/kk/device,PairEAMAlloyKokkos) -PairStyle(eam/alloy/kk/host,PairEAMAlloyKokkos) - +// clang-format off +PairStyle(eam/alloy/kk,PairEAMAlloyKokkos); +PairStyle(eam/alloy/kk/device,PairEAMAlloyKokkos); +PairStyle(eam/alloy/kk/host,PairEAMAlloyKokkos); +// clang-format on #else #ifndef LMP_PAIR_EAM_ALLOY_KOKKOS_H @@ -116,8 +117,6 @@ class PairEAMAlloyKokkos : public PairEAM, public KokkosBase { void unpack_reverse_comm(int, int *, double *); protected: - void cleanup_copy(); - typename AT::t_x_array x; typename AT::t_f_array f; typename AT::t_int_1d type; diff --git a/src/KOKKOS/pair_eam_fs_kokkos.cpp b/src/KOKKOS/pair_eam_fs_kokkos.cpp index 39a3392271..b12de79b37 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.cpp +++ b/src/KOKKOS/pair_eam_fs_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_eam_fs_kokkos.h b/src/KOKKOS/pair_eam_fs_kokkos.h index ca0e64aa54..016b3ae922 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.h +++ b/src/KOKKOS/pair_eam_fs_kokkos.h @@ -1,7 +1,8 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,11 +14,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/fs/kk,PairEAMFSKokkos) -PairStyle(eam/fs/kk/device,PairEAMFSKokkos) -PairStyle(eam/fs/kk/host,PairEAMFSKokkos) - +// clang-format off +PairStyle(eam/fs/kk,PairEAMFSKokkos); +PairStyle(eam/fs/kk/device,PairEAMFSKokkos); +PairStyle(eam/fs/kk/host,PairEAMFSKokkos); +// clang-format on #else #ifndef LMP_PAIR_EAM_FS_KOKKOS_H @@ -116,8 +117,6 @@ class PairEAMFSKokkos : public PairEAM, public KokkosBase { void unpack_reverse_comm(int, int *, double *); protected: - void cleanup_copy(); - typename AT::t_x_array x; typename AT::t_f_array f; typename AT::t_int_1d type; diff --git a/src/KOKKOS/pair_eam_kokkos.cpp b/src/KOKKOS/pair_eam_kokkos.cpp index 5025b4d642..c9d2808075 100644 --- a/src/KOKKOS/pair_eam_kokkos.cpp +++ b/src/KOKKOS/pair_eam_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_eam_kokkos.h b/src/KOKKOS/pair_eam_kokkos.h index e4cc3f28ae..6920eb1022 100644 --- a/src/KOKKOS/pair_eam_kokkos.h +++ b/src/KOKKOS/pair_eam_kokkos.h @@ -1,7 +1,8 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,11 +14,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/kk,PairEAMKokkos) -PairStyle(eam/kk/device,PairEAMKokkos) -PairStyle(eam/kk/host,PairEAMKokkos) - +// clang-format off +PairStyle(eam/kk,PairEAMKokkos); +PairStyle(eam/kk/device,PairEAMKokkos); +PairStyle(eam/kk/host,PairEAMKokkos); +// clang-format on #else #ifndef LMP_PAIR_EAM_KOKKOS_H @@ -113,8 +114,6 @@ class PairEAMKokkos : public PairEAM, public KokkosBase { void unpack_reverse_comm(int, int *, double *); protected: - void cleanup_copy(); - typename AT::t_x_array x; typename AT::t_f_array f; typename AT::t_int_1d type; diff --git a/src/KOKKOS/pair_exp6_rx_kokkos.cpp b/src/KOKKOS/pair_exp6_rx_kokkos.cpp index c0cfd11466..152c4c3a7d 100644 --- a/src/KOKKOS/pair_exp6_rx_kokkos.cpp +++ b/src/KOKKOS/pair_exp6_rx_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_exp6_rx_kokkos.h b/src/KOKKOS/pair_exp6_rx_kokkos.h index 640ea360db..b3363f39f6 100644 --- a/src/KOKKOS/pair_exp6_rx_kokkos.h +++ b/src/KOKKOS/pair_exp6_rx_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(exp6/rx/kk,PairExp6rxKokkos) -PairStyle(exp6/rx/kk/device,PairExp6rxKokkos) -PairStyle(exp6/rx/kk/host,PairExp6rxKokkos) - +// clang-format off +PairStyle(exp6/rx/kk,PairExp6rxKokkos); +PairStyle(exp6/rx/kk/device,PairExp6rxKokkos); +PairStyle(exp6/rx/kk/host,PairExp6rxKokkos); +// clang-format on #else #ifndef LMP_PAIR_EXP6_RX_KOKKOS_H diff --git a/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp b/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp index 01ac1ea54f..93f8e37006 100644 --- a/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp +++ b/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_gran_hooke_history_kokkos.h b/src/KOKKOS/pair_gran_hooke_history_kokkos.h index 96997f45aa..638901c5af 100644 --- a/src/KOKKOS/pair_gran_hooke_history_kokkos.h +++ b/src/KOKKOS/pair_gran_hooke_history_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gran/hooke/history/kk,PairGranHookeHistoryKokkos) -PairStyle(gran/hooke/history/kk/device,PairGranHookeHistoryKokkos) -PairStyle(gran/hooke/history/kk/host,PairGranHookeHistoryKokkos) - +// clang-format off +PairStyle(gran/hooke/history/kk,PairGranHookeHistoryKokkos); +PairStyle(gran/hooke/history/kk/device,PairGranHookeHistoryKokkos); +PairStyle(gran/hooke/history/kk/host,PairGranHookeHistoryKokkos); +// clang-format on #else #ifndef LMP_PAIR_GRAN_HOOKE_HISTORY_KOKKOS_H diff --git a/src/KOKKOS/pair_hybrid_kokkos.cpp b/src/KOKKOS/pair_hybrid_kokkos.cpp index 5ef2edf1b6..b1d3e0259f 100644 --- a/src/KOKKOS/pair_hybrid_kokkos.cpp +++ b/src/KOKKOS/pair_hybrid_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_hybrid_kokkos.h b/src/KOKKOS/pair_hybrid_kokkos.h index 618a3e76f2..3a222618d3 100644 --- a/src/KOKKOS/pair_hybrid_kokkos.h +++ b/src/KOKKOS/pair_hybrid_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(hybrid/kk,PairHybridKokkos) - +// clang-format off +PairStyle(hybrid/kk,PairHybridKokkos); +// clang-format on #else #ifndef LMP_PAIR_HYBRID_KOKKOS_H diff --git a/src/KOKKOS/pair_hybrid_overlay_kokkos.cpp b/src/KOKKOS/pair_hybrid_overlay_kokkos.cpp index b819b1e898..c815e2ad72 100644 --- a/src/KOKKOS/pair_hybrid_overlay_kokkos.cpp +++ b/src/KOKKOS/pair_hybrid_overlay_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_hybrid_overlay_kokkos.h b/src/KOKKOS/pair_hybrid_overlay_kokkos.h index c61c15fe52..aeef5c311c 100644 --- a/src/KOKKOS/pair_hybrid_overlay_kokkos.h +++ b/src/KOKKOS/pair_hybrid_overlay_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(hybrid/overlay/kk,PairHybridOverlayKokkos) - +// clang-format off +PairStyle(hybrid/overlay/kk,PairHybridOverlayKokkos); +// clang-format on #else #ifndef LMP_PAIR_HYBRID_OVERLAY_KOKKOS_H diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index 08c33ca04c..91fd034f74 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -94,8 +95,8 @@ struct PairComputeFunctor { dup_vatom = Kokkos::Experimental::create_scatter_view::value >(c.d_vatom); }; - // Call cleanup_copy which sets allocations to null which are destructed by the PairStyle - ~PairComputeFunctor() {c.cleanup_copy();list.copymode = 1;}; + // Set copymode = 1 so parent allocations aren't destructed by copies of the style + ~PairComputeFunctor() {c.copymode = 1; list.copymode = 1;}; KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const { return j >> SBBITS & 3; diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp index a0abce1510..ab49237f4e 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -55,10 +56,6 @@ PairLJCharmmCoulCharmmImplicitKokkos::PairLJCharmmCoulCharmmImplicit execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_ljsq = 0.0; - cut_coulsq = 0.0; - } /* ---------------------------------------------------------------------- */ @@ -66,38 +63,17 @@ PairLJCharmmCoulCharmmImplicitKokkos::PairLJCharmmCoulCharmmImplicit template PairLJCharmmCoulCharmmImplicitKokkos::~PairLJCharmmCoulCharmmImplicitKokkos() { - if (!copymode) { + if (copymode) return; + + if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - k_cutsq = DAT::tdual_ffloat_2d(); - k_cut_ljsq = DAT::tdual_ffloat_2d(); - k_cut_coulsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - //memory->sfree(cut_ljsq); - //memory->sfree(cut_coulsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; - cut_ljsq = 0.0; - cut_coulsq = 0.0; + memoryKK->destroy_kokkos(k_cutsq,cutsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJCharmmCoulCharmmImplicitKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - cut_ljsq = 0.0; - eatom = nullptr; - vatom = nullptr; - ftable = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJCharmmCoulCharmmImplicitKokkos::compute(int eflag_in, int vflag_in) { @@ -123,8 +99,6 @@ void PairLJCharmmCoulCharmmImplicitKokkos::compute(int eflag_in, int atomKK->sync(execution_space,datamask_read); k_cutsq.template sync(); - k_cut_ljsq.template sync(); - k_cut_coulsq.template sync(); k_params.template sync(); if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); else atomKK->modified(execution_space,F_MASK); @@ -312,12 +286,9 @@ void PairLJCharmmCoulCharmmImplicitKokkos::allocate() memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); - //memory->destroy(cut_ljsq); - memoryKK->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq"); - d_cut_ljsq = k_cut_ljsq.template view(); + d_cut_ljsq = typename AT::t_ffloat_2d("pair:cut_ljsq",n+1,n+1); - memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); - d_cut_coulsq = k_cut_coulsq.template view(); + d_cut_coulsq = typename AT::t_ffloat_2d("pair:cut_coulsq",n+1,n+1); k_params = Kokkos::DualView("PairLJCharmmCoulCharmmImplicit::params",n+1,n+1); params = k_params.template view(); @@ -448,6 +419,9 @@ void PairLJCharmmCoulCharmmImplicitKokkos::init_style() { PairLJCharmmCoulCharmmImplicit::init_style(); + Kokkos::deep_copy(d_cut_ljsq,cut_ljsq); + Kokkos::deep_copy(d_cut_coulsq,cut_coulsq); + // error if rRESPA with inner levels if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { @@ -488,31 +462,25 @@ template double PairLJCharmmCoulCharmmImplicitKokkos::init_one(int i, int j) { double cutone = PairLJCharmmCoulCharmmImplicit::init_one(i,j); - double cut_ljsqm = cut_ljsq; - double cut_coulsqm = cut_coulsq; k_params.h_view(i,j).lj1 = lj1[i][j]; k_params.h_view(i,j).lj2 = lj2[i][j]; k_params.h_view(i,j).lj3 = lj3[i][j]; k_params.h_view(i,j).lj4 = lj4[i][j]; //k_params.h_view(i,j).offset = offset[i][j]; - k_params.h_view(i,j).cut_ljsq = cut_ljsqm; - k_params.h_view(i,j).cut_coulsq = cut_coulsqm; + k_params.h_view(i,j).cut_ljsq = cut_ljsq; + k_params.h_view(i,j).cut_coulsq = cut_coulsq; k_params.h_view(j,i) = k_params.h_view(i,j); if (i(); - k_cut_ljsq.h_view(i,j) = k_cut_ljsq.h_view(j,i) = cut_ljsqm; - k_cut_ljsq.template modify(); - k_cut_coulsq.h_view(i,j) = k_cut_coulsq.h_view(j,i) = cut_coulsqm; - k_cut_coulsq.template modify(); k_params.template modify(); return cutone; diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h index 272cc2b491..197e388114 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/charmm/implicit/kk,PairLJCharmmCoulCharmmImplicitKokkos) -PairStyle(lj/charmm/coul/charmm/implicit/kk/device,PairLJCharmmCoulCharmmImplicitKokkos) -PairStyle(lj/charmm/coul/charmm/implicit/kk/host,PairLJCharmmCoulCharmmImplicitKokkos) - +// clang-format off +PairStyle(lj/charmm/coul/charmm/implicit/kk,PairLJCharmmCoulCharmmImplicitKokkos); +PairStyle(lj/charmm/coul/charmm/implicit/kk/device,PairLJCharmmCoulCharmmImplicitKokkos); +PairStyle(lj/charmm/coul/charmm/implicit/kk/host,PairLJCharmmCoulCharmmImplicitKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_CHARMM_IMPLICIT_KOKKOS_H @@ -47,8 +48,6 @@ class PairLJCharmmCoulCharmmImplicitKokkos : public PairLJCharmmCoulCharmmImplic protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp index f683204d9d..66064d58b2 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -56,10 +57,6 @@ PairLJCharmmCoulCharmmKokkos::PairLJCharmmCoulCharmmKokkos(LAMMPS *l execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_ljsq = 0.0; - cut_coulsq = 0.0; - } /* ---------------------------------------------------------------------- */ @@ -67,38 +64,17 @@ PairLJCharmmCoulCharmmKokkos::PairLJCharmmCoulCharmmKokkos(LAMMPS *l template PairLJCharmmCoulCharmmKokkos::~PairLJCharmmCoulCharmmKokkos() { - if (!copymode) { + if (copymode) return; + + if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); - k_cut_ljsq = DAT::tdual_ffloat_2d(); - k_cut_coulsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - //memory->sfree(cut_ljsq); - //memory->sfree(cut_coulsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; - cut_ljsq = 0.0; - cut_coulsq = 0.0; } } /* ---------------------------------------------------------------------- */ -template -void PairLJCharmmCoulCharmmKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - cut_ljsq = 0.0; - eatom = nullptr; - vatom = nullptr; - ftable = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJCharmmCoulCharmmKokkos::compute(int eflag_in, int vflag_in) { @@ -124,8 +100,6 @@ void PairLJCharmmCoulCharmmKokkos::compute(int eflag_in, int vflag_i atomKK->sync(execution_space,datamask_read); k_cutsq.template sync(); - k_cut_ljsq.template sync(); - k_cut_coulsq.template sync(); k_params.template sync(); if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); else atomKK->modified(execution_space,F_MASK); @@ -313,12 +287,9 @@ void PairLJCharmmCoulCharmmKokkos::allocate() memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); - //memory->destroy(cut_ljsq); - memoryKK->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq"); - d_cut_ljsq = k_cut_ljsq.template view(); + d_cut_ljsq = typename AT::t_ffloat_2d("pair:cut_ljsq",n+1,n+1); - memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); - d_cut_coulsq = k_cut_coulsq.template view(); + d_cut_coulsq = typename AT::t_ffloat_2d("pair:cut_coulsq",n+1,n+1); k_params = Kokkos::DualView("PairLJCharmmCoulCharmm::params",n+1,n+1); params = k_params.template view(); @@ -449,6 +420,9 @@ void PairLJCharmmCoulCharmmKokkos::init_style() { PairLJCharmmCoulCharmm::init_style(); + Kokkos::deep_copy(d_cut_ljsq,cut_ljsq); + Kokkos::deep_copy(d_cut_coulsq,cut_coulsq); + // error if rRESPA with inner levels if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { @@ -489,38 +463,30 @@ template double PairLJCharmmCoulCharmmKokkos::init_one(int i, int j) { double cutone = PairLJCharmmCoulCharmm::init_one(i,j); - double cut_ljsqm = cut_ljsq; - double cut_coulsqm = cut_coulsq; k_params.h_view(i,j).lj1 = lj1[i][j]; k_params.h_view(i,j).lj2 = lj2[i][j]; k_params.h_view(i,j).lj3 = lj3[i][j]; k_params.h_view(i,j).lj4 = lj4[i][j]; //k_params.h_view(i,j).offset = offset[i][j]; - k_params.h_view(i,j).cut_ljsq = cut_ljsqm; - k_params.h_view(i,j).cut_coulsq = cut_coulsqm; + k_params.h_view(i,j).cut_ljsq = cut_ljsq; + k_params.h_view(i,j).cut_coulsq = cut_coulsq; k_params.h_view(j,i) = k_params.h_view(i,j); if (i(); - k_cut_ljsq.h_view(i,j) = k_cut_ljsq.h_view(j,i) = cut_ljsqm; - k_cut_ljsq.template modify(); - k_cut_coulsq.h_view(i,j) = k_cut_coulsq.h_view(j,i) = cut_coulsqm; - k_cut_coulsq.template modify(); k_params.template modify(); return cutone; } - - namespace LAMMPS_NS { template class PairLJCharmmCoulCharmmKokkos; #ifdef LMP_KOKKOS_GPU diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h index 38caf1336e..31f7d4a9c0 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/charmm/kk,PairLJCharmmCoulCharmmKokkos) -PairStyle(lj/charmm/coul/charmm/kk/device,PairLJCharmmCoulCharmmKokkos) -PairStyle(lj/charmm/coul/charmm/kk/host,PairLJCharmmCoulCharmmKokkos) - +// clang-format off +PairStyle(lj/charmm/coul/charmm/kk,PairLJCharmmCoulCharmmKokkos); +PairStyle(lj/charmm/coul/charmm/kk/device,PairLJCharmmCoulCharmmKokkos); +PairStyle(lj/charmm/coul/charmm/kk/host,PairLJCharmmCoulCharmmKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_CHARMM_KOKKOS_H @@ -47,8 +48,6 @@ class PairLJCharmmCoulCharmmKokkos : public PairLJCharmmCoulCharmm { protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, @@ -93,9 +92,7 @@ class PairLJCharmmCoulCharmmKokkos : public PairLJCharmmCoulCharmm { typename AT::tdual_ffloat_2d k_cutsq; typename AT::t_ffloat_2d d_cutsq; - typename AT::tdual_ffloat_2d k_cut_ljsq; typename AT::t_ffloat_2d d_cut_ljsq; - typename AT::tdual_ffloat_2d k_cut_coulsq; typename AT::t_ffloat_2d d_cut_coulsq; typename AT::t_ffloat_1d_randomread diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp index 7f9876a76f..0a650e30e1 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -56,10 +57,6 @@ PairLJCharmmCoulLongKokkos::PairLJCharmmCoulLongKokkos(LAMMPS *lmp): execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_ljsq = 0.0; - cut_coulsq = 0.0; - } /* ---------------------------------------------------------------------- */ @@ -67,38 +64,17 @@ PairLJCharmmCoulLongKokkos::PairLJCharmmCoulLongKokkos(LAMMPS *lmp): template PairLJCharmmCoulLongKokkos::~PairLJCharmmCoulLongKokkos() { - if (!copymode) { + if (copymode) return; + + if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - k_cutsq = DAT::tdual_ffloat_2d(); - k_cut_ljsq = DAT::tdual_ffloat_2d(); - k_cut_coulsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - //memory->sfree(cut_ljsq); - //memory->sfree(cut_coulsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; - cut_ljsq = 0.0; - cut_coulsq = 0.0; + memoryKK->destroy_kokkos(k_cutsq,cutsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJCharmmCoulLongKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - cut_ljsq = 0.0; - eatom = nullptr; - vatom = nullptr; - ftable = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJCharmmCoulLongKokkos::compute(int eflag_in, int vflag_in) { @@ -124,8 +100,6 @@ void PairLJCharmmCoulLongKokkos::compute(int eflag_in, int vflag_in) atomKK->sync(execution_space,datamask_read); k_cutsq.template sync(); - k_cut_ljsq.template sync(); - k_cut_coulsq.template sync(); k_params.template sync(); if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); else atomKK->modified(execution_space,F_MASK); @@ -334,12 +308,9 @@ void PairLJCharmmCoulLongKokkos::allocate() memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); - //memory->destroy(cut_ljsq); - memoryKK->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq"); - d_cut_ljsq = k_cut_ljsq.template view(); + d_cut_ljsq = typename AT::t_ffloat_2d("pair:cut_ljsq",n+1,n+1); - memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); - d_cut_coulsq = k_cut_coulsq.template view(); + d_cut_coulsq = typename AT::t_ffloat_2d("pair:cut_coulsq",n+1,n+1); k_params = Kokkos::DualView("PairLJCharmmCoulLong::params",n+1,n+1); params = k_params.template view(); @@ -457,6 +428,9 @@ void PairLJCharmmCoulLongKokkos::init_style() { PairLJCharmmCoulLong::init_style(); + Kokkos::deep_copy(d_cut_ljsq,cut_ljsq); + Kokkos::deep_copy(d_cut_coulsq,cut_coulsq); + // error if rRESPA with inner levels if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { @@ -497,38 +471,30 @@ template double PairLJCharmmCoulLongKokkos::init_one(int i, int j) { double cutone = PairLJCharmmCoulLong::init_one(i,j); - double cut_ljsqm = cut_ljsq; - double cut_coulsqm = cut_coulsq; k_params.h_view(i,j).lj1 = lj1[i][j]; k_params.h_view(i,j).lj2 = lj2[i][j]; k_params.h_view(i,j).lj3 = lj3[i][j]; k_params.h_view(i,j).lj4 = lj4[i][j]; //k_params.h_view(i,j).offset = offset[i][j]; - k_params.h_view(i,j).cut_ljsq = cut_ljsqm; - k_params.h_view(i,j).cut_coulsq = cut_coulsqm; + k_params.h_view(i,j).cut_ljsq = cut_ljsq; + k_params.h_view(i,j).cut_coulsq = cut_coulsq; k_params.h_view(j,i) = k_params.h_view(i,j); if (i(); - k_cut_ljsq.h_view(i,j) = k_cut_ljsq.h_view(j,i) = cut_ljsqm; - k_cut_ljsq.template modify(); - k_cut_coulsq.h_view(i,j) = k_cut_coulsq.h_view(j,i) = cut_coulsqm; - k_cut_coulsq.template modify(); k_params.template modify(); return cutone; } - - namespace LAMMPS_NS { template class PairLJCharmmCoulLongKokkos; #ifdef LMP_KOKKOS_GPU diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h index a4517c49d6..34c2064549 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h +++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/long/kk,PairLJCharmmCoulLongKokkos) -PairStyle(lj/charmm/coul/long/kk/device,PairLJCharmmCoulLongKokkos) -PairStyle(lj/charmm/coul/long/kk/host,PairLJCharmmCoulLongKokkos) - +// clang-format off +PairStyle(lj/charmm/coul/long/kk,PairLJCharmmCoulLongKokkos); +PairStyle(lj/charmm/coul/long/kk/device,PairLJCharmmCoulLongKokkos); +PairStyle(lj/charmm/coul/long/kk/host,PairLJCharmmCoulLongKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_KOKKOS_H @@ -45,8 +46,6 @@ class PairLJCharmmCoulLongKokkos : public PairLJCharmmCoulLong { double init_one(int, int); protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, @@ -91,9 +90,7 @@ class PairLJCharmmCoulLongKokkos : public PairLJCharmmCoulLong { typename AT::tdual_ffloat_2d k_cutsq; typename AT::t_ffloat_2d d_cutsq; - typename AT::tdual_ffloat_2d k_cut_ljsq; typename AT::t_ffloat_2d d_cut_ljsq; - typename AT::tdual_ffloat_2d k_cut_coulsq; typename AT::t_ffloat_2d d_cut_coulsq; typename AT::t_ffloat_1d_randomread diff --git a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp index 36a15da628..eb9baa0e92 100644 --- a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -44,10 +45,6 @@ PairLJClass2CoulCutKokkos::PairLJClass2CoulCutKokkos(LAMMPS *lmp):Pa execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_ljsq = nullptr; - cut_coulsq = nullptr; - } /* ---------------------------------------------------------------------- */ @@ -55,28 +52,19 @@ PairLJClass2CoulCutKokkos::PairLJClass2CoulCutKokkos(LAMMPS *lmp):Pa template PairLJClass2CoulCutKokkos::~PairLJClass2CoulCutKokkos() { - if (!copymode) { - memoryKK->destroy_kokkos(k_cutsq, cutsq); - memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); - memoryKK->destroy_kokkos(k_cut_coulsq, cut_coulsq); + if (copymode) return; + + if (allocated) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_cutsq,cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq,cut_ljsq); + memoryKK->destroy_kokkos(k_cut_coulsq,cut_coulsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJClass2CoulCutKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - cut_ljsq = nullptr; - cut_coulsq = nullptr; - eatom = nullptr; - vatom = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJClass2CoulCutKokkos::compute(int eflag_in, int vflag_in) { diff --git a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h index 558719bd00..a89b8fe5a1 100644 --- a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/coul/cut/kk,PairLJClass2CoulCutKokkos) -PairStyle(lj/class2/coul/cut/kk/device,PairLJClass2CoulCutKokkos) -PairStyle(lj/class2/coul/cut/kk/host,PairLJClass2CoulCutKokkos) - +// clang-format off +PairStyle(lj/class2/coul/cut/kk,PairLJClass2CoulCutKokkos); +PairStyle(lj/class2/coul/cut/kk/device,PairLJClass2CoulCutKokkos); +PairStyle(lj/class2/coul/cut/kk/host,PairLJClass2CoulCutKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_COUL_CUT_KOKKOS_H @@ -46,8 +47,6 @@ class PairLJClass2CoulCutKokkos : public PairLJClass2CoulCut { protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, diff --git a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp index 031d025544..3606b979c6 100644 --- a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -52,10 +53,6 @@ PairLJClass2CoulLongKokkos::PairLJClass2CoulLongKokkos(LAMMPS *lmp): execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_ljsq = nullptr; - cut_coulsq = 0.0; - } /* ---------------------------------------------------------------------- */ @@ -63,27 +60,18 @@ PairLJClass2CoulLongKokkos::PairLJClass2CoulLongKokkos(LAMMPS *lmp): template PairLJClass2CoulLongKokkos::~PairLJClass2CoulLongKokkos() { - if (!copymode) { - memoryKK->destroy_kokkos(k_cutsq, cutsq); - memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); + if (copymode) return; + + if (allocated) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_cutsq,cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq,cut_ljsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJClass2CoulLongKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - cut_ljsq = nullptr; - eatom = nullptr; - vatom = nullptr; - ftable = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJClass2CoulLongKokkos::compute(int eflag_in, int vflag_in) { @@ -110,7 +98,6 @@ void PairLJClass2CoulLongKokkos::compute(int eflag_in, int vflag_in) atomKK->sync(execution_space,datamask_read); k_cutsq.template sync(); k_cut_ljsq.template sync(); - k_cut_coulsq.template sync(); k_params.template sync(); if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); else atomKK->modified(execution_space,F_MASK); @@ -302,15 +289,17 @@ void PairLJClass2CoulLongKokkos::allocate() PairLJClass2CoulLong::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(); + memory->destroy(cut_ljsq); memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); - memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); - d_cut_coulsq = k_cut_coulsq.template view(); + d_cut_coulsq = typename AT::t_ffloat_2d("pair:cut_coulsq",n+1,n+1); + k_params = Kokkos::DualView("PairLJClass2CoulLong::params",n+1,n+1); params = k_params.template view(); } @@ -440,6 +429,8 @@ void PairLJClass2CoulLongKokkos::init_style() { PairLJClass2CoulLong::init_style(); + Kokkos::deep_copy(d_cut_coulsq,cut_coulsq); + // error if rRESPA with inner levels if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { @@ -481,7 +472,6 @@ double PairLJClass2CoulLongKokkos::init_one(int i, int j) { double cutone = PairLJClass2CoulLong::init_one(i,j); double cut_ljsqm = cut_ljsq[i][j]; - double cut_coulsqm = cut_coulsq; k_params.h_view(i,j).lj1 = lj1[i][j]; k_params.h_view(i,j).lj2 = lj2[i][j]; @@ -489,28 +479,25 @@ double PairLJClass2CoulLongKokkos::init_one(int i, int j) k_params.h_view(i,j).lj4 = lj4[i][j]; k_params.h_view(i,j).offset = offset[i][j]; k_params.h_view(i,j).cut_ljsq = cut_ljsqm; - k_params.h_view(i,j).cut_coulsq = cut_coulsqm; + k_params.h_view(i,j).cut_coulsq = cut_coulsq; k_params.h_view(j,i) = k_params.h_view(i,j); if (i(); k_cut_ljsq.h_view(i,j) = k_cut_ljsq.h_view(j,i) = cut_ljsqm; k_cut_ljsq.template modify(); - k_cut_coulsq.h_view(i,j) = k_cut_coulsq.h_view(j,i) = cut_coulsqm; - k_cut_coulsq.template modify(); k_params.template modify(); return cutone; } - namespace LAMMPS_NS { template class PairLJClass2CoulLongKokkos; #ifdef LMP_KOKKOS_GPU diff --git a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h index 392f3e217d..6ffe8cd6ff 100644 --- a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/coul/long/kk,PairLJClass2CoulLongKokkos) -PairStyle(lj/class2/coul/long/kk/device,PairLJClass2CoulLongKokkos) -PairStyle(lj/class2/coul/long/kk/host,PairLJClass2CoulLongKokkos) - +// clang-format off +PairStyle(lj/class2/coul/long/kk,PairLJClass2CoulLongKokkos); +PairStyle(lj/class2/coul/long/kk/device,PairLJClass2CoulLongKokkos); +PairStyle(lj/class2/coul/long/kk/host,PairLJClass2CoulLongKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_COUL_LONG_KOKKOS_H @@ -46,8 +47,6 @@ class PairLJClass2CoulLongKokkos : public PairLJClass2CoulLong { double init_one(int, int); protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, @@ -94,7 +93,6 @@ class PairLJClass2CoulLongKokkos : public PairLJClass2CoulLong { typename AT::t_ffloat_2d d_cutsq; typename AT::tdual_ffloat_2d k_cut_ljsq; typename AT::t_ffloat_2d d_cut_ljsq; - typename AT::tdual_ffloat_2d k_cut_coulsq; typename AT::t_ffloat_2d d_cut_coulsq; typename AT::t_ffloat_1d_randomread diff --git a/src/KOKKOS/pair_lj_class2_kokkos.cpp b/src/KOKKOS/pair_lj_class2_kokkos.cpp index cef3c1f8d8..c1a16a0078 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -47,7 +48,6 @@ PairLJClass2Kokkos::PairLJClass2Kokkos(LAMMPS *lmp) : PairLJClass2(l execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -55,26 +55,17 @@ PairLJClass2Kokkos::PairLJClass2Kokkos(LAMMPS *lmp) : PairLJClass2(l template PairLJClass2Kokkos::~PairLJClass2Kokkos() { + if (copymode) return; + if (allocated) { - k_cutsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - cutsq = nullptr; + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_cutsq,cutsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJClass2Kokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - eatom = nullptr; - vatom = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJClass2Kokkos::compute(int eflag_in, int vflag_in) { diff --git a/src/KOKKOS/pair_lj_class2_kokkos.h b/src/KOKKOS/pair_lj_class2_kokkos.h index 1931b196f3..e6b1fa9d37 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/kk,PairLJClass2Kokkos) -PairStyle(lj/class2/kk/device,PairLJClass2Kokkos) -PairStyle(lj/class2/kk/host,PairLJClass2Kokkos) - +// clang-format off +PairStyle(lj/class2/kk,PairLJClass2Kokkos); +PairStyle(lj/class2/kk/device,PairLJClass2Kokkos); +PairStyle(lj/class2/kk/host,PairLJClass2Kokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_KOKKOS_H @@ -53,8 +54,6 @@ class PairLJClass2Kokkos : public PairLJClass2 { }; protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const; diff --git a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp index 636a72b5e1..9a2a5ce673 100644 --- a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -43,10 +44,6 @@ PairLJCutCoulCutKokkos::PairLJCutCoulCutKokkos(LAMMPS *lmp):PairLJCu execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_ljsq = nullptr; - cut_coulsq = nullptr; - } /* ---------------------------------------------------------------------- */ @@ -54,28 +51,19 @@ PairLJCutCoulCutKokkos::PairLJCutCoulCutKokkos(LAMMPS *lmp):PairLJCu template PairLJCutCoulCutKokkos::~PairLJCutCoulCutKokkos() { + if (copymode) return; + if (allocated) { - memoryKK->destroy_kokkos(k_cutsq, cutsq); - memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); - memoryKK->destroy_kokkos(k_cut_coulsq, cut_coulsq); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_cutsq,cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq,cut_ljsq); + memoryKK->destroy_kokkos(k_cut_coulsq,cut_coulsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJCutCoulCutKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - cut_ljsq = nullptr; - cut_coulsq = nullptr; - eatom = nullptr; - vatom = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJCutCoulCutKokkos::compute(int eflag_in, int vflag_in) { diff --git a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h index 644d3f164e..bc4a9ffeeb 100644 --- a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/cut/kk,PairLJCutCoulCutKokkos) -PairStyle(lj/cut/coul/cut/kk/device,PairLJCutCoulCutKokkos) -PairStyle(lj/cut/coul/cut/kk/host,PairLJCutCoulCutKokkos) - +// clang-format off +PairStyle(lj/cut/coul/cut/kk,PairLJCutCoulCutKokkos); +PairStyle(lj/cut/coul/cut/kk/device,PairLJCutCoulCutKokkos); +PairStyle(lj/cut/coul/cut/kk/host,PairLJCutCoulCutKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_CUT_KOKKOS_H @@ -45,8 +46,6 @@ class PairLJCutCoulCutKokkos : public PairLJCutCoulCut { double init_one(int, int); protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp index 8b4e189442..9673796205 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -47,10 +48,6 @@ PairLJCutCoulDebyeKokkos::PairLJCutCoulDebyeKokkos(LAMMPS *lmp):Pair execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_ljsq = nullptr; - cut_coulsq = nullptr; - } /* ---------------------------------------------------------------------- */ @@ -58,28 +55,19 @@ PairLJCutCoulDebyeKokkos::PairLJCutCoulDebyeKokkos(LAMMPS *lmp):Pair template PairLJCutCoulDebyeKokkos::~PairLJCutCoulDebyeKokkos() { - if (!copymode) { - memoryKK->destroy_kokkos(k_cutsq, cutsq); - memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); - memoryKK->destroy_kokkos(k_cut_coulsq, cut_coulsq); + if (copymode) return; + + if (allocated) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_cutsq,cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq,cut_ljsq); + memoryKK->destroy_kokkos(k_cut_coulsq,cut_coulsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJCutCoulDebyeKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - cut_ljsq = nullptr; - cut_coulsq = nullptr; - eatom = nullptr; - vatom = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJCutCoulDebyeKokkos::compute(int eflag_in, int vflag_in) { diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h index 1e367a6232..b0e25f606b 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/debye/kk,PairLJCutCoulDebyeKokkos) -PairStyle(lj/cut/coul/debye/kk/device,PairLJCutCoulDebyeKokkos) -PairStyle(lj/cut/coul/debye/kk/host,PairLJCutCoulDebyeKokkos) - +// clang-format off +PairStyle(lj/cut/coul/debye/kk,PairLJCutCoulDebyeKokkos); +PairStyle(lj/cut/coul/debye/kk/device,PairLJCutCoulDebyeKokkos); +PairStyle(lj/cut/coul/debye/kk/host,PairLJCutCoulDebyeKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_DEBYE_KOKKOS_H @@ -45,8 +46,6 @@ class PairLJCutCoulDebyeKokkos : public PairLJCutCoulDebye { double init_one(int, int); protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, diff --git a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp index cbeb0ab70a..8f25ee45dc 100644 --- a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -57,10 +58,6 @@ PairLJCutCoulDSFKokkos::PairLJCutCoulDSFKokkos(LAMMPS *lmp):PairLJCu execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_ljsq = nullptr; - //cut_coulsq = nullptr; - } /* ---------------------------------------------------------------------- */ @@ -68,28 +65,18 @@ PairLJCutCoulDSFKokkos::PairLJCutCoulDSFKokkos(LAMMPS *lmp):PairLJCu template PairLJCutCoulDSFKokkos::~PairLJCutCoulDSFKokkos() { - if (!copymode) { + if (copymode) return; + + if (allocated) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); memoryKK->destroy_kokkos(k_cutsq, cutsq); memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); - //memoryKK->destroy_kokkos(k_cut_coulsq, cut_coulsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJCutCoulDSFKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - cut_ljsq = nullptr; - //cut_coulsq = nullptr; - eatom = nullptr; - vatom = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJCutCoulDSFKokkos::compute(int eflag_in, int vflag_in) { @@ -116,7 +103,6 @@ void PairLJCutCoulDSFKokkos::compute(int eflag_in, int vflag_in) atomKK->sync(execution_space,datamask_read); k_cutsq.template sync(); k_cut_ljsq.template sync(); - k_cut_coulsq.template sync(); k_params.template sync(); if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); else atomKK->modified(execution_space,F_MASK); @@ -276,15 +262,17 @@ void PairLJCutCoulDSFKokkos::allocate() PairLJCutCoulDSF::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(); + memory->destroy(cut_ljsq); memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); - //memory->destroy(cut_coulsq); - memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); - d_cut_coulsq = k_cut_coulsq.template view(); + + d_cut_coulsq = typename AT::t_ffloat_2d("pair:cut_coulsq",n+1,n+1); + k_params = Kokkos::DualView("PairLJCutCoulDSF::params",n+1,n+1); params = k_params.template view(); } @@ -298,6 +286,8 @@ void PairLJCutCoulDSFKokkos::init_style() { PairLJCutCoulDSF::init_style(); + Kokkos::deep_copy(d_cut_coulsq,cut_coulsq); + // error if rRESPA with inner levels if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { @@ -339,7 +329,6 @@ double PairLJCutCoulDSFKokkos::init_one(int i, int j) { double cutone = PairLJCutCoulDSF::init_one(i,j); double cut_ljsqm = cut_ljsq[i][j]; - double cut_coulsqm = cut_coulsq; k_params.h_view(i,j).lj1 = lj1[i][j]; k_params.h_view(i,j).lj2 = lj2[i][j]; @@ -347,22 +336,20 @@ double PairLJCutCoulDSFKokkos::init_one(int i, int j) k_params.h_view(i,j).lj4 = lj4[i][j]; k_params.h_view(i,j).offset = offset[i][j]; k_params.h_view(i,j).cut_ljsq = cut_ljsqm; - k_params.h_view(i,j).cut_coulsq = cut_coulsqm; + k_params.h_view(i,j).cut_coulsq = cut_coulsq; k_params.h_view(j,i) = k_params.h_view(i,j); if (i(); k_cut_ljsq.h_view(i,j) = k_cut_ljsq.h_view(j,i) = cut_ljsqm; k_cut_ljsq.template modify(); - k_cut_coulsq.h_view(i,j) = k_cut_coulsq.h_view(j,i) = cut_coulsqm; - k_cut_coulsq.template modify(); k_params.template modify(); return cutone; diff --git a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h index 222d873dba..bf013d4837 100644 --- a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/dsf/kk,PairLJCutCoulDSFKokkos) -PairStyle(lj/cut/coul/dsf/kk/device,PairLJCutCoulDSFKokkos) -PairStyle(lj/cut/coul/dsf/kk/host,PairLJCutCoulDSFKokkos) - +// clang-format off +PairStyle(lj/cut/coul/dsf/kk,PairLJCutCoulDSFKokkos); +PairStyle(lj/cut/coul/dsf/kk/device,PairLJCutCoulDSFKokkos); +PairStyle(lj/cut/coul/dsf/kk/host,PairLJCutCoulDSFKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_DSF_KOKKOS_H @@ -44,8 +45,6 @@ class PairLJCutCoulDSFKokkos : public PairLJCutCoulDSF { double init_one(int, int); protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, @@ -92,10 +91,8 @@ class PairLJCutCoulDSFKokkos : public PairLJCutCoulDSF { typename AT::t_ffloat_2d d_cutsq; typename AT::tdual_ffloat_2d k_cut_ljsq; typename AT::t_ffloat_2d d_cut_ljsq; - typename AT::tdual_ffloat_2d k_cut_coulsq; typename AT::t_ffloat_2d d_cut_coulsq; - int neighflag; int nlocal,nall,eflag,vflag; diff --git a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp index 244acc644a..2d4833843c 100644 --- a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -54,10 +55,6 @@ PairLJCutCoulLongKokkos::PairLJCutCoulLongKokkos(LAMMPS *lmp):PairLJ execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_ljsq = nullptr; - cut_coulsq = 0.0; - } /* ---------------------------------------------------------------------- */ @@ -65,31 +62,18 @@ PairLJCutCoulLongKokkos::PairLJCutCoulLongKokkos(LAMMPS *lmp):PairLJ template PairLJCutCoulLongKokkos::~PairLJCutCoulLongKokkos() { - memoryKK->destroy_kokkos(k_eatom,eatom); - memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = nullptr; - vatom = nullptr; + if (copymode) return; + if (allocated) { - memoryKK->destroy_kokkos(k_cutsq, cutsq); - memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_cutsq,cutsq); + memoryKK->destroy_kokkos(k_cut_ljsq,cut_ljsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJCutCoulLongKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - cut_ljsq = nullptr; - eatom = nullptr; - vatom = nullptr; - ftable = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJCutCoulLongKokkos::compute(int eflag_in, int vflag_in) { @@ -117,7 +101,6 @@ void PairLJCutCoulLongKokkos::compute(int eflag_in, int vflag_in) atomKK->sync(execution_space,datamask_read); k_cutsq.template sync(); k_cut_ljsq.template sync(); - k_cut_coulsq.template sync(); k_params.template sync(); if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); else atomKK->modified(execution_space,F_MASK); @@ -303,12 +286,13 @@ void PairLJCutCoulLongKokkos::allocate() memory->destroy(cutsq); memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); + memory->destroy(cut_ljsq); memoryKK->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq"); d_cut_ljsq = k_cut_ljsq.template view(); - memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); - d_cut_coulsq = k_cut_coulsq.template view(); + d_cut_coulsq = typename AT::t_ffloat_2d("pair:cut_coulsq",n+1,n+1); + k_params = Kokkos::DualView("PairLJCutCoulLong::params",n+1,n+1); params = k_params.template view(); } @@ -438,6 +422,8 @@ void PairLJCutCoulLongKokkos::init_style() { PairLJCutCoulLong::init_style(); + Kokkos::deep_copy(d_cut_coulsq,cut_coulsq); + // error if rRESPA with inner levels if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { @@ -479,7 +465,6 @@ double PairLJCutCoulLongKokkos::init_one(int i, int j) { double cutone = PairLJCutCoulLong::init_one(i,j); double cut_ljsqm = cut_ljsq[i][j]; - double cut_coulsqm = cut_coulsq; k_params.h_view(i,j).lj1 = lj1[i][j]; k_params.h_view(i,j).lj2 = lj2[i][j]; @@ -487,29 +472,25 @@ double PairLJCutCoulLongKokkos::init_one(int i, int j) k_params.h_view(i,j).lj4 = lj4[i][j]; k_params.h_view(i,j).offset = offset[i][j]; k_params.h_view(i,j).cut_ljsq = cut_ljsqm; - k_params.h_view(i,j).cut_coulsq = cut_coulsqm; + k_params.h_view(i,j).cut_coulsq = cut_coulsq; k_params.h_view(j,i) = k_params.h_view(i,j); if (i(); k_cut_ljsq.h_view(i,j) = k_cut_ljsq.h_view(j,i) = cut_ljsqm; k_cut_ljsq.template modify(); - k_cut_coulsq.h_view(i,j) = k_cut_coulsq.h_view(j,i) = cut_coulsqm; - k_cut_coulsq.template modify(); k_params.template modify(); return cutone; } - - namespace LAMMPS_NS { template class PairLJCutCoulLongKokkos; #ifdef LMP_KOKKOS_GPU diff --git a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h index 6d04277851..3b3067dd0e 100644 --- a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/long/kk,PairLJCutCoulLongKokkos) -PairStyle(lj/cut/coul/long/kk/device,PairLJCutCoulLongKokkos) -PairStyle(lj/cut/coul/long/kk/host,PairLJCutCoulLongKokkos) - +// clang-format off +PairStyle(lj/cut/coul/long/kk,PairLJCutCoulLongKokkos); +PairStyle(lj/cut/coul/long/kk/device,PairLJCutCoulLongKokkos); +PairStyle(lj/cut/coul/long/kk/host,PairLJCutCoulLongKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_LONG_KOKKOS_H @@ -46,8 +47,6 @@ class PairLJCutCoulLongKokkos : public PairLJCutCoulLong { double init_one(int, int); protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, @@ -94,7 +93,6 @@ class PairLJCutCoulLongKokkos : public PairLJCutCoulLong { typename AT::t_ffloat_2d d_cutsq; typename AT::tdual_ffloat_2d k_cut_ljsq; typename AT::t_ffloat_2d d_cut_ljsq; - typename AT::tdual_ffloat_2d k_cut_coulsq; typename AT::t_ffloat_2d d_cut_coulsq; typename AT::t_ffloat_1d_randomread diff --git a/src/KOKKOS/pair_lj_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_kokkos.cpp index bffb921490..5a5edcab76 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -42,7 +43,6 @@ PairLJCutKokkos::PairLJCutKokkos(LAMMPS *lmp) : PairLJCut(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -50,30 +50,17 @@ PairLJCutKokkos::PairLJCutKokkos(LAMMPS *lmp) : PairLJCut(lmp) template PairLJCutKokkos::~PairLJCutKokkos() { + if (copymode) return; + if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - k_cutsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; + memoryKK->destroy_kokkos(k_cutsq,cutsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJCutKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - eatom = nullptr; - vatom = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJCutKokkos::compute(int eflag_in, int vflag_in) { @@ -119,6 +106,8 @@ void PairLJCutKokkos::compute(int eflag_in, int vflag_in) // loop over neighbors of my atoms + copymode = 1; + EV_FLOAT ev = pair_compute,void >(this,(NeighListKokkos*)list); if (eflag_global) eng_vdwl += ev.evdwl; diff --git a/src/KOKKOS/pair_lj_cut_kokkos.h b/src/KOKKOS/pair_lj_cut_kokkos.h index d513bbff6c..5722145815 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/kk,PairLJCutKokkos) -PairStyle(lj/cut/kk/device,PairLJCutKokkos) -PairStyle(lj/cut/kk/host,PairLJCutKokkos) - +// clang-format off +PairStyle(lj/cut/kk,PairLJCutKokkos); +PairStyle(lj/cut/kk/device,PairLJCutKokkos); +PairStyle(lj/cut/kk/host,PairLJCutKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_KOKKOS_H @@ -53,8 +54,6 @@ class PairLJCutKokkos : public PairLJCut { }; protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const; diff --git a/src/KOKKOS/pair_lj_expand_kokkos.cpp b/src/KOKKOS/pair_lj_expand_kokkos.cpp index d351f2d5fc..14342357ec 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.cpp +++ b/src/KOKKOS/pair_lj_expand_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -47,7 +48,6 @@ PairLJExpandKokkos::PairLJExpandKokkos(LAMMPS *lmp) : PairLJExpand(l execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -55,26 +55,17 @@ PairLJExpandKokkos::PairLJExpandKokkos(LAMMPS *lmp) : PairLJExpand(l template PairLJExpandKokkos::~PairLJExpandKokkos() { - if (!copymode) { - k_cutsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - cutsq = nullptr; + if (copymode) return; + + if (allocated) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_cutsq,cutsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJExpandKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - eatom = nullptr; - vatom = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJExpandKokkos::compute(int eflag_in, int vflag_in) { diff --git a/src/KOKKOS/pair_lj_expand_kokkos.h b/src/KOKKOS/pair_lj_expand_kokkos.h index 174711fefc..8fe9bd7aa2 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.h +++ b/src/KOKKOS/pair_lj_expand_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/expand/kk,PairLJExpandKokkos) -PairStyle(lj/expand/kk/device,PairLJExpandKokkos) -PairStyle(lj/expand/kk/host,PairLJExpandKokkos) - +// clang-format off +PairStyle(lj/expand/kk,PairLJExpandKokkos); +PairStyle(lj/expand/kk/device,PairLJExpandKokkos); +PairStyle(lj/expand/kk/host,PairLJExpandKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_EXPAND_KOKKOS_H @@ -53,8 +54,6 @@ class PairLJExpandKokkos : public PairLJExpand { }; protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const; diff --git a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp index fa4a3ca06d..069b4068e8 100644 --- a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -47,10 +48,6 @@ PairLJGromacsCoulGromacsKokkos::PairLJGromacsCoulGromacsKokkos(LAMMP execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_ljsq = 0.0; - cut_coulsq = 0.0; - } /* ---------------------------------------------------------------------- */ @@ -58,38 +55,17 @@ PairLJGromacsCoulGromacsKokkos::PairLJGromacsCoulGromacsKokkos(LAMMP template PairLJGromacsCoulGromacsKokkos::~PairLJGromacsCoulGromacsKokkos() { - if (!copymode) { + if (copymode) return; + + if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - k_cutsq = DAT::tdual_ffloat_2d(); - k_cut_ljsq = DAT::tdual_ffloat_2d(); - k_cut_coulsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - //memory->sfree(cut_ljsq); - //memory->sfree(cut_coulsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; - cut_ljsq = 0.0; - cut_coulsq = 0.0; + memoryKK->destroy_kokkos(k_cutsq,cutsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJGromacsCoulGromacsKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - cut_ljsq = 0.0; - eatom = nullptr; - vatom = nullptr; - ftable = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJGromacsCoulGromacsKokkos::compute(int eflag_in, int vflag_in) { @@ -115,8 +91,6 @@ void PairLJGromacsCoulGromacsKokkos::compute(int eflag_in, int vflag atomKK->sync(execution_space,datamask_read); k_cutsq.template sync(); - k_cut_ljsq.template sync(); - k_cut_coulsq.template sync(); k_params.template sync(); if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); else atomKK->modified(execution_space,F_MASK); @@ -298,12 +272,9 @@ void PairLJGromacsCoulGromacsKokkos::allocate() memoryKK->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq"); d_cutsq = k_cutsq.template view(); - //memory->destroy(cut_ljsq); - memoryKK->create_kokkos(k_cut_ljsq,n+1,n+1,"pair:cut_ljsq"); - d_cut_ljsq = k_cut_ljsq.template view(); + d_cut_ljsq = typename AT::t_ffloat_2d("pair:cut_ljsq",n+1,n+1); - memoryKK->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq"); - d_cut_coulsq = k_cut_coulsq.template view(); + d_cut_coulsq = typename AT::t_ffloat_2d("pair:cut_coulsq",n+1,n+1); k_params = Kokkos::DualView("PairLJGromacsCoulGromacs::params",n+1,n+1); params = k_params.template view(); @@ -434,6 +405,9 @@ void PairLJGromacsCoulGromacsKokkos::init_style() { PairLJGromacsCoulGromacs::init_style(); + Kokkos::deep_copy(d_cut_ljsq,cut_ljsq); + Kokkos::deep_copy(d_cut_coulsq,cut_coulsq); + // error if rRESPA with inner levels if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { @@ -499,10 +473,6 @@ double PairLJGromacsCoulGromacsKokkos::init_one(int i, int j) k_cutsq.h_view(i,j) = k_cutsq.h_view(j,i) = cutone*cutone; k_cutsq.template modify(); - k_cut_ljsq.h_view(i,j) = k_cut_ljsq.h_view(j,i) = cut_ljsqm; - k_cut_ljsq.template modify(); - k_cut_coulsq.h_view(i,j) = k_cut_coulsq.h_view(j,i) = cut_coulsqm; - k_cut_coulsq.template modify(); k_params.template modify(); return cutone; diff --git a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h index 8e29c00bfa..13357e2e5c 100644 --- a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h +++ b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/gromacs/coul/gromacs/kk,PairLJGromacsCoulGromacsKokkos) -PairStyle(lj/gromacs/coul/gromacs/kk/device,PairLJGromacsCoulGromacsKokkos) -PairStyle(lj/gromacs/coul/gromacs/kk/host,PairLJGromacsCoulGromacsKokkos) - +// clang-format off +PairStyle(lj/gromacs/coul/gromacs/kk,PairLJGromacsCoulGromacsKokkos); +PairStyle(lj/gromacs/coul/gromacs/kk/device,PairLJGromacsCoulGromacsKokkos); +PairStyle(lj/gromacs/coul/gromacs/kk/host,PairLJGromacsCoulGromacsKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_GROMACS_COUL_GROMACS_KOKKOS_H @@ -54,8 +55,6 @@ class PairLJGromacsCoulGromacsKokkos : public PairLJGromacsCoulGromacs { }; protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, @@ -100,9 +99,7 @@ class PairLJGromacsCoulGromacsKokkos : public PairLJGromacsCoulGromacs { typename AT::tdual_ffloat_2d k_cutsq; typename AT::t_ffloat_2d d_cutsq; - typename AT::tdual_ffloat_2d k_cut_ljsq; typename AT::t_ffloat_2d d_cut_ljsq; - typename AT::tdual_ffloat_2d k_cut_coulsq; typename AT::t_ffloat_2d d_cut_coulsq; typename AT::t_ffloat_1d_randomread diff --git a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp index 58fe845b71..0764a35fac 100644 --- a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -47,10 +48,6 @@ PairLJGromacsKokkos::PairLJGromacsKokkos(LAMMPS *lmp):PairLJGromacs( execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; - cut_inner = nullptr; - cut_inner_sq = nullptr; - } /* ---------------------------------------------------------------------- */ @@ -58,35 +55,17 @@ PairLJGromacsKokkos::PairLJGromacsKokkos(LAMMPS *lmp):PairLJGromacs( template PairLJGromacsKokkos::~PairLJGromacsKokkos() { - if (!copymode) { + if (copymode) return; + + if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - k_cutsq = DAT::tdual_ffloat_2d(); - k_cut_inner_sq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; - cut_inner = nullptr; - cut_inner_sq = nullptr; + memoryKK->destroy_kokkos(k_cutsq,cutsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJGromacsKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - cut_inner = nullptr; - cut_inner_sq = nullptr; - eatom = nullptr; - vatom = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJGromacsKokkos::compute(int eflag_in, int vflag_in) { diff --git a/src/KOKKOS/pair_lj_gromacs_kokkos.h b/src/KOKKOS/pair_lj_gromacs_kokkos.h index 89a635df8a..de0c9ec890 100644 --- a/src/KOKKOS/pair_lj_gromacs_kokkos.h +++ b/src/KOKKOS/pair_lj_gromacs_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/gromacs/kk,PairLJGromacsKokkos) -PairStyle(lj/gromacs/kk/device,PairLJGromacsKokkos) -PairStyle(lj/gromacs/kk/host,PairLJGromacsKokkos) - +// clang-format off +PairStyle(lj/gromacs/kk,PairLJGromacsKokkos); +PairStyle(lj/gromacs/kk/device,PairLJGromacsKokkos); +PairStyle(lj/gromacs/kk/host,PairLJGromacsKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_GROMACS_KOKKOS_H @@ -53,8 +54,6 @@ class PairLJGromacsKokkos : public PairLJGromacs { }; protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.cpp b/src/KOKKOS/pair_lj_sdk_kokkos.cpp index f8f1fa87cc..79452765c5 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.cpp +++ b/src/KOKKOS/pair_lj_sdk_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -47,7 +48,6 @@ PairLJSDKKokkos::PairLJSDKKokkos(LAMMPS *lmp) : PairLJSDK(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -55,26 +55,17 @@ PairLJSDKKokkos::PairLJSDKKokkos(LAMMPS *lmp) : PairLJSDK(lmp) template PairLJSDKKokkos::~PairLJSDKKokkos() { + if (copymode) return; + if (allocated) { - k_cutsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - cutsq = nullptr; + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memoryKK->destroy_kokkos(k_cutsq,cutsq); } } /* ---------------------------------------------------------------------- */ -template -void PairLJSDKKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - eatom = nullptr; - vatom = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairLJSDKKokkos::compute(int eflag_in, int vflag_in) { diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.h b/src/KOKKOS/pair_lj_sdk_kokkos.h index 7fe8ff18a3..1855715155 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.h +++ b/src/KOKKOS/pair_lj_sdk_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/sdk/kk,PairLJSDKKokkos) -PairStyle(lj/sdk/kk/device,PairLJSDKKokkos) -PairStyle(lj/sdk/kk/host,PairLJSDKKokkos) - +// clang-format off +PairStyle(lj/sdk/kk,PairLJSDKKokkos); +PairStyle(lj/sdk/kk/device,PairLJSDKKokkos); +PairStyle(lj/sdk/kk/host,PairLJSDKKokkos); +// clang-format on #else #ifndef LMP_PAIR_LJ_SDK_KOKKOS_H @@ -54,8 +55,6 @@ class PairLJSDKKokkos : public PairLJSDK { }; protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const; diff --git a/src/KOKKOS/pair_morse_kokkos.cpp b/src/KOKKOS/pair_morse_kokkos.cpp index 74c2934510..d6663608fb 100644 --- a/src/KOKKOS/pair_morse_kokkos.cpp +++ b/src/KOKKOS/pair_morse_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -49,7 +50,6 @@ PairMorseKokkos::PairMorseKokkos(LAMMPS *lmp) : PairMorse(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -57,30 +57,17 @@ PairMorseKokkos::PairMorseKokkos(LAMMPS *lmp) : PairMorse(lmp) template PairMorseKokkos::~PairMorseKokkos() { + if (copymode) return; + if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - k_cutsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; + memoryKK->destroy_kokkos(k_cutsq,cutsq); } } /* ---------------------------------------------------------------------- */ -template -void PairMorseKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - eatom = nullptr; - vatom = nullptr; -} - -/* ---------------------------------------------------------------------- */ - template void PairMorseKokkos::compute(int eflag_in, int vflag_in) { diff --git a/src/KOKKOS/pair_morse_kokkos.h b/src/KOKKOS/pair_morse_kokkos.h index e0205554ed..4a29289a30 100644 --- a/src/KOKKOS/pair_morse_kokkos.h +++ b/src/KOKKOS/pair_morse_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(morse/kk,PairMorseKokkos) -PairStyle(morse/kk/device,PairMorseKokkos) -PairStyle(morse/kk/host,PairMorseKokkos) - +// clang-format off +PairStyle(morse/kk,PairMorseKokkos); +PairStyle(morse/kk/device,PairMorseKokkos); +PairStyle(morse/kk/host,PairMorseKokkos); +// clang-format on #else #ifndef LMP_PAIR_MORSE_KOKKOS_H @@ -52,8 +53,6 @@ class PairMorseKokkos : public PairMorse { }; protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const; diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp index cfc55c2c52..1107d39fe9 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.h b/src/KOKKOS/pair_multi_lucy_rx_kokkos.h index a112a79ff9..3e2d898b76 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.h +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(multi/lucy/rx/kk,PairMultiLucyRXKokkos) -PairStyle(multi/lucy/rx/kk/device,PairMultiLucyRXKokkos) -PairStyle(multi/lucy/rx/kk/host,PairMultiLucyRXKokkos) - +// clang-format off +PairStyle(multi/lucy/rx/kk,PairMultiLucyRXKokkos); +PairStyle(multi/lucy/rx/kk/device,PairMultiLucyRXKokkos); +PairStyle(multi/lucy/rx/kk/host,PairMultiLucyRXKokkos); +// clang-format on #else #ifndef LMP_PAIR_MULTI_LUCY_RX_KOKKOS_H diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index 75a1448b33..de707fba3b 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_reaxc_kokkos.h b/src/KOKKOS/pair_reaxc_kokkos.h index 5f4ae68c42..7caa270a80 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.h +++ b/src/KOKKOS/pair_reaxc_kokkos.h @@ -1,7 +1,8 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,11 +14,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(reax/c/kk,PairReaxCKokkos) -PairStyle(reax/c/kk/device,PairReaxCKokkos) -PairStyle(reax/c/kk/host,PairReaxCKokkos) - +// clang-format off +PairStyle(reax/c/kk,PairReaxCKokkos); +PairStyle(reax/c/kk/device,PairReaxCKokkos); +PairStyle(reax/c/kk/host,PairReaxCKokkos); +// clang-format on #else #ifndef LMP_PAIR_REAXC_KOKKOS_H @@ -331,7 +332,6 @@ class PairReaxCKokkos : public PairReaxC { F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *dril, F_FLOAT *drjl, F_FLOAT *drkl) const; protected: - void cleanup_copy(); void allocate(); void allocate_array(); void setup(); diff --git a/src/KOKKOS/pair_snap_kokkos.cpp b/src/KOKKOS/pair_snap_kokkos.cpp index 4677d178e0..954a086412 100644 --- a/src/KOKKOS/pair_snap_kokkos.cpp +++ b/src/KOKKOS/pair_snap_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_snap_kokkos.h b/src/KOKKOS/pair_snap_kokkos.h index b0ed7d4703..5cc3c5db17 100644 --- a/src/KOKKOS/pair_snap_kokkos.h +++ b/src/KOKKOS/pair_snap_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,15 +13,15 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(snap/kk,PairSNAPKokkosDevice) -PairStyle(snap/kk/device,PairSNAPKokkosDevice) +// clang-format off +PairStyle(snap/kk,PairSNAPKokkosDevice); +PairStyle(snap/kk/device,PairSNAPKokkosDevice); #ifdef LMP_KOKKOS_GPU -PairStyle(snap/kk/host,PairSNAPKokkosHost) +PairStyle(snap/kk/host,PairSNAPKokkosHost); #else -PairStyle(snap/kk/host,PairSNAPKokkosDevice) +PairStyle(snap/kk/host,PairSNAPKokkosDevice); #endif - +// clang-format on #else #ifndef LMP_PAIR_SNAP_KOKKOS_H diff --git a/src/KOKKOS/pair_snap_kokkos_impl.h b/src/KOKKOS/pair_snap_kokkos_impl.h index 379140288f..34dffacca8 100644 --- a/src/KOKKOS/pair_snap_kokkos_impl.h +++ b/src/KOKKOS/pair_snap_kokkos_impl.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_sw_kokkos.cpp b/src/KOKKOS/pair_sw_kokkos.cpp index 2fb90b7aec..59949551f6 100644 --- a/src/KOKKOS/pair_sw_kokkos.cpp +++ b/src/KOKKOS/pair_sw_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_sw_kokkos.h b/src/KOKKOS/pair_sw_kokkos.h index 755c2ce0e4..eeda79415b 100644 --- a/src/KOKKOS/pair_sw_kokkos.h +++ b/src/KOKKOS/pair_sw_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(sw/kk,PairSWKokkos) -PairStyle(sw/kk/device,PairSWKokkos) -PairStyle(sw/kk/host,PairSWKokkos) - +// clang-format off +PairStyle(sw/kk,PairSWKokkos); +PairStyle(sw/kk/device,PairSWKokkos); +PairStyle(sw/kk/host,PairSWKokkos); +// clang-format on #else #ifndef LMP_PAIR_SW_KOKKOS_H diff --git a/src/KOKKOS/pair_table_kokkos.cpp b/src/KOKKOS/pair_table_kokkos.cpp index e0dc8e0d25..158af4ed70 100644 --- a/src/KOKKOS/pair_table_kokkos.cpp +++ b/src/KOKKOS/pair_table_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -50,11 +51,19 @@ template PairTableKokkos::~PairTableKokkos() { if (copymode) return; + + if (allocated) { + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memory->destroy(setflag); + memoryKK->destroy_kokkos(d_table->cutsq,cutsq); + memoryKK->destroy_kokkos(d_table->tabindex,tabindex); + } + delete h_table; h_table = nullptr; delete d_table; d_table = nullptr; - copymode = true; //prevents base class destructor from running } /* ---------------------------------------------------------------------- */ @@ -117,6 +126,8 @@ void PairTableKokkos::compute_style(int eflag_in, int vflag_in) d_cutsq = d_table->cutsq; // loop over neighbors of my atoms + copymode = 1; + EV_FLOAT ev; if (atom->ntypes > MAX_TYPES_STACKPARAMS) { if (neighflag == FULL) { @@ -182,6 +193,7 @@ void PairTableKokkos::compute_style(int eflag_in, int vflag_in) if (vflag_fdotr) pair_virial_fdotr_compute(this); + copymode = 0; } template @@ -519,16 +531,6 @@ void PairTableKokkos::init_style() } } -template -void PairTableKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - eatom = nullptr; - vatom = nullptr; - h_table=nullptr; d_table=nullptr; -} - namespace LAMMPS_NS { template class PairTableKokkos; #ifdef LMP_KOKKOS_GPU diff --git a/src/KOKKOS/pair_table_kokkos.h b/src/KOKKOS/pair_table_kokkos.h index b065d015bb..0075fbdde2 100644 --- a/src/KOKKOS/pair_table_kokkos.h +++ b/src/KOKKOS/pair_table_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(table/kk,PairTableKokkos) -PairStyle(table/kk/device,PairTableKokkos) -PairStyle(table/kk/host,PairTableKokkos) - +// clang-format off +PairStyle(table/kk,PairTableKokkos); +PairStyle(table/kk/device,PairTableKokkos); +PairStyle(table/kk/host,PairTableKokkos); +// clang-format on #else #ifndef LMP_PAIR_TABLE_KOKKOS_H @@ -120,7 +121,6 @@ class PairTableKokkos : public PairTable { int update_table; void create_kokkos_tables(); - void cleanup_copy(); template KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/pair_table_rx_kokkos.cpp b/src/KOKKOS/pair_table_rx_kokkos.cpp index 41b0343443..6cb6f1b96a 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.cpp +++ b/src/KOKKOS/pair_table_rx_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -165,12 +166,12 @@ PairTableRXKokkos::~PairTableRXKokkos() delete [] site1; delete [] site2; - memoryKK->destroy_kokkos(k_eatom,eatom); - memoryKK->destroy_kokkos(k_vatom,vatom); - if (allocated) { - memoryKK->destroy_kokkos(d_table->cutsq, cutsq); - memoryKK->destroy_kokkos(d_table->tabindex, tabindex); + memoryKK->destroy_kokkos(k_eatom,eatom); + memoryKK->destroy_kokkos(k_vatom,vatom); + memory->destroy(setflag); + memoryKK->destroy_kokkos(d_table->cutsq,cutsq); + memoryKK->destroy_kokkos(d_table->tabindex,tabindex); } delete h_table; @@ -654,6 +655,8 @@ void PairTableRXKokkos::compute_style(int eflag_in, int vflag_in) d_cutsq = d_table->cutsq; // loop over neighbors of my atoms + copymode = 1; + const int ntotal = atom->nlocal + atom->nghost; if (ntotal > (int)mixWtSite1.extent(0)) { mixWtSite1old = Kokkos::View("PairTableRXKokkos::mixWtSite1old", ntotal); @@ -793,6 +796,8 @@ void PairTableRXKokkos::compute_style(int eflag_in, int vflag_in) k_vatom.template modify(); k_vatom.template sync(); } + + copymode = 0; } template @@ -1280,16 +1285,6 @@ void PairTableRXKokkos::init_style() } } -template -void PairTableRXKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - eatom = nullptr; - vatom = nullptr; - h_table=nullptr; d_table=nullptr; -} - namespace LAMMPS_NS { template class PairTableRXKokkos; #ifdef LMP_KOKKOS_GPU diff --git a/src/KOKKOS/pair_table_rx_kokkos.h b/src/KOKKOS/pair_table_rx_kokkos.h index d05a7c582b..7d2e40cd81 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.h +++ b/src/KOKKOS/pair_table_rx_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(table/rx/kk,PairTableRXKokkos) -PairStyle(table/rx/kk/device,PairTableRXKokkos) -PairStyle(table/rx/kk/host,PairTableRXKokkos) - +// clang-format off +PairStyle(table/rx/kk,PairTableRXKokkos); +PairStyle(table/rx/kk/device,PairTableRXKokkos); +PairStyle(table/rx/kk/host,PairTableRXKokkos); +// clang-format on #else #ifndef LMP_PAIR_TABLE_RX_KOKKOS_H @@ -90,7 +91,6 @@ class PairTableRXKokkos : public PairTable { int update_table; void create_kokkos_tables(); - void cleanup_copy(); friend void pair_virial_fdotr_compute(PairTableRXKokkos*); diff --git a/src/KOKKOS/pair_tersoff_kokkos.cpp b/src/KOKKOS/pair_tersoff_kokkos.cpp index 72a79c0b49..2aa58f2415 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pair_tersoff_kokkos.h b/src/KOKKOS/pair_tersoff_kokkos.h index 5f5d537ae7..8e9f6eb88a 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.h +++ b/src/KOKKOS/pair_tersoff_kokkos.h @@ -1,7 +1,8 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,11 +14,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/kk,PairTersoffKokkos) -PairStyle(tersoff/kk/device,PairTersoffKokkos) -PairStyle(tersoff/kk/host,PairTersoffKokkos) - +// clang-format off +PairStyle(tersoff/kk,PairTersoffKokkos); +PairStyle(tersoff/kk/device,PairTersoffKokkos); +PairStyle(tersoff/kk/host,PairTersoffKokkos); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_KOKKOS_H @@ -181,8 +182,6 @@ class PairTersoffKokkos : public PairTersoff { void setup_params(); protected: - void cleanup_copy(); - typedef Kokkos::DualView tdual_int_3d; Kokkos::DualView k_params; typename Kokkos::DualView) -PairStyle(tersoff/mod/kk/device,PairTersoffMODKokkos) -PairStyle(tersoff/mod/kk/host,PairTersoffMODKokkos) - +// clang-format off +PairStyle(tersoff/mod/kk,PairTersoffMODKokkos); +PairStyle(tersoff/mod/kk/device,PairTersoffMODKokkos); +PairStyle(tersoff/mod/kk/host,PairTersoffMODKokkos); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_MOD_KOKKOS_H @@ -181,8 +182,6 @@ class PairTersoffMODKokkos : public PairTersoffMOD { void setup_params(); protected: - void cleanup_copy(); - typedef Kokkos::DualView tdual_int_3d; Kokkos::DualView k_params; typename Kokkos::DualView) -PairStyle(tersoff/zbl/kk/device,PairTersoffZBLKokkos) -PairStyle(tersoff/zbl/kk/host,PairTersoffZBLKokkos) - +// clang-format off +PairStyle(tersoff/zbl/kk,PairTersoffZBLKokkos); +PairStyle(tersoff/zbl/kk/device,PairTersoffZBLKokkos); +PairStyle(tersoff/zbl/kk/host,PairTersoffZBLKokkos); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_ZBL_KOKKOS_H @@ -186,8 +187,6 @@ class PairTersoffZBLKokkos : public PairTersoffZBL { double fermi_d_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const; protected: - void cleanup_copy(); - typedef Kokkos::DualView tdual_int_3d; Kokkos::DualView k_params; typename Kokkos::DualView) -PairStyle(vashishta/kk/device,PairVashishtaKokkos) -PairStyle(vashishta/kk/host,PairVashishtaKokkos) - +// clang-format off +PairStyle(vashishta/kk,PairVashishtaKokkos); +PairStyle(vashishta/kk/device,PairVashishtaKokkos); +PairStyle(vashishta/kk/host,PairVashishtaKokkos); +// clang-format on #else #ifndef LMP_PAIR_VASHISHTA_KOKKOS_H diff --git a/src/KOKKOS/pair_yukawa_kokkos.cpp b/src/KOKKOS/pair_yukawa_kokkos.cpp index 123b0a2d84..9654185b73 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.cpp +++ b/src/KOKKOS/pair_yukawa_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -46,7 +47,6 @@ PairYukawaKokkos::PairYukawaKokkos(LAMMPS *lmp) : PairYukawa(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,28 +54,15 @@ PairYukawaKokkos::PairYukawaKokkos(LAMMPS *lmp) : PairYukawa(lmp) template PairYukawaKokkos::~PairYukawaKokkos() { + if (copymode) return; + if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - k_cutsq = DAT::tdual_ffloat_2d(); - memory->sfree(cutsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; + memoryKK->destroy_kokkos(k_cutsq,cutsq); } } -/* ---------------------------------------------------------------------- */ - -template -void PairYukawaKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - eatom = nullptr; - vatom = nullptr; -} - /* ---------------------------------------------------------------------- allocate all arrays ------------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_yukawa_kokkos.h b/src/KOKKOS/pair_yukawa_kokkos.h index 11143248e1..cd478e30ed 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.h +++ b/src/KOKKOS/pair_yukawa_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(yukawa/kk,PairYukawaKokkos) -PairStyle(yukawa/kk/device,PairYukawaKokkos) -PairStyle(yukawa/kk/host,PairYukawaKokkos) - +// clang-format off +PairStyle(yukawa/kk,PairYukawaKokkos); +PairStyle(yukawa/kk/device,PairYukawaKokkos); +PairStyle(yukawa/kk/host,PairYukawaKokkos); +// clang-format on #else #ifndef LMP_PAIR_YUKAWA_KOKKOS_H @@ -53,8 +54,6 @@ class PairYukawaKokkos : public PairYukawa { protected: - void cleanup_copy(); - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, diff --git a/src/KOKKOS/pair_zbl_kokkos.cpp b/src/KOKKOS/pair_zbl_kokkos.cpp index 954c2edf26..87a0f5d353 100644 --- a/src/KOKKOS/pair_zbl_kokkos.cpp +++ b/src/KOKKOS/pair_zbl_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -62,10 +63,6 @@ PairZBLKokkos::~PairZBLKokkos() if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - memory->sfree(cutsq); - eatom = nullptr; - vatom = nullptr; - cutsq = nullptr; } } @@ -79,6 +76,8 @@ void PairZBLKokkos::init_style() { PairZBL::init_style(); + Kokkos::deep_copy(d_cutsq,cut_globalsq); + // error if rRESPA with inner levels if (update->whichflag == 1 && utils::strmatch(update->integrate_style,"^respa")) { @@ -109,8 +108,6 @@ void PairZBLKokkos::init_style() } else { error->all(FLERR,"Cannot use chosen neighbor list style with lj/cut/kk"); } - - Kokkos::deep_copy(d_cutsq,cut_globalsq); } /* ---------------------------------------------------------------------- */ @@ -412,18 +409,6 @@ F_FLOAT PairZBLKokkos::d2zbldr2(F_FLOAT r, int i, int j) const { return result; } - -/* ---------------------------------------------------------------------- */ - -template -void PairZBLKokkos::cleanup_copy() { - // WHY needed: this prevents parent copy from deallocating any arrays - allocated = 0; - cutsq = nullptr; - eatom = nullptr; - vatom = nullptr; -} - namespace LAMMPS_NS { template class PairZBLKokkos; #ifdef LMP_KOKKOS_GPU diff --git a/src/KOKKOS/pair_zbl_kokkos.h b/src/KOKKOS/pair_zbl_kokkos.h index 6109eceba4..5b1d6e8d7d 100644 --- a/src/KOKKOS/pair_zbl_kokkos.h +++ b/src/KOKKOS/pair_zbl_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(zbl/kk,PairZBLKokkos) -PairStyle(zbl/kk/device,PairZBLKokkos) -PairStyle(zbl/kk/host,PairZBLKokkos) - +// clang-format off +PairStyle(zbl/kk,PairZBLKokkos); +PairStyle(zbl/kk/device,PairZBLKokkos); +PairStyle(zbl/kk/host,PairZBLKokkos); +// clang-format on #else #ifndef LMP_PAIR_ZBL_KOKKOS_H @@ -86,7 +87,6 @@ class PairZBLKokkos : public PairZBL { F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, const int& /*itype*/, const int& /*jtype*/) const { return 0; } - void cleanup_copy(); void allocate(); friend struct PairComputeFunctor; diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index e5bc3fa74b..2385d1977a 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/pppm_kokkos.h b/src/KOKKOS/pppm_kokkos.h index 2369bcc1a0..6b7b7f1f89 100644 --- a/src/KOKKOS/pppm_kokkos.h +++ b/src/KOKKOS/pppm_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/kk,PPPMKokkos) -KSpaceStyle(pppm/kk/device,PPPMKokkos) -KSpaceStyle(pppm/kk/host,PPPMKokkos) - +// clang-format off +KSpaceStyle(pppm/kk,PPPMKokkos); +KSpaceStyle(pppm/kk/device,PPPMKokkos); +KSpaceStyle(pppm/kk/host,PPPMKokkos); +// clang-format on #else #ifndef LMP_PPPM_KOKKOS_H diff --git a/src/KOKKOS/rand_pool_wrap_kokkos.cpp b/src/KOKKOS/rand_pool_wrap_kokkos.cpp index 5229fe5a0f..aead3788ec 100644 --- a/src/KOKKOS/rand_pool_wrap_kokkos.cpp +++ b/src/KOKKOS/rand_pool_wrap_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/rand_pool_wrap_kokkos.h b/src/KOKKOS/rand_pool_wrap_kokkos.h index fd7f773ca6..9a9d681c79 100644 --- a/src/KOKKOS/rand_pool_wrap_kokkos.h +++ b/src/KOKKOS/rand_pool_wrap_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/region_block_kokkos.cpp b/src/KOKKOS/region_block_kokkos.cpp index f32dae3b5e..f38d6f6b95 100644 --- a/src/KOKKOS/region_block_kokkos.cpp +++ b/src/KOKKOS/region_block_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/region_block_kokkos.h b/src/KOKKOS/region_block_kokkos.h index 2d11770470..5067ff789b 100644 --- a/src/KOKKOS/region_block_kokkos.h +++ b/src/KOKKOS/region_block_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef REGION_CLASS - -RegionStyle(block/kk,RegBlockKokkos) -RegionStyle(block/kk/device,RegBlockKokkos) -RegionStyle(block/kk/host,RegBlockKokkos) - +// clang-format off +RegionStyle(block/kk,RegBlockKokkos); +RegionStyle(block/kk/device,RegBlockKokkos); +RegionStyle(block/kk/host,RegBlockKokkos); +// clang-format on #else #ifndef LMP_REGION_BLOCK_KOKKOS_H diff --git a/src/KOKKOS/remap_kokkos.cpp b/src/KOKKOS/remap_kokkos.cpp index a0aaadaddb..f3bd241b41 100644 --- a/src/KOKKOS/remap_kokkos.cpp +++ b/src/KOKKOS/remap_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/remap_kokkos.h b/src/KOKKOS/remap_kokkos.h index c77301503f..316c96e359 100644 --- a/src/KOKKOS/remap_kokkos.h +++ b/src/KOKKOS/remap_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/sna_kokkos.h b/src/KOKKOS/sna_kokkos.h index 72baa32c7c..cb7b1b3cc0 100644 --- a/src/KOKKOS/sna_kokkos.h +++ b/src/KOKKOS/sna_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,6 +24,10 @@ #include #include "kokkos_type.h" +#ifdef __SYCL_DEVICE_ONLY__ +#include +#endif + namespace LAMMPS_NS { template @@ -164,9 +169,21 @@ inline void compute_s_dsfac(const real_type, const real_type, real_type&, real_type&); // compute_cayley_klein static KOKKOS_FORCEINLINE_FUNCTION - void sincos_wrapper(double x, double* sin_, double *cos_) { sincos(x, sin_, cos_); } + void sincos_wrapper(double x, double* sin_, double *cos_) { +#ifdef __SYCL_DEVICE_ONLY__ + *sin_ = sycl::sincos(x, cos_); +#else + sincos(x, sin_, cos_); +#endif + } static KOKKOS_FORCEINLINE_FUNCTION - void sincos_wrapper(float x, float* sin_, float *cos_) { sincosf(x, sin_, cos_); } + void sincos_wrapper(float x, float* sin_, float *cos_) { +#ifdef __SYCL_DEVICE_ONLY__ + *sin_ = sycl::sincos(x, cos_); +#else + sincosf(x, sin_, cos_); +#endif + } #ifdef TIMING_INFO double* timers; diff --git a/src/KOKKOS/sna_kokkos_impl.h b/src/KOKKOS/sna_kokkos_impl.h index db710780ba..142b55158e 100644 --- a/src/KOKKOS/sna_kokkos_impl.h +++ b/src/KOKKOS/sna_kokkos_impl.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -54,6 +55,7 @@ SNAKokkos::SNAKokkos(real_type rfac0_in, ncoeff = compute_ncoeff(); nmax = 0; + natom = 0; build_indexlist(); diff --git a/src/KOKKOS/verlet_kokkos.cpp b/src/KOKKOS/verlet_kokkos.cpp index 254e269671..492eac3e49 100644 --- a/src/KOKKOS/verlet_kokkos.cpp +++ b/src/KOKKOS/verlet_kokkos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KOKKOS/verlet_kokkos.h b/src/KOKKOS/verlet_kokkos.h index ba5ee3464f..36f084bf7f 100644 --- a/src/KOKKOS/verlet_kokkos.h +++ b/src/KOKKOS/verlet_kokkos.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef INTEGRATE_CLASS - -IntegrateStyle(verlet/kk,VerletKokkos) -IntegrateStyle(verlet/kk/device,VerletKokkos) -IntegrateStyle(verlet/kk/host,VerletKokkos) - +// clang-format off +IntegrateStyle(verlet/kk,VerletKokkos); +IntegrateStyle(verlet/kk/device,VerletKokkos); +IntegrateStyle(verlet/kk/host,VerletKokkos); +// clang-format on #else #ifndef LMP_VERLET_KOKKOS_H diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp index 12b3a7d962..fbdd24af1d 100644 --- a/src/KSPACE/ewald.cpp +++ b/src/KSPACE/ewald.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/ewald.h b/src/KSPACE/ewald.h index 81f6eb3237..b429d18729 100644 --- a/src/KSPACE/ewald.h +++ b/src/KSPACE/ewald.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(ewald,Ewald) - +// clang-format off +KSpaceStyle(ewald,Ewald); +// clang-format on #else #ifndef LMP_EWALD_H @@ -37,25 +37,25 @@ class Ewald : public KSpace { void compute_group_group(int, int, int); protected: - int kxmax,kymax,kzmax; - int kcount,kmax,kmax3d,kmax_created; - double gsqmx,volume; + int kxmax, kymax, kzmax; + int kcount, kmax, kmax3d, kmax_created; + double gsqmx, volume; int nmax; double unitk[3]; - int *kxvecs,*kyvecs,*kzvecs; - int kxmax_orig,kymax_orig,kzmax_orig; + int *kxvecs, *kyvecs, *kzvecs; + int kxmax_orig, kymax_orig, kzmax_orig; double *ug; - double **eg,**vg; + double **eg, **vg; double **ek; - double *sfacrl,*sfacim,*sfacrl_all,*sfacim_all; - double ***cs,***sn; + double *sfacrl, *sfacim, *sfacrl_all, *sfacim_all; + double ***cs, ***sn; // group-group interactions int group_allocate_flag; - double *sfacrl_A,*sfacim_A,*sfacrl_A_all,*sfacim_A_all; - double *sfacrl_B,*sfacim_B,*sfacrl_B_all,*sfacim_B_all; + double *sfacrl_A, *sfacim_A, *sfacrl_A_all, *sfacim_A_all; + double *sfacrl_B, *sfacim_B, *sfacrl_B_all, *sfacim_B_all; double rms(int, double, bigint, double); virtual void eik_dot_r(); @@ -72,12 +72,12 @@ class Ewald : public KSpace { // group-group interactions - void slabcorr_groups(int,int,int); + void slabcorr_groups(int, int, int); void allocate_groups(); void deallocate_groups(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/ewald_dipole.cpp b/src/KSPACE/ewald_dipole.cpp index b918adede3..5c7835bd51 100644 --- a/src/KSPACE/ewald_dipole.cpp +++ b/src/KSPACE/ewald_dipole.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/ewald_dipole.h b/src/KSPACE/ewald_dipole.h index 105f1b7e3f..f1cb619442 100644 --- a/src/KSPACE/ewald_dipole.h +++ b/src/KSPACE/ewald_dipole.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(ewald/dipole,EwaldDipole) - +// clang-format off +KSpaceStyle(ewald/dipole,EwaldDipole); +// clang-format on #else #ifndef LMP_EWALD_DIPOLE_H @@ -33,9 +33,9 @@ class EwaldDipole : public Ewald { virtual void compute(int, int); protected: - double musum,musqsum,mu2; - double **tk; // field for torque - double **vc; // virial per k + double musum, musqsum, mu2; + double **tk; // field for torque + double **vc; // virial per k void musum_musq(); double rms_dipole(int, double, bigint); @@ -44,10 +44,9 @@ class EwaldDipole : public Ewald { double NewtonSolve(double, double, bigint, double, double); double f(double, double, bigint, double, double); double derivf(double, double, bigint, double, double); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/ewald_dipole_spin.cpp b/src/KSPACE/ewald_dipole_spin.cpp index f7bc9fdefc..6f093d5d0a 100644 --- a/src/KSPACE/ewald_dipole_spin.cpp +++ b/src/KSPACE/ewald_dipole_spin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/ewald_dipole_spin.h b/src/KSPACE/ewald_dipole_spin.h index 13f9e79ae9..eb87c69ae2 100644 --- a/src/KSPACE/ewald_dipole_spin.h +++ b/src/KSPACE/ewald_dipole_spin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(ewald/dipole/spin,EwaldDipoleSpin) - +// clang-format off +KSpaceStyle(ewald/dipole/spin,EwaldDipoleSpin); +// clang-format on #else #ifndef LMP_EWALD_DIPOLE_SPIN_H @@ -33,19 +33,18 @@ class EwaldDipoleSpin : public EwaldDipole { void compute(int, int); protected: - double hbar; // reduced Planck's constant - double mub; // Bohr's magneton - double mu_0; // vacuum permeability - double mub2mu0; // prefactor for mech force - double mub2mu0hbinv; // prefactor for mag force + double hbar; // reduced Planck's constant + double mub; // Bohr's magneton + double mu_0; // vacuum permeability + double mub2mu0; // prefactor for mech force + double mub2mu0hbinv; // prefactor for mag force void spsum_musq(); virtual void eik_dot_r(); void slabcorr(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/ewald_disp.cpp b/src/KSPACE/ewald_disp.cpp index 620d371b1f..0535061bb7 100644 --- a/src/KSPACE/ewald_disp.cpp +++ b/src/KSPACE/ewald_disp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/ewald_disp.h b/src/KSPACE/ewald_disp.h index 9bd7d1960b..11fd019718 100644 --- a/src/KSPACE/ewald_disp.h +++ b/src/KSPACE/ewald_disp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(ewald/disp,EwaldDisp) - +// clang-format off +KSpaceStyle(ewald/disp,EwaldDisp); +// clang-format on #else #ifndef LMP_EWALD_DISP_H @@ -24,10 +24,13 @@ KSpaceStyle(ewald/disp,EwaldDisp) namespace LAMMPS_NS { -#define EWALD_NORDER 6 -#define EWALD_NFUNCS 4 -#define EWALD_MAX_NSUMS 10 -#define EWALD_NSUMS {1, 1, 7, 1} +#define EWALD_NORDER 6 +#define EWALD_NFUNCS 4 +#define EWALD_MAX_NSUMS 10 +#define EWALD_NSUMS \ + { \ + 1, 1, 7, 1 \ + } class EwaldDisp : public KSpace { public: @@ -37,18 +40,17 @@ class EwaldDisp : public KSpace { void setup(); void settings(int, char **); void compute(int, int); - double memory_usage() {return bytes;} + double memory_usage() { return bytes; } private: double unit[6]; int function[EWALD_NFUNCS], first_output; - int nkvec, nkvec_max, nevec, nevec_max, - nbox, nfunctions, nsums, sums; + int nkvec, nkvec_max, nevec, nevec_max, nbox, nfunctions, nsums, sums; int peratom_allocate_flag; int nmax; double bytes; - double gsqmx,q2,b2,M2; + double gsqmx, q2, b2, M2; double *kenergy, energy_self[EWALD_NFUNCS]; double *kvirial, virial_self[EWALD_NFUNCS]; double **energy_self_peratom; @@ -58,7 +60,9 @@ class EwaldDisp : public KSpace { struct kvector *kvec; double mumurd2e, dielectric, *B, volume; - struct Sum { double x, x2; } sum[EWALD_MAX_NSUMS]; + struct Sum { + double x, x2; + } sum[EWALD_MAX_NSUMS]; struct complex *cek_local, *cek_global; double rms(int, double, bigint, double, double, double); @@ -86,7 +90,7 @@ class EwaldDisp : public KSpace { double derivf(double, double, bigint, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/fft3d.cpp b/src/KSPACE/fft3d.cpp index a21bbb0999..130aaebf21 100644 --- a/src/KSPACE/fft3d.cpp +++ b/src/KSPACE/fft3d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/fft3d.h b/src/KSPACE/fft3d.h index 478cbb05e5..12f426a061 100644 --- a/src/KSPACE/fft3d.h +++ b/src/KSPACE/fft3d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -46,7 +46,7 @@ typedef float _Complex FFT_DATA; #elif defined(FFT_FFTW3) #include "fftw3.h" typedef fftwf_complex FFT_DATA; -#define FFTW_API(function) fftwf_ ## function +#define FFTW_API(function) fftwf_##function #else @@ -57,12 +57,12 @@ typedef fftwf_complex FFT_DATA; #endif #define kiss_fft_scalar float typedef struct { - kiss_fft_scalar re; - kiss_fft_scalar im; + kiss_fft_scalar re; + kiss_fft_scalar im; } FFT_DATA; struct kiss_fft_state; -typedef struct kiss_fft_state* kiss_fft_cfg; +typedef struct kiss_fft_state *kiss_fft_cfg; #endif // ------------------------------------------------------------------------- @@ -79,7 +79,7 @@ typedef double _Complex FFT_DATA; #elif defined(FFT_FFTW3) #include "fftw3.h" typedef fftw_complex FFT_DATA; -#define FFTW_API(function) fftw_ ## function +#define FFTW_API(function) fftw_##function #else @@ -89,12 +89,12 @@ typedef fftw_complex FFT_DATA; #endif #define kiss_fft_scalar double typedef struct { - kiss_fft_scalar re; - kiss_fft_scalar im; + kiss_fft_scalar re; + kiss_fft_scalar im; } FFT_DATA; struct kiss_fft_state; -typedef struct kiss_fft_state* kiss_fft_cfg; +typedef struct kiss_fft_state *kiss_fft_cfg; #endif #else @@ -106,21 +106,21 @@ typedef struct kiss_fft_state* kiss_fft_cfg; // details of how to do a 3d FFT struct fft_plan_3d { - struct remap_plan_3d *pre_plan; // remap from input -> 1st FFTs - struct remap_plan_3d *mid1_plan; // remap from 1st -> 2nd FFTs - struct remap_plan_3d *mid2_plan; // remap from 2nd -> 3rd FFTs - struct remap_plan_3d *post_plan; // remap from 3rd FFTs -> output - FFT_DATA *copy; // memory for remap results (if needed) - FFT_DATA *scratch; // scratch space for remaps - int total1,total2,total3; // # of 1st,2nd,3rd FFTs (times length) - int length1,length2,length3; // length of 1st,2nd,3rd FFTs - int pre_target; // where to put remap results - int mid1_target,mid2_target; - int scaled; // whether to scale FFT results - int normnum; // # of values to rescale - double norm; // normalization factor for rescaling + struct remap_plan_3d *pre_plan; // remap from input -> 1st FFTs + struct remap_plan_3d *mid1_plan; // remap from 1st -> 2nd FFTs + struct remap_plan_3d *mid2_plan; // remap from 2nd -> 3rd FFTs + struct remap_plan_3d *post_plan; // remap from 3rd FFTs -> output + FFT_DATA *copy; // memory for remap results (if needed) + FFT_DATA *scratch; // scratch space for remaps + int total1, total2, total3; // # of 1st,2nd,3rd FFTs (times length) + int length1, length2, length3; // length of 1st,2nd,3rd FFTs + int pre_target; // where to put remap results + int mid1_target, mid2_target; + int scaled; // whether to scale FFT results + int normnum; // # of values to rescale + double norm; // normalization factor for rescaling - // system specific 1d FFT info + // system specific 1d FFT info #if defined(FFT_MKL) DFTI_DESCRIPTOR *handle_fast; DFTI_DESCRIPTOR *handle_mid; @@ -145,15 +145,13 @@ struct fft_plan_3d { // function prototypes extern "C" { - void fft_3d(FFT_DATA *, FFT_DATA *, int, struct fft_plan_3d *); - struct fft_plan_3d *fft_3d_create_plan(MPI_Comm, int, int, int, - int, int, int, int, int, - int, int, int, int, int, int, int, - int, int, int *, int); - void fft_3d_destroy_plan(struct fft_plan_3d *); - void factor(int, int *, int *); - void bifactor(int, int *, int *); - void fft_1d_only(FFT_DATA *, int, int, struct fft_plan_3d *); +void fft_3d(FFT_DATA *, FFT_DATA *, int, struct fft_plan_3d *); +struct fft_plan_3d *fft_3d_create_plan(MPI_Comm, int, int, int, int, int, int, int, int, int, int, + int, int, int, int, int, int, int, int *, int); +void fft_3d_destroy_plan(struct fft_plan_3d *); +void factor(int, int *, int *); +void bifactor(int, int *, int *); +void fft_1d_only(FFT_DATA *, int, int, struct fft_plan_3d *); } /* ERROR/WARNING messages: diff --git a/src/KSPACE/fft3d_wrap.cpp b/src/KSPACE/fft3d_wrap.cpp index 55509616d5..56a59755a1 100644 --- a/src/KSPACE/fft3d_wrap.cpp +++ b/src/KSPACE/fft3d_wrap.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/fft3d_wrap.h b/src/KSPACE/fft3d_wrap.h index 6deb9baf03..58a6957a2b 100644 --- a/src/KSPACE/fft3d_wrap.h +++ b/src/KSPACE/fft3d_wrap.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,17 +14,17 @@ #ifndef LMP_FFT3D_WRAP_H #define LMP_FFT3D_WRAP_H -#include "pointers.h" #include "fft3d.h" +#include "pointers.h" namespace LAMMPS_NS { class FFT3d : protected Pointers { public: - enum{FORWARD=1,BACKWARD=-1}; + enum { FORWARD = 1, BACKWARD = -1 }; - FFT3d(class LAMMPS *, MPI_Comm,int,int,int,int,int,int,int,int,int, - int,int,int,int,int,int,int,int,int *,int); + FFT3d(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, int, + int, int, int, int, int *, int); ~FFT3d(); void compute(FFT_SCALAR *, FFT_SCALAR *, int); void timing1d(FFT_SCALAR *, int, int); @@ -33,7 +33,7 @@ class FFT3d : protected Pointers { struct fft_plan_3d *plan; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KSPACE/fix_tune_kspace.cpp b/src/KSPACE/fix_tune_kspace.cpp index 55960f1c33..6b3b969a7f 100644 --- a/src/KSPACE/fix_tune_kspace.cpp +++ b/src/KSPACE/fix_tune_kspace.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/fix_tune_kspace.h b/src/KSPACE/fix_tune_kspace.h index 1cd663c8cc..7affe49684 100644 --- a/src/KSPACE/fix_tune_kspace.h +++ b/src/KSPACE/fix_tune_kspace.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(tune/kspace,FixTuneKspace) - +// clang-format off +FixStyle(tune/kspace,FixTuneKspace); +// clang-format on #else #ifndef LMP_FIX_TUNE_KSPACE_H @@ -22,7 +22,6 @@ FixStyle(tune/kspace,FixTuneKspace) #include "fix.h" - namespace LAMMPS_NS { class FixTuneKspace : public Fix { @@ -45,12 +44,12 @@ class FixTuneKspace : public Fix { private: int nevery; - int last_step; // previous timestep when timing info was collected - double last_spcpu; // old elapsed CPU time value - int firststep; // 0 if this is the first time timing info is collected - int niter; // number of kspace switches + int last_step; // previous timestep when timing info was collected + double last_spcpu; // old elapsed CPU time value + int firststep; // 0 if this is the first time timing info is collected + int niter; // number of kspace switches - double ewald_time,pppm_time,msm_time; + double ewald_time, pppm_time, msm_time; double pair_cut_coul; std::string acc_str; std::string kspace_style; @@ -62,25 +61,25 @@ class FixTuneKspace : public Fix { double old_slab_volfactor; int niter_adjust_rcut; - double ax_brent,bx_brent,cx_brent,dx_brent; - double fa_brent,fb_brent,fc_brent,fd_brent; - double v_brent,w_brent,x_brent; - double fv_brent,fw_brent,fx_brent; - double a_brent,b_brent; + double ax_brent, bx_brent, cx_brent, dx_brent; + double fa_brent, fb_brent, fc_brent, fd_brent; + double v_brent, w_brent, x_brent; + double fv_brent, fw_brent, fx_brent; + double a_brent, b_brent; double fd2_brent; double dxlim; - bool keep_bracketing,first_brent_pass; - bool converged,need_fd2_brent; + bool keep_bracketing, first_brent_pass; + bool converged, need_fd2_brent; inline void shft3(double &a, double &b, double &c, const double d) { - a=b; - b=c; - c=d; + a = b; + b = c; + c = d; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/gridcomm.cpp b/src/KSPACE/gridcomm.cpp index a6445f023e..e37555080d 100644 --- a/src/KSPACE/gridcomm.cpp +++ b/src/KSPACE/gridcomm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/gridcomm.h b/src/KSPACE/gridcomm.h index 4cadfdbf29..03379bde99 100644 --- a/src/KSPACE/gridcomm.h +++ b/src/KSPACE/gridcomm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,51 +20,46 @@ namespace LAMMPS_NS { class GridComm : protected Pointers { public: - GridComm(class LAMMPS *, MPI_Comm, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int); - GridComm(class LAMMPS *, MPI_Comm, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int); + GridComm(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, + int, int, int); + GridComm(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, + int, int, int, int, int, int, int, int, int, int); virtual ~GridComm(); void setup(int &, int &); int ghost_adjacent(); - void forward_comm_kspace(class KSpace *, int, int, int, - void *, void *, MPI_Datatype); - void reverse_comm_kspace(class KSpace *, int, int, int, - void *, void *, MPI_Datatype); + void forward_comm_kspace(class KSpace *, int, int, int, void *, void *, MPI_Datatype); + void reverse_comm_kspace(class KSpace *, int, int, int, void *, void *, MPI_Datatype); protected: - int me,nprocs; - int layout; // REGULAR or TILED - MPI_Comm gridcomm; // communicator for this class - // usually world, but MSM calls with subset + int me, nprocs; + int layout; // REGULAR or TILED + MPI_Comm gridcomm; // communicator for this class + // usually world, but MSM calls with subset // inputs from caller via constructor - int nx,ny,nz; // size of global grid in all 3 dims - int inxlo,inxhi; // inclusive extent of my grid chunk - int inylo,inyhi; // 0 <= in <= N-1 - int inzlo,inzhi; - int outxlo,outxhi; // inclusive extent of my grid chunk plus - int outylo,outyhi; // ghost cells in all 6 directions - int outzlo,outzhi; // lo indices can be < 0, hi indices can be >= N - int fullxlo,fullxhi; // extent of grid chunk that caller stores - int fullylo,fullyhi; // can be same as out indices or larger - int fullzlo,fullzhi; + int nx, ny, nz; // size of global grid in all 3 dims + int inxlo, inxhi; // inclusive extent of my grid chunk + int inylo, inyhi; // 0 <= in <= N-1 + int inzlo, inzhi; + int outxlo, outxhi; // inclusive extent of my grid chunk plus + int outylo, outyhi; // ghost cells in all 6 directions + int outzlo, outzhi; // lo indices can be < 0, hi indices can be >= N + int fullxlo, fullxhi; // extent of grid chunk that caller stores + int fullylo, fullyhi; // can be same as out indices or larger + int fullzlo, fullzhi; // ------------------------------------------- // internal variables for REGULAR layout // ------------------------------------------- - int procxlo,procxhi; // 6 neighbor procs that adjoin me - int procylo,procyhi; // not used for comm_style = tiled - int proczlo,proczhi; + int procxlo, procxhi; // 6 neighbor procs that adjoin me + int procylo, procyhi; // not used for comm_style = tiled + int proczlo, proczhi; - int ghostxlo,ghostxhi; // # of my owned grid planes needed - int ghostylo,ghostyhi; // by neighobr procs in each dir as their ghost planes - int ghostzlo,ghostzhi; + int ghostxlo, ghostxhi; // # of my owned grid planes needed + int ghostylo, ghostyhi; // by neighobr procs in each dir as their ghost planes + int ghostzlo, ghostzhi; // swap = exchange of owned and ghost grid cells between 2 procs, including self @@ -77,22 +72,22 @@ class GridComm : protected Pointers { int *unpacklist; // 3d array offsets to unpack }; - int nswap,maxswap; + int nswap, maxswap; Swap *swap; // ------------------------------------------- // internal variables for TILED layout // ------------------------------------------- - int *overlap_procs; // length of Nprocs in communicator - MPI_Request *requests; // length of max messages this proc receives + int *overlap_procs; // length of Nprocs in communicator + MPI_Request *requests; // length of max messages this proc receives // RCB tree of cut info // each proc contributes one value, except proc 0 struct RCBinfo { - int dim; // 0,1,2 = which dim the cut is in - int cut; // grid index of lowest cell in upper half of cut + int dim; // 0,1,2 = which dim the cut is in + int cut; // grid index of lowest cell in upper half of cut }; RCBinfo *rcbinfo; @@ -101,37 +96,37 @@ class GridComm : protected Pointers { // includes overlaps across periodic boundaries, can also be self struct Overlap { - int proc; // proc whose owned cells overlap my ghost cells - int box[6]; // box that overlaps otherproc's owned cells - // this box is wholly contained within global grid - int pbc[3]; // PBC offsets to convert box to a portion of my ghost box - // my ghost box may extend beyond global grid + int proc; // proc whose owned cells overlap my ghost cells + int box[6]; // box that overlaps otherproc's owned cells + // this box is wholly contained within global grid + int pbc[3]; // PBC offsets to convert box to a portion of my ghost box + // my ghost box may extend beyond global grid }; - int noverlap,maxoverlap; + int noverlap, maxoverlap; Overlap *overlap; // request = sent to each proc whose owned cells overlap my ghost cells struct Request { - int sender; // sending proc - int index; // index of overlap on sender - int box[6]; // box that overlaps receiver's owned cells - // wholly contained within global grid + int sender; // sending proc + int index; // index of overlap on sender + int box[6]; // box that overlaps receiver's owned cells + // wholly contained within global grid }; - Request *srequest,*rrequest; + Request *srequest, *rrequest; // response = reply from each proc whose owned cells overlap my ghost cells struct Response { - int index; // index of my overlap for the initial request - int box[6]; // box that overlaps responder's owned cells - // wholly contained within global grid - // has to unwrapped by PBC to map to my ghost cells + int index; // index of my overlap for the initial request + int box[6]; // box that overlaps responder's owned cells + // wholly contained within global grid + // has to unwrapped by PBC to map to my ghost cells }; - Response *sresponse,*rresponse; + Response *sresponse, *rresponse; // send = proc to send a subset of my owned cells to, for forward comm // for reverse comm, proc I receive ghost overlaps with my owned cells from @@ -155,7 +150,7 @@ class GridComm : protected Pointers { int offset; }; - int adjacent; // 0 on a proc who receives ghosts from a non-neighbor proc + int adjacent; // 0 on a proc who receives ghosts from a non-neighbor proc // copy = subset of my owned cells to copy into subset of my ghost cells // that describes forward comm, for reverse comm it is the opposite @@ -167,7 +162,7 @@ class GridComm : protected Pointers { int *unpacklist; }; - int nsend,nrecv,ncopy; + int nsend, nrecv, ncopy; Send *send; Recv *recv; Copy *copy; @@ -176,11 +171,8 @@ class GridComm : protected Pointers { // internal methods // ------------------------------------------- - void initialize(MPI_Comm, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int); + void initialize(MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, int, int, + int, int, int, int, int, int, int, int, int, int, int, int, int); virtual void setup_regular(int &, int &); virtual void setup_tiled(int &, int &); void ghost_box_drop(int *, int *); @@ -189,14 +181,10 @@ class GridComm : protected Pointers { int ghost_adjacent_regular(); int ghost_adjacent_tiled(); - void forward_comm_kspace_regular(class KSpace *, int, int, int, - void *, void *, MPI_Datatype); - void forward_comm_kspace_tiled(class KSpace *, int, int, int, - void *, void *, MPI_Datatype); - void reverse_comm_kspace_regular(class KSpace *, int, int, int, - void *, void *, MPI_Datatype); - void reverse_comm_kspace_tiled(class KSpace *, int, int, int, - void *, void *, MPI_Datatype); + void forward_comm_kspace_regular(class KSpace *, int, int, int, void *, void *, MPI_Datatype); + void forward_comm_kspace_tiled(class KSpace *, int, int, int, void *, void *, MPI_Datatype); + void reverse_comm_kspace_regular(class KSpace *, int, int, int, void *, void *, MPI_Datatype); + void reverse_comm_kspace_tiled(class KSpace *, int, int, int, void *, void *, MPI_Datatype); virtual void grow_swap(); void grow_overlap(); @@ -204,6 +192,6 @@ class GridComm : protected Pointers { int indices(int *&, int, int, int, int, int, int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KSPACE/kissfft.h b/src/KSPACE/kissfft.h index 8cb6dec820..cfc672902e 100644 --- a/src/KSPACE/kissfft.h +++ b/src/KSPACE/kissfft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov See the README file in the top-level LAMMPS directory. @@ -17,9 +17,9 @@ #ifndef LMP_FFT_KISSFFT #define LMP_FFT_KISSFFT +#include #include #include -#include #if defined(_OPENMP) #include @@ -69,10 +69,10 @@ /* e.g. an fft of length 128 has 4 factors as far as kissfft is concerned: 4*4*4*2 */ struct kiss_fft_state { - int nfft; - int inverse; - int factors[2*MAXFACTORS]; - FFT_DATA twiddles[1]; + int nfft; + int inverse; + int factors[2 * MAXFACTORS]; + FFT_DATA twiddles[1]; }; #ifdef KISS_FFT_USE_ALLOCA @@ -81,15 +81,15 @@ struct kiss_fft_state { // 1. FFT sizes that have "bad" factors. i.e. not 2,3 and 5 // 2. "in-place" FFTs. Notice the quotes, since kissfft does not really do an in-place transform. #include -#define KISS_FFT_TMP_ALLOC(nbytes) alloca(nbytes) -#define KISS_FFT_TMP_FREE(ptr) +#define KISS_FFT_TMP_ALLOC(nbytes) alloca(nbytes) +#define KISS_FFT_TMP_FREE(ptr) #else -#define KISS_FFT_TMP_ALLOC(nbytes) KISS_FFT_MALLOC(nbytes) -#define KISS_FFT_TMP_FREE(ptr) KISS_FFT_FREE(ptr) +#define KISS_FFT_TMP_ALLOC(nbytes) KISS_FFT_MALLOC(nbytes) +#define KISS_FFT_TMP_FREE(ptr) KISS_FFT_FREE(ptr) #endif -static kiss_fft_cfg kiss_fft_alloc(int,int,void *,size_t *); -static void kiss_fft(kiss_fft_cfg,const FFT_DATA *,FFT_DATA *); +static kiss_fft_cfg kiss_fft_alloc(int, int, void *, size_t *); +static void kiss_fft(kiss_fft_cfg, const FFT_DATA *, FFT_DATA *); /* Explanation of macros dealing with complex math: @@ -101,285 +101,311 @@ static void kiss_fft(kiss_fft_cfg,const FFT_DATA *,FFT_DATA *); C_ADDTO( res , a) : res += a * */ -#define S_MUL(a,b) ( (a)*(b) ) -#define C_MUL(m,a,b) \ - do{ (m).re = (a).re*(b).re - (a).im*(b).im;\ - (m).im = (a).re*(b).im + (a).im*(b).re; }while(0) -#define C_FIXDIV(c,div) /* NOOP */ -#define C_MULBYSCALAR( c, s ) \ - do{ (c).re *= (s);\ - (c).im *= (s); }while(0) +#define S_MUL(a, b) ((a) * (b)) +#define C_MUL(m, a, b) \ + do { \ + (m).re = (a).re * (b).re - (a).im * (b).im; \ + (m).im = (a).re * (b).im + (a).im * (b).re; \ + } while (0) +#define C_FIXDIV(c, div) /* NOOP */ +#define C_MULBYSCALAR(c, s) \ + do { \ + (c).re *= (s); \ + (c).im *= (s); \ + } while (0) #ifndef CHECK_OVERFLOW_OP -# define CHECK_OVERFLOW_OP(a,op,b) /* noop */ +#define CHECK_OVERFLOW_OP(a, op, b) /* noop */ #endif -#define C_ADD( res, a,b)\ - do { \ - CHECK_OVERFLOW_OP((a).re,+,(b).re)\ - CHECK_OVERFLOW_OP((a).im,+,(b).im)\ - (res).re=(a).re+(b).re; (res).im=(a).im+(b).im; \ - }while(0) -#define C_SUB( res, a,b)\ - do { \ - CHECK_OVERFLOW_OP((a).re,-,(b).re)\ - CHECK_OVERFLOW_OP((a).im,-,(b).im)\ - (res).re=(a).re-(b).re; (res).im=(a).im-(b).im; \ - }while(0) -#define C_ADDTO( res , a)\ - do { \ - CHECK_OVERFLOW_OP((res).re,+,(a).re)\ - CHECK_OVERFLOW_OP((res).im,+,(a).im)\ - (res).re += (a).re; (res).im += (a).im;\ - }while(0) - -#define C_SUBFROM( res , a)\ - do {\ - CHECK_OVERFLOW_OP((res).re,-,(a).re)\ - CHECK_OVERFLOW_OP((res).im,-,(a).im)\ - (res).re -= (a).re; (res).im -= (a).im; \ - }while(0) +#define C_ADD(res, a, b) \ + do { \ + CHECK_OVERFLOW_OP((a).re, +, (b).re) \ + CHECK_OVERFLOW_OP((a).im, +, (b).im) \ + (res).re = (a).re + (b).re; \ + (res).im = (a).im + (b).im; \ + } while (0) +#define C_SUB(res, a, b) \ + do { \ + CHECK_OVERFLOW_OP((a).re, -, (b).re) \ + CHECK_OVERFLOW_OP((a).im, -, (b).im) \ + (res).re = (a).re - (b).re; \ + (res).im = (a).im - (b).im; \ + } while (0) +#define C_ADDTO(res, a) \ + do { \ + CHECK_OVERFLOW_OP((res).re, +, (a).re) \ + CHECK_OVERFLOW_OP((res).im, +, (a).im) \ + (res).re += (a).re; \ + (res).im += (a).im; \ + } while (0) +#define C_SUBFROM(res, a) \ + do { \ + CHECK_OVERFLOW_OP((res).re, -, (a).re) \ + CHECK_OVERFLOW_OP((res).im, -, (a).im) \ + (res).re -= (a).re; \ + (res).im -= (a).im; \ + } while (0) #define KISS_FFT_COS(phase) (kiss_fft_scalar) cos(phase) #define KISS_FFT_SIN(phase) (kiss_fft_scalar) sin(phase) -#define HALF_OF(x) ((x)*.5) +#define HALF_OF(x) ((x) *.5) -#define kf_cexp(x,phase) \ - do{ \ - (x)->re = KISS_FFT_COS(phase);\ - (x)->im = KISS_FFT_SIN(phase);\ - }while(0) +#define kf_cexp(x, phase) \ + do { \ + (x)->re = KISS_FFT_COS(phase); \ + (x)->im = KISS_FFT_SIN(phase); \ + } while (0) -static void kf_bfly2(FFT_DATA *Fout, const size_t fstride, - const kiss_fft_cfg st, int m) +static void kf_bfly2(FFT_DATA *Fout, const size_t fstride, const kiss_fft_cfg st, int m) { - FFT_DATA *Fout2; - FFT_DATA *tw1 = st->twiddles; - FFT_DATA t; + FFT_DATA *Fout2; + FFT_DATA *tw1 = st->twiddles; + FFT_DATA t; - Fout2 = Fout + m; - do { - C_FIXDIV(*Fout,2); C_FIXDIV(*Fout2,2); + Fout2 = Fout + m; + do { + C_FIXDIV(*Fout, 2); + C_FIXDIV(*Fout2, 2); - C_MUL (t, *Fout2 , *tw1); - tw1 += fstride; - C_SUB( *Fout2 , *Fout , t ); - C_ADDTO( *Fout , t ); - ++Fout2; - ++Fout; - } while(--m); + C_MUL(t, *Fout2, *tw1); + tw1 += fstride; + C_SUB(*Fout2, *Fout, t); + C_ADDTO(*Fout, t); + ++Fout2; + ++Fout; + } while (--m); } -static void kf_bfly4(FFT_DATA * Fout, const size_t fstride, - const kiss_fft_cfg st, const size_t m) +static void kf_bfly4(FFT_DATA *Fout, const size_t fstride, const kiss_fft_cfg st, const size_t m) { - FFT_DATA *tw1, *tw2, *tw3; - FFT_DATA scratch[6]; - size_t k=m; - const size_t m2=2*m; - const size_t m3=3*m; + FFT_DATA *tw1, *tw2, *tw3; + FFT_DATA scratch[6]; + size_t k = m; + const size_t m2 = 2 * m; + const size_t m3 = 3 * m; - tw3 = tw2 = tw1 = st->twiddles; + tw3 = tw2 = tw1 = st->twiddles; - do { - C_FIXDIV(*Fout,4); C_FIXDIV(Fout[m],4); C_FIXDIV(Fout[m2],4); C_FIXDIV(Fout[m3],4); + do { + C_FIXDIV(*Fout, 4); + C_FIXDIV(Fout[m], 4); + C_FIXDIV(Fout[m2], 4); + C_FIXDIV(Fout[m3], 4); - C_MUL(scratch[0],Fout[m] , *tw1 ); - C_MUL(scratch[1],Fout[m2] , *tw2 ); - C_MUL(scratch[2],Fout[m3] , *tw3 ); + C_MUL(scratch[0], Fout[m], *tw1); + C_MUL(scratch[1], Fout[m2], *tw2); + C_MUL(scratch[2], Fout[m3], *tw3); - C_SUB( scratch[5] , *Fout, scratch[1] ); - C_ADDTO(*Fout, scratch[1]); - C_ADD( scratch[3] , scratch[0] , scratch[2] ); - C_SUB( scratch[4] , scratch[0] , scratch[2] ); - C_SUB( Fout[m2], *Fout, scratch[3] ); - tw1 += fstride; - tw2 += fstride*2; - tw3 += fstride*3; - C_ADDTO( *Fout , scratch[3] ); + C_SUB(scratch[5], *Fout, scratch[1]); + C_ADDTO(*Fout, scratch[1]); + C_ADD(scratch[3], scratch[0], scratch[2]); + C_SUB(scratch[4], scratch[0], scratch[2]); + C_SUB(Fout[m2], *Fout, scratch[3]); + tw1 += fstride; + tw2 += fstride * 2; + tw3 += fstride * 3; + C_ADDTO(*Fout, scratch[3]); - if (st->inverse) { - Fout[m].re = scratch[5].re - scratch[4].im; - Fout[m].im = scratch[5].im + scratch[4].re; - Fout[m3].re = scratch[5].re + scratch[4].im; - Fout[m3].im = scratch[5].im - scratch[4].re; - } else{ - Fout[m].re = scratch[5].re + scratch[4].im; - Fout[m].im = scratch[5].im - scratch[4].re; - Fout[m3].re = scratch[5].re - scratch[4].im; - Fout[m3].im = scratch[5].im + scratch[4].re; - } - ++Fout; - } while(--k); -} - -static void kf_bfly3(FFT_DATA * Fout, const size_t fstride, - const kiss_fft_cfg st, size_t m) -{ - size_t k=m; - const size_t m2 = 2*m; - FFT_DATA *tw1, *tw2; - FFT_DATA scratch[5]; - FFT_DATA epi3; - epi3 = st->twiddles[fstride*m]; - - tw1=tw2=st->twiddles; - - do { - C_FIXDIV(*Fout,3); C_FIXDIV(Fout[m],3); C_FIXDIV(Fout[m2],3); - - C_MUL(scratch[1],Fout[m] , *tw1); - C_MUL(scratch[2],Fout[m2] , *tw2); - - C_ADD(scratch[3],scratch[1],scratch[2]); - C_SUB(scratch[0],scratch[1],scratch[2]); - tw1 += fstride; - tw2 += fstride*2; - - Fout[m].re = Fout->re - HALF_OF(scratch[3].re); - Fout[m].im = Fout->im - HALF_OF(scratch[3].im); - - C_MULBYSCALAR( scratch[0] , epi3.im ); - - C_ADDTO(*Fout,scratch[3]); - - Fout[m2].re = Fout[m].re + scratch[0].im; - Fout[m2].im = Fout[m].im - scratch[0].re; - - Fout[m].re -= scratch[0].im; - Fout[m].im += scratch[0].re; - - ++Fout; - } while(--k); -} - -static void kf_bfly5(FFT_DATA * Fout, const size_t fstride, - const kiss_fft_cfg st, int m) -{ - FFT_DATA *Fout0, *Fout1, *Fout2, *Fout3, *Fout4; - int u; - FFT_DATA scratch[13]; - FFT_DATA * twiddles = st->twiddles; - FFT_DATA *tw; - FFT_DATA ya,yb; - ya = twiddles[fstride*m]; - yb = twiddles[fstride*2*m]; - - Fout0=Fout; - Fout1=Fout0+m; - Fout2=Fout0+2*m; - Fout3=Fout0+3*m; - Fout4=Fout0+4*m; - - tw=st->twiddles; - for ( u=0; ure += scratch[7].re + scratch[8].re; - Fout0->im += scratch[7].im + scratch[8].im; - - scratch[5].re = scratch[0].re + S_MUL(scratch[7].re,ya.re) + S_MUL(scratch[8].re,yb.re); - scratch[5].im = scratch[0].im + S_MUL(scratch[7].im,ya.re) + S_MUL(scratch[8].im,yb.re); - - scratch[6].re = S_MUL(scratch[10].im,ya.im) + S_MUL(scratch[9].im,yb.im); - scratch[6].im = -S_MUL(scratch[10].re,ya.im) - S_MUL(scratch[9].re,yb.im); - - C_SUB(*Fout1,scratch[5],scratch[6]); - C_ADD(*Fout4,scratch[5],scratch[6]); - - scratch[11].re = scratch[0].re + S_MUL(scratch[7].re,yb.re) + S_MUL(scratch[8].re,ya.re); - scratch[11].im = scratch[0].im + S_MUL(scratch[7].im,yb.re) + S_MUL(scratch[8].im,ya.re); - scratch[12].re = - S_MUL(scratch[10].im,yb.im) + S_MUL(scratch[9].im,ya.im); - scratch[12].im = S_MUL(scratch[10].re,yb.im) - S_MUL(scratch[9].re,ya.im); - - C_ADD(*Fout2,scratch[11],scratch[12]); - C_SUB(*Fout3,scratch[11],scratch[12]); - - ++Fout0;++Fout1;++Fout2;++Fout3;++Fout4; + if (st->inverse) { + Fout[m].re = scratch[5].re - scratch[4].im; + Fout[m].im = scratch[5].im + scratch[4].re; + Fout[m3].re = scratch[5].re + scratch[4].im; + Fout[m3].im = scratch[5].im - scratch[4].re; + } else { + Fout[m].re = scratch[5].re + scratch[4].im; + Fout[m].im = scratch[5].im - scratch[4].re; + Fout[m3].re = scratch[5].re - scratch[4].im; + Fout[m3].im = scratch[5].im + scratch[4].re; } + ++Fout; + } while (--k); +} + +static void kf_bfly3(FFT_DATA *Fout, const size_t fstride, const kiss_fft_cfg st, size_t m) +{ + size_t k = m; + const size_t m2 = 2 * m; + FFT_DATA *tw1, *tw2; + FFT_DATA scratch[5]; + FFT_DATA epi3; + epi3 = st->twiddles[fstride * m]; + + tw1 = tw2 = st->twiddles; + + do { + C_FIXDIV(*Fout, 3); + C_FIXDIV(Fout[m], 3); + C_FIXDIV(Fout[m2], 3); + + C_MUL(scratch[1], Fout[m], *tw1); + C_MUL(scratch[2], Fout[m2], *tw2); + + C_ADD(scratch[3], scratch[1], scratch[2]); + C_SUB(scratch[0], scratch[1], scratch[2]); + tw1 += fstride; + tw2 += fstride * 2; + + Fout[m].re = Fout->re - HALF_OF(scratch[3].re); + Fout[m].im = Fout->im - HALF_OF(scratch[3].im); + + C_MULBYSCALAR(scratch[0], epi3.im); + + C_ADDTO(*Fout, scratch[3]); + + Fout[m2].re = Fout[m].re + scratch[0].im; + Fout[m2].im = Fout[m].im - scratch[0].re; + + Fout[m].re -= scratch[0].im; + Fout[m].im += scratch[0].re; + + ++Fout; + } while (--k); +} + +static void kf_bfly5(FFT_DATA *Fout, const size_t fstride, const kiss_fft_cfg st, int m) +{ + FFT_DATA *Fout0, *Fout1, *Fout2, *Fout3, *Fout4; + int u; + FFT_DATA scratch[13]; + FFT_DATA *twiddles = st->twiddles; + FFT_DATA *tw; + FFT_DATA ya, yb; + ya = twiddles[fstride * m]; + yb = twiddles[fstride * 2 * m]; + + Fout0 = Fout; + Fout1 = Fout0 + m; + Fout2 = Fout0 + 2 * m; + Fout3 = Fout0 + 3 * m; + Fout4 = Fout0 + 4 * m; + + tw = st->twiddles; + for (u = 0; u < m; ++u) { + C_FIXDIV(*Fout0, 5); + C_FIXDIV(*Fout1, 5); + C_FIXDIV(*Fout2, 5); + C_FIXDIV(*Fout3, 5); + C_FIXDIV(*Fout4, 5); + scratch[0] = *Fout0; + + C_MUL(scratch[1], *Fout1, tw[u * fstride]); + C_MUL(scratch[2], *Fout2, tw[2 * u * fstride]); + C_MUL(scratch[3], *Fout3, tw[3 * u * fstride]); + C_MUL(scratch[4], *Fout4, tw[4 * u * fstride]); + + C_ADD(scratch[7], scratch[1], scratch[4]); + C_SUB(scratch[10], scratch[1], scratch[4]); + C_ADD(scratch[8], scratch[2], scratch[3]); + C_SUB(scratch[9], scratch[2], scratch[3]); + + Fout0->re += scratch[7].re + scratch[8].re; + Fout0->im += scratch[7].im + scratch[8].im; + + scratch[5].re = scratch[0].re + S_MUL(scratch[7].re, ya.re) + S_MUL(scratch[8].re, yb.re); + scratch[5].im = scratch[0].im + S_MUL(scratch[7].im, ya.re) + S_MUL(scratch[8].im, yb.re); + + scratch[6].re = S_MUL(scratch[10].im, ya.im) + S_MUL(scratch[9].im, yb.im); + scratch[6].im = -S_MUL(scratch[10].re, ya.im) - S_MUL(scratch[9].re, yb.im); + + C_SUB(*Fout1, scratch[5], scratch[6]); + C_ADD(*Fout4, scratch[5], scratch[6]); + + scratch[11].re = scratch[0].re + S_MUL(scratch[7].re, yb.re) + S_MUL(scratch[8].re, ya.re); + scratch[11].im = scratch[0].im + S_MUL(scratch[7].im, yb.re) + S_MUL(scratch[8].im, ya.re); + scratch[12].re = -S_MUL(scratch[10].im, yb.im) + S_MUL(scratch[9].im, ya.im); + scratch[12].im = S_MUL(scratch[10].re, yb.im) - S_MUL(scratch[9].re, ya.im); + + C_ADD(*Fout2, scratch[11], scratch[12]); + C_SUB(*Fout3, scratch[11], scratch[12]); + + ++Fout0; + ++Fout1; + ++Fout2; + ++Fout3; + ++Fout4; + } } /* perform the butterfly for one stage of a mixed radix FFT */ -static void kf_bfly_generic(FFT_DATA * Fout, const size_t fstride, - const kiss_fft_cfg st, int m, int p) +static void kf_bfly_generic(FFT_DATA *Fout, const size_t fstride, const kiss_fft_cfg st, int m, + int p) { - int u,k,q1,q; - FFT_DATA * twiddles = st->twiddles; - FFT_DATA t; - int Norig = st->nfft; + int u, k, q1, q; + FFT_DATA *twiddles = st->twiddles; + FFT_DATA t; + int Norig = st->nfft; - FFT_DATA * scratch = (FFT_DATA*)KISS_FFT_TMP_ALLOC(sizeof(FFT_DATA)*p); - for ( u=0; u=Norig) twidx-=Norig; - C_MUL(t,scratch[q] , twiddles[twidx] ); - C_ADDTO( Fout[ k ] ,t); - } - k += m; - } + FFT_DATA *scratch = (FFT_DATA *) KISS_FFT_TMP_ALLOC(sizeof(FFT_DATA) * p); + for (u = 0; u < m; ++u) { + k = u; + for (q1 = 0; q1 < p; ++q1) { + scratch[q1] = Fout[k]; + C_FIXDIV(scratch[q1], p); + k += m; } - KISS_FFT_TMP_FREE(scratch); + + k = u; + for (q1 = 0; q1 < p; ++q1) { + int twidx = 0; + Fout[k] = scratch[0]; + for (q = 1; q < p; ++q) { + twidx += fstride * k; + if (twidx >= Norig) twidx -= Norig; + C_MUL(t, scratch[q], twiddles[twidx]); + C_ADDTO(Fout[k], t); + } + k += m; + } + } + KISS_FFT_TMP_FREE(scratch); } -static void kf_work(FFT_DATA * Fout, const FFT_DATA *f, - const size_t fstride, int in_stride, - int * factors, const kiss_fft_cfg st) +static void kf_work(FFT_DATA *Fout, const FFT_DATA *f, const size_t fstride, int in_stride, + int *factors, const kiss_fft_cfg st) { - FFT_DATA * Fout_beg=Fout; - const int p=*factors++; /* the radix */ - const int m=*factors++; /* stage's fft length/p */ - const FFT_DATA * Fout_end = Fout + p*m; + FFT_DATA *Fout_beg = Fout; + const int p = *factors++; /* the radix */ + const int m = *factors++; /* stage's fft length/p */ + const FFT_DATA *Fout_end = Fout + p * m; - if (m==1) { - do { - *Fout = *f; - f += fstride*in_stride; - } while (++Fout != Fout_end); - } else { - do { - /* recursive call: + if (m == 1) { + do { + *Fout = *f; + f += fstride * in_stride; + } while (++Fout != Fout_end); + } else { + do { + /* recursive call: DFT of size m*p performed by doing p instances of smaller DFTs of size m, each one takes a decimated version of the input */ - kf_work( Fout , f, fstride*p, in_stride, factors,st); - f += fstride*in_stride; - } while( (Fout += m) != Fout_end); - } + kf_work(Fout, f, fstride * p, in_stride, factors, st); + f += fstride * in_stride; + } while ((Fout += m) != Fout_end); + } - Fout=Fout_beg; + Fout = Fout_beg; - /* recombine the p smaller DFTs */ - switch (p) { - case 2: kf_bfly2(Fout,fstride,st,m); break; - case 3: kf_bfly3(Fout,fstride,st,m); break; - case 4: kf_bfly4(Fout,fstride,st,m); break; - case 5: kf_bfly5(Fout,fstride,st,m); break; - default: kf_bfly_generic(Fout,fstride,st,m,p); break; - } + /* recombine the p smaller DFTs */ + switch (p) { + case 2: + kf_bfly2(Fout, fstride, st, m); + break; + case 3: + kf_bfly3(Fout, fstride, st, m); + break; + case 4: + kf_bfly4(Fout, fstride, st, m); + break; + case 5: + kf_bfly5(Fout, fstride, st, m); + break; + default: + kf_bfly_generic(Fout, fstride, st, m, p); + break; + } } /* facbuf is populated by p1,m1,p2,m2, ... @@ -388,28 +414,33 @@ static void kf_work(FFT_DATA * Fout, const FFT_DATA *f, m0 = n */ static void kf_factor(int n, int *facbuf) { - int p=4, nf=0; - double floor_sqrt; - floor_sqrt = floor( sqrt((double)n) ); + int p = 4, nf = 0; + double floor_sqrt; + floor_sqrt = floor(sqrt((double) n)); - /* factor out the remaining powers of 4, powers of 2, + /* factor out the remaining powers of 4, powers of 2, and then any other remaining primes */ - do { - if (nf == MAXFACTORS) p = n; /* make certain that we don't run out of space */ - while (n % p) { - switch (p) { - case 4: p = 2; break; - case 2: p = 3; break; - default: p += 2; break; - } - if (p > floor_sqrt) - p = n; /* no more factors, skip to end */ - } - n /= p; - *facbuf++ = p; - *facbuf++ = n; - ++nf; - } while (n > 1); + do { + if (nf == MAXFACTORS) p = n; /* make certain that we don't run out of space */ + while (n % p) { + switch (p) { + case 4: + p = 2; + break; + case 2: + p = 3; + break; + default: + p += 2; + break; + } + if (p > floor_sqrt) p = n; /* no more factors, skip to end */ + } + n /= p; + *facbuf++ = p; + *facbuf++ = n; + ++nf; + } while (n > 1); } /* @@ -420,50 +451,49 @@ static void kf_factor(int n, int *facbuf) */ static kiss_fft_cfg kiss_fft_alloc(int nfft, int inverse_fft, void *mem, size_t *lenmem) { - kiss_fft_cfg st=nullptr; - size_t memneeded = sizeof(struct kiss_fft_state) - + sizeof(FFT_DATA)*(nfft-1); /* twiddle factors */ + kiss_fft_cfg st = nullptr; + size_t memneeded = + sizeof(struct kiss_fft_state) + sizeof(FFT_DATA) * (nfft - 1); /* twiddle factors */ - if (lenmem==nullptr) { - st=(kiss_fft_cfg)KISS_FFT_MALLOC( memneeded ); - } else { - if (mem != nullptr && *lenmem >= memneeded) - st = (kiss_fft_cfg)mem; - *lenmem = memneeded; + if (lenmem == nullptr) { + st = (kiss_fft_cfg) KISS_FFT_MALLOC(memneeded); + } else { + if (mem != nullptr && *lenmem >= memneeded) st = (kiss_fft_cfg) mem; + *lenmem = memneeded; + } + + if (st) { + int i; + st->nfft = nfft; + st->inverse = inverse_fft; + + for (i = 0; i < nfft; ++i) { + const double phase = (st->inverse ? 2.0 * M_PI : -2.0 * M_PI) * i / nfft; + kf_cexp(st->twiddles + i, phase); } - if (st) { - int i; - st->nfft=nfft; - st->inverse = inverse_fft; - - for (i=0;iinverse ? 2.0*M_PI:-2.0*M_PI)*i / nfft; - kf_cexp(st->twiddles+i, phase ); - } - - kf_factor(nfft,st->factors); - } - return st; + kf_factor(nfft, st->factors); + } + return st; } static void kiss_fft_stride(kiss_fft_cfg st, const FFT_DATA *fin, FFT_DATA *fout, int in_stride) { - if (fin == fout) { - // NOTE: this is not really an in-place FFT algorithm. - // It just performs an out-of-place FFT into a temp buffer - FFT_DATA * tmpbuf = (FFT_DATA*)KISS_FFT_TMP_ALLOC( sizeof(FFT_DATA)*st->nfft); - kf_work(tmpbuf,fin,1,in_stride, st->factors,st); - memcpy(fout,tmpbuf,sizeof(FFT_DATA)*st->nfft); - KISS_FFT_TMP_FREE(tmpbuf); - }else{ - kf_work( fout, fin, 1,in_stride, st->factors,st ); - } + if (fin == fout) { + // NOTE: this is not really an in-place FFT algorithm. + // It just performs an out-of-place FFT into a temp buffer + FFT_DATA *tmpbuf = (FFT_DATA *) KISS_FFT_TMP_ALLOC(sizeof(FFT_DATA) * st->nfft); + kf_work(tmpbuf, fin, 1, in_stride, st->factors, st); + memcpy(fout, tmpbuf, sizeof(FFT_DATA) * st->nfft); + KISS_FFT_TMP_FREE(tmpbuf); + } else { + kf_work(fout, fin, 1, in_stride, st->factors, st); + } } static void kiss_fft(kiss_fft_cfg cfg, const FFT_DATA *fin, FFT_DATA *fout) { - kiss_fft_stride(cfg,fin,fout,1); + kiss_fft_stride(cfg, fin, fout, 1); } #endif diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index bbd4b01a68..87b919af17 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/msm.h b/src/KSPACE/msm.h index be28f19267..ac44dd2894 100644 --- a/src/KSPACE/msm.h +++ b/src/KSPACE/msm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(msm,MSM) - +// clang-format off +KSpaceStyle(msm,MSM); +// clang-format on #else #ifndef LMP_MSM_H @@ -35,30 +35,30 @@ class MSM : public KSpace { virtual double memory_usage(); protected: - int me,nprocs; + int me, nprocs; double precision; int nfactors; int *factors; double qqrd2e; double cutoff; double volume; - double *delxinv,*delyinv,*delzinv; - double h_x,h_y,h_z; + double *delxinv, *delyinv, *delzinv; + double h_x, h_y, h_z; double C_p; - int *nx_msm,*ny_msm,*nz_msm; - int *nxlo_in,*nylo_in,*nzlo_in; - int *nxhi_in,*nyhi_in,*nzhi_in; - int *nxlo_out,*nylo_out,*nzlo_out; - int *nxhi_out,*nyhi_out,*nzhi_out; - int *ngrid,*active_flag; - int *alpha,*betax,*betay,*betaz; - int nxlo_out_all,nylo_out_all,nzlo_out_all; - int nxhi_out_all,nyhi_out_all,nzhi_out_all; - int nxlo_direct,nxhi_direct,nylo_direct; - int nyhi_direct,nzlo_direct,nzhi_direct; + int *nx_msm, *ny_msm, *nz_msm; + int *nxlo_in, *nylo_in, *nzlo_in; + int *nxhi_in, *nyhi_in, *nzhi_in; + int *nxlo_out, *nylo_out, *nzlo_out; + int *nxhi_out, *nyhi_out, *nzhi_out; + int *ngrid, *active_flag; + int *alpha, *betax, *betay, *betaz; + int nxlo_out_all, nylo_out_all, nzlo_out_all; + int nxhi_out_all, nyhi_out_all, nzhi_out_all; + int nxlo_direct, nxhi_direct, nylo_direct; + int nyhi_direct, nzlo_direct, nzhi_direct; int nmax_direct; - int nlower,nupper; + int nlower, nupper; int peratom_allocate_flag; int levels; @@ -66,32 +66,32 @@ class MSM : public KSpace { double ****qgrid; double ****egrid; - double ****v0grid,****v1grid,****v2grid; - double ****v3grid,****v4grid,****v5grid; + double ****v0grid, ****v1grid, ****v2grid; + double ****v3grid, ****v4grid, ****v5grid; double **g_direct; - double **v0_direct,**v1_direct,**v2_direct; - double **v3_direct,**v4_direct,**v5_direct; + double **v0_direct, **v1_direct, **v2_direct; + double **v3_direct, **v4_direct, **v5_direct; double *g_direct_top; - double *v0_direct_top,*v1_direct_top,*v2_direct_top; - double *v3_direct_top,*v4_direct_top,*v5_direct_top; + double *v0_direct_top, *v1_direct_top, *v2_direct_top; + double *v3_direct_top, *v4_direct_top, *v5_direct_top; - double **phi1d,**dphi1d; + double **phi1d, **dphi1d; - int procgrid[3]; // procs assigned in each dim of 3d grid - int myloc[3]; // which proc I am in each dim - int ***procneigh_levels; // my 6 neighboring procs, 0/1 = left/right + int procgrid[3]; // procs assigned in each dim of 3d grid + int myloc[3]; // which proc I am in each dim + int ***procneigh_levels; // my 6 neighboring procs, 0/1 = left/right - class GridComm *gcall; // GridComm class for finest level grid - class GridComm **gc; // GridComm classes for each hierarchical level + class GridComm *gcall; // GridComm class for finest level grid + class GridComm **gc; // GridComm classes for each hierarchical level - double *gcall_buf1,*gcall_buf2; - double **gc_buf1,**gc_buf2; - int ngcall_buf1,ngcall_buf2,npergrid; - int *ngc_buf1,*ngc_buf2; + double *gcall_buf1, *gcall_buf2; + double **gc_buf1, **gc_buf2; + int ngcall_buf1, ngcall_buf2, npergrid; + int *ngc_buf1, *ngc_buf2; int current_level; - int **part2grid; // storage for particle -> grid mapping + int **part2grid; // storage for particle -> grid mapping int nmax; int triclinic; @@ -101,7 +101,7 @@ class MSM : public KSpace { void set_proc_grid(int); void set_grid_local(); void setup_grid(); - double estimate_1d_error(double,double); + double estimate_1d_error(double, double); double estimate_3d_error(); double estimate_total_error(); void allocate(); @@ -110,7 +110,7 @@ class MSM : public KSpace { void deallocate_peratom(); void allocate_levels(); void deallocate_levels(); - int factorable(int,int&,int&); + int factorable(int, int &, int &); void particle_map(); void make_rho(); virtual void direct(int); @@ -119,8 +119,8 @@ class MSM : public KSpace { void direct_peratom_top(int); void restriction(int); void prolongation(int); - void grid_swap_forward(int,double*** &); - void grid_swap_reverse(int,double*** &); + void grid_swap_forward(int, double ***&); + void grid_swap_reverse(int, double ***&); void fieldforce(); void fieldforce_peratom(); void compute_phis(const double &, const double &, const double &); @@ -140,7 +140,7 @@ class MSM : public KSpace { void unpack_reverse_grid(int, void *, int, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/msm_cg.cpp b/src/KSPACE/msm_cg.cpp index a786748a31..81a1418fc7 100644 --- a/src/KSPACE/msm_cg.cpp +++ b/src/KSPACE/msm_cg.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/msm_cg.h b/src/KSPACE/msm_cg.h index b6c1a46b5f..67a77ec622 100644 --- a/src/KSPACE/msm_cg.h +++ b/src/KSPACE/msm_cg.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(msm/cg,MSMCG) - +// clang-format off +KSpaceStyle(msm/cg,MSMCG); +// clang-format on #else #ifndef LMP_MSM_CG_H @@ -44,7 +44,7 @@ class MSMCG : public MSM { virtual void fieldforce_peratom(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_born_coul_long.cpp b/src/KSPACE/pair_born_coul_long.cpp index 990c456ef6..c602189c23 100644 --- a/src/KSPACE/pair_born_coul_long.cpp +++ b/src/KSPACE/pair_born_coul_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_born_coul_long.h b/src/KSPACE/pair_born_coul_long.h index 2f7e31112b..11dd84c202 100644 --- a/src/KSPACE/pair_born_coul_long.h +++ b/src/KSPACE/pair_born_coul_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/long,PairBornCoulLong) - +// clang-format off +PairStyle(born/coul/long,PairBornCoulLong); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_LONG_H @@ -44,17 +44,17 @@ class PairBornCoulLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **a,**rho,**sigma,**c,**d; - double **rhoinv,**born1,**born2,**born3,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **a, **rho, **sigma, **c, **d; + double **rhoinv, **born1, **born2, **born3, **offset; double *cut_respa; double g_ewald; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_born_coul_msm.cpp b/src/KSPACE/pair_born_coul_msm.cpp index a33e9d245b..df6342f627 100644 --- a/src/KSPACE/pair_born_coul_msm.cpp +++ b/src/KSPACE/pair_born_coul_msm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_born_coul_msm.h b/src/KSPACE/pair_born_coul_msm.h index 3435044dd2..c5a2255bcd 100644 --- a/src/KSPACE/pair_born_coul_msm.h +++ b/src/KSPACE/pair_born_coul_msm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/msm,PairBornCoulMSM) - +// clang-format off +PairStyle(born/coul/msm,PairBornCoulMSM); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_MSM_H @@ -31,13 +31,13 @@ class PairBornCoulMSM : public PairBornCoulLong { virtual void compute(int, int); virtual double single(int, int, int, int, double, double, double, double &); virtual void *extract(const char *, int &); + protected: int nmax; double **ftmp; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_buck_coul_long.cpp b/src/KSPACE/pair_buck_coul_long.cpp index 20202a8de2..7cdab7d84d 100644 --- a/src/KSPACE/pair_buck_coul_long.cpp +++ b/src/KSPACE/pair_buck_coul_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_buck_coul_long.h b/src/KSPACE/pair_buck_coul_long.h index 22726cc4e1..89a23558ae 100644 --- a/src/KSPACE/pair_buck_coul_long.h +++ b/src/KSPACE/pair_buck_coul_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/coul/long,PairBuckCoulLong) - +// clang-format off +PairStyle(buck/coul/long,PairBuckCoulLong); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_LONG_H @@ -44,10 +44,10 @@ class PairBuckCoulLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **a,**rho,**c; - double **rhoinv,**buck1,**buck2,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **a, **rho, **c; + double **rhoinv, **buck1, **buck2, **offset; double *cut_respa; double g_ewald; @@ -55,7 +55,7 @@ class PairBuckCoulLong : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_buck_coul_msm.cpp b/src/KSPACE/pair_buck_coul_msm.cpp index c4ee5ce6f6..f20ecb6285 100644 --- a/src/KSPACE/pair_buck_coul_msm.cpp +++ b/src/KSPACE/pair_buck_coul_msm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_buck_coul_msm.h b/src/KSPACE/pair_buck_coul_msm.h index e6147df108..ee52d2235b 100644 --- a/src/KSPACE/pair_buck_coul_msm.h +++ b/src/KSPACE/pair_buck_coul_msm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/coul/msm,PairBuckCoulMSM) - +// clang-format off +PairStyle(buck/coul/msm,PairBuckCoulMSM); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_MSM_H @@ -31,12 +31,13 @@ class PairBuckCoulMSM : public PairBuckCoulLong { virtual void compute(int, int); virtual double single(int, int, int, int, double, double, double, double &); virtual void *extract(const char *, int &); + protected: int nmax; double **ftmp; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index ca5a9ab3c2..eb70a1807a 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_buck_long_coul_long.h b/src/KSPACE/pair_buck_long_coul_long.h index 6f4128f379..1dab289c20 100644 --- a/src/KSPACE/pair_buck_long_coul_long.h +++ b/src/KSPACE/pair_buck_long_coul_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/long/coul/long,PairBuckLongCoulLong) - +// clang-format off +PairStyle(buck/long/coul/long,PairBuckLongCoulLong); +// clang-format on #else #ifndef LMP_PAIR_BUCK_LONG_COUL_LONG_H @@ -64,7 +64,7 @@ class PairBuckLongCoulLong : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_coul_long.cpp b/src/KSPACE/pair_coul_long.cpp index 93b18d6c5f..09c820160c 100644 --- a/src/KSPACE/pair_coul_long.cpp +++ b/src/KSPACE/pair_coul_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_coul_long.h b/src/KSPACE/pair_coul_long.h index 0864a45f29..e553c8cb56 100644 --- a/src/KSPACE/pair_coul_long.h +++ b/src/KSPACE/pair_coul_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/long,PairCoulLong) - +// clang-format off +PairStyle(coul/long,PairCoulLong); +// clang-format on #else #ifndef LMP_PAIR_COUL_LONG_H @@ -41,7 +41,7 @@ class PairCoulLong : public Pair { virtual void *extract(const char *, int &); protected: - double cut_coul,cut_coulsq,qdist; + double cut_coul, cut_coulsq, qdist; double *cut_respa; double g_ewald; double **scale; @@ -49,7 +49,7 @@ class PairCoulLong : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_coul_msm.cpp b/src/KSPACE/pair_coul_msm.cpp index 07a922e676..11c4579c6f 100644 --- a/src/KSPACE/pair_coul_msm.cpp +++ b/src/KSPACE/pair_coul_msm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_coul_msm.h b/src/KSPACE/pair_coul_msm.h index 575dd1ae14..d52830183a 100644 --- a/src/KSPACE/pair_coul_msm.h +++ b/src/KSPACE/pair_coul_msm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/msm,PairCoulMSM) - +// clang-format off +PairStyle(coul/msm,PairCoulMSM); +// clang-format on #else #ifndef LMP_PAIR_COUL_MSM_H @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class PairCoulMSM : public PairCoulLong { public: PairCoulMSM(class LAMMPS *); - virtual ~PairCoulMSM() {}; + virtual ~PairCoulMSM(){}; virtual void compute(int, int); virtual double single(int, int, int, int, double, double, double, double &); virtual void *extract(const char *, int &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp index a8a3736e2a..db1de908a3 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_lj_charmm_coul_long.h b/src/KSPACE/pair_lj_charmm_coul_long.h index b232c46546..6925a635bf 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.h +++ b/src/KSPACE/pair_lj_charmm_coul_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/long,PairLJCharmmCoulLong) - +// clang-format off +PairStyle(lj/charmm/coul/long,PairLJCharmmCoulLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_H @@ -49,25 +49,25 @@ class PairLJCharmmCoulLong : public Pair { protected: int implicit; - double cut_lj_inner,cut_lj; - double cut_lj_innersq,cut_ljsq; - double cut_coul,cut_coulsq; + double cut_lj_inner, cut_lj; + double cut_lj_innersq, cut_ljsq; + double cut_coul, cut_coulsq; double cut_bothsq; double cut_in_off, cut_in_on, cut_out_off, cut_out_on; double cut_in_diff, cut_out_diff; double cut_in_diff_inv, cut_out_diff_inv; double cut_in_off_sq, cut_in_on_sq, cut_out_off_sq, cut_out_on_sq; double denom_lj, denom_lj_inv; - double **epsilon,**sigma,**eps14,**sigma14; - double **lj1,**lj2,**lj3,**lj4,**offset; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; + double **epsilon, **sigma, **eps14, **sigma14; + double **lj1, **lj2, **lj3, **lj4, **offset; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; double *cut_respa; double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_charmm_coul_msm.cpp b/src/KSPACE/pair_lj_charmm_coul_msm.cpp index a342d0b780..c0e7878f62 100644 --- a/src/KSPACE/pair_lj_charmm_coul_msm.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_msm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_lj_charmm_coul_msm.h b/src/KSPACE/pair_lj_charmm_coul_msm.h index 711d22687b..90425c4daf 100644 --- a/src/KSPACE/pair_lj_charmm_coul_msm.h +++ b/src/KSPACE/pair_lj_charmm_coul_msm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/msm,PairLJCharmmCoulMSM) - +// clang-format off +PairStyle(lj/charmm/coul/msm,PairLJCharmmCoulMSM); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_MSM_H @@ -32,12 +32,13 @@ class PairLJCharmmCoulMSM : public PairLJCharmmCoulLong { virtual double single(int, int, int, int, double, double, double, double &); virtual void compute_outer(int, int); virtual void *extract(const char *, int &); + protected: int nmax; double **ftmp; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp index ea48f0676f..42fdb47338 100644 --- a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_lj_charmmfsw_coul_long.h b/src/KSPACE/pair_lj_charmmfsw_coul_long.h index d541372ce2..e254092c43 100644 --- a/src/KSPACE/pair_lj_charmmfsw_coul_long.h +++ b/src/KSPACE/pair_lj_charmmfsw_coul_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmmfsw/coul/long,PairLJCharmmfswCoulLong) - +// clang-format off +PairStyle(lj/charmmfsw/coul/long,PairLJCharmmfswCoulLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMMFSW_COUL_LONG_H @@ -51,23 +51,23 @@ class PairLJCharmmfswCoulLong : public Pair { int implicit; int dihedflag; - double cut_lj_inner,cut_lj,cut_ljinv,cut_lj_innerinv; - double cut_lj_innersq,cut_ljsq; - double cut_lj3inv,cut_lj_inner3inv,cut_lj3,cut_lj_inner3; - double cut_lj6inv,cut_lj_inner6inv,cut_lj6,cut_lj_inner6; - double cut_coul,cut_coulsq; + double cut_lj_inner, cut_lj, cut_ljinv, cut_lj_innerinv; + double cut_lj_innersq, cut_ljsq; + double cut_lj3inv, cut_lj_inner3inv, cut_lj3, cut_lj_inner3; + double cut_lj6inv, cut_lj_inner6inv, cut_lj6, cut_lj_inner6; + double cut_coul, cut_coulsq; double cut_bothsq; - double denom_lj,denom_lj12,denom_lj6; - double **epsilon,**sigma,**eps14,**sigma14; - double **lj1,**lj2,**lj3,**lj4,**offset; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; + double denom_lj, denom_lj12, denom_lj6; + double **epsilon, **sigma, **eps14, **sigma14; + double **lj1, **lj2, **lj3, **lj4, **offset; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; double *cut_respa; double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp index 5d04fd1cfb..b438e9e31e 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.cpp +++ b/src/KSPACE/pair_lj_cut_coul_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -60,6 +61,8 @@ PairLJCutCoulLong::PairLJCutCoulLong(LAMMPS *lmp) : Pair(lmp) PairLJCutCoulLong::~PairLJCutCoulLong() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); diff --git a/src/KSPACE/pair_lj_cut_coul_long.h b/src/KSPACE/pair_lj_cut_coul_long.h index 2154382811..23d8d26f93 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.h +++ b/src/KSPACE/pair_lj_cut_coul_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/long,PairLJCutCoulLong) - +// clang-format off +PairStyle(lj/cut/coul/long,PairLJCutCoulLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_LONG_H @@ -49,18 +49,18 @@ class PairLJCutCoulLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; - double qdist; // TIP4P distance from O site to negative charge + double qdist; // TIP4P distance from O site to negative charge double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_cut_coul_msm.cpp b/src/KSPACE/pair_lj_cut_coul_msm.cpp index 455ce7e4e5..8ed150f266 100644 --- a/src/KSPACE/pair_lj_cut_coul_msm.cpp +++ b/src/KSPACE/pair_lj_cut_coul_msm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_lj_cut_coul_msm.h b/src/KSPACE/pair_lj_cut_coul_msm.h index aabb5dd120..c84fc5688c 100644 --- a/src/KSPACE/pair_lj_cut_coul_msm.h +++ b/src/KSPACE/pair_lj_cut_coul_msm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/msm,PairLJCutCoulMSM) - +// clang-format off +PairStyle(lj/cut/coul/msm,PairLJCutCoulMSM); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_MSM_H @@ -32,12 +32,13 @@ class PairLJCutCoulMSM : public PairLJCutCoulLong { virtual double single(int, int, int, int, double, double, double, double &); virtual void compute_outer(int, int); virtual void *extract(const char *, int &); + protected: int nmax; double **ftmp; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_cut_tip4p_long.cpp b/src/KSPACE/pair_lj_cut_tip4p_long.cpp index 7ab2d5d5a1..d0e4b74309 100644 --- a/src/KSPACE/pair_lj_cut_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_cut_tip4p_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_lj_cut_tip4p_long.h b/src/KSPACE/pair_lj_cut_tip4p_long.h index e5667a9a1d..20066e71e2 100644 --- a/src/KSPACE/pair_lj_cut_tip4p_long.h +++ b/src/KSPACE/pair_lj_cut_tip4p_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/tip4p/long,PairLJCutTIP4PLong) - +// clang-format off +PairStyle(lj/cut/tip4p/long,PairLJCutTIP4PLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_TIP4P_LONG_H @@ -38,19 +38,19 @@ class PairLJCutTIP4PLong : public PairLJCutCoulLong { double memory_usage(); protected: - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index da3b3c19e0..01698bb43d 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_lj_long_coul_long.h b/src/KSPACE/pair_lj_long_coul_long.h index b3c780be37..926c098052 100644 --- a/src/KSPACE/pair_lj_long_coul_long.h +++ b/src/KSPACE/pair_lj_long_coul_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/long/coul/long,PairLJLongCoulLong) - +// clang-format off +PairStyle(lj/long/coul/long,PairLJLongCoulLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_LONG_COUL_LONG_H @@ -64,7 +64,7 @@ class PairLJLongCoulLong : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_long_tip4p_long.cpp b/src/KSPACE/pair_lj_long_tip4p_long.cpp index 568e6ca37c..cf947f2e19 100644 --- a/src/KSPACE/pair_lj_long_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_long_tip4p_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_lj_long_tip4p_long.h b/src/KSPACE/pair_lj_long_tip4p_long.h index 7499fcb8b9..15150a4e23 100644 --- a/src/KSPACE/pair_lj_long_tip4p_long.h +++ b/src/KSPACE/pair_lj_long_tip4p_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/long/tip4p/long,PairLJLongTIP4PLong) - +// clang-format off +PairStyle(lj/long/tip4p/long,PairLJLongTIP4PLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_LONG_TIP4P_LONG_H @@ -40,21 +40,20 @@ class PairLJLongTIP4PLong : public PairLJLongCoulLong { void *extract(const char *, int &); double memory_usage(); - protected: - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_tip4p_long.cpp b/src/KSPACE/pair_tip4p_long.cpp index 8d5a8a824a..16cf04dea1 100644 --- a/src/KSPACE/pair_tip4p_long.cpp +++ b/src/KSPACE/pair_tip4p_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pair_tip4p_long.h b/src/KSPACE/pair_tip4p_long.h index bc52cd9456..c4a2e0b623 100644 --- a/src/KSPACE/pair_tip4p_long.h +++ b/src/KSPACE/pair_tip4p_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tip4p/long,PairTIP4PLong) - +// clang-format off +PairStyle(tip4p/long,PairTIP4PLong); +// clang-format on #else #ifndef LMP_PAIR_TIP4P_LONG_H @@ -38,19 +38,19 @@ class PairTIP4PLong : public PairCoulLong { double memory_usage(); protected: - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index 3a96731be4..0415631a4c 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pppm.h b/src/KSPACE/pppm.h index af105f129d..4fa41fa311 100644 --- a/src/KSPACE/pppm.h +++ b/src/KSPACE/pppm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm,PPPM) - +// clang-format off +KSpaceStyle(pppm,PPPM); +// clang-format on #else #ifndef LMP_PPPM_H @@ -61,64 +61,64 @@ class PPPM : public KSpace { virtual void compute_group_group(int, int, int); protected: - int me,nprocs; + int me, nprocs; int nfactors; int *factors; double cutoff; double volume; - double delxinv,delyinv,delzinv,delvolinv; - double h_x,h_y,h_z; - double shift,shiftone; + double delxinv, delyinv, delzinv, delvolinv; + double h_x, h_y, h_z; + double shift, shiftone; int peratom_allocate_flag; - int nxlo_in,nylo_in,nzlo_in,nxhi_in,nyhi_in,nzhi_in; - int nxlo_out,nylo_out,nzlo_out,nxhi_out,nyhi_out,nzhi_out; - int nxlo_ghost,nxhi_ghost,nylo_ghost,nyhi_ghost,nzlo_ghost,nzhi_ghost; - int nxlo_fft,nylo_fft,nzlo_fft,nxhi_fft,nyhi_fft,nzhi_fft; - int nlower,nupper; - int ngrid,nfft,nfft_both; + int nxlo_in, nylo_in, nzlo_in, nxhi_in, nyhi_in, nzhi_in; + int nxlo_out, nylo_out, nzlo_out, nxhi_out, nyhi_out, nzhi_out; + int nxlo_ghost, nxhi_ghost, nylo_ghost, nyhi_ghost, nzlo_ghost, nzhi_ghost; + int nxlo_fft, nylo_fft, nzlo_fft, nxhi_fft, nyhi_fft, nzhi_fft; + int nlower, nupper; + int ngrid, nfft, nfft_both; FFT_SCALAR ***density_brick; - FFT_SCALAR ***vdx_brick,***vdy_brick,***vdz_brick; + FFT_SCALAR ***vdx_brick, ***vdy_brick, ***vdz_brick; FFT_SCALAR ***u_brick; - FFT_SCALAR ***v0_brick,***v1_brick,***v2_brick; - FFT_SCALAR ***v3_brick,***v4_brick,***v5_brick; + FFT_SCALAR ***v0_brick, ***v1_brick, ***v2_brick; + FFT_SCALAR ***v3_brick, ***v4_brick, ***v5_brick; double *greensfn; double **vg; - double *fkx,*fky,*fkz; + double *fkx, *fky, *fkz; FFT_SCALAR *density_fft; - FFT_SCALAR *work1,*work2; + FFT_SCALAR *work1, *work2; double *gf_b; - FFT_SCALAR **rho1d,**rho_coeff,**drho1d,**drho_coeff; + FFT_SCALAR **rho1d, **rho_coeff, **drho1d, **drho_coeff; double *sf_precoeff1, *sf_precoeff2, *sf_precoeff3; double *sf_precoeff4, *sf_precoeff5, *sf_precoeff6; - double sf_coeff[6]; // coefficients for calculating ad self-forces + double sf_coeff[6]; // coefficients for calculating ad self-forces double **acons; // FFTs and grid communication - class FFT3d *fft1,*fft2; + class FFT3d *fft1, *fft2; class Remap *remap; class GridComm *gc; - FFT_SCALAR *gc_buf1,*gc_buf2; - int ngc_buf1,ngc_buf2,npergrid; + FFT_SCALAR *gc_buf1, *gc_buf2; + int ngc_buf1, ngc_buf2, npergrid; // group-group interactions int group_allocate_flag; - FFT_SCALAR ***density_A_brick,***density_B_brick; - FFT_SCALAR *density_A_fft,*density_B_fft; + FFT_SCALAR ***density_A_brick, ***density_B_brick; + FFT_SCALAR *density_A_fft, *density_B_fft; - int **part2grid; // storage for particle -> grid mapping + int **part2grid; // storage for particle -> grid mapping int nmax; double *boxlo; - // TIP4P settings - int typeH,typeO; // atom types of TIP4P water H and O atoms - double qdist; // distance from O site to negative charge - double alpha; // geometric factor + // TIP4P settings + int typeH, typeO; // atom types of TIP4P water H and O atoms + double qdist; // distance from O site to negative charge + double alpha; // geometric factor virtual void set_grid_global(); void set_grid_local(); @@ -154,11 +154,9 @@ class PPPM : public KSpace { virtual void poisson_peratom(); virtual void fieldforce_peratom(); - void procs2grid2d(int,int,int,int *, int*); - void compute_rho1d(const FFT_SCALAR &, const FFT_SCALAR &, - const FFT_SCALAR &); - void compute_drho1d(const FFT_SCALAR &, const FFT_SCALAR &, - const FFT_SCALAR &); + void procs2grid2d(int, int, int, int *, int *); + void compute_rho1d(const FFT_SCALAR &, const FFT_SCALAR &, const FFT_SCALAR &); + void compute_drho1d(const FFT_SCALAR &, const FFT_SCALAR &, const FFT_SCALAR &); void compute_rho_coeff(); virtual void slabcorr(); @@ -171,7 +169,7 @@ class PPPM : public KSpace { // triclinic - int triclinic; // domain settings, orthog or triclinic + int triclinic; // domain settings, orthog or triclinic void setup_triclinic(); void compute_gf_ik_triclinic(); void poisson_ik_triclinic(); @@ -183,9 +181,9 @@ class PPPM : public KSpace { virtual void deallocate_groups(); virtual void make_rho_groups(int, int, int); virtual void poisson_groups(int); - virtual void slabcorr_groups(int,int,int); + virtual void slabcorr_groups(int, int, int); -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- denominator for Hockney-Eastwood Green's function of x,y,z = sin(kx*deltax/2), etc @@ -197,21 +195,21 @@ class PPPM : public KSpace { gf_b = denominator expansion coeffs ------------------------------------------------------------------------- */ - inline double gf_denom(const double &x, const double &y, - const double &z) const { - double sx,sy,sz; + inline double gf_denom(const double &x, const double &y, const double &z) const + { + double sx, sy, sz; sz = sy = sx = 0.0; - for (int l = order-1; l >= 0; l--) { - sx = gf_b[l] + sx*x; - sy = gf_b[l] + sy*y; - sz = gf_b[l] + sz*z; + for (int l = order - 1; l >= 0; l--) { + sx = gf_b[l] + sx * x; + sy = gf_b[l] + sy * y; + sz = gf_b[l] + sz * z; } - double s = sx*sy*sz; - return s*s; + double s = sx * sy * sz; + return s * s; }; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_cg.cpp b/src/KSPACE/pppm_cg.cpp index b31919f767..825547e573 100644 --- a/src/KSPACE/pppm_cg.cpp +++ b/src/KSPACE/pppm_cg.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pppm_cg.h b/src/KSPACE/pppm_cg.h index 6c7425b893..83c75b5f53 100644 --- a/src/KSPACE/pppm_cg.h +++ b/src/KSPACE/pppm_cg.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/cg,PPPMCG) - +// clang-format off +KSpaceStyle(pppm/cg,PPPMCG); +// clang-format on #else #ifndef LMP_PPPM_CG_H @@ -46,7 +46,7 @@ class PPPMCG : public PPPM { virtual void make_rho_groups(int, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_dipole.cpp b/src/KSPACE/pppm_dipole.cpp index 8078c24f90..a730d8214b 100644 --- a/src/KSPACE/pppm_dipole.cpp +++ b/src/KSPACE/pppm_dipole.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pppm_dipole.h b/src/KSPACE/pppm_dipole.h index 93326262fe..7ae2e9a7ef 100644 --- a/src/KSPACE/pppm_dipole.h +++ b/src/KSPACE/pppm_dipole.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/dipole,PPPMDipole) - +// clang-format off +KSpaceStyle(pppm/dipole,PPPMDipole); +// clang-format on #else #ifndef LMP_PPPM_DIPOLE_H @@ -57,23 +57,23 @@ class PPPMDipole : public PPPM { // dipole - FFT_SCALAR ***densityx_brick_dipole,***densityy_brick_dipole,***densityz_brick_dipole; - FFT_SCALAR ***vdxx_brick_dipole,***vdyy_brick_dipole,***vdzz_brick_dipole; - FFT_SCALAR ***vdxy_brick_dipole,***vdxz_brick_dipole,***vdyz_brick_dipole; - FFT_SCALAR ***ux_brick_dipole,***uy_brick_dipole,***uz_brick_dipole; - FFT_SCALAR ***v0x_brick_dipole,***v1x_brick_dipole,***v2x_brick_dipole; - FFT_SCALAR ***v3x_brick_dipole,***v4x_brick_dipole,***v5x_brick_dipole; - FFT_SCALAR ***v0y_brick_dipole,***v1y_brick_dipole,***v2y_brick_dipole; - FFT_SCALAR ***v3y_brick_dipole,***v4y_brick_dipole,***v5y_brick_dipole; - FFT_SCALAR ***v0z_brick_dipole,***v1z_brick_dipole,***v2z_brick_dipole; - FFT_SCALAR ***v3z_brick_dipole,***v4z_brick_dipole,***v5z_brick_dipole; - FFT_SCALAR *work3,*work4; - FFT_SCALAR *densityx_fft_dipole,*densityy_fft_dipole,*densityz_fft_dipole; + FFT_SCALAR ***densityx_brick_dipole, ***densityy_brick_dipole, ***densityz_brick_dipole; + FFT_SCALAR ***vdxx_brick_dipole, ***vdyy_brick_dipole, ***vdzz_brick_dipole; + FFT_SCALAR ***vdxy_brick_dipole, ***vdxz_brick_dipole, ***vdyz_brick_dipole; + FFT_SCALAR ***ux_brick_dipole, ***uy_brick_dipole, ***uz_brick_dipole; + FFT_SCALAR ***v0x_brick_dipole, ***v1x_brick_dipole, ***v2x_brick_dipole; + FFT_SCALAR ***v3x_brick_dipole, ***v4x_brick_dipole, ***v5x_brick_dipole; + FFT_SCALAR ***v0y_brick_dipole, ***v1y_brick_dipole, ***v2y_brick_dipole; + FFT_SCALAR ***v3y_brick_dipole, ***v4y_brick_dipole, ***v5y_brick_dipole; + FFT_SCALAR ***v0z_brick_dipole, ***v1z_brick_dipole, ***v2z_brick_dipole; + FFT_SCALAR ***v3z_brick_dipole, ***v4z_brick_dipole, ***v5z_brick_dipole; + FFT_SCALAR *work3, *work4; + FFT_SCALAR *densityx_fft_dipole, *densityy_fft_dipole, *densityz_fft_dipole; class GridComm *gc_dipole; int only_dipole_flag; - double musum,musqsum,mu2; + double musum, musqsum, mu2; double find_gewald_dipole(double, double, bigint, double, double); double newton_raphson_f_dipole(double, double, bigint, double, double); @@ -91,7 +91,7 @@ class PPPMDipole : public PPPM { void musum_musq(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_dipole_spin.cpp b/src/KSPACE/pppm_dipole_spin.cpp index daaacc6bd4..bff33bc3eb 100644 --- a/src/KSPACE/pppm_dipole_spin.cpp +++ b/src/KSPACE/pppm_dipole_spin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pppm_dipole_spin.h b/src/KSPACE/pppm_dipole_spin.h index 2998278863..eea43db15d 100644 --- a/src/KSPACE/pppm_dipole_spin.h +++ b/src/KSPACE/pppm_dipole_spin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/dipole/spin,PPPMDipoleSpin) - +// clang-format off +KSpaceStyle(pppm/dipole/spin,PPPMDipoleSpin); +// clang-format on #else #ifndef LMP_PPPM_DIPOLE_SPIN_H @@ -32,11 +32,11 @@ class PPPMDipoleSpin : public PPPMDipole { void compute(int, int); protected: - double hbar; // reduced Planck's constant - double mub; // Bohr's magneton - double mu_0; // vacuum permeability - double mub2mu0; // prefactor for mech force - double mub2mu0hbinv; // prefactor for mag force + double hbar; // reduced Planck's constant + double mub; // Bohr's magneton + double mu_0; // vacuum permeability + double mub2mu0; // prefactor for mech force + double mub2mu0hbinv; // prefactor for mag force void slabcorr(); @@ -48,7 +48,7 @@ class PPPMDipoleSpin : public PPPMDipole { void spsum_spsq(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index a912cf9a45..f7c97b1f87 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pppm_disp.h b/src/KSPACE/pppm_disp.h index 3c952cb54d..985ca5e0b2 100644 --- a/src/KSPACE/pppm_disp.h +++ b/src/KSPACE/pppm_disp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/disp,PPPMDisp) - +// clang-format off +KSpaceStyle(pppm/disp,PPPMDisp); +// clang-format on #else #ifndef LMP_PPPM_DISP_H @@ -42,8 +42,8 @@ typedef double FFT_SCALAR; namespace LAMMPS_NS { -#define EWALD_MAXORDER 6 -#define EWALD_FUNCS 4 +#define EWALD_MAXORDER 6 +#define EWALD_FUNCS 4 class PPPMDisp : public KSpace { public: @@ -59,12 +59,12 @@ class PPPMDisp : public KSpace { virtual double memory_usage(); protected: - int me,nprocs; + int me, nprocs; int nfactors; int *factors; double csumij; double csum; - double *csumi; //needed as correction term for per atom calculations! + double *csumi; //needed as correction term for per atom calculations! double *cii; int csumflag; double cutoff, cutoff_lj; @@ -78,84 +78,93 @@ class PPPMDisp : public KSpace { int nsplit_alloc; int function[EWALD_FUNCS]; - double delxinv,delyinv,delzinv,delvolinv; - double delxinv_6,delyinv_6,delzinv_6,delvolinv_6; + double delxinv, delyinv, delzinv, delvolinv; + double delxinv_6, delyinv_6, delzinv_6, delvolinv_6; - double shift,shiftone; - int nxlo_in,nylo_in,nzlo_in,nxhi_in,nyhi_in,nzhi_in; - int nxlo_out,nylo_out,nzlo_out,nxhi_out,nyhi_out,nzhi_out; - int nxlo_fft,nylo_fft,nzlo_fft,nxhi_fft,nyhi_fft,nzhi_fft; - int nlower,nupper; - int ngrid,nfft,nfft_both; + double shift, shiftone; + int nxlo_in, nylo_in, nzlo_in, nxhi_in, nyhi_in, nzhi_in; + int nxlo_out, nylo_out, nzlo_out, nxhi_out, nyhi_out, nzhi_out; + int nxlo_fft, nylo_fft, nzlo_fft, nxhi_fft, nyhi_fft, nzhi_fft; + int nlower, nupper; + int ngrid, nfft, nfft_both; - double shift_6,shiftone_6; - int nxlo_in_6,nylo_in_6,nzlo_in_6,nxhi_in_6,nyhi_in_6,nzhi_in_6; - int nxlo_out_6,nylo_out_6,nzlo_out_6,nxhi_out_6,nyhi_out_6,nzhi_out_6; - int nxlo_fft_6,nylo_fft_6,nzlo_fft_6,nxhi_fft_6,nyhi_fft_6,nzhi_fft_6; - int nlower_6,nupper_6; - int ngrid_6,nfft_6,nfft_both_6; + double shift_6, shiftone_6; + int nxlo_in_6, nylo_in_6, nzlo_in_6, nxhi_in_6, nyhi_in_6, nzhi_in_6; + int nxlo_out_6, nylo_out_6, nzlo_out_6, nxhi_out_6, nyhi_out_6, nzhi_out_6; + int nxlo_fft_6, nylo_fft_6, nzlo_fft_6, nxhi_fft_6, nyhi_fft_6, nzhi_fft_6; + int nlower_6, nupper_6; + int ngrid_6, nfft_6, nfft_both_6; // the following variables are needed for every structure factor FFT_SCALAR ***density_brick; - FFT_SCALAR ***vdx_brick,***vdy_brick,***vdz_brick; + FFT_SCALAR ***vdx_brick, ***vdy_brick, ***vdz_brick; FFT_SCALAR *density_fft; FFT_SCALAR ***u_brick; - FFT_SCALAR ***v0_brick,***v1_brick,***v2_brick,***v3_brick,***v4_brick,***v5_brick; + FFT_SCALAR ***v0_brick, ***v1_brick, ***v2_brick, ***v3_brick, ***v4_brick, ***v5_brick; FFT_SCALAR ***density_brick_g; - FFT_SCALAR ***vdx_brick_g,***vdy_brick_g,***vdz_brick_g; + FFT_SCALAR ***vdx_brick_g, ***vdy_brick_g, ***vdz_brick_g; FFT_SCALAR *density_fft_g; FFT_SCALAR ***u_brick_g; - FFT_SCALAR ***v0_brick_g,***v1_brick_g,***v2_brick_g,***v3_brick_g,***v4_brick_g,***v5_brick_g; + FFT_SCALAR ***v0_brick_g, ***v1_brick_g, ***v2_brick_g, ***v3_brick_g, ***v4_brick_g, + ***v5_brick_g; FFT_SCALAR ***density_brick_a0; - FFT_SCALAR ***vdx_brick_a0,***vdy_brick_a0,***vdz_brick_a0; + FFT_SCALAR ***vdx_brick_a0, ***vdy_brick_a0, ***vdz_brick_a0; FFT_SCALAR *density_fft_a0; FFT_SCALAR ***u_brick_a0; - FFT_SCALAR ***v0_brick_a0,***v1_brick_a0,***v2_brick_a0,***v3_brick_a0,***v4_brick_a0,***v5_brick_a0; + FFT_SCALAR ***v0_brick_a0, ***v1_brick_a0, ***v2_brick_a0, ***v3_brick_a0, ***v4_brick_a0, + ***v5_brick_a0; FFT_SCALAR ***density_brick_a1; - FFT_SCALAR ***vdx_brick_a1,***vdy_brick_a1,***vdz_brick_a1; + FFT_SCALAR ***vdx_brick_a1, ***vdy_brick_a1, ***vdz_brick_a1; FFT_SCALAR *density_fft_a1; FFT_SCALAR ***u_brick_a1; - FFT_SCALAR ***v0_brick_a1,***v1_brick_a1,***v2_brick_a1,***v3_brick_a1,***v4_brick_a1,***v5_brick_a1; + FFT_SCALAR ***v0_brick_a1, ***v1_brick_a1, ***v2_brick_a1, ***v3_brick_a1, ***v4_brick_a1, + ***v5_brick_a1; FFT_SCALAR ***density_brick_a2; - FFT_SCALAR ***vdx_brick_a2,***vdy_brick_a2,***vdz_brick_a2; + FFT_SCALAR ***vdx_brick_a2, ***vdy_brick_a2, ***vdz_brick_a2; FFT_SCALAR *density_fft_a2; FFT_SCALAR ***u_brick_a2; - FFT_SCALAR ***v0_brick_a2,***v1_brick_a2,***v2_brick_a2,***v3_brick_a2,***v4_brick_a2,***v5_brick_a2; + FFT_SCALAR ***v0_brick_a2, ***v1_brick_a2, ***v2_brick_a2, ***v3_brick_a2, ***v4_brick_a2, + ***v5_brick_a2; FFT_SCALAR ***density_brick_a3; - FFT_SCALAR ***vdx_brick_a3,***vdy_brick_a3,***vdz_brick_a3; + FFT_SCALAR ***vdx_brick_a3, ***vdy_brick_a3, ***vdz_brick_a3; FFT_SCALAR *density_fft_a3; FFT_SCALAR ***u_brick_a3; - FFT_SCALAR ***v0_brick_a3,***v1_brick_a3,***v2_brick_a3,***v3_brick_a3,***v4_brick_a3,***v5_brick_a3; + FFT_SCALAR ***v0_brick_a3, ***v1_brick_a3, ***v2_brick_a3, ***v3_brick_a3, ***v4_brick_a3, + ***v5_brick_a3; FFT_SCALAR ***density_brick_a4; - FFT_SCALAR ***vdx_brick_a4,***vdy_brick_a4,***vdz_brick_a4; + FFT_SCALAR ***vdx_brick_a4, ***vdy_brick_a4, ***vdz_brick_a4; FFT_SCALAR *density_fft_a4; FFT_SCALAR ***u_brick_a4; - FFT_SCALAR ***v0_brick_a4,***v1_brick_a4,***v2_brick_a4,***v3_brick_a4,***v4_brick_a4,***v5_brick_a4; + FFT_SCALAR ***v0_brick_a4, ***v1_brick_a4, ***v2_brick_a4, ***v3_brick_a4, ***v4_brick_a4, + ***v5_brick_a4; FFT_SCALAR ***density_brick_a5; - FFT_SCALAR ***vdx_brick_a5,***vdy_brick_a5,***vdz_brick_a5; + FFT_SCALAR ***vdx_brick_a5, ***vdy_brick_a5, ***vdz_brick_a5; FFT_SCALAR *density_fft_a5; FFT_SCALAR ***u_brick_a5; - FFT_SCALAR ***v0_brick_a5,***v1_brick_a5,***v2_brick_a5,***v3_brick_a5,***v4_brick_a5,***v5_brick_a5; + FFT_SCALAR ***v0_brick_a5, ***v1_brick_a5, ***v2_brick_a5, ***v3_brick_a5, ***v4_brick_a5, + ***v5_brick_a5; FFT_SCALAR ***density_brick_a6; - FFT_SCALAR ***vdx_brick_a6,***vdy_brick_a6,***vdz_brick_a6; + FFT_SCALAR ***vdx_brick_a6, ***vdy_brick_a6, ***vdz_brick_a6; FFT_SCALAR *density_fft_a6; FFT_SCALAR ***u_brick_a6; - FFT_SCALAR ***v0_brick_a6,***v1_brick_a6,***v2_brick_a6,***v3_brick_a6,***v4_brick_a6,***v5_brick_a6; + FFT_SCALAR ***v0_brick_a6, ***v1_brick_a6, ***v2_brick_a6, ***v3_brick_a6, ***v4_brick_a6, + ***v5_brick_a6; FFT_SCALAR ****density_brick_none; - FFT_SCALAR ****vdx_brick_none,****vdy_brick_none,****vdz_brick_none; + FFT_SCALAR ****vdx_brick_none, ****vdy_brick_none, ****vdz_brick_none; FFT_SCALAR **density_fft_none; FFT_SCALAR ****u_brick_none; - FFT_SCALAR ****v0_brick_none,****v1_brick_none,****v2_brick_none,****v3_brick_none,****v4_brick_none,****v5_brick_none; + FFT_SCALAR ****v0_brick_none, ****v1_brick_none, ****v2_brick_none, ****v3_brick_none, + ****v4_brick_none, ****v5_brick_none; //// needed for each interaction type double *greensfn; @@ -166,61 +175,56 @@ class PPPMDisp : public KSpace { double **vg_6; double **vg2_6; - double *fkx,*fky,*fkz; + double *fkx, *fky, *fkz; double *fkx2, *fky2, *fkz2; double *fkx_6, *fky_6, *fkz_6; double *fkx2_6, *fky2_6, *fkz2_6; double *gf_b; double *gf_b_6; - double *sf_precoeff1, *sf_precoeff2, *sf_precoeff3, *sf_precoeff4, - *sf_precoeff5, *sf_precoeff6; - double *sf_precoeff1_6, *sf_precoeff2_6, *sf_precoeff3_6, - *sf_precoeff4_6, *sf_precoeff5_6, *sf_precoeff6_6; - FFT_SCALAR **rho1d,**rho_coeff; + double *sf_precoeff1, *sf_precoeff2, *sf_precoeff3, *sf_precoeff4, *sf_precoeff5, *sf_precoeff6; + double *sf_precoeff1_6, *sf_precoeff2_6, *sf_precoeff3_6, *sf_precoeff4_6, *sf_precoeff5_6, + *sf_precoeff6_6; + FFT_SCALAR **rho1d, **rho_coeff; FFT_SCALAR **drho1d, **drho_coeff; FFT_SCALAR **rho1d_6, **rho_coeff_6; FFT_SCALAR **drho1d_6, **drho_coeff_6; - FFT_SCALAR *work1,*work2; + FFT_SCALAR *work1, *work2; FFT_SCALAR *work1_6, *work2_6; - class FFT3d *fft1,*fft2 ; - class FFT3d *fft1_6,*fft2_6; - class Remap *remap,*remap_6; - class GridComm *gc,*gc6; + class FFT3d *fft1, *fft2; + class FFT3d *fft1_6, *fft2_6; + class Remap *remap, *remap_6; + class GridComm *gc, *gc6; - FFT_SCALAR *gc_buf1,*gc_buf2,*gc6_buf1,*gc6_buf2; - int ngc_buf1,ngc_buf2,npergrid; - int ngc6_buf1,ngc6_buf2,npergrid6; + FFT_SCALAR *gc_buf1, *gc_buf2, *gc6_buf1, *gc6_buf2; + int ngc_buf1, ngc_buf2, npergrid; + int ngc6_buf1, ngc6_buf2, npergrid6; - int **part2grid; // storage for particle -> grid mapping + int **part2grid; // storage for particle -> grid mapping int **part2grid_6; int nmax; - int triclinic; // domain settings, orthog or triclinic + int triclinic; // domain settings, orthog or triclinic double *boxlo; - // TIP4P settings - int typeH,typeO; // atom types of TIP4P water H and O atoms - double qdist; // distance from O site to negative charge - double alpha; // geometric factor + // TIP4P settings + int typeH, typeO; // atom types of TIP4P water H and O atoms + double qdist; // distance from O site to negative charge + double alpha; // geometric factor void init_coeffs(); - int qr_alg(double**, double**, int); - void hessenberg(double**, double**, int); - void qr_tri(double**, double**, int); - void mmult(double**, double**, double**, int); - int check_convergence(double**, double**, double**, - double**, double**, double**, int); + int qr_alg(double **, double **, int); + void hessenberg(double **, double **, int); + void qr_tri(double **, double **, int); + void mmult(double **, double **, double **, int); + int check_convergence(double **, double **, double **, double **, double **, double **, int); void set_grid(); void set_grid_6(); void set_init_g6(); - void set_fft_parameters(int&, int&, int&, int&, int&,int&, - int&, int&,int&, int&, int&,int&, - int&, int&,int&, int&, int&,int&, - int&, int&,int&, int&, int&, - int&, int&, int&, - double&, double&, int&); + void set_fft_parameters(int &, int &, int &, int &, int &, int &, int &, int &, int &, int &, + int &, int &, int &, int &, int &, int &, int &, int &, int &, int &, + int &, int &, int &, int &, int &, int &, double &, double &, int &); void set_n_pppm_6(); void adjust_gewald(); void adjust_gewald_6(); @@ -229,7 +233,7 @@ class PPPMDisp : public KSpace { double f_6(); double derivf_6(); double final_accuracy(); - void final_accuracy_6(double&, double&, double&); + void final_accuracy_6(double &, double &, double &); double lj_rspace_error(); double compute_qopt(); double compute_qopt_6(); @@ -247,104 +251,73 @@ class PPPMDisp : public KSpace { int factorable(int); double rms(double, double, bigint, double, double **); double diffpr(double, double, double, double, double **); - void compute_gf_denom(double*, int); - double gf_denom(double, double, double, double*, int); + void compute_gf_denom(double *, int); + double gf_denom(double, double, double, double *, int); - void compute_sf_precoeff(int, int, int, int, - int, int, int, - int, int, int, - double*, double*, double*, - double*, double*, double*); + void compute_sf_precoeff(int, int, int, int, int, int, int, int, int, int, double *, double *, + double *, double *, double *, double *); void compute_gf(); void compute_sf_coeff(); void compute_gf_6(); void compute_sf_coeff_6(); - virtual void particle_map(double, double, double, - double, int **, int, int, - int, int, int, - int, int, int); - virtual void particle_map_c(double, double, double, - double, int **, int, int, - int, int, int, - int, int, int ); + virtual void particle_map(double, double, double, double, int **, int, int, int, int, int, int, + int, int); + virtual void particle_map_c(double, double, double, double, int **, int, int, int, int, int, int, + int, int); virtual void make_rho_c(); virtual void make_rho_g(); virtual void make_rho_a(); virtual void make_rho_none(); - virtual void brick2fft(int, int, int, int, int, int, - FFT_SCALAR ***, FFT_SCALAR *, FFT_SCALAR *, + virtual void brick2fft(int, int, int, int, int, int, FFT_SCALAR ***, FFT_SCALAR *, FFT_SCALAR *, LAMMPS_NS::Remap *); virtual void brick2fft_a(); virtual void brick2fft_none(); - virtual void poisson_ik(FFT_SCALAR *, FFT_SCALAR *, - FFT_SCALAR *, LAMMPS_NS::FFT3d *,LAMMPS_NS::FFT3d *, - int, int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, double&, double *, - double *, double *, double *, - double *, double *, double *, - FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, double *, double **, double **, - FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, + virtual void poisson_ik(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR *, LAMMPS_NS::FFT3d *, + LAMMPS_NS::FFT3d *, int, int, int, int, int, int, int, int, int, int, int, + int, int, int, int, int, double &, double *, double *, double *, double *, + double *, double *, double *, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, double *, double **, double **, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***); + + virtual void poisson_ad(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR *, LAMMPS_NS::FFT3d *, + LAMMPS_NS::FFT3d *, int, int, int, int, int, int, int, int, int, int, int, + int, int, int, int, int, double &, double *, double *, double **, + double **, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); - virtual void poisson_ad(FFT_SCALAR*, FFT_SCALAR*, - FFT_SCALAR*, LAMMPS_NS::FFT3d*,LAMMPS_NS::FFT3d*, - int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int, - double&, double*, - double*, double**, double**, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***); + virtual void poisson_peratom(FFT_SCALAR *, FFT_SCALAR *, LAMMPS_NS::FFT3d *, double **, double **, + int, int, int, int, int, int, int, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); + virtual void poisson_2s_ik(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***); + virtual void poisson_2s_ad(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); - virtual void poisson_peratom(FFT_SCALAR*, FFT_SCALAR*, LAMMPS_NS::FFT3d*, - double**, double**, int, - int, int, int, int, int, int, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***); - virtual void poisson_2s_ik(FFT_SCALAR *, FFT_SCALAR *, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); - virtual void poisson_2s_ad(FFT_SCALAR *, FFT_SCALAR *, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); + virtual void poisson_2s_peratom(FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); - virtual void poisson_2s_peratom(FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***); - - virtual void poisson_none_ad(int, int, FFT_SCALAR *, FFT_SCALAR *, - FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, + virtual void poisson_none_ad(int, int, FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, + FFT_SCALAR ****, FFT_SCALAR ****); + virtual void poisson_none_ik(int, int, FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****); - virtual void poisson_none_ik(int, int, FFT_SCALAR *, FFT_SCALAR *, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, - FFT_SCALAR ****, - FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****); - virtual void poisson_none_peratom(int, int, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***); - + virtual void poisson_none_peratom(int, int, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***); virtual void fieldforce_c_ik(); virtual void fieldforce_c_ad(); @@ -358,12 +331,12 @@ class PPPMDisp : public KSpace { virtual void fieldforce_none_ik(); virtual void fieldforce_none_ad(); virtual void fieldforce_none_peratom(); - void procs2grid2d(int,int,int,int *, int*); - void compute_rho1d(const FFT_SCALAR &, const FFT_SCALAR &, - const FFT_SCALAR &, int, FFT_SCALAR **, FFT_SCALAR **); - void compute_drho1d(const FFT_SCALAR &, const FFT_SCALAR &, - const FFT_SCALAR &, int, FFT_SCALAR **, FFT_SCALAR **); - void compute_rho_coeff(FFT_SCALAR **,FFT_SCALAR **, int); + void procs2grid2d(int, int, int, int *, int *); + void compute_rho1d(const FFT_SCALAR &, const FFT_SCALAR &, const FFT_SCALAR &, int, FFT_SCALAR **, + FFT_SCALAR **); + void compute_drho1d(const FFT_SCALAR &, const FFT_SCALAR &, const FFT_SCALAR &, int, + FFT_SCALAR **, FFT_SCALAR **); + void compute_rho_coeff(FFT_SCALAR **, FFT_SCALAR **, int); void slabcorr(int); // grid communication @@ -374,7 +347,7 @@ class PPPMDisp : public KSpace { void unpack_reverse_grid(int, void *, int, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_disp_tip4p.cpp b/src/KSPACE/pppm_disp_tip4p.cpp index 5e5362a298..902b512bc3 100644 --- a/src/KSPACE/pppm_disp_tip4p.cpp +++ b/src/KSPACE/pppm_disp_tip4p.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pppm_disp_tip4p.h b/src/KSPACE/pppm_disp_tip4p.h index 1f6a92a4bf..a8bb90ca54 100644 --- a/src/KSPACE/pppm_disp_tip4p.h +++ b/src/KSPACE/pppm_disp_tip4p.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/disp/tip4p,PPPMDispTIP4P) - +// clang-format off +KSpaceStyle(pppm/disp/tip4p,PPPMDispTIP4P); +// clang-format on #else #ifndef LMP_PPPM_DISP_TIP4P_H @@ -27,13 +27,12 @@ namespace LAMMPS_NS { class PPPMDispTIP4P : public PPPMDisp { public: PPPMDispTIP4P(class LAMMPS *); - virtual ~PPPMDispTIP4P () {}; + virtual ~PPPMDispTIP4P(){}; void init(); protected: - virtual void particle_map_c(double, double, double, - double, int **, int, int, - int, int, int, int, int, int); + virtual void particle_map_c(double, double, double, double, int **, int, int, int, int, int, int, + int, int); virtual void make_rho_c(); virtual void fieldforce_c_ik(); virtual void fieldforce_c_ad(); @@ -43,7 +42,7 @@ class PPPMDispTIP4P : public PPPMDisp { void find_M(int, int &, int &, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_stagger.cpp b/src/KSPACE/pppm_stagger.cpp index 3927acdaa0..49cefac12e 100644 --- a/src/KSPACE/pppm_stagger.cpp +++ b/src/KSPACE/pppm_stagger.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pppm_stagger.h b/src/KSPACE/pppm_stagger.h index 02f182fa68..2467b1a161 100644 --- a/src/KSPACE/pppm_stagger.h +++ b/src/KSPACE/pppm_stagger.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/stagger,PPPMStagger) - +// clang-format off +KSpaceStyle(pppm/stagger,PPPMStagger); +// clang-format on #else #ifndef LMP_PPPM_STAGGER_H @@ -50,31 +50,30 @@ class PPPMStagger : public PPPM { virtual void fieldforce_ad(); virtual void fieldforce_peratom(); - inline double gf_denom2(const double &x, const double &y, - const double &z) const + inline double gf_denom2(const double &x, const double &y, const double &z) const { - double sx,sy,sz; - double x2 = x*x; - double y2 = y*y; - double z2 = z*z; + double sx, sy, sz; + double x2 = x * x; + double y2 = y * y; + double z2 = z * z; double xl = x; double yl = y; double zl = z; sx = sy = sz = 0.0; for (int l = 0; l < order; l++) { - sx += gf_b2[order][l]*xl; - sy += gf_b2[order][l]*yl; - sz += gf_b2[order][l]*zl; + sx += gf_b2[order][l] * xl; + sy += gf_b2[order][l] * yl; + sz += gf_b2[order][l] * zl; xl *= x2; yl *= y2; zl *= z2; } - double s = sx*sy*sz; - return s*s; + double s = sx * sy * sz; + return s * s; }; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_tip4p.cpp b/src/KSPACE/pppm_tip4p.cpp index 5172db9674..1cb7bf462f 100644 --- a/src/KSPACE/pppm_tip4p.cpp +++ b/src/KSPACE/pppm_tip4p.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/pppm_tip4p.h b/src/KSPACE/pppm_tip4p.h index aba660253f..9d3d70c0c6 100644 --- a/src/KSPACE/pppm_tip4p.h +++ b/src/KSPACE/pppm_tip4p.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/tip4p,PPPMTIP4P) - +// clang-format off +KSpaceStyle(pppm/tip4p,PPPMTIP4P); +// clang-format on #else #ifndef LMP_PPPM_TIP4P_H @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PPPMTIP4P : public PPPM { public: PPPMTIP4P(class LAMMPS *); - virtual ~PPPMTIP4P () {}; + virtual ~PPPMTIP4P(){}; void init(); protected: @@ -41,7 +41,7 @@ class PPPMTIP4P : public PPPM { void find_M(int, int &, int &, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/remap.cpp b/src/KSPACE/remap.cpp index 6caaa9fe2c..9ca040aa64 100644 --- a/src/KSPACE/remap.cpp +++ b/src/KSPACE/remap.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/remap.h b/src/KSPACE/remap.h index 0d5a01e39a..0f91fae996 100644 --- a/src/KSPACE/remap.h +++ b/src/KSPACE/remap.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,47 +24,44 @@ typedef double FFT_SCALAR; // details of how to do a 3d remap struct remap_plan_3d { - FFT_SCALAR *sendbuf; // buffer for MPI sends - FFT_SCALAR *scratch; // scratch buffer for MPI recvs + FFT_SCALAR *sendbuf; // buffer for MPI sends + FFT_SCALAR *scratch; // scratch buffer for MPI recvs void (*pack)(FFT_SCALAR *, FFT_SCALAR *, struct pack_plan_3d *); - // which pack function to use + // which pack function to use void (*unpack)(FFT_SCALAR *, FFT_SCALAR *, struct pack_plan_3d *); - // which unpack function to use - int *send_offset; // extraction loc for each send - int *send_size; // size of each send message - int *send_proc; // proc to send each message to - struct pack_plan_3d *packplan; // pack plan for each send message - int *recv_offset; // insertion loc for each recv - int *recv_size; // size of each recv message - int *recv_proc; // proc to recv each message from - int *recv_bufloc; // offset in scratch buf for each recv - MPI_Request *request; // MPI request for each posted recv - struct pack_plan_3d *unpackplan; // unpack plan for each recv message - int nrecv; // # of recvs from other procs - int nsend; // # of sends to other procs - int self; // whether I send/recv with myself - int memory; // user provides scratch space or not - MPI_Comm comm; // group of procs performing remap - int usecollective; // use collective or point-to-point MPI - int commringlen; // length of commringlist - int *commringlist; // ranks on communication ring of this plan + // which unpack function to use + int *send_offset; // extraction loc for each send + int *send_size; // size of each send message + int *send_proc; // proc to send each message to + struct pack_plan_3d *packplan; // pack plan for each send message + int *recv_offset; // insertion loc for each recv + int *recv_size; // size of each recv message + int *recv_proc; // proc to recv each message from + int *recv_bufloc; // offset in scratch buf for each recv + MPI_Request *request; // MPI request for each posted recv + struct pack_plan_3d *unpackplan; // unpack plan for each recv message + int nrecv; // # of recvs from other procs + int nsend; // # of sends to other procs + int self; // whether I send/recv with myself + int memory; // user provides scratch space or not + MPI_Comm comm; // group of procs performing remap + int usecollective; // use collective or point-to-point MPI + int commringlen; // length of commringlist + int *commringlist; // ranks on communication ring of this plan }; // collision between 2 regions struct extent_3d { - int ilo,ihi,isize; - int jlo,jhi,jsize; - int klo,khi,ksize; + int ilo, ihi, isize; + int jlo, jhi, jsize; + int klo, khi, ksize; }; // function prototypes void remap_3d(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR *, struct remap_plan_3d *); -struct remap_plan_3d *remap_3d_create_plan(MPI_Comm, - int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int); +struct remap_plan_3d *remap_3d_create_plan(MPI_Comm, int, int, int, int, int, int, int, int, int, + int, int, int, int, int, int, int, int); void remap_3d_destroy_plan(struct remap_plan_3d *); -int remap_3d_collide(struct extent_3d *, - struct extent_3d *, struct extent_3d *); +int remap_3d_collide(struct extent_3d *, struct extent_3d *, struct extent_3d *); diff --git a/src/KSPACE/remap_wrap.cpp b/src/KSPACE/remap_wrap.cpp index ec5f798b53..10e14d5618 100644 --- a/src/KSPACE/remap_wrap.cpp +++ b/src/KSPACE/remap_wrap.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/KSPACE/remap_wrap.h b/src/KSPACE/remap_wrap.h index f2e69e995f..d42c8d4c5e 100644 --- a/src/KSPACE/remap_wrap.h +++ b/src/KSPACE/remap_wrap.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -21,8 +21,8 @@ namespace LAMMPS_NS { class Remap : protected Pointers { public: - Remap(class LAMMPS *, MPI_Comm,int,int,int,int,int,int, - int,int,int,int,int,int,int,int,int,int,int); + Remap(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, int, + int, int, int, int); ~Remap(); void perform(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR *); @@ -30,7 +30,7 @@ class Remap : protected Pointers { struct remap_plan_3d *plan; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/LATTE/fix_latte.cpp b/src/LATTE/fix_latte.cpp index 81d7cb3201..e1d0224e62 100644 --- a/src/LATTE/fix_latte.cpp +++ b/src/LATTE/fix_latte.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/LATTE/fix_latte.h b/src/LATTE/fix_latte.h index aba6f81ff6..2797da3599 100644 --- a/src/LATTE/fix_latte.h +++ b/src/LATTE/fix_latte.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(latte,FixLatte) - +// clang-format off +FixStyle(latte,FixLatte); +// clang-format on #else #ifndef LMP_FIX_LATTE_H @@ -45,10 +45,10 @@ class FixLatte : public Fix { protected: char *id_pe; - int coulomb,pbcflag,pe_peratom,virial_global,virial_peratom,neighflag; + int coulomb, pbcflag, pe_peratom, virial_global, virial_peratom, neighflag; int eflag_caller; - int nmax,newsystem; + int nmax, newsystem; double *qpotential; double **flatte; double latte_energy; @@ -57,7 +57,7 @@ class FixLatte : public Fix { class Compute *c_pe; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/fix_qeq_comb.cpp b/src/MANYBODY/fix_qeq_comb.cpp index 7c23e6c218..30d970fc97 100644 --- a/src/MANYBODY/fix_qeq_comb.cpp +++ b/src/MANYBODY/fix_qeq_comb.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/fix_qeq_comb.h b/src/MANYBODY/fix_qeq_comb.h index 01163b7f90..320691b7b0 100644 --- a/src/MANYBODY/fix_qeq_comb.h +++ b/src/MANYBODY/fix_qeq_comb.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(qeq/comb,FixQEQComb) - +// clang-format off +FixStyle(qeq/comb,FixQEQComb); +// clang-format on #else #ifndef LMP_FIX_QEQ_COMB_H @@ -32,15 +32,15 @@ class FixQEQComb : public Fix { virtual void init(); void setup(int); virtual void post_force(int); - void post_force_respa(int,int,int); + void post_force_respa(int, int, int); double memory_usage(); - int pack_forward_comm(int , int *, double *, int, int *); - void unpack_forward_comm(int , int , double *); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); void min_post_force(int); protected: - int me,firstflag; + int me, firstflag; double precision; int ilevel_respa; bigint ngroup; @@ -49,10 +49,10 @@ class FixQEQComb : public Fix { class PairComb *comb; class PairComb3 *comb3; int nmax; - double *qf,*q1,*q2; + double *qf, *q1, *q2; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_adp.cpp b/src/MANYBODY/pair_adp.cpp index 59afbc280b..aed241554b 100644 --- a/src/MANYBODY/pair_adp.cpp +++ b/src/MANYBODY/pair_adp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_adp.h b/src/MANYBODY/pair_adp.h index b7a26affbf..3740b214ed 100644 --- a/src/MANYBODY/pair_adp.h +++ b/src/MANYBODY/pair_adp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(adp,PairADP) - +// clang-format off +PairStyle(adp,PairADP); +// clang-format on #else #ifndef LMP_PAIR_ADP_H @@ -41,38 +41,38 @@ class PairADP : public Pair { double memory_usage(); protected: - int nmax; // allocated size of per-atom arrays - double cutforcesq,cutmax; + int nmax; // allocated size of per-atom arrays + double cutforcesq, cutmax; // per-atom arrays - double *rho,*fp; + double *rho, *fp; double **mu, **lambda; // potentials as array data - int nrho,nr; - int nfrho,nrhor,nz2r; + int nrho, nr; + int nfrho, nrhor, nz2r; int nu2r, nw2r; - double **frho,**rhor,**z2r; + double **frho, **rhor, **z2r; double **u2r, **w2r; - int *type2frho,**type2rhor,**type2z2r; - int **type2u2r,**type2w2r; + int *type2frho, **type2rhor, **type2z2r; + int **type2u2r, **type2w2r; // potentials in spline form used for force computation - double dr,rdr,drho,rdrho; - double ***rhor_spline,***frho_spline,***z2r_spline; + double dr, rdr, drho, rdrho; + double ***rhor_spline, ***frho_spline, ***z2r_spline; double ***u2r_spline, ***w2r_spline; // potentials as file data struct Setfl { char **elements; - int nelements,nrho,nr; - double drho,dr,cut; + int nelements, nrho, nr; + double drho, dr, cut; double *mass; - double **frho,**rhor,***z2r; + double **frho, **rhor, ***z2r; double ***u2r, ***w2r; }; Setfl *setfl; @@ -85,7 +85,7 @@ class PairADP : public Pair { void file2array(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp index 058a769b14..b18dbfef90 100644 --- a/src/MANYBODY/pair_airebo.cpp +++ b/src/MANYBODY/pair_airebo.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_airebo.h b/src/MANYBODY/pair_airebo.h index 068f1afecf..fa1572b1e4 100644 --- a/src/MANYBODY/pair_airebo.h +++ b/src/MANYBODY/pair_airebo.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,17 +12,17 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(airebo,PairAIREBO) - +// clang-format off +PairStyle(airebo,PairAIREBO); +// clang-format on #else #ifndef LMP_PAIR_AIREBO_H #define LMP_PAIR_AIREBO_H +#include "math_const.h" #include "pair.h" #include -#include "math_const.h" namespace LAMMPS_NS { @@ -37,63 +37,63 @@ class PairAIREBO : public Pair { double init_one(int, int); double memory_usage(); - enum { AIREBO, REBO_2, AIREBO_M }; // for telling class variants apart in shared code + enum { AIREBO, REBO_2, AIREBO_M }; // for telling class variants apart in shared code -protected: - int *map; // 0 (C), 1 (H), or -1 ("NULL") for each type + protected: + int *map; // 0 (C), 1 (H), or -1 ("NULL") for each type int variant; - int ljflag,torflag; // 0/1 if LJ/Morse,torsion terms included - int morseflag; // 1 if Morse instead of LJ for non-bonded + int ljflag, torflag; // 0/1 if LJ/Morse,torsion terms included + int morseflag; // 1 if Morse instead of LJ for non-bonded - double cutlj; // user-specified LJ cutoff - double sigcut,sigwid,sigmin; // corresponding cutoff function - double cutljrebosq; // cut for when to compute - // REBO neighs of ghost atoms + double cutlj; // user-specified LJ cutoff + double sigcut, sigwid, sigmin; // corresponding cutoff function + double cutljrebosq; // cut for when to compute + // REBO neighs of ghost atoms - double **cutljsq; // LJ cutoffs for C,H types - double **lj1,**lj2,**lj3,**lj4; // pre-computed LJ coeffs for C,H types - double cut3rebo; // maximum distance for 3rd REBO neigh + double **cutljsq; // LJ cutoffs for C,H types + double **lj1, **lj2, **lj3, **lj4; // pre-computed LJ coeffs for C,H types + double cut3rebo; // maximum distance for 3rd REBO neigh - int maxlocal; // size of numneigh, firstneigh arrays - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - MyPage *ipage; // neighbor list pages - int *REBO_numneigh; // # of pair neighbors for each atom - int **REBO_firstneigh; // ptr to 1st neighbor of each atom + int maxlocal; // size of numneigh, firstneigh arrays + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + MyPage *ipage; // neighbor list pages + int *REBO_numneigh; // # of pair neighbors for each atom + int **REBO_firstneigh; // ptr to 1st neighbor of each atom - double *closestdistsq; // closest owned atom dist to each ghost - double *nC,*nH; // sum of weighting fns with REBO neighs + double *closestdistsq; // closest owned atom dist to each ghost + double *nC, *nH; // sum of weighting fns with REBO neighs - double smin,Nmin,Nmax,NCmin,NCmax,thmin,thmax; - double rcmin[2][2],rcmax[2][2],rcmaxsq[2][2],rcmaxp[2][2]; - double Q[2][2],alpha[2][2],A[2][2],rho[2][2],BIJc[2][2][3],Beta[2][2][3]; - double rcLJmin[2][2],rcLJmax[2][2],rcLJmaxsq[2][2],bLJmin[2][2],bLJmax[2][2]; - double epsilon[2][2],sigma[2][2],epsilonT[2][2]; + double smin, Nmin, Nmax, NCmin, NCmax, thmin, thmax; + double rcmin[2][2], rcmax[2][2], rcmaxsq[2][2], rcmaxp[2][2]; + double Q[2][2], alpha[2][2], A[2][2], rho[2][2], BIJc[2][2][3], Beta[2][2][3]; + double rcLJmin[2][2], rcLJmax[2][2], rcLJmaxsq[2][2], bLJmin[2][2], bLJmax[2][2]; + double epsilon[2][2], sigma[2][2], epsilonT[2][2]; // parameters for Morse variant - double epsilonM[2][2],alphaM[2][2],reqM[2][2]; + double epsilonM[2][2], alphaM[2][2], reqM[2][2]; // spline coefficients - double gCdom[5],gC1[4][6],gC2[4][6],gHdom[4],gH[3][6]; - double pCCdom[2][2],pCHdom[2][2],pCC[4][4][16],pCH[4][4][16]; - double piCCdom[3][2],piCHdom[3][2],piHHdom[3][2]; - double piCC[4][4][9][64],piCH[4][4][9][64],piHH[4][4][9][64]; - double Tijdom[3][2],Tijc[4][4][9][64]; + double gCdom[5], gC1[4][6], gC2[4][6], gHdom[4], gH[3][6]; + double pCCdom[2][2], pCHdom[2][2], pCC[4][4][16], pCH[4][4][16]; + double piCCdom[3][2], piCHdom[3][2], piHHdom[3][2]; + double piCC[4][4][9][64], piCH[4][4][9][64], piHH[4][4][9][64]; + double Tijdom[3][2], Tijc[4][4][9][64]; // spline knot values - double PCCf[5][5],PCCdfdx[5][5],PCCdfdy[5][5],PCHf[5][5]; - double PCHdfdx[5][5],PCHdfdy[5][5]; - double piCCf[5][5][11],piCCdfdx[5][5][11]; - double piCCdfdy[5][5][11],piCCdfdz[5][5][11]; - double piCHf[5][5][11],piCHdfdx[5][5][11]; - double piCHdfdy[5][5][11],piCHdfdz[5][5][11]; - double piHHf[5][5][11],piHHdfdx[5][5][11]; - double piHHdfdy[5][5][11],piHHdfdz[5][5][11]; - double Tf[5][5][10],Tdfdx[5][5][10],Tdfdy[5][5][10],Tdfdz[5][5][10]; + double PCCf[5][5], PCCdfdx[5][5], PCCdfdy[5][5], PCHf[5][5]; + double PCHdfdx[5][5], PCHdfdy[5][5]; + double piCCf[5][5][11], piCCdfdx[5][5][11]; + double piCCdfdy[5][5][11], piCCdfdz[5][5][11]; + double piCHf[5][5][11], piCHdfdx[5][5][11]; + double piCHdfdy[5][5][11], piCHdfdz[5][5][11]; + double piHHf[5][5][11], piHHdfdx[5][5][11]; + double piHHdfdy[5][5][11], piHHdfdz[5][5][11]; + double Tf[5][5][10], Tdfdx[5][5][10], Tdfdy[5][5][10], Tdfdz[5][5][10]; void REBO_neigh(); void FREBO(int, int); @@ -101,8 +101,7 @@ protected: void TORSION(int, int); double bondorder(int, int, double *, double, double, double **, int); - double bondorderLJ(int, int, double *, double, double, - double *, double, double **, int); + double bondorderLJ(int, int, double *, double, double, double *, double, double **, int); double gSpline(double, double, int, double *, double *); double PijSpline(double, double, int, int, double *); @@ -115,11 +114,11 @@ protected: double Spbicubic(double, double, double *, double *); double Sptricubic(double, double, double, double *, double *); void Sptricubic_patch_adjust(double *, double, double, char); - void Sptricubic_patch_coeffs(double, double, double, double, double, double, - double*, double*, double*, double*, double*); + void Sptricubic_patch_coeffs(double, double, double, double, double, double, double *, double *, + double *, double *, double *); void Spbicubic_patch_adjust(double *, double, double, char); - void Spbicubic_patch_coeffs(double, double, double, double, double *, - double *, double *, double *); + void Spbicubic_patch_coeffs(double, double, double, double, double *, double *, double *, + double *); virtual void spline_init(); void allocate(); @@ -135,10 +134,11 @@ protected: no side effects ------------------------------------------------------------------------- */ - inline double Sp(double Xij, double Xmin, double Xmax, double &dX) const { + inline double Sp(double Xij, double Xmin, double Xmax, double &dX) const + { double cutoff; - double t = (Xij-Xmin) / (Xmax-Xmin); + double t = (Xij - Xmin) / (Xmax - Xmin); if (t <= 0.0) { cutoff = 1.0; dX = 0.0; @@ -146,8 +146,8 @@ protected: cutoff = 0.0; dX = 0.0; } else { - cutoff = 0.5 * (1.0+cos(t*MathConst::MY_PI)); - dX = (-0.5*MathConst::MY_PI*sin(t*MathConst::MY_PI)) / (Xmax-Xmin); + cutoff = 0.5 * (1.0 + cos(t * MathConst::MY_PI)); + dX = (-0.5 * MathConst::MY_PI * sin(t * MathConst::MY_PI)) / (Xmax - Xmin); } return cutoff; }; @@ -158,10 +158,11 @@ protected: no side effects ------------------------------------------------------------------------- */ - inline double Sp2(double Xij, double Xmin, double Xmax, double &dX) const { + inline double Sp2(double Xij, double Xmin, double Xmax, double &dX) const + { double cutoff; - double t = (Xij-Xmin) / (Xmax-Xmin); + double t = (Xij - Xmin) / (Xmax - Xmin); if (t <= 0.0) { cutoff = 1.0; dX = 0.0; @@ -169,21 +170,18 @@ protected: cutoff = 0.0; dX = 0.0; } else { - cutoff = (1.0-(t*t*(3.0-2.0*t))); - dX = 6.0*(t*t-t) / (Xmax-Xmin); + cutoff = (1.0 - (t * t * (3.0 - 2.0 * t))); + dX = 6.0 * (t * t - t) / (Xmax - Xmin); } return cutoff; }; /* kronecker delta function returning a double */ - inline double kronecker(const int a, const int b) const { - return (a == b) ? 1.0 : 0.0; - }; - + inline double kronecker(const int a, const int b) const { return (a == b) ? 1.0 : 0.0; }; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_airebo_morse.cpp b/src/MANYBODY/pair_airebo_morse.cpp index 03aa944d13..01d2516415 100644 --- a/src/MANYBODY/pair_airebo_morse.cpp +++ b/src/MANYBODY/pair_airebo_morse.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_airebo_morse.h b/src/MANYBODY/pair_airebo_morse.h index b835e91d1b..fe2e61440a 100644 --- a/src/MANYBODY/pair_airebo_morse.h +++ b/src/MANYBODY/pair_airebo_morse.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(airebo/morse,PairAIREBOMorse) - +// clang-format off +PairStyle(airebo/morse,PairAIREBOMorse); +// clang-format on #else #ifndef LMP_PAIR_AIREBO_MORSE_H @@ -30,7 +30,7 @@ class PairAIREBOMorse : public PairAIREBO { void settings(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_atm.cpp b/src/MANYBODY/pair_atm.cpp index 460e1f6828..81adef5871 100644 --- a/src/MANYBODY/pair_atm.cpp +++ b/src/MANYBODY/pair_atm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_atm.h b/src/MANYBODY/pair_atm.h index 6f7fbc6d3d..8370e08aec 100644 --- a/src/MANYBODY/pair_atm.h +++ b/src/MANYBODY/pair_atm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(atm,PairATM) - +// clang-format off +PairStyle(atm,PairATM); +// clang-format on #else #ifndef LMP_PAIR_ATM_H @@ -39,15 +39,15 @@ class PairATM : public Pair { void read_restart_settings(FILE *); protected: - double cut_global,cut_triple; + double cut_global, cut_triple; double ***nu; void allocate(); - void interaction_ddd(double, double, double, double, double, double *, - double *, double *, double *, double *, int, double &); + void interaction_ddd(double, double, double, double, double, double *, double *, double *, + double *, double *, int, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_bop.cpp b/src/MANYBODY/pair_bop.cpp index 6d3aecda0e..9041d25b53 100644 --- a/src/MANYBODY/pair_bop.cpp +++ b/src/MANYBODY/pair_bop.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -29,7 +30,7 @@ pairbop v 1.0 comes with no warranty of any kind. pairbop v 1.0 is a copyrighted code that is distributed free-of-charge, under the terms of the GNU Public License (GPL). See "Open-Source Rules" - https://lammps.sandia.gov/open_source.html + https://www.lammps.org/open_source.html ------------------------------------------------------------------------- */ // uncomment define to enable writing table files for debugging diff --git a/src/MANYBODY/pair_bop.h b/src/MANYBODY/pair_bop.h index 7ab73a0d20..53ad7ceace 100644 --- a/src/MANYBODY/pair_bop.h +++ b/src/MANYBODY/pair_bop.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -28,7 +28,7 @@ PairStyle(bop,PairBOP); #include "pair.h" namespace LAMMPS_NS { - class TabularFunction; +class TabularFunction; class PairBOP : public Pair { @@ -43,7 +43,6 @@ class PairBOP : public Pair { double memory_usage(); private: - struct PairParameters { double cutB, cutBsq, cutL, cutLsq; TabularFunction *betaS; @@ -106,13 +105,13 @@ class PairBOP : public Pair { double *sigma_f, *sigma_k, *small3; double *pro_delta, *pro; - int bop_types; // number of elments in potential file - int npairs; // number of element pairs - int ntriples; // number of all triples - char **bop_elements; // names of elements in potential file + int bop_types; // number of elments in potential file + int npairs; // number of element pairs + int ntriples; // number of all triples + char **bop_elements; // names of elements in potential file double bytes; - int otfly; // = 1 faster, more memory, = 0 slower, less memory + int otfly; // = 1 faster, more memory, = 0 slower, less memory PairList1 *pairlist1; PairList2 *pairlist2; diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp index a1fc65deb7..fd278d1488 100644 --- a/src/MANYBODY/pair_comb.cpp +++ b/src/MANYBODY/pair_comb.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_comb.h b/src/MANYBODY/pair_comb.h index 4e569dee00..580a737b9a 100644 --- a/src/MANYBODY/pair_comb.h +++ b/src/MANYBODY/pair_comb.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(comb,PairComb) - +// clang-format off +PairStyle(comb,PairComb); +// clang-format on #else #ifndef LMP_PAIR_COMB_H @@ -42,28 +42,28 @@ class PairComb : public Pair { protected: struct Param { - double lam11,lam12,lam21,lam22; - double c,d,h; - double gamma,powerm; - double powern,beta; - double biga1,biga2,bigb1,bigb2; - double bigd,bigr; - double cut,cutsq; - double c1,c2,c3,c4; - double plp1,plp3,plp6,a123,aconf; - double rlm1,rlm2; - double romiga,romigb,romigc,romigd,addrep; - double QU1,QL1,DU1,DL1,Qo1,dQ1,aB1,bB1,nD1,bD1; - double QU2,QL2,DU2,DL2,Qo2,dQ2,aB2,bB2,nD2,bD2; - double chi,dj,dk,dl,dm,esm1,esm2,cmn1,cmn2,cml1,cml2; + double lam11, lam12, lam21, lam22; + double c, d, h; + double gamma, powerm; + double powern, beta; + double biga1, biga2, bigb1, bigb2; + double bigd, bigr; + double cut, cutsq; + double c1, c2, c3, c4; + double plp1, plp3, plp6, a123, aconf; + double rlm1, rlm2; + double romiga, romigb, romigc, romigd, addrep; + double QU1, QL1, DU1, DL1, Qo1, dQ1, aB1, bB1, nD1, bD1; + double QU2, QL2, DU2, DL2, Qo2, dQ2, aB2, bB2, nD2, bD2; + double chi, dj, dk, dl, dm, esm1, esm2, cmn1, cmn2, cml1, cml2; double coulcut, lcut, lcutsq, hfocor; - int ielement,jelement,kelement; + int ielement, jelement, kelement; int powermint; }; - double cutmax; // max cutoff for all elements + double cutmax; // max cutoff for all elements double precision; - Param *params; // parameter set for an I-J-K interaction + Param *params; // parameter set for an I-J-K interaction int nmax; double *qf; @@ -74,84 +74,78 @@ class PairComb : public Pair { int *NCo, cor_flag, cuo_flag, cuo_flag1, cuo_flag2; double **bbij; - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - int *sht_num,**sht_first; // short-range neighbor list - MyPage *ipage; // neighbor list pages + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + int *sht_num, **sht_first; // short-range neighbor list + MyPage *ipage; // neighbor list pages double cutmin; void allocate(); virtual void read_file(char *); void setup_params(); - virtual void repulsive(Param *, double, double &, int, - double &, double, double); + virtual void repulsive(Param *, double, double &, int, double &, double, double); double zeta(Param *, double, double, double *, double *); - void force_zeta(Param *, int, int, int, double, double, double, double, - double &, double &, double &); - void attractive(Param *, double, double, double, double *, double *, - double *, double *, double *); + void force_zeta(Param *, int, int, int, double, double, double, double, double &, double &, + double &); + void attractive(Param *, double, double, double, double *, double *, double *, double *, + double *); double elp(Param *, double, double, double *, double *); - void flp(Param *, double, double, double *, double *, double *, - double *, double *); + void flp(Param *, double, double, double *, double *, double *, double *, double *); double comb_fc(double, Param *); double comb_fc_d(double, Param *); double comb_fc2(double); double comb_fc2_d(double); double comb_fc3(double); double comb_fc3_d(double); - virtual double comb_fa(double, Param *, double,double); - virtual double comb_fa_d(double, Param *, double,double); + virtual double comb_fa(double, Param *, double, double); + virtual double comb_fa_d(double, Param *, double, double); double comb_bij(double, Param *); double comb_bij_d(double, Param *); - inline double comb_gijk(const double costheta, - const Param * const param) const { + inline double comb_gijk(const double costheta, const Param *const param) const + { const double comb_c = param->c * param->c; const double comb_d = param->d * param->d; const double hcth = param->h - costheta; - return param->gamma*(1.0 + comb_c/comb_d - comb_c / (comb_d + hcth*hcth)); + return param->gamma * (1.0 + comb_c / comb_d - comb_c / (comb_d + hcth * hcth)); } - inline double comb_gijk_d(const double costheta, - const Param * const param) const { + inline double comb_gijk_d(const double costheta, const Param *const param) const + { const double comb_c = param->c * param->c; const double comb_d = param->d * param->d; const double hcth = param->h - costheta; const double numerator = -2.0 * comb_c * hcth; - const double denominator = 1.0/(comb_d + hcth*hcth); - return param->gamma*numerator*denominator*denominator; + const double denominator = 1.0 / (comb_d + hcth * hcth); + return param->gamma * numerator * denominator * denominator; } - void comb_zetaterm_d(double, double *, double, double *, double, - double *, double *, double *, Param *); - void costheta_d(double *, double, double *, double, - double *, double *, double *); + void comb_zetaterm_d(double, double *, double, double *, double, double *, double *, double *, + Param *); + void costheta_d(double *, double, double *, double, double *, double *, double *); double self(Param *, double, double); void sm_table(); void potal_calc(double &, double &, double &); - void tri_point(double, int &, int &, int &, double &, double &, - double &, int &); - void direct(int,int,int,int,double,double,double,double,double,double, - double,double,double,double &,double &); - void field(Param *,double,double,double,double &,double &); + void tri_point(double, int &, int &, int &, double &, double &, double &, int &); + void direct(int, int, int, int, double, double, double, double, double, double, double, double, + double, double &, double &); + void field(Param *, double, double, double, double &, double &); double qfo_self(Param *, double, double); - void qfo_short(Param *, int, int, double, double, double, - double &, double &); - void qfo_direct (int, int, int, int, double, double, double, double, - double, double &); - void qfo_field(Param *, double,double ,double ,double &, double &); + void qfo_short(Param *, int, int, double, double, double, double &, double &); + void qfo_direct(int, int, int, int, double, double, double, double, double, double &); + void qfo_field(Param *, double, double, double, double &, double &); void qsolve(double *); void Over_cor(Param *, double, int, double &, double &); int pack_reverse_comm(int, int, double *); void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int , int *, double *, int, int *); - void unpack_forward_comm(int , int , double *); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); void Short_neigh(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index a0fa3b96b6..c3d9c3043f 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_comb3.h b/src/MANYBODY/pair_comb3.h index 19a0ef904a..946b6c5b0e 100644 --- a/src/MANYBODY/pair_comb3.h +++ b/src/MANYBODY/pair_comb3.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(comb3,PairComb3) - +// clang-format off +PairStyle(comb3,PairComb3); +// clang-format on #else #ifndef LMP_PAIR_COMB3_H @@ -40,20 +40,20 @@ class PairComb3 : public Pair { static constexpr int NPARAMS_PER_LINE = 74; protected: - // general potential parameters + // general potential parameters struct Param { - int ielement,jelement,kelement,powermint; - int ielementgp,jelementgp,kelementgp; //element group - int ang_flag,pcn_flag,rad_flag,tor_flag; //angle, coordination,radical, torsion flag - double lami,lambda,alfi,alpha1,alpha2,alpha3,beta; - double pcos6,pcos5,pcos4,pcos3,pcos2,pcos1,pcos0; - double gamma,powerm,powern,bigA,bigB1,bigB2,bigB3; - double bigd,bigr,cut,cutsq,c1,c2,c3,c4; - double p6p0,p6p1,p6p2,p6p3,p6p4,p6p5,p6p6; - double ptork1,ptork2; - double addrepr,addrep, vdwflag; - double QU,QL,DU,DL,Qo,dQ,aB,bB,nD,bD,qmin,qmax; - double chi,dj,dk,dl,dm,esm,cmn1,cmn2,pcmn1,pcmn2; + int ielement, jelement, kelement, powermint; + int ielementgp, jelementgp, kelementgp; //element group + int ang_flag, pcn_flag, rad_flag, tor_flag; //angle, coordination,radical, torsion flag + double lami, lambda, alfi, alpha1, alpha2, alpha3, beta; + double pcos6, pcos5, pcos4, pcos3, pcos2, pcos1, pcos0; + double gamma, powerm, powern, bigA, bigB1, bigB2, bigB3; + double bigd, bigr, cut, cutsq, c1, c2, c3, c4; + double p6p0, p6p1, p6p2, p6p3, p6p4, p6p5, p6p6; + double ptork1, ptork2; + double addrepr, addrep, vdwflag; + double QU, QL, DU, DL, Qo, dQ, aB, bB, nD, bD, qmin, qmax; + double chi, dj, dk, dl, dm, esm, cmn1, cmn2, pcmn1, pcmn2; double coulcut, lcut, lcutsq; double veps, vsig, pcna, pcnb, pcnc, pcnd, polz, curl, pcross; double paaa, pbbb; @@ -61,12 +61,12 @@ class PairComb3 : public Pair { }; // general setups - double PI,PI2,PI4,PIsq; // PIs - double cutmin; // min cutoff for all elements - double cutmax; // max cutoff for all elements - double precision; // tolerance for QEq convergence - Param *params; // parameter set for an I-J-K interaction - int debug_eng1, debug_eng2, debug_fq; // logic controlling debugging outputs + double PI, PI2, PI4, PIsq; // PIs + double cutmin; // min cutoff for all elements + double cutmax; // max cutoff for all elements + double precision; // tolerance for QEq convergence + Param *params; // parameter set for an I-J-K interaction + int debug_eng1, debug_eng2, debug_fq; // logic controlling debugging outputs int pack_flag; // Short range neighbor list @@ -77,7 +77,7 @@ class PairComb3 : public Pair { // loop up tables and flags int nmax, **intype; - int pol_flag, polar; + int pol_flag, polar; double *qf, **bbij, *charge, *NCo; double *esm, **fafb, **dfafb, **ddfafb, **phin, **dphin, **erpaw; double **vvdw, **vdvdw; @@ -87,21 +87,21 @@ class PairComb3 : public Pair { // additional carbon parameters int cflag; - int nsplpcn,nsplrad,nspltor; - int maxx,maxy,maxz,maxxc,maxyc,maxconj; + int nsplpcn, nsplrad, nspltor; + int maxx, maxy, maxz, maxxc, maxyc, maxconj; int maxxcn[4]; - double vmaxxcn[4],dvmaxxcn[4]; + double vmaxxcn[4], dvmaxxcn[4]; int ntab; - double iin2[16][2],iin3[64][3]; + double iin2[16][2], iin3[64][3]; double brad[4], btor[4], bbtor, ptorr; double fi_tor[3], fj_tor[3], fk_tor[3], fl_tor[3]; double radtmp, fi_rad[3], fj_rad[3], fk_rad[3]; - double ccutoff[6],ch_a[7]; + double ccutoff[6], ch_a[7]; //COMB3-v18 arrays for CHO - // We wanna dynamic arrays - // C angle arrays, size = ntab+1 + // We wanna dynamic arrays + // C angle arrays, size = ntab+1 double pang[20001]; double dpang[20001]; double ddpang[20001]; @@ -147,54 +147,42 @@ class PairComb3 : public Pair { double comb_fcsw(double); // short range terms - void attractive(Param *, Param *, Param *, double, double, double, double, - double, double, double, double *, double *, double *, - double *, double *, int, double); - virtual void comb_fa(double, Param *, Param *, double, double, - double &, double &); - virtual void repulsive(Param *, Param *,double, double &, int, - double &, double, double); + void attractive(Param *, Param *, Param *, double, double, double, double, double, double, double, + double *, double *, double *, double *, double *, int, double); + virtual void comb_fa(double, Param *, Param *, double, double, double &, double &); + virtual void repulsive(Param *, Param *, double, double &, int, double &, double, double); // bond order terms double comb_bij(double, Param *, double, int, double); double comb_gijk(double, Param *, double); void comb_gijk_d(double, Param *, double, double &, double &); double zeta(Param *, Param *, double, double, double *, double *, int, double); - void comb_bij_d(double, Param *, double, int, double &, - double &, double &, double &, double &, double &, double); - void coord(Param *, double, int, double &, double &, - double &, double &, double &, double); - void comb_zetaterm_d(double, double, double, double, double, - double *, double, double *, double, double *, double *, - double *, Param *, Param *, Param *, double); - void costheta_d(double *, double, double *, double, - double *, double *, double *); - void force_zeta(Param *, Param *, double, double, double, double &, - double &, double &, double &, double &, double &, double &, - double &, double &, double &, double &, double &, double &, - int, double &, double,double, int, int, int, - double , double , double); - void cntri_int(int, double, double, double, int, int, int, - double &, double &, double &, double &, Param *); + void comb_bij_d(double, Param *, double, int, double &, double &, double &, double &, double &, + double &, double); + void coord(Param *, double, int, double &, double &, double &, double &, double &, double); + void comb_zetaterm_d(double, double, double, double, double, double *, double, double *, double, + double *, double *, double *, Param *, Param *, Param *, double); + void costheta_d(double *, double, double *, double, double *, double *, double *); + void force_zeta(Param *, Param *, double, double, double, double &, double &, double &, double &, + double &, double &, double &, double &, double &, double &, double &, double &, + double &, int, double &, double, double, int, int, int, double, double, double); + void cntri_int(int, double, double, double, int, int, int, double &, double &, double &, double &, + Param *); // Legendre polynomials void selfp6p(Param *, Param *, double, double &, double &); - double ep6p(Param *, Param *, double, double, double *, double * ,double &); - void fp6p(Param *, Param *, double, double, double *, double *, double *, - double *, double *); + double ep6p(Param *, Param *, double, double, double *, double *, double &); + void fp6p(Param *, Param *, double, double, double *, double *, double *, double *, double *); // long range q-dependent terms double self(Param *, double); void tables(); void potal_calc(double &, double &, double &); - void tri_point(double, int &, int &, int &, double &, double &, - double &); - void vdwaals(int,int,int,int,double,double,double,double, - double &, double &); - void direct(Param *, Param *, int,int,int,double,double, - double,double,double,double, double,double,double &,double &, - int, int); - void field(Param *, Param *,double,double,double,double &,double &); + void tri_point(double, int &, int &, int &, double &, double &, double &); + void vdwaals(int, int, int, int, double, double, double, double, double &, double &); + void direct(Param *, Param *, int, int, int, double, double, double, double, double, double, + double, double, double &, double &, int, int); + void field(Param *, Param *, double, double, double, double &, double &); int heaviside(double); double switching(double); double switching_d(double); @@ -202,50 +190,43 @@ class PairComb3 : public Pair { // radical terms double rad_init(double, Param *, int, double &, double); - void rad_calc(double, Param *, Param *, double, double, int, - int, double, double); - void rad_int(int , double, double, double, int, int, int, - double &, double &, double &, double &); - void rad_forceik(Param *, double, double *, double, double); - void rad_force(Param *, double, double *, double); + void rad_calc(double, Param *, Param *, double, double, int, int, double, double); + void rad_int(int, double, double, double, int, int, int, double &, double &, double &, double &); + void rad_forceik(Param *, double, double *, double, double); + void rad_force(Param *, double, double *, double); // torsion terms - double bbtor1(int, Param *, Param *, double, double, double, - double *, double *, double *, double); //modified by TAO - void tor_calc(double, Param *, Param *, double, double, int, - int, double, double); - void tor_int(int , double, double, double, int, int, int, - double &, double &, double &, double &); - void tor_force(int, Param *, Param *, double, double, double, - double, double *, double *, double *); //modified by TAO + double bbtor1(int, Param *, Param *, double, double, double, double *, double *, double *, + double); //modified by TAO + void tor_calc(double, Param *, Param *, double, double, int, int, double, double); + void tor_int(int, double, double, double, int, int, int, double &, double &, double &, double &); + void tor_force(int, Param *, Param *, double, double, double, double, double *, double *, + double *); //modified by TAO // charge force terms double qfo_self(Param *, double); - void qfo_short(Param *, Param *, double, double, double, - double &, double &, int, int, int); - void qfo_direct(Param *, Param *, int, int, int, double, - double, double, double, double, double &, double &, - double, double, int, int); - void qfo_field(Param *, Param *,double,double ,double ,double &, double &); - void qfo_dipole(double, int, int, int, int, double, double *, double, - double, double, double &, double &, int, int); + void qfo_short(Param *, Param *, double, double, double, double &, double &, int, int, int); + void qfo_direct(Param *, Param *, int, int, int, double, double, double, double, double, double &, + double &, double, double, int, int); + void qfo_field(Param *, Param *, double, double, double, double &, double &); + void qfo_dipole(double, int, int, int, int, double, double *, double, double, double, double &, + double &, int, int); void qsolve(double *); // dipole - polarization terms double dipole_self(Param *, int); - void dipole_init(Param *, Param *, double, double *, double, - int, int, int, double, double, double, double, double, int , int); - void dipole_calc(Param *, Param *, double, double, double, double, double, - int, int, int, double, double, double, double, double, int , int, - double &, double &, double *); + void dipole_init(Param *, Param *, double, double *, double, int, int, int, double, double, + double, double, double, int, int); + void dipole_calc(Param *, Param *, double, double, double, double, double, int, int, int, double, + double, double, double, double, int, int, double &, double &, double *); // communication functions int pack_reverse_comm(int, int, double *); void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int , int *, double *, int, int *); - void unpack_forward_comm(int , int , double *); - }; -} + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); +}; +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index b5fd507687..c2953f0d20 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_eam.h b/src/MANYBODY/pair_eam.h index 8779042118..5ec89cbe7e 100644 --- a/src/MANYBODY/pair_eam.h +++ b/src/MANYBODY/pair_eam.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam,PairEAM) - +// clang-format off +PairStyle(eam,PairEAM); +// clang-format on #else #ifndef LMP_PAIR_EAM_H @@ -24,10 +24,9 @@ PairStyle(eam,PairEAM) namespace LAMMPS_NS { - class PairEAM : public Pair { public: - friend class FixSemiGrandCanonicalMC; // Alex Stukowski option + friend class FixSemiGrandCanonicalMC; // Alex Stukowski option // public variables so USER-ATC package can access them @@ -35,15 +34,15 @@ class PairEAM : public Pair { // potentials as array data - int nrho,nr; - int nfrho,nrhor,nz2r; - double **frho,**rhor,**z2r; - int *type2frho,**type2rhor,**type2z2r; + int nrho, nr; + int nfrho, nrhor, nz2r; + double **frho, **rhor, **z2r; + int *type2frho, **type2rhor, **type2z2r; // potentials in spline form used for force computation - double dr,rdr,drho,rdrho,rhomax,rhomin; - double ***rhor_spline,***frho_spline,***z2r_spline; + double dr, rdr, drho, rdrho, rhomax, rhomin; + double ***rhor_spline, ***frho_spline, ***z2r_spline; PairEAM(class LAMMPS *); virtual ~PairEAM(); @@ -63,42 +62,42 @@ class PairEAM : public Pair { void swap_eam(double *, double **); protected: - int nmax; // allocated size of per-atom arrays + int nmax; // allocated size of per-atom arrays double cutforcesq; double **scale; - bigint embedstep; // timestep, the embedding term was computed + bigint embedstep; // timestep, the embedding term was computed // per-atom arrays - double *rho,*fp; + double *rho, *fp; int *numforce; // potentials as file data struct Funcfl { char *file; - int nrho,nr; - double drho,dr,cut,mass; - double *frho,*rhor,*zr; + int nrho, nr; + double drho, dr, cut, mass; + double *frho, *rhor, *zr; }; Funcfl *funcfl; int nfuncfl; struct Setfl { char **elements; - int nelements,nrho,nr; - double drho,dr,cut; + int nelements, nrho, nr; + double drho, dr, cut; double *mass; - double **frho,**rhor,***z2r; + double **frho, **rhor, ***z2r; }; Setfl *setfl; struct Fs { char **elements; - int nelements,nrho,nr; - double drho,dr,cut; + int nelements, nrho, nr; + double drho, dr, cut; double *mass; - double **frho,***rhor,***z2r; + double **frho, ***rhor, ***z2r; }; Fs *fs; @@ -110,7 +109,7 @@ class PairEAM : public Pair { virtual void file2array(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_eam_alloy.cpp b/src/MANYBODY/pair_eam_alloy.cpp index e1c43b9d99..bea1502a4f 100644 --- a/src/MANYBODY/pair_eam_alloy.cpp +++ b/src/MANYBODY/pair_eam_alloy.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_eam_alloy.h b/src/MANYBODY/pair_eam_alloy.h index d280a29da1..d3b7880a4d 100644 --- a/src/MANYBODY/pair_eam_alloy.h +++ b/src/MANYBODY/pair_eam_alloy.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/alloy,PairEAMAlloy) - +// clang-format off +PairStyle(eam/alloy,PairEAMAlloy); +// clang-format on #else #ifndef LMP_PAIR_EAM_ALLOY_H @@ -37,7 +37,7 @@ class PairEAMAlloy : virtual public PairEAM { void file2array(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_eam_cd.cpp b/src/MANYBODY/pair_eam_cd.cpp index da4d2b2c65..de40cb2568 100644 --- a/src/MANYBODY/pair_eam_cd.cpp +++ b/src/MANYBODY/pair_eam_cd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_eam_cd.h b/src/MANYBODY/pair_eam_cd.h index 49daa78a35..77e909f48b 100644 --- a/src/MANYBODY/pair_eam_cd.h +++ b/src/MANYBODY/pair_eam_cd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/cd,PairEAMCD_OneSite) -PairStyle(eam/cd/old,PairEAMCD_TwoSite) - +// clang-format off +PairStyle(eam/cd,PairEAMCD_OneSite); +PairStyle(eam/cd/old,PairEAMCD_TwoSite); +// clang-format on #else #ifndef LMP_PAIR_EAM_CD_H @@ -25,11 +25,10 @@ PairStyle(eam/cd/old,PairEAMCD_TwoSite) namespace LAMMPS_NS { -class PairEAMCD : public PairEAMAlloy -{ -public: +class PairEAMCD : public PairEAMAlloy { + public: /// Constructor. - PairEAMCD(class LAMMPS*, int cdeamVersion); + PairEAMCD(class LAMMPS *, int cdeamVersion); /// Destructor. virtual ~PairEAMCD(); @@ -52,26 +51,24 @@ public: void *extract(const char *, int &) { return nullptr; } /// Parses the coefficients of the h polynomial from the end of the EAM file. - void read_h_coeff(char* filename); + void read_h_coeff(char *filename); public: // The public interface exposed by this potential class. // Evaluates the h(x) polynomial for a given local concentration x. - inline double evalH(double x) const { + inline double evalH(double x) const + { double v = 0.0; - for (int i = nhcoeff-1; i >= 1; i--) { - v = (v + hcoeff[i]) * x; - } + for (int i = nhcoeff - 1; i >= 1; i--) { v = (v + hcoeff[i]) * x; } return v + hcoeff[0]; }; // Calculates the derivative of the h(x) polynomial. - inline double evalHprime(double x) const { + inline double evalHprime(double x) const + { double v = 0.0; - for (int i = nhcoeff-1; i >= 2; i--) { - v = (v + (double)i * hcoeff[i]) * x; - } + for (int i = nhcoeff - 1; i >= 2; i--) { v = (v + (double) i * hcoeff[i]) * x; } return v + hcoeff[1]; }; @@ -107,7 +104,6 @@ public: int speciesB; protected: - // Evaluation functions: // This structure specifies an entry in one of the EAM spline tables @@ -118,81 +114,93 @@ public: } EAMTableIndex; // Converts a radius value to an index value to be used in a spline table lookup. - inline EAMTableIndex radiusToTableIndex(double r) const { + inline EAMTableIndex radiusToTableIndex(double r) const + { EAMTableIndex index; - index.p = r*rdr + 1.0; + index.p = r * rdr + 1.0; index.m = static_cast(index.p); - index.m = index.m <= (nr-1) ? index.m : (nr-1); + index.m = index.m <= (nr - 1) ? index.m : (nr - 1); index.p -= index.m; index.p = index.p <= 1.0 ? index.p : 1.0; return index; }; // Converts a density value to an index value to be used in a spline table lookup. - inline EAMTableIndex rhoToTableIndex(double rho) const { + inline EAMTableIndex rhoToTableIndex(double rho) const + { EAMTableIndex index; - index.p = rho*rdrho + 1.0; + index.p = rho * rdrho + 1.0; index.m = static_cast(index.p); - index.m = index.m <= (nrho-1) ? index.m : (nrho-1); + index.m = index.m <= (nrho - 1) ? index.m : (nrho - 1); index.p -= index.m; index.p = index.p <= 1.0 ? index.p : 1.0; return index; }; // Computes the derivative of rho(r) - inline double RhoPrimeOfR(const EAMTableIndex& index, int itype, int jtype) const { - const double* coeff = rhor_spline[type2rhor[itype][jtype]][index.m]; - return (coeff[0]*index.p + coeff[1])*index.p + coeff[2]; + inline double RhoPrimeOfR(const EAMTableIndex &index, int itype, int jtype) const + { + const double *coeff = rhor_spline[type2rhor[itype][jtype]][index.m]; + return (coeff[0] * index.p + coeff[1]) * index.p + coeff[2]; }; // Computes rho(r) - inline double RhoOfR(const EAMTableIndex& index, int itype, int jtype) const { - const double* coeff = rhor_spline[type2rhor[itype][jtype]][index.m]; - return ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6]; + inline double RhoOfR(const EAMTableIndex &index, int itype, int jtype) const + { + const double *coeff = rhor_spline[type2rhor[itype][jtype]][index.m]; + return ((coeff[3] * index.p + coeff[4]) * index.p + coeff[5]) * index.p + coeff[6]; }; // Computes the derivative of F(rho) - inline double FPrimeOfRho(const EAMTableIndex& index, int itype) const { - const double* coeff = frho_spline[type2frho[itype]][index.m]; - return (coeff[0]*index.p + coeff[1])*index.p + coeff[2]; + inline double FPrimeOfRho(const EAMTableIndex &index, int itype) const + { + const double *coeff = frho_spline[type2frho[itype]][index.m]; + return (coeff[0] * index.p + coeff[1]) * index.p + coeff[2]; }; // Computes F(rho) - inline double FofRho(const EAMTableIndex& index, int itype) const { - const double* coeff = frho_spline[type2frho[itype]][index.m]; - return ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6]; + inline double FofRho(const EAMTableIndex &index, int itype) const + { + const double *coeff = frho_spline[type2frho[itype]][index.m]; + return ((coeff[3] * index.p + coeff[4]) * index.p + coeff[5]) * index.p + coeff[6]; }; // Computes the derivative of z2(r) - inline double Z2PrimeOfR(const EAMTableIndex& index, int itype, int jtype) const { - const double* coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; - return (coeff[0]*index.p + coeff[1])*index.p + coeff[2]; + inline double Z2PrimeOfR(const EAMTableIndex &index, int itype, int jtype) const + { + const double *coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; + return (coeff[0] * index.p + coeff[1]) * index.p + coeff[2]; }; // Computes z2(r) - inline double Z2OfR(const EAMTableIndex& index, int itype, int jtype) const { - const double* coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; - return ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6]; + inline double Z2OfR(const EAMTableIndex &index, int itype, int jtype) const + { + const double *coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; + return ((coeff[3] * index.p + coeff[4]) * index.p + coeff[5]) * index.p + coeff[6]; }; // Computes pair potential V_ij(r). - inline double PhiOfR(const EAMTableIndex& index, int itype, int jtype, const double oneOverR) const { + inline double PhiOfR(const EAMTableIndex &index, int itype, int jtype, + const double oneOverR) const + { // phi = pair potential energy // z2 = phi * r - const double* coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; - const double z2 = ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6]; + const double *coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; + const double z2 = ((coeff[3] * index.p + coeff[4]) * index.p + coeff[5]) * index.p + coeff[6]; return z2 * oneOverR; }; // Computes pair potential V_ij(r) and its derivative. - inline double PhiOfR(const EAMTableIndex& index, int itype, int jtype, const double oneOverR, double& phid) const { + inline double PhiOfR(const EAMTableIndex &index, int itype, int jtype, const double oneOverR, + double &phid) const + { // phi = pair potential energy // phip = phi' // z2 = phi * r // z2p = (phi * r)' = (phi' r) + phi - const double* coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; - const double z2p = (coeff[0]*index.p + coeff[1])*index.p + coeff[2]; - const double z2 = ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6]; + const double *coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; + const double z2p = (coeff[0] * index.p + coeff[1]) * index.p + coeff[2]; + const double z2 = ((coeff[3] * index.p + coeff[4]) * index.p + coeff[5]) * index.p + coeff[6]; const double phi = z2 * oneOverR; phid = z2p * oneOverR - phi * oneOverR; return phi; @@ -201,7 +209,7 @@ public: // Parameters // h() polynomial function coefficients - double* hcoeff; + double *hcoeff; // The number of coefficients in the polynomial. int nhcoeff; @@ -211,22 +219,20 @@ public: }; /// The one-site concentration formulation of CD-EAM. - class PairEAMCD_OneSite : public PairEAMCD - { - public: - /// Constructor. - PairEAMCD_OneSite(class LAMMPS* lmp) : PairEAM(lmp), PairEAMCD(lmp, 1) {} - }; +class PairEAMCD_OneSite : public PairEAMCD { + public: + /// Constructor. + PairEAMCD_OneSite(class LAMMPS *lmp) : PairEAM(lmp), PairEAMCD(lmp, 1) {} +}; - /// The two-site concentration formulation of CD-EAM. - class PairEAMCD_TwoSite : public PairEAMCD - { - public: - /// Constructor. - PairEAMCD_TwoSite(class LAMMPS* lmp) : PairEAM(lmp), PairEAMCD(lmp, 2) {} - }; +/// The two-site concentration formulation of CD-EAM. +class PairEAMCD_TwoSite : public PairEAMCD { + public: + /// Constructor. + PairEAMCD_TwoSite(class LAMMPS *lmp) : PairEAM(lmp), PairEAMCD(lmp, 2) {} +}; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_eam_fs.cpp b/src/MANYBODY/pair_eam_fs.cpp index 543606871a..b4596a297b 100644 --- a/src/MANYBODY/pair_eam_fs.cpp +++ b/src/MANYBODY/pair_eam_fs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_eam_fs.h b/src/MANYBODY/pair_eam_fs.h index 137f25a048..7683b92bc3 100644 --- a/src/MANYBODY/pair_eam_fs.h +++ b/src/MANYBODY/pair_eam_fs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/fs,PairEAMFS) - +// clang-format off +PairStyle(eam/fs,PairEAMFS); +// clang-format on #else #ifndef LMP_PAIR_EAM_FS_H @@ -38,7 +38,7 @@ class PairEAMFS : virtual public PairEAM { int he_flag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_eam_he.cpp b/src/MANYBODY/pair_eam_he.cpp index b0c4b7c205..b613fb8915 100644 --- a/src/MANYBODY/pair_eam_he.cpp +++ b/src/MANYBODY/pair_eam_he.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_eam_he.h b/src/MANYBODY/pair_eam_he.h index d69e0729c8..eaa86d8e8f 100644 --- a/src/MANYBODY/pair_eam_he.h +++ b/src/MANYBODY/pair_eam_he.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/he,PairEAMHE) - +// clang-format off +PairStyle(eam/he,PairEAMHE); +// clang-format on #else #ifndef LMP_PAIR_EAM_HE_H @@ -33,7 +33,7 @@ class PairEAMHE : public PairEAMFS { void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp index 2749cf6c4d..6013677376 100644 --- a/src/MANYBODY/pair_eim.cpp +++ b/src/MANYBODY/pair_eim.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_eim.h b/src/MANYBODY/pair_eim.h index a68dcc2198..7602474cb4 100644 --- a/src/MANYBODY/pair_eim.h +++ b/src/MANYBODY/pair_eim.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eim,PairEIM) - +// clang-format off +PairStyle(eim,PairEIM); +// clang-format on #else #ifndef LMP_PAIR_EIM_H @@ -44,22 +44,21 @@ class PairEIM : public Pair { double memory_usage(); struct Setfl { - double division,rbig,rsmall; + double division, rbig, rsmall; int nr; - int *ielement,*tp; - double *mass,*negativity,*ra,*ri,*Ec,*q0; - double *rcutphiA,*rcutphiR,*Eb,*r0,*alpha,*beta, - *rcutq,*Asigma,*rq,*rcutsigma,*Ac,*zeta, - *rs; - double dr,cut; - double ***Fij,***Gij,***phiij; + int *ielement, *tp; + double *mass, *negativity, *ra, *ri, *Ec, *q0; + double *rcutphiA, *rcutphiR, *Eb, *r0, *alpha, *beta, *rcutq, *Asigma, *rq, *rcutsigma, *Ac, + *zeta, *rs; + double dr, cut; + double ***Fij, ***Gij, ***phiij; double **cuts; }; protected: - double **cutforcesq,cutmax; + double **cutforcesq, cutmax; int nmax; - double *rho,*fp; + double *rho, *fp; int rhofp; Setfl *setfl; @@ -67,15 +66,15 @@ class PairEIM : public Pair { // potentials as array data int nr; - int nFij,nGij,nphiij; - double **Fij,**Gij,**phiij; - int **type2Fij,**type2Gij,**type2phiij; + int nFij, nGij, nphiij; + double **Fij, **Gij, **phiij; + int **type2Fij, **type2Gij, **type2phiij; // potentials in spline form used for force computation - double dr,rdr; - double *negativity,*q0; - double ***Fij_spline,***Gij_spline,***phiij_spline; + double dr, rdr; + double *negativity, *q0; + double ***Fij_spline, ***Gij_spline, ***phiij_spline; void allocate(); void array2spline(); @@ -99,19 +98,17 @@ class EIMPotentialFileReader : protected Pointers { void parse(FILE *fp); char *next_line(FILE *fp); - std::pair get_pair(const std::string &a, - const std::string &b); + std::pair get_pair(const std::string &a, const std::string &b); -public: - EIMPotentialFileReader(class LAMMPS* lmp, const std::string &filename, - const int auto_convert=0); + public: + EIMPotentialFileReader(class LAMMPS *lmp, const std::string &filename, + const int auto_convert = 0); void get_global(PairEIM::Setfl *setfl); void get_element(PairEIM::Setfl *setfl, int i, const std::string &name); - void get_pair(PairEIM::Setfl *setfl, int ij, - const std::string &elemA, const std::string &elemB); + void get_pair(PairEIM::Setfl *setfl, int ij, const std::string &elemA, const std::string &elemB); -private: + private: // potential parameters double division; double rbig; @@ -145,10 +142,10 @@ private: }; std::map elements; - std::map, PairData> pairs; + std::map, PairData> pairs; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_gw.cpp b/src/MANYBODY/pair_gw.cpp index 7e0cb3a3a2..71a0038bb6 100644 --- a/src/MANYBODY/pair_gw.cpp +++ b/src/MANYBODY/pair_gw.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_gw.h b/src/MANYBODY/pair_gw.h index 68fd366a79..ffd8665c05 100644 --- a/src/MANYBODY/pair_gw.h +++ b/src/MANYBODY/pair_gw.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gw,PairGW) - +// clang-format off +PairStyle(gw,PairGW); +// clang-format on #else #ifndef LMP_PAIR_GW_H @@ -38,31 +38,30 @@ class PairGW : public Pair { protected: struct Param { - double lam1,lam2,lam3; - double c,d,h; - double gamma,powerm; - double powern,beta; - double biga,bigb,bigd,bigr; - double cut,cutsq; - double c1,c2,c3,c4; - int ielement,jelement,kelement; + double lam1, lam2, lam3; + double c, d, h; + double gamma, powerm; + double powern, beta; + double biga, bigb, bigd, bigr; + double cut, cutsq; + double c1, c2, c3, c4; + int ielement, jelement, kelement; int powermint; - double Z_i,Z_j; - double ZBLcut,ZBLexpscale; + double Z_i, Z_j; + double ZBLcut, ZBLexpscale; }; - Param *params; // parameter set for an I-J-K interaction - double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements - int **pages; // neighbor list pages - int maxlocal; // size of numneigh, firstneigh arrays - int maxpage; // # of pages currently allocated - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom + int **pages; // neighbor list pages + int maxlocal; // size of numneigh, firstneigh arrays + int maxpage; // # of pages currently allocated + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom - - int *GW_numneigh; // # of pair neighbors for each atom - int **GW_firstneigh; // ptr to 1st neighbor of each atom + int *GW_numneigh; // # of pair neighbors for each atom + int **GW_firstneigh; // ptr to 1st neighbor of each atom void GW_neigh(); void add_pages(int howmany = 1); @@ -72,10 +71,9 @@ class PairGW : public Pair { void setup_params(); virtual void repulsive(Param *, double, double &, int, double &); double zeta(Param *, double, double, double *, double *); - virtual void force_zeta(Param *, double, double, double &, - double &, int, double &); - void attractive(Param *, double, double, double, double *, double *, - double *, double *, double *); + virtual void force_zeta(Param *, double, double, double &, double &, int, double &); + void attractive(Param *, double, double, double, double *, double *, double *, double *, + double *); double gw_fc(double, Param *); double gw_fc_d(double, Param *); @@ -84,36 +82,35 @@ class PairGW : public Pair { double gw_bij(double, Param *); double gw_bij_d(double, Param *); - void gw_zetaterm_d(double, double *, double, double *, double, - double *, double *, double *, Param *); - void costheta_d(double *, double, double *, double, - double *, double *, double *); + void gw_zetaterm_d(double, double *, double, double *, double, double *, double *, double *, + Param *); + void costheta_d(double *, double, double *, double, double *, double *, double *); // inlined functions for efficiency - inline double gw_gijk(const double costheta, - const Param * const param) const { + inline double gw_gijk(const double costheta, const Param *const param) const + { const double gw_c = param->c * param->c; const double gw_d = param->d * param->d; const double hcth = param->h - costheta; - //printf("gw_gijk: gw_c=%f gw_d=%f hcth=%f=%f-%f\n", gw_c, gw_d, hcth, param->h, costheta); + //printf("gw_gijk: gw_c=%f gw_d=%f hcth=%f=%f-%f\n", gw_c, gw_d, hcth, param->h, costheta); - return param->gamma*(1.0 + gw_c/gw_d - gw_c / (gw_d + hcth*hcth)); + return param->gamma * (1.0 + gw_c / gw_d - gw_c / (gw_d + hcth * hcth)); } - inline double gw_gijk_d(const double costheta, - const Param * const param) const { + inline double gw_gijk_d(const double costheta, const Param *const param) const + { const double gw_c = param->c * param->c; const double gw_d = param->d * param->d; const double hcth = param->h - costheta; const double numerator = -2.0 * gw_c * hcth; - const double denominator = 1.0/(gw_d + hcth*hcth); - return param->gamma*numerator*denominator*denominator; + const double denominator = 1.0 / (gw_d + hcth * hcth); + return param->gamma * numerator * denominator * denominator; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_gw_zbl.cpp b/src/MANYBODY/pair_gw_zbl.cpp index e166b1f1de..8045852f5a 100644 --- a/src/MANYBODY/pair_gw_zbl.cpp +++ b/src/MANYBODY/pair_gw_zbl.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_gw_zbl.h b/src/MANYBODY/pair_gw_zbl.h index 0c7c7e13e1..97a5d8ce8f 100644 --- a/src/MANYBODY/pair_gw_zbl.h +++ b/src/MANYBODY/pair_gw_zbl.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gw/zbl,PairGWZBL) - +// clang-format off +PairStyle(gw/zbl,PairGWZBL); +// clang-format on #else #ifndef LMP_PAIR_GW_ZBL_H @@ -32,9 +32,9 @@ class PairGWZBL : public PairGW { static constexpr int NPARAMS_PER_LINE = 21; private: - double global_a_0; // Bohr radius for Coulomb repulsion - double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion - double global_e; // proton charge (negative of electron charge) + double global_a_0; // Bohr radius for Coulomb repulsion + double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion + double global_e; // proton charge (negative of electron charge) void read_file(char *); void repulsive(Param *, double, double &, int, double &); @@ -46,7 +46,7 @@ class PairGWZBL : public PairGW { double F_fermi_d(double, Param *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp index 7c18dfee4c..1af884d814 100644 --- a/src/MANYBODY/pair_lcbop.cpp +++ b/src/MANYBODY/pair_lcbop.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_lcbop.h b/src/MANYBODY/pair_lcbop.h index 92ebca1ed8..9350283f18 100644 --- a/src/MANYBODY/pair_lcbop.h +++ b/src/MANYBODY/pair_lcbop.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,17 +12,17 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lcbop,PairLCBOP) - +// clang-format off +PairStyle(lcbop,PairLCBOP); +// clang-format on #else #ifndef LMP_PAIR_LCBOP_H #define LMP_PAIR_LCBOP_H +#include "math_const.h" #include "pair.h" #include -#include "math_const.h" namespace LAMMPS_NS { @@ -38,67 +38,55 @@ class PairLCBOP : public Pair { double memory_usage(); protected: - int **pages; // neighbor list pages + int **pages; // neighbor list pages - double cutLR; // LR cutoff + double cutLR; // LR cutoff - double cutLRsq; // LR cutoff squared - double cut3rebo; // maximum distance for 3rd SR neigh + double cutLRsq; // LR cutoff squared + double cut3rebo; // maximum distance for 3rd SR neigh - int maxlocal; // size of numneigh, firstneigh arrays - int maxpage; // # of pages currently allocated - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - MyPage *ipage; // neighbor list pages - int *SR_numneigh; // # of pair neighbors for each atom - int **SR_firstneigh; // ptr to 1st neighbor of each atom + int maxlocal; // size of numneigh, firstneigh arrays + int maxpage; // # of pages currently allocated + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + MyPage *ipage; // neighbor list pages + int *SR_numneigh; // # of pair neighbors for each atom + int **SR_firstneigh; // ptr to 1st neighbor of each atom - double *N; // sum of cutoff fns ( f_C ) with SR neighs - double *M; // sum_j f_C_ij*F(N_j - f_C_ij) + double *N; // sum of cutoff fns ( f_C ) with SR neighs + double *M; // sum_j f_C_ij*F(N_j - f_C_ij) - double - r_1, r_2, gamma_1, A, B_1, B_2, alpha, beta_1, beta_2, - d, C_1, C_4, C_6, L, kappa, R_0, R_1, - r_0, r_1_LR, r_2_LR, - v_1, v_2, eps_1, eps_2, lambda_1, lambda_2, eps, delta; + double r_1, r_2, gamma_1, A, B_1, B_2, alpha, beta_1, beta_2, d, C_1, C_4, C_6, L, kappa, R_0, + R_1, r_0, r_1_LR, r_2_LR, v_1, v_2, eps_1, eps_2, lambda_1, lambda_2, eps, delta; double r_2_sq; // splines coefficients struct TF_conj_field { - double - f_00, - f_01, - f_10, - f_11, - f_x_00, - f_x_01, - f_x_10, - f_x_11, - f_y_00, - f_y_01, - f_y_10, - f_y_11; + double f_00, f_01, f_10, f_11, f_x_00, f_x_01, f_x_10, f_x_11, f_y_00, f_y_01, f_y_10, f_y_11; } F_conj_field[3][3][2]; - double F_conj_data[4][4][2][3]; // temporary data from file - double gX[6]; // x coordinates for described points[# of points]; - double gC[5+1][6-1]; // coefficients for each period between described points [degree of polynomial+1][# of points-1] + double F_conj_data[4][4][2][3]; // temporary data from file + double gX[6]; // x coordinates for described points[# of points]; + double gC + [5 + 1] + [6 - + 1]; // coefficients for each period between described points [degree of polynomial+1][# of points-1] void SR_neigh(); void FSR(int, int); void FLR(int, int); - void FNij( int, int, double, double**, int ); - void FMij( int, int, double, double**, int ); - double bondorder( int, int, double*, double, double, double**, int ); - double b ( int, int, double*, double, double, double**, int ); + void FNij(int, int, double, double **, int); + void FMij(int, int, double, double **, int); + double bondorder(int, int, double *, double, double, double **, int); + double b(int, int, double *, double, double, double **, int); - double gSpline( double, double* ); - double hSpline( double, double* ); - void g_decompose_x( double, size_t*, double* ); - double F_conj( double, double, double, double*, double*, double* ); + double gSpline(double, double *); + double hSpline(double, double *); + void g_decompose_x(double, size_t *, double *); + double F_conj(double, double, double, double *, double *, double *); - void read_file( char * ); + void read_file(char *); void spline_init(); @@ -115,10 +103,11 @@ class PairLCBOP : public Pair { no side effects ------------------------------------------------------------------------- */ - inline double f_c(double Xij, double Xmin, double Xmax, double *dX) const { + inline double f_c(double Xij, double Xmin, double Xmax, double *dX) const + { double cutoff; - double t = (Xij-Xmin) / (Xmax-Xmin); + double t = (Xij - Xmin) / (Xmax - Xmin); if (t <= 0.0) { cutoff = 1.0; *dX = 0.0; @@ -126,9 +115,9 @@ class PairLCBOP : public Pair { cutoff = 0.0; *dX = 0.0; } else { - double z = t*t*t-1; - cutoff = exp( gamma_1*t*t*t/z ); - *dX = cutoff * (-3*gamma_1*t*t)/z/z / (Xmax-Xmin); + double z = t * t * t - 1; + cutoff = exp(gamma_1 * t * t * t / z); + *dX = cutoff * (-3 * gamma_1 * t * t) / z / z / (Xmax - Xmin); } return cutoff; }; @@ -139,10 +128,11 @@ class PairLCBOP : public Pair { no side effects ------------------------------------------------------------------------- */ - inline double f_c_LR(double Xij, double Xmin, double Xmax, double *dX) const { + inline double f_c_LR(double Xij, double Xmin, double Xmax, double *dX) const + { double cutoff; - double t = (Xij-Xmin) / (Xmax-Xmin); + double t = (Xij - Xmin) / (Xmax - Xmin); if (t <= 0.0) { cutoff = 1.0; //dX = 0.0; this way the derivative is inherited from previous cut off function call @@ -150,15 +140,14 @@ class PairLCBOP : public Pair { cutoff = 0.0; *dX = 0.0; } else { - cutoff = ( 1.0+cos(MathConst::MY_PI*t) )/2.0; - *dX = -MathConst::MY_PI*sin(MathConst::MY_PI*t)/2/(Xmax-Xmin); + cutoff = (1.0 + cos(MathConst::MY_PI * t)) / 2.0; + *dX = -MathConst::MY_PI * sin(MathConst::MY_PI * t) / 2 / (Xmax - Xmin); } return cutoff; }; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_nb3b_harmonic.cpp b/src/MANYBODY/pair_nb3b_harmonic.cpp index dfc4046eda..29895af774 100644 --- a/src/MANYBODY/pair_nb3b_harmonic.cpp +++ b/src/MANYBODY/pair_nb3b_harmonic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_nb3b_harmonic.h b/src/MANYBODY/pair_nb3b_harmonic.h index ee32dfcaee..159e7f8433 100644 --- a/src/MANYBODY/pair_nb3b_harmonic.h +++ b/src/MANYBODY/pair_nb3b_harmonic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- --------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(nb3b/harmonic,PairNb3bHarmonic) - +// clang-format off +PairStyle(nb3b/harmonic,PairNb3bHarmonic); +// clang-format on #else #ifndef LMP_PAIR_NB3B_HARMONIC_H @@ -39,22 +39,22 @@ class PairNb3bHarmonic : public Pair { protected: struct Param { double k_theta, theta0, cutoff; - double cut,cutsq; - int ielement,jelement,kelement; + double cut, cutsq; + int ielement, jelement, kelement; }; - double cutmax; // max cutoff for all elements - Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction void allocate(); void read_file(char *); void setup_params(); void twobody(Param *, double, double &, int, double &); - void threebody(Param *, Param *, Param *, double, double, double *, double *, - double *, double *, int, double &); + void threebody(Param *, Param *, Param *, double, double, double *, double *, double *, double *, + int, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_polymorphic.cpp b/src/MANYBODY/pair_polymorphic.cpp index 91f754152b..319f0dde8f 100644 --- a/src/MANYBODY/pair_polymorphic.cpp +++ b/src/MANYBODY/pair_polymorphic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_polymorphic.h b/src/MANYBODY/pair_polymorphic.h index 504253f589..b57a9a2268 100644 --- a/src/MANYBODY/pair_polymorphic.h +++ b/src/MANYBODY/pair_polymorphic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(polymorphic,PairPolymorphic) - +// clang-format off +PairStyle(polymorphic,PairPolymorphic); +// clang-format on #else #ifndef LMP_PAIR_POLYMORPHIC_H @@ -23,12 +23,11 @@ PairStyle(polymorphic,PairPolymorphic) #include "pair.h" namespace LAMMPS_NS { - // forward declaration - class TabularFunction; +// forward declaration +class TabularFunction; class PairPolymorphic : public Pair { public: - PairPolymorphic(class LAMMPS *); virtual ~PairPolymorphic(); virtual void compute(int, int); @@ -38,7 +37,6 @@ class PairPolymorphic : public Pair { double init_one(int, int); protected: - struct PairParameters { double cut; double cutsq; @@ -60,21 +58,21 @@ class PairPolymorphic : public Pair { double epsilon; int eta; - int nx,nr,ng; // table sizes + int nx, nr, ng; // table sizes double maxX; // parameter sets - PairParameters * pairParameters; // for I-J interaction - TripletParameters * tripletParameters; // for I-J-K interaction + PairParameters *pairParameters; // for I-J interaction + TripletParameters *tripletParameters; // for I-J-K interaction - int neighsize,numneighV,numneighW,numneighW1; - int *firstneighV,*firstneighW,*firstneighW1; - double *delxV,*delyV,*delzV,*drV; - double *delxW,*delyW,*delzW,*drW; + int neighsize, numneighV, numneighW, numneighW1; + int *firstneighV, *firstneighW, *firstneighW1; + double *delxV, *delyV, *delzV, *drV; + double *delxW, *delyW, *delzW, *drW; - double cutmax; // max cutoff for all elements + double cutmax; // max cutoff for all elements double cutmaxsq; - int npair,ntriple; + int npair, ntriple; int *match; void allocate(); @@ -84,17 +82,14 @@ class PairPolymorphic : public Pair { #if defined(LMP_POLYMORPHIC_WRITE_TABLES) void write_tables(int); #endif - void attractive(PairParameters *, PairParameters *, TripletParameters *, - double, double, double, double *, double *, double *, - double *, double *); + void attractive(PairParameters *, PairParameters *, TripletParameters *, double, double, double, + double *, double *, double *, double *, double *); - void ters_zetaterm_d(double, double *, double, double *, double, double *, - double *, double *, PairParameters *, PairParameters *, - TripletParameters *); - void costheta_d(double *, double, double *, double, - double *, double *, double *); + void ters_zetaterm_d(double, double *, double, double *, double, double *, double *, double *, + PairParameters *, PairParameters *, TripletParameters *); + void costheta_d(double *, double, double *, double, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_rebo.cpp b/src/MANYBODY/pair_rebo.cpp index c487b3bb6a..0c53f4a538 100644 --- a/src/MANYBODY/pair_rebo.cpp +++ b/src/MANYBODY/pair_rebo.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_rebo.h b/src/MANYBODY/pair_rebo.h index 42d50b47ac..94e5b9a228 100644 --- a/src/MANYBODY/pair_rebo.h +++ b/src/MANYBODY/pair_rebo.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(rebo,PairREBO) - +// clang-format off +PairStyle(rebo,PairREBO); +// clang-format on #else #ifndef LMP_PAIR_REBO_H @@ -31,7 +31,7 @@ class PairREBO : public PairAIREBO { void spline_init(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_sw.cpp b/src/MANYBODY/pair_sw.cpp index fe7e56456e..75ece1dc71 100644 --- a/src/MANYBODY/pair_sw.cpp +++ b/src/MANYBODY/pair_sw.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_sw.h b/src/MANYBODY/pair_sw.h index 21f9bb0819..5f6f51b57c 100644 --- a/src/MANYBODY/pair_sw.h +++ b/src/MANYBODY/pair_sw.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(sw,PairSW) - +// clang-format off +PairStyle(sw,PairSW); +// clang-format on #else #ifndef LMP_PAIR_SW_H @@ -37,32 +37,32 @@ class PairSW : public Pair { static constexpr int NPARAMS_PER_LINE = 14; struct Param { - double epsilon,sigma; - double littlea,lambda,gamma,costheta; - double biga,bigb; - double powerp,powerq; + double epsilon, sigma; + double littlea, lambda, gamma, costheta; + double biga, bigb; + double powerp, powerq; double tol; - double cut,cutsq; - double sigma_gamma,lambda_epsilon,lambda_epsilon2; - double c1,c2,c3,c4,c5,c6; - int ielement,jelement,kelement; + double cut, cutsq; + double sigma_gamma, lambda_epsilon, lambda_epsilon2; + double c1, c2, c3, c4, c5, c6; + int ielement, jelement, kelement; }; protected: - double cutmax; // max cutoff for all elements - Param *params; // parameter set for an I-J-K interaction - int maxshort; // size of short neighbor list array - int *neighshort; // short neighbor list array + double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction + int maxshort; // size of short neighbor list array + int *neighshort; // short neighbor list array virtual void allocate(); void read_file(char *); virtual void setup_params(); void twobody(Param *, double, double &, int, double &); - void threebody(Param *, Param *, Param *, double, double, double *, double *, - double *, double *, int, double &); + void threebody(Param *, Param *, Param *, double, double, double *, double *, double *, double *, + int, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp index 2a642e6244..33682ce3fa 100644 --- a/src/MANYBODY/pair_tersoff.cpp +++ b/src/MANYBODY/pair_tersoff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_tersoff.h b/src/MANYBODY/pair_tersoff.h index 16bfcd7d57..f1ee2a1100 100644 --- a/src/MANYBODY/pair_tersoff.h +++ b/src/MANYBODY/pair_tersoff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff,PairTersoff) - +// clang-format off +PairStyle(tersoff,PairTersoff); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_H @@ -34,47 +34,44 @@ class PairTersoff : public Pair { virtual void init_style(); double init_one(int, int); - template - void eval(); + template void eval(); static constexpr int NPARAMS_PER_LINE = 17; protected: - struct Param { - double lam1,lam2,lam3; - double c,d,h; - double gamma,powerm; - double powern,beta; - double biga,bigb,bigd,bigr; - double cut,cutsq; - double c1,c2,c3,c4; - int ielement,jelement,kelement; + double lam1, lam2, lam3; + double c, d, h; + double gamma, powerm; + double powern, beta; + double biga, bigb, bigd, bigr; + double cut, cutsq; + double c1, c2, c3, c4; + int ielement, jelement, kelement; int powermint; - double Z_i,Z_j; // added for TersoffZBL - double ZBLcut,ZBLexpscale; - double c5,ca1,ca4; // added for TersoffMOD + double Z_i, Z_j; // added for TersoffZBL + double ZBLcut, ZBLexpscale; + double c5, ca1, ca4; // added for TersoffMOD double powern_del; - double c0; // added for TersoffMODC + double c0; // added for TersoffMODC }; - 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 - int *neighshort; // short neighbor list array + 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 + int *neighshort; // short neighbor list array - int shift_flag; // flag to turn on/off shift - double shift; // negative change in equilibrium bond length + int shift_flag; // flag to turn on/off shift + double shift; // negative change in equilibrium bond length virtual void allocate(); virtual void read_file(char *); virtual void setup_params(); virtual void repulsive(Param *, double, double &, int, double &); virtual double zeta(Param *, double, double, double *, double *); - virtual void force_zeta(Param *, double, double, double &, - double &, int, double &); - void attractive(Param *, double, double, double, double *, double *, - double *, double *, double *); + virtual void force_zeta(Param *, double, double, double &, double &, int, double &); + void attractive(Param *, double, double, double, double *, double *, double *, double *, + double *); virtual double ters_fc(double, Param *); virtual double ters_fc_d(double, Param *); @@ -83,35 +80,33 @@ class PairTersoff : public Pair { virtual double ters_bij(double, Param *); virtual double ters_bij_d(double, Param *); - virtual void ters_zetaterm_d(double, double *, double, double, - double *, double, double, - double *, double *, double *, Param *); - void costheta_d(double *, double, double *, double, - double *, double *, double *); + virtual void ters_zetaterm_d(double, double *, double, double, double *, double, double, double *, + double *, double *, Param *); + void costheta_d(double *, double, double *, double, double *, double *, double *); // inlined functions for efficiency - inline double ters_gijk(const double costheta, - const Param * const param) const { + inline double ters_gijk(const double costheta, const Param *const param) const + { const double ters_c = param->c * param->c; const double ters_d = param->d * param->d; const double hcth = param->h - costheta; - return param->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)); } - inline double ters_gijk_d(const double costheta, - const Param * const param) const { + inline double ters_gijk_d(const double costheta, const Param *const param) const + { const double ters_c = param->c * param->c; const double ters_d = param->d * param->d; const double hcth = param->h - costheta; const double numerator = -2.0 * ters_c * hcth; - const double denominator = 1.0/(ters_d + hcth*hcth); - return param->gamma*numerator*denominator*denominator; + const double denominator = 1.0 / (ters_d + hcth * hcth); + return param->gamma * numerator * denominator * denominator; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_tersoff_mod.cpp b/src/MANYBODY/pair_tersoff_mod.cpp index 465bc0ebd0..939dcfddd6 100644 --- a/src/MANYBODY/pair_tersoff_mod.cpp +++ b/src/MANYBODY/pair_tersoff_mod.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_tersoff_mod.h b/src/MANYBODY/pair_tersoff_mod.h index 8d68e1c9bd..8ae2c56a89 100644 --- a/src/MANYBODY/pair_tersoff_mod.h +++ b/src/MANYBODY/pair_tersoff_mod.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/mod,PairTersoffMOD) - +// clang-format off +PairStyle(tersoff/mod,PairTersoffMOD); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_MOD_H @@ -41,43 +41,42 @@ class PairTersoffMOD : public PairTersoff { double ters_fc_d(double, Param *); double ters_bij(double, Param *); double ters_bij_d(double, Param *); - void ters_zetaterm_d(double, double *, double, double, - double *, double, double, - double *, double *, double *, Param *); + void ters_zetaterm_d(double, double *, double, double, double *, double, double, double *, + double *, double *, Param *); // inlined functions for efficiency // these replace but do not override versions in PairTersoff // since overriding virtual inlined functions is best avoided - inline double ters_gijk_mod(const double costheta, - const Param * const param) const { + inline double ters_gijk_mod(const double costheta, const Param *const param) const + { const double ters_c1 = param->c1; const double ters_c2 = param->c2; const double ters_c3 = param->c3; const double ters_c4 = param->c4; const double ters_c5 = param->c5; - const double tmp_h = (param->h - costheta)*(param->h - costheta); + const double tmp_h = (param->h - costheta) * (param->h - costheta); - return ters_c1 + (ters_c2*tmp_h/(ters_c3 + tmp_h)) * - (1.0 + ters_c4*exp(-ters_c5*tmp_h)); + return ters_c1 + + (ters_c2 * tmp_h / (ters_c3 + tmp_h)) * (1.0 + ters_c4 * exp(-ters_c5 * tmp_h)); } - inline double ters_gijk_d_mod(const double costheta, - const Param * const param) const { + inline double ters_gijk_d_mod(const double costheta, const Param *const param) const + { const double ters_c2 = param->c2; const double ters_c3 = param->c3; const double ters_c4 = param->c4; const double ters_c5 = param->c5; - const double tmp_h = (param->h - costheta)*(param->h - costheta); - const double g1 = (param->h - costheta)/(ters_c3 + tmp_h); - const double g2 = exp(-ters_c5*tmp_h); + const double tmp_h = (param->h - costheta) * (param->h - costheta); + const double g1 = (param->h - costheta) / (ters_c3 + tmp_h); + const double g2 = exp(-ters_c5 * tmp_h); - return -2.0*ters_c2*g1*((1 + ters_c4*g2)*(1 + g1*(costheta - param->h)) - - tmp_h*ters_c4*ters_c5*g2); + return -2.0 * ters_c2 * g1 * + ((1 + ters_c4 * g2) * (1 + g1 * (costheta - param->h)) - tmp_h * ters_c4 * ters_c5 * g2); } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_tersoff_mod_c.cpp b/src/MANYBODY/pair_tersoff_mod_c.cpp index 25bc735b9b..6dbf49efdf 100644 --- a/src/MANYBODY/pair_tersoff_mod_c.cpp +++ b/src/MANYBODY/pair_tersoff_mod_c.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_tersoff_mod_c.h b/src/MANYBODY/pair_tersoff_mod_c.h index 1491941a2c..09565fb9de 100644 --- a/src/MANYBODY/pair_tersoff_mod_c.h +++ b/src/MANYBODY/pair_tersoff_mod_c.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/mod/c,PairTersoffMODC) - +// clang-format off +PairStyle(tersoff/mod/c,PairTersoffMODC); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_MOD_C_H @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class PairTersoffMODC : public PairTersoffMOD { public: - PairTersoffMODC(class LAMMPS *lmp) : PairTersoffMOD(lmp) {}; + PairTersoffMODC(class LAMMPS *lmp) : PairTersoffMOD(lmp){}; ~PairTersoffMODC() {} static constexpr int NPARAMS_PER_LINE = 21; @@ -36,7 +36,7 @@ class PairTersoffMODC : public PairTersoffMOD { void repulsive(Param *, double, double &, int, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_tersoff_zbl.cpp b/src/MANYBODY/pair_tersoff_zbl.cpp index 404868f969..c1d420dabb 100644 --- a/src/MANYBODY/pair_tersoff_zbl.cpp +++ b/src/MANYBODY/pair_tersoff_zbl.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_tersoff_zbl.h b/src/MANYBODY/pair_tersoff_zbl.h index b489563928..ea081cce77 100644 --- a/src/MANYBODY/pair_tersoff_zbl.h +++ b/src/MANYBODY/pair_tersoff_zbl.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/zbl,PairTersoffZBL) - +// clang-format off +PairStyle(tersoff/zbl,PairTersoffZBL); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_ZBL_H @@ -32,9 +32,9 @@ class PairTersoffZBL : public PairTersoff { static constexpr int NPARAMS_PER_LINE = 21; protected: - double global_a_0; // Bohr radius for Coulomb repulsion - double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion - double global_e; // proton charge (negative of electron charge) + double global_a_0; // Bohr radius for Coulomb repulsion + double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion + double global_e; // proton charge (negative of electron charge) void read_file(char *); void repulsive(Param *, double, double &, int, double &); @@ -46,7 +46,7 @@ class PairTersoffZBL : public PairTersoff { double F_fermi_d(double, Param *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_vashishta.cpp b/src/MANYBODY/pair_vashishta.cpp index cacfa7078e..3ea3747467 100644 --- a/src/MANYBODY/pair_vashishta.cpp +++ b/src/MANYBODY/pair_vashishta.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_vashishta.h b/src/MANYBODY/pair_vashishta.h index 468a33b4cc..bfb527439c 100644 --- a/src/MANYBODY/pair_vashishta.h +++ b/src/MANYBODY/pair_vashishta.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(vashishta,PairVashishta) - +// clang-format off +PairStyle(vashishta,PairVashishta); +// clang-format on #else #ifndef LMP_PAIR_VASHISHITA_H @@ -37,31 +37,32 @@ class PairVashishta : public Pair { static constexpr int NPARAMS_PER_LINE = 17; struct Param { - double bigb,gamma,r0,bigc,costheta; - double bigh,eta,zi,zj; - double lambda1,bigd,mbigd,lambda4,bigw,cut; - double lam1inv,lam4inv,zizj,heta,big2b,big6w; - double rcinv,rc2inv,rc4inv,rc6inv,rceta; - double cutsq2,cutsq; - double lam1rc,lam4rc,vrcc2,vrcc3,vrc,dvrc,c0; - int ielement,jelement,kelement; + double bigb, gamma, r0, bigc, costheta; + double bigh, eta, zi, zj; + double lambda1, bigd, mbigd, lambda4, bigw, cut; + double lam1inv, lam4inv, zizj, heta, big2b, big6w; + double rcinv, rc2inv, rc4inv, rc6inv, rceta; + double cutsq2, cutsq; + double lam1rc, lam4rc, vrcc2, vrcc3, vrc, dvrc, c0; + int ielement, jelement, kelement; }; + protected: - double cutmax; // max cutoff for all elements - Param *params; // parameter set for an I-J-K interaction - double r0max; // largest value of r0 - int maxshort; // size of short neighbor list array - int *neighshort; // short neighbor list array + double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction + double r0max; // largest value of r0 + int maxshort; // size of short neighbor list array + int *neighshort; // short neighbor list array void allocate(); void read_file(char *); virtual void setup_params(); void twobody(Param *, double, double &, int, double &); - void threebody(Param *, Param *, Param *, double, double, double *, double *, - double *, double *, int, double &); + void threebody(Param *, Param *, Param *, double, double, double *, double *, double *, double *, + int, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_vashishta_table.cpp b/src/MANYBODY/pair_vashishta_table.cpp index 05d9703443..a39f2b90ec 100644 --- a/src/MANYBODY/pair_vashishta_table.cpp +++ b/src/MANYBODY/pair_vashishta_table.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MANYBODY/pair_vashishta_table.h b/src/MANYBODY/pair_vashishta_table.h index dade008fc8..7033fdc163 100644 --- a/src/MANYBODY/pair_vashishta_table.h +++ b/src/MANYBODY/pair_vashishta_table.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(vashishta/table,PairVashishtaTable) - +// clang-format off +PairStyle(vashishta/table,PairVashishtaTable); +// clang-format on #else #ifndef LMP_PAIR_VASHISHITA_TABLE_H @@ -36,15 +36,15 @@ class PairVashishtaTable : public PairVashishta { int ntable; double deltaR2; double oneOverDeltaR2; - double ***forceTable; // table of forces per element pair - double ***potentialTable; // table of potential energies + double ***forceTable; // table of forces per element pair + double ***potentialTable; // table of potential energies void twobody_table(const Param &, double, double &, int, double &); void setup_params(); void create_tables(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_atom_swap.cpp b/src/MC/fix_atom_swap.cpp index d055d57b88..e2fa4823bf 100644 --- a/src/MC/fix_atom_swap.cpp +++ b/src/MC/fix_atom_swap.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MC/fix_atom_swap.h b/src/MC/fix_atom_swap.h index 7c56624ad1..a77b5a944e 100644 --- a/src/MC/fix_atom_swap.h +++ b/src/MC/fix_atom_swap.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(atom/swap,FixAtomSwap) - +// clang-format off +FixStyle(atom/swap,FixAtomSwap); +// clang-format on #else #ifndef LMP_FIX_MCSWAP_H @@ -47,21 +47,21 @@ class FixAtomSwap : public Fix { void restart(char *); private: - int nevery,seed; - int conserve_ke_flag; // yes = conserve ke, no = do not conserve ke - int semi_grand_flag; // yes = semi-grand canonical, no = constant composition + int nevery, seed; + int conserve_ke_flag; // yes = conserve ke, no = do not conserve ke + int semi_grand_flag; // yes = semi-grand canonical, no = constant composition int ncycles; - int niswap,njswap; // # of i,j swap atoms on all procs - int niswap_local,njswap_local; // # of swap atoms on this proc - int niswap_before,njswap_before; // # of swap atoms on procs < this proc - int nswap; // # of swap atoms on all procs - int nswap_local; // # of swap atoms on this proc - int nswap_before; // # of swap atoms on procs < this proc - int regionflag; // 0 = anywhere in box, 1 = specific region - int iregion; // swap region - char *idregion; // swap region id + int niswap, njswap; // # of i,j swap atoms on all procs + int niswap_local, njswap_local; // # of swap atoms on this proc + int niswap_before, njswap_before; // # of swap atoms on procs < this proc + int nswap; // # of swap atoms on all procs + int nswap_local; // # of swap atoms on this proc + int nswap_before; // # of swap atoms on procs < this proc + int regionflag; // 0 = anywhere in box, 1 = specific region + int iregion; // swap region + char *idregion; // swap region id - int nswaptypes,nmutypes; + int nswaptypes, nmutypes; int *type_list; double *mu; @@ -87,7 +87,7 @@ class FixAtomSwap : public Fix { void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index 8974b9039f..f1860ba3ec 100644 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MC/fix_bond_break.h b/src/MC/fix_bond_break.h index e3bdcb01fa..d6fdd8850b 100644 --- a/src/MC/fix_bond_break.h +++ b/src/MC/fix_bond_break.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(bond/break,FixBondBreak) - +// clang-format off +FixStyle(bond/break,FixBondBreak); +// clang-format on #else #ifndef LMP_FIX_BOND_BREAK_H @@ -31,7 +31,7 @@ class FixBondBreak : public Fix { int setmask(); void init(); void post_integrate(); - void post_integrate_respa(int,int); + void post_integrate_respa(int, int); int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); @@ -41,18 +41,18 @@ class FixBondBreak : public Fix { double memory_usage(); private: - int me,nprocs; - int btype,seed; - double cutoff,cutsq,fraction; - int angleflag,dihedralflag,improperflag; + int me, nprocs; + int btype, seed; + double cutoff, cutsq, fraction; + int angleflag, dihedralflag, improperflag; bigint lastcheck; - int breakcount,breakcounttotal; + int breakcount, breakcounttotal; int nmax; - tagint *partner,*finalpartner; - double *distsq,*probability; + tagint *partner, *finalpartner; + double *distsq, *probability; - int nbreak,maxbreak; + int nbreak, maxbreak; tagint **broken; tagint *copy; @@ -62,7 +62,7 @@ class FixBondBreak : public Fix { int commflag; int nbroken; - int nangles,ndihedrals,nimpropers; + int nangles, ndihedrals, nimpropers; void check_ghosts(); void update_topology(); @@ -78,7 +78,7 @@ class FixBondBreak : public Fix { void print_copy(const char *, tagint, int, int, int, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index 634837595b..2a4ba5ad6c 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MC/fix_bond_create.h b/src/MC/fix_bond_create.h index 333e98630e..df29c91369 100644 --- a/src/MC/fix_bond_create.h +++ b/src/MC/fix_bond_create.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(bond/create,FixBondCreate) - +// clang-format off +FixStyle(bond/create,FixBondCreate); +// clang-format on #else #ifndef LMP_FIX_BOND_CREATE_H @@ -48,26 +48,26 @@ class FixBondCreate : public Fix { protected: int me; - int iatomtype,jatomtype; - int btype,seed; - int imaxbond,jmaxbond; - int inewtype,jnewtype; - int constrainflag,constrainpass; - double amin,amax; - double cutsq,fraction; - int atype,dtype,itype; - int angleflag,dihedralflag,improperflag; + int iatomtype, jatomtype; + int btype, seed; + int imaxbond, jmaxbond; + int inewtype, jnewtype; + int constrainflag, constrainpass; + double amin, amax; + double cutsq, fraction; + int atype, dtype, itype; + int angleflag, dihedralflag, improperflag; int overflow; tagint lastcheck; int *bondcount; - int createcount,createcounttotal; + int createcount, createcounttotal; int nmax; - tagint *partner,*finalpartner; - double *distsq,*probability; + tagint *partner, *finalpartner; + double *distsq, *probability; - int ncreate,maxcreate; + int ncreate, maxcreate; tagint **created; tagint *copy; @@ -75,9 +75,9 @@ class FixBondCreate : public Fix { class RanMars *random; class NeighList *list; - int countflag,commflag; + int countflag, commflag; int nlevels_respa; - int nangles,ndihedrals,nimpropers; + int nangles, ndihedrals, nimpropers; void check_ghosts(); void update_topology(); @@ -87,7 +87,7 @@ class FixBondCreate : public Fix { void create_impropers(int); int dedup(int, int, tagint *); - virtual int constrain(int, int, double, double) {return 1;} + virtual int constrain(int, int, double, double) { return 1; } // DEBUG @@ -95,7 +95,7 @@ class FixBondCreate : public Fix { void print_copy(const char *, tagint, int, int, int, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_bond_create_angle.cpp b/src/MC/fix_bond_create_angle.cpp index c57bdee895..3ebda59f0d 100644 --- a/src/MC/fix_bond_create_angle.cpp +++ b/src/MC/fix_bond_create_angle.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MC/fix_bond_create_angle.h b/src/MC/fix_bond_create_angle.h index 320f3225f1..d7563f1d78 100644 --- a/src/MC/fix_bond_create_angle.h +++ b/src/MC/fix_bond_create_angle.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(bond/create/angle,FixBondCreateAngle) - +// clang-format off +FixStyle(bond/create/angle,FixBondCreateAngle); +// clang-format on #else #ifndef LMP_FIX_BOND_CREATE_ANGLE_H @@ -32,7 +32,7 @@ class FixBondCreateAngle : public FixBondCreate { int constrain(int, int, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp index 1f3026888a..babaecc2bd 100644 --- a/src/MC/fix_bond_swap.cpp +++ b/src/MC/fix_bond_swap.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MC/fix_bond_swap.h b/src/MC/fix_bond_swap.h index ad72ac66aa..e0691233f5 100644 --- a/src/MC/fix_bond_swap.h +++ b/src/MC/fix_bond_swap.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(bond/swap,FixBondSwap) - +// clang-format off +FixStyle(bond/swap,FixBondSwap); +// clang-format on #else #ifndef LMP_FIX_BONDSWAP_H @@ -37,10 +37,10 @@ class FixBondSwap : public Fix { double memory_usage(); private: - double fraction,cutsq; - int nmax,tflag; + double fraction, cutsq; + int nmax, tflag; int *alist; - int naccept,foursome; + int naccept, foursome; int angleflag; char *id_temp; int *type; @@ -56,7 +56,7 @@ class FixBondSwap : public Fix { double angle_eng(int, int, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_charge_regulation.cpp b/src/MC/fix_charge_regulation.cpp index 416d0541c3..309d390ca4 100644 --- a/src/MC/fix_charge_regulation.cpp +++ b/src/MC/fix_charge_regulation.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MC/fix_charge_regulation.h b/src/MC/fix_charge_regulation.h index 4f7ae57f96..bd4ab22a07 100644 --- a/src/MC/fix_charge_regulation.h +++ b/src/MC/fix_charge_regulation.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(charge/regulation,FixChargeRegulation) - +// clang-format off +FixStyle(charge/regulation,FixChargeRegulation); +// clang-format on #else #ifndef LMP_FIX_CHARGE_REGULATION_H @@ -28,79 +28,84 @@ FixStyle(charge/regulation,FixChargeRegulation) namespace LAMMPS_NS { - class FixChargeRegulation : public Fix { - public: - FixChargeRegulation(class LAMMPS *, int, char **); - ~FixChargeRegulation(); - int setmask(); - void init(); - void pre_exchange(); - void forward_acid(); - void backward_acid(); - void forward_base(); - void backward_base(); - void forward_ions(); - void forward_ions_multival(); - void backward_ions(); - void backward_ions_multival(); - int get_random_particle(int, double, double, double *); - int insert_particle(int, double, double, double *); - double energy_full(); - int particle_number(int, double); - int particle_number_xrd(int, double, double, double *); - double compute_vector(int n); - void assign_tags(); - void options(int, char **); - void setThermoTemperaturePointer(); - double memory_usage(); +class FixChargeRegulation : public Fix { + public: + FixChargeRegulation(class LAMMPS *, int, char **); + ~FixChargeRegulation(); + int setmask(); + void init(); + void pre_exchange(); + void forward_acid(); + void backward_acid(); + void forward_base(); + void backward_base(); + void forward_ions(); + void forward_ions_multival(); + void backward_ions(); + void backward_ions_multival(); + int get_random_particle(int, double, double, double *); + int insert_particle(int, double, double, double *); + double energy_full(); + int particle_number(int, double); + int particle_number_xrd(int, double, double, double *); + double compute_vector(int n); + void assign_tags(); + void options(int, char **); + void setThermoTemperaturePointer(); + double memory_usage(); - private: - int exclusion_group, exclusion_group_bit; - int nevery, seed; // begin MC cycle every nevery MD timesteps, random seed - int nmc; // MC move attempts per cycle - double llength_unit_in_nm ; // LAMMPS unit of length in nm, needed since chemical potentials are in units of mol/l - double pH, pKa, pKb, pKs, pI_plus, pI_minus; // chemical potentials and equilibrium constant in log10 base - double c10pH, c10pKa, c10pKb, c10pOH, c10pI_plus, c10pI_minus; // 10 raised to chemical potential value, in units of concentration [mol/liter] - double pmcmoves[3]; // mc move attempt probability: acid, base, ion pair exchange - double pmcc; // mc move cumulative attempt probability - int npart_xrd; // # of particles (ions) within xrd - int npart_xrd2; // # of particles (ions) within xrd - double vlocal_xrd; // # local volume within xrd - bool only_salt_flag; // true if performing only salt insertion/deletion, no acid/base dissociation. - bool add_tags_flag; // true if each inserted atom gets its unique atom tag - int groupbitall; // group bitmask for inserted atoms - int ngroups; // number of group-ids for inserted atoms - char **groupstrings; // list of group-ids for inserted atoms + private: + int exclusion_group, exclusion_group_bit; + int nevery, seed; // begin MC cycle every nevery MD timesteps, random seed + int nmc; // MC move attempts per cycle + double + llength_unit_in_nm; // LAMMPS unit of length in nm, needed since chemical potentials are in units of mol/l + double pH, pKa, pKb, pKs, pI_plus, + pI_minus; // chemical potentials and equilibrium constant in log10 base + double c10pH, c10pKa, c10pKb, c10pOH, c10pI_plus, + c10pI_minus; // 10 raised to chemical potential value, in units of concentration [mol/liter] + double pmcmoves[3]; // mc move attempt probability: acid, base, ion pair exchange + double pmcc; // mc move cumulative attempt probability + int npart_xrd; // # of particles (ions) within xrd + int npart_xrd2; // # of particles (ions) within xrd + double vlocal_xrd; // # local volume within xrd + bool + only_salt_flag; // true if performing only salt insertion/deletion, no acid/base dissociation. + bool add_tags_flag; // true if each inserted atom gets its unique atom tag + int groupbitall; // group bitmask for inserted atoms + int ngroups; // number of group-ids for inserted atoms + char **groupstrings; // list of group-ids for inserted atoms - // counters - unsigned long int nacid_attempts, nacid_successes, nbase_attempts, nbase_successes, nsalt_attempts, nsalt_successes; - int nacid_neutral, nacid_charged, nbase_neutral, nbase_charged, ncation, nanion; // particle type counts - int cr_nmax; // max number of local particles - double reservoir_temperature; - double beta, sigma, volume, volume_rx; // inverse temperature, speed, total volume, reacting volume - int salt_charge[2]; // charge of salt ions: [0] - cation, [1] - anion - int salt_charge_ratio; // charge ratio when using multivalent ion exchange - double xlo, xhi, ylo, yhi, zlo, zhi; // box size - double energy_stored; // full energy of old/current configuration - int triclinic; // 0 = orthog box, 1 = triclinic - double *sublo, *subhi; // triclinic size - int *ptype_ID; // particle ID array - double overlap_cutoffsq; // square distance cutoff for overlap - int overlap_flag; - int acid_type, cation_type, base_type, anion_type; // reacting atom types - int reaction_distance_flag; // radial reaction restriction flag - double reaction_distance; // max radial distance from acid/base for ion insertion + // counters + unsigned long int nacid_attempts, nacid_successes, nbase_attempts, nbase_successes, + nsalt_attempts, nsalt_successes; + int nacid_neutral, nacid_charged, nbase_neutral, nbase_charged, ncation, + nanion; // particle type counts + int cr_nmax; // max number of local particles + double reservoir_temperature; + double beta, sigma, volume, + volume_rx; // inverse temperature, speed, total volume, reacting volume + int salt_charge[2]; // charge of salt ions: [0] - cation, [1] - anion + int salt_charge_ratio; // charge ratio when using multivalent ion exchange + double xlo, xhi, ylo, yhi, zlo, zhi; // box size + double energy_stored; // full energy of old/current configuration + int triclinic; // 0 = orthog box, 1 = triclinic + double *sublo, *subhi; // triclinic size + int *ptype_ID; // particle ID array + double overlap_cutoffsq; // square distance cutoff for overlap + int overlap_flag; + int acid_type, cation_type, base_type, anion_type; // reacting atom types + int reaction_distance_flag; // radial reaction restriction flag + double reaction_distance; // max radial distance from acid/base for ion insertion - - class Pair *pair; - class Compute *c_pe; // energy compute pointer - class RanPark *random_equal; // random number generator - class RanPark *random_unequal; // random number generator - char *idftemp; // pointer to the temperature fix - double *target_temperature_tcp; // current temperature of the thermostat - - }; -} + class Pair *pair; + class Compute *c_pe; // energy compute pointer + class RanPark *random_equal; // random number generator + class RanPark *random_unequal; // random number generator + char *idftemp; // pointer to the temperature fix + double *target_temperature_tcp; // current temperature of the thermostat +}; +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index 3ab6327404..e275cd8c11 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MC/fix_gcmc.h b/src/MC/fix_gcmc.h index 99153865f2..44b7f2078d 100644 --- a/src/MC/fix_gcmc.h +++ b/src/MC/fix_gcmc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(gcmc,FixGCMC) - +// clang-format off +FixStyle(gcmc,FixGCMC); +// clang-format on #else #ifndef LMP_FIX_GCMC_H @@ -59,34 +59,34 @@ class FixGCMC : public Fix { void grow_molecule_arrays(int); private: - int molecule_group,molecule_group_bit; + int molecule_group, molecule_group_bit; int molecule_group_inversebit; - int exclusion_group,exclusion_group_bit; - int ngcmc_type,nevery,seed; - int ncycles,nexchanges,nmcmoves; + int exclusion_group, exclusion_group_bit; + int ngcmc_type, nevery, seed; + int ncycles, nexchanges, nmcmoves; double patomtrans, pmoltrans, pmolrotate, pmctot; - int ngas; // # of gas atoms on all procs - int ngas_local; // # of gas atoms on this proc - int ngas_before; // # of gas atoms on procs < this proc - int exchmode; // exchange ATOM or MOLECULE - int movemode; // move ATOM or MOLECULE - int regionflag; // 0 = anywhere in box, 1 = specific region - int iregion; // gcmc region - char *idregion; // gcmc region id - bool pressure_flag; // true if user specified reservoir pressure - bool charge_flag; // true if user specified atomic charge - bool full_flag; // true if doing full system energy calculations + int ngas; // # of gas atoms on all procs + int ngas_local; // # of gas atoms on this proc + int ngas_before; // # of gas atoms on procs < this proc + int exchmode; // exchange ATOM or MOLECULE + int movemode; // move ATOM or MOLECULE + int regionflag; // 0 = anywhere in box, 1 = specific region + int iregion; // gcmc region + char *idregion; // gcmc region id + bool pressure_flag; // true if user specified reservoir pressure + bool charge_flag; // true if user specified atomic charge + bool full_flag; // true if doing full system energy calculations - int natoms_per_molecule; // number of atoms in each inserted molecule - int nmaxmolatoms; // number of atoms allocated for molecule arrays + int natoms_per_molecule; // number of atoms in each inserted molecule + int nmaxmolatoms; // number of atoms allocated for molecule arrays - int groupbitall; // group bitmask for inserted atoms - int ngroups; // number of group-ids for inserted atoms - char** groupstrings; // list of group-ids for inserted atoms - int ngrouptypes; // number of type-based group-ids for inserted atoms - char** grouptypestrings; // list of type-based group-ids for inserted atoms - int* grouptypebits; // list of type-based group bitmasks - int* grouptypes; // list of type-based group types + int groupbitall; // group bitmask for inserted atoms + int ngroups; // number of group-ids for inserted atoms + char **groupstrings; // list of group-ids for inserted atoms + int ngrouptypes; // number of type-based group-ids for inserted atoms + char **grouptypestrings; // list of type-based group-ids for inserted atoms + int *grouptypebits; // list of type-based group bitmasks + int *grouptypes; // list of type-based group types double ntranslation_attempts; double ntranslation_successes; double nrotation_attempts; @@ -104,20 +104,20 @@ class FixGCMC : public Fix { double chemical_potential; double displace; double max_rotation_angle; - double beta,zz,sigma,volume; - double pressure,fugacity_coeff,charge; - double xlo,xhi,ylo,yhi,zlo,zhi; - double region_xlo,region_xhi,region_ylo,region_yhi,region_zlo,region_zhi; + double beta, zz, sigma, volume; + double pressure, fugacity_coeff, charge; + double xlo, xhi, ylo, yhi, zlo, zhi; + double region_xlo, region_xhi, region_ylo, region_yhi, region_zlo, region_zhi; double region_volume; - double energy_stored; // full energy of old/current configuration - double *sublo,*subhi; + double energy_stored; // full energy of old/current configuration + double *sublo, *subhi; int *local_gas_list; double **cutsq; double **molcoords; double *molq; imageint *molimage; imageint imagezero; - double overlap_cutoffsq; // square distance cutoff for overlap + double overlap_cutoffsq; // square distance cutoff for overlap int overlap_flag; int max_ngas; int min_ngas; @@ -132,18 +132,18 @@ class FixGCMC : public Fix { class Atom *model_atom; class Molecule **onemols; - int imol,nmol; + int imol, nmol; class Fix *fixrigid, *fixshake; int rigidflag, shakeflag; char *idrigid, *idshake; - int triclinic; // 0 = orthog box, 1 = triclinic + int triclinic; // 0 = orthog box, 1 = triclinic class Compute *c_pe; void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_tfmc.cpp b/src/MC/fix_tfmc.cpp index ff49d84f6b..84371b9f2b 100644 --- a/src/MC/fix_tfmc.cpp +++ b/src/MC/fix_tfmc.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MC/fix_tfmc.h b/src/MC/fix_tfmc.h index 6b95704612..ea68d4fc6a 100644 --- a/src/MC/fix_tfmc.h +++ b/src/MC/fix_tfmc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(tfmc,FixTFMC) - +// clang-format off +FixStyle(tfmc,FixTFMC); +// clang-format on #else #ifndef LMP_FIX_TFMC_H @@ -44,7 +44,7 @@ class FixTFMC : public Fix { class RanMars *random_num; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index 65f00811c1..3dd0d2d3c9 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MC/fix_widom.h b/src/MC/fix_widom.h index c12be4ad75..222cb32b3f 100644 --- a/src/MC/fix_widom.h +++ b/src/MC/fix_widom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(widom,FixWidom) - +// clang-format off +FixStyle(widom,FixWidom); +// clang-format on #else #ifndef LMP_FIX_WIDOM_H @@ -48,23 +48,23 @@ class FixWidom : public Fix { void grow_molecule_arrays(int); private: - int molecule_group,molecule_group_bit; + int molecule_group, molecule_group_bit; int molecule_group_inversebit; - int exclusion_group,exclusion_group_bit; - int nwidom_type,nevery,seed; + int exclusion_group, exclusion_group_bit; + int nwidom_type, nevery, seed; int ninsertions; - int ngas; // # of gas atoms on all procs - int ngas_local; // # of gas atoms on this proc - int exchmode; // exchange ATOM or MOLECULE - int movemode; // move ATOM or MOLECULE - int regionflag; // 0 = anywhere in box, 1 = specific region - int iregion; // widom region - char *idregion; // widom region id - bool charge_flag; // true if user specified atomic charge - bool full_flag; // true if doing full system energy calculations + int ngas; // # of gas atoms on all procs + int ngas_local; // # of gas atoms on this proc + int exchmode; // exchange ATOM or MOLECULE + int movemode; // move ATOM or MOLECULE + int regionflag; // 0 = anywhere in box, 1 = specific region + int iregion; // widom region + char *idregion; // widom region id + bool charge_flag; // true if user specified atomic charge + bool full_flag; // true if doing full system energy calculations - int natoms_per_molecule; // number of atoms in each inserted molecule - int nmaxmolatoms; // number of atoms allocated for molecule arrays + int natoms_per_molecule; // number of atoms in each inserted molecule + int nmaxmolatoms; // number of atoms allocated for molecule arrays double ave_widom_chemical_potential; @@ -72,13 +72,13 @@ class FixWidom : public Fix { int max_region_attempts; double gas_mass; double insertion_temperature; - double beta,sigma,volume; + double beta, sigma, volume; double charge; - double xlo,xhi,ylo,yhi,zlo,zhi; - double region_xlo,region_xhi,region_ylo,region_yhi,region_zlo,region_zhi; + double xlo, xhi, ylo, yhi, zlo, zhi; + double region_xlo, region_xhi, region_ylo, region_yhi, region_zlo, region_zhi; double region_volume; - double energy_stored; // full energy of old/current configuration - double *sublo,*subhi; + double energy_stored; // full energy of old/current configuration + double *sublo, *subhi; int *local_gas_list; double **cutsq; double **molcoords; @@ -95,15 +95,15 @@ class FixWidom : public Fix { class Atom *model_atom; class Molecule **onemols; - int imol,nmol; - int triclinic; // 0 = orthog box, 1 = triclinic + int imol, nmol; + int triclinic; // 0 = orthog box, 1 = triclinic class Compute *c_pe; void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/pair_dsmc.cpp b/src/MC/pair_dsmc.cpp index 0e8f7e1933..8a0918e2e0 100644 --- a/src/MC/pair_dsmc.cpp +++ b/src/MC/pair_dsmc.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MC/pair_dsmc.h b/src/MC/pair_dsmc.h index 784ada286c..947c0dafb2 100644 --- a/src/MC/pair_dsmc.h +++ b/src/MC/pair_dsmc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dsmc,PairDSMC) - +// clang-format off +PairStyle(dsmc,PairDSMC); +// clang-format on #else #ifndef LMP_PAIR_DSMC_H @@ -92,18 +92,20 @@ class PairDSMC : public Pair { void scatter_random(int, int, int); int convert_double_to_equivalent_int(double); - inline void subtract3d(const double *v1, const double *v2, double *v3) { + inline void subtract3d(const double *v1, const double *v2, double *v3) + { v3[0] = v2[0] - v1[0]; v3[1] = v2[1] - v1[1]; v3[2] = v2[2] - v1[2]; } - inline double dot3d(const double *v1, const double *v2) { - return( v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2] ); + inline double dot3d(const double *v1, const double *v2) + { + return (v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]); } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MESSAGE/fix_client_md.cpp b/src/MESSAGE/fix_client_md.cpp index 1ef103ec3b..e33434e81e 100644 --- a/src/MESSAGE/fix_client_md.cpp +++ b/src/MESSAGE/fix_client_md.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MESSAGE/fix_client_md.h b/src/MESSAGE/fix_client_md.h index f2e43717a9..a9f9b531f1 100644 --- a/src/MESSAGE/fix_client_md.h +++ b/src/MESSAGE/fix_client_md.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(client/md,FixClientMD) - +// clang-format off +FixStyle(client/md,FixClientMD); +// clang-format on #else #ifndef LMP_FIX_CLIENT_MD_H @@ -37,10 +37,10 @@ class FixClientMD : public Fix { double compute_scalar(); private: - int maxatom,units,server_error; + int maxatom, units, server_error; double eng; double inv_nprocs; - double fconvert,econvert,pconvert; + double fconvert, econvert, pconvert; double box[3][3]; double *xpbc; @@ -49,7 +49,7 @@ class FixClientMD : public Fix { void receive_fev(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MESSAGE/message.cpp b/src/MESSAGE/message.cpp index 97ee95311d..e1530fd081 100644 --- a/src/MESSAGE/message.cpp +++ b/src/MESSAGE/message.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MESSAGE/message.h b/src/MESSAGE/message.h index d4099737e6..cb86fa62e5 100644 --- a/src/MESSAGE/message.h +++ b/src/MESSAGE/message.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(message,Message) - +// clang-format off +CommandStyle(message,Message); +// clang-format on #else #ifndef LMP_MESSAGE_H @@ -26,14 +26,14 @@ namespace LAMMPS_NS { class Message : public Command { public: - Message(class LAMMPS *lmp) : Command(lmp) {}; + Message(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); private: void quit(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MESSAGE/server.cpp b/src/MESSAGE/server.cpp index 0f02a58d29..76cd4ca4e4 100644 --- a/src/MESSAGE/server.cpp +++ b/src/MESSAGE/server.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MESSAGE/server.h b/src/MESSAGE/server.h index dffecaf1c8..c06aaa6f12 100644 --- a/src/MESSAGE/server.h +++ b/src/MESSAGE/server.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(server,Server) - +// clang-format off +CommandStyle(server,Server); +// clang-format on #else #ifndef LMP_SERVER_H @@ -26,11 +26,11 @@ namespace LAMMPS_NS { class Server : public Command { public: - Server(class LAMMPS *lmp) : Command(lmp) {}; + Server(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MESSAGE/server_mc.cpp b/src/MESSAGE/server_mc.cpp index 52c1b489f5..f549056b53 100644 --- a/src/MESSAGE/server_mc.cpp +++ b/src/MESSAGE/server_mc.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MESSAGE/server_mc.h b/src/MESSAGE/server_mc.h index 286a5ab465..0b22ca392a 100644 --- a/src/MESSAGE/server_mc.h +++ b/src/MESSAGE/server_mc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,6 +24,6 @@ class ServerMC : protected Pointers { void loop(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/MESSAGE/server_md.cpp b/src/MESSAGE/server_md.cpp index 000ab81a5c..53bdaf7879 100644 --- a/src/MESSAGE/server_md.cpp +++ b/src/MESSAGE/server_md.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MESSAGE/server_md.h b/src/MESSAGE/server_md.h index 1f15eccbec..e50027f0ea 100644 --- a/src/MESSAGE/server_md.h +++ b/src/MESSAGE/server_md.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -26,13 +26,13 @@ class ServerMD : protected Pointers { private: int units; - double fconvert,econvert,pconvert; + double fconvert, econvert, pconvert; double **fcopy; void box_change(double *, double *); void send_fev(int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/MISC/compute_msd_nongauss.cpp b/src/MISC/compute_msd_nongauss.cpp index 5b4ba8b1fe..99c5cee715 100644 --- a/src/MISC/compute_msd_nongauss.cpp +++ b/src/MISC/compute_msd_nongauss.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/compute_msd_nongauss.h b/src/MISC/compute_msd_nongauss.h index 8931c50c09..d94adf74c4 100644 --- a/src/MISC/compute_msd_nongauss.h +++ b/src/MISC/compute_msd_nongauss.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(msd/nongauss,ComputeMSDNonGauss) - +// clang-format off +ComputeStyle(msd/nongauss,ComputeMSDNonGauss); +// clang-format on #else #ifndef LMP_COMPUTE_MSD_NONGAUSS_H @@ -31,7 +31,7 @@ class ComputeMSDNonGauss : public ComputeMSD { void compute_vector(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/compute_ti.cpp b/src/MISC/compute_ti.cpp index 5ba85679a3..d416fab1de 100644 --- a/src/MISC/compute_ti.cpp +++ b/src/MISC/compute_ti.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/compute_ti.h b/src/MISC/compute_ti.h index d82343f4eb..55d10c446c 100644 --- a/src/MISC/compute_ti.h +++ b/src/MISC/compute_ti.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(ti,ComputeTI) - +// clang-format off +ComputeStyle(ti,ComputeTI); +// clang-format on #else #ifndef COMPUTE_TI_H @@ -34,14 +34,14 @@ class ComputeTI : public Compute { private: int nterms; int *which; - int *ivar1,*ivar2; + int *ivar1, *ivar2; int *ilo, *ihi; - char **var1,**var2; + char **var1, **var2; class Pair **pptr; char **pstyle; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/dump_xtc.cpp b/src/MISC/dump_xtc.cpp index 87eac61673..5f7016ee50 100644 --- a/src/MISC/dump_xtc.cpp +++ b/src/MISC/dump_xtc.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/dump_xtc.h b/src/MISC/dump_xtc.h index 5ec9cee342..ef26b70295 100644 --- a/src/MISC/dump_xtc.h +++ b/src/MISC/dump_xtc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(xtc,DumpXTC) - +// clang-format off +DumpStyle(xtc,DumpXTC); +// clang-format on #else #ifndef LMP_DUMP_XTC_H @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class DumpXTC : public Dump { public: - DumpXTC(class LAMMPS *, int, char**); + DumpXTC(class LAMMPS *, int, char **); virtual ~DumpXTC(); private: - int natoms,ntotal; + int natoms, ntotal; int nevery_save; - int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no - float precision; // user-adjustable precision setting + int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no + float precision; // user-adjustable precision setting float *coords; - double sfactor,tfactor; // scaling factors for positions and time unit + double sfactor, tfactor; // scaling factors for positions and time unit XDR xd; void init_style(); @@ -50,7 +50,7 @@ class DumpXTC : public Dump { void write_frame(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_deposit.cpp b/src/MISC/fix_deposit.cpp index e74c80f037..f3b175fc78 100644 --- a/src/MISC/fix_deposit.cpp +++ b/src/MISC/fix_deposit.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/fix_deposit.h b/src/MISC/fix_deposit.h index 9bb66930a1..a7c506beb6 100644 --- a/src/MISC/fix_deposit.h +++ b/src/MISC/fix_deposit.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(deposit,FixDeposit) - +// clang-format off +FixStyle(deposit,FixDeposit); +// clang-format on #else #ifndef LMP_FIX_DEPOSIT_H @@ -37,34 +37,34 @@ class FixDeposit : public Fix { void *extract(const char *, int &); private: - int ninsert,ntype,nfreq,seed; - int iregion,globalflag,localflag,maxattempt,rateflag,scaleflag,targetflag; - int mode,rigidflag,shakeflag,idnext,distflag,orientflag; - double lo,hi,deltasq,nearsq,rate,sigma; - double vxlo,vxhi,vylo,vyhi,vzlo,vzhi; - double xlo,xhi,ylo,yhi,zlo,zhi,xmid,ymid,zmid; - double rx,ry,rz,tx,ty,tz; + int ninsert, ntype, nfreq, seed; + int iregion, globalflag, localflag, maxattempt, rateflag, scaleflag, targetflag; + int mode, rigidflag, shakeflag, idnext, distflag, orientflag; + double lo, hi, deltasq, nearsq, rate, sigma; + double vxlo, vxhi, vylo, vyhi, vzlo, vzhi; + double xlo, xhi, ylo, yhi, zlo, zhi, xmid, ymid, zmid; + double rx, ry, rz, tx, ty, tz; char *idregion; - char *idrigid,*idshake; + char *idrigid, *idshake; class Molecule **onemols; - int nmol,natom_max; + int nmol, natom_max; double *molfrac; double **coords; imageint *imageflags; - class Fix *fixrigid,*fixshake; + class Fix *fixrigid, *fixshake; double oneradius; int ninserted; bigint nfirst; - tagint maxtag_all,maxmol_all; + tagint maxtag_all, maxmol_all; class RanPark *random; void find_maxid(); void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_efield.cpp b/src/MISC/fix_efield.cpp index 5eb3caf5ea..98cecd8a01 100644 --- a/src/MISC/fix_efield.cpp +++ b/src/MISC/fix_efield.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/fix_efield.h b/src/MISC/fix_efield.h index d18629bdbc..c9496e29d2 100644 --- a/src/MISC/fix_efield.h +++ b/src/MISC/fix_efield.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(efield,FixEfield) - +// clang-format off +FixStyle(efield,FixEfield); +// clang-format on #else #ifndef LMP_FIX_EFIELD_H @@ -40,23 +40,23 @@ class FixEfield : public Fix { double compute_vector(int); private: - double ex,ey,ez; - int varflag,iregion; - char *xstr,*ystr,*zstr,*estr; + double ex, ey, ez; + int varflag, iregion; + char *xstr, *ystr, *zstr, *estr; char *idregion; - int xvar,yvar,zvar,evar,xstyle,ystyle,zstyle,estyle; + int xvar, yvar, zvar, evar, xstyle, ystyle, zstyle, estyle; int ilevel_respa; double qe2f; - int qflag,muflag; + int qflag, muflag; int maxatom; double **efield; int force_flag; - double fsum[4],fsum_all[4]; + double fsum[4], fsum_all[4]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_evaporate.cpp b/src/MISC/fix_evaporate.cpp index 2a11d1675a..ceb9f52818 100644 --- a/src/MISC/fix_evaporate.cpp +++ b/src/MISC/fix_evaporate.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/fix_evaporate.h b/src/MISC/fix_evaporate.h index d09875b5bd..6005a80257 100644 --- a/src/MISC/fix_evaporate.h +++ b/src/MISC/fix_evaporate.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(evaporate,FixEvaporate) - +// clang-format off +FixStyle(evaporate,FixEvaporate); +// clang-format on #else #ifndef LMP_FIX_EVAPORATE_H @@ -35,18 +35,18 @@ class FixEvaporate : public Fix { double memory_usage(); private: - int nevery,nflux,iregion; + int nevery, nflux, iregion; int molflag; int ndeleted; char *idregion; int nmax; - int *list,*mark; + int *list, *mark; class RanPark *random; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_gld.cpp b/src/MISC/fix_gld.cpp index d0ad26c740..34ed43301e 100644 --- a/src/MISC/fix_gld.cpp +++ b/src/MISC/fix_gld.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/fix_gld.h b/src/MISC/fix_gld.h index d8fa7408a4..1424e5c5f4 100644 --- a/src/MISC/fix_gld.h +++ b/src/MISC/fix_gld.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(gld,FixGLD) - +// clang-format off +FixStyle(gld,FixGLD); +// clang-format on #else #ifndef LMP_FIX_GLD_H @@ -49,7 +49,7 @@ class FixGLD : public Fix { void init_s_gld(); protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; int freezeflag, zeroflag; @@ -65,7 +65,7 @@ class FixGLD : public Fix { class RanMars *random; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_oneway.cpp b/src/MISC/fix_oneway.cpp index 7e655e60c6..5ebc535c43 100644 --- a/src/MISC/fix_oneway.cpp +++ b/src/MISC/fix_oneway.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/fix_oneway.h b/src/MISC/fix_oneway.h index aeb0e9532f..d3b2cf7b65 100644 --- a/src/MISC/fix_oneway.h +++ b/src/MISC/fix_oneway.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(oneway,FixOneWay) - +// clang-format off +FixStyle(oneway,FixOneWay); +// clang-format on #else #ifndef LMP_FIX_ONEWAY_H @@ -38,7 +38,7 @@ class FixOneWay : public Fix { char *regionstr; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_orient_bcc.cpp b/src/MISC/fix_orient_bcc.cpp index d78a6bcb95..fd5ce748d6 100644 --- a/src/MISC/fix_orient_bcc.cpp +++ b/src/MISC/fix_orient_bcc.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/fix_orient_bcc.h b/src/MISC/fix_orient_bcc.h index 7059e4bbfd..7483cd457f 100644 --- a/src/MISC/fix_orient_bcc.h +++ b/src/MISC/fix_orient_bcc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(orient/bcc,FixOrientBCC) - +// clang-format off +FixStyle(orient/bcc,FixOrientBCC); +// clang-format on #else #ifndef LMP_FIX_ORIENT_BCC_H @@ -26,21 +26,21 @@ namespace LAMMPS_NS { class FixOrientBCC : public Fix { public: - struct Nbr { // neighbor info for each owned and ghost atom - int n; // # of closest neighbors (up to 8) - tagint id[8]; // IDs of each neighbor - // if center atom is owned, these are local IDs - // if center atom is ghost, these are global IDs - double xismooth[8]; // distance weighting factor for each neighbors - double dxi[8][3]; // d order-parameter / dx for each neighbor - double duxi; // d Energy / d order-parameter for atom + struct Nbr { // neighbor info for each owned and ghost atom + int n; // # of closest neighbors (up to 8) + tagint id[8]; // IDs of each neighbor + // if center atom is owned, these are local IDs + // if center atom is ghost, these are global IDs + double xismooth[8]; // distance weighting factor for each neighbors + double dxi[8][3]; // d order-parameter / dx for each neighbor + double duxi; // d Energy / d order-parameter for atom }; - struct Sort { // data structure for sorting to find 8 closest - int id; // local ID of neighbor atom - double rsq; // distance between center and neighbor atom - double delta[3]; // displacement between center and neighbor atom - double xismooth; // distance weighting factor + struct Sort { // data structure for sorting to find 8 closest + int id; // local ID of neighbor atom + double rsq; // distance between center and neighbor atom + double delta[3]; // displacement between center and neighbor atom + double xismooth; // distance weighting factor }; FixOrientBCC(class LAMMPS *, int, char **); @@ -60,21 +60,21 @@ class FixOrientBCC : public Fix { int me; int ilevel_respa; - int direction_of_motion; // 1 = center shrinks, 0 = center grows - int nstats; // stats output every this many steps - double a; // lattice parameter - double Vxi; // potential value - double uxif_low; // cut-off fraction, low order parameter - double uxif_high; // cut-off fraction, high order parameter - char *xifilename, *chifilename; // file names for 2 crystal orientations + int direction_of_motion; // 1 = center shrinks, 0 = center grows + int nstats; // stats output every this many steps + double a; // lattice parameter + double Vxi; // potential value + double uxif_low; // cut-off fraction, low order parameter + double uxif_high; // cut-off fraction, high order parameter + char *xifilename, *chifilename; // file names for 2 crystal orientations bool use_xismooth; - double Rxi[8][3],Rchi[8][3],half_xi_chi_vec[2][4][3]; - double xiid,xi0,xi1,xicutoffsq,cutsq,added_energy; + double Rxi[8][3], Rchi[8][3], half_xi_chi_vec[2][4][3]; + double xiid, xi0, xi1, xicutoffsq, cutsq, added_energy; int half_bcc_nn; - int nmax; // expose 2 per-atom quantities - double **order; // order param and normalized order param + int nmax; // expose 2 per-atom quantities + double **order; // order param and normalized order param Nbr *nbr; Sort *sort; @@ -84,7 +84,7 @@ class FixOrientBCC : public Fix { static int compare(const void *, const void *); }; -} +} // namespace LAMMPS_NS #endif #endif @@ -110,6 +110,6 @@ E: Fix orient/bcc found self twice The neighbor lists used by fix orient/bcc are messed up. If this error occurs, it is likely a bug, so send an email to the -"developers"_https://lammps.sandia.gov/authors.html. +"developers"_https://www.lammps.org/authors.html. */ diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index 559a56000e..c5fe269e5b 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/fix_orient_fcc.h b/src/MISC/fix_orient_fcc.h index a6ec2d1884..0c4c2433e5 100644 --- a/src/MISC/fix_orient_fcc.h +++ b/src/MISC/fix_orient_fcc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(orient/fcc,FixOrientFCC) - +// clang-format off +FixStyle(orient/fcc,FixOrientFCC); +// clang-format on #else #ifndef LMP_FIX_ORIENT_FCC_H @@ -36,11 +36,11 @@ class FixOrientFCC : public Fix { double duxi; // d Energy / d order-parameter for atom }; - struct Sort { // data structure for sorting to find 12 closest - int id; // local ID of neighbor atom - double rsq; // distance between center and neighbor atom - double delta[3]; // displacement between center and neighbor atom - double xismooth; // distance weighting factor + struct Sort { // data structure for sorting to find 12 closest + int id; // local ID of neighbor atom + double rsq; // distance between center and neighbor atom + double delta[3]; // displacement between center and neighbor atom + double xismooth; // distance weighting factor }; FixOrientFCC(class LAMMPS *, int, char **); @@ -60,21 +60,21 @@ class FixOrientFCC : public Fix { int me; int ilevel_respa; - int direction_of_motion; // 1 = center shrinks, 0 = center grows - int nstats; // stats output every this many steps - double a; // lattice parameter - double Vxi; // potential value - double uxif_low; // cut-off fraction, low order parameter - double uxif_high; // cut-off fraction, high order parameter - char *xifilename, *chifilename; // file names for 2 crystal orientations + int direction_of_motion; // 1 = center shrinks, 0 = center grows + int nstats; // stats output every this many steps + double a; // lattice parameter + double Vxi; // potential value + double uxif_low; // cut-off fraction, low order parameter + double uxif_high; // cut-off fraction, high order parameter + char *xifilename, *chifilename; // file names for 2 crystal orientations bool use_xismooth; - double Rxi[12][3],Rchi[12][3],half_xi_chi_vec[2][6][3]; - double xiid,xi0,xi1,xicutoffsq,cutsq,added_energy; + double Rxi[12][3], Rchi[12][3], half_xi_chi_vec[2][6][3]; + double xiid, xi0, xi1, xicutoffsq, cutsq, added_energy; int half_fcc_nn; - int nmax; // expose 2 per-atom quantities - double **order; // order param and normalized order param + int nmax; // expose 2 per-atom quantities + double **order; // order param and normalized order param Nbr *nbr; Sort *sort; @@ -84,7 +84,7 @@ class FixOrientFCC : public Fix { static int compare(const void *, const void *); }; -} +} // namespace LAMMPS_NS #endif #endif @@ -110,6 +110,6 @@ E: Fix orient/fcc found self twice The neighbor lists used by fix orient/fcc are messed up. If this error occurs, it is likely a bug, so send an email to the -"developers"_https://lammps.sandia.gov/authors.html. +"developers"_https://www.lammps.org/authors.html. */ diff --git a/src/MISC/fix_thermal_conductivity.cpp b/src/MISC/fix_thermal_conductivity.cpp index a7b85c5c2d..bdd516ae80 100644 --- a/src/MISC/fix_thermal_conductivity.cpp +++ b/src/MISC/fix_thermal_conductivity.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/fix_thermal_conductivity.h b/src/MISC/fix_thermal_conductivity.h index 0c59f29bd6..3f598bce5b 100644 --- a/src/MISC/fix_thermal_conductivity.h +++ b/src/MISC/fix_thermal_conductivity.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(thermal/conductivity,FixThermalConductivity) - +// clang-format off +FixStyle(thermal/conductivity,FixThermalConductivity); +// clang-format on #else #ifndef LMP_FIX_THERMAL_CONDUCTIVITY_H @@ -35,18 +35,18 @@ class FixThermalConductivity : public Fix { private: int me; - int edim,nbin,periodicity; + int edim, nbin, periodicity; int nswap; - double prd,boxlo,boxhi; - double slablo_lo,slablo_hi,slabhi_lo,slabhi_hi; + double prd, boxlo, boxhi; + double slablo_lo, slablo_hi, slabhi_lo, slabhi_hi; double e_exchange; - int nlo,nhi; - int *index_lo,*index_hi; - double *ke_lo,*ke_hi; + int nlo, nhi; + int *index_lo, *index_hi; + double *ke_lo, *ke_hi; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp index 519007ebf7..aed5761dd4 100644 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/fix_ttm.h b/src/MISC/fix_ttm.h index ddcebfe46a..46bddd22af 100644 --- a/src/MISC/fix_ttm.h +++ b/src/MISC/fix_ttm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(ttm,FixTTM) - +// clang-format off +FixStyle(ttm,FixTTM); +// clang-format on #else #ifndef LMP_FIX_TTM_H @@ -53,22 +53,22 @@ class FixTTM : public Fix { int seed; class RanMars *random; FILE *fp; - int nxnodes,nynodes,nznodes; + int nxnodes, nynodes, nznodes; bigint total_nnodes; int ***nsum, ***nsum_all; - double *gfactor1,*gfactor2,*ratio,**flangevin; - double ***T_electron,***T_electron_old; - double ***sum_vsq,***sum_mass_vsq; - double ***sum_vsq_all,***sum_mass_vsq_all; - double ***net_energy_transfer,***net_energy_transfer_all; - double electronic_specific_heat,electronic_density; + double *gfactor1, *gfactor2, *ratio, **flangevin; + double ***T_electron, ***T_electron_old; + double ***sum_vsq, ***sum_mass_vsq; + double ***sum_vsq_all, ***sum_mass_vsq_all; + double ***net_energy_transfer, ***net_energy_transfer_all; + double electronic_specific_heat, electronic_density; double electronic_thermal_conductivity; - double gamma_p,gamma_s,v_0,v_0_sq; + double gamma_p, gamma_s, v_0, v_0_sq; void read_initial_electron_temperatures(const char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_viscosity.cpp b/src/MISC/fix_viscosity.cpp index be00350842..1d84d76124 100644 --- a/src/MISC/fix_viscosity.cpp +++ b/src/MISC/fix_viscosity.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/fix_viscosity.h b/src/MISC/fix_viscosity.h index 519658a27f..559de6c362 100644 --- a/src/MISC/fix_viscosity.h +++ b/src/MISC/fix_viscosity.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(viscosity,FixViscosity) - +// clang-format off +FixStyle(viscosity,FixViscosity); +// clang-format on #else #ifndef LMP_FIX_VISCOSITY_H @@ -35,19 +35,19 @@ class FixViscosity : public Fix { private: int me; - int vdim,pdim,nbin,periodicity; + int vdim, pdim, nbin, periodicity; int nswap; double vtarget; - double prd,boxlo,boxhi; - double slablo_lo,slablo_hi,slabhi_lo,slabhi_hi; + double prd, boxlo, boxhi; + double slablo_lo, slablo_hi, slabhi_lo, slabhi_hi; double p_exchange; - int npositive,nnegative; - int *pos_index,*neg_index; - double *pos_delta,*neg_delta; + int npositive, nnegative; + int *pos_index, *neg_index; + double *pos_delta, *neg_delta; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/pair_nm_cut.cpp b/src/MISC/pair_nm_cut.cpp index c12e0a472d..66762869ea 100644 --- a/src/MISC/pair_nm_cut.cpp +++ b/src/MISC/pair_nm_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/pair_nm_cut.h b/src/MISC/pair_nm_cut.h index 83a0846321..bf40740abf 100644 --- a/src/MISC/pair_nm_cut.h +++ b/src/MISC/pair_nm_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(nm/cut,PairNMCut) - +// clang-format off +PairStyle(nm/cut,PairNMCut); +// clang-format on #else #ifndef LMP_PAIR_NM_CUT_H @@ -45,13 +45,13 @@ class PairNMCut : public Pair { protected: double cut_global; double **cut; - double **e0,**r0,**nn, **mm; - double **nm,**e0nm,**r0n,**r0m,**offset; + double **e0, **r0, **nn, **mm; + double **nm, **e0nm, **r0n, **r0m, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/pair_nm_cut_coul_cut.cpp b/src/MISC/pair_nm_cut_coul_cut.cpp index 7f046476ab..de5bc7cf92 100644 --- a/src/MISC/pair_nm_cut_coul_cut.cpp +++ b/src/MISC/pair_nm_cut_coul_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/pair_nm_cut_coul_cut.h b/src/MISC/pair_nm_cut_coul_cut.h index 0586f0a16f..a411c332de 100644 --- a/src/MISC/pair_nm_cut_coul_cut.h +++ b/src/MISC/pair_nm_cut_coul_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(nm/cut/coul/cut,PairNMCutCoulCut) - - +// clang-format off +PairStyle(nm/cut/coul/cut,PairNMCutCoulCut); +// clang-format on #else #ifndef LMP_PAIR_NM_CUT_COUL_CUT_H @@ -45,16 +44,16 @@ class PairNMCutCoulCut : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **e0,**r0,**nn, **mm; - double **nm,**e0nm,**r0n,**r0m,**offset; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **e0, **r0, **nn, **mm; + double **nm, **e0nm, **r0n, **r0m, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/pair_nm_cut_coul_long.cpp b/src/MISC/pair_nm_cut_coul_long.cpp index b3dfcf80ac..ff8dd3d220 100644 --- a/src/MISC/pair_nm_cut_coul_long.cpp +++ b/src/MISC/pair_nm_cut_coul_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MISC/pair_nm_cut_coul_long.h b/src/MISC/pair_nm_cut_coul_long.h index 4a8e49e2b6..1e4989717c 100644 --- a/src/MISC/pair_nm_cut_coul_long.h +++ b/src/MISC/pair_nm_cut_coul_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(nm/cut/coul/long,PairNMCutCoulLong) - +// clang-format off +PairStyle(nm/cut/coul/long,PairNMCutCoulLong); +// clang-format on #else #ifndef LMP_PAIR_NM_CUT_COUL_LONG_H @@ -46,17 +46,17 @@ class PairNMCutCoulLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **e0,**r0,**nn, **mm; - double **nm,**e0nm,**r0n,**r0m,**offset; - double qdist; // TIP4P distance from O site to negative charge + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **e0, **r0, **nn, **mm; + double **nm, **e0nm, **r0n, **r0m, **offset; + double qdist; // TIP4P distance from O site to negative charge double g_ewald; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/xdr_compat.cpp b/src/MISC/xdr_compat.cpp index 675afb835e..04807a60cc 100644 --- a/src/MISC/xdr_compat.cpp +++ b/src/MISC/xdr_compat.cpp @@ -1,3 +1,4 @@ +// clang-format off #include "xdr_compat.h" #include #include diff --git a/src/MISC/xdr_compat.h b/src/MISC/xdr_compat.h index 60cae1662e..30aecbcb62 100644 --- a/src/MISC/xdr_compat.h +++ b/src/MISC/xdr_compat.h @@ -59,8 +59,9 @@ extern "C" { typedef int bool_t; -#if defined(__MINGW32__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || defined(__NetBSD__) -typedef char * caddr_t; +#if defined(__MINGW32__) || defined(__APPLE__) || defined(__FreeBSD__) || \ + defined(__DragonFly__) || defined(__OpenBSD__) || defined(__NetBSD__) +typedef char *caddr_t; typedef unsigned int u_int; #endif @@ -69,35 +70,30 @@ typedef unsigned int u_int; * long or short is 32 bits and die if none of them is :-) */ #if (INT_MAX == 2147483647) - typedef int xdr_int32_t; - typedef unsigned int xdr_uint32_t; +typedef int xdr_int32_t; +typedef unsigned int xdr_uint32_t; #elif (LONG_MAX == 2147483647L) - typedef long xdr_int32_t; - typedef unsigned long xdr_uint32_t; +typedef long xdr_int32_t; +typedef unsigned long xdr_uint32_t; #elif (SHRT_MAX == 2147483647) - typedef short xdr_int32_t; - typedef unsigned short xdr_uint32_t; +typedef short xdr_int32_t; +typedef unsigned short xdr_uint32_t; #else -# error ERROR: No 32 bit wide integer type found! +#error ERROR: No 32 bit wide integer type found! #endif -enum xdr_op { - XDR_ENCODE = 0, - XDR_DECODE = 1, - XDR_FREE = 2 -}; +enum xdr_op { XDR_ENCODE = 0, XDR_DECODE = 1, XDR_FREE = 2 }; #ifndef FALSE -# define FALSE (0) +#define FALSE (0) #endif #ifndef TRUE -# define TRUE (1) +#define TRUE (1) #endif -#define BYTES_PER_XDR_UNIT (4) +#define BYTES_PER_XDR_UNIT (4) /* Macro to round up to units of 4. */ -#define XDR_RNDUP(x) (((x) + BYTES_PER_XDR_UNIT - 1) & ~(BYTES_PER_XDR_UNIT - 1)) - +#define XDR_RNDUP(x) (((x) + BYTES_PER_XDR_UNIT - 1) & ~(BYTES_PER_XDR_UNIT - 1)) /* * The XDR handle. @@ -107,38 +103,36 @@ enum xdr_op { */ typedef struct XDR XDR; -struct XDR - { - enum xdr_op x_op; /* operation; fast additional param */ - struct xdr_ops *x_ops; - char *x_public; /* users' data */ - char *x_private; /* pointer to private data */ - char *x_base; /* private used for position info */ - int x_handy; /* extra private word */ - }; +struct XDR { + enum xdr_op x_op; /* operation; fast additional param */ + struct xdr_ops *x_ops; + char *x_public; /* users' data */ + char *x_private; /* pointer to private data */ + char *x_base; /* private used for position info */ + int x_handy; /* extra private word */ +}; -struct xdr_ops - { - bool_t (*x_getbytes) (XDR *__xdrs, char *__addr, unsigned int __len); - /* get some bytes from " */ - bool_t (*x_putbytes) (XDR *__xdrs, char *__addr, unsigned int __len); - /* put some bytes to " */ - unsigned int (*x_getpostn) (XDR *__xdrs); - /* returns bytes off from beginning */ - bool_t (*x_setpostn) (XDR *__xdrs, unsigned int __pos); - /* lets you reposition the stream */ - xdr_int32_t *(*x_inline) (XDR *__xdrs, int __len); - /* buf quick ptr to buffered data */ - void (*x_destroy) (XDR *__xdrs); - /* free privates of this xdr_stream */ - bool_t (*x_getint32) (XDR *__xdrs, xdr_int32_t *__ip); - /* get a int from underlying stream */ - bool_t (*x_putint32) (XDR *__xdrs, xdr_int32_t *__ip); - /* put a int to " */ - bool_t (*x_getuint32) (XDR *__xdrs, xdr_uint32_t *__ip); - /* get a unsigned int from underlying stream */ - bool_t (*x_putuint32) (XDR *__xdrs, xdr_uint32_t *__ip); - /* put a int to " */ +struct xdr_ops { + bool_t (*x_getbytes)(XDR *__xdrs, char *__addr, unsigned int __len); + /* get some bytes from " */ + bool_t (*x_putbytes)(XDR *__xdrs, char *__addr, unsigned int __len); + /* put some bytes to " */ + unsigned int (*x_getpostn)(XDR *__xdrs); + /* returns bytes off from beginning */ + bool_t (*x_setpostn)(XDR *__xdrs, unsigned int __pos); + /* lets you reposition the stream */ + xdr_int32_t *(*x_inline)(XDR *__xdrs, int __len); + /* buf quick ptr to buffered data */ + void (*x_destroy)(XDR *__xdrs); + /* free privates of this xdr_stream */ + bool_t (*x_getint32)(XDR *__xdrs, xdr_int32_t *__ip); + /* get a int from underlying stream */ + bool_t (*x_putint32)(XDR *__xdrs, xdr_int32_t *__ip); + /* put a int to " */ + bool_t (*x_getuint32)(XDR *__xdrs, xdr_uint32_t *__ip); + /* get a unsigned int from underlying stream */ + bool_t (*x_putuint32)(XDR *__xdrs, xdr_uint32_t *__ip); + /* put a int to " */ }; /* @@ -150,7 +144,7 @@ struct xdr_ops * allocate dynamic storage of the appropriate size and return it. */ -typedef bool_t (*xdrproc_t) (XDR *, void *,...); +typedef bool_t (*xdrproc_t)(XDR *, void *, ...); /* * Operations defined on a XDR handle @@ -163,58 +157,46 @@ typedef bool_t (*xdrproc_t) (XDR *, void *,...); * unsigned int pos; */ +#define xdr_getint32(xdrs, int32p) (*(xdrs)->x_ops->x_getint32)(xdrs, int32p) -#define xdr_getint32(xdrs, int32p) \ - (*(xdrs)->x_ops->x_getint32)(xdrs, int32p) +#define xdr_putint32(xdrs, int32p) (*(xdrs)->x_ops->x_putint32)(xdrs, int32p) -#define xdr_putint32(xdrs, int32p) \ - (*(xdrs)->x_ops->x_putint32)(xdrs, int32p) +#define xdr_getuint32(xdrs, uint32p) (*(xdrs)->x_ops->x_getuint32)(xdrs, uint32p) -#define xdr_getuint32(xdrs, uint32p) \ - (*(xdrs)->x_ops->x_getuint32)(xdrs, uint32p) +#define xdr_putuint32(xdrs, uint32p) (*(xdrs)->x_ops->x_putuint32)(xdrs, uint32p) -#define xdr_putuint32(xdrs, uint32p) \ - (*(xdrs)->x_ops->x_putuint32)(xdrs, uint32p) +#define xdr_getbytes(xdrs, addr, len) (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) -#define xdr_getbytes(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) +#define xdr_putbytes(xdrs, addr, len) (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) -#define xdr_putbytes(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) +#define xdr_getpos(xdrs) (*(xdrs)->x_ops->x_getpostn)(xdrs) -#define xdr_getpos(xdrs) \ - (*(xdrs)->x_ops->x_getpostn)(xdrs) +#define xdr_setpos(xdrs, pos) (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) -#define xdr_setpos(xdrs, pos) \ - (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) +#define xdr_inline(xdrs, len) (*(xdrs)->x_ops->x_inline)(xdrs, len) -#define xdr_inline(xdrs, len) \ - (*(xdrs)->x_ops->x_inline)(xdrs, len) +#define xdr_destroy(xdrs) \ + do { \ + if ((xdrs)->x_ops->x_destroy) (*(xdrs)->x_ops->x_destroy)(xdrs); \ + } while (0) -#define xdr_destroy(xdrs) \ - do { \ - if ((xdrs)->x_ops->x_destroy) \ - (*(xdrs)->x_ops->x_destroy)(xdrs); \ - } while (0) - - -extern bool_t xdr_int (XDR *__xdrs, int *__ip); -extern bool_t xdr_u_int (XDR *__xdrs, unsigned int *__ip); -extern bool_t xdr_short (XDR *__xdrs, short *__ip); -extern bool_t xdr_u_short (XDR *__xdrs, unsigned short *__ip); -extern bool_t xdr_bool (XDR *__xdrs, int *__bp); -extern bool_t xdr_opaque (XDR *__xdrs, char *__cp, unsigned int __cnt); -extern bool_t xdr_string (XDR *__xdrs, char **__cpp, unsigned int __maxsize); -extern bool_t xdr_char (XDR *__xdrs, char *__cp); -extern bool_t xdr_u_char (XDR *__xdrs, unsigned char *__cp); -extern bool_t xdr_vector (XDR *__xdrs, char *__basep, unsigned int __nelem, - unsigned int __elemsize, xdrproc_t __xdr_elem); -extern bool_t xdr_float (XDR *__xdrs, float *__fp); -extern bool_t xdr_double (XDR *__xdrs, double *__dp); -extern void xdrstdio_create (XDR *__xdrs, FILE *__file, enum xdr_op __xop); +extern bool_t xdr_int(XDR *__xdrs, int *__ip); +extern bool_t xdr_u_int(XDR *__xdrs, unsigned int *__ip); +extern bool_t xdr_short(XDR *__xdrs, short *__ip); +extern bool_t xdr_u_short(XDR *__xdrs, unsigned short *__ip); +extern bool_t xdr_bool(XDR *__xdrs, int *__bp); +extern bool_t xdr_opaque(XDR *__xdrs, char *__cp, unsigned int __cnt); +extern bool_t xdr_string(XDR *__xdrs, char **__cpp, unsigned int __maxsize); +extern bool_t xdr_char(XDR *__xdrs, char *__cp); +extern bool_t xdr_u_char(XDR *__xdrs, unsigned char *__cp); +extern bool_t xdr_vector(XDR *__xdrs, char *__basep, unsigned int __nelem, unsigned int __elemsize, + xdrproc_t __xdr_elem); +extern bool_t xdr_float(XDR *__xdrs, float *__fp); +extern bool_t xdr_double(XDR *__xdrs, double *__dp); +extern void xdrstdio_create(XDR *__xdrs, FILE *__file, enum xdr_op __xop); /* free memory buffers for xdr */ -extern void xdr_free (xdrproc_t __proc, char *__objp); +extern void xdr_free(xdrproc_t __proc, char *__objp); #ifdef __cplusplus } diff --git a/src/MLIAP/README.md b/src/MLIAP/README.md index c311168263..b5cdc337f5 100644 --- a/src/MLIAP/README.md +++ b/src/MLIAP/README.md @@ -38,4 +38,4 @@ The `mliappy` energy model requires that the MLIAP package be compiled with Pyth This requires to also install the PYTHON package and have the [cython](https://cython.org) software installed. During configuration/compilation the cythonize script will be used to convert the provided .pyx file(s) to C++ code. Please do not run the cythonize script in the src/MLIAP folder. If you have done so by accident, you need to delete the generated .cpp and .h file(s) in the src/MLIAP folder or there may be problems during compilation. -More information on building LAMMPS with this package is [here](https://lammps.sandia.gov/doc/Build_extras.html#mliap). +More information on building LAMMPS with this package is [here](https://docs.lammps.org/Build_extras.html#mliap). diff --git a/src/MLIAP/compute_mliap.cpp b/src/MLIAP/compute_mliap.cpp index ce271c4480..58bcd87943 100644 --- a/src/MLIAP/compute_mliap.cpp +++ b/src/MLIAP/compute_mliap.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MLIAP/compute_mliap.h b/src/MLIAP/compute_mliap.h index 01255fff6d..6afbc970cb 100644 --- a/src/MLIAP/compute_mliap.h +++ b/src/MLIAP/compute_mliap.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(mliap,ComputeMLIAP) - +// clang-format off +ComputeStyle(mliap,ComputeMLIAP); +// clang-format on #else #ifndef LMP_COMPUTE_MLIAP_H @@ -22,7 +22,6 @@ ComputeStyle(mliap,ComputeMLIAP) #include "compute.h" - namespace LAMMPS_NS { class ComputeMLIAP : public Compute { @@ -39,11 +38,11 @@ class ComputeMLIAP : public Compute { private: double **mliaparray, **mliaparrayall; class NeighList *list; - int *map; // map types to [0,nelements) - int ndescriptors; // number of descriptors - int nparams; // number of model parameters per element + int *map; // map types to [0,nelements) + int ndescriptors; // number of descriptors + int nparams; // number of model parameters per element int nelements; - int gradgradflag; // 1 for graddesc, 0 for gamma + int gradgradflag; // 1 for graddesc, 0 for gamma class MLIAPModel *model; class MLIAPDescriptor *descriptor; class MLIAPData *data; @@ -57,7 +56,7 @@ class ComputeMLIAP : public Compute { void dbdotr_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MLIAP/mliap_data.cpp b/src/MLIAP/mliap_data.cpp index 0f23100a46..e96e87ba11 100644 --- a/src/MLIAP/mliap_data.cpp +++ b/src/MLIAP/mliap_data.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MLIAP/mliap_data.h b/src/MLIAP/mliap_data.h index bfefa53af0..5f689c204c 100644 --- a/src/MLIAP/mliap_data.h +++ b/src/MLIAP/mliap_data.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -21,11 +21,12 @@ namespace LAMMPS_NS { class MLIAPData : protected Pointers { public: - MLIAPData(class LAMMPS*, int, int*, class MLIAPModel*, class MLIAPDescriptor*, class PairMLIAP* = nullptr); + MLIAPData(class LAMMPS *, int, int *, class MLIAPModel *, class MLIAPDescriptor *, + class PairMLIAP * = nullptr); ~MLIAPData(); void init(); - void generate_neighdata(class NeighList *, int=0, int=0); + void generate_neighdata(class NeighList *, int = 0, int = 0); void grow_neigharrays(); double memory_usage(); @@ -35,52 +36,51 @@ class MLIAPData : protected Pointers { int yoffset, zoffset; int ndims_force, ndims_virial; double **gradforce; - double** betas; // betas for all atoms in list - double** descriptors; // descriptors for all atoms in list - double* eatoms; // energies for all atoms in list - double energy; // energy - int ndescriptors; // number of descriptors - int nparams; // number of model parameters per element - int nelements; // number of elements + double **betas; // betas for all atoms in list + double **descriptors; // descriptors for all atoms in list + double *eatoms; // energies for all atoms in list + double energy; // energy + int ndescriptors; // number of descriptors + int nparams; // number of model parameters per element + int nelements; // number of elements // data structures for grad-grad list (gamma) - int natomgamma_max; // allocated size of gamma - int gamma_nnz; // number of non-zero entries in gamma - double** gamma; // gamma element - int** gamma_row_index; // row (parameter) index - int** gamma_col_index; // column (descriptor) index - double* egradient; // energy gradient w.r.t. parameters + int natomgamma_max; // allocated size of gamma + int gamma_nnz; // number of non-zero entries in gamma + double **gamma; // gamma element + int **gamma_row_index; // row (parameter) index + int **gamma_col_index; // column (descriptor) index + double *egradient; // energy gradient w.r.t. parameters // data structures for mliap neighbor list // only neighbors strictly inside descriptor cutoff - int nlistatoms; // current number of atoms in neighborlist - int nlistatoms_max; // allocated size of descriptor array - int natomneigh_max; // allocated size of atom neighbor arrays - int *numneighs; // neighbors count for each atom - int *iatoms; // index of each atom - int *ielems; // element of each atom - int nneigh_max; // number of ij neighbors allocated - int *jatoms; // index of each neighbor - int *jelems; // element of each neighbor - double **rij; // distance vector of each neighbor - double ***graddesc; // descriptor gradient w.r.t. each neighbor - int eflag; // indicates if energy is needed - int vflag; // indicates if virial is needed - class PairMLIAP *pairmliap; // access to pair tally functions + int nlistatoms; // current number of atoms in neighborlist + int nlistatoms_max; // allocated size of descriptor array + int natomneigh_max; // allocated size of atom neighbor arrays + int *numneighs; // neighbors count for each atom + int *iatoms; // index of each atom + int *ielems; // element of each atom + int nneigh_max; // number of ij neighbors allocated + int *jatoms; // index of each neighbor + int *jelems; // element of each neighbor + double **rij; // distance vector of each neighbor + double ***graddesc; // descriptor gradient w.r.t. each neighbor + int eflag; // indicates if energy is needed + int vflag; // indicates if virial is needed + class PairMLIAP *pairmliap; // access to pair tally functions private: class MLIAPModel *model; class MLIAPDescriptor *descriptor; int nmax; - class NeighList *list; // LAMMPS neighbor list - int *map; // map LAMMPS types to [0,nelements) - int gradgradflag; // 1 for graddesc, 0 for gamma - + class NeighList *list; // LAMMPS neighbor list + int *map; // map LAMMPS types to [0,nelements) + int gradgradflag; // 1 for graddesc, 0 for gamma }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/MLIAP/mliap_descriptor.cpp b/src/MLIAP/mliap_descriptor.cpp index 29b1736f4e..06cb8bbb80 100644 --- a/src/MLIAP/mliap_descriptor.cpp +++ b/src/MLIAP/mliap_descriptor.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MLIAP/mliap_descriptor.h b/src/MLIAP/mliap_descriptor.h index 7f162d6ee4..437c6b4620 100644 --- a/src/MLIAP/mliap_descriptor.h +++ b/src/MLIAP/mliap_descriptor.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,27 +18,25 @@ namespace LAMMPS_NS { -class MLIAPDescriptor : protected Pointers { -public: - MLIAPDescriptor(LAMMPS*); +class MLIAPDescriptor : protected Pointers { + public: + MLIAPDescriptor(LAMMPS *); ~MLIAPDescriptor(); - virtual void compute_descriptors(class MLIAPData*)=0; - virtual void compute_forces(class MLIAPData*)=0; - virtual void compute_force_gradients(class MLIAPData*)=0; - virtual void compute_descriptor_gradients(class MLIAPData*)=0; - virtual void init()=0; - virtual double memory_usage()=0; - - int ndescriptors; // number of descriptors - int nelements; // # of unique elements - char **elements; // names of unique elements - double **cutsq; // nelem x nelem rcutsq values - double cutmax; // maximum cutoff needed -protected: + virtual void compute_descriptors(class MLIAPData *) = 0; + virtual void compute_forces(class MLIAPData *) = 0; + virtual void compute_force_gradients(class MLIAPData *) = 0; + virtual void compute_descriptor_gradients(class MLIAPData *) = 0; + virtual void init() = 0; + virtual double memory_usage() = 0; + int ndescriptors; // number of descriptors + int nelements; // # of unique elements + char **elements; // names of unique elements + double **cutsq; // nelem x nelem rcutsq values + double cutmax; // maximum cutoff needed + protected: }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/mliap_descriptor_snap.cpp b/src/MLIAP/mliap_descriptor_snap.cpp index 098d9ccbba..fdc6210b08 100644 --- a/src/MLIAP/mliap_descriptor_snap.cpp +++ b/src/MLIAP/mliap_descriptor_snap.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MLIAP/mliap_descriptor_snap.h b/src/MLIAP/mliap_descriptor_snap.h index 09cb56f445..e2ebda794f 100644 --- a/src/MLIAP/mliap_descriptor_snap.h +++ b/src/MLIAP/mliap_descriptor_snap.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,33 +18,32 @@ namespace LAMMPS_NS { -class MLIAPDescriptorSNAP : public MLIAPDescriptor { -public: - MLIAPDescriptorSNAP(LAMMPS*, char*); +class MLIAPDescriptorSNAP : public MLIAPDescriptor { + public: + MLIAPDescriptorSNAP(LAMMPS *, char *); ~MLIAPDescriptorSNAP(); - virtual void compute_descriptors(class MLIAPData*); - virtual void compute_forces(class MLIAPData*); - virtual void compute_force_gradients(class MLIAPData*); - virtual void compute_descriptor_gradients(class MLIAPData*); + virtual void compute_descriptors(class MLIAPData *); + virtual void compute_forces(class MLIAPData *); + virtual void compute_force_gradients(class MLIAPData *); + virtual void compute_descriptor_gradients(class MLIAPData *); virtual void init(); virtual double memory_usage(); double rcutfac; -protected: - class SNA* snaptr; + protected: + class SNA *snaptr; void read_paramfile(char *); - inline int equal(double* x,double* y); - inline double dist2(double* x,double* y); + inline int equal(double *x, double *y); + inline double dist2(double *x, double *y); - double *radelem; // element radii - double *wjelem; // elements weights + double *radelem; // element radii + double *wjelem; // elements weights int twojmax, switchflag, bzeroflag; int chemflag, bnormflag, wselfallflag; double rfac0, rmin0; }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/mliap_model.cpp b/src/MLIAP/mliap_model.cpp index 214ac3358c..dfebe2eccf 100644 --- a/src/MLIAP/mliap_model.cpp +++ b/src/MLIAP/mliap_model.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MLIAP/mliap_model.h b/src/MLIAP/mliap_model.h index 98bae35d2f..9c14782806 100644 --- a/src/MLIAP/mliap_model.h +++ b/src/MLIAP/mliap_model.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,40 +19,38 @@ namespace LAMMPS_NS { class MLIAPModel : protected Pointers { -public: - MLIAPModel(LAMMPS*, char*); + public: + MLIAPModel(LAMMPS *, char *); ~MLIAPModel(); void set_ndescriptors(int); void set_nelements(int); - virtual int get_nparams()=0; - virtual int get_gamma_nnz(class MLIAPData*)=0; - virtual void compute_gradients(class MLIAPData*)=0; - virtual void compute_gradgrads(class MLIAPData*)=0; - virtual void compute_force_gradients(class MLIAPData*)=0; + virtual int get_nparams() = 0; + virtual int get_gamma_nnz(class MLIAPData *) = 0; + virtual void compute_gradients(class MLIAPData *) = 0; + virtual void compute_gradgrads(class MLIAPData *) = 0; + virtual void compute_force_gradients(class MLIAPData *) = 0; virtual void init(); - virtual double memory_usage()=0; - int nelements; // # of unique elements - int nonlinearflag; // 1 if gradient() requires descriptors - int ndescriptors; // number of descriptors - int nparams; // number of parameters per element + virtual double memory_usage() = 0; + int nelements; // # of unique elements + int nonlinearflag; // 1 if gradient() requires descriptors + int ndescriptors; // number of descriptors + int nparams; // number of parameters per element -protected: - virtual void read_coeffs(char *)=0; + protected: + virtual void read_coeffs(char *) = 0; }; class MLIAPModelSimple : public MLIAPModel { -public: - MLIAPModelSimple(LAMMPS*, char*); + public: + MLIAPModelSimple(LAMMPS *, char *); ~MLIAPModelSimple(); virtual double memory_usage(); -protected: - double **coeffelem; // element coefficients + protected: + double **coeffelem; // element coefficients virtual void read_coeffs(char *); - }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/mliap_model_linear.cpp b/src/MLIAP/mliap_model_linear.cpp index 8417bcdd18..1323b95aa1 100644 --- a/src/MLIAP/mliap_model_linear.cpp +++ b/src/MLIAP/mliap_model_linear.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MLIAP/mliap_model_linear.h b/src/MLIAP/mliap_model_linear.h index 1603f0cb53..b485e58eff 100644 --- a/src/MLIAP/mliap_model_linear.h +++ b/src/MLIAP/mliap_model_linear.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,18 +19,18 @@ namespace LAMMPS_NS { class MLIAPModelLinear : public MLIAPModelSimple { -public: - MLIAPModelLinear(LAMMPS*, char* = nullptr); + public: + MLIAPModelLinear(LAMMPS *, char * = nullptr); ~MLIAPModelLinear(); virtual int get_nparams(); - virtual int get_gamma_nnz(class MLIAPData*); - virtual void compute_gradients(class MLIAPData*); - virtual void compute_gradgrads(class MLIAPData*); - virtual void compute_force_gradients(class MLIAPData*); -protected: + virtual int get_gamma_nnz(class MLIAPData *); + virtual void compute_gradients(class MLIAPData *); + virtual void compute_gradgrads(class MLIAPData *); + virtual void compute_force_gradients(class MLIAPData *); + + protected: }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/mliap_model_nn.cpp b/src/MLIAP/mliap_model_nn.cpp index fcc62c3059..f3dec942a1 100644 --- a/src/MLIAP/mliap_model_nn.cpp +++ b/src/MLIAP/mliap_model_nn.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MLIAP/mliap_model_nn.h b/src/MLIAP/mliap_model_nn.h index 0f04b09f9a..6eeaddb39d 100644 --- a/src/MLIAP/mliap_model_nn.h +++ b/src/MLIAP/mliap_model_nn.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,50 +19,51 @@ namespace LAMMPS_NS { class MLIAPModelNN : public MLIAPModel { -public: - MLIAPModelNN(LAMMPS*, char* = nullptr); + public: + MLIAPModelNN(LAMMPS *, char * = nullptr); ~MLIAPModelNN(); virtual int get_nparams(); - virtual int get_gamma_nnz(class MLIAPData*); - virtual void compute_gradients(class MLIAPData*); - virtual void compute_gradgrads(class MLIAPData*); - virtual void compute_force_gradients(class MLIAPData*); + virtual int get_gamma_nnz(class MLIAPData *); + virtual void compute_gradients(class MLIAPData *); + virtual void compute_gradgrads(class MLIAPData *); + virtual void compute_force_gradients(class MLIAPData *); virtual double memory_usage(); - int nlayers; // number of layers per element + int nlayers; // number of layers per element -protected: - int *activation; // activation functions - int *nnodes; // number of nodes per layer - double ***scale; // element scale values - double **coeffelem; // element coefficients + protected: + int *activation; // activation functions + int *nnodes; // number of nodes per layer + double ***scale; // element scale values + double **coeffelem; // element coefficients virtual void read_coeffs(char *); - inline double sigm(double x, double &deriv) { - double expl = 1./(1.+exp(-x)); - deriv = expl*(1-expl); + inline double sigm(double x, double &deriv) + { + double expl = 1. / (1. + exp(-x)); + deriv = expl * (1 - expl); return expl; } - inline double tanh(double x, double &deriv) { - double expl = 2./(1.+exp(-2.*x))-1; - deriv = 1.-expl*expl; + inline double tanh(double x, double &deriv) + { + double expl = 2. / (1. + exp(-2. * x)) - 1; + deriv = 1. - expl * expl; return expl; } - inline double relu(double x, double &deriv) { + inline double relu(double x, double &deriv) + { if (x > 0) { - deriv = 1.; - return x; + deriv = 1.; + return x; } else { - deriv = 0.; - return 0; + deriv = 0.; + return 0; } } - }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/mliap_model_python.cpp b/src/MLIAP/mliap_model_python.cpp index 6f88c41bce..cd985f273a 100644 --- a/src/MLIAP/mliap_model_python.cpp +++ b/src/MLIAP/mliap_model_python.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MLIAP/mliap_model_python.h b/src/MLIAP/mliap_model_python.h index f776b9a795..8410b4dc4a 100644 --- a/src/MLIAP/mliap_model_python.h +++ b/src/MLIAP/mliap_model_python.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,30 +18,27 @@ namespace LAMMPS_NS { - class MLIAPModelPython : public MLIAPModel { -public: - MLIAPModelPython(LAMMPS*, char* = NULL); + public: + MLIAPModelPython(LAMMPS *, char * = NULL); ~MLIAPModelPython(); virtual int get_nparams(); - virtual int get_gamma_nnz(class MLIAPData*); - virtual void compute_gradients(class MLIAPData*); - virtual void compute_gradgrads(class MLIAPData*); - virtual void compute_force_gradients(class MLIAPData*); + virtual int get_gamma_nnz(class MLIAPData *); + virtual void compute_gradients(class MLIAPData *); + virtual void compute_gradgrads(class MLIAPData *); + virtual void compute_force_gradients(class MLIAPData *); virtual double memory_usage(); - void connect_param_counts(); // If possible convert this to protected/private and - // and figure out how to declare cython fn - // load_from_python as a friend. + void connect_param_counts(); // If possible convert this to protected/private and + // and figure out how to declare cython fn + // load_from_python as a friend. int model_loaded; -protected: + protected: virtual void read_coeffs(char *); -private: - + private: }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/mliap_model_quadratic.cpp b/src/MLIAP/mliap_model_quadratic.cpp index 1f46704d1b..638b4a22f7 100644 --- a/src/MLIAP/mliap_model_quadratic.cpp +++ b/src/MLIAP/mliap_model_quadratic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MLIAP/mliap_model_quadratic.h b/src/MLIAP/mliap_model_quadratic.h index eabb8acfbe..c183178339 100644 --- a/src/MLIAP/mliap_model_quadratic.h +++ b/src/MLIAP/mliap_model_quadratic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,19 +19,18 @@ namespace LAMMPS_NS { class MLIAPModelQuadratic : public MLIAPModelSimple { -public: - MLIAPModelQuadratic(LAMMPS*, char* = nullptr); + public: + MLIAPModelQuadratic(LAMMPS *, char * = nullptr); ~MLIAPModelQuadratic(); virtual int get_nparams(); - virtual int get_gamma_nnz(class MLIAPData*); - virtual void compute_gradients(class MLIAPData*); - virtual void compute_gradgrads(class MLIAPData*); - virtual void compute_force_gradients(class MLIAPData*); + virtual int get_gamma_nnz(class MLIAPData *); + virtual void compute_gradients(class MLIAPData *); + virtual void compute_gradgrads(class MLIAPData *); + virtual void compute_force_gradients(class MLIAPData *); -protected: + protected: }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/pair_mliap.cpp b/src/MLIAP/pair_mliap.cpp index ab081f8462..f9dadf30ca 100644 --- a/src/MLIAP/pair_mliap.cpp +++ b/src/MLIAP/pair_mliap.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MLIAP/pair_mliap.h b/src/MLIAP/pair_mliap.h index d8fb82c8b7..641772effb 100644 --- a/src/MLIAP/pair_mliap.h +++ b/src/MLIAP/pair_mliap.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(mliap,PairMLIAP) - +// clang-format off +PairStyle(mliap,PairMLIAP); +// clang-format on #else #ifndef LMP_PAIR_MLIAP_H @@ -25,29 +25,28 @@ PairStyle(mliap,PairMLIAP) namespace LAMMPS_NS { class PairMLIAP : public Pair { -public: + public: PairMLIAP(class LAMMPS *); ~PairMLIAP(); virtual void compute(int, int); void settings(int, char **); virtual void coeff(int, char **); - void e_tally(class MLIAPData*); - void v_tally(int, int, double*, double*); + void e_tally(class MLIAPData *); + void v_tally(int, int, double *, double *); virtual void init_style(); virtual double init_one(int, int); virtual double memory_usage(); - int *map; // mapping from atom types to elements + int *map; // mapping from atom types to elements -protected: + protected: virtual void allocate(); - class MLIAPModel* model; - class MLIAPDescriptor* descriptor; + class MLIAPModel *model; + class MLIAPDescriptor *descriptor; class MLIAPData *data; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/MOLECULE/angle_charmm.cpp b/src/MOLECULE/angle_charmm.cpp index 73a17c2b6c..eeda825cfa 100644 --- a/src/MOLECULE/angle_charmm.cpp +++ b/src/MOLECULE/angle_charmm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/angle_charmm.h b/src/MOLECULE/angle_charmm.h index 28ed51e8ce..72bae696cb 100644 --- a/src/MOLECULE/angle_charmm.h +++ b/src/MOLECULE/angle_charmm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(charmm,AngleCharmm) - +// clang-format off +AngleStyle(charmm,AngleCharmm); +// clang-format on #else #ifndef LMP_ANGLE_CHARMM_H @@ -37,12 +37,12 @@ class AngleCharmm : public Angle { double single(int, int, int, int); protected: - double *k,*theta0,*k_ub,*r_ub; + double *k, *theta0, *k_ub, *r_ub; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/angle_cosine.cpp b/src/MOLECULE/angle_cosine.cpp index 4480ec7fa6..624c6c2e95 100644 --- a/src/MOLECULE/angle_cosine.cpp +++ b/src/MOLECULE/angle_cosine.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/angle_cosine.h b/src/MOLECULE/angle_cosine.h index 915acab85e..2c7b0ddbc4 100644 --- a/src/MOLECULE/angle_cosine.h +++ b/src/MOLECULE/angle_cosine.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine,AngleCosine) - +// clang-format off +AngleStyle(cosine,AngleCosine); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_H @@ -42,7 +42,7 @@ class AngleCosine : public Angle { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/angle_cosine_delta.cpp b/src/MOLECULE/angle_cosine_delta.cpp index 6ec8cbb69e..e13174d70d 100644 --- a/src/MOLECULE/angle_cosine_delta.cpp +++ b/src/MOLECULE/angle_cosine_delta.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/angle_cosine_delta.h b/src/MOLECULE/angle_cosine_delta.h index 28a14149f6..ce5b001073 100644 --- a/src/MOLECULE/angle_cosine_delta.h +++ b/src/MOLECULE/angle_cosine_delta.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine/delta,AngleCosineDelta) - +// clang-format off +AngleStyle(cosine/delta,AngleCosineDelta); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_DELTA_H @@ -31,7 +31,7 @@ class AngleCosineDelta : public AngleCosineSquared { double single(int, int, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/angle_cosine_periodic.cpp b/src/MOLECULE/angle_cosine_periodic.cpp index 6d4252e8b3..4a7768722f 100644 --- a/src/MOLECULE/angle_cosine_periodic.cpp +++ b/src/MOLECULE/angle_cosine_periodic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/angle_cosine_periodic.h b/src/MOLECULE/angle_cosine_periodic.h index 2f25245dbe..e5c9673b78 100644 --- a/src/MOLECULE/angle_cosine_periodic.h +++ b/src/MOLECULE/angle_cosine_periodic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine/periodic, AngleCosinePeriodic) - +// clang-format off +AngleStyle(cosine/periodic, AngleCosinePeriodic); +// clang-format on #else #ifndef LMP_ANGLE_PERIODIC_H @@ -38,12 +38,12 @@ class AngleCosinePeriodic : public Angle { protected: double *k; - int *multiplicity,*b; + int *multiplicity, *b; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/angle_cosine_squared.cpp b/src/MOLECULE/angle_cosine_squared.cpp index 9d5a2167c4..4351095e56 100644 --- a/src/MOLECULE/angle_cosine_squared.cpp +++ b/src/MOLECULE/angle_cosine_squared.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/angle_cosine_squared.h b/src/MOLECULE/angle_cosine_squared.h index d4539a3b23..d36aac64dd 100644 --- a/src/MOLECULE/angle_cosine_squared.h +++ b/src/MOLECULE/angle_cosine_squared.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine/squared,AngleCosineSquared) - +// clang-format off +AngleStyle(cosine/squared,AngleCosineSquared); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_SQUARED_H @@ -37,12 +37,12 @@ class AngleCosineSquared : public Angle { virtual double single(int, int, int, int); protected: - double *k,*theta0; + double *k, *theta0; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/angle_harmonic.cpp b/src/MOLECULE/angle_harmonic.cpp index 46a5a06cc6..42f20328ea 100644 --- a/src/MOLECULE/angle_harmonic.cpp +++ b/src/MOLECULE/angle_harmonic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/angle_harmonic.h b/src/MOLECULE/angle_harmonic.h index 109da340c7..e722f7d065 100644 --- a/src/MOLECULE/angle_harmonic.h +++ b/src/MOLECULE/angle_harmonic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(harmonic,AngleHarmonic) - +// clang-format off +AngleStyle(harmonic,AngleHarmonic); +// clang-format on #else #ifndef LMP_ANGLE_HARMONIC_H @@ -37,12 +37,12 @@ class AngleHarmonic : public Angle { double single(int, int, int, int); protected: - double *k,*theta0; + double *k, *theta0; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/angle_table.cpp b/src/MOLECULE/angle_table.cpp index 4dfb4f0988..4299e375f1 100644 --- a/src/MOLECULE/angle_table.cpp +++ b/src/MOLECULE/angle_table.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/angle_table.h b/src/MOLECULE/angle_table.h index bbfa6d38b7..6b95cb6a23 100644 --- a/src/MOLECULE/angle_table.h +++ b/src/MOLECULE/angle_table.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(table,AngleTable) - +// clang-format off +AngleStyle(table,AngleTable); +// clang-format on #else #ifndef LMP_ANGLE_TABLE_H @@ -39,16 +39,16 @@ class AngleTable : public Angle { double single(int, int, int, int); protected: - int tabstyle,tablength; + int tabstyle, tablength; double *theta0; struct Table { - int ninput,fpflag; - double fplo,fphi,theta0; - double *afile,*efile,*ffile; - double *e2file,*f2file; - double delta,invdelta,deltasq6; - double *ang,*e,*de,*f,*df,*e2,*f2; + int ninput, fpflag; + double fplo, fphi, theta0; + double *afile, *efile, *ffile; + double *e2file, *f2file; + double delta, invdelta, deltasq6; + double *ang, *e, *de, *f, *df, *e2, *f2; }; int ntables; @@ -71,7 +71,7 @@ class AngleTable : public Angle { void u_lookup(int, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/atom_vec_angle.cpp b/src/MOLECULE/atom_vec_angle.cpp index 046650dedd..06a4f441ca 100644 --- a/src/MOLECULE/atom_vec_angle.cpp +++ b/src/MOLECULE/atom_vec_angle.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/atom_vec_angle.h b/src/MOLECULE/atom_vec_angle.h index 6bff95af40..5ec0166f98 100644 --- a/src/MOLECULE/atom_vec_angle.h +++ b/src/MOLECULE/atom_vec_angle.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(angle,AtomVecAngle) - +// clang-format off +AtomStyle(angle,AtomVecAngle); +// clang-format on #else #ifndef LMP_ATOM_VEC_ANGLE_H @@ -36,16 +36,16 @@ class AtomVecAngle : public AtomVec { void data_atom_post(int); private: - int *num_bond,*num_angle; - int **bond_type,**angle_type; + int *num_bond, *num_angle; + int **bond_type, **angle_type; int **nspecial; - int any_bond_negative,any_angle_negative; - int bond_per_atom,angle_per_atom; - int *bond_negative,*angle_negative; + int any_bond_negative, any_angle_negative; + int bond_per_atom, angle_per_atom; + int *bond_negative, *angle_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/atom_vec_bond.cpp b/src/MOLECULE/atom_vec_bond.cpp index 285d73cf65..acd0bc9979 100644 --- a/src/MOLECULE/atom_vec_bond.cpp +++ b/src/MOLECULE/atom_vec_bond.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/atom_vec_bond.h b/src/MOLECULE/atom_vec_bond.h index ba32265374..4aa8ff5edc 100644 --- a/src/MOLECULE/atom_vec_bond.h +++ b/src/MOLECULE/atom_vec_bond.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(bond,AtomVecBond) - +// clang-format off +AtomStyle(bond,AtomVecBond); +// clang-format on #else #ifndef LMP_ATOM_VEC_BOND_H @@ -45,7 +45,7 @@ class AtomVecBond : public AtomVec { int *bond_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/atom_vec_full.cpp b/src/MOLECULE/atom_vec_full.cpp index 074c89a088..e88c4d7a62 100644 --- a/src/MOLECULE/atom_vec_full.cpp +++ b/src/MOLECULE/atom_vec_full.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/atom_vec_full.h b/src/MOLECULE/atom_vec_full.h index 569ea4e11d..5fff686e78 100644 --- a/src/MOLECULE/atom_vec_full.h +++ b/src/MOLECULE/atom_vec_full.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(full,AtomVecFull) - +// clang-format off +AtomStyle(full,AtomVecFull); +// clang-format on #else #ifndef LMP_ATOM_VEC_FULL_H @@ -36,17 +36,16 @@ class AtomVecFull : public AtomVec { void data_atom_post(int); private: - int *num_bond,*num_angle,*num_dihedral,*num_improper; - int **bond_type,**angle_type,**dihedral_type,**improper_type; + int *num_bond, *num_angle, *num_dihedral, *num_improper; + int **bond_type, **angle_type, **dihedral_type, **improper_type; int **nspecial; - int any_bond_negative,any_angle_negative, - any_dihedral_negative,any_improper_negative; - int bond_per_atom,angle_per_atom,dihedral_per_atom,improper_per_atom; - int *bond_negative,*angle_negative,*dihedral_negative,*improper_negative; + int any_bond_negative, any_angle_negative, any_dihedral_negative, any_improper_negative; + int bond_per_atom, angle_per_atom, dihedral_per_atom, improper_per_atom; + int *bond_negative, *angle_negative, *dihedral_negative, *improper_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/atom_vec_molecular.cpp b/src/MOLECULE/atom_vec_molecular.cpp index 3a0bb1a16c..9cb3f53f5a 100644 --- a/src/MOLECULE/atom_vec_molecular.cpp +++ b/src/MOLECULE/atom_vec_molecular.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/atom_vec_molecular.h b/src/MOLECULE/atom_vec_molecular.h index 9203e5d040..b98b3114f0 100644 --- a/src/MOLECULE/atom_vec_molecular.h +++ b/src/MOLECULE/atom_vec_molecular.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(molecular,AtomVecMolecular) - +// clang-format off +AtomStyle(molecular,AtomVecMolecular); +// clang-format on #else #ifndef LMP_ATOM_VEC_MOLECULAR_H @@ -36,17 +36,16 @@ class AtomVecMolecular : public AtomVec { void data_atom_post(int); private: - int *num_bond,*num_angle,*num_dihedral,*num_improper; - int **bond_type,**angle_type,**dihedral_type,**improper_type; + int *num_bond, *num_angle, *num_dihedral, *num_improper; + int **bond_type, **angle_type, **dihedral_type, **improper_type; int **nspecial; - int any_bond_negative,any_angle_negative, - any_dihedral_negative,any_improper_negative; - int bond_per_atom,angle_per_atom,dihedral_per_atom,improper_per_atom; - int *bond_negative,*angle_negative,*dihedral_negative,*improper_negative; + int any_bond_negative, any_angle_negative, any_dihedral_negative, any_improper_negative; + int bond_per_atom, angle_per_atom, dihedral_per_atom, improper_per_atom; + int *bond_negative, *angle_negative, *dihedral_negative, *improper_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/atom_vec_template.cpp b/src/MOLECULE/atom_vec_template.cpp index 0aefc66e26..919f5c9aec 100644 --- a/src/MOLECULE/atom_vec_template.cpp +++ b/src/MOLECULE/atom_vec_template.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/atom_vec_template.h b/src/MOLECULE/atom_vec_template.h index efc178ad5a..0050190eb6 100644 --- a/src/MOLECULE/atom_vec_template.h +++ b/src/MOLECULE/atom_vec_template.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(template,AtomVecTemplate) - +// clang-format off +AtomStyle(template,AtomVecTemplate); +// clang-format on #else #ifndef LMP_ATOM_VEC_TEMPLATE_H @@ -36,10 +36,10 @@ class AtomVecTemplate : public AtomVec { void data_atom_post(int); private: - int *molindex,*molatom; + int *molindex, *molatom; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/bond_fene.cpp b/src/MOLECULE/bond_fene.cpp index 07e8828f62..74255abf29 100644 --- a/src/MOLECULE/bond_fene.cpp +++ b/src/MOLECULE/bond_fene.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/bond_fene.h b/src/MOLECULE/bond_fene.h index e00be16aea..76ee2ea34f 100644 --- a/src/MOLECULE/bond_fene.h +++ b/src/MOLECULE/bond_fene.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(fene, BondFENE) - +// clang-format off +BondStyle(fene, BondFENE); +// clang-format on #else #ifndef LMP_BOND_FENE_H @@ -49,7 +49,7 @@ class BondFENE : public Bond { #endif #endif - /* ERROR/WARNING messages: +/* ERROR/WARNING messages: W: FENE bond too long: %ld %d %d %g diff --git a/src/MOLECULE/bond_fene_expand.cpp b/src/MOLECULE/bond_fene_expand.cpp index faa4a203d1..0b381c728c 100644 --- a/src/MOLECULE/bond_fene_expand.cpp +++ b/src/MOLECULE/bond_fene_expand.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/bond_fene_expand.h b/src/MOLECULE/bond_fene_expand.h index 49a8b8ab8e..9252165293 100644 --- a/src/MOLECULE/bond_fene_expand.h +++ b/src/MOLECULE/bond_fene_expand.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(fene/expand, BondFENEExpand) - +// clang-format off +BondStyle(fene/expand, BondFENEExpand); +// clang-format on #else #ifndef LMP_BOND_FENE_EXPAND_H @@ -48,7 +48,7 @@ class BondFENEExpand : public Bond { #endif #endif - /* ERROR/WARNING messages: +/* ERROR/WARNING messages: W: FENE bond too long: %ld %d %d %g diff --git a/src/MOLECULE/bond_gromos.cpp b/src/MOLECULE/bond_gromos.cpp index 16904f4a76..f6e0a25606 100644 --- a/src/MOLECULE/bond_gromos.cpp +++ b/src/MOLECULE/bond_gromos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/bond_gromos.h b/src/MOLECULE/bond_gromos.h index 54cfb19a92..1f555d09a8 100644 --- a/src/MOLECULE/bond_gromos.h +++ b/src/MOLECULE/bond_gromos.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(gromos,BondGromos) - +// clang-format off +BondStyle(gromos,BondGromos); +// clang-format on #else #ifndef LMP_BOND_GROMOS_H @@ -38,12 +38,12 @@ class BondGromos : public Bond { virtual void *extract(const char *, int &); protected: - double *k,*r0; + double *k, *r0; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/bond_harmonic.cpp b/src/MOLECULE/bond_harmonic.cpp index 25f60e1498..32988d8d0a 100644 --- a/src/MOLECULE/bond_harmonic.cpp +++ b/src/MOLECULE/bond_harmonic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/bond_harmonic.h b/src/MOLECULE/bond_harmonic.h index b335e23a97..eb6c5e062e 100644 --- a/src/MOLECULE/bond_harmonic.h +++ b/src/MOLECULE/bond_harmonic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(harmonic,BondHarmonic) - +// clang-format off +BondStyle(harmonic,BondHarmonic); +// clang-format on #else #ifndef LMP_BOND_HARMONIC_H @@ -38,12 +38,12 @@ class BondHarmonic : public Bond { virtual void *extract(const char *, int &); protected: - double *k,*r0; + double *k, *r0; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/bond_morse.cpp b/src/MOLECULE/bond_morse.cpp index f196bfda97..6175ed27cf 100644 --- a/src/MOLECULE/bond_morse.cpp +++ b/src/MOLECULE/bond_morse.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/bond_morse.h b/src/MOLECULE/bond_morse.h index 6110eda171..10e99c16a3 100644 --- a/src/MOLECULE/bond_morse.h +++ b/src/MOLECULE/bond_morse.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(morse,BondMorse) - +// clang-format off +BondStyle(morse,BondMorse); +// clang-format on #else #ifndef LMP_BOND_MORSE_H @@ -38,12 +38,12 @@ class BondMorse : public Bond { virtual void *extract(const char *, int &); protected: - double *d0,*alpha,*r0; + double *d0, *alpha, *r0; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/bond_nonlinear.cpp b/src/MOLECULE/bond_nonlinear.cpp index c00ab4c87d..e1cac4743f 100644 --- a/src/MOLECULE/bond_nonlinear.cpp +++ b/src/MOLECULE/bond_nonlinear.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/bond_nonlinear.h b/src/MOLECULE/bond_nonlinear.h index 8624e9bb14..4fcf87cdf0 100644 --- a/src/MOLECULE/bond_nonlinear.h +++ b/src/MOLECULE/bond_nonlinear.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(nonlinear,BondNonlinear) - +// clang-format off +BondStyle(nonlinear,BondNonlinear); +// clang-format on #else #ifndef LMP_BOND_NONLINEAR_H @@ -38,12 +38,12 @@ class BondNonlinear : public Bond { virtual void *extract(const char *, int &); protected: - double *epsilon,*r0,*lamda; + double *epsilon, *r0, *lamda; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/bond_quartic.cpp b/src/MOLECULE/bond_quartic.cpp index c7151c3aca..b3eea79064 100644 --- a/src/MOLECULE/bond_quartic.cpp +++ b/src/MOLECULE/bond_quartic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/bond_quartic.h b/src/MOLECULE/bond_quartic.h index 0642b5e8d4..35ec705849 100644 --- a/src/MOLECULE/bond_quartic.h +++ b/src/MOLECULE/bond_quartic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(quartic,BondQuartic) - +// clang-format off +BondStyle(quartic,BondQuartic); +// clang-format on #else #ifndef LMP_BOND_QUARTIC_H @@ -39,12 +39,12 @@ class BondQuartic : public Bond { protected: double TWO_1_3; - double *k,*b1,*b2,*rc,*u0; + double *k, *b1, *b2, *rc, *u0; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/bond_table.cpp b/src/MOLECULE/bond_table.cpp index 6d701f5b9a..5637dfa699 100644 --- a/src/MOLECULE/bond_table.cpp +++ b/src/MOLECULE/bond_table.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/bond_table.h b/src/MOLECULE/bond_table.h index 3c95069ee2..b1b506a2a4 100644 --- a/src/MOLECULE/bond_table.h +++ b/src/MOLECULE/bond_table.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(table,BondTable) - +// clang-format off +BondStyle(table,BondTable); +// clang-format on #else #ifndef LMP_BOND_TABLE_H @@ -39,17 +39,17 @@ class BondTable : public Bond { double single(int, double, int, int, double &); protected: - int tabstyle,tablength; + int tabstyle, tablength; double *r0; struct Table { - int ninput,fpflag; - double fplo,fphi,r0; - double lo,hi; - double *rfile,*efile,*ffile; - double *e2file,*f2file; - double delta,invdelta,deltasq6; - double *r,*e,*de,*f,*df,*e2,*f2; + int ninput, fpflag; + double fplo, fphi, r0; + double lo, hi; + double *rfile, *efile, *ffile; + double *e2file, *f2file; + double delta, invdelta, deltasq6; + double *r, *e, *de, *f, *df, *e2, *f2; }; int ntables; @@ -72,7 +72,7 @@ class BondTable : public Bond { void u_lookup(int, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp index 31435931e4..62a3c30434 100644 --- a/src/MOLECULE/dihedral_charmm.cpp +++ b/src/MOLECULE/dihedral_charmm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/dihedral_charmm.h b/src/MOLECULE/dihedral_charmm.h index 54ff666e0b..9d0bd69606 100644 --- a/src/MOLECULE/dihedral_charmm.h +++ b/src/MOLECULE/dihedral_charmm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(charmm,DihedralCharmm) - +// clang-format off +DihedralStyle(charmm,DihedralCharmm); +// clang-format on #else #ifndef LMP_DIHEDRAL_CHARMM_H @@ -36,15 +36,15 @@ class DihedralCharmm : public Dihedral { void write_data(FILE *); protected: - double *k,*weight,*cos_shift,*sin_shift; - int *multiplicity,*shift; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; - int implicit,weightflag; + double *k, *weight, *cos_shift, *sin_shift; + int *multiplicity, *shift; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; + int implicit, weightflag; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/dihedral_charmmfsw.cpp b/src/MOLECULE/dihedral_charmmfsw.cpp index 9939cb97ad..b74357ab39 100644 --- a/src/MOLECULE/dihedral_charmmfsw.cpp +++ b/src/MOLECULE/dihedral_charmmfsw.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/dihedral_charmmfsw.h b/src/MOLECULE/dihedral_charmmfsw.h index 89a0539a1d..afbcf66ade 100644 --- a/src/MOLECULE/dihedral_charmmfsw.h +++ b/src/MOLECULE/dihedral_charmmfsw.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(charmmfsw,DihedralCharmmfsw) - +// clang-format off +DihedralStyle(charmmfsw,DihedralCharmmfsw); +// clang-format on #else #ifndef LMP_DIHEDRAL_CHARMMFSW_H @@ -36,19 +36,19 @@ class DihedralCharmmfsw : public Dihedral { void write_data(FILE *); protected: - int implicit,weightflag,dihedflag; - double cut_lj_inner14,cut_lj14,cut_coul14; - double evdwl14_12,evdwl14_6,cut_coulinv14; - double cut_lj_inner3inv,cut_lj_inner6inv,cut_lj3inv,cut_lj6inv; + int implicit, weightflag, dihedflag; + double cut_lj_inner14, cut_lj14, cut_coul14; + double evdwl14_12, evdwl14_6, cut_coulinv14; + double cut_lj_inner3inv, cut_lj_inner6inv, cut_lj3inv, cut_lj6inv; - double *k,*weight,*cos_shift,*sin_shift; - int *multiplicity,*shift; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; + double *k, *weight, *cos_shift, *sin_shift; + int *multiplicity, *shift; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/dihedral_harmonic.cpp b/src/MOLECULE/dihedral_harmonic.cpp index a1cf42c816..5603178bcf 100644 --- a/src/MOLECULE/dihedral_harmonic.cpp +++ b/src/MOLECULE/dihedral_harmonic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/dihedral_harmonic.h b/src/MOLECULE/dihedral_harmonic.h index d1fe038c5e..e3c29b34bd 100644 --- a/src/MOLECULE/dihedral_harmonic.h +++ b/src/MOLECULE/dihedral_harmonic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(harmonic,DihedralHarmonic) - +// clang-format off +DihedralStyle(harmonic,DihedralHarmonic); +// clang-format on #else #ifndef LMP_DIHEDRAL_HARMONIC_H @@ -35,13 +35,13 @@ class DihedralHarmonic : public Dihedral { void write_data(FILE *); protected: - double *k,*cos_shift,*sin_shift; - int *sign,*multiplicity; + double *k, *cos_shift, *sin_shift; + int *sign, *multiplicity; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/dihedral_helix.cpp b/src/MOLECULE/dihedral_helix.cpp index 0c70b8a5ce..4726dd3bce 100644 --- a/src/MOLECULE/dihedral_helix.cpp +++ b/src/MOLECULE/dihedral_helix.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/dihedral_helix.h b/src/MOLECULE/dihedral_helix.h index f8981dd34a..dad281fa2e 100644 --- a/src/MOLECULE/dihedral_helix.h +++ b/src/MOLECULE/dihedral_helix.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(helix,DihedralHelix) - +// clang-format off +DihedralStyle(helix,DihedralHelix); +// clang-format on #else #ifndef LMP_DIHEDRAL_HELIX_H @@ -35,12 +35,12 @@ class DihedralHelix : public Dihedral { void write_data(FILE *); protected: - double *aphi,*bphi,*cphi; + double *aphi, *bphi, *cphi; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/dihedral_multi_harmonic.cpp b/src/MOLECULE/dihedral_multi_harmonic.cpp index 58e6dc09dd..958db6d0c5 100644 --- a/src/MOLECULE/dihedral_multi_harmonic.cpp +++ b/src/MOLECULE/dihedral_multi_harmonic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/dihedral_multi_harmonic.h b/src/MOLECULE/dihedral_multi_harmonic.h index 92e4d24723..9f79262da9 100644 --- a/src/MOLECULE/dihedral_multi_harmonic.h +++ b/src/MOLECULE/dihedral_multi_harmonic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(multi/harmonic,DihedralMultiHarmonic) - +// clang-format off +DihedralStyle(multi/harmonic,DihedralMultiHarmonic); +// clang-format on #else #ifndef LMP_DIHEDRAL_MULTI_HARMONIC_H @@ -35,12 +35,12 @@ class DihedralMultiHarmonic : public Dihedral { void write_data(FILE *); protected: - double *a1,*a2,*a3,*a4,*a5; + double *a1, *a2, *a3, *a4, *a5; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/dihedral_opls.cpp b/src/MOLECULE/dihedral_opls.cpp index 37af3907c5..d09fbc32d3 100644 --- a/src/MOLECULE/dihedral_opls.cpp +++ b/src/MOLECULE/dihedral_opls.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/dihedral_opls.h b/src/MOLECULE/dihedral_opls.h index c6f6ad7ad0..723fbb987b 100644 --- a/src/MOLECULE/dihedral_opls.h +++ b/src/MOLECULE/dihedral_opls.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(opls,DihedralOPLS) - +// clang-format off +DihedralStyle(opls,DihedralOPLS); +// clang-format on #else #ifndef LMP_DIHEDRAL_OPLS_H @@ -35,12 +35,12 @@ class DihedralOPLS : public Dihedral { void write_data(FILE *); protected: - double *k1,*k2,*k3,*k4; + double *k1, *k2, *k3, *k4; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index 9400da3389..fb1ead126b 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/fix_cmap.h b/src/MOLECULE/fix_cmap.h index d1dd3afbf2..ae70f9faad 100644 --- a/src/MOLECULE/fix_cmap.h +++ b/src/MOLECULE/fix_cmap.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(cmap,FixCMAP) - +// clang-format off +FixStyle(cmap,FixCMAP); +// clang-format on #else #ifndef LMP_FIX_CMAP_H @@ -65,10 +65,10 @@ class FixCMAP : public Fix { double memory_usage(); private: - int nprocs,me; - int newton_bond,eflag_caller; - int ctype,ilevel_respa; - int ncrosstermtypes,crossterm_per_atom,maxcrossterm; + int nprocs, me; + int newton_bond, eflag_caller; + int ctype, ilevel_respa; + int ncrosstermtypes, crossterm_per_atom, maxcrossterm; int ncrosstermlist; bigint ncmap; @@ -77,12 +77,12 @@ class FixCMAP : public Fix { int nmax_previous; int *num_crossterm; int **crossterm_type; - tagint **crossterm_atom1,**crossterm_atom2,**crossterm_atom3; - tagint **crossterm_atom4,**crossterm_atom5; + tagint **crossterm_atom1, **crossterm_atom2, **crossterm_atom3; + tagint **crossterm_atom4, **crossterm_atom5; - double E,dEdPhi,dEdPsi; + double E, dEdPhi, dEdPsi; double ecmap; - double fcmap[4],cij[4][4]; + double fcmap[4], cij[4][4]; double *g_axis; // CMAP grid points obtained from external file @@ -91,7 +91,7 @@ class FixCMAP : public Fix { // partial derivatives and cross-derivatives of the grid data - double ***d1cmapgrid,***d2cmapgrid,***d12cmapgrid; + double ***d1cmapgrid, ***d2cmapgrid, ***d12cmapgrid; // read map grid data @@ -112,8 +112,8 @@ class FixCMAP : public Fix { // calculate dihedral angles - double dihedral_angle_atan2(double, double, double, double, double, double, - double, double, double, double); + double dihedral_angle_atan2(double, double, double, double, double, double, double, double, + double, double); // calculate bicubic interpolation coefficient matrix c_ij @@ -121,10 +121,9 @@ class FixCMAP : public Fix { // perform bicubic interpolation at point of interest - void bc_interpol(double, double, int, int, double *, double *, double *, - double *); + void bc_interpol(double, double, int, int, double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/improper_cvff.cpp b/src/MOLECULE/improper_cvff.cpp index 3e4a26b708..91dac5b173 100644 --- a/src/MOLECULE/improper_cvff.cpp +++ b/src/MOLECULE/improper_cvff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/improper_cvff.h b/src/MOLECULE/improper_cvff.h index 8edbe5144d..821d29e607 100644 --- a/src/MOLECULE/improper_cvff.h +++ b/src/MOLECULE/improper_cvff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(cvff,ImproperCvff) - +// clang-format off +ImproperStyle(cvff,ImproperCvff); +// clang-format on #else #ifndef LMP_IMPROPER_CVFF_H @@ -36,12 +36,12 @@ class ImproperCvff : public Improper { protected: double *k; - int *sign,*multiplicity; + int *sign, *multiplicity; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/improper_harmonic.cpp b/src/MOLECULE/improper_harmonic.cpp index 82236fabb2..4b93d8653e 100644 --- a/src/MOLECULE/improper_harmonic.cpp +++ b/src/MOLECULE/improper_harmonic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/improper_harmonic.h b/src/MOLECULE/improper_harmonic.h index 86b8bf34f6..d81a81f951 100644 --- a/src/MOLECULE/improper_harmonic.h +++ b/src/MOLECULE/improper_harmonic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(harmonic,ImproperHarmonic) - +// clang-format off +ImproperStyle(harmonic,ImproperHarmonic); +// clang-format on #else #ifndef LMP_IMPROPER_HARMONIC_H @@ -35,12 +35,12 @@ class ImproperHarmonic : public Improper { void write_data(FILE *); protected: - double *k,*chi; + double *k, *chi; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/improper_umbrella.cpp b/src/MOLECULE/improper_umbrella.cpp index 343677740d..0cf2351cef 100644 --- a/src/MOLECULE/improper_umbrella.cpp +++ b/src/MOLECULE/improper_umbrella.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/improper_umbrella.h b/src/MOLECULE/improper_umbrella.h index 7a89fc5331..836527ee3c 100644 --- a/src/MOLECULE/improper_umbrella.h +++ b/src/MOLECULE/improper_umbrella.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(umbrella,ImproperUmbrella) - +// clang-format off +ImproperStyle(umbrella,ImproperUmbrella); +// clang-format on #else #ifndef LMP_IMPROPER_UMBRELLA_H @@ -40,7 +40,7 @@ class ImproperUmbrella : public Improper { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.cpp b/src/MOLECULE/pair_hbond_dreiding_lj.cpp index 9744c01e78..f2c24c6d26 100644 --- a/src/MOLECULE/pair_hbond_dreiding_lj.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_lj.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.h b/src/MOLECULE/pair_hbond_dreiding_lj.h index 5cd745e6ae..67b5262e32 100644 --- a/src/MOLECULE/pair_hbond_dreiding_lj.h +++ b/src/MOLECULE/pair_hbond_dreiding_lj.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(hbond/dreiding/lj,PairHbondDreidingLJ) - +// clang-format off +PairStyle(hbond/dreiding/lj,PairHbondDreidingLJ); +// clang-format on #else #ifndef LMP_PAIR_HBOND_DREIDING_LJ_H @@ -36,31 +36,31 @@ class PairHbondDreidingLJ : public Pair { virtual double single(int, int, int, int, double, double, double, double &); protected: - double cut_inner_global,cut_outer_global,cut_angle_global; + double cut_inner_global, cut_outer_global, cut_angle_global; int ap_global; struct Param { - double epsilon,sigma; - double lj1,lj2,lj3,lj4; - double d0,alpha,r0; + double epsilon, sigma; + double lj1, lj2, lj3, lj4; + double d0, alpha, r0; double morse1; double denom_vdw; - double cut_inner,cut_outer,cut_innersq,cut_outersq,cut_angle,offset; + double cut_inner, cut_outer, cut_innersq, cut_outersq, cut_angle, offset; int ap; }; - Param *params; // parameter set for an I-J-K interaction - int nparams; // number of parameters read + Param *params; // parameter set for an I-J-K interaction + int nparams; // number of parameters read int maxparam; - int *donor; // 1 if this type is ever a donor, else 0 - int *acceptor; // 1 if this type is ever an acceptor, else 0 - int ***type2param; // mapping from D,A,H to params, -1 if no map + int *donor; // 1 if this type is ever a donor, else 0 + int *acceptor; // 1 if this type is ever an acceptor, else 0 + int ***type2param; // mapping from D,A,H to params, -1 if no map void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.cpp b/src/MOLECULE/pair_hbond_dreiding_morse.cpp index 4c112e9f1e..cf83c6baa3 100644 --- a/src/MOLECULE/pair_hbond_dreiding_morse.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_morse.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.h b/src/MOLECULE/pair_hbond_dreiding_morse.h index dc4b9b8614..9c0fa8f198 100644 --- a/src/MOLECULE/pair_hbond_dreiding_morse.h +++ b/src/MOLECULE/pair_hbond_dreiding_morse.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(hbond/dreiding/morse,PairHbondDreidingMorse) - +// clang-format off +PairStyle(hbond/dreiding/morse,PairHbondDreidingMorse); +// clang-format on #else #ifndef LMP_PAIR_HBOND_DREIDING_MORSE_H @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class PairHbondDreidingMorse : public PairHbondDreidingLJ { public: PairHbondDreidingMorse(class LAMMPS *); - virtual ~PairHbondDreidingMorse() {}; + virtual ~PairHbondDreidingMorse(){}; virtual void compute(int, int); void coeff(int, char **); void init_style(); double single(int, int, int, int, double, double, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp index 86e8f45200..5df54a0911 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.h b/src/MOLECULE/pair_lj_charmm_coul_charmm.h index 9a1e3cb1ea..b6878dd60b 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm.h +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/charmm,PairLJCharmmCoulCharmm) - +// clang-format off +PairStyle(lj/charmm/coul/charmm,PairLJCharmmCoulCharmm); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_CHARMM_H @@ -44,17 +44,17 @@ class PairLJCharmmCoulCharmm : public Pair { protected: int implicit; - double cut_lj_inner,cut_lj,cut_coul_inner,cut_coul; - double cut_lj_innersq,cut_ljsq,cut_coul_innersq,cut_coulsq,cut_bothsq; - double denom_lj,denom_coul; - double **epsilon,**sigma,**eps14,**sigma14; - double **lj1,**lj2,**lj3,**lj4; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; + double cut_lj_inner, cut_lj, cut_coul_inner, cut_coul; + double cut_lj_innersq, cut_ljsq, cut_coul_innersq, cut_coulsq, cut_bothsq; + double denom_lj, denom_coul; + double **epsilon, **sigma, **eps14, **sigma14; + double **lj1, **lj2, **lj3, **lj4; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.cpp b/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.cpp index 088c88dcc3..4614c65fe7 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.cpp +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h b/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h index ead7792c4f..5c497187ad 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/charmm/implicit,PairLJCharmmCoulCharmmImplicit) - +// clang-format off +PairStyle(lj/charmm/coul/charmm/implicit,PairLJCharmmCoulCharmmImplicit); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_CHARMM_IMPLICIT_H @@ -31,7 +31,7 @@ class PairLJCharmmCoulCharmmImplicit : public PairLJCharmmCoulCharmm { double single(int, int, int, int, double, double, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp index 050aaaa5cb..1d9be47db2 100644 --- a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp +++ b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.h b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.h index 82dbd44e9e..fd517e584f 100644 --- a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.h +++ b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmmfsw/coul/charmmfsh,PairLJCharmmfswCoulCharmmfsh) - +// clang-format off +PairStyle(lj/charmmfsw/coul/charmmfsh,PairLJCharmmfswCoulCharmmfsh); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMMFSW_COUL_CHARMMFSH_H @@ -46,20 +46,20 @@ class PairLJCharmmfswCoulCharmmfsh : public Pair { int implicit; int dihedflag; - double cut_lj_inner,cut_lj,cut_coul,cut_coulinv,cut_ljinv,cut_lj_innerinv; - double cut_lj_innersq,cut_ljsq,cut_coulsq,cut_bothsq; - double cut_lj3inv,cut_lj_inner3inv,cut_lj3,cut_lj_inner3; - double cut_lj6inv,cut_lj_inner6inv,cut_lj6,cut_lj_inner6; - double denom_lj,denom_lj12,denom_lj6; + double cut_lj_inner, cut_lj, cut_coul, cut_coulinv, cut_ljinv, cut_lj_innerinv; + double cut_lj_innersq, cut_ljsq, cut_coulsq, cut_bothsq; + double cut_lj3inv, cut_lj_inner3inv, cut_lj3, cut_lj_inner3; + double cut_lj6inv, cut_lj_inner6inv, cut_lj6, cut_lj_inner6; + double denom_lj, denom_lj12, denom_lj6; - double **epsilon,**sigma,**eps14,**sigma14; - double **lj1,**lj2,**lj3,**lj4; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; + double **epsilon, **sigma, **eps14, **sigma14; + double **lj1, **lj2, **lj3, **lj4; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp index 2bca4857a1..dda09f62ce 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.h b/src/MOLECULE/pair_lj_cut_tip4p_cut.h index 4852275030..4e113649be 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.h +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/tip4p/cut,PairLJCutTIP4PCut) - +// clang-format off +PairStyle(lj/cut/tip4p/cut,PairLJCutTIP4PCut); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_TIP4P_CUT_H @@ -43,27 +43,27 @@ class PairLJCutTIP4PCut : public Pair { double memory_usage(); protected: - double cut_lj_global,cut_coul_global; - double cut_coul,cut_coulsq; - double cut_coulsqplus; // extended value for cut_coulsq - double **cut_lj,**cut_ljsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double cut_lj_global, cut_coul_global; + double cut_coul, cut_coulsq; + double cut_coulsqplus; // extended value for cut_coulsq + double **cut_lj, **cut_ljsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P double qdist; - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void allocate(); void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_tip4p_cut.cpp b/src/MOLECULE/pair_tip4p_cut.cpp index f208c17efd..e0eeaa6e58 100644 --- a/src/MOLECULE/pair_tip4p_cut.cpp +++ b/src/MOLECULE/pair_tip4p_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MOLECULE/pair_tip4p_cut.h b/src/MOLECULE/pair_tip4p_cut.h index d0ff796d39..8280a78ecf 100644 --- a/src/MOLECULE/pair_tip4p_cut.h +++ b/src/MOLECULE/pair_tip4p_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tip4p/cut,PairTIP4PCut) - +// clang-format off +PairStyle(tip4p/cut,PairTIP4PCut); +// clang-format on #else #ifndef LMP_PAIR_TIP4P_CUT_H @@ -41,23 +41,23 @@ class PairTIP4PCut : public Pair { protected: double cut_coul_global; - double cut_coul,cut_coulsq; - double cut_coulsqplus; // extended value for cut_coulsq + double cut_coul, cut_coulsq; + double cut_coulsqplus; // extended value for cut_coulsq - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P double qdist; - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void allocate(); void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MPIIO/dump_atom_mpiio.cpp b/src/MPIIO/dump_atom_mpiio.cpp index 2feaca6ecd..c5f8f8c165 100644 --- a/src/MPIIO/dump_atom_mpiio.cpp +++ b/src/MPIIO/dump_atom_mpiio.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -15,16 +15,17 @@ Contributing author: Paul Coffman (IBM) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "dump_atom_mpiio.h" -#include -#include #include "domain.h" -#include "update.h" -#include "memory.h" #include "error.h" +#include "memory.h" +#include "update.h" +#include +#include + +#include "omp_compat.h" #if defined(_OPENMP) #include #endif @@ -37,24 +38,23 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -DumpAtomMPIIO::DumpAtomMPIIO(LAMMPS *lmp, int narg, char **arg) : - DumpAtom(lmp, narg, arg) {} +DumpAtomMPIIO::DumpAtomMPIIO(LAMMPS *lmp, int narg, char **arg) : DumpAtom(lmp, narg, arg) {} /* ---------------------------------------------------------------------- */ DumpAtomMPIIO::~DumpAtomMPIIO() { - if (multifile == 0) MPI_File_close(&mpifh); + if (multifile == 0) MPI_File_close(&mpifh); } /* ---------------------------------------------------------------------- */ void DumpAtomMPIIO::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; + MPI_File_set_size(mpifh, mpifo + headerSize + sumFileSize); + currentFileSize = mpifo + headerSize + sumFileSize; return; } if (multifile == 0) singlefile_opened = 1; @@ -66,61 +66,56 @@ void DumpAtomMPIIO::openfile() if (multifile) { char *filestar = filecurrent; filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar,'*'); + 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); + 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 = '*'; if (maxfiles > 0) { if (numfiles < maxfiles) { - nameslist[numfiles] = new char[strlen(filecurrent)+1]; - strcpy(nameslist[numfiles],filecurrent); + nameslist[numfiles] = new char[strlen(filecurrent) + 1]; + strcpy(nameslist[numfiles], filecurrent); ++numfiles; } else { remove(nameslist[fileidx]); delete[] nameslist[fileidx]; - nameslist[fileidx] = new char[strlen(filecurrent)+1]; - strcpy(nameslist[fileidx],filecurrent); + nameslist[fileidx] = new char[strlen(filecurrent) + 1]; + strcpy(nameslist[fileidx], filecurrent); fileidx = (fileidx + 1) % maxfiles; } } } - 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); - } + 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) + error->one(FLERR, "Cannot open dump file {}: {}", filecurrent, utils::getsyserror()); + int myrank; - MPI_Comm_rank(world,&myrank); - if (myrank == 0) - MPI_File_get_size(mpifh,&mpifo); + MPI_Comm_rank(world, &myrank); + 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; + 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) + error->one(FLERR, "Cannot open dump file {}: {}", filecurrent, utils::getsyserror()); - 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); - } mpifo = 0; - MPI_File_set_size(mpifh,(MPI_Offset) (headerSize+sumFileSize)); - currentFileSize = (headerSize+sumFileSize); + MPI_File_set_size(mpifh, (MPI_Offset)(headerSize + sumFileSize)); + currentFileSize = (headerSize + sumFileSize); } } @@ -155,10 +150,10 @@ void DumpAtomMPIIO::write() // nmax = max # of dump lines on any proc bigint bnme = nme; - MPI_Allreduce(&bnme,&ntotal,1,MPI_LMP_BIGINT,MPI_SUM,world); + MPI_Allreduce(&bnme, &ntotal, 1, MPI_LMP_BIGINT, MPI_SUM, world); int nmax; - MPI_Allreduce(&nme,&nmax,1,MPI_INT,MPI_MAX,world); + MPI_Allreduce(&nme, &nmax, 1, MPI_INT, MPI_MAX, world); // write timestep header // for multiproc, @@ -174,64 +169,70 @@ void DumpAtomMPIIO::write() if (nmax > maxbuf) { if ((bigint) nmax * size_one > MAXSMALLINT) - error->all(FLERR,"Too much per-proc info for dump"); + error->all(FLERR, "Too much per-proc info for dump"); maxbuf = nmax; memory->destroy(buf); - memory->create(buf,(maxbuf*size_one),"dump:buf"); + memory->create(buf, (maxbuf * size_one), "dump:buf"); } if (sort_flag && sortcol == 0 && nmax > maxids) { maxids = nmax; memory->destroy(ids); - memory->create(ids,maxids,"dump:ids"); + memory->create(ids, maxids, "dump:ids"); } - if (sort_flag && sortcol == 0) pack(ids); - else pack(nullptr); + if (sort_flag && sortcol == 0) + pack(ids); + else + pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing performEstimate = 1; write_header(nheader); - write_data(nme,buf); - MPI_Bcast(&sumFileSize, 1, MPI_LMP_BIGINT, (nprocs-1), world); + write_data(nme, buf); + MPI_Bcast(&sumFileSize, 1, MPI_LMP_BIGINT, (nprocs - 1), world); openfile(); performEstimate = 0; - write_header(nheader); // mpifo now points to end of header info + write_header(nheader); // mpifo now points to end of header info // now actually write the data performEstimate = 0; - write_data(nme,buf); + write_data(nme, buf); - if (multifile) MPI_File_close(&mpifh); - if (multifile) delete [] filecurrent; + if (multifile) MPI_File_close(&mpifh); + if (multifile) delete[] filecurrent; } /* ---------------------------------------------------------------------- */ void DumpAtomMPIIO::init_style() { - if (image_flag == 0) size_one = 5; - else size_one = 8; + if (image_flag == 0) + size_one = 5; + else + size_one = 8; // format = copy of default or user-specified line format // default depends on image flags - delete [] format; + 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"); + strcpy(format, format_line_user); + strcat(format, "\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"; + 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"); + strcpy(format, str); + strcat(format, "\n"); } // setup boundary string @@ -273,10 +274,14 @@ void DumpAtomMPIIO::init_style() else if (scale_flag == 0 && image_flag == 1) pack_choice = &DumpAtomMPIIO::pack_noscale_image; - if (binary) write_choice = &DumpAtomMPIIO::write_binary; - else if (buffer_flag == 1) write_choice = &DumpAtomMPIIO::write_string; - else if (image_flag == 0) write_choice = &DumpAtomMPIIO::write_lines_noimage; - else if (image_flag == 1) write_choice = &DumpAtomMPIIO::write_lines_image; + if (binary) + write_choice = &DumpAtomMPIIO::write_binary; + else if (buffer_flag == 1) + write_choice = &DumpAtomMPIIO::write_string; + else if (image_flag == 0) + write_choice = &DumpAtomMPIIO::write_lines_noimage; + else if (image_flag == 1) + write_choice = &DumpAtomMPIIO::write_lines_image; } /* ---------------------------------------------------------------------- */ @@ -292,48 +297,47 @@ void DumpAtomMPIIO::header_binary(bigint ndump) { if (performEstimate) { - headerBuffer = (char *) malloc((2*sizeof(bigint)) + (9*sizeof(int)) + (6*sizeof(double))); + headerBuffer = (char *) malloc((2 * sizeof(bigint)) + (9 * sizeof(int)) + (6 * sizeof(double))); headerSize = 0; - memcpy(&((char*)headerBuffer)[headerSize],&update->ntimestep,sizeof(bigint)); + memcpy(headerBuffer + headerSize, &update->ntimestep, sizeof(bigint)); headerSize += sizeof(bigint); - memcpy(&((char*)headerBuffer)[headerSize],&ndump,sizeof(bigint)); + memcpy(headerBuffer + headerSize, &ndump, sizeof(bigint)); headerSize += sizeof(bigint); - memcpy(&((char*)headerBuffer)[headerSize],&domain->triclinic,sizeof(int)); + memcpy(headerBuffer + headerSize, &domain->triclinic, sizeof(int)); headerSize += sizeof(int); - memcpy(&((char*)headerBuffer)[headerSize],&domain->boundary[0][0],6*sizeof(int)); - headerSize += 6*sizeof(int); + memcpy(headerBuffer + headerSize, &domain->boundary[0][0], 6 * sizeof(int)); + headerSize += 6 * sizeof(int); - memcpy(&((char*)headerBuffer)[headerSize],&boxxlo,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxxlo, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxxhi,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxxhi, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxylo,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxylo, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxyhi,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxyhi, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxzlo,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxzlo, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxzhi,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxzhi, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&size_one,sizeof(int)); + memcpy(headerBuffer + headerSize, &size_one, sizeof(int)); headerSize += sizeof(int); - memcpy(&((char*)headerBuffer)[headerSize],&nprocs,sizeof(int)); + memcpy(headerBuffer + headerSize, &nprocs, sizeof(int)); headerSize += sizeof(int); - } - else { // write data + } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,headerBuffer,headerSize,MPI_BYTE,MPI_STATUS_IGNORE); + MPI_File_write_at(mpifh, mpifo, headerBuffer, headerSize, MPI_BYTE, MPI_STATUS_IGNORE); mpifo += headerSize; free(headerBuffer); } @@ -345,59 +349,58 @@ void DumpAtomMPIIO::header_binary_triclinic(bigint ndump) { if (performEstimate) { - headerBuffer = (char *) malloc((2*sizeof(bigint)) + (9*sizeof(int)) + (6*sizeof(double))); + headerBuffer = (char *) malloc((2 * sizeof(bigint)) + (9 * sizeof(int)) + (9 * sizeof(double))); headerSize = 0; - memcpy(&((char*)headerBuffer)[headerSize],&update->ntimestep,sizeof(bigint)); + memcpy(headerBuffer + headerSize, &update->ntimestep, sizeof(bigint)); headerSize += sizeof(bigint); - memcpy(&((char*)headerBuffer)[headerSize],&ndump,sizeof(bigint)); + memcpy(headerBuffer + headerSize, &ndump, sizeof(bigint)); headerSize += sizeof(bigint); - memcpy(&((char*)headerBuffer)[headerSize],&domain->triclinic,sizeof(int)); + memcpy(headerBuffer + headerSize, &domain->triclinic, sizeof(int)); headerSize += sizeof(int); - memcpy(&((char*)headerBuffer)[headerSize],&domain->boundary[0][0],6*sizeof(int)); - headerSize += 6*sizeof(int); + memcpy(headerBuffer + headerSize, &domain->boundary[0][0], 6 * sizeof(int)); + headerSize += 6 * sizeof(int); - memcpy(&((char*)headerBuffer)[headerSize],&boxxlo,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxxlo, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxxhi,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxxhi, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxylo,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxylo, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxyhi,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxyhi, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxzlo,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxzlo, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxzhi,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxzhi, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxxy,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxxy, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxxz,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxxz, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxyz,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxyz, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&size_one,sizeof(int)); + memcpy(headerBuffer + headerSize, &size_one, sizeof(int)); headerSize += sizeof(int); - memcpy(&((char*)headerBuffer)[headerSize],&nprocs,sizeof(int)); + memcpy(headerBuffer + headerSize, &nprocs, sizeof(int)); headerSize += sizeof(int); - } - else { // write data + } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,headerBuffer,headerSize,MPI_BYTE,MPI_STATUS_IGNORE); + MPI_File_write_at(mpifh, mpifo, headerBuffer, headerSize, MPI_BYTE, MPI_STATUS_IGNORE); mpifo += headerSize; free(headerBuffer); } @@ -409,25 +412,21 @@ void DumpAtomMPIIO::header_item(bigint ndump) { if (performEstimate) { - headerBuffer = (char *) malloc(MAX_TEXT_HEADER_SIZE); + auto itemtxt = fmt::format("ITEM: TIMESTEP\n{}\n", update->ntimestep); + itemtxt += fmt::format("ITEM: NUMBER OF ATOMS\n{}\n", ndump); + itemtxt += fmt::format("ITEM: BOX BOUNDS {}\n", boundstr); + itemtxt += fmt::format("{} {}\n{} {}\n{} {}\n", boxxlo, boxxhi, boxylo, boxyhi, boxzlo, boxzhi); + itemtxt += fmt::format("ITEM: ATOMS {}\n", columns); - headerSize = 0; - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"ITEM: TIMESTEP\n"); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],BIGINT_FORMAT "\n",update->ntimestep); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: NUMBER OF ATOMS\n"); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],BIGINT_FORMAT "\n",ndump); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: BOX BOUNDS %s\n",boundstr); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"%g %g\n",boxxlo,boxxhi); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"%g %g\n",boxylo,boxyhi); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"%g %g\n",boxzlo,boxzhi); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: ATOMS %s\n",columns); - } - else { // write data + headerSize = itemtxt.size(); + headerBuffer = utils::strdup(itemtxt); + + } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,headerBuffer,headerSize,MPI_CHAR,MPI_STATUS_IGNORE); + MPI_File_write_at(mpifh, mpifo, headerBuffer, headerSize, MPI_CHAR, MPI_STATUS_IGNORE); mpifo += headerSize; - free(headerBuffer); + delete[] headerBuffer; } } @@ -437,25 +436,22 @@ void DumpAtomMPIIO::header_item_triclinic(bigint ndump) { if (performEstimate) { - headerBuffer = (char *) malloc(MAX_TEXT_HEADER_SIZE); + auto itemtxt = fmt::format("ITEM: TIMESTEP\n{}\n", update->ntimestep); + itemtxt += fmt::format("ITEM: NUMBER OF ATOMS\n{}\n", ndump); + itemtxt += fmt::format("ITEM: BOX BOUNDS xy xz yz {}\n", boundstr); + itemtxt += fmt::format("{} {} {}\n{} {} {}\n{} {} {}\n", boxxlo, boxxhi, boxxy, boxylo, boxyhi, + boxxz, boxzlo, boxzhi, boxyz); + itemtxt += fmt::format("ITEM: ATOMS {}\n", columns); - headerSize = 0; - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: TIMESTEP\n"); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],BIGINT_FORMAT "\n",update->ntimestep); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: NUMBER OF ATOMS\n"); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],BIGINT_FORMAT "\n",ndump); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"%g %g %g\n",boxxlo,boxxhi,boxxy); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"%g %g %g\n",boxylo,boxyhi,boxxz); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"%g %g %g\n",boxzlo,boxzhi,boxyz); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: ATOMS %s\n",columns); - } - else { // write data + headerSize = itemtxt.size(); + headerBuffer = utils::strdup(itemtxt); + + } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,headerBuffer,headerSize,MPI_CHAR,MPI_STATUS_IGNORE); + MPI_File_write_at(mpifh, mpifo, headerBuffer, headerSize, MPI_CHAR, MPI_STATUS_IGNORE); mpifo += headerSize; - free(headerBuffer); + delete[] headerBuffer; } } @@ -463,8 +459,7 @@ void DumpAtomMPIIO::header_item_triclinic(bigint ndump) void DumpAtomMPIIO::write_data(int n, double *mybuf) { - - (this->*write_choice)(n,mybuf); + (this->*write_choice)(n, mybuf); } /* ---------------------------------------------------------------------- */ @@ -477,22 +472,21 @@ void DumpAtomMPIIO::write_binary(int n, double *mybuf) bigint incPrefix = 0; bigint bigintNme = (bigint) nme; - MPI_Scan(&bigintNme,&incPrefix,1,MPI_LMP_BIGINT,MPI_SUM,world); - sumFileSize = (incPrefix*size_one*sizeof(double)) + (nprocs * sizeof(int)); - offsetFromHeader = ((incPrefix-bigintNme)*size_one*sizeof(double)) + (me * sizeof(int)); - } - else { - int byteBufSize = (n*sizeof(double)) + sizeof(int); + MPI_Scan(&bigintNme, &incPrefix, 1, MPI_LMP_BIGINT, MPI_SUM, world); + sumFileSize = (incPrefix * size_one * sizeof(double)) + (nprocs * sizeof(int)); + offsetFromHeader = ((incPrefix - bigintNme) * size_one * sizeof(double)) + (me * sizeof(int)); + } else { + int byteBufSize = (n * sizeof(double)) + sizeof(int); char *bufWithSize; - memory->create(bufWithSize,byteBufSize,"dump:bufWithSize"); - memcpy(bufWithSize,(char*)(&n),sizeof(int)); - memcpy(&((char*)bufWithSize)[sizeof(int)],mybuf,(n*sizeof(double))); - MPI_File_write_at_all(mpifh,mpifo+offsetFromHeader,bufWithSize,byteBufSize,MPI_BYTE,MPI_STATUS_IGNORE); + memory->create(bufWithSize, byteBufSize, "dump:bufWithSize"); + memcpy(bufWithSize, (char *) (&n), sizeof(int)); + memcpy(&((char *) bufWithSize)[sizeof(int)], mybuf, (n * sizeof(double))); + MPI_File_write_at_all(mpifh, mpifo + offsetFromHeader, bufWithSize, byteBufSize, MPI_BYTE, + MPI_STATUS_IGNORE); memory->destroy(bufWithSize); - if (flush_flag) - MPI_File_sync(mpifh); + if (flush_flag) MPI_File_sync(mpifh); } } @@ -505,23 +499,21 @@ void DumpAtomMPIIO::write_string(int n, double *mybuf) #if defined(_OPENMP) int nthreads = omp_get_max_threads(); if (nthreads > 1) - nsme = convert_string_omp(n,mybuf); + nsme = convert_string_omp(n, mybuf); else { - nsme = convert_string(n,mybuf); + nsme = convert_string(n, mybuf); } #else - nsme = convert_string(n,mybuf); + nsme = convert_string(n, mybuf); #endif bigint incPrefix = 0; bigint bigintNsme = (bigint) nsme; - MPI_Scan(&bigintNsme,&incPrefix,1,MPI_LMP_BIGINT,MPI_SUM,world); - sumFileSize = (incPrefix*sizeof(char)); - offsetFromHeader = ((incPrefix-bigintNsme)*sizeof(char)); - } - else { - MPI_File_write_at_all(mpifh,mpifo+offsetFromHeader,sbuf,nsme,MPI_CHAR,MPI_STATUS_IGNORE); - if (flush_flag) - MPI_File_sync(mpifh); + MPI_Scan(&bigintNsme, &incPrefix, 1, MPI_LMP_BIGINT, MPI_SUM, world); + sumFileSize = (incPrefix * sizeof(char)); + offsetFromHeader = ((incPrefix - bigintNsme) * sizeof(char)); + } else { + MPI_File_write_at_all(mpifh, mpifo + offsetFromHeader, sbuf, nsme, MPI_CHAR, MPI_STATUS_IGNORE); + if (flush_flag) MPI_File_sync(mpifh); } } @@ -530,9 +522,9 @@ void DumpAtomMPIIO::write_string(int n, double *mybuf) int DumpAtomMPIIO::convert_string(int n, double *mybuf) { if (image_flag == 0) - return convert_noimage(n,mybuf); + return convert_noimage(n, mybuf); else - return convert_image(n,mybuf); + return convert_image(n, mybuf); } /* ---------------------------------------------------------------------- */ @@ -542,9 +534,9 @@ int DumpAtomMPIIO::convert_string(int n, double *mybuf) int DumpAtomMPIIO::convert_string_omp(int n, double *mybuf) { if (image_flag == 0) - return convert_noimage_omp(n,mybuf); + return convert_noimage_omp(n, mybuf); else - return convert_image_omp(n,mybuf); + return convert_image_omp(n, mybuf); } /* ---------------------------------------------------------------------- @@ -561,55 +553,63 @@ int DumpAtomMPIIO::convert_image_omp(int n, double *mybuf) mpifhStringCount = 0; int nthreads = omp_get_max_threads(); - if (nthreads > n) { // call serial version - convert_string(n,mybuf); + if (nthreads > n) { // call serial version + convert_string(n, mybuf); - } - else { - memory->create(mpifhStringCountPerThread,nthreads,"dump:mpifhStringCountPerThread"); - mpifh_buffer_line_per_thread = (char **) malloc(nthreads*sizeof(char*)); - memory->create(bufOffset,nthreads,"dump:bufOffset"); - memory->create(bufRange,nthreads,"dump:bufRange"); - memory->create(bufLength,nthreads,"dump:bufLength"); + } else { + memory->create(mpifhStringCountPerThread, nthreads, "dump:mpifhStringCountPerThread"); + mpifh_buffer_line_per_thread = (char **) malloc(nthreads * sizeof(char *)); + memory->create(bufOffset, nthreads, "dump:bufOffset"); + memory->create(bufRange, nthreads, "dump:bufRange"); + memory->create(bufLength, nthreads, "dump:bufLength"); - int i=0; - for (i=0;i<(nthreads-1);i++) { + int i = 0; + for (i = 0; i < (nthreads - 1); i++) { mpifhStringCountPerThread[i] = 0; - bufOffset[i] = (int) (i*(int)(floor((double)n/(double)nthreads))*size_one); - bufRange[i] = (int)(floor((double)n/(double)nthreads)); + bufOffset[i] = (int) (i * (int) (floor((double) n / (double) nthreads)) * size_one); + bufRange[i] = (int) (floor((double) n / (double) nthreads)); bufLength[i] = DUMP_BUF_CHUNK_SIZE; mpifh_buffer_line_per_thread[i] = (char *) malloc(DUMP_BUF_CHUNK_SIZE * sizeof(char)); mpifh_buffer_line_per_thread[i][0] = '\0'; } mpifhStringCountPerThread[i] = 0; - bufOffset[i] = (int) (i*(int)(floor((double)n/(double)nthreads))*size_one); - bufRange[i] = n-(i*(int)(floor((double)n/(double)nthreads))); + bufOffset[i] = (int) (i * (int) (floor((double) n / (double) nthreads)) * size_one); + bufRange[i] = n - (i * (int) (floor((double) n / (double) nthreads))); bufLength[i] = DUMP_BUF_CHUNK_SIZE; mpifh_buffer_line_per_thread[i] = (char *) malloc(DUMP_BUF_CHUNK_SIZE * sizeof(char)); mpifh_buffer_line_per_thread[i][0] = '\0'; -#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(bufOffset, bufRange, bufLength, mpifhStringCountPerThread, mpifh_buffer_line_per_thread, mybuf) +#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(bufOffset, bufRange, bufLength, \ + mpifhStringCountPerThread, \ + mpifh_buffer_line_per_thread, mybuf) { int tid = omp_get_thread_num(); - int m=0; + int m = 0; for (int i = 0; i < bufRange[tid]; i++) { if ((bufLength[tid] - mpifhStringCountPerThread[tid]) < DUMP_BUF_INCREMENT_SIZE) { - mpifh_buffer_line_per_thread[tid] = (char *) realloc(mpifh_buffer_line_per_thread[tid],(mpifhStringCountPerThread[tid]+DUMP_BUF_CHUNK_SIZE) * sizeof(char)); - bufLength[tid] = (mpifhStringCountPerThread[tid]+DUMP_BUF_CHUNK_SIZE) * sizeof(char); + mpifh_buffer_line_per_thread[tid] = (char *) realloc( + mpifh_buffer_line_per_thread[tid], + (mpifhStringCountPerThread[tid] + DUMP_BUF_CHUNK_SIZE) * sizeof(char)); + bufLength[tid] = (mpifhStringCountPerThread[tid] + DUMP_BUF_CHUNK_SIZE) * sizeof(char); } - mpifhStringCountPerThread[tid] += sprintf(&(mpifh_buffer_line_per_thread[tid][mpifhStringCountPerThread[tid]]),format,static_cast (mybuf[bufOffset[tid]+m]),static_cast (mybuf[bufOffset[tid]+m+1]),mybuf[bufOffset[tid]+m+2],mybuf[bufOffset[tid]+m+3],mybuf[bufOffset[tid]+m+4],static_cast (mybuf[bufOffset[tid]+m+5]),static_cast (mybuf[bufOffset[tid]+m+6]),static_cast (mybuf[bufOffset[tid]+m+7])); + mpifhStringCountPerThread[tid] += + sprintf(&(mpifh_buffer_line_per_thread[tid][mpifhStringCountPerThread[tid]]), format, + static_cast(mybuf[bufOffset[tid] + m]), + static_cast(mybuf[bufOffset[tid] + m + 1]), mybuf[bufOffset[tid] + m + 2], + mybuf[bufOffset[tid] + m + 3], mybuf[bufOffset[tid] + m + 4], + static_cast(mybuf[bufOffset[tid] + m + 5]), + static_cast(mybuf[bufOffset[tid] + m + 6]), + static_cast(mybuf[bufOffset[tid] + m + 7])); m += size_one; } } #pragma omp barrier mpifhStringCount = 0; - for (i=0;idestroy(bufOffset); memory->destroy(bufRange); @@ -618,21 +618,19 @@ int DumpAtomMPIIO::convert_image_omp(int n, double *mybuf) if (mpifhStringCount > 0) { if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > MAXSMALLINT) return -1; - maxsbuf = mpifhStringCount+1; - memory->grow(sbuf,maxsbuf,"dump:sbuf"); + maxsbuf = mpifhStringCount + 1; + memory->grow(sbuf, maxsbuf, "dump:sbuf"); } sbuf[0] = '\0'; } - - for (int i=0;idestroy(mpifhStringCountPerThread); free(mpifh_buffer_line_per_thread); - } return mpifhStringCount; } @@ -651,55 +649,60 @@ int DumpAtomMPIIO::convert_noimage_omp(int n, double *mybuf) mpifhStringCount = 0; int nthreads = omp_get_max_threads(); - if (nthreads > n) { // call serial version - convert_string(n,mybuf); + if (nthreads > n) { // call serial version + convert_string(n, mybuf); - } - else { - memory->create(mpifhStringCountPerThread,nthreads,"dump:mpifhStringCountPerThread"); - mpifh_buffer_line_per_thread = (char **) malloc(nthreads*sizeof(char*)); - memory->create(bufOffset,nthreads,"dump:bufOffset"); - memory->create(bufRange,nthreads,"dump:bufRange"); - memory->create(bufLength,nthreads,"dump:bufLength"); + } else { + memory->create(mpifhStringCountPerThread, nthreads, "dump:mpifhStringCountPerThread"); + mpifh_buffer_line_per_thread = (char **) malloc(nthreads * sizeof(char *)); + memory->create(bufOffset, nthreads, "dump:bufOffset"); + memory->create(bufRange, nthreads, "dump:bufRange"); + memory->create(bufLength, nthreads, "dump:bufLength"); - int i=0; - for (i=0;i<(nthreads-1);i++) { + int i = 0; + for (i = 0; i < (nthreads - 1); i++) { mpifhStringCountPerThread[i] = 0; - bufOffset[i] = (int) (i*(int)(floor((double)n/(double)nthreads))*size_one); - bufRange[i] = (int)(floor((double)n/(double)nthreads)); + bufOffset[i] = (int) (i * (int) (floor((double) n / (double) nthreads)) * size_one); + bufRange[i] = (int) (floor((double) n / (double) nthreads)); bufLength[i] = DUMP_BUF_CHUNK_SIZE; mpifh_buffer_line_per_thread[i] = (char *) malloc(DUMP_BUF_CHUNK_SIZE * sizeof(char)); mpifh_buffer_line_per_thread[i][0] = '\0'; } mpifhStringCountPerThread[i] = 0; - bufOffset[i] = (int) (i*(int)(floor((double)n/(double)nthreads))*size_one); - bufRange[i] = n-(i*(int)(floor((double)n/(double)nthreads))); + bufOffset[i] = (int) (i * (int) (floor((double) n / (double) nthreads)) * size_one); + bufRange[i] = n - (i * (int) (floor((double) n / (double) nthreads))); bufLength[i] = DUMP_BUF_CHUNK_SIZE; mpifh_buffer_line_per_thread[i] = (char *) malloc(DUMP_BUF_CHUNK_SIZE * sizeof(char)); mpifh_buffer_line_per_thread[i][0] = '\0'; -#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(bufOffset, bufRange, bufLength, mpifhStringCountPerThread, mpifh_buffer_line_per_thread, mybuf) +#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(bufOffset, bufRange, bufLength, \ + mpifhStringCountPerThread, \ + mpifh_buffer_line_per_thread, mybuf) { int tid = omp_get_thread_num(); - int m=0; + int m = 0; for (int i = 0; i < bufRange[tid]; i++) { if ((bufLength[tid] - mpifhStringCountPerThread[tid]) < DUMP_BUF_INCREMENT_SIZE) { - mpifh_buffer_line_per_thread[tid] = (char *) realloc(mpifh_buffer_line_per_thread[tid],(mpifhStringCountPerThread[tid]+DUMP_BUF_CHUNK_SIZE) * sizeof(char)); - bufLength[tid] = (mpifhStringCountPerThread[tid]+DUMP_BUF_CHUNK_SIZE) * sizeof(char); + mpifh_buffer_line_per_thread[tid] = (char *) realloc( + mpifh_buffer_line_per_thread[tid], + (mpifhStringCountPerThread[tid] + DUMP_BUF_CHUNK_SIZE) * sizeof(char)); + bufLength[tid] = (mpifhStringCountPerThread[tid] + DUMP_BUF_CHUNK_SIZE) * sizeof(char); } - mpifhStringCountPerThread[tid] += sprintf(&(mpifh_buffer_line_per_thread[tid][mpifhStringCountPerThread[tid]]),format,static_cast (mybuf[bufOffset[tid]+m]),static_cast (mybuf[bufOffset[tid]+m+1]),mybuf[bufOffset[tid]+m+2],mybuf[bufOffset[tid]+m+3],mybuf[bufOffset[tid]+m+4]); + mpifhStringCountPerThread[tid] += + sprintf(&(mpifh_buffer_line_per_thread[tid][mpifhStringCountPerThread[tid]]), format, + static_cast(mybuf[bufOffset[tid] + m]), + static_cast(mybuf[bufOffset[tid] + m + 1]), mybuf[bufOffset[tid] + m + 2], + mybuf[bufOffset[tid] + m + 3], mybuf[bufOffset[tid] + m + 4]); m += size_one; } } #pragma omp barrier mpifhStringCount = 0; - for (i=0;idestroy(bufOffset); memory->destroy(bufRange); @@ -708,21 +711,19 @@ int DumpAtomMPIIO::convert_noimage_omp(int n, double *mybuf) if (mpifhStringCount > 0) { if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > MAXSMALLINT) return -1; - maxsbuf = mpifhStringCount+1; - memory->grow(sbuf,maxsbuf,"dump:sbuf"); + maxsbuf = mpifhStringCount + 1; + memory->grow(sbuf, maxsbuf, "dump:sbuf"); } sbuf[0] = '\0'; } - - for (int i=0;idestroy(mpifhStringCountPerThread); free(mpifh_buffer_line_per_thread); - } return mpifhStringCount; diff --git a/src/MPIIO/dump_atom_mpiio.h b/src/MPIIO/dump_atom_mpiio.h index 3486f20f53..b2c186df3c 100644 --- a/src/MPIIO/dump_atom_mpiio.h +++ b/src/MPIIO/dump_atom_mpiio.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(atom/mpiio,DumpAtomMPIIO) - +// clang-format off +DumpStyle(atom/mpiio,DumpAtomMPIIO); +// clang-format on #else #ifndef LMP_DUMP_ATOM_MPIIO_H @@ -31,14 +31,14 @@ class DumpAtomMPIIO : public DumpAtom { virtual ~DumpAtomMPIIO(); protected: - - bigint sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data - char *headerBuffer; // buffer for holding header data + bigint + sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data + char *headerBuffer; // buffer for holding header data MPI_File mpifh; - MPI_Offset mpifo,offsetFromHeader,headerSize, currentFileSize; - int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data - char *filecurrent; // name of file for this round (with % and * replaced) + MPI_Offset mpifo, offsetFromHeader, headerSize, currentFileSize; + int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data + char *filecurrent; // name of file for this round (with % and * replaced) virtual void openfile(); virtual void write_header(bigint); @@ -47,28 +47,26 @@ class DumpAtomMPIIO : public DumpAtom { virtual void init_style(); typedef void (DumpAtomMPIIO::*FnPtrHeader)(bigint); - FnPtrHeader header_choice; // ptr to write header functions + FnPtrHeader header_choice; // ptr to write header functions void header_binary(bigint); void header_binary_triclinic(bigint); void header_item(bigint); void header_item_triclinic(bigint); #if defined(_OPENMP) - int convert_string_omp(int, double *); // multithreaded version of convert_string - int convert_image_omp(int, double *); // multithreaded version of convert_image - int convert_noimage_omp(int, double *); // multithreaded version of convert_noimage + int convert_string_omp(int, double *); // multithreaded version of convert_string + int convert_image_omp(int, double *); // multithreaded version of convert_image + int convert_noimage_omp(int, double *); // multithreaded version of convert_noimage #endif int convert_string(int, double *); typedef void (DumpAtomMPIIO::*FnPtrData)(int, double *); - FnPtrData write_choice; // ptr to write data functions + FnPtrData write_choice; // ptr to write data functions void write_binary(int, double *); void write_string(int, double *); - - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MPIIO/dump_cfg_mpiio.cpp b/src/MPIIO/dump_cfg_mpiio.cpp index 07fb86d31c..cd0f1bfaaf 100644 --- a/src/MPIIO/dump_cfg_mpiio.cpp +++ b/src/MPIIO/dump_cfg_mpiio.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MPIIO/dump_cfg_mpiio.h b/src/MPIIO/dump_cfg_mpiio.h index d0855f55fb..492f7c1adb 100644 --- a/src/MPIIO/dump_cfg_mpiio.h +++ b/src/MPIIO/dump_cfg_mpiio.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(cfg/mpiio,DumpCFGMPIIO) - +// clang-format off +DumpStyle(cfg/mpiio,DumpCFGMPIIO); +// clang-format on #else #ifndef LMP_DUMP_CFG_MPIIO_H @@ -30,16 +30,17 @@ class DumpCFGMPIIO : public DumpCFG { virtual ~DumpCFGMPIIO(); protected: - bigint sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data - char *headerBuffer; // buffer for holding header data + bigint + sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data + char *headerBuffer; // buffer for holding header data MPI_File mpifh; - MPI_Offset mpifo,offsetFromHeader,headerSize, currentFileSize; - int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data - char *filecurrent; // name of file for this round (with % and * replaced) + MPI_Offset mpifo, offsetFromHeader, headerSize, currentFileSize; + int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data + char *filecurrent; // name of file for this round (with % and * replaced) #if defined(_OPENMP) - int convert_string_omp(int, double *); // multithreaded version of convert_string + int convert_string_omp(int, double *); // multithreaded version of convert_string #endif virtual void openfile(); @@ -49,11 +50,11 @@ class DumpCFGMPIIO : public DumpCFG { virtual void write_data(int, double *); typedef void (DumpCFGMPIIO::*FnPtrData)(int, double *); - FnPtrData write_choice; // ptr to write data functions + FnPtrData write_choice; // ptr to write data functions void write_string(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MPIIO/dump_custom_mpiio.cpp b/src/MPIIO/dump_custom_mpiio.cpp index 34cbe8ff28..e17d54e76a 100644 --- a/src/MPIIO/dump_custom_mpiio.cpp +++ b/src/MPIIO/dump_custom_mpiio.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -15,20 +15,21 @@ Contributing author: Paul Coffman (IBM) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "dump_custom_mpiio.h" -#include -#include #include "domain.h" -#include "input.h" -#include "variable.h" -#include "update.h" -#include "modify.h" -#include "fix.h" -#include "memory.h" #include "error.h" +#include "fix.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" +#include +#include + +#include "omp_compat.h" #if defined(_OPENMP) #include #endif @@ -39,21 +40,20 @@ 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}; - +// 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) : - DumpCustom(lmp, narg, arg) {} +DumpCustomMPIIO::DumpCustomMPIIO(LAMMPS *lmp, int narg, char **arg) : DumpCustom(lmp, narg, arg) {} /* ---------------------------------------------------------------------- */ @@ -66,10 +66,10 @@ 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; + MPI_File_set_size(mpifh, mpifo + headerSize + sumFileSize); + currentFileSize = mpifo + headerSize + sumFileSize; return; } if (multifile == 0) singlefile_opened = 1; @@ -81,62 +81,56 @@ void DumpCustomMPIIO::openfile() if (multifile) { char *filestar = filecurrent; filecurrent = new char[strlen(filestar) + 16]; - char *ptr = strchr(filestar,'*'); + 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); + 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 = '*'; if (maxfiles > 0) { if (numfiles < maxfiles) { - nameslist[numfiles] = new char[strlen(filecurrent)+1]; - strcpy(nameslist[numfiles],filecurrent); + nameslist[numfiles] = new char[strlen(filecurrent) + 1]; + strcpy(nameslist[numfiles], filecurrent); ++numfiles; } else { remove(nameslist[fileidx]); delete[] nameslist[fileidx]; - nameslist[fileidx] = new char[strlen(filecurrent)+1]; - strcpy(nameslist[fileidx],filecurrent); + nameslist[fileidx] = new char[strlen(filecurrent) + 1]; + strcpy(nameslist[fileidx], filecurrent); fileidx = (fileidx + 1) % maxfiles; } } } - 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); - } + 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) + error->one(FLERR, "Cannot open dump file {}: {}", filecurrent, utils::getsyserror()); + int myrank; - MPI_Comm_rank(world,&myrank); - if (myrank == 0) - MPI_File_get_size(mpifh,&mpifo); + MPI_Comm_rank(world, &myrank); + 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; + 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) + error->one(FLERR, "Cannot open dump file {}: {}", filecurrent, utils::getsyserror()); - 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); - } mpifo = 0; - MPI_File_set_size(mpifh,(MPI_Offset) (headerSize+sumFileSize)); - currentFileSize = (headerSize+sumFileSize); - + MPI_File_set_size(mpifh, (MPI_Offset)(headerSize + sumFileSize)); + currentFileSize = (headerSize + sumFileSize); } } @@ -171,10 +165,10 @@ void DumpCustomMPIIO::write() // nmax = max # of dump lines on any proc bigint bnme = nme; - MPI_Allreduce(&bnme,&ntotal,1,MPI_LMP_BIGINT,MPI_SUM,world); + MPI_Allreduce(&bnme, &ntotal, 1, MPI_LMP_BIGINT, MPI_SUM, world); int nmax; - MPI_Allreduce(&nme,&nmax,1,MPI_INT,MPI_MAX,world); + MPI_Allreduce(&nme, &nmax, 1, MPI_INT, MPI_MAX, world); // write timestep header // for multiproc, @@ -190,38 +184,40 @@ void DumpCustomMPIIO::write() if (nmax > maxbuf) { if ((bigint) nmax * size_one > MAXSMALLINT) - error->all(FLERR,"Too much per-proc info for dump"); + error->all(FLERR, "Too much per-proc info for dump"); maxbuf = nmax; memory->destroy(buf); - memory->create(buf,(maxbuf*size_one),"dump:buf"); + memory->create(buf, (maxbuf * size_one), "dump:buf"); } if (sort_flag && sortcol == 0 && nmax > maxids) { maxids = nmax; memory->destroy(ids); - memory->create(ids,maxids,"dump:ids"); + memory->create(ids, maxids, "dump:ids"); } - if (sort_flag && sortcol == 0) pack(ids); - else pack(nullptr); + if (sort_flag && sortcol == 0) + pack(ids); + else + pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing performEstimate = 1; write_header(nheader); - write_data(nme,buf); - MPI_Bcast(&sumFileSize, 1, MPI_LMP_BIGINT, (nprocs-1), world); + write_data(nme, buf); + MPI_Bcast(&sumFileSize, 1, MPI_LMP_BIGINT, (nprocs - 1), world); openfile(); performEstimate = 0; - write_header(nheader); // mpifo now points to end of header info + write_header(nheader); // mpifo now points to end of header info // now actually write the data performEstimate = 0; - write_data(nme,buf); + write_data(nme, buf); - if (multifile) MPI_File_close(&mpifh); - if (multifile) delete [] filecurrent; + if (multifile) MPI_File_close(&mpifh); + if (multifile) delete[] filecurrent; } /* ---------------------------------------------------------------------- */ @@ -230,14 +226,16 @@ void DumpCustomMPIIO::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; + if (format_line_user) + str = format_line_user; + else + str = format_default; int n = strlen(str) + 1; format = new char[n]; - strcpy(format,str); + strcpy(format, str); // tokenize the format string and add space at end of each format element // if user-specified int/float format exists, use it instead @@ -246,29 +244,31 @@ void DumpCustomMPIIO::init_style() char *ptr; for (int i = 0; i < size_one; i++) { - if (i == 0) ptr = strtok(format," \0"); - else ptr = strtok(nullptr," \0"); - if (ptr == nullptr) error->all(FLERR,"Dump_modify format line is too short"); - delete [] vformat[i]; + if (i == 0) + ptr = strtok(format, " \0"); + else + ptr = strtok(nullptr, " \0"); + if (ptr == nullptr) error->all(FLERR, "Dump_modify format line is too short"); + delete[] vformat[i]; if (format_column_user[i]) { vformat[i] = new char[strlen(format_column_user[i]) + 2]; - strcpy(vformat[i],format_column_user[i]); + strcpy(vformat[i], format_column_user[i]); } else if (vtype[i] == Dump::INT && format_int_user) { vformat[i] = new char[strlen(format_int_user) + 2]; - strcpy(vformat[i],format_int_user); + strcpy(vformat[i], format_int_user); } else if (vtype[i] == Dump::DOUBLE && format_float_user) { vformat[i] = new char[strlen(format_float_user) + 2]; - strcpy(vformat[i],format_float_user); + strcpy(vformat[i], format_float_user); } else if (vtype[i] == Dump::BIGINT && format_bigint_user) { vformat[i] = new char[strlen(format_bigint_user) + 2]; - strcpy(vformat[i],format_bigint_user); + strcpy(vformat[i], format_bigint_user); } else { vformat[i] = new char[strlen(ptr) + 2]; - strcpy(vformat[i],ptr); + strcpy(vformat[i], ptr); } - vformat[i] = strcat(vformat[i]," "); + vformat[i] = strcat(vformat[i], " "); } // setup boundary string @@ -286,8 +286,10 @@ void DumpCustomMPIIO::init_style() else if (!binary && domain->triclinic == 1) header_choice = &DumpCustomMPIIO::header_item_triclinic; - if (binary) write_choice = &DumpCustomMPIIO::write_binary; - else write_choice = &DumpCustomMPIIO::write_string; + if (binary) + write_choice = &DumpCustomMPIIO::write_binary; + else + write_choice = &DumpCustomMPIIO::write_string; // find current ptr for each compute,fix,variable // check that fix frequency is acceptable @@ -295,24 +297,23 @@ void DumpCustomMPIIO::init_style() 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"); + 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"); + 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"); + 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"); + if (ivariable < 0) error->all(FLERR, "Could not find dump custom variable name"); variable[i] = ivariable; } @@ -320,8 +321,7 @@ void DumpCustomMPIIO::init_style() if (iregion >= 0) { iregion = domain->find_region(idregion); - if (iregion == -1) - error->all(FLERR,"Region ID for dump custom does not exist"); + if (iregion == -1) error->all(FLERR, "Region ID for dump custom does not exist"); } } @@ -338,48 +338,47 @@ void DumpCustomMPIIO::header_binary(bigint ndump) { if (performEstimate) { - headerBuffer = (char *) malloc((2*sizeof(bigint)) + (9*sizeof(int)) + (6*sizeof(double))); + headerBuffer = (char *) malloc((2 * sizeof(bigint)) + (9 * sizeof(int)) + (6 * sizeof(double))); headerSize = 0; - memcpy(&((char*)headerBuffer)[headerSize],&update->ntimestep,sizeof(bigint)); + memcpy(headerBuffer + headerSize, &update->ntimestep, sizeof(bigint)); headerSize += sizeof(bigint); - memcpy(&((char*)headerBuffer)[headerSize],&ndump,sizeof(bigint)); + memcpy(headerBuffer + headerSize, &ndump, sizeof(bigint)); headerSize += sizeof(bigint); - memcpy(&((char*)headerBuffer)[headerSize],&domain->triclinic,sizeof(int)); + memcpy(headerBuffer + headerSize, &domain->triclinic, sizeof(int)); headerSize += sizeof(int); - memcpy(&((char*)headerBuffer)[headerSize],&domain->boundary[0][0],6*sizeof(int)); - headerSize += 6*sizeof(int); + memcpy(headerBuffer + headerSize, &domain->boundary[0][0], 6 * sizeof(int)); + headerSize += 6 * sizeof(int); - memcpy(&((char*)headerBuffer)[headerSize],&boxxlo,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxxlo, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxxhi,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxxhi, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxylo,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxylo, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxyhi,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxyhi, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxzlo,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxzlo, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxzhi,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxzhi, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&size_one,sizeof(int)); + memcpy(headerBuffer + headerSize, &size_one, sizeof(int)); headerSize += sizeof(int); - memcpy(&((char*)headerBuffer)[headerSize],&nprocs,sizeof(int)); + memcpy(headerBuffer + headerSize, &nprocs, sizeof(int)); headerSize += sizeof(int); - } - else { // write data + } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,headerBuffer,headerSize,MPI_BYTE,MPI_STATUS_IGNORE); + MPI_File_write_at(mpifh, mpifo, headerBuffer, headerSize, MPI_BYTE, MPI_STATUS_IGNORE); mpifo += headerSize; free(headerBuffer); } @@ -391,59 +390,58 @@ void DumpCustomMPIIO::header_binary_triclinic(bigint ndump) { if (performEstimate) { - headerBuffer = (char *) malloc((2*sizeof(bigint)) + (9*sizeof(int)) + (6*sizeof(double))); + headerBuffer = (char *) malloc((2 * sizeof(bigint)) + (9 * sizeof(int)) + (9 * sizeof(double))); headerSize = 0; - memcpy(&((char*)headerBuffer)[headerSize],&update->ntimestep,sizeof(bigint)); + memcpy(headerBuffer + headerSize, &update->ntimestep, sizeof(bigint)); headerSize += sizeof(bigint); - memcpy(&((char*)headerBuffer)[headerSize],&ndump,sizeof(bigint)); + memcpy(headerBuffer + headerSize, &ndump, sizeof(bigint)); headerSize += sizeof(bigint); - memcpy(&((char*)headerBuffer)[headerSize],&domain->triclinic,sizeof(int)); + memcpy(headerBuffer + headerSize, &domain->triclinic, sizeof(int)); headerSize += sizeof(int); - memcpy(&((char*)headerBuffer)[headerSize],&domain->boundary[0][0],6*sizeof(int)); - headerSize += 6*sizeof(int); + memcpy(headerBuffer + headerSize, &domain->boundary[0][0], 6 * sizeof(int)); + headerSize += 6 * sizeof(int); - memcpy(&((char*)headerBuffer)[headerSize],&boxxlo,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxxlo, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxxhi,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxxhi, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxylo,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxylo, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxyhi,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxyhi, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxzlo,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxzlo, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxzhi,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxzhi, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxxy,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxxy, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxxz,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxxz, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&boxyz,sizeof(double)); + memcpy(headerBuffer + headerSize, &boxyz, sizeof(double)); headerSize += sizeof(double); - memcpy(&((char*)headerBuffer)[headerSize],&size_one,sizeof(int)); + memcpy(headerBuffer + headerSize, &size_one, sizeof(int)); headerSize += sizeof(int); - memcpy(&((char*)headerBuffer)[headerSize],&nprocs,sizeof(int)); + memcpy(headerBuffer + headerSize, &nprocs, sizeof(int)); headerSize += sizeof(int); - } - else { // write data + } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,headerBuffer,headerSize,MPI_BYTE,MPI_STATUS_IGNORE); + MPI_File_write_at(mpifh, mpifo, headerBuffer, headerSize, MPI_BYTE, MPI_STATUS_IGNORE); mpifo += headerSize; free(headerBuffer); } @@ -455,25 +453,21 @@ void DumpCustomMPIIO::header_item(bigint ndump) { if (performEstimate) { - headerBuffer = (char *) malloc(MAX_TEXT_HEADER_SIZE); + auto itemtxt = fmt::format("ITEM: TIMESTEP\n{}\n", update->ntimestep); + itemtxt += fmt::format("ITEM: NUMBER OF ATOMS\n{}\n", ndump); + itemtxt += fmt::format("ITEM: BOX BOUNDS {}\n", boundstr); + itemtxt += fmt::format("{} {}\n{} {}\n{} {}\n", boxxlo, boxxhi, boxylo, boxyhi, boxzlo, boxzhi); + itemtxt += fmt::format("ITEM: ATOMS {}\n", columns); - headerSize = 0; - headerSize += sprintf(((char*)&((char*)headerBuffer)[headerSize]),"ITEM: TIMESTEP\n"); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],BIGINT_FORMAT "\n",update->ntimestep); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: NUMBER OF ATOMS\n"); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],BIGINT_FORMAT "\n",ndump); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: BOX BOUNDS %s\n",boundstr); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"%g %g\n",boxxlo,boxxhi); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"%g %g\n",boxylo,boxyhi); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"%g %g\n",boxzlo,boxzhi); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: ATOMS %s\n",columns); - } - else { // write data + headerSize = itemtxt.size(); + headerBuffer = utils::strdup(itemtxt); + + } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,headerBuffer,headerSize,MPI_CHAR,MPI_STATUS_IGNORE); + MPI_File_write_at(mpifh, mpifo, headerBuffer, headerSize, MPI_CHAR, MPI_STATUS_IGNORE); mpifo += headerSize; - free(headerBuffer); + delete[] headerBuffer; } } @@ -483,25 +477,22 @@ void DumpCustomMPIIO::header_item_triclinic(bigint ndump) { if (performEstimate) { - headerBuffer = (char *) malloc(MAX_TEXT_HEADER_SIZE); + auto itemtxt = fmt::format("ITEM: TIMESTEP\n{}\n", update->ntimestep); + itemtxt += fmt::format("ITEM: NUMBER OF ATOMS\n{}\n", ndump); + itemtxt += fmt::format("ITEM: BOX BOUNDS xy xz yz {}\n", boundstr); + itemtxt += fmt::format("{} {} {}\n{} {} {}\n{} {} {}\n", boxxlo, boxxhi, boxxy, boxylo, boxyhi, + boxxz, boxzlo, boxzhi, boxyz); + itemtxt += fmt::format("ITEM: ATOMS {}\n", columns); - headerSize = 0; - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: TIMESTEP\n"); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],BIGINT_FORMAT "\n",update->ntimestep); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: NUMBER OF ATOMS\n"); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],BIGINT_FORMAT "\n",ndump); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"%g %g %g\n",boxxlo,boxxhi,boxxy); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"%g %g %g\n",boxylo,boxyhi,boxxz); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"%g %g %g\n",boxzlo,boxzhi,boxyz); - headerSize += sprintf(&((char*)headerBuffer)[headerSize],"ITEM: ATOMS %s\n",columns); - } - else { // write data + headerSize = itemtxt.size(); + headerBuffer = utils::strdup(itemtxt); + + } else { // write data if (me == 0) - MPI_File_write_at(mpifh,mpifo,headerBuffer,headerSize,MPI_CHAR,MPI_STATUS_IGNORE); + MPI_File_write_at(mpifh, mpifo, headerBuffer, headerSize, MPI_CHAR, MPI_STATUS_IGNORE); mpifo += headerSize; - free(headerBuffer); + delete[] headerBuffer; } } @@ -509,7 +500,7 @@ void DumpCustomMPIIO::header_item_triclinic(bigint ndump) void DumpCustomMPIIO::write_data(int n, double *mybuf) { - (this->*write_choice)(n,mybuf); + (this->*write_choice)(n, mybuf); } /* ---------------------------------------------------------------------- */ @@ -522,22 +513,21 @@ void DumpCustomMPIIO::write_binary(int n, double *mybuf) bigint incPrefix = 0; bigint bigintNme = (bigint) nme; - MPI_Scan(&bigintNme,&incPrefix,1,MPI_LMP_BIGINT,MPI_SUM,world); - sumFileSize = (incPrefix*size_one*sizeof(double)) + (nprocs * sizeof(int)); - offsetFromHeader = ((incPrefix-bigintNme)*size_one*sizeof(double)) + (me * sizeof(int)); - } - else { - int byteBufSize = (n*sizeof(double)) + sizeof(int); + MPI_Scan(&bigintNme, &incPrefix, 1, MPI_LMP_BIGINT, MPI_SUM, world); + sumFileSize = (incPrefix * size_one * sizeof(double)) + (nprocs * sizeof(int)); + offsetFromHeader = ((incPrefix - bigintNme) * size_one * sizeof(double)) + (me * sizeof(int)); + } else { + int byteBufSize = (n * sizeof(double)) + sizeof(int); char *bufWithSize; - memory->create(bufWithSize,byteBufSize,"dump:bufWithSize"); - memcpy(bufWithSize,(char*)(&n),sizeof(int)); - memcpy(&((char*)bufWithSize)[sizeof(int)],mybuf,(n*sizeof(double))); - MPI_File_write_at_all(mpifh,mpifo+offsetFromHeader,bufWithSize,byteBufSize,MPI_BYTE,MPI_STATUS_IGNORE); + memory->create(bufWithSize, byteBufSize, "dump:bufWithSize"); + memcpy(bufWithSize, (char *) (&n), sizeof(int)); + memcpy(&((char *) bufWithSize)[sizeof(int)], mybuf, (n * sizeof(double))); + MPI_File_write_at_all(mpifh, mpifo + offsetFromHeader, bufWithSize, byteBufSize, MPI_BYTE, + MPI_STATUS_IGNORE); memory->destroy(bufWithSize); - if (flush_flag) - MPI_File_sync(mpifh); + if (flush_flag) MPI_File_sync(mpifh); } } @@ -550,23 +540,20 @@ void DumpCustomMPIIO::write_string(int n, double *mybuf) #if defined(_OPENMP) int nthreads = omp_get_max_threads(); if ((nthreads > 1) && !(lmp->kokkos)) - nsme = convert_string_omp(n,mybuf); // not (yet) compatible with Kokkos + nsme = convert_string_omp(n, mybuf); // not (yet) compatible with Kokkos else - nsme = convert_string(n,mybuf); + nsme = convert_string(n, mybuf); #else - - nsme = convert_string(n,mybuf); + nsme = convert_string(n, mybuf); #endif bigint incPrefix = 0; bigint bigintNsme = (bigint) nsme; - MPI_Scan(&bigintNsme,&incPrefix,1,MPI_LMP_BIGINT,MPI_SUM,world); - sumFileSize = (incPrefix*sizeof(char)); - offsetFromHeader = ((incPrefix-bigintNsme)*sizeof(char)); - } - else { - MPI_File_write_at_all(mpifh,mpifo+offsetFromHeader,sbuf,nsme,MPI_CHAR,MPI_STATUS_IGNORE); - if (flush_flag) - MPI_File_sync(mpifh); + MPI_Scan(&bigintNsme, &incPrefix, 1, MPI_LMP_BIGINT, MPI_SUM, world); + sumFileSize = (incPrefix * sizeof(char)); + offsetFromHeader = ((incPrefix - bigintNsme) * sizeof(char)); + } else { + MPI_File_write_at_all(mpifh, mpifo + offsetFromHeader, sbuf, nsme, MPI_CHAR, MPI_STATUS_IGNORE); + if (flush_flag) MPI_File_sync(mpifh); } } @@ -586,64 +573,71 @@ int DumpCustomMPIIO::convert_string_omp(int n, double *mybuf) mpifhStringCount = 0; int nthreads = omp_get_max_threads(); - if (nthreads > n) { // call serial version - convert_string(n,mybuf); + if (nthreads > n) { // call serial version + convert_string(n, mybuf); - } - else { - memory->create(mpifhStringCountPerThread,nthreads,"dump:mpifhStringCountPerThread"); - mpifh_buffer_line_per_thread = (char **) malloc(nthreads*sizeof(char*)); - memory->create(bufOffset,nthreads,"dump:bufOffset"); - memory->create(bufRange,nthreads,"dump:bufRange"); - memory->create(bufLength,nthreads,"dump:bufLength"); + } else { + memory->create(mpifhStringCountPerThread, nthreads, "dump:mpifhStringCountPerThread"); + mpifh_buffer_line_per_thread = (char **) malloc(nthreads * sizeof(char *)); + memory->create(bufOffset, nthreads, "dump:bufOffset"); + memory->create(bufRange, nthreads, "dump:bufRange"); + memory->create(bufLength, nthreads, "dump:bufLength"); - int i=0; - for (i=0;i<(nthreads-1);i++) { + int i = 0; + for (i = 0; i < (nthreads - 1); i++) { mpifhStringCountPerThread[i] = 0; - bufOffset[i] = (int) (i*(int)(floor((double)n/(double)nthreads))*size_one); - bufRange[i] = (int)(floor((double)n/(double)nthreads)); + bufOffset[i] = (int) (i * (int) (floor((double) n / (double) nthreads)) * size_one); + bufRange[i] = (int) (floor((double) n / (double) nthreads)); bufLength[i] = DUMP_BUF_CHUNK_SIZE; mpifh_buffer_line_per_thread[i] = (char *) malloc(DUMP_BUF_CHUNK_SIZE * sizeof(char)); mpifh_buffer_line_per_thread[i][0] = '\0'; } mpifhStringCountPerThread[i] = 0; - bufOffset[i] = (int) (i*(int)(floor((double)n/(double)nthreads))*size_one); - bufRange[i] = n-(i*(int)(floor((double)n/(double)nthreads))); + bufOffset[i] = (int) (i * (int) (floor((double) n / (double) nthreads)) * size_one); + bufRange[i] = n - (i * (int) (floor((double) n / (double) nthreads))); bufLength[i] = DUMP_BUF_CHUNK_SIZE; mpifh_buffer_line_per_thread[i] = (char *) malloc(DUMP_BUF_CHUNK_SIZE * sizeof(char)); mpifh_buffer_line_per_thread[i][0] = '\0'; -#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(bufOffset, bufRange, bufLength, mpifhStringCountPerThread, mpifh_buffer_line_per_thread, mybuf) +#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(bufOffset, bufRange, bufLength, \ + mpifhStringCountPerThread, \ + mpifh_buffer_line_per_thread, mybuf) { int tid = omp_get_thread_num(); - int m=0; + int m = 0; for (int i = 0; i < bufRange[tid]; i++) { if ((bufLength[tid] - mpifhStringCountPerThread[tid]) < DUMP_BUF_INCREMENT_SIZE) { - mpifh_buffer_line_per_thread[tid] = (char *) realloc(mpifh_buffer_line_per_thread[tid],(mpifhStringCountPerThread[tid]+DUMP_BUF_CHUNK_SIZE) * sizeof(char)); - bufLength[tid] = (mpifhStringCountPerThread[tid]+DUMP_BUF_CHUNK_SIZE) * sizeof(char); + mpifh_buffer_line_per_thread[tid] = (char *) realloc( + mpifh_buffer_line_per_thread[tid], + (mpifhStringCountPerThread[tid] + DUMP_BUF_CHUNK_SIZE) * sizeof(char)); + bufLength[tid] = (mpifhStringCountPerThread[tid] + DUMP_BUF_CHUNK_SIZE) * sizeof(char); } for (int j = 0; j < size_one; j++) { if (vtype[j] == Dump::INT) - mpifhStringCountPerThread[tid] += sprintf(&(mpifh_buffer_line_per_thread[tid][mpifhStringCountPerThread[tid]]),vformat[j],static_cast (mybuf[bufOffset[tid]+m])); + mpifhStringCountPerThread[tid] += + sprintf(&(mpifh_buffer_line_per_thread[tid][mpifhStringCountPerThread[tid]]), + vformat[j], static_cast(mybuf[bufOffset[tid] + m])); else if (vtype[j] == Dump::DOUBLE) - mpifhStringCountPerThread[tid] += sprintf(&(mpifh_buffer_line_per_thread[tid][mpifhStringCountPerThread[tid]]),vformat[j],mybuf[bufOffset[tid]+m]); + mpifhStringCountPerThread[tid] += + sprintf(&(mpifh_buffer_line_per_thread[tid][mpifhStringCountPerThread[tid]]), + vformat[j], mybuf[bufOffset[tid] + m]); else if (vtype[j] == Dump::STRING) - mpifhStringCountPerThread[tid] += sprintf(&(mpifh_buffer_line_per_thread[tid][mpifhStringCountPerThread[tid]]),vformat[j],typenames[(int) mybuf[bufOffset[tid]+m]]); - m ++; + mpifhStringCountPerThread[tid] += + sprintf(&(mpifh_buffer_line_per_thread[tid][mpifhStringCountPerThread[tid]]), + vformat[j], typenames[(int) mybuf[bufOffset[tid] + m]]); + m++; } - mpifhStringCountPerThread[tid] += sprintf(&(mpifh_buffer_line_per_thread[tid][mpifhStringCountPerThread[tid]]),"\n"); - + mpifhStringCountPerThread[tid] += + sprintf(&(mpifh_buffer_line_per_thread[tid][mpifhStringCountPerThread[tid]]), "\n"); } } #pragma omp barrier mpifhStringCount = 0; - for (i=0;idestroy(bufOffset); memory->destroy(bufRange); @@ -652,21 +646,19 @@ int DumpCustomMPIIO::convert_string_omp(int n, double *mybuf) if (mpifhStringCount > 0) { if (mpifhStringCount > maxsbuf) { if (mpifhStringCount > MAXSMALLINT) return -1; - maxsbuf = mpifhStringCount+1; - memory->grow(sbuf,maxsbuf,"dump:sbuf"); + maxsbuf = mpifhStringCount + 1; + memory->grow(sbuf, maxsbuf, "dump:sbuf"); } sbuf[0] = '\0'; } - - for (int i=0;idestroy(mpifhStringCountPerThread); free(mpifh_buffer_line_per_thread); - } return mpifhStringCount; diff --git a/src/MPIIO/dump_custom_mpiio.h b/src/MPIIO/dump_custom_mpiio.h index 8be38364b3..bb5b901d53 100644 --- a/src/MPIIO/dump_custom_mpiio.h +++ b/src/MPIIO/dump_custom_mpiio.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(custom/mpiio,DumpCustomMPIIO) - +// clang-format off +DumpStyle(custom/mpiio,DumpCustomMPIIO); +// clang-format on #else #ifndef LMP_DUMP_CUSTOM_MPIIO_H @@ -30,17 +30,17 @@ class DumpCustomMPIIO : public DumpCustom { virtual ~DumpCustomMPIIO(); protected: - - bigint sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data - char *headerBuffer; // buffer for holding header data + bigint + sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data + char *headerBuffer; // buffer for holding header data MPI_File mpifh; - MPI_Offset mpifo,offsetFromHeader,headerSize, currentFileSize; - int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data - char *filecurrent; // name of file for this round (with % and * replaced) + MPI_Offset mpifo, offsetFromHeader, headerSize, currentFileSize; + int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data + char *filecurrent; // name of file for this round (with % and * replaced) #if defined(_OPENMP) - int convert_string_omp(int, double *); // multithreaded version of convert_string + int convert_string_omp(int, double *); // multithreaded version of convert_string #endif virtual void openfile(); @@ -50,19 +50,19 @@ class DumpCustomMPIIO : public DumpCustom { virtual void init_style(); typedef void (DumpCustomMPIIO::*FnPtrHeader)(bigint); - FnPtrHeader header_choice; // ptr to write header functions + FnPtrHeader header_choice; // ptr to write header functions void header_binary(bigint); void header_binary_triclinic(bigint); void header_item(bigint); void header_item_triclinic(bigint); typedef void (DumpCustomMPIIO::*FnPtrData)(int, double *); - FnPtrData write_choice; // ptr to write data functions + FnPtrData write_choice; // ptr to write data functions void write_binary(int, double *); void write_string(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MPIIO/dump_xyz_mpiio.cpp b/src/MPIIO/dump_xyz_mpiio.cpp index 481470c7e6..24fd130e3d 100644 --- a/src/MPIIO/dump_xyz_mpiio.cpp +++ b/src/MPIIO/dump_xyz_mpiio.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MPIIO/dump_xyz_mpiio.h b/src/MPIIO/dump_xyz_mpiio.h index b2fde6306a..e85db01a87 100644 --- a/src/MPIIO/dump_xyz_mpiio.h +++ b/src/MPIIO/dump_xyz_mpiio.h @@ -1,6 +1,6 @@ /* -*- c++ -*- --------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(xyz/mpiio,DumpXYZMPIIO) - +// clang-format off +DumpStyle(xyz/mpiio,DumpXYZMPIIO); +// clang-format on #else #ifndef LMP_DUMP_XYZ_MPIIO_H @@ -30,17 +30,17 @@ class DumpXYZMPIIO : public DumpXYZ { virtual ~DumpXYZMPIIO(); protected: - - bigint sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data - char *headerBuffer; // buffer for holding header data + bigint + sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data + char *headerBuffer; // buffer for holding header data MPI_File mpifh; - MPI_Offset mpifo,offsetFromHeader,headerSize, currentFileSize; - int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data - char *filecurrent; // name of file for this round (with % and * replaced) + MPI_Offset mpifo, offsetFromHeader, headerSize, currentFileSize; + int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data + char *filecurrent; // name of file for this round (with % and * replaced) #if defined(_OPENMP) - int convert_string_omp(int, double *); // multithreaded version of convert_string + int convert_string_omp(int, double *); // multithreaded version of convert_string #endif virtual void openfile(); @@ -51,12 +51,11 @@ class DumpXYZMPIIO : public DumpXYZ { virtual void init_style(); typedef void (DumpXYZMPIIO::*FnPtrData)(int, double *); - FnPtrData write_choice; // ptr to write data functions + FnPtrData write_choice; // ptr to write data functions void write_string(int, double *); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MPIIO/restart_mpiio.cpp b/src/MPIIO/restart_mpiio.cpp index 8354a83bdb..57ade6c39e 100644 --- a/src/MPIIO/restart_mpiio.cpp +++ b/src/MPIIO/restart_mpiio.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MPIIO/restart_mpiio.h b/src/MPIIO/restart_mpiio.h index f3594573be..a39808e69c 100644 --- a/src/MPIIO/restart_mpiio.h +++ b/src/MPIIO/restart_mpiio.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,10 +18,10 @@ namespace LAMMPS_NS { -class RestartMPIIO : protected Pointers { +class RestartMPIIO : protected Pointers { private: - MPI_File mpifh; - int nprocs, myrank; + MPI_File mpifh; + int nprocs, myrank; public: int mpiio_exists; @@ -35,7 +35,7 @@ class RestartMPIIO : protected Pointers { void close(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/MSCG/fix_mscg.cpp b/src/MSCG/fix_mscg.cpp index 38635b0891..0d420cace8 100644 --- a/src/MSCG/fix_mscg.cpp +++ b/src/MSCG/fix_mscg.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/MSCG/fix_mscg.h b/src/MSCG/fix_mscg.h index 520a6b1ac3..1233db1748 100644 --- a/src/MSCG/fix_mscg.h +++ b/src/MSCG/fix_mscg.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(mscg,FixMSCG) - +// clang-format off +FixStyle(mscg,FixMSCG); +// clang-format on #else #ifndef LMP_FIX_MSCG_H @@ -35,18 +35,18 @@ class FixMSCG : public Fix { void post_run(); private: - int range_flag,name_flag,me,nprocs; - int nframes,n_frames,block_size,n_cg_sites,n_cg_types,*cg_site_types; - int max_partners_bond,max_partners_angle,max_partners_dihedral; - unsigned *n_partners_bond,*n_partners_angle,*n_partners_dihedral; - unsigned **partners_bond,**partners_angle,**partners_dihedral; - double *x1d,*f1d,**f; + int range_flag, name_flag, me, nprocs; + int nframes, n_frames, block_size, n_cg_sites, n_cg_types, *cg_site_types; + int max_partners_bond, max_partners_angle, max_partners_dihedral; + unsigned *n_partners_bond, *n_partners_angle, *n_partners_dihedral; + unsigned **partners_bond, **partners_angle, **partners_dihedral; + double *x1d, *f1d, **f; double box_half_lengths[3]; char **type_names; void *mscg_struct; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/Makefile b/src/Makefile index 6523870d75..a0de708070 100644 --- a/src/Makefile +++ b/src/Makefile @@ -54,20 +54,21 @@ PACKAGE = asphere body class2 colloid compress coreshell dipole gpu \ PACKUSER = user-adios user-atc user-awpmd user-brownian user-bocs user-cgdna \ user-cgsdk user-colvars user-diffraction user-dpd user-drude \ user-eff user-fep user-h5md user-intel user-lb user-manifold \ - user-meamc user-mesodpd user-mesont user-mgpt user-misc \ + user-mdi user-meamc user-mesodpd user-mesont user-mgpt user-misc \ user-mofff \user-molfile user-netcdf user-omp user-phonon \ user-pace user-plumed user-ptm user-qmmm user-qtb user-quip \ user-reaction user-reaxc user-scafacos user-smd user-smtbq \ user-sdpd user-sph user-tally user-uef user-vtk user-yaff PACKLIB = compress gpu kim kokkos latte message mpiio mscg poems python voronoi \ - user-adios user-atc user-awpmd user-colvars user-h5md user-lb user-mesont \ - user-molfile user-netcdf user-pace user-plumed user-qmmm user-quip \ + user-adios user-atc user-awpmd user-colvars user-h5md user-lb user-mdi \ + user-mesont user-molfile user-netcdf user-pace user-plumed user-qmmm user-quip \ user-scafacos user-smd user-vtk PACKSYS = compress mpiio python user-lb -PACKINT = gpu kokkos message poems user-atc user-awpmd user-colvars user-mesont +PACKINT = gpu kokkos message poems user-atc user-awpmd user-colvars user-mesont \ + user-mdi PACKEXT = kim latte mscg voronoi \ user-adios user-h5md user-molfile user-netcdf user-pace user-plumed \ diff --git a/src/OPT/pair_eam_alloy_opt.cpp b/src/OPT/pair_eam_alloy_opt.cpp index 86ee369159..ce9b345e10 100644 --- a/src/OPT/pair_eam_alloy_opt.cpp +++ b/src/OPT/pair_eam_alloy_opt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/OPT/pair_eam_alloy_opt.h b/src/OPT/pair_eam_alloy_opt.h index 6c56ca76dd..7da08bfecb 100644 --- a/src/OPT/pair_eam_alloy_opt.h +++ b/src/OPT/pair_eam_alloy_opt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/alloy/opt,PairEAMAlloyOpt) - +// clang-format off +PairStyle(eam/alloy/opt,PairEAMAlloyOpt); +// clang-format on #else #ifndef LMP_PAIR_EAM_ALLOY_OPT_H @@ -31,7 +31,7 @@ class PairEAMAlloyOpt : public PairEAMAlloy, public PairEAMOpt { virtual ~PairEAMAlloyOpt() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_eam_fs_opt.cpp b/src/OPT/pair_eam_fs_opt.cpp index 10832dbb4b..3cc2f65f1d 100644 --- a/src/OPT/pair_eam_fs_opt.cpp +++ b/src/OPT/pair_eam_fs_opt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/OPT/pair_eam_fs_opt.h b/src/OPT/pair_eam_fs_opt.h index 63f0ea8499..5349e25740 100644 --- a/src/OPT/pair_eam_fs_opt.h +++ b/src/OPT/pair_eam_fs_opt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/fs/opt,PairEAMFSOpt) - +// clang-format off +PairStyle(eam/fs/opt,PairEAMFSOpt); +// clang-format on #else #ifndef LMP_PAIR_EAM_FS_OPT_H @@ -31,7 +31,7 @@ class PairEAMFSOpt : public PairEAMFS, public PairEAMOpt { virtual ~PairEAMFSOpt() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_eam_opt.cpp b/src/OPT/pair_eam_opt.cpp index 67923515c9..08af3e7d18 100644 --- a/src/OPT/pair_eam_opt.cpp +++ b/src/OPT/pair_eam_opt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/OPT/pair_eam_opt.h b/src/OPT/pair_eam_opt.h index 6805e2a1cb..02af32b6a1 100644 --- a/src/OPT/pair_eam_opt.h +++ b/src/OPT/pair_eam_opt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/opt,PairEAMOpt) - +// clang-format off +PairStyle(eam/opt,PairEAMOpt); +// clang-format on #else #ifndef LMP_PAIR_EAM_OPT_H @@ -33,10 +33,10 @@ class PairEAMOpt : virtual public PairEAM { void compute(int, int); private: - template < int EVFLAG, int EFLAG, int NEWTON_PAIR > void eval(); + template void eval(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_lj_charmm_coul_long_opt.cpp b/src/OPT/pair_lj_charmm_coul_long_opt.cpp index 998d88b8cb..7b6bec5b94 100644 --- a/src/OPT/pair_lj_charmm_coul_long_opt.cpp +++ b/src/OPT/pair_lj_charmm_coul_long_opt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/OPT/pair_lj_charmm_coul_long_opt.h b/src/OPT/pair_lj_charmm_coul_long_opt.h index 3f1bf44a8f..b1f3a69069 100644 --- a/src/OPT/pair_lj_charmm_coul_long_opt.h +++ b/src/OPT/pair_lj_charmm_coul_long_opt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/long/opt,PairLJCharmmCoulLongOpt) - +// clang-format off +PairStyle(lj/charmm/coul/long/opt,PairLJCharmmCoulLongOpt); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_OPT_H @@ -30,10 +30,10 @@ class PairLJCharmmCoulLongOpt : public PairLJCharmmCoulLong { void compute(int, int); private: - template < int EVFLAG, int EFLAG, int NEWTON_PAIR > void eval(); + template void eval(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_lj_cut_coul_long_opt.cpp b/src/OPT/pair_lj_cut_coul_long_opt.cpp index 4d73b91d30..de6f562900 100644 --- a/src/OPT/pair_lj_cut_coul_long_opt.cpp +++ b/src/OPT/pair_lj_cut_coul_long_opt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/OPT/pair_lj_cut_coul_long_opt.h b/src/OPT/pair_lj_cut_coul_long_opt.h index b136dcb34d..9b6fb077aa 100644 --- a/src/OPT/pair_lj_cut_coul_long_opt.h +++ b/src/OPT/pair_lj_cut_coul_long_opt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/long/opt,PairLJCutCoulLongOpt) - +// clang-format off +PairStyle(lj/cut/coul/long/opt,PairLJCutCoulLongOpt); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_LONG_OPT_H @@ -30,12 +30,10 @@ class PairLJCutCoulLongOpt : public PairLJCutCoulLong { virtual void compute(int, int); protected: - template - void eval(); + template void eval(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_lj_cut_opt.cpp b/src/OPT/pair_lj_cut_opt.cpp index 7a5d6978fd..e0ab42b779 100644 --- a/src/OPT/pair_lj_cut_opt.cpp +++ b/src/OPT/pair_lj_cut_opt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/OPT/pair_lj_cut_opt.h b/src/OPT/pair_lj_cut_opt.h index 60afee870e..895ee64392 100644 --- a/src/OPT/pair_lj_cut_opt.h +++ b/src/OPT/pair_lj_cut_opt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/opt,PairLJCutOpt) - +// clang-format off +PairStyle(lj/cut/opt,PairLJCutOpt); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_OPT_H @@ -30,10 +30,10 @@ class PairLJCutOpt : public PairLJCut { void compute(int, int); private: - template < int EVFLAG, int EFLAG, int NEWTON_PAIR > void eval(); + template void eval(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_lj_cut_tip4p_long_opt.cpp b/src/OPT/pair_lj_cut_tip4p_long_opt.cpp index 9384720163..9f02547d7e 100644 --- a/src/OPT/pair_lj_cut_tip4p_long_opt.cpp +++ b/src/OPT/pair_lj_cut_tip4p_long_opt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/OPT/pair_lj_cut_tip4p_long_opt.h b/src/OPT/pair_lj_cut_tip4p_long_opt.h index 79c1d1e001..dc82e077c0 100644 --- a/src/OPT/pair_lj_cut_tip4p_long_opt.h +++ b/src/OPT/pair_lj_cut_tip4p_long_opt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/tip4p/long/opt,PairLJCutTIP4PLongOpt) - +// clang-format off +PairStyle(lj/cut/tip4p/long/opt,PairLJCutTIP4PLongOpt); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_TIP4P_LONG_OPT_H @@ -24,22 +24,20 @@ PairStyle(lj/cut/tip4p/long/opt,PairLJCutTIP4PLongOpt) namespace LAMMPS_NS { - class PairLJCutTIP4PLongOpt : public PairLJCutTIP4PLong { +class PairLJCutTIP4PLongOpt : public PairLJCutTIP4PLong { public: - PairLJCutTIP4PLongOpt(class LAMMPS *); - virtual ~PairLJCutTIP4PLongOpt() {}; + PairLJCutTIP4PLongOpt(class LAMMPS *); + virtual ~PairLJCutTIP4PLongOpt(){}; virtual void compute(int, int); virtual double memory_usage(); protected: - template < const int, const int, const int, const int > - void eval(); - void compute_newsite_opt(const double *, const double *, - const double *, double *) const; + template void eval(); + void compute_newsite_opt(const double *, const double *, const double *, double *) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_lj_long_coul_long_opt.cpp b/src/OPT/pair_lj_long_coul_long_opt.cpp index b530eda1d3..5b8a1009f1 100644 --- a/src/OPT/pair_lj_long_coul_long_opt.cpp +++ b/src/OPT/pair_lj_long_coul_long_opt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/OPT/pair_lj_long_coul_long_opt.h b/src/OPT/pair_lj_long_coul_long_opt.h index 39a8dabbfd..47a10ef648 100644 --- a/src/OPT/pair_lj_long_coul_long_opt.h +++ b/src/OPT/pair_lj_long_coul_long_opt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/long/coul/long/opt,PairLJLongCoulLongOpt) - +// clang-format off +PairStyle(lj/long/coul/long/opt,PairLJLongCoulLongOpt); +// clang-format on #else #ifndef LMP_PAIR_LJ_LONG_COUL_LONG_OPT_H @@ -28,21 +28,19 @@ class PairLJLongCoulLongOpt : public PairLJLongCoulLong { public: PairLJLongCoulLongOpt(class LAMMPS *); virtual void compute(int, int); - virtual void compute_outer(int,int); + virtual void compute_outer(int, int); protected: - template + template void eval(); - template + template void eval_outer(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_morse_opt.cpp b/src/OPT/pair_morse_opt.cpp index 56c101a993..80414b40c8 100644 --- a/src/OPT/pair_morse_opt.cpp +++ b/src/OPT/pair_morse_opt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/OPT/pair_morse_opt.h b/src/OPT/pair_morse_opt.h index bb870d6e6e..4986566a4b 100644 --- a/src/OPT/pair_morse_opt.h +++ b/src/OPT/pair_morse_opt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(morse/opt,PairMorseOpt) - +// clang-format off +PairStyle(morse/opt,PairMorseOpt); +// clang-format on #else #ifndef LMP_PAIR_MORSE_OPT_H @@ -30,10 +30,10 @@ class PairMorseOpt : public PairMorse { void compute(int, int); private: - template < int EVFLAG, int EFLAG, int NEWTON_PAIR > void eval(); + template void eval(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_ufm_opt.cpp b/src/OPT/pair_ufm_opt.cpp index 9d7b79527c..3008d0af22 100644 --- a/src/OPT/pair_ufm_opt.cpp +++ b/src/OPT/pair_ufm_opt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/OPT/pair_ufm_opt.h b/src/OPT/pair_ufm_opt.h index 6df271edad..c79cf0024e 100644 --- a/src/OPT/pair_ufm_opt.h +++ b/src/OPT/pair_ufm_opt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,9 +18,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(ufm/opt,PairUFMOpt) - +// clang-format off +PairStyle(ufm/opt,PairUFMOpt); +// clang-format on #else #ifndef LMP_PAIR_UFM_OPT_H @@ -36,10 +36,10 @@ class PairUFMOpt : public PairUFM { void compute(int, int); private: - template < int EVFLAG, int EFLAG, int NEWTON_PAIR > void eval(); + template void eval(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/atom_vec_peri.cpp b/src/PERI/atom_vec_peri.cpp index 4ea0fd4a23..a0483efb4d 100644 --- a/src/PERI/atom_vec_peri.cpp +++ b/src/PERI/atom_vec_peri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PERI/atom_vec_peri.h b/src/PERI/atom_vec_peri.h index 66ef2d4230..10c68bbb41 100644 --- a/src/PERI/atom_vec_peri.h +++ b/src/PERI/atom_vec_peri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(peri,AtomVecPeri) - +// clang-format off +AtomStyle(peri,AtomVecPeri); +// clang-format on #else #ifndef LMP_ATOM_VEC_PERI_H @@ -35,12 +35,11 @@ class AtomVecPeri : public AtomVec { void pack_property_atom(int, double *, int, int); private: - double *rmass,*vfrac,*s0; + double *rmass, *vfrac, *s0; double **x0; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/compute_damage_atom.cpp b/src/PERI/compute_damage_atom.cpp index 17b0374e0a..1e5a6102dc 100644 --- a/src/PERI/compute_damage_atom.cpp +++ b/src/PERI/compute_damage_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PERI/compute_damage_atom.h b/src/PERI/compute_damage_atom.h index ea0c4fd993..7530a1cb02 100644 --- a/src/PERI/compute_damage_atom.h +++ b/src/PERI/compute_damage_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(damage/atom,ComputeDamageAtom) - +// clang-format off +ComputeStyle(damage/atom,ComputeDamageAtom); +// clang-format on #else #ifndef LMP_COMPUTE_DAMAGE_ATOM_H @@ -38,7 +38,7 @@ class ComputeDamageAtom : public Compute { int ifix_peri; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/compute_dilatation_atom.cpp b/src/PERI/compute_dilatation_atom.cpp index 9ea03acd04..492b192f3b 100644 --- a/src/PERI/compute_dilatation_atom.cpp +++ b/src/PERI/compute_dilatation_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PERI/compute_dilatation_atom.h b/src/PERI/compute_dilatation_atom.h index ead6a68189..ee675c0bb7 100644 --- a/src/PERI/compute_dilatation_atom.h +++ b/src/PERI/compute_dilatation_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(dilatation/atom,ComputeDilatationAtom) - +// clang-format off +ComputeStyle(dilatation/atom,ComputeDilatationAtom); +// clang-format on #else #ifndef LMP_COMPUTE_DILATATION_ATOM_H @@ -29,6 +29,7 @@ class ComputeDilatationAtom : public Compute { friend class PairPeriLPS; friend class PairPeriVES; friend class PairPeriEPS; + public: ComputeDilatationAtom(class LAMMPS *, int, char **); ~ComputeDilatationAtom(); @@ -39,10 +40,10 @@ class ComputeDilatationAtom : public Compute { private: int nmax; double *dilatation; - int isPMB,isLPS,isVES,isEPS; + int isPMB, isLPS, isVES, isEPS; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/compute_plasticity_atom.cpp b/src/PERI/compute_plasticity_atom.cpp index 829f10e327..74d4b298a7 100644 --- a/src/PERI/compute_plasticity_atom.cpp +++ b/src/PERI/compute_plasticity_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PERI/compute_plasticity_atom.h b/src/PERI/compute_plasticity_atom.h index 0022bf2215..b77182d251 100644 --- a/src/PERI/compute_plasticity_atom.h +++ b/src/PERI/compute_plasticity_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(plasticity/atom,ComputePlasticityAtom) - +// clang-format off +ComputeStyle(plasticity/atom,ComputePlasticityAtom); +// clang-format on #else #ifndef LMP_COMPUTE_PLASTICITY_ATOM_H @@ -38,7 +38,7 @@ class ComputePlasticityAtom : public Compute { int ifix_peri; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp index 99210bde5b..74b192b70f 100644 --- a/src/PERI/fix_peri_neigh.cpp +++ b/src/PERI/fix_peri_neigh.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PERI/fix_peri_neigh.h b/src/PERI/fix_peri_neigh.h index b72d666390..ac9784f6e6 100644 --- a/src/PERI/fix_peri_neigh.h +++ b/src/PERI/fix_peri_neigh.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(PERI_NEIGH,FixPeriNeigh) - +// clang-format off +FixStyle(PERI_NEIGH,FixPeriNeigh); +// clang-format on #else #ifndef LMP_FIX_PERI_NEIGH_H @@ -35,7 +35,7 @@ class FixPeriNeigh : public Fix { friend class ComputePlasticityAtom; public: - FixPeriNeigh(class LAMMPS *,int, char **); + FixPeriNeigh(class LAMMPS *, int, char **); virtual ~FixPeriNeigh(); int setmask(); void init(); @@ -57,27 +57,26 @@ class FixPeriNeigh : public Fix { int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); - protected: - int first; // flag for first time initialization - int maxpartner; // max # of peridynamic neighs for any atom - int *npartner; // # of neighbors for each atom - tagint **partner; // neighs for each atom, stored as global IDs - double **deviatorextention; // Deviatoric extension - double **deviatorBackextention; // Deviatoric back extension - double **deviatorPlasticextension; // Deviatoric plastic extension + int first; // flag for first time initialization + int maxpartner; // max # of peridynamic neighs for any atom + int *npartner; // # of neighbors for each atom + tagint **partner; // neighs for each atom, stored as global IDs + double **deviatorextention; // Deviatoric extension + double **deviatorBackextention; // Deviatoric back extension + double **deviatorPlasticextension; // Deviatoric plastic extension double *lambdaValue; - double **r0; // initial distance to partners - double **r1; // instanteneous distance to partners - double *thetaValue; // dilatation - double *vinter; // sum of vfrac for bonded neighbors - double *wvolume; // weighted volume of particle - int isPMB,isLPS,isVES,isEPS; // which flavor of PD + double **r0; // initial distance to partners + double **r1; // instanteneous distance to partners + double *thetaValue; // dilatation + double *vinter; // sum of vfrac for bonded neighbors + double *wvolume; // weighted volume of particle + int isPMB, isLPS, isVES, isEPS; // which flavor of PD class NeighList *list; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/pair_peri_eps.cpp b/src/PERI/pair_peri_eps.cpp index c7bc0a09ba..f6e99332b3 100644 --- a/src/PERI/pair_peri_eps.cpp +++ b/src/PERI/pair_peri_eps.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PERI/pair_peri_eps.h b/src/PERI/pair_peri_eps.h index 39e0a6c034..82d4c91ddb 100644 --- a/src/PERI/pair_peri_eps.h +++ b/src/PERI/pair_peri_eps.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(peri/eps,PairPeriEPS) - +// clang-format off +PairStyle(peri/eps,PairPeriEPS); +// clang-format on #else #ifndef LMP_PAIR_PERI_EPS_H @@ -53,7 +53,7 @@ class PairPeriEPS : public Pair { double **bulkmodulus; double **shearmodulus; double **s00, **alpha; - double **cut, **m_yieldstress; //NEW: **m_yieldstress + double **cut, **m_yieldstress; //NEW: **m_yieldstress double *s0_new; int nmax; @@ -61,7 +61,7 @@ class PairPeriEPS : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/pair_peri_lps.cpp b/src/PERI/pair_peri_lps.cpp index dd88e0b42b..5b725306b0 100644 --- a/src/PERI/pair_peri_lps.cpp +++ b/src/PERI/pair_peri_lps.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PERI/pair_peri_lps.h b/src/PERI/pair_peri_lps.h index 0cdaa93656..fb4647eb2f 100644 --- a/src/PERI/pair_peri_lps.h +++ b/src/PERI/pair_peri_lps.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(peri/lps,PairPeriLPS) - +// clang-format off +PairStyle(peri/lps,PairPeriLPS); +// clang-format on #else #ifndef LMP_PAIR_PERI_LPS_H @@ -51,7 +51,7 @@ class PairPeriLPS : public Pair { int ifix_peri; double **bulkmodulus; double **shearmodulus; - double **s00,**alpha; + double **s00, **alpha; double **cut; double *s0_new; @@ -60,7 +60,7 @@ class PairPeriLPS : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/pair_peri_pmb.cpp b/src/PERI/pair_peri_pmb.cpp index aeb977c999..49e8ce6218 100644 --- a/src/PERI/pair_peri_pmb.cpp +++ b/src/PERI/pair_peri_pmb.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PERI/pair_peri_pmb.h b/src/PERI/pair_peri_pmb.h index 543d87424e..cd65052dec 100644 --- a/src/PERI/pair_peri_pmb.h +++ b/src/PERI/pair_peri_pmb.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(peri/pmb,PairPeriPMB) - +// clang-format off +PairStyle(peri/pmb,PairPeriPMB); +// clang-format on #else #ifndef LMP_PAIR_PERI_PMB_H @@ -52,7 +52,7 @@ class PairPeriPMB : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/pair_peri_ves.cpp b/src/PERI/pair_peri_ves.cpp index 1814ae2970..ca8802396e 100644 --- a/src/PERI/pair_peri_ves.cpp +++ b/src/PERI/pair_peri_ves.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PERI/pair_peri_ves.h b/src/PERI/pair_peri_ves.h index 8e52027055..03659ae65d 100644 --- a/src/PERI/pair_peri_ves.h +++ b/src/PERI/pair_peri_ves.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(peri/ves,PairPeriVES) - +// clang-format off +PairStyle(peri/ves,PairPeriVES); +// clang-format on #else #ifndef LMP_PAIR_PERI_VES_H @@ -47,7 +47,6 @@ class PairPeriVES : public Pair { double influence_function(double, double, double); void compute_dilatation(); - protected: int ifix_peri; double **bulkmodulus; @@ -63,7 +62,7 @@ class PairPeriVES : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PLUGIN/plugin.cpp b/src/PLUGIN/plugin.cpp index 1650284747..78538be2ff 100644 --- a/src/PLUGIN/plugin.cpp +++ b/src/PLUGIN/plugin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PLUGIN/plugin.h b/src/PLUGIN/plugin.h index bc1d473c90..5f54a4dc58 100644 --- a/src/PLUGIN/plugin.h +++ b/src/PLUGIN/plugin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,37 +12,36 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(plugin,Plugin) - +// clang-format off +CommandStyle(plugin,Plugin); +// clang-format on #else #ifndef LMP_PLUGIN_H #define LMP_PLUGIN_H -#include "lammpsplugin.h" #include "command.h" +#include "lammpsplugin.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { - class Plugin : public Command { - public: - Plugin(class LAMMPS *); - void command(int, char **); - }; +class Plugin : public Command { + public: + Plugin(class LAMMPS *); + void command(int, char **); +}; - void plugin_load(const char *, LAMMPS *); - void plugin_register(lammpsplugin_t *, void *); +void plugin_load(const char *, LAMMPS *); +void plugin_register(lammpsplugin_t *, void *); - void plugin_unload(const char *, const char *, LAMMPS *); - void plugin_erase(const char *, const char *); - void plugin_clear(LAMMPS *); +void plugin_unload(const char *, const char *, LAMMPS *); +void plugin_erase(const char *, const char *); +void plugin_clear(LAMMPS *); - int plugin_get_num_plugins(); - int plugin_find(const char *, const char *); - const lammpsplugin_t *plugin_get_info(int); -} +int plugin_get_num_plugins(); +int plugin_find(const char *, const char *); +const lammpsplugin_t *plugin_get_info(int); +} // namespace LAMMPS_NS #endif #endif diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index 0514ee5078..fdd8ef7a18 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/POEMS/fix_poems.h b/src/POEMS/fix_poems.h index 30f6c775d7..537dbdd1b1 100644 --- a/src/POEMS/fix_poems.h +++ b/src/POEMS/fix_poems.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(poems,FixPOEMS) - +// clang-format off +FixStyle(poems,FixPOEMS); +// clang-format on #else #ifndef LMP_FIX_POEMS_H @@ -26,7 +26,7 @@ class Workspace; namespace LAMMPS_NS { -class FixPOEMS : public Fix { +class FixPOEMS : public Fix { public: FixPOEMS(class LAMMPS *, int narg, char **arg); ~FixPOEMS(); @@ -54,7 +54,7 @@ class FixPOEMS : public Fix { private: int me; - double dtv,dtf,dthalf; + double dtv, dtf, dthalf; double *step_respa; int nlevels_respa; double total_ke; @@ -63,36 +63,36 @@ class FixPOEMS : public Fix { // atom assignment to rigid bodies // double count joint atoms as being in multiple bodies - int *natom2body; // # of bodies each atom is part of - int **atom2body; // list of bodies each atom is part of - double **displace; // atom displace in body coords for 1st body it's in + int *natom2body; // # of bodies each atom is part of + int **atom2body; // list of bodies each atom is part of + double **displace; // atom displace in body coords for 1st body it's in // rigid body properties // only nrigid double counts joint atoms as being in multiple bodies // other quantities only count a joint atom as being in 1st body - int nbody; // # of rigid bodies - int *nrigid; // # of atoms in each rigid body - double *masstotal; // total mass of each rigid body - double **xcm; // coords of center-of-mass of each rigid body - double **vcm; // velocity of center-of-mass of each - double **fcm; // force on center-of-mass of each - double **inertia; // 6 inertia components of each (xx,yy,zz,xy,yz,xz) - double **ex_space,**ey_space,**ez_space; - // orientation of each body in space coords - double **angmom; // angular momentum of each in space coords - double **omega; // angular velocity of each in space coords - double **torque; // torque on each rigid body in space coords - double **sum,**all; // work vectors + int nbody; // # of rigid bodies + int *nrigid; // # of atoms in each rigid body + double *masstotal; // total mass of each rigid body + double **xcm; // coords of center-of-mass of each rigid body + double **vcm; // velocity of center-of-mass of each + double **fcm; // force on center-of-mass of each + double **inertia; // 6 inertia components of each (xx,yy,zz,xy,yz,xz) + double **ex_space, **ey_space, **ez_space; + // orientation of each body in space coords + double **angmom; // angular momentum of each in space coords + double **omega; // angular velocity of each in space coords + double **torque; // torque on each rigid body in space coords + double **sum, **all; // work vectors // joint attributes between pairs of rigid bodies - int ncluster; // # of independent clusters of coupled bodies - int njoint; // # of interbody joints - int **jointbody; // indices of 2 rigid bodies in each joint (1-N) - double **xjoint; // coords of each joint point - int nfree; // # of isolated unconnected bodies - int *freelist; // indices of isolated bodies (1-N) + int ncluster; // # of independent clusters of coupled bodies + int njoint; // # of interbody joints + int **jointbody; // indices of 2 rigid bodies in each joint (1-N) + double **xjoint; // coords of each joint point + int nfree; // # of isolated unconnected bodies + int *freelist; // indices of isolated bodies (1-N) // POEMS object @@ -106,13 +106,12 @@ class FixPOEMS : public Fix { void jointbuild(); void sortlist(int, tagint **); int loopcheck(int, int, tagint **); - void omega_from_mq(double *, double *, double *, double *, - double *, double *); + void omega_from_mq(double *, double *, double *, double *, double *, double *); void set_v(); void set_xv(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PYTHON/fix_python_invoke.cpp b/src/PYTHON/fix_python_invoke.cpp index 82baef909b..15242d4868 100644 --- a/src/PYTHON/fix_python_invoke.cpp +++ b/src/PYTHON/fix_python_invoke.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PYTHON/fix_python_invoke.h b/src/PYTHON/fix_python_invoke.h index 63cdaea8de..a60b6e5f69 100644 --- a/src/PYTHON/fix_python_invoke.h +++ b/src/PYTHON/fix_python_invoke.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,16 +12,15 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(python/invoke,FixPythonInvoke) -FixStyle(python,FixPythonInvoke) - +// clang-format off +FixStyle(python/invoke,FixPythonInvoke); +FixStyle(python,FixPythonInvoke); +// clang-format on #else #ifndef LMP_FIX_PYTHON_INVOKE_H #define LMP_FIX_PYTHON_INVOKE_H - #include "fix.h" namespace LAMMPS_NS { @@ -35,12 +34,12 @@ class FixPythonInvoke : public Fix { virtual void post_force(int); private: - void * lmpPtr; - void * pFunc; + void *lmpPtr; + void *pFunc; int selected_callback; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PYTHON/fix_python_move.cpp b/src/PYTHON/fix_python_move.cpp index 8ec2e1b74d..72b61a834c 100644 --- a/src/PYTHON/fix_python_move.cpp +++ b/src/PYTHON/fix_python_move.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PYTHON/fix_python_move.h b/src/PYTHON/fix_python_move.h index e1257e8fe5..fa2a275579 100644 --- a/src/PYTHON/fix_python_move.h +++ b/src/PYTHON/fix_python_move.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,9 +22,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(python/move,FixPythonMove) - +// clang-format off +FixStyle(python/move,FixPythonMove); +// clang-format on #else #ifndef LMP_FIX_PYTHON_MOVE_H @@ -48,10 +48,10 @@ class FixPythonMove : public Fix { virtual void reset_dt(); protected: - void * py_move; + void *py_move; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PYTHON/pair_python.cpp b/src/PYTHON/pair_python.cpp index adf7e2bb49..2cffcb8b05 100644 --- a/src/PYTHON/pair_python.cpp +++ b/src/PYTHON/pair_python.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PYTHON/pair_python.h b/src/PYTHON/pair_python.h index 1ca290f4a1..bb202b8cc5 100644 --- a/src/PYTHON/pair_python.h +++ b/src/PYTHON/pair_python.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,9 +22,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(python,PairPython) - +// clang-format off +PairStyle(python,PairPython); +// clang-format on #else #ifndef LMP_PAIR_PYTHON_H @@ -46,14 +46,14 @@ class PairPython : public Pair { protected: double cut_global; - void * py_potential; - int * skip_types; + void *py_potential; + int *skip_types; virtual void allocate(); - void * get_member_function(const char *); + void *get_member_function(const char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PYTHON/python_compat.h b/src/PYTHON/python_compat.h index 9263cd3e95..98aec37d37 100644 --- a/src/PYTHON/python_compat.h +++ b/src/PYTHON/python_compat.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,15 +18,31 @@ // Wrap API changes between Python 2 and 3 using macros #if PY_MAJOR_VERSION == 2 +#if defined(_MSC_VER) || defined(__MINGW32__) +#define PY_INT_FROM_LONG(X) PyLong_FromLongLong(X) +#else #define PY_INT_FROM_LONG(X) PyInt_FromLong(X) +#endif +#if defined(_MSC_VER) || defined(__MINGW32__) +#define PY_INT_AS_LONG(X) PyLong_AsLongLong(X) +#else #define PY_INT_AS_LONG(X) PyInt_AsLong(X) +#endif #define PY_STRING_FROM_STRING(X) PyString_FromString(X) #define PY_VOID_POINTER(X) PyCObject_FromVoidPtr((void *) X, nullptr) #define PY_STRING_AS_STRING(X) PyString_AsString(X) #elif PY_MAJOR_VERSION == 3 +#if defined(_MSC_VER) || defined(__MINGW32__) +#define PY_INT_FROM_LONG(X) PyLong_FromLongLong(X) +#else #define PY_INT_FROM_LONG(X) PyLong_FromLong(X) +#endif +#if defined(_MSC_VER) || defined(__MINGW32__) +#define PY_INT_AS_LONG(X) PyLong_AsLongLong(X) +#else #define PY_INT_AS_LONG(X) PyLong_AsLong(X) +#endif #define PY_STRING_FROM_STRING(X) PyUnicode_FromString(X) #define PY_VOID_POINTER(X) PyCapsule_New((void *) X, nullptr, nullptr) #define PY_STRING_AS_STRING(X) PyUnicode_AsUTF8(X) diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index e2484f62f7..793fedf00e 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/PYTHON/python_impl.h b/src/PYTHON/python_impl.h index c031eb236c..0190e8d7c2 100644 --- a/src/PYTHON/python_impl.h +++ b/src/PYTHON/python_impl.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,8 +14,8 @@ #ifndef LMP_PYTHON_IMPL_H #define LMP_PYTHON_IMPL_H -#include "pointers.h" #include "lmppython.h" +#include "pointers.h" namespace LAMMPS_NS { @@ -35,15 +35,15 @@ class PythonImpl : protected Pointers, public PythonInterface { bool has_minimum_version(int major, int minor); private: - int ninput,noutput,length_longstr; + int ninput, noutput, length_longstr; char **istr; - char *ostr,*format; + char *ostr, *format; void *pyMain; struct PyFunc { char *name; - int ninput,noutput; - int *itype,*ivarflag; + int ninput, noutput; + int *itype, *ivarflag; int *ivalue; double *dvalue; char **svalue; @@ -61,7 +61,7 @@ class PythonImpl : protected Pointers, public PythonInterface { void deallocate(int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/PYTHON/python_utils.h b/src/PYTHON/python_utils.h index 45dd58456c..bc801447a2 100644 --- a/src/PYTHON/python_utils.h +++ b/src/PYTHON/python_utils.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,23 +20,22 @@ namespace LAMMPS_NS { namespace PyUtils { -class GIL { - PyGILState_STATE gstate; -public: - GIL() : gstate(PyGILState_Ensure()) { + class GIL { + PyGILState_STATE gstate; + + public: + GIL() : gstate(PyGILState_Ensure()) {} + ~GIL() { PyGILState_Release(gstate); } + }; + + static void Print_Errors() + { + PyErr_Print(); + PyErr_Clear(); } - ~GIL() { - PyGILState_Release(gstate); - } -}; -static void Print_Errors() { - PyErr_Print(); - PyErr_Clear(); -} +} // namespace PyUtils -} - -} +} // namespace LAMMPS_NS #endif diff --git a/src/Purge.list b/src/Purge.list index 2853ce2a7c..88d9e22e59 100644 --- a/src/Purge.list +++ b/src/Purge.list @@ -51,6 +51,11 @@ lmpinstalledpkgs.h lmpgitversion.h mliap_model_python_couple.cpp mliap_model_python_couple.h +# removed on 14 May 2021 +nstencil_half_bin_2d_newton_ssa.cpp +nstencil_half_bin_2d_newton_ssa.h +nstencil_half_bin_3d_newton_ssa.cpp +nstencil_half_bin_3d_newton_ssa.h # removed on 9 Sep 2020 mergesort.h # renamed on 8 May 2020 diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index bca2914b82..8f7baa23be 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/QEQ/fix_qeq.h b/src/QEQ/fix_qeq.h index 1ec9df5932..add2c9996d 100644 --- a/src/QEQ/fix_qeq.h +++ b/src/QEQ/fix_qeq.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -17,10 +17,10 @@ #include "fix.h" #define EV_TO_KCAL_PER_MOL 14.4 -#define DANGER_ZONE 0.90 -#define MIN_CAP 50 -#define SAFE_ZONE 1.2 -#define MIN_NBRS 100 +#define DANGER_ZONE 0.90 +#define MIN_CAP 50 +#define SAFE_ZONE 1.2 +#define MIN_NBRS 100 namespace LAMMPS_NS { @@ -29,7 +29,7 @@ class FixQEq : public Fix { FixQEq(class LAMMPS *, int, char **); ~FixQEq(); int setmask(); - void init_list(int,class NeighList *); + void init_list(int, class NeighList *); void setup_pre_force(int); void setup_pre_force_respa(int, int); void pre_force_respa(int, int, int); @@ -61,13 +61,13 @@ class FixQEq : public Fix { int matvecs; double qeq_time; - double swa, swb; // lower/upper Taper cutoff radius - double Tap[8]; // Taper function - double tolerance; // tolerance for the norm of the rel residual in CG - int maxiter; // maximum number of QEq iterations - double cutoff, cutoff_sq; // neighbor cutoff + double swa, swb; // lower/upper Taper cutoff radius + double Tap[8]; // Taper function + double tolerance; // tolerance for the norm of the rel residual in CG + int maxiter; // maximum number of QEq iterations + double cutoff, cutoff_sq; // neighbor cutoff - double *chi,*eta,*gamma,*zeta,*zcore; // qeq parameters + double *chi, *eta, *gamma, *zeta, *zcore; // qeq parameters double *chizj; double **shld; int streitz_flag, reax_flag; @@ -80,7 +80,7 @@ class FixQEq : public Fix { double **s_hist, **t_hist; int nprev; - typedef struct{ + typedef struct { int n, m; int *firstnbr; int *numnbrs; @@ -106,15 +106,15 @@ class FixQEq : public Fix { void calculate_Q(); - double parallel_norm(double*, int); - double parallel_dot(double*, double*, int); - double parallel_vector_acc(double*, int); + double parallel_norm(double *, int); + double parallel_dot(double *, double *, int); + double parallel_vector_acc(double *, int); - void vector_sum(double *, double, double *, double, double *,int); + void vector_sum(double *, double, double *, double, double *, int); void vector_add(double *, double, double *, int); void init_storage(); - void read_file(char*); + void read_file(char *); void allocate_storage(); void deallocate_storage(); void reallocate_storage(); @@ -123,10 +123,10 @@ class FixQEq : public Fix { void reallocate_matrix(); virtual int CG(double *, double *); - virtual void sparse_matvec(sparse_matrix *, double *,double *); + virtual void sparse_matvec(sparse_matrix *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/QEQ/fix_qeq_dynamic.cpp b/src/QEQ/fix_qeq_dynamic.cpp index 84ad081cdc..679739bb9c 100644 --- a/src/QEQ/fix_qeq_dynamic.cpp +++ b/src/QEQ/fix_qeq_dynamic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/QEQ/fix_qeq_dynamic.h b/src/QEQ/fix_qeq_dynamic.h index 36bd448065..2ae4ea907b 100644 --- a/src/QEQ/fix_qeq_dynamic.h +++ b/src/QEQ/fix_qeq_dynamic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(qeq/dynamic,FixQEqDynamic) - +// clang-format off +FixStyle(qeq/dynamic,FixQEqDynamic); +// clang-format on #else #ifndef LMP_FIX_QEQ_DYNAMIC_H @@ -40,7 +40,7 @@ class FixQEqDynamic : public FixQEq { double compute_eneg(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/QEQ/fix_qeq_fire.cpp b/src/QEQ/fix_qeq_fire.cpp index 3860e775d4..1bc0ba32ea 100644 --- a/src/QEQ/fix_qeq_fire.cpp +++ b/src/QEQ/fix_qeq_fire.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/QEQ/fix_qeq_fire.h b/src/QEQ/fix_qeq_fire.h index 26663e5a45..fb910129dc 100644 --- a/src/QEQ/fix_qeq_fire.h +++ b/src/QEQ/fix_qeq_fire.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(qeq/fire,FixQEqFire) - +// clang-format off +FixStyle(qeq/fire,FixQEqFire); +// clang-format on #else #ifndef LMP_FIX_QEQ_FIRE_H @@ -43,7 +43,7 @@ class FixQEqFire : public FixQEq { class PairComb3 *comb3; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/QEQ/fix_qeq_point.cpp b/src/QEQ/fix_qeq_point.cpp index 4ef24e6a97..f94eba1a77 100644 --- a/src/QEQ/fix_qeq_point.cpp +++ b/src/QEQ/fix_qeq_point.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/QEQ/fix_qeq_point.h b/src/QEQ/fix_qeq_point.h index 323a2ba489..a680a9416d 100644 --- a/src/QEQ/fix_qeq_point.h +++ b/src/QEQ/fix_qeq_point.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(qeq/point,FixQEqPoint) - +// clang-format off +FixStyle(qeq/point,FixQEqPoint); +// clang-format on #else #ifndef LMP_FIX_QEQ_POINT_H @@ -34,9 +34,8 @@ class FixQEqPoint : public FixQEq { private: void init_matvec(); void compute_H(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/QEQ/fix_qeq_shielded.cpp b/src/QEQ/fix_qeq_shielded.cpp index df720bc490..355d0fb0d3 100644 --- a/src/QEQ/fix_qeq_shielded.cpp +++ b/src/QEQ/fix_qeq_shielded.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/QEQ/fix_qeq_shielded.h b/src/QEQ/fix_qeq_shielded.h index a9524fa382..4d8d3c1395 100644 --- a/src/QEQ/fix_qeq_shielded.h +++ b/src/QEQ/fix_qeq_shielded.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(qeq/shielded,FixQEqShielded) - +// clang-format off +FixStyle(qeq/shielded,FixQEqShielded); +// clang-format on #else #ifndef LMP_FIX_QEQ_SHIELDED_H @@ -36,10 +36,9 @@ class FixQEqShielded : public FixQEq { void init_shielding(); void init_matvec(); void compute_H(); - double calculate_H(double,double); - + double calculate_H(double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/QEQ/fix_qeq_slater.cpp b/src/QEQ/fix_qeq_slater.cpp index 73f7cdf879..3426595c0d 100644 --- a/src/QEQ/fix_qeq_slater.cpp +++ b/src/QEQ/fix_qeq_slater.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/QEQ/fix_qeq_slater.h b/src/QEQ/fix_qeq_slater.h index 9e9a9bbd67..3247b0ddd6 100644 --- a/src/QEQ/fix_qeq_slater.h +++ b/src/QEQ/fix_qeq_slater.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(qeq/slater,FixQEqSlater) - +// clang-format off +FixStyle(qeq/slater,FixQEqSlater); +// clang-format on #else #ifndef LMP_FIX_QEQ_SLATER_H @@ -33,7 +33,7 @@ class FixQEqSlater : public FixQEq { private: void init_matvec(); - void sparse_matvec(sparse_matrix*,double*,double*); + void sparse_matvec(sparse_matrix *, double *, double *); void compute_H(); double calculate_H(double, double, double, double, double &); double calculate_H_wolf(double, double, double, double, double &); @@ -41,7 +41,7 @@ class FixQEqSlater : public FixQEq { class PairCoulStreitz *streitz; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/compute_event_displace.cpp b/src/REPLICA/compute_event_displace.cpp index 0ef14b8603..cfb6307e63 100644 --- a/src/REPLICA/compute_event_displace.cpp +++ b/src/REPLICA/compute_event_displace.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/compute_event_displace.h b/src/REPLICA/compute_event_displace.h index 269eef438a..c8c4c8810d 100644 --- a/src/REPLICA/compute_event_displace.h +++ b/src/REPLICA/compute_event_displace.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(event/displace,ComputeEventDisplace) - +// clang-format off +ComputeStyle(event/displace,ComputeEventDisplace); +// clang-format on #else #ifndef LMP_COMPUTE_EVENT_DISPLACE_H @@ -34,7 +34,6 @@ class ComputeEventDisplace : public Compute { int all_events(); void reset_extra_compute_fix(const char *); - private: int triclinic; double displace_distsq; @@ -42,7 +41,7 @@ class ComputeEventDisplace : public Compute { class FixEvent *fix_event; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/fix_event.cpp b/src/REPLICA/fix_event.cpp index 8862030b7e..2f4f44d46f 100644 --- a/src/REPLICA/fix_event.cpp +++ b/src/REPLICA/fix_event.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/fix_event.h b/src/REPLICA/fix_event.h index 96a6626477..963b505c85 100644 --- a/src/REPLICA/fix_event.h +++ b/src/REPLICA/fix_event.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class FixEvent : public Fix { public: FixEvent(class LAMMPS *, int, char **); - virtual ~FixEvent()=0; // use destructor to make base class virtual + virtual ~FixEvent() = 0; // use destructor to make base class virtual int setmask(); double memory_usage(); @@ -42,16 +42,16 @@ class FixEvent : public Fix { void restore_state_dephase(); // restore atoms if dephase had event private: - double **xevent; // atom coords at last event - double **xold; // atom coords for reset/restore - double **vold; // atom vels for reset/restore - imageint *imageold; // image flags for reset/restore - double **xorig; // original atom coords for reset/restore - double **vorig; // original atom vels for reset/restore - imageint *imageorig; // original image flags for reset/restore + double **xevent; // atom coords at last event + double **xold; // atom coords for reset/restore + double **vold; // atom vels for reset/restore + imageint *imageold; // image flags for reset/restore + double **xorig; // original atom coords for reset/restore + double **vorig; // original atom vels for reset/restore + imageint *imageorig; // original image flags for reset/restore }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/REPLICA/fix_event_hyper.cpp b/src/REPLICA/fix_event_hyper.cpp index 5b9c0f48eb..5f68506db5 100644 --- a/src/REPLICA/fix_event_hyper.cpp +++ b/src/REPLICA/fix_event_hyper.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/fix_event_hyper.h b/src/REPLICA/fix_event_hyper.h index 9a04a30bed..b86e448775 100644 --- a/src/REPLICA/fix_event_hyper.h +++ b/src/REPLICA/fix_event_hyper.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(EVENT/HYPER,FixEventHyper) - +// clang-format off +FixStyle(EVENT/HYPER,FixEventHyper); +// clang-format on #else #ifndef LMP_FIX_EVENT_HYPER_H @@ -26,12 +26,12 @@ namespace LAMMPS_NS { class FixEventHyper : public FixEvent { public: - int event_number; // event counter - bigint event_timestep; // timestep of last event on any replica - bigint clock; // total elapsed timesteps across all replicas - int replica_number; // replica where last event occurred - int correlated_event; // 1 if last event was correlated, 0 otherwise - int ncoincident; // # of simultaneous events on different replicas + int event_number; // event counter + bigint event_timestep; // timestep of last event on any replica + bigint clock; // total elapsed timesteps across all replicas + int replica_number; // replica where last event occurred + int correlated_event; // 1 if last event was correlated, 0 otherwise + int ncoincident; // # of simultaneous events on different replicas FixEventHyper(class LAMMPS *, int, char **); ~FixEventHyper() {} @@ -44,7 +44,7 @@ class FixEventHyper : public FixEvent { void store_event_hyper(bigint, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/fix_event_prd.cpp b/src/REPLICA/fix_event_prd.cpp index 4922a1a3b1..3256d01923 100644 --- a/src/REPLICA/fix_event_prd.cpp +++ b/src/REPLICA/fix_event_prd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/fix_event_prd.h b/src/REPLICA/fix_event_prd.h index 2f28c62dd4..a5ed2418da 100644 --- a/src/REPLICA/fix_event_prd.h +++ b/src/REPLICA/fix_event_prd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(EVENT/PRD,FixEventPRD) - +// clang-format off +FixStyle(EVENT/PRD,FixEventPRD); +// clang-format on #else #ifndef LMP_FIX_EVENT_PRD_H @@ -26,12 +26,12 @@ namespace LAMMPS_NS { class FixEventPRD : public FixEvent { public: - int event_number; // event counter - bigint event_timestep; // timestep of last event on any replica - bigint clock; // total elapsed timesteps across all replicas - int replica_number; // replica where last event occurred - int correlated_event; // 1 if last event was correlated, 0 otherwise - int ncoincident; // # of simultaneous events on different replicas + int event_number; // event counter + bigint event_timestep; // timestep of last event on any replica + bigint clock; // total elapsed timesteps across all replicas + int replica_number; // replica where last event occurred + int correlated_event; // 1 if last event was correlated, 0 otherwise + int ncoincident; // # of simultaneous events on different replicas FixEventPRD(class LAMMPS *, int, char **); ~FixEventPRD() {} @@ -44,10 +44,9 @@ class FixEventPRD : public FixEvent { void store_event_prd(bigint, int); private: - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/fix_event_tad.cpp b/src/REPLICA/fix_event_tad.cpp index 723938f739..f51401fae1 100644 --- a/src/REPLICA/fix_event_tad.cpp +++ b/src/REPLICA/fix_event_tad.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/fix_event_tad.h b/src/REPLICA/fix_event_tad.h index e1e976a0ba..88f27c20e9 100644 --- a/src/REPLICA/fix_event_tad.h +++ b/src/REPLICA/fix_event_tad.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(EVENT/TAD,FixEventTAD) - +// clang-format off +FixStyle(EVENT/TAD,FixEventTAD); +// clang-format on #else #ifndef LMP_FIX_EVENT_TAD_H @@ -26,10 +26,10 @@ namespace LAMMPS_NS { class FixEventTAD : public FixEvent { public: - int event_number; // event counter - bigint event_timestep; // timestep of last event - double tlo; // event time at low temperature - double ebarrier; // energy barrier for this event + int event_number; // event counter + bigint event_timestep; // timestep of last event + double tlo; // event time at low temperature + double ebarrier; // energy barrier for this event FixEventTAD(class LAMMPS *, int, char **); ~FixEventTAD() {} @@ -42,10 +42,9 @@ class FixEventTAD : public FixEvent { void store_event_tad(bigint); private: - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/fix_hyper.cpp b/src/REPLICA/fix_hyper.cpp index a6b6c4ad43..dc458dd3c6 100644 --- a/src/REPLICA/fix_hyper.cpp +++ b/src/REPLICA/fix_hyper.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/fix_hyper.h b/src/REPLICA/fix_hyper.h index e2ae205649..64552b18c6 100644 --- a/src/REPLICA/fix_hyper.h +++ b/src/REPLICA/fix_hyper.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -36,7 +36,7 @@ class FixHyper : public Fix { int hyperflag; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/REPLICA/fix_hyper_global.cpp b/src/REPLICA/fix_hyper_global.cpp index ebd07ae55f..bd96897a9e 100644 --- a/src/REPLICA/fix_hyper_global.cpp +++ b/src/REPLICA/fix_hyper_global.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/fix_hyper_global.h b/src/REPLICA/fix_hyper_global.h index 8f7620ca66..4b9f2886cd 100644 --- a/src/REPLICA/fix_hyper_global.h +++ b/src/REPLICA/fix_hyper_global.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(hyper/global,FixHyperGlobal) - +// clang-format off +FixStyle(hyper/global,FixHyperGlobal); +// clang-format on #else #ifndef LMP_FIX_HYPER_GLOBAL_H @@ -48,43 +48,43 @@ class FixHyperGlobal : public FixHyper { private: int me; - double cutbond,qfactor,vmax,tequil; + double cutbond, qfactor, vmax, tequil; - int firstflag,bcastflag,owner,nevent,nevent_atom; - double cutbondsq,beta,dt,t_hyper,invqfactorsq; - double outvec[5]; // same as VECLEN in *.cpp - double maxbondlen; // max length of any bond - double maxdriftsq; // max distance any atom drifts from original pos - int nobias; // # of steps when bias = 0, b/c bond too long - int negstrain; // # of steps when biased bond has negative strain - bigint groupatoms; // # of atoms in fix group + int firstflag, bcastflag, owner, nevent, nevent_atom; + double cutbondsq, beta, dt, t_hyper, invqfactorsq; + double outvec[5]; // same as VECLEN in *.cpp + double maxbondlen; // max length of any bond + double maxdriftsq; // max distance any atom drifts from original pos + int nobias; // # of steps when bias = 0, b/c bond too long + int negstrain; // # of steps when biased bond has negative strain + bigint groupatoms; // # of atoms in fix group class NeighList *list; // list of my owned bonds // persists on a proc from one event until the next - int maxbond; // allocated size of blist + int maxbond; // allocated size of blist - struct OneBond { // single IJ bond, atom I is owner - int i,j; // current local indices of 2 bond atoms - int iold,jold; // local indices when bonds were formed - double r0; // relaxed bond length + struct OneBond { // single IJ bond, atom I is owner + int i, j; // current local indices of 2 bond atoms + int iold, jold; // local indices when bonds were formed + double r0; // relaxed bond length }; - OneBond *blist; // list of owned bonds - int nblocal; // # of owned bonds + OneBond *blist; // list of owned bonds + int nblocal; // # of owned bonds // coords and IDs of owned+ghost atoms when bonds were formed // persists on a proc from one event until the next - int nlocal_old; // nlocal for old atoms - int nall_old; // nlocal+nghost for old atoms - int maxold; // allocated size of old atoms + int nlocal_old; // nlocal for old atoms + int nall_old; // nlocal+nghost for old atoms + int maxold; // allocated size of old atoms - double **xold; // coords of atoms when bonds were formed - tagint *tagold; // IDs of atoms when bonds were forme - int *old2now; // o2n[i] = current local index of old atom I + double **xold; // coords of atoms when bonds were formed + tagint *tagold; // IDs of atoms when bonds were forme + int *old2now; // o2n[i] = current local index of old atom I // MPI data struct for finding bond with max strain via Allreduce @@ -92,14 +92,14 @@ class FixHyperGlobal : public FixHyper { double value; int proc; }; - Two pairme,pairall; + Two pairme, pairall; // internal methods void grow_bond(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index e4cc61f77f..4a477fad8d 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/fix_hyper_local.h b/src/REPLICA/fix_hyper_local.h index 4085a82de4..91a594fc64 100644 --- a/src/REPLICA/fix_hyper_local.h +++ b/src/REPLICA/fix_hyper_local.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(hyper/local,FixHyperLocal) - +// clang-format off +FixStyle(hyper/local,FixHyperLocal); +// clang-format on #else #ifndef LMP_FIX_HYPER_LOCAL_H @@ -23,8 +23,8 @@ FixStyle(hyper/local,FixHyperLocal) #include "fix_hyper.h" namespace LAMMPS_NS { - // forward declaration. struct HyperOneCoeff is defined in my_page.h - struct HyperOneCoeff; +// forward declaration. struct HyperOneCoeff is defined in my_page.h +struct HyperOneCoeff; class FixHyperLocal : public FixHyper { public: @@ -60,19 +60,19 @@ class FixHyperLocal : public FixHyper { // inputs and derived quantities - double cutbond,qfactor,vmax,tequil,dcut; - double alpha_user; // timescale to apply boostostat (time units) - double alpha; // unitless dt/alpha_user - double boost_target; // target value of boost - int checkghost,checkbias; // flags for optional stats + double cutbond, qfactor, vmax, tequil, dcut; + double alpha_user; // timescale to apply boostostat (time units) + double alpha; // unitless dt/alpha_user + double boost_target; // target value of boost + int checkghost, checkbias; // flags for optional stats int checkbias_every; int checkbias_flag; - int boundflag,resetfreq; // bias coeff bounding and reset settings + int boundflag, resetfreq; // bias coeff bounding and reset settings double boundfrac; - bigint groupatoms; // # of atoms in fix group - double cutbondsq,dcutsq; - double beta,invvmax,invqfactorsq; + bigint groupatoms; // # of atoms in fix group + double cutbondsq, dcutsq; + double beta, invvmax, invqfactorsq; // two DEBUG quantities // double myboost; @@ -80,95 +80,95 @@ class FixHyperLocal : public FixHyper { // flags - int setupflag; // 1 during setup, 0 during run - int firstflag; // set for first time bond_build takes place - int nostrainyet; // 1 until maxstrain is first compute - bigint starttime; // timestep when this fix was invoked - int commflag; // flag for communication mode + int setupflag; // 1 during setup, 0 during run + int firstflag; // set for first time bond_build takes place + int nostrainyet; // 1 until maxstrain is first compute + bigint starttime; // timestep when this fix was invoked + int commflag; // flag for communication mode // bias coeff bounds and reset - double bound_lower,bound_upper; + double bound_lower, bound_upper; bigint lastreset; // stats - int nbondbuild; // # of rebuilds of bond list - double time_bondbuild; // CPU time for bond builds + int nbondbuild; // # of rebuilds of bond list + double time_bondbuild; // CPU time for bond builds - bigint allbonds; // current total # of bonds - int maxbondperatom; // max # of bonds any atom ever has - int nevent; // # of events that trigger bond rebuild - int nevent_atom; // # of atoms that experienced an event + bigint allbonds; // current total # of bonds + int maxbondperatom; // max # of bonds any atom ever has + int nevent; // # of events that trigger bond rebuild + int nevent_atom; // # of atoms that experienced an event - bigint nnewbond; // running tally of # of new bonds created - bigint nbias_running; // running count of biased bonds - bigint nobias_running; // ditto for bonds with bias = 0, b/c too long - bigint negstrain_running; // ditto for bonds with negative strain + bigint nnewbond; // running tally of # of new bonds created + bigint nbias_running; // running count of biased bonds + bigint nobias_running; // ditto for bonds with bias = 0, b/c too long + bigint negstrain_running; // ditto for bonds with negative strain - double mybias; // sum of bias potentials for biased bonds - double maxbondlen; // cummulative max length of any bond - double maxdriftsq; // max distance any bond atom drifts from quenched x + double mybias; // sum of bias potentials for biased bonds + double maxbondlen; // cummulative max length of any bond + double maxdriftsq; // max distance any bond atom drifts from quenched x - double sumboost; // sum of all bond boosts at each timestep - double aveboost_running; // cummulative sumboost/allbonds across steps - double aveboost_running_output; // most recent output of ab_running - double sumbiascoeff; // sum of all bond bias coeffs at each timestep - double avebiascoeff_running; // cummulative sumbiascoeff/allbonds across steps - double avebiascoeff_running_output; // most recent output of abc_running - double minbiascoeff; // min bias coeff on this step for my bonds - double maxbiascoeff; // max bias coeff on this step for my bonds - double minbiascoeff_running; // cummulative min bias coeff for any bond - double maxbiascoeff_running; // cummulative max bias coeff for any bond + double sumboost; // sum of all bond boosts at each timestep + double aveboost_running; // cummulative sumboost/allbonds across steps + double aveboost_running_output; // most recent output of ab_running + double sumbiascoeff; // sum of all bond bias coeffs at each timestep + double avebiascoeff_running; // cummulative sumbiascoeff/allbonds across steps + double avebiascoeff_running_output; // most recent output of abc_running + double minbiascoeff; // min bias coeff on this step for my bonds + double maxbiascoeff; // max bias coeff on this step for my bonds + double minbiascoeff_running; // cummulative min bias coeff for any bond + double maxbiascoeff_running; // cummulative max bias coeff for any bond - double rmaxever,rmaxeverbig; - int ghost_toofar; // # of ghost atoms not found in Dcut neigh list - int checkbias_count; // count of too-close biased bonds + double rmaxever, rmaxeverbig; + int ghost_toofar; // # of ghost atoms not found in Dcut neigh list + int checkbias_count; // count of too-close biased bonds // 2 neighbor lists - class NeighList *listfull; // full neigh list up to Dcut distance - class NeighList *listhalf; // half neigh list up to pair distance - // both created only when bonds are rebuilt + class NeighList *listfull; // full neigh list up to Dcut distance + class NeighList *listhalf; // half neigh list up to pair distance + // both created only when bonds are rebuilt // list of my owned bonds and bias coeffs // persists on a proc from one event until the next - struct OneBond { // single IJ bond, atom I is owner - int i,j; // current local indices of 2 bond atoms - int iold,jold; // local indices when bonds were formed - double r0; // relaxed bond length + struct OneBond { // single IJ bond, atom I is owner + int i, j; // current local indices of 2 bond atoms + int iold, jold; // local indices when bonds were formed + double r0; // relaxed bond length }; - OneBond *blist; // list of owned bonds - double *biascoeff; // bias coefficient Cij for each bond - int nblocal; // # of owned bonds - int maxbond; // allocated size of blist + OneBond *blist; // list of owned bonds + double *biascoeff; // bias coefficient Cij for each bond + int nblocal; // # of owned bonds + int maxbond; // allocated size of blist // old data from last timestep bonds were formed // persists on a proc from one event until the next // first set of vectors are maxlocal in length // second set of vectors are maxall in length - int nlocal_old; // nlocal for old atoms - int nall_old; // nlocal+nghost for old atoms - int maxlocal; // allocated size of old local atom vecs - int maxall; // allocated size of old all atom vecs + int nlocal_old; // nlocal for old atoms + int nall_old; // nlocal+nghost for old atoms + int maxlocal; // allocated size of old local atom vecs + int maxall; // allocated size of old all atom vecs - int *numbond; // # of bonds owned by old owned atoms - int *maxhalf; // bond index for maxstrain bond of old atoms - int *eligible; // 0/1 flag for bias on one of old atom's bonds - double *maxhalfstrain; // strain value for maxstrain bond of old atoms + int *numbond; // # of bonds owned by old owned atoms + int *maxhalf; // bond index for maxstrain bond of old atoms + int *eligible; // 0/1 flag for bias on one of old atom's bonds + double *maxhalfstrain; // strain value for maxstrain bond of old atoms - int *old2now; // o2n[i] = current local index of old atom I - // may be -1 if ghost atom has drifted - tagint *tagold; // IDs of atoms when bonds were formed - // 0 if a ghost atom is not in Dcut neigh list - double **xold; // coords of atoms when bonds were formed + int *old2now; // o2n[i] = current local index of old atom I + // may be -1 if ghost atom has drifted + tagint *tagold; // IDs of atoms when bonds were formed + // 0 if a ghost atom is not in Dcut neigh list + double **xold; // coords of atoms when bonds were formed // vectors used to find maxstrain bonds within a local domain - int maxatom; // size of these vectors, nlocal + nghost + int maxatom; // size of these vectors, nlocal + nghost double *maxstrain; // max-strain of any bond atom I is part of // for owned and ghost atoms @@ -179,16 +179,16 @@ class FixHyperLocal : public FixHyper { // list of biased bonds this proc owns - int maxbias; // allocated size of bias list - int nbias; // # of biased bonds I own - int *bias; // index of biased bonds in my bond list + int maxbias; // allocated size of bias list + int nbias; // # of biased bonds I own + int *bias; // index of biased bonds in my bond list // data structs for persisting bias coeffs when bond list is reformed - MyPage *cpage;// pages of OneCoeff datums for clist - HyperOneCoeff **clist; // ptrs to vectors of bias coeffs for each atom - int *numcoeff; // # of bias coeffs per atom (one per bond) - int maxcoeff; // allocate sized of clist and numcoeff + MyPage *cpage; // pages of OneCoeff datums for clist + HyperOneCoeff **clist; // ptrs to vectors of bias coeffs for each atom + int *numcoeff; // # of bias coeffs per atom (one per bond) + int maxcoeff; // allocate sized of clist and numcoeff // extra timers @@ -200,7 +200,7 @@ class FixHyperLocal : public FixHyper { void grow_bond(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/fix_neb.cpp b/src/REPLICA/fix_neb.cpp index 77a4c1c666..8910959355 100644 --- a/src/REPLICA/fix_neb.cpp +++ b/src/REPLICA/fix_neb.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/fix_neb.h b/src/REPLICA/fix_neb.h index b686ef6d47..3bdec0414f 100644 --- a/src/REPLICA/fix_neb.h +++ b/src/REPLICA/fix_neb.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(neb,FixNEB) - +// clang-format off +FixStyle(neb,FixNEB); +// clang-format on #else #ifndef LMP_FIX_NEB_H @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixNEB : public Fix { public: - double veng,plen,nlen,dotpath,dottangrad,gradlen,dotgrad; + double veng, plen, nlen, dotpath, dottangrad, gradlen, dotgrad; int rclimber; FixNEB(class LAMMPS *, int, char **); @@ -37,42 +37,41 @@ class FixNEB : public Fix { void min_post_force(int); private: - int me,nprocs,nprocs_universe; - double kspring,kspringIni,kspringFinal,kspringPerp,EIniIni,EFinalIni; - bool StandardNEB,NEBLongRange,PerpSpring,FreeEndIni,FreeEndFinal; - bool FreeEndFinalWithRespToEIni,FinalAndInterWithRespToEIni; - int ireplica,nreplica; - int procnext,procprev; + int me, nprocs, nprocs_universe; + double kspring, kspringIni, kspringFinal, kspringPerp, EIniIni, EFinalIni; + bool StandardNEB, NEBLongRange, PerpSpring, FreeEndIni, FreeEndFinal; + bool FreeEndFinalWithRespToEIni, FinalAndInterWithRespToEIni; + int ireplica, nreplica; + int procnext, procprev; int cmode; MPI_Comm uworld; MPI_Comm rootworld; - char *id_pe; class Compute *pe; int nebatoms; - int ntotal; // total # of atoms, NEB or not - int maxlocal; // size of xprev,xnext,tangent arrays + int ntotal; // total # of atoms, NEB or not + int maxlocal; // size of xprev,xnext,tangent arrays double *nlenall; - double **xprev,**xnext,**fnext,**springF; + double **xprev, **xnext, **fnext, **springF; double **tangent; - double **xsend,**xrecv; // coords to send/recv to/from other replica - double **fsend,**frecv; // coords to send/recv to/from other replica - tagint *tagsend,*tagrecv; // ditto for atom IDs + double **xsend, **xrecv; // coords to send/recv to/from other replica + double **fsend, **frecv; // coords to send/recv to/from other replica + tagint *tagsend, *tagrecv; // ditto for atom IDs - // info gathered from all procs in my replica - double **xsendall,**xrecvall; // coords to send/recv to/from other replica - double **fsendall,**frecvall; // force to send/recv to/from other replica - tagint *tagsendall,*tagrecvall; // ditto for atom IDs + // info gathered from all procs in my replica + double **xsendall, **xrecvall; // coords to send/recv to/from other replica + double **fsendall, **frecvall; // force to send/recv to/from other replica + tagint *tagsendall, *tagrecvall; // ditto for atom IDs - int *counts,*displacements; // used for MPI_Gather + int *counts, *displacements; // used for MPI_Gather void inter_replica_comm(); void reallocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/hyper.cpp b/src/REPLICA/hyper.cpp index 8eb1c143e9..84ff43ec85 100644 --- a/src/REPLICA/hyper.cpp +++ b/src/REPLICA/hyper.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/hyper.h b/src/REPLICA/hyper.h index a6418c89a0..c17fc7a6d8 100644 --- a/src/REPLICA/hyper.h +++ b/src/REPLICA/hyper.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(hyper,Hyper) - +// clang-format off +CommandStyle(hyper,Hyper); +// clang-format on #else #ifndef LMP_HYPER_H @@ -31,18 +31,18 @@ class Hyper : public Command { void command(int, char **); private: - int me,nprocs; + int me, nprocs; int t_event; - double etol,ftol; - int maxiter,maxeval; - int stepmode,dumpflag,ndump,rebond; + double etol, ftol; + int maxiter, maxeval; + int stepmode, dumpflag, ndump, rebond; int *dumplist; - int neigh_every,neigh_delay,neigh_dist_check; + int neigh_every, neigh_delay, neigh_dist_check; int quench_reneighbor; - bigint nbuild,ndanger; + bigint nbuild, ndanger; - double time_dynamics,time_quench; + double time_dynamics, time_quench; double time_start; class FixHyper *fix_hyper; @@ -55,7 +55,7 @@ class Hyper : public Command { void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index 3ef223bd13..66a1dd83d5 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/neb.h b/src/REPLICA/neb.h index 6c4071baa1..26d3b72541 100644 --- a/src/REPLICA/neb.h +++ b/src/REPLICA/neb.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(neb,NEB) - +// clang-format off +CommandStyle(neb,NEB); +// clang-format on #else #ifndef LMP_NEB_H @@ -29,38 +29,38 @@ class NEB : public Command { NEB(class LAMMPS *); NEB(class LAMMPS *, double, double, int, int, int, double *, double *); ~NEB(); - void command(int, char **); // process neb command - void run(); // run NEB + void command(int, char **); // process neb command + void run(); // run NEB - double ebf,ebr; // forward and reverse energy barriers + double ebf, ebr; // forward and reverse energy barriers private: - int me,me_universe; // my proc ID in world and universe - int ireplica,nreplica; + int me, me_universe; // my proc ID in world and universe + int ireplica, nreplica; bool verbose; MPI_Comm uworld; - MPI_Comm roots; // MPI comm with 1 root proc from each world + MPI_Comm roots; // MPI comm with 1 root proc from each world FILE *fp; int compressed; - double etol; // energy tolerance convergence criterion - double ftol; // force tolerance convergence criterion - int n1steps, n2steps; // number of steps in stage 1 and 2 - int nevery; // output interval - char *inpfile; // name of file containing final state + double etol; // energy tolerance convergence criterion + double ftol; // force tolerance convergence criterion + int n1steps, n2steps; // number of steps in stage 1 and 2 + int nevery; // output interval + char *inpfile; // name of file containing final state class FixNEB *fneb; - int numall; // per-replica dimension of array all - double **all; // PE,plen,nlen,gradvnorm from each replica - double *rdist; // normalize reaction distance, 0 to 1 - double *freplica; // force on an image - double *fmaxatomInRepl; // force on an image + int numall; // per-replica dimension of array all + double **all; // PE,plen,nlen,gradvnorm from each replica + double *rdist; // normalize reaction distance, 0 to 1 + double *freplica; // force on an image + double *fmaxatomInRepl; // force on an image void readfile(char *, int); void open(char *); void print_status(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index 2ba0340109..23e572e88b 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/prd.h b/src/REPLICA/prd.h index c21ec4e319..a5342c47b8 100644 --- a/src/REPLICA/prd.h +++ b/src/REPLICA/prd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(prd,PRD) - +// clang-format off +CommandStyle(prd,PRD); +// clang-format on #else #ifndef LMP_PRD_H @@ -31,29 +31,29 @@ class PRD : public Command { void command(int, char **); private: - int me,nprocs; - int t_event,n_dephase,t_dephase,t_corr; - double etol,ftol,temp_dephase; - int maxiter,maxeval,temp_flag,stepmode,cmode; - char *loop_setting,*dist_setting; + int me, nprocs; + int t_event, n_dephase, t_dephase, t_corr; + double etol, ftol, temp_dephase; + int maxiter, maxeval, temp_flag, stepmode, cmode; + char *loop_setting, *dist_setting; - int equal_size_replicas,natoms; - int neigh_every,neigh_delay,neigh_dist_check; + int equal_size_replicas, natoms; + int neigh_every, neigh_delay, neigh_dist_check; int quench_reneighbor; - bigint nbuild,ndanger; + bigint nbuild, ndanger; - double time_dephase,time_dynamics,time_quench,time_comm,time_output; + double time_dephase, time_dynamics, time_quench, time_comm, time_output; double time_start; MPI_Comm comm_replica; - int *counts,*displacements; + int *counts, *displacements; tagint *tagall; double **xall; imageint *imageall; int ncoincident; - class RanPark *random_select,*random_clock; + class RanPark *random_select, *random_clock; class RanMars *random_dephase; class Compute *compute_event; class FixEventPRD *fix_event; @@ -71,7 +71,7 @@ class PRD : public Command { void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index f9ea044757..5631944dbf 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/tad.h b/src/REPLICA/tad.h index cf2136f0d5..7e528acfbb 100644 --- a/src/REPLICA/tad.h +++ b/src/REPLICA/tad.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(tad,TAD) - +// clang-format off +CommandStyle(tad,TAD); +// clang-format on #else #ifndef LMP_TAD_H @@ -31,38 +31,38 @@ class TAD : public Command { void command(int, char **); private: - int me,nprocs; - int nsteps,t_event; - double templo,temphi,delta_conf,tmax; - double etol,ftol,etol_neb,ftol_neb,dt_neb; - int maxiter,maxeval,n1steps_neb,n2steps_neb,nevery_neb; + int me, nprocs; + int nsteps, t_event; + double templo, temphi, delta_conf, tmax; + double etol, ftol, etol_neb, ftol_neb, dt_neb; + int maxiter, maxeval, n1steps_neb, n2steps_neb, nevery_neb; char *min_style, *min_style_neb; - double delta_beta,ratio_beta; - double deltconf,deltstop,deltfirst; // Times since last event + double delta_beta, ratio_beta; + double deltconf, deltstop, deltfirst; // Times since last event int event_first; - int neigh_every,neigh_delay,neigh_dist_check; + int neigh_every, neigh_delay, neigh_dist_check; int quench_reneighbor; - bigint nbuild,ndanger; + bigint nbuild, ndanger; - double time_dynamics,time_quench,time_neb,time_comm,time_output; + double time_dynamics, time_quench, time_neb, time_comm, time_output; double time_start; - class NEB *neb; // NEB object - class Fix *fix_neb; // FixNEB object - class Compute *compute_event; // compute to detect event - class FixEventTAD *fix_event; // current event/state - class FixStore *fix_revert; // revert state - FixEventTAD **fix_event_list; // list of possible events - int n_event_list; // number of events - int nmax_event_list; // allocated events - int nmin_event_list; // minimum allocation + class NEB *neb; // NEB object + class Fix *fix_neb; // FixNEB object + class Compute *compute_event; // compute to detect event + class FixEventTAD *fix_event; // current event/state + class FixStore *fix_revert; // revert state + FixEventTAD **fix_event_list; // list of possible events + int n_event_list; // number of events + int nmax_event_list; // allocated events + int nmin_event_list; // minimum allocation - char *neb_logfilename; // filename for ulogfile_neb - FILE *uscreen_neb; // neb universe screen output - FILE *ulogfile_neb; // neb universe logfile - FILE *uscreen_lammps; // lammps universe screen output - FILE *ulogfile_lammps; // lammps universe logfile + char *neb_logfilename; // filename for ulogfile_neb + FILE *uscreen_neb; // neb universe screen output + FILE *ulogfile_neb; // neb universe logfile + FILE *uscreen_lammps; // lammps universe screen output + FILE *ulogfile_lammps; // lammps universe logfile class Finish *finish; @@ -83,7 +83,7 @@ class TAD : public Command { void delete_event_list(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/temper.cpp b/src/REPLICA/temper.cpp index d3894060a3..f31705213e 100644 --- a/src/REPLICA/temper.cpp +++ b/src/REPLICA/temper.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/temper.h b/src/REPLICA/temper.h index 40293de483..d7ebf79c33 100644 --- a/src/REPLICA/temper.h +++ b/src/REPLICA/temper.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(temper,Temper) - +// clang-format off +CommandStyle(temper,Temper); +// clang-format on #else #ifndef LMP_TEMPER_H @@ -31,29 +31,29 @@ class Temper : public Command { void command(int, char **); private: - int me,me_universe; // my proc ID in world and universe - int iworld,nworlds; // world info - double boltz; // copy from output->boltz - MPI_Comm roots; // MPI comm with 1 root proc from each world - class RanPark *ranswap,*ranboltz; // RNGs for swapping and Boltz factor - int nevery; // # of timesteps between swaps - int nswaps; // # of tempering swaps to perform - int seed_swap; // 0 = toggle swaps, n = RNG for swap direction - int seed_boltz; // seed for Boltz factor comparison - int whichfix; // index of temperature fix to use - int fixstyle; // what kind of temperature fix is used + int me, me_universe; // my proc ID in world and universe + int iworld, nworlds; // world info + double boltz; // copy from output->boltz + MPI_Comm roots; // MPI comm with 1 root proc from each world + class RanPark *ranswap, *ranboltz; // RNGs for swapping and Boltz factor + int nevery; // # of timesteps between swaps + int nswaps; // # of tempering swaps to perform + int seed_swap; // 0 = toggle swaps, n = RNG for swap direction + int seed_boltz; // seed for Boltz factor comparison + int whichfix; // index of temperature fix to use + int fixstyle; // what kind of temperature fix is used - int my_set_temp; // which set temp I am simulating - double *set_temp; // static list of replica set temperatures - int *temp2world; // temp2world[i] = world simulating set temp i - int *world2temp; // world2temp[i] = temp simulated by world i - int *world2root; // world2root[i] = root proc of world i + int my_set_temp; // which set temp I am simulating + double *set_temp; // static list of replica set temperatures + int *temp2world; // temp2world[i] = world simulating set temp i + int *world2temp; // world2temp[i] = temp simulated by world i + int *world2root; // world2root[i] = root proc of world i void scale_velocities(int, int); void print_status(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/verlet_split.cpp b/src/REPLICA/verlet_split.cpp index d3cda94ef1..95cd54119c 100644 --- a/src/REPLICA/verlet_split.cpp +++ b/src/REPLICA/verlet_split.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/REPLICA/verlet_split.h b/src/REPLICA/verlet_split.h index e2c9ac2900..57561a9daf 100644 --- a/src/REPLICA/verlet_split.h +++ b/src/REPLICA/verlet_split.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef INTEGRATE_CLASS - -IntegrateStyle(verlet/split,VerletSplit) - +// clang-format off +IntegrateStyle(verlet/split,VerletSplit); +// clang-format on #else #ifndef LMP_VERLET_SPLIT_H @@ -35,14 +35,14 @@ class VerletSplit : public Verlet { double memory_usage(); private: - int master; // 1 if an Rspace proc, 0 if Kspace - int me_block; // proc ID within Rspace/Kspace block - int ratio; // ratio of Rspace procs to Kspace procs - int *qsize,*qdisp,*xsize,*xdisp; // MPI gather/scatter params for block comm - MPI_Comm block; // communicator within one block - int tip4p_flag; // 1 if PPPM/tip4p so do extra comm + int master; // 1 if an Rspace proc, 0 if Kspace + int me_block; // proc ID within Rspace/Kspace block + int ratio; // ratio of Rspace procs to Kspace procs + int *qsize, *qdisp, *xsize, *xdisp; // MPI gather/scatter params for block comm + MPI_Comm block; // communicator within one block + int tip4p_flag; // 1 if PPPM/tip4p so do extra comm - double **f_kspace; // copy of Kspace forces on Rspace procs + double **f_kspace; // copy of Kspace forces on Rspace procs int maxatom; void rk_setup(); @@ -50,7 +50,7 @@ class VerletSplit : public Verlet { void k2r_comm(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/compute_erotate_rigid.cpp b/src/RIGID/compute_erotate_rigid.cpp index d1567cfe2e..4217aa8e0a 100644 --- a/src/RIGID/compute_erotate_rigid.cpp +++ b/src/RIGID/compute_erotate_rigid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/compute_erotate_rigid.h b/src/RIGID/compute_erotate_rigid.h index fae6cf5a10..b8571fa21a 100644 --- a/src/RIGID/compute_erotate_rigid.h +++ b/src/RIGID/compute_erotate_rigid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(erotate/rigid,ComputeERotateRigid) - +// clang-format off +ComputeStyle(erotate/rigid,ComputeERotateRigid); +// clang-format on #else #ifndef LMP_COMPUTE_EROTATE_RIGID_H @@ -36,7 +36,7 @@ class ComputeERotateRigid : public Compute { char *rfix; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/compute_ke_rigid.cpp b/src/RIGID/compute_ke_rigid.cpp index 9da5aabb9a..48f04e9cff 100644 --- a/src/RIGID/compute_ke_rigid.cpp +++ b/src/RIGID/compute_ke_rigid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/compute_ke_rigid.h b/src/RIGID/compute_ke_rigid.h index 2cbd059da3..32ec7e062e 100644 --- a/src/RIGID/compute_ke_rigid.h +++ b/src/RIGID/compute_ke_rigid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(ke/rigid,ComputeKERigid) - +// clang-format off +ComputeStyle(ke/rigid,ComputeKERigid); +// clang-format on #else #ifndef LMP_COMPUTE_KE_RIGID_H @@ -36,7 +36,7 @@ class ComputeKERigid : public Compute { char *rfix; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/compute_rigid_local.cpp b/src/RIGID/compute_rigid_local.cpp index 9de227531d..44708c7730 100644 --- a/src/RIGID/compute_rigid_local.cpp +++ b/src/RIGID/compute_rigid_local.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/compute_rigid_local.h b/src/RIGID/compute_rigid_local.h index 1fb7e93b5b..3c8b48f366 100644 --- a/src/RIGID/compute_rigid_local.h +++ b/src/RIGID/compute_rigid_local.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(rigid/local,ComputeRigidLocal) - +// clang-format off +ComputeStyle(rigid/local,ComputeRigidLocal); +// clang-format on #else #ifndef LMP_COMPUTE_RIGID_LOCAL_H @@ -48,7 +48,7 @@ class ComputeRigidLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_ehex.cpp b/src/RIGID/fix_ehex.cpp index 4bfabea3dd..f0c633c7a8 100644 --- a/src/RIGID/fix_ehex.cpp +++ b/src/RIGID/fix_ehex.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_ehex.h b/src/RIGID/fix_ehex.h index 456b99320a..32ff1b9560 100644 --- a/src/RIGID/fix_ehex.h +++ b/src/RIGID/fix_ehex.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,11 +11,10 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - #ifdef FIX_CLASS - -FixStyle(ehex,FixEHEX) - +// clang-format off +FixStyle(ehex,FixEHEX); +// clang-format on #else #ifndef LMP_FIX_EHEX_H @@ -31,14 +30,14 @@ class FixEHEX : public Fix { public: FixEHEX(class LAMMPS *, int, char **); ~FixEHEX(); - int setmask(); + int setmask(); void init(); void end_of_step(); - void rescale(); + void rescale(); double compute_scalar(); double memory_usage(); void update_scalingmask(); - void com_properties(double *, double *, double *, double*, double *, double*); + void com_properties(double *, double *, double *, double *, double *, double *); bool rescale_atom(int i, class Region *region); virtual void grow_arrays(int nmax); bool check_cluster(tagint *shake_atom, int n, class Region *region); @@ -51,22 +50,22 @@ class FixEHEX : public Fix { char *idregion; int me; - double **x; // coordinates - double **f; // forces - double **v; // velocities - double *mass; // masses - double *rmass; // reduced masses - int *type; // atom types - int nlocal; // number of local atoms - class FixShake * fshake; // pointer to fix_shake/fix_rattle - int constraints; // constraints (0/1) - int cluster; // rescaling entire clusters (0/1) - int hex; // HEX mode (0/1) - bool *scalingmask; // scalingmask[i] determines whether - // the velocity of atom i is to be rescaled + double **x; // coordinates + double **f; // forces + double **v; // velocities + double *mass; // masses + double *rmass; // reduced masses + int *type; // atom types + int nlocal; // number of local atoms + class FixShake *fshake; // pointer to fix_shake/fix_rattle + int constraints; // constraints (0/1) + int cluster; // rescaling entire clusters (0/1) + int hex; // HEX mode (0/1) + bool *scalingmask; // scalingmask[i] determines whether + // the velocity of atom i is to be rescaled }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rattle.cpp b/src/RIGID/fix_rattle.cpp index 90aa6d487a..9bd391d26d 100644 --- a/src/RIGID/fix_rattle.cpp +++ b/src/RIGID/fix_rattle.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_rattle.h b/src/RIGID/fix_rattle.h index 7b541bac77..d8bcec753c 100644 --- a/src/RIGID/fix_rattle.h +++ b/src/RIGID/fix_rattle.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rattle,FixRattle) - +// clang-format off +FixStyle(rattle,FixRattle); +// clang-format on #else #ifndef LMP_FIX_RATTLE_H @@ -26,10 +26,10 @@ namespace LAMMPS_NS { class FixRattle : public FixShake { public: - double **vp; // array for unconstrained velocities - int comm_mode; // mode for communication pack/unpack - double derr_max; // distance error - double verr_max; // velocity error + double **vp; // array for unconstrained velocities + int comm_mode; // mode for communication pack/unpack + double derr_max; // distance error + double verr_max; // velocity error FixRattle(class LAMMPS *, int, char **); ~FixRattle(); @@ -38,7 +38,7 @@ class FixRattle : public FixShake { virtual void post_force(int); virtual void post_force_respa(int, int, int); virtual void final_integrate(); - virtual void final_integrate_respa(int,int); + virtual void final_integrate_respa(int, int); virtual void correct_coordinates(int vflag); virtual void correct_velocities(); @@ -63,7 +63,7 @@ class FixRattle : public FixShake { // debugging methods - bool check3angle(double ** v, int m, bool checkr, bool checkv); + bool check3angle(double **v, int m, bool checkr, bool checkv); bool check2(double **v, int m, bool checkr, bool checkv); bool check3(double **v, int m, bool checkr, bool checkv); bool check4(double **v, int m, bool checkr, bool checkv); @@ -71,7 +71,7 @@ class FixRattle : public FixShake { void end_of_step(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 24ce241670..f53881c4e7 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_rigid.h b/src/RIGID/fix_rigid.h index e04b4cf143..90663acc47 100644 --- a/src/RIGID/fix_rigid.h +++ b/src/RIGID/fix_rigid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid,FixRigid) - +// clang-format off +FixStyle(rigid,FixRigid); +// clang-format on #else #ifndef LMP_FIX_RIGID_H @@ -55,85 +55,85 @@ class FixRigid : public Fix { void zero_momentum(); void zero_rotation(); virtual int modify_param(int, char **); - virtual void *extract(const char*, int &); + virtual void *extract(const char *, int &); double extract_ke(); double extract_erotational(); double compute_array(int, int); protected: - int me,nprocs; - double dtv,dtf,dtq; + int me, nprocs; + double dtv, dtf, dtq; double *step_respa; int triclinic; - char *inpfile; // file to read rigid body attributes from + char *inpfile; // file to read rigid body attributes from - int rstyle; // SINGLE,MOLECULE,GROUP - int setupflag; // 1 if body properties are setup, else 0 - int earlyflag; // 1 if forces/torques computed at post_force() + int rstyle; // SINGLE,MOLECULE,GROUP + int setupflag; // 1 if body properties are setup, else 0 + int earlyflag; // 1 if forces/torques computed at post_force() - int dimension; // # of dimensions - int nbody; // # of rigid bodies - int nlinear; // # of linear rigid bodies - int *nrigid; // # of atoms in each rigid body - int *mol2body; // convert mol-ID to rigid body index - int *body2mol; // convert rigid body index to mol-ID - int maxmol; // size of mol2body = max mol-ID + int dimension; // # of dimensions + int nbody; // # of rigid bodies + int nlinear; // # of linear rigid bodies + int *nrigid; // # of atoms in each rigid body + int *mol2body; // convert mol-ID to rigid body index + int *body2mol; // convert rigid body index to mol-ID + int maxmol; // size of mol2body = max mol-ID - int *body; // which body each atom is part of (-1 if none) - double **displace; // displacement of each atom in body coords + int *body; // which body each atom is part of (-1 if none) + double **displace; // displacement of each atom in body coords - double *masstotal; // total mass of each rigid body - double **xcm; // coords of center-of-mass of each rigid body - double **vcm; // velocity of center-of-mass of each - double **fcm; // force on center-of-mass of each - double **inertia; // 3 principal components of inertia of each - double **ex_space,**ey_space,**ez_space; - // principal axes of each in space coords - double **angmom; // angular momentum of each in space coords - double **omega; // angular velocity of each in space coords - double **torque; // torque on each rigid body in space coords - double **quat; // quaternion of each rigid body - imageint *imagebody; // image flags of xcm of each rigid body - double **fflag; // flag for on/off of center-of-mass force - double **tflag; // flag for on/off of center-of-mass torque - double **langextra; // Langevin thermostat forces and torques + double *masstotal; // total mass of each rigid body + double **xcm; // coords of center-of-mass of each rigid body + double **vcm; // velocity of center-of-mass of each + double **fcm; // force on center-of-mass of each + double **inertia; // 3 principal components of inertia of each + double **ex_space, **ey_space, **ez_space; + // principal axes of each in space coords + double **angmom; // angular momentum of each in space coords + double **omega; // angular velocity of each in space coords + double **torque; // torque on each rigid body in space coords + double **quat; // quaternion of each rigid body + imageint *imagebody; // image flags of xcm of each rigid body + double **fflag; // flag for on/off of center-of-mass force + double **tflag; // flag for on/off of center-of-mass torque + double **langextra; // Langevin thermostat forces and torques - double **sum,**all; // work vectors for each rigid body - int **remapflag; // PBC remap flags for each rigid body + double **sum, **all; // work vectors for each rigid body + int **remapflag; // PBC remap flags for each rigid body - int extended; // 1 if any particles have extended attributes - int orientflag; // 1 if particles store spatial orientation - int dorientflag; // 1 if particles store dipole orientation - int reinitflag; // 1 if re-initialize rigid bodies between runs + int extended; // 1 if any particles have extended attributes + int orientflag; // 1 if particles store spatial orientation + int dorientflag; // 1 if particles store dipole orientation + int reinitflag; // 1 if re-initialize rigid bodies between runs - imageint *xcmimage; // internal image flags for atoms in rigid bodies - // set relative to in-box xcm of each body - int *eflags; // flags for extended particles - double **orient; // orientation vector of particle wrt rigid body - double **dorient; // orientation of dipole mu wrt rigid body + imageint *xcmimage; // internal image flags for atoms in rigid bodies + // set relative to in-box xcm of each body + int *eflags; // flags for extended particles + double **orient; // orientation vector of particle wrt rigid body + double **dorient; // orientation of dipole mu wrt rigid body - double tfactor; // scale factor on temperature of rigid bodies - int langflag; // 0/1 = no/yes Langevin thermostat + double tfactor; // scale factor on temperature of rigid bodies + int langflag; // 0/1 = no/yes Langevin thermostat - int tstat_flag; // NVT settings - double t_start,t_stop,t_target; - double t_period,t_freq; - int t_chain,t_iter,t_order; + int tstat_flag; // NVT settings + double t_start, t_stop, t_target; + double t_period, t_freq; + int t_chain, t_iter, t_order; - int pstat_flag; // NPT settings - double p_start[3],p_stop[3]; - double p_period[3],p_freq[3]; + int pstat_flag; // NPT settings + double p_start[3], p_stop[3]; + double p_period[3], p_freq[3]; int p_flag[3]; - int pcouple,pstyle; + int pcouple, pstyle; int p_chain; - int allremap; // remap all atoms - int dilate_group_bit; // mask for dilation group - char *id_dilate; // group name to dilate + int allremap; // remap all atoms + int dilate_group_bit; // mask for dilation group + char *id_dilate; // group name to dilate - char *id_gravity; // ID of fix gravity command to add gravity forces - double *gvec; // ptr to gravity vector inside the fix + char *id_gravity; // ID of fix gravity command to add gravity forces + double *gvec; // ptr to gravity vector inside the fix class RanMars *random; class AtomVecEllipsoid *avec_ellipsoid; @@ -147,11 +147,10 @@ class FixRigid : public Fix { void setup_bodies_dynamic(); void apply_langevin_thermostat(); void compute_forces_and_torques(); - void readfile(int, double *, double **, double **, double **, - imageint *, int *); + void readfile(int, double *, double **, double **, double **, imageint *, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_nh.cpp b/src/RIGID/fix_rigid_nh.cpp index 3c4e332fd2..943d7225ba 100644 --- a/src/RIGID/fix_rigid_nh.cpp +++ b/src/RIGID/fix_rigid_nh.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -822,7 +823,7 @@ void FixRigidNH::nhc_press_integrate() double tb_mass = kt / (p_freq_max * p_freq_max); q_b[0] = dimension * dimension * tb_mass; - for (int i = 1; i < p_chain; i++) { + for (i = 1; i < p_chain; i++) { q_b[i] = tb_mass; f_eta_b[i] = q_b[i-1] * eta_dot_b[i-1] * eta_dot_b[i-1] - kt; f_eta_b[i] /= q_b[i]; diff --git a/src/RIGID/fix_rigid_nh.h b/src/RIGID/fix_rigid_nh.h index 86492e5531..0335eecabf 100644 --- a/src/RIGID/fix_rigid_nh.h +++ b/src/RIGID/fix_rigid_nh.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -34,40 +34,40 @@ class FixRigidNH : public FixRigid { void reset_target(double); protected: - double **conjqm; // conjugate quaternion momentum - double boltz,nktv2p,mvv2e; // boltzman constant, conversion factors + double **conjqm; // conjugate quaternion momentum + double boltz, nktv2p, mvv2e; // boltzman constant, conversion factors - int nf_t,nf_r; // trans/rot degrees of freedom - double *w,*wdti1,*wdti2,*wdti4; // Yoshida-Suzuki coefficients - double *q_t,*q_r; // trans/rot thermostat masses - double *eta_t,*eta_r; // trans/rot thermostat positions - double *eta_dot_t,*eta_dot_r; // trans/rot thermostat velocities - double *f_eta_t,*f_eta_r; // trans/rot thermostat forces + int nf_t, nf_r; // trans/rot degrees of freedom + double *w, *wdti1, *wdti2, *wdti4; // Yoshida-Suzuki coefficients + double *q_t, *q_r; // trans/rot thermostat masses + double *eta_t, *eta_r; // trans/rot thermostat positions + double *eta_dot_t, *eta_dot_r; // trans/rot thermostat velocities + double *f_eta_t, *f_eta_r; // trans/rot thermostat forces - double epsilon_mass[3], *q_b; // baro/thermo masses - double epsilon[3],*eta_b; // baro/thermo positions - double epsilon_dot[3],*eta_dot_b; // baro/thermo velocities - double *f_eta_b; // thermo forces - double akin_t,akin_r; // translational/rotational kinetic energies + double epsilon_mass[3], *q_b; // baro/thermo masses + double epsilon[3], *eta_b; // baro/thermo positions + double epsilon_dot[3], *eta_dot_b; // baro/thermo velocities + double *f_eta_b; // thermo forces + double akin_t, akin_r; // translational/rotational kinetic energies - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigidfix; // number of rigid fixes - int *rfix; // indices of rigid fixes + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigidfix; // number of rigid fixes + int *rfix; // indices of rigid fixes - double vol0; // reference volume - double t0; // reference temperature - int pdim,g_f; // number of barostatted dims, total DoFs - double p_hydro; // hydrostatic target pressure - double p_freq_max; // maximum barostat frequency + double vol0; // reference volume + double t0; // reference temperature + int pdim, g_f; // number of barostatted dims, total DoFs + double p_hydro; // hydrostatic target pressure + double p_freq_max; // maximum barostat frequency - double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections + double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections double t_current; - double p_current[3],p_target[3]; + double p_current[3], p_target[3]; - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tcomputeflag,pcomputeflag; // 1 = compute was created by fix. 0 = external + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tcomputeflag, pcomputeflag; // 1 = compute was created by fix. 0 = external void couple(); void remap(); @@ -88,14 +88,14 @@ class FixRigidNH : public FixRigid { inline double FixRigidNH::maclaurin_series(double x) { - double x2,x4; + double x2, x4; x2 = x * x; x4 = x2 * x2; - return (1.0 + (1.0/6.0) * x2 + (1.0/120.0) * x4 + (1.0/5040.0) * x2 * x4 + - (1.0/362880.0) * x4 * x4); + return (1.0 + (1.0 / 6.0) * x2 + (1.0 / 120.0) * x4 + (1.0 / 5040.0) * x2 * x4 + + (1.0 / 362880.0) * x4 * x4); } -} +} // namespace LAMMPS_NS #endif diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp index cc7ea24c34..2392c5e417 100644 --- a/src/RIGID/fix_rigid_nh_small.cpp +++ b/src/RIGID/fix_rigid_nh_small.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_rigid_nh_small.h b/src/RIGID/fix_rigid_nh_small.h index 54d5421ceb..11dae8f211 100644 --- a/src/RIGID/fix_rigid_nh_small.h +++ b/src/RIGID/fix_rigid_nh_small.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -34,40 +34,40 @@ class FixRigidNHSmall : public FixRigidSmall { void reset_target(double); protected: - double boltz,nktv2p,mvv2e; // boltzman constant, conversion factors + double boltz, nktv2p, mvv2e; // boltzman constant, conversion factors - int dimension; // # of dimensions - int nf_t,nf_r; // trans/rot degrees of freedom - double *w,*wdti1,*wdti2,*wdti4; // Yoshida-Suzuki coefficients - double *q_t,*q_r; // trans/rot thermostat masses - double *eta_t,*eta_r; // trans/rot thermostat positions - double *eta_dot_t,*eta_dot_r; // trans/rot thermostat velocities - double *f_eta_t,*f_eta_r; // trans/rot thermostat forces + int dimension; // # of dimensions + int nf_t, nf_r; // trans/rot degrees of freedom + double *w, *wdti1, *wdti2, *wdti4; // Yoshida-Suzuki coefficients + double *q_t, *q_r; // trans/rot thermostat masses + double *eta_t, *eta_r; // trans/rot thermostat positions + double *eta_dot_t, *eta_dot_r; // trans/rot thermostat velocities + double *f_eta_t, *f_eta_r; // trans/rot thermostat forces - double epsilon_mass[3], *q_b; // baro/thermo masses - double epsilon[3],*eta_b; // baro/thermo positions - double epsilon_dot[3],*eta_dot_b; // baro/thermo velocities - double *f_eta_b; // thermo forces - double akin_t,akin_r; // translational/rotational kinetic energies + double epsilon_mass[3], *q_b; // baro/thermo masses + double epsilon[3], *eta_b; // baro/thermo positions + double epsilon_dot[3], *eta_dot_b; // baro/thermo velocities + double *f_eta_b; // thermo forces + double akin_t, akin_r; // translational/rotational kinetic energies - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigidfix; // number of rigid fixes - int *rfix; // indices of rigid fixes + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigidfix; // number of rigid fixes + int *rfix; // indices of rigid fixes - double vol0; // reference volume - double t0; // reference temperature - int pdim,g_f; // number of barostatted dims, total DoFs - double p_hydro; // hydrostatic target pressure - double p_freq_max; // maximum barostat frequency + double vol0; // reference volume + double t0; // reference temperature + int pdim, g_f; // number of barostatted dims, total DoFs + double p_hydro; // hydrostatic target pressure + double p_freq_max; // maximum barostat frequency - double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections + double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections - double t_target,t_current; + double t_target, t_current; double t_freq; - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tcomputeflag,pcomputeflag; // 1 = compute was created by fix. 0 = external + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tcomputeflag, pcomputeflag; // 1 = compute was created by fix. 0 = external void couple(); void remap(); @@ -89,14 +89,14 @@ class FixRigidNHSmall : public FixRigidSmall { inline double FixRigidNHSmall::maclaurin_series(double x) { - double x2,x4; + double x2, x4; x2 = x * x; x4 = x2 * x2; - return (1.0 + (1.0/6.0) * x2 + (1.0/120.0) * x4 + (1.0/5040.0) * x2 * x4 + - (1.0/362880.0) * x4 * x4); + return (1.0 + (1.0 / 6.0) * x2 + (1.0 / 120.0) * x4 + (1.0 / 5040.0) * x2 * x4 + + (1.0 / 362880.0) * x4 * x4); } -} +} // namespace LAMMPS_NS #endif diff --git a/src/RIGID/fix_rigid_nph.cpp b/src/RIGID/fix_rigid_nph.cpp index 1c93df4599..6fcdc66fec 100644 --- a/src/RIGID/fix_rigid_nph.cpp +++ b/src/RIGID/fix_rigid_nph.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_rigid_nph.h b/src/RIGID/fix_rigid_nph.h index 9f716286ae..4cdb61c141 100644 --- a/src/RIGID/fix_rigid_nph.h +++ b/src/RIGID/fix_rigid_nph.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/nph,FixRigidNPH) - +// clang-format off +FixStyle(rigid/nph,FixRigidNPH); +// clang-format on #else #ifndef LMP_FIX_RIGID_NPH_H @@ -30,8 +30,7 @@ class FixRigidNPH : public FixRigidNH { ~FixRigidNPH() {} }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_nph_small.cpp b/src/RIGID/fix_rigid_nph_small.cpp index ad5a48f1c2..7f6f81d858 100644 --- a/src/RIGID/fix_rigid_nph_small.cpp +++ b/src/RIGID/fix_rigid_nph_small.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_rigid_nph_small.h b/src/RIGID/fix_rigid_nph_small.h index 798d0b904b..ae4d2e6466 100644 --- a/src/RIGID/fix_rigid_nph_small.h +++ b/src/RIGID/fix_rigid_nph_small.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/nph/small,FixRigidNPHSmall) - +// clang-format off +FixStyle(rigid/nph/small,FixRigidNPHSmall); +// clang-format on #else #ifndef LMP_FIX_RIGID_NPH_SMALL_H @@ -30,8 +30,7 @@ class FixRigidNPHSmall : public FixRigidNHSmall { ~FixRigidNPHSmall() {} }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_npt.cpp b/src/RIGID/fix_rigid_npt.cpp index 4f65929476..342144f82f 100644 --- a/src/RIGID/fix_rigid_npt.cpp +++ b/src/RIGID/fix_rigid_npt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_rigid_npt.h b/src/RIGID/fix_rigid_npt.h index 6c10f44ac9..a4bcda5b3d 100644 --- a/src/RIGID/fix_rigid_npt.h +++ b/src/RIGID/fix_rigid_npt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/npt,FixRigidNPT) - +// clang-format off +FixStyle(rigid/npt,FixRigidNPT); +// clang-format on #else #ifndef LMP_FIX_RIGID_NPT_H @@ -30,8 +30,7 @@ class FixRigidNPT : public FixRigidNH { ~FixRigidNPT() {} }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_npt_small.cpp b/src/RIGID/fix_rigid_npt_small.cpp index 6f7c025bc8..701ed0c9f2 100644 --- a/src/RIGID/fix_rigid_npt_small.cpp +++ b/src/RIGID/fix_rigid_npt_small.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_rigid_npt_small.h b/src/RIGID/fix_rigid_npt_small.h index 2b3f0e3b5e..24d4fda374 100644 --- a/src/RIGID/fix_rigid_npt_small.h +++ b/src/RIGID/fix_rigid_npt_small.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/npt/small,FixRigidNPTSmall) - +// clang-format off +FixStyle(rigid/npt/small,FixRigidNPTSmall); +// clang-format on #else #ifndef LMP_FIX_RIGID_NPT_SMALL_H @@ -30,8 +30,7 @@ class FixRigidNPTSmall : public FixRigidNHSmall { ~FixRigidNPTSmall() {} }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_nve.cpp b/src/RIGID/fix_rigid_nve.cpp index b4c52c7774..1d16eed335 100644 --- a/src/RIGID/fix_rigid_nve.cpp +++ b/src/RIGID/fix_rigid_nve.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_rigid_nve.h b/src/RIGID/fix_rigid_nve.h index 59ba184279..b05df5b606 100644 --- a/src/RIGID/fix_rigid_nve.h +++ b/src/RIGID/fix_rigid_nve.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/nve,FixRigidNVE) - +// clang-format off +FixStyle(rigid/nve,FixRigidNVE); +// clang-format on #else #ifndef LMP_FIX_RIGID_NVE_H @@ -30,7 +30,7 @@ class FixRigidNVE : public FixRigidNH { ~FixRigidNVE() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_nve_small.cpp b/src/RIGID/fix_rigid_nve_small.cpp index 106d23d34a..67b4e5204e 100644 --- a/src/RIGID/fix_rigid_nve_small.cpp +++ b/src/RIGID/fix_rigid_nve_small.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_rigid_nve_small.h b/src/RIGID/fix_rigid_nve_small.h index 96de7f2bcd..3cc790befa 100644 --- a/src/RIGID/fix_rigid_nve_small.h +++ b/src/RIGID/fix_rigid_nve_small.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/nve/small,FixRigidNVESmall) - +// clang-format off +FixStyle(rigid/nve/small,FixRigidNVESmall); +// clang-format on #else #ifndef LMP_FIX_RIGID_NVE_SMALL_H @@ -30,7 +30,7 @@ class FixRigidNVESmall : public FixRigidNHSmall { ~FixRigidNVESmall() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_nvt.cpp b/src/RIGID/fix_rigid_nvt.cpp index dd930a6766..6cc436734d 100644 --- a/src/RIGID/fix_rigid_nvt.cpp +++ b/src/RIGID/fix_rigid_nvt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_rigid_nvt.h b/src/RIGID/fix_rigid_nvt.h index 4c2c003d78..5224fd56ae 100644 --- a/src/RIGID/fix_rigid_nvt.h +++ b/src/RIGID/fix_rigid_nvt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/nvt,FixRigidNVT) - +// clang-format off +FixStyle(rigid/nvt,FixRigidNVT); +// clang-format on #else #ifndef LMP_FIX_RIGID_NVT_H @@ -30,7 +30,7 @@ class FixRigidNVT : public FixRigidNH { ~FixRigidNVT() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_nvt_small.cpp b/src/RIGID/fix_rigid_nvt_small.cpp index 0392f9c881..c3a7aed35f 100644 --- a/src/RIGID/fix_rigid_nvt_small.cpp +++ b/src/RIGID/fix_rigid_nvt_small.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_rigid_nvt_small.h b/src/RIGID/fix_rigid_nvt_small.h index 4f83546b77..edb781884b 100644 --- a/src/RIGID/fix_rigid_nvt_small.h +++ b/src/RIGID/fix_rigid_nvt_small.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/nvt/small,FixRigidNVTSmall) - +// clang-format off +FixStyle(rigid/nvt/small,FixRigidNVTSmall); +// clang-format on #else #ifndef LMP_FIX_RIGID_NVT_SMALL_H @@ -30,7 +30,7 @@ class FixRigidNVTSmall : public FixRigidNHSmall { ~FixRigidNVTSmall() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 60348fb5ce..9a35d2c73b 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_rigid_small.h b/src/RIGID/fix_rigid_small.h index 16a5e58da5..60a4dd1161 100644 --- a/src/RIGID/fix_rigid_small.h +++ b/src/RIGID/fix_rigid_small.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/small,FixRigidSmall) - +// clang-format off +FixStyle(rigid/small,FixRigidSmall); +// clang-format on #else #ifndef LMP_FIX_RIGID_SMALL_H @@ -61,72 +61,72 @@ class FixRigidSmall : public Fix { void zero_momentum(); void zero_rotation(); int modify_param(int, char **); - void *extract(const char*, int &); + void *extract(const char *, int &); double extract_ke(); double extract_erotational(); double compute_scalar(); double memory_usage(); protected: - int me,nprocs; - double dtv,dtf,dtq; + int me, nprocs; + double dtv, dtf, dtq; double *step_respa; int triclinic; - char *inpfile; // file to read rigid body attributes from - int setupflag; // 1 if body properties are setup, else 0 - int earlyflag; // 1 if forces/torques are computed at post_force() - int commflag; // various modes of forward/reverse comm - int customflag; // 1 if custom property/variable define bodies - int nbody; // total # of rigid bodies - int nlinear; // total # of linear rigid bodies - tagint maxmol; // max mol-ID - double maxextent; // furthest distance from body owner to body atom + char *inpfile; // file to read rigid body attributes from + int setupflag; // 1 if body properties are setup, else 0 + int earlyflag; // 1 if forces/torques are computed at post_force() + int commflag; // various modes of forward/reverse comm + int customflag; // 1 if custom property/variable define bodies + int nbody; // total # of rigid bodies + int nlinear; // total # of linear rigid bodies + tagint maxmol; // max mol-ID + double maxextent; // furthest distance from body owner to body atom struct Body { - double mass; // total mass of body - double xcm[3]; // COM position - double vcm[3]; // COM velocity - double fcm[3]; // force on COM - double torque[3]; // torque around COM - double quat[4]; // quaternion for orientation of body - double inertia[3]; // 3 principal components of inertia - double ex_space[3]; // principal axes in space coords + double mass; // total mass of body + double xcm[3]; // COM position + double vcm[3]; // COM velocity + double fcm[3]; // force on COM + double torque[3]; // torque around COM + double quat[4]; // quaternion for orientation of body + double inertia[3]; // 3 principal components of inertia + double ex_space[3]; // principal axes in space coords double ey_space[3]; double ez_space[3]; - double angmom[3]; // space-frame angular momentum of body - double omega[3]; // space-frame omega of body - double conjqm[4]; // conjugate quaternion momentum - imageint image; // image flags of xcm - int remapflag[4]; // PBC remap flags - int ilocal; // index of owning atom + double angmom[3]; // space-frame angular momentum of body + double omega[3]; // space-frame omega of body + double conjqm[4]; // conjugate quaternion momentum + imageint image; // image flags of xcm + int remapflag[4]; // PBC remap flags + int ilocal; // index of owning atom }; - Body *body; // list of rigid bodies, owned and ghost - int nlocal_body; // # of owned rigid bodies - int nghost_body; // # of ghost rigid bodies - int nmax_body; // max # of bodies that body can hold - int bodysize; // sizeof(Body) in doubles + Body *body; // list of rigid bodies, owned and ghost + int nlocal_body; // # of owned rigid bodies + int nghost_body; // # of ghost rigid bodies + int nmax_body; // max # of bodies that body can hold + int bodysize; // sizeof(Body) in doubles // per-atom quantities // only defined for owned atoms, except bodyown for own+ghost - int *bodyown; // index of body if atom owns a body, -1 if not - tagint *bodytag; // ID of body this atom is in, 0 if none - // ID = tag of atom that owns body - int *atom2body; // index of owned/ghost body this atom is in, -1 if not - // can point to original or any image of the body - imageint *xcmimage; // internal image flags for atoms in rigid bodies - // set relative to in-box xcm of each body - double **displace; // displacement of each atom in body coords - int *eflags; // flags for extended particles - double **orient; // orientation vector of particle wrt rigid body - double **dorient; // orientation of dipole mu wrt rigid body + int *bodyown; // index of body if atom owns a body, -1 if not + tagint *bodytag; // ID of body this atom is in, 0 if none + // ID = tag of atom that owns body + int *atom2body; // index of owned/ghost body this atom is in, -1 if not + // can point to original or any image of the body + imageint *xcmimage; // internal image flags for atoms in rigid bodies + // set relative to in-box xcm of each body + double **displace; // displacement of each atom in body coords + int *eflags; // flags for extended particles + double **orient; // orientation vector of particle wrt rigid body + double **dorient; // orientation of dipole mu wrt rigid body - int extended; // 1 if any particles have extended attributes - int orientflag; // 1 if particles store spatial orientation - int dorientflag; // 1 if particles store dipole orientation - int reinitflag; // 1 if re-initialize rigid bodies between runs + int extended; // 1 if any particles have extended attributes + int orientflag; // 1 if particles store spatial orientation + int dorientflag; // 1 if particles store dipole orientation + int reinitflag; // 1 if re-initialize rigid bodies between runs class AtomVecEllipsoid *avec_ellipsoid; class AtomVecLine *avec_line; @@ -134,8 +134,8 @@ class FixRigidSmall : public Fix { // temporary per-body storage - int **counts; // counts of atom types in bodies - double **itensor; // 6 space-frame components of inertia tensor + int **counts; // counts of atom types in bodies + double **itensor; // 6 space-frame components of inertia tensor // mass per body, accessed by granular pair styles @@ -144,30 +144,30 @@ class FixRigidSmall : public Fix { // Langevin thermostatting - int langflag; // 0/1 = no/yes Langevin thermostat - double t_start,t_stop,t_period; // thermostat params - double **langextra; // Langevin thermostat forces and torques - int maxlang; // max size of langextra - class RanMars *random; // RNG + int langflag; // 0/1 = no/yes Langevin thermostat + double t_start, t_stop, t_period; // thermostat params + double **langextra; // Langevin thermostat forces and torques + int maxlang; // max size of langextra + class RanMars *random; // RNG - int tstat_flag,pstat_flag; // 0/1 = no/yes thermostat/barostat + int tstat_flag, pstat_flag; // 0/1 = no/yes thermostat/barostat - int t_chain,t_iter,t_order; + int t_chain, t_iter, t_order; - double p_start[3],p_stop[3]; - double p_period[3],p_freq[3]; + double p_start[3], p_stop[3]; + double p_period[3], p_freq[3]; int p_flag[3]; - int pcouple,pstyle; + int pcouple, pstyle; int p_chain; - int allremap; // remap all atoms - int dilate_group_bit; // mask for dilation group - char *id_dilate; // group name to dilate + int allremap; // remap all atoms + int dilate_group_bit; // mask for dilation group + char *id_dilate; // group name to dilate - char *id_gravity; // ID of fix gravity command to add gravity forces - double *gvec; // ptr to gravity vector inside the fix + char *id_gravity; // ID of fix gravity command to add gravity forces + double *gvec; // ptr to gravity vector inside the fix - double p_current[3],p_target[3]; + double p_current[3], p_target[3]; // molecules added on-the-fly as rigid bodies @@ -179,8 +179,8 @@ class FixRigidSmall : public Fix { double rsqfar; struct InRvous { - int me,ilocal; - tagint atomID,bodyID; + int me, ilocal; + tagint atomID, bodyID; double x[3]; }; @@ -212,7 +212,7 @@ class FixRigidSmall : public Fix { //void check(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index 56ce6415de..709327b1d6 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/RIGID/fix_shake.h b/src/RIGID/fix_shake.h index d627986038..c5563ea9b9 100644 --- a/src/RIGID/fix_shake.h +++ b/src/RIGID/fix_shake.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(shake,FixShake) - +// clang-format off +FixStyle(shake,FixShake); +// clang-format on #else #ifndef LMP_FIX_SHAKE_H @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixShake : public Fix { - friend class FixEHEX; + friend class FixEHEX; public: FixShake(class LAMMPS *, int, char **); @@ -59,64 +59,64 @@ class FixShake : public Fix { void *extract(const char *, int &); protected: - int vflag_post_force; // store the vflag of last post_force call - int respa; // 0 = vel. Verlet, 1 = respa - int me,nprocs; - int rattle; // 0 = SHAKE, 1 = RATTLE - double tolerance; // SHAKE tolerance - int max_iter; // max # of SHAKE iterations - int output_every; // SHAKE stat output every so often - bigint next_output; // timestep for next output + int vflag_post_force; // store the vflag of last post_force call + int respa; // 0 = vel. Verlet, 1 = respa + int me, nprocs; + int rattle; // 0 = SHAKE, 1 = RATTLE + double tolerance; // SHAKE tolerance + int max_iter; // max # of SHAKE iterations + int output_every; // SHAKE stat output every so often + bigint next_output; // timestep for next output - // settings from input command - int *bond_flag,*angle_flag; // bond/angle types to constrain - int *type_flag; // constrain bonds to these types - double *mass_list; // constrain bonds to these masses - int nmass; // # of masses in mass_list + // settings from input command + int *bond_flag, *angle_flag; // bond/angle types to constrain + int *type_flag; // constrain bonds to these types + double *mass_list; // constrain bonds to these masses + int nmass; // # of masses in mass_list - int molecular; // copy of atom->molecular - double *bond_distance,*angle_distance; // constraint distances + int molecular; // copy of atom->molecular + double *bond_distance, *angle_distance; // constraint distances - int ifix_respa; // rRESPA fix needed by SHAKE - int nlevels_respa; // copies of needed rRESPA variables + int ifix_respa; // rRESPA fix needed by SHAKE + int nlevels_respa; // copies of needed rRESPA variables int *loop_respa; double *step_respa; - double **x,**v,**f; // local ptrs to atom class quantities - double **ftmp,**vtmp; // pointers to temporary arrays for f,v + double **x, **v, **f; // local ptrs to atom class quantities + double **ftmp, **vtmp; // pointers to temporary arrays for f,v - double *mass,*rmass; + double *mass, *rmass; int *type; int nlocal; - // atom-based arrays - int *shake_flag; // 0 if atom not in SHAKE cluster - // 1 = size 3 angle cluster - // 2,3,4 = size of bond-only cluster - tagint **shake_atom; // global IDs of atoms in cluster - // central atom is 1st - // lowest global ID is 1st for size 2 - int **shake_type; // bondtype of each bond in cluster - // for angle cluster, 3rd value - // is angletype - double **xshake; // unconstrained atom coords - int *nshake; // count + // atom-based arrays + int *shake_flag; // 0 if atom not in SHAKE cluster + // 1 = size 3 angle cluster + // 2,3,4 = size of bond-only cluster + tagint **shake_atom; // global IDs of atoms in cluster + // central atom is 1st + // lowest global ID is 1st for size 2 + int **shake_type; // bondtype of each bond in cluster + // for angle cluster, 3rd value + // is angletype + double **xshake; // unconstrained atom coords + int *nshake; // count - double dtv,dtfsq; // timesteps for trial move - double dtf_inner,dtf_innerhalf; // timesteps for rRESPA trial move + double dtv, dtfsq; // timesteps for trial move + double dtf_inner, dtf_innerhalf; // timesteps for rRESPA trial move - int *list; // list of clusters to SHAKE - int nlist,maxlist; // size and max-size of list + int *list; // list of clusters to SHAKE + int nlist, maxlist; // size and max-size of list - // stat quantities - int *b_count,*b_count_all; // counts for each bond type - double *b_ave,*b_max,*b_min; // ave/max/min dist for each bond type - double *b_ave_all,*b_max_all,*b_min_all; // MPI summing arrays - int *a_count,*a_count_all; // ditto for angle types - double *a_ave,*a_max,*a_min; - double *a_ave_all,*a_max_all,*a_min_all; + // stat quantities + int *b_count, *b_count_all; // counts for each bond type + double *b_ave, *b_max, *b_min; // ave/max/min dist for each bond type + double *b_ave_all, *b_max_all, *b_min_all; // MPI summing arrays + int *a_count, *a_count_all; // ditto for angle types + double *a_ave, *a_max, *a_min; + double *a_ave_all, *a_max_all, *a_min_all; - class Molecule **atommols; // atom style template pointer - class Molecule **onemols; // molecule added on-the-fly + class Molecule **atommols; // atom style template pointer + class Molecule **onemols; // molecule added on-the-fly int nmol; void find_clusters(); @@ -148,12 +148,12 @@ class FixShake : public Fix { }; struct PartnerInfo { - tagint atomID,partnerID; - int mask,type,massflag,bondtype; + tagint atomID, partnerID; + int mask, type, massflag, bondtype; }; struct NShakeInfo { - tagint atomID,partnerID; + tagint atomID, partnerID; int nshake; }; @@ -172,7 +172,7 @@ class FixShake : public Fix { static int rendezvous_shake(int, char *, int &, int *&, char *&, void *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/rigid_const.h b/src/RIGID/rigid_const.h index b37bd9fad2..16f20d567e 100644 --- a/src/RIGID/rigid_const.h +++ b/src/RIGID/rigid_const.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -10,6 +10,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +// clang-format off #ifndef LMP_RIGID_CONST_H #define LMP_RIGID_CONST_H @@ -17,10 +18,10 @@ namespace LAMMPS_NS { namespace RigidConst { - enum{SINGLE,MOLECULE,GROUP}; - enum{NONE,XYZ,XY,YZ,XZ}; - enum{ISO,ANISO,TRICLINIC}; - enum{FULL_BODY,INITIAL,FINAL,FORCE_TORQUE,VCM_ANGMOM,XCM_MASS,ITENSOR,DOF}; + enum{SINGLE, MOLECULE, GROUP}; + enum{NONE, XYZ, XY, YZ, XZ}; + enum{ISO, ANISO, TRICLINIC}; + enum{FULL_BODY, INITIAL, FINAL, FORCE_TORQUE, VCM_ANGMOM, XCM_MASS, ITENSOR, DOF}; enum {POINT = 1<<0, SPHERE = 1<<1, diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp index 8887139ee2..38bba33adf 100644 --- a/src/SHOCK/fix_append_atoms.cpp +++ b/src/SHOCK/fix_append_atoms.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SHOCK/fix_append_atoms.h b/src/SHOCK/fix_append_atoms.h index e2cf1cb025..a8ba145b97 100644 --- a/src/SHOCK/fix_append_atoms.h +++ b/src/SHOCK/fix_append_atoms.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(append/atoms,FixAppendAtoms) - +// clang-format off +FixStyle(append/atoms,FixAppendAtoms); +// clang-format on #else #ifndef FIX_APPEND_ATOMS_H @@ -44,14 +44,14 @@ class FixAppendAtoms : public Fix { int scaleflag, freq; int nbasis; int *basistype; - int advance,advance_sum; - double size,spatlead; + int advance, advance_sum; + double size, spatlead; char *spatialid; double tfactor; - double *gfactor1,*gfactor2; + double *gfactor1, *gfactor2; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp index 9e6ef32f5a..e8430b6ab1 100644 --- a/src/SHOCK/fix_msst.cpp +++ b/src/SHOCK/fix_msst.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SHOCK/fix_msst.h b/src/SHOCK/fix_msst.h index e253e1860f..76bfbf6d55 100644 --- a/src/SHOCK/fix_msst.h +++ b/src/SHOCK/fix_msst.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(msst,FixMSST) - +// clang-format off +FixStyle(msst,FixMSST); +// clang-format on #else #ifndef FIX_MSST_H @@ -41,59 +41,59 @@ class FixMSST : public Fix { double memory_usage(); private: - double dtv,dtf,dthalf; // full and half step sizes - double boltz,nktv2p, mvv2e; // Boltzmann factor and unit conversions - double total_mass; // mass of the computational cell + double dtv, dtf, dthalf; // full and half step sizes + double boltz, nktv2p, mvv2e; // Boltzmann factor and unit conversions + double total_mass; // mass of the computational cell - double omega[3]; // time derivative of the volume - double p_current[3],dilation[3]; - double qmass; // effective cell mass - double mu; // effective cell viscosity - double tscale; // converts thermal energy to compressive - // strain ke at simulation start - int dftb; // flag for use with DFTB+ + double omega[3]; // time derivative of the volume + double p_current[3], dilation[3]; + double qmass; // effective cell mass + double mu; // effective cell viscosity + double tscale; // converts thermal energy to compressive + // strain ke at simulation start + int dftb; // flag for use with DFTB+ - double velocity_sum; // sum of the velocities squared - double damping; // damping function for TS force term at - // small volume difference (v0 - vol) - double T0S0; // initial TS term for DFTB+ simulations - double S_elec,S_elec_1,S_elec_2; // time history of electron entropy - // for DFTB+ simulaitons - double TS_dot; // time derivative of TS term for - // DFTB+ simulations + double velocity_sum; // sum of the velocities squared + double damping; // damping function for TS force term at + // small volume difference (v0 - vol) + double T0S0; // initial TS term for DFTB+ simulations + double S_elec, S_elec_1, S_elec_2; // time history of electron entropy + // for DFTB+ simulaitons + double TS_dot; // time derivative of TS term for + // DFTB+ simulations - double **old_velocity; // saved velocities + double **old_velocity; // saved velocities - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int *rfix; // indices of rigid fixes + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int *rfix; // indices of rigid fixes - char *id_temp,*id_press; // strings with identifiers of - char *id_pe; // created computes + char *id_temp, *id_press; // strings with identifiers of + char *id_pe; // created computes - class Compute *temperature; // computes created to evaluate - class Compute *pressure; // thermodynamic quantities + class Compute *temperature; // computes created to evaluate + class Compute *pressure; // thermodynamic quantities class Compute *pe; - int tflag,pflag,vsflag,peflag; // flags to keep track of computes that - // were created + int tflag, pflag, vsflag, peflag; // flags to keep track of computes that + // were created // shock initial conditions - double e0; // initial energy - double v0; // initial volume - double p0; // initial pressure - double velocity; // velocity of the shock - double lagrangian_position; // Lagrangian location of computational cell - int direction; // direction of shock - int p0_set; // is pressure set - int v0_set; // is volume set - int e0_set; // is energy set - double TS_int; // needed for conserved quantity - // with thermal electronic excitations - double beta; // energy conservation scaling factor + double e0; // initial energy + double v0; // initial volume + double p0; // initial pressure + double velocity; // velocity of the shock + double lagrangian_position; // Lagrangian location of computational cell + int direction; // direction of shock + int p0_set; // is pressure set + int v0_set; // is volume set + int e0_set; // is energy set + double TS_int; // needed for conserved quantity + // with thermal electronic excitations + double beta; // energy conservation scaling factor - int maxold; // allocated size of old_velocity - class FixExternal *fix_external; // ptr to fix external + int maxold; // allocated size of old_velocity + class FixExternal *fix_external; // ptr to fix external // functions @@ -108,7 +108,7 @@ class FixMSST : public Fix { double compute_vsum(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SHOCK/fix_nphug.cpp b/src/SHOCK/fix_nphug.cpp index 20038c7df6..ff1025c840 100644 --- a/src/SHOCK/fix_nphug.cpp +++ b/src/SHOCK/fix_nphug.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SHOCK/fix_nphug.h b/src/SHOCK/fix_nphug.h index bdf28d75d1..57b4dabc9c 100644 --- a/src/SHOCK/fix_nphug.h +++ b/src/SHOCK/fix_nphug.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nphug,FixNPHug) - +// clang-format off +FixStyle(nphug,FixNPHug); +// clang-format on #else #ifndef LMP_FIX_NPHUG_H @@ -31,11 +31,11 @@ class FixNPHug : public FixNH { void init(); void setup(int); int modify_param(int, char **); - int pack_restart_data(double *); // pack restart data + int pack_restart_data(double *); // pack restart data void restart(char *); private: - class Compute *pe; // PE compute pointer + class Compute *pe; // PE compute pointer void compute_temp_target(); double compute_vector(int); @@ -47,15 +47,15 @@ class FixNPHug : public FixNH { char *id_pe; int peflag; - int v0_set,p0_set,e0_set; - double v0,p0,e0,rho0; + int v0_set, p0_set, e0_set; + double v0, p0, e0, rho0; int idir; int uniaxial; int size_restart_global(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SHOCK/fix_wall_piston.cpp b/src/SHOCK/fix_wall_piston.cpp index 0111214ae9..be2d51f2c4 100644 --- a/src/SHOCK/fix_wall_piston.cpp +++ b/src/SHOCK/fix_wall_piston.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SHOCK/fix_wall_piston.h b/src/SHOCK/fix_wall_piston.h index 1801d5c86a..5d2e02a21e 100644 --- a/src/SHOCK/fix_wall_piston.h +++ b/src/SHOCK/fix_wall_piston.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,9 +11,9 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/piston,FixWallPiston) - +// clang-format off +FixStyle(wall/piston,FixWallPiston); +// clang-format on #else #ifndef LMP_FIX_WALL_PISTON_H @@ -32,16 +32,18 @@ class FixWallPiston : public Fix { void initial_integrate(int); private: - int xloflag,xhiflag,yloflag,yhiflag,zloflag,zhiflag; - int scaleflag, roughflag, rampflag, rampNL1flag, rampNL2flag, rampNL3flag, rampNL4flag, rampNL5flag; - double roughdist,roughoff,x0,y0,z0,vx,vy,vz,maxvx,maxvy,maxvz,paccelx,paccely,paccelz, angfreq; + int xloflag, xhiflag, yloflag, yhiflag, zloflag, zhiflag; + int scaleflag, roughflag, rampflag, rampNL1flag, rampNL2flag, rampNL3flag, rampNL4flag, + rampNL5flag; + double roughdist, roughoff, x0, y0, z0, vx, vy, vz, maxvx, maxvy, maxvz, paccelx, paccely, + paccelz, angfreq; int tempflag, tseed; double t_target, t_period, t_extent; class RanMars *randomt; - double *gfactor1,*gfactor2; + double *gfactor1, *gfactor2; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SNAP/compute_sna_atom.cpp b/src/SNAP/compute_sna_atom.cpp index 47679fd8cc..3f5c1be3c0 100644 --- a/src/SNAP/compute_sna_atom.cpp +++ b/src/SNAP/compute_sna_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SNAP/compute_sna_atom.h b/src/SNAP/compute_sna_atom.h index c9ef46a2f5..3bcf217b51 100644 --- a/src/SNAP/compute_sna_atom.h +++ b/src/SNAP/compute_sna_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(sna/atom,ComputeSNAAtom) - +// clang-format off +ComputeStyle(sna/atom,ComputeSNAAtom); +// clang-format on #else #ifndef LMP_COMPUTE_SNA_ATOM_H @@ -42,14 +42,14 @@ class ComputeSNAAtom : public Compute { double rcutfac; double *radelem; double *wjelem; - int * map; // map types to [0,nelements) + int *map; // map types to [0,nelements) int nelements, chemflag; - class SNA* snaptr; + class SNA *snaptr; double cutmax; int quadraticflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SNAP/compute_snad_atom.cpp b/src/SNAP/compute_snad_atom.cpp index 0e2a74eea0..6815e25c68 100644 --- a/src/SNAP/compute_snad_atom.cpp +++ b/src/SNAP/compute_snad_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SNAP/compute_snad_atom.h b/src/SNAP/compute_snad_atom.h index e5c54226e8..f175538d5f 100644 --- a/src/SNAP/compute_snad_atom.h +++ b/src/SNAP/compute_snad_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(snad/atom,ComputeSNADAtom) - +// clang-format off +ComputeStyle(snad/atom,ComputeSNADAtom); +// clang-format on #else #ifndef LMP_COMPUTE_SNAD_ATOM_H @@ -44,14 +44,14 @@ class ComputeSNADAtom : public Compute { double rcutfac; double *radelem; double *wjelem; - int *map; // map types to [0,nelements) + int *map; // map types to [0,nelements) int nelements, chemflag; - class SNA* snaptr; + class SNA *snaptr; double cutmax; int quadraticflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SNAP/compute_snap.cpp b/src/SNAP/compute_snap.cpp index d7655dba5f..63deff9f8f 100644 --- a/src/SNAP/compute_snap.cpp +++ b/src/SNAP/compute_snap.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SNAP/compute_snap.h b/src/SNAP/compute_snap.h index 43fe4df882..131fafd68c 100644 --- a/src/SNAP/compute_snap.h +++ b/src/SNAP/compute_snap.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(snap,ComputeSnap) - +// clang-format off +ComputeStyle(snap,ComputeSnap); +// clang-format on #else #ifndef LMP_COMPUTE_SNAP_H @@ -44,9 +44,9 @@ class ComputeSnap : public Compute { double rcutfac; double *radelem; double *wjelem; - int *map; // map types to [0,nelements) + int *map; // map types to [0,nelements) int nelements, chemflag; - class SNA* snaptr; + class SNA *snaptr; double cutmax; int quadraticflag; @@ -56,7 +56,7 @@ class ComputeSnap : public Compute { void dbdotr_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SNAP/compute_snav_atom.cpp b/src/SNAP/compute_snav_atom.cpp index 4a6fa3c717..64f9faebe2 100644 --- a/src/SNAP/compute_snav_atom.cpp +++ b/src/SNAP/compute_snav_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SNAP/compute_snav_atom.h b/src/SNAP/compute_snav_atom.h index 36a64239da..0c3fce54bb 100644 --- a/src/SNAP/compute_snav_atom.h +++ b/src/SNAP/compute_snav_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(snav/atom,ComputeSNAVAtom) - +// clang-format off +ComputeStyle(snav/atom,ComputeSNAVAtom); +// clang-format on #else #ifndef LMP_COMPUTE_SNAV_ATOM_H @@ -44,13 +44,13 @@ class ComputeSNAVAtom : public Compute { double rcutfac; double *radelem; double *wjelem; - int *map; // map types to [0,nelements) + int *map; // map types to [0,nelements) int nelements, chemflag; - class SNA* snaptr; + class SNA *snaptr; int quadraticflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SNAP/pair_snap.cpp b/src/SNAP/pair_snap.cpp index 314bb7ca37..b8d8333902 100644 --- a/src/SNAP/pair_snap.cpp +++ b/src/SNAP/pair_snap.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SNAP/pair_snap.h b/src/SNAP/pair_snap.h index 3f8393b03c..0cc38ef9cb 100644 --- a/src/SNAP/pair_snap.h +++ b/src/SNAP/pair_snap.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(snap,PairSNAP) - +// clang-format off +PairStyle(snap,PairSNAP); +// clang-format on #else #ifndef LMP_PAIR_SNAP_H @@ -25,7 +25,7 @@ PairStyle(snap,PairSNAP) namespace LAMMPS_NS { class PairSNAP : public Pair { -public: + public: PairSNAP(class LAMMPS *); ~PairSNAP(); virtual void compute(int, int); @@ -35,35 +35,35 @@ public: virtual double init_one(int, int); virtual double memory_usage(); - double rcutfac, quadraticflag; // declared public to workaround gcc 4.9 - int ncoeff; // compiler bug, manifest in KOKKOS package + double rcutfac, quadraticflag; // declared public to workaround gcc 4.9 + int ncoeff; // compiler bug, manifest in KOKKOS package -protected: + protected: int ncoeffq, ncoeffall; - class SNA* snaptr; + class SNA *snaptr; virtual void allocate(); void read_files(char *, char *); - inline int equal(double* x,double* y); - inline double dist2(double* x,double* y); + inline int equal(double *x, double *y); + inline double dist2(double *x, double *y); void compute_beta(); void compute_bispectrum(); - double rcutmax; // max cutoff for all elements - double *radelem; // element radii - double *wjelem; // elements weights - double **coeffelem; // element bispectrum coefficients - double** beta; // betas for all atoms in list - double** bispectrum; // bispectrum components for all atoms in list + double rcutmax; // max cutoff for all elements + double *radelem; // element radii + double *wjelem; // elements weights + double **coeffelem; // element bispectrum coefficients + double **beta; // betas for all atoms in list + double **bispectrum; // bispectrum components for all atoms in list int twojmax, switchflag, bzeroflag, bnormflag; int chemflag, wselfallflag; int chunksize; double rfac0, rmin0, wj1, wj2; - int rcutfacflag, twojmaxflag; // flags for required parameters - int beta_max; // length of beta + int rcutfacflag, twojmaxflag; // flags for required parameters + int beta_max; // length of beta }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SNAP/sna.cpp b/src/SNAP/sna.cpp index 5568dd002e..8a7ffa9f45 100644 --- a/src/SNAP/sna.cpp +++ b/src/SNAP/sna.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SNAP/sna.h b/src/SNAP/sna.h index 1444fecaf7..bd2249a101 100644 --- a/src/SNAP/sna.h +++ b/src/SNAP/sna.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -32,10 +32,10 @@ struct SNA_BINDICES { class SNA : protected Pointers { -public: - SNA(LAMMPS*, double, int, double, int, int, int, int, int, int); + public: + SNA(LAMMPS *, double, int, double, int, int, int, int, int, int); - SNA(LAMMPS* lmp) : Pointers(lmp) {}; + SNA(LAMMPS *lmp) : Pointers(lmp){}; ~SNA(); void build_indexlist(); void init(); @@ -47,58 +47,56 @@ public: void compute_ui(int, int); void compute_zi(); - void compute_yi(const double*); - void compute_yterm(int, int, int, const double*); + void compute_yi(const double *); + void compute_yterm(int, int, int, const double *); void compute_bi(int); // functions for derivatives - void compute_duidrj(double*, double, double, int, int); + void compute_duidrj(double *, double, double, int, int); void compute_dbidrj(); - void compute_deidrj(double*); + void compute_deidrj(double *); double compute_sfac(double, double); double compute_dsfac(double, double); - double* blist; - double** dblist; - double** rij; - int* inside; - double* wj; - double* rcutij; - int* element; // index on [0,nelements) + double *blist; + double **dblist; + double **rij; + int *inside; + double *wj; + double *rcutij; + int *element; // index on [0,nelements) int nmax; void grow_rij(int); int twojmax; - double* ylist_r, * ylist_i; + double *ylist_r, *ylist_i; int idxcg_max, idxu_max, idxz_max, idxb_max; - - -private: + private: double rmin0, rfac0; // data for bispectrum coefficients - SNA_ZINDICES* idxz; - SNA_BINDICES* idxb; + SNA_ZINDICES *idxz; + SNA_BINDICES *idxb; - double** rootpqarray; - double* cglist; - int*** idxcg_block; + double **rootpqarray; + double *cglist; + int ***idxcg_block; - double* ulisttot_r, * ulisttot_i; - double** ulist_r_ij, ** ulist_i_ij; - int* idxu_block; + double *ulisttot_r, *ulisttot_i; + double **ulist_r_ij, **ulist_i_ij; + int *idxu_block; - double* zlist_r, * zlist_i; - int*** idxz_block; + double *zlist_r, *zlist_i; + int ***idxz_block; - int*** idxb_block; + int ***idxb_block; - double** dulist_r, ** dulist_i; - int elem_duarray; // element of j in derivative + double **dulist_r, **dulist_i; + int elem_duarray; // element of j in derivative void create_twojmax_arrays(); void destroy_twojmax_arrays(); @@ -107,12 +105,10 @@ private: void init_rootpqarray(); void zero_uarraytot(int); void add_uarraytot(double, double, double, int, int); - void compute_uarray(double, double, double, - double, double, int); + void compute_uarray(double, double, double, double, double, int); double deltacg(int, int, int); void compute_ncoeff(); - void compute_duarray(double, double, double, - double, double, double, double, double, int); + void compute_duarray(double, double, double, double, double, double, double, double, int); // Sets the style for the switching function // 0 = none @@ -122,17 +118,17 @@ private: // Self-weight double wself; - int bzero_flag; // 1 if bzero subtracted from barray - double* bzero; // array of B values for isolated atoms - int bnorm_flag; // 1 if barray divided by j+1 - int chem_flag; // 1 for multi-element bispectrum components - int wselfall_flag; // 1 for adding wself to all element labelings - int nelements; // number of elements - int ndoubles; // number of multi-element pairs - int ntriples; // number of multi-element triplets + int bzero_flag; // 1 if bzero subtracted from barray + double *bzero; // array of B values for isolated atoms + int bnorm_flag; // 1 if barray divided by j+1 + int chem_flag; // 1 for multi-element bispectrum components + int wselfall_flag; // 1 for adding wself to all element labelings + int nelements; // number of elements + int ndoubles; // number of multi-element pairs + int ntriples; // number of multi-element triplets }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/SPIN/atom_vec_spin.cpp b/src/SPIN/atom_vec_spin.cpp index c15cf0fd7c..645f86dde2 100644 --- a/src/SPIN/atom_vec_spin.cpp +++ b/src/SPIN/atom_vec_spin.cpp @@ -1,7 +1,8 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/atom_vec_spin.h b/src/SPIN/atom_vec_spin.h index 6aa1cccee0..ff995d2f13 100644 --- a/src/SPIN/atom_vec_spin.h +++ b/src/SPIN/atom_vec_spin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(spin,AtomVecSpin) - +// clang-format off +AtomStyle(spin,AtomVecSpin); +// clang-format on #else #ifndef LMP_ATOM_VEC_SPIN_H @@ -33,10 +33,10 @@ class AtomVecSpin : public AtomVec { void data_atom_post(int); private: - double **sp,**fm,**fm_long; + double **sp, **fm, **fm_long; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/compute_spin.cpp b/src/SPIN/compute_spin.cpp index c43e7784b4..cebc0d9573 100644 --- a/src/SPIN/compute_spin.cpp +++ b/src/SPIN/compute_spin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -57,7 +58,7 @@ ComputeSpin::ComputeSpin(LAMMPS *lmp, int narg, char **arg) : long_spin_flag = 0; precession_spin_flag = 0; - init(); + ComputeSpin::init(); allocate(); diff --git a/src/SPIN/compute_spin.h b/src/SPIN/compute_spin.h index 3b4c28674e..766cfa4ccd 100644 --- a/src/SPIN/compute_spin.h +++ b/src/SPIN/compute_spin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(spin,ComputeSpin) - +// clang-format off +ComputeStyle(spin,ComputeSpin); +// clang-format on #else #ifndef LMP_COMPUTE_SPIN_H @@ -32,11 +32,11 @@ class ComputeSpin : public Compute { void compute_vector(); private: - int pair_spin_flag; // magnetic pair flags - int long_spin_flag; // magnetic long-range flag - int precession_spin_flag; // magnetic precession flags + int pair_spin_flag; // magnetic pair flags + int long_spin_flag; // magnetic long-range flag + int precession_spin_flag; // magnetic precession flags - double kb,hbar; + double kb, hbar; // pointers to magnetic fixes @@ -44,14 +44,14 @@ class ComputeSpin : public Compute { // pointers to magnetic pair styles - int npairs, npairspin; // # of pairs, and # of spin pairs + int npairs, npairspin; // # of pairs, and # of spin pairs class Pair *pair; - class PairSpin **spin_pairs; // vector of spin pairs + class PairSpin **spin_pairs; // vector of spin pairs void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index ae9d637180..7d9af83d12 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/fix_langevin_spin.h b/src/SPIN/fix_langevin_spin.h index 3e228536a2..c9608748d9 100644 --- a/src/SPIN/fix_langevin_spin.h +++ b/src/SPIN/fix_langevin_spin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(langevin/spin,FixLangevinSpin) - +// clang-format off +FixStyle(langevin/spin,FixLangevinSpin); +// clang-format on #else #ifndef LMP_FIX_LANGEVIN_SPIN_H @@ -26,31 +26,30 @@ namespace LAMMPS_NS { class FixLangevinSpin : public Fix { public: - int tdamp_flag,temp_flag; // damping and temperature flags + int tdamp_flag, temp_flag; // damping and temperature flags FixLangevinSpin(class LAMMPS *, int, char **); virtual ~FixLangevinSpin(); int setmask(); void init(); void setup(int); - void add_tdamping(double *, double *); // add transverse damping + void add_tdamping(double *, double *); // add transverse damping void add_temperature(double[3]); void compute_single_langevin(int, double *, double *); protected: - double alpha_t; // transverse mag. damping - double dts; // magnetic timestep - double temp; // spin bath temperature - double D,sigma; // bath intensity var. - double gil_factor; // gilbert's prefactor + double alpha_t; // transverse mag. damping + double dts; // magnetic timestep + double temp; // spin bath temperature + double D, sigma; // bath intensity var. + double gil_factor; // gilbert's prefactor int nlevels_respa; class RanMars *random; int seed; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/fix_neb_spin.cpp b/src/SPIN/fix_neb_spin.cpp index 7bef18e9e7..de50cac764 100644 --- a/src/SPIN/fix_neb_spin.cpp +++ b/src/SPIN/fix_neb_spin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/fix_neb_spin.h b/src/SPIN/fix_neb_spin.h index 3c095ef3c2..5ddef9c791 100644 --- a/src/SPIN/fix_neb_spin.h +++ b/src/SPIN/fix_neb_spin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(neb/spin,FixNEBSpin) - +// clang-format off +FixStyle(neb/spin,FixNEBSpin); +// clang-format on #else #ifndef LMP_FIX_NEB_SPIN_H @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixNEBSpin : public Fix { public: - double veng,plen,nlen,dotpath,dottangrad,gradlen,dotgrad; + double veng, plen, nlen, dotpath, dottangrad, gradlen, dotgrad; int rclimber; FixNEBSpin(class LAMMPS *, int, char **); @@ -37,50 +37,49 @@ class FixNEBSpin : public Fix { void min_post_force(int); private: - int me,nprocs,nprocs_universe; - double kspring,kspringIni,kspringFinal,kspringPerp,EIniIni,EFinalIni; - bool StandardNEB,NEBLongRange,PerpSpring,FreeEndIni,FreeEndFinal; - bool FreeEndFinalWithRespToEIni,FinalAndInterWithRespToEIni; + int me, nprocs, nprocs_universe; + double kspring, kspringIni, kspringFinal, kspringPerp, EIniIni, EFinalIni; + bool StandardNEB, NEBLongRange, PerpSpring, FreeEndIni, FreeEndFinal; + bool FreeEndFinalWithRespToEIni, FinalAndInterWithRespToEIni; bool SpinLattice; - int ireplica,nreplica; - int procnext,procprev; + int ireplica, nreplica; + int procnext, procprev; int cmode; MPI_Comm uworld; MPI_Comm rootworld; - char *id_pe; class Compute *pe; int nebatoms; - int ntotal; // total # of atoms, NEB or not - int maxlocal; // size of xprev,xnext,tangent arrays + int ntotal; // total # of atoms, NEB or not + int maxlocal; // size of xprev,xnext,tangent arrays double *nlenall; - double **xprev,**xnext,**fnext; - double **spprev,**spnext,**fmnext; + double **xprev, **xnext, **fnext; + double **spprev, **spnext, **fmnext; double **springF; double **tangent; - double **xsend,**xrecv; // coords to send/recv to/from other replica - double **fsend,**frecv; // coords to send/recv to/from other replica - double **spsend,**sprecv; // sp to send/recv to/from other replica - double **fmsend,**fmrecv; // fm to send/recv to/from other replica - tagint *tagsend,*tagrecv; // ditto for atom IDs + double **xsend, **xrecv; // coords to send/recv to/from other replica + double **fsend, **frecv; // coords to send/recv to/from other replica + double **spsend, **sprecv; // sp to send/recv to/from other replica + double **fmsend, **fmrecv; // fm to send/recv to/from other replica + tagint *tagsend, *tagrecv; // ditto for atom IDs - // info gathered from all procs in my replica - double **xsendall,**xrecvall; // coords to send/recv to/from other replica - double **fsendall,**frecvall; // force to send/recv to/from other replica - double **spsendall,**sprecvall; // sp to send/recv to/from other replica - double **fmsendall,**fmrecvall; // fm to send/recv to/from other replica - tagint *tagsendall,*tagrecvall; // ditto for atom IDs + // info gathered from all procs in my replica + double **xsendall, **xrecvall; // coords to send/recv to/from other replica + double **fsendall, **frecvall; // force to send/recv to/from other replica + double **spsendall, **sprecvall; // sp to send/recv to/from other replica + double **fmsendall, **fmrecvall; // fm to send/recv to/from other replica + tagint *tagsendall, *tagrecvall; // ditto for atom IDs - int *counts,*displacements; // used for MPI_Gather + int *counts, *displacements; // used for MPI_Gather double geodesic_distance(double *, double *); void inter_replica_comm(); void reallocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index b340a08c65..e6929d2d72 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/fix_nve_spin.h b/src/SPIN/fix_nve_spin.h index a10b36908b..718eb3a733 100644 --- a/src/SPIN/fix_nve_spin.h +++ b/src/SPIN/fix_nve_spin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/spin,FixNVESpin) - +// clang-format off +FixStyle(nve/spin,FixNVESpin); +// clang-format on #else #ifndef LMP_FIX_NVE_SPIN_H @@ -25,7 +25,8 @@ FixStyle(nve/spin,FixNVESpin) namespace LAMMPS_NS { class FixNVESpin : public Fix { -friend class PairSpin; + friend class PairSpin; + public: FixNVESpin(class LAMMPS *, int, char **); virtual ~FixNVESpin(); @@ -37,35 +38,35 @@ friend class PairSpin; void ComputeInteractionsSpin(int); // compute and advance single spin functions void AdvanceSingleSpin(int); - void sectoring(); // sectoring operation functions + void sectoring(); // sectoring operation functions int coords2sector(double *); void setup_pre_neighbor(); void pre_neighbor(); - int lattice_flag; // lattice_flag = 0 if spins only - // lattice_flag = 1 if spin-lattice calc. + int lattice_flag; // lattice_flag = 0 if spins only + // lattice_flag = 1 if spin-lattice calc. protected: - int sector_flag; // sector_flag = 0 if serial algorithm - // sector_flag = 1 if parallel algorithm + int sector_flag; // sector_flag = 0 if serial algorithm + // sector_flag = 1 if parallel algorithm - double dtv, dtf, dts; // velocity, force, and spin timesteps + double dtv, dtf, dts; // velocity, force, and spin timesteps - int nlocal_max; // max value of nlocal (for size of lists) + int nlocal_max; // max value of nlocal (for size of lists) - int pair_spin_flag; // magnetic pair flags - int long_spin_flag; // magnetic long-range flag - int precession_spin_flag; // magnetic precession flags - int maglangevin_flag; // magnetic langevin flags + int pair_spin_flag; // magnetic pair flags + int long_spin_flag; // magnetic long-range flag + int precession_spin_flag; // magnetic precession flags + int maglangevin_flag; // magnetic langevin flags int tdamp_flag, temp_flag; int setforce_spin_flag; // pointers to magnetic pair styles - int npairs, npairspin; // # of pairs, and # of spin pairs + int npairs, npairspin; // # of pairs, and # of spin pairs class Pair *pair; - class PairSpin **spin_pairs; // vector of spin pairs + class PairSpin **spin_pairs; // vector of spin pairs // pointers to fix langevin/spin styles @@ -75,7 +76,7 @@ friend class PairSpin; // pointers to fix setforce/spin styles int nsetspin; - class FixSetForceSpin *locksetforcespin; // to be done + class FixSetForceSpin *locksetforcespin; // to be done // pointers to fix precession/spin styles @@ -89,14 +90,13 @@ friend class PairSpin; // stacking variables for sectoring algorithm - int *stack_head; // index of first atom in backward_stacks - int *stack_foot; // index of first atom in forward_stacks - int *backward_stacks; // index of next atom in backward stack - int *forward_stacks; // index of next atom in forward stack - + int *stack_head; // index of first atom in backward_stacks + int *stack_foot; // index of first atom in forward_stacks + int *backward_stacks; // index of next atom in backward stack + int *forward_stacks; // index of next atom in forward stack }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index e2ddccdd89..44cb6e1071 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/fix_precession_spin.h b/src/SPIN/fix_precession_spin.h index ac0c0eaf0b..dafc729337 100644 --- a/src/SPIN/fix_precession_spin.h +++ b/src/SPIN/fix_precession_spin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(precession/spin,FixPrecessionSpin) - +// clang-format off +FixStyle(precession/spin,FixPrecessionSpin); +// clang-format on #else #ifndef LMP_FIX_PRECESSION_SPIN_H @@ -69,11 +69,11 @@ class FixPrecessionSpin : public Fix { // storing magnetic energies - int nlocal_max; // max nlocal (for list size) - double *emag; // energy list + int nlocal_max; // max nlocal (for list size) + double *emag; // energy list protected: - int style; // style of the magnetic precession + int style; // style of the magnetic precession double degree2rad; double hbar; @@ -91,7 +91,7 @@ class FixPrecessionSpin : public Fix { double H_field; double nhx, nhy, nhz; - double hx, hy, hz; // temp. force variables + double hx, hy, hz; // temp. force variables // STT intensity and direction @@ -101,31 +101,30 @@ class FixPrecessionSpin : public Fix { // magnetic anisotropy intensity and direction - double Ka; // aniso const. in eV - double Kah; // aniso const. in rad.THz + double Ka; // aniso const. in eV + double Kah; // aniso const. in rad.THz double nax, nay, naz; - double Kax, Kay, Kaz; // temp. force variables + double Kax, Kay, Kaz; // temp. force variables // cubic anisotropy intensity - double k1c,k2c; // cubic const. in eV - double k1ch,k2ch; // cubic const. in rad.THz - double nc1x,nc1y,nc1z; - double nc2x,nc2y,nc2z; - double nc3x,nc3y,nc3z; + double k1c, k2c; // cubic const. in eV + double k1ch, k2ch; // cubic const. in rad.THz + double nc1x, nc1y, nc1z; + double nc2x, nc2y, nc2z; + double nc3x, nc3y, nc3z; // hexagonal anisotropy double K6; // hexagonal aniso const. in eV - double K6h; // hexagonal aniso const. in rad.THz - double n6x,n6y,n6z; // main axis - double m6x,m6y,m6z; // secondary (perpendicular) axis - double l6x,l6y,l6z; // =(m x n) + double K6h; // hexagonal aniso const. in rad.THz + double n6x, n6y, n6z; // main axis + double m6x, m6y, m6z; // secondary (perpendicular) axis + double l6x, l6y, l6z; // =(m x n) void set_magneticprecession(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/fix_setforce_spin.cpp b/src/SPIN/fix_setforce_spin.cpp index d3114d052c..73acb45920 100644 --- a/src/SPIN/fix_setforce_spin.cpp +++ b/src/SPIN/fix_setforce_spin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/fix_setforce_spin.h b/src/SPIN/fix_setforce_spin.h index 4809bb801b..678a00da37 100644 --- a/src/SPIN/fix_setforce_spin.h +++ b/src/SPIN/fix_setforce_spin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(setforce/spin,FixSetForceSpin) - +// clang-format off +FixStyle(setforce/spin,FixSetForceSpin); +// clang-format on #else #ifndef LMP_FIX_SET_FORCE_SPIN_H @@ -32,7 +32,7 @@ class FixSetForceSpin : public FixSetForce { void single_setforce_spin(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/min_spin.cpp b/src/SPIN/min_spin.cpp index 3bcb356fe1..4f28db2296 100644 --- a/src/SPIN/min_spin.cpp +++ b/src/SPIN/min_spin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/min_spin.h b/src/SPIN/min_spin.h index ee4bfb20b4..929528defd 100644 --- a/src/SPIN/min_spin.h +++ b/src/SPIN/min_spin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef MINIMIZE_CLASS - -MinimizeStyle(spin,MinSpin) - +// clang-format off +MinimizeStyle(spin,MinSpin); +// clang-format on #else #ifndef LMP_MIN_SPIN_H @@ -37,22 +37,21 @@ class MinSpin : public Min { void advance_spins(double); private: - // global and spin timesteps double dt; double dts; - double alpha_damp; // damping for spin minimization - double discrete_factor; // factor for spin timestep evaluation + double alpha_damp; // damping for spin minimization + double discrete_factor; // factor for spin timestep evaluation - double *spvec; // variables for atomic dof, as 1d vector - double *fmvec; // variables for atomic dof, as 1d vector + double *spvec; // variables for atomic dof, as 1d vector + double *fmvec; // variables for atomic dof, as 1d vector bigint last_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/min_spin_cg.cpp b/src/SPIN/min_spin_cg.cpp index de2bd5c3ae..9867f7aab5 100644 --- a/src/SPIN/min_spin_cg.cpp +++ b/src/SPIN/min_spin_cg.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/min_spin_cg.h b/src/SPIN/min_spin_cg.h index 5d87e05f4e..b1ee51da85 100644 --- a/src/SPIN/min_spin_cg.h +++ b/src/SPIN/min_spin_cg.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef MINIMIZE_CLASS - -MinimizeStyle(spin/cg, MinSpinCG) - +// clang-format off +MinimizeStyle(spin/cg, MinSpinCG); +// clang-format on #else #ifndef LMP_MIN_SPIN_CG_H @@ -24,7 +24,7 @@ MinimizeStyle(spin/cg, MinSpinCG) namespace LAMMPS_NS { -class MinSpinCG: public Min { +class MinSpinCG : public Min { public: MinSpinCG(class LAMMPS *); virtual ~MinSpinCG(); @@ -35,21 +35,21 @@ class MinSpinCG: public Min { int iterate(int); private: - int local_iter; // for neb - int nlocal_max; // max value of nlocal (for size of lists) - int use_line_search; // use line search or not. - int ireplica,nreplica; // for neb - double dt; // global timestep - double dts; // spin timestep - double discrete_factor; // factor for spin timestep evaluation - double der_e_cur; // current derivative along search dir. - double der_e_pr; // previous derivative along search dir. - double *spvec; // variables for atomic dof, as 1d vector - double *fmvec; // variables for atomic dof, as 1d vector - double *g_old; // gradient vector at previous step - double *g_cur; // current gradient vector - double *p_s; // search direction vector - double **sp_copy; // copy of the spins + int local_iter; // for neb + int nlocal_max; // max value of nlocal (for size of lists) + int use_line_search; // use line search or not. + int ireplica, nreplica; // for neb + double dt; // global timestep + double dts; // spin timestep + double discrete_factor; // factor for spin timestep evaluation + double der_e_cur; // current derivative along search dir. + double der_e_pr; // previous derivative along search dir. + double *spvec; // variables for atomic dof, as 1d vector + double *fmvec; // variables for atomic dof, as 1d vector + double *g_old; // gradient vector at previous step + double *g_cur; // current gradient vector + double *p_s; // search direction vector + double **sp_copy; // copy of the spins void advance_spins(); void calc_gradient(); @@ -65,7 +65,7 @@ class MinSpinCG: public Min { bigint last_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/min_spin_lbfgs.cpp b/src/SPIN/min_spin_lbfgs.cpp index 1f8d72664d..de3b70f01f 100644 --- a/src/SPIN/min_spin_lbfgs.cpp +++ b/src/SPIN/min_spin_lbfgs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/min_spin_lbfgs.h b/src/SPIN/min_spin_lbfgs.h index de21c8b3a5..0bc81c2113 100644 --- a/src/SPIN/min_spin_lbfgs.h +++ b/src/SPIN/min_spin_lbfgs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef MINIMIZE_CLASS - -MinimizeStyle(spin/lbfgs, MinSpinLBFGS) - +// clang-format off +MinimizeStyle(spin/lbfgs, MinSpinLBFGS); +// clang-format on #else #ifndef LMP_MIN_SPIN_LBFGS_H @@ -24,7 +24,7 @@ MinimizeStyle(spin/lbfgs, MinSpinLBFGS) namespace LAMMPS_NS { -class MinSpinLBFGS: public Min { +class MinSpinLBFGS : public Min { public: MinSpinLBFGS(class LAMMPS *); virtual ~MinSpinLBFGS(); @@ -35,18 +35,18 @@ class MinSpinLBFGS: public Min { int iterate(int); private: - int local_iter; // for neb - int use_line_search; // use line search or not. - int nlocal_max; // max value of nlocal (for size of lists) - int ireplica,nreplica; // for neb - double der_e_cur; // current derivative along search dir. - double der_e_pr; // previous derivative along search dir. + int local_iter; // for neb + int use_line_search; // use line search or not. + int nlocal_max; // max value of nlocal (for size of lists) + int ireplica, nreplica; // for neb + double der_e_cur; // current derivative along search dir. + double der_e_pr; // previous derivative along search dir. double maxepsrot; - double *spvec; // variables for atomic dof, as 1d vector - double *fmvec; // variables for atomic dof, as 1d vector - double *g_old; // gradient vector at previous step - double *g_cur; // current gradient vector - double *p_s; // search direction vector + double *spvec; // variables for atomic dof, as 1d vector + double *fmvec; // variables for atomic dof, as 1d vector + double *g_old; // gradient vector at previous step + double *g_cur; // current gradient vector + double *p_s; // search direction vector void advance_spins(); void calc_gradient(); @@ -58,15 +58,15 @@ class MinSpinLBFGS: public Min { int adescent(double, double); double maximum_rotation(double *); - double *rho; // estimation of curvature - double **ds; // change in rotation matrix between two iterations, da - double **dy; // change in gradients between two iterations, dg - double **sp_copy; // copy of the spins - int num_mem; // number of stored steps + double *rho; // estimation of curvature + double **ds; // change in rotation matrix between two iterations, da + double **dy; // change in gradients between two iterations, dg + double **sp_copy; // copy of the spins + int num_mem; // number of stored steps bigint last_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index e0cfb8189a..a07a16350a 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/neb_spin.h b/src/SPIN/neb_spin.h index bdb7e34caf..8de68830d6 100644 --- a/src/SPIN/neb_spin.h +++ b/src/SPIN/neb_spin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(neb/spin,NEBSpin) - +// clang-format off +CommandStyle(neb/spin,NEBSpin); +// clang-format on #else #ifndef LMP_NEB_SPIN_H @@ -28,31 +28,31 @@ class NEBSpin : public Command { public: NEBSpin(class LAMMPS *); ~NEBSpin(); - void command(int, char **); // process neb/spin command - void run(); // run NEBSpin + void command(int, char **); // process neb/spin command + void run(); // run NEBSpin - double ebf,ebr; // forward and reverse energy barriers + double ebf, ebr; // forward and reverse energy barriers private: - int me,me_universe; // my proc ID in world and universe - int ireplica,nreplica; + int me, me_universe; // my proc ID in world and universe + int ireplica, nreplica; bool verbose; MPI_Comm uworld; - MPI_Comm roots; // MPI comm with 1 root proc from each world + MPI_Comm roots; // MPI comm with 1 root proc from each world FILE *fp; int compressed; - double etol; // energy tolerance convergence criterion - double ttol; // torque tolerance convergence criterion - int n1steps, n2steps; // number of steps in stage 1 and 2 - int nevery; // output interval - char *inpfile; // name of file containing final state + double etol; // energy tolerance convergence criterion + double ttol; // torque tolerance convergence criterion + int n1steps, n2steps; // number of steps in stage 1 and 2 + int nevery; // output interval + char *inpfile; // name of file containing final state class FixNEBSpin *fneb; - int numall; // per-replica dimension of array all - double **all; // PE,plen,nlen,gradvnorm from each replica - double *rdist; // normalize reaction distance, 0 to 1 - double *freplica; // force on an image - double *fmaxatomInRepl; // force on an image + int numall; // per-replica dimension of array all + double **all; // PE,plen,nlen,gradvnorm from each replica + double *rdist; // normalize reaction distance, 0 to 1 + double *freplica; // force on an image + double *fmaxatomInRepl; // force on an image void readfile(char *, int); int initial_rotation(double *, double *, double); @@ -60,7 +60,7 @@ class NEBSpin : public Command { void print_status(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin.cpp b/src/SPIN/pair_spin.cpp index 815ed2d290..9731a447a6 100644 --- a/src/SPIN/pair_spin.cpp +++ b/src/SPIN/pair_spin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/pair_spin.h b/src/SPIN/pair_spin.h index 2e115d69f1..91262cdb5d 100644 --- a/src/SPIN/pair_spin.h +++ b/src/SPIN/pair_spin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,37 +14,38 @@ #ifndef LMP_PAIR_SPIN_H #define LMP_PAIR_SPIN_H -#include "pair.h" // IWYU pragma: export +#include "pair.h" // IWYU pragma: export namespace LAMMPS_NS { class PairSpin : public Pair { -friend class FixNVESpin; + friend class FixNVESpin; + public: PairSpin(class LAMMPS *); virtual ~PairSpin(); virtual void settings(int, char **); virtual void coeff(int, char **) {} virtual void init_style(); - virtual double init_one(int, int) {return 0.0;} - virtual void *extract(const char *, int &) {return nullptr;} + virtual double init_one(int, int) { return 0.0; } + virtual void *extract(const char *, int &) { return nullptr; } virtual void compute(int, int) {} virtual void compute_single_pair(int, double *) {} // storing magnetic energies - int nlocal_max; // max nlocal (for list size) - double *emag; // energy list + int nlocal_max; // max nlocal (for list size) + double *emag; // energy list protected: - double hbar; // Planck constant (eV.ps.rad-1) - int lattice_flag; // flag for mech force computation + double hbar; // Planck constant (eV.ps.rad-1) + int lattice_flag; // flag for mech force computation virtual void allocate() {} }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/SPIN/pair_spin_dipole_cut.cpp b/src/SPIN/pair_spin_dipole_cut.cpp index 2679f0fd6d..06d896ed2f 100644 --- a/src/SPIN/pair_spin_dipole_cut.cpp +++ b/src/SPIN/pair_spin_dipole_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/pair_spin_dipole_cut.h b/src/SPIN/pair_spin_dipole_cut.h index 3adceaf1c7..abda4bb206 100644 --- a/src/SPIN/pair_spin_dipole_cut.h +++ b/src/SPIN/pair_spin_dipole_cut.h @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(spin/dipole/cut,PairSpinDipoleCut) - +// clang-format off +PairStyle(spin/dipole/cut,PairSpinDipoleCut); +// clang-format on #else #ifndef LMP_PAIR_SPIN_DIPOLE_CUT_H @@ -39,26 +39,24 @@ class PairSpinDipoleCut : public PairSpin { void compute(int, int); void compute_single_pair(int, double *); - void compute_dipolar(int, int, double *, double *, double *, - double *, double); - void compute_dipolar_mech(int, int, double *, double *, double *, - double *, double); + void compute_dipolar(int, int, double *, double *, double *, double *, double); + void compute_dipolar_mech(int, int, double *, double *, double *, double *, double); void write_restart(FILE *); void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_long_global; // global long cutoff distance + double cut_spin_long_global; // global long cutoff distance protected: - double hbar; // reduced Planck's constant - double mub; // Bohr's magneton - double mu_0; // vacuum permeability - double mub2mu0; // prefactor for mech force - double mub2mu0hbinv; // prefactor for mag force + double hbar; // reduced Planck's constant + double mub; // Bohr's magneton + double mu_0; // vacuum permeability + double mub2mu0; // prefactor for mech force + double mub2mu0hbinv; // prefactor for mag force - double **cut_spin_long; // cutoff distance long + double **cut_spin_long; // cutoff distance long double g_ewald; int ewald_order; @@ -66,7 +64,7 @@ class PairSpinDipoleCut : public PairSpin { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin_dipole_long.cpp b/src/SPIN/pair_spin_dipole_long.cpp index 3b4c861e0c..860a5c5eb9 100644 --- a/src/SPIN/pair_spin_dipole_long.cpp +++ b/src/SPIN/pair_spin_dipole_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/pair_spin_dipole_long.h b/src/SPIN/pair_spin_dipole_long.h index 1ec30cdb93..c70d23bdd5 100644 --- a/src/SPIN/pair_spin_dipole_long.h +++ b/src/SPIN/pair_spin_dipole_long.h @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(spin/dipole/long,PairSpinDipoleLong) - +// clang-format off +PairStyle(spin/dipole/long,PairSpinDipoleLong); +// clang-format on #else #ifndef LMP_PAIR_SPIN_DIPOLE_LONG_H @@ -40,26 +40,24 @@ class PairSpinDipoleLong : public PairSpin { void compute(int, int); void compute_single_pair(int, double *); - void compute_long(int, int, double *, double *, double *, - double *, double *); - void compute_long_mech(int, int, double *, double *, double *, - double *, double *); + void compute_long(int, int, double *, double *, double *, double *, double *); + void compute_long_mech(int, int, double *, double *, double *, double *, double *); void write_restart(FILE *); void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_long_global; // global long cutoff distance + double cut_spin_long_global; // global long cutoff distance protected: - double hbar; // reduced Planck's constant - double mub; // Bohr's magneton - double mu_0; // vacuum permeability - double mub2mu0; // prefactor for mech force - double mub2mu0hbinv; // prefactor for mag force + double hbar; // reduced Planck's constant + double mub; // Bohr's magneton + double mu_0; // vacuum permeability + double mub2mu0; // prefactor for mech force + double mub2mu0hbinv; // prefactor for mag force - double **cut_spin_long; // cutoff distance long + double **cut_spin_long; // cutoff distance long double g_ewald; int ewald_order; @@ -67,7 +65,7 @@ class PairSpinDipoleLong : public PairSpin { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin_dmi.cpp b/src/SPIN/pair_spin_dmi.cpp index e6ed5e4609..2b1fd39a05 100644 --- a/src/SPIN/pair_spin_dmi.cpp +++ b/src/SPIN/pair_spin_dmi.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/pair_spin_dmi.h b/src/SPIN/pair_spin_dmi.h index 0d73a77dd5..bdd02946af 100644 --- a/src/SPIN/pair_spin_dmi.h +++ b/src/SPIN/pair_spin_dmi.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(spin/dmi,PairSpinDmi) - +// clang-format off +PairStyle(spin/dmi,PairSpinDmi); +// clang-format on #else #ifndef LMP_PAIR_SPIN_DMI_H @@ -44,18 +44,18 @@ class PairSpinDmi : public PairSpin { void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_dmi_global; // short range pair cutoff + double cut_spin_dmi_global; // short range pair cutoff protected: - double **DM; // dmi coeff in eV - double **v_dmx, **v_dmy, **v_dmz; // dmi direction - double **vmech_dmx, **vmech_dmy, **vmech_dmz; // dmi mech direction - double **cut_spin_dmi; // cutoff distance dmi + double **DM; // dmi coeff in eV + double **v_dmx, **v_dmy, **v_dmz; // dmi direction + double **vmech_dmx, **vmech_dmy, **vmech_dmz; // dmi mech direction + double **cut_spin_dmi; // cutoff distance dmi void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin_exchange.cpp b/src/SPIN/pair_spin_exchange.cpp index b7dd6ffc17..23553a9d94 100644 --- a/src/SPIN/pair_spin_exchange.cpp +++ b/src/SPIN/pair_spin_exchange.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/pair_spin_exchange.h b/src/SPIN/pair_spin_exchange.h index d8e79b8775..0dd3d06fc5 100644 --- a/src/SPIN/pair_spin_exchange.h +++ b/src/SPIN/pair_spin_exchange.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(spin/exchange,PairSpinExchange) - +// clang-format off +PairStyle(spin/exchange,PairSpinExchange); +// clang-format on #else #ifndef LMP_PAIR_SPIN_EXCHANGE_H @@ -38,26 +38,26 @@ class PairSpinExchange : public PairSpin { void compute_exchange(int, int, double, double *, double *); void compute_exchange_mech(int, int, double, double *, double *, double *, double *); - double compute_energy(int , int , double , double *, double *); + double compute_energy(int, int, double, double *, double *); void write_restart(FILE *); void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_exchange_global; // global exchange cutoff distance + double cut_spin_exchange_global; // global exchange cutoff distance protected: - int e_offset; // apply energy offset - double **J1_mag; // exchange coeffs in eV - double **J1_mech; // mech exchange coeffs in - double **J2, **J3; // J1 in eV, J2 adim, J3 in Ang - double **cut_spin_exchange; // cutoff distance exchange + int e_offset; // apply energy offset + double **J1_mag; // exchange coeffs in eV + double **J1_mech; // mech exchange coeffs in + double **J2, **J3; // J1 in eV, J2 adim, J3 in Ang + double **cut_spin_exchange; // cutoff distance exchange void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin_exchange_biquadratic.cpp b/src/SPIN/pair_spin_exchange_biquadratic.cpp index 858c103cf3..8bff5e1b1d 100644 --- a/src/SPIN/pair_spin_exchange_biquadratic.cpp +++ b/src/SPIN/pair_spin_exchange_biquadratic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/pair_spin_exchange_biquadratic.h b/src/SPIN/pair_spin_exchange_biquadratic.h index a4104edce3..ccfe874fff 100644 --- a/src/SPIN/pair_spin_exchange_biquadratic.h +++ b/src/SPIN/pair_spin_exchange_biquadratic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(spin/exchange/biquadratic,PairSpinExchangeBiquadratic) - +// clang-format off +PairStyle(spin/exchange/biquadratic,PairSpinExchangeBiquadratic); +// clang-format on #else #ifndef LMP_PAIR_SPIN_EXCHANGE_BIQUADRATIC_H @@ -38,30 +38,29 @@ class PairSpinExchangeBiquadratic : public PairSpin { void compute_exchange(int, int, double, double *, double *, double *); void compute_exchange_mech(int, int, double, double *, double *, double *, double *); - double compute_energy(int , int , double , double *, double *); + double compute_energy(int, int, double, double *, double *); void write_restart(FILE *); void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_exchange_global; // global exchange cutoff distance + double cut_spin_exchange_global; // global exchange cutoff distance protected: - - int e_offset; // apply energy offset - double **J1_mag; // H exchange coeffs in eV - double **J1_mech; // mech exchange coeffs in - double **J2, **J3; // J1 in eV, J2 in Ang-1, J3 in Ang - double **K1_mag; // Bi exchange coeffs in eV - double **K1_mech; // mech exchange coeffs in - double **K2, **K3; // K1 in eV, K2 Ang-1, K3 in Ang - double **cut_spin_exchange; // cutoff distance exchange + int e_offset; // apply energy offset + double **J1_mag; // H exchange coeffs in eV + double **J1_mech; // mech exchange coeffs in + double **J2, **J3; // J1 in eV, J2 in Ang-1, J3 in Ang + double **K1_mag; // Bi exchange coeffs in eV + double **K1_mech; // mech exchange coeffs in + double **K2, **K3; // K1 in eV, K2 Ang-1, K3 in Ang + double **cut_spin_exchange; // cutoff distance exchange void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin_magelec.cpp b/src/SPIN/pair_spin_magelec.cpp index 33ad364aaa..5ea66e7d7d 100644 --- a/src/SPIN/pair_spin_magelec.cpp +++ b/src/SPIN/pair_spin_magelec.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/pair_spin_magelec.h b/src/SPIN/pair_spin_magelec.h index 1c3cf00b22..08f60f5a02 100644 --- a/src/SPIN/pair_spin_magelec.h +++ b/src/SPIN/pair_spin_magelec.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(spin/magelec,PairSpinMagelec) - +// clang-format off +PairStyle(spin/magelec,PairSpinMagelec); +// clang-format on #else #ifndef LMP_PAIR_SPIN_MAGELEC_H @@ -44,17 +44,17 @@ class PairSpinMagelec : public PairSpin { void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_magelec_global; // global me cutoff + double cut_spin_magelec_global; // global me cutoff protected: - double **ME, **ME_mech; // magelec coeff in eV - double **v_mex, **v_mey, **v_mez; // magelec direction - double **cut_spin_magelec; // magelec cutoff distance + double **ME, **ME_mech; // magelec coeff in eV + double **v_mex, **v_mey, **v_mez; // magelec direction + double **cut_spin_magelec; // magelec cutoff distance void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin_neel.cpp b/src/SPIN/pair_spin_neel.cpp index 049a14c82f..78717777d4 100644 --- a/src/SPIN/pair_spin_neel.cpp +++ b/src/SPIN/pair_spin_neel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SPIN/pair_spin_neel.h b/src/SPIN/pair_spin_neel.h index 03712b3ca3..046171927e 100644 --- a/src/SPIN/pair_spin_neel.h +++ b/src/SPIN/pair_spin_neel.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(spin/neel,PairSpinNeel) - +// clang-format off +PairStyle(spin/neel,PairSpinNeel); +// clang-format on #else #ifndef LMP_PAIR_SPIN_NEEL_H @@ -45,22 +45,21 @@ class PairSpinNeel : public PairSpin { void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_neel_global; // global neel cutoff distance + double cut_spin_neel_global; // global neel cutoff distance protected: - // pseudo-dipolar and pseudo-quadrupolar coeff. - double **g1, **g1_mech; // neel coeffs gij - double **g2, **g3; // g1 in eV, g2 adim, g3 in Ang - double **q1, **q1_mech; // neel coeffs qij - double **q2, **q3; // q1 in eV, q2 adim, q3 in Ang - double **cut_spin_neel; // cutoff distance exchange + double **g1, **g1_mech; // neel coeffs gij + double **g2, **g3; // g1 in eV, g2 adim, g3 in Ang + double **q1, **q1_mech; // neel coeffs qij + double **q2, **q3; // q1 in eV, q2 adim, q3 in Ang + double **cut_spin_neel; // cutoff distance exchange void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index 1ba6e4a03f..b1bd4a6fab 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SRD/fix_srd.h b/src/SRD/fix_srd.h index 923228f808..e4dd557394 100644 --- a/src/SRD/fix_srd.h +++ b/src/SRD/fix_srd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(srd,FixSRD) - +// clang-format off +FixStyle(srd,FixSRD); +// clang-format on #else #ifndef LMP_FIX_SRD_H @@ -40,27 +40,27 @@ class FixSRD : public Fix { void unpack_reverse_comm(int, int *, double *); private: - int me,nprocs; - int bigexist,biggroup,biggroupbit; - int collidestyle,lamdaflag,overlap,insideflag,exactflag,maxbounceallow; - int cubicflag,shiftuser,shiftseed,shiftflag,tstat; - int rescale_rotate,rescale_collide; - double gridsrd,gridsearch,lamda,radfactor,cubictol; - int triclinic,change_size,change_shape,deformflag; + int me, nprocs; + int bigexist, biggroup, biggroupbit; + int collidestyle, lamdaflag, overlap, insideflag, exactflag, maxbounceallow; + int cubicflag, shiftuser, shiftseed, shiftflag, tstat; + int rescale_rotate, rescale_collide; + double gridsrd, gridsearch, lamda, radfactor, cubictol; + int triclinic, change_size, change_shape, deformflag; - double dt_big,dt_srd; - double mass_big,mass_srd; + double dt_big, dt_srd; + double mass_big, mass_srd; double temperature_srd; double sigma; double srd_per_cell; - double dmax,vmax,vmaxsq; - double maxbigdiam,minbigdiam; - double dist_ghost,dist_srd,dist_srd_reneigh; // explained in code + double dmax, vmax, vmaxsq; + double maxbigdiam, minbigdiam; + double dist_ghost, dist_srd, dist_srd_reneigh; // explained in code - int wallexist,nwall,wallvarflag; + int wallexist, nwall, wallvarflag; class FixWallSRD *wallfix; int *wallwhich; - double *xwall,*xwallhold,*vwall; + double *xwall, *xwallhold, *vwall; double **fwall; double walltrigger; @@ -71,59 +71,59 @@ class FixSRD : public Fix { // for orthogonal box, these are in box units // for triclinic box, these are in lamda units - double srdlo[3],srdhi[3]; // SRDs must stay inside - double srdlo_reneigh[3],srdhi_reneigh[3]; // SRDs trigger a reneigh + double srdlo[3], srdhi[3]; // SRDs must stay inside + double srdlo_reneigh[3], srdhi_reneigh[3]; // SRDs trigger a reneigh int dimension; - int initflag,setupflag,reneighflag; + int initflag, setupflag, reneighflag; class RanMars *random; class RanPark *randomshift; // stats - int ncheck,ncollide,ninside,nrescale,reneighcount; - int nbounce,bouncemaxnum,bouncemax; + int ncheck, ncollide, ninside, nrescale, reneighcount; + int nbounce, bouncemaxnum, bouncemax; int stats_flag; int srd_bin_count; double srd_bin_temp; - double stats[12],stats_all[12]; + double stats[12], stats_all[12]; - double **flocal; // local ptrs to atom force and torque + double **flocal; // local ptrs to atom force and torque double **tlocal; // info to store for each owned and ghost big particle and wall struct Big { - int index; // local index of particle/wall - int type; // SPHERE or ELLIPSOID or LINE or TRI or WALL - double radius,radsq; // radius of sphere - double aradsqinv; // 3 ellipsoid radii + int index; // local index of particle/wall + int type; // SPHERE or ELLIPSOID or LINE or TRI or WALL + double radius, radsq; // radius of sphere + double aradsqinv; // 3 ellipsoid radii double bradsqinv; double cradsqinv; - double length; // length of line segment - double normbody[3]; // normal of tri in body-frame - double cutbinsq; // add big to bin if within this distance - double omega[3]; // current omega for sphere/ellipsoid/tri/line - double ex[3],ey[3],ez[3]; // current orientation vecs for ellipsoid/tri - double norm[3]; // current unit normal of tri in space-frame - double theta; // current orientation of line + double length; // length of line segment + double normbody[3]; // normal of tri in body-frame + double cutbinsq; // add big to bin if within this distance + double omega[3]; // current omega for sphere/ellipsoid/tri/line + double ex[3], ey[3], ez[3]; // current orientation vecs for ellipsoid/tri + double norm[3]; // current unit normal of tri in space-frame + double theta; // current orientation of line }; - Big *biglist; // list of info for each owned & ghost big and wall - int torqueflag; // 1 if any big particle is torqued + Big *biglist; // list of info for each owned & ghost big and wall + int torqueflag; // 1 if any big particle is torqued // current size of particle-based arrays - int nbig; // # of owned/ghost big particles and walls - int maxbig; // max number of owned/ghost big particles and walls - int nmax; // max number of SRD particles + int nbig; // # of owned/ghost big particles and walls + int maxbig; // max number of owned/ghost big particles and walls + int nmax; // max number of SRD particles // bins for SRD velocity remap, shifting and communication // binsize and inv are in lamda units for triclinic - int nbins1,nbin1x,nbin1y,nbin1z; - double binsize1x,binsize1y,binsize1z; - double bininv1x,bininv1y,bininv1z; + int nbins1, nbin1x, nbin1y, nbin1z; + double binsize1x, binsize1y, binsize1z; + double bininv1x, bininv1y, bininv1z; struct BinAve { int owner; // 1 if I am owner of this bin, 0 if not @@ -135,50 +135,50 @@ class FixSRD : public Fix { }; struct BinComm { - int nsend,nrecv; // # of bins to send/recv - int sendproc,recvproc; // who to send/recv to/from - int *sendlist,*recvlist; // list of bins to send/recv + int nsend, nrecv; // # of bins to send/recv + int sendproc, recvproc; // who to send/recv to/from + int *sendlist, *recvlist; // list of bins to send/recv }; struct BinShift { - int commflag; // 1 if this shift requires any comm - int nbins,nbinx,nbiny,nbinz; // extent of my bins - int maxbinsq,maxvbin; - int binlo[3],binhi[3]; // extent of my bins in global array - double corner[3]; // lower,left corner to offset from - // corner is in lamda units for triclinic - BinAve *vbin; // my bins - BinComm bcomm[6]; // bin communication pattern for overlaps + int commflag; // 1 if this shift requires any comm + int nbins, nbinx, nbiny, nbinz; // extent of my bins + int maxbinsq, maxvbin; + int binlo[3], binhi[3]; // extent of my bins in global array + double corner[3]; // lower,left corner to offset from + // corner is in lamda units for triclinic + BinAve *vbin; // my bins + BinComm bcomm[6]; // bin communication pattern for overlaps }; - BinShift shifts[2]; // 0 = no shift, 1 = shift + BinShift shifts[2]; // 0 = no shift, 1 = shift int maxbin1; - int *binhead; // 1st SRD particle in each bin - int *binnext; // next SRD particle in same bin + int *binhead; // 1st SRD particle in each bin + int *binnext; // next SRD particle in same bin int maxbuf; - double *sbuf1,*sbuf2; // buffers for send/recv of velocity bin data - double *rbuf1,*rbuf2; + double *sbuf1, *sbuf2; // buffers for send/recv of velocity bin data + double *rbuf1, *rbuf2; // bins and stencil for collision searching for SRDs & big particles - int nbins2,nbin2x,nbin2y,nbin2z; + int nbins2, nbin2x, nbin2y, nbin2z; int maxbin2; - double binsize2x,binsize2y,binsize2z; - double bininv2x,bininv2y,bininv2z; - double xblo2,yblo2,zblo2; + double binsize2x, binsize2y, binsize2z; + double bininv2x, bininv2y, bininv2z; + double xblo2, yblo2, zblo2; - int *nbinbig; // # of big particles overlapping each bin - int **binbig; // indices of big particles overlapping each bin - int *binsrd; // which bin each SRD particle is in - int nstencil; // # of bins in stencil - int maxstencil; // max # of bins stencil array can hold - int **stencil; // list of 3d bin offsets a big particle can overlap + int *nbinbig; // # of big particles overlapping each bin + int **binbig; // indices of big particles overlapping each bin + int *binsrd; // which bin each SRD particle is in + int nstencil; // # of bins in stencil + int maxstencil; // max # of bins stencil array can hold + int **stencil; // list of 3d bin offsets a big particle can overlap // persistent data for line/tri collision calculations - double tfraction,theta0,theta1; - double xs0[3],xs1[3],xsc[3]; - double xb0[3],xb1[3],xbc[3]; + double tfraction, theta0, theta1; + double xs0[3], xs1[3], xsc[3]; + double xb0[3], xb1[3], xbc[3]; double nbc[3]; // shared data for triangle collision calculations @@ -203,30 +203,24 @@ class FixSRD : public Fix { int inside_tri(double *, double *, double *, double *, Big *, double); int inside_wall(double *, int); - double collision_sphere_exact(double *, double *, double *, double *, - Big *, double *, double *, double *); - void collision_sphere_inexact(double *, double *, - Big *, double *, double *, double *); - double collision_ellipsoid_exact(double *, double *, double *, double *, - Big *, double *, double *, double *); - void collision_ellipsoid_inexact(double *, double *, - Big *, double *, double *, double *); - double collision_line_exact(double *, double *, double *, double *, - Big *, double, double *, double *, double *); - double collision_tri_exact(double *, double *, double *, double *, - Big *, double, double *, double *, double *); - double collision_wall_exact(double *, int, double *, - double *, double *, double *); + double collision_sphere_exact(double *, double *, double *, double *, Big *, double *, double *, + double *); + void collision_sphere_inexact(double *, double *, Big *, double *, double *, double *); + double collision_ellipsoid_exact(double *, double *, double *, double *, Big *, double *, + double *, double *); + void collision_ellipsoid_inexact(double *, double *, Big *, double *, double *, double *); + double collision_line_exact(double *, double *, double *, double *, Big *, double, double *, + double *, double *); + double collision_tri_exact(double *, double *, double *, double *, Big *, double, double *, + double *, double *); + double collision_wall_exact(double *, int, double *, double *, double *, double *); void collision_wall_inexact(double *, int, double *, double *, double *); - void slip(double *, double *, double *, Big *, - double *, double *, double *); + void slip(double *, double *, double *, Big *, double *, double *, double *); void slip_wall(double *, int, double *, double *); - void noslip(double *, double *, double *, Big *, int, - double *, double *, double *); + void noslip(double *, double *, double *, Big *, int, double *, double *, double *); - void force_torque(double *, double *, double *, - double *, double *, double *); + void force_torque(double *, double *, double *, double *, double *, double *); void force_wall(double *, double *, int); int update_srd(int, double, double *, double *, double *, double *); @@ -249,11 +243,10 @@ class FixSRD : public Fix { void triside(double, double &, double &); double distance(int, int); - void print_collision(int, int, int, double, double, - double *, double *, double *, int); + void print_collision(int, int, int, double, double, double *, double *, double *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SRD/fix_wall_srd.cpp b/src/SRD/fix_wall_srd.cpp index f30ba5b8e0..89b49f3b95 100644 --- a/src/SRD/fix_wall_srd.cpp +++ b/src/SRD/fix_wall_srd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/SRD/fix_wall_srd.h b/src/SRD/fix_wall_srd.h index 11ab8cc0bc..81c0064721 100644 --- a/src/SRD/fix_wall_srd.h +++ b/src/SRD/fix_wall_srd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/srd,FixWallSRD) - +// clang-format off +FixStyle(wall/srd,FixWallSRD); +// clang-format on #else #ifndef LMP_FIX_WALL_SRD_H @@ -26,9 +26,9 @@ namespace LAMMPS_NS { class FixWallSRD : public Fix { public: - int nwall,varflag,overlap; + int nwall, varflag, overlap; int wallwhich[6]; - double xwall[6],xwallhold[6],vwall[6]; + double xwall[6], xwallhold[6], vwall[6]; double **fwall; FixWallSRD(class LAMMPS *, int, char **); @@ -53,7 +53,7 @@ class FixWallSRD : public Fix { int force_flag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/STUBS/mpi.cpp b/src/STUBS/mpi.cpp index 0e87492118..e5cd50629e 100644 --- a/src/STUBS/mpi.cpp +++ b/src/STUBS/mpi.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,13 +13,15 @@ /* Single-processor "stub" versions of MPI routines */ +#include "mpi.h" + +#include "../version.h" + +#include +#include #include #include -#include -#include #include -#include "mpi.h" -#include "../version.h" /* data structure for double/int */ @@ -38,7 +40,7 @@ MPI_Datatype *ptr_datatype[MAXEXTRA_DATATYPE]; int index_datatype[MAXEXTRA_DATATYPE]; int size_datatype[MAXEXTRA_DATATYPE]; -static int _mpi_is_initialized=0; +static int _mpi_is_initialized = 0; /* ---------------------------------------------------------------------- */ /* MPI Functions */ @@ -86,7 +88,7 @@ int MPI_Get_library_version(char *version, int *resultlen) if (!version || !resultlen) return MPI_ERR_ARG; len = strlen(string); - memcpy(version,string,len+1); + memcpy(version, string, len + 1); *resultlen = len; return MPI_SUCCESS; } @@ -103,7 +105,7 @@ int MPI_Get_processor_name(char *name, int *resultlen) if (!name || !resultlen) return MPI_ERR_ARG; len = strlen(host); - memcpy(name,host,len+1); + memcpy(name, host, len + 1); *resultlen = len; return MPI_SUCCESS; } @@ -175,7 +177,7 @@ double MPI_Wtime() double time; struct timeval tv; - gettimeofday(&tv,NULL); + gettimeofday(&tv, NULL); time = 1.0 * tv.tv_sec + 1.0e-6 * tv.tv_usec; return time; #endif @@ -187,14 +189,22 @@ double MPI_Wtime() static int stubtypesize(MPI_Datatype datatype) { - if (datatype == MPI_INT) return sizeof(int); - else if (datatype == MPI_FLOAT) return sizeof(float); - else if (datatype == MPI_DOUBLE) return sizeof(double); - else if (datatype == MPI_CHAR) return sizeof(char); - else if (datatype == MPI_BYTE) return sizeof(char); - else if (datatype == MPI_LONG) return sizeof(long); - else if (datatype == MPI_LONG_LONG) return sizeof(uint64_t); - else if (datatype == MPI_DOUBLE_INT) return sizeof(double_int); + if (datatype == MPI_INT) + return sizeof(int); + else if (datatype == MPI_FLOAT) + return sizeof(float); + else if (datatype == MPI_DOUBLE) + return sizeof(double); + else if (datatype == MPI_CHAR) + return sizeof(char); + else if (datatype == MPI_BYTE) + return sizeof(char); + else if (datatype == MPI_LONG) + return sizeof(long); + else if (datatype == MPI_LONG_LONG) + return sizeof(uint64_t); + else if (datatype == MPI_DOUBLE_INT) + return sizeof(double_int); else { int i; for (i = 0; i < nextra_datatype; i++) @@ -222,10 +232,9 @@ int MPI_Request_free(MPI_Request *request) /* ---------------------------------------------------------------------- */ -int MPI_Send(const void *buf, int count, MPI_Datatype datatype, - int dest, int tag, MPI_Comm comm) +int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { - static int callcount=0; + static int callcount = 0; if (callcount == 0) { printf("MPI Stub WARNING: Should not send message to self\n"); ++callcount; @@ -235,10 +244,10 @@ int MPI_Send(const void *buf, int count, MPI_Datatype datatype, /* ---------------------------------------------------------------------- */ -int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, - int source, int tag, MPI_Comm comm, MPI_Request *request) +int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Request *request) { - static int callcount=0; + static int callcount = 0; if (callcount == 0) { printf("MPI Stub WARNING: Should not send message to self\n"); ++callcount; @@ -248,10 +257,9 @@ int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, /* ---------------------------------------------------------------------- */ -int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, - int dest, int tag, MPI_Comm comm) +int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { - static int callcount=0; + static int callcount = 0; if (callcount == 0) { printf("MPI Stub WARNING: Should not rsend message to self\n"); ++callcount; @@ -261,10 +269,10 @@ int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, /* ---------------------------------------------------------------------- */ -int MPI_Recv(void *buf, int count, MPI_Datatype datatype, - int source, int tag, MPI_Comm comm, MPI_Status *status) +int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Status *status) { - static int callcount=0; + static int callcount = 0; if (callcount == 0) { printf("MPI Stub WARNING: Should not recv message from self\n"); ++callcount; @@ -274,10 +282,10 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, /* ---------------------------------------------------------------------- */ -int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, - int source, int tag, MPI_Comm comm, MPI_Request *request) +int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Request *request) { - static int callcount=0; + static int callcount = 0; if (callcount == 0) { printf("MPI Stub WARNING: Should not recv message from self\n"); ++callcount; @@ -289,7 +297,7 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int MPI_Wait(MPI_Request *request, MPI_Status *status) { - static int callcount=0; + static int callcount = 0; if (callcount == 0) { printf("MPI Stub WARNING: Should not wait on message from self\n"); ++callcount; @@ -301,7 +309,7 @@ int MPI_Wait(MPI_Request *request, MPI_Status *status) int MPI_Waitall(int n, MPI_Request *request, MPI_Status *status) { - static int callcount=0; + static int callcount = 0; if (callcount == 0) { printf("MPI Stub WARNING: Should not wait on message from self\n"); ++callcount; @@ -311,10 +319,9 @@ int MPI_Waitall(int n, MPI_Request *request, MPI_Status *status) /* ---------------------------------------------------------------------- */ -int MPI_Waitany(int count, MPI_Request *request, int *index, - MPI_Status *status) +int MPI_Waitany(int count, MPI_Request *request, int *index, MPI_Status *status) { - static int callcount=0; + static int callcount = 0; if (callcount == 0) { printf("MPI Stub WARNING: Should not wait on message from self\n"); ++callcount; @@ -324,12 +331,11 @@ int MPI_Waitany(int count, MPI_Request *request, int *index, /* ---------------------------------------------------------------------- */ -int MPI_Sendrecv(const void *sbuf, int scount, MPI_Datatype sdatatype, - int dest, int stag, void *rbuf, int rcount, - MPI_Datatype rdatatype, int source, int rtag, +int MPI_Sendrecv(const void *sbuf, int scount, MPI_Datatype sdatatype, int dest, int stag, + void *rbuf, int rcount, MPI_Datatype rdatatype, int source, int rtag, MPI_Comm comm, MPI_Status *status) { - static int callcount=0; + static int callcount = 0; if (callcount == 0) { printf("MPI Stub WARNING: Should not send message to self\n"); ++callcount; @@ -341,7 +347,7 @@ int MPI_Sendrecv(const void *sbuf, int scount, MPI_Datatype sdatatype, int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count) { - static int callcount=0; + static int callcount = 0; if (callcount == 0) { printf("MPI Stub WARNING: Should not get count of message to self\n"); ++callcount; @@ -353,7 +359,7 @@ int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count) int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out) { - *comm_out = comm+1; + *comm_out = comm + 1; return 0; } @@ -361,52 +367,61 @@ int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out) int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *comm_out) { - *comm_out = comm+1; + *comm_out = comm + 1; return 0; } /* ---------------------------------------------------------------------- */ -int MPI_Comm_free(MPI_Comm *comm) {return 0;} +int MPI_Comm_free(MPI_Comm *comm) +{ + return 0; +} /* ---------------------------------------------------------------------- */ -MPI_Fint MPI_Comm_c2f(MPI_Comm comm) { return comm; }; +MPI_Fint MPI_Comm_c2f(MPI_Comm comm) +{ + return comm; +}; /* ---------------------------------------------------------------------- */ -MPI_Comm MPI_Comm_f2c(MPI_Fint comm) { return comm; }; +MPI_Comm MPI_Comm_f2c(MPI_Fint comm) +{ + return comm; +}; /* ---------------------------------------------------------------------- */ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group) { - *group = comm; - return 0; + *group = comm; + return 0; } /* ---------------------------------------------------------------------- */ int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm) { - *newcomm = group; - return 0; + *newcomm = group; + return 0; } /* ---------------------------------------------------------------------- */ int MPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup) { - if (n > 0) - *newgroup = MPI_COMM_WORLD; - else - *newgroup = group; - return 0; + if (n > 0) + *newgroup = MPI_COMM_WORLD; + else + *newgroup = group; + return 0; } /* ---------------------------------------------------------------------- */ -int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods, - int reorder, MPI_Comm *comm_cart) +int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods, int reorder, + MPI_Comm *comm_cart) { *comm_cart = comm_old; return 0; @@ -414,8 +429,7 @@ int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods, /* ---------------------------------------------------------------------- */ -int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, - int *coords) +int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords) { dims[0] = dims[1] = dims[2] = 1; periods[0] = periods[1] = periods[2] = 1; @@ -425,8 +439,7 @@ int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, /* ---------------------------------------------------------------------- */ -int MPI_Cart_shift(MPI_Comm comm, int direction, int displ, - int *source, int *dest) +int MPI_Cart_shift(MPI_Comm comm, int direction, int displ, int *source, int *dest) { *source = *dest = 0; return 0; @@ -444,8 +457,7 @@ int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank) /* store size of user datatype in extra lists */ -int MPI_Type_contiguous(int count, MPI_Datatype oldtype, - MPI_Datatype *newtype) +int MPI_Type_contiguous(int count, MPI_Datatype oldtype, MPI_Datatype *newtype) { if (nextra_datatype == MAXEXTRA_DATATYPE) return -1; ptr_datatype[nextra_datatype] = newtype; @@ -477,9 +489,9 @@ int MPI_Type_free(MPI_Datatype *datatype) int i; for (i = 0; i < nextra_datatype; i++) if (datatype == ptr_datatype[i]) { - ptr_datatype[i] = ptr_datatype[nextra_datatype-1]; - index_datatype[i] = index_datatype[nextra_datatype-1]; - size_datatype[i] = size_datatype[nextra_datatype-1]; + ptr_datatype[i] = ptr_datatype[nextra_datatype - 1]; + index_datatype[i] = index_datatype[nextra_datatype - 1]; + size_datatype[i] = size_datatype[nextra_datatype - 1]; nextra_datatype--; break; } @@ -502,24 +514,15 @@ int MPI_Op_free(MPI_Op *op) /* ---------------------------------------------------------------------- */ -int MPI_Barrier(MPI_Comm comm) {return 0;} - -/* ---------------------------------------------------------------------- */ - -int MPI_Bcast(void *buf, int count, MPI_Datatype datatype, - int root, MPI_Comm comm) {return 0;} - -/* ---------------------------------------------------------------------- */ - -/* copy values from data1 to data2 */ - -int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +int MPI_Barrier(MPI_Comm comm) { - int n = count * stubtypesize(datatype); + return 0; +} - if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf,sendbuf,n); +/* ---------------------------------------------------------------------- */ + +int MPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm) +{ return 0; } @@ -527,42 +530,13 @@ int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, /* copy values from data1 to data2 */ -int MPI_Reduce(void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, - int root, MPI_Comm comm) -{ - int n = count * stubtypesize(datatype); - - if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf,sendbuf,n); - return 0; -} - - -/* ---------------------------------------------------------------------- */ - -int MPI_Scan(void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) -{ - int n = count * stubtypesize(datatype); - - if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf,sendbuf,n); - return 0; -} - -/* ---------------------------------------------------------------------- */ - -/* copy values from data1 to data2 */ - -int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, +int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { - int n = sendcount * stubtypesize(sendtype); + int n = count * stubtypesize(datatype); if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf,sendbuf,n); + memcpy(recvbuf, sendbuf, n); return 0; } @@ -570,14 +544,39 @@ int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, /* copy values from data1 to data2 */ -int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *displs, - MPI_Datatype recvtype, MPI_Comm comm) +int MPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, + MPI_Comm comm) +{ + int n = count * stubtypesize(datatype); + + if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; + memcpy(recvbuf, sendbuf, n); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +int MPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + MPI_Comm comm) +{ + int n = count * stubtypesize(datatype); + + if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; + memcpy(recvbuf, sendbuf, n); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +/* copy values from data1 to data2 */ + +int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, MPI_Comm comm) { int n = sendcount * stubtypesize(sendtype); if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf,sendbuf,n); + memcpy(recvbuf, sendbuf, n); return 0; } @@ -585,13 +584,27 @@ int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, /* copy values from data1 to data2 */ -int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, + int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm) +{ + int n = sendcount * stubtypesize(sendtype); + + if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; + memcpy(recvbuf, sendbuf, n); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +/* copy values from data1 to data2 */ + +int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm) { int n = *recvcounts * stubtypesize(datatype); if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf,sendbuf,n); + memcpy(recvbuf, sendbuf, n); return 0; } @@ -599,14 +612,13 @@ int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, /* copy values from data1 to data2 */ -int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm) +int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, int root, MPI_Comm comm) { int n = sendcount * stubtypesize(sendtype); if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf,sendbuf,n); + memcpy(recvbuf, sendbuf, n); return 0; } @@ -614,14 +626,27 @@ int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, /* copy values from data1 to data2 */ -int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *displs, +int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, + int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm) +{ + int n = sendcount * stubtypesize(sendtype); + + if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; + memcpy(recvbuf, sendbuf, n); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +/* copy values from data1 to data2 */ + +int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { - int n = sendcount * stubtypesize(sendtype); + int n = recvcount * stubtypesize(recvtype); if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf,sendbuf,n); + memcpy(recvbuf, sendbuf, n); return 0; } @@ -629,30 +654,13 @@ int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, /* copy values from data1 to data2 */ -int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm) +int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, + int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { int n = recvcount * stubtypesize(recvtype); if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf,sendbuf,n); - return 0; -} - - -/* ---------------------------------------------------------------------- */ - -/* copy values from data1 to data2 */ - -int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, - MPI_Datatype sendtype, void *recvbuf, int recvcount, - MPI_Datatype recvtype, int root, MPI_Comm comm) -{ - int n = recvcount * stubtypesize(recvtype); - - if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf,sendbuf,n); + memcpy(recvbuf, sendbuf, n); return 0; } @@ -660,14 +668,13 @@ int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, /* copy values from data1 to data2 */ -int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm) +int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, MPI_Comm comm) { int n = sendcount * stubtypesize(sendtype); if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf,sendbuf,n); + memcpy(recvbuf, sendbuf, n); return 0; } @@ -675,15 +682,14 @@ int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, /* copy values from data1 to data2 */ -int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, - MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *rdispls, - MPI_Datatype recvtype, MPI_Comm comm) +int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype sendtype, + void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype recvtype, + MPI_Comm comm) { int n = *sendcounts * stubtypesize(sendtype); if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf,sendbuf,n); + memcpy(recvbuf, sendbuf, n); return 0; } diff --git a/src/STUBS/mpi.h b/src/STUBS/mpi.h index c4d8848f57..a39dadd484 100644 --- a/src/STUBS/mpi.h +++ b/src/STUBS/mpi.h @@ -26,13 +26,12 @@ #error "MPI STUBS must be compiled with a C++ compiler" #endif - /* Dummy defs for MPI stubs */ #define MPI_COMM_WORLD 0 -#define MPI_SUCCESS 0 -#define MPI_ERR_ARG -1 +#define MPI_SUCCESS 0 +#define MPI_ERR_ARG -1 #define MPI_INT 1 #define MPI_FLOAT 2 @@ -70,8 +69,7 @@ #define MPI_MAX_PROCESSOR_NAME 128 #define MPI_MAX_LIBRARY_VERSION_STRING 128 -typedef void MPI_User_function(void *invec, void *inoutvec, - int *len, MPI_Datatype *datatype); +typedef void MPI_User_function(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype); /* MPI data structs */ @@ -98,24 +96,20 @@ double MPI_Wtime(); int MPI_Type_size(int, int *); int MPI_Request_free(MPI_Request *request); -int MPI_Send(const void *buf, int count, MPI_Datatype datatype, - int dest, int tag, MPI_Comm comm); -int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, - int source, int tag, MPI_Comm comm, MPI_Request *request); -int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, - int dest, int tag, MPI_Comm comm); -int MPI_Recv(void *buf, int count, MPI_Datatype datatype, - int source, int tag, MPI_Comm comm, MPI_Status *status); -int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, - int source, int tag, MPI_Comm comm, MPI_Request *request); +int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); +int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Request *request); +int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); +int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Status *status); +int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Request *request); int MPI_Wait(MPI_Request *request, MPI_Status *status); int MPI_Waitall(int n, MPI_Request *request, MPI_Status *status); -int MPI_Waitany(int count, MPI_Request *request, int *index, - MPI_Status *status); -int MPI_Sendrecv(const void *sbuf, int scount, MPI_Datatype sdatatype, - int dest, int stag, void *rbuf, int rcount, - MPI_Datatype rdatatype, int source, int rtag, - MPI_Comm comm, MPI_Status *status); +int MPI_Waitany(int count, MPI_Request *request, int *index, MPI_Status *status); +int MPI_Sendrecv(const void *sbuf, int scount, MPI_Datatype sdatatype, int dest, int stag, + void *rbuf, int rcount, MPI_Datatype rdatatype, int source, int rtag, + MPI_Comm comm, MPI_Status *status); int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count); int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out); @@ -127,16 +121,13 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group); int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm); int MPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup); -int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods, - int reorder, MPI_Comm *comm_cart); -int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, - int *coords); -int MPI_Cart_shift(MPI_Comm comm, int direction, int displ, - int *source, int *dest); +int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods, int reorder, + MPI_Comm *comm_cart); +int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords); +int MPI_Cart_shift(MPI_Comm comm, int direction, int displ, int *source, int *dest); int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank); -int MPI_Type_contiguous(int count, MPI_Datatype oldtype, - MPI_Datatype *newtype); +int MPI_Type_contiguous(int count, MPI_Datatype oldtype, MPI_Datatype *newtype); int MPI_Type_commit(MPI_Datatype *datatype); int MPI_Type_free(MPI_Datatype *datatype); @@ -144,41 +135,32 @@ int MPI_Op_create(MPI_User_function *function, int commute, MPI_Op *op); int MPI_Op_free(MPI_Op *op); int MPI_Barrier(MPI_Comm comm); -int MPI_Bcast(void *buf, int count, MPI_Datatype datatype, - int root, MPI_Comm comm); -int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); -int MPI_Reduce(void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); -int MPI_Scan(void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); -int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, +int MPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm); +int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); -int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *displs, - MPI_Datatype recvtype, MPI_Comm comm); -int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); -int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm); -int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *displs, - MPI_Datatype recvtype, int root, MPI_Comm comm); -int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - int root, MPI_Comm comm); -int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, - MPI_Datatype sendtype, void *recvbuf, int recvcount, - MPI_Datatype recvtype, int root, MPI_Comm comm); -int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm); -int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, - MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *rdispls, +int MPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, + MPI_Comm comm); +int MPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + MPI_Comm comm); +int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); +int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, + int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm); +int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); +int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, int root, MPI_Comm comm); +int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, + int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm); +int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, int root, MPI_Comm comm); +int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, + int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); +int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, MPI_Comm comm); +int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype sendtype, + void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype recvtype, + MPI_Comm comm); /* ---------------------------------------------------------------------- */ #endif diff --git a/src/USER-ADIOS/dump_atom_adios.cpp b/src/USER-ADIOS/dump_atom_adios.cpp index 5d4bbd2377..7265ef75f5 100644 --- a/src/USER-ADIOS/dump_atom_adios.cpp +++ b/src/USER-ADIOS/dump_atom_adios.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-ADIOS/dump_atom_adios.h b/src/USER-ADIOS/dump_atom_adios.h index 40ef386dc6..783abaf915 100644 --- a/src/USER-ADIOS/dump_atom_adios.h +++ b/src/USER-ADIOS/dump_atom_adios.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,7 +13,7 @@ #ifdef DUMP_CLASS // clang-format off -DumpStyle(atom/adios, DumpAtomADIOS) +DumpStyle(atom/adios, DumpAtomADIOS); // clang-format on #else @@ -22,32 +22,30 @@ DumpStyle(atom/adios, DumpAtomADIOS) #include "dump_atom.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { class DumpAtomADIOSInternal; -class DumpAtomADIOS : public DumpAtom -{ +class DumpAtomADIOS : public DumpAtom { -public: - DumpAtomADIOS(class LAMMPS *, int, char **); - virtual ~DumpAtomADIOS(); + public: + DumpAtomADIOS(class LAMMPS *, int, char **); + virtual ~DumpAtomADIOS(); -protected: - virtual void openfile(); - virtual void write(); - virtual void init_style(); + protected: + virtual void openfile(); + virtual void write(); + virtual void init_style(); -private: - DumpAtomADIOSInternal *internal; + private: + DumpAtomADIOSInternal *internal; }; -} +} // namespace LAMMPS_NS #endif #endif - /* ERROR/WARNING messages: +/* ERROR/WARNING messages: E: Cannot open dump file %s diff --git a/src/USER-ADIOS/dump_custom_adios.cpp b/src/USER-ADIOS/dump_custom_adios.cpp index 18a3c7ef9e..344c6ff6e9 100644 --- a/src/USER-ADIOS/dump_custom_adios.cpp +++ b/src/USER-ADIOS/dump_custom_adios.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-ADIOS/dump_custom_adios.h b/src/USER-ADIOS/dump_custom_adios.h index 6a2a2b84b2..ae327f0db5 100644 --- a/src/USER-ADIOS/dump_custom_adios.h +++ b/src/USER-ADIOS/dump_custom_adios.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,7 +13,7 @@ #ifdef DUMP_CLASS // clang-format off -DumpStyle(custom/adios, DumpCustomADIOS) +DumpStyle(custom/adios, DumpCustomADIOS); // clang-format on #else @@ -22,31 +22,29 @@ DumpStyle(custom/adios, DumpCustomADIOS) #include "dump_custom.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { class DumpCustomADIOSInternal; -class DumpCustomADIOS : public DumpCustom -{ -public: - DumpCustomADIOS(class LAMMPS *, int, char **); - virtual ~DumpCustomADIOS(); +class DumpCustomADIOS : public DumpCustom { + public: + DumpCustomADIOS(class LAMMPS *, int, char **); + virtual ~DumpCustomADIOS(); -protected: - virtual void openfile(); - virtual void write(); - virtual void init_style(); + protected: + virtual void openfile(); + virtual void write(); + virtual void init_style(); -private: - DumpCustomADIOSInternal *internal; + private: + DumpCustomADIOSInternal *internal; }; -} +} // namespace LAMMPS_NS #endif #endif - /* ERROR/WARNING messages: +/* ERROR/WARNING messages: E: Cannot open dump file %s diff --git a/src/USER-ADIOS/reader_adios.cpp b/src/USER-ADIOS/reader_adios.cpp index 5cb0cb12ea..04c0fed9eb 100644 --- a/src/USER-ADIOS/reader_adios.cpp +++ b/src/USER-ADIOS/reader_adios.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-ADIOS/reader_adios.h b/src/USER-ADIOS/reader_adios.h index 999375f2f5..1d8f2a3773 100644 --- a/src/USER-ADIOS/reader_adios.h +++ b/src/USER-ADIOS/reader_adios.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef READER_CLASS - -ReaderStyle(adios, ReaderADIOS) - +// clang-format off +ReaderStyle(adios, ReaderADIOS); +// clang-format on #else #ifndef LMP_READER_ADIOS_H @@ -28,45 +28,42 @@ ReaderStyle(adios, ReaderADIOS) #include #include -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { class ReadADIOSInternal; -class ReaderADIOS : public Reader -{ -public: - ReaderADIOS(class LAMMPS *); - virtual ~ReaderADIOS(); +class ReaderADIOS : public Reader { + public: + ReaderADIOS(class LAMMPS *); + virtual ~ReaderADIOS(); - virtual void settings(int, char **); + virtual void settings(int, char **); - virtual int read_time(bigint &); - virtual void skip(); - virtual bigint read_header(double[3][3], int &, int &, int, int, int *, - char **, int, int, int &, int &, int &, int &); - virtual void read_atoms(int, int, double **); + virtual int read_time(bigint &); + virtual void skip(); + virtual bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, + int &, int &, int &); + virtual void read_atoms(int, int, double **); - virtual void open_file(const char *); - virtual void close_file(); + virtual void open_file(const char *); + virtual void close_file(); -private: - int *fieldindex; // mapping of input fields to dump - uint64_t nAtomsTotal; // current number of atoms in entire dump step - uint64_t nAtoms; // current number of atoms for this process - // (Sum(nAtoms)=nAtomsTotal) - uint64_t atomOffset; // starting atom position for this process to read + private: + int *fieldindex; // mapping of input fields to dump + uint64_t nAtomsTotal; // current number of atoms in entire dump step + uint64_t nAtoms; // current number of atoms for this process + // (Sum(nAtoms)=nAtomsTotal) + uint64_t atomOffset; // starting atom position for this process to read - bigint nstep; // current (time) step number - bigint nid; // current atom id. + bigint nstep; // current (time) step number + bigint nid; // current atom id. - int me; - ReadADIOSInternal *internal; + int me; + ReadADIOSInternal *internal; - int find_label(const std::string &label, - const std::map &labels); + int find_label(const std::string &label, const std::map &labels); }; -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-ATC/fix_atc.cpp b/src/USER-ATC/fix_atc.cpp index 843dc41194..b4f5b1eade 100644 --- a/src/USER-ATC/fix_atc.cpp +++ b/src/USER-ATC/fix_atc.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-ATC/fix_atc.h b/src/USER-ATC/fix_atc.h index e810e6bf91..1b34604aa2 100644 --- a/src/USER-ATC/fix_atc.h +++ b/src/USER-ATC/fix_atc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(atc,FixATC) - +// clang-format off +FixStyle(atc,FixATC); +// clang-format on #else #ifndef FIX_ATC_H @@ -23,120 +23,120 @@ FixStyle(atc,FixATC) #include "fix.h" namespace ATC { - class ATC_Method; +class ATC_Method; } namespace LAMMPS_NS { - class NeighList; +class NeighList; - /** +/** * @class FixATC * @brief Class for an atom-to-continuum (ATC) LAMMPS fix. */ - class FixATC : public Fix { - public: - /** constructor & destructor */ - FixATC(class LAMMPS *, int, char **); - ~FixATC(); +class FixATC : public Fix { + public: + /** constructor & destructor */ + FixATC(class LAMMPS *, int, char **); + ~FixATC(); - /** initialization functions */ - void init(); - void init_list(int id, NeighList *ptr) ; - void setup(int vflag); - void min_setup(int vflag); + /** initialization functions */ + void init(); + void init_list(int id, NeighList *ptr); + void setup(int vflag); + void min_setup(int vflag); - /** setmask: tell LAMMPS which fix methods to call */ - int setmask(); + /** setmask: tell LAMMPS which fix methods to call */ + int setmask(); - /** initial_integrate */ - void initial_integrate(int vflag); + /** initial_integrate */ + void initial_integrate(int vflag); - /** after first integrate phase */ - void post_integrate(); + /** after first integrate phase */ + void post_integrate(); - /** final_integrate */ - void final_integrate(); + /** final_integrate */ + void final_integrate(); - /** end of step for run or minimize */ - void end_of_step(); + /** end of step for run or minimize */ + void end_of_step(); - /** pre_exchange is used to modify fix-specific data + /** pre_exchange is used to modify fix-specific data and is called before domain->pbc() and comm->exchange(). */ - void setup_pre_exchange(); - void pre_exchange(); - void min_pre_exchange(); + void setup_pre_exchange(); + void pre_exchange(); + void min_pre_exchange(); - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); + double memory_usage(); + void grow_arrays(int); + void copy_arrays(int, int, int); - /** pack_exchange called from atom_vec->pack_exchange() + /** pack_exchange called from atom_vec->pack_exchange() and packs fix-specific data for a given real (local) atom being sent to another processor. */ - int pack_exchange(int, double *); + int pack_exchange(int, double *); - /** unpack_exchange called from atom_vec->unpack_exchange() + /** unpack_exchange called from atom_vec->unpack_exchange() and unpacks fix-specific data for a given real (local) atom received from another processor. */ - int unpack_exchange(int, double *); + int unpack_exchange(int, double *); - /** pack_comm called from comm->forward_comm_fix and + /** pack_comm called from comm->forward_comm_fix and packs fix-specific data for a given ghost atom from exchange with another proc */ - int pack_forward_comm(int , int *, double *, int, int *); + int pack_forward_comm(int, int *, double *, int, int *); - /** unpack_comm called from comm->forward_comm_fix and + /** unpack_comm called from comm->forward_comm_fix and unpacks fix-specific data for a given ghost atom from exchange with another proc */ - void unpack_forward_comm(int, int, double *); + void unpack_forward_comm(int, int, double *); - /** pre_neighbor is used to modify fix-specific data + /** pre_neighbor is used to modify fix-specific data and is called before neighbor list is built in neighbor->build(). */ - void pre_neighbor(); - void setup_pre_neighbor(); + void pre_neighbor(); + void setup_pre_neighbor(); - /** pre/post_force is used to modify fix-specific data + /** pre/post_force is used to modify fix-specific data and is before/after the various force computations. */ - void pre_force(int vflag); - void post_force(int vflag); + void pre_force(int vflag); + void post_force(int vflag); - /** post_run is called after a run completes */ - void post_run(); + /** post_run is called after a run completes */ + void post_run(); - /** min_pre_force is called before forces are calculated in minimize */ - void min_pre_force(int vflag); + /** min_pre_force is called before forces are calculated in minimize */ + void min_pre_force(int vflag); - /** min_post_force is called after forces are calculated in minimize */ - void min_post_force(int vflag); + /** min_post_force is called after forces are calculated in minimize */ + void min_post_force(int vflag); - /** modify atc parameters (parser) */ - int modify_param(int narg, char** arg); + /** modify atc parameters (parser) */ + int modify_param(int narg, char **arg); - /** calls ATC_Method to handle restarting/checkpointing */ - /** these four methods are for writing per-atom quantities */ - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); - /** these two methods are for writing all other quantities */ - void write_restart(FILE *); - void restart(char *); + /** calls ATC_Method to handle restarting/checkpointing */ + /** these four methods are for writing per-atom quantities */ + int pack_restart(int, double *); + void unpack_restart(int, int); + int size_restart(int); + int maxsize_restart(); + /** these two methods are for writing all other quantities */ + void write_restart(FILE *); + void restart(char *); - /** accessor function for ATC_Method class pointer */ - const ATC::ATC_Method* atc() { return atc_; } + /** accessor function for ATC_Method class pointer */ + const ATC::ATC_Method *atc() { return atc_; } - protected: - LAMMPS * lammps_; + protected: + LAMMPS *lammps_; - /** functions for "thermo" output */ - virtual double compute_scalar() ; - virtual double compute_vector(int n) ; - virtual double compute_array(int irow, int icol) ; - double dtv,dtf; - ATC::ATC_Method *atc_; - }; -} + /** functions for "thermo" output */ + virtual double compute_scalar(); + virtual double compute_vector(int n); + virtual double compute_array(int irow, int icol); + double dtv, dtf; + ATC::ATC_Method *atc_; +}; +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-AWPMD/atom_vec_wavepacket.cpp b/src/USER-AWPMD/atom_vec_wavepacket.cpp index 49b13c28ae..c339e8343f 100644 --- a/src/USER-AWPMD/atom_vec_wavepacket.cpp +++ b/src/USER-AWPMD/atom_vec_wavepacket.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-AWPMD/atom_vec_wavepacket.h b/src/USER-AWPMD/atom_vec_wavepacket.h index 479bb267e4..310180b1b4 100644 --- a/src/USER-AWPMD/atom_vec_wavepacket.h +++ b/src/USER-AWPMD/atom_vec_wavepacket.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(wavepacket,AtomVecWavepacket) - +// clang-format off +AtomStyle(wavepacket,AtomVecWavepacket); +// clang-format on #else #ifndef LMP_ATOM_VEC_WAVEPACKET_H @@ -25,7 +25,7 @@ AtomStyle(wavepacket,AtomVecWavepacket) namespace LAMMPS_NS { class AtomVecWavepacket : public AtomVec { -public: + public: AtomVecWavepacket(class LAMMPS *); void grow_pointers(); @@ -37,10 +37,10 @@ public: private: int *spin; - double *q,*eradius,*ervel,*erforce; + double *q, *eradius, *ervel, *erforce; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-AWPMD/fix_nve_awpmd.cpp b/src/USER-AWPMD/fix_nve_awpmd.cpp index bd2668da09..812b573826 100644 --- a/src/USER-AWPMD/fix_nve_awpmd.cpp +++ b/src/USER-AWPMD/fix_nve_awpmd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-AWPMD/fix_nve_awpmd.h b/src/USER-AWPMD/fix_nve_awpmd.h index b3edfeb4e6..700483ef6e 100644 --- a/src/USER-AWPMD/fix_nve_awpmd.h +++ b/src/USER-AWPMD/fix_nve_awpmd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/awpmd,FixNVEAwpmd) - +// clang-format off +FixStyle(nve/awpmd,FixNVEAwpmd); +// clang-format on #else #ifndef LMP_FIX_NVE_awpmd_H @@ -40,14 +40,14 @@ class FixNVEAwpmd : public Fix { void reset_dt(); protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; class PairAWPMDCut *awpmd_pair; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp index 54f851171b..aa740a15ed 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.cpp +++ b/src/USER-AWPMD/pair_awpmd_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-AWPMD/pair_awpmd_cut.h b/src/USER-AWPMD/pair_awpmd_cut.h index 46f43c09cf..9fb906bfd0 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.h +++ b/src/USER-AWPMD/pair_awpmd_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,11 +14,10 @@ Contributing author: Ilya Valuev (JIHT RAS) ------------------------------------------------------------------------- */ - #ifdef PAIR_CLASS - -PairStyle(awpmd/cut,PairAWPMDCut) - +// clang-format off +PairStyle(awpmd/cut,PairAWPMDCut); +// clang-format on #else #ifndef LMP_PAIR_AWPMD_CUT_H @@ -26,14 +25,13 @@ PairStyle(awpmd/cut,PairAWPMDCut) #include "pair.h" - class AWPMD_split; - namespace LAMMPS_NS { class PairAWPMDCut : public Pair { friend class FixNVEAwpmd; + public: PairAWPMDCut(class LAMMPS *); virtual ~PairAWPMDCut(); @@ -54,28 +52,24 @@ class PairAWPMDCut : public Pair { double memory_usage(); private: - - int flexible_pressure_flag; double cut_global; double **cut; - - int nmax; // number of additional variables for minimizer - double *min_var,*min_varforce; // additional variables for minimizer + int nmax; // number of additional variables for minimizer + double *min_var, *min_varforce; // additional variables for minimizer void allocate(); void virial_eradius_compute(); - - AWPMD_split *wpmd; // solver object - double ermscale; // scale of width mass for motion - double width_pbc; // setting for width pbc - double half_box_length; // calculated by coeff function + AWPMD_split *wpmd; // solver object + double ermscale; // scale of width mass for motion + double width_pbc; // setting for width pbc + double half_box_length; // calculated by coeff function }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-BOCS/compute_pressure_bocs.cpp b/src/USER-BOCS/compute_pressure_bocs.cpp index 49c644be71..b62d7cd1bf 100644 --- a/src/USER-BOCS/compute_pressure_bocs.cpp +++ b/src/USER-BOCS/compute_pressure_bocs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-BOCS/compute_pressure_bocs.h b/src/USER-BOCS/compute_pressure_bocs.h index eccc43bf48..d5d4b1a7b9 100644 --- a/src/USER-BOCS/compute_pressure_bocs.h +++ b/src/USER-BOCS/compute_pressure_bocs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -15,27 +15,26 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(PRESSURE/BOCS,ComputePressureBocs) - +// clang-format off +ComputeStyle(PRESSURE/BOCS,ComputePressureBocs); +// clang-format on #else - #ifndef LMP_COMPUTE_PRESSURE_BOCS_H #define LMP_COMPUTE_PRESSURE_BOCS_H #include "compute.h" namespace LAMMPS_NS { - // Enumerate the p_basis_type magic values to improve readability: - enum{BASIS_ANALYTIC, BASIS_LINEAR_SPLINE, BASIS_CUBIC_SPLINE}; - // Enumerate the data file column names to improve readability - enum{VOLUME, PRESSURE_CORRECTION}; - // Declare names for the number of columns in the splines data structure to improve readability - const int NUM_LINEAR_SPLINE_COLUMNS = 2; // linear spline columns passed to compute - const int NUM_CUBIC_SPLINE_COLUMNS = 5; // cubic spline columns passed to compute +// Enumerate the p_basis_type magic values to improve readability: +enum { BASIS_ANALYTIC, BASIS_LINEAR_SPLINE, BASIS_CUBIC_SPLINE }; +// Enumerate the data file column names to improve readability +enum { VOLUME, PRESSURE_CORRECTION }; +// Declare names for the number of columns in the splines data structure to improve readability +const int NUM_LINEAR_SPLINE_COLUMNS = 2; // linear spline columns passed to compute +const int NUM_CUBIC_SPLINE_COLUMNS = 5; // cubic spline columns passed to compute - // ComputePressure -> ComputePressureBocs MRD NJD +// ComputePressure -> ComputePressureBocs MRD NJD class ComputePressureBocs : public Compute { public: ComputePressureBocs(class LAMMPS *, int, char **); @@ -48,36 +47,36 @@ class ComputePressureBocs : public Compute { double compute_cg_scalar(); double get_cg_p_corr(int, double *, int, double, double); double get_cg_fluct(double, double); - void send_cg_info(int, int, double*, int, double); + void send_cg_info(int, int, double *, int, double); void send_cg_info(int, double **, int); double get_cg_p_corr(double **, int, double); - double find_index(double* , double); + double find_index(double *, double); protected: - double boltz,nktv2p,inv_volume; - int nvirial,dimension; + double boltz, nktv2p, inv_volume; + int nvirial, dimension; double **vptr; double *kspace_virial; Compute *temperature; char *id_temp; double virial[6]; - int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag; - int fixflag,kspaceflag; + int keflag, pairflag, bondflag, angleflag, dihedralflag, improperflag; + int fixflag, kspaceflag; -// NJD MRD + // NJD MRD int p_basis_type; int p_match_flag; double vavg; int N_mol; int N_basis; double *phi_coeff; - double ** splines; + double **splines; int spline_length; void virial_compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-BOCS/fix_bocs.cpp b/src/USER-BOCS/fix_bocs.cpp index da0ea3658b..4f773e7c65 100644 --- a/src/USER-BOCS/fix_bocs.cpp +++ b/src/USER-BOCS/fix_bocs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-BOCS/fix_bocs.h b/src/USER-BOCS/fix_bocs.h index da5eaac6d6..fd1e09115d 100644 --- a/src/USER-BOCS/fix_bocs.h +++ b/src/USER-BOCS/fix_bocs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,11 +14,10 @@ from The Pennsylvania State University ------------------------------------------------------------------------- */ - #ifdef FIX_CLASS - -FixStyle(bocs,FixBocs) - +// clang-format off +FixStyle(bocs,FixBocs); +// clang-format on #else #ifndef LMP_FIX_BOCS_H @@ -30,8 +29,8 @@ namespace LAMMPS_NS { class FixBocs : public Fix { public: - FixBocs(class LAMMPS *, int, char **); // MRD NJD - virtual ~FixBocs(); // MRD NJD + FixBocs(class LAMMPS *, int, char **); // MRD NJD + virtual ~FixBocs(); // MRD NJD int setmask(); virtual void init(); virtual void setup(int); @@ -43,106 +42,104 @@ class FixBocs : public Fix { double compute_scalar(); virtual double compute_vector(int); void write_restart(FILE *); - virtual int pack_restart_data(double *); // pack restart data + virtual int pack_restart_data(double *); // pack restart data virtual void restart(char *); int modify_param(int, char **); void reset_target(double); void reset_dt(); - virtual void *extract(const char*,int &); + virtual void *extract(const char *, int &); double memory_usage(); - protected: - int dimension,which; - double dtv,dtf,dthalf,dt4,dt8,dto; - double boltz,nktv2p,tdof; - double vol0; // reference volume - double t0; // reference temperature - // used for barostat mass - double t_start,t_stop; - double t_current,t_target,ke_target; + int dimension, which; + double dtv, dtf, dthalf, dt4, dt8, dto; + double boltz, nktv2p, tdof; + double vol0; // reference volume + double t0; // reference temperature + // used for barostat mass + double t_start, t_stop; + double t_current, t_target, ke_target; double t_freq; - int tstat_flag; // 1 if control T - int pstat_flag; // 1 if control P + int tstat_flag; // 1 if control T + int pstat_flag; // 1 if control P - int pstyle,pcouple,allremap; - int p_flag[6]; // 1 if control P on this dim, 0 if not - double p_start[6],p_stop[6]; - double p_freq[6],p_target[6]; - double omega[6],omega_dot[6]; + int pstyle, pcouple, allremap; + int p_flag[6]; // 1 if control P on this dim, 0 if not + double p_start[6], p_stop[6]; + double p_freq[6], p_target[6]; + double omega[6], omega_dot[6]; double omega_mass[6]; double p_current[6]; - double drag,tdrag_factor; // drag factor on particle thermostat - double pdrag_factor; // drag factor on barostat - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int dilate_group_bit; // mask for dilation group - int *rfix; // indices of rigid fixes - char *id_dilate; // group name to dilate - class Irregular *irregular; // for migrating atoms after box flips + double drag, tdrag_factor; // drag factor on particle thermostat + double pdrag_factor; // drag factor on barostat + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int dilate_group_bit; // mask for dilation group + int *rfix; // indices of rigid fixes + char *id_dilate; // group name to dilate + class Irregular *irregular; // for migrating atoms after box flips -// MRD NJD + // MRD NJD int p_basis_type; int p_match_flag; double vavg; int N_mol; int N_p_match; double *p_match_coeffs; - double ** splines; + double **splines; int spline_length; - int nlevels_respa; double *step_respa; - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tcomputeflag,pcomputeflag; // 1 = compute was created by fix - // 0 = created externally + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tcomputeflag, pcomputeflag; // 1 = compute was created by fix + // 0 = created externally - double *eta,*eta_dot; // chain thermostat for particles + double *eta, *eta_dot; // chain thermostat for particles double *eta_dotdot; double *eta_mass; - int mtchain; // length of chain - int mtchain_default_flag; // 1 = mtchain is default + int mtchain; // length of chain + int mtchain_default_flag; // 1 = mtchain is default - double *etap; // chain thermostat for barostat + double *etap; // chain thermostat for barostat double *etap_dot; double *etap_dotdot; double *etap_mass; - int mpchain; // length of chain + int mpchain; // length of chain - int mtk_flag; // 0 if using Hoover barostat - int pdim; // number of barostatted dims - double p_freq_max; // maximum barostat frequency + int mtk_flag; // 0 if using Hoover barostat + int pdim; // number of barostatted dims + double p_freq_max; // maximum barostat frequency - double p_hydro; // hydrostatic target pressure + double p_hydro; // hydrostatic target pressure - int nc_tchain,nc_pchain; + int nc_tchain, nc_pchain; double factor_eta; - double sigma[6]; // scaled target stress - double fdev[6]; // deviatoric force on barostat - int deviatoric_flag; // 0 if target stress tensor is hydrostatic - double h0_inv[6]; // h_inv of reference (zero strain) box - int nreset_h0; // interval for resetting h0 + double sigma[6]; // scaled target stress + double fdev[6]; // deviatoric force on barostat + int deviatoric_flag; // 0 if target stress tensor is hydrostatic + double h0_inv[6]; // h_inv of reference (zero strain) box + int nreset_h0; // interval for resetting h0 - double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections + double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections - int eta_mass_flag; // 1 if eta_mass updated, 0 if not. - int omega_mass_flag; // 1 if omega_mass updated, 0 if not. - int etap_mass_flag; // 1 if etap_mass updated, 0 if not. - int dipole_flag; // 1 if dipole is updated, 0 if not. - int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not + int eta_mass_flag; // 1 if eta_mass updated, 0 if not. + int omega_mass_flag; // 1 if omega_mass updated, 0 if not. + int etap_mass_flag; // 1 if etap_mass updated, 0 if not. + int dipole_flag; // 1 if dipole is updated, 0 if not. + int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not - int scaleyz; // 1 if yz scaled with lz - int scalexz; // 1 if xz scaled with lz - int scalexy; // 1 if xy scaled with ly - int flipflag; // 1 if box flips are invoked as needed + int scaleyz; // 1 if yz scaled with lz + int scalexz; // 1 if xz scaled with lz + int scalexy; // 1 if xy scaled with ly + int flipflag; // 1 if box flips are invoked as needed - int pre_exchange_flag; // set if pre_exchange needed for box flips + int pre_exchange_flag; // set if pre_exchange needed for box flips - double fixedpoint[3]; // location of dilation fixed-point + double fixedpoint[3]; // location of dilation fixed-point void couple(); virtual void remap(); @@ -153,7 +150,7 @@ class FixBocs : public Fix { int build_linear_splines(double **); int build_cubic_splines(double **); - virtual void nve_x(); // may be overwritten by child classes + virtual void nve_x(); // may be overwritten by child classes virtual void nve_v(); virtual void nh_v_press(); virtual void nh_v_temp(); @@ -167,7 +164,7 @@ class FixBocs : public Fix { void nh_omega_dot(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-BROWNIAN/fix_brownian.cpp b/src/USER-BROWNIAN/fix_brownian.cpp index 92a969661b..fc6b434080 100644 --- a/src/USER-BROWNIAN/fix_brownian.cpp +++ b/src/USER-BROWNIAN/fix_brownian.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-BROWNIAN/fix_brownian.h b/src/USER-BROWNIAN/fix_brownian.h index 97705f4f48..5847c1e8dc 100644 --- a/src/USER-BROWNIAN/fix_brownian.h +++ b/src/USER-BROWNIAN/fix_brownian.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -27,13 +27,12 @@ namespace LAMMPS_NS { class FixBrownian : public FixBrownianBase { public: FixBrownian(class LAMMPS *, int, char **); - virtual ~FixBrownian() {}; + virtual ~FixBrownian(){}; void init(); void initial_integrate(int); private: - template - void initial_integrate_templated(); + template void initial_integrate_templated(); }; } // namespace LAMMPS_NS diff --git a/src/USER-BROWNIAN/fix_brownian_asphere.cpp b/src/USER-BROWNIAN/fix_brownian_asphere.cpp index e7b6eb2728..ef0c246508 100644 --- a/src/USER-BROWNIAN/fix_brownian_asphere.cpp +++ b/src/USER-BROWNIAN/fix_brownian_asphere.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -39,7 +39,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixBrownianAsphere::FixBrownianAsphere(LAMMPS *lmp, int narg, char **arg) : - FixBrownianBase(lmp, narg, arg) + FixBrownianBase(lmp, narg, arg), avec(nullptr) { if (!gamma_t_eigen_flag || !gamma_r_eigen_flag) { error->all(FLERR, "Illegal fix brownian command."); @@ -73,7 +73,6 @@ void FixBrownianAsphere::init() double f_rot[3]; double *quat; - int *ellipsoid = atom->ellipsoid; AtomVecEllipsoid::Bonus *bonus = avec->bonus; double Q[3][3]; diff --git a/src/USER-BROWNIAN/fix_brownian_asphere.h b/src/USER-BROWNIAN/fix_brownian_asphere.h index 23a88ddaba..b40f797dd3 100644 --- a/src/USER-BROWNIAN/fix_brownian_asphere.h +++ b/src/USER-BROWNIAN/fix_brownian_asphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class FixBrownianAsphere : public FixBrownianBase { public: FixBrownianAsphere(class LAMMPS *, int, char **); - virtual ~FixBrownianAsphere() {}; + virtual ~FixBrownianAsphere(){}; void initial_integrate(int); void init(); diff --git a/src/USER-BROWNIAN/fix_brownian_base.cpp b/src/USER-BROWNIAN/fix_brownian_base.cpp index 93990681bd..fd5d1f5df7 100644 --- a/src/USER-BROWNIAN/fix_brownian_base.cpp +++ b/src/USER-BROWNIAN/fix_brownian_base.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -46,6 +46,7 @@ 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; + g2 = 0.0; if (narg < 5) error->all(FLERR, "Illegal fix brownian command."); @@ -201,7 +202,7 @@ void FixBrownianBase::init() g1 = force->ftm2v; if (noise_flag == 0) { - g2 = 0; + g2 = 0.0; } else if (gaussian_noise_flag == 1) { g2 = sqrt(2 * force->boltz * temp / dt / force->mvv2e); } else { diff --git a/src/USER-BROWNIAN/fix_brownian_base.h b/src/USER-BROWNIAN/fix_brownian_base.h index 5d3b7fe69b..c13fc71a84 100644 --- a/src/USER-BROWNIAN/fix_brownian_base.h +++ b/src/USER-BROWNIAN/fix_brownian_base.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-BROWNIAN/fix_brownian_sphere.cpp b/src/USER-BROWNIAN/fix_brownian_sphere.cpp index 00893d77e7..4621be595f 100644 --- a/src/USER-BROWNIAN/fix_brownian_sphere.cpp +++ b/src/USER-BROWNIAN/fix_brownian_sphere.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-BROWNIAN/fix_brownian_sphere.h b/src/USER-BROWNIAN/fix_brownian_sphere.h index 19e86204ad..73befb07f5 100644 --- a/src/USER-BROWNIAN/fix_brownian_sphere.h +++ b/src/USER-BROWNIAN/fix_brownian_sphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -27,13 +27,12 @@ namespace LAMMPS_NS { class FixBrownianSphere : public FixBrownianBase { public: FixBrownianSphere(class LAMMPS *, int, char **); - virtual ~FixBrownianSphere() {}; + virtual ~FixBrownianSphere(){}; void init(); void initial_integrate(int); private: - template - void initial_integrate_templated(); + template void initial_integrate_templated(); double g3, g4; }; } // namespace LAMMPS_NS diff --git a/src/USER-BROWNIAN/fix_propel_self.cpp b/src/USER-BROWNIAN/fix_propel_self.cpp index 9adb49d039..f2ff366be4 100644 --- a/src/USER-BROWNIAN/fix_propel_self.cpp +++ b/src/USER-BROWNIAN/fix_propel_self.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -42,7 +42,7 @@ enum { DIPOLE, VELOCITY, QUAT }; /* ---------------------------------------------------------------------- */ -FixPropelSelf::FixPropelSelf(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) +FixPropelSelf::FixPropelSelf(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), avec(nullptr) { virial_global_flag = virial_peratom_flag = 1; diff --git a/src/USER-BROWNIAN/fix_propel_self.h b/src/USER-BROWNIAN/fix_propel_self.h index 9874635818..7932e8af99 100644 --- a/src/USER-BROWNIAN/fix_propel_self.h +++ b/src/USER-BROWNIAN/fix_propel_self.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixPropelSelf : public Fix { public: FixPropelSelf(class LAMMPS *, int, char **); - virtual ~FixPropelSelf() {}; + virtual ~FixPropelSelf(){}; void init(); void post_force(int); void setup(int); diff --git a/src/USER-CGDNA/bond_oxdna2_fene.cpp b/src/USER-CGDNA/bond_oxdna2_fene.cpp index b846e52ddc..0fad5bfaae 100644 --- a/src/USER-CGDNA/bond_oxdna2_fene.cpp +++ b/src/USER-CGDNA/bond_oxdna2_fene.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/bond_oxdna2_fene.h b/src/USER-CGDNA/bond_oxdna2_fene.h index 474692de67..98a74e3551 100644 --- a/src/USER-CGDNA/bond_oxdna2_fene.h +++ b/src/USER-CGDNA/bond_oxdna2_fene.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(oxdna2/fene,BondOxdna2Fene) - +// clang-format off +BondStyle(oxdna2/fene,BondOxdna2Fene); +// clang-format on #else #ifndef LMP_BOND_OXDNA2_FENE_H @@ -28,11 +28,10 @@ class BondOxdna2Fene : public BondOxdnaFene { public: BondOxdna2Fene(class LAMMPS *); virtual ~BondOxdna2Fene(); - virtual void compute_interaction_sites(double *, double *, double *, - double *); + virtual void compute_interaction_sites(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/bond_oxdna_fene.cpp b/src/USER-CGDNA/bond_oxdna_fene.cpp index de32a9c661..483e54e809 100644 --- a/src/USER-CGDNA/bond_oxdna_fene.cpp +++ b/src/USER-CGDNA/bond_oxdna_fene.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/bond_oxdna_fene.h b/src/USER-CGDNA/bond_oxdna_fene.h index 012aa35b0c..d0151da4af 100644 --- a/src/USER-CGDNA/bond_oxdna_fene.h +++ b/src/USER-CGDNA/bond_oxdna_fene.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(oxdna/fene,BondOxdnaFene) - +// clang-format off +BondStyle(oxdna/fene,BondOxdnaFene); +// clang-format on #else #ifndef LMP_BOND_OXDNA_FENE_H @@ -28,8 +28,7 @@ class BondOxdnaFene : public Bond { public: BondOxdnaFene(class LAMMPS *); virtual ~BondOxdnaFene(); - virtual void compute_interaction_sites(double *, double *, double *, - double *); + virtual void compute_interaction_sites(double *, double *, double *, double *); virtual void compute(int, int); void coeff(int, char **); void init_style(); @@ -40,13 +39,13 @@ class BondOxdnaFene : public Bond { double single(int, double, int, int, double &); protected: - double *k,*Delta,*r0; // FENE + double *k, *Delta, *r0; // FENE void allocate(); void ev_tally_xyz(int, int, int, int, double, double, double, double, double, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/bond_oxrna2_fene.cpp b/src/USER-CGDNA/bond_oxrna2_fene.cpp index 9aaf7fe036..71c5d9edf3 100644 --- a/src/USER-CGDNA/bond_oxrna2_fene.cpp +++ b/src/USER-CGDNA/bond_oxrna2_fene.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/bond_oxrna2_fene.h b/src/USER-CGDNA/bond_oxrna2_fene.h index 898202700c..901daf2eb0 100644 --- a/src/USER-CGDNA/bond_oxrna2_fene.h +++ b/src/USER-CGDNA/bond_oxrna2_fene.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(oxrna2/fene,BondOxrna2Fene) - +// clang-format off +BondStyle(oxrna2/fene,BondOxrna2Fene); +// clang-format on #else #ifndef LMP_BOND_OXRNA2_FENE_H @@ -28,11 +28,10 @@ class BondOxrna2Fene : public BondOxdnaFene { public: BondOxrna2Fene(class LAMMPS *); virtual ~BondOxrna2Fene(); - virtual void compute_interaction_sites(double *, double *, double *, - double *); + virtual void compute_interaction_sites(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/fix_nve_dot.cpp b/src/USER-CGDNA/fix_nve_dot.cpp index 8bc60d6edc..53b13cdbf1 100644 --- a/src/USER-CGDNA/fix_nve_dot.cpp +++ b/src/USER-CGDNA/fix_nve_dot.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/fix_nve_dot.h b/src/USER-CGDNA/fix_nve_dot.h index e87d856dda..1f02536f51 100644 --- a/src/USER-CGDNA/fix_nve_dot.h +++ b/src/USER-CGDNA/fix_nve_dot.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/dot,FixNVEDot) - +// clang-format off +FixStyle(nve/dot,FixNVEDot); +// clang-format on #else #ifndef LMP_FIX_NVE_DOT_H @@ -32,26 +32,26 @@ class FixNVEDot : public FixNVE { void final_integrate(); private: - double dt,dthlf,dthlfm; + double dt, dthlf, dthlfm; class AtomVecEllipsoid *avec; // conversion from 3-vector in space frame to 4-vector in body frame - inline void vec3_to_vec4(const double * q, const double * v3, double * v4) + inline void vec3_to_vec4(const double *q, const double *v3, double *v4) { - v4[0] = -q[1]*v3[0] - q[2]*v3[1] - q[3]*v3[2]; - v4[1] = q[0]*v3[0] + q[3]*v3[1] - q[2]*v3[2]; - v4[2] = -q[3]*v3[0] + q[0]*v3[1] + q[1]*v3[2]; - v4[3] = q[2]*v3[0] - q[1]*v3[1] + q[0]*v3[2]; + v4[0] = -q[1] * v3[0] - q[2] * v3[1] - q[3] * v3[2]; + v4[1] = q[0] * v3[0] + q[3] * v3[1] - q[2] * v3[2]; + v4[2] = -q[3] * v3[0] + q[0] * v3[1] + q[1] * v3[2]; + v4[3] = q[2] * v3[0] - q[1] * v3[1] + q[0] * v3[2]; } // conversion from 4-vector in body frame to 3-vector in space frame - inline void vec4_to_vec3(const double * q, const double * v4, double * v3) + inline void vec4_to_vec3(const double *q, const double *v4, double *v3) { - v3[0] = -q[1]*v4[0] + q[0]*v4[1] - q[3]*v4[2] + q[2]*v4[3]; - v3[1] = -q[2]*v4[0] + q[3]*v4[1] + q[0]*v4[2] - q[1]*v4[3]; - v3[2] = -q[3]*v4[0] - q[2]*v4[1] + q[1]*v4[2] + q[0]*v4[3]; + v3[0] = -q[1] * v4[0] + q[0] * v4[1] - q[3] * v4[2] + q[2] * v4[3]; + v3[1] = -q[2] * v4[0] + q[3] * v4[1] + q[0] * v4[2] - q[1] * v4[3]; + v3[2] = -q[3] * v4[0] - q[2] * v4[1] + q[1] * v4[2] + q[0] * v4[3]; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/fix_nve_dotc_langevin.cpp b/src/USER-CGDNA/fix_nve_dotc_langevin.cpp index 008902dce1..54c1d1b545 100644 --- a/src/USER-CGDNA/fix_nve_dotc_langevin.cpp +++ b/src/USER-CGDNA/fix_nve_dotc_langevin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/fix_nve_dotc_langevin.h b/src/USER-CGDNA/fix_nve_dotc_langevin.h index b2fe7d2eb0..018db64c13 100644 --- a/src/USER-CGDNA/fix_nve_dotc_langevin.h +++ b/src/USER-CGDNA/fix_nve_dotc_langevin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/dotc/langevin,FixNVEDotcLangevin) - +// clang-format off +FixStyle(nve/dotc/langevin,FixNVEDotcLangevin); +// clang-format on #else #ifndef LMP_FIX_NVE_DOTC_LANGEVIN_H @@ -33,34 +33,35 @@ class FixNVEDotcLangevin : public FixNVE { void final_integrate(); private: - double dt,dthlf,dthlfm,dtqrt; + double dt, dthlf, dthlfm, dtqrt; // conversion from 3-vector in space frame to 4-vector in body frame - inline void vec3_to_vec4(const double * q, const double * v3, double * v4) + inline void vec3_to_vec4(const double *q, const double *v3, double *v4) { - v4[0] = -q[1]*v3[0] - q[2]*v3[1] - q[3]*v3[2]; - v4[1] = q[0]*v3[0] + q[3]*v3[1] - q[2]*v3[2]; - v4[2] = -q[3]*v3[0] + q[0]*v3[1] + q[1]*v3[2]; - v4[3] = q[2]*v3[0] - q[1]*v3[1] + q[0]*v3[2]; + v4[0] = -q[1] * v3[0] - q[2] * v3[1] - q[3] * v3[2]; + v4[1] = q[0] * v3[0] + q[3] * v3[1] - q[2] * v3[2]; + v4[2] = -q[3] * v3[0] + q[0] * v3[1] + q[1] * v3[2]; + v4[3] = q[2] * v3[0] - q[1] * v3[1] + q[0] * v3[2]; } // conversion from 4-vector in body frame to 3-vector in space frame - inline void vec4_to_vec3(const double * q, const double * v4, double * v3) + inline void vec4_to_vec3(const double *q, const double *v4, double *v3) { - v3[0] = -q[1]*v4[0] + q[0]*v4[1] - q[3]*v4[2] + q[2]*v4[3]; - v3[1] = -q[2]*v4[0] + q[3]*v4[1] + q[0]*v4[2] - q[1]*v4[3]; - v3[2] = -q[3]*v4[0] - q[2]*v4[1] + q[1]*v4[2] + q[0]*v4[3]; + v3[0] = -q[1] * v4[0] + q[0] * v4[1] - q[3] * v4[2] + q[2] * v4[3]; + v3[1] = -q[2] * v4[0] + q[3] * v4[1] + q[0] * v4[2] - q[1] * v4[3]; + v3[2] = -q[3] * v4[0] - q[2] * v4[1] + q[1] * v4[2] + q[0] * v4[3]; } + protected: int seed; class AtomVecEllipsoid *avec; - double t_start,t_stop,t_period,t_target,tsqrt; - double gamma,Gamma,ascale; - double M,gfactor1,gfactor2; - double gfactor3[3],gfactor4[3],gfactor5[3]; + double t_start, t_stop, t_period, t_target, tsqrt; + double gamma, Gamma, ascale; + double M, gfactor1, gfactor2; + double gfactor3[3], gfactor4[3], gfactor5[3]; class RanMars *random; void compute_target(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/mf_oxdna.h b/src/USER-CGDNA/mf_oxdna.h index 05bf5eae8f..0dcd236773 100644 --- a/src/USER-CGDNA/mf_oxdna.h +++ b/src/USER-CGDNA/mf_oxdna.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,141 +18,118 @@ namespace MFOxdna { - inline double F1(double, double, double, double, double, double, double, double, double, double, double); - inline double DF1(double, double, double, double, double, double, double, double, double, double); - inline double F2(double, double, double, double, double, double, double, double, double, double); - inline double DF2(double, double, double, double, double, double, double, double, double); - inline double F3(double, double, double, double, double, double, double, double &); - inline double F4(double, double, double, double, double, double); - inline double DF4(double, double, double, double, double, double); - inline double F5(double, double, double, double, double); - inline double DF5(double, double, double, double, double); - inline double F6(double, double, double); - inline double DF6(double, double, double); - inline double is_3pto5p(const double *, const double *); +inline double F1(double, double, double, double, double, double, double, double, double, double, + double); +inline double DF1(double, double, double, double, double, double, double, double, double, double); +inline double F2(double, double, double, double, double, double, double, double, double, double); +inline double DF2(double, double, double, double, double, double, double, double, double); +inline double F3(double, double, double, double, double, double, double, double &); +inline double F4(double, double, double, double, double, double); +inline double DF4(double, double, double, double, double, double); +inline double F5(double, double, double, double, double); +inline double DF5(double, double, double, double, double); +inline double F6(double, double, double); +inline double DF6(double, double, double); +inline double is_3pto5p(const double *, const double *); -} +} // namespace MFOxdna /* ---------------------------------------------------------------------- f1 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::F1(double r, double eps, double a, double cut_0, - double cut_lc, double cut_hc, double cut_lo, - double cut_hi, double b_lo, double b_hi, +inline double MFOxdna::F1(double r, double eps, double a, double cut_0, double cut_lc, + double cut_hc, double cut_lo, double cut_hi, double b_lo, double b_hi, double shift) { if (r > cut_hc) { return 0.0; - } - else if (r > cut_hi) { - return eps * b_hi * (r-cut_hc) * (r-cut_hc); - } - else if (r > cut_lo) { - double tmp = 1 - exp(-(r-cut_0) * a); + } else if (r > cut_hi) { + return eps * b_hi * (r - cut_hc) * (r - cut_hc); + } else if (r > cut_lo) { + double tmp = 1 - exp(-(r - cut_0) * a); return eps * tmp * tmp - shift; - } - else if (r > cut_lc) { - return eps * b_lo * (r-cut_lc) * (r-cut_lc); - } - else { + } else if (r > cut_lc) { + return eps * b_lo * (r - cut_lc) * (r - cut_lc); + } else { return 0.0; } - } /* ---------------------------------------------------------------------- derivative of f1 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::DF1(double r, double eps, double a, double cut_0, - double cut_lc, double cut_hc, double cut_lo, - double cut_hi, double b_lo, double b_hi) +inline double MFOxdna::DF1(double r, double eps, double a, double cut_0, double cut_lc, + double cut_hc, double cut_lo, double cut_hi, double b_lo, double b_hi) { if (r > cut_hc) { return 0.0; - } - else if (r > cut_hi) { + } else if (r > cut_hi) { return 2 * eps * b_hi * (1 - cut_hc / r); - } - else if (r > cut_lo) { - double tmp = exp(-(r-cut_0) * a); + } else if (r > cut_lo) { + double tmp = exp(-(r - cut_0) * a); return 2 * eps * (1 - tmp) * tmp * a / r; - } - else if (r > cut_lc) { + } else if (r > cut_lc) { return 2 * eps * b_lo * (1 - cut_lc / r); - } - else { + } else { return 0.0; } - } /* ---------------------------------------------------------------------- f2 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::F2(double r, double k, double cut_0, double cut_lc, - double cut_hc, double cut_lo, double cut_hi, - double b_lo, double b_hi, double cut_c) +inline double MFOxdna::F2(double r, double k, double cut_0, double cut_lc, double cut_hc, + double cut_lo, double cut_hi, double b_lo, double b_hi, double cut_c) { if (r < cut_lc || r > cut_hc) { return 0; - } - else if (r < cut_lo) { - return k * b_lo * (cut_lc - r)*(cut_lc-r); - } - else if (r < cut_hi) { - return k * 0.5 * ((r - cut_0)*(r-cut_0) - (cut_0 - cut_c)*(cut_0 - cut_c)); - } - else{ + } else if (r < cut_lo) { + return k * b_lo * (cut_lc - r) * (cut_lc - r); + } else if (r < cut_hi) { + return k * 0.5 * ((r - cut_0) * (r - cut_0) - (cut_0 - cut_c) * (cut_0 - cut_c)); + } else { return k * b_hi * (cut_hc - r) * (cut_hc - r); } - } /* ---------------------------------------------------------------------- derivative of f2 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::DF2(double r, double k, double cut_0, double cut_lc, - double cut_hc, double cut_lo, double cut_hi, - double b_lo, double b_hi) +inline double MFOxdna::DF2(double r, double k, double cut_0, double cut_lc, double cut_hc, + double cut_lo, double cut_hi, double b_lo, double b_hi) { if (r < cut_lc || r > cut_hc) { return 0; - } - else if (r < cut_lo) { - return 2*k * b_lo * (r - cut_lc); - } - else if (r < cut_hi) { + } else if (r < cut_lo) { + return 2 * k * b_lo * (r - cut_lc); + } else if (r < cut_hi) { return k * (r - cut_0); + } else { + return 2 * k * b_hi * (r - cut_hc); } - else{ - return 2*k * b_hi * (r - cut_hc); - } - } /* ---------------------------------------------------------------------- f3 modulation factor, force and energy calculation ------------------------------------------------------------------------- */ -inline double MFOxdna::F3(double rsq, double cutsq_ast, double cut_c, - double lj1, double lj2, double eps, double b, - double & fpair) +inline double MFOxdna::F3(double rsq, double cutsq_ast, double cut_c, double lj1, double lj2, + double eps, double b, double &fpair) { double evdwl = 0.0; if (rsq < cutsq_ast) { - double r2inv = 1.0/rsq; - double r6inv = r2inv*r2inv*r2inv; - fpair = r2inv*r6inv*(12*lj1*r6inv - 6*lj2); - evdwl = r6inv*(lj1*r6inv-lj2); - } - else { + double r2inv = 1.0 / rsq; + double r6inv = r2inv * r2inv * r2inv; + fpair = r2inv * r6inv * (12 * lj1 * r6inv - 6 * lj2); + evdwl = r6inv * (lj1 * r6inv - lj2); + } else { double r = sqrt(rsq); - double rinv = 1.0/r; - fpair = 2*eps*b*(cut_c*rinv - 1); - evdwl = eps*b*(cut_c-r)*(cut_c-r); + double rinv = 1.0 / r; + fpair = 2 * eps * b * (cut_c * rinv - 1); + evdwl = eps * b * (cut_c - r) * (cut_c - r); } return evdwl; } @@ -160,24 +137,20 @@ inline double MFOxdna::F3(double rsq, double cutsq_ast, double cut_c, /* ---------------------------------------------------------------------- f4 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::F4(double theta, double a, double theta_0, - double dtheta_ast, double b, double dtheta_c) +inline double MFOxdna::F4(double theta, double a, double theta_0, double dtheta_ast, double b, + double dtheta_c) { - double dtheta = theta-theta_0; + double dtheta = theta - theta_0; if (fabs(dtheta) > dtheta_c) { return 0.0; + } else if (dtheta > dtheta_ast) { + return b * (dtheta - dtheta_c) * (dtheta - dtheta_c); + } else if (dtheta > -dtheta_ast) { + return 1 - a * dtheta * dtheta; + } else { + return b * (dtheta + dtheta_c) * (dtheta + dtheta_c); } - else if (dtheta > dtheta_ast) { - return b * (dtheta-dtheta_c)*(dtheta-dtheta_c); - } - else if (dtheta > -dtheta_ast) { - return 1 - a * dtheta*dtheta; - } - else { - return b * (dtheta+dtheta_c)*(dtheta+dtheta_c); - } - } /* ---------------------------------------------------------------------- @@ -188,43 +161,35 @@ inline double MFOxdna::F4(double theta, double a, double theta_0, because the sign of DF4 depends on the sign of theta in the function call. It is also more efficient to store sin(theta). ------------------------------------------------------------------------- */ -inline double MFOxdna::DF4(double theta, double a, double theta_0, - double dtheta_ast, double b, double dtheta_c) +inline double MFOxdna::DF4(double theta, double a, double theta_0, double dtheta_ast, double b, + double dtheta_c) { - double dtheta = theta-theta_0; + double dtheta = theta - theta_0; if (fabs(dtheta) > dtheta_c) { return 0.0; + } else if (dtheta > dtheta_ast) { + return 2 * b * (dtheta - dtheta_c); + } else if (dtheta > -dtheta_ast) { + return -2 * a * dtheta; + } else { + return 2 * b * (dtheta + dtheta_c); } - else if (dtheta > dtheta_ast) { - return 2*b* (dtheta-dtheta_c); - } - else if (dtheta > -dtheta_ast) { - return -2*a * dtheta; - } - else { - return 2*b* (dtheta+dtheta_c); - } - } /* ---------------------------------------------------------------------- f5 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::F5(double x, double a, double x_ast, - double b, double x_c) +inline double MFOxdna::F5(double x, double a, double x_ast, double b, double x_c) { if (x >= 0) { return 1.0; - } - else if (x > x_ast) { + } else if (x > x_ast) { return 1 - a * x * x; - } - else if (x > x_c) { - return b * (x-x_c) * (x-x_c); - } - else { + } else if (x > x_c) { + return b * (x - x_c) * (x - x_c); + } else { return 0.0; } } @@ -232,19 +197,15 @@ inline double MFOxdna::F5(double x, double a, double x_ast, /* ---------------------------------------------------------------------- derivative of f5 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::DF5(double x, double a, double x_ast, - double b, double x_c) +inline double MFOxdna::DF5(double x, double a, double x_ast, double b, double x_c) { if (x >= 0) { return 0.0; - } - else if (x > x_ast) { + } else if (x > x_ast) { return -2 * a * x; - } - else if (x > x_c) { - return 2 * b * (x-x_c); - } - else { + } else if (x > x_c) { + return 2 * b * (x - x_c); + } else { return 0.0; } return 0; @@ -257,9 +218,8 @@ inline double MFOxdna::F6(double theta, double a, double b) { if (theta < b) { return 0.0; - } - else { - return 0.5 * a * (theta-b)*(theta-b); + } else { + return 0.5 * a * (theta - b) * (theta - b); } } @@ -270,9 +230,8 @@ inline double MFOxdna::DF6(double theta, double a, double b) { if (theta < b) { return 0.0; - } - else { - return a * (theta-b); + } else { + return a * (theta - b); } } @@ -280,8 +239,8 @@ inline double MFOxdna::DF6(double theta, double a, double b) test for directionality by projecting base normal n onto delr = a - b, returns 1 if nucleotide b to nucleotide a is 3' to 5', otherwise -1 ------------------------------------------------------------------------- */ -inline double MFOxdna::is_3pto5p(const double * delr, const double * n) +inline double MFOxdna::is_3pto5p(const double *delr, const double *n) { - return copysign(1.0,MathExtra::dot3(delr,n)); + return copysign(1.0, MathExtra::dot3(delr, n)); } #endif diff --git a/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp b/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp index 47d16c4806..e8ab197be1 100644 --- a/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp +++ b/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxdna2_coaxstk.h b/src/USER-CGDNA/pair_oxdna2_coaxstk.h index b397a8a60d..2a323be579 100644 --- a/src/USER-CGDNA/pair_oxdna2_coaxstk.h +++ b/src/USER-CGDNA/pair_oxdna2_coaxstk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxdna2/coaxstk,PairOxdna2Coaxstk) - +// clang-format off +PairStyle(oxdna2/coaxstk,PairOxdna2Coaxstk); +// clang-format on #else #ifndef LMP_PAIR_OXDNA2_COAXSTK_H @@ -64,7 +64,7 @@ class PairOxdna2Coaxstk : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna2_dh.cpp b/src/USER-CGDNA/pair_oxdna2_dh.cpp index 6b0df2cde6..1a587e82e1 100644 --- a/src/USER-CGDNA/pair_oxdna2_dh.cpp +++ b/src/USER-CGDNA/pair_oxdna2_dh.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxdna2_dh.h b/src/USER-CGDNA/pair_oxdna2_dh.h index 6b6dbd6e50..925b53e322 100644 --- a/src/USER-CGDNA/pair_oxdna2_dh.h +++ b/src/USER-CGDNA/pair_oxdna2_dh.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxdna2/dh,PairOxdna2Dh) - +// clang-format off +PairStyle(oxdna2/dh,PairOxdna2Dh); +// clang-format on #else #ifndef LMP_PAIR_OXDNA2_DH_H @@ -28,8 +28,7 @@ class PairOxdna2Dh : public Pair { public: PairOxdna2Dh(class LAMMPS *); virtual ~PairOxdna2Dh(); - virtual void compute_interaction_sites(double *, double *, double *, - double *); + virtual void compute_interaction_sites(double *, double *, double *, double *); virtual void compute(int, int); void settings(int, char **); void coeff(int, char **); @@ -44,15 +43,13 @@ class PairOxdna2Dh : public Pair { void *extract(const char *, int &); protected: - - double **qeff_dh_pf,**kappa_dh; - double **b_dh,**cut_dh_ast,**cutsq_dh_ast,**cut_dh_c,**cutsq_dh_c; + double **qeff_dh_pf, **kappa_dh; + double **b_dh, **cut_dh_ast, **cutsq_dh_ast, **cut_dh_c, **cutsq_dh_c; virtual void allocate(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna2_excv.cpp b/src/USER-CGDNA/pair_oxdna2_excv.cpp index 173c3d28db..2197fceb76 100644 --- a/src/USER-CGDNA/pair_oxdna2_excv.cpp +++ b/src/USER-CGDNA/pair_oxdna2_excv.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxdna2_excv.h b/src/USER-CGDNA/pair_oxdna2_excv.h index 1faaca89ff..e5fc3a3a26 100644 --- a/src/USER-CGDNA/pair_oxdna2_excv.h +++ b/src/USER-CGDNA/pair_oxdna2_excv.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxdna2/excv,PairOxdna2Excv) - +// clang-format off +PairStyle(oxdna2/excv,PairOxdna2Excv); +// clang-format on #else #ifndef LMP_PAIR_OXDNA2_EXCV_H @@ -28,11 +28,10 @@ class PairOxdna2Excv : public PairOxdnaExcv { public: PairOxdna2Excv(class LAMMPS *); virtual ~PairOxdna2Excv(); - virtual void compute_interaction_sites(double *, double *, - double *, double *, double *); + virtual void compute_interaction_sites(double *, double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna_coaxstk.cpp b/src/USER-CGDNA/pair_oxdna_coaxstk.cpp index c062bbfa99..2715b7c5e2 100644 --- a/src/USER-CGDNA/pair_oxdna_coaxstk.cpp +++ b/src/USER-CGDNA/pair_oxdna_coaxstk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxdna_coaxstk.h b/src/USER-CGDNA/pair_oxdna_coaxstk.h index c4095a2c21..5771bbe592 100644 --- a/src/USER-CGDNA/pair_oxdna_coaxstk.h +++ b/src/USER-CGDNA/pair_oxdna_coaxstk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxdna/coaxstk,PairOxdnaCoaxstk) -PairStyle(oxrna2/coaxstk,PairOxdnaCoaxstk) - +// clang-format off +PairStyle(oxdna/coaxstk,PairOxdnaCoaxstk); +PairStyle(oxrna2/coaxstk,PairOxdnaCoaxstk); +// clang-format on #else #ifndef LMP_PAIR_OXDNA_COAXSTK_H @@ -66,7 +66,7 @@ class PairOxdnaCoaxstk : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna_excv.cpp b/src/USER-CGDNA/pair_oxdna_excv.cpp index e5f2a5cad5..d41976e86c 100644 --- a/src/USER-CGDNA/pair_oxdna_excv.cpp +++ b/src/USER-CGDNA/pair_oxdna_excv.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxdna_excv.h b/src/USER-CGDNA/pair_oxdna_excv.h index c9e51df46e..c3ad6cf37a 100644 --- a/src/USER-CGDNA/pair_oxdna_excv.h +++ b/src/USER-CGDNA/pair_oxdna_excv.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxdna/excv,PairOxdnaExcv) - +// clang-format off +PairStyle(oxdna/excv,PairOxdnaExcv); +// clang-format on #else #ifndef LMP_PAIR_OXDNA_EXCV_H @@ -28,8 +28,7 @@ class PairOxdnaExcv : public Pair { public: PairOxdnaExcv(class LAMMPS *); virtual ~PairOxdnaExcv(); - virtual void compute_interaction_sites(double *, double *, double *, - double *, double *); + virtual void compute_interaction_sites(double *, double *, double *, double *, double *); virtual void compute(int, int); void settings(int, char **); void coeff(int, char **); @@ -55,10 +54,9 @@ class PairOxdnaExcv : public Pair { double **lj1_bb, **lj2_bb, **b_bb, **cut_bb_c, **cutsq_bb_c; virtual void allocate(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna_hbond.cpp b/src/USER-CGDNA/pair_oxdna_hbond.cpp index 3e1d51ddf1..4bf0bc9c56 100644 --- a/src/USER-CGDNA/pair_oxdna_hbond.cpp +++ b/src/USER-CGDNA/pair_oxdna_hbond.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxdna_hbond.h b/src/USER-CGDNA/pair_oxdna_hbond.h index 0a0d99c998..fdc8e9823b 100644 --- a/src/USER-CGDNA/pair_oxdna_hbond.h +++ b/src/USER-CGDNA/pair_oxdna_hbond.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxdna/hbond,PairOxdnaHbond) -PairStyle(oxdna2/hbond,PairOxdnaHbond) - +// clang-format off +PairStyle(oxdna/hbond,PairOxdnaHbond); +PairStyle(oxdna2/hbond,PairOxdnaHbond); +// clang-format on #else #ifndef LMP_PAIR_OXDNA_HBOND_H @@ -72,7 +72,7 @@ class PairOxdnaHbond : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna_stk.cpp b/src/USER-CGDNA/pair_oxdna_stk.cpp index 6aed2d854c..25521fd1e0 100644 --- a/src/USER-CGDNA/pair_oxdna_stk.cpp +++ b/src/USER-CGDNA/pair_oxdna_stk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxdna_stk.h b/src/USER-CGDNA/pair_oxdna_stk.h index f4ffe62dfa..3d6c22d909 100644 --- a/src/USER-CGDNA/pair_oxdna_stk.h +++ b/src/USER-CGDNA/pair_oxdna_stk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxdna/stk,PairOxdnaStk) -PairStyle(oxdna2/stk,PairOxdnaStk) - +// clang-format off +PairStyle(oxdna/stk,PairOxdnaStk); +PairStyle(oxdna2/stk,PairOxdnaStk); +// clang-format on #else #ifndef LMP_PAIR_OXDNA_STK_H @@ -65,7 +65,7 @@ class PairOxdnaStk : public Pair { void ev_tally_xyz(int, int, int, int, double, double, double, double, double, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna_xstk.cpp b/src/USER-CGDNA/pair_oxdna_xstk.cpp index c1b63ea2fa..447483e413 100644 --- a/src/USER-CGDNA/pair_oxdna_xstk.cpp +++ b/src/USER-CGDNA/pair_oxdna_xstk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxdna_xstk.h b/src/USER-CGDNA/pair_oxdna_xstk.h index 5811ca3a76..30089f53fb 100644 --- a/src/USER-CGDNA/pair_oxdna_xstk.h +++ b/src/USER-CGDNA/pair_oxdna_xstk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxdna/xstk,PairOxdnaXstk) -PairStyle(oxdna2/xstk,PairOxdnaXstk) - +// clang-format off +PairStyle(oxdna/xstk,PairOxdnaXstk); +PairStyle(oxdna2/xstk,PairOxdnaXstk); +// clang-format on #else #ifndef LMP_PAIR_OXDNA_XSTK_H @@ -69,7 +69,7 @@ class PairOxdnaXstk : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxrna2_dh.cpp b/src/USER-CGDNA/pair_oxrna2_dh.cpp index 2f7257a143..9ebbabbd1a 100644 --- a/src/USER-CGDNA/pair_oxrna2_dh.cpp +++ b/src/USER-CGDNA/pair_oxrna2_dh.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxrna2_dh.h b/src/USER-CGDNA/pair_oxrna2_dh.h index a9f0640085..1b66cd82ca 100644 --- a/src/USER-CGDNA/pair_oxrna2_dh.h +++ b/src/USER-CGDNA/pair_oxrna2_dh.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxrna2/dh,PairOxrna2Dh) - +// clang-format off +PairStyle(oxrna2/dh,PairOxrna2Dh); +// clang-format on #else #ifndef LMP_PAIR_OXRNA2_DH_H @@ -28,12 +28,10 @@ class PairOxrna2Dh : public PairOxdna2Dh { public: PairOxrna2Dh(class LAMMPS *); virtual ~PairOxrna2Dh(); - virtual void compute_interaction_sites(double *, double *, double *, - double *); - + virtual void compute_interaction_sites(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxrna2_excv.cpp b/src/USER-CGDNA/pair_oxrna2_excv.cpp index 254c50d96d..0e0535f0a0 100644 --- a/src/USER-CGDNA/pair_oxrna2_excv.cpp +++ b/src/USER-CGDNA/pair_oxrna2_excv.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxrna2_excv.h b/src/USER-CGDNA/pair_oxrna2_excv.h index e496db881e..90537f865e 100644 --- a/src/USER-CGDNA/pair_oxrna2_excv.h +++ b/src/USER-CGDNA/pair_oxrna2_excv.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxrna2/excv,PairOxrna2Excv) - +// clang-format off +PairStyle(oxrna2/excv,PairOxrna2Excv); +// clang-format on #else #ifndef LMP_PAIR_OXRNA2_EXCV_H @@ -28,11 +28,10 @@ class PairOxrna2Excv : public PairOxdnaExcv { public: PairOxrna2Excv(class LAMMPS *); virtual ~PairOxrna2Excv(); - virtual void compute_interaction_sites(double *, double *, - double *, double *, double *); + virtual void compute_interaction_sites(double *, double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxrna2_hbond.cpp b/src/USER-CGDNA/pair_oxrna2_hbond.cpp index 7e6dc32b2e..31f50816aa 100644 --- a/src/USER-CGDNA/pair_oxrna2_hbond.cpp +++ b/src/USER-CGDNA/pair_oxrna2_hbond.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxrna2_hbond.h b/src/USER-CGDNA/pair_oxrna2_hbond.h index 1122949110..ed96bda744 100644 --- a/src/USER-CGDNA/pair_oxrna2_hbond.h +++ b/src/USER-CGDNA/pair_oxrna2_hbond.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxrna2/hbond,PairOxrna2Hbond) - +// clang-format off +PairStyle(oxrna2/hbond,PairOxrna2Hbond); +// clang-format on #else #ifndef LMP_PAIR_OXRNA2_HBOND_H @@ -30,7 +30,7 @@ class PairOxrna2Hbond : public PairOxdnaHbond { virtual ~PairOxrna2Hbond(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxrna2_stk.cpp b/src/USER-CGDNA/pair_oxrna2_stk.cpp index 3b02a57501..8353a22463 100644 --- a/src/USER-CGDNA/pair_oxrna2_stk.cpp +++ b/src/USER-CGDNA/pair_oxrna2_stk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxrna2_stk.h b/src/USER-CGDNA/pair_oxrna2_stk.h index 96ea2752ed..7648dd207d 100644 --- a/src/USER-CGDNA/pair_oxrna2_stk.h +++ b/src/USER-CGDNA/pair_oxrna2_stk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxrna2/stk,PairOxrna2Stk) - +// clang-format off +PairStyle(oxrna2/stk,PairOxrna2Stk); +// clang-format on #else #ifndef LMP_PAIR_OXRNA2_STK_H @@ -66,7 +66,7 @@ class PairOxrna2Stk : public Pair { void ev_tally_xyz(int, int, int, int, double, double, double, double, double, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxrna2_xstk.cpp b/src/USER-CGDNA/pair_oxrna2_xstk.cpp index 71c6ca0356..8b44a9bde1 100644 --- a/src/USER-CGDNA/pair_oxrna2_xstk.cpp +++ b/src/USER-CGDNA/pair_oxrna2_xstk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGDNA/pair_oxrna2_xstk.h b/src/USER-CGDNA/pair_oxrna2_xstk.h index 7b07f3fad4..187d0b67ae 100644 --- a/src/USER-CGDNA/pair_oxrna2_xstk.h +++ b/src/USER-CGDNA/pair_oxrna2_xstk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(oxrna2/xstk,PairOxrna2Xstk) - +// clang-format off +PairStyle(oxrna2/xstk,PairOxrna2Xstk); +// clang-format on #else #ifndef LMP_PAIR_OXRNA2_XSTK_H @@ -65,7 +65,7 @@ class PairOxrna2Xstk : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGSDK/angle_sdk.cpp b/src/USER-CGSDK/angle_sdk.cpp index 16caa00d21..5e649d7846 100644 --- a/src/USER-CGSDK/angle_sdk.cpp +++ b/src/USER-CGSDK/angle_sdk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGSDK/angle_sdk.h b/src/USER-CGSDK/angle_sdk.h index 8ff252f359..880f086be4 100644 --- a/src/USER-CGSDK/angle_sdk.h +++ b/src/USER-CGSDK/angle_sdk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(sdk,AngleSDK) - +// clang-format off +AngleStyle(sdk,AngleSDK); +// clang-format on #else #ifndef LMP_ANGLE_SDK_H @@ -38,24 +38,23 @@ class AngleSDK : public Angle { double single(int, int, int, int); protected: - double *k,*theta0; + double *k, *theta0; // scaling factor for repulsive 1-3 interaction double *repscale; // parameters from SDK pair style int **lj_type; - double **lj1,**lj2, **lj3, **lj4; - double **rminsq,**emin; + double **lj1, **lj2, **lj3, **lj4; + double **rminsq, **emin; - int repflag; // 1 if we have to handle 1-3 repulsion + int repflag; // 1 if we have to handle 1-3 repulsion - void ev_tally13(int, int, int, int, double, double, - double, double, double); + void ev_tally13(int, int, int, int, double, double, double, double, double); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGSDK/lj_sdk_common.h b/src/USER-CGSDK/lj_sdk_common.h index d09fd9f439..1157b89521 100644 --- a/src/USER-CGSDK/lj_sdk_common.h +++ b/src/USER-CGSDK/lj_sdk_common.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -25,21 +25,24 @@ namespace LAMMPS_NS { namespace LJSDKParms { // LJ type flags. list of supported LJ exponent combinations - enum {LJ_NOT_SET=0, LJ9_6, LJ12_4, LJ12_6, NUM_LJ_TYPES}; + enum { LJ_NOT_SET = 0, LJ9_6, LJ12_4, LJ12_6, NUM_LJ_TYPES }; #if defined(LMP_NEED_SDK_FIND_LJ_TYPE) - static int find_lj_type(const char *label, - const char * const * const list) { - for (int i=0; i < NUM_LJ_TYPES; ++i) - if (strcmp(label,list[i]) == 0) return i; + static int find_lj_type(const char *label, const char *const *const list) + { + for (int i = 0; i < NUM_LJ_TYPES; ++i) + if (strcmp(label, list[i]) == 0) return i; return LJ_NOT_SET; } #endif - static const char * const lj_type_list[] = {"none", "lj9_6", "lj12_4", "lj12_6"}; - static const double lj_prefact[] = {0.0, 6.75, 2.59807621135332, 4.0}; - static const double lj_pow1[] = {0.0, 9.00, 12.0, 12.0}; - static const double lj_pow2[] = {0.0, 6.00, 4.0, 6.0}; -}} + // clang-format off + static const char *const lj_type_list[] = {"none", "lj9_6", "lj12_4", "lj12_6"}; + static constexpr double lj_prefact[] = {0.0, 6.75, 2.59807621135332, 4.0}; + static constexpr double lj_pow1[] = {0.0, 9.00, 12.0, 12.0}; + static constexpr double lj_pow2[] = {0.0, 6.00, 4.0, 6.0}; + // clang-format on +} // namespace LJSDKParms +} // namespace LAMMPS_NS #endif diff --git a/src/USER-CGSDK/pair_lj_sdk.cpp b/src/USER-CGSDK/pair_lj_sdk.cpp index fd9e13fecf..597c1d59c4 100644 --- a/src/USER-CGSDK/pair_lj_sdk.cpp +++ b/src/USER-CGSDK/pair_lj_sdk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -47,6 +48,8 @@ PairLJSDK::PairLJSDK(LAMMPS *lmp) : Pair(lmp) PairLJSDK::~PairLJSDK() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(lj_type); diff --git a/src/USER-CGSDK/pair_lj_sdk.h b/src/USER-CGSDK/pair_lj_sdk.h index 2d825d9a05..fd6a9f7595 100644 --- a/src/USER-CGSDK/pair_lj_sdk.h +++ b/src/USER-CGSDK/pair_lj_sdk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/sdk,PairLJSDK) - +// clang-format off +PairStyle(lj/sdk,PairLJSDK); +// clang-format on #else #ifndef LMP_PAIR_LJ_SDK_H @@ -47,11 +47,11 @@ class PairLJSDK : public Pair { virtual double memory_usage(); protected: - int **lj_type; // type of lennard jones potential + int **lj_type; // type of lennard jones potential double **cut; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; // cutoff and offset for minimum of LJ potential // to be used in SDK angle potential, which @@ -65,10 +65,9 @@ class PairLJSDK : public Pair { private: template void eval(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp index 293a4b1b9c..0fd0d2d30a 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp +++ b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_long.h b/src/USER-CGSDK/pair_lj_sdk_coul_long.h index d505b4e161..ea5986284b 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_long.h +++ b/src/USER-CGSDK/pair_lj_sdk_coul_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/sdk/coul/long,PairLJSDKCoulLong) - +// clang-format off +PairStyle(lj/sdk/coul/long,PairLJSDKCoulLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_SDK_COUL_LONG_H @@ -48,10 +48,10 @@ class PairLJSDKCoulLong : public Pair { virtual double memory_usage(); protected: - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; int **lj_type; // cutoff and offset for minimum of LJ potential @@ -67,10 +67,9 @@ class PairLJSDKCoulLong : public Pair { private: template void eval(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp b/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp index 2e94fe815d..b05f4043fb 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp +++ b/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_msm.h b/src/USER-CGSDK/pair_lj_sdk_coul_msm.h index dc15b07820..0b4031aa81 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_msm.h +++ b/src/USER-CGSDK/pair_lj_sdk_coul_msm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/sdk/coul/msm,PairLJSDKCoulMSM) - +// clang-format off +PairStyle(lj/sdk/coul/msm,PairLJSDKCoulMSM); +// clang-format on #else #ifndef LMP_PAIR_LJ_SDK_COUL_MSM_H @@ -31,17 +31,16 @@ namespace LAMMPS_NS { class PairLJSDKCoulMSM : public PairLJSDKCoulLong { public: PairLJSDKCoulMSM(class LAMMPS *); - virtual ~PairLJSDKCoulMSM() {}; + virtual ~PairLJSDKCoulMSM(){}; virtual void compute(int, int); virtual double single(int, int, int, int, double, double, double, double &); virtual void *extract(const char *, int &); -private: + private: template void eval_msm(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-COLVARS/colvarproxy_lammps.cpp b/src/USER-COLVARS/colvarproxy_lammps.cpp index eb7d1820e5..b1c9877599 100644 --- a/src/USER-COLVARS/colvarproxy_lammps.cpp +++ b/src/USER-COLVARS/colvarproxy_lammps.cpp @@ -1,3 +1,4 @@ +// clang-format off // -*- c++ -*- // This file is part of the Collective Variables module (Colvars). diff --git a/src/USER-COLVARS/colvarproxy_lammps.h b/src/USER-COLVARS/colvarproxy_lammps.h index aee268932e..b7b2799802 100644 --- a/src/USER-COLVARS/colvarproxy_lammps.h +++ b/src/USER-COLVARS/colvarproxy_lammps.h @@ -10,10 +10,10 @@ #ifndef COLVARPROXY_LAMMPS_H #define COLVARPROXY_LAMMPS_H -#include "colvarproxy_lammps_version.h" // IWYU pragma: export +#include "colvarproxy_lammps_version.h" // IWYU pragma: export -#include #include +#include #include #include @@ -21,11 +21,11 @@ #include "colvarproxy.h" #include "colvartypes.h" +#include "domain.h" // IWYU pragma: keep +#include "force.h" // IWYU pragma: keep +#include "lammps.h" // IWYU pragma: keep #include "random_park.h" -#include "lammps.h" // IWYU pragma: keep -#include "domain.h" // IWYU pragma: keep -#include "force.h" // IWYU pragma: keep -#include "update.h" // IWYU pragma: keep +#include "update.h" // IWYU pragma: keep /// \brief Communication between colvars and LAMMPS /// (implementation of \link colvarproxy \endlink) @@ -33,7 +33,6 @@ class colvarproxy_lammps : public colvarproxy { // LAMMPS specific data objects and flags protected: - // pointers to LAMMPS class instances LAMMPS_NS::LAMMPS *_lmp; LAMMPS_NS::RanPark *_random; @@ -41,28 +40,28 @@ class colvarproxy_lammps : public colvarproxy { // state of LAMMPS properties double t_target, my_timestep, my_boltzmann, my_angstrom; double bias_energy; - int previous_step; + int previous_step; bool first_timestep; bool do_exit; - std::vector atoms_types; + std::vector atoms_types; - MPI_Comm inter_comm; // MPI comm with 1 root proc from each world - int inter_me, inter_num; // rank for the inter replica comm + MPI_Comm inter_comm; // MPI comm with 1 root proc from each world + int inter_me, inter_num; // rank for the inter replica comm public: friend class cvm::atom; - colvarproxy_lammps(LAMMPS_NS::LAMMPS *lmp, const char *, - const char *, const int, const double, MPI_Comm); + colvarproxy_lammps(LAMMPS_NS::LAMMPS *lmp, const char *, const char *, const int, const double, + MPI_Comm); virtual ~colvarproxy_lammps(); - void init(const char*); + void init(const char *); virtual int setup(); - // disable default and copy constructor + // disable default and copy constructor private: - colvarproxy_lammps() {}; - colvarproxy_lammps(const colvarproxy_lammps &) {}; + colvarproxy_lammps(){}; + colvarproxy_lammps(const colvarproxy_lammps &){}; // methods for lammps to move data or trigger actions in the proxy public: @@ -96,7 +95,10 @@ class colvarproxy_lammps : public colvarproxy { inline cvm::real boltzmann() { return my_boltzmann; }; inline cvm::real temperature() { return t_target; }; - inline cvm::real dt() { return my_timestep; }; // return _lmp->update->dt * _lmp->force->femtosecond; }; + inline cvm::real dt() + { + return my_timestep; + }; // return _lmp->update->dt * _lmp->force->femtosecond; }; void add_energy(cvm::real energy) { bias_energy += energy; }; void request_total_force(bool yesno) { total_force_requested = yesno; }; @@ -104,8 +106,7 @@ class colvarproxy_lammps : public colvarproxy { void log(std::string const &message); void error(std::string const &message); - cvm::rvector position_distance(cvm::atom_pos const &pos1, - cvm::atom_pos const &pos2) const; + cvm::rvector position_distance(cvm::atom_pos const &pos1, cvm::atom_pos const &pos2) const; int backup_file(char const *filename); @@ -121,9 +122,8 @@ class colvarproxy_lammps : public colvarproxy { virtual int num_replicas(); virtual void replica_comm_barrier(); - virtual int replica_comm_recv(char* msg_data, int buf_len, int src_rep); - virtual int replica_comm_send(char* msg_data, int msg_len, int dest_rep); + virtual int replica_comm_recv(char *msg_data, int buf_len, int src_rep); + virtual int replica_comm_send(char *msg_data, int msg_len, int dest_rep); }; #endif - diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp index a1b992059e..f4f6974c70 100644 --- a/src/USER-COLVARS/fix_colvars.cpp +++ b/src/USER-COLVARS/fix_colvars.cpp @@ -1,3 +1,4 @@ +// clang-format off // -*- c++ -*- // This file is part of the Collective Variables module (Colvars). @@ -9,7 +10,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-COLVARS/fix_colvars.h b/src/USER-COLVARS/fix_colvars.h index 21f7ca7d98..d382dcf1f7 100644 --- a/src/USER-COLVARS/fix_colvars.h +++ b/src/USER-COLVARS/fix_colvars.h @@ -9,7 +9,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -25,9 +25,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(colvars,FixColvars) - +// clang-format off +FixStyle(colvars,FixColvars); +// clang-format on #else #ifndef LMP_FIX_COLVARS_H @@ -49,7 +49,7 @@ class FixColvars : public Fix { virtual void init(); virtual void setup(int); virtual int modify_param(int, char **); - virtual void min_setup(int vflag) {setup(vflag);}; + virtual void min_setup(int vflag) { setup(vflag); }; virtual void min_post_force(int); virtual void post_force(int); virtual void post_force_respa(int, int, int); @@ -62,38 +62,38 @@ class FixColvars : public Fix { virtual void restart(char *); protected: - colvarproxy_lammps *proxy; // pointer to the colvars proxy class - char *conf_file; // name of colvars config file - char *inp_name; // name/prefix of colvars restart file - char *out_name; // prefix string for all output files - char *tmp_name; // name of thermostat fix. - int rng_seed; // seed to initialize random number generator - int tstat_id; // id of the thermostat fix - double energy; // biasing energy of the fix + colvarproxy_lammps *proxy; // pointer to the colvars proxy class + char *conf_file; // name of colvars config file + char *inp_name; // name/prefix of colvars restart file + char *out_name; // prefix string for all output files + char *tmp_name; // name of thermostat fix. + int rng_seed; // seed to initialize random number generator + int tstat_id; // id of the thermostat fix + double energy; // biasing energy of the fix - int me; // my MPI rank in this "world". - int num_coords; // total number of atoms controlled by this fix - tagint *taglist; // list of all atom IDs referenced by colvars. + int me; // my MPI rank in this "world". + int num_coords; // total number of atoms controlled by this fix + tagint *taglist; // list of all atom IDs referenced by colvars. - int nmax; // size of atom communication buffer. - int size_one; // bytes per atom in communication buffer. - struct commdata *comm_buf; // communication buffer - double *force_buf; // communication buffer + int nmax; // size of atom communication buffer. + int size_one; // bytes per atom in communication buffer. + struct commdata *comm_buf; // communication buffer + double *force_buf; // communication buffer - void *idmap; // hash for mapping atom indices to consistent order. - int *rev_idmap; // list of the hash keys for reverse mapping. + void *idmap; // hash for mapping atom indices to consistent order. + int *rev_idmap; // list of the hash keys for reverse mapping. - int nlevels_respa; // flag to determine respa levels. - int store_forces; // flag to determine whether to store total forces - int unwrap_flag; // 1 if atom coords are unwrapped, 0 if not - int init_flag; // 1 if initialized, 0 if not - static int instances; // count fix instances, since colvars currently - // only supports one instance at a time - MPI_Comm root2root; // inter-root communicator for multi-replica support - void one_time_init(); // one time initialization + int nlevels_respa; // flag to determine respa levels. + int store_forces; // flag to determine whether to store total forces + int unwrap_flag; // 1 if atom coords are unwrapped, 0 if not + int init_flag; // 1 if initialized, 0 if not + static int instances; // count fix instances, since colvars currently + // only supports one instance at a time + MPI_Comm root2root; // inter-root communicator for multi-replica support + void one_time_init(); // one time initialization }; -} +} // namespace LAMMPS_NS #endif #endif @@ -149,4 +149,3 @@ Some error condition happened inside the colvars library that prohibits it from continuing. Please examine the output for additional information. */ - diff --git a/src/USER-COLVARS/group_ndx.cpp b/src/USER-COLVARS/group_ndx.cpp index 48d4157fc9..a45c0c1bf0 100644 --- a/src/USER-COLVARS/group_ndx.cpp +++ b/src/USER-COLVARS/group_ndx.cpp @@ -1,8 +1,9 @@ +// clang-format off // -*- c++ -*- /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-COLVARS/group_ndx.h b/src/USER-COLVARS/group_ndx.h index ec578a5b61..4c1e7e93e5 100644 --- a/src/USER-COLVARS/group_ndx.h +++ b/src/USER-COLVARS/group_ndx.h @@ -2,7 +2,7 @@ /* ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(group2ndx,Group2Ndx) - +// clang-format off +CommandStyle(group2ndx,Group2Ndx); +// clang-format on #else #ifndef LMP_GROUP_NDX_H @@ -28,13 +28,14 @@ namespace LAMMPS_NS { class Group2Ndx : public Command { public: - Group2Ndx(class LAMMPS *lmp) : Command(lmp) {}; + Group2Ndx(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); + private: void write_group(FILE *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-COLVARS/ndx_group.cpp b/src/USER-COLVARS/ndx_group.cpp index 5e2bee22a6..be54c5dca9 100644 --- a/src/USER-COLVARS/ndx_group.cpp +++ b/src/USER-COLVARS/ndx_group.cpp @@ -1,8 +1,9 @@ +// clang-format off // -*- c++ -*- /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-COLVARS/ndx_group.h b/src/USER-COLVARS/ndx_group.h index 753d09ce82..85831accaf 100644 --- a/src/USER-COLVARS/ndx_group.h +++ b/src/USER-COLVARS/ndx_group.h @@ -2,7 +2,7 @@ /* ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(ndx2group,Ndx2Group) - +// clang-format off +CommandStyle(ndx2group,Ndx2Group); +// clang-format on #else #ifndef LMP_NDX_GROUP_H @@ -29,13 +29,14 @@ namespace LAMMPS_NS { class Ndx2Group : public Command { public: - Ndx2Group(class LAMMPS *lmp) : Command(lmp) {}; + Ndx2Group(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); + private: void create(const std::string &, const std::vector &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DIFFRACTION/compute_saed.cpp b/src/USER-DIFFRACTION/compute_saed.cpp index b1fa296315..3702751688 100644 --- a/src/USER-DIFFRACTION/compute_saed.cpp +++ b/src/USER-DIFFRACTION/compute_saed.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DIFFRACTION/compute_saed.h b/src/USER-DIFFRACTION/compute_saed.h index dc4268eee7..371e5c9c7f 100644 --- a/src/USER-DIFFRACTION/compute_saed.h +++ b/src/USER-DIFFRACTION/compute_saed.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(saed,ComputeSAED) - +// clang-format off +ComputeStyle(saed,ComputeSAED); +// clang-format on #else #ifndef LMP_COMPUTE_SAED_H @@ -28,36 +28,35 @@ class ComputeSAED : public Compute { public: ComputeSAED(class LAMMPS *, int, char **); ~ComputeSAED(); - void init(); - void compute_vector(); - double memory_usage(); -//testing - double saed_var[10]; + void init(); + void compute_vector(); + double memory_usage(); + //testing + double saed_var[10]; private: - int me; - int *ztype; // Atomic number of the different atom types - double c[3]; // Parameters controlling resolution of reciprocal space explored - double dR_Ewald; // Thickness of Ewald sphere slice - double prd_inv[3]; // Inverse spacing of unit cell - bool echo; // echo compute_array progress - bool manual; // Turn on manual recpiprocal map - int nRows; // Number of relp explored + int me; + int *ztype; // Atomic number of the different atom types + double c[3]; // Parameters controlling resolution of reciprocal space explored + double dR_Ewald; // Thickness of Ewald sphere slice + double prd_inv[3]; // Inverse spacing of unit cell + bool echo; // echo compute_array progress + bool manual; // Turn on manual recpiprocal map + int nRows; // Number of relp explored - double Zone[3]; // Zone axis to view SAED - double R_Ewald; // Radius of Ewald sphere (distance units) - double lambda; // Radiation wavelenght (distance units) - double dK[3]; // spacing of reciprocal points in each dimension - int Knmax[3]; // maximum integer value for K points in each dimension - double Kmax; // Maximum reciprocal distance to explore + double Zone[3]; // Zone axis to view SAED + double R_Ewald; // Radius of Ewald sphere (distance units) + double lambda; // Radiation wavelenght (distance units) + double dK[3]; // spacing of reciprocal points in each dimension + int Knmax[3]; // maximum integer value for K points in each dimension + double Kmax; // Maximum reciprocal distance to explore int ntypes; int nlocalgroup; int *store_tmp; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DIFFRACTION/compute_saed_consts.h b/src/USER-DIFFRACTION/compute_saed_consts.h index 63743d0d9a..d7045718b5 100644 --- a/src/USER-DIFFRACTION/compute_saed_consts.h +++ b/src/USER-DIFFRACTION/compute_saed_consts.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -31,428 +31,219 @@ Acta Crystallogr.A 52 25776 // list of element types associated with atomic scattering factor constants static const char *SAEDtypeList[SAEDmaxType] = { - "H", "He", "Li", "Be", "B", - "C", "N", "O", "F", "Ne", - "Na", "Mg", "Al", "Si", "P", - "S", "Cl", "Ar", "K", "Ca", - "Sc", "Ti", "V", "Cr", "Mn", - "Fe", "Co", "Ni", "Cu", "Zn", - "Ga", "Ge", "As", "Se", "Br", - "Kr", "Rb", "Sr", "Y", "Zr", - "Nb", "Mo", "Tc", "Ru", "Rh", - "Pd", "Ag", "Cd", "In", "Sn", - "Sb", "Te", "I", "Xe", "Cs", - "Ba", "La", "Ce", "Pr", "Nd", - "Pm", "Sm", "Eu", "Gd", "Tb", - "Dy", "Ho", "Er", "Tm", "Yb", - "Lu", "Hf", "Ta", "W", "Re", - "Os", "Ir", "Pt", "Au", "Hg", - "Tl", "Pb", "Bi", "Po", "At", - "Rn", "Fr", "Ra", "Ac", "Th", - "Pa", "U", "Np", "Pu", "Am", - "Cm", "Bk", "Cf"}; + "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", + "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", + "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr", "Nb", "Mo", + "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I", "Xe", "Cs", "Ba", + "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", + "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg", "Tl", "Pb", "Bi", "Po", + "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf"}; // list of atomic scattering factor constants for electron diffraction static const double ASFSAED[SAEDmaxType][20] = { - /* Each set of four rows in this file represents a single row in the matrix + /* Each set of four rows in this file represents a single row in the matrix First two rows are constants for 0 < sin(theta)/lambda < 2 Z-number A1 A2 A3 A4 A5 B1 B2 B3 B4 B5 Second two rows are constants for 2 < sin(theta)/lambda < 6 A1 A2 A3 A4 A5 B1 B2 B3 B4 B5*/ - /* 1*/ { 0.0349, 0.1201, 0.1970, 0.0573, 0.1195, - 0.5347, 3.5867, 12.3471, 18.9525, 38.6269, - 0.0088, 0.0449, 0.1481, 0.2356, 0.0914, - 0.1152, 1.0867, 4.9755, 16.5591, 43.2743}, - /* 2*/ { 0.0317, 0.0838, 0.1526, 0.1334, 0.0164, - 0.2507, 1.4751, 4.4938, 12.6646, 31.1653, - 0.0084, 0.0443, 0.1314, 0.1671, 0.0666, - 0.0596, 0.5360, 2.4274, 7.7852, 20.3126}, - /* 3*/ { 0.0750, 0.2249, 0.5548, 1.4954, 0.9354, - 0.3864, 2.9383, 15.3829, 53.5545, 138.7337, - 0.0478, 0.2048, 0.5253, 1.5225, 0.9853, - 0.2258, 2.1032, 12.9349, 50.7501, 136.6280}, - /* 4*/ { 0.0780, 0.2210, 0.6740, 1.3867, 0.6925, - 0.3131, 2.2381, 10.1517, 30.9061, 78.3273, - 0.0423, 0.1874, 0.6019, 1.4311, 0.7891, - 0.1445, 1.4180, 8.1165, 27.9705, 74.8684}, - /* 5*/ { 0.0909, 0.2551, 0.7738, 1.2136, 0.4606, - 0.2995, 2.1155, 8.3816, 24.1292, 63.1314, - 0.0436, 0.1898, 0.6788, 1.3273, 0.5544, - 0.1207, 1.1595, 6.2474, 21.0460, 59.3619}, - /* 6*/ { 0.0893, 0.2563, 0.7570, 1.0487, 0.3575, - 0.2465, 1.7100, 6.4094, 18.6113, 50.2523, - 0.0489, 0.2091, 0.7537, 1.1420, 0.3555, - 0.1140, 1.0825, 5.4281, 17.8811, 51.1341}, - /* 7*/ { 0.1022, 0.3219, 0.7982, 0.8197, 0.1715, - 0.2451, 1.7481, 6.1925, 17.3894, 48.1431, - 0.0267, 0.1328, 0.5301, 1.1020, 0.4215, - 0.0541, 0.5165, 2.8207, 10.6297, 34.3764}, - /* 8*/ { 0.0974, 0.2921, 0.6910, 0.6990, 0.2039, - 0.2067, 1.3815, 4.6943, 12.7105, 32.4726, - 0.0365, 0.1729, 0.5805, 0.8814, 0.3121, - 0.0652, 0.6184, 2.9449, 9.6298, 28.2194}, - /* 9*/ { 0.1083, 0.3175, 0.6487, 0.5846, 0.1421, - 0.2057, 1.3439, 4.2788, 11.3932, 28.7881, - 0.0382, 0.1822, 0.5972, 0.7707, 0.2130, - 0.0613, 0.5753, 2.6858, 8.8214, 25.6668}, - /* 10*/ { 0.1269, 0.3535, 0.5582, 0.4674, 0.1460, - 0.2200, 1.3779, 4.0203, 9.4934, 23.1278, - 0.0380, 0.1785, 0.5494, 0.6942, 0.1918, - 0.0554, 0.5087, 2.2639, 7.3316, 21.6912}, - /* 11*/ { 0.2142, 0.6853, 0.7692, 1.6589, 1.4482, - 0.3334, 2.3446, 10.0830, 48.3037, 138.2700, - 0.1260, 0.6442, 0.8893, 1.8197, 1.2988, - 0.1684, 1.7150, 8.8386, 50.8265, 147.2073}, - /* 12*/ { 0.2314, 0.6866, 0.9677, 2.1882, 1.1339, - 0.3278, 2.2720, 10.9241, 39.2898, 101.9748, - 0.1130, 0.5575, 0.9046, 2.1580, 1.4735, - 0.1356, 1.3579, 6.9255, 32.3165, 92.1138}, - /* 13*/ { 0.2390, 0.6573, 1.2011, 2.5586, 1.2312, - 0.3138, 2.1063, 10.4163, 34.4552, 98.5344, - 0.1165, 0.5504, 1.0179, 2.6295, 1.5711, - 0.1295, 1.2619, 6.8242, 28.4577, 88.4750}, - /* 14*/ { 0.2519, 0.6372, 1.3795, 2.5082, 1.0500, - 0.3075, 2.0174, 9.6746, 29.3744, 80.4732, - 0.0567, 0.3365, 0.8104, 2.4960, 2.1186, - 0.0582, 0.6155, 3.2522, 16.7929, 57.6767}, - /* 15*/ { 0.2548, 0.6106, 1.4541, 2.3204, 0.8477, - 0.2908, 1.8740, 8.5176, 24.3434, 63.2996, - 0.1005, 0.4615, 1.0663, 2.5854, 1.2725, - 0.0977, 0.9084, 4.9654, 18.5471, 54.3648}, - /* 16*/ { 0.2497, 0.5628, 1.3899, 2.1865, 0.7715, - 0.2681, 1.6711, 7.0267, 19.5377, 50.3888, - 0.0915, 0.4312, 1.0847, 2.4671, 1.0852, - 0.0838, 0.7788, 4.3462, 15.5846, 44.6365}, - /* 17*/ { 0.2443, 0.5397, 1.3919, 2.0197, 0.6621, - 0.2468, 1.5242, 6.1537, 16.6687, 42.3086, - 0.0799, 0.3891, 1.0037, 2.3332, 1.0507, - 0.0694, 0.6443, 3.5351, 12.5058, 35.8633}, - /* 18*/ { 0.2385, 0.5017, 1.3428, 1.8899, 0.6079, - 0.2289, 1.3694, 5.2561, 14.0928, 35.5361, - 0.1044, 0.4551, 1.4232, 2.1533, 0.4459, - 0.0853, 0.7701, 4.4684, 14.5864, 41.2474}, - /* 19*/ { 0.4115, 1.4031, 2.2784, 2.6742, 2.2162, - 0.3703, 3.3874, 13.1029, 68.9592, 194.4329, - 0.2149, 0.8703, 2.4999, 2.3591, 3.0318, - 0.1660, 1.6906, 8.7447, 46.7825, 165.6923}, - /* 20*/ { 0.4054, 1.3880, 2.1602, 3.7532, 2.2063, - 0.3499, 3.0991, 11.9608, 53.9353, 142.3892, - 0.2355, 0.9916, 2.3959, 3.7252, 2.5647, - 0.1742, 1.8329, 8.8407, 47.4583, 134.9613}, - /* 21*/ { 0.3787, 1.2181, 2.0594, 3.2618, 2.3870, - 0.3133, 2.5856, 9.5813, 41.7688, 116.7282, - 0.4636, 2.0802, 2.9003, 1.4193, 2.4323, - 0.3682, 4.0312, 22.6493, 71.8200, 103.3691}, - /* 22*/ { 0.3825, 1.2598, 2.0008, 3.0617, 2.0694, - 0.3040, 2.4863, 9.2783, 39.0751, 109.4583, - 0.2123, 0.8960, 2.1765, 3.0436, 2.4439, - 0.1399, 1.4568, 6.7534, 33.1168, 101.8238}, - /* 23*/ { 0.3876, 1.2750, 1.9109, 2.8314, 1.8979, - 0.2967, 2.3780, 8.7981, 35.9528, 101.7201, - 0.2369, 1.0774, 2.1894, 3.0825, 1.7190, - 0.1505, 1.6392, 7.5691, 36.8741, 107.8517}, - /* 24*/ { 0.4046, 1.3696, 1.8941, 2.0800, 1.2196, - 0.2986, 2.3958, 9.1406, 37.4701, 113.7121, - 0.1970, 0.8228, 2.0200, 2.1717, 1.7516, - 0.1197, 1.1985, 5.4097, 25.2361, 94.4290}, - /* 25*/ { 0.3796, 1.2094, 1.7815, 2.5420, 1.5937, - 0.2699, 2.0455, 7.4726, 31.0604, 91.5622, - 0.1943, 0.8190, 1.9296, 2.4968, 2.0625, - 0.1135, 1.1313, 5.0341, 24.1798, 80.5598}, - /* 26*/ { 0.3946, 1.2725, 1.7031, 2.3140, 1.4795, - 0.2717, 2.0443, 7.6007, 29.9714, 86.2265, - 0.1929, 0.8239, 1.8689, 2.3694, 1.9060, - 0.1087, 1.0806, 4.7637, 22.8500, 76.7309}, - /* 27*/ { 0.4118, 1.3161, 1.6493, 2.1930, 1.2830, - 0.2742, 2.0372, 7.7205, 29.9680, 84.9383, - 0.2186, 0.9861, 1.8540, 2.3258, 1.4685, - 0.1182, 1.2300, 5.4177, 25.7602, 80.8542}, - /* 28*/ { 0.3860, 1.1765, 1.5451, 2.0730, 1.3814, - 0.2478, 1.7660, 6.3107, 25.2204, 74.3146, - 0.2313, 1.0657, 1.8229, 2.2609, 1.1883, - 0.1210, 1.2691, 5.6870, 27.0917, 83.0285}, - /* 29*/ { 0.4314, 1.3208, 1.5236, 1.4671, 0.8562, - 0.2694, 1.9223, 7.3474, 28.9892, 90.6246, - 0.3501, 1.6558, 1.9582, 0.2134, 1.4109, - 0.1867, 1.9917, 11.3396, 53.2619, 63.2520}, - /* 30*/ { 0.4288, 1.2646, 1.4472, 1.8294, 1.0934, - 0.2593, 1.7998, 6.7500, 25.5860, 73.5284, - 0.1780, 0.8096, 1.6744, 1.9499, 1.4495, - 0.0876, 0.8650, 3.8612, 18.8726, 64.7016}, - /* 31*/ { 0.4818, 1.4032, 1.6561, 2.4605, 1.1054, - 0.2825, 1.9785, 8.7546, 32.5238, 98.5523, - 0.2135, 0.9768, 1.6669, 2.5662, 1.6790, - 0.1020, 1.0219, 4.6275, 22.8742, 80.1535}, - /* 32*/ { 0.4655, 1.3014, 1.6088, 2.6998, 1.3003, - 0.2647, 1.7926, 7.6071, 26.5541, 77.5238, - 0.2135, 0.9761, 1.6555, 2.8938, 1.6356, - 0.0989, 0.9845, 4.5527, 21.5563, 70.3903}, - /* 33*/ { 0.4517, 1.2229, 1.5852, 2.7958, 1.2638, - 0.2493, 1.6436, 6.8154, 22.3681, 62.0390, - 0.2059, 0.9518, 1.6372, 3.0490, 1.4756, - 0.0926, 0.9182, 4.3291, 19.2996, 58.9329}, - /* 34*/ { 0.4477, 1.1678, 1.5843, 2.8087, 1.1956, - 0.2405, 1.5442, 6.3231, 19.4610, 52.0233, - 0.1574, 0.7614, 1.4834, 3.0016, 1.7978, - 0.0686, 0.6808, 3.1163, 14.3458, 44.0455}, - /* 35*/ { 0.4798, 1.1948, 1.8695, 2.6953, 0.8203, - 0.2504, 1.5963, 6.9653, 19.8492, 50.3233, - 0.1899, 0.8983, 1.6358, 3.1845, 1.1518, - 0.0810, 0.7957, 3.9054, 15.7701, 45.6124}, - /* 36*/ { 0.4546, 1.0993, 1.7696, 2.7068, 0.8672, - 0.2309, 1.4279, 5.9449, 16.6752, 42.2243, - 0.1742, 0.8447, 1.5944, 3.1507, 1.1338, - 0.0723, 0.7123, 3.5192, 13.7724, 39.1148}, - /* 37*/ { 1.0160, 2.8528, 3.5466, -7.7804, 12.1148, - 0.4853, 5.0925, 25.7851, 130.4510, 138.6775, - 0.3781, 1.4904, 3.5753, 3.0031, 3.3272, - 0.1557, 1.5347, 9.9947, 51.4251, 185.9828}, - /* 38*/ { 0.6703, 1.4926, 3.3368, 4.4600, 3.1501, - 0.3190, 2.2287, 10.3504, 52.3291, 151.2216, - 0.3723, 1.4598, 3.5124, 4.4612, 3.3031, - 0.1480, 1.4643, 9.2320, 49.8807, 148.0937}, - /* 39*/ { 0.6894, 1.5474, 3.2450, 4.2126, 2.9764, - 0.3189, 2.2904, 10.0062, 44.0771, 125.0120, - 0.3234, 1.2737, 3.2115, 4.0563, 3.7962, - 0.1244, 1.1948, 7.2756, 34.1430, 111.2079}, - /* 40*/ { 0.6719, 1.4684, 3.1668, 3.9557, 2.8920, - 0.3036, 2.1249, 8.9236, 36.8458, 108.2049, - 0.2997, 1.1879, 3.1075, 3.9740, 3.5769, - 0.1121, 1.0638, 6.3891, 28.7081, 97.4289}, - /* 41*/ { 0.6123, 1.2677, 3.0348, 3.3841, 2.3683, - 0.2709, 1.7683, 7.2489, 27.9465, 98.5624, - 0.1680, 0.9370, 2.7300, 3.8150, 3.0053, - 0.0597, 0.6524, 4.4317, 19.5540, 85.5011}, - /* 42*/ { 0.6773, 1.4798, 3.1788, 3.0824, 1.8384, - 0.2920, 2.0606, 8.1129, 30.5336, 100.0658, - 0.3069, 1.1714, 3.2293, 3.4254, 2.1224, - 0.1101, 1.0222, 5.9613, 25.1965, 93.5831}, - /* 43*/ { 0.7082, 1.6392, 3.1993, 3.4327, 1.8711, - 0.2976, 2.2106, 8.5246, 33.1456, 96.6377, - 0.2928, 1.1267, 3.1675, 3.6619, 2.5942, - 0.1020, 0.9481, 5.4713, 23.8153, 82.8991}, - /* 44*/ { 0.6735, 1.4934, 3.0966, 2.7254, 1.5597, - 0.2773, 1.9716, 7.3249, 26.6891, 90.5581, - 0.2604, 1.0442, 3.0761, 3.2175, 1.9448, - 0.0887, 0.8240, 4.8278, 19.8977, 80.4566}, - /* 45*/ { 0.6413, 1.3690, 2.9854, 2.6952, 1.5433, - 0.2580, 1.7721, 6.3854, 23.2549, 85.1517, - 0.2713, 1.0556, 3.1416, 3.0451, 1.7179, - 0.0907, 0.8324, 4.7702, 19.7862, 80.2540}, - /* 46*/ { 0.5904, 1.1775, 2.6519, 2.2875, 0.8689, - 0.2324, 1.5019, 5.1591, 15.5428, 46.8213, - 0.2003, 0.8779, 2.6135, 2.8594, 1.0258, - 0.0659, 0.6111, 3.5563, 12.7638, 44.4283}, - /* 47*/ { 0.6377, 1.3790, 2.8294, 2.3631, 1.4553, - 0.2466, 1.6974, 5.7656, 20.0943, 76.7372, - 0.2739, 1.0503, 3.1564, 2.7543, 1.4328, - 0.0881, 0.8028, 4.4451, 18.7011, 79.2633}, - /* 48*/ { 0.6364, 1.4247, 2.7802, 2.5973, 1.7886, - 0.2407, 1.6823, 5.6588, 20.7219, 69.1109, - 0.3072, 1.1303, 3.2046, 2.9329, 1.6560, - 0.0966, 0.8856, 4.6273, 20.6789, 73.4723}, - /* 49*/ { 0.6768, 1.6589, 2.7740, 3.1835, 2.1326, - 0.2522, 1.8545, 6.2936, 25.1457, 84.5448, - 0.3564, 1.3011, 3.2424, 3.4839, 2.0459, - 0.1091, 1.0452, 5.0900, 24.6578, 88.0513}, - /* 50*/ { 0.7224, 1.9610, 2.7161, 3.5603, 1.8972, - 0.2651, 2.0604, 7.3011, 27.5493, 81.3349, - 0.2966, 1.1157, 3.0973, 3.8156, 2.5281, - 0.0896, 0.8268, 4.2242, 20.6900, 71.3399}, - /* 51*/ { 0.7106, 1.9247, 2.6149, 3.8322, 1.8899, - 0.2562, 1.9646, 6.8852, 24.7648, 68.9168, - 0.2725, 1.0651, 2.9940, 4.0697, 2.5682, - 0.0809, 0.7488, 3.8710, 18.8800, 60.6499}, - /* 52*/ { 0.6947, 1.8690, 2.5356, 4.0013, 1.8955, - 0.2459, 1.8542, 6.4411, 22.1730, 59.2206, - 0.2422, 0.9692, 2.8114, 4.1509, 2.8161, - 0.0708, 0.6472, 3.3609, 16.0752, 50.1724}, - /* 53*/ { 0.7047, 1.9484, 2.5940, 4.1526, 1.5057, - 0.2455, 1.8638, 6.7639, 21.8007, 56.4395, - 0.2617, 1.0325, 2.8097, 4.4809, 2.3190, - 0.0749, 0.6914, 3.4634, 16.3603, 48.2522}, - /* 54*/ { 0.6737, 1.7908, 2.4129, 4.2100, 1.7058, - 0.2305, 1.6890, 5.8218, 18.3928, 47.2496, - 0.2334, 0.9496, 2.6381, 4.4680, 2.5020, - 0.0655, 0.6050, 3.0389, 14.0809, 41.0005}, - /* 55*/ { 1.2704, 3.8018, 5.6618, 0.9205, 4.8105, - 0.4356, 4.2058, 23.4342, 136.7780, 171.7561, - 0.5713, 2.4866, 4.9795, 4.0198, 4.4403, - 0.1626, 1.8213, 11.1049, 49.0568, 202.9987}, - /* 56*/ { 0.9049, 2.6076, 4.8498, 5.1603, 4.7388, - 0.3066, 2.4363, 12.1821, 54.6135, 161.9978, - 0.5229, 2.2874, 4.7243, 5.0807, 5.6389, - 0.1434, 1.6019, 9.4511, 42.7685, 148.4969}, - /* 57*/ { 0.8405, 2.3863, 4.6139, 5.1514, 4.7949, - 0.2791, 2.1410, 10.3400, 41.9148, 132.0204, - 0.5461, 2.3856, 5.0653, 5.7601, 4.0463, - 0.1479, 1.6552, 10.0059, 47.3245, 145.8464}, - /* 58*/ { 0.8551, 2.3915, 4.5772, 5.0278, 4.5118, - 0.2805, 2.1200, 10.1808, 42.0633, 130.9893, - 0.2227, 1.0760, 2.9482, 5.8496, 7.1834, - 0.0571, 0.5946, 3.2022, 16.4253, 95.7030}, - /* 59*/ { 0.9096, 2.5313, 4.5266, 4.6376, 4.3690, - 0.2939, 2.2471, 10.8266, 48.8842, 147.6020, - 0.5237, 2.2913, 4.6161, 4.7233, 4.8173, - 0.1360, 1.5068, 8.8213, 41.9536, 141.2424}, - /* 60*/ { 0.8807, 2.4183, 4.4448, 4.6858, 4.1725, - 0.2802, 2.0836, 10.0357, 47.4506, 146.9976, - 0.5368, 2.3301, 4.6058, 4.6621, 4.4622, - 0.1378, 1.5140, 8.8719, 43.5967, 141.8065}, - /* 61*/ { 0.9471, 2.5463, 4.3523, 4.4789, 3.9080, - 0.2977, 2.2276, 10.5762, 49.3619, 145.3580, - 0.5232, 2.2627, 4.4552, 4.4787, 4.5073, - 0.1317, 1.4336, 8.3087, 40.6010, 135.9196}, - /* 62*/ { 0.9699, 2.5837, 4.2778, 4.4575, 3.5985, - 0.3003, 2.2447, 10.6487, 50.7994, 146.4179, - 0.5162, 2.2302, 4.3449, 4.3598, 4.4292, - 0.1279, 1.3811, 7.9629, 39.1213, 132.7846}, - /* 63*/ { 0.8694, 2.2413, 3.9196, 3.9694, 4.5498, - 0.2653, 1.8590, 8.3998, 36.7397, 125.7089, - 0.5272, 2.2844, 4.3361, 4.3178, 4.0908, - 0.1285, 1.3943, 8.1081, 40.9631, 134.1233}, - /* 64*/ { 0.9673, 2.4702, 4.1148, 4.4972, 3.2099, - 0.2909, 2.1014, 9.7067, 43.4270, 125.9474, - 0.9664, 3.4052, 5.0803, 1.4991, 4.2528, - 0.2641, 2.6586, 16.2213, 80.2060, 92.5359}, - /* 65*/ { 0.9325, 2.3673, 3.8791, 3.9674, 3.7996, - 0.2761, 1.9511, 8.9296, 41.5937, 131.0122, - 0.5110, 2.1570, 4.0308, 3.9936, 4.2466, - 0.1210, 1.2704, 7.1368, 35.0354, 123.5062}, - /* 66*/ { 0.9505, 2.3705, 3.8218, 4.0471, 3.4451, - 0.2773, 1.9469, 8.8862, 43.0938, 133.1396, - 0.4974, 2.1097, 3.8906, 3.8100, 4.3084, - 0.1157, 1.2108, 6.7377, 32.4150, 116.9225}, - /* 67*/ { 0.9248, 2.2428, 3.6182, 3.7910, 3.7912, - 0.2660, 1.8183, 7.9655, 33.1129, 101.8139, - 0.4679, 1.9693, 3.7191, 3.9632, 4.2432, - 0.1069, 1.0994, 5.9769, 27.1491, 96.3119}, - /* 68*/ { 1.0373, 2.4824, 3.6558, 3.8925, 3.0056, - 0.2944, 2.0797, 9.4156, 45.8056, 132.7720, - 0.5034, 2.1088, 3.8232, 3.7299, 3.8963, - 0.1141, 1.1769, 6.6087, 33.4332, 116.4913}, - /* 69*/ { 1.0075, 2.3787, 3.5440, 3.6932, 3.1759, - 0.2816, 1.9486, 8.7162, 41.8420, 125.0320, - 0.4839, 2.0262, 3.6851, 3.5874, 4.0037, - 0.1081, 1.1012, 6.1114, 30.3728, 110.5988}, - /* 70*/ { 1.0347, 2.3911, 3.4619, 3.6556, 3.0052, - 0.2855, 1.9679, 8.7619, 42.3304, 125.6499, - 0.5221, 2.1695, 3.7567, 3.6685, 3.4274, - 0.1148, 1.1860, 6.7520, 35.6807, 118.0692}, - /* 71*/ { 0.9927, 2.2436, 3.3554, 3.7813, 3.0994, - 0.2701, 1.8073, 7.8112, 34.4849, 103.3526, - 0.4680, 1.9466, 3.5428, 3.8490, 3.6594, - 0.1015, 1.0195, 5.6058, 27.4899, 95.2846}, - /* 72*/ { 1.0295, 2.2911, 3.4110, 3.9497, 2.4925, - 0.2761, 1.8625, 8.0961, 34.2712, 98.5295, - 0.4048, 1.7370, 3.3399, 3.9448, 3.7293, - 0.0868, 0.8585, 4.6378, 21.6900, 80.2408}, - /* 73*/ { 1.0190, 2.2291, 3.4097, 3.9252, 2.2679, - 0.2694, 1.7962, 7.6944, 31.0942, 91.1089, - 0.3835, 1.6747, 3.2986, 4.0462, 3.4303, - 0.0810, 0.8020, 4.3545, 19.9644, 73.6337}, - /* 74*/ { 0.9853, 2.1167, 3.3570, 3.7981, 2.2798, - 0.2569, 1.6745, 7.0098, 26.9234, 81.3910, - 0.3661, 1.6191, 3.2455, 4.0856, 3.2064, - 0.0761, 0.7543, 4.0952, 18.2886, 68.0967}, - /* 75*/ { 0.9914, 2.0858, 3.4531, 3.8812, 1.8526, - 0.2548, 1.6518, 6.8845, 26.7234, 81.7215, - 0.3933, 1.6973, 3.4202, 4.1274, 2.6158, - 0.0806, 0.7972, 4.4237, 19.5692, 68.7477}, - /* 76*/ { 0.9813, 2.0322, 3.3665, 3.6235, 1.9741, - 0.2487, 1.5973, 6.4737, 23.2817, 70.9254, - 0.3854, 1.6555, 3.4129, 4.1111, 2.4106, - 0.0787, 0.7638, 4.2441, 18.3700, 65.1071}, - /* 77*/ { 1.0194, 2.0645, 3.4425, 3.4914, 1.6976, - 0.2554, 1.6475, 6.5966, 23.2269, 70.0272, - 0.3510, 1.5620, 3.2946, 4.0615, 2.4382, - 0.0706, 0.6904, 3.8266, 16.0812, 58.7638}, - /* 78*/ { 0.9148, 1.8096, 3.2134, 3.2953, 1.5754, - 0.2263, 1.3813, 5.3243, 17.5987, 60.0171, - 0.3083, 1.4158, 2.9662, 3.9349, 2.1709, - 0.0609, 0.5993, 3.1921, 12.5285, 49.7675}, - /* 79*/ { 0.9674, 1.8916, 3.3993, 3.0524, 1.2607, - 0.2358, 1.4712, 5.6758, 18.7119, 61.5286, - 0.3055, 1.3945, 2.9617, 3.8990, 2.0026, - 0.0596, 0.5827, 3.1035, 11.9693, 47.9106}, - /* 80*/ { 1.0033, 1.9469, 3.4396, 3.1548, 1.4180, - 0.2413, 1.5298, 5.8009, 19.4520, 60.5753, - 0.3593, 1.5736, 3.5237, 3.8109, 1.6953, - 0.0694, 0.6758, 3.8457, 15.6203, 56.6614}, - /* 81*/ { 1.0689, 2.1038, 3.6039, 3.4927, 1.8283, - 0.2540, 1.6715, 6.3509, 23.1531, 78.7099, - 0.3511, 1.5489, 3.5676, 4.0900, 2.5251, - 0.0672, 0.6522, 3.7420, 15.9791, 65.1354}, - /* 82*/ { 1.0891, 2.1867, 3.6160, 3.8031, 1.8994, - 0.2552, 1.7174, 6.5131, 23.9170, 74.7039, - 0.3540, 1.5453, 3.5975, 4.3152, 2.7743, - 0.0668, 0.6465, 3.6968, 16.2056, 61.4909}, - /* 83*/ { 1.1007, 2.2306, 3.5689, 4.1549, 2.0382, - 0.2546, 1.7351, 6.4948, 23.6464, 70.3780, - 0.3530, 1.5258, 3.5815, 4.5532, 3.0714, - 0.0661, 0.6324, 3.5906, 15.9962, 57.5760}, - /* 84*/ { 1.1568, 2.4353, 3.6459, 4.4064, 1.7179, - 0.2648, 1.8786, 7.1749, 25.1766, 69.2821, - 0.3673, 1.5772, 3.7079, 4.8582, 2.8440, - 0.0678, 0.6527, 3.7396, 17.0668, 55.9789}, - /* 85*/ { 1.0909, 2.1976, 3.3831, 4.6700, 2.1277, - 0.2466, 1.6707, 6.0197, 20.7657, 57.2663, - 0.3547, 1.5206, 3.5621, 5.0184, 3.0075, - 0.0649, 0.6188, 3.4696, 15.6090, 49.4818}, - /* 86*/ { 1.0756, 2.1630, 3.3178, 4.8852, 2.0489, - 0.2402, 1.6169, 5.7644, 19.4568, 52.5009, - 0.4586, 1.7781, 3.9877, 5.7273, 1.5460, - 0.0831, 0.7840, 4.3599, 20.0128, 62.1535}, - /* 87*/ { 1.4282, 3.5081, 5.6767, 4.1964, 3.8946, - 0.3183, 2.6889, 13.4816, 54.3866, 200.8321, - 0.8282, 2.9941, 5.6597, 4.9292, 4.2889, - 0.1515, 1.6163, 9.7752, 42.8480, 190.7366}, - /* 88*/ { 1.3127, 3.1243, 5.2988, 5.3891, 5.4133, - 0.2887, 2.2897, 10.8276, 43.5389, 145.6109, - 1.4129, 4.4269, 7.0460, -1.0573, 8.6430, - 0.2921, 3.1381, 19.6767, 102.0430, 113.9798}, - /* 89*/ { 1.3128, 3.1021, 5.3385, 5.9611, 4.7562, - 0.2861, 2.2509, 10.5287, 41.7796, 128.2973, - 0.7169, 2.5710, 5.1791, 6.3484, 5.6474, - 0.1263, 1.2900, 7.3686, 32.4490, 118.0558}, - /* 90*/ { 1.2553, 2.9178, 5.0862, 6.1206, 4.7122, - 0.2701, 2.0636, 9.3051, 34.5977, 107.9200, - 0.6958, 2.4936, 5.1269, 6.6988, 5.0799, - 0.1211, 1.2247, 6.9398, 30.0991, 105.1960}, - /* 91*/ { 1.3218, 3.1444, 5.4371, 5.6444, 4.0107, - 0.2827, 2.2250, 10.2454, 41.1162, 124.4449, - 1.2502, 4.2284, 7.0489, 1.1390, 5.8222, - 0.2415, 2.6442, 16.3313, 73.5757, 91.9401}, - /* 92*/ { 1.3382, 3.2043, 5.4558, 5.4839, 3.6342, - 0.2838, 2.2452, 10.2519, 41.7251, 124.9023, - 0.6410, 2.2643, 4.8713, 5.9287, 5.3935, - 0.1097, 1.0644, 5.7907, 25.0261, 101.3899}, - /* 93*/ { 1.5193, 4.0053, 6.5327, -0.1402, 6.7489, - 0.3213, 2.8206, 14.8878, 68.9103, 81.7257, - 0.6938, 2.4652, 5.1227, 5.5965, 4.8543, - 0.1171, 1.1757, 6.4053, 27.5217, 103.0482}, - /* 94*/ { 1.3517, 3.2937, 5.3213, 4.6466, 3.5714, - 0.2813, 2.2418, 9.9952, 42.7939, 132.1739, - 0.6902, 2.4509, 5.1284, 5.0339, 4.8575, - 0.1153, 1.1545, 6.2291, 27.0741, 111.3150}, - /* 95*/ { 1.2135, 2.7962, 4.7545, 4.5731, 4.4786, - 0.2483, 1.8437, 7.5421, 29.3841, 112.4579, - 0.7577, 2.7264, 5.4184, 4.8198, 4.1013, - 0.1257, 1.3044, 7.1035, 32.4649, 118.8647}, - /* 96*/ { 1.2937, 3.1100, 5.0393, 4.7546, 3.5031, - 0.2638, 2.0341, 8.7101, 35.2992, 109.4972, - 0.7567, 2.7565, 5.4364, 5.1918, 3.5643, - 0.1239, 1.2979, 7.0798, 32.7871, 110.1512}, - /* 97*/ { 1.2915, 3.1023, 4.9309, 4.6009, 3.4661, - 0.2611, 2.0023, 8.4377, 34.1559, 105.8911, - 0.7492, 2.7267, 5.3521, 5.0369, 3.5321, - 0.1217, 1.2651, 6.8101, 31.6088, 106.4853}, - /* 98*/ { 1.2089, 2.7391, 4.3482, 4.0047, 4.6497, - 0.2421, 1.7487, 6.7262, 23.2153, 80.3108, - 0.8100, 3.0001, 5.4635, 4.1756, 3.5066, - 0.1310, 1.4038, 7.6057, 34.0186, 90.5226}, - }; + /* 1*/ {0.0349, 0.1201, 0.1970, 0.0573, 0.1195, 0.5347, 3.5867, 12.3471, 18.9525, 38.6269, + 0.0088, 0.0449, 0.1481, 0.2356, 0.0914, 0.1152, 1.0867, 4.9755, 16.5591, 43.2743}, + /* 2*/ {0.0317, 0.0838, 0.1526, 0.1334, 0.0164, 0.2507, 1.4751, 4.4938, 12.6646, 31.1653, + 0.0084, 0.0443, 0.1314, 0.1671, 0.0666, 0.0596, 0.5360, 2.4274, 7.7852, 20.3126}, + /* 3*/ {0.0750, 0.2249, 0.5548, 1.4954, 0.9354, 0.3864, 2.9383, 15.3829, 53.5545, 138.7337, + 0.0478, 0.2048, 0.5253, 1.5225, 0.9853, 0.2258, 2.1032, 12.9349, 50.7501, 136.6280}, + /* 4*/ {0.0780, 0.2210, 0.6740, 1.3867, 0.6925, 0.3131, 2.2381, 10.1517, 30.9061, 78.3273, + 0.0423, 0.1874, 0.6019, 1.4311, 0.7891, 0.1445, 1.4180, 8.1165, 27.9705, 74.8684}, + /* 5*/ {0.0909, 0.2551, 0.7738, 1.2136, 0.4606, 0.2995, 2.1155, 8.3816, 24.1292, 63.1314, + 0.0436, 0.1898, 0.6788, 1.3273, 0.5544, 0.1207, 1.1595, 6.2474, 21.0460, 59.3619}, + /* 6*/ {0.0893, 0.2563, 0.7570, 1.0487, 0.3575, 0.2465, 1.7100, 6.4094, 18.6113, 50.2523, + 0.0489, 0.2091, 0.7537, 1.1420, 0.3555, 0.1140, 1.0825, 5.4281, 17.8811, 51.1341}, + /* 7*/ {0.1022, 0.3219, 0.7982, 0.8197, 0.1715, 0.2451, 1.7481, 6.1925, 17.3894, 48.1431, + 0.0267, 0.1328, 0.5301, 1.1020, 0.4215, 0.0541, 0.5165, 2.8207, 10.6297, 34.3764}, + /* 8*/ {0.0974, 0.2921, 0.6910, 0.6990, 0.2039, 0.2067, 1.3815, 4.6943, 12.7105, 32.4726, + 0.0365, 0.1729, 0.5805, 0.8814, 0.3121, 0.0652, 0.6184, 2.9449, 9.6298, 28.2194}, + /* 9*/ {0.1083, 0.3175, 0.6487, 0.5846, 0.1421, 0.2057, 1.3439, 4.2788, 11.3932, 28.7881, + 0.0382, 0.1822, 0.5972, 0.7707, 0.2130, 0.0613, 0.5753, 2.6858, 8.8214, 25.6668}, + /* 10*/ {0.1269, 0.3535, 0.5582, 0.4674, 0.1460, 0.2200, 1.3779, 4.0203, 9.4934, 23.1278, + 0.0380, 0.1785, 0.5494, 0.6942, 0.1918, 0.0554, 0.5087, 2.2639, 7.3316, 21.6912}, + /* 11*/ {0.2142, 0.6853, 0.7692, 1.6589, 1.4482, 0.3334, 2.3446, 10.0830, 48.3037, 138.2700, + 0.1260, 0.6442, 0.8893, 1.8197, 1.2988, 0.1684, 1.7150, 8.8386, 50.8265, 147.2073}, + /* 12*/ {0.2314, 0.6866, 0.9677, 2.1882, 1.1339, 0.3278, 2.2720, 10.9241, 39.2898, 101.9748, + 0.1130, 0.5575, 0.9046, 2.1580, 1.4735, 0.1356, 1.3579, 6.9255, 32.3165, 92.1138}, + /* 13*/ {0.2390, 0.6573, 1.2011, 2.5586, 1.2312, 0.3138, 2.1063, 10.4163, 34.4552, 98.5344, + 0.1165, 0.5504, 1.0179, 2.6295, 1.5711, 0.1295, 1.2619, 6.8242, 28.4577, 88.4750}, + /* 14*/ {0.2519, 0.6372, 1.3795, 2.5082, 1.0500, 0.3075, 2.0174, 9.6746, 29.3744, 80.4732, + 0.0567, 0.3365, 0.8104, 2.4960, 2.1186, 0.0582, 0.6155, 3.2522, 16.7929, 57.6767}, + /* 15*/ {0.2548, 0.6106, 1.4541, 2.3204, 0.8477, 0.2908, 1.8740, 8.5176, 24.3434, 63.2996, + 0.1005, 0.4615, 1.0663, 2.5854, 1.2725, 0.0977, 0.9084, 4.9654, 18.5471, 54.3648}, + /* 16*/ {0.2497, 0.5628, 1.3899, 2.1865, 0.7715, 0.2681, 1.6711, 7.0267, 19.5377, 50.3888, + 0.0915, 0.4312, 1.0847, 2.4671, 1.0852, 0.0838, 0.7788, 4.3462, 15.5846, 44.6365}, + /* 17*/ {0.2443, 0.5397, 1.3919, 2.0197, 0.6621, 0.2468, 1.5242, 6.1537, 16.6687, 42.3086, + 0.0799, 0.3891, 1.0037, 2.3332, 1.0507, 0.0694, 0.6443, 3.5351, 12.5058, 35.8633}, + /* 18*/ {0.2385, 0.5017, 1.3428, 1.8899, 0.6079, 0.2289, 1.3694, 5.2561, 14.0928, 35.5361, + 0.1044, 0.4551, 1.4232, 2.1533, 0.4459, 0.0853, 0.7701, 4.4684, 14.5864, 41.2474}, + /* 19*/ {0.4115, 1.4031, 2.2784, 2.6742, 2.2162, 0.3703, 3.3874, 13.1029, 68.9592, 194.4329, + 0.2149, 0.8703, 2.4999, 2.3591, 3.0318, 0.1660, 1.6906, 8.7447, 46.7825, 165.6923}, + /* 20*/ {0.4054, 1.3880, 2.1602, 3.7532, 2.2063, 0.3499, 3.0991, 11.9608, 53.9353, 142.3892, + 0.2355, 0.9916, 2.3959, 3.7252, 2.5647, 0.1742, 1.8329, 8.8407, 47.4583, 134.9613}, + /* 21*/ {0.3787, 1.2181, 2.0594, 3.2618, 2.3870, 0.3133, 2.5856, 9.5813, 41.7688, 116.7282, + 0.4636, 2.0802, 2.9003, 1.4193, 2.4323, 0.3682, 4.0312, 22.6493, 71.8200, 103.3691}, + /* 22*/ {0.3825, 1.2598, 2.0008, 3.0617, 2.0694, 0.3040, 2.4863, 9.2783, 39.0751, 109.4583, + 0.2123, 0.8960, 2.1765, 3.0436, 2.4439, 0.1399, 1.4568, 6.7534, 33.1168, 101.8238}, + /* 23*/ {0.3876, 1.2750, 1.9109, 2.8314, 1.8979, 0.2967, 2.3780, 8.7981, 35.9528, 101.7201, + 0.2369, 1.0774, 2.1894, 3.0825, 1.7190, 0.1505, 1.6392, 7.5691, 36.8741, 107.8517}, + /* 24*/ {0.4046, 1.3696, 1.8941, 2.0800, 1.2196, 0.2986, 2.3958, 9.1406, 37.4701, 113.7121, + 0.1970, 0.8228, 2.0200, 2.1717, 1.7516, 0.1197, 1.1985, 5.4097, 25.2361, 94.4290}, + /* 25*/ {0.3796, 1.2094, 1.7815, 2.5420, 1.5937, 0.2699, 2.0455, 7.4726, 31.0604, 91.5622, + 0.1943, 0.8190, 1.9296, 2.4968, 2.0625, 0.1135, 1.1313, 5.0341, 24.1798, 80.5598}, + /* 26*/ {0.3946, 1.2725, 1.7031, 2.3140, 1.4795, 0.2717, 2.0443, 7.6007, 29.9714, 86.2265, + 0.1929, 0.8239, 1.8689, 2.3694, 1.9060, 0.1087, 1.0806, 4.7637, 22.8500, 76.7309}, + /* 27*/ {0.4118, 1.3161, 1.6493, 2.1930, 1.2830, 0.2742, 2.0372, 7.7205, 29.9680, 84.9383, + 0.2186, 0.9861, 1.8540, 2.3258, 1.4685, 0.1182, 1.2300, 5.4177, 25.7602, 80.8542}, + /* 28*/ {0.3860, 1.1765, 1.5451, 2.0730, 1.3814, 0.2478, 1.7660, 6.3107, 25.2204, 74.3146, + 0.2313, 1.0657, 1.8229, 2.2609, 1.1883, 0.1210, 1.2691, 5.6870, 27.0917, 83.0285}, + /* 29*/ {0.4314, 1.3208, 1.5236, 1.4671, 0.8562, 0.2694, 1.9223, 7.3474, 28.9892, 90.6246, + 0.3501, 1.6558, 1.9582, 0.2134, 1.4109, 0.1867, 1.9917, 11.3396, 53.2619, 63.2520}, + /* 30*/ {0.4288, 1.2646, 1.4472, 1.8294, 1.0934, 0.2593, 1.7998, 6.7500, 25.5860, 73.5284, + 0.1780, 0.8096, 1.6744, 1.9499, 1.4495, 0.0876, 0.8650, 3.8612, 18.8726, 64.7016}, + /* 31*/ {0.4818, 1.4032, 1.6561, 2.4605, 1.1054, 0.2825, 1.9785, 8.7546, 32.5238, 98.5523, + 0.2135, 0.9768, 1.6669, 2.5662, 1.6790, 0.1020, 1.0219, 4.6275, 22.8742, 80.1535}, + /* 32*/ {0.4655, 1.3014, 1.6088, 2.6998, 1.3003, 0.2647, 1.7926, 7.6071, 26.5541, 77.5238, + 0.2135, 0.9761, 1.6555, 2.8938, 1.6356, 0.0989, 0.9845, 4.5527, 21.5563, 70.3903}, + /* 33*/ {0.4517, 1.2229, 1.5852, 2.7958, 1.2638, 0.2493, 1.6436, 6.8154, 22.3681, 62.0390, + 0.2059, 0.9518, 1.6372, 3.0490, 1.4756, 0.0926, 0.9182, 4.3291, 19.2996, 58.9329}, + /* 34*/ {0.4477, 1.1678, 1.5843, 2.8087, 1.1956, 0.2405, 1.5442, 6.3231, 19.4610, 52.0233, + 0.1574, 0.7614, 1.4834, 3.0016, 1.7978, 0.0686, 0.6808, 3.1163, 14.3458, 44.0455}, + /* 35*/ {0.4798, 1.1948, 1.8695, 2.6953, 0.8203, 0.2504, 1.5963, 6.9653, 19.8492, 50.3233, + 0.1899, 0.8983, 1.6358, 3.1845, 1.1518, 0.0810, 0.7957, 3.9054, 15.7701, 45.6124}, + /* 36*/ {0.4546, 1.0993, 1.7696, 2.7068, 0.8672, 0.2309, 1.4279, 5.9449, 16.6752, 42.2243, + 0.1742, 0.8447, 1.5944, 3.1507, 1.1338, 0.0723, 0.7123, 3.5192, 13.7724, 39.1148}, + /* 37*/ {1.0160, 2.8528, 3.5466, -7.7804, 12.1148, 0.4853, 5.0925, 25.7851, 130.4510, 138.6775, + 0.3781, 1.4904, 3.5753, 3.0031, 3.3272, 0.1557, 1.5347, 9.9947, 51.4251, 185.9828}, + /* 38*/ {0.6703, 1.4926, 3.3368, 4.4600, 3.1501, 0.3190, 2.2287, 10.3504, 52.3291, 151.2216, + 0.3723, 1.4598, 3.5124, 4.4612, 3.3031, 0.1480, 1.4643, 9.2320, 49.8807, 148.0937}, + /* 39*/ {0.6894, 1.5474, 3.2450, 4.2126, 2.9764, 0.3189, 2.2904, 10.0062, 44.0771, 125.0120, + 0.3234, 1.2737, 3.2115, 4.0563, 3.7962, 0.1244, 1.1948, 7.2756, 34.1430, 111.2079}, + /* 40*/ {0.6719, 1.4684, 3.1668, 3.9557, 2.8920, 0.3036, 2.1249, 8.9236, 36.8458, 108.2049, + 0.2997, 1.1879, 3.1075, 3.9740, 3.5769, 0.1121, 1.0638, 6.3891, 28.7081, 97.4289}, + /* 41*/ {0.6123, 1.2677, 3.0348, 3.3841, 2.3683, 0.2709, 1.7683, 7.2489, 27.9465, 98.5624, + 0.1680, 0.9370, 2.7300, 3.8150, 3.0053, 0.0597, 0.6524, 4.4317, 19.5540, 85.5011}, + /* 42*/ {0.6773, 1.4798, 3.1788, 3.0824, 1.8384, 0.2920, 2.0606, 8.1129, 30.5336, 100.0658, + 0.3069, 1.1714, 3.2293, 3.4254, 2.1224, 0.1101, 1.0222, 5.9613, 25.1965, 93.5831}, + /* 43*/ {0.7082, 1.6392, 3.1993, 3.4327, 1.8711, 0.2976, 2.2106, 8.5246, 33.1456, 96.6377, + 0.2928, 1.1267, 3.1675, 3.6619, 2.5942, 0.1020, 0.9481, 5.4713, 23.8153, 82.8991}, + /* 44*/ {0.6735, 1.4934, 3.0966, 2.7254, 1.5597, 0.2773, 1.9716, 7.3249, 26.6891, 90.5581, + 0.2604, 1.0442, 3.0761, 3.2175, 1.9448, 0.0887, 0.8240, 4.8278, 19.8977, 80.4566}, + /* 45*/ {0.6413, 1.3690, 2.9854, 2.6952, 1.5433, 0.2580, 1.7721, 6.3854, 23.2549, 85.1517, + 0.2713, 1.0556, 3.1416, 3.0451, 1.7179, 0.0907, 0.8324, 4.7702, 19.7862, 80.2540}, + /* 46*/ {0.5904, 1.1775, 2.6519, 2.2875, 0.8689, 0.2324, 1.5019, 5.1591, 15.5428, 46.8213, + 0.2003, 0.8779, 2.6135, 2.8594, 1.0258, 0.0659, 0.6111, 3.5563, 12.7638, 44.4283}, + /* 47*/ {0.6377, 1.3790, 2.8294, 2.3631, 1.4553, 0.2466, 1.6974, 5.7656, 20.0943, 76.7372, + 0.2739, 1.0503, 3.1564, 2.7543, 1.4328, 0.0881, 0.8028, 4.4451, 18.7011, 79.2633}, + /* 48*/ {0.6364, 1.4247, 2.7802, 2.5973, 1.7886, 0.2407, 1.6823, 5.6588, 20.7219, 69.1109, + 0.3072, 1.1303, 3.2046, 2.9329, 1.6560, 0.0966, 0.8856, 4.6273, 20.6789, 73.4723}, + /* 49*/ {0.6768, 1.6589, 2.7740, 3.1835, 2.1326, 0.2522, 1.8545, 6.2936, 25.1457, 84.5448, + 0.3564, 1.3011, 3.2424, 3.4839, 2.0459, 0.1091, 1.0452, 5.0900, 24.6578, 88.0513}, + /* 50*/ {0.7224, 1.9610, 2.7161, 3.5603, 1.8972, 0.2651, 2.0604, 7.3011, 27.5493, 81.3349, + 0.2966, 1.1157, 3.0973, 3.8156, 2.5281, 0.0896, 0.8268, 4.2242, 20.6900, 71.3399}, + /* 51*/ {0.7106, 1.9247, 2.6149, 3.8322, 1.8899, 0.2562, 1.9646, 6.8852, 24.7648, 68.9168, + 0.2725, 1.0651, 2.9940, 4.0697, 2.5682, 0.0809, 0.7488, 3.8710, 18.8800, 60.6499}, + /* 52*/ {0.6947, 1.8690, 2.5356, 4.0013, 1.8955, 0.2459, 1.8542, 6.4411, 22.1730, 59.2206, + 0.2422, 0.9692, 2.8114, 4.1509, 2.8161, 0.0708, 0.6472, 3.3609, 16.0752, 50.1724}, + /* 53*/ {0.7047, 1.9484, 2.5940, 4.1526, 1.5057, 0.2455, 1.8638, 6.7639, 21.8007, 56.4395, + 0.2617, 1.0325, 2.8097, 4.4809, 2.3190, 0.0749, 0.6914, 3.4634, 16.3603, 48.2522}, + /* 54*/ {0.6737, 1.7908, 2.4129, 4.2100, 1.7058, 0.2305, 1.6890, 5.8218, 18.3928, 47.2496, + 0.2334, 0.9496, 2.6381, 4.4680, 2.5020, 0.0655, 0.6050, 3.0389, 14.0809, 41.0005}, + /* 55*/ {1.2704, 3.8018, 5.6618, 0.9205, 4.8105, 0.4356, 4.2058, 23.4342, 136.7780, 171.7561, + 0.5713, 2.4866, 4.9795, 4.0198, 4.4403, 0.1626, 1.8213, 11.1049, 49.0568, 202.9987}, + /* 56*/ {0.9049, 2.6076, 4.8498, 5.1603, 4.7388, 0.3066, 2.4363, 12.1821, 54.6135, 161.9978, + 0.5229, 2.2874, 4.7243, 5.0807, 5.6389, 0.1434, 1.6019, 9.4511, 42.7685, 148.4969}, + /* 57*/ {0.8405, 2.3863, 4.6139, 5.1514, 4.7949, 0.2791, 2.1410, 10.3400, 41.9148, 132.0204, + 0.5461, 2.3856, 5.0653, 5.7601, 4.0463, 0.1479, 1.6552, 10.0059, 47.3245, 145.8464}, + /* 58*/ {0.8551, 2.3915, 4.5772, 5.0278, 4.5118, 0.2805, 2.1200, 10.1808, 42.0633, 130.9893, + 0.2227, 1.0760, 2.9482, 5.8496, 7.1834, 0.0571, 0.5946, 3.2022, 16.4253, 95.7030}, + /* 59*/ {0.9096, 2.5313, 4.5266, 4.6376, 4.3690, 0.2939, 2.2471, 10.8266, 48.8842, 147.6020, + 0.5237, 2.2913, 4.6161, 4.7233, 4.8173, 0.1360, 1.5068, 8.8213, 41.9536, 141.2424}, + /* 60*/ {0.8807, 2.4183, 4.4448, 4.6858, 4.1725, 0.2802, 2.0836, 10.0357, 47.4506, 146.9976, + 0.5368, 2.3301, 4.6058, 4.6621, 4.4622, 0.1378, 1.5140, 8.8719, 43.5967, 141.8065}, + /* 61*/ {0.9471, 2.5463, 4.3523, 4.4789, 3.9080, 0.2977, 2.2276, 10.5762, 49.3619, 145.3580, + 0.5232, 2.2627, 4.4552, 4.4787, 4.5073, 0.1317, 1.4336, 8.3087, 40.6010, 135.9196}, + /* 62*/ {0.9699, 2.5837, 4.2778, 4.4575, 3.5985, 0.3003, 2.2447, 10.6487, 50.7994, 146.4179, + 0.5162, 2.2302, 4.3449, 4.3598, 4.4292, 0.1279, 1.3811, 7.9629, 39.1213, 132.7846}, + /* 63*/ {0.8694, 2.2413, 3.9196, 3.9694, 4.5498, 0.2653, 1.8590, 8.3998, 36.7397, 125.7089, + 0.5272, 2.2844, 4.3361, 4.3178, 4.0908, 0.1285, 1.3943, 8.1081, 40.9631, 134.1233}, + /* 64*/ {0.9673, 2.4702, 4.1148, 4.4972, 3.2099, 0.2909, 2.1014, 9.7067, 43.4270, 125.9474, + 0.9664, 3.4052, 5.0803, 1.4991, 4.2528, 0.2641, 2.6586, 16.2213, 80.2060, 92.5359}, + /* 65*/ {0.9325, 2.3673, 3.8791, 3.9674, 3.7996, 0.2761, 1.9511, 8.9296, 41.5937, 131.0122, + 0.5110, 2.1570, 4.0308, 3.9936, 4.2466, 0.1210, 1.2704, 7.1368, 35.0354, 123.5062}, + /* 66*/ {0.9505, 2.3705, 3.8218, 4.0471, 3.4451, 0.2773, 1.9469, 8.8862, 43.0938, 133.1396, + 0.4974, 2.1097, 3.8906, 3.8100, 4.3084, 0.1157, 1.2108, 6.7377, 32.4150, 116.9225}, + /* 67*/ {0.9248, 2.2428, 3.6182, 3.7910, 3.7912, 0.2660, 1.8183, 7.9655, 33.1129, 101.8139, + 0.4679, 1.9693, 3.7191, 3.9632, 4.2432, 0.1069, 1.0994, 5.9769, 27.1491, 96.3119}, + /* 68*/ {1.0373, 2.4824, 3.6558, 3.8925, 3.0056, 0.2944, 2.0797, 9.4156, 45.8056, 132.7720, + 0.5034, 2.1088, 3.8232, 3.7299, 3.8963, 0.1141, 1.1769, 6.6087, 33.4332, 116.4913}, + /* 69*/ {1.0075, 2.3787, 3.5440, 3.6932, 3.1759, 0.2816, 1.9486, 8.7162, 41.8420, 125.0320, + 0.4839, 2.0262, 3.6851, 3.5874, 4.0037, 0.1081, 1.1012, 6.1114, 30.3728, 110.5988}, + /* 70*/ {1.0347, 2.3911, 3.4619, 3.6556, 3.0052, 0.2855, 1.9679, 8.7619, 42.3304, 125.6499, + 0.5221, 2.1695, 3.7567, 3.6685, 3.4274, 0.1148, 1.1860, 6.7520, 35.6807, 118.0692}, + /* 71*/ {0.9927, 2.2436, 3.3554, 3.7813, 3.0994, 0.2701, 1.8073, 7.8112, 34.4849, 103.3526, + 0.4680, 1.9466, 3.5428, 3.8490, 3.6594, 0.1015, 1.0195, 5.6058, 27.4899, 95.2846}, + /* 72*/ {1.0295, 2.2911, 3.4110, 3.9497, 2.4925, 0.2761, 1.8625, 8.0961, 34.2712, 98.5295, + 0.4048, 1.7370, 3.3399, 3.9448, 3.7293, 0.0868, 0.8585, 4.6378, 21.6900, 80.2408}, + /* 73*/ {1.0190, 2.2291, 3.4097, 3.9252, 2.2679, 0.2694, 1.7962, 7.6944, 31.0942, 91.1089, + 0.3835, 1.6747, 3.2986, 4.0462, 3.4303, 0.0810, 0.8020, 4.3545, 19.9644, 73.6337}, + /* 74*/ {0.9853, 2.1167, 3.3570, 3.7981, 2.2798, 0.2569, 1.6745, 7.0098, 26.9234, 81.3910, + 0.3661, 1.6191, 3.2455, 4.0856, 3.2064, 0.0761, 0.7543, 4.0952, 18.2886, 68.0967}, + /* 75*/ {0.9914, 2.0858, 3.4531, 3.8812, 1.8526, 0.2548, 1.6518, 6.8845, 26.7234, 81.7215, + 0.3933, 1.6973, 3.4202, 4.1274, 2.6158, 0.0806, 0.7972, 4.4237, 19.5692, 68.7477}, + /* 76*/ {0.9813, 2.0322, 3.3665, 3.6235, 1.9741, 0.2487, 1.5973, 6.4737, 23.2817, 70.9254, + 0.3854, 1.6555, 3.4129, 4.1111, 2.4106, 0.0787, 0.7638, 4.2441, 18.3700, 65.1071}, + /* 77*/ {1.0194, 2.0645, 3.4425, 3.4914, 1.6976, 0.2554, 1.6475, 6.5966, 23.2269, 70.0272, + 0.3510, 1.5620, 3.2946, 4.0615, 2.4382, 0.0706, 0.6904, 3.8266, 16.0812, 58.7638}, + /* 78*/ {0.9148, 1.8096, 3.2134, 3.2953, 1.5754, 0.2263, 1.3813, 5.3243, 17.5987, 60.0171, + 0.3083, 1.4158, 2.9662, 3.9349, 2.1709, 0.0609, 0.5993, 3.1921, 12.5285, 49.7675}, + /* 79*/ {0.9674, 1.8916, 3.3993, 3.0524, 1.2607, 0.2358, 1.4712, 5.6758, 18.7119, 61.5286, + 0.3055, 1.3945, 2.9617, 3.8990, 2.0026, 0.0596, 0.5827, 3.1035, 11.9693, 47.9106}, + /* 80*/ {1.0033, 1.9469, 3.4396, 3.1548, 1.4180, 0.2413, 1.5298, 5.8009, 19.4520, 60.5753, + 0.3593, 1.5736, 3.5237, 3.8109, 1.6953, 0.0694, 0.6758, 3.8457, 15.6203, 56.6614}, + /* 81*/ {1.0689, 2.1038, 3.6039, 3.4927, 1.8283, 0.2540, 1.6715, 6.3509, 23.1531, 78.7099, + 0.3511, 1.5489, 3.5676, 4.0900, 2.5251, 0.0672, 0.6522, 3.7420, 15.9791, 65.1354}, + /* 82*/ {1.0891, 2.1867, 3.6160, 3.8031, 1.8994, 0.2552, 1.7174, 6.5131, 23.9170, 74.7039, + 0.3540, 1.5453, 3.5975, 4.3152, 2.7743, 0.0668, 0.6465, 3.6968, 16.2056, 61.4909}, + /* 83*/ {1.1007, 2.2306, 3.5689, 4.1549, 2.0382, 0.2546, 1.7351, 6.4948, 23.6464, 70.3780, + 0.3530, 1.5258, 3.5815, 4.5532, 3.0714, 0.0661, 0.6324, 3.5906, 15.9962, 57.5760}, + /* 84*/ {1.1568, 2.4353, 3.6459, 4.4064, 1.7179, 0.2648, 1.8786, 7.1749, 25.1766, 69.2821, + 0.3673, 1.5772, 3.7079, 4.8582, 2.8440, 0.0678, 0.6527, 3.7396, 17.0668, 55.9789}, + /* 85*/ {1.0909, 2.1976, 3.3831, 4.6700, 2.1277, 0.2466, 1.6707, 6.0197, 20.7657, 57.2663, + 0.3547, 1.5206, 3.5621, 5.0184, 3.0075, 0.0649, 0.6188, 3.4696, 15.6090, 49.4818}, + /* 86*/ {1.0756, 2.1630, 3.3178, 4.8852, 2.0489, 0.2402, 1.6169, 5.7644, 19.4568, 52.5009, + 0.4586, 1.7781, 3.9877, 5.7273, 1.5460, 0.0831, 0.7840, 4.3599, 20.0128, 62.1535}, + /* 87*/ {1.4282, 3.5081, 5.6767, 4.1964, 3.8946, 0.3183, 2.6889, 13.4816, 54.3866, 200.8321, + 0.8282, 2.9941, 5.6597, 4.9292, 4.2889, 0.1515, 1.6163, 9.7752, 42.8480, 190.7366}, + /* 88*/ {1.3127, 3.1243, 5.2988, 5.3891, 5.4133, 0.2887, 2.2897, 10.8276, 43.5389, 145.6109, + 1.4129, 4.4269, 7.0460, -1.0573, 8.6430, 0.2921, 3.1381, 19.6767, 102.0430, 113.9798}, + /* 89*/ {1.3128, 3.1021, 5.3385, 5.9611, 4.7562, 0.2861, 2.2509, 10.5287, 41.7796, 128.2973, + 0.7169, 2.5710, 5.1791, 6.3484, 5.6474, 0.1263, 1.2900, 7.3686, 32.4490, 118.0558}, + /* 90*/ {1.2553, 2.9178, 5.0862, 6.1206, 4.7122, 0.2701, 2.0636, 9.3051, 34.5977, 107.9200, + 0.6958, 2.4936, 5.1269, 6.6988, 5.0799, 0.1211, 1.2247, 6.9398, 30.0991, 105.1960}, + /* 91*/ {1.3218, 3.1444, 5.4371, 5.6444, 4.0107, 0.2827, 2.2250, 10.2454, 41.1162, 124.4449, + 1.2502, 4.2284, 7.0489, 1.1390, 5.8222, 0.2415, 2.6442, 16.3313, 73.5757, 91.9401}, + /* 92*/ {1.3382, 3.2043, 5.4558, 5.4839, 3.6342, 0.2838, 2.2452, 10.2519, 41.7251, 124.9023, + 0.6410, 2.2643, 4.8713, 5.9287, 5.3935, 0.1097, 1.0644, 5.7907, 25.0261, 101.3899}, + /* 93*/ {1.5193, 4.0053, 6.5327, -0.1402, 6.7489, 0.3213, 2.8206, 14.8878, 68.9103, 81.7257, + 0.6938, 2.4652, 5.1227, 5.5965, 4.8543, 0.1171, 1.1757, 6.4053, 27.5217, 103.0482}, + /* 94*/ {1.3517, 3.2937, 5.3213, 4.6466, 3.5714, 0.2813, 2.2418, 9.9952, 42.7939, 132.1739, + 0.6902, 2.4509, 5.1284, 5.0339, 4.8575, 0.1153, 1.1545, 6.2291, 27.0741, 111.3150}, + /* 95*/ {1.2135, 2.7962, 4.7545, 4.5731, 4.4786, 0.2483, 1.8437, 7.5421, 29.3841, 112.4579, + 0.7577, 2.7264, 5.4184, 4.8198, 4.1013, 0.1257, 1.3044, 7.1035, 32.4649, 118.8647}, + /* 96*/ {1.2937, 3.1100, 5.0393, 4.7546, 3.5031, 0.2638, 2.0341, 8.7101, 35.2992, 109.4972, + 0.7567, 2.7565, 5.4364, 5.1918, 3.5643, 0.1239, 1.2979, 7.0798, 32.7871, 110.1512}, + /* 97*/ {1.2915, 3.1023, 4.9309, 4.6009, 3.4661, 0.2611, 2.0023, 8.4377, 34.1559, 105.8911, + 0.7492, 2.7267, 5.3521, 5.0369, 3.5321, 0.1217, 1.2651, 6.8101, 31.6088, 106.4853}, + /* 98*/ {1.2089, 2.7391, 4.3482, 4.0047, 4.6497, 0.2421, 1.7487, 6.7262, 23.2153, 80.3108, + 0.8100, 3.0001, 5.4635, 4.1756, 3.5066, 0.1310, 1.4038, 7.6057, 34.0186, 90.5226}, +}; #endif diff --git a/src/USER-DIFFRACTION/compute_xrd.cpp b/src/USER-DIFFRACTION/compute_xrd.cpp index 720e5809b1..a0a049e9d7 100644 --- a/src/USER-DIFFRACTION/compute_xrd.cpp +++ b/src/USER-DIFFRACTION/compute_xrd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DIFFRACTION/compute_xrd.h b/src/USER-DIFFRACTION/compute_xrd.h index b0beca201c..4254e50bf9 100644 --- a/src/USER-DIFFRACTION/compute_xrd.h +++ b/src/USER-DIFFRACTION/compute_xrd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(xrd,ComputeXRD) - +// clang-format off +ComputeStyle(xrd,ComputeXRD); +// clang-format on #else #ifndef LMP_COMPUTE_XRD_H @@ -33,28 +33,27 @@ class ComputeXRD : public Compute { double memory_usage(); private: - int me; - int *ztype; // Atomic number of the different atom types - double Min2Theta; // Minimum 2theta value (input in 2theta rad) - double Max2Theta; // Maximum 2theta value (input in 2theta rad) - double Kmax; // Maximum reciprocal distance to explore - double c[3]; // Resolution parameters for reciprocal space explored - int Knmax[3]; // maximum integer value for K points in each dimension - double dK[3]; // Parameters controlling resolution of reciprocal space explored - double prd_inv[3]; // Inverse spacing of unit cell - int LP; // Switch to turn on Lorentz-Polarization factor 1=on - bool echo; // echo compute_array progress - bool manual; // Turn on manual recpiprocal map + int me; + int *ztype; // Atomic number of the different atom types + double Min2Theta; // Minimum 2theta value (input in 2theta rad) + double Max2Theta; // Maximum 2theta value (input in 2theta rad) + double Kmax; // Maximum reciprocal distance to explore + double c[3]; // Resolution parameters for reciprocal space explored + int Knmax[3]; // maximum integer value for K points in each dimension + double dK[3]; // Parameters controlling resolution of reciprocal space explored + double prd_inv[3]; // Inverse spacing of unit cell + int LP; // Switch to turn on Lorentz-Polarization factor 1=on + bool echo; // echo compute_array progress + bool manual; // Turn on manual recpiprocal map int ntypes; int nlocalgroup; - double lambda; // Radiation wavelenght (distance units) + double lambda; // Radiation wavelenght (distance units) int radflag; int *store_tmp; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DIFFRACTION/compute_xrd_consts.h b/src/USER-DIFFRACTION/compute_xrd_consts.h index 945f0c51b7..d033e5a662 100644 --- a/src/USER-DIFFRACTION/compute_xrd_consts.h +++ b/src/USER-DIFFRACTION/compute_xrd_consts.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -28,479 +28,245 @@ x-ray and electron atomic scattering factors at high angles Acta Crystallogr. A 45 78693 */ -#define XRDmaxType 210 +#define XRDmaxType 210 static const char *XRDtypeList[XRDmaxType] = { - "H", "He1-", "He", "Li", "Li1+", - "Be", "Be2+", "B", "C", "Cval", - "N", "O", "O1-", "F", "F1-", - "Ne", "Na", "Na1+", "Mg", "Mg2+", - "Al", "Al3+", "Si", "Sival", "Si4+", - "P", "S", "Cl", "Cl1-", "Ar", - "K", "Ca", "Ca2+", "Sc", "Sc3+", - "Ti", "Ti2+", "Ti3+", "Ti4+", "V", - "V2+", "V3+", "V5+", "Cr", "Cr2+", - "Cr3+", "Mn", "Mn2+", "Mn3+", "Mn4+", - "Fe", "Fe2+", "Fe3+", "Co", "Co2+", - "Co", "Ni", "Ni2+", "Ni3+", "Cu", - "Cu1+", "Cu2+", "Zn", "Zn2+", "Ga", - "Ga3+", "Ge", "Ge4+", "As", "Se", - "Br", "Br1-", "Kr", "Rb", "Rb1+", - "Sr", "Sr2+", "Y", "Y3+", "Zr", - "Zr4+", "Nb", "Nb3+", "Nb5+", "Mo", - "Mo3+", "Mo5+", "Mo6+", "Tc", "Ru", - "Ru3+", "Ru4+", "Rh", "Rh3+", "Rh4+", - "Pd", "Pd2+", "Pd4+", "Ag", "Ag1+", - "Ag2+", "Cd", "Cd2+", "In", "In3+", - "Sn", "Sn2+", "Sn4+", "Sb", "Sb3+", - "Sb5+", "Te", "I", "I1-", "Xe", - "Cs", "Cs1+", "Ba", "Ba2+", "La", - "La3+", "Ce", "Ce3+", "Ce4+", "Pr", - "Pr3+", "Pr4+", "Nd", "Nd3+", "Pm", - "Pm3+", "Sm", "Sm3+", "Eu", "Eu2+", - "Eu3+", "Gd", "Gd3+", "Tb", "Tb3+", - "Dy", "Dy3+", "Ho", "Ho3+", "Er", - "Er3+", "Tm", "Tm3+", "Yb", "Yb2+", - "Yb3+", "Lu", "Lu3+", "Hf", "Hf4+", - "Ta", "Ta5+", "W", "W6+", "Re", - "Os", "Os4+", "Ir", "Ir3+", "Ir4+", - "Pt", "Pt2+", "Pt4+", "Au", "Au1+", - "Au3+", "Hg", "Hg1+", "Hg2+", "Tl", - "Tl1+", "Tl3+", "Pb", "Pb2+", "Pb4+", - "Bi", "Bi3+", "Bi5+", "Po", "At", - "Rn", "Fr", "Ra", "Ra2+", "Ac", - "Ac3+", "Th", "Th4+", "Pa", "U", - "U3+", "U4+", "U6+", "Np", "Np3+", - "Np4+", "Np6+", "Pu", "Pu3+", "Pu4+", - "Pu6+", "Am", "Cm", "Bk", "Cf"}; + "H", "He1-", "He", "Li", "Li1+", "Be", "Be2+", "B", "C", "Cval", "N", "O", + "O1-", "F", "F1-", "Ne", "Na", "Na1+", "Mg", "Mg2+", "Al", "Al3+", "Si", "Sival", + "Si4+", "P", "S", "Cl", "Cl1-", "Ar", "K", "Ca", "Ca2+", "Sc", "Sc3+", "Ti", + "Ti2+", "Ti3+", "Ti4+", "V", "V2+", "V3+", "V5+", "Cr", "Cr2+", "Cr3+", "Mn", "Mn2+", + "Mn3+", "Mn4+", "Fe", "Fe2+", "Fe3+", "Co", "Co2+", "Co", "Ni", "Ni2+", "Ni3+", "Cu", + "Cu1+", "Cu2+", "Zn", "Zn2+", "Ga", "Ga3+", "Ge", "Ge4+", "As", "Se", "Br", "Br1-", + "Kr", "Rb", "Rb1+", "Sr", "Sr2+", "Y", "Y3+", "Zr", "Zr4+", "Nb", "Nb3+", "Nb5+", + "Mo", "Mo3+", "Mo5+", "Mo6+", "Tc", "Ru", "Ru3+", "Ru4+", "Rh", "Rh3+", "Rh4+", "Pd", + "Pd2+", "Pd4+", "Ag", "Ag1+", "Ag2+", "Cd", "Cd2+", "In", "In3+", "Sn", "Sn2+", "Sn4+", + "Sb", "Sb3+", "Sb5+", "Te", "I", "I1-", "Xe", "Cs", "Cs1+", "Ba", "Ba2+", "La", + "La3+", "Ce", "Ce3+", "Ce4+", "Pr", "Pr3+", "Pr4+", "Nd", "Nd3+", "Pm", "Pm3+", "Sm", + "Sm3+", "Eu", "Eu2+", "Eu3+", "Gd", "Gd3+", "Tb", "Tb3+", "Dy", "Dy3+", "Ho", "Ho3+", + "Er", "Er3+", "Tm", "Tm3+", "Yb", "Yb2+", "Yb3+", "Lu", "Lu3+", "Hf", "Hf4+", "Ta", + "Ta5+", "W", "W6+", "Re", "Os", "Os4+", "Ir", "Ir3+", "Ir4+", "Pt", "Pt2+", "Pt4+", + "Au", "Au1+", "Au3+", "Hg", "Hg1+", "Hg2+", "Tl", "Tl1+", "Tl3+", "Pb", "Pb2+", "Pb4+", + "Bi", "Bi3+", "Bi5+", "Po", "At", "Rn", "Fr", "Ra", "Ra2+", "Ac", "Ac3+", "Th", + "Th4+", "Pa", "U", "U3+", "U4+", "U6+", "Np", "Np3+", "Np4+", "Np6+", "Pu", "Pu3+", + "Pu4+", "Pu6+", "Am", "Cm", "Bk", "Cf"}; // a list of atomic scattering factor constants for x-ray diffraction static const double ASFXRD[XRDmaxType][9] = { - /* Each set of two rows in this file contains the constants + /* Each set of two rows in this file contains the constants for 0 < sin(theta)/lambda < 2 A1, B1, A2, B2, A3, B3, A4, B4, C */ - {0.489918, 20.6593, 0.262003, 7.74039, 0.196767, - 49.5519, 0.049879, 2.20159, 0.001305}, - {0.897661, 53.1368, 0.565616, 15.187, 0.415815, - 186.576, 0.116973, 3.56709, 0.002389}, - { 0.8734, 9.1037, 0.6309, 3.3568, 0.3112, - 22.9276, 0.178, 0.9821, 0.0064}, - { 1.1282, 3.9546, 0.7508, 1.0524, 0.6175, - 85.3905, 0.4653, 68.261, 0.0377}, - { 0.6968, 4.6237, 0.7888, 1.9557, 0.3414, - 0.6316, 0.7029, 0.542, 0.0167}, - { 1.5919, 43.6427, 1.1278, 1.8623, 0.5391, - 103.483, 0.7029, 0.542, 0.0385}, - { 6.2603, 0.0027, 0.8849, 0.8313, 0.7993, - 2.2758, 0.1647, 5.1146, -6.1092}, - { 2.0545, 23.2185, 1.3326, 1.021, 1.0979, - 60.3498, 0.7068, 0.1403, -0.1932}, - { 2.31, 20.8439, 1.02, 10.2075, 1.5886, - 0.5687, 0.865, 51.6512, 0.2156}, - { 2.26069, 22.6907, 1.56165, 0.656665, 1.05075, - 9.75618, 0.839259, 55.5949, 0.286977}, - { 12.2126, 0.0057, 3.1322, 9.8933, 2.0125, - 28.9975, 1.1663, 0.5826, -11.529}, - { 3.0485, 13.2771, 2.2868, 5.7011, 1.5463, - 0.3239, 0.867, 32.9089, 0.2508}, - { 4.1916, 12.8573, 1.63969, 4.17236, 1.52673, - -47.0179, 20.307, -0.01404, 21.9412}, - { 3.5392, 10.2825, 2.6412, 4.2944, 1.517, - 0.2615, 1.0243, 26.1476, 0.2776}, - { 3.6322, 5.27756, 3.51057, 14.7353, 1.26064, - 0.442258, 0.940706, 47.3437, 0.653396}, - { 3.9553, 8.4042, 3.1125, 3.4262, 1.4546, - 0.2306, 1.1251, 21.7184, 0.3515}, - { 4.7626, 3.285, 3.1736, 8.8422, 1.2674, - 0.3136, 1.1128, 129.424, 0.676}, - { 3.2565, 2.6671, 3.9362, 6.1153, 1.3998, - 0.2001, 1.0032, 14.039, 0.404}, - { 5.4204, 2.8275, 2.1735, 79.2611, 1.2269, - 0.3808, 2.3073, 7.1937, 0.8584}, - { 3.4988, 2.1676, 3.8378, 4.7542, 1.3284, - 0.185, 0.8497, 10.1411, 0.4853}, - { 6.4202, 3.0387, 1.9002, 0.7426, 1.5936, - 31.5472, 1.9646, 85.0886, 1.1151}, - { 4.17448, 1.93816, 3.3876, 4.14553, 1.20296, - 0.228753, 0.528137, 8.28524, 0.706786}, - { 6.2915, 2.4386, 3.0353, 32.3337, 1.9891, - 0.6785, 1.541, 81.6937, 1.1407}, - { 5.66269, 2.6652, 3.07164, 38.6634, 2.62446, - 0.916946, 1.3932, 93.5458, 1.24707}, - { 4.43918, 1.64167, 3.20345, 3.43757, 1.19453, - 0.2149, 0.41653, 6.65365, 0.746297}, - { 6.4345, 1.9067, 4.1791, 27.157, 1.78, - 0.526, 1.4908, 68.1645, 1.1149}, - { 6.9053, 1.4679, 5.2034, 22.2151, 1.4379, - 0.2536, 1.5863, 56.172, 0.8669}, - { 11.4604, 0.0104, 7.1964, 1.1662, 6.2556, - 18.5194, 1.6455, 47.7784, -9.5574}, - { 18.2915, 0.0066, 7.2084, 1.1717, 6.5337, - 19.5424, 2.3386, 60.4486, -16.378}, - { 7.4845, 0.9072, 6.7723, 14.8407, 0.6539, - 43.8983, 1.6442, 33.3929, 1.4445}, - { 8.2186, 12.7949, 7.4398, 0.7748, 1.0519, - 213.187, 0.8659, 41.6841, 1.4228}, - { 8.6266, 10.4421, 7.3873, 0.6599, 1.5899, - 85.7484, 1.0211, 178.437, 1.3751}, - { 15.6348, -0.0074, 7.9518, 0.6089, 8.4372, - 10.3116, 0.8537, 25.9905, -14.875}, - { 9.189, 9.0213, 7.3679, 0.5729, 1.6409, - 136.108, 1.468, 51.3531, 1.3329}, - { 13.4008, 0.29854, 8.0273, 7.9629, 1.65943, - -0.28604, 1.57936, 16.0662, -6.6667}, - { 9.7595, 7.8508, 7.3558, 0.5, 1.6991, - 35.6338, 1.9021, 116.105, 1.2807}, - { 9.11423, 7.5243, 7.62174, 0.457585, 2.2793, - 19.5361, 0.087899, 61.6558, 0.897155}, - { 17.7344, 0.22061, 8.73816, 7.04716, 5.25691, - -0.15762, 1.92134, 15.9768, -14.652}, - { 19.5114, 0.178847, 8.23473, 6.67018, 2.01341, - -0.29263, 1.5208, 12.9464, -13.28}, - { 10.2971, 6.8657, 7.3511, 0.4385, 2.0703, - 26.8938, 2.0571, 102.478, 1.2199}, - { 10.106, 6.8818, 7.3541, 0.4409, 2.2884, - 20.3004, 0.0223, 115.122, 1.2298}, - { 9.43141, 6.39535, 7.7419, 0.383349, 2.15343, - 15.1908, 0.016865, 63.969, 0.656565}, - { 15.6887, 0.679003, 8.14208, 5.40135, 2.03081, - 9.97278, -9.576, 0.940464, 1.7143}, - { 10.6406, 6.1038, 7.3537, 0.392, 3.324, - 20.2626, 1.4922, 98.7399, 1.1832}, - { 9.54034, 5.66078, 7.7509, 0.344261, 3.58274, - 13.3075, 0.509107, 32.4224, 0.616898}, - { 9.6809, 5.59463, 7.81136, 0.334393, 2.87603, - 12.8288, 0.113575, 32.8761, 0.518275}, - { 11.2819, 5.3409, 7.3573, 0.3432, 3.0193, - 17.8674, 2.2441, 83.7543, 1.0896}, - { 10.8061, 5.2796, 7.362, 0.3435, 3.5268, - 14.343, 0.2184, 41.3235, 1.0874}, - { 9.84521, 4.91797, 7.87194, 0.294393, 3.56531, - 10.8171, 0.323613, 24.1281, 0.393974}, - { 9.96253, 4.8485, 7.97057, 0.283303, 2.76067, - 10.4852, 0.054447, 27.573, 0.251877}, - { 11.7695, 4.7611, 7.3573, 0.3072, 3.5222, - 15.3535, 2.3045, 76.8805, 1.0369}, - { 11.0424, 4.6538, 7.374, 0.3053, 4.1346, - 12.0546, 0.4399, 31.2809, 1.0097}, - { 11.1764, 4.6147, 7.3863, 0.3005, 3.3948, - 11.6729, 0.0724, 38.5566, 0.9707}, - { 12.2841, 4.2791, 7.3409, 0.2784, 4.0034, - 13.5359, 2.3488, 71.1692, 1.0118}, - { 11.2296, 4.1231, 7.3883, 0.2726, 4.7393, - 10.2443, 0.7108, 25.6466, 0.9324}, - { 10.338, 3.90969, 7.88173, 0.238668, 4.76795, - 8.35583, 0.725591, 18.3491, 0.286667}, - { 12.8376, 3.8785, 7.292, 0.2565, 4.4438, - 12.1763, 2.38, 66.3421, 1.0341}, - { 11.4166, 3.6766, 7.4005, 0.2449, 5.3442, - 8.873, 0.9773, 22.1626, 0.8614}, - { 10.7806, 3.5477, 7.75868, 0.22314, 5.22746, - 7.64468, 0.847114, 16.9673, 0.386044}, - { 13.338, 3.5828, 7.1676, 0.247, 5.6158, - 11.3966, 1.6735, 64.8126, 1.191}, - { 11.9475, 3.3669, 7.3573, 0.2274, 6.2455, - 8.6625, 1.5578, 25.8487, 0.89}, - { 11.8168, 3.37484, 7.11181, 0.244078, 5.78135, - 7.9876, 1.14523, 19.897, 1.14431}, - { 14.0743, 3.2655, 7.0318, 0.2333, 5.1652, - 10.3163, 2.41, 58.7097, 1.3041}, - { 11.9719, 2.9946, 7.3862, 0.2031, 6.4668, - 7.0826, 1.394, 18.0995, 0.7807}, - { 15.2354, 3.0669, 6.7006, 0.2412, 4.3591, - 10.7805, 2.9623, 61.4135, 1.7189}, - { 12.692, 2.81262, 6.69883, 0.22789, 6.06692, - 6.36441, 1.0066, 14.4122, 1.53545}, - { 16.0816, 2.8509, 6.3747, 0.2516, 3.7068, - 11.4468, 3.683, 54.7625, 2.1313}, - { 12.9172, 2.53718, 6.70003, 0.205855, 6.06791, - 5.47913, 0.859041, 11.603, 1.45572}, - { 16.6723, 2.6345, 6.0701, 0.2647, 3.4313, - 12.9479, 4.2779, 47.7972, 2.531}, - { 17.0006, 2.4098, 5.8196, 0.2726, 3.9731, - 15.2372, 4.3543, 43.8163, 2.8409}, - { 17.1789, 2.1723, 5.2358, 16.5796, 5.6377, - 0.2609, 3.9851, 41.4328, 2.9557}, - { 17.1718, 2.2059, 6.3338, 19.3345, 5.5754, - 0.2871, 3.7272, 58.1535, 3.1776}, - { 17.3555, 1.9384, 6.7286, 16.5623, 5.5493, - 0.2261, 3.5375, 39.3972, 2.825}, - { 17.1784, 1.7888, 9.6435, 17.3151, 5.1399, - 0.2748, 1.5292, 164.934, 3.4873}, - { 17.5816, 1.7139, 7.6598, 14.7957, 5.8981, - 0.1603, 2.7817, 31.2087, 2.0782}, - { 17.5663, 1.5564, 9.8184, 14.0988, 5.422, - 0.1664, 2.6694, 132.376, 2.5064}, - { 18.0874, 1.4907, 8.1373, 12.6963, 2.5654, - -24.5651, 34.193, -0.0138, 41.4025}, - { 17.776, 1.4029, 10.2946, 12.8006, 5.72629, - 0.125599, 3.26588, 104.354, 1.91213}, - { 17.9268, 1.35417, 9.1531, 11.2145, 1.76795, - -22.6599, 33.108, -0.01319, 40.2602}, - { 17.8765, 1.27618, 10.948, 11.916, 5.41732, - 0.117622, 3.65721, 87.6627, 2.06929}, - { 18.1668, 1.2148, 10.0562, 10.1483, 1.01118, - 21.6054, -2.6479, -0.10276, 9.41454}, - { 17.6142, 1.18865, 12.0144, 11.766, 4.04183, - 0.204785, 3.53346, 69.7957, 3.75591}, - { 19.8812, 0.019175, 18.0653, 1.13305, 11.0177, - 10.1621, 1.94715, 28.3389, -12.912}, - { 17.9163, 1.12446, 13.3417, 0.028781, 10.799, - 9.28206, 0.337905, 25.7228, -6.3934}, - { 3.7025, 0.2772, 17.2356, 1.0958, 12.8876, - 11.004, 3.7429, 61.6584, 4.3875}, - { 21.1664, 0.014734, 18.2017, 1.03031, 11.7423, - 9.53659, 2.30951, 26.6307, -14.421}, - { 21.0149, 0.014345, 18.0992, 1.02238, 11.4632, - 8.78809, 0.740625, 23.3452, -14.316}, - { 17.8871, 1.03649, 11.175, 8.48061, 6.57891, - 0.058881, 0, 0, 0.344941}, - { 19.1301, 0.864132, 11.0948, 8.14487, 4.64901, - 21.5707, 2.71263, 86.8472, 5.40428}, - { 19.2674, 0.80852, 12.9182, 8.43467, 4.86337, - 24.7997, 1.56756, 94.2928, 5.37814}, - { 18.5638, 0.847329, 13.2885, 8.37164, 9.32602, - 0.017662, 3.00964, 22.887, -3.1892}, - { 18.5003, 0.844582, 13.1787, 8.12534, 4.71304, - 0.36495, 2.18535, 20.8504, 1.42357}, - { 19.2957, 0.751536, 14.3501, 8.21758, 4.73425, - 25.8749, 1.28918, 98.6062, 5.328}, - { 18.8785, 0.764252, 14.1259, 7.84438, 3.32515, - 21.2487, -6.1989, -0.01036, 11.8678}, - { 18.8545, 0.760825, 13.9806, 7.62436, 2.53464, - 19.3317, -5.6526, -0.0102, 11.2835}, - { 19.3319, 0.698655, 15.5017, 7.98929, 5.29537, - 25.2052, 0.605844, 76.8986, 5.26593}, - { 19.1701, 0.696219, 15.2096, 7.55573, 4.32234, - 22.5057, 0, 0, 5.2916}, - { 19.2493, 0.683839, 14.79, 7.14833, 2.89289, - 17.9144, -7.9492, 0.005127, 13.0174}, - { 19.2808, 0.6446, 16.6885, 7.4726, 4.8045, - 24.6605, 1.0463, 99.8156, 5.179}, - { 19.1812, 0.646179, 15.9719, 7.19123, 5.27475, - 21.7326, 0.357534, 66.1147, 5.21572}, - { 19.1643, 0.645643, 16.2456, 7.18544, 4.3709, - 21.4072, 0, 0, 5.21404}, - { 19.2214, 0.5946, 17.6444, 6.9089, 4.461, - 24.7008, 1.6029, 87.4825, 5.0694}, - { 19.1514, 0.597922, 17.2535, 6.80639, 4.47128, - 20.2521, 0, 0, 5.11937}, - { 19.1624, 0.5476, 18.5596, 6.3776, 4.2948, - 25.8499, 2.0396, 92.8029, 4.9391}, - { 19.1045, 0.551522, 18.1108, 6.3247, 3.78897, - 17.3595, 0, 0, 4.99635}, - { 19.1889, 5.8303, 19.1005, 0.5031, 4.4585, - 26.8909, 2.4663, 83.9571, 4.7821}, - { 19.1094, 0.5036, 19.0548, 5.8378, 4.5648, - 23.3752, 0.487, 62.2061, 4.7861}, - { 18.9333, 5.764, 19.7131, 0.4655, 3.4182, - 14.0049, 0.0193, -0.7583, 3.9182}, - { 19.6418, 5.3034, 19.0455, 0.4607, 5.0371, - 27.9074, 2.6827, 75.2825, 4.5909}, - { 18.9755, 0.467196, 18.933, 5.22126, 5.10789, - 19.5902, 0.288753, 55.5113, 4.69626}, - { 19.8685, 5.44853, 19.0302, 0.467973, 2.41253, - 14.1259, 0, 0, 4.69263}, - { 19.9644, 4.81742, 19.0138, 0.420885, 6.14487, - 28.5284, 2.5239, 70.8403, 4.352}, - { 20.1472, 4.347, 18.9949, 0.3814, 7.5138, - 27.766, 2.2735, 66.8776, 4.0712}, - { 20.2332, 4.3579, 18.997, 0.3815, 7.8069, - 29.5259, 2.8868, 84.9304, 4.0714}, - { 20.2933, 3.9282, 19.0298, 0.344, 8.9767, - 26.4659, 1.99, 64.2658, 3.7118}, - { 20.3892, 3.569, 19.1062, 0.3107, 10.662, - 24.3879, 1.4953, 213.904, 3.3352}, - { 20.3524, 3.552, 19.1278, 0.3086, 10.2821, - 23.7128, 0.9615, 59.4565, 3.2791}, - { 20.3361, 3.216, 19.297, 0.2756, 10.888, - 20.2073, 2.6959, 167.202, 2.7731}, - { 20.1807, 3.21367, 19.1136, 0.28331, 10.9054, - 20.0558, 0.77634, 51.746, 3.02902}, - { 20.578, 2.94817, 19.599, 0.244475, 11.3727, - 18.7726, 3.28719, 133.124, 2.14678}, - { 20.2489, 2.9207, 19.3763, 0.250698, 11.6323, - 17.8211, 0.336048, 54.9453, 2.4086}, - { 21.1671, 2.81219, 19.7695, 0.226836, 11.8513, - 17.6083, 3.33049, 127.113, 1.86264}, - { 20.8036, 2.77691, 19.559, 0.23154, 11.9369, - 16.5408, 0.612376, 43.1692, 2.09013}, - { 20.3235, 2.65941, 19.8186, 0.21885, 12.1233, - 15.7992, 0.144583, 62.2355, 1.5918}, - { 22.044, 2.77393, 19.6697, 0.222087, 12.3856, - 16.7669, 2.82428, 143.644, 2.0583}, - { 21.3727, 2.6452, 19.7491, 0.214299, 12.1329, - 15.323, 0.97518, 36.4065, 1.77132}, - { 20.9413, 2.54467, 20.0539, 0.202481, 12.4668, - 14.8137, 0.296689, 45.4643, 1.24285}, - { 22.6845, 2.66248, 19.6847, 0.210628, 12.774, - 15.885, 2.85137, 137.903, 1.98486}, - { 21.961, 2.52722, 19.9339, 0.199237, 12.12, - 14.1783, 1.51031, 30.8717, 1.47588}, - { 23.3405, 2.5627, 19.6095, 0.202088, 13.1235, - 15.1009, 2.87516, 132.721, 2.02876}, - { 22.5527, 2.4174, 20.1108, 0.185769, 12.0671, - 13.1275, 2.07492, 27.4491, 1.19499}, - { 24.0042, 2.47274, 19.4258, 0.196451, 13.4396, - 14.3996, 2.89604, 128.007, 2.20963}, - { 23.1504, 2.31641, 20.2599, 0.174081, 11.9202, - 12.1571, 2.71488, 24.8242, 0.954586}, - { 24.6274, 2.3879, 19.0886, 0.1942, 13.7603, - 13.7546, 2.9227, 123.174, 2.5745}, - { 24.0063, 2.27783, 19.9504, 0.17353, 11.8034, - 11.6096, 3.87243, 26.5156, 1.36389}, - { 23.7497, 2.22258, 20.3745, 0.16394, 11.8509, - 11.311, 3.26503, 22.9966, 0.759344}, - { 25.0709, 2.25341, 19.0798, 0.181951, 13.8518, - 12.9331, 3.54545, 101.398, 2.4196}, - { 24.3466, 2.13553, 20.4208, 0.155525, 11.8708, - 10.5782, 3.7149, 21.7029, 0.645089}, - { 25.8976, 2.24256, 18.2185, 0.196143, 14.3167, - 12.6648, 2.95354, 115.362, 3.58324}, - { 24.9559, 2.05601, 20.3271, 0.149525, 12.2471, - 10.0499, 3.773, 21.2773, 0.691967}, - { 26.507, 2.1802, 17.6383, 0.202172, 14.5596, - 12.1899, 2.96577, 111.874, 4.29728}, - { 25.5395, 1.9804, 20.2861, 0.143384, 11.9812, - 9.34972, 4.50073, 19.581, 0.68969}, - { 26.9049, 2.07051, 17.294, 0.19794, 14.5583, - 11.4407, 3.63837, 92.6566, 4.56796}, - { 26.1296, 1.91072, 20.0994, 0.139358, 11.9788, - 8.80018, 4.93676, 18.5908, 0.852795}, - { 27.6563, 2.07356, 16.4285, 0.223545, 14.9779, - 11.3604, 2.98233, 105.703, 5.92046}, - { 26.722, 1.84659, 19.7748, 0.13729, 12.1506, - 8.36225, 5.17379, 17.8974, 1.17613}, - { 28.1819, 2.02859, 15.8851, 0.238849, 15.1542, - 10.9975, 2.98706, 102.961, 1.63929}, - { 27.3083, 1.78711, 19.332, 0.136974, 12.3339, - 7.96778, 5.38348, 17.2922, 1.63929}, - { 28.6641, 1.9889, 15.4345, 0.257119, 15.3087, - 10.6647, 2.98963, 100.417, 7.56672}, - { 28.1209, 1.78503, 17.6817, 0.15997, 13.3335, - 8.18304, 5.14657, 20.39, 3.70983}, - { 27.8917, 1.73272, 18.7614, 0.13879, 12.6072, - 7.64412, 5.47647, 16.8153, 2.26001}, - { 28.9476, 1.90182, 15.2208, 9.98519, 15.1, - 0.261033, 3.71601, 84.3298, 7.97628}, - { 28.4628, 1.68216, 18.121, 0.142292, 12.8429, - 7.33727, 5.59415, 16.3535, 2.97573}, - { 29.144, 1.83262, 15.1726, 9.5999, 14.7586, - 0.275116, 4.30013, 72.029, 8.58154}, - { 28.8131, 1.59136, 18.4601, 0.128903, 12.7285, - 6.76232, 5.59927, 14.0366, 2.39699}, - { 29.2024, 1.77333, 15.2293, 9.37046, 14.5135, - 0.295977, 4.76492, 63.3644, 9.24354}, - { 29.1587, 1.50711, 18.8407, 0.116741, 12.8268, - 6.31524, 5.38695, 12.4244, 1.78555}, - { 29.0818, 1.72029, 15.43, 9.2259, 14.4327, - 0.321703, 5.11982, 57.056, 9.8875}, - { 29.4936, 1.42755, 19.3763, 0.104621, 13.0544, - 5.93667, 5.06412, 11.1972, 1.01074}, - { 28.7621, 1.67191, 15.7189, 9.09227, 14.5564, - 0.3505, 5.44174, 52.0861, 10.472}, - { 28.1894, 1.62903, 16.155, 8.97948, 14.9305, - 0.382661, 5.67589, 48.1647, 11.0005}, - { 30.419, 1.37113, 15.2637, 6.84706, 14.7458, - 0.165191, 5.06795, 18.003, 6.49804}, - { 27.3049, 1.59279, 16.7296, 8.86553, 15.6115, - 0.417916, 5.83377, 45.0011, 11.4722}, - { 30.4156, 1.34323, 15.862, 7.10909, 13.6145, - 0.204633, 5.82008, 20.3254, 8.27903}, - { 30.7058, 1.30923, 15.5512, 6.71983, 14.2326, - 0.167252, 5.53672, 17.4911, 6.96824}, - { 27.0059, 1.51293, 17.7639, 8.81174, 15.7131, - 0.424593, 5.7837, 38.6103, 11.6883}, - { 29.8429, 1.32927, 16.7224, 7.38979, 13.2153, - 0.263297, 6.35234, 22.9426, 9.85329}, - { 30.9612, 1.24813, 15.9829, 6.60834, 13.7348, - 0.16864, 5.92034, 16.9392, 7.39534}, - { 16.8819, 0.4611, 18.5913, 8.6216, 25.5582, - 1.4826, 5.86, 36.3956, 12.0658}, - { 28.0109, 1.35321, 17.8204, 7.7395, 14.3359, - 0.356752, 6.58077, 26.4043, 11.2299}, - { 30.6886, 1.2199, 16.9029, 6.82872, 12.7801, - 0.212867, 6.52354, 18.659, 9.0968}, - { 20.6809, 0.545, 19.0417, 8.4484, 21.6575, - 1.5729, 5.9676, 38.3246, 12.6089}, - { 25.0853, 1.39507, 18.4973, 7.65105, 16.8883, - 0.443378, 6.48216, 28.2262, 12.0205}, - { 29.5641, 1.21152, 18.06, 7.05639, 12.8374, - 0.284738, 6.89912, 20.7482, 10.6268}, - { 27.5446, 0.65515, 19.1584, 8.70751, 15.538, - 1.96347, 5.52593, 45.8149, 13.1746}, - { 21.3985, 1.4711, 20.4723, 0.517394, 18.7478, - 7.43463, 6.82847, 28.8482, 12.5258}, - { 30.8695, 1.1008, 18.3481, 6.53852, 11.9328, - 0.219074, 7.00574, 17.2114, 9.8027}, - { 31.0617, 0.6902, 13.0637, 2.3576, 18.442, - 8.618, 5.9696, 47.2579, 13.4118}, - { 21.7886, 1.3366, 19.5682, 0.488383, 19.1406, - 6.7727, 7.01107, 23.8132, 12.4734}, - { 32.1244, 1.00566, 18.8003, 6.10926, 12.0175, - 0.147041, 6.96886, 14.714, 8.08428}, - { 33.3689, 0.704, 12.951, 2.9238, 16.5877, - 8.7937, 6.4692, 48.0093, 13.5782}, - { 21.8053, 1.2356, 19.5026, 6.24149, 19.1053, - 0.469999, 7.10295, 20.3185, 12.4711}, - { 33.5364, 0.91654, 25.0946, 0.39042, 19.2497, - 5.71414, 6.91555, 12.8285, 6.7994}, - { 34.6726, 0.700999, 15.4733, 3.55078, 13.1138, - 9.55642, 7.02588, 47.0045, 13.677}, - { 35.3163, 0.68587, 19.0211, 3.97458, 9.49887, - 11.3824, 7.42518, 45.4715, 13.7108}, - { 35.5631, 0.6631, 21.2816, 4.0691, 8.0037, - 14.0422, 7.4433, 44.2473, 13.6905}, - { 35.9299, 0.646453, 23.0547, 4.17619, 12.1439, - 23.1052, 2.11253, 150.645, 13.7247}, - { 35.763, 0.616341, 22.9064, 3.87135, 12.4739, - 19.9887, 3.21097, 142.325, 13.6211}, - { 35.215, 0.604909, 21.67, 3.5767, 7.91342, - 12.601, 7.65078, 29.8436, 13.5431}, - { 35.6597, 0.589092, 23.1032, 3.65155, 12.5977, - 18.599, 4.08655, 117.02, 13.5266}, - { 35.1736, 0.579689, 22.1112, 3.41437, 8.19216, - 12.9187, 7.05545, 25.9443, 13.4637}, - { 35.5645, 0.563359, 23.4219, 3.46204, 12.7473, - 17.8309, 4.80703, 99.1722, 13.4314}, - { 35.1007, 0.555054, 22.4418, 3.24498, 9.78554, - 13.4661, 5.29444, 23.9533, 13.376}, - { 35.8847, 0.547751, 23.2948, 3.41519, 14.1891, - 16.9235, 4.17287, 105.251, 13.4287}, - { 36.0228, 0.5293, 23.4128, 3.3253, 14.9491, - 16.0927, 4.188, 100.613, 13.3966}, - { 35.5747, 0.52048, 22.5259, 3.12293, 12.2165, - 12.7148, 5.37073, 26.3394, 13.3092}, - { 35.3715, 0.516598, 22.5326, 3.05053, 12.0291, - 12.5723, 4.7984, 23.4582, 13.2671}, - { 34.8509, 0.507079, 22.7584, 2.8903, 14.0099, - 13.1767, 1.21457, 25.2017, 13.1665}, - { 36.1874, 0.511929, 23.5964, 3.25396, 15.6402, - 15.3622, 4.1855, 97.4908, 13.3573}, - { 35.7074, 0.502322, 22.613, 3.03807, 12.9898, - 12.1449, 5.43227, 25.4928, 13.2544}, - { 35.5103, 0.498626, 22.5787, 2.96627, 12.7766, - 11.9484, 4.92159, 22.7502, 13.2116}, - { 35.0136, 0.48981, 22.7286, 2.81099, 14.3884, - 12.33, 1.75669, 22.6581, 13.113}, - { 36.5254, 0.499384, 23.8083, 3.26371, 16.7707, - 14.9455, 3.47947, 105.98, 13.3812}, - { 35.84, 0.484938, 22.7169, 2.96118, 13.5807, - 11.5331, 5.66016, 24.3992, 13.1991}, - { 35.6493, 0.481422, 22.646, 2.8902, 13.3595, - 11.316, 5.18831, 21.8301, 13.1555}, - { 35.1736, 0.473204, 22.7181, 2.73848, 14.7635, - 11.553, 2.28678, 20.9303, 13.0582}, - { 36.6706, 0.483629, 24.0992, 3.20647, 17.3415, - 14.3136, 3.49331, 102.273, 13.3592}, - { 36.6488, 0.465154, 24.4096, 3.08997, 17.399, - 13.4346, 4.21665, 88.4834, 13.2887}, - { 36.7881, 0.451018, 24.7736, 3.04619, 17.8919, - 12.8946, 4.23284, 86.003, 13.2754}, - { 36.9185, 0.437533, 25.1995, 3.00775, 18.3317, - 12.4044, 4.24391, 83.7881, 13.2674}, - }; + {0.489918, 20.6593, 0.262003, 7.74039, 0.196767, 49.5519, 0.049879, 2.20159, 0.001305}, + {0.897661, 53.1368, 0.565616, 15.187, 0.415815, 186.576, 0.116973, 3.56709, 0.002389}, + {0.8734, 9.1037, 0.6309, 3.3568, 0.3112, 22.9276, 0.178, 0.9821, 0.0064}, + {1.1282, 3.9546, 0.7508, 1.0524, 0.6175, 85.3905, 0.4653, 68.261, 0.0377}, + {0.6968, 4.6237, 0.7888, 1.9557, 0.3414, 0.6316, 0.7029, 0.542, 0.0167}, + {1.5919, 43.6427, 1.1278, 1.8623, 0.5391, 103.483, 0.7029, 0.542, 0.0385}, + {6.2603, 0.0027, 0.8849, 0.8313, 0.7993, 2.2758, 0.1647, 5.1146, -6.1092}, + {2.0545, 23.2185, 1.3326, 1.021, 1.0979, 60.3498, 0.7068, 0.1403, -0.1932}, + {2.31, 20.8439, 1.02, 10.2075, 1.5886, 0.5687, 0.865, 51.6512, 0.2156}, + {2.26069, 22.6907, 1.56165, 0.656665, 1.05075, 9.75618, 0.839259, 55.5949, 0.286977}, + {12.2126, 0.0057, 3.1322, 9.8933, 2.0125, 28.9975, 1.1663, 0.5826, -11.529}, + {3.0485, 13.2771, 2.2868, 5.7011, 1.5463, 0.3239, 0.867, 32.9089, 0.2508}, + {4.1916, 12.8573, 1.63969, 4.17236, 1.52673, -47.0179, 20.307, -0.01404, 21.9412}, + {3.5392, 10.2825, 2.6412, 4.2944, 1.517, 0.2615, 1.0243, 26.1476, 0.2776}, + {3.6322, 5.27756, 3.51057, 14.7353, 1.26064, 0.442258, 0.940706, 47.3437, 0.653396}, + {3.9553, 8.4042, 3.1125, 3.4262, 1.4546, 0.2306, 1.1251, 21.7184, 0.3515}, + {4.7626, 3.285, 3.1736, 8.8422, 1.2674, 0.3136, 1.1128, 129.424, 0.676}, + {3.2565, 2.6671, 3.9362, 6.1153, 1.3998, 0.2001, 1.0032, 14.039, 0.404}, + {5.4204, 2.8275, 2.1735, 79.2611, 1.2269, 0.3808, 2.3073, 7.1937, 0.8584}, + {3.4988, 2.1676, 3.8378, 4.7542, 1.3284, 0.185, 0.8497, 10.1411, 0.4853}, + {6.4202, 3.0387, 1.9002, 0.7426, 1.5936, 31.5472, 1.9646, 85.0886, 1.1151}, + {4.17448, 1.93816, 3.3876, 4.14553, 1.20296, 0.228753, 0.528137, 8.28524, 0.706786}, + {6.2915, 2.4386, 3.0353, 32.3337, 1.9891, 0.6785, 1.541, 81.6937, 1.1407}, + {5.66269, 2.6652, 3.07164, 38.6634, 2.62446, 0.916946, 1.3932, 93.5458, 1.24707}, + {4.43918, 1.64167, 3.20345, 3.43757, 1.19453, 0.2149, 0.41653, 6.65365, 0.746297}, + {6.4345, 1.9067, 4.1791, 27.157, 1.78, 0.526, 1.4908, 68.1645, 1.1149}, + {6.9053, 1.4679, 5.2034, 22.2151, 1.4379, 0.2536, 1.5863, 56.172, 0.8669}, + {11.4604, 0.0104, 7.1964, 1.1662, 6.2556, 18.5194, 1.6455, 47.7784, -9.5574}, + {18.2915, 0.0066, 7.2084, 1.1717, 6.5337, 19.5424, 2.3386, 60.4486, -16.378}, + {7.4845, 0.9072, 6.7723, 14.8407, 0.6539, 43.8983, 1.6442, 33.3929, 1.4445}, + {8.2186, 12.7949, 7.4398, 0.7748, 1.0519, 213.187, 0.8659, 41.6841, 1.4228}, + {8.6266, 10.4421, 7.3873, 0.6599, 1.5899, 85.7484, 1.0211, 178.437, 1.3751}, + {15.6348, -0.0074, 7.9518, 0.6089, 8.4372, 10.3116, 0.8537, 25.9905, -14.875}, + {9.189, 9.0213, 7.3679, 0.5729, 1.6409, 136.108, 1.468, 51.3531, 1.3329}, + {13.4008, 0.29854, 8.0273, 7.9629, 1.65943, -0.28604, 1.57936, 16.0662, -6.6667}, + {9.7595, 7.8508, 7.3558, 0.5, 1.6991, 35.6338, 1.9021, 116.105, 1.2807}, + {9.11423, 7.5243, 7.62174, 0.457585, 2.2793, 19.5361, 0.087899, 61.6558, 0.897155}, + {17.7344, 0.22061, 8.73816, 7.04716, 5.25691, -0.15762, 1.92134, 15.9768, -14.652}, + {19.5114, 0.178847, 8.23473, 6.67018, 2.01341, -0.29263, 1.5208, 12.9464, -13.28}, + {10.2971, 6.8657, 7.3511, 0.4385, 2.0703, 26.8938, 2.0571, 102.478, 1.2199}, + {10.106, 6.8818, 7.3541, 0.4409, 2.2884, 20.3004, 0.0223, 115.122, 1.2298}, + {9.43141, 6.39535, 7.7419, 0.383349, 2.15343, 15.1908, 0.016865, 63.969, 0.656565}, + {15.6887, 0.679003, 8.14208, 5.40135, 2.03081, 9.97278, -9.576, 0.940464, 1.7143}, + {10.6406, 6.1038, 7.3537, 0.392, 3.324, 20.2626, 1.4922, 98.7399, 1.1832}, + {9.54034, 5.66078, 7.7509, 0.344261, 3.58274, 13.3075, 0.509107, 32.4224, 0.616898}, + {9.6809, 5.59463, 7.81136, 0.334393, 2.87603, 12.8288, 0.113575, 32.8761, 0.518275}, + {11.2819, 5.3409, 7.3573, 0.3432, 3.0193, 17.8674, 2.2441, 83.7543, 1.0896}, + {10.8061, 5.2796, 7.362, 0.3435, 3.5268, 14.343, 0.2184, 41.3235, 1.0874}, + {9.84521, 4.91797, 7.87194, 0.294393, 3.56531, 10.8171, 0.323613, 24.1281, 0.393974}, + {9.96253, 4.8485, 7.97057, 0.283303, 2.76067, 10.4852, 0.054447, 27.573, 0.251877}, + {11.7695, 4.7611, 7.3573, 0.3072, 3.5222, 15.3535, 2.3045, 76.8805, 1.0369}, + {11.0424, 4.6538, 7.374, 0.3053, 4.1346, 12.0546, 0.4399, 31.2809, 1.0097}, + {11.1764, 4.6147, 7.3863, 0.3005, 3.3948, 11.6729, 0.0724, 38.5566, 0.9707}, + {12.2841, 4.2791, 7.3409, 0.2784, 4.0034, 13.5359, 2.3488, 71.1692, 1.0118}, + {11.2296, 4.1231, 7.3883, 0.2726, 4.7393, 10.2443, 0.7108, 25.6466, 0.9324}, + {10.338, 3.90969, 7.88173, 0.238668, 4.76795, 8.35583, 0.725591, 18.3491, 0.286667}, + {12.8376, 3.8785, 7.292, 0.2565, 4.4438, 12.1763, 2.38, 66.3421, 1.0341}, + {11.4166, 3.6766, 7.4005, 0.2449, 5.3442, 8.873, 0.9773, 22.1626, 0.8614}, + {10.7806, 3.5477, 7.75868, 0.22314, 5.22746, 7.64468, 0.847114, 16.9673, 0.386044}, + {13.338, 3.5828, 7.1676, 0.247, 5.6158, 11.3966, 1.6735, 64.8126, 1.191}, + {11.9475, 3.3669, 7.3573, 0.2274, 6.2455, 8.6625, 1.5578, 25.8487, 0.89}, + {11.8168, 3.37484, 7.11181, 0.244078, 5.78135, 7.9876, 1.14523, 19.897, 1.14431}, + {14.0743, 3.2655, 7.0318, 0.2333, 5.1652, 10.3163, 2.41, 58.7097, 1.3041}, + {11.9719, 2.9946, 7.3862, 0.2031, 6.4668, 7.0826, 1.394, 18.0995, 0.7807}, + {15.2354, 3.0669, 6.7006, 0.2412, 4.3591, 10.7805, 2.9623, 61.4135, 1.7189}, + {12.692, 2.81262, 6.69883, 0.22789, 6.06692, 6.36441, 1.0066, 14.4122, 1.53545}, + {16.0816, 2.8509, 6.3747, 0.2516, 3.7068, 11.4468, 3.683, 54.7625, 2.1313}, + {12.9172, 2.53718, 6.70003, 0.205855, 6.06791, 5.47913, 0.859041, 11.603, 1.45572}, + {16.6723, 2.6345, 6.0701, 0.2647, 3.4313, 12.9479, 4.2779, 47.7972, 2.531}, + {17.0006, 2.4098, 5.8196, 0.2726, 3.9731, 15.2372, 4.3543, 43.8163, 2.8409}, + {17.1789, 2.1723, 5.2358, 16.5796, 5.6377, 0.2609, 3.9851, 41.4328, 2.9557}, + {17.1718, 2.2059, 6.3338, 19.3345, 5.5754, 0.2871, 3.7272, 58.1535, 3.1776}, + {17.3555, 1.9384, 6.7286, 16.5623, 5.5493, 0.2261, 3.5375, 39.3972, 2.825}, + {17.1784, 1.7888, 9.6435, 17.3151, 5.1399, 0.2748, 1.5292, 164.934, 3.4873}, + {17.5816, 1.7139, 7.6598, 14.7957, 5.8981, 0.1603, 2.7817, 31.2087, 2.0782}, + {17.5663, 1.5564, 9.8184, 14.0988, 5.422, 0.1664, 2.6694, 132.376, 2.5064}, + {18.0874, 1.4907, 8.1373, 12.6963, 2.5654, -24.5651, 34.193, -0.0138, 41.4025}, + {17.776, 1.4029, 10.2946, 12.8006, 5.72629, 0.125599, 3.26588, 104.354, 1.91213}, + {17.9268, 1.35417, 9.1531, 11.2145, 1.76795, -22.6599, 33.108, -0.01319, 40.2602}, + {17.8765, 1.27618, 10.948, 11.916, 5.41732, 0.117622, 3.65721, 87.6627, 2.06929}, + {18.1668, 1.2148, 10.0562, 10.1483, 1.01118, 21.6054, -2.6479, -0.10276, 9.41454}, + {17.6142, 1.18865, 12.0144, 11.766, 4.04183, 0.204785, 3.53346, 69.7957, 3.75591}, + {19.8812, 0.019175, 18.0653, 1.13305, 11.0177, 10.1621, 1.94715, 28.3389, -12.912}, + {17.9163, 1.12446, 13.3417, 0.028781, 10.799, 9.28206, 0.337905, 25.7228, -6.3934}, + {3.7025, 0.2772, 17.2356, 1.0958, 12.8876, 11.004, 3.7429, 61.6584, 4.3875}, + {21.1664, 0.014734, 18.2017, 1.03031, 11.7423, 9.53659, 2.30951, 26.6307, -14.421}, + {21.0149, 0.014345, 18.0992, 1.02238, 11.4632, 8.78809, 0.740625, 23.3452, -14.316}, + {17.8871, 1.03649, 11.175, 8.48061, 6.57891, 0.058881, 0, 0, 0.344941}, + {19.1301, 0.864132, 11.0948, 8.14487, 4.64901, 21.5707, 2.71263, 86.8472, 5.40428}, + {19.2674, 0.80852, 12.9182, 8.43467, 4.86337, 24.7997, 1.56756, 94.2928, 5.37814}, + {18.5638, 0.847329, 13.2885, 8.37164, 9.32602, 0.017662, 3.00964, 22.887, -3.1892}, + {18.5003, 0.844582, 13.1787, 8.12534, 4.71304, 0.36495, 2.18535, 20.8504, 1.42357}, + {19.2957, 0.751536, 14.3501, 8.21758, 4.73425, 25.8749, 1.28918, 98.6062, 5.328}, + {18.8785, 0.764252, 14.1259, 7.84438, 3.32515, 21.2487, -6.1989, -0.01036, 11.8678}, + {18.8545, 0.760825, 13.9806, 7.62436, 2.53464, 19.3317, -5.6526, -0.0102, 11.2835}, + {19.3319, 0.698655, 15.5017, 7.98929, 5.29537, 25.2052, 0.605844, 76.8986, 5.26593}, + {19.1701, 0.696219, 15.2096, 7.55573, 4.32234, 22.5057, 0, 0, 5.2916}, + {19.2493, 0.683839, 14.79, 7.14833, 2.89289, 17.9144, -7.9492, 0.005127, 13.0174}, + {19.2808, 0.6446, 16.6885, 7.4726, 4.8045, 24.6605, 1.0463, 99.8156, 5.179}, + {19.1812, 0.646179, 15.9719, 7.19123, 5.27475, 21.7326, 0.357534, 66.1147, 5.21572}, + {19.1643, 0.645643, 16.2456, 7.18544, 4.3709, 21.4072, 0, 0, 5.21404}, + {19.2214, 0.5946, 17.6444, 6.9089, 4.461, 24.7008, 1.6029, 87.4825, 5.0694}, + {19.1514, 0.597922, 17.2535, 6.80639, 4.47128, 20.2521, 0, 0, 5.11937}, + {19.1624, 0.5476, 18.5596, 6.3776, 4.2948, 25.8499, 2.0396, 92.8029, 4.9391}, + {19.1045, 0.551522, 18.1108, 6.3247, 3.78897, 17.3595, 0, 0, 4.99635}, + {19.1889, 5.8303, 19.1005, 0.5031, 4.4585, 26.8909, 2.4663, 83.9571, 4.7821}, + {19.1094, 0.5036, 19.0548, 5.8378, 4.5648, 23.3752, 0.487, 62.2061, 4.7861}, + {18.9333, 5.764, 19.7131, 0.4655, 3.4182, 14.0049, 0.0193, -0.7583, 3.9182}, + {19.6418, 5.3034, 19.0455, 0.4607, 5.0371, 27.9074, 2.6827, 75.2825, 4.5909}, + {18.9755, 0.467196, 18.933, 5.22126, 5.10789, 19.5902, 0.288753, 55.5113, 4.69626}, + {19.8685, 5.44853, 19.0302, 0.467973, 2.41253, 14.1259, 0, 0, 4.69263}, + {19.9644, 4.81742, 19.0138, 0.420885, 6.14487, 28.5284, 2.5239, 70.8403, 4.352}, + {20.1472, 4.347, 18.9949, 0.3814, 7.5138, 27.766, 2.2735, 66.8776, 4.0712}, + {20.2332, 4.3579, 18.997, 0.3815, 7.8069, 29.5259, 2.8868, 84.9304, 4.0714}, + {20.2933, 3.9282, 19.0298, 0.344, 8.9767, 26.4659, 1.99, 64.2658, 3.7118}, + {20.3892, 3.569, 19.1062, 0.3107, 10.662, 24.3879, 1.4953, 213.904, 3.3352}, + {20.3524, 3.552, 19.1278, 0.3086, 10.2821, 23.7128, 0.9615, 59.4565, 3.2791}, + {20.3361, 3.216, 19.297, 0.2756, 10.888, 20.2073, 2.6959, 167.202, 2.7731}, + {20.1807, 3.21367, 19.1136, 0.28331, 10.9054, 20.0558, 0.77634, 51.746, 3.02902}, + {20.578, 2.94817, 19.599, 0.244475, 11.3727, 18.7726, 3.28719, 133.124, 2.14678}, + {20.2489, 2.9207, 19.3763, 0.250698, 11.6323, 17.8211, 0.336048, 54.9453, 2.4086}, + {21.1671, 2.81219, 19.7695, 0.226836, 11.8513, 17.6083, 3.33049, 127.113, 1.86264}, + {20.8036, 2.77691, 19.559, 0.23154, 11.9369, 16.5408, 0.612376, 43.1692, 2.09013}, + {20.3235, 2.65941, 19.8186, 0.21885, 12.1233, 15.7992, 0.144583, 62.2355, 1.5918}, + {22.044, 2.77393, 19.6697, 0.222087, 12.3856, 16.7669, 2.82428, 143.644, 2.0583}, + {21.3727, 2.6452, 19.7491, 0.214299, 12.1329, 15.323, 0.97518, 36.4065, 1.77132}, + {20.9413, 2.54467, 20.0539, 0.202481, 12.4668, 14.8137, 0.296689, 45.4643, 1.24285}, + {22.6845, 2.66248, 19.6847, 0.210628, 12.774, 15.885, 2.85137, 137.903, 1.98486}, + {21.961, 2.52722, 19.9339, 0.199237, 12.12, 14.1783, 1.51031, 30.8717, 1.47588}, + {23.3405, 2.5627, 19.6095, 0.202088, 13.1235, 15.1009, 2.87516, 132.721, 2.02876}, + {22.5527, 2.4174, 20.1108, 0.185769, 12.0671, 13.1275, 2.07492, 27.4491, 1.19499}, + {24.0042, 2.47274, 19.4258, 0.196451, 13.4396, 14.3996, 2.89604, 128.007, 2.20963}, + {23.1504, 2.31641, 20.2599, 0.174081, 11.9202, 12.1571, 2.71488, 24.8242, 0.954586}, + {24.6274, 2.3879, 19.0886, 0.1942, 13.7603, 13.7546, 2.9227, 123.174, 2.5745}, + {24.0063, 2.27783, 19.9504, 0.17353, 11.8034, 11.6096, 3.87243, 26.5156, 1.36389}, + {23.7497, 2.22258, 20.3745, 0.16394, 11.8509, 11.311, 3.26503, 22.9966, 0.759344}, + {25.0709, 2.25341, 19.0798, 0.181951, 13.8518, 12.9331, 3.54545, 101.398, 2.4196}, + {24.3466, 2.13553, 20.4208, 0.155525, 11.8708, 10.5782, 3.7149, 21.7029, 0.645089}, + {25.8976, 2.24256, 18.2185, 0.196143, 14.3167, 12.6648, 2.95354, 115.362, 3.58324}, + {24.9559, 2.05601, 20.3271, 0.149525, 12.2471, 10.0499, 3.773, 21.2773, 0.691967}, + {26.507, 2.1802, 17.6383, 0.202172, 14.5596, 12.1899, 2.96577, 111.874, 4.29728}, + {25.5395, 1.9804, 20.2861, 0.143384, 11.9812, 9.34972, 4.50073, 19.581, 0.68969}, + {26.9049, 2.07051, 17.294, 0.19794, 14.5583, 11.4407, 3.63837, 92.6566, 4.56796}, + {26.1296, 1.91072, 20.0994, 0.139358, 11.9788, 8.80018, 4.93676, 18.5908, 0.852795}, + {27.6563, 2.07356, 16.4285, 0.223545, 14.9779, 11.3604, 2.98233, 105.703, 5.92046}, + {26.722, 1.84659, 19.7748, 0.13729, 12.1506, 8.36225, 5.17379, 17.8974, 1.17613}, + {28.1819, 2.02859, 15.8851, 0.238849, 15.1542, 10.9975, 2.98706, 102.961, 1.63929}, + {27.3083, 1.78711, 19.332, 0.136974, 12.3339, 7.96778, 5.38348, 17.2922, 1.63929}, + {28.6641, 1.9889, 15.4345, 0.257119, 15.3087, 10.6647, 2.98963, 100.417, 7.56672}, + {28.1209, 1.78503, 17.6817, 0.15997, 13.3335, 8.18304, 5.14657, 20.39, 3.70983}, + {27.8917, 1.73272, 18.7614, 0.13879, 12.6072, 7.64412, 5.47647, 16.8153, 2.26001}, + {28.9476, 1.90182, 15.2208, 9.98519, 15.1, 0.261033, 3.71601, 84.3298, 7.97628}, + {28.4628, 1.68216, 18.121, 0.142292, 12.8429, 7.33727, 5.59415, 16.3535, 2.97573}, + {29.144, 1.83262, 15.1726, 9.5999, 14.7586, 0.275116, 4.30013, 72.029, 8.58154}, + {28.8131, 1.59136, 18.4601, 0.128903, 12.7285, 6.76232, 5.59927, 14.0366, 2.39699}, + {29.2024, 1.77333, 15.2293, 9.37046, 14.5135, 0.295977, 4.76492, 63.3644, 9.24354}, + {29.1587, 1.50711, 18.8407, 0.116741, 12.8268, 6.31524, 5.38695, 12.4244, 1.78555}, + {29.0818, 1.72029, 15.43, 9.2259, 14.4327, 0.321703, 5.11982, 57.056, 9.8875}, + {29.4936, 1.42755, 19.3763, 0.104621, 13.0544, 5.93667, 5.06412, 11.1972, 1.01074}, + {28.7621, 1.67191, 15.7189, 9.09227, 14.5564, 0.3505, 5.44174, 52.0861, 10.472}, + {28.1894, 1.62903, 16.155, 8.97948, 14.9305, 0.382661, 5.67589, 48.1647, 11.0005}, + {30.419, 1.37113, 15.2637, 6.84706, 14.7458, 0.165191, 5.06795, 18.003, 6.49804}, + {27.3049, 1.59279, 16.7296, 8.86553, 15.6115, 0.417916, 5.83377, 45.0011, 11.4722}, + {30.4156, 1.34323, 15.862, 7.10909, 13.6145, 0.204633, 5.82008, 20.3254, 8.27903}, + {30.7058, 1.30923, 15.5512, 6.71983, 14.2326, 0.167252, 5.53672, 17.4911, 6.96824}, + {27.0059, 1.51293, 17.7639, 8.81174, 15.7131, 0.424593, 5.7837, 38.6103, 11.6883}, + {29.8429, 1.32927, 16.7224, 7.38979, 13.2153, 0.263297, 6.35234, 22.9426, 9.85329}, + {30.9612, 1.24813, 15.9829, 6.60834, 13.7348, 0.16864, 5.92034, 16.9392, 7.39534}, + {16.8819, 0.4611, 18.5913, 8.6216, 25.5582, 1.4826, 5.86, 36.3956, 12.0658}, + {28.0109, 1.35321, 17.8204, 7.7395, 14.3359, 0.356752, 6.58077, 26.4043, 11.2299}, + {30.6886, 1.2199, 16.9029, 6.82872, 12.7801, 0.212867, 6.52354, 18.659, 9.0968}, + {20.6809, 0.545, 19.0417, 8.4484, 21.6575, 1.5729, 5.9676, 38.3246, 12.6089}, + {25.0853, 1.39507, 18.4973, 7.65105, 16.8883, 0.443378, 6.48216, 28.2262, 12.0205}, + {29.5641, 1.21152, 18.06, 7.05639, 12.8374, 0.284738, 6.89912, 20.7482, 10.6268}, + {27.5446, 0.65515, 19.1584, 8.70751, 15.538, 1.96347, 5.52593, 45.8149, 13.1746}, + {21.3985, 1.4711, 20.4723, 0.517394, 18.7478, 7.43463, 6.82847, 28.8482, 12.5258}, + {30.8695, 1.1008, 18.3481, 6.53852, 11.9328, 0.219074, 7.00574, 17.2114, 9.8027}, + {31.0617, 0.6902, 13.0637, 2.3576, 18.442, 8.618, 5.9696, 47.2579, 13.4118}, + {21.7886, 1.3366, 19.5682, 0.488383, 19.1406, 6.7727, 7.01107, 23.8132, 12.4734}, + {32.1244, 1.00566, 18.8003, 6.10926, 12.0175, 0.147041, 6.96886, 14.714, 8.08428}, + {33.3689, 0.704, 12.951, 2.9238, 16.5877, 8.7937, 6.4692, 48.0093, 13.5782}, + {21.8053, 1.2356, 19.5026, 6.24149, 19.1053, 0.469999, 7.10295, 20.3185, 12.4711}, + {33.5364, 0.91654, 25.0946, 0.39042, 19.2497, 5.71414, 6.91555, 12.8285, 6.7994}, + {34.6726, 0.700999, 15.4733, 3.55078, 13.1138, 9.55642, 7.02588, 47.0045, 13.677}, + {35.3163, 0.68587, 19.0211, 3.97458, 9.49887, 11.3824, 7.42518, 45.4715, 13.7108}, + {35.5631, 0.6631, 21.2816, 4.0691, 8.0037, 14.0422, 7.4433, 44.2473, 13.6905}, + {35.9299, 0.646453, 23.0547, 4.17619, 12.1439, 23.1052, 2.11253, 150.645, 13.7247}, + {35.763, 0.616341, 22.9064, 3.87135, 12.4739, 19.9887, 3.21097, 142.325, 13.6211}, + {35.215, 0.604909, 21.67, 3.5767, 7.91342, 12.601, 7.65078, 29.8436, 13.5431}, + {35.6597, 0.589092, 23.1032, 3.65155, 12.5977, 18.599, 4.08655, 117.02, 13.5266}, + {35.1736, 0.579689, 22.1112, 3.41437, 8.19216, 12.9187, 7.05545, 25.9443, 13.4637}, + {35.5645, 0.563359, 23.4219, 3.46204, 12.7473, 17.8309, 4.80703, 99.1722, 13.4314}, + {35.1007, 0.555054, 22.4418, 3.24498, 9.78554, 13.4661, 5.29444, 23.9533, 13.376}, + {35.8847, 0.547751, 23.2948, 3.41519, 14.1891, 16.9235, 4.17287, 105.251, 13.4287}, + {36.0228, 0.5293, 23.4128, 3.3253, 14.9491, 16.0927, 4.188, 100.613, 13.3966}, + {35.5747, 0.52048, 22.5259, 3.12293, 12.2165, 12.7148, 5.37073, 26.3394, 13.3092}, + {35.3715, 0.516598, 22.5326, 3.05053, 12.0291, 12.5723, 4.7984, 23.4582, 13.2671}, + {34.8509, 0.507079, 22.7584, 2.8903, 14.0099, 13.1767, 1.21457, 25.2017, 13.1665}, + {36.1874, 0.511929, 23.5964, 3.25396, 15.6402, 15.3622, 4.1855, 97.4908, 13.3573}, + {35.7074, 0.502322, 22.613, 3.03807, 12.9898, 12.1449, 5.43227, 25.4928, 13.2544}, + {35.5103, 0.498626, 22.5787, 2.96627, 12.7766, 11.9484, 4.92159, 22.7502, 13.2116}, + {35.0136, 0.48981, 22.7286, 2.81099, 14.3884, 12.33, 1.75669, 22.6581, 13.113}, + {36.5254, 0.499384, 23.8083, 3.26371, 16.7707, 14.9455, 3.47947, 105.98, 13.3812}, + {35.84, 0.484938, 22.7169, 2.96118, 13.5807, 11.5331, 5.66016, 24.3992, 13.1991}, + {35.6493, 0.481422, 22.646, 2.8902, 13.3595, 11.316, 5.18831, 21.8301, 13.1555}, + {35.1736, 0.473204, 22.7181, 2.73848, 14.7635, 11.553, 2.28678, 20.9303, 13.0582}, + {36.6706, 0.483629, 24.0992, 3.20647, 17.3415, 14.3136, 3.49331, 102.273, 13.3592}, + {36.6488, 0.465154, 24.4096, 3.08997, 17.399, 13.4346, 4.21665, 88.4834, 13.2887}, + {36.7881, 0.451018, 24.7736, 3.04619, 17.8919, 12.8946, 4.23284, 86.003, 13.2754}, + {36.9185, 0.437533, 25.1995, 3.00775, 18.3317, 12.4044, 4.24391, 83.7881, 13.2674}, +}; #endif diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.cpp b/src/USER-DIFFRACTION/fix_saed_vtk.cpp index 39c0ddc9d1..2e7d0897a6 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.cpp +++ b/src/USER-DIFFRACTION/fix_saed_vtk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.h b/src/USER-DIFFRACTION/fix_saed_vtk.h index 83c7161275..07aebce63d 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.h +++ b/src/USER-DIFFRACTION/fix_saed_vtk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(saed/vtk,FixSAEDVTK) - +// clang-format off +FixStyle(saed/vtk,FixSAEDVTK); +// clang-format on #else #ifndef LMP_FIX_SAED_VTK_H @@ -35,19 +35,18 @@ class FixSAEDVTK : public Fix { double compute_vector(int); void reset_timestep(bigint); - private: - int nrepeat,nfreq,irepeat; + int nrepeat, nfreq, irepeat; bigint nvalid; char *ids; FILE *fp; int nrows; - int ave,nwindow,nsum,startstep; + int ave, nwindow, nsum, startstep; int overwrite; long filepos; - int norm,iwindow,window_limit; + int norm, iwindow, window_limit; double *vector; double *vector_total; double **vector_list; @@ -60,27 +59,26 @@ class FixSAEDVTK : public Fix { class ComputeSAED *compute_saed; - double Zone[3]; // Zone axis to view SAED - double R_Ewald; // Radius of Ewald sphere (distance units) - double lambda; // Radiation wavelenght (distance units) - double dK[3]; // spacing of reciprocal points in each dimension - int Knmax[3]; // maximum integer value for K points in each dimension - int Knmin[3]; // minimum integer value for K points in each dimension + double Zone[3]; // Zone axis to view SAED + double R_Ewald; // Radius of Ewald sphere (distance units) + double lambda; // Radiation wavelenght (distance units) + double dK[3]; // spacing of reciprocal points in each dimension + int Knmax[3]; // maximum integer value for K points in each dimension + int Knmin[3]; // minimum integer value for K points in each dimension - int KnSlice[6]; // min 0-2 max 2-5 hkl index using zone - double Kmax; // Maximum reciprocal distance to explore - double c[3]; // Parameters controlling resolution of reciprocal space explored - double dR_Ewald; // Thickness of Ewald sphere slice - double prd_inv[3]; // Inverse spacing of unit cell - - char *filename; // user-specified file - int nOutput; - int Dim[3]; - bool manual; // Turn on manual recpiprocal map + int KnSlice[6]; // min 0-2 max 2-5 hkl index using zone + double Kmax; // Maximum reciprocal distance to explore + double c[3]; // Parameters controlling resolution of reciprocal space explored + double dR_Ewald; // Thickness of Ewald sphere slice + double prd_inv[3]; // Inverse spacing of unit cell + char *filename; // user-specified file + int nOutput; + int Dim[3]; + bool manual; // Turn on manual recpiprocal map }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/atom_vec_dpd.cpp b/src/USER-DPD/atom_vec_dpd.cpp index 0560d190d2..461b1d2246 100644 --- a/src/USER-DPD/atom_vec_dpd.cpp +++ b/src/USER-DPD/atom_vec_dpd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/atom_vec_dpd.h b/src/USER-DPD/atom_vec_dpd.h index ea3fb6abf0..3a4e4ecec1 100644 --- a/src/USER-DPD/atom_vec_dpd.h +++ b/src/USER-DPD/atom_vec_dpd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(dpd,AtomVecDPD) - +// clang-format off +AtomStyle(dpd,AtomVecDPD); +// clang-format on #else #ifndef LMP_ATOM_VEC_DPD_H @@ -32,13 +32,13 @@ class AtomVecDPD : public AtomVec { void unpack_restart_init(int); void data_atom_post(int); -private: - double *rho,*dpdTheta; - double *uCond,*uMech,*uChem; - double *uCG,*uCGnew; + private: + double *rho, *dpdTheta; + double *uCond, *uMech, *uChem; + double *uCG, *uCGnew; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/compute_dpd.cpp b/src/USER-DPD/compute_dpd.cpp index 437d4c9bc6..f6848b9834 100644 --- a/src/USER-DPD/compute_dpd.cpp +++ b/src/USER-DPD/compute_dpd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/compute_dpd.h b/src/USER-DPD/compute_dpd.h index a77e19bee8..e010ad8288 100644 --- a/src/USER-DPD/compute_dpd.h +++ b/src/USER-DPD/compute_dpd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(dpd,ComputeDpd) - +// clang-format off +ComputeStyle(dpd,ComputeDpd); +// clang-format on #else #ifndef LMP_COMPUTE_DPD_H @@ -33,10 +33,9 @@ class ComputeDpd : public Compute { private: double *dpdU; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/compute_dpd_atom.cpp b/src/USER-DPD/compute_dpd_atom.cpp index 9053d8af31..f881612447 100644 --- a/src/USER-DPD/compute_dpd_atom.cpp +++ b/src/USER-DPD/compute_dpd_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/compute_dpd_atom.h b/src/USER-DPD/compute_dpd_atom.h index cbc913d628..7525e1cfab 100644 --- a/src/USER-DPD/compute_dpd_atom.h +++ b/src/USER-DPD/compute_dpd_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(dpd/atom,ComputeDpdAtom) - +// clang-format off +ComputeStyle(dpd/atom,ComputeDpdAtom); +// clang-format on #else #ifndef LMP_COMPUTE_DPD_ATOM_H @@ -37,7 +37,7 @@ class ComputeDpdAtom : public Compute { double **dpdAtom; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/fix_dpd_energy.cpp b/src/USER-DPD/fix_dpd_energy.cpp index dae250203d..f980e41157 100644 --- a/src/USER-DPD/fix_dpd_energy.cpp +++ b/src/USER-DPD/fix_dpd_energy.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/fix_dpd_energy.h b/src/USER-DPD/fix_dpd_energy.h index c7160596bf..7a463f64a0 100644 --- a/src/USER-DPD/fix_dpd_energy.h +++ b/src/USER-DPD/fix_dpd_energy.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(dpd/energy,FixDPDenergy) - +// clang-format off +FixStyle(dpd/energy,FixDPDenergy); +// clang-format on #else #ifndef LMP_FIX_DPDE_H @@ -36,7 +36,7 @@ class FixDPDenergy : public Fix { class PairDPDfdtEnergy *pairDPDE; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/fix_eos_cv.cpp b/src/USER-DPD/fix_eos_cv.cpp index 1bcdb9dbc6..396a8b3e32 100644 --- a/src/USER-DPD/fix_eos_cv.cpp +++ b/src/USER-DPD/fix_eos_cv.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/fix_eos_cv.h b/src/USER-DPD/fix_eos_cv.h index 1ca7fbad56..129984b390 100644 --- a/src/USER-DPD/fix_eos_cv.h +++ b/src/USER-DPD/fix_eos_cv.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(eos/cv,FixEOScv) - +// clang-format off +FixStyle(eos/cv,FixEOScv); +// clang-format on #else #ifndef LMP_FIX_EOS_CV_H @@ -37,7 +37,7 @@ class FixEOScv : public Fix { double cvEOS; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/fix_eos_table.cpp b/src/USER-DPD/fix_eos_table.cpp index 0d23f32b4e..c9c23b51f8 100644 --- a/src/USER-DPD/fix_eos_table.cpp +++ b/src/USER-DPD/fix_eos_table.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/fix_eos_table.h b/src/USER-DPD/fix_eos_table.h index 4913250f90..4aad90402a 100644 --- a/src/USER-DPD/fix_eos_table.h +++ b/src/USER-DPD/fix_eos_table.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(eos/table,FixEOStable) - +// clang-format off +FixStyle(eos/table,FixEOStable); +// clang-format on #else #ifndef LMP_FIX_EOS_TABLE_H @@ -36,16 +36,16 @@ class FixEOStable : public Fix { void temperature_lookup(double, double &); protected: - enum{LINEAR}; + enum { LINEAR }; - int tabstyle,tablength; + int tabstyle, tablength; struct Table { int ninput; - double lo,hi; - double *rfile,*efile; + double lo, hi; + double *rfile, *efile; double *e2file; - double delta,invdelta,deltasq6; - double *r,*e,*de,*e2; + double delta, invdelta, deltasq6; + double *r, *e, *de, *e2; }; int ntables; Table *tables; @@ -61,9 +61,8 @@ class FixEOStable : public Fix { void param_extract(Table *, Table *, char *); void spline(double *, double *, int, double, double, double *); double splint(double *, double *, double *, int, double); - - }; -} +}; +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/fix_eos_table_rx.cpp b/src/USER-DPD/fix_eos_table_rx.cpp index 7b0bec93f2..7df5a3d7ce 100644 --- a/src/USER-DPD/fix_eos_table_rx.cpp +++ b/src/USER-DPD/fix_eos_table_rx.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/fix_eos_table_rx.h b/src/USER-DPD/fix_eos_table_rx.h index 07adb1ec41..a2c4d7860e 100644 --- a/src/USER-DPD/fix_eos_table_rx.h +++ b/src/USER-DPD/fix_eos_table_rx.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(eos/table/rx,FixEOStableRX) - +// clang-format off +FixStyle(eos/table/rx,FixEOStableRX); +// clang-format on #else #ifndef LMP_FIX_EOS_TABLE_RX_H @@ -37,16 +37,16 @@ class FixEOStableRX : public Fix { void temperature_lookup(int, double, double &); protected: - enum{LINEAR}; + enum { LINEAR }; - int tabstyle,tablength; + int tabstyle, tablength; struct Table { int ninput; - double lo,hi; - double *rfile,*efile; + double lo, hi; + double *rfile, *efile; double *e2file; - double delta,invdelta,deltasq6; - double *r,*e,*de,*e2; + double delta, invdelta, deltasq6; + double *r, *e, *de, *e2; }; int ntables; Table *tables, *tables2; @@ -67,18 +67,18 @@ class FixEOStableRX : public Fix { void read_file(char *); - double *dHf,*energyCorr,*tempCorrCoeff,*moleculeCorrCoeff; + double *dHf, *energyCorr, *tempCorrCoeff, *moleculeCorrCoeff; int pack_reverse_comm(int, int, double *); void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int , int *, double *, int, int *); - void unpack_forward_comm(int , int , double *); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); int *eosSpecies; int ncolumn; bool rx_flag; - }; -} +}; +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/fix_rx.cpp b/src/USER-DPD/fix_rx.cpp index 4f0f381e6d..52dcaaf2d5 100644 --- a/src/USER-DPD/fix_rx.cpp +++ b/src/USER-DPD/fix_rx.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/fix_rx.h b/src/USER-DPD/fix_rx.h index 6113469274..debf4d911e 100644 --- a/src/USER-DPD/fix_rx.h +++ b/src/USER-DPD/fix_rx.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rx,FixRX) - +// clang-format off +FixStyle(rx,FixRX); +// clang-format on #else #ifndef LMP_FIX_RX_H @@ -41,22 +41,22 @@ class FixRX : public Fix { protected: int pack_reverse_comm(int, int, double *); void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int , int *, double *, int, int *); - void unpack_forward_comm(int , int , double *); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); class NeighList *list; double tmpArg; - int *mol2param; // mapping from molecule to parameters - int nreactions; // # of stored parameter sets - int maxparam; // max # of parameter sets + int *mol2param; // mapping from molecule to parameters + int nreactions; // # of stored parameter sets + int maxparam; // max # of parameter sets struct Param { double cp; int ispecies; - char *name; // names of unique molecules and interaction type + char *name; // names of unique molecules and interaction type }; - Param *params; // parameter set for an I-J-K interaction + Param *params; // parameter set for an I-J-K interaction int nspecies; void read_file(char *); @@ -66,33 +66,30 @@ class FixRX : public Fix { double *kR; //!< Classic Runge-Kutta 4th-order stepper. - void rk4(int, double*, void*); + void rk4(int, double *, void *); //!< Runge-Kutta-Fehlberg ODE Solver. - void rkf45(int, double*, void*, int ode_counter[]); + void rkf45(int, double *, void *, int ode_counter[]); //!< Runge-Kutta-Fehlberg ODE stepper function. - void rkf45_step (const int neq, const double h, double y[], double y_out[], - double rwk[], void *); + void rkf45_step(const int neq, const double h, double y[], double y_out[], double rwk[], void *); //!< Initial step size estimation for the Runge-Kutta-Fehlberg ODE solver. - int rkf45_h0 (const int neq, const double t, const double t_stop, - const double hmin, const double hmax, - double& h0, double y[], double rwk[], void *v_params); + int rkf45_h0(const int neq, const double t, const double t_stop, const double hmin, + const double hmax, double &h0, double y[], double rwk[], void *v_params); class PairDPDfdtEnergy *pairDPDE; double *dpdThetaLocal; double *sumWeights; void computeLocalTemperature(); - int localTempFlag,wtFlag,odeIntegrationFlag; + int localTempFlag, wtFlag, odeIntegrationFlag; double sigFactor; int rhs(double, const double *, double *, void *); - int rhs_dense (double, const double *, double *, void *); + int rhs_dense(double, const double *, double *, void *); // User-defined data container needed in rhs. - struct UserRHSData - { + struct UserRHSData { double *kFor; double *rxnRateLaw; }; @@ -103,24 +100,25 @@ class FixRX : public Fix { void initSparse(void); int rhs_sparse(double, const double *, double *, void *) const; - int sparseKinetics_maxReactants; //dt); - - void ssa_update_dpd(int, int, int); // Constant Temperature - void ssa_update_dpde(int, int, int); // Constant Energy + double dtsqrt; // = sqrt(update->dt); + void ssa_update_dpd(int, int, int); // Constant Temperature + void ssa_update_dpde(int, int, int); // Constant Energy }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/nbin_ssa.cpp b/src/USER-DPD/nbin_ssa.cpp index db3425c259..993a41b356 100644 --- a/src/USER-DPD/nbin_ssa.cpp +++ b/src/USER-DPD/nbin_ssa.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/nbin_ssa.h b/src/USER-DPD/nbin_ssa.h index a814e4c1a2..c09ef7b692 100644 --- a/src/USER-DPD/nbin_ssa.h +++ b/src/USER-DPD/nbin_ssa.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,34 +12,33 @@ ------------------------------------------------------------------------- */ #ifdef NBIN_CLASS - +// clang-format off NBinStyle(ssa, NBinSSA, - NB_STANDARD | NB_SSA) - + NB_STANDARD | NB_SSA); +// clang-format on #else #ifndef LMP_NBIN_SSA_H #define LMP_NBIN_SSA_H -#include -#include "nbin_standard.h" #include "error.h" +#include "nbin_standard.h" +#include namespace LAMMPS_NS { class NBinSSA : public NBinStandard { public: - - int gairhead_ssa[8]; // index of 1st ghost atom in each AIR + int gairhead_ssa[8]; // index of 1st ghost atom in each AIR // Bounds of the local atoms in the binhead array - int lbinxlo; // lowest local bin x-dim coordinate - int lbinylo; // lowest local bin y-dim coordinate - int lbinzlo; // lowest local bin z-dim coordinate - int lbinxhi; // highest local bin x-dim coordinate - int lbinyhi; // highest local bin y-dim coordinate - int lbinzhi; // highest local bin z-dim coordinate + int lbinxlo; // lowest local bin x-dim coordinate + int lbinylo; // lowest local bin y-dim coordinate + int lbinzlo; // lowest local bin z-dim coordinate + int lbinxhi; // highest local bin x-dim coordinate + int lbinyhi; // highest local bin y-dim coordinate + int lbinzhi; // highest local bin z-dim coordinate NBinSSA(class LAMMPS *); ~NBinSSA(); @@ -49,52 +48,51 @@ class NBinSSA : public NBinStandard { double memory_usage(); - inline - int coord2bin(const double & x,const double & y,const double & z, int &ixo, int &iyo, int &izo) const + inline int coord2bin(const double &x, const double &y, const double &z, int &ixo, int &iyo, + int &izo) const { - int ix,iy,iz; + int ix, iy, iz; if (!std::isfinite(x) || !std::isfinite(y) || !std::isfinite(z)) - error->one(FLERR,"Non-numeric positions - simulation unstable"); + error->one(FLERR, "Non-numeric positions - simulation unstable"); if (x >= bboxhi_[0]) - ix = static_cast ((x-bboxhi_[0])*bininvx) + nbinx; + ix = static_cast((x - bboxhi_[0]) * bininvx) + nbinx; else if (x >= bboxlo_[0]) { - ix = static_cast ((x-bboxlo_[0])*bininvx); - ix = MIN(ix,nbinx-1); + ix = static_cast((x - bboxlo_[0]) * bininvx); + ix = MIN(ix, nbinx - 1); } else - ix = static_cast ((x-bboxlo_[0])*bininvx) - 1; + ix = static_cast((x - bboxlo_[0]) * bininvx) - 1; if (y >= bboxhi_[1]) - iy = static_cast ((y-bboxhi_[1])*bininvy) + nbiny; + iy = static_cast((y - bboxhi_[1]) * bininvy) + nbiny; else if (y >= bboxlo_[1]) { - iy = static_cast ((y-bboxlo_[1])*bininvy); - iy = MIN(iy,nbiny-1); + iy = static_cast((y - bboxlo_[1]) * bininvy); + iy = MIN(iy, nbiny - 1); } else - iy = static_cast ((y-bboxlo_[1])*bininvy) - 1; + iy = static_cast((y - bboxlo_[1]) * bininvy) - 1; if (z >= bboxhi_[2]) - iz = static_cast ((z-bboxhi_[2])*bininvz) + nbinz; + iz = static_cast((z - bboxhi_[2]) * bininvz) + nbinz; else if (z >= bboxlo_[2]) { - iz = static_cast ((z-bboxlo_[2])*bininvz); - iz = MIN(iz,nbinz-1); + iz = static_cast((z - bboxlo_[2]) * bininvz); + iz = MIN(iz, nbinz - 1); } else - iz = static_cast ((z-bboxlo_[2])*bininvz) - 1; + iz = static_cast((z - bboxlo_[2]) * bininvz) - 1; ixo = ix - mbinxlo; iyo = iy - mbinylo; izo = iz - mbinzlo; - return (iz-mbinzlo)*mbiny*mbinx + (iy-mbinylo)*mbinx + (ix-mbinxlo); + return (iz - mbinzlo) * mbiny * mbinx + (iy - mbinylo) * mbinx + (ix - mbinxlo); } private: - int coord2ssaAIR(const double *); // map atom coord to an AIR number - double bboxlo_[3],bboxhi_[3]; - + int coord2ssaAIR(const double *); // map atom coord to an AIR number + double bboxlo_[3], bboxhi_[3]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/npair_half_bin_newton_ssa.cpp b/src/USER-DPD/npair_half_bin_newton_ssa.cpp index 2c57367b20..1dfeaac6bb 100644 --- a/src/USER-DPD/npair_half_bin_newton_ssa.cpp +++ b/src/USER-DPD/npair_half_bin_newton_ssa.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/npair_half_bin_newton_ssa.h b/src/USER-DPD/npair_half_bin_newton_ssa.h index 7ed3574c4f..52f3bb5142 100644 --- a/src/USER-DPD/npair_half_bin_newton_ssa.h +++ b/src/USER-DPD/npair_half_bin_newton_ssa.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/newton/ssa, NPairHalfBinNewtonSSA, - NP_HALF | NP_BIN | NP_NEWTON | NP_ORTHO | NP_SSA | NP_GHOST) - + NP_HALF | NP_BIN | NP_NEWTON | NP_ORTHO | NP_SSA | NP_GHOST); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_NEWTON_SSA_H @@ -43,11 +43,12 @@ class NPairHalfBinNewtonSSA : public NPair { NPairHalfBinNewtonSSA(class LAMMPS *); ~NPairHalfBinNewtonSSA(); void build(class NeighList *); + private: int ssa_maxPhaseCt; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/nstencil_half_bin_2d_ssa.cpp b/src/USER-DPD/nstencil_half_bin_2d_ssa.cpp index aca7b9df09..810802e43d 100644 --- a/src/USER-DPD/nstencil_half_bin_2d_ssa.cpp +++ b/src/USER-DPD/nstencil_half_bin_2d_ssa.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/nstencil_half_bin_2d_ssa.h b/src/USER-DPD/nstencil_half_bin_2d_ssa.h index 675bb86532..252a59d806 100644 --- a/src/USER-DPD/nstencil_half_bin_2d_ssa.h +++ b/src/USER-DPD/nstencil_half_bin_2d_ssa.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/bin/2d/ssa, NStencilHalfBin2dSSA, - NS_HALF | NS_BIN | NS_2D | NS_SSA | NS_ORTHO | NS_GHOST) - + NS_HALF | NS_BIN | NS_2D | NS_SSA | NS_ORTHO | NS_GHOST); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_BIN_2D_SSA_H @@ -33,7 +33,7 @@ class NStencilHalfBin2dSSA : public NStencilSSA { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/nstencil_half_bin_3d_ssa.cpp b/src/USER-DPD/nstencil_half_bin_3d_ssa.cpp index 8e33f5414f..9530ea44c6 100644 --- a/src/USER-DPD/nstencil_half_bin_3d_ssa.cpp +++ b/src/USER-DPD/nstencil_half_bin_3d_ssa.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/nstencil_half_bin_3d_ssa.h b/src/USER-DPD/nstencil_half_bin_3d_ssa.h index 67dd8dc05b..97c1b891ae 100644 --- a/src/USER-DPD/nstencil_half_bin_3d_ssa.h +++ b/src/USER-DPD/nstencil_half_bin_3d_ssa.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/bin/3d/ssa, NStencilHalfBin3dSSA, - NS_HALF | NS_BIN | NS_3D | NS_SSA | NS_ORTHO | NS_GHOST) - + NS_HALF | NS_BIN | NS_3D | NS_SSA | NS_ORTHO | NS_GHOST); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_BIN_3D_SSA_H @@ -33,7 +33,7 @@ class NStencilHalfBin3dSSA : public NStencilSSA { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/nstencil_ssa.h b/src/USER-DPD/nstencil_ssa.h index 2e0de390f2..6cb0868c19 100644 --- a/src/USER-DPD/nstencil_ssa.h +++ b/src/USER-DPD/nstencil_ssa.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -28,7 +28,7 @@ class NStencilSSA : public NStencil { int nstencil_ssa[5]; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-DPD/pair_dpd_fdt.cpp b/src/USER-DPD/pair_dpd_fdt.cpp index 4feb5a53ce..1205ddc94c 100644 --- a/src/USER-DPD/pair_dpd_fdt.cpp +++ b/src/USER-DPD/pair_dpd_fdt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/pair_dpd_fdt.h b/src/USER-DPD/pair_dpd_fdt.h index 768b264a40..d721b056db 100644 --- a/src/USER-DPD/pair_dpd_fdt.h +++ b/src/USER-DPD/pair_dpd_fdt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dpd/fdt,PairDPDfdt) - +// clang-format off +PairStyle(dpd/fdt,PairDPDfdt); +// clang-format on #else #ifndef LMP_PAIR_DPD_FDT_H @@ -53,10 +53,9 @@ class PairDPDfdt : public Pair { bool a0_is_zero; void allocate(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/pair_dpd_fdt_energy.cpp b/src/USER-DPD/pair_dpd_fdt_energy.cpp index a97abcc84c..9d506ebb84 100644 --- a/src/USER-DPD/pair_dpd_fdt_energy.cpp +++ b/src/USER-DPD/pair_dpd_fdt_energy.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/pair_dpd_fdt_energy.h b/src/USER-DPD/pair_dpd_fdt_energy.h index 5692b5a836..28fdc06de6 100644 --- a/src/USER-DPD/pair_dpd_fdt_energy.h +++ b/src/USER-DPD/pair_dpd_fdt_energy.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dpd/fdt/energy,PairDPDfdtEnergy) - +// clang-format off +PairStyle(dpd/fdt/energy,PairDPDfdtEnergy); +// clang-format on #else #ifndef LMP_PAIR_DPD_FDT_ENERGY_H @@ -43,8 +43,8 @@ class PairDPDfdtEnergy : public Pair { double **cut; double **a0; - double **sigma,**kappa,**alpha; - double *duCond,*duMech; + double **sigma, **kappa, **alpha; + double *duCond, *duMech; int seed; class RanMars *random; @@ -55,10 +55,9 @@ class PairDPDfdtEnergy : public Pair { bool a0_is_zero; virtual void allocate(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/pair_exp6_rx.cpp b/src/USER-DPD/pair_exp6_rx.cpp index 37013bcf48..f5adfac7a1 100644 --- a/src/USER-DPD/pair_exp6_rx.cpp +++ b/src/USER-DPD/pair_exp6_rx.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/pair_exp6_rx.h b/src/USER-DPD/pair_exp6_rx.h index d306ac62c8..719d8776b0 100644 --- a/src/USER-DPD/pair_exp6_rx.h +++ b/src/USER-DPD/pair_exp6_rx.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(exp6/rx,PairExp6rx) - +// clang-format off +PairStyle(exp6/rx,PairExp6rx); +// clang-format on #else #ifndef LMP_PAIR_EXP6_RX_H @@ -38,26 +38,26 @@ class PairExp6rx : public Pair { void read_restart_settings(FILE *); struct Param { - double epsilon,rm,alpha; + double epsilon, rm, alpha; int ispecies; - char *name, *potential; // names of unique molecules and interaction type - char *tablename; // name of interaction table - int potentialType; // enumerated interaction potential type. + char *name, *potential; // names of unique molecules and interaction type + char *tablename; // name of interaction table + int potentialType; // enumerated interaction potential type. }; protected: - enum{LINEAR}; - enum{NONE,EXPONENT,POLYNOMIAL}; + enum { LINEAR }; + enum { NONE, EXPONENT, POLYNOMIAL }; double cut_global; double **cut; - double **epsilon,**rm,**alpha; - double **rminv,**buck1,**buck2,**offset; + double **epsilon, **rm, **alpha; + double **rminv, **buck1, **buck2, **offset; virtual void allocate(); - int *mol2param; // mapping from molecule to parameters - int nparams; // # of stored parameter sets - int maxparam; // max # of parameter sets - Param *params; // parameter set for an I-J-K interaction + int *mol2param; // mapping from molecule to parameters + int nparams; // # of stored parameter sets + int maxparam; // max # of parameter sets + Param *params; // parameter set for an I-J-K interaction int nspecies; virtual void read_file(char *); @@ -66,7 +66,9 @@ class PairExp6rx : public Pair { int isite1, isite2; char *site1, *site2; - void getMixingWeights(int, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &) const; + void getMixingWeights(int, double &, double &, double &, double &, double &, double &, double &, + double &, double &, double &, double &, double &, double &, double &, + double &, double &) const; double exponentR, exponentEpsilon; int scalingFlag; void exponentScaling(double, double &, double &) const; @@ -78,7 +80,7 @@ class PairExp6rx : public Pair { inline double expValue(const double) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/pair_multi_lucy.cpp b/src/USER-DPD/pair_multi_lucy.cpp index 85cab8a37f..9f5e494991 100644 --- a/src/USER-DPD/pair_multi_lucy.cpp +++ b/src/USER-DPD/pair_multi_lucy.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/pair_multi_lucy.h b/src/USER-DPD/pair_multi_lucy.h index e1440a12f2..7de798e9d3 100644 --- a/src/USER-DPD/pair_multi_lucy.h +++ b/src/USER-DPD/pair_multi_lucy.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(multi/lucy,PairMultiLucy) - +// clang-format off +PairStyle(multi/lucy,PairMultiLucy); +// clang-format on #else #ifndef LMP_PAIR_MULTI_LUCY_H @@ -44,20 +44,19 @@ class PairMultiLucy : public Pair { void computeLocalDensity(); double rho_0; - protected: - enum{LOOKUP,LINEAR}; + enum { LOOKUP, LINEAR }; int nmax; - int tabstyle,tablength; + int tabstyle, tablength; struct Table { - int ninput,rflag,fpflag,match; - double rlo,rhi,fplo,fphi,cut; - double *rfile,*efile,*ffile; - double *e2file,*f2file; - double innersq,delta,invdelta,deltasq6; - double *rsq,*drsq,*e,*de,*f,*df,*e2,*f2; + int ninput, rflag, fpflag, match; + double rlo, rhi, fplo, fphi, cut; + double *rfile, *efile, *ffile; + double *e2file, *f2file; + double innersq, delta, invdelta, deltasq6; + double *rsq, *drsq, *e, *de, *f, *df, *e2, *f2; }; int ntables; Table *tables; @@ -76,7 +75,7 @@ class PairMultiLucy : public Pair { double splint(double *, double *, double *, int, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/pair_multi_lucy_rx.cpp b/src/USER-DPD/pair_multi_lucy_rx.cpp index 5bea395725..4c7cfe65e5 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.cpp +++ b/src/USER-DPD/pair_multi_lucy_rx.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DPD/pair_multi_lucy_rx.h b/src/USER-DPD/pair_multi_lucy_rx.h index 005144173e..a0d4caadf5 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.h +++ b/src/USER-DPD/pair_multi_lucy_rx.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(multi/lucy/rx,PairMultiLucyRX) - +// clang-format off +PairStyle(multi/lucy/rx,PairMultiLucyRX); +// clang-format on #else #ifndef LMP_PAIR_MULTI_LUCY_RX_H @@ -44,20 +44,19 @@ class PairMultiLucyRX : public Pair { void computeLocalDensity(); double rho_0; - protected: - enum{LOOKUP,LINEAR}; + enum { LOOKUP, LINEAR }; int nmax; - int tabstyle,tablength; + int tabstyle, tablength; struct Table { - int ninput,rflag,fpflag,match; - double rlo,rhi,fplo,fphi,cut; - double *rfile,*efile,*ffile; - double *e2file,*f2file; - double innersq,delta,invdelta,deltasq6; - double *rsq,*drsq,*e,*de,*f,*df,*e2,*f2; + int ninput, rflag, fpflag, match; + double rlo, rhi, fplo, fphi, cut; + double *rfile, *efile, *ffile; + double *e2file, *f2file; + double innersq, delta, invdelta, deltasq6; + double *rsq, *drsq, *e, *de, *f, *df, *e2, *f2; }; int ntables; Table *tables; @@ -80,10 +79,9 @@ class PairMultiLucyRX : public Pair { int isite1, isite2; void getMixingWeights(int, double &, double &, double &, double &); bool fractionalWeighting; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/pair_table_rx.cpp b/src/USER-DPD/pair_table_rx.cpp index 85879d11fa..d47b8a7173 100644 --- a/src/USER-DPD/pair_table_rx.cpp +++ b/src/USER-DPD/pair_table_rx.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -54,6 +55,8 @@ PairTableRX::PairTableRX(LAMMPS *lmp) : PairTable(lmp) PairTableRX::~PairTableRX() { + if (copymode) return; + delete [] site1; delete [] site2; } diff --git a/src/USER-DPD/pair_table_rx.h b/src/USER-DPD/pair_table_rx.h index ac97b8af1e..49bf7811a3 100644 --- a/src/USER-DPD/pair_table_rx.h +++ b/src/USER-DPD/pair_table_rx.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(table/rx,PairTableRX) - +// clang-format off +PairStyle(table/rx,PairTableRX); +// clang-format on #else #ifndef LMP_PAIR_TABLE_RX_H @@ -35,16 +35,14 @@ class PairTableRX : public PairTable { virtual double single(int, int, int, int, double, double, double, double &); protected: - int nspecies; char *site1, *site2; int isite1, isite2; void getMixingWeights(int, double &, double &, double &, double &); bool fractionalWeighting; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/random_external_state.h b/src/USER-DPD/random_external_state.h index 037a5ee8b0..503118f0bf 100644 --- a/src/USER-DPD/random_external_state.h +++ b/src/USER-DPD/random_external_state.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -63,9 +63,8 @@ #ifndef LMP_RANDOM_EXTERNALSTATE_H #define LMP_RANDOM_EXTERNALSTATE_H -#include #include "accelerator_kokkos.h" - +#include /// \file random_external_state.h /// \brief Pseudorandom number generators @@ -77,90 +76,98 @@ // A replacement for the Kokkos Random_XorShift64 class that uses // an external state variable, instead of a class member variable. namespace random_external_state { - typedef uint64_t es_RNG_t; +typedef uint64_t es_RNG_t; - enum {MAX_URAND = 0xffffffffU}; - enum {MAX_URAND64 = 0xffffffffffffffffULL-1}; +enum { MAX_URAND = 0xffffffffU }; +enum { MAX_URAND64 = 0xffffffffffffffffULL - 1 }; - LAMMPS_INLINE - uint32_t es_urand(es_RNG_t &state_) { - state_ ^= state_ >> 12; - state_ ^= state_ << 25; - state_ ^= state_ >> 27; +LAMMPS_INLINE +uint32_t es_urand(es_RNG_t &state_) +{ + state_ ^= state_ >> 12; + state_ ^= state_ << 25; + state_ ^= state_ >> 27; - es_RNG_t tmp = state_ * 2685821657736338717ULL; - tmp = tmp>>16; - return static_cast(tmp&MAX_URAND); - } - - LAMMPS_INLINE - uint64_t es_urand64(es_RNG_t &state_) { - state_ ^= state_ >> 12; - state_ ^= state_ << 25; - state_ ^= state_ >> 27; - return (state_ * 2685821657736338717ULL) - 1; - } - - LAMMPS_INLINE - int es_rand(es_RNG_t &state_) { - return static_cast(es_urand(state_)/2); - } - - LAMMPS_INLINE - double es_drand(es_RNG_t &state_) { - return 1.0 * es_urand64(state_)/MAX_URAND64; - } - - //Marsaglia polar method for drawing a standard normal distributed random number - LAMMPS_INLINE - double es_normal(es_RNG_t &state_) { - double S, U; - do { - U = 2.0*es_drand(state_) - 1.0; - const double V = 2.0*es_drand(state_) - 1.0; - S = U*U+V*V; - } while ((S >= 1.0) || (S == 0.0)); - return U*sqrt(-2.0*log(S)/S); - } - - LAMMPS_INLINE - double es_normalPair(es_RNG_t &state_, double &second) { - double S, U, V; - do { - U = 2.0*es_drand(state_) - 1.0; - V = 2.0*es_drand(state_) - 1.0; - S = U*U+V*V; - } while ((S >= 1.0) || (S == 0.0)); - const double fac = sqrt(-2.0*log(S)/S); - second = V*fac; - return U*fac; - } - - // Use es_init() to init a serial RNG, that is then - // used to generate the initial state of your k parallel - // RNGs with k calls to genNextParallelState() - LAMMPS_INLINE - void es_init(es_RNG_t &serial_state, uint64_t seed) { - if (seed==0) seed = uint64_t(1318319); - serial_state = seed; - for (int i = 0; i < 17; i++) es_rand(serial_state); - } - - // Call genNextParallelState() once for each RNG to generate - // the initial state for that RNG. - LAMMPS_INLINE - void es_genNextParallelState(es_RNG_t &serial_state, es_RNG_t &new_state) { - int n1 = es_rand(serial_state); - int n2 = es_rand(serial_state); - int n3 = es_rand(serial_state); - int n4 = es_rand(serial_state); - new_state = ((((static_cast(n1)) & 0xffff)<<00) | - (((static_cast(n2)) & 0xffff)<<16) | - (((static_cast(n3)) & 0xffff)<<32) | - (((static_cast(n4)) & 0xffff)<<48)); - } + es_RNG_t tmp = state_ * 2685821657736338717ULL; + tmp = tmp >> 16; + return static_cast(tmp & MAX_URAND); } +LAMMPS_INLINE +uint64_t es_urand64(es_RNG_t &state_) +{ + state_ ^= state_ >> 12; + state_ ^= state_ << 25; + state_ ^= state_ >> 27; + return (state_ * 2685821657736338717ULL) - 1; +} + +LAMMPS_INLINE +int es_rand(es_RNG_t &state_) +{ + return static_cast(es_urand(state_) / 2); +} + +LAMMPS_INLINE +double es_drand(es_RNG_t &state_) +{ + return 1.0 * es_urand64(state_) / MAX_URAND64; +} + +//Marsaglia polar method for drawing a standard normal distributed random number +LAMMPS_INLINE +double es_normal(es_RNG_t &state_) +{ + double S, U; + do { + U = 2.0 * es_drand(state_) - 1.0; + const double V = 2.0 * es_drand(state_) - 1.0; + S = U * U + V * V; + } while ((S >= 1.0) || (S == 0.0)); + return U * sqrt(-2.0 * log(S) / S); +} + +LAMMPS_INLINE +double es_normalPair(es_RNG_t &state_, double &second) +{ + double S, U, V; + do { + U = 2.0 * es_drand(state_) - 1.0; + V = 2.0 * es_drand(state_) - 1.0; + S = U * U + V * V; + } while ((S >= 1.0) || (S == 0.0)); + const double fac = sqrt(-2.0 * log(S) / S); + second = V * fac; + return U * fac; +} + +// Use es_init() to init a serial RNG, that is then +// used to generate the initial state of your k parallel +// RNGs with k calls to genNextParallelState() +LAMMPS_INLINE +void es_init(es_RNG_t &serial_state, uint64_t seed) +{ + if (seed == 0) seed = uint64_t(1318319); + serial_state = seed; + for (int i = 0; i < 17; i++) es_rand(serial_state); +} + +// Call genNextParallelState() once for each RNG to generate +// the initial state for that RNG. +LAMMPS_INLINE +void es_genNextParallelState(es_RNG_t &serial_state, es_RNG_t &new_state) +{ + int n1 = es_rand(serial_state); + int n2 = es_rand(serial_state); + int n3 = es_rand(serial_state); + int n4 = es_rand(serial_state); + new_state = ((((static_cast(n1)) & 0xffff) << 00) | + (((static_cast(n2)) & 0xffff) << 16) | + (((static_cast(n3)) & 0xffff) << 32) | + (((static_cast(n4)) & 0xffff) << 48)); +} +} // namespace random_external_state + #endif /* ERROR/WARNING messages: diff --git a/src/USER-DRUDE/compute_temp_drude.cpp b/src/USER-DRUDE/compute_temp_drude.cpp index 4325c9d6ae..940a7e5328 100644 --- a/src/USER-DRUDE/compute_temp_drude.cpp +++ b/src/USER-DRUDE/compute_temp_drude.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DRUDE/compute_temp_drude.h b/src/USER-DRUDE/compute_temp_drude.h index b1ef758e23..cef5d8664e 100644 --- a/src/USER-DRUDE/compute_temp_drude.h +++ b/src/USER-DRUDE/compute_temp_drude.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/drude,ComputeTempDrude) - +// clang-format off +ComputeStyle(temp/drude,ComputeTempDrude); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_DRUDE_H @@ -36,7 +36,7 @@ class ComputeTempDrude : public Compute { private: int fix_dof; - class FixDrude * fix_drude; + class FixDrude *fix_drude; char *id_temp; class Compute *temperature; bigint dof_core, dof_drude; @@ -44,10 +44,9 @@ class ComputeTempDrude : public Compute { double temp_core, temp_drude; void dof_compute(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DRUDE/fix_drude.cpp b/src/USER-DRUDE/fix_drude.cpp index 49ea5a03e7..1856b5455c 100644 --- a/src/USER-DRUDE/fix_drude.cpp +++ b/src/USER-DRUDE/fix_drude.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DRUDE/fix_drude.h b/src/USER-DRUDE/fix_drude.h index 332ca837a9..b563de485d 100644 --- a/src/USER-DRUDE/fix_drude.h +++ b/src/USER-DRUDE/fix_drude.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(drude,FixDrude) - +// clang-format off +FixStyle(drude,FixDrude); +// clang-format on #else #ifndef LMP_FIX_DRUDE_H @@ -24,15 +24,15 @@ FixStyle(drude,FixDrude) #include #define NOPOL_TYPE 0 -#define CORE_TYPE 1 +#define CORE_TYPE 1 #define DRUDE_TYPE 2 namespace LAMMPS_NS { class FixDrude : public Fix { public: - int * drudetype; - tagint * drudeid; + int *drudetype; + tagint *drudeid; bool is_reduced; FixDrude(class LAMMPS *, int, char **); @@ -48,9 +48,9 @@ class FixDrude : public Fix { int pack_border(int n, int *list, double *buf); int unpack_border(int n, int first, double *buf); -private: + private: int rebuildflag; - std::set * partner_set; + std::set *partner_set; void build_drudeid(); static void ring_search_drudeid(int size, char *cbuf, void *ptr); @@ -61,8 +61,7 @@ private: static void ring_copy_drude(int size, char *cbuf, void *ptr); }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-DRUDE/fix_drude_transform.cpp b/src/USER-DRUDE/fix_drude_transform.cpp index d75481c2c8..ed42d2b548 100644 --- a/src/USER-DRUDE/fix_drude_transform.cpp +++ b/src/USER-DRUDE/fix_drude_transform.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DRUDE/fix_drude_transform.h b/src/USER-DRUDE/fix_drude_transform.h index 1b8e5fa46a..7ee85d2b42 100644 --- a/src/USER-DRUDE/fix_drude_transform.h +++ b/src/USER-DRUDE/fix_drude_transform.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(drude/transform/direct,FixDrudeTransform) -FixStyle(drude/transform/inverse,FixDrudeTransform) - +// clang-format off +FixStyle(drude/transform/direct,FixDrudeTransform); +FixStyle(drude/transform/inverse,FixDrudeTransform); +// clang-format on #else #ifndef LMP_FIX_DRUDE_TRANSFORM_H @@ -25,8 +25,7 @@ FixStyle(drude/transform/inverse,FixDrudeTransform) namespace LAMMPS_NS { -template -class FixDrudeTransform : public Fix { +template class FixDrudeTransform : public Fix { public: FixDrudeTransform(class LAMMPS *, int, char **); ~FixDrudeTransform(); @@ -39,13 +38,13 @@ class FixDrudeTransform : public Fix { void final_integrate(); int pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc); void unpack_forward_comm(int n, int first, double *buf); + protected: - double * mcoeff; - class FixDrude * fix_drude; + double *mcoeff; + class FixDrude *fix_drude; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-DRUDE/fix_langevin_drude.cpp b/src/USER-DRUDE/fix_langevin_drude.cpp index 44d2556b61..205b36ce51 100644 --- a/src/USER-DRUDE/fix_langevin_drude.cpp +++ b/src/USER-DRUDE/fix_langevin_drude.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DRUDE/fix_langevin_drude.h b/src/USER-DRUDE/fix_langevin_drude.h index 08e0ecd1a6..939de2db48 100644 --- a/src/USER-DRUDE/fix_langevin_drude.h +++ b/src/USER-DRUDE/fix_langevin_drude.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(langevin/drude,FixLangevinDrude) - +// clang-format off +FixStyle(langevin/drude,FixLangevinDrude); +// clang-format on #else #ifndef LMP_FIX_LANGEVIN_DRUDE_H @@ -34,13 +34,13 @@ class FixLangevinDrude : public Fix { virtual void post_force(int vflag); void reset_target(double); virtual void *extract(const char *, int &); - int pack_reverse_comm(int, int, double*); - void unpack_reverse_comm(int, int*, double*); + int pack_reverse_comm(int, int, double *); + void unpack_reverse_comm(int, int *, double *); int modify_param(int, char **); protected: - double t_start_core,t_period_core,t_target_core; - double t_start_drude,t_period_drude,t_target_drude; + double t_start_core, t_period_core, t_target_core; + double t_start_drude, t_period_drude, t_target_drude; int tstyle_core, tstyle_drude; int tvar_core, tvar_drude; char *tstr_core, *tstr_drude; @@ -50,13 +50,12 @@ class FixLangevinDrude : public Fix { class RanMars *random_core, *random_drude; int zero; bigint ncore; - class FixDrude * fix_drude; + class FixDrude *fix_drude; class Compute *temperature; char *id_temp; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-DRUDE/fix_tgnh_drude.cpp b/src/USER-DRUDE/fix_tgnh_drude.cpp index 3cde93f1b5..9f9bcada78 100644 --- a/src/USER-DRUDE/fix_tgnh_drude.cpp +++ b/src/USER-DRUDE/fix_tgnh_drude.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DRUDE/fix_tgnh_drude.h b/src/USER-DRUDE/fix_tgnh_drude.h index 2063f0a97e..3549317655 100644 --- a/src/USER-DRUDE/fix_tgnh_drude.h +++ b/src/USER-DRUDE/fix_tgnh_drude.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -34,7 +34,7 @@ class FixTGNHDrude : public Fix { double compute_scalar(); virtual double compute_vector(int); void write_restart(FILE *); - virtual int pack_restart_data(double *); // pack restart data + virtual int pack_restart_data(double *); // pack restart data virtual void restart(char *); int modify_param(int, char **); void reset_target(double); @@ -42,92 +42,92 @@ class FixTGNHDrude : public Fix { double memory_usage(); protected: - int dimension,which; - double dtv,dtf,dthalf,dt4,dt8,dto; - double boltz,nktv2p,tdof; - double vol0; // reference volume - double t0; // reference temperature - // used for barostat mass - double t_start,t_stop; - double t_current,t_target; + int dimension, which; + double dtv, dtf, dthalf, dt4, dt8, dto; + double boltz, nktv2p, tdof; + double vol0; // reference volume + double t0; // reference temperature + // used for barostat mass + double t_start, t_stop; + double t_current, t_target; double t_freq; - int tstat_flag; // 1 if control T - int pstat_flag; // 1 if control P + int tstat_flag; // 1 if control T + int pstat_flag; // 1 if control P - int pstyle,pcouple; - int p_flag[6]; // 1 if control P on this dim, 0 if not - double p_start[6],p_stop[6]; - double p_freq[6],p_target[6]; - double omega[6],omega_dot[6]; + int pstyle, pcouple; + int p_flag[6]; // 1 if control P on this dim, 0 if not + double p_start[6], p_stop[6]; + double p_freq[6], p_target[6]; + double omega[6], omega_dot[6]; double omega_mass[6]; double p_current[6]; - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int *rfix; // indices of rigid fixes - class Irregular *irregular; // for migrating atoms after box flips + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int *rfix; // indices of rigid fixes + class Irregular *irregular; // for migrating atoms after box flips int nlevels_respa; double *step_respa; - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tcomputeflag,pcomputeflag; // 1 = compute was created by fix - // 0 = created externally + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tcomputeflag, pcomputeflag; // 1 = compute was created by fix + // 0 = created externally double *etamol; - double *etamol_dot; // chain thermostat for motion of whole molecules + double *etamol_dot; // chain thermostat for motion of whole molecules double *etamol_dotdot; double *etamol_mass; double *etaint; - double *etaint_dot; // chain thermostat for internal DOFs + double *etaint_dot; // chain thermostat for internal DOFs double *etaint_dotdot; double *etaint_mass; double *etadrude; - double *etadrude_dot; // chain thermostat for Drude relative motions + double *etadrude_dot; // chain thermostat for Drude relative motions double *etadrude_dotdot; double *etadrude_mass; - double *etap; // chain thermostat for barostat + double *etap; // chain thermostat for barostat double *etap_dot; double *etap_dotdot; double *etap_mass; - int mtchain; // length of chain - int mpchain; // length of chain + int mtchain; // length of chain + int mpchain; // length of chain - int mtk_flag; // 0 if using Hoover barostat - int pdim; // number of barostatted dims - double p_freq_max; // maximum barostat frequency + int mtk_flag; // 0 if using Hoover barostat + int pdim; // number of barostatted dims + double p_freq_max; // maximum barostat frequency - double p_hydro; // hydrostatic target pressure + double p_hydro; // hydrostatic target pressure - int nc_tchain,nc_pchain; - double sigma[6]; // scaled target stress - double fdev[6]; // deviatoric force on barostat - int deviatoric_flag; // 0 if target stress tensor is hydrostatic - double h0_inv[6]; // h_inv of reference (zero strain) box - int nreset_h0; // interval for resetting h0 + int nc_tchain, nc_pchain; + double sigma[6]; // scaled target stress + double fdev[6]; // deviatoric force on barostat + int deviatoric_flag; // 0 if target stress tensor is hydrostatic + double h0_inv[6]; // h_inv of reference (zero strain) box + int nreset_h0; // interval for resetting h0 - double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections + double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections - int scaleyz; // 1 if yz scaled with lz - int scalexz; // 1 if xz scaled with lz - int scalexy; // 1 if xy scaled with ly - int flipflag; // 1 if box flips are invoked as needed + int scaleyz; // 1 if yz scaled with lz + int scalexz; // 1 if xz scaled with lz + int scalexy; // 1 if xy scaled with ly + int flipflag; // 1 if box flips are invoked as needed - int pre_exchange_flag; // set if pre_exchange needed for box flips + int pre_exchange_flag; // set if pre_exchange needed for box flips - double fixedpoint[3]; // location of dilation fixed-point + double fixedpoint[3]; // location of dilation fixed-point void couple(); virtual void remap(); void nhc_temp_integrate(); void nhc_press_integrate(); - virtual void nve_x(); // may be overwritten by child classes + virtual void nve_x(); // may be overwritten by child classes virtual void nve_v(); virtual void nh_v_press(); virtual void nh_v_temp(); @@ -140,24 +140,24 @@ class FixTGNHDrude : public Fix { void compute_press_target(); void nh_omega_dot(); - - class FixDrude * fix_drude; - int n_mol; // number of molecules in the system + class FixDrude *fix_drude; + int n_mol; // number of molecules in the system double *mass_mol; - double dof_mol, dof_int, dof_drude; // DOFs of different modes in the fix group + double dof_mol, dof_int, dof_drude; // DOFs of different modes in the fix group void setup_mol_mass_dof(); double **v_mol, **v_mol_tmp; - void compute_temp_mol_int_drude(bool); // calculate the temperatures of three sets of DOFs + void compute_temp_mol_int_drude(bool); // calculate the temperatures of three sets of DOFs bool temp_computed_end_of_step = false; double tdrude_target, tdrude_freq; double t_mol, t_int, t_drude; double ke2mol, ke2int, ke2drude; double ke2mol_target, ke2int_target, ke2drude_target; double factor_eta_mol, factor_eta_int, factor_eta_drude; - double propagate(double *, double *, double *, const double *, const double &, const double &, const double &) const; + double propagate(double *, double *, double *, const double *, const double &, const double &, + const double &) const; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-DRUDE/fix_tgnpt_drude.cpp b/src/USER-DRUDE/fix_tgnpt_drude.cpp index 301e0aa029..f9df2ed93b 100644 --- a/src/USER-DRUDE/fix_tgnpt_drude.cpp +++ b/src/USER-DRUDE/fix_tgnpt_drude.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DRUDE/fix_tgnpt_drude.h b/src/USER-DRUDE/fix_tgnpt_drude.h index f1cbb68f5a..1fe30705eb 100644 --- a/src/USER-DRUDE/fix_tgnpt_drude.h +++ b/src/USER-DRUDE/fix_tgnpt_drude.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(tgnpt/drude,FixTGNPTDrude) - +// clang-format off +FixStyle(tgnpt/drude,FixTGNPTDrude); +// clang-format on #else #ifndef LMP_FIX_TGNPT_DRUDE_H @@ -30,7 +30,7 @@ class FixTGNPTDrude : public FixTGNHDrude { ~FixTGNPTDrude() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DRUDE/fix_tgnvt_drude.cpp b/src/USER-DRUDE/fix_tgnvt_drude.cpp index ab566058d4..ac4f8d4845 100644 --- a/src/USER-DRUDE/fix_tgnvt_drude.cpp +++ b/src/USER-DRUDE/fix_tgnvt_drude.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DRUDE/fix_tgnvt_drude.h b/src/USER-DRUDE/fix_tgnvt_drude.h index eb73e8c918..9c06df66a8 100644 --- a/src/USER-DRUDE/fix_tgnvt_drude.h +++ b/src/USER-DRUDE/fix_tgnvt_drude.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(tgnvt/drude,FixTGNVTDrude) - +// clang-format off +FixStyle(tgnvt/drude,FixTGNVTDrude); +// clang-format on #else #ifndef LMP_FIX_TGNVT_DRUDE_H @@ -24,13 +24,13 @@ FixStyle(tgnvt/drude,FixTGNVTDrude) namespace LAMMPS_NS { -class FixTGNVTDrude: public FixTGNHDrude { +class FixTGNVTDrude : public FixTGNHDrude { public: FixTGNVTDrude(class LAMMPS *, int, char **); ~FixTGNVTDrude() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DRUDE/pair_coul_tt.cpp b/src/USER-DRUDE/pair_coul_tt.cpp index a807ea3c16..c3e97b49da 100644 --- a/src/USER-DRUDE/pair_coul_tt.cpp +++ b/src/USER-DRUDE/pair_coul_tt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DRUDE/pair_coul_tt.h b/src/USER-DRUDE/pair_coul_tt.h index 23ef827968..cb7139a720 100644 --- a/src/USER-DRUDE/pair_coul_tt.h +++ b/src/USER-DRUDE/pair_coul_tt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/tt,PairCoulTT) - +// clang-format off +PairStyle(coul/tt,PairCoulTT); +// clang-format on #else #ifndef LMP_PAIR_COULTT_H @@ -24,7 +24,7 @@ PairStyle(coul/tt,PairCoulTT) namespace LAMMPS_NS { -class PairCoulTT: public Pair { +class PairCoulTT : public Pair { public: PairCoulTT(class LAMMPS *); virtual ~PairCoulTT(); @@ -43,15 +43,15 @@ class PairCoulTT: public Pair { protected: int n_global; double cut_global; - double **cut,**scale; - double **b,**c; + double **cut, **scale; + double **b, **c; int **ntt; - class FixDrude * fix_drude; + class FixDrude *fix_drude; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp index 84437f408a..3cf085a723 100644 --- a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp +++ b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DRUDE/pair_lj_cut_thole_long.h b/src/USER-DRUDE/pair_lj_cut_thole_long.h index cd01db6f72..eb26966d72 100644 --- a/src/USER-DRUDE/pair_lj_cut_thole_long.h +++ b/src/USER-DRUDE/pair_lj_cut_thole_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/thole/long,PairLJCutTholeLong) - +// clang-format off +PairStyle(lj/cut/thole/long,PairLJCutTholeLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_THOLE_LONG_H @@ -44,23 +44,23 @@ class PairLJCutTholeLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; - double qdist; // TIP4P distance from O site to negative charge + double qdist; // TIP4P distance from O site to negative charge double g_ewald; double thole_global; double cut_global; - double **cut,**scale; - double **polar,**thole,**ascreen; + double **cut, **scale; + double **polar, **thole, **ascreen; class FixDrude *fix_drude; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DRUDE/pair_thole.cpp b/src/USER-DRUDE/pair_thole.cpp index 418705e0a3..97a3f48343 100644 --- a/src/USER-DRUDE/pair_thole.cpp +++ b/src/USER-DRUDE/pair_thole.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-DRUDE/pair_thole.h b/src/USER-DRUDE/pair_thole.h index ff93797f5e..15dd1737be 100644 --- a/src/USER-DRUDE/pair_thole.h +++ b/src/USER-DRUDE/pair_thole.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(thole,PairThole) - +// clang-format off +PairStyle(thole,PairThole); +// clang-format on #else #ifndef LMP_PAIR_THOLE_H @@ -43,14 +43,14 @@ class PairThole : public Pair { protected: double thole_global; double cut_global; - double **cut,**scale; - double **polar,**thole,**ascreen; - class FixDrude * fix_drude; + double **cut, **scale; + double **polar, **thole, **ascreen; + class FixDrude *fix_drude; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/atom_vec_electron.cpp b/src/USER-EFF/atom_vec_electron.cpp index 8bf0ee1a6b..87bec2ce9f 100644 --- a/src/USER-EFF/atom_vec_electron.cpp +++ b/src/USER-EFF/atom_vec_electron.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/atom_vec_electron.h b/src/USER-EFF/atom_vec_electron.h index 3cdd218f55..50883e0764 100644 --- a/src/USER-EFF/atom_vec_electron.h +++ b/src/USER-EFF/atom_vec_electron.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(electron,AtomVecElectron) - +// clang-format off +AtomStyle(electron,AtomVecElectron); +// clang-format on #else #ifndef LMP_ATOM_VEC_ELECTRON_H @@ -35,12 +35,12 @@ class AtomVecElectron : public AtomVec { int property_atom(char *); void pack_property_atom(int, double *, int, int); -private: + private: int *spin; - double *eradius,*ervel,*erforce; + double *eradius, *ervel, *erforce; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/compute_ke_atom_eff.cpp b/src/USER-EFF/compute_ke_atom_eff.cpp index c2342c4b5b..cb6e489fc1 100644 --- a/src/USER-EFF/compute_ke_atom_eff.cpp +++ b/src/USER-EFF/compute_ke_atom_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/compute_ke_atom_eff.h b/src/USER-EFF/compute_ke_atom_eff.h index c1ea0ac8ce..160b8ac96e 100644 --- a/src/USER-EFF/compute_ke_atom_eff.h +++ b/src/USER-EFF/compute_ke_atom_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,11 +11,10 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - #ifdef COMPUTE_CLASS - -ComputeStyle(ke/atom/eff,ComputeKEAtomEff) - +// clang-format off +ComputeStyle(ke/atom/eff,ComputeKEAtomEff); +// clang-format on #else #ifndef LMP_COMPUTE_KE_ATOM_EFF_H @@ -38,7 +37,7 @@ class ComputeKEAtomEff : public Compute { double *ke; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/compute_ke_eff.cpp b/src/USER-EFF/compute_ke_eff.cpp index 6250fc74a6..621b186887 100644 --- a/src/USER-EFF/compute_ke_eff.cpp +++ b/src/USER-EFF/compute_ke_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/compute_ke_eff.h b/src/USER-EFF/compute_ke_eff.h index 854c60f110..7e8063ba18 100644 --- a/src/USER-EFF/compute_ke_eff.h +++ b/src/USER-EFF/compute_ke_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(ke/eff,ComputeKEEff) - +// clang-format off +ComputeStyle(ke/eff,ComputeKEEff); +// clang-format on #else #ifndef LMP_COMPUTE_KE_EFF_H @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class ComputeKEEff : public Compute { public: ComputeKEEff(class LAMMPS *, int, char **); - ~ComputeKEEff() {}; + ~ComputeKEEff(){}; void init(); double compute_scalar(); @@ -35,7 +35,7 @@ class ComputeKEEff : public Compute { double pfactor; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/compute_temp_deform_eff.cpp b/src/USER-EFF/compute_temp_deform_eff.cpp index 620a7eba21..6476c78039 100644 --- a/src/USER-EFF/compute_temp_deform_eff.cpp +++ b/src/USER-EFF/compute_temp_deform_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/compute_temp_deform_eff.h b/src/USER-EFF/compute_temp_deform_eff.h index 880c436916..1bd6768847 100644 --- a/src/USER-EFF/compute_temp_deform_eff.h +++ b/src/USER-EFF/compute_temp_deform_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/deform/eff,ComputeTempDeformEff) - +// clang-format off +ComputeStyle(temp/deform/eff,ComputeTempDeformEff); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_DEFORM_EFF_H @@ -41,14 +41,14 @@ class ComputeTempDeformEff : public Compute { protected: double tfactor; - double vbias[3]; // stored velocity bias for one atom - double **vbiasall; // stored velocity bias for all atoms - int maxbias; // size of vbiasall array + double vbias[3]; // stored velocity bias for one atom + double **vbiasall; // stored velocity bias for all atoms + int maxbias; // size of vbiasall array virtual void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/compute_temp_eff.cpp b/src/USER-EFF/compute_temp_eff.cpp index 33876a3d95..6ce6d5f671 100644 --- a/src/USER-EFF/compute_temp_eff.cpp +++ b/src/USER-EFF/compute_temp_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/compute_temp_eff.h b/src/USER-EFF/compute_temp_eff.h index d66b65e3a2..112b51d9d7 100644 --- a/src/USER-EFF/compute_temp_eff.h +++ b/src/USER-EFF/compute_temp_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/eff,ComputeTempEff) - +// clang-format off +ComputeStyle(temp/eff,ComputeTempEff); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_EFF_H @@ -39,7 +39,7 @@ class ComputeTempEff : public Compute { void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/compute_temp_region_eff.cpp b/src/USER-EFF/compute_temp_region_eff.cpp index 50ebf8abbe..3b5147b900 100644 --- a/src/USER-EFF/compute_temp_region_eff.cpp +++ b/src/USER-EFF/compute_temp_region_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/compute_temp_region_eff.h b/src/USER-EFF/compute_temp_region_eff.h index 064e0ae6de..8ab10dd39a 100644 --- a/src/USER-EFF/compute_temp_region_eff.h +++ b/src/USER-EFF/compute_temp_region_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/region/eff,ComputeTempRegionEff) - +// clang-format off +ComputeStyle(temp/region/eff,ComputeTempRegionEff); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_REGION_EFF_H @@ -46,7 +46,7 @@ class ComputeTempRegionEff : public Compute { char *idregion; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_langevin_eff.cpp b/src/USER-EFF/fix_langevin_eff.cpp index 9c4ec9024d..e288e8732d 100644 --- a/src/USER-EFF/fix_langevin_eff.cpp +++ b/src/USER-EFF/fix_langevin_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/fix_langevin_eff.h b/src/USER-EFF/fix_langevin_eff.h index 3ba75b4fe0..3176fdf9c1 100644 --- a/src/USER-EFF/fix_langevin_eff.h +++ b/src/USER-EFF/fix_langevin_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(langevin/eff,FixLangevinEff) - +// clang-format off +FixStyle(langevin/eff,FixLangevinEff); +// clang-format on #else #ifndef LMP_FIX_LANGEVIN_EFF_H @@ -39,7 +39,7 @@ class FixLangevinEff : public FixLangevin { void post_force_tally(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_nh_eff.cpp b/src/USER-EFF/fix_nh_eff.cpp index 34a4767b84..fb1ab1ecca 100644 --- a/src/USER-EFF/fix_nh_eff.cpp +++ b/src/USER-EFF/fix_nh_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/fix_nh_eff.h b/src/USER-EFF/fix_nh_eff.h index b98a4fa481..32a96efd96 100644 --- a/src/USER-EFF/fix_nh_eff.h +++ b/src/USER-EFF/fix_nh_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -29,6 +29,6 @@ class FixNHEff : public FixNH { virtual void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-EFF/fix_nph_eff.cpp b/src/USER-EFF/fix_nph_eff.cpp index 1e9871da02..9e82a50535 100644 --- a/src/USER-EFF/fix_nph_eff.cpp +++ b/src/USER-EFF/fix_nph_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/fix_nph_eff.h b/src/USER-EFF/fix_nph_eff.h index 04c28b0f66..7fdbe38d5a 100644 --- a/src/USER-EFF/fix_nph_eff.h +++ b/src/USER-EFF/fix_nph_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nph/eff,FixNPHEff) - +// clang-format off +FixStyle(nph/eff,FixNPHEff); +// clang-format on #else #ifndef LMP_FIX_NPH_EFF_H @@ -30,7 +30,7 @@ class FixNPHEff : public FixNHEff { ~FixNPHEff() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_npt_eff.cpp b/src/USER-EFF/fix_npt_eff.cpp index 4612810c02..e304bedd33 100644 --- a/src/USER-EFF/fix_npt_eff.cpp +++ b/src/USER-EFF/fix_npt_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/fix_npt_eff.h b/src/USER-EFF/fix_npt_eff.h index e726a84668..060b24b38a 100644 --- a/src/USER-EFF/fix_npt_eff.h +++ b/src/USER-EFF/fix_npt_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt/eff,FixNPTEff) - +// clang-format off +FixStyle(npt/eff,FixNPTEff); +// clang-format on #else #ifndef LMP_FIX_NPT_EFF_H @@ -30,7 +30,7 @@ class FixNPTEff : public FixNHEff { ~FixNPTEff() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_nve_eff.cpp b/src/USER-EFF/fix_nve_eff.cpp index 436f6f56da..ed640990ca 100644 --- a/src/USER-EFF/fix_nve_eff.cpp +++ b/src/USER-EFF/fix_nve_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/fix_nve_eff.h b/src/USER-EFF/fix_nve_eff.h index b8a31fb5e4..cab149ee36 100644 --- a/src/USER-EFF/fix_nve_eff.h +++ b/src/USER-EFF/fix_nve_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/eff,FixNVEEff) - +// clang-format off +FixStyle(nve/eff,FixNVEEff); +// clang-format on #else #ifndef LMP_FIX_NVE_EFF_H @@ -36,12 +36,12 @@ class FixNVEEff : public Fix { void reset_dt(); protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_nvt_eff.cpp b/src/USER-EFF/fix_nvt_eff.cpp index 1748530fba..05448c6697 100644 --- a/src/USER-EFF/fix_nvt_eff.cpp +++ b/src/USER-EFF/fix_nvt_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/fix_nvt_eff.h b/src/USER-EFF/fix_nvt_eff.h index a333de126e..96e4cab6eb 100644 --- a/src/USER-EFF/fix_nvt_eff.h +++ b/src/USER-EFF/fix_nvt_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/eff,FixNVTEff) - +// clang-format off +FixStyle(nvt/eff,FixNVTEff); +// clang-format on #else #ifndef LMP_FIX_NVT_EFF_H @@ -30,7 +30,7 @@ class FixNVTEff : public FixNHEff { ~FixNVTEff() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_nvt_sllod_eff.cpp b/src/USER-EFF/fix_nvt_sllod_eff.cpp index 36a5cbb8ab..8e3f7cd72d 100644 --- a/src/USER-EFF/fix_nvt_sllod_eff.cpp +++ b/src/USER-EFF/fix_nvt_sllod_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/fix_nvt_sllod_eff.h b/src/USER-EFF/fix_nvt_sllod_eff.h index e1b6384c2d..8ac3357627 100644 --- a/src/USER-EFF/fix_nvt_sllod_eff.h +++ b/src/USER-EFF/fix_nvt_sllod_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/sllod/eff,FixNVTSllodEff) - +// clang-format off +FixStyle(nvt/sllod/eff,FixNVTSllodEff); +// clang-format on #else #ifndef LMP_FIX_NVT_SLODD_EFF_H @@ -36,7 +36,7 @@ class FixNVTSllodEff : public FixNHEff { void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_temp_rescale_eff.cpp b/src/USER-EFF/fix_temp_rescale_eff.cpp index 0d3bf6ed43..579d8901c6 100644 --- a/src/USER-EFF/fix_temp_rescale_eff.cpp +++ b/src/USER-EFF/fix_temp_rescale_eff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/fix_temp_rescale_eff.h b/src/USER-EFF/fix_temp_rescale_eff.h index c57230359b..d4e29d1c8c 100644 --- a/src/USER-EFF/fix_temp_rescale_eff.h +++ b/src/USER-EFF/fix_temp_rescale_eff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(temp/rescale/eff,FixTempRescaleEff) - +// clang-format off +FixStyle(temp/rescale/eff,FixTempRescaleEff); +// clang-format on #else #ifndef LMP_FIX_TEMP_RESCALE_EFF_H @@ -37,15 +37,15 @@ class FixTempRescaleEff : public Fix { protected: int which; - double t_start,t_stop,t_window; - double fraction,energy,efactor; + double t_start, t_stop, t_window; + double fraction, energy, efactor; char *id_temp; class Compute *temperature; int tflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp index 2413a30635..af781b1404 100644 --- a/src/USER-EFF/pair_eff_cut.cpp +++ b/src/USER-EFF/pair_eff_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-EFF/pair_eff_cut.h b/src/USER-EFF/pair_eff_cut.h index 0b3e4b3c13..0e086e62d6 100644 --- a/src/USER-EFF/pair_eff_cut.h +++ b/src/USER-EFF/pair_eff_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eff/cut,PairEffCut) - +// clang-format off +PairStyle(eff/cut,PairEffCut); +// clang-format on #else #ifndef LMP_PAIR_EFF_CUT_H @@ -50,19 +50,19 @@ class PairEffCut : public Pair { double cut_global; double **cut; int ecp_type[100]; - double PAULI_CORE_A[100],PAULI_CORE_B[100],PAULI_CORE_C[100]; - double PAULI_CORE_D[100],PAULI_CORE_E[100]; + double PAULI_CORE_A[100], PAULI_CORE_B[100], PAULI_CORE_C[100]; + double PAULI_CORE_D[100], PAULI_CORE_E[100]; double hhmss2e, h2e; int nmax; - double *min_eradius,*min_erforce; + double *min_eradius, *min_erforce; void allocate(); void virial_eff_compute(); void ev_tally_eff(int, int, int, int, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/pair_eff_inline.h b/src/USER-EFF/pair_eff_inline.h index 4971b3d6ce..a6249bc4b6 100644 --- a/src/USER-EFF/pair_eff_inline.h +++ b/src/USER-EFF/pair_eff_inline.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -27,146 +27,134 @@ namespace LAMMPS_NS { // error arrays -double E1[] = -{ -1.483110564084803581889448079057, --3.01071073386594942470731046311E-1, -6.8994830689831566246603180718E-2, --1.3916271264722187682546525687E-2, -2.420799522433463662891678239E-3, --3.65863968584808644649382577E-4, -4.8620984432319048282887568E-5, --5.749256558035684835054215E-6, -6.11324357843476469706758E-7, --5.8991015312958434390846E-8, -5.207009092068648240455E-9, --4.23297587996554326810E-10, -3.1881135066491749748E-11, --2.236155018832684273E-12, -1.46732984799108492E-13, --9.044001985381747E-15, -5.25481371547092E-16, --2.8874261222849E-17, -1.504785187558E-18, --7.4572892821E-20, -3.522563810E-21, --1.58944644E-22, -6.864365E-24, --2.84257E-25, -1.1306E-26, --4.33E-28, -1.6E-29, --1.0E-30 -}; +double E1[] = {1.483110564084803581889448079057, + -3.01071073386594942470731046311E-1, + 6.8994830689831566246603180718E-2, + -1.3916271264722187682546525687E-2, + 2.420799522433463662891678239E-3, + -3.65863968584808644649382577E-4, + 4.8620984432319048282887568E-5, + -5.749256558035684835054215E-6, + 6.11324357843476469706758E-7, + -5.8991015312958434390846E-8, + 5.207009092068648240455E-9, + -4.23297587996554326810E-10, + 3.1881135066491749748E-11, + -2.236155018832684273E-12, + 1.46732984799108492E-13, + -9.044001985381747E-15, + 5.25481371547092E-16, + -2.8874261222849E-17, + 1.504785187558E-18, + -7.4572892821E-20, + 3.522563810E-21, + -1.58944644E-22, + 6.864365E-24, + -2.84257E-25, + 1.1306E-26, + -4.33E-28, + 1.6E-29, + -1.0E-30}; -double E2[] = -{ -1.077977852072383151168335910348, --2.6559890409148673372146500904E-2, --1.487073146698099509605046333E-3, --1.38040145414143859607708920E-4, --1.1280303332287491498507366E-5, --1.172869842743725224053739E-6, --1.03476150393304615537382E-7, --1.1899114085892438254447E-8, --1.016222544989498640476E-9, --1.37895716146965692169E-10, --9.369613033737303335E-12, --1.918809583959525349E-12, --3.7573017201993707E-14, --3.7053726026983357E-14, -2.627565423490371E-15, --1.121322876437933E-15, -1.84136028922538E-16, --4.9130256574886E-17, -1.0704455167373E-17, --2.671893662405E-18, -6.49326867976E-19, --1.65399353183E-19, -4.2605626604E-20, --1.1255840765E-20, -3.025617448E-21, --8.29042146E-22, -2.31049558E-22, --6.5469511E-23, -1.8842314E-23, --5.504341E-24, -1.630950E-24, --4.89860E-25, -1.49054E-25, --4.5922E-26, -1.4318E-26, --4.516E-27, -1.440E-27, --4.64E-28, -1.51E-28, --5.0E-29, -1.7E-29, --6.0E-30, -2.0E-30, --1.0E-30 -}; +double E2[] = {1.077977852072383151168335910348, + -2.6559890409148673372146500904E-2, + -1.487073146698099509605046333E-3, + -1.38040145414143859607708920E-4, + -1.1280303332287491498507366E-5, + -1.172869842743725224053739E-6, + -1.03476150393304615537382E-7, + -1.1899114085892438254447E-8, + -1.016222544989498640476E-9, + -1.37895716146965692169E-10, + -9.369613033737303335E-12, + -1.918809583959525349E-12, + -3.7573017201993707E-14, + -3.7053726026983357E-14, + 2.627565423490371E-15, + -1.121322876437933E-15, + 1.84136028922538E-16, + -4.9130256574886E-17, + 1.0704455167373E-17, + -2.671893662405E-18, + 6.49326867976E-19, + -1.65399353183E-19, + 4.2605626604E-20, + -1.1255840765E-20, + 3.025617448E-21, + -8.29042146E-22, + 2.31049558E-22, + -6.5469511E-23, + 1.8842314E-23, + -5.504341E-24, + 1.630950E-24, + -4.89860E-25, + 1.49054E-25, + -4.5922E-26, + 1.4318E-26, + -4.516E-27, + 1.440E-27, + -4.64E-28, + 1.51E-28, + -5.0E-29, + 1.7E-29, + -6.0E-30, + 2.0E-30, + -1.0E-30}; -double DE1[] = -{ --0.689379974848418501361491576718, -0.295939056851161774752959335568, --0.087237828075228616420029484096, -0.019959734091835509766546612696, --0.003740200486895490324750329974, -0.000593337912367800463413186784, --0.000081560801047403878256504204, -9.886099179971884018535968E-6, --1.071209234904290565745194E-6, -1.0490945447626050322784E-7, --9.370959271038746709966E-9, -7.6927263488753841874E-10, --5.8412335114551520146E-11, -4.125393291736424788E-12, --2.72304624901729048E-13, -1.6869717361387012E-14, --9.84565340276638E-16, -5.4313471880068E-17, --2.840458699772E-18, -1.4120512798E-19, --6.688772574E-21, -3.0257558E-22, --1.3097526E-23, -5.4352E-25, --2.1704E-26, -8.32E-28, --5.4E-29 -}; +double DE1[] = {-0.689379974848418501361491576718, + 0.295939056851161774752959335568, + -0.087237828075228616420029484096, + 0.019959734091835509766546612696, + -0.003740200486895490324750329974, + 0.000593337912367800463413186784, + -0.000081560801047403878256504204, + 9.886099179971884018535968E-6, + -1.071209234904290565745194E-6, + 1.0490945447626050322784E-7, + -9.370959271038746709966E-9, + 7.6927263488753841874E-10, + -5.8412335114551520146E-11, + 4.125393291736424788E-12, + -2.72304624901729048E-13, + 1.6869717361387012E-14, + -9.84565340276638E-16, + 5.4313471880068E-17, + -2.840458699772E-18, + 1.4120512798E-19, + -6.688772574E-21, + 3.0257558E-22, + -1.3097526E-23, + 5.4352E-25, + -2.1704E-26, + 8.32E-28, + -5.4E-29}; -double DE2[] = -{ -0.717710208167480928473053690384, --0.379868973985143305103199928808, -0.125832094465157378967135019248, --0.030917661684228839423081992424, -0.006073689914144320367855343072, --0.000996057789064916825079352632, -0.000140310790466315733723475232, --0.000017328176496070286001302184, -1.90540194670935746397168e-6, --1.8882873760163694937908e-7, -1.703176613666840587056e-8, --1.40955218086201517976e-9, -1.0776816914256065828e-10, --7.656138112778696256e-12, -5.07943557413613792e-13, --3.1608615530282912e-14, -1.852036572003432e-15, --1.02524641430496e-16, -5.37852808112e-18, --2.68128238704e-19, -1.273321788e-20, --5.77335744e-22, -2.504352e-23, --1.0446e-24, -4.16e-26, --2.808e-27 -}; +double DE2[] = {0.717710208167480928473053690384, + -0.379868973985143305103199928808, + 0.125832094465157378967135019248, + -0.030917661684228839423081992424, + 0.006073689914144320367855343072, + -0.000996057789064916825079352632, + 0.000140310790466315733723475232, + -0.000017328176496070286001302184, + 1.90540194670935746397168e-6, + -1.8882873760163694937908e-7, + 1.703176613666840587056e-8, + -1.40955218086201517976e-9, + 1.0776816914256065828e-10, + -7.656138112778696256e-12, + 5.07943557413613792e-13, + -3.1608615530282912e-14, + 1.852036572003432e-15, + -1.02524641430496e-16, + 5.37852808112e-18, + -2.68128238704e-19, + 1.273321788e-20, + -5.77335744e-22, + 2.504352e-23, + -1.0446e-24, + 4.16e-26, + -2.808e-27}; // inline functions for performance @@ -177,13 +165,14 @@ inline double ipoly02(double x) /* P(x) in the range x > 2 */ int i; double b0, b1, b2; - b1 = 0.0; b0 = 0.0; x *= 2; - for (i = ERF_TERMS2; i >= 0; i--) - { - b2 = b1; - b1 = b0; - b0 = x * b1 - b2 + E2[i]; - } + b1 = 0.0; + b0 = 0.0; + x *= 2; + for (i = ERF_TERMS2; i >= 0; i--) { + b2 = b1; + b1 = b0; + b0 = x * b1 - b2 + E2[i]; + } return 0.5 * (b0 - b2); } @@ -195,13 +184,14 @@ inline double ipoly1(double x) int i; double b0, b1, b2; - b1 = 0.0; b0 = 0.0; x *= 2; - for (i = DERF_TERMS; i >= 0; i--) - { - b2 = b1; - b1 = b0; - b0 = x * b1 - b2 + DE1[i]; - } + b1 = 0.0; + b0 = 0.0; + x *= 2; + for (i = DERF_TERMS; i >= 0; i--) { + b2 = b1; + b1 = b0; + b0 = x * b1 - b2 + DE1[i]; + } return 0.5 * (b0 - b2); } @@ -213,13 +203,14 @@ inline double ipoly01(double x) int i; double b0, b1, b2; - b1 = 0.0; b0 = 0.0; x *= 2; - for (i = ERF_TERMS1; i >= 0; i--) - { - b2 = b1; - b1 = b0; - b0 = x * b1 - b2 + E1[i]; - } + b1 = 0.0; + b0 = 0.0; + x *= 2; + for (i = ERF_TERMS1; i >= 0; i--) { + b2 = b1; + b1 = b0; + b0 = x * b1 - b2 + E1[i]; + } return 0.5 * (b0 - b2); } @@ -230,28 +221,25 @@ inline double ierfoverx1(double x, double *df) // Computes Erf(x)/x and its first derivative double t, f; - double x2; // x squared + double x2; // x squared double exp_term, recip_x; - if (x < 2.0) - { - /* erf(x) = x * y(t) */ - /* t = 2 * (x/2)^2 - 1. */ - t = 0.5 * x * x - 1; - f = ipoly01(t); - *df = ipoly1(t) * x; - } - else - { - /* erf(x) = 1 - exp(-x^2)/x * y(t) */ - /* t = (10.5 - x^2) / (2.5 + x^2) */ - x2 = x * x; - t = (10.5 - x2) / (2.5 + x2); - exp_term = exp(-x2); - recip_x = 1.0 / x; - f = 1.0 / x - (exp_term / x2) * ipoly02(t); - *df = (1.12837916709551257389615890312 * exp_term - f) * recip_x; - } + if (x < 2.0) { + /* erf(x) = x * y(t) */ + /* t = 2 * (x/2)^2 - 1. */ + t = 0.5 * x * x - 1; + f = ipoly01(t); + *df = ipoly1(t) * x; + } else { + /* erf(x) = 1 - exp(-x^2)/x * y(t) */ + /* t = (10.5 - x^2) / (2.5 + x^2) */ + x2 = x * x; + t = (10.5 - x2) / (2.5 + x2); + exp_term = exp(-x2); + recip_x = 1.0 / x; + f = 1.0 / x - (exp_term / x2) * ipoly02(t); + *df = (1.12837916709551257389615890312 * exp_term - f) * recip_x; + } return f; } @@ -273,8 +261,7 @@ inline void ElecNucNuc(double q, double rc, double *ecoul, double *frc) /* ---------------------------------------------------------------------- */ -inline void ElecNucElec(double q, double rc, double re1, - double *ecoul, double *frc, double *fre1) +inline void ElecNucElec(double q, double rc, double re1, double *ecoul, double *frc, double *fre1) { double a, arc; double coeff_a; @@ -302,9 +289,8 @@ inline void ElecNucElec(double q, double rc, double re1, /* ---------------------------------------------------------------------- */ -inline void ElecElecElec(double rc, double re1, double re2, - double *ecoul, double *frc, double *fre1, - double *fre2) +inline void ElecElecElec(double rc, double re1, double re2, double *ecoul, double *frc, + double *fre1, double *fre2) { double a, arc, re, fre; double coeff_a; @@ -347,7 +333,7 @@ inline void ElecCoreNuc(double q, double rc, double re1, double *ecoul, double * double coeff_a; double E, dEdr, df, f; - coeff_a = 1.4142135623730951; /* sqrt(2) */ + coeff_a = 1.4142135623730951; /* sqrt(2) */ a = coeff_a / re1; arc = a * rc; @@ -361,8 +347,7 @@ inline void ElecCoreNuc(double q, double rc, double re1, double *ecoul, double * /* ---------------------------------------------------------------------- */ -inline void ElecCoreCore(double q, double rc, double re1, double re2, - double *ecoul, double *frc) +inline void ElecCoreCore(double q, double rc, double re1, double re2, double *ecoul, double *frc) { double a, arc, re; double coeff_a; @@ -384,10 +369,10 @@ inline void ElecCoreCore(double q, double rc, double re1, double re2, /* ---------------------------------------------------------------------- */ -inline void ElecCoreElec(double q, double rc, double re1, double re2, - double *ecoul, double *frc, double *fre2) +inline void ElecCoreElec(double q, double rc, double re1, double re2, double *ecoul, double *frc, + double *fre2) { - double a,arc, re; + double a, arc, re; double coeff_a; double E, dEdr, dEdr2, f, df, fre; @@ -419,8 +404,7 @@ inline void ElecCoreElec(double q, double rc, double re1, double re2, /* ---------------------------------------------------------------------- */ -inline void PauliElecElec(int samespin, double rc, - double re1, double re2, double *epauli, +inline void PauliElecElec(int samespin, double rc, double re1, double re2, double *epauli, double *frc, double *fre1, double *fre2) { double ree, rem; @@ -429,30 +413,31 @@ inline void PauliElecElec(int samespin, double rc, double dTdr1, dTdr2, dTdr; double O, dOdS, ratio; - re1 *= PAULI_RE; re2 *= PAULI_RE; rc *= PAULI_RC; + re1 *= PAULI_RE; + re2 *= PAULI_RE; + rc *= PAULI_RC; ree = re1 * re1 + re2 * re2; rem = re1 * re1 - re2 * re2; - S = (2.82842712474619 / pow((re2 / re1 + re1 / re2), 1.5)) * - exp(-rc * rc / ree); + S = (2.82842712474619 / pow((re2 / re1 + re1 / re2), 1.5)) * exp(-rc * rc / ree); - t1 = 1.5 * (1 / (re1 * re1) + 1 / (re2 * re2)); - t2 = 2.0 * (3 * ree - 2 * rc * rc) / (ree * ree); + t1 = 1.5 * (1 / (re1 * re1) + 1 / (re2 * re2)); + t2 = 2.0 * (3 * ree - 2 * rc * rc) / (ree * ree); tt = t1 - t2; dSdr1 = (-1.5 / re1) * (rem / ree) + 2 * re1 * rc * rc / (ree * ree); dSdr2 = (1.5 / re2) * (rem / ree) + 2 * re2 * rc * rc / (ree * ree); - dSdr = -2 * rc / ree; - dTdr1 = -3 / (re1 * re1 * re1) - 12 * re1 / (ree * ree) + 8 * re1 * - (-2 * rc * rc + 3 * ree) / (ree * ree * ree); - dTdr2 = -3 / (re2 * re2 * re2) - 12 * re2 / (ree * ree) + 8 * re2 * - (-2 * rc * rc + 3 * ree) / (ree * ree * ree); - dTdr = 8 * rc / (ree * ree); + dSdr = -2 * rc / ree; + dTdr1 = -3 / (re1 * re1 * re1) - 12 * re1 / (ree * ree) + + 8 * re1 * (-2 * rc * rc + 3 * ree) / (ree * ree * ree); + dTdr2 = -3 / (re2 * re2 * re2) - 12 * re2 / (ree * ree) + + 8 * re2 * (-2 * rc * rc + 3 * ree) / (ree * ree * ree); + dTdr = 8 * rc / (ree * ree); if (samespin == 1) { O = S * S / (1.0 - S * S) + (1 - PAULI_RHO) * S * S / (1.0 + S * S); dOdS = 2 * S / ((1.0 - S * S) * (1.0 - S * S)) + - (1 - PAULI_RHO) * 2 * S / ((1.0 + S * S) * (1.0 + S * S)); + (1 - PAULI_RHO) * 2 * S / ((1.0 + S * S) * (1.0 + S * S)); } else { O = -PAULI_RHO * S * S / (1.0 + S * S); dOdS = -PAULI_RHO * 2 * S / ((1.0 + S * S) * (1.0 + S * S)); @@ -461,14 +446,14 @@ inline void PauliElecElec(int samespin, double rc, ratio = tt * dOdS * S; *fre1 -= PAULI_RE * (dTdr1 * O + ratio * dSdr1); *fre2 -= PAULI_RE * (dTdr2 * O + ratio * dSdr2); - *frc -= PAULI_RC * (dTdr * O + ratio * dSdr); - *epauli += tt*O; + *frc -= PAULI_RC * (dTdr * O + ratio * dSdr); + *epauli += tt * O; } /* ---------------------------------------------------------------------- */ -inline void PauliCoreElec(double rc, double re2, double *epauli, double *frc, - double *fre2, double PAULI_CORE_A, double PAULI_CORE_B, double PAULI_CORE_C) +inline void PauliCoreElec(double rc, double re2, double *epauli, double *frc, double *fre2, + double PAULI_CORE_A, double PAULI_CORE_B, double PAULI_CORE_C) { double E, dEdrc, dEdre2, rcsq, ssq; @@ -477,11 +462,12 @@ inline void PauliCoreElec(double rc, double re2, double *epauli, double *frc, E = PAULI_CORE_A * exp((-PAULI_CORE_B * rcsq) / (ssq + PAULI_CORE_C)); - dEdrc = -2 * PAULI_CORE_A * PAULI_CORE_B * rc * exp(-PAULI_CORE_B * rcsq / - (ssq + PAULI_CORE_C)) / (ssq + PAULI_CORE_C); + dEdrc = -2 * PAULI_CORE_A * PAULI_CORE_B * rc * exp(-PAULI_CORE_B * rcsq / (ssq + PAULI_CORE_C)) / + (ssq + PAULI_CORE_C); - dEdre2 = 2 * PAULI_CORE_A * PAULI_CORE_B * re2 * rcsq * exp(-PAULI_CORE_B * rcsq / - (ssq + PAULI_CORE_C)) / ((PAULI_CORE_C + ssq)*(PAULI_CORE_C + ssq)); + dEdre2 = 2 * PAULI_CORE_A * PAULI_CORE_B * re2 * rcsq * + exp(-PAULI_CORE_B * rcsq / (ssq + PAULI_CORE_C)) / + ((PAULI_CORE_C + ssq) * (PAULI_CORE_C + ssq)); *epauli += E; *frc -= dEdrc; @@ -490,34 +476,32 @@ inline void PauliCoreElec(double rc, double re2, double *epauli, double *frc, /* ---------------------------------------------------------------------- */ -inline void PauliCorePElec(double rc, double re2, double *epauli, double *frc, - double *fre2, double PAULI_CORE_P_A, - double PAULI_CORE_P_B, double PAULI_CORE_P_C, - double PAULI_CORE_P_D, double PAULI_CORE_P_E) +inline void PauliCorePElec(double rc, double re2, double *epauli, double *frc, double *fre2, + double PAULI_CORE_P_A, double PAULI_CORE_P_B, double PAULI_CORE_P_C, + double PAULI_CORE_P_D, double PAULI_CORE_P_E) { double E, dEdrc, dEdre2; - E = PAULI_CORE_P_A * - pow((2.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B)), 5.0) * - pow((rc - PAULI_CORE_P_C * re2), 2.0) * exp(-PAULI_CORE_P_D * - pow((rc - PAULI_CORE_P_C * re2), 2.0) / (PAULI_CORE_P_E + re2 * re2)); + E = PAULI_CORE_P_A * pow((2.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B)), 5.0) * + pow((rc - PAULI_CORE_P_C * re2), 2.0) * + exp(-PAULI_CORE_P_D * pow((rc - PAULI_CORE_P_C * re2), 2.0) / (PAULI_CORE_P_E + re2 * re2)); - dEdrc = PAULI_CORE_P_A * - pow((2.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B)), 5.0) * - 2.0 * (rc - PAULI_CORE_P_C * re2) * exp(-PAULI_CORE_P_D * - pow((rc - PAULI_CORE_P_C * re2), 2.0) / (PAULI_CORE_P_E + re2 * re2)) - + E * (-PAULI_CORE_P_D * 2.0 * (rc - PAULI_CORE_P_C * re2) / - (PAULI_CORE_P_E + re2 * re2)); + dEdrc = PAULI_CORE_P_A * pow((2.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B)), 5.0) * 2.0 * + (rc - PAULI_CORE_P_C * re2) * + exp(-PAULI_CORE_P_D * pow((rc - PAULI_CORE_P_C * re2), 2.0) / + (PAULI_CORE_P_E + re2 * re2)) + + E * (-PAULI_CORE_P_D * 2.0 * (rc - PAULI_CORE_P_C * re2) / (PAULI_CORE_P_E + re2 * re2)); - dEdre2 = E * (-5.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B) * - (-PAULI_CORE_P_B / (re2 * re2) + 1.0 / PAULI_CORE_P_B)) - + PAULI_CORE_P_A * - pow((2.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B)), 5.0) * - 2.0 * (rc - PAULI_CORE_P_C * re2) * (-PAULI_CORE_P_C) * - exp(-PAULI_CORE_P_D * pow((rc - PAULI_CORE_P_C * re2), 2.0) / - (PAULI_CORE_P_E + re2 * re2)) + E * (2.0 * PAULI_CORE_P_D * - (rc - PAULI_CORE_P_C * re2) * (PAULI_CORE_P_C * PAULI_CORE_P_E + - rc * re2) / pow((PAULI_CORE_P_E + re2 * re2), 2.0)); + dEdre2 = E * + (-5.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B) * + (-PAULI_CORE_P_B / (re2 * re2) + 1.0 / PAULI_CORE_P_B)) + + PAULI_CORE_P_A * pow((2.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B)), 5.0) * 2.0 * + (rc - PAULI_CORE_P_C * re2) * (-PAULI_CORE_P_C) * + exp(-PAULI_CORE_P_D * pow((rc - PAULI_CORE_P_C * re2), 2.0) / + (PAULI_CORE_P_E + re2 * re2)) + + E * + (2.0 * PAULI_CORE_P_D * (rc - PAULI_CORE_P_C * re2) * + (PAULI_CORE_P_C * PAULI_CORE_P_E + rc * re2) / pow((PAULI_CORE_P_E + re2 * re2), 2.0)); *epauli += E; *frc -= dEdrc; @@ -526,8 +510,8 @@ inline void PauliCorePElec(double rc, double re2, double *epauli, double *frc, /* ---------------------------------------------------------------------- */ -inline void RForce(double dx, double dy, double dz, - double rc, double force, double *fx, double *fy, double *fz) +inline void RForce(double dx, double dy, double dz, double rc, double force, double *fx, double *fy, + double *fz) { force /= rc; *fx = force * dx; @@ -537,22 +521,29 @@ inline void RForce(double dx, double dy, double dz, /* ---------------------------------------------------------------------- */ -inline void SmallRForce(double dx, double dy, double dz, - double rc, double force, - double *fx, double *fy, double *fz) +inline void SmallRForce(double dx, double dy, double dz, double rc, double force, double *fx, + double *fy, double *fz) { /* Handles case where rc is small to avoid division by zero */ if (rc > 0.000001) { force /= rc; - *fx = force * dx; *fy = force * dy; *fz = force * dz; + *fx = force * dx; + *fy = force * dy; + *fz = force * dz; } else { - if (dx != 0) *fx = force / sqrt(1 + (dy * dy + dz * dz) / (dx * dx)); - else *fx = 0.0; - if (dy != 0) *fy = force / sqrt(1 + (dx * dx + dz * dz) / (dy * dy)); - else *fy = 0.0; - if (dz != 0) *fz = force / sqrt(1 + (dx * dx + dy * dy) / (dz * dz)); - else *fz = 0.0; + if (dx != 0) + *fx = force / sqrt(1 + (dy * dy + dz * dz) / (dx * dx)); + else + *fx = 0.0; + if (dy != 0) + *fy = force / sqrt(1 + (dx * dx + dz * dz) / (dy * dy)); + else + *fy = 0.0; + if (dz != 0) + *fz = force / sqrt(1 + (dx * dx + dy * dy) / (dz * dz)); + else + *fz = 0.0; // if (dx < 0) *fx = -*fx; // if (dy < 0) *fy = -*fy; // if (dz < 0) *fz = -*fz; @@ -583,4 +574,4 @@ inline double dcutoff(double x) return (((140 * x - 420) * x + 420) * x - 140) * x * x * x; } -} +} // namespace LAMMPS_NS diff --git a/src/USER-FEP/compute_fep.cpp b/src/USER-FEP/compute_fep.cpp index b055c24dec..683fbe114a 100644 --- a/src/USER-FEP/compute_fep.cpp +++ b/src/USER-FEP/compute_fep.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/compute_fep.h b/src/USER-FEP/compute_fep.h index 947634f5a7..d7f17abaf0 100644 --- a/src/USER-FEP/compute_fep.h +++ b/src/USER-FEP/compute_fep.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(fep,ComputeFEP) - +// clang-format off +ComputeStyle(fep,ComputeFEP); +// clang-format on #else #ifndef COMPUTE_FEP_H @@ -47,22 +47,22 @@ class ComputeFEP : public Compute { int nmax; double *q_orig; double **f_orig; - double eng_vdwl_orig,eng_coul_orig; + double eng_vdwl_orig, eng_coul_orig; double pvirial_orig[6]; - double *peatom_orig,**pvatom_orig; + double *peatom_orig, **pvatom_orig; double energy_orig; double kvirial_orig[6]; - double *keatom_orig,**kvatom_orig; + double *keatom_orig, **kvatom_orig; class Fix *fixgpu; struct Perturb { - int which,ivar; + int which, ivar; char *var; - char *pstyle,*pparam; - int ilo,ihi,jlo,jhi; + char *pstyle, *pparam; + int ilo, ihi, jlo, jhi; int pdim; - double **array,**array_orig; + double **array, **array_orig; int aparam; }; @@ -78,7 +78,7 @@ class ComputeFEP : public Compute { void restore_qfev(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/fix_adapt_fep.cpp b/src/USER-FEP/fix_adapt_fep.cpp index 7f17179087..b5aad03887 100644 --- a/src/USER-FEP/fix_adapt_fep.cpp +++ b/src/USER-FEP/fix_adapt_fep.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/fix_adapt_fep.h b/src/USER-FEP/fix_adapt_fep.h index 4846c6b7b9..2aadf373b5 100644 --- a/src/USER-FEP/fix_adapt_fep.h +++ b/src/USER-FEP/fix_adapt_fep.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(adapt/fep,FixAdaptFEP) - +// clang-format off +FixStyle(adapt/fep,FixAdaptFEP); +// clang-format on #else #ifndef LMP_FIX_ADAPT_FEP_H @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixAdaptFEP : public Fix { public: - int diamflag; // 1 if atom diameters will vary, for AtomVecGranular + int diamflag; // 1 if atom diameters will vary, for AtomVecGranular int chgflag; FixAdaptFEP(class LAMMPS *, int, char **); @@ -37,25 +37,25 @@ class FixAdaptFEP : public Fix { void setup_pre_force(int); void pre_force(int); void post_run(); - void setup_pre_force_respa(int,int); - void pre_force_respa(int,int,int); + void setup_pre_force_respa(int, int); + void pre_force_respa(int, int, int); void set_arrays(int); private: - int nadapt,resetflag,scaleflag,afterflag; + int nadapt, resetflag, scaleflag, afterflag; int anypair; int nlevels_respa; - char *id_fix_diam,*id_fix_chg; - class FixStore *fix_diam,*fix_chg; + char *id_fix_diam, *id_fix_chg; + class FixStore *fix_diam, *fix_chg; struct Adapt { - int which,ivar; + int which, ivar; char *var; - char *pstyle,*pparam; - int ilo,ihi,jlo,jhi; + char *pstyle, *pparam; + int ilo, ihi, jlo, jhi; int pdim; - double *scalar,scalar_orig; - double **array,**array_orig; + double *scalar, scalar_orig; + double **array, **array_orig; int aparam; }; @@ -66,7 +66,7 @@ class FixAdaptFEP : public Fix { void restore_settings(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_coul_cut_soft.cpp b/src/USER-FEP/pair_coul_cut_soft.cpp index a9a7e36bd6..877ca64cae 100644 --- a/src/USER-FEP/pair_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_coul_cut_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/pair_coul_cut_soft.h b/src/USER-FEP/pair_coul_cut_soft.h index 8aa6e2232e..92f1fc6efc 100644 --- a/src/USER-FEP/pair_coul_cut_soft.h +++ b/src/USER-FEP/pair_coul_cut_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/cut/soft,PairCoulCutSoft) - +// clang-format off +PairStyle(coul/cut/soft,PairCoulCutSoft); +// clang-format on #else #ifndef LMP_PAIR_COUL_CUT_SOFT_H @@ -52,7 +52,7 @@ class PairCoulCutSoft : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_coul_long_soft.cpp b/src/USER-FEP/pair_coul_long_soft.cpp index 95285bdf4b..74f1909415 100644 --- a/src/USER-FEP/pair_coul_long_soft.cpp +++ b/src/USER-FEP/pair_coul_long_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/pair_coul_long_soft.h b/src/USER-FEP/pair_coul_long_soft.h index 7acbaaaffc..f5e2e52642 100644 --- a/src/USER-FEP/pair_coul_long_soft.h +++ b/src/USER-FEP/pair_coul_long_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/long/soft,PairCoulLongSoft) - +// clang-format off +PairStyle(coul/long/soft,PairCoulLongSoft); +// clang-format on #else #ifndef LMP_PAIR_COUL_LONG_SOFT_H @@ -41,18 +41,18 @@ class PairCoulLongSoft : public Pair { virtual void *extract(const char *, int &); protected: - double cut_coul,cut_coulsq; + double cut_coul, cut_coulsq; double **scale; double **lambda; double nlambda, alphac; double **lam1, **lam2; - double qdist; // TIP4P distance O to negative charge (compatibility of cutoffs) + double qdist; // TIP4P distance O to negative charge (compatibility of cutoffs) double g_ewald; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp index 27968182e7..2460dbf313 100644 --- a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/pair_lj_charmm_coul_long_soft.h b/src/USER-FEP/pair_lj_charmm_coul_long_soft.h index 1061010bb9..45cdcaf0d2 100644 --- a/src/USER-FEP/pair_lj_charmm_coul_long_soft.h +++ b/src/USER-FEP/pair_lj_charmm_coul_long_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/long/soft,PairLJCharmmCoulLongSoft) - +// clang-format off +PairStyle(lj/charmm/coul/long/soft,PairLJCharmmCoulLongSoft); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_SOFT_H @@ -49,22 +49,22 @@ class PairLJCharmmCoulLongSoft : public Pair { protected: int implicit; - double cut_lj_inner,cut_lj; - double cut_lj_innersq,cut_ljsq; - double cut_coul,cut_coulsq; + double cut_lj_inner, cut_lj; + double cut_lj_innersq, cut_ljsq; + double cut_coul, cut_coulsq; double cut_bothsq; double denom_lj; - double **epsilon,**sigma,**eps14,**sigma14,**lambda; + double **epsilon, **sigma, **eps14, **sigma14, **lambda; double nlambda, alphalj, alphac; - double **lj1,**lj2,**lj3,**lj4,**offset; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; + double **lj1, **lj2, **lj3, **lj4, **offset; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; double *cut_respa; double g_ewald; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp b/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp index 8b462b0ac7..6b6501f936 100644 --- a/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/pair_lj_class2_coul_cut_soft.h b/src/USER-FEP/pair_lj_class2_coul_cut_soft.h index f35dd00a26..8533862b0a 100644 --- a/src/USER-FEP/pair_lj_class2_coul_cut_soft.h +++ b/src/USER-FEP/pair_lj_class2_coul_cut_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/coul/cut/soft,PairLJClass2CoulCutSoft) - +// clang-format off +PairStyle(lj/class2/coul/cut/soft,PairLJClass2CoulCutSoft); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_COUL_CUT_SOFT_H @@ -43,17 +43,17 @@ class PairLJClass2CoulCutSoft : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **epsilon,**sigma, **lambda; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **epsilon, **sigma, **lambda; double nlambda, alphalj, alphac; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **lj1, **lj2, **lj3, **lj4, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp b/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp index 90f65c9ae5..c32a3ef884 100644 --- a/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/pair_lj_class2_coul_long_soft.h b/src/USER-FEP/pair_lj_class2_coul_long_soft.h index 2a38c1db7b..0b7212686b 100644 --- a/src/USER-FEP/pair_lj_class2_coul_long_soft.h +++ b/src/USER-FEP/pair_lj_class2_coul_long_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/coul/long/soft,PairLJClass2CoulLongSoft) - +// clang-format off +PairStyle(lj/class2/coul/long/soft,PairLJClass2CoulLongSoft); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_COUL_LONG_SOFT_H @@ -44,17 +44,17 @@ class PairLJClass2CoulLongSoft : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma, **lambda; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma, **lambda; double nlambda, alphalj, alphac; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **lj1, **lj2, **lj3, **lj4, **offset; double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_class2_soft.cpp b/src/USER-FEP/pair_lj_class2_soft.cpp index df8d1aaab6..e43c02a50d 100644 --- a/src/USER-FEP/pair_lj_class2_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/pair_lj_class2_soft.h b/src/USER-FEP/pair_lj_class2_soft.h index f107ae1fbc..32930b9b86 100644 --- a/src/USER-FEP/pair_lj_class2_soft.h +++ b/src/USER-FEP/pair_lj_class2_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + 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 @@ -10,9 +10,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/soft,PairLJClass2Soft) - +// clang-format off +PairStyle(lj/class2/soft,PairLJClass2Soft); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_SOFT_H @@ -44,12 +44,12 @@ class PairLJClass2Soft : public Pair { double **cut; double **epsilon, **sigma, **lambda; double nlambda, alphalj; - double **lj1,**lj2,**lj3,**offset; + double **lj1, **lj2, **lj3, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp index abe683385e..49d6d84957 100644 --- a/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/pair_lj_cut_coul_cut_soft.h b/src/USER-FEP/pair_lj_cut_coul_cut_soft.h index 1a3f213c04..3d03da1b7d 100644 --- a/src/USER-FEP/pair_lj_cut_coul_cut_soft.h +++ b/src/USER-FEP/pair_lj_cut_coul_cut_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/cut/soft,PairLJCutCoulCutSoft) - +// clang-format off +PairStyle(lj/cut/coul/cut/soft,PairLJCutCoulCutSoft); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_CUT_SOFT_H @@ -43,17 +43,17 @@ class PairLJCutCoulCutSoft : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **epsilon,**sigma, **lambda; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **epsilon, **sigma, **lambda; double nlambda, alphalj, alphac; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **lj1, **lj2, **lj3, **lj4, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp index 608e4a8244..0d81fb17cd 100644 --- a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/pair_lj_cut_coul_long_soft.h b/src/USER-FEP/pair_lj_cut_coul_long_soft.h index 0abd33b3e5..b82c673dc5 100644 --- a/src/USER-FEP/pair_lj_cut_coul_long_soft.h +++ b/src/USER-FEP/pair_lj_cut_coul_long_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/long/soft,PairLJCutCoulLongSoft) - +// clang-format off +PairStyle(lj/cut/coul/long/soft,PairLJCutCoulLongSoft); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_LONG_SOFT_H @@ -48,19 +48,19 @@ class PairLJCutCoulLongSoft : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma, **lambda; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma, **lambda; double nlambda, alphalj, alphac; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; - double qdist; // TIP4P distance O to negative charge (compatibility of cutoffs) + double qdist; // TIP4P distance O to negative charge (compatibility of cutoffs) double g_ewald; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_soft.cpp index 8c2f878a8d..0934a91255 100644 --- a/src/USER-FEP/pair_lj_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/pair_lj_cut_soft.h b/src/USER-FEP/pair_lj_cut_soft.h index 8795b4fb16..00f579823c 100644 --- a/src/USER-FEP/pair_lj_cut_soft.h +++ b/src/USER-FEP/pair_lj_cut_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/soft,PairLJCutSoft) - +// clang-format off +PairStyle(lj/cut/soft,PairLJCutSoft); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_SOFT_H @@ -49,15 +49,15 @@ class PairLJCutSoft : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma, **lambda; + double **epsilon, **sigma, **lambda; double nlambda, alphalj; - double **lj1,**lj2,**lj3,**offset; + double **lj1, **lj2, **lj3, **offset; double *cut_respa; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp index 7f9519083c..3cd374b1e4 100644 --- a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.h b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.h index c95d7e162d..cf6ac22126 100644 --- a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.h +++ b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/tip4p/long/soft,PairLJCutTIP4PLongSoft) - +// clang-format off +PairStyle(lj/cut/tip4p/long/soft,PairLJCutTIP4PLongSoft); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_TIP4P_LONG_SOFT_H @@ -38,19 +38,19 @@ class PairLJCutTIP4PLongSoft : public PairLJCutCoulLongSoft { virtual double memory_usage(); protected: - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_morse_soft.cpp b/src/USER-FEP/pair_morse_soft.cpp index d429503237..2e228ef2ca 100644 --- a/src/USER-FEP/pair_morse_soft.cpp +++ b/src/USER-FEP/pair_morse_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/pair_morse_soft.h b/src/USER-FEP/pair_morse_soft.h index 14cc51a90f..e15658bfc0 100644 --- a/src/USER-FEP/pair_morse_soft.h +++ b/src/USER-FEP/pair_morse_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -15,9 +15,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(morse/soft,PairMorseSoft) - +// clang-format off +PairStyle(morse/soft,PairMorseSoft); +// clang-format on #else #ifndef LMP_PAIR_MORSE_SOFT_H @@ -29,7 +29,7 @@ namespace LAMMPS_NS { class PairMorseSoft : public PairMorse { public: - PairMorseSoft(class LAMMPS *lmp) : PairMorse(lmp), lambda(nullptr) {}; + PairMorseSoft(class LAMMPS *lmp) : PairMorse(lmp), lambda(nullptr){}; virtual ~PairMorseSoft(); virtual void compute(int, int); @@ -55,7 +55,7 @@ class PairMorseSoft : public PairMorse { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_tip4p_long_soft.cpp b/src/USER-FEP/pair_tip4p_long_soft.cpp index a72a0eb024..5a04e29a5a 100644 --- a/src/USER-FEP/pair_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_tip4p_long_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-FEP/pair_tip4p_long_soft.h b/src/USER-FEP/pair_tip4p_long_soft.h index 406a47a2ea..9df7847993 100644 --- a/src/USER-FEP/pair_tip4p_long_soft.h +++ b/src/USER-FEP/pair_tip4p_long_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tip4p/long/soft,PairTIP4PLongSoft) - +// clang-format off +PairStyle(tip4p/long/soft,PairTIP4PLongSoft); +// clang-format on #else #ifndef LMP_PAIR_TIP4P_LONG_SOFT_H @@ -38,19 +38,19 @@ class PairTIP4PLongSoft : public PairCoulLongSoft { virtual double memory_usage(); protected: - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-H5MD/dump_h5md.cpp b/src/USER-H5MD/dump_h5md.cpp index d22f31bbe2..46c587a992 100644 --- a/src/USER-H5MD/dump_h5md.cpp +++ b/src/USER-H5MD/dump_h5md.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-H5MD/dump_h5md.h b/src/USER-H5MD/dump_h5md.h index 967bfed7fa..28b74649c6 100644 --- a/src/USER-H5MD/dump_h5md.h +++ b/src/USER-H5MD/dump_h5md.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,27 +13,27 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(h5md,DumpH5MD) - +// clang-format off +DumpStyle(h5md,DumpH5MD); +// clang-format on #else #ifndef LMP_DUMP_H5MD_H #define LMP_DUMP_H5MD_H -#include "dump.h" #include "ch5md.h" +#include "dump.h" namespace LAMMPS_NS { class DumpH5MD : public Dump { public: - DumpH5MD(class LAMMPS *, int, char**); + DumpH5MD(class LAMMPS *, int, char **); virtual ~DumpH5MD(); private: - int natoms,ntotal; - int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no + int natoms, ntotal; + int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no h5md_file datafile; int datafile_from_dump; h5md_particles_group particles_data; @@ -68,7 +68,7 @@ class DumpH5MD : public Dump { void write_fixed_frame(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-INTEL/angle_charmm_intel.cpp b/src/USER-INTEL/angle_charmm_intel.cpp index bab6333580..9284150522 100644 --- a/src/USER-INTEL/angle_charmm_intel.cpp +++ b/src/USER-INTEL/angle_charmm_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/angle_charmm_intel.h b/src/USER-INTEL/angle_charmm_intel.h index 7ee04ba8d9..ede6b46609 100644 --- a/src/USER-INTEL/angle_charmm_intel.h +++ b/src/USER-INTEL/angle_charmm_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(charmm/intel,AngleCharmmIntel) - +// clang-format off +AngleStyle(charmm/intel,AngleCharmmIntel); +// clang-format on #else #ifndef LMP_ANGLE_CHARMM_INTEL_H diff --git a/src/USER-INTEL/angle_harmonic_intel.cpp b/src/USER-INTEL/angle_harmonic_intel.cpp index e3b310558e..6a7a5c2fe2 100644 --- a/src/USER-INTEL/angle_harmonic_intel.cpp +++ b/src/USER-INTEL/angle_harmonic_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/angle_harmonic_intel.h b/src/USER-INTEL/angle_harmonic_intel.h index 5efd663cea..67983b2868 100644 --- a/src/USER-INTEL/angle_harmonic_intel.h +++ b/src/USER-INTEL/angle_harmonic_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(harmonic/intel,AngleHarmonicIntel) - +// clang-format off +AngleStyle(harmonic/intel,AngleHarmonicIntel); +// clang-format on #else #ifndef LMP_ANGLE_HARMONIC_INTEL_H diff --git a/src/USER-INTEL/bond_fene_intel.cpp b/src/USER-INTEL/bond_fene_intel.cpp index 6b0c7c6f38..0efcdafaef 100644 --- a/src/USER-INTEL/bond_fene_intel.cpp +++ b/src/USER-INTEL/bond_fene_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/bond_fene_intel.h b/src/USER-INTEL/bond_fene_intel.h index 13bcc35e97..938bd1515f 100644 --- a/src/USER-INTEL/bond_fene_intel.h +++ b/src/USER-INTEL/bond_fene_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(fene/intel,BondFENEIntel) - +// clang-format off +BondStyle(fene/intel,BondFENEIntel); +// clang-format on #else #ifndef LMP_BOND_FENE_INTEL_H diff --git a/src/USER-INTEL/bond_harmonic_intel.cpp b/src/USER-INTEL/bond_harmonic_intel.cpp index 2697182c1d..db531ee650 100644 --- a/src/USER-INTEL/bond_harmonic_intel.cpp +++ b/src/USER-INTEL/bond_harmonic_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/bond_harmonic_intel.h b/src/USER-INTEL/bond_harmonic_intel.h index 234d75bda4..1744153a77 100644 --- a/src/USER-INTEL/bond_harmonic_intel.h +++ b/src/USER-INTEL/bond_harmonic_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(harmonic/intel,BondHarmonicIntel) - +// clang-format off +BondStyle(harmonic/intel,BondHarmonicIntel); +// clang-format on #else #ifndef LMP_BOND_HARMONIC_INTEL_H diff --git a/src/USER-INTEL/dihedral_charmm_intel.cpp b/src/USER-INTEL/dihedral_charmm_intel.cpp index bf3cd55cea..c49768afe6 100644 --- a/src/USER-INTEL/dihedral_charmm_intel.cpp +++ b/src/USER-INTEL/dihedral_charmm_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/dihedral_charmm_intel.h b/src/USER-INTEL/dihedral_charmm_intel.h index 1cca32468b..9e17f46dd9 100644 --- a/src/USER-INTEL/dihedral_charmm_intel.h +++ b/src/USER-INTEL/dihedral_charmm_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(charmm/intel,DihedralCharmmIntel) - +// clang-format off +DihedralStyle(charmm/intel,DihedralCharmmIntel); +// clang-format on #else #ifndef LMP_DIHEDRAL_CHARMM_INTEL_H diff --git a/src/USER-INTEL/dihedral_fourier_intel.cpp b/src/USER-INTEL/dihedral_fourier_intel.cpp index 2f52cfe50d..d8a500b40e 100644 --- a/src/USER-INTEL/dihedral_fourier_intel.cpp +++ b/src/USER-INTEL/dihedral_fourier_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/dihedral_fourier_intel.h b/src/USER-INTEL/dihedral_fourier_intel.h index ce446eec0d..5c480981c5 100644 --- a/src/USER-INTEL/dihedral_fourier_intel.h +++ b/src/USER-INTEL/dihedral_fourier_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(fourier/intel,DihedralFourierIntel) - +// clang-format off +DihedralStyle(fourier/intel,DihedralFourierIntel); +// clang-format on #else #ifndef LMP_DIHEDRAL_FOURIER_INTEL_H diff --git a/src/USER-INTEL/dihedral_harmonic_intel.cpp b/src/USER-INTEL/dihedral_harmonic_intel.cpp index d0351d56ab..82eb87e90f 100644 --- a/src/USER-INTEL/dihedral_harmonic_intel.cpp +++ b/src/USER-INTEL/dihedral_harmonic_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/dihedral_harmonic_intel.h b/src/USER-INTEL/dihedral_harmonic_intel.h index 75570f2444..7508edbec1 100644 --- a/src/USER-INTEL/dihedral_harmonic_intel.h +++ b/src/USER-INTEL/dihedral_harmonic_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(harmonic/intel,DihedralHarmonicIntel) - +// clang-format off +DihedralStyle(harmonic/intel,DihedralHarmonicIntel); +// clang-format on #else #ifndef LMP_DIHEDRAL_HARMONIC_INTEL_H diff --git a/src/USER-INTEL/dihedral_opls_intel.cpp b/src/USER-INTEL/dihedral_opls_intel.cpp index 58a636f143..a19482a2d8 100644 --- a/src/USER-INTEL/dihedral_opls_intel.cpp +++ b/src/USER-INTEL/dihedral_opls_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/dihedral_opls_intel.h b/src/USER-INTEL/dihedral_opls_intel.h index b34777748d..456a5af9b9 100644 --- a/src/USER-INTEL/dihedral_opls_intel.h +++ b/src/USER-INTEL/dihedral_opls_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(opls/intel,DihedralOPLSIntel) - +// clang-format off +DihedralStyle(opls/intel,DihedralOPLSIntel); +// clang-format on #else #ifndef LMP_DIHEDRAL_OPLS_INTEL_H diff --git a/src/USER-INTEL/fix_intel.cpp b/src/USER-INTEL/fix_intel.cpp index 6c7e108ca6..edec1f0c42 100644 --- a/src/USER-INTEL/fix_intel.cpp +++ b/src/USER-INTEL/fix_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/fix_intel.h b/src/USER-INTEL/fix_intel.h index 46ebd95b6a..8bc3e80780 100644 --- a/src/USER-INTEL/fix_intel.h +++ b/src/USER-INTEL/fix_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(INTEL,FixIntel) - +// clang-format off +FixStyle(INTEL,FixIntel); +// clang-format on #else #ifndef LMP_FIX_INTEL_H diff --git a/src/USER-INTEL/fix_nh_intel.cpp b/src/USER-INTEL/fix_nh_intel.cpp index 6105892041..5370e3a13f 100644 --- a/src/USER-INTEL/fix_nh_intel.cpp +++ b/src/USER-INTEL/fix_nh_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/fix_nh_intel.h b/src/USER-INTEL/fix_nh_intel.h index a2a53bb616..3d1a9c389f 100644 --- a/src/USER-INTEL/fix_nh_intel.h +++ b/src/USER-INTEL/fix_nh_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/fix_npt_intel.cpp b/src/USER-INTEL/fix_npt_intel.cpp index 3f48130f99..d014b34d62 100644 --- a/src/USER-INTEL/fix_npt_intel.cpp +++ b/src/USER-INTEL/fix_npt_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/fix_npt_intel.h b/src/USER-INTEL/fix_npt_intel.h index f383035050..5bf0c6dbe6 100644 --- a/src/USER-INTEL/fix_npt_intel.h +++ b/src/USER-INTEL/fix_npt_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt/intel,FixNPTIntel) - +// clang-format off +FixStyle(npt/intel,FixNPTIntel); +// clang-format on #else #ifndef LMP_FIX_NPT_INTEL_H diff --git a/src/USER-INTEL/fix_nve_asphere_intel.cpp b/src/USER-INTEL/fix_nve_asphere_intel.cpp index 87a1731b50..78504c237a 100644 --- a/src/USER-INTEL/fix_nve_asphere_intel.cpp +++ b/src/USER-INTEL/fix_nve_asphere_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/fix_nve_asphere_intel.h b/src/USER-INTEL/fix_nve_asphere_intel.h index 91e4240369..39d87a2a73 100644 --- a/src/USER-INTEL/fix_nve_asphere_intel.h +++ b/src/USER-INTEL/fix_nve_asphere_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/asphere/intel,FixNVEAsphereIntel) - +// clang-format off +FixStyle(nve/asphere/intel,FixNVEAsphereIntel); +// clang-format on #else #ifndef LMP_FIX_NVE_ASPHERE_INTEL_H diff --git a/src/USER-INTEL/fix_nve_intel.cpp b/src/USER-INTEL/fix_nve_intel.cpp index 713a5eea55..fb90946da0 100644 --- a/src/USER-INTEL/fix_nve_intel.cpp +++ b/src/USER-INTEL/fix_nve_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/fix_nve_intel.h b/src/USER-INTEL/fix_nve_intel.h index 1725f4266c..17ead378a9 100644 --- a/src/USER-INTEL/fix_nve_intel.h +++ b/src/USER-INTEL/fix_nve_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/intel,FixNVEIntel) - +// clang-format off +FixStyle(nve/intel,FixNVEIntel); +// clang-format on #else #ifndef LMP_FIX_NVE_INTEL_H diff --git a/src/USER-INTEL/fix_nvt_intel.cpp b/src/USER-INTEL/fix_nvt_intel.cpp index 61259fba2f..6ef0c9bedc 100644 --- a/src/USER-INTEL/fix_nvt_intel.cpp +++ b/src/USER-INTEL/fix_nvt_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/fix_nvt_intel.h b/src/USER-INTEL/fix_nvt_intel.h index 839e561b0f..28cd3a4ebc 100644 --- a/src/USER-INTEL/fix_nvt_intel.h +++ b/src/USER-INTEL/fix_nvt_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/intel,FixNVTIntel) - +// clang-format off +FixStyle(nvt/intel,FixNVTIntel); +// clang-format on #else #ifndef LMP_FIX_NVT_INTEL_H diff --git a/src/USER-INTEL/fix_nvt_sllod_intel.cpp b/src/USER-INTEL/fix_nvt_sllod_intel.cpp index efe124cb2d..f704512c51 100644 --- a/src/USER-INTEL/fix_nvt_sllod_intel.cpp +++ b/src/USER-INTEL/fix_nvt_sllod_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/fix_nvt_sllod_intel.h b/src/USER-INTEL/fix_nvt_sllod_intel.h index f6cd9638f2..a08893f85e 100644 --- a/src/USER-INTEL/fix_nvt_sllod_intel.h +++ b/src/USER-INTEL/fix_nvt_sllod_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/sllod/intel,FixNVTSllodIntel) - +// clang-format off +FixStyle(nvt/sllod/intel,FixNVTSllodIntel); +// clang-format on #else #ifndef LMP_FIX_NVTSLLOD_INTEL_H diff --git a/src/USER-INTEL/improper_cvff_intel.cpp b/src/USER-INTEL/improper_cvff_intel.cpp index 60c36f066f..9fe1ad8eb1 100644 --- a/src/USER-INTEL/improper_cvff_intel.cpp +++ b/src/USER-INTEL/improper_cvff_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/improper_cvff_intel.h b/src/USER-INTEL/improper_cvff_intel.h index cc752e1501..2c740ba90b 100644 --- a/src/USER-INTEL/improper_cvff_intel.h +++ b/src/USER-INTEL/improper_cvff_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(cvff/intel,ImproperCvffIntel) - +// clang-format off +ImproperStyle(cvff/intel,ImproperCvffIntel); +// clang-format on #else #ifndef LMP_IMPROPER_CVFF_INTEL_H diff --git a/src/USER-INTEL/improper_harmonic_intel.cpp b/src/USER-INTEL/improper_harmonic_intel.cpp index e52b40f99f..c5bf84b2d5 100644 --- a/src/USER-INTEL/improper_harmonic_intel.cpp +++ b/src/USER-INTEL/improper_harmonic_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/improper_harmonic_intel.h b/src/USER-INTEL/improper_harmonic_intel.h index ccd1543c17..14ca7b12d6 100644 --- a/src/USER-INTEL/improper_harmonic_intel.h +++ b/src/USER-INTEL/improper_harmonic_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(harmonic/intel,ImproperHarmonicIntel) - +// clang-format off +ImproperStyle(harmonic/intel,ImproperHarmonicIntel); +// clang-format on #else #ifndef LMP_IMPROPER_HARMONIC_INTEL_H diff --git a/src/USER-INTEL/intel_buffers.cpp b/src/USER-INTEL/intel_buffers.cpp index 925900875f..4efd61bac9 100644 --- a/src/USER-INTEL/intel_buffers.cpp +++ b/src/USER-INTEL/intel_buffers.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-INTEL/intel_buffers.h b/src/USER-INTEL/intel_buffers.h index eafe3ad845..607cc2fd82 100644 --- a/src/USER-INTEL/intel_buffers.h +++ b/src/USER-INTEL/intel_buffers.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/intel_intrinsics.h b/src/USER-INTEL/intel_intrinsics.h index 34ba902a67..a17cc2859a 100644 --- a/src/USER-INTEL/intel_intrinsics.h +++ b/src/USER-INTEL/intel_intrinsics.h @@ -1,6 +1,7 @@ +// clang-format off /* *- c++ -*- ----------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/intel_intrinsics_airebo.h b/src/USER-INTEL/intel_intrinsics_airebo.h index cadf80bbe8..f49abbaf3d 100644 --- a/src/USER-INTEL/intel_intrinsics_airebo.h +++ b/src/USER-INTEL/intel_intrinsics_airebo.h @@ -1,3 +1,4 @@ +// clang-format off #ifndef LMP_INTEL_AIREBO_SCALAR # ifdef __INTEL_COMPILER # if defined(__MIC__) || defined(__AVX512F__) diff --git a/src/USER-INTEL/intel_preprocess.h b/src/USER-INTEL/intel_preprocess.h index 2e7101b42d..c082bb237f 100644 --- a/src/USER-INTEL/intel_preprocess.h +++ b/src/USER-INTEL/intel_preprocess.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/intel_simd.h b/src/USER-INTEL/intel_simd.h index 01fa1c0a45..165455a33d 100644 --- a/src/USER-INTEL/intel_simd.h +++ b/src/USER-INTEL/intel_simd.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/math_extra_intel.h b/src/USER-INTEL/math_extra_intel.h index 679ca635e1..0c081a4725 100644 --- a/src/USER-INTEL/math_extra_intel.h +++ b/src/USER-INTEL/math_extra_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/nbin_intel.cpp b/src/USER-INTEL/nbin_intel.cpp index 31b53e3462..5227b6c521 100644 --- a/src/USER-INTEL/nbin_intel.cpp +++ b/src/USER-INTEL/nbin_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/nbin_intel.h b/src/USER-INTEL/nbin_intel.h index e83b314c6f..488e1ace6b 100644 --- a/src/USER-INTEL/nbin_intel.h +++ b/src/USER-INTEL/nbin_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef NBIN_CLASS - +// clang-format off NBinStyle(intel, NBinIntel, - NB_STANDARD | NB_INTEL) - + NB_STANDARD | NB_INTEL); +// clang-format on #else #ifndef LMP_NBIN_INTEL_H diff --git a/src/USER-INTEL/npair_full_bin_ghost_intel.cpp b/src/USER-INTEL/npair_full_bin_ghost_intel.cpp index d15c5d9d4e..50f98bf746 100644 --- a/src/USER-INTEL/npair_full_bin_ghost_intel.cpp +++ b/src/USER-INTEL/npair_full_bin_ghost_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/npair_full_bin_ghost_intel.h b/src/USER-INTEL/npair_full_bin_ghost_intel.h index a352f89f75..b4a1176d17 100644 --- a/src/USER-INTEL/npair_full_bin_ghost_intel.h +++ b/src/USER-INTEL/npair_full_bin_ghost_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,12 +17,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/bin/ghost/intel, NPairFullBinGhostIntel, NP_FULL | NP_BIN | NP_GHOST | NP_NEWTON | NP_NEWTOFF | - NP_ORTHO | NP_TRI | NP_INTEL) - + NP_ORTHO | NP_TRI | NP_INTEL); +// clang-format on #else #ifndef LMP_NPAIR_FULL_BIN_GHOST_INTEL_H diff --git a/src/USER-INTEL/npair_full_bin_intel.cpp b/src/USER-INTEL/npair_full_bin_intel.cpp index 7d16955493..4b84c72081 100644 --- a/src/USER-INTEL/npair_full_bin_intel.cpp +++ b/src/USER-INTEL/npair_full_bin_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/npair_full_bin_intel.h b/src/USER-INTEL/npair_full_bin_intel.h index e5d8e0751e..f77557d840 100644 --- a/src/USER-INTEL/npair_full_bin_intel.h +++ b/src/USER-INTEL/npair_full_bin_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/bin/intel, NPairFullBinIntel, NP_FULL | NP_BIN | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | - NP_INTEL) + NP_INTEL); +// clang-format on #else #ifndef LMP_NPAIR_FULL_BIN_INTEL_H diff --git a/src/USER-INTEL/npair_half_bin_newton_intel.cpp b/src/USER-INTEL/npair_half_bin_newton_intel.cpp index 5b886d3de3..abaddde84c 100644 --- a/src/USER-INTEL/npair_half_bin_newton_intel.cpp +++ b/src/USER-INTEL/npair_half_bin_newton_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/npair_half_bin_newton_intel.h b/src/USER-INTEL/npair_half_bin_newton_intel.h index 17a1785a94..18a6f0c103 100644 --- a/src/USER-INTEL/npair_half_bin_newton_intel.h +++ b/src/USER-INTEL/npair_half_bin_newton_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/newton/intel, NPairHalfBinNewtonIntel, - NP_HALF | NP_BIN | NP_NEWTON | NP_ORTHO | NP_INTEL) - + NP_HALF | NP_BIN | NP_NEWTON | NP_ORTHO | NP_INTEL); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_NEWTON_INTEL_H diff --git a/src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp b/src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp index 3c3680af03..264407b1bf 100644 --- a/src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp +++ b/src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/npair_half_bin_newton_tri_intel.h b/src/USER-INTEL/npair_half_bin_newton_tri_intel.h index 3e2ae2f25d..4603913e49 100644 --- a/src/USER-INTEL/npair_half_bin_newton_tri_intel.h +++ b/src/USER-INTEL/npair_half_bin_newton_tri_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +13,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/newton/tri/intel, NPairHalfBinNewtonTriIntel, - NP_HALF | NP_BIN | NP_NEWTON | NP_TRI | NP_INTEL) - + NP_HALF | NP_BIN | NP_NEWTON | NP_TRI | NP_INTEL); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_NEWTON_INTEL_TRI_H diff --git a/src/USER-INTEL/npair_halffull_newtoff_intel.h b/src/USER-INTEL/npair_halffull_newtoff_intel.h index b606343cb5..5383808651 100644 --- a/src/USER-INTEL/npair_halffull_newtoff_intel.h +++ b/src/USER-INTEL/npair_halffull_newtoff_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,27 +20,27 @@ // standard routines. #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(halffull/newtoff/intel, NPairHalffullNewtoff, NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_HALF | - NP_ORTHO | NP_TRI | NP_INTEL) + NP_ORTHO | NP_TRI | NP_INTEL); NPairStyle(halffull/newtoff/skip/intel, NPairHalffullNewtoff, NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_HALF | - NP_ORTHO | NP_TRI | NP_SKIP | NP_INTEL) + NP_ORTHO | NP_TRI | NP_SKIP | NP_INTEL); NPairStyle(halffull/newtoff/ghost/intel, NPairHalffullNewtoff, NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_HALF | - NP_ORTHO | NP_TRI | NP_GHOST | NP_INTEL) + NP_ORTHO | NP_TRI | NP_GHOST | NP_INTEL); NPairStyle(halffull/newtoff/skip/ghost/intel, NPairHalffullNewtoff, NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_HALF | - NP_ORTHO | NP_TRI | NP_SKIP | NP_GHOST | NP_INTEL) - + NP_ORTHO | NP_TRI | NP_SKIP | NP_GHOST | NP_INTEL); +// clang-format on #endif /* ERROR/WARNING messages: diff --git a/src/USER-INTEL/npair_halffull_newton_intel.cpp b/src/USER-INTEL/npair_halffull_newton_intel.cpp index b45c1a8023..9b9e96aeca 100644 --- a/src/USER-INTEL/npair_halffull_newton_intel.cpp +++ b/src/USER-INTEL/npair_halffull_newton_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/npair_halffull_newton_intel.h b/src/USER-INTEL/npair_halffull_newton_intel.h index 5f727ac692..614d975926 100644 --- a/src/USER-INTEL/npair_halffull_newton_intel.h +++ b/src/USER-INTEL/npair_halffull_newton_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,17 +17,17 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(halffull/newton/intel, NPairHalffullNewtonIntel, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI| NP_INTEL) + NP_ORTHO | NP_TRI| NP_INTEL); NPairStyle(halffull/newton/skip/intel, NPairHalffullNewtonIntel, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | - NP_ORTHO | NP_TRI | NP_SKIP | NP_INTEL) - + NP_ORTHO | NP_TRI | NP_SKIP | NP_INTEL); +// clang-format on #else #ifndef LMP_NPAIR_HALFFULL_NEWTON_INTEL_H diff --git a/src/USER-INTEL/npair_intel.cpp b/src/USER-INTEL/npair_intel.cpp index c224775a26..643ceff8f3 100644 --- a/src/USER-INTEL/npair_intel.cpp +++ b/src/USER-INTEL/npair_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/npair_intel.h b/src/USER-INTEL/npair_intel.h index 191c5385f5..7c21e683ad 100644 --- a/src/USER-INTEL/npair_intel.h +++ b/src/USER-INTEL/npair_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/npair_skip_intel.cpp b/src/USER-INTEL/npair_skip_intel.cpp index 53900f116f..32da0abff8 100644 --- a/src/USER-INTEL/npair_skip_intel.cpp +++ b/src/USER-INTEL/npair_skip_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/npair_skip_intel.h b/src/USER-INTEL/npair_skip_intel.h index 0e9494f941..e431a23e69 100644 --- a/src/USER-INTEL/npair_skip_intel.h +++ b/src/USER-INTEL/npair_skip_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,19 +13,19 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(skip/intel, NPairSkipIntel, NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_INTEL) + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_INTEL); NPairStyle(skip/ghost/intel, NPairSkipIntel, NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_GHOST | NP_INTEL) - + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_GHOST | NP_INTEL); +// clang-format on #else #ifndef LMP_NPAIR_SKIP_INTEL_H diff --git a/src/USER-INTEL/pair_airebo_intel.cpp b/src/USER-INTEL/pair_airebo_intel.cpp index f8f094ec9f..12afce046b 100644 --- a/src/USER-INTEL/pair_airebo_intel.cpp +++ b/src/USER-INTEL/pair_airebo_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pair_airebo_intel.h b/src/USER-INTEL/pair_airebo_intel.h index de90177939..47093f1c29 100644 --- a/src/USER-INTEL/pair_airebo_intel.h +++ b/src/USER-INTEL/pair_airebo_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(airebo/intel,PairAIREBOIntel) - +// clang-format off +PairStyle(airebo/intel,PairAIREBOIntel); +// clang-format on #else #ifndef LMP_PAIR_AIREBO_INTEL_H diff --git a/src/USER-INTEL/pair_airebo_morse_intel.cpp b/src/USER-INTEL/pair_airebo_morse_intel.cpp index f17dacd8e2..8b9894dc02 100644 --- a/src/USER-INTEL/pair_airebo_morse_intel.cpp +++ b/src/USER-INTEL/pair_airebo_morse_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pair_airebo_morse_intel.h b/src/USER-INTEL/pair_airebo_morse_intel.h index 4a97fce38b..fb8e3dcf14 100644 --- a/src/USER-INTEL/pair_airebo_morse_intel.h +++ b/src/USER-INTEL/pair_airebo_morse_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(airebo/morse/intel,PairAIREBOMorseIntel) - +// clang-format off +PairStyle(airebo/morse/intel,PairAIREBOMorseIntel); +// clang-format on #else #ifndef LMP_PAIR_AIREBO_MORSE_INTEL_H diff --git a/src/USER-INTEL/pair_buck_coul_cut_intel.cpp b/src/USER-INTEL/pair_buck_coul_cut_intel.cpp index 010237dcdf..e2ff70e392 100644 --- a/src/USER-INTEL/pair_buck_coul_cut_intel.cpp +++ b/src/USER-INTEL/pair_buck_coul_cut_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pair_buck_coul_cut_intel.h b/src/USER-INTEL/pair_buck_coul_cut_intel.h index 020f8afff7..793446f05e 100644 --- a/src/USER-INTEL/pair_buck_coul_cut_intel.h +++ b/src/USER-INTEL/pair_buck_coul_cut_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -17,9 +18,9 @@ #ifdef PAIR_CLASS - -PairStyle(buck/coul/cut/intel,PairBuckCoulCutIntel) - +// clang-format off +PairStyle(buck/coul/cut/intel,PairBuckCoulCutIntel); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_CUT_INTEL_H diff --git a/src/USER-INTEL/pair_buck_coul_long_intel.cpp b/src/USER-INTEL/pair_buck_coul_long_intel.cpp index 72d78fb6c7..689a874bce 100644 --- a/src/USER-INTEL/pair_buck_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_buck_coul_long_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pair_buck_coul_long_intel.h b/src/USER-INTEL/pair_buck_coul_long_intel.h index f05ebadeef..c9fc6d8f0f 100644 --- a/src/USER-INTEL/pair_buck_coul_long_intel.h +++ b/src/USER-INTEL/pair_buck_coul_long_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/coul/long/intel,PairBuckCoulLongIntel) - +// clang-format off +PairStyle(buck/coul/long/intel,PairBuckCoulLongIntel); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_LONG_INTEL_H diff --git a/src/USER-INTEL/pair_buck_intel.cpp b/src/USER-INTEL/pair_buck_intel.cpp index df81b6852f..017774f8f6 100644 --- a/src/USER-INTEL/pair_buck_intel.cpp +++ b/src/USER-INTEL/pair_buck_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pair_buck_intel.h b/src/USER-INTEL/pair_buck_intel.h index 89702dd754..38615a86ec 100644 --- a/src/USER-INTEL/pair_buck_intel.h +++ b/src/USER-INTEL/pair_buck_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/intel,PairBuckIntel) - +// clang-format off +PairStyle(buck/intel,PairBuckIntel); +// clang-format on #else #ifndef LMP_PAIR_BUCK_INTEL_H diff --git a/src/USER-INTEL/pair_dpd_intel.cpp b/src/USER-INTEL/pair_dpd_intel.cpp index 45da3cccd7..18c039572b 100644 --- a/src/USER-INTEL/pair_dpd_intel.cpp +++ b/src/USER-INTEL/pair_dpd_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-INTEL/pair_dpd_intel.h b/src/USER-INTEL/pair_dpd_intel.h index 94ef795ba5..2553638947 100644 --- a/src/USER-INTEL/pair_dpd_intel.h +++ b/src/USER-INTEL/pair_dpd_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -17,9 +18,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dpd/intel,PairDPDIntel) - +// clang-format off +PairStyle(dpd/intel,PairDPDIntel); +// clang-format on #else #ifndef LMP_PAIR_DPD_INTEL_H diff --git a/src/USER-INTEL/pair_eam_alloy_intel.cpp b/src/USER-INTEL/pair_eam_alloy_intel.cpp index 04ee07ca82..8df26f273b 100644 --- a/src/USER-INTEL/pair_eam_alloy_intel.cpp +++ b/src/USER-INTEL/pair_eam_alloy_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pair_eam_alloy_intel.h b/src/USER-INTEL/pair_eam_alloy_intel.h index 82ba0c9f89..d1805da2c5 100644 --- a/src/USER-INTEL/pair_eam_alloy_intel.h +++ b/src/USER-INTEL/pair_eam_alloy_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/alloy/intel,PairEAMAlloyIntel) - +// clang-format off +PairStyle(eam/alloy/intel,PairEAMAlloyIntel); +// clang-format on #else #ifndef LMP_PAIR_EAM_ALLOY_INTEL_H diff --git a/src/USER-INTEL/pair_eam_fs_intel.cpp b/src/USER-INTEL/pair_eam_fs_intel.cpp index 0eb2cda43d..8c065c2de1 100644 --- a/src/USER-INTEL/pair_eam_fs_intel.cpp +++ b/src/USER-INTEL/pair_eam_fs_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pair_eam_fs_intel.h b/src/USER-INTEL/pair_eam_fs_intel.h index 3614c5640e..619d6b46e6 100644 --- a/src/USER-INTEL/pair_eam_fs_intel.h +++ b/src/USER-INTEL/pair_eam_fs_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/fs/intel,PairEAMFSIntel) - +// clang-format off +PairStyle(eam/fs/intel,PairEAMFSIntel); +// clang-format on #else #ifndef LMP_PAIR_EAM_FS_INTEL_H diff --git a/src/USER-INTEL/pair_eam_intel.cpp b/src/USER-INTEL/pair_eam_intel.cpp index 206bdd5ee6..58573eca5f 100644 --- a/src/USER-INTEL/pair_eam_intel.cpp +++ b/src/USER-INTEL/pair_eam_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pair_eam_intel.h b/src/USER-INTEL/pair_eam_intel.h index a24b5e15dc..9817625f07 100644 --- a/src/USER-INTEL/pair_eam_intel.h +++ b/src/USER-INTEL/pair_eam_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/intel,PairEAMIntel) - +// clang-format off +PairStyle(eam/intel,PairEAMIntel); +// clang-format on #else #ifndef LMP_PAIR_EAM_INTEL_H diff --git a/src/USER-INTEL/pair_gayberne_intel.cpp b/src/USER-INTEL/pair_gayberne_intel.cpp index fd79b5812b..e51b7758e6 100644 --- a/src/USER-INTEL/pair_gayberne_intel.cpp +++ b/src/USER-INTEL/pair_gayberne_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-INTEL/pair_gayberne_intel.h b/src/USER-INTEL/pair_gayberne_intel.h index 0374da4cb3..b726055c6b 100644 --- a/src/USER-INTEL/pair_gayberne_intel.h +++ b/src/USER-INTEL/pair_gayberne_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gayberne/intel,PairGayBerneIntel) - +// clang-format off +PairStyle(gayberne/intel,PairGayBerneIntel); +// clang-format on #else #ifndef LMP_PAIR_GAYBERNE_INTEL_H diff --git a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp index 850af0de6f..59809cc839 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp +++ b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h index 5bb6912363..cf868787e6 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h +++ b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/charmm/intel,PairLJCharmmCoulCharmmIntel) - +// clang-format off +PairStyle(lj/charmm/coul/charmm/intel,PairLJCharmmCoulCharmmIntel); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_CHARMM_INTEL_H diff --git a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp index b89deacc0b..0ce7e1e1fd 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h index fe743a9841..b860fda3e3 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h +++ b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/long/intel,PairLJCharmmCoulLongIntel) - +// clang-format off +PairStyle(lj/charmm/coul/long/intel,PairLJCharmmCoulLongIntel); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_INTEL_H diff --git a/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp index 111f5610b6..9e024b35c8 100644 --- a/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-INTEL/pair_lj_cut_coul_long_intel.h b/src/USER-INTEL/pair_lj_cut_coul_long_intel.h index 5c3a4f38e2..4be9cbd1f5 100644 --- a/src/USER-INTEL/pair_lj_cut_coul_long_intel.h +++ b/src/USER-INTEL/pair_lj_cut_coul_long_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/long/intel,PairLJCutCoulLongIntel) - +// clang-format off +PairStyle(lj/cut/coul/long/intel,PairLJCutCoulLongIntel); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_LONG_INTEL_H diff --git a/src/USER-INTEL/pair_lj_cut_intel.cpp b/src/USER-INTEL/pair_lj_cut_intel.cpp index 6499f1cec8..029b1eca5b 100644 --- a/src/USER-INTEL/pair_lj_cut_intel.cpp +++ b/src/USER-INTEL/pair_lj_cut_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-INTEL/pair_lj_cut_intel.h b/src/USER-INTEL/pair_lj_cut_intel.h index 710e4e39a0..a5a48148f2 100644 --- a/src/USER-INTEL/pair_lj_cut_intel.h +++ b/src/USER-INTEL/pair_lj_cut_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/intel,PairLJCutIntel) - +// clang-format off +PairStyle(lj/cut/intel,PairLJCutIntel); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_INTEL_H diff --git a/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp index 3292ea463d..eb70745318 100644 --- a/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pair_lj_long_coul_long_intel.h b/src/USER-INTEL/pair_lj_long_coul_long_intel.h index 19adeda55e..d1213dda62 100644 --- a/src/USER-INTEL/pair_lj_long_coul_long_intel.h +++ b/src/USER-INTEL/pair_lj_long_coul_long_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* *- c++ -*- ----------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/long/coul/long/intel,PairLJLongCoulLongIntel) - +// clang-format off +PairStyle(lj/long/coul/long/intel,PairLJLongCoulLongIntel); +// clang-format on #else #ifndef LMP_PAIR_LJ_LONG_COUL_LONG_INTEL_H diff --git a/src/USER-INTEL/pair_rebo_intel.cpp b/src/USER-INTEL/pair_rebo_intel.cpp index d5661b5489..75be02e06c 100644 --- a/src/USER-INTEL/pair_rebo_intel.cpp +++ b/src/USER-INTEL/pair_rebo_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pair_rebo_intel.h b/src/USER-INTEL/pair_rebo_intel.h index d4beebbaa7..0946e297c4 100644 --- a/src/USER-INTEL/pair_rebo_intel.h +++ b/src/USER-INTEL/pair_rebo_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(rebo/intel,PairREBOIntel) - +// clang-format off +PairStyle(rebo/intel,PairREBOIntel); +// clang-format on #else #ifndef LMP_PAIR_REBO_INTEL_H diff --git a/src/USER-INTEL/pair_sw_intel.cpp b/src/USER-INTEL/pair_sw_intel.cpp index bc5c40a258..b7c92bf1ee 100644 --- a/src/USER-INTEL/pair_sw_intel.cpp +++ b/src/USER-INTEL/pair_sw_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pair_sw_intel.h b/src/USER-INTEL/pair_sw_intel.h index e8dfb00343..a60c2b0a0d 100644 --- a/src/USER-INTEL/pair_sw_intel.h +++ b/src/USER-INTEL/pair_sw_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(sw/intel,PairSWIntel) - +// clang-format off +PairStyle(sw/intel,PairSWIntel); +// clang-format on #else #ifndef LMP_PAIR_SW_INTEL_H diff --git a/src/USER-INTEL/pair_tersoff_intel.cpp b/src/USER-INTEL/pair_tersoff_intel.cpp index eb3ce562fa..975b600bfa 100644 --- a/src/USER-INTEL/pair_tersoff_intel.cpp +++ b/src/USER-INTEL/pair_tersoff_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pair_tersoff_intel.h b/src/USER-INTEL/pair_tersoff_intel.h index 48e1376110..b613a00194 100644 --- a/src/USER-INTEL/pair_tersoff_intel.h +++ b/src/USER-INTEL/pair_tersoff_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/intel,PairTersoffIntel) - +// clang-format off +PairStyle(tersoff/intel,PairTersoffIntel); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_INTEL_H diff --git a/src/USER-INTEL/pppm_disp_intel.cpp b/src/USER-INTEL/pppm_disp_intel.cpp index 88fb6374ab..ff045983db 100644 --- a/src/USER-INTEL/pppm_disp_intel.cpp +++ b/src/USER-INTEL/pppm_disp_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pppm_disp_intel.h b/src/USER-INTEL/pppm_disp_intel.h index 0191bbcb81..bc6ed2f54f 100644 --- a/src/USER-INTEL/pppm_disp_intel.h +++ b/src/USER-INTEL/pppm_disp_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/disp/intel,PPPMDispIntel) - +// clang-format off +KSpaceStyle(pppm/disp/intel,PPPMDispIntel); +// clang-format on #else #ifndef LMP_PPPMINTEL_DISP_H diff --git a/src/USER-INTEL/pppm_intel.cpp b/src/USER-INTEL/pppm_intel.cpp index c91066e314..b369e25284 100644 --- a/src/USER-INTEL/pppm_intel.cpp +++ b/src/USER-INTEL/pppm_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/pppm_intel.h b/src/USER-INTEL/pppm_intel.h index 8dce1532ae..b6ffe206b1 100644 --- a/src/USER-INTEL/pppm_intel.h +++ b/src/USER-INTEL/pppm_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* *- c++ -*- ----------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,9 +20,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/intel,PPPMIntel) - +// clang-format off +KSpaceStyle(pppm/intel,PPPMIntel); +// clang-format on #else #ifndef LMP_PPPMINTEL_H diff --git a/src/USER-INTEL/verlet_lrt_intel.cpp b/src/USER-INTEL/verlet_lrt_intel.cpp index 4fe1cf7f92..150a6ebd7b 100644 --- a/src/USER-INTEL/verlet_lrt_intel.cpp +++ b/src/USER-INTEL/verlet_lrt_intel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-INTEL/verlet_lrt_intel.h b/src/USER-INTEL/verlet_lrt_intel.h index 02b24cae3f..daa159e29a 100644 --- a/src/USER-INTEL/verlet_lrt_intel.h +++ b/src/USER-INTEL/verlet_lrt_intel.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef INTEGRATE_CLASS - -IntegrateStyle(verlet/lrt/intel,VerletLRTIntel) - +// clang-format off +IntegrateStyle(verlet/lrt/intel,VerletLRTIntel); +// clang-format on #else #ifndef LMP_VERLET_LRT_INTEL_H diff --git a/src/USER-LB/fix_lb_fluid.cpp b/src/USER-LB/fix_lb_fluid.cpp index dafd5d2a3a..0295c04f47 100644 --- a/src/USER-LB/fix_lb_fluid.cpp +++ b/src/USER-LB/fix_lb_fluid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-LB/fix_lb_fluid.h b/src/USER-LB/fix_lb_fluid.h index 8d81648e47..3b0ce872ba 100644 --- a/src/USER-LB/fix_lb_fluid.h +++ b/src/USER-LB/fix_lb_fluid.h @@ -12,9 +12,9 @@ ------------------------------------------------------------------------ */ #ifdef FIX_CLASS - -FixStyle(lb/fluid,FixLbFluid) - +// clang-format off +FixStyle(lb/fluid,FixLbFluid); +// clang-format on #else #ifndef LMP_FIX_LB_FLUID_H @@ -28,140 +28,138 @@ FixStyle(lb/fluid,FixLbFluid) namespace LAMMPS_NS { - class FixLbFluid : public Fix { - friend class FixLbMomentum; - friend class FixLbRigidPCSphere; - friend class FixLbPC; - friend class FixLbViscous; +class FixLbFluid : public Fix { + friend class FixLbMomentum; + friend class FixLbRigidPCSphere; + friend class FixLbPC; + friend class FixLbViscous; -public: - FixLbFluid(class LAMMPS *, int, char **); - ~FixLbFluid(); - int setmask(); - void init(); - void initial_integrate(int); - void setup(int); - void post_force(int); - void end_of_step(); + public: + FixLbFluid(class LAMMPS *, int, char **); + ~FixLbFluid(); + int setmask(); + void init(); + void initial_integrate(int); + void setup(int); + void post_force(int); + void end_of_step(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + void grow_arrays(int); + void copy_arrays(int, int, int); + int pack_exchange(int, double *); + int unpack_exchange(int, double *); - private: - double viscosity,densityinit_real,a_0_real,T; - int setdx,seta0; - int numvel; + private: + double viscosity, densityinit_real, a_0_real, T; + int setdx, seta0; + int numvel; - double dm_lb,dx_lb,dt_lb; // Lattice units for mass, distance, time. + double dm_lb, dx_lb, dt_lb; // Lattice units for mass, distance, time. - int Nbx,Nby,Nbz; // Total # of x,y,z grid points. - int subNbx,subNby,subNbz; // # of x,y,z, grid points (including buffer) - // on local processor. - int me, nprocs; // MPI variables: processor ID, # of processors - MPI_Datatype oneslice; // MPI datatypes to pass arrays. - MPI_Datatype passxu,passyu,passzu; - MPI_Datatype passxf,passyf,passzf; - MPI_Datatype passxrho,passyrho,passzrho; - MPI_Datatype passxtemp,passytemp,passztemp; + int Nbx, Nby, Nbz; // Total # of x,y,z grid points. + int subNbx, subNby, subNbz; // # of x,y,z, grid points (including buffer) + // on local processor. + int me, nprocs; // MPI variables: processor ID, # of processors + MPI_Datatype oneslice; // MPI datatypes to pass arrays. + MPI_Datatype passxu, passyu, passzu; + MPI_Datatype passxf, passyf, passzf; + MPI_Datatype passxrho, passyrho, passzrho; + MPI_Datatype passxtemp, passytemp, passztemp; - double kB,densityinit,a_0; // Boltzmann constant, initial density, - // and a_0 all in lattice units. - double *Gamma; - double *NodeArea; - int setGamma,setArea; - double **hydroF; + double kB, densityinit, a_0; // Boltzmann constant, initial density, + // and a_0 all in lattice units. + double *Gamma; + double *NodeArea; + int setGamma, setArea; + double **hydroF; - int groupbit_viscouslb, groupbit_pc, groupbit_rigid_pc_sphere; + int groupbit_viscouslb, groupbit_pc, groupbit_rigid_pc_sphere; - double ***density_lb; // fluid density - double ****u_lb; // fluid velocity - double ****f_lb; // distributions - double ****fnew; // used in the calculation of the new - // distributions. - double ****feq; // equilibrium distributions - double ****feqold; // equilibrium distributions from previous - // timestep + double ***density_lb; // fluid density + double ****u_lb; // fluid velocity + double ****f_lb; // distributions + double ****fnew; // used in the calculation of the new + // distributions. + double ****feq; // equilibrium distributions + double ****feqold; // equilibrium distributions from previous + // timestep - double ****feqn; // equilibrium distributions without noise. - double ****feqoldn; // equilibrium distributions from previous - // timestep without noise. - double ****Ff; // Force from the MD particles on the fluid. - double ****Fftempx; - double ****Fftempy; - double ****Fftempz; + double ****feqn; // equilibrium distributions without noise. + double ****feqoldn; // equilibrium distributions from previous + // timestep without noise. + double ****Ff; // Force from the MD particles on the fluid. + double ****Fftempx; + double ****Fftempy; + double ****Fftempz; - double *Ng_lb; // Lattice Boltzmann variables. - double *w_lb; - double **mg_lb; - int **e; - double tau; - double expminusdtovertau; - double Dcoeff; - double K_0; - double dtoverdtcollision; + double *Ng_lb; // Lattice Boltzmann variables. + double *w_lb; + double **mg_lb; + int **e; + double tau; + double expminusdtovertau; + double Dcoeff; + double K_0; + double dtoverdtcollision; - int step; + int step; - double ****buf; // arrays used to output data. - double ****buf2; - double ****altogether; - double ****altogether2; + double ****buf; // arrays used to output data. + double ****buf2; + double ****altogether; + double ****altogether2; - double bodyforcex,bodyforcey,bodyforcez; // Body Forces acting on the fluid (default=0) - double vwtp,vwbt; // Velocities of the z walls in the y - // direction. (must have fixed boundary - // conditions in z) + double bodyforcex, bodyforcey, bodyforcez; // Body Forces acting on the fluid (default=0) + double vwtp, vwbt; // Velocities of the z walls in the y + // direction. (must have fixed boundary + // conditions in z) - int noisestress; // 1 to include noise in the system, - // 0 otherwise. - double namp,noisefactor; - int seed; - class RanMars *random; + int noisestress; // 1 to include noise in the system, + // 0 otherwise. + double namp, noisefactor; + int seed; + class RanMars *random; - int force_diagnostic; // 1 to print out the force action on a group - // of particles, 0 otherwise. - int igroupforce; // the group for which the force is to be - // printed. + int force_diagnostic; // 1 to print out the force action on a group + // of particles, 0 otherwise. + int igroupforce; // the group for which the force is to be + // printed. - int typeLB; + int typeLB; - int trilinear_stencil; // 1 to use the trilinear stencil, 0 to use the - // peskin stencil. + int trilinear_stencil; // 1 to use the trilinear stencil, 0 to use the + // peskin stencil. - int readrestart; // 1 to read in data from a restart file. - MPI_File pFileRead; + int readrestart; // 1 to read in data from a restart file. + MPI_File pFileRead; - int printrestart; // 1 to write data to a restart file. - MPI_File pFileWrite; + int printrestart; // 1 to write data to a restart file. + MPI_File pFileWrite; - int printfluid; - int fixviscouslb; + int printfluid; + int fixviscouslb; - void rescale(void); - void (FixLbFluid::*initializeLB)(void); - void initializeLB15(void); - void initializeLB19(void); - void initialize_feq(void); - void (FixLbFluid::*equilibriumdist)(int,int,int,int,int,int); - void equilibriumdist15(int,int,int,int,int,int); - void equilibriumdist19(int,int,int,int,int,int); - void parametercalc_part(int,int,int,int,int,int); - void parametercalc_full(void); - void update_periodic(int,int,int,int,int,int); - void (FixLbFluid::*update_full)(void); - void update_full15(void); - void update_full19(void); - void streamout(void); - void read_restartfile(void); - void write_restartfile(void); - void peskin_interpolation(int); - void trilinear_interpolation(int); - void calc_fluidforce(void); - - }; -} + void rescale(void); + void (FixLbFluid::*initializeLB)(void); + void initializeLB15(void); + void initializeLB19(void); + void initialize_feq(void); + void (FixLbFluid::*equilibriumdist)(int, int, int, int, int, int); + void equilibriumdist15(int, int, int, int, int, int); + void equilibriumdist19(int, int, int, int, int, int); + void parametercalc_part(int, int, int, int, int, int); + void parametercalc_full(void); + void update_periodic(int, int, int, int, int, int); + void (FixLbFluid::*update_full)(void); + void update_full15(void); + void update_full19(void); + void streamout(void); + void read_restartfile(void); + void write_restartfile(void); + void peskin_interpolation(int); + void trilinear_interpolation(int); + void calc_fluidforce(void); +}; +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-LB/fix_lb_momentum.cpp b/src/USER-LB/fix_lb_momentum.cpp index 9a305f6fe1..1c3549f942 100644 --- a/src/USER-LB/fix_lb_momentum.cpp +++ b/src/USER-LB/fix_lb_momentum.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-LB/fix_lb_momentum.h b/src/USER-LB/fix_lb_momentum.h index 3f4fee5009..145ba78f05 100644 --- a/src/USER-LB/fix_lb_momentum.h +++ b/src/USER-LB/fix_lb_momentum.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(lb/momentum,FixLbMomentum) - +// clang-format off +FixStyle(lb/momentum,FixLbMomentum); +// clang-format on #else #ifndef LMP_FIX_LB_MOMENTUM_H @@ -33,13 +33,13 @@ class FixLbMomentum : public Fix { private: int linear; - int xflag,yflag,zflag; + int xflag, yflag, zflag; double masstotal; class FixLbFluid *fix_lb_fluid; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-LB/fix_lb_pc.cpp b/src/USER-LB/fix_lb_pc.cpp index 78eb518481..bae0987b21 100644 --- a/src/USER-LB/fix_lb_pc.cpp +++ b/src/USER-LB/fix_lb_pc.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-LB/fix_lb_pc.h b/src/USER-LB/fix_lb_pc.h index e088fab38f..e2e47d915f 100644 --- a/src/USER-LB/fix_lb_pc.h +++ b/src/USER-LB/fix_lb_pc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(lb/pc,FixLbPC) - +// clang-format off +FixStyle(lb/pc,FixLbPC); +// clang-format on #else #ifndef LMP_FIX_LB_PC_H @@ -24,7 +24,7 @@ FixStyle(lb/pc,FixLbPC) namespace LAMMPS_NS { - class FixLbPC : public Fix { +class FixLbPC : public Fix { public: FixLbPC(class LAMMPS *, int, char **); ~FixLbPC(); @@ -39,9 +39,8 @@ namespace LAMMPS_NS { int pack_exchange(int, double *); int unpack_exchange(int, double *); - private: - double dtv,dtf; + double dtv, dtf; int me; double *Gamma_MD; double expminusdttimesgamma; @@ -55,7 +54,7 @@ namespace LAMMPS_NS { class FixLbFluid *fix_lb_fluid; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index 2d94a90246..9db1c2acec 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.h b/src/USER-LB/fix_lb_rigid_pc_sphere.h index 946889e1db..5964c7d142 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.h +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(lb/rigid/pc/sphere,FixLbRigidPCSphere) - +// clang-format off +FixStyle(lb/rigid/pc/sphere,FixLbRigidPCSphere); +// clang-format on #else #ifndef LMP_FIX_LB_RIGID_PC_SPHERE_H @@ -47,54 +47,53 @@ class FixLbRigidPCSphere : public Fix { void reset_dt(); double compute_array(int, int); - private: double **up; double **up_old; double *Gamma_MD; - double expminusdttimesgamma,DMDcoeff; + double expminusdttimesgamma, DMDcoeff; double expminusdttimesgammadiv2; - double force_factor,torque_factor; + double force_factor, torque_factor; - double dtv,dtf; + double dtv, dtf; - int nbody; // # of rigid bodies - int *nrigid; // # of atoms in each rigid body + int nbody; // # of rigid bodies + int *nrigid; // # of atoms in each rigid body int *nrigid_shell; - double *masstotal; // total mass of each rigid body + double *masstotal; // total mass of each rigid body double *masstotal_shell; double *sphereradius; - double **xcm; // coords of center-of-mass of each rigid body + double **xcm; // coords of center-of-mass of each rigid body double **xcm_old; - double **vcm; // velocity of center-of-mass of each + double **vcm; // velocity of center-of-mass of each double **ucm; double **ucm_old; - double **fcm; // force on center-of-mass of each + double **fcm; // force on center-of-mass of each double **fcm_old; double **fcm_fluid; - double **omega; // angular momentum of each in space coords - double **torque; // torque on each rigid body in space coords + double **omega; // angular momentum of each in space coords + double **torque; // torque on each rigid body in space coords double **torque_old; double **torque_fluid; double **torque_fluid_old; double **rotate; - imageint *imagebody; // image flags of xcm of each rigid body - double **fflag; // flag for on/off of center-of-mass force - double **tflag; // flag for on/off of center-of-mass torque + imageint *imagebody; // image flags of xcm of each rigid body + double **fflag; // flag for on/off of center-of-mass force + double **tflag; // flag for on/off of center-of-mass torque - int *body; // which body each atom is part of (-1 if none) + int *body; // which body each atom is part of (-1 if none) - double **sum,**all; // work vectors for each rigid body - int **remapflag; // PBC remap flags for each rigid body + double **sum, **all; // work vectors for each rigid body + int **remapflag; // PBC remap flags for each rigid body - double tfactor; // scale factor on temperature of rigid bodies + double tfactor; // scale factor on temperature of rigid bodies - int inner_nodes; // ==1 if certain particle are inside the rigid - // body and should not interact with the fluid. - // ==0 otherwise. - int igroupinner; // specifies the particles which are inside the - // spherical rigid body, and do not interact with - // the fluid. + int inner_nodes; // ==1 if certain particle are inside the rigid + // body and should not interact with the fluid. + // ==0 otherwise. + int igroupinner; // specifies the particles which are inside the + // spherical rigid body, and do not interact with + // the fluid. void set_xv(); void set_v(); @@ -104,7 +103,7 @@ class FixLbRigidPCSphere : public Fix { class FixLbFluid *fix_lb_fluid; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-LB/fix_lb_viscous.cpp b/src/USER-LB/fix_lb_viscous.cpp index a13fea3a1a..95e36a98a9 100644 --- a/src/USER-LB/fix_lb_viscous.cpp +++ b/src/USER-LB/fix_lb_viscous.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-LB/fix_lb_viscous.h b/src/USER-LB/fix_lb_viscous.h index 2f4206fc31..1d08a15463 100644 --- a/src/USER-LB/fix_lb_viscous.h +++ b/src/USER-LB/fix_lb_viscous.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(lb/viscous,FixLbViscous) - +// clang-format off +FixStyle(lb/viscous,FixLbViscous); +// clang-format on #else #ifndef LMP_FIX_LB_VISCOUS_H @@ -43,7 +43,7 @@ class FixLbViscous : public Fix { class FixLbFluid *fix_lb_fluid; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MANIFOLD/fix_manifoldforce.cpp b/src/USER-MANIFOLD/fix_manifoldforce.cpp index a5cc75f567..2968361e43 100644 --- a/src/USER-MANIFOLD/fix_manifoldforce.cpp +++ b/src/USER-MANIFOLD/fix_manifoldforce.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/fix_manifoldforce.h b/src/USER-MANIFOLD/fix_manifoldforce.h index 57dd2643d0..285fcd5578 100644 --- a/src/USER-MANIFOLD/fix_manifoldforce.h +++ b/src/USER-MANIFOLD/fix_manifoldforce.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -34,9 +34,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(manifoldforce,FixManifoldForce) - +// clang-format off +FixStyle(manifoldforce,FixManifoldForce); +// clang-format on #else #ifndef LMP_FIX_MANIFOLDFORCE_H @@ -45,7 +45,9 @@ FixStyle(manifoldforce,FixManifoldForce) #include "fix.h" namespace LAMMPS_NS { -namespace user_manifold { class manifold; } +namespace user_manifold { + class manifold; +} class FixManifoldForce : public Fix { public: @@ -58,15 +60,14 @@ class FixManifoldForce : public Fix { void post_force_respa(int, int, int); void min_post_force(int); - private: user_manifold::manifold *ptr_m; // Stuff to store the parameters in. - int nvars; // # of args after manifold name. + int nvars; // # of args after manifold name. }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index e8c06b0501..b340869ea9 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.h b/src/USER-MANIFOLD/fix_nve_manifold_rattle.h index 30886434ec..e112b9bc7e 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.h +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -31,11 +31,10 @@ ------------------------------------------------------------------------- */ - #ifdef FIX_CLASS - -FixStyle(nve/manifold/rattle,FixNVEManifoldRattle) - +// clang-format off +FixStyle(nve/manifold/rattle,FixNVEManifoldRattle); +// clang-format on #else #ifndef LMP_FIX_NVE_MANIFOLD_RATTLE_H @@ -45,71 +44,72 @@ FixStyle(nve/manifold/rattle,FixNVEManifoldRattle) namespace LAMMPS_NS { -namespace user_manifold { class manifold; } - - class FixNVEManifoldRattle : public Fix { - public: - - struct statistics { - - statistics() : x_iters(0), v_iters(0), x_iters_per_atom(0), - v_iters_per_atom(0), natoms(0), dofs_removed(0), - last_out(0) {} - double x_iters, v_iters; - double x_iters_per_atom; - double v_iters_per_atom; - int natoms; - int dofs_removed; - bigint last_out; - }; - - FixNVEManifoldRattle(LAMMPS *, int &, char **, int = 1); - virtual ~FixNVEManifoldRattle(); - // All this stuff is interface, so you DO need to implement them. - // Just delegate them to the workhorse classes. - virtual int setmask(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void init(); - virtual void reset_dt(); - virtual void end_of_step(); - virtual int dof(int); - virtual void setup(int) {} // Not needed for fixNVE but is for fixNVT - virtual double memory_usage(); - - protected: - - int nevery, next_output; - - double dtv, dtf; - double tolerance; - int max_iter; - - char **tstrs; - int *tvars; - int *tstyle; - int *is_var; - - statistics stats; - int update_style; - int nvars; - - user_manifold::manifold *ptr_m; - - void print_stats( const char * ); - int was_var( const char * ); - - virtual void update_var_params(); - virtual void rattle_manifold_x( double *, double *, double *, double, double, tagint ); - virtual void rattle_manifold_v( double *, double *, double *, double, tagint ); - - virtual void nve_x_rattle(int, int); - virtual void nve_v_rattle(int, int); - }; +namespace user_manifold { + class manifold; } +class FixNVEManifoldRattle : public Fix { + public: + struct statistics { -#endif // LMP_FIX_NVE_MANIFOLD_RATTLE_H + statistics() : + x_iters(0), v_iters(0), x_iters_per_atom(0), v_iters_per_atom(0), natoms(0), + dofs_removed(0), last_out(0) + { + } + double x_iters, v_iters; + double x_iters_per_atom; + double v_iters_per_atom; + int natoms; + int dofs_removed; + bigint last_out; + }; + + FixNVEManifoldRattle(LAMMPS *, int &, char **, int = 1); + virtual ~FixNVEManifoldRattle(); + // All this stuff is interface, so you DO need to implement them. + // Just delegate them to the workhorse classes. + virtual int setmask(); + virtual void initial_integrate(int); + virtual void final_integrate(); + virtual void init(); + virtual void reset_dt(); + virtual void end_of_step(); + virtual int dof(int); + virtual void setup(int) {} // Not needed for fixNVE but is for fixNVT + virtual double memory_usage(); + + protected: + int nevery, next_output; + + double dtv, dtf; + double tolerance; + int max_iter; + + char **tstrs; + int *tvars; + int *tstyle; + int *is_var; + + statistics stats; + int update_style; + int nvars; + + user_manifold::manifold *ptr_m; + + void print_stats(const char *); + int was_var(const char *); + + virtual void update_var_params(); + virtual void rattle_manifold_x(double *, double *, double *, double, double, tagint); + virtual void rattle_manifold_v(double *, double *, double *, double, tagint); + + virtual void nve_x_rattle(int, int); + virtual void nve_v_rattle(int, int); +}; +} // namespace LAMMPS_NS + +#endif // LMP_FIX_NVE_MANIFOLD_RATTLE_H #endif /* ERROR/WARNING messages: diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp index 155d2b0842..57ae8ef109 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h index 5ffc6af0c0..2e6115e692 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -31,11 +31,10 @@ ------------------------------------------------------------------------- */ - #ifdef FIX_CLASS - -FixStyle(nvt/manifold/rattle,FixNVTManifoldRattle) - +// clang-format off +FixStyle(nvt/manifold/rattle,FixNVTManifoldRattle); +// clang-format on #else #ifndef LMP_FIX_NVT_MANIFOLD_RATTLE_H @@ -43,8 +42,6 @@ FixStyle(nvt/manifold/rattle,FixNVTManifoldRattle) #include "fix_nve_manifold_rattle.h" - - /* FixNVTManifoldRattle works by wrapping some Nose-Hoover thermostat routines around the time integration functions of FixNVEManifoldRattle. @@ -53,50 +50,44 @@ namespace LAMMPS_NS { // namespace user_manifold { - class FixNVTManifoldRattle : public FixNVEManifoldRattle { - public: - FixNVTManifoldRattle(LAMMPS *, int, char **, int = 1); - virtual ~FixNVTManifoldRattle(); +class FixNVTManifoldRattle : public FixNVEManifoldRattle { + public: + FixNVTManifoldRattle(LAMMPS *, int, char **, int = 1); + virtual ~FixNVTManifoldRattle(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void init(); - virtual void reset_dt(); - virtual int setmask(); - virtual void setup(int); // Not needed for fixNVE but is for fixNVT - virtual double memory_usage(); + virtual void initial_integrate(int); + virtual void final_integrate(); + virtual void init(); + virtual void reset_dt(); + virtual int setmask(); + virtual void setup(int); // Not needed for fixNVE but is for fixNVT + virtual double memory_usage(); + protected: + void compute_temp_target(); + void nhc_temp_integrate(); + void nh_v_temp(); + double dthalf, dt4, dt8; - protected: + char *id_temp; + class Compute *temperature; + double t_start, t_stop, t_period; + double t_current, t_target, ke_target; + double t_freq, drag, tdrag_factor; + double boltz, nktv2p, tdof; + double *eta, *eta_dot; + double *eta_dotdot; + double *eta_mass; + int mtchain; + double factor_eta; + int which, got_temp; - void compute_temp_target(); - void nhc_temp_integrate(); - void nh_v_temp(); + const char *fix_id; +}; +} // namespace LAMMPS_NS - double dthalf, dt4, dt8; - - char *id_temp; - class Compute* temperature; - double t_start,t_stop, t_period; - double t_current,t_target,ke_target; - double t_freq, drag, tdrag_factor; - double boltz,nktv2p,tdof; - double *eta,*eta_dot; - double *eta_dotdot; - double *eta_mass; - int mtchain; - double factor_eta; - int which, got_temp; - - const char *fix_id; - }; -} - - - - -#endif // LMP_FIX_NVE_MANIFOLD_RATTLE_H +#endif // LMP_FIX_NVE_MANIFOLD_RATTLE_H #endif /* ERROR/WARNING messages: diff --git a/src/USER-MANIFOLD/manifold.h b/src/USER-MANIFOLD/manifold.h index c91647583f..f2f46a6647 100644 --- a/src/USER-MANIFOLD/manifold.h +++ b/src/USER-MANIFOLD/manifold.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -46,55 +46,47 @@ namespace user_manifold { // Abstract base class. class manifold : protected Pointers { public: - manifold(class LAMMPS* lmp) : Pointers(lmp), params(nullptr) { } + manifold(class LAMMPS *lmp) : Pointers(lmp), params(nullptr) {} virtual ~manifold() { delete[] params; } - virtual double g( const double * ) = 0; - virtual void n( const double *, double * ) = 0; - + virtual double g(const double *) = 0; + virtual void n(const double *, double *) = 0; // Variant of g that computes n at the same time. - virtual double g_and_n( const double *x, double *nn ) + virtual double g_and_n(const double *x, double *nn) { - this->n(x,nn); + this->n(x, nn); return g(x); } virtual const char *id() = 0; - virtual void set_atom_id( tagint /*a_id*/ ) {} + virtual void set_atom_id(tagint /*a_id*/) {} virtual int nparams() = 0; // double *get_params() { return params; }; // Overload if any initialization depends on params: virtual void post_param_init() {} - virtual void checkup() {} // Some diagnostics... + virtual void checkup() {} // Some diagnostics... double *params; }; - - // Some utility functions that are templated, so I implement them // here in the header. - template< unsigned int size > inline - double infnorm(double *vect) + template inline double infnorm(double *vect) { - double largest = fabs( vect[0] ); + double largest = fabs(vect[0]); for (unsigned int i = 1; i < size; ++i) { - double c = fabs( vect[i] ); - largest = ( c > largest ) ? c : largest; + double c = fabs(vect[i]); + largest = (c > largest) ? c : largest; } return largest; } - inline double dot(double *a, double *b) { - return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]; - } + inline double dot(double *a, double *b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; } +} // namespace user_manifold -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS -} - - -#endif // LMP_MANIFOLD_H +#endif // LMP_MANIFOLD_H diff --git a/src/USER-MANIFOLD/manifold_cylinder.cpp b/src/USER-MANIFOLD/manifold_cylinder.cpp index 317934a34e..edd3ecf974 100644 --- a/src/USER-MANIFOLD/manifold_cylinder.cpp +++ b/src/USER-MANIFOLD/manifold_cylinder.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/manifold_cylinder.h b/src/USER-MANIFOLD/manifold_cylinder.h index 10715b2683..a8393a9768 100644 --- a/src/USER-MANIFOLD/manifold_cylinder.h +++ b/src/USER-MANIFOLD/manifold_cylinder.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,25 +18,24 @@ // A normal cylinder - namespace LAMMPS_NS { namespace user_manifold { class manifold_cylinder : public manifold { - public: - enum { NPARAMS = 1 }; // Number of parameters. - manifold_cylinder( LAMMPS *lmp, int, char ** ); + public: + enum { NPARAMS = 1 }; // Number of parameters. + manifold_cylinder(LAMMPS *lmp, int, char **); virtual ~manifold_cylinder() {} - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); static const char *type() { return "cylinder"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS -#endif // LMP_MANIFOLD_CYLINDER_H +#endif // LMP_MANIFOLD_CYLINDER_H diff --git a/src/USER-MANIFOLD/manifold_cylinder_dent.cpp b/src/USER-MANIFOLD/manifold_cylinder_dent.cpp index 9289fc93a5..a559b7bd75 100644 --- a/src/USER-MANIFOLD/manifold_cylinder_dent.cpp +++ b/src/USER-MANIFOLD/manifold_cylinder_dent.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/manifold_cylinder_dent.h b/src/USER-MANIFOLD/manifold_cylinder_dent.h index 770fa23aef..f6ec6dfea9 100644 --- a/src/USER-MANIFOLD/manifold_cylinder_dent.h +++ b/src/USER-MANIFOLD/manifold_cylinder_dent.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,25 +16,24 @@ #include "manifold.h" - namespace LAMMPS_NS { namespace user_manifold { class manifold_cylinder_dent : public manifold { public: - manifold_cylinder_dent( LAMMPS *lmp, int, char ** ); - enum { NPARAMS = 3 }; // Number of parameters. + manifold_cylinder_dent(LAMMPS *lmp, int, char **); + enum { NPARAMS = 3 }; // Number of parameters. virtual ~manifold_cylinder_dent() {} - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); static const char *type() { return "cylinder/dent"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS -#endif // LMP_MANIFOLD_CYLINDER_DENT_H +#endif // LMP_MANIFOLD_CYLINDER_DENT_H diff --git a/src/USER-MANIFOLD/manifold_dumbbell.cpp b/src/USER-MANIFOLD/manifold_dumbbell.cpp index af5fdc9edb..15a3713528 100644 --- a/src/USER-MANIFOLD/manifold_dumbbell.cpp +++ b/src/USER-MANIFOLD/manifold_dumbbell.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/manifold_dumbbell.h b/src/USER-MANIFOLD/manifold_dumbbell.h index ef6aec6271..47a4961fd3 100644 --- a/src/USER-MANIFOLD/manifold_dumbbell.h +++ b/src/USER-MANIFOLD/manifold_dumbbell.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,8 +16,6 @@ #include "manifold.h" - - namespace LAMMPS_NS { namespace user_manifold { @@ -25,20 +23,20 @@ namespace user_manifold { // A dendritic dumbbell approximation: class manifold_dumbbell : public manifold { public: - enum { NPARAMS = 4 }; // Number of parameters. - manifold_dumbbell( LAMMPS *lmp, int, char ** ); + enum { NPARAMS = 4 }; // Number of parameters. + manifold_dumbbell(LAMMPS *lmp, int, char **); virtual ~manifold_dumbbell() {} - virtual double g ( const double *x ); - virtual void n ( const double *x, double *nn ); + virtual double g(const double *x); + virtual void n(const double *x, double *nn); - static const char* type() { return "dumbbell"; } + static const char *type() { return "dumbbell"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS -#endif // LMP_MANIFOLD_DUMBBELL_H +#endif // LMP_MANIFOLD_DUMBBELL_H diff --git a/src/USER-MANIFOLD/manifold_ellipsoid.cpp b/src/USER-MANIFOLD/manifold_ellipsoid.cpp index ea62b335ef..d42324b4a2 100644 --- a/src/USER-MANIFOLD/manifold_ellipsoid.cpp +++ b/src/USER-MANIFOLD/manifold_ellipsoid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/manifold_ellipsoid.h b/src/USER-MANIFOLD/manifold_ellipsoid.h index f728a95ff4..6bc9d97690 100644 --- a/src/USER-MANIFOLD/manifold_ellipsoid.h +++ b/src/USER-MANIFOLD/manifold_ellipsoid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,7 +16,6 @@ #include "manifold.h" - namespace LAMMPS_NS { namespace user_manifold { @@ -24,18 +23,18 @@ namespace user_manifold { class manifold_ellipsoid : public manifold { public: enum { NPARAMS = 3 }; - manifold_ellipsoid( LAMMPS *lmp, int, char ** ); + manifold_ellipsoid(LAMMPS *lmp, int, char **); virtual ~manifold_ellipsoid() {} - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); - static const char* type() { return "ellipsoid"; } + static const char *type() { return "ellipsoid"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS -#endif // LMP_MANIFOLD_ELLIPSOID_H +#endif // LMP_MANIFOLD_ELLIPSOID_H diff --git a/src/USER-MANIFOLD/manifold_factory.cpp b/src/USER-MANIFOLD/manifold_factory.cpp index 43e0029b29..8b3e3d02d0 100644 --- a/src/USER-MANIFOLD/manifold_factory.cpp +++ b/src/USER-MANIFOLD/manifold_factory.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/manifold_factory.h b/src/USER-MANIFOLD/manifold_factory.h index 61d143feb6..ddaf965169 100644 --- a/src/USER-MANIFOLD/manifold_factory.h +++ b/src/USER-MANIFOLD/manifold_factory.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -31,79 +31,32 @@ ------------------------------------------------------------------------- */ - #ifndef LMP_MANIFOLD_FACTORY_H #define LMP_MANIFOLD_FACTORY_H #include #include -/* - * Defining USE_PHONY_LAMMPS makes sure that none of the LAMMPS classes are - * included/compiled. This is done in order to allow other programs to use - * the manifold_factory without compiling all of LAMMPS itself. The relevant - * classes/functions are replaced with dummy ones defined in this #ifdef-block: - */ -#ifdef USE_PHONY_LAMMPS -# ifdef __GNUG__ -# warning Not compiling actual LAMMPS classes! -# endif - - -struct Error { - void all(const char *fname, int line, const char* msg) - { - fprintf(stderr,"ERROR: %s (%s:%d)",msg,fname,line); - std::terminate(); - } - - void one(const char *fname, int line, const char* msg) - { - fprintf(stderr,"ERROR: %s (%s:%d)",msg,fname,line); - std::terminate(); - } -}; - -struct LAMMPS { }; - -struct Pointers -{ - Pointers(LAMMPS *) : error( &e ) {} - Error e; - Error *error; -}; - -static FILE *screen = fopen("/dev/stdout","w"); - -#define FLERR __FILE__,__LINE__ // Equivalent to definition in pointers.h -#endif // USE_PHONY_LAMMPS - -/* Here the actual implementation of LAMMPS-related functions begins. */ - namespace LAMMPS_NS { class LAMMPS; namespace user_manifold { -// forward declaration -class manifold; + // forward declaration + class manifold; // Templated, so needs to be in header. template - void make_manifold_if( manifold **man_ptr, const char *name, - LAMMPS *lmp, int narg, char **arg ) + void make_manifold_if(manifold **man_ptr, const char *name, LAMMPS *lmp, int narg, char **arg) { - if ( strcmp( m_type::type(), name ) == 0 ) { - if ( *man_ptr == nullptr ) { - *man_ptr = new m_type(lmp, narg, arg); - } + if (strcmp(m_type::type(), name) == 0) { + if (*man_ptr == nullptr) { *man_ptr = new m_type(lmp, narg, arg); } } } - manifold* create_manifold(const char *, LAMMPS *, - int , char ** ); + manifold *create_manifold(const char *, LAMMPS *, int, char **); -} // namespace user_manifold -} // namespace LAMMPS_NS +} // namespace user_manifold +} // namespace LAMMPS_NS -#endif // LMP_MANIFOLD_FACTORY_H +#endif // LMP_MANIFOLD_FACTORY_H diff --git a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp index 4893e86da2..5eb2b08504 100644 --- a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp +++ b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/manifold_gaussian_bump.h b/src/USER-MANIFOLD/manifold_gaussian_bump.h index 30926f9815..75c0ce6644 100644 --- a/src/USER-MANIFOLD/manifold_gaussian_bump.h +++ b/src/USER-MANIFOLD/manifold_gaussian_bump.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -50,20 +50,21 @@ namespace user_manifold { class manifold_gaussian_bump : public manifold { public: enum { NPARAMS = 4 }; - manifold_gaussian_bump(class LAMMPS*, int, char **); + manifold_gaussian_bump(class LAMMPS *, int, char **); virtual ~manifold_gaussian_bump(); - virtual double g( const double * ); - virtual void n( const double *, double * ); + virtual double g(const double *); + virtual void n(const double *, double *); // Variant of g that computes n at the same time. - virtual double g_and_n( const double *x, double *nn ); + virtual double g_and_n(const double *x, double *nn); - static const char* type() { return "gaussian_bump"; } + static const char *type() { return "gaussian_bump"; } virtual const char *id() { return type(); } virtual int nparams() { return NPARAMS; } virtual void post_param_init(); + private: // Some private constants: double AA, ll, ll2, f_at_rc, fp_at_rc; @@ -76,24 +77,22 @@ namespace user_manifold { double *lut_z; double *lut_zp; - double gaussian_bump ( double ) const; - double gaussian_bump_x2 ( double ) const; - double gaussian_bump_der( double ) const; + double gaussian_bump(double) const; + double gaussian_bump_x2(double) const; + double gaussian_bump_der(double) const; - void make_lut(); - double lut_get_z ( double rr ) const; - double lut_get_zp( double rr ) const; - void lut_get_z_and_zp( double rr, double &zz, double &zzp ) const; + void make_lut(); + double lut_get_z(double rr) const; + double lut_get_zp(double rr) const; + void lut_get_z_and_zp(double rr, double &zz, double &zzp) const; void test_lut(); - double taper( double ); - double taper_der( double ); - + double taper(double); + double taper_der(double); }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS - -#endif // LMP_MANIFOLD_GAUSSIAN_BUMP_H +#endif // LMP_MANIFOLD_GAUSSIAN_BUMP_H diff --git a/src/USER-MANIFOLD/manifold_plane.cpp b/src/USER-MANIFOLD/manifold_plane.cpp index b533c27197..2c1ef91444 100644 --- a/src/USER-MANIFOLD/manifold_plane.cpp +++ b/src/USER-MANIFOLD/manifold_plane.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/manifold_plane.h b/src/USER-MANIFOLD/manifold_plane.h index 9a45b58c94..3ee70186fd 100644 --- a/src/USER-MANIFOLD/manifold_plane.h +++ b/src/USER-MANIFOLD/manifold_plane.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,28 +16,25 @@ #include "manifold.h" - namespace LAMMPS_NS { namespace user_manifold { - // A 2D plane class manifold_plane : public manifold { public: - enum { NPARAMS = 6 }; // Number of parameters. - manifold_plane( LAMMPS *lmp, int, char ** ); + enum { NPARAMS = 6 }; // Number of parameters. + manifold_plane(LAMMPS *lmp, int, char **); virtual ~manifold_plane() {} - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); static const char *type() { return "plane"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold +} // namespace LAMMPS_NS -} - -#endif // LMP_MANIFOLD_PLANE_H +#endif // LMP_MANIFOLD_PLANE_H diff --git a/src/USER-MANIFOLD/manifold_plane_wiggle.cpp b/src/USER-MANIFOLD/manifold_plane_wiggle.cpp index f5e57d5f6f..be9a49dced 100644 --- a/src/USER-MANIFOLD/manifold_plane_wiggle.cpp +++ b/src/USER-MANIFOLD/manifold_plane_wiggle.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/manifold_plane_wiggle.h b/src/USER-MANIFOLD/manifold_plane_wiggle.h index 06b55419ae..895dd54e90 100644 --- a/src/USER-MANIFOLD/manifold_plane_wiggle.h +++ b/src/USER-MANIFOLD/manifold_plane_wiggle.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,7 +16,6 @@ #include "manifold.h" - namespace LAMMPS_NS { namespace user_manifold { @@ -24,18 +23,18 @@ namespace user_manifold { // A 2D wiggly/wave-y plane (Like z = A cos(kx)) class manifold_plane_wiggle : public manifold { public: - enum { NPARAMS = 2 }; // Number of parameters. - manifold_plane_wiggle( LAMMPS *lmp, int, char ** ); + enum { NPARAMS = 2 }; // Number of parameters. + manifold_plane_wiggle(LAMMPS *lmp, int, char **); virtual ~manifold_plane_wiggle() {} - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); static const char *type() { return "plane/wiggle"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS -#endif // LMP_MANIFOLD_PLANE_WIGGLE_H +#endif // LMP_MANIFOLD_PLANE_WIGGLE_H diff --git a/src/USER-MANIFOLD/manifold_sphere.h b/src/USER-MANIFOLD/manifold_sphere.h index e0a80ab88b..18ca828c92 100644 --- a/src/USER-MANIFOLD/manifold_sphere.h +++ b/src/USER-MANIFOLD/manifold_sphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,53 +20,51 @@ namespace LAMMPS_NS { namespace user_manifold { - // A sphere: class manifold_sphere : public manifold { public: enum { NPARAMS = 1 }; - manifold_sphere( LAMMPS *lmp, int, char ** ) : manifold(lmp) {} + manifold_sphere(LAMMPS *lmp, int, char **) : manifold(lmp) {} virtual ~manifold_sphere() {} - virtual double g( const double *x ) + virtual double g(const double *x) { double R = params[0]; - double r2 = x[0]*x[0] + x[1]*x[1] + x[2]*x[2]; - return r2 - R*R; + double r2 = x[0] * x[0] + x[1] * x[1] + x[2] * x[2]; + return r2 - R * R; } - virtual double g_and_n( const double *x, double *nn ) + virtual double g_and_n(const double *x, double *nn) { double R = params[0]; - double r2 = x[0]*x[0] + x[1]*x[1] + x[2]*x[2]; - nn[0] = 2*x[0]; - nn[1] = 2*x[1]; - nn[2] = 2*x[2]; + double r2 = x[0] * x[0] + x[1] * x[1] + x[2] * x[2]; + nn[0] = 2 * x[0]; + nn[1] = 2 * x[1]; + nn[2] = 2 * x[2]; - return r2 - R*R; + return r2 - R * R; } - virtual void n( const double *x, double *nn ) + virtual void n(const double *x, double *nn) { - nn[0] = 2*x[0]; - nn[1] = 2*x[1]; - nn[2] = 2*x[2]; + nn[0] = 2 * x[0]; + nn[1] = 2 * x[1]; + nn[2] = 2 * x[2]; } - virtual void H( double * /*x*/, double h[3][3] ) + virtual void H(double * /*x*/, double h[3][3]) { h[0][1] = h[0][2] = h[1][0] = h[1][2] = h[2][0] = h[2][1] = 0.0; h[0][0] = h[1][1] = h[2][2] = 2.0; } - static const char* type() { return "sphere"; } + static const char *type() { return "sphere"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS - -#endif // LMP_MANIFOLD_SPHERE_H +#endif // LMP_MANIFOLD_SPHERE_H diff --git a/src/USER-MANIFOLD/manifold_spine.cpp b/src/USER-MANIFOLD/manifold_spine.cpp index 96e0418188..ddfaac1a62 100644 --- a/src/USER-MANIFOLD/manifold_spine.cpp +++ b/src/USER-MANIFOLD/manifold_spine.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/manifold_spine.h b/src/USER-MANIFOLD/manifold_spine.h index 1b54ceaa17..3fb0640185 100644 --- a/src/USER-MANIFOLD/manifold_spine.h +++ b/src/USER-MANIFOLD/manifold_spine.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,7 +16,6 @@ #include "manifold.h" - namespace LAMMPS_NS { namespace user_manifold { @@ -24,33 +23,32 @@ namespace user_manifold { // A dendritic spine approximation: class manifold_spine : public manifold { public: - enum { NPARAMS = 5 }; // Number of parameters. - manifold_spine( LAMMPS *lmp, int, char ** ); + enum { NPARAMS = 5 }; // Number of parameters. + manifold_spine(LAMMPS *lmp, int, char **); virtual ~manifold_spine() {} - virtual double g ( const double *x ); - virtual void n ( const double *x, double *nn ); - virtual double g_and_n( const double *x, double *nn ); + virtual double g(const double *x); + virtual void n(const double *x, double *nn); + virtual double g_and_n(const double *x, double *nn); - static const char* type() { return "spine"; } + static const char *type() { return "spine"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } + protected: int power; }; class manifold_spine_two : public manifold_spine { public: - manifold_spine_two( LAMMPS *lmp, int, char **); + manifold_spine_two(LAMMPS *lmp, int, char **); - static const char* type() { return "spine/two"; } + static const char *type() { return "spine/two"; } virtual const char *id() { return type(); } - }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS - -#endif // LMP_MANIFOLD_SPINE_H +#endif // LMP_MANIFOLD_SPINE_H diff --git a/src/USER-MANIFOLD/manifold_supersphere.h b/src/USER-MANIFOLD/manifold_supersphere.h index 7b9ad2e12c..9949def311 100644 --- a/src/USER-MANIFOLD/manifold_supersphere.h +++ b/src/USER-MANIFOLD/manifold_supersphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,23 +18,19 @@ namespace LAMMPS_NS { - namespace user_manifold { // A sphere: class manifold_supersphere : public manifold { public: enum { NPARAMS = 2 }; - manifold_supersphere( LAMMPS *lmp, int, char ** ) : manifold(lmp) {} + manifold_supersphere(LAMMPS *lmp, int, char **) : manifold(lmp) {} virtual ~manifold_supersphere() {} - double my_sign( double a ) - { - return (a > 0) - (a < 0); - } + double my_sign(double a) { return (a > 0) - (a < 0); } - virtual double g( const double *x ) + virtual double g(const double *x) { double R = params[0]; double q = params[1]; @@ -42,30 +38,30 @@ namespace user_manifold { double yy = fabs(x[1]); double zz = fabs(x[2]); - double rr = pow(xx,q) + pow(yy,q) + pow(zz,q); + double rr = pow(xx, q) + pow(yy, q) + pow(zz, q); - return rr - pow(R,q); + return rr - pow(R, q); } - virtual void n( const double *x, double *nn ) + virtual void n(const double *x, double *nn) { double q = params[1]; double xx = fabs(x[0]); double yy = fabs(x[1]); double zz = fabs(x[2]); - nn[0] = q * my_sign(x[0])*pow(xx,q-1); - nn[1] = q * my_sign(x[1])*pow(yy,q-1); - nn[2] = q * my_sign(x[2])*pow(zz,q-1); + nn[0] = q * my_sign(x[0]) * pow(xx, q - 1); + nn[1] = q * my_sign(x[1]) * pow(yy, q - 1); + nn[2] = q * my_sign(x[2]) * pow(zz, q - 1); } - static const char* type() { return "supersphere"; } + static const char *type() { return "supersphere"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-MANIFOLD/manifold_thylakoid.cpp b/src/USER-MANIFOLD/manifold_thylakoid.cpp index c8c9fe2721..b7004cac3a 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,14 +13,13 @@ ----------------------------------------------------------------------- */ #include "manifold_thylakoid.h" -#include #include "manifold_thylakoid_shared.h" + #include "comm.h" #include "domain.h" // For some checks regarding the simulation box. #include "error.h" - -#define MANIFOLD_THYLAKOID_DEBUG +#include using namespace LAMMPS_NS; using namespace user_manifold; @@ -164,26 +164,12 @@ void manifold_thylakoid::init_domains() x0 = -( 0.5*LB + lB + lT + LT + lT + pad); y0 = -( 0.5*LT + lT + pad ); z0 = -15; -#ifdef MANIFOLD_THYLAKOID_DEBUG - if (comm->me == 0) { - fprintf(screen,"x0, y0, z0 = %f, %f, %f\n",x0,y0,z0); - } -#endif // MANIFOLD_THYLAKOID_DEBUG -#ifndef USE_PHONY_LAMMPS - if (x0 < domain->boxlo[0]) { - char msg[2048]; - sprintf(msg,"Thylakoid expects xlo of at most %f, but found %f", - x0, domain->boxlo[0]); - error->one(FLERR,msg); - } - if (y0 < domain->boxlo[1]) { - char msg[2048]; - sprintf(msg,"Thylakoid expects ylo of at most %f, but found %f", - y0, domain->boxlo[1]); - error->one(FLERR,msg); - } -#endif + if (x0 < domain->boxlo[0]) + error->one(FLERR,"Thylakoid expects xlo of at most {:.8f}, but found {:.8f}", x0, domain->boxlo[0]); + + if (y0 < domain->boxlo[1]) + error->one(FLERR,"Thylakoid expects ylo of at most {:.8f}, but found {:.8f}",y0, domain->boxlo[1]); // Add some padding to prevent improper lookups. z0 -= pad; @@ -196,24 +182,11 @@ void manifold_thylakoid::init_domains() Ly = y1 - y0; Lz = z1 - z0; -#ifndef USE_PHONY_LAMMPS - char msg[2048]; - if (x1 > domain->boxhi[0]) { - sprintf(msg,"Expected xhi larger than current box has: %f > %f", - x1, domain->boxhi[0]); - error->one(FLERR,msg); - } - if (y1 > domain->boxhi[1]) { - sprintf(msg,"Expected yhi larger than current box has: %f > %f", - y1, domain->boxhi[1]); - error->one(FLERR,msg); - } - // if (z1 > domain->boxhi[2]) { - // sprintf(msg,"Expected zhi larger than current box has: %f > %f", - // z1, domain->boxhi[2]); - // error->one(FLERR,msg); - // } -#endif + if (x1 > domain->boxhi[0]) + error->one(FLERR,"Expected xhi larger than current box has: {:.8f} > {:.8f}", x1, domain->boxhi[0]); + + if (y1 > domain->boxhi[1]) + error->one(FLERR,"Expected yhi larger than current box has: {:.8f} > {:.8f}", y1, domain->boxhi[1]); // Create and add the manifold parts to the array. thyla_part *p; @@ -255,11 +228,6 @@ void manifold_thylakoid::init_domains() bl.hi[2] = (1.0 + safety_fac) * Reff; // double X0, double R0, double R, double s, -#ifdef MANIFOLD_THYLAKOID_DEBUG - if (comm->me == 0) { - fprintf(screen,"x0, r0, R = %f, %f, %f\n", bl.pt[0], rB, lB); - } -#endif // MANIFOLD_THYLAKOID_DEBUG p = make_cyl_to_plane_part(bl.pt[0], rB, lB, -1, bl.pt); set_domain(p, bl.lo, bl.hi); parts.push_back(p); @@ -278,11 +246,6 @@ void manifold_thylakoid::init_domains() br.hi[2] = (1.0 + safety_fac) * Reff; // double X0, double R0, double R, double s, -#ifdef MANIFOLD_THYLAKOID_DEBUG - if (comm->me == 0) { - fprintf(screen,"x0, r0, R = %f, %f, %f\n", br.pt[0], rB, lB); - } -#endif // MANIFOLD_THYLAKOID_DEBUG p = make_cyl_to_plane_part(br.pt[0], rB, lB, 1, br.pt); set_domain(p, br.lo, br.hi); parts.push_back(p); @@ -305,12 +268,6 @@ void manifold_thylakoid::init_domains() p = make_cyl_part( 0, 1, 1, bc.pt, rB ); set_domain( p, bc.lo, bc.hi ); -#ifdef MANIFOLD_THYLAKOID_DEBUG - if (comm->me == 0) { - fprintf(screen,"Cylinder lives on [ %f x %f ] x [ %f x %f ] x [ %f x %f]\n", - bc.lo[0], bc.hi[0], bc.lo[1], bc.hi[1], bc.lo[2], bc.hi[2]); - } -#endif // MANIFOLD_THYLAKOID_DEBUG parts.push_back(p); @@ -477,41 +434,18 @@ void manifold_thylakoid::init_domains() prr.pt[0], br.pt[0] + lB); error->one(FLERR,msg); } - - // For debugging, print the domains and coms: -#ifdef MANIFOLD_THYLAKOID_DEBUG - if (comm->me == 0) { - FILE *fp_doms = fopen("test_doms.dat","w"); - FILE *fp_coms = fopen("test_coms.dat","w"); - print_part_data(fp_doms, fp_coms); - fclose(fp_doms); - fclose(fp_coms); - } -#endif // MANIFOLD_THYLAKOID_DEBUG } void manifold_thylakoid::set_domain( thyla_part *p, const std::vector &lo, const std::vector &hi ) { -#ifdef MANIFOLD_THYLAKOID_DEBUG - if (comm->me == 0) { - fprintf(screen,"Adding part with domain [%f, %f] x [%f, %f] x [%f, %f]\n", - lo[0],hi[0],lo[1],hi[1],lo[2],hi[2] ); - } -#endif // MANIFOLD_THYLAKOID_DEBUG if (lo[0] >= hi[0]) { - char msg[2048]; - sprintf(msg,"xlo >= xhi (%f >= %f)",lo[0],hi[0]); - error->one(FLERR,msg); + error->one(FLERR,"xlo >= xhi ({:.8f} >= {:.8f})",lo[0],hi[0]); } else if (lo[1] >= hi[1]) { - char msg[2048]; - sprintf(msg,"ylo >= yhi (%f >= %f)",lo[1],hi[1]); - error->one(FLERR,msg); + error->one(FLERR,"ylo >= yhi ({:.8f} >= {:.8f})",lo[1],hi[1]); } else if (lo[2] >= hi[2]) { - char msg[2048]; - sprintf(msg,"zlo >= zhi (%f >= %f)",lo[2],hi[2]); - error->one(FLERR,msg); + error->one(FLERR,"zlo >= zhi ({:.8f} >= {:.8f})",lo[2],hi[2]); } p->xlo = lo[0]; p->ylo = lo[1]; @@ -611,21 +545,3 @@ thyla_part *manifold_thylakoid::make_cyl_to_plane_part(double X0, double R0, dou thyla_part *p = new thyla_part(thyla_part::THYLA_TYPE_CYL_TO_PLANE,args,0,0,0,0,0,0); return p; } - - - - -void manifold_thylakoid::print_part_data( FILE *fp_doms, FILE *fp_coms ) -{ - for (std::size_t i = 0; i < parts.size(); ++i) { - thyla_part *p = parts[i]; - fprintf(fp_doms, "%f %f\n", p->xlo, p->ylo); - fprintf(fp_doms, "%f %f\n", p->xlo, p->yhi); - fprintf(fp_doms, "%f %f\n", p->xhi, p->yhi); - fprintf(fp_doms, "%f %f\n", p->xhi, p->ylo); - fprintf(fp_doms, "%f %f\n\n",p->xlo, p->ylo); - fprintf(fp_coms, "%f %f\n", p->x0, p->y0 ); - } -} - - diff --git a/src/USER-MANIFOLD/manifold_thylakoid.h b/src/USER-MANIFOLD/manifold_thylakoid.h index cdd69d05cc..5470d722f9 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.h +++ b/src/USER-MANIFOLD/manifold_thylakoid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -25,45 +25,39 @@ namespace user_manifold { class manifold_thylakoid : public manifold { public: enum { NPARAMS = 3 }; - manifold_thylakoid( LAMMPS *lmp, int, char ** ); + manifold_thylakoid(LAMMPS *lmp, int, char **); virtual ~manifold_thylakoid(); - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); - static const char* type() { return "thylakoid"; } + static const char *type() { return "thylakoid"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } - virtual void post_param_init(); - virtual void checkup(); // Some diagnostics... + virtual void checkup(); // Some diagnostics... private: void init_domains(); - thyla_part *get_thyla_part( const double *x, int *err_flag, std::size_t *idx = nullptr ); - int is_in_domain( thyla_part *p, const double *x ); + thyla_part *get_thyla_part(const double *x, int *err_flag, std::size_t *idx = nullptr); + int is_in_domain(thyla_part *p, const double *x); void check_overlap(); - std::vector parts; + std::vector parts; - thyla_part *make_plane_part (double a, double b, double c, - const std::vector &pt); - thyla_part *make_cyl_part (double a, double b, double c, - const std::vector &pt, double R); + thyla_part *make_plane_part(double a, double b, double c, const std::vector &pt); + thyla_part *make_cyl_part(double a, double b, double c, const std::vector &pt, + double R); thyla_part *make_sphere_part(const std::vector &pt, double R); thyla_part *make_cyl_to_plane_part(double X0, double R0, double R, double s, - const std::vector &pt ); + const std::vector &pt); - - void set_domain( thyla_part *p, const std::vector &lo, - const std::vector &hi ); - - void print_part_data( FILE *fp_doms, FILE *fp_coms ); + void set_domain(thyla_part *p, const std::vector &lo, const std::vector &hi); // Coefficients for the thylakoid model. At the moment it is just // a cylinder, we slowly expand it. - double pad; // Padding to make sure periodic images are mapped back properly. + double pad; // Padding to make sure periodic images are mapped back properly. double LB, lT, lB, wB, LT; // Domain size: @@ -72,10 +66,8 @@ namespace user_manifold { double Lx, Ly, Lz; }; +} // namespace user_manifold +} // namespace LAMMPS_NS -} // namespace LAMMPS_NS - -} - -#endif // LMP_MANIFOLD_THYLAKOID_H +#endif // LMP_MANIFOLD_THYLAKOID_H diff --git a/src/USER-MANIFOLD/manifold_thylakoid_shared.cpp b/src/USER-MANIFOLD/manifold_thylakoid_shared.cpp index fc49e3715e..b71cf23e5e 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid_shared.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid_shared.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/manifold_thylakoid_shared.h b/src/USER-MANIFOLD/manifold_thylakoid_shared.h index a83603785b..a90d5e8801 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid_shared.h +++ b/src/USER-MANIFOLD/manifold_thylakoid_shared.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,7 +14,6 @@ #ifndef MANIFOLD_THYLAKOID_SHARED_H #define MANIFOLD_THYLAKOID_SHARED_H - #include "lmptype.h" #include @@ -22,7 +21,6 @@ namespace LAMMPS_NS { namespace user_manifold { - // The thylakoid is composed of many parts struct thyla_part { enum thyla_types { @@ -32,13 +30,13 @@ namespace user_manifold { THYLA_TYPE_CYL_TO_PLANE }; - thyla_part( int type, double *args, double xlo, double ylo, double zlo, - double xhi, double yhi, double zhi ); + thyla_part(int type, double *args, double xlo, double ylo, double zlo, double xhi, double yhi, + double zhi); thyla_part() : type(-1), x0(-1337), y0(-1337), z0(-1337) {} ~thyla_part(); - double g( const double *x ); - void n( const double *x, double *n ); + double g(const double *x); + void n(const double *x, double *n); int type; double params[7]; @@ -51,9 +49,7 @@ namespace user_manifold { double xlo, xhi, ylo, yhi, zlo, zhi; double x0, y0, z0; - }; // struct thyla_part - - + }; // struct thyla_part struct thyla_part_geom { thyla_part_geom() : pt(3), lo(3), hi(3) {} @@ -61,16 +57,12 @@ namespace user_manifold { // Function for mirroring thyla_geoms: enum DIRS { DIR_X, DIR_Y, DIR_Z }; - static void mirror( unsigned int axis, thyla_part_geom *m, - const thyla_part_geom *o ); + static void mirror(unsigned int axis, thyla_part_geom *m, const thyla_part_geom *o); - }; // struct thyla_part_geom + }; // struct thyla_part_geom +} // namespace user_manifold -} // namespace user_manifold +} // namespace LAMMPS_NS - -} // namespace LAMMPS_NS - - -#endif // MANIFOLD_THYLAKOID_SHARED_H +#endif // MANIFOLD_THYLAKOID_SHARED_H diff --git a/src/USER-MANIFOLD/manifold_torus.cpp b/src/USER-MANIFOLD/manifold_torus.cpp index 1e25a3ffe2..f09ffc4a96 100644 --- a/src/USER-MANIFOLD/manifold_torus.cpp +++ b/src/USER-MANIFOLD/manifold_torus.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MANIFOLD/manifold_torus.h b/src/USER-MANIFOLD/manifold_torus.h index 15dd06c6bf..b706038bc8 100644 --- a/src/USER-MANIFOLD/manifold_torus.h +++ b/src/USER-MANIFOLD/manifold_torus.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,19 +16,17 @@ #include "manifold.h" - namespace LAMMPS_NS { namespace user_manifold { - class manifold_torus : public manifold { public: - enum {NPARAMS=2}; - manifold_torus( LAMMPS *, int, char ** ); + enum { NPARAMS = 2 }; + manifold_torus(LAMMPS *, int, char **); ~manifold_torus() {} - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); static const char *type() { return "torus"; } virtual const char *id() { return type(); } @@ -36,10 +34,8 @@ namespace user_manifold { virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS - - -#endif // LMP_MANIFOLD_TORUS_H +#endif // LMP_MANIFOLD_TORUS_H diff --git a/src/USER-MDI/Install.sh b/src/USER-MDI/Install.sh new file mode 100755 index 0000000000..4f1ea6dfba --- /dev/null +++ b/src/USER-MDI/Install.sh @@ -0,0 +1,71 @@ +# Install/unInstall package files in LAMMPS +# mode = 0/1/2 for uninstall/install/update + +mode=$1 + +# enforce using portable C locale +LC_ALL=C +export LC_ALL + +# arg1 = file, arg2 = file it depends on + +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]*mdi[^ \t]* //g' ../Makefile.package + sed -i -e 's|^PKG_INC =[ \t]*|&-I../../lib/mdi/includelink |' ../Makefile.package + sed -i -e 's/[^ \t]*MDI[^ \t]* //' ../Makefile.package + sed -i -e 's|^PKG_INC =[ \t]*|&-DLMP_USER_MDI |' ../Makefile.package + sed -i -e 's|^PKG_PATH =[ \t]*|&-L../../lib/mdi/liblink |' ../Makefile.package + sed -i -e 's|^PKG_LIB =[ \t]*|&-lmdi |' ../Makefile.package + sed -i -e 's|^PKG_SYSINC =[ \t]*|&$(mdi_SYSINC) |' ../Makefile.package + sed -i -e 's|^PKG_SYSLIB =[ \t]*|&$(mdi_SYSLIB) |' ../Makefile.package + sed -i -e 's|^PKG_SYSPATH =[ \t]*|&$(mdi_SYSPATH) |' ../Makefile.package + fi + + if (test -e ../Makefile.package.settings) then + sed -i -e '/^include.*mdi.*$/d' ../Makefile.package.settings + # multiline form needed for BSD sed on Macs + sed -i -e '4 i \ +include ..\/..\/lib\/mdi\/Makefile.lammps +' ../Makefile.package.settings + + fi + +elif (test $1 = 0) then + + if (test -e ../Makefile.package) then + sed -i -e 's/[^ \t]*mdi[^ \t]* //g' ../Makefile.package + sed -i -e 's/[^ \t]*MDI[^ \t]* //' ../Makefile.package + fi + + if (test -e ../Makefile.package.settings) then + sed -i -e '/^include.*mdi.*$/d' ../Makefile.package.settings + fi + +fi diff --git a/src/USER-MDI/README b/src/USER-MDI/README new file mode 100644 index 0000000000..045fbea518 --- /dev/null +++ b/src/USER-MDI/README @@ -0,0 +1,24 @@ +The USER-MDI package adds an mdi/engine command which enables LAMMPS +to operate as a MolSSI Driver Interface (MDI) engine, responding to +commands from an external MDI driver. + +It uses the MDI Library, which is available at +https://github.com/MolSSI-MDI/MDI_Library. The MDI Library is +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: +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: + +python Install.py -m gcc +python Install.py -m icc + +When using CMake to build LAMMPS the CMake configuration can use +either a preinstalled MDI library or download and compile a +private copy. diff --git a/src/USER-MDI/fix_mdi_engine.cpp b/src/USER-MDI/fix_mdi_engine.cpp new file mode 100644 index 0000000000..0eec1740d3 --- /dev/null +++ b/src/USER-MDI/fix_mdi_engine.cpp @@ -0,0 +1,953 @@ +/* ---------------------------------------------------------------------- + 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: Taylor Barnes (MolSSI) + MolSSI Driver Interface (MDI) support for LAMMPS +------------------------------------------------------------------------- */ + +#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 "irregular.h" +#include "library.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "verlet.h" + +#include +#include + +enum { NONE, REAL, METAL }; // LAMMPS units which MDI supports + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixMDIEngine::FixMDIEngine(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg), id_pe(nullptr), pe(nullptr), id_ke(nullptr), ke(nullptr) +{ + 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); +} + +/* ---------------------------------------------------------------------- */ + +int FixMDIEngine::setmask() +{ + int mask = 0; + + mask |= POST_INTEGRATE; + mask |= POST_FORCE; + mask |= MIN_PRE_FORCE; + mask |= MIN_POST_FORCE; + + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine::exchange_forces() +{ + double **f = atom->f; + const int *const mask = atom->mask; + const int nlocal = atom->nlocal; + + // 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"); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine::post_integrate() +{ + engine_mode("@COORDS"); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine::min_pre_force(int vflag) +{ + engine_mode("@COORDS"); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine::min_post_force(int vflag) +{ + engine_mode("@FORCES"); +} + +/* ---------------------------------------------------------------------- */ + +void FixMDIEngine::post_force(int vflag) +{ + if (most_recent_init == 1) + engine_mode("@FORCES"); + else if (most_recent_init == 2) + engine_mode("@FORCES"); +} + +// ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- +// 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) { + ierr = MDI_Recv((char *) &atom->natoms, 1, MDI_INT, mdicomm); + if (ierr != 0) error->all(FLERR, "MDI: Unable to receive number of atoms from driver"); + MPI_Bcast(&atom->natoms, 1, MPI_INT, 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; +} + +/* ---------------------------------------------------------------------- */ + +char *FixMDIEngine::engine_mode(const char *node) +{ + /* + if (screen) + fprintf(screen,"MDI ENGINE MODE: %i\n",node); + if (logfile) + fprintf(logfile,"MDI ENGINE MODE: %i\n",node); + */ + + // 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 (not exit_flag and not 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 *mask = atom->mask; + 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 *mask = atom->mask; + 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 *mask = atom->mask; + 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; + 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 *mask = atom->mask; + 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 *mask = atom->mask; + 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 (abs(celldata[1]) > small or abs(celldata[2]) > small or abs(celldata[3]) > small or + abs(celldata[5]) > small or abs(celldata[6]) > small or abs(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]; +} diff --git a/src/USER-MDI/fix_mdi_engine.h b/src/USER-MDI/fix_mdi_engine.h new file mode 100644 index 0000000000..e3d6b37772 --- /dev/null +++ b/src/USER-MDI/fix_mdi_engine.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 FIX_CLASS +// clang-format off +FixStyle(mdi/engine, FixMDIEngine); +// clang-format on +#else + +#ifndef LMP_FIX_MDI_ENGINE_H +#define LMP_FIX_MDI_ENGINE_H + +#include "fix.h" +#include "mdi.h" + +namespace LAMMPS_NS { + +class FixMDIEngine : public Fix { + public: + FixMDIEngine(class LAMMPS *, int, char **); + ~FixMDIEngine(); + int setmask(); + void init(); + + int execute_command(const char *command, MDI_Comm driver_socket); + char *engine_mode(const char *node); + + // receive and update forces + + //void setup(int); + void min_setup(int); + void post_integrate(); + void post_force(int); + void min_pre_force(int); //@COORDS + void min_post_force(int); //@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 *); +}; + +} // namespace LAMMPS_NS + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. + +E: Potential energy ID for fix mdi does not exist + +Self-explanatory. + +E: Cannot use MDI command without atom IDs + +Self-explanatory. + +E: MDI command requires consecutive atom IDs + +Self-explanatory. + +E: Unable to connect to driver + +Self-explanatory. + +E: Unable to ... driver + +Self-explanatory. + +E: Unknown command from driver + +The driver sent a command that is not supported by the LAMMPS +interface. In some cases this might be because a nonsensical +command was sent (i.e. "SCF"). In other cases, the LAMMPS +interface might benefit from being expanded. + +*/ diff --git a/src/USER-MDI/library_mdi.cpp b/src/USER-MDI/library_mdi.cpp new file mode 100644 index 0000000000..0e6bd05ead --- /dev/null +++ b/src/USER-MDI/library_mdi.cpp @@ -0,0 +1,113 @@ +/* ---------------------------------------------------------------------- + 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. +------------------------------------------------------------------------- */ + +// ---------------------------------------------------------------------- +// MolSSI Driver Interface functions +// ---------------------------------------------------------------------- + +#include "library_mdi.h" + +// needed to enable MPI support +#define LAMMPS_LIB_MPI 1 +#include "library.h" + +#include "fix_mdi_engine.h" + +#include + +using namespace LAMMPS_NS; + +/** Initialize an instance of LAMMPS as an MDI plugin + * +\verbatim embed:rst + +This function is called by the MolSSI Driver Interface library (MDI) +when LAMMPS is run as a plugin, and should not otherwise be used. + +The function initializes MDI, then creates and initializes an instance +of LAMMPS. The command-line arguments ``argc`` and ``argv`` used to +initialize LAMMPS are recieved from MDI. The LAMMPS instance runs an +input file, which must include the ``mdi/engine`` command; when LAMMPS +executes this command, it will begin listening for commands from the +driver. The name of the input file is obtained from the ``-in`` +command-line argument, which must be provided by the MDI driver. + +\endverbatim + * \param command string buffer corresponding to the command to be executed + * \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. */ + +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); + if (MDI_Plugin_get_argv(&mdi_argv)) MPI_Abort(MPI_COMM_WORLD, 1); + 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; + while (iarg < mdi_argc && !found_filename) { + + if ((strcmp(mdi_argv[iarg], "-in") == 0) || (strcmp(mdi_argv[iarg], "-i") == 0)) { + + if (iarg + 2 > mdi_argc) MPI_Abort(MPI_COMM_WORLD, 1); + filename = mdi_argv[iarg + 1]; + 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]; + } + iarg++; + } + if (!found_filename) MPI_Abort(MPI_COMM_WORLD, 1); + + // create and run a LAMMPS instance + void *lmp = nullptr; + if (lammps_config_has_mpi_support() > 0) + lmp = lammps_open(mdi_argc, mdi_argv, mpi_world_comm, nullptr); + else + lmp = lammps_open_no_mpi(mdi_argc, mdi_argv, nullptr); + lammps_file(lmp, filename); + lammps_close(lmp); + + return 0; +} + +/** Execute an MDI command + * +\verbatim embed:rst + +This function is called by the MolSSI Driver Interface Library (MDI) +when LAMMPS is run as a plugin, and should not otherwise be used. +The function executes a single command from an external MDI driver. + +\endverbatim + * \param command string buffer corresponding to the command to be executed + * \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); +} diff --git a/src/USER-MDI/library_mdi.h b/src/USER-MDI/library_mdi.h new file mode 100644 index 0000000000..1928244dd8 --- /dev/null +++ b/src/USER-MDI/library_mdi.h @@ -0,0 +1,26 @@ +/* -*- 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 LAMMPS_LIBRARY_MDI_H +#define LAMMPS_LIBRARY_MDI_H + +/* C style library calls to LAMMPS when a LAMMPS shared library is + * used as a plugin through MolSSI Driver Interface (MDI). */ + +#include + +extern "C" { +int MDI_Plugin_init_lammps(); +int lammps_execute_mdi_command(const char *, MDI_Comm, void *); +} +#endif diff --git a/src/USER-MDI/mdi_engine.cpp b/src/USER-MDI/mdi_engine.cpp new file mode 100644 index 0000000000..7289986218 --- /dev/null +++ b/src/USER-MDI/mdi_engine.cpp @@ -0,0 +1,354 @@ +/* ---------------------------------------------------------------------- + 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: Taylor Barnes (MolSSI) + MolSSI Driver Interface (MDI) support for LAMMPS +------------------------------------------------------------------------- */ + +#include "mdi_engine.h" + +#include "atom.h" +#include "error.h" +#include "fix_mdi_engine.h" +#include "force.h" +#include "mdi.h" +#include "min.h" +#include "minimize.h" +#include "modify.h" +#include "output.h" +#include "timer.h" +#include "update.h" +#include "verlet.h" + +#include +#include + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- + trigger LAMMPS to start acting as an MDI engine + 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 +---------------------------------------------------------------------- */ + +void MDIEngine::command(int narg, char **arg) +{ + // list of nodes and commands that a MDI-compliant MD code should support + + // default node and its commands + + MDI_Register_node("@DEFAULT"); + MDI_Register_command("@DEFAULT", "<@"); + MDI_Register_command("@DEFAULT", "CELL"); + MDI_Register_command("@DEFAULT", ">CELL_DISPL"); + MDI_Register_command("@DEFAULT", ">COORDS"); + MDI_Register_command("@DEFAULT", "@INIT_MD"); + MDI_Register_command("@DEFAULT", "@INIT_OPTG"); + MDI_Register_command("@DEFAULT", "EXIT"); + + // node for setting up and running a dynamics simulation + + MDI_Register_node("@INIT_MD"); + MDI_Register_command("@INIT_MD", "<@"); + MDI_Register_command("@INIT_MD", "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", "@FORCES"); + 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", "@FORCES"); + MDI_Register_command("@INIT_OPTG", "EXIT"); + + // node at POST_FORCE location in timestep + + 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", "@"); + MDI_Register_command("@FORCES", "@COORDS"); + MDI_Register_command("@FORCES", "@DEFAULT"); + MDI_Register_command("@FORCES", "@FORCES"); + MDI_Register_command("@FORCES", "EXIT"); + + // node at POST_INTEGRATE location in timestep + + 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 + + int ifix = modify->find_fix_by_style("mdi/engine"); + bool added_mdi_engine_fix = false; + if (ifix < 0) { + modify->add_fix("MDI_ENGINE_INTERNAL all mdi/engine"); + added_mdi_engine_fix = true; + } + + // identify the mdi_engine fix + + ifix = modify->find_fix_by_style("mdi/engine"); + mdi_fix = static_cast(modify->fix[ifix]); + + // 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 (1) { + + // 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, + fmt::format("MDI node exited with " + "invalid command: {}", + command)); + } + + // remove mdi/engine fix that mdi/engine instantiated + + if (added_mdi_engine_fix) modify->delete_fix("MDI_ENGINE_INTERNAL"); +} + +/* ---------------------------------------------------------------------- + run an MD simulation under control of driver +---------------------------------------------------------------------- */ + +char *MDIEngine::mdi_md() +{ + // initialize an MD 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; + + lmp->init(); + + // engine is now at @INIT_MD node + + char *command = nullptr; + command = mdi_fix->engine_mode("@INIT_MD"); + + if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; + + // setup the MD simulation + + 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 + + while (1) { + 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; + } + + return nullptr; +} + +/* ---------------------------------------------------------------------- + perform minimization under control of driver +---------------------------------------------------------------------- */ + +char *MDIEngine::mdi_optg() +{ + // initialize an energy minization + + Minimize *minimizer = new Minimize(lmp); + + // setup the minimizer in a way that ensures optimization + // will continue until MDI driver exits + + 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(); + + update->whichflag = 2; + update->beginstep = update->firststep = update->ntimestep; + update->endstep = update->laststep = update->firststep + update->nsteps; + + lmp->init(); + + // engine is now at @INIT_OPTG node + + char *command = nullptr; + command = mdi_fix->engine_mode("@INIT_OPTG"); + + if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; + + // setup the minimization + + update->minimize->setup(); + + // get new command + + command = mdi_fix->command; + + if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; + + // 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. + + update->minimize->iterate(update->nsteps); + + // return if driver sends @DEFAULT or EXIT + + command = mdi_fix->command; + + if (strcmp(command, "@DEFAULT") == 0 || strcmp(command, "EXIT") == 0) return command; + + error->all(FLERR, + fmt::format("MDI reached end of OPTG simulation " + "with invalid command: {}", + command)); + return nullptr; +} diff --git a/src/USER-MDI/mdi_engine.h b/src/USER-MDI/mdi_engine.h new file mode 100644 index 0000000000..f282714097 --- /dev/null +++ b/src/USER-MDI/mdi_engine.h @@ -0,0 +1,53 @@ +/* -*- 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 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" + +namespace LAMMPS_NS { + +class MDIEngine : public Command { + public: + MDIEngine(LAMMPS *lmp) : Command(lmp) {} + virtual ~MDIEngine() {} + void command(int, char **); + + private: + class FixMDIEngine *mdi_fix; + + char *mdi_md(); + char *mdi_optg(); +}; + +} // 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/USER-MEAMC/meam.h b/src/USER-MEAMC/meam.h index f9440d9cbf..d41e5f6aed 100644 --- a/src/USER-MEAMC/meam.h +++ b/src/USER-MEAMC/meam.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,7 +14,7 @@ #ifndef LMP_MEAM_H #define LMP_MEAM_H -#include "math_const.h" // IWYU pragma: export +#include "math_const.h" // IWYU pragma: export #include #include @@ -26,14 +26,13 @@ class Memory; typedef enum { FCC, BCC, HCP, DIM, DIA, DIA3, B1, C11, L12, B2, CH4, LIN, ZIG, TRI } lattice_t; -class MEAM -{ -public: - MEAM(Memory* mem); +class MEAM { + public: + MEAM(Memory *mem); ~MEAM(); -private: - Memory* memory; + private: + Memory *memory; // cutforce = force cutoff // cutforcesq = force cutoff squared @@ -97,7 +96,7 @@ private: int eltind[maxelt][maxelt]; int neltypes; - double** phir; + double **phir; double **phirar, **phirar1, **phirar2, **phirar3, **phirar4, **phirar5, **phirar6; @@ -110,13 +109,13 @@ private: int emb_lin_neg, bkgd_dyn; double gsmooth_factor; - int vind2D[3][3], vind3D[3][3][3]; // x-y-z to Voigt-like index - int v2D[6], v3D[10]; // multiplicity of Voigt index (i.e. [1] -> xy+yx = 2 + int vind2D[3][3], vind3D[3][3][3]; // x-y-z to Voigt-like index + int v2D[6], v3D[10]; // multiplicity of Voigt index (i.e. [1] -> xy+yx = 2 int nr, nrar; double dr, rdrar; -public: + public: int nmax; double *rho, *rho0, *rho1, *rho2, *rho3, *frhop; double *gamma, *dgamma1, *dgamma2, *dgamma3, *arho2b; @@ -129,13 +128,14 @@ public: double stheta_meam[maxelt][maxelt]; double ctheta_meam[maxelt][maxelt]; -protected: + protected: // meam_funcs.cpp //----------------------------------------------------------------------------- // Cutoff function // - static double fcut(const double xi) { + static double fcut(const double xi) + { double a; if (xi >= 1.0) return 1.0; @@ -144,7 +144,8 @@ protected: else { // ( 1.d0 - (1.d0 - xi)**4 )**2, but with better codegen a = 1.0 - xi; - a *= a; a *= a; + a *= a; + a *= a; a = 1.0 - a; return a * a; } @@ -153,7 +154,8 @@ protected: //----------------------------------------------------------------------------- // Cutoff function and derivative // - static double dfcut(const double xi, double& dfc) { + static double dfcut(const double xi, double &dfc) + { double a, a3, a4, a1m4; if (xi >= 1.0) { dfc = 0.0; @@ -165,10 +167,10 @@ protected: a = 1.0 - xi; a3 = a * a * a; a4 = a * a3; - a1m4 = 1.0-a4; + a1m4 = 1.0 - a4; dfc = 8 * a1m4 * a3; - return a1m4*a1m4; + return a1m4 * a1m4; } } @@ -176,13 +178,14 @@ protected: // Derivative of Cikj w.r.t. rij // Inputs: rij,rij2,rik2,rjk2 // - static double dCfunc(const double rij2, const double rik2, const double rjk2) { - double rij4, a, asq, b,denom; + static double dCfunc(const double rij2, const double rik2, const double rjk2) + { + double rij4, a, asq, b, denom; rij4 = rij2 * rij2; a = rik2 - rjk2; b = rik2 + rjk2; - asq = a*a; + asq = a * a; denom = rij4 - asq; denom = denom * denom; return -4 * (-2 * rij2 * asq + rij4 * b + asq * b) / denom; @@ -192,8 +195,9 @@ protected: // Derivative of Cikj w.r.t. rik and rjk // Inputs: rij,rij2,rik2,rjk2 // - static void dCfunc2(const double rij2, const double rik2, const double rjk2, - double& dCikj1, double& dCikj2) { + static void dCfunc2(const double rij2, const double rik2, const double rjk2, double &dCikj1, + double &dCikj2) + { double rij4, rik4, rjk4, a, denom; rij4 = rij2 * rij2; @@ -209,34 +213,40 @@ protected: double G_gam(const double gamma, const int ibar, int &errorflag) const; double dG_gam(const double gamma, const int ibar, double &dG) const; static double zbl(const double r, const int z1, const int z2); - double embedding(const double A, const double Ec, const double rhobar, double& dF) const; - static double erose(const double r, const double re, const double alpha, const double Ec, const double repuls, const double attrac, const int form); + double embedding(const double A, const double Ec, const double rhobar, double &dF) const; + static double erose(const double r, const double re, const double alpha, const double Ec, + const double repuls, const double attrac, const int form); - static void get_shpfcn(const lattice_t latt, const double sthe, const double cthe, double (&s)[3]); + static void get_shpfcn(const lattice_t latt, const double sthe, const double cthe, + double (&s)[3]); - static int get_Zij2(const lattice_t latt, const double cmin, const double cmax, - const double sthe, double &a, double &S); + static int get_Zij2(const lattice_t latt, const double cmin, const double cmax, const double sthe, + double &a, double &S); static int get_Zij2_b2nn(const lattice_t latt, const double cmin, const double cmax, double &S); -protected: - void meam_checkindex(int, int, int, int*, int*); - void getscreen(int i, double* scrfcn, double* dscrfcn, double* fcpair, double** x, int numneigh, - int* firstneigh, int numneigh_full, int* firstneigh_full, int ntype, int* type, int* fmap); - void calc_rho1(int i, int ntype, int* type, int* fmap, double** x, int numneigh, int* firstneigh, - double* scrfcn, double* fcpair); + protected: + void meam_checkindex(int, int, int, int *, int *); + void getscreen(int i, double *scrfcn, double *dscrfcn, double *fcpair, double **x, int numneigh, + int *firstneigh, int numneigh_full, int *firstneigh_full, int ntype, int *type, + int *fmap); + void calc_rho1(int i, int ntype, int *type, int *fmap, double **x, int numneigh, int *firstneigh, + double *scrfcn, double *fcpair); void alloyparams(); void compute_pair_meam(); double phi_meam(double, int, int); - double phi_meam_series(const double scrn, const int Z1, const int Z2, const int a, const int b, const double r, const double arat); + double phi_meam_series(const double scrn, const int Z1, const int Z2, const int a, const int b, + const double r, const double arat); void compute_reference_density(); - void get_tavref(double*, double*, double*, double*, double*, double*, double, double, double, double, - double, double, double, int, int, lattice_t); - void get_sijk(double, int, int, int, double*); - void get_densref(double, int, int, double*, double*, double*, double*, double*, double*, double*, double*); + void get_tavref(double *, double *, double *, double *, double *, double *, double, double, + double, double, double, double, double, int, int, lattice_t); + void get_sijk(double, int, int, int, double *); + void get_densref(double, int, int, double *, double *, double *, double *, double *, double *, + double *, double *); void interpolate_meam(int); -public: + public: + // clang-format off //----------------------------------------------------------------------------- // convert lattice spec to lattice_t // only use single-element lattices if single=true @@ -269,41 +279,46 @@ public: } return true; } - + // clang-format on static int get_Zij(const lattice_t latt); - void meam_setup_global(int nelt, lattice_t* lat, int* ielement, double* atwt, double* alpha, - double* b0, double* b1, double* b2, double* b3, double* alat, double* esub, - double* asub, double* t0, double* t1, double* t2, double* t3, double* rozero, - int* ibar); - void meam_setup_param(int which, double value, int nindex, int* index /*index(3)*/, int* errorflag); - void meam_setup_done(double* cutmax); + void meam_setup_global(int nelt, lattice_t *lat, int *ielement, double *atwt, double *alpha, + double *b0, double *b1, double *b2, double *b3, double *alat, double *esub, + double *asub, double *t0, double *t1, double *t2, double *t3, + double *rozero, int *ibar); + void meam_setup_param(int which, double value, int nindex, int *index /*index(3)*/, + int *errorflag); + void meam_setup_done(double *cutmax); void meam_dens_setup(int atom_nmax, int nall, int n_neigh); - void meam_dens_init(int i, int ntype, int* type, int* fmap, double** x, int numneigh, int* firstneigh, - int numneigh_full, int* firstneigh_full, int fnoffset); - void meam_dens_final(int nlocal, int eflag_either, int eflag_global, int eflag_atom, double* eng_vdwl, - double* eatom, int ntype, int* type, int* fmap, double** scale, int& errorflag); - void meam_force(int i, int eflag_either, int eflag_global, int eflag_atom, int vflag_atom, double* eng_vdwl, - double* eatom, int ntype, int* type, int* fmap, double** scale, double** x, int numneigh, int* firstneigh, - int numneigh_full, int* firstneigh_full, int fnoffset, double** f, double** vatom); + void meam_dens_init(int i, int ntype, int *type, int *fmap, double **x, int numneigh, + int *firstneigh, int numneigh_full, int *firstneigh_full, int fnoffset); + void meam_dens_final(int nlocal, int eflag_either, int eflag_global, int eflag_atom, + double *eng_vdwl, double *eatom, int ntype, int *type, int *fmap, + double **scale, int &errorflag); + void meam_force(int i, int eflag_either, int eflag_global, int eflag_atom, int vflag_atom, + double *eng_vdwl, double *eatom, int ntype, int *type, int *fmap, double **scale, + double **x, int numneigh, int *firstneigh, int numneigh_full, + int *firstneigh_full, int fnoffset, double **f, double **vatom); }; // Functions we need for compat -static inline bool iszero(const double f) { +static inline bool iszero(const double f) +{ return fabs(f) < 1e-20; } -static inline bool isone(const double f) { - return fabs(f-1.0) < 1e-20; +static inline bool isone(const double f) +{ + return fabs(f - 1.0) < 1e-20; } // Helper functions -static inline double fdiv_zero(const double n, const double d) { - if (iszero(d)) - return 0.0; +static inline double fdiv_zero(const double n, const double d) +{ + if (iszero(d)) return 0.0; return n / d; } -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-MEAMC/meam_dens_final.cpp b/src/USER-MEAMC/meam_dens_final.cpp index fe4308567d..e4df007230 100644 --- a/src/USER-MEAMC/meam_dens_final.cpp +++ b/src/USER-MEAMC/meam_dens_final.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MEAMC/meam_dens_init.cpp b/src/USER-MEAMC/meam_dens_init.cpp index 662838f8f7..f6de79de53 100644 --- a/src/USER-MEAMC/meam_dens_init.cpp +++ b/src/USER-MEAMC/meam_dens_init.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MEAMC/meam_force.cpp b/src/USER-MEAMC/meam_force.cpp index 5f53299518..ab72d3c6c8 100644 --- a/src/USER-MEAMC/meam_force.cpp +++ b/src/USER-MEAMC/meam_force.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MEAMC/meam_funcs.cpp b/src/USER-MEAMC/meam_funcs.cpp index 7292dd64b0..d7fb514591 100644 --- a/src/USER-MEAMC/meam_funcs.cpp +++ b/src/USER-MEAMC/meam_funcs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MEAMC/meam_impl.cpp b/src/USER-MEAMC/meam_impl.cpp index 474db275fd..d518e5fa79 100644 --- a/src/USER-MEAMC/meam_impl.cpp +++ b/src/USER-MEAMC/meam_impl.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MEAMC/meam_setup_done.cpp b/src/USER-MEAMC/meam_setup_done.cpp index 3a62bf0942..5c9979167d 100644 --- a/src/USER-MEAMC/meam_setup_done.cpp +++ b/src/USER-MEAMC/meam_setup_done.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MEAMC/meam_setup_global.cpp b/src/USER-MEAMC/meam_setup_global.cpp index f48deb34b1..a474e579c2 100644 --- a/src/USER-MEAMC/meam_setup_global.cpp +++ b/src/USER-MEAMC/meam_setup_global.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MEAMC/meam_setup_param.cpp b/src/USER-MEAMC/meam_setup_param.cpp index bed769c770..946a245e63 100644 --- a/src/USER-MEAMC/meam_setup_param.cpp +++ b/src/USER-MEAMC/meam_setup_param.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MEAMC/pair_meamc.cpp b/src/USER-MEAMC/pair_meamc.cpp index 7bbfcdd33a..a4ea3abdce 100644 --- a/src/USER-MEAMC/pair_meamc.cpp +++ b/src/USER-MEAMC/pair_meamc.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MEAMC/pair_meamc.h b/src/USER-MEAMC/pair_meamc.h index 7672612c19..08166c7bd7 100644 --- a/src/USER-MEAMC/pair_meamc.h +++ b/src/USER-MEAMC/pair_meamc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(meam/c,PairMEAMC) -PairStyle(meam,PairMEAMC) - +// clang-format off +PairStyle(meam/c,PairMEAMC); +PairStyle(meam,PairMEAMC); +// clang-format on #else #ifndef LMP_PAIR_MEAMC_H @@ -47,12 +47,12 @@ class PairMEAMC : public Pair { private: class MEAM *meam_inst; - double cutmax; // max cutoff for all elements - int nlibelements; // # of library elements - std::vector libelements; // names of library elements - std::vector mass; // mass of library element + double cutmax; // max cutoff for all elements + int nlibelements; // # of library elements + std::vector libelements; // names of library elements + std::vector mass; // mass of library element - double **scale; // scaling factor for adapt + double **scale; // scaling factor for adapt void allocate(); void read_files(const std::string &, const std::string &); @@ -61,7 +61,7 @@ class PairMEAMC : public Pair { void neigh_strip(int, int *, int *, int **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/atom_vec_edpd.cpp b/src/USER-MESODPD/atom_vec_edpd.cpp index 4880b1303c..cf7c8ed29f 100644 --- a/src/USER-MESODPD/atom_vec_edpd.cpp +++ b/src/USER-MESODPD/atom_vec_edpd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/atom_vec_edpd.h b/src/USER-MESODPD/atom_vec_edpd.h index f44e16bc7b..da17a855eb 100644 --- a/src/USER-MESODPD/atom_vec_edpd.h +++ b/src/USER-MESODPD/atom_vec_edpd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(edpd,AtomVecEDPD) - +// clang-format off +AtomStyle(edpd,AtomVecEDPD); +// clang-format on #else #ifndef LMP_ATOM_VEC_EDPD_H @@ -35,12 +35,12 @@ class AtomVecEDPD : public AtomVec { void data_atom_post(int); private: - double *edpd_cv,*edpd_temp,*edpd_flux; + double *edpd_cv, *edpd_temp, *edpd_flux; double **vest; double *vest_temp; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/atom_vec_mdpd.cpp b/src/USER-MESODPD/atom_vec_mdpd.cpp index 44543beb61..5a05d33b79 100644 --- a/src/USER-MESODPD/atom_vec_mdpd.cpp +++ b/src/USER-MESODPD/atom_vec_mdpd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/atom_vec_mdpd.h b/src/USER-MESODPD/atom_vec_mdpd.h index cac8437fa8..67134f30f0 100644 --- a/src/USER-MESODPD/atom_vec_mdpd.h +++ b/src/USER-MESODPD/atom_vec_mdpd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(mdpd,AtomVecMDPD) - +// clang-format off +AtomStyle(mdpd,AtomVecMDPD); +// clang-format on #else #ifndef LMP_ATOM_VEC_MDPD_H @@ -36,11 +36,11 @@ class AtomVecMDPD : public AtomVec { void pack_property_atom(int, double *, int, int); private: - double *rho,*drho; + double *rho, *drho; double **vest; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/atom_vec_tdpd.cpp b/src/USER-MESODPD/atom_vec_tdpd.cpp index 67f40967cd..8b558457ed 100644 --- a/src/USER-MESODPD/atom_vec_tdpd.cpp +++ b/src/USER-MESODPD/atom_vec_tdpd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/atom_vec_tdpd.h b/src/USER-MESODPD/atom_vec_tdpd.h index 678e7ac62e..898c48c160 100644 --- a/src/USER-MESODPD/atom_vec_tdpd.h +++ b/src/USER-MESODPD/atom_vec_tdpd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(tdpd,AtomVecTDPD) - +// clang-format off +AtomStyle(tdpd,AtomVecTDPD); +// clang-format on #else #ifndef LMP_ATOM_VEC_TDPD_H @@ -41,7 +41,7 @@ class AtomVecTDPD : public AtomVec { int cc_species; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/compute_edpd_temp_atom.cpp b/src/USER-MESODPD/compute_edpd_temp_atom.cpp index 383b5676c1..951473a62b 100644 --- a/src/USER-MESODPD/compute_edpd_temp_atom.cpp +++ b/src/USER-MESODPD/compute_edpd_temp_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/compute_edpd_temp_atom.h b/src/USER-MESODPD/compute_edpd_temp_atom.h index e0899d4759..0dd7464bca 100644 --- a/src/USER-MESODPD/compute_edpd_temp_atom.h +++ b/src/USER-MESODPD/compute_edpd_temp_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(edpd/temp/atom,ComputeEDPDTempAtom) - +// clang-format off +ComputeStyle(edpd/temp/atom,ComputeEDPDTempAtom); +// clang-format on #else #ifndef LMP_COMPUTE_EDPD_TEMP_ATOM_H @@ -37,7 +37,7 @@ class ComputeEDPDTempAtom : public Compute { double *temp_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/compute_tdpd_cc_atom.cpp b/src/USER-MESODPD/compute_tdpd_cc_atom.cpp index d616dfca4d..ccf83c9aad 100644 --- a/src/USER-MESODPD/compute_tdpd_cc_atom.cpp +++ b/src/USER-MESODPD/compute_tdpd_cc_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/compute_tdpd_cc_atom.h b/src/USER-MESODPD/compute_tdpd_cc_atom.h index fe6278a16f..1f9fe76b25 100644 --- a/src/USER-MESODPD/compute_tdpd_cc_atom.h +++ b/src/USER-MESODPD/compute_tdpd_cc_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(tdpd/cc/atom,ComputeTDPDCCAtom) - +// clang-format off +ComputeStyle(tdpd/cc/atom,ComputeTDPDCCAtom); +// clang-format on #else #ifndef LMP_COMPUTE_TDPD_CC_ATOM_H @@ -38,7 +38,7 @@ class ComputeTDPDCCAtom : public Compute { double *cc_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/fix_edpd_source.cpp b/src/USER-MESODPD/fix_edpd_source.cpp index 98a36e589a..0ad303516a 100644 --- a/src/USER-MESODPD/fix_edpd_source.cpp +++ b/src/USER-MESODPD/fix_edpd_source.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/fix_edpd_source.h b/src/USER-MESODPD/fix_edpd_source.h index 048fd55517..0d6fab1d9d 100644 --- a/src/USER-MESODPD/fix_edpd_source.h +++ b/src/USER-MESODPD/fix_edpd_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(edpd/source,FixEDPDSource) - +// clang-format off +FixStyle(edpd/source,FixEDPDSource); +// clang-format on #else #ifndef LMP_FIX_EDPDSOURCE_H @@ -38,7 +38,7 @@ class FixEDPDSource : public Fix { double value; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/fix_mvv_dpd.cpp b/src/USER-MESODPD/fix_mvv_dpd.cpp index 7d8658a065..73290535b1 100644 --- a/src/USER-MESODPD/fix_mvv_dpd.cpp +++ b/src/USER-MESODPD/fix_mvv_dpd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/fix_mvv_dpd.h b/src/USER-MESODPD/fix_mvv_dpd.h index ffaba67f92..c8d1626a42 100644 --- a/src/USER-MESODPD/fix_mvv_dpd.h +++ b/src/USER-MESODPD/fix_mvv_dpd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(mvv/dpd,FixMvvDPD) - +// clang-format off +FixStyle(mvv/dpd,FixMvvDPD); +// clang-format on #else #ifndef LMP_FIX_MVV_DPD_H @@ -39,7 +39,7 @@ class FixMvvDPD : public Fix { double verlet; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/fix_mvv_edpd.cpp b/src/USER-MESODPD/fix_mvv_edpd.cpp index 200ab2564e..856647d792 100644 --- a/src/USER-MESODPD/fix_mvv_edpd.cpp +++ b/src/USER-MESODPD/fix_mvv_edpd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/fix_mvv_edpd.h b/src/USER-MESODPD/fix_mvv_edpd.h index d779780eee..06fc373ca5 100644 --- a/src/USER-MESODPD/fix_mvv_edpd.h +++ b/src/USER-MESODPD/fix_mvv_edpd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(mvv/edpd,FixMvvEDPD) - +// clang-format off +FixStyle(mvv/edpd,FixMvvEDPD); +// clang-format on #else #ifndef LMP_FIX_MVV_EDPD_H @@ -39,7 +39,7 @@ class FixMvvEDPD : public Fix { double verlet; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/fix_mvv_tdpd.cpp b/src/USER-MESODPD/fix_mvv_tdpd.cpp index 8819595174..00c6e29968 100644 --- a/src/USER-MESODPD/fix_mvv_tdpd.cpp +++ b/src/USER-MESODPD/fix_mvv_tdpd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/fix_mvv_tdpd.h b/src/USER-MESODPD/fix_mvv_tdpd.h index 37e725b68f..e30b285f6f 100644 --- a/src/USER-MESODPD/fix_mvv_tdpd.h +++ b/src/USER-MESODPD/fix_mvv_tdpd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(mvv/tdpd,FixMvvTDPD) - +// clang-format off +FixStyle(mvv/tdpd,FixMvvTDPD); +// clang-format on #else #ifndef LMP_FIX_MVV_TDPD_H @@ -40,7 +40,7 @@ class FixMvvTDPD : public Fix { int cc_species; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/fix_tdpd_source.cpp b/src/USER-MESODPD/fix_tdpd_source.cpp index c0669552ff..5eb7416d5b 100644 --- a/src/USER-MESODPD/fix_tdpd_source.cpp +++ b/src/USER-MESODPD/fix_tdpd_source.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/fix_tdpd_source.h b/src/USER-MESODPD/fix_tdpd_source.h index 451fa62e52..fe0a806ac2 100644 --- a/src/USER-MESODPD/fix_tdpd_source.h +++ b/src/USER-MESODPD/fix_tdpd_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(tdpd/source,FixTDPDSource) - +// clang-format off +FixStyle(tdpd/source,FixTDPDSource); +// clang-format on #else #ifndef LMP_FIX_TDPDSOURCE_H @@ -39,7 +39,7 @@ class FixTDPDSource : public Fix { double value; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/pair_edpd.cpp b/src/USER-MESODPD/pair_edpd.cpp index 147e5c322f..53469e4e3d 100644 --- a/src/USER-MESODPD/pair_edpd.cpp +++ b/src/USER-MESODPD/pair_edpd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/pair_edpd.h b/src/USER-MESODPD/pair_edpd.h index c27a526225..a872401a3b 100644 --- a/src/USER-MESODPD/pair_edpd.h +++ b/src/USER-MESODPD/pair_edpd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(edpd,PairEDPD) - +// clang-format off +PairStyle(edpd,PairEDPD); +// clang-format on #else #ifndef LMP_PAIR_EDPD_H @@ -42,21 +42,21 @@ class PairEDPD : public Pair { protected: double cut_global; int seed; - double **cut,**cutT; - double **a0,**gamma; + double **cut, **cutT; + double **a0, **gamma; double **power; double **slope; double **kappa; double **powerT; int power_flag, kappa_flag; - double ***sc,***kc; + double ***sc, ***kc; class RanMars *random; class RanMars *randomT; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/pair_mdpd.cpp b/src/USER-MESODPD/pair_mdpd.cpp index 30589e19bd..9e704de2a7 100644 --- a/src/USER-MESODPD/pair_mdpd.cpp +++ b/src/USER-MESODPD/pair_mdpd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/pair_mdpd.h b/src/USER-MESODPD/pair_mdpd.h index 11977a32b3..746a9ee5c0 100644 --- a/src/USER-MESODPD/pair_mdpd.h +++ b/src/USER-MESODPD/pair_mdpd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(mdpd,PairMDPD) - +// clang-format off +PairStyle(mdpd,PairMDPD); +// clang-format on #else #ifndef LMP_PAIR_MDPD_H @@ -41,17 +41,17 @@ class PairMDPD : public Pair { virtual void write_data_all(FILE *); protected: - double cut_global,temperature; + double cut_global, temperature; int seed; double **cut, **cut_r; - double **A_att,**B_rep; - double **gamma,**sigma; + double **A_att, **B_rep; + double **gamma, **sigma; class RanMars *random; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/pair_mdpd_rhosum.cpp b/src/USER-MESODPD/pair_mdpd_rhosum.cpp index 0f37daacce..cbf1bccbee 100644 --- a/src/USER-MESODPD/pair_mdpd_rhosum.cpp +++ b/src/USER-MESODPD/pair_mdpd_rhosum.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/pair_mdpd_rhosum.h b/src/USER-MESODPD/pair_mdpd_rhosum.h index 065bcc80b0..c31b6be0ca 100644 --- a/src/USER-MESODPD/pair_mdpd_rhosum.h +++ b/src/USER-MESODPD/pair_mdpd_rhosum.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(mdpd/rhosum,PairMDPDRhoSum) - +// clang-format off +PairStyle(mdpd/rhosum,PairMDPDRhoSum); +// clang-format on #else #ifndef LMP_PAIR_MDPD_RHOSUM_H @@ -44,7 +44,7 @@ class PairMDPDRhoSum : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/pair_tdpd.cpp b/src/USER-MESODPD/pair_tdpd.cpp index a57b682c1c..e99edfa5ff 100644 --- a/src/USER-MESODPD/pair_tdpd.cpp +++ b/src/USER-MESODPD/pair_tdpd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESODPD/pair_tdpd.h b/src/USER-MESODPD/pair_tdpd.h index f141b3fe5b..71be53934e 100644 --- a/src/USER-MESODPD/pair_tdpd.h +++ b/src/USER-MESODPD/pair_tdpd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tdpd,PairTDPD) - +// clang-format off +PairStyle(tdpd,PairTDPD); +// clang-format on #else #ifndef LMP_PAIR_TDPD_H @@ -40,19 +40,19 @@ class PairTDPD : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_global,temperature; - int seed,cc_species; - double **cut,**cutcc; - double **a0,**gamma,**sigma; + double cut_global, temperature; + int seed, cc_species; + double **cut, **cutcc; + double **a0, **gamma, **sigma; double **power; - double ***kappa,***epsilon; + double ***kappa, ***epsilon; double ***powercc; class RanMars *random; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESONT/atom_vec_mesont.cpp b/src/USER-MESONT/atom_vec_mesont.cpp index 89a099273b..5e57479b63 100644 --- a/src/USER-MESONT/atom_vec_mesont.cpp +++ b/src/USER-MESONT/atom_vec_mesont.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESONT/atom_vec_mesont.h b/src/USER-MESONT/atom_vec_mesont.h index da6b7d2a09..38bb815a0a 100644 --- a/src/USER-MESONT/atom_vec_mesont.h +++ b/src/USER-MESONT/atom_vec_mesont.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(mesont,AtomVecMesoNT) - +// clang-format off +AtomStyle(mesont,AtomVecMesoNT); +// clang-format on #else #ifndef LMP_ATOM_VEC_MESONT_H @@ -31,7 +31,7 @@ class AtomVecMesoNT : public AtomVec { AtomVecMesoNT(class LAMMPS *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESONT/compute_mesont.cpp b/src/USER-MESONT/compute_mesont.cpp index a20ed32f26..6560699cf8 100644 --- a/src/USER-MESONT/compute_mesont.cpp +++ b/src/USER-MESONT/compute_mesont.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESONT/compute_mesont.h b/src/USER-MESONT/compute_mesont.h index e3ee9a53c8..ea8df7cf8c 100644 --- a/src/USER-MESONT/compute_mesont.h +++ b/src/USER-MESONT/compute_mesont.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(mesont,ComputeMesoNT) - +// clang-format off +ComputeStyle(mesont,ComputeMesoNT); +// clang-format on #else #ifndef LMP_COMPUTE_MESONT_ATOM_H @@ -41,11 +41,11 @@ class ComputeMesoNT : public Compute { int nmax; double *energy; - enum ComputeType {ES, EB, ET}; + enum ComputeType { ES, EB, ET }; ComputeType compute_type; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESONT/export_mesont.h b/src/USER-MESONT/export_mesont.h index 517b445d54..2438dd98dc 100644 --- a/src/USER-MESONT/export_mesont.h +++ b/src/USER-MESONT/export_mesont.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,31 +16,32 @@ #ifdef __cplusplus extern "C" { #endif - // see ExportCNT.f90 in lib/mesont for function details - void mesont_lib_TPBInit(); - void mesont_lib_TPMInit(const int& M, const int& N); - void mesont_lib_SetTablePath(const char* TPMFile, const int& N); +// see ExportCNT.f90 in lib/mesont for function details +void mesont_lib_TPBInit(); +void mesont_lib_TPMInit(const int &M, const int &N); +void mesont_lib_SetTablePath(const char *TPMFile, const int &N); - void mesont_lib_InitCNTPotModule(const int& STRModel, const int& STRParams, - const int& YMType, const int& BNDModel, const double& Rref); +void mesont_lib_InitCNTPotModule(const int &STRModel, const int &STRParams, const int &YMType, + const int &BNDModel, const double &Rref); - double mesont_lib_get_R(); +double mesont_lib_get_R(); - void mesont_lib_TubeStretchingForceField(double& U1, double& U2, double* F1, - double* F2, double* S1, double* S2, const double* X1, const double* X2, - const double& R12, const double& L12); +void mesont_lib_TubeStretchingForceField(double &U1, double &U2, double *F1, double *F2, double *S1, + double *S2, const double *X1, const double *X2, + const double &R12, const double &L12); - void mesont_lib_TubeBendingForceField(double& U1, double& U2, double& U3, - double* F1, double* F2, double* F3, double* S1, double* S2, double* S3, - const double* X1, const double* X2, const double* X3, const double& R123, - const double& L123, int& BBF2 ); +void mesont_lib_TubeBendingForceField(double &U1, double &U2, double &U3, double *F1, double *F2, + double *F3, double *S1, double *S2, double *S3, + const double *X1, const double *X2, const double *X3, + const double &R123, const double &L123, int &BBF2); - void mesont_lib_SegmentTubeForceField(double& U1, double& U2, double *U, - double* F1, double* F2, double* F, double* Fe, double* S1, double* S2, - double* S, double* Se, const double* X1, const double* X2, - const double& R12, const int& N, const double* X, const double* Xe, - const int* BBF, const double& R, const int& E1, const int& E2, - const int& Ee, const int& TPMType); +void mesont_lib_SegmentTubeForceField(double &U1, double &U2, double *U, double *F1, double *F2, + double *F, double *Fe, double *S1, double *S2, double *S, + double *Se, const double *X1, const double *X2, + const double &R12, const int &N, const double *X, + const double *Xe, const int *BBF, const double &R, + const int &E1, const int &E2, const int &Ee, + const int &TPMType); #ifdef __cplusplus } diff --git a/src/USER-MESONT/pair_mesocnt.cpp b/src/USER-MESONT/pair_mesocnt.cpp index cff99395ff..6ff33bc130 100644 --- a/src/USER-MESONT/pair_mesocnt.cpp +++ b/src/USER-MESONT/pair_mesocnt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESONT/pair_mesocnt.h b/src/USER-MESONT/pair_mesocnt.h index 2e13fe9243..3db576ad7d 100644 --- a/src/USER-MESONT/pair_mesocnt.h +++ b/src/USER-MESONT/pair_mesocnt.h @@ -1,7 +1,20 @@ +/* -*- 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 - -PairStyle(mesocnt, PairMesoCNT) - +// clang-format off +PairStyle(mesocnt, PairMesoCNT); +// clang-format on #else #ifndef LMP_PAIR_MESOCNT_H @@ -22,28 +35,27 @@ class PairMesoCNT : public Pair { double init_one(int, int); protected: - int uinf_points,gamma_points,phi_points,usemi_points; - int nlocal_size,reduced_neigh_size; - int *reduced_nlist,*numchainlist; - int **reduced_neighlist,**nchainlist,**endlist; + int uinf_points, gamma_points, phi_points, usemi_points; + int nlocal_size, reduced_neigh_size; + int *reduced_nlist, *numchainlist; + int **reduced_neighlist, **nchainlist, **endlist; int ***chainlist; - double ang,ang_inv,eunit,funit; - double delta1,delta2; - double r,rsq,d,rc,rcsq,rc0,cutoff,cutoffsq; - double r_ang,rsq_ang,d_ang,rc_ang,rcsq_ang,cutoff_ang,cutoffsq_ang; - double sig,sig_ang,comega,ctheta; - double hstart_uinf,hstart_gamma, - hstart_phi,psistart_phi,hstart_usemi,xistart_usemi; - double delh_uinf,delh_gamma,delh_phi,delpsi_phi,delh_usemi,delxi_usemi; + double ang, ang_inv, eunit, funit; + double delta1, delta2; + double r, rsq, d, rc, rcsq, rc0, cutoff, cutoffsq; + double r_ang, rsq_ang, d_ang, rc_ang, rcsq_ang, cutoff_ang, cutoffsq_ang; + double sig, sig_ang, comega, ctheta; + double hstart_uinf, hstart_gamma, hstart_phi, psistart_phi, hstart_usemi, xistart_usemi; + double delh_uinf, delh_gamma, delh_phi, delpsi_phi, delh_usemi, delxi_usemi; - double p1[3],p2[3],p[3],m[3]; - double *param,*w,*wnode; + double p1[3], p2[3], p[3], m[3]; + double *param, *w, *wnode; double **dq_w; - double ***q1_dq_w,***q2_dq_w; - double *uinf_data,*gamma_data,**phi_data,**usemi_data; - double **uinf_coeff,**gamma_coeff,****phi_coeff,****usemi_coeff; - double **flocal,**fglobal,**basis; + double ***q1_dq_w, ***q2_dq_w; + double *uinf_data, *gamma_data, **phi_data, **usemi_data; + double **uinf_coeff, **gamma_coeff, ****phi_coeff, ****usemi_coeff; + double **flocal, **fglobal, **basis; char *file; @@ -54,59 +66,56 @@ class PairMesoCNT : public Pair { void sort(int *, int); void read_file(); void read_data(FILE *, double *, double &, double &, int); - void read_data(FILE *, double **, double &, double &, - double &, double &, int); + void read_data(FILE *, double **, double &, double &, double &, double &, int); void spline_coeff(double *, double **, double, int); void spline_coeff(double **, double ****, double, double, int); double spline(double, double, double, double **, int); double dspline(double, double, double, double **, int); - double spline(double, double, double, double, double, double, - double ****, int); - double dxspline(double, double, double, double, double, double, - double ****, int); - double dyspline(double, double, double, double, double, double, - double ****, int); + double spline(double, double, double, double, double, double, double ****, int); + double dxspline(double, double, double, double, double, double, double ****, int); + double dyspline(double, double, double, double, double, double, double ****, int); - void geometry(const double *, const double *, const double *, - const double *, const double *, + void geometry(const double *, const double *, const double *, const double *, const double *, double *, double *, double *, double **); - void weight(const double *, const double *, const double *, - const double *, double &, double *, double *, - double *, double *); + void weight(const double *, const double *, const double *, const double *, double &, double *, + double *, double *, double *); void finf(const double *, double &, double **); void fsemi(const double *, double &, double &, double **); // inlined functions for efficiency - inline double heaviside(double x) { - if (x > 0) return 1.0; - else return 0.0; + inline double heaviside(double x) + { + if (x > 0) + return 1.0; + else + return 0.0; } - inline double s(double x) { - return heaviside(-x) + heaviside(x)*heaviside(1-x)*(1 - x*x*(3 - 2*x)); + inline double s(double x) + { + return heaviside(-x) + heaviside(x) * heaviside(1 - x) * (1 - x * x * (3 - 2 * x)); } - inline double ds(double x) { - return 6 * heaviside(x) * heaviside(1-x) * x * (x-1); - } + inline double ds(double x) { return 6 * heaviside(x) * heaviside(1 - x) * x * (x - 1); } - inline double s5(double x) { + inline double s5(double x) + { double x2 = x * x; - return heaviside(-x) - + heaviside(x)*heaviside(1-x)*(1 - x2*x*(6*x2 - 15*x + 10)); + return heaviside(-x) + heaviside(x) * heaviside(1 - x) * (1 - x2 * x * (6 * x2 - 15 * x + 10)); } - inline double ds5(double x) { + inline double ds5(double x) + { double x2 = x * x; - return -30 * heaviside(x) * heaviside(1-x) * x2 * (x2 - 2*x + 1); + return -30 * heaviside(x) * heaviside(1 - x) * x2 * (x2 - 2 * x + 1); } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESONT/pair_mesont_tpm.cpp b/src/USER-MESONT/pair_mesont_tpm.cpp index 2a18bd64c9..f75258eb36 100644 --- a/src/USER-MESONT/pair_mesont_tpm.cpp +++ b/src/USER-MESONT/pair_mesont_tpm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MESONT/pair_mesont_tpm.h b/src/USER-MESONT/pair_mesont_tpm.h index f7e600b888..ee8bd9ece6 100644 --- a/src/USER-MESONT/pair_mesont_tpm.h +++ b/src/USER-MESONT/pair_mesont_tpm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(mesont/tpm,PairMESONTTPM) - +// clang-format off +PairStyle(mesont/tpm,PairMESONTTPM); +// clang-format on #else #ifndef LMP_PAIR_MESONT_TPM_H @@ -42,14 +42,14 @@ class PairMESONTTPM : public Pair { void write_data_all(FILE *); virtual void init_style(); - double energy_s; // accumulated energies for stretching - double energy_b; // accumulated energies for bending - double energy_t; // accumulated energies for tube-tube interaction - double *eatom_s, *eatom_b, *eatom_t; // accumulated per-atom values + double energy_s; // accumulated energies for stretching + double energy_b; // accumulated energies for bending + double energy_t; // accumulated energies for tube-tube interaction + double *eatom_s, *eatom_b, *eatom_t; // accumulated per-atom values protected: int BendingMode, TPMType; - char* tab_path; + char *tab_path; int tab_path_length; double cut_global; double **cut; @@ -60,7 +60,7 @@ class PairMESONTTPM : public Pair { virtual void *extract(const char *, int &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MGPT/mgpt_bgmul_7.c.h b/src/USER-MGPT/mgpt_bgmul_7.c.h index 5719697759..ababcdab84 100644 --- a/src/USER-MGPT/mgpt_bgmul_7.c.h +++ b/src/USER-MGPT/mgpt_bgmul_7.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_linalg.cpp b/src/USER-MGPT/mgpt_linalg.cpp index 77eeea0438..d0ea59d447 100644 --- a/src/USER-MGPT/mgpt_linalg.cpp +++ b/src/USER-MGPT/mgpt_linalg.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_linalg.h b/src/USER-MGPT/mgpt_linalg.h index 20993af68c..07c4f5df6d 100644 --- a/src/USER-MGPT/mgpt_linalg.h +++ b/src/USER-MGPT/mgpt_linalg.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_mmul3_538.c.h b/src/USER-MGPT/mgpt_mmul3_538.c.h index d615902214..7e701933a0 100644 --- a/src/USER-MGPT/mgpt_mmul3_538.c.h +++ b/src/USER-MGPT/mgpt_mmul3_538.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_mmul3_748.c.h b/src/USER-MGPT/mgpt_mmul3_748.c.h index f6104c52a7..24e3fc9082 100644 --- a/src/USER-MGPT/mgpt_mmul3_748.c.h +++ b/src/USER-MGPT/mgpt_mmul3_748.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_mmul3d_526.c.h b/src/USER-MGPT/mgpt_mmul3d_526.c.h index 0a7e763f63..ea3f28b2ff 100644 --- a/src/USER-MGPT/mgpt_mmul3d_526.c.h +++ b/src/USER-MGPT/mgpt_mmul3d_526.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_mmul3d_744.c.h b/src/USER-MGPT/mgpt_mmul3d_744.c.h index cfbe1236c6..91877e9c32 100644 --- a/src/USER-MGPT/mgpt_mmul3d_744.c.h +++ b/src/USER-MGPT/mgpt_mmul3d_744.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_mmul_bg_552.c.h b/src/USER-MGPT/mgpt_mmul_bg_552.c.h index 069f96907f..5597d34d73 100644 --- a/src/USER-MGPT/mgpt_mmul_bg_552.c.h +++ b/src/USER-MGPT/mgpt_mmul_bg_552.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_mmul_bg_722.c.h b/src/USER-MGPT/mgpt_mmul_bg_722.c.h index 732bb1319a..1a18fb70f5 100644 --- a/src/USER-MGPT/mgpt_mmul_bg_722.c.h +++ b/src/USER-MGPT/mgpt_mmul_bg_722.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_mmul_bgq_n5_lda8_2x8.c.h b/src/USER-MGPT/mgpt_mmul_bgq_n5_lda8_2x8.c.h index ce2fb5e159..6cec7f7d28 100644 --- a/src/USER-MGPT/mgpt_mmul_bgq_n5_lda8_2x8.c.h +++ b/src/USER-MGPT/mgpt_mmul_bgq_n5_lda8_2x8.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_mmul_bgq_n7_lda8_4x8.c.h b/src/USER-MGPT/mgpt_mmul_bgq_n7_lda8_4x8.c.h index da7e850cac..ccbbca5884 100644 --- a/src/USER-MGPT/mgpt_mmul_bgq_n7_lda8_4x8.c.h +++ b/src/USER-MGPT/mgpt_mmul_bgq_n7_lda8_4x8.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_readpot.cpp b/src/USER-MGPT/mgpt_readpot.cpp index 9b89894f6f..6717312bcd 100644 --- a/src/USER-MGPT/mgpt_readpot.cpp +++ b/src/USER-MGPT/mgpt_readpot.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_readpot.h b/src/USER-MGPT/mgpt_readpot.h index 11c2a1b4b0..629b1c683f 100644 --- a/src/USER-MGPT/mgpt_readpot.h +++ b/src/USER-MGPT/mgpt_readpot.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_splinetab.cpp b/src/USER-MGPT/mgpt_splinetab.cpp index d526dedcc6..f6ae00376e 100644 --- a/src/USER-MGPT/mgpt_splinetab.cpp +++ b/src/USER-MGPT/mgpt_splinetab.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_splinetab.h b/src/USER-MGPT/mgpt_splinetab.h index 7458c1ecdd..4be9934957 100644 --- a/src/USER-MGPT/mgpt_splinetab.h +++ b/src/USER-MGPT/mgpt_splinetab.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_ttr_5022.c.h b/src/USER-MGPT/mgpt_ttr_5022.c.h index c588d4925f..a3f365788d 100644 --- a/src/USER-MGPT/mgpt_ttr_5022.c.h +++ b/src/USER-MGPT/mgpt_ttr_5022.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_ttr_5042.c.h b/src/USER-MGPT/mgpt_ttr_5042.c.h index f60ecb5fb1..0cdb8b5be1 100644 --- a/src/USER-MGPT/mgpt_ttr_5042.c.h +++ b/src/USER-MGPT/mgpt_ttr_5042.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_ttr_5123.c.h b/src/USER-MGPT/mgpt_ttr_5123.c.h index ecab1d2c47..1124ca35d6 100644 --- a/src/USER-MGPT/mgpt_ttr_5123.c.h +++ b/src/USER-MGPT/mgpt_ttr_5123.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_ttr_5141.c.h b/src/USER-MGPT/mgpt_ttr_5141.c.h index 0e3f04cdf4..5200a9a2b1 100644 --- a/src/USER-MGPT/mgpt_ttr_5141.c.h +++ b/src/USER-MGPT/mgpt_ttr_5141.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_ttr_7022.c.h b/src/USER-MGPT/mgpt_ttr_7022.c.h index 1e5e1cd94b..75ed1283cd 100644 --- a/src/USER-MGPT/mgpt_ttr_7022.c.h +++ b/src/USER-MGPT/mgpt_ttr_7022.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_ttr_7042.c.h b/src/USER-MGPT/mgpt_ttr_7042.c.h index fb8cdb3123..8a6ee14fdc 100644 --- a/src/USER-MGPT/mgpt_ttr_7042.c.h +++ b/src/USER-MGPT/mgpt_ttr_7042.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_ttr_7123.c.h b/src/USER-MGPT/mgpt_ttr_7123.c.h index 60fa7eb5e3..68fe692ade 100644 --- a/src/USER-MGPT/mgpt_ttr_7123.c.h +++ b/src/USER-MGPT/mgpt_ttr_7123.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/mgpt_ttr_7141.c.h b/src/USER-MGPT/mgpt_ttr_7141.c.h index 2e61b34fe2..9e72d0bd1f 100644 --- a/src/USER-MGPT/mgpt_ttr_7141.c.h +++ b/src/USER-MGPT/mgpt_ttr_7141.c.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/pair_mgpt.cpp b/src/USER-MGPT/pair_mgpt.cpp index 7061d1f86b..26881bfa9e 100644 --- a/src/USER-MGPT/pair_mgpt.cpp +++ b/src/USER-MGPT/pair_mgpt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MGPT/pair_mgpt.h b/src/USER-MGPT/pair_mgpt.h index f2f256ef80..227e5e9a50 100644 --- a/src/USER-MGPT/pair_mgpt.h +++ b/src/USER-MGPT/pair_mgpt.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(mgpt,PairMGPT) - +// clang-format off +PairStyle(mgpt,PairMGPT); +// clang-format on #else #ifndef LMP_PAIR_MGPT_H diff --git a/src/USER-MISC/angle_cosine_shift.cpp b/src/USER-MISC/angle_cosine_shift.cpp index 6c225b3e6d..1829537165 100644 --- a/src/USER-MISC/angle_cosine_shift.cpp +++ b/src/USER-MISC/angle_cosine_shift.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/angle_cosine_shift.h b/src/USER-MISC/angle_cosine_shift.h index f4dc1b02e7..038d31e501 100644 --- a/src/USER-MISC/angle_cosine_shift.h +++ b/src/USER-MISC/angle_cosine_shift.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine/shift,AngleCosineShift) - +// clang-format off +AngleStyle(cosine/shift,AngleCosineShift); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_SHIFT_H @@ -46,7 +46,7 @@ class AngleCosineShift : public Angle { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/angle_cosine_shift_exp.cpp b/src/USER-MISC/angle_cosine_shift_exp.cpp index 330b4fc5b6..43ecc3c692 100644 --- a/src/USER-MISC/angle_cosine_shift_exp.cpp +++ b/src/USER-MISC/angle_cosine_shift_exp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/angle_cosine_shift_exp.h b/src/USER-MISC/angle_cosine_shift_exp.h index 4a9ec15f95..6ebbb1185b 100644 --- a/src/USER-MISC/angle_cosine_shift_exp.h +++ b/src/USER-MISC/angle_cosine_shift_exp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,7 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS -AngleStyle(cosine/shift/exp,AngleCosineShiftExp) +// clang-format off +AngleStyle(cosine/shift/exp,AngleCosineShiftExp); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_SHIFT_EXP_H @@ -36,7 +38,7 @@ class AngleCosineShiftExp : public Angle { protected: bool *doExpansion; - double *umin,*a,*opt1; + double *umin, *a, *opt1; double *theta0; double *sint; double *cost; @@ -44,7 +46,7 @@ class AngleCosineShiftExp : public Angle { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/angle_dipole.cpp b/src/USER-MISC/angle_dipole.cpp index cc63dbc046..38f13a47bd 100644 --- a/src/USER-MISC/angle_dipole.cpp +++ b/src/USER-MISC/angle_dipole.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/angle_dipole.h b/src/USER-MISC/angle_dipole.h index cc25c53b92..e74947da9e 100644 --- a/src/USER-MISC/angle_dipole.h +++ b/src/USER-MISC/angle_dipole.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(dipole,AngleDipole) - +// clang-format off +AngleStyle(dipole,AngleDipole); +// clang-format on #else #ifndef LMP_ANGLE_DIPOLE_H @@ -37,12 +37,12 @@ class AngleDipole : public Angle { double single(int, int, int, int); protected: - double *k,*gamma0; + double *k, *gamma0; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/angle_fourier.cpp b/src/USER-MISC/angle_fourier.cpp index 47b74fad99..a1248d41db 100644 --- a/src/USER-MISC/angle_fourier.cpp +++ b/src/USER-MISC/angle_fourier.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/angle_fourier.h b/src/USER-MISC/angle_fourier.h index ea4c8b2852..daaab5351f 100644 --- a/src/USER-MISC/angle_fourier.h +++ b/src/USER-MISC/angle_fourier.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(fourier,AngleFourier) - +// clang-format off +AngleStyle(fourier,AngleFourier); +// clang-format on #else #ifndef ANGLE_FOURIER_H @@ -37,12 +37,12 @@ class AngleFourier : public Angle { virtual double single(int, int, int, int); protected: - double *k,*C0,*C1,*C2; + double *k, *C0, *C1, *C2; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/angle_fourier_simple.cpp b/src/USER-MISC/angle_fourier_simple.cpp index 2b40c2f12f..d69da70a57 100644 --- a/src/USER-MISC/angle_fourier_simple.cpp +++ b/src/USER-MISC/angle_fourier_simple.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/angle_fourier_simple.h b/src/USER-MISC/angle_fourier_simple.h index 734199939e..815ed99109 100644 --- a/src/USER-MISC/angle_fourier_simple.h +++ b/src/USER-MISC/angle_fourier_simple.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(fourier/simple,AngleFourierSimple) - +// clang-format off +AngleStyle(fourier/simple,AngleFourierSimple); +// clang-format on #else #ifndef ANGLE_FOURIER_SIMPLE_H @@ -37,12 +37,12 @@ class AngleFourierSimple : public Angle { virtual double single(int, int, int, int); protected: - double *k,*C,*N; + double *k, *C, *N; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/angle_gaussian.cpp b/src/USER-MISC/angle_gaussian.cpp index b8bd68bd02..e4310e0a22 100644 --- a/src/USER-MISC/angle_gaussian.cpp +++ b/src/USER-MISC/angle_gaussian.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/angle_gaussian.h b/src/USER-MISC/angle_gaussian.h index af2b097aee..654872205f 100644 --- a/src/USER-MISC/angle_gaussian.h +++ b/src/USER-MISC/angle_gaussian.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(gaussian,AngleGaussian) - +// clang-format off +AngleStyle(gaussian,AngleGaussian); +// clang-format on #else #ifndef LMP_ANGLE_GAUSSIAN_H @@ -39,12 +39,12 @@ class AngleGaussian : public Angle { protected: int *nterms; double *angle_temperature; - double **alpha,**width,**theta0; + double **alpha, **width, **theta0; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/angle_quartic.cpp b/src/USER-MISC/angle_quartic.cpp index 7c991e0857..f88c628fb1 100644 --- a/src/USER-MISC/angle_quartic.cpp +++ b/src/USER-MISC/angle_quartic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/angle_quartic.h b/src/USER-MISC/angle_quartic.h index 8b11b56488..0d352fac52 100644 --- a/src/USER-MISC/angle_quartic.h +++ b/src/USER-MISC/angle_quartic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(quartic,AngleQuartic) - +// clang-format off +AngleStyle(quartic,AngleQuartic); +// clang-format on #else #ifndef LMP_ANGLE_QUARTIC_H @@ -42,7 +42,7 @@ class AngleQuartic : public Angle { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/bond_gaussian.cpp b/src/USER-MISC/bond_gaussian.cpp index 98c5086c2d..ca0bd13df8 100644 --- a/src/USER-MISC/bond_gaussian.cpp +++ b/src/USER-MISC/bond_gaussian.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/bond_gaussian.h b/src/USER-MISC/bond_gaussian.h index 98cbf171de..07ed5d771d 100644 --- a/src/USER-MISC/bond_gaussian.h +++ b/src/USER-MISC/bond_gaussian.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(gaussian,BondGaussian) - +// clang-format off +BondStyle(gaussian,BondGaussian); +// clang-format on #else #ifndef LMP_BOND_GAUSSIAN_H @@ -39,12 +39,12 @@ class BondGaussian : public Bond { protected: int *nterms; double *bond_temperature; - double **alpha,**width,**r0; + double **alpha, **width, **r0; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/bond_harmonic_shift.cpp b/src/USER-MISC/bond_harmonic_shift.cpp index a4c7d08329..da6046f23f 100644 --- a/src/USER-MISC/bond_harmonic_shift.cpp +++ b/src/USER-MISC/bond_harmonic_shift.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/bond_harmonic_shift.h b/src/USER-MISC/bond_harmonic_shift.h index 4375e3787a..484a00b787 100644 --- a/src/USER-MISC/bond_harmonic_shift.h +++ b/src/USER-MISC/bond_harmonic_shift.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(harmonic/shift,BondHarmonicShift) - +// clang-format off +BondStyle(harmonic/shift,BondHarmonicShift); +// clang-format on #else #ifndef LMP_BOND_HARMONIC_SHIFT_H @@ -37,12 +37,12 @@ class BondHarmonicShift : public Bond { double single(int, double, int, int, double &); protected: - double *k,*r0,*r1; + double *k, *r0, *r1; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/bond_harmonic_shift_cut.cpp b/src/USER-MISC/bond_harmonic_shift_cut.cpp index ec7955bb3b..f6420b0c4a 100644 --- a/src/USER-MISC/bond_harmonic_shift_cut.cpp +++ b/src/USER-MISC/bond_harmonic_shift_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/bond_harmonic_shift_cut.h b/src/USER-MISC/bond_harmonic_shift_cut.h index 0d13305f0b..01dc9cb593 100644 --- a/src/USER-MISC/bond_harmonic_shift_cut.h +++ b/src/USER-MISC/bond_harmonic_shift_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(harmonic/shift/cut,BondHarmonicShiftCut) - +// clang-format off +BondStyle(harmonic/shift/cut,BondHarmonicShiftCut); +// clang-format on #else #ifndef LMP_BOND_HARMONIC_SHIFT_CUT_H @@ -37,12 +37,12 @@ class BondHarmonicShiftCut : public Bond { double single(int, double, int, int, double &); protected: - double *k,*r0,*r1; + double *k, *r0, *r1; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp index d8c79f0bdf..c7009742e0 100644 --- a/src/USER-MISC/bond_special.cpp +++ b/src/USER-MISC/bond_special.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/bond_special.h b/src/USER-MISC/bond_special.h index e1807a29da..80a32b7896 100644 --- a/src/USER-MISC/bond_special.h +++ b/src/USER-MISC/bond_special.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(special,BondSpecial) - +// clang-format off +BondStyle(special,BondSpecial); +// clang-format on #else #ifndef LMP_BOND_SPECIAL_H @@ -26,7 +26,7 @@ BondStyle(special,BondSpecial) namespace LAMMPS_NS { -class BondSpecial: public Bond { +class BondSpecial : public Bond { public: BondSpecial(class LAMMPS *); virtual ~BondSpecial(); @@ -40,12 +40,12 @@ class BondSpecial: public Bond { double single(int, double, int, int, double &); protected: - double *factor_lj,*factor_coul; + double *factor_lj, *factor_coul; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_ackland_atom.cpp b/src/USER-MISC/compute_ackland_atom.cpp index d4c5317c5c..05fd374a10 100644 --- a/src/USER-MISC/compute_ackland_atom.cpp +++ b/src/USER-MISC/compute_ackland_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/compute_ackland_atom.h b/src/USER-MISC/compute_ackland_atom.h index 0b2c0f98f1..657f419c86 100644 --- a/src/USER-MISC/compute_ackland_atom.h +++ b/src/USER-MISC/compute_ackland_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(ackland/atom,ComputeAcklandAtom) - +// clang-format off +ComputeStyle(ackland/atom,ComputeAcklandAtom); +// clang-format on #else #ifndef LMP_COMPUTE_ACKLAND_ATOM_H @@ -34,7 +34,7 @@ class ComputeAcklandAtom : public Compute { double memory_usage(); private: - int nmax,maxneigh,legacy; + int nmax, maxneigh, legacy; double *distsq; int *nearest, *nearest_n0, *nearest_n1; double *structure; @@ -44,7 +44,7 @@ class ComputeAcklandAtom : public Compute { void select2(int, int, double *, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_basal_atom.cpp b/src/USER-MISC/compute_basal_atom.cpp index a73f401120..eacb3cf267 100644 --- a/src/USER-MISC/compute_basal_atom.cpp +++ b/src/USER-MISC/compute_basal_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/compute_basal_atom.h b/src/USER-MISC/compute_basal_atom.h index 89e0ac739b..45527411ec 100644 --- a/src/USER-MISC/compute_basal_atom.h +++ b/src/USER-MISC/compute_basal_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(basal/atom,ComputeBasalAtom) - +// clang-format off +ComputeStyle(basal/atom,ComputeBasalAtom); +// clang-format on #else #ifndef LMP_COMPUTE_BASAL_ATOM_H @@ -34,7 +34,7 @@ class ComputeBasalAtom : public Compute { double memory_usage(); private: - int nmax,maxneigh; + int nmax, maxneigh; double *distsq; int *nearest, *nearest_n0, *nearest_n1; double **BPV; @@ -44,7 +44,7 @@ class ComputeBasalAtom : public Compute { void select2(int, int, double *, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_cnp_atom.cpp b/src/USER-MISC/compute_cnp_atom.cpp index fc9776a6a5..350567004e 100644 --- a/src/USER-MISC/compute_cnp_atom.cpp +++ b/src/USER-MISC/compute_cnp_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/compute_cnp_atom.h b/src/USER-MISC/compute_cnp_atom.h index f90b09ff35..03c52c401a 100644 --- a/src/USER-MISC/compute_cnp_atom.h +++ b/src/USER-MISC/compute_cnp_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(cnp/atom,ComputeCNPAtom) - +// clang-format off +ComputeStyle(cnp/atom,ComputeCNPAtom); +// clang-format on #else #ifndef LMP_COMPUTE_CNP_ATOM_H @@ -34,22 +34,22 @@ class ComputeCNPAtom : public Compute { double memory_usage(); private: -//revise + //revise int nmax; double cutsq; class NeighList *list; int **nearest; int *nnearest; double *cnpv; -// int nmax; -// double cutsq; -// class NeighList *list; -// int **nearest; -// int *nnearest; -// double *pattern; + // int nmax; + // double cutsq; + // class NeighList *list; + // int **nearest; + // int *nnearest; + // double *pattern; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_entropy_atom.cpp b/src/USER-MISC/compute_entropy_atom.cpp index 2fea708a71..d0866c946c 100644 --- a/src/USER-MISC/compute_entropy_atom.cpp +++ b/src/USER-MISC/compute_entropy_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/compute_entropy_atom.h b/src/USER-MISC/compute_entropy_atom.h index d11fcc850a..a122b2595d 100644 --- a/src/USER-MISC/compute_entropy_atom.h +++ b/src/USER-MISC/compute_entropy_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(entropy/atom,ComputeEntropyAtom) - +// clang-format off +ComputeStyle(entropy/atom,ComputeEntropyAtom); +// clang-format on #else #ifndef COMPUTE_ENTROPY_ATOM_H @@ -34,7 +34,7 @@ class ComputeEntropyAtom : public Compute { double memory_usage(); private: - int nmax,maxneigh, nbin; + int nmax, maxneigh, nbin; class NeighList *list; double *pair_entropy, *pair_entropy_avg; double sigma, cutoff, cutoff2; @@ -45,7 +45,7 @@ class ComputeEntropyAtom : public Compute { int local_flag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_gyration_shape.cpp b/src/USER-MISC/compute_gyration_shape.cpp index 12ccd84533..d64594d219 100644 --- a/src/USER-MISC/compute_gyration_shape.cpp +++ b/src/USER-MISC/compute_gyration_shape.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -43,7 +44,7 @@ ComputeGyrationShape::ComputeGyrationShape(LAMMPS *lmp, int narg, char **arg) : // ID of compute gyration id_gyration = utils::strdup(arg[3]); - init(); + ComputeGyrationShape::init(); vector = new double[6]; } diff --git a/src/USER-MISC/compute_gyration_shape.h b/src/USER-MISC/compute_gyration_shape.h index 92871a5827..8f74082eec 100644 --- a/src/USER-MISC/compute_gyration_shape.h +++ b/src/USER-MISC/compute_gyration_shape.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(gyration/shape,ComputeGyrationShape) - +// clang-format off +ComputeStyle(gyration/shape,ComputeGyrationShape); +// clang-format on #else #ifndef LMP_COMPUTE_GYRATION_SHAPE_H @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class ComputeGyrationShape : public Compute { public: - char *id_gyration; // fields accessed by other classes + char *id_gyration; // fields accessed by other classes ComputeGyrationShape(class LAMMPS *, int, char **); ~ComputeGyrationShape(); @@ -37,7 +37,7 @@ class ComputeGyrationShape : public Compute { class Compute *c_gyration; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_gyration_shape_chunk.cpp b/src/USER-MISC/compute_gyration_shape_chunk.cpp index 2adfa4d2c9..b6a3d6b789 100644 --- a/src/USER-MISC/compute_gyration_shape_chunk.cpp +++ b/src/USER-MISC/compute_gyration_shape_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -39,7 +40,7 @@ ComputeGyrationShapeChunk::ComputeGyrationShapeChunk(LAMMPS *lmp, int narg, char // ID of compute gyration id_gyration_chunk = utils::strdup(arg[3]); - init(); + ComputeGyrationShapeChunk::init(); array_flag = 1; size_array_cols = 6; diff --git a/src/USER-MISC/compute_gyration_shape_chunk.h b/src/USER-MISC/compute_gyration_shape_chunk.h index 53800887f4..bfabfaa46d 100644 --- a/src/USER-MISC/compute_gyration_shape_chunk.h +++ b/src/USER-MISC/compute_gyration_shape_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(gyration/shape/chunk,ComputeGyrationShapeChunk) - +// clang-format off +ComputeStyle(gyration/shape/chunk,ComputeGyrationShapeChunk); +// clang-format on #else #ifndef LMP_COMPUTE_GYRATION_SHAPE_CHUNK_H @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class ComputeGyrationShapeChunk : public Compute { public: - char *id_gyration_chunk; // fields accessed by other classes + char *id_gyration_chunk; // fields accessed by other classes ComputeGyrationShapeChunk(class LAMMPS *, int, char **); ~ComputeGyrationShapeChunk(); @@ -45,10 +45,9 @@ class ComputeGyrationShapeChunk : public Compute { class Compute *c_gyration_chunk; void allocate(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_hma.cpp b/src/USER-MISC/compute_hma.cpp index 23c0334dd3..b74280a8e5 100644 --- a/src/USER-MISC/compute_hma.cpp +++ b/src/USER-MISC/compute_hma.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/compute_hma.h b/src/USER-MISC/compute_hma.h index bc504fd5f5..750f5fc242 100644 --- a/src/USER-MISC/compute_hma.h +++ b/src/USER-MISC/compute_hma.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(hma,ComputeHMA) - +// clang-format off +ComputeStyle(hma,ComputeHMA); +// clang-format on #else #ifndef LMP_COMPUTE_HMA_H @@ -47,21 +47,20 @@ class ComputeHMA : public Compute { double boltz, nktv2p, inv_volume; double deltaPcap; double virial_compute(int); - static double sumVirial(int n, double* v) { + static double sumVirial(int n, double *v) + { double x = 0; - for (int i=0; ie and tb->f (evenly spaced) // ----------------------------------------------------------- - enum{LINEAR,SPLINE}; + enum { LINEAR, SPLINE }; inline void uf_lookup(int type, double x, double &u, double &f) { Table *tb = &tables[tabindex[type]]; - double x_over_delta = x*tb->invdelta; - int i = static_cast (x_over_delta); + double x_over_delta = x * tb->invdelta; + int i = static_cast(x_over_delta); double a; double b = x_over_delta - i; // Apply periodic boundary conditions to indices i and i+1 if (i >= tablength) i -= tablength; - int ip1 = i+1; if (ip1 >= tablength) ip1 -= tablength; + int ip1 = i + 1; + if (ip1 >= tablength) ip1 -= tablength; - switch(tabstyle) { + switch (tabstyle) { case LINEAR: u = tb->e[i] + b * tb->de[i]; - f = tb->f[i] + b * tb->df[i]; //<--works even if tb->f_unspecified==true + f = tb->f[i] + b * tb->df[i]; //<--works even if tb->f_unspecified==true break; case SPLINE: a = 1.0 - b; u = a * tb->e[i] + b * tb->e[ip1] + - ((a*a*a-a)*tb->e2[i] + (b*b*b-b)*tb->e2[ip1]) * - tb->deltasq6; + ((a * a * a - a) * tb->e2[i] + (b * b * b - b) * tb->e2[ip1]) * tb->deltasq6; if (tb->f_unspecified) //Formula below taken from equation3.3.5 of "numerical recipes in c" //"f"=-derivative of e with respect to x (or "phi" in this case) - f = (tb->e[i]-tb->e[ip1])*tb->invdelta + - ((3.0*a*a-1.0)*tb->e2[i]+(1.0-3.0*b*b)*tb->e2[ip1])*tb->delta/6.0; + f = (tb->e[i] - tb->e[ip1]) * tb->invdelta + + ((3.0 * a * a - 1.0) * tb->e2[i] + (1.0 - 3.0 * b * b) * tb->e2[ip1]) * tb->delta / + 6.0; else f = a * tb->f[i] + b * tb->f[ip1] + - ((a*a*a-a)*tb->f2[i] + (b*b*b-b)*tb->f2[ip1]) * - tb->deltasq6; + ((a * a * a - a) * tb->f2[i] + (b * b * b - b) * tb->f2[ip1]) * tb->deltasq6; break; - } // switch(tabstyle) - } // uf_lookup() - + } // switch(tabstyle) + } // uf_lookup() // ---------------------------------------------------------- // u_lookup() @@ -126,28 +125,27 @@ class DihedralTable : public Dihedral { int N = tablength; // i = static_cast ((x - tb->lo) * tb->invdelta); <-general version - double x_over_delta = x*tb->invdelta; - int i = static_cast (x_over_delta); + double x_over_delta = x * tb->invdelta; + int i = static_cast(x_over_delta); double b = x_over_delta - i; // Apply periodic boundary conditions to indices i and i+1 if (i >= N) i -= N; - int ip1 = i+1; if (ip1 >= N) ip1 -= N; + int ip1 = i + 1; + if (ip1 >= N) ip1 -= N; if (tabstyle == LINEAR) { u = tb->e[i] + b * tb->de[i]; - } - else if (tabstyle == SPLINE) { + } else if (tabstyle == SPLINE) { double a = 1.0 - b; u = a * tb->e[i] + b * tb->e[ip1] + - ((a*a*a-a)*tb->e2[i] + (b*b*b-b)*tb->e2[ip1]) * - tb->deltasq6; + ((a * a * a - a) * tb->e2[i] + (b * b * b - b) * tb->e2[ip1]) * tb->deltasq6; } - } // u_lookup() + } // u_lookup() -}; //class DihedralTable +}; //class DihedralTable -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS -#endif //#ifndef LMP_DIHEDRAL_TABLE_H -#endif //#ifdef DIHEDRAL_CLASS ... #else +#endif //#ifndef LMP_DIHEDRAL_TABLE_H +#endif //#ifdef DIHEDRAL_CLASS ... #else diff --git a/src/USER-MISC/dihedral_table_cut.cpp b/src/USER-MISC/dihedral_table_cut.cpp index 1fce1d1216..5c7bc30862 100644 --- a/src/USER-MISC/dihedral_table_cut.cpp +++ b/src/USER-MISC/dihedral_table_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/dihedral_table_cut.h b/src/USER-MISC/dihedral_table_cut.h index bff2472323..99607a9e0b 100644 --- a/src/USER-MISC/dihedral_table_cut.h +++ b/src/USER-MISC/dihedral_table_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(table/cut,DihedralTableCut) - +// clang-format off +DihedralStyle(table/cut,DihedralTableCut); +// clang-format on #else #ifndef LMP_DIHEDRAL_TABLE_CUT_H @@ -32,12 +32,12 @@ class DihedralTableCut : public DihedralTable { virtual void coeff(int, char **); protected: - double *aat_k,*aat_theta0_1,*aat_theta0_2; + double *aat_k, *aat_theta0_1, *aat_theta0_2; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_accelerate_cos.cpp b/src/USER-MISC/fix_accelerate_cos.cpp index 01dac054b4..72a148a27e 100644 --- a/src/USER-MISC/fix_accelerate_cos.cpp +++ b/src/USER-MISC/fix_accelerate_cos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_accelerate_cos.h b/src/USER-MISC/fix_accelerate_cos.h index 2f17eceded..cad4a94e2a 100644 --- a/src/USER-MISC/fix_accelerate_cos.h +++ b/src/USER-MISC/fix_accelerate_cos.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(accelerate/cos,FixAccelerateCos) - +// clang-format off +FixStyle(accelerate/cos,FixAccelerateCos); +// clang-format on #else #ifndef LMP_FIX_ACCELERATE_COS_H @@ -28,12 +28,12 @@ FixStyle(accelerate/cos,FixAccelerateCos) namespace LAMMPS_NS { -class FixAccelerateCos: public Fix { +class FixAccelerateCos : public Fix { public: FixAccelerateCos(class LAMMPS *, int, char **); - virtual ~FixAccelerateCos() {}; + virtual ~FixAccelerateCos(){}; int setmask(); - virtual void init() {}; + virtual void init(){}; void setup(int); virtual void post_force(int); @@ -41,7 +41,7 @@ class FixAccelerateCos: public Fix { double acceleration; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_addtorque.cpp b/src/USER-MISC/fix_addtorque.cpp index 4bcc15933f..7c8e832673 100644 --- a/src/USER-MISC/fix_addtorque.cpp +++ b/src/USER-MISC/fix_addtorque.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_addtorque.h b/src/USER-MISC/fix_addtorque.h index 62b77b52ae..74f6fa2495 100644 --- a/src/USER-MISC/fix_addtorque.h +++ b/src/USER-MISC/fix_addtorque.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(addtorque,FixAddTorque) - +// clang-format off +FixStyle(addtorque,FixAddTorque); +// clang-format on #else #ifndef LMP_FIX_ADDTORQUE_H @@ -39,16 +39,16 @@ class FixAddTorque : public Fix { double compute_vector(int); private: - double xvalue,yvalue,zvalue; + double xvalue, yvalue, zvalue; int varflag; - char *xstr,*ystr,*zstr; - int xvar,yvar,zvar,xstyle,ystyle,zstyle; - double foriginal[4],foriginal_all[4]; + char *xstr, *ystr, *zstr; + int xvar, yvar, zvar, xstyle, ystyle, zstyle; + double foriginal[4], foriginal_all[4]; int force_flag; int ilevel_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_ave_correlate_long.cpp b/src/USER-MISC/fix_ave_correlate_long.cpp index deeec0f1c7..b45823d509 100644 --- a/src/USER-MISC/fix_ave_correlate_long.cpp +++ b/src/USER-MISC/fix_ave_correlate_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_ave_correlate_long.h b/src/USER-MISC/fix_ave_correlate_long.h index bc7897cddd..b62c6aefcb 100644 --- a/src/USER-MISC/fix_ave_correlate_long.h +++ b/src/USER-MISC/fix_ave_correlate_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(ave/correlate/long,FixAveCorrelateLong) - +// clang-format off +FixStyle(ave/correlate/long,FixAveCorrelateLong); +// clang-format on #else #ifndef LMP_FIX_AVE_CORRELATE_LONG_H @@ -37,38 +37,38 @@ class FixAveCorrelateLong : public Fix { void restart(char *); double memory_usage(); - double *t; // Time steps for result arrays - double **f; // Result arrays + double *t; // Time steps for result arrays + double **f; // Result arrays unsigned int npcorr; private: // NOT OPTIMAL: shift2 and accumulator2 only needed in cross-correlations - double ***shift, *** shift2; + double ***shift, ***shift2; double ***correlation; double **accumulator, **accumulator2; unsigned long int **ncorrelation; unsigned int *naccumulator; unsigned int *insertindex; - int numcorrelators; // Recommended 20 - unsigned int p; // Points per correlator (recommended 16) - unsigned int m; // Num points for average (recommended 2; p mod m = 0) - unsigned int dmin; // Min distance between ponts for correlators k>0; dmin=p/m + int numcorrelators; // Recommended 20 + unsigned int p; // Points per correlator (recommended 16) + unsigned int m; // Num points for average (recommended 2; p mod m = 0) + unsigned int dmin; // Min distance between ponts for correlators k>0; dmin=p/m - int length; // Length of result arrays - int kmax; // Maximum correlator attained during simulation + int length; // Length of result arrays + int kmax; // Maximum correlator attained during simulation - int me,nvalues; + int me, nvalues; int nfreq; - bigint nvalid,nvalid_last,last_accumulated_step; - int *which,*argindex,*value2index; + bigint nvalid, nvalid_last, last_accumulated_step; + int *which, *argindex, *value2index; char **ids; FILE *fp; - int type,startstep,overwrite; + int type, startstep, overwrite; long filepos; - int npair; // number of correlation pairs to calculate + int npair; // number of correlation pairs to calculate double *values; void accumulate(); @@ -77,10 +77,9 @@ class FixAveCorrelateLong : public Fix { void add(const int i, const double w, const int k = 0); void add(const int i, const double wA, const double wB, const int k = 0); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_electron_stopping.cpp b/src/USER-MISC/fix_electron_stopping.cpp index 5453d5c302..e6aedb014b 100644 --- a/src/USER-MISC/fix_electron_stopping.cpp +++ b/src/USER-MISC/fix_electron_stopping.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_electron_stopping.h b/src/USER-MISC/fix_electron_stopping.h index 968f7e6368..f978164b67 100644 --- a/src/USER-MISC/fix_electron_stopping.h +++ b/src/USER-MISC/fix_electron_stopping.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -17,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(electron/stopping,FixElectronStopping) - +// clang-format off +FixStyle(electron/stopping,FixElectronStopping); +// clang-format on #else #ifndef LMP_FIX_ELECTRON_STOPPING_H @@ -27,7 +27,6 @@ FixStyle(electron/stopping,FixElectronStopping) #include "fix.h" - namespace LAMMPS_NS { class FixElectronStopping : public Fix { @@ -44,22 +43,22 @@ class FixElectronStopping : public Fix { void read_table(const char *); void grow_table(); - double Ecut; // cutoff energy - double SeLoss, SeLoss_all; // electronic energy loss - int SeLoss_sync_flag; // sync done since last change? + double Ecut; // cutoff energy + double SeLoss, SeLoss_all; // electronic energy loss + int SeLoss_sync_flag; // sync done since last change? - int maxlines; // max number of lines in table - int table_entries; // number of table entries actually read - double **elstop_ranges; // [ 0][i]: energies - // [>0][i]: stopping powers per type + int maxlines; // max number of lines in table + int table_entries; // number of table entries actually read + double **elstop_ranges; // [ 0][i]: energies + // [>0][i]: stopping powers per type - int iregion; // region index if used, else -1 - int minneigh; // minimum number of neighbors + int iregion; // region index if used, else -1 + int minneigh; // minimum number of neighbors class NeighList *list; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_electron_stopping_fit.cpp b/src/USER-MISC/fix_electron_stopping_fit.cpp index b3dbfb3337..35ead3397c 100644 --- a/src/USER-MISC/fix_electron_stopping_fit.cpp +++ b/src/USER-MISC/fix_electron_stopping_fit.cpp @@ -1,6 +1,7 @@ +// clang-format off /* --------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_electron_stopping_fit.h b/src/USER-MISC/fix_electron_stopping_fit.h index fa95c96483..304ea79cfa 100644 --- a/src/USER-MISC/fix_electron_stopping_fit.h +++ b/src/USER-MISC/fix_electron_stopping_fit.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -17,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(electron/stopping/fit,FixElectronStoppingFit) - +// clang-format off +FixStyle(electron/stopping/fit,FixElectronStoppingFit); +// clang-format on #else #ifndef LMP_FIX_ELECTRON_STOPPING_FIT_H @@ -41,14 +41,15 @@ class FixElectronStoppingFit : public Fix { double compute_scalar(); private: - double *energy_coh_in,*v_min_sq,*v_max_sq,*drag_fac_in_1,*drag_fac_in_2,*drag_fac_1,*drag_fac_2; - double electronic_loss,electronic_loss_this_node; - double f_dot_v_prior,f_dot_v_current; - int last_step,this_step; + double *energy_coh_in, *v_min_sq, *v_max_sq, *drag_fac_in_1, *drag_fac_in_2, *drag_fac_1, + *drag_fac_2; + double electronic_loss, electronic_loss_this_node; + double f_dot_v_prior, f_dot_v_current; + int last_step, this_step; int nlevels_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_ffl.cpp b/src/USER-MISC/fix_ffl.cpp index 6dfa9eb2ca..fc7c986ce3 100644 --- a/src/USER-MISC/fix_ffl.cpp +++ b/src/USER-MISC/fix_ffl.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_ffl.h b/src/USER-MISC/fix_ffl.h index 24f5405e3f..26e076cb8b 100644 --- a/src/USER-MISC/fix_ffl.h +++ b/src/USER-MISC/fix_ffl.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(ffl,FixFFL) - +// clang-format off +FixStyle(ffl,FixFFL); +// clang-format on #else #ifndef LMP_FIX_FFL_H @@ -45,6 +45,7 @@ class FixFFL : public Fix { virtual void *extract(const char *, int &); void init_ffl(); + protected: double *ffl_tmp1, *ffl_tmp2; double t_start, t_stop, t_target; @@ -61,7 +62,7 @@ class FixFFL : public Fix { double **vaux; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_filter_corotate.cpp b/src/USER-MISC/fix_filter_corotate.cpp index 6e6dce84a7..a398491df5 100644 --- a/src/USER-MISC/fix_filter_corotate.cpp +++ b/src/USER-MISC/fix_filter_corotate.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_filter_corotate.h b/src/USER-MISC/fix_filter_corotate.h index 4819c00b8b..d0af7bc2db 100644 --- a/src/USER-MISC/fix_filter_corotate.h +++ b/src/USER-MISC/fix_filter_corotate.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -17,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(filter/corotate,FixFilterCorotate) - +// clang-format off +FixStyle(filter/corotate,FixFilterCorotate); +// clang-format on #else #ifndef LMP_FIX_FILTER_COROTATE_H @@ -27,111 +27,105 @@ FixStyle(filter/corotate,FixFilterCorotate) #include "fix.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { - class FixFilterCorotate : public Fix - { - public: +class FixFilterCorotate : public Fix { + public: + FixFilterCorotate(class LAMMPS *, int, char **); + ~FixFilterCorotate(); + void setup(int); + void setup_pre_neighbor(); + void pre_neighbor(); + void setup_pre_force_respa(int, int); + // void setup_post_force_respa(int,int); + void pre_force_respa(int, int, int); + void post_force_respa(int, int, int); - FixFilterCorotate(class LAMMPS *, int, char **); - ~FixFilterCorotate(); - void setup(int); - void setup_pre_neighbor(); - void pre_neighbor(); - void setup_pre_force_respa(int,int); -// void setup_post_force_respa(int,int); - void pre_force_respa(int, int, int); - void post_force_respa(int, int, int); + void init(); + int setmask(); - void init(); - int setmask(); + double compute_array(int, int); - double compute_array(int,int); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); + void grow_arrays(int); + double memory_usage(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - void grow_arrays(int ); - double memory_usage(); + void copy_arrays(int, int, int); + void set_arrays(int); + void update_arrays(int, int); - void copy_arrays(int, int, int); - void set_arrays(int); - void update_arrays(int, int); + int pack_exchange(int, double *); + int unpack_exchange(int, double *); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + protected: + int me, nprocs; - protected: + int flevel; //filtered respa level - int me,nprocs; + double **help2; //temp derivative + double **x_store; //temp for atom->x + double *g; //temp for derivative - int flevel; //filtered respa level + double *n1, *n2, *n3, *del1, *del2, *del3; - double **help2; //temp derivative - double **x_store; //temp for atom->x - double *g; //temp for derivative + double **dn1dx, **dn2dx, **dn3dx; - double*n1,*n2,*n3, *del1, *del2,*del3; + int *bond_flag, *angle_flag; // bond/angle types to constrain + int *type_flag; // constrain bonds to these types + double *mass_list; // constrain bonds to these masses + int nmass; // # of masses in mass_list - double**dn1dx,**dn2dx,**dn3dx; + int molecular; // copy of atom->molecular + double *bond_distance, *angle_distance; // constraint distances - int *bond_flag,*angle_flag; // bond/angle types to constrain - int *type_flag; // constrain bonds to these types - double *mass_list; // constrain bonds to these masses - int nmass; // # of masses in mass_list + int nlevels_respa; // copies of needed rRESPA variables - int molecular; // copy of atom->molecular - double *bond_distance,*angle_distance; // constraint distances + double **x, **v, **f; // local ptrs to atom class quantities + double *mass, *rmass; + int *type; + int nlocal; + // atom-based arrays + int *shake_flag; // 0 if atom not in SHAKE cluster + // 1 = size 3 angle cluster + // 2,3,4 = size of bond-only cluster + tagint **shake_atom; // global IDs of atoms in cluster + // central atom is 1st + // lowest global ID is 1st for size 2 + int **shake_type; // bondtype of each bond in cluster + // for angle cluster, 3rd value + // is angletype + int *nshake; // count - int nlevels_respa; // copies of needed rRESPA variables + int *list; // list of clusters to SHAKE + int nlist, maxlist; // size and max-size of list + double ***clist_derv; //stores derivative + double **clist_q0; //stores reference config + int *clist_nselect1, *clist_nselect2; //stores length of each selec. list + int **clist_select1, **clist_select2; //stores selection lists - double **x,**v,**f; // local ptrs to atom class quantities - double *mass,*rmass; - int *type; - int nlocal; - // atom-based arrays - int *shake_flag; // 0 if atom not in SHAKE cluster - // 1 = size 3 angle cluster - // 2,3,4 = size of bond-only cluster - tagint **shake_atom; // global IDs of atoms in cluster - // central atom is 1st - // lowest global ID is 1st for size 2 - int **shake_type; // bondtype of each bond in cluster - // for angle cluster, 3rd value - // is angletype - int *nshake; // count + void find_clusters(); + int masscheck(double); - int *list; // list of clusters to SHAKE - int nlist,maxlist; // size and max-size of list - double ***clist_derv; //stores derivative - double **clist_q0; //stores reference config - int *clist_nselect1, *clist_nselect2; //stores length of each selec. list - int **clist_select1, **clist_select2; //stores selection lists + void filter_inner(); + void filter_outer(); - void find_clusters(); - int masscheck(double); + void general_cluster(int, int); - void filter_inner(); - void filter_outer(); + void stats(); + int bondtype_findset(int, tagint, tagint, int); + int angletype_findset(int, tagint, tagint, int); - void general_cluster(int,int); + // callback functions for ring communication - void stats(); - int bondtype_findset(int, tagint, tagint, int); - int angletype_findset(int, tagint, tagint, int); + static void ring_bonds(int, char *, void *); + static void ring_nshake(int, char *, void *); + static void ring_shake(int, char *, void *); - // callback functions for ring communication + int sgn(double val) { return (0 < val) - (val < 0); }; +}; - static void ring_bonds(int, char *, void *); - static void ring_nshake(int, char *, void *); - static void ring_shake(int, char *, void *); - - int sgn(double val) { - return (0 < val) - (val < 0); - }; - }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_flow_gauss.cpp b/src/USER-MISC/fix_flow_gauss.cpp index 9e6a2c0174..1a48488ab6 100644 --- a/src/USER-MISC/fix_flow_gauss.cpp +++ b/src/USER-MISC/fix_flow_gauss.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_flow_gauss.h b/src/USER-MISC/fix_flow_gauss.h index 84b647d484..9ca12b61cc 100644 --- a/src/USER-MISC/fix_flow_gauss.h +++ b/src/USER-MISC/fix_flow_gauss.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ Joel.Eaves@Colorado.edu ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(flow/gauss,FixFlowGauss) - +// clang-format off +FixStyle(flow/gauss,FixFlowGauss); +// clang-format on #else #ifndef LMP_FIX_FLOWGAUSS_H @@ -24,33 +24,32 @@ FixStyle(flow/gauss,FixFlowGauss) #include "fix.h" - namespace LAMMPS_NS { +namespace LAMMPS_NS { - class FixFlowGauss : public Fix { - public: - FixFlowGauss(class LAMMPS *, int, char **); - int setmask(); - void init(); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - double compute_scalar(); - double compute_vector(int n); +class FixFlowGauss : public Fix { + public: + FixFlowGauss(class LAMMPS *, int, char **); + int setmask(); + void init(); + void setup(int); + void post_force(int); + void post_force_respa(int, int, int); + double compute_scalar(); + double compute_vector(int n); - protected: - int dimension; - bool flow[3]; //flag if each direction is conserved - double a_app[3]; //applied acceleration - double mTot; //total mass of constrained group - double f_tot[3]; //total applied force - double pe_tot; //total added energy - double dt; //timestep - bool workflag; //if calculate work done by fix - int ilevel_respa; + protected: + int dimension; + bool flow[3]; //flag if each direction is conserved + double a_app[3]; //applied acceleration + double mTot; //total mass of constrained group + double f_tot[3]; //total applied force + double pe_tot; //total added energy + double dt; //timestep + bool workflag; //if calculate work done by fix + int ilevel_respa; +}; - }; - - } +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_gle.cpp b/src/USER-MISC/fix_gle.cpp index 8a7459b79d..782ea89792 100644 --- a/src/USER-MISC/fix_gle.cpp +++ b/src/USER-MISC/fix_gle.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_gle.h b/src/USER-MISC/fix_gle.h index 39ea35a37b..17150ea2be 100644 --- a/src/USER-MISC/fix_gle.h +++ b/src/USER-MISC/fix_gle.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(gle,FixGLE) - +// clang-format off +FixStyle(gle,FixGLE); +// clang-format on #else #ifndef LMP_FIX_GLE_H @@ -52,7 +52,9 @@ class FixGLE : public Fix { virtual void *extract(const char *, int &); - void init_gle(); void init_gles(); + void init_gle(); + void init_gles(); + protected: int ns, ns1sq; double *A, *C, *S, *T, *ST, *TT; @@ -71,7 +73,7 @@ class FixGLE : public Fix { double **vaux; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_grem.cpp b/src/USER-MISC/fix_grem.cpp index e036eff205..07b8051225 100644 --- a/src/USER-MISC/fix_grem.cpp +++ b/src/USER-MISC/fix_grem.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_grem.h b/src/USER-MISC/fix_grem.h index 0cd88477ea..71dd5d939d 100644 --- a/src/USER-MISC/fix_grem.h +++ b/src/USER-MISC/fix_grem.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(grem,FixGrem) - +// clang-format off +FixStyle(grem,FixGrem); +// clang-format on #else #ifndef LMP_FIX_GREM_H @@ -35,18 +35,18 @@ class FixGrem : public Fix { void post_force(int); void *extract(const char *, int &); double compute_scalar(); - double scale_grem,lambda,eta,h0; + double scale_grem, lambda, eta, h0; int pressflag; private: - double tbath,pressref; + double tbath, pressref; protected: - char *id_temp,*id_press,*id_ke,*id_pe,*id_nh; - class Compute *temperature,*pressure,*ke,*pe; + char *id_temp, *id_press, *id_ke, *id_pe, *id_nh; + class Compute *temperature, *pressure, *ke, *pe; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_imd.cpp b/src/USER-MISC/fix_imd.cpp index f9591db4d3..199cabc644 100644 --- a/src/USER-MISC/fix_imd.cpp +++ b/src/USER-MISC/fix_imd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_imd.h b/src/USER-MISC/fix_imd.h index 3019c0908c..3c4e66f50a 100644 --- a/src/USER-MISC/fix_imd.h +++ b/src/USER-MISC/fix_imd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -42,9 +42,9 @@ negotiate an appropriate license for such distribution." ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(imd,FixIMD) - +// clang-format off +FixStyle(imd,FixIMD); +// clang-format on #else #ifndef LMP_FIX_IMD_H @@ -73,51 +73,51 @@ class FixIMD : public Fix { double memory_usage(); protected: - int imd_port; - void *localsock; - void *clientsock; + int imd_port; + void *localsock; + void *clientsock; - int num_coords; // total number of atoms controlled by this fix - int size_one; // bytes per atom in communication buffer. - int maxbuf; // size of atom communication buffer. - void *comm_buf; // communication buffer - void *idmap; // hash for mapping atom indices to consistent order. - tagint *rev_idmap; // list of the hash keys for reverse mapping. + int num_coords; // total number of atoms controlled by this fix + int size_one; // bytes per atom in communication buffer. + int maxbuf; // size of atom communication buffer. + void *comm_buf; // communication buffer + void *idmap; // hash for mapping atom indices to consistent order. + tagint *rev_idmap; // list of the hash keys for reverse mapping. - int imd_forces; // number of forces communicated via IMD. - void *force_buf; // force data buffer - double imd_fscale; // scale factor for forces. in case VMD's units are off. + int imd_forces; // number of forces communicated via IMD. + void *force_buf; // force data buffer + double imd_fscale; // scale factor for forces. in case VMD's units are off. - int imd_inactive; // true if IMD connection stopped. - int imd_terminate; // true if IMD requests termination of run. - int imd_trate; // IMD transmission rate. + int imd_inactive; // true if IMD connection stopped. + int imd_terminate; // true if IMD requests termination of run. + int imd_trate; // IMD transmission rate. - int unwrap_flag; // true if coordinates need to be unwrapped before sending - int nowait_flag; // true if LAMMPS should not wait with the execution for VMD. - int connect_msg; // flag to indicate whether a "listen for connection message" is needed. + int unwrap_flag; // true if coordinates need to be unwrapped before sending + int nowait_flag; // true if LAMMPS should not wait with the execution for VMD. + int connect_msg; // flag to indicate whether a "listen for connection message" is needed. - int me; // my MPI rank in this "world". - int nlevels_respa; // flag to determine respa levels. + int me; // my MPI rank in this "world". + int nlevels_respa; // flag to determine respa levels. - int msglen; - char *msgdata; + int msglen; + char *msgdata; #if defined(LAMMPS_ASYNC_IMD) - int buf_has_data; // flag to indicate to the i/o thread what to do. - pthread_mutex_t write_mutex; // mutex for sending coordinates to i/o thread - pthread_cond_t write_cond; // conditional variable for coordinate i/o - pthread_mutex_t read_mutex; // mutex for accessing data receieved by i/o thread - pthread_t iothread; // thread id for i/o thread. - pthread_attr_t iot_attr; // i/o thread attributes. -public: - void ioworker(void); + int buf_has_data; // flag to indicate to the i/o thread what to do. + pthread_mutex_t write_mutex; // mutex for sending coordinates to i/o thread + pthread_cond_t write_cond; // conditional variable for coordinate i/o + pthread_mutex_t read_mutex; // mutex for accessing data receieved by i/o thread + pthread_t iothread; // thread id for i/o thread. + pthread_attr_t iot_attr; // i/o thread attributes. + public: + void ioworker(void); #endif -protected: + protected: int reconnect(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_ipi.cpp b/src/USER-MISC/fix_ipi.cpp index 1f1b527816..277ddc8489 100644 --- a/src/USER-MISC/fix_ipi.cpp +++ b/src/USER-MISC/fix_ipi.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_ipi.h b/src/USER-MISC/fix_ipi.h index 32f81e596f..443dbc8780 100644 --- a/src/USER-MISC/fix_ipi.h +++ b/src/USER-MISC/fix_ipi.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(ipi,FixIPI) - +// clang-format off +FixStyle(ipi,FixIPI); +// clang-format on #else #ifndef LMP_FIX_IPI_H @@ -34,8 +34,12 @@ class FixIPI : public Fix { virtual void final_integrate(); protected: - char *host; int port; int inet, master, hasdata; - int ipisock, me, socketflag; double *buffer; long bsize; + char *host; + int port; + int inet, master, hasdata; + int ipisock, me, socketflag; + double *buffer; + long bsize; int kspace_flag; int reset_flag; @@ -43,7 +47,7 @@ class FixIPI : public Fix { class Irregular *irregular; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_momentum_chunk.cpp b/src/USER-MISC/fix_momentum_chunk.cpp index d8a3b8ee4d..06d2137d84 100644 --- a/src/USER-MISC/fix_momentum_chunk.cpp +++ b/src/USER-MISC/fix_momentum_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_momentum_chunk.h b/src/USER-MISC/fix_momentum_chunk.h index 84ce3824c3..d290582187 100644 --- a/src/USER-MISC/fix_momentum_chunk.h +++ b/src/USER-MISC/fix_momentum_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(momentum/chunk,FixMomentumChunk) - +// clang-format off +FixStyle(momentum/chunk,FixMomentumChunk); +// clang-format on #else #ifndef LMP_FIX_MOMENTUM_CHUNK_H @@ -22,7 +22,6 @@ FixStyle(momentum/chunk,FixMomentumChunk) #include "fix.h" - namespace LAMMPS_NS { class FixMomentumChunk : public Fix { @@ -35,15 +34,15 @@ class FixMomentumChunk : public Fix { void post_run(); protected: - std::string id_chunk,id_com,id_vcm,id_omega; - int nchunk,linear,angular,rescale; - int xflag,yflag,zflag; + std::string id_chunk, id_com, id_vcm, id_omega; + int nchunk, linear, angular, rescale; + int xflag, yflag, zflag; class ComputeChunkAtom *cchunk; - class Compute *ccom,*cvcm,*comega; + class Compute *ccom, *cvcm, *comega; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_npt_cauchy.cpp b/src/USER-MISC/fix_npt_cauchy.cpp index 802cabea67..2390872631 100644 --- a/src/USER-MISC/fix_npt_cauchy.cpp +++ b/src/USER-MISC/fix_npt_cauchy.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_npt_cauchy.h b/src/USER-MISC/fix_npt_cauchy.h index 4842e59af8..1348b1bce4 100644 --- a/src/USER-MISC/fix_npt_cauchy.h +++ b/src/USER-MISC/fix_npt_cauchy.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt/cauchy,FixNPTCauchy) - +// clang-format off +FixStyle(npt/cauchy,FixNPTCauchy); +// clang-format on #else #ifndef LMP_FIX_NPT_CAUCHY_H @@ -40,101 +40,101 @@ class FixNPTCauchy : public Fix { double compute_scalar(); virtual double compute_vector(int); void write_restart(FILE *); - virtual int pack_restart_data(double *); // pack restart data + virtual int pack_restart_data(double *); // pack restart data virtual void restart(char *); int modify_param(int, char **); void reset_target(double); void reset_dt(); - virtual void *extract(const char*,int &); + virtual void *extract(const char *, int &); double memory_usage(); protected: - int dimension,which; - double dtv,dtf,dthalf,dt4,dt8,dto; - double boltz,nktv2p,tdof; - double vol0; // reference volume - double t0; // reference temperature - // used for barostat mass - double t_start,t_stop; - double t_current,t_target,ke_target; + int dimension, which; + double dtv, dtf, dthalf, dt4, dt8, dto; + double boltz, nktv2p, tdof; + double vol0; // reference volume + double t0; // reference temperature + // used for barostat mass + double t_start, t_stop; + double t_current, t_target, ke_target; double t_freq; - int tstat_flag; // 1 if control T - int pstat_flag; // 1 if control P + int tstat_flag; // 1 if control T + int pstat_flag; // 1 if control P - int pstyle,pcouple,allremap; - int p_flag[6]; // 1 if control P on this dim, 0 if not - double p_start[6],p_stop[6]; - double p_freq[6],p_target[6]; - double omega[6],omega_dot[6]; + int pstyle, pcouple, allremap; + int p_flag[6]; // 1 if control P on this dim, 0 if not + double p_start[6], p_stop[6]; + double p_freq[6], p_target[6]; + double omega[6], omega_dot[6]; double omega_mass[6]; double p_current[6]; - double drag,tdrag_factor; // drag factor on particle thermostat - double pdrag_factor; // drag factor on barostat - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int dilate_group_bit; // mask for dilation group - int *rfix; // indices of rigid fixes - char *id_dilate; // group name to dilate - class Irregular *irregular; // for migrating atoms after box flips + double drag, tdrag_factor; // drag factor on particle thermostat + double pdrag_factor; // drag factor on barostat + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int dilate_group_bit; // mask for dilation group + int *rfix; // indices of rigid fixes + char *id_dilate; // group name to dilate + class Irregular *irregular; // for migrating atoms after box flips int nlevels_respa; double *step_respa; - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tcomputeflag,pcomputeflag; // 1 = compute was created by fix - // 0 = created externally + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tcomputeflag, pcomputeflag; // 1 = compute was created by fix + // 0 = created externally - double *eta,*eta_dot; // chain thermostat for particles + double *eta, *eta_dot; // chain thermostat for particles double *eta_dotdot; double *eta_mass; - int mtchain; // length of chain - int mtchain_default_flag; // 1 = mtchain is default + int mtchain; // length of chain + int mtchain_default_flag; // 1 = mtchain is default - double *etap; // chain thermostat for barostat + double *etap; // chain thermostat for barostat double *etap_dot; double *etap_dotdot; double *etap_mass; - int mpchain; // length of chain + int mpchain; // length of chain - int mtk_flag; // 0 if using Hoover barostat - int pdim; // number of barostatted dims - double p_freq_max; // maximum barostat frequency + int mtk_flag; // 0 if using Hoover barostat + int pdim; // number of barostatted dims + double p_freq_max; // maximum barostat frequency - double p_hydro; // hydrostatic target pressure + double p_hydro; // hydrostatic target pressure - int nc_tchain,nc_pchain; + int nc_tchain, nc_pchain; double factor_eta; - double sigma[6]; // scaled target stress - double fdev[6]; // deviatoric force on barostat - int deviatoric_flag; // 0 if target stress tensor is hydrostatic - double h0_inv[6]; // h_inv of reference (zero strain) box - int nreset_h0; // interval for resetting h0 + double sigma[6]; // scaled target stress + double fdev[6]; // deviatoric force on barostat + int deviatoric_flag; // 0 if target stress tensor is hydrostatic + double h0_inv[6]; // h_inv of reference (zero strain) box + int nreset_h0; // interval for resetting h0 - double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections + double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections - int eta_mass_flag; // 1 if eta_mass updated, 0 if not. - int omega_mass_flag; // 1 if omega_mass updated, 0 if not. - int etap_mass_flag; // 1 if etap_mass updated, 0 if not. - int dipole_flag; // 1 if dipole is updated, 0 if not. - int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not + int eta_mass_flag; // 1 if eta_mass updated, 0 if not. + int omega_mass_flag; // 1 if omega_mass updated, 0 if not. + int etap_mass_flag; // 1 if etap_mass updated, 0 if not. + int dipole_flag; // 1 if dipole is updated, 0 if not. + int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not - int scaleyz; // 1 if yz scaled with lz - int scalexz; // 1 if xz scaled with lz - int scalexy; // 1 if xy scaled with ly - int flipflag; // 1 if box flips are invoked as needed + int scaleyz; // 1 if yz scaled with lz + int scalexz; // 1 if xz scaled with lz + int scalexy; // 1 if xy scaled with ly + int flipflag; // 1 if box flips are invoked as needed - int pre_exchange_flag; // set if pre_exchange needed for box flips + int pre_exchange_flag; // set if pre_exchange needed for box flips - double fixedpoint[3]; // location of dilation fixed-point + double fixedpoint[3]; // location of dilation fixed-point void couple(); virtual void remap(); void nhc_temp_integrate(); void nhc_press_integrate(); - virtual void nve_x(); // may be overwritten by child classes + virtual void nve_x(); // may be overwritten by child classes virtual void nve_v(); virtual void nh_v_press(); virtual void nh_v_temp(); @@ -148,36 +148,34 @@ class FixNPTCauchy : public Fix { void nh_omega_dot(); // Implementation of CauchyStat - char *id_store; // fix id of the STORE fix for retaining data - class FixStore *init_store; // fix pointer to STORE fix - double H0[3][3]; // shape matrix for the undeformed cell - double h_old[6]; // previous time step shape matrix for - // the undeformed cell - double invH0[3][3]; // inverse of H0; - double CSvol0; // volume of undeformed cell - double setPK[3][3]; // current set values of the PK stress - // (this is modified until the cauchy - // stress converges) - double alpha; // integration parameter for the cauchystat - int initPK; // 1 if setPK needs to be initialized either - // from cauchy or restart, else 0 - int restartPK; // Read PK stress from the previous run - int restart_stored; // values of PK stress from the previous step stored - int initRUN; // 0 if run not initialized - // (pressure->vector not computed yet), - // else 1 (pressure->vector available) + char *id_store; // fix id of the STORE fix for retaining data + class FixStore *init_store; // fix pointer to STORE fix + double H0[3][3]; // shape matrix for the undeformed cell + double h_old[6]; // previous time step shape matrix for + // the undeformed cell + double invH0[3][3]; // inverse of H0; + double CSvol0; // volume of undeformed cell + double setPK[3][3]; // current set values of the PK stress + // (this is modified until the cauchy + // stress converges) + double alpha; // integration parameter for the cauchystat + int initPK; // 1 if setPK needs to be initialized either + // from cauchy or restart, else 0 + int restartPK; // Read PK stress from the previous run + int restart_stored; // values of PK stress from the previous step stored + int initRUN; // 0 if run not initialized + // (pressure->vector not computed yet), + // else 1 (pressure->vector available) void CauchyStat_init(); void CauchyStat_cleanup(); void CauchyStat(); - void CauchyStat_Step(double (&Fi)[3][3], double (&Fdot)[3][3], - double (&cauchy)[3][3], double (&setcauchy)[3][3], - double (&setPK)[3][3], double volume, double volume0, - double deltat, double alpha); - + void CauchyStat_Step(double (&Fi)[3][3], double (&Fdot)[3][3], double (&cauchy)[3][3], + double (&setcauchy)[3][3], double (&setPK)[3][3], double volume, + double volume0, double deltat, double alpha); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_nvk.cpp b/src/USER-MISC/fix_nvk.cpp index 6426eee5cc..1f4c76febc 100644 --- a/src/USER-MISC/fix_nvk.cpp +++ b/src/USER-MISC/fix_nvk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_nvk.h b/src/USER-MISC/fix_nvk.h index 63113342cd..90162e2fc0 100644 --- a/src/USER-MISC/fix_nvk.h +++ b/src/USER-MISC/fix_nvk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvk,FixNVK) - +// clang-format off +FixStyle(nvk,FixNVK); +// clang-format on #else #ifndef LMP_FIX_NVK_H @@ -37,13 +37,13 @@ class FixNVK : public Fix { virtual void reset_dt(); protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; double K_target; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index 5618b36a32..6ec4e278ec 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratdir_veces + https://www.lammps.org/, Sandia National Laboratdir_veces Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_orient_eco.h b/src/USER-MISC/fix_orient_eco.h index 4c241fc8ea..d8e593a0ea 100644 --- a/src/USER-MISC/fix_orient_eco.h +++ b/src/USER-MISC/fix_orient_eco.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(orient/eco,FixOrientECO) - +// clang-format off +FixStyle(orient/eco,FixOrientECO); +// clang-format on #else #ifndef LMP_FIX_ORIENT_ECO_H @@ -25,56 +25,55 @@ FixStyle(orient/eco,FixOrientECO) namespace LAMMPS_NS { class FixOrientECO : public Fix { - public: - FixOrientECO(class LAMMPS *, int, char **); - ~FixOrientECO(); - int setmask(); - void init(); - void init_list(int, class NeighList *); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - double compute_scalar(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); + public: + FixOrientECO(class LAMMPS *, int, char **); + ~FixOrientECO(); + int setmask(); + void init(); + void init_list(int, class NeighList *); + void setup(int); + void post_force(int); + void post_force_respa(int, int, int); + double compute_scalar(); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); + double memory_usage(); - private: - struct Nbr; // forward declaration. private struct for managing precomputed terms + private: + struct Nbr; // forward declaration. private struct for managing precomputed terms - int me; // this processors rank - int nmax; // maximal # of owned + ghost atoms on this processor - int ilevel_respa; // used for RESPA integrator only + int me; // this processors rank + int nmax; // maximal # of owned + ghost atoms on this processor + int ilevel_respa; // used for RESPA integrator only - int sign; // from sign of u - double u_0; // synthetic potential energy - double half_u; // half synthetic potential energy - double eta; // threshold for thermal effects - double inv_eta; // inverse threshold for thermal effects - double r_cut; // cutoff radius - double squared_cutoff; // squared cutoff radius - double inv_squared_cutoff; // inverse squared cutoff radius - char *dir_filename; // filename of reference grain input - double dir_vec[6][3]; // direct lattice vectors - double reciprocal_vectors[2][3][3]; // reciprocal lattice vectors + int sign; // from sign of u + double u_0; // synthetic potential energy + double half_u; // half synthetic potential energy + double eta; // threshold for thermal effects + double inv_eta; // inverse threshold for thermal effects + double r_cut; // cutoff radius + double squared_cutoff; // squared cutoff radius + double inv_squared_cutoff; // inverse squared cutoff radius + char *dir_filename; // filename of reference grain input + double dir_vec[6][3]; // direct lattice vectors + double reciprocal_vectors[2][3][3]; // reciprocal lattice vectors - double added_energy; // energy added by fix + double added_energy; // energy added by fix - double **order; // order parameter and normalized order - // parameter per atom + double **order; // order parameter and normalized order + // parameter per atom - double norm_fac; // normalization constant - double inv_norm_fac; // inverse normalization constant + double norm_fac; // normalization constant + double inv_norm_fac; // inverse normalization constant - Nbr *nbr; // pointer on array of precomputed terms - class NeighList *list; // LAMMPS' neighbor list + Nbr *nbr; // pointer on array of precomputed terms + class NeighList *list; // LAMMPS' neighbor list - void get_reciprocal(); // calculate reciprocal lattice vectors - int get_norm(); // compute normalization factor + void get_reciprocal(); // calculate reciprocal lattice vectors + int get_norm(); // compute normalization factor }; -} - -#endif // LMP_FIX_ORIENT_ECO_H -#endif // FIX_CLASS +} // namespace LAMMPS_NS +#endif // LMP_FIX_ORIENT_ECO_H +#endif // FIX_CLASS diff --git a/src/USER-MISC/fix_pafi.cpp b/src/USER-MISC/fix_pafi.cpp index 472bb8498f..eea8a2c1d3 100644 --- a/src/USER-MISC/fix_pafi.cpp +++ b/src/USER-MISC/fix_pafi.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_pafi.h b/src/USER-MISC/fix_pafi.h index b71483f50e..32942bc1e1 100644 --- a/src/USER-MISC/fix_pafi.h +++ b/src/USER-MISC/fix_pafi.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(pafi,FixPAFI) - +// clang-format off +FixStyle(pafi,FixPAFI); +// clang-format on #else #ifndef LMP_FIX_PAFI_H @@ -48,26 +48,26 @@ class FixPAFI : public Fix { double memory_usage(); protected: - int varflag,icompute; + int varflag, icompute; char *computename; class Compute *PathCompute; - double proj[6], proj_all[6]; // f,v,h, psi - double results[5], results_all[5]; // f.n, (f.n)**2, psi, dx.n - double c_v[10],c_v_all[10]; - double temperature,gamma,sqrtD,t_period,local_norm,mass_f; - int force_flag,od_flag,com_flag; - int nlevels_respa,ilevel_respa; + double proj[6], proj_all[6]; // f,v,h, psi + double results[5], results_all[5]; // f.n, (f.n)**2, psi, dx.n + double c_v[10], c_v_all[10]; + double temperature, gamma, sqrtD, t_period, local_norm, mass_f; + int force_flag, od_flag, com_flag; + int nlevels_respa, ilevel_respa; int maxatom; class RanMars *random; int seed; double **h; // nve - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_pimd.cpp b/src/USER-MISC/fix_pimd.cpp index 1a48738cbe..ce1d41302f 100644 --- a/src/USER-MISC/fix_pimd.cpp +++ b/src/USER-MISC/fix_pimd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_pimd.h b/src/USER-MISC/fix_pimd.h index 5782246c76..2c13663f23 100644 --- a/src/USER-MISC/fix_pimd.h +++ b/src/USER-MISC/fix_pimd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(pimd,FixPIMD) - +// clang-format off +FixStyle(pimd,FixPIMD); +// clang-format on #else #ifndef FIX_PIMD_H @@ -38,16 +38,16 @@ class FixPIMD : public Fix { double memory_usage(); void grow_arrays(int); - void copy_arrays(int,int,int); - int pack_exchange(int,double*); - int unpack_exchange(int,double*); - int pack_restart(int,double*); - void unpack_restart(int,int); + void copy_arrays(int, int, int); + int pack_exchange(int, double *); + int unpack_exchange(int, double *); + int pack_restart(int, double *); + void unpack_restart(int, int); int maxsize_restart(); int size_restart(int); double compute_vector(int); - int pack_forward_comm(int, int*, double *, int, int*); + int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); int method; @@ -68,7 +68,7 @@ class FixPIMD : public Fix { /* inter-partition communication */ int max_nsend; - tagint* tag_send; + tagint *tag_send; double *buf_send; int max_nlocal; @@ -87,8 +87,8 @@ class FixPIMD : public Fix { int *mode_index; void nmpimd_init(); - void nmpimd_fill(double**); - void nmpimd_transform(double**, double**, double*); + void nmpimd_fill(double **); + void nmpimd_transform(double **, double **, double *); /* Nose-hoover chain integration */ @@ -108,8 +108,7 @@ class FixPIMD : public Fix { void nhc_update_x(); }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_rhok.cpp b/src/USER-MISC/fix_rhok.cpp index 54c6a0a9aa..5c49878998 100644 --- a/src/USER-MISC/fix_rhok.cpp +++ b/src/USER-MISC/fix_rhok.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + 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 diff --git a/src/USER-MISC/fix_rhok.h b/src/USER-MISC/fix_rhok.h index 74e2f1031c..1a69c7a24e 100644 --- a/src/USER-MISC/fix_rhok.h +++ b/src/USER-MISC/fix_rhok.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + 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 @@ -10,9 +10,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rhok,FixRhok) - +// clang-format off +FixStyle(rhok,FixRhok); +// clang-format on #else #ifndef LMP_FIX_RHOK_H @@ -22,13 +22,12 @@ FixStyle(rhok,FixRhok) namespace LAMMPS_NS { -class FixRhok : public Fix -{ -public: +class FixRhok : public Fix { + public: // Constructor: all the parameters to this fix specified in // the LAMMPS input get passed in - FixRhok( LAMMPS* inLMP, int inArgc, char** inArgv ); - virtual ~FixRhok() {}; + FixRhok(LAMMPS *inLMP, int inArgc, char **inArgv); + virtual ~FixRhok(){}; // Methods that this fix implements // -------------------------------- @@ -40,38 +39,37 @@ public: void init(); // Initial application of the fix to a system (when doing MD / minimization) - void setup( int inVFlag ); - void min_setup( int inVFlag ); + void setup(int inVFlag); + void min_setup(int inVFlag); // Modify the forces calculated in the main force loop, either when // doing usual MD, RESPA MD or minimization - void post_force( int inVFlag ); - void post_force_respa( int inVFlag, int inILevel, int inILoop ); - void min_post_force( int inVFlag ); + void post_force(int inVFlag); + void post_force_respa(int inVFlag, int inILevel, int inILoop); + void min_post_force(int inVFlag); // Compute the change in the potential energy induced by this fix double compute_scalar(); - // Compute the ith component of the vector associated with this fix - double compute_vector( int inI ); + // Compute the ith component of the vector associated with this fix + double compute_vector(int inI); -private: + private: // RESPA boilerplate int mNLevelsRESPA; // Defining parameters for this umbrella - double mK[3], mKappa, mRhoK0; + double mK[3], mKappa, mRhoK0; - // Number of particles affected by the fix - int mNThis; - double mSqrtNThis; + // Number of particles affected by the fix + int mNThis; + double mSqrtNThis; - // Real and imaginary parts of rho_k := sum_i exp( - i k . r_i ) - double mRhoKLocal[2], mRhoKGlobal[2]; + // Real and imaginary parts of rho_k := sum_i exp( - i k . r_i ) + double mRhoKLocal[2], mRhoKGlobal[2]; }; -} // namespace LAMMPS_NS - -#endif // __FIX_RHOK__ -#endif // FIX_CLASS +} // namespace LAMMPS_NS +#endif // __FIX_RHOK__ +#endif // FIX_CLASS diff --git a/src/USER-MISC/fix_smd.cpp b/src/USER-MISC/fix_smd.cpp index bc8ede4a17..047f40c2a3 100644 --- a/src/USER-MISC/fix_smd.cpp +++ b/src/USER-MISC/fix_smd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_smd.h b/src/USER-MISC/fix_smd.h index bb84d03f27..d26ecd7600 100644 --- a/src/USER-MISC/fix_smd.h +++ b/src/USER-MISC/fix_smd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(smd,FixSMD) - +// clang-format off +FixStyle(smd,FixSMD); +// clang-format on #else #ifndef LMP_FIX_SMD_H @@ -38,23 +38,23 @@ class FixSMD : public Fix { void restart(char *); private: - double xc,yc,zc,xn,yn,zn,r0; - double k_smd,f_smd,v_smd; - int xflag,yflag,zflag; + double xc, yc, zc, xn, yn, zn, r0; + double k_smd, f_smd, v_smd; + int xflag, yflag, zflag; int styleflag; - double r_old,r_now,pmf; + double r_old, r_now, pmf; - int igroup2,group2bit; - double masstotal,masstotal2; + int igroup2, group2bit; + double masstotal, masstotal2; int ilevel_respa; - double ftotal[3],ftotal_all[7]; + double ftotal[3], ftotal_all[7]; int force_flag; void smd_tether(); void smd_couple(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_srp.cpp b/src/USER-MISC/fix_srp.cpp index 51047dfaa6..fb502febaf 100644 --- a/src/USER-MISC/fix_srp.cpp +++ b/src/USER-MISC/fix_srp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_srp.h b/src/USER-MISC/fix_srp.h index f045f498c3..2167a27340 100644 --- a/src/USER-MISC/fix_srp.h +++ b/src/USER-MISC/fix_srp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(SRP,FixSRP) - +// clang-format off +FixStyle(SRP,FixSRP); +// clang-format on #else #ifndef LMP_FIX_SRP_H @@ -44,7 +44,7 @@ class FixSRP : public Fix { int unpack_border(int, int, double *); void post_run(); - int pack_restart(int, double*); + int pack_restart(int, double *); void unpack_restart(int, int); int maxsize_restart(); int size_restart(int); @@ -59,7 +59,7 @@ class FixSRP : public Fix { int bptype; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp index 1d6079d4d6..c6a3ed47ea 100644 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ------------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_ti_spring.h b/src/USER-MISC/fix_ti_spring.h index 96ed1bf042..0900a71dee 100644 --- a/src/USER-MISC/fix_ti_spring.h +++ b/src/USER-MISC/fix_ti_spring.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,9 +19,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(ti/spring,FixTISpring) - +// clang-format off +FixStyle(ti/spring,FixTISpring); +// clang-format on #else #ifndef LMP_FIX_TI_SPRING_H @@ -35,45 +35,45 @@ class FixTISpring : public Fix { public: FixTISpring(class LAMMPS *, int, char **); ~FixTISpring(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - void initial_integrate(int); + int setmask(); + void init(); + void setup(int); + void min_setup(int); + void post_force(int); + void post_force_respa(int, int, int); + void min_post_force(int); + void initial_integrate(int); double compute_scalar(); double compute_vector(int); double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + void grow_arrays(int); + void copy_arrays(int, int, int); + int pack_exchange(int, double *); + int unpack_exchange(int, double *); + int pack_restart(int, double *); + void unpack_restart(int, int); + int size_restart(int); + int maxsize_restart(); private: - double switch_func(double); // Switching function. - double dswitch_func(double); // Switching function derivative. + double switch_func(double); // Switching function. + double dswitch_func(double); // Switching function derivative. - double k; // Spring constant. - double espring; // Springs energies. - double **xoriginal; // Original coords of atoms. - double lambda; // Coupling parameter. - double dlambda; // Lambda variation with t. - double linfo[2]; // Current lambda status. - bigint t_switch; // Total switching steps. - bigint t_equil; // Equilibration time. - bigint t0; // Initial time. - int sf; // Switching function option. - int nlevels_respa; + double k; // Spring constant. + double espring; // Springs energies. + double **xoriginal; // Original coords of atoms. + double lambda; // Coupling parameter. + double dlambda; // Lambda variation with t. + double linfo[2]; // Current lambda status. + bigint t_switch; // Total switching steps. + bigint t_equil; // Equilibration time. + bigint t0; // Initial time. + int sf; // Switching function option. + int nlevels_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index 5d3e5c69e7..211b2eadb2 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_ttm_mod.h b/src/USER-MISC/fix_ttm_mod.h index e22e94ad49..c14f6ee4e0 100644 --- a/src/USER-MISC/fix_ttm_mod.h +++ b/src/USER-MISC/fix_ttm_mod.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(ttm/mod,FixTTMMod) - +// clang-format off +FixStyle(ttm/mod,FixTTMMod); +// clang-format on #else #ifndef LMP_FIX_TTM_MOD_H @@ -25,8 +25,8 @@ FixStyle(ttm/mod,FixTTMMod) namespace LAMMPS_NS { struct el_heat_capacity_thermal_conductivity { -double el_heat_capacity; -double el_thermal_conductivity; + double el_heat_capacity; + double el_thermal_conductivity; }; class FixTTMMod : public Fix { @@ -58,22 +58,22 @@ class FixTTMMod : public Fix { int seed; class RanMars *random; FILE *fp; - int nxnodes,nynodes,nznodes; + int nxnodes, nynodes, nznodes; bigint total_nnodes; int ***nsum, ***nsum_all; - double *gfactor1,*gfactor2,*ratio,**flangevin; - double ***T_electron,***T_electron_old,***T_electron_first; - double ***sum_vsq,***sum_mass_vsq; - double ***sum_vsq_all,***sum_mass_vsq_all; - double ***net_energy_transfer,***net_energy_transfer_all; - double gamma_p,gamma_s,v_0,v_0_sq; - int skin_layer,surface_l,surface_r,t_surface_l,t_surface_r; + double *gfactor1, *gfactor2, *ratio, **flangevin; + double ***T_electron, ***T_electron_old, ***T_electron_first; + double ***sum_vsq, ***sum_mass_vsq; + double ***sum_vsq_all, ***sum_mass_vsq_all; + double ***net_energy_transfer, ***net_energy_transfer_all; + double gamma_p, gamma_s, v_0, v_0_sq; + int skin_layer, surface_l, surface_r, t_surface_l, t_surface_r; int movsur; - double esheat_0,esheat_1,esheat_2,esheat_3,esheat_4,C_limit,electronic_density; - double el_th_diff,T_damp; - double intensity,width,duration,surface_double; - double mult_factor,ttm_dt; - double pres_factor,free_path,ionic_density; + double esheat_0, esheat_1, esheat_2, esheat_3, esheat_4, C_limit, electronic_density; + double el_th_diff, T_damp; + double intensity, width, duration, surface_double; + double mult_factor, ttm_dt; + double pres_factor, free_path, ionic_density; double electron_temperature_min; el_heat_capacity_thermal_conductivity el_properties(double); double el_sp_heat_integral(double); @@ -81,7 +81,7 @@ class FixTTMMod : public Fix { void read_initial_electron_temperatures(const char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_wall_ees.cpp b/src/USER-MISC/fix_wall_ees.cpp index 8adac48263..c224e59d12 100644 --- a/src/USER-MISC/fix_wall_ees.cpp +++ b/src/USER-MISC/fix_wall_ees.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_wall_ees.h b/src/USER-MISC/fix_wall_ees.h index 0e5050a53e..5bfb821c43 100644 --- a/src/USER-MISC/fix_wall_ees.h +++ b/src/USER-MISC/fix_wall_ees.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/ees,FixWallEES) - +// clang-format off +FixStyle(wall/ees,FixWallEES); +// clang-format on #else #ifndef LMP_FIX_WALL_EES_H @@ -32,11 +32,11 @@ class FixWallEES : public FixWall { void wall_particle(int, int, double); private: - double coeff1[6],coeff2[6],coeff3[6],coeff4[6],coeff5[6],coeff6[6]; + double coeff1[6], coeff2[6], coeff3[6], coeff4[6], coeff5[6], coeff6[6]; class AtomVecEllipsoid *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_wall_reflect_stochastic.cpp b/src/USER-MISC/fix_wall_reflect_stochastic.cpp index 00676279ed..5f3ebfa959 100644 --- a/src/USER-MISC/fix_wall_reflect_stochastic.cpp +++ b/src/USER-MISC/fix_wall_reflect_stochastic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_wall_reflect_stochastic.h b/src/USER-MISC/fix_wall_reflect_stochastic.h index db818318af..b895a569f0 100644 --- a/src/USER-MISC/fix_wall_reflect_stochastic.h +++ b/src/USER-MISC/fix_wall_reflect_stochastic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/reflect/stochastic,FixWallReflectStochastic) - +// clang-format off +FixStyle(wall/reflect/stochastic,FixWallReflectStochastic); +// clang-format on #else #ifndef LMP_FIX_WALL_REFLECT_STOCHASTIC_H @@ -31,15 +31,15 @@ class FixWallReflectStochastic : public FixWallReflect { private: int seedfix; - double walltemp[6],wallvel[6][3],wallaccom[6][3]; + double walltemp[6], wallvel[6][3], wallaccom[6][3]; int rstyle; class RanMars *random; - void wall_particle(int m,int which, double coord); + void wall_particle(int m, int which, double coord); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_wall_region_ees.cpp b/src/USER-MISC/fix_wall_region_ees.cpp index 84514526b1..81a67e8e58 100644 --- a/src/USER-MISC/fix_wall_region_ees.cpp +++ b/src/USER-MISC/fix_wall_region_ees.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/fix_wall_region_ees.h b/src/USER-MISC/fix_wall_region_ees.h index 9c8e988937..b34e8238a8 100644 --- a/src/USER-MISC/fix_wall_region_ees.h +++ b/src/USER-MISC/fix_wall_region_ees.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/region/ees,FixWallRegionEES) - +// clang-format off +FixStyle(wall/region/ees,FixWallRegionEES); +// clang-format on #else #ifndef LMP_FIX_WALL_REGION_EES_H @@ -22,7 +22,6 @@ FixStyle(wall/region/ees,FixWallRegionEES) #include "fix.h" - namespace LAMMPS_NS { class FixWallRegionEES : public Fix { @@ -43,21 +42,21 @@ class FixWallRegionEES : public Fix { class AtomVecEllipsoid *avec; int iregion; - double epsilon,sigma,cutoff; + double epsilon, sigma, cutoff; int eflag; - double ewall[4],ewall_all[4]; + double ewall[4], ewall_all[4]; int nlevels_respa; char *idregion; - double coeff1,coeff2,coeff3,coeff4,offset; + double coeff1, coeff2, coeff3, coeff4, offset; double coeff5, coeff6; - double eng,fwall; + double eng, fwall; double torque[3]; void ees(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/improper_cossq.cpp b/src/USER-MISC/improper_cossq.cpp index 3d7701ac6d..2952a15d8b 100644 --- a/src/USER-MISC/improper_cossq.cpp +++ b/src/USER-MISC/improper_cossq.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/improper_cossq.h b/src/USER-MISC/improper_cossq.h index 1245c6fc20..fd22e438ce 100644 --- a/src/USER-MISC/improper_cossq.h +++ b/src/USER-MISC/improper_cossq.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(cossq,ImproperCossq) - +// clang-format off +ImproperStyle(cossq,ImproperCossq); +// clang-format on #else #ifndef LMP_IMPROPER_COSSQ_H @@ -39,7 +39,7 @@ class ImproperCossq : public Improper { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/improper_distance.cpp b/src/USER-MISC/improper_distance.cpp index ba65810daf..189440e318 100644 --- a/src/USER-MISC/improper_distance.cpp +++ b/src/USER-MISC/improper_distance.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/improper_distance.h b/src/USER-MISC/improper_distance.h index 540671463b..fbf8060c9f 100644 --- a/src/USER-MISC/improper_distance.h +++ b/src/USER-MISC/improper_distance.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(distance,ImproperDistance) - +// clang-format off +ImproperStyle(distance,ImproperDistance); +// clang-format on #else #ifndef LMP_IMPROPER_DISTANCE_H @@ -35,13 +35,12 @@ class ImproperDistance : public Improper { void write_data(FILE *); private: - double *k,*chi; + double *k, *chi; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-MISC/improper_fourier.cpp b/src/USER-MISC/improper_fourier.cpp index 2e32d58c35..eeb1cbb7dc 100644 --- a/src/USER-MISC/improper_fourier.cpp +++ b/src/USER-MISC/improper_fourier.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/improper_fourier.h b/src/USER-MISC/improper_fourier.h index c9ed9ac406..25d03e623b 100644 --- a/src/USER-MISC/improper_fourier.h +++ b/src/USER-MISC/improper_fourier.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(fourier,ImproperFourier) - +// clang-format off +ImproperStyle(fourier,ImproperFourier); +// clang-format on #else #ifndef LMP_IMPROPER_FOURIER_H @@ -37,15 +37,14 @@ class ImproperFourier : public Improper { protected: double *k, *C0, *C1, *C2; int *all; - void addone(const int &i1,const int &i2,const int &i3,const int &i4, - const int &type,const int &evflag,const int &eflag, - const double &vb1x, const double &vb1y, const double &vb1z, - const double &vb2x, const double &vb2y, const double &vb2z, + void addone(const int &i1, const int &i2, const int &i3, const int &i4, const int &type, + const int &evflag, const int &eflag, const double &vb1x, const double &vb1y, + const double &vb1z, const double &vb2x, const double &vb2y, const double &vb2z, const double &vb3x, const double &vb3y, const double &vb3z); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/improper_ring.cpp b/src/USER-MISC/improper_ring.cpp index 9a31d0e112..36de27804b 100644 --- a/src/USER-MISC/improper_ring.cpp +++ b/src/USER-MISC/improper_ring.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/improper_ring.h b/src/USER-MISC/improper_ring.h index 295a189066..f428a7bfd6 100644 --- a/src/USER-MISC/improper_ring.h +++ b/src/USER-MISC/improper_ring.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(ring,ImproperRing) - +// clang-format off +ImproperStyle(ring,ImproperRing); +// clang-format on #else #ifndef LMP_IMPROPER_RING_H @@ -35,12 +35,12 @@ class ImproperRing : public Improper { void write_data(FILE *); protected: - double *k,*chi; + double *k, *chi; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_agni.cpp b/src/USER-MISC/pair_agni.cpp index ec5cfaad06..46d782e899 100644 --- a/src/USER-MISC/pair_agni.cpp +++ b/src/USER-MISC/pair_agni.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_agni.h b/src/USER-MISC/pair_agni.h index c687c5ad93..2a1e700d29 100644 --- a/src/USER-MISC/pair_agni.h +++ b/src/USER-MISC/pair_agni.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(agni,PairAGNI) - +// clang-format off +PairStyle(agni,PairAGNI); +// clang-format on #else #ifndef LMP_PAIR_AGNI_H @@ -36,23 +36,22 @@ class PairAGNI : public Pair { virtual void init_style(); struct Param { - double cut,cutsq; - double *eta,**xU,*alpha; - double sigma,lambda,b,gwidth; - int numeta,numtrain,ielement; - + double cut, cutsq; + double *eta, **xU, *alpha; + double sigma, lambda, b, gwidth; + int numeta, numtrain, ielement; }; protected: - double cutmax; // max cutoff for all elements - int atomic_feature_version; // version of fingerprint - Param *params; // parameter set for an I-J interaction + double cutmax; // max cutoff for all elements + int atomic_feature_version; // version of fingerprint + Param *params; // parameter set for an I-J interaction virtual void allocate(); void read_file(char *); virtual void setup_params(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_buck_mdf.cpp b/src/USER-MISC/pair_buck_mdf.cpp index 9e9900cf1b..cea3399ef1 100644 --- a/src/USER-MISC/pair_buck_mdf.cpp +++ b/src/USER-MISC/pair_buck_mdf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_buck_mdf.h b/src/USER-MISC/pair_buck_mdf.h index 7eda523999..0718fbaf71 100644 --- a/src/USER-MISC/pair_buck_mdf.h +++ b/src/USER-MISC/pair_buck_mdf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/mdf,PairBuckMDF) - +// clang-format off +PairStyle(buck/mdf,PairBuckMDF); +// clang-format on #else #ifndef LMP_PAIR_BUCK_MDF_H @@ -40,15 +40,15 @@ class PairBuckMDF : public Pair { void *extract(const char *, int &); protected: - double cut_global,cut_inner_global; - double **cut,**cut_inner,**cut_inner_sq; - double **a,**rho,**c; - double **rhoinv,**buck1,**buck2,**offset; + double cut_global, cut_inner_global; + double **cut, **cut_inner, **cut_inner_sq; + double **a, **rho, **c; + double **rhoinv, **buck1, **buck2, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_cosine_squared.cpp b/src/USER-MISC/pair_cosine_squared.cpp index 684d405f2b..77bb7dc326 100644 --- a/src/USER-MISC/pair_cosine_squared.cpp +++ b/src/USER-MISC/pair_cosine_squared.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_cosine_squared.h b/src/USER-MISC/pair_cosine_squared.h index 4a7470912c..e1c87525ed 100644 --- a/src/USER-MISC/pair_cosine_squared.h +++ b/src/USER-MISC/pair_cosine_squared.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -15,9 +15,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(cosine/squared, PairCosineSquared) - +// clang-format off +PairStyle(cosine/squared, PairCosineSquared); +// clang-format on #else #ifndef LMP_PAIR_LJ_COS_SQ_H @@ -46,7 +46,7 @@ class PairCosineSquared : public Pair { double single(int, int, int, int, double, double, double, double &); // void *extract(const char *, int &); -/* RESPA stuff not implemented... + /* RESPA stuff not implemented... void compute_inner(); void compute_middle(); void compute_outer(int, int); @@ -61,7 +61,7 @@ class PairCosineSquared : public Pair { virtual void allocate(); }; -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS #endif #endif @@ -97,4 +97,3 @@ If cutoff is equal to sigma (minimum) then this pair style basically degenerates/reverts to only WCA. This is for convenience. */ - diff --git a/src/USER-MISC/pair_coul_diel.cpp b/src/USER-MISC/pair_coul_diel.cpp index 96db441e27..4f45858725 100644 --- a/src/USER-MISC/pair_coul_diel.cpp +++ b/src/USER-MISC/pair_coul_diel.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_coul_diel.h b/src/USER-MISC/pair_coul_diel.h index 68804c7c90..f15b300fb8 100644 --- a/src/USER-MISC/pair_coul_diel.h +++ b/src/USER-MISC/pair_coul_diel.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/diel,PairCoulDiel) - +// clang-format off +PairStyle(coul/diel,PairCoulDiel); +// clang-format on #else #ifndef LMP_PAIR_COUL_DIEL_H @@ -51,7 +51,7 @@ class PairCoulDiel : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_coul_shield.cpp b/src/USER-MISC/pair_coul_shield.cpp index 63c4b30be2..2cda85ead6 100644 --- a/src/USER-MISC/pair_coul_shield.cpp +++ b/src/USER-MISC/pair_coul_shield.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_coul_shield.h b/src/USER-MISC/pair_coul_shield.h index 066d670f25..4413732577 100644 --- a/src/USER-MISC/pair_coul_shield.h +++ b/src/USER-MISC/pair_coul_shield.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/shield,PairCoulShield) - +// clang-format off +PairStyle(coul/shield,PairCoulShield); +// clang-format on #else #ifndef LMP_PAIR_COUL_SHIELD_H @@ -51,47 +51,49 @@ class PairCoulShield : public Pair { void allocate(); -/* ----Calculate the long-range cutoff term */ - inline double calc_Tap(double r_ij, double Rcut) { - double Tap,r; + /* ----Calculate the long-range cutoff term */ + inline double calc_Tap(double r_ij, double Rcut) + { + double Tap, r; //int Tap_coeff[8] = {1,0,0,0,-35,84,-70,20}; - double Tap_coeff[8] = {1.0,0.0,0.0,0.0,-35.0,84.0,-70.0,20.0}; + double Tap_coeff[8] = {1.0, 0.0, 0.0, 0.0, -35.0, 84.0, -70.0, 20.0}; - r = r_ij/Rcut; + r = r_ij / Rcut; Tap = 0.0; Tap = Tap_coeff[7] * r + Tap_coeff[6]; - Tap = Tap * r + Tap_coeff[5]; - Tap = Tap * r + Tap_coeff[4]; - Tap = Tap * r + Tap_coeff[3]; - Tap = Tap * r + Tap_coeff[2]; - Tap = Tap * r + Tap_coeff[1]; - Tap = Tap * r + Tap_coeff[0]; + Tap = Tap * r + Tap_coeff[5]; + Tap = Tap * r + Tap_coeff[4]; + Tap = Tap * r + Tap_coeff[3]; + Tap = Tap * r + Tap_coeff[2]; + Tap = Tap * r + Tap_coeff[1]; + Tap = Tap * r + Tap_coeff[0]; - return(Tap); + return (Tap); } - /* ----Calculate the derivatives of long-range cutoff term */ - inline double calc_dTap(double r_ij, double Rcut) { - double dTap,r; - double Tap_coeff[8] = {1.0,0.0,0.0,0.0,-35.0,84.0,-70.0,20.0}; + /* ----Calculate the derivatives of long-range cutoff term */ + inline double calc_dTap(double r_ij, double Rcut) + { + double dTap, r; + double Tap_coeff[8] = {1.0, 0.0, 0.0, 0.0, -35.0, 84.0, -70.0, 20.0}; - r = r_ij/Rcut; + r = r_ij / Rcut; dTap = 0.0; - dTap = 7.0*Tap_coeff[7] * r + 6.0*Tap_coeff[6]; - dTap = dTap * r + 5.0*Tap_coeff[5]; - dTap = dTap * r + 4.0*Tap_coeff[4]; - dTap = dTap * r + 3.0*Tap_coeff[3]; - dTap = dTap * r + 2.0*Tap_coeff[2]; - dTap = dTap * r + Tap_coeff[1]; - dTap = dTap/Rcut; + dTap = 7.0 * Tap_coeff[7] * r + 6.0 * Tap_coeff[6]; + dTap = dTap * r + 5.0 * Tap_coeff[5]; + dTap = dTap * r + 4.0 * Tap_coeff[4]; + dTap = dTap * r + 3.0 * Tap_coeff[3]; + dTap = dTap * r + 2.0 * Tap_coeff[2]; + dTap = dTap * r + Tap_coeff[1]; + dTap = dTap / Rcut; - return(dTap); + return (dTap); } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_coul_slater_cut.cpp b/src/USER-MISC/pair_coul_slater_cut.cpp index bb32cf1c18..eca5d5dd63 100644 --- a/src/USER-MISC/pair_coul_slater_cut.cpp +++ b/src/USER-MISC/pair_coul_slater_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_coul_slater_cut.h b/src/USER-MISC/pair_coul_slater_cut.h index c0854d47ed..4fc43f97e0 100644 --- a/src/USER-MISC/pair_coul_slater_cut.h +++ b/src/USER-MISC/pair_coul_slater_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/slater/cut,PairCoulSlaterCut) - +// clang-format off +PairStyle(coul/slater/cut,PairCoulSlaterCut); +// clang-format on #else #ifndef LMP_PAIR_COUL_SLATER_CUT_H @@ -37,7 +37,7 @@ class PairCoulSlaterCut : public PairCoulCut { double lamda; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_coul_slater_long.cpp b/src/USER-MISC/pair_coul_slater_long.cpp index 9c2e9780df..605305a7ef 100644 --- a/src/USER-MISC/pair_coul_slater_long.cpp +++ b/src/USER-MISC/pair_coul_slater_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_coul_slater_long.h b/src/USER-MISC/pair_coul_slater_long.h index 5f71f6b1c2..eaa99a9729 100644 --- a/src/USER-MISC/pair_coul_slater_long.h +++ b/src/USER-MISC/pair_coul_slater_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/slater/long,PairCoulSlaterLong) - +// clang-format off +PairStyle(coul/slater/long,PairCoulSlaterLong); +// clang-format on #else #ifndef LMP_PAIR_COUL_SLATER_LONG_H @@ -41,7 +41,7 @@ class PairCoulSlaterLong : public Pair { virtual void *extract(const char *, int &); protected: - double cut_coul,cut_coulsq,qdist; + double cut_coul, cut_coulsq, qdist; double lamda; //double *cut_respa; double g_ewald; @@ -50,7 +50,7 @@ class PairCoulSlaterLong : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_dpd_ext.cpp b/src/USER-MISC/pair_dpd_ext.cpp index 9d59a167e9..82e0cde0d6 100644 --- a/src/USER-MISC/pair_dpd_ext.cpp +++ b/src/USER-MISC/pair_dpd_ext.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_dpd_ext.h b/src/USER-MISC/pair_dpd_ext.h index fabb95b773..01436470b0 100644 --- a/src/USER-MISC/pair_dpd_ext.h +++ b/src/USER-MISC/pair_dpd_ext.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dpd/ext,PairDPDExt) - +// clang-format off +PairStyle(dpd/ext,PairDPDExt); +// clang-format on #else #ifndef LMP_PAIR_DPD_EXT_H @@ -42,18 +42,18 @@ class PairDPDExt : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_global,temperature; + double cut_global, temperature; int seed; double **cut; - double **a0,**gamma,**gammaII,**gammaT; - double **sigma,**sigmaT; - double **ws,**wsT; + double **a0, **gamma, **gammaII, **gammaT; + double **sigma, **sigmaT; + double **ws, **wsT; class RanMars *random; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_dpd_ext_tstat.cpp b/src/USER-MISC/pair_dpd_ext_tstat.cpp index a9f66fb38c..df012065d6 100644 --- a/src/USER-MISC/pair_dpd_ext_tstat.cpp +++ b/src/USER-MISC/pair_dpd_ext_tstat.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_dpd_ext_tstat.h b/src/USER-MISC/pair_dpd_ext_tstat.h index 23cdd1d3c7..09f5c9a801 100644 --- a/src/USER-MISC/pair_dpd_ext_tstat.h +++ b/src/USER-MISC/pair_dpd_ext_tstat.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dpd/ext/tstat,PairDPDExtTstat) - +// clang-format off +PairStyle(dpd/ext/tstat,PairDPDExtTstat); +// clang-format on #else #ifndef LMP_PAIR_DPD_EXT_TSTAT_H @@ -39,10 +39,10 @@ class PairDPDExtTstat : public PairDPDExt { void write_data_all(FILE *); protected: - double t_start,t_stop; + double t_start, t_stop; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_drip.cpp b/src/USER-MISC/pair_drip.cpp index 0f571dd41e..97f5ca439e 100644 --- a/src/USER-MISC/pair_drip.cpp +++ b/src/USER-MISC/pair_drip.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_drip.h b/src/USER-MISC/pair_drip.h index ea783e3398..bd719e0b57 100644 --- a/src/USER-MISC/pair_drip.h +++ b/src/USER-MISC/pair_drip.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,11 +20,10 @@ Phys. Rev. B, 98, 235404 (2018). ------------------------------------------------------------------------- */ - #ifdef PAIR_CLASS - -PairStyle(drip, PairDRIP) - +// clang-format off +PairStyle(drip, PairDRIP); +// clang-format on #else #ifndef LMP_PAIR_DRIP_H @@ -35,11 +34,10 @@ PairStyle(drip, PairDRIP) namespace LAMMPS_NS { #define DIM 3 -typedef double V3[3]; - +typedef double V3[3]; class PairDRIP : public Pair { -public: + public: PairDRIP(class LAMMPS *); virtual ~PairDRIP(); @@ -49,70 +47,62 @@ public: double init_one(int, int); void init_style(); -protected: - struct Param - { - int ielement, jelement; + protected: + struct Param { + int ielement, jelement; double C0, C2, C4, C, delta, lambda, A, z0, B, eta, rhocut, rcut, ncut; double rhocutsq, rcutsq, ncutsq; }; - Param *params; // parameter set for I-J interactions - int **nearest3neigh; // nearest 3 neighbors of atoms - double cutmax; // max cutoff for all species + Param *params; // parameter set for I-J interactions + int **nearest3neigh; // nearest 3 neighbors of atoms + double cutmax; // max cutoff for all species void read_file(char *); void allocate(); // DRIP specific functions - double calc_attractive(Param&, double const, double const *, - double *const, double *const); + double calc_attractive(Param &, double const, double const *, double *const, double *const); - double calc_repulsive(int const, int const, Param&, double const, - double const *, double const *, V3 const *, V3 const *, V3 const *, - V3 const *, double *const, double *const); + double calc_repulsive(int const, int const, Param &, double const, double const *, double const *, + V3 const *, V3 const *, V3 const *, V3 const *, double *const, + double *const); void find_nearest3neigh(); - void calc_normal(int const, double *const, V3 *const, V3 *const, V3 *const, - V3 *const); + void calc_normal(int const, double *const, V3 *const, V3 *const, V3 *const, V3 *const); - void get_drhosqij(double const *, double const *, V3 const *, V3 const *, - V3 const *, V3 const *, double *const, double *const, double *const, - double *const, double *const); + void get_drhosqij(double const *, double const *, V3 const *, V3 const *, V3 const *, V3 const *, + double *const, double *const, double *const, double *const, double *const); - double td(double, double, double, double, double const *const, double, - const double *const, double&, double&); + double td(double, double, double, double, double const *const, double, const double *const, + double &, double &); - double dihedral(const int, const int, Param&, double const, double&, - double *const, double *const, double *const, double *const, double *const, - double *const, double *const, double *const); + double dihedral(const int, const int, Param &, double const, double &, double *const, + double *const, double *const, double *const, double *const, double *const, + double *const, double *const); - double deriv_cos_omega(double const *, double const *, double const *, - double const *, double *const, double *const, double *const, - double *const); + double deriv_cos_omega(double const *, double const *, double const *, double const *, + double *const, double *const, double *const, double *const); - double tap(double, double, double&); + double tap(double, double, double &); - double tap_rho(double, double, double&); + double tap_rho(double, double, double &); - void deriv_cross(double const *, double const *, double const *, - double *const, V3 *const, V3 *const, V3 *const); + void deriv_cross(double const *, double const *, double const *, double *const, V3 *const, + V3 *const, V3 *const); // inline functions inline double dot(double const *x, double const *y) const { - return x[0]*y[0]+x[1]*y[1]+x[2]*y[2]; + return x[0] * y[0] + x[1] * y[1] + x[2] * y[2]; } inline void mat_dot_vec(V3 const *X, double const *y, double *const z) const { - for (int k = 0; k < 3; k++) { - z[k] = X[k][0]*y[0]+X[k][1]*y[1]+X[k][2]*y[2]; - } + for (int k = 0; k < 3; k++) { z[k] = X[k][0] * y[0] + X[k][1] * y[1] + X[k][2] * y[2]; } } - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_e3b.cpp b/src/USER-MISC/pair_e3b.cpp index 419cd29a2b..e6d5935d86 100644 --- a/src/USER-MISC/pair_e3b.cpp +++ b/src/USER-MISC/pair_e3b.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_e3b.h b/src/USER-MISC/pair_e3b.h index d8fa31b6b3..f6cf916918 100644 --- a/src/USER-MISC/pair_e3b.h +++ b/src/USER-MISC/pair_e3b.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(e3b,PairE3B) - +// clang-format off +PairStyle(e3b,PairE3B); +// clang-format on #else #ifndef LMP_PAIR_E3B_H @@ -34,35 +34,35 @@ class PairE3B : public Pair { virtual double init_one(int, int); virtual void init_style(); -protected: + protected: //potential parameters int typeO; - double ea,eb,ec; //three body energies - double k3; //three body exponential decay (units inverse length) - double rs,rc3,rc2; //rs: switching cutuff, rc3: cutoff for 3-body - double e2,k2; //2-body energy and exp decay - double cutmax; //max cutoff of all interactions - double rc2sq,rc3sq,rc3deltaSq; - double sc_denom,sc_num; + double ea, eb, ec; //three body energies + double k3; //three body exponential decay (units inverse length) + double rs, rc3, rc2; //rs: switching cutuff, rc3: cutoff for 3-body + double e2, k2; //2-body energy and exp decay + double cutmax; //max cutoff of all interactions + double rc2sq, rc3sq, rc3deltaSq; + double sc_denom, sc_num; //list of indexes of Os and Hs in each pair - int pairmax,pairPerAtom; // size of pair list - int **pairO,***pairH; // pair lists - double ***exps,****del3,***fpair3,*sumExp; - int maxID; //size of global sumExp array - size_t nbytes; //size of sumExp array in bytes - int natoms; //to make sure number of atoms is constant + int pairmax, pairPerAtom; // size of pair list + int **pairO, ***pairH; // pair lists + double ***exps, ****del3, ***fpair3, *sumExp; + int maxID; //size of global sumExp array + size_t nbytes; //size of sumExp array in bytes + int natoms; //to make sure number of atoms is constant virtual void allocate(); void allocateE3B(); bool allocatedE3B; //for reading settings from pair_style input - bool checkKeyword(const char *,const char *,const int, const int); + bool checkKeyword(const char *, const char *, const int, const int); void checkInputs(const double &bondL); - void presetParam(const int flag,bool &repeatFlag,double &bondL); + void presetParam(const int flag, bool &repeatFlag, double &bondL); tagint find_maxID(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_edip.cpp b/src/USER-MISC/pair_edip.cpp index 88b8728c38..3f80609853 100644 --- a/src/USER-MISC/pair_edip.cpp +++ b/src/USER-MISC/pair_edip.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_edip.h b/src/USER-MISC/pair_edip.h index 3588c609a8..8ee3a74dd8 100644 --- a/src/USER-MISC/pair_edip.h +++ b/src/USER-MISC/pair_edip.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(edip,PairEDIP) - +// clang-format off +PairStyle(edip,PairEDIP); +// clang-format on #else #ifndef LMP_PAIR_EDIP_H @@ -41,7 +41,7 @@ class PairEDIP : public Pair { double alpha, beta; double eta, gamm, lambda, mu, rho, sigma, Q0; double u1, u2, u3, u4; - int ielement,jelement,kelement; + int ielement, jelement, kelement; }; double *preInvR_ij; @@ -86,8 +86,8 @@ class PairEDIP : public Pair { double u3; double u4; - double cutmax; // max cutoff for all elements - Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction void allocate(); void allocatePreLoops(void); @@ -100,7 +100,7 @@ class PairEDIP : public Pair { void setup_params(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_edip_multi.cpp b/src/USER-MISC/pair_edip_multi.cpp index 4db52da11a..73cc1ef1f9 100644 --- a/src/USER-MISC/pair_edip_multi.cpp +++ b/src/USER-MISC/pair_edip_multi.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_edip_multi.h b/src/USER-MISC/pair_edip_multi.h index eebc174630..44921ebdba 100644 --- a/src/USER-MISC/pair_edip_multi.h +++ b/src/USER-MISC/pair_edip_multi.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(edip/multi,PairEDIPMulti) - +// clang-format off +PairStyle(edip/multi,PairEDIPMulti); +// clang-format on #else #ifndef LMP_PAIR_EDIP_MULTI_H @@ -36,25 +36,25 @@ class PairEDIPMulti : public Pair { protected: struct Param { - double A, B; // coefficients for pair interaction I-J - double cutoffA; // cut-off distance for pair interaction I-J - double cutoffC; // lower cut-off distance for calculating Z_I - double alpha; // coefficient for calculating Z_I - double beta; // attractive term for pair I-J - double sigma; // cut-off coefficient for pair I-J - double rho; // pair I-J - double gamma; // coefficient for three-body interaction I-J-K - double eta, lambda; // coefficients for function h(l,Z) - double mu, Q0; // coefficients for function Q(Z) - double u1, u2, u3, u4; // coefficients for function tau(Z) + double A, B; // coefficients for pair interaction I-J + double cutoffA; // cut-off distance for pair interaction I-J + double cutoffC; // lower cut-off distance for calculating Z_I + double alpha; // coefficient for calculating Z_I + double beta; // attractive term for pair I-J + double sigma; // cut-off coefficient for pair I-J + double rho; // pair I-J + double gamma; // coefficient for three-body interaction I-J-K + double eta, lambda; // coefficients for function h(l,Z) + double mu, Q0; // coefficients for function Q(Z) + double u1, u2, u3, u4; // coefficients for function tau(Z) double cutsq; - int ielement,jelement,kelement; + int ielement, jelement, kelement; }; double *preForceCoord; - double cutmax; // max cutoff for all elements - Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction void allocate(); void allocatePreLoops(void); @@ -71,7 +71,7 @@ class PairEDIPMulti : public Pair { void edip_fcut3(double, Param *, double &, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_extep.cpp b/src/USER-MISC/pair_extep.cpp index c64c7474cd..554aafe8ee 100644 --- a/src/USER-MISC/pair_extep.cpp +++ b/src/USER-MISC/pair_extep.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_extep.h b/src/USER-MISC/pair_extep.h index eb6ff8f025..6b1c925226 100644 --- a/src/USER-MISC/pair_extep.h +++ b/src/USER-MISC/pair_extep.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(extep,PairExTeP) - +// clang-format off +PairStyle(extep,PairExTeP); +// clang-format on #else #ifndef LMP_PAIR_EXTEP_H @@ -39,33 +39,33 @@ class PairExTeP : public Pair { protected: struct Param { - double lam1,lam2,lam3; - double c,d,h; - double gamma,powerm; - double powern,beta; - double biga,bigb,bigd,bigr; - double cut,cutsq; - double c1,c2,c3,c4; - int ielement,jelement,kelement; + double lam1, lam2, lam3; + double c, d, h; + double gamma, powerm; + double powern, beta; + double biga, bigb, bigd, bigr; + double cut, cutsq; + double c1, c2, c3, c4; + int ielement, jelement, kelement; int powermint; - double Z_i,Z_j; // added for ExTePZBL - double ZBLcut,ZBLexpscale; - double c5,ca1,ca4; // added for ExTePMOD + double Z_i, Z_j; // added for ExTePZBL + double ZBLcut, ZBLexpscale; + double c5, ca1, ca4; // added for ExTePMOD double powern_del; }; - Param *params; // parameter set for an I-J-K interaction - double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements - int maxlocal; // size of numneigh, firstneigh arrays - int maxpage; // # of pages currently allocated - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - MyPage *ipage; // neighbor list pages - int *SR_numneigh; // # of pair neighbors for each atom - int **SR_firstneigh; // ptr to 1st neighbor of each atom + int maxlocal; // size of numneigh, firstneigh arrays + int maxpage; // # of pages currently allocated + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + MyPage *ipage; // neighbor list pages + int *SR_numneigh; // # of pair neighbors for each atom + int **SR_firstneigh; // ptr to 1st neighbor of each atom - double *Nt, *Nd; // sum of cutoff fns ( f_C ) with SR neighs + double *Nt, *Nd; // sum of cutoff fns ( f_C ) with SR neighs void allocate(); void spline_init(); @@ -73,10 +73,9 @@ class PairExTeP : public Pair { virtual void setup(); virtual void repulsive(Param *, double, double &, int, double &); virtual double zeta(Param *, double, double, double *, double *); - virtual void force_zeta(Param *, double, double, double &, - double &, int, double &); - void attractive(Param *, double, double, double, double *, double *, - double *, double *, double *); + virtual void force_zeta(Param *, double, double, double &, double &, int, double &); + void attractive(Param *, double, double, double, double *, double *, double *, double *, + double *); virtual double ters_fc(double, Param *); virtual double ters_fc_d(double, Param *); @@ -85,61 +84,47 @@ class PairExTeP : public Pair { virtual double ters_bij(double, Param *); virtual double ters_bij_d(double, Param *); - virtual void ters_zetaterm_d(double, double *, double, double *, double, - double *, double *, double *, Param *); - void costheta_d(double *, double, double *, double, - double *, double *, double *); + virtual void ters_zetaterm_d(double, double *, double, double *, double, double *, double *, + double *, Param *); + void costheta_d(double *, double, double *, double, double *, double *, double *); // inlined functions for efficiency - inline double ters_gijk(const double costheta, - const Param * const param) const { + inline double ters_gijk(const double costheta, const Param *const param) const + { const double ters_c = param->c * param->c; const double ters_d = param->d * param->d; const double hcth = param->h - costheta; - return param->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)); } - inline double ters_gijk_d(const double costheta, - const Param * const param) const { + inline double ters_gijk_d(const double costheta, const Param *const param) const + { const double ters_c = param->c * param->c; const double ters_d = param->d * param->d; const double hcth = param->h - costheta; const double numerator = -2.0 * ters_c * hcth; - const double denominator = 1.0/(ters_d + hcth*hcth); - return param->gamma*numerator*denominator*denominator; + const double denominator = 1.0 / (ters_d + hcth * hcth); + return param->gamma * numerator * denominator * denominator; } // splines parameters // F[Ni=0-1, 1-2, 2-3, // Nj=..., struct TF_corr_param { - double - f_00, - f_01, - f_10, - f_11, - f_x_00, - f_x_01, - f_x_10, - f_x_11, - f_y_00, - f_y_01, - f_y_10, - f_y_11; + double f_00, f_01, f_10, f_11, f_x_00, f_x_01, f_x_10, f_x_11, f_y_00, f_y_01, f_y_10, f_y_11; } F_corr_param[MAXTYPES][MAXTYPES][NSPLINE][NSPLINE]; double F_corr_data[MAXTYPES][MAXTYPES][NSPLINE][NSPLINE][3]; - double F_corr( int, int, double, double, double*, double* ); + double F_corr(int, int, double, double, double *, double *); void SR_neigh(); - double envelop_function(double, double, double*); - + double envelop_function(double, double, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_gauss_cut.cpp b/src/USER-MISC/pair_gauss_cut.cpp index 85f4446358..99d3675f7b 100644 --- a/src/USER-MISC/pair_gauss_cut.cpp +++ b/src/USER-MISC/pair_gauss_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_gauss_cut.h b/src/USER-MISC/pair_gauss_cut.h index 360a084945..b0a05c179d 100644 --- a/src/USER-MISC/pair_gauss_cut.h +++ b/src/USER-MISC/pair_gauss_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gauss/cut,PairGaussCut) - +// clang-format off +PairStyle(gauss/cut,PairGaussCut); +// clang-format on #else #ifndef LMP_PAIR_GAUSS_CUT_H @@ -50,13 +50,13 @@ class PairGaussCut : public Pair { protected: double cut_global; double **cut; - double **hgauss,**sigmah,**rmh; - double **pgauss,**offset; + double **hgauss, **sigmah, **rmh; + double **pgauss, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_ilp_graphene_hbn.cpp b/src/USER-MISC/pair_ilp_graphene_hbn.cpp index 2870d175c4..8317567f69 100644 --- a/src/USER-MISC/pair_ilp_graphene_hbn.cpp +++ b/src/USER-MISC/pair_ilp_graphene_hbn.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_ilp_graphene_hbn.h b/src/USER-MISC/pair_ilp_graphene_hbn.h index 8f62354fe1..952d6edb9b 100644 --- a/src/USER-MISC/pair_ilp_graphene_hbn.h +++ b/src/USER-MISC/pair_ilp_graphene_hbn.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(ilp/graphene/hbn,PairILPGrapheneHBN) - +// clang-format off +PairStyle(ilp/graphene/hbn,PairILPGrapheneHBN); +// clang-format on #else #ifndef LMP_PAIR_ILP_GRAPHENE_HBN_H @@ -42,21 +42,21 @@ class PairILPGrapheneHBN : public Pair { protected: int me; - int maxlocal; // size of numneigh, firstneigh arrays - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - MyPage *ipage; // neighbor list pages - int *ILP_numneigh; // # of pair neighbors for each atom - int **ILP_firstneigh; // ptr to 1st neighbor of each atom - int tap_flag; // flag to turn on/off taper function + int maxlocal; // size of numneigh, firstneigh arrays + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + MyPage *ipage; // neighbor list pages + int *ILP_numneigh; // # of pair neighbors for each atom + int **ILP_firstneigh; // ptr to 1st neighbor of each atom + int tap_flag; // flag to turn on/off taper function struct Param { - double z0,alpha,epsilon,C,delta,d,sR,reff,C6,S; - double delta2inv,seff,lambda,rcut; - int ielement,jelement; + double z0, alpha, epsilon, C, delta, d, sR, reff, C6, S; + double delta2inv, seff, lambda, rcut; + int ielement, jelement; }; - Param *params; // parameter set for I-J interactions - int nmax; // max # of atoms + Param *params; // parameter set for I-J interactions + int nmax; // max # of atoms double cut_global; double cut_normal; @@ -67,49 +67,53 @@ class PairILPGrapheneHBN : public Pair { double ***dnormdri; double ****dnormal; - void read_file( char * ); + void read_file(char *); void allocate(); /* ----Calculate the long-range cutoff term */ - inline double calc_Tap(double r_ij, double Rcut) { - double Tap,r; - double Tap_coeff[8] = {1.0,0.0,0.0,0.0,-35.0,84.0,-70.0,20.0}; + inline double calc_Tap(double r_ij, double Rcut) + { + double Tap, r; + double Tap_coeff[8] = {1.0, 0.0, 0.0, 0.0, -35.0, 84.0, -70.0, 20.0}; - r = r_ij/Rcut; - if (r >= 1.0) {Tap = 0.0;} - else { + r = r_ij / Rcut; + if (r >= 1.0) { + Tap = 0.0; + } else { Tap = Tap_coeff[7] * r + Tap_coeff[6]; - Tap = Tap * r + Tap_coeff[5]; - Tap = Tap * r + Tap_coeff[4]; - Tap = Tap * r + Tap_coeff[3]; - Tap = Tap * r + Tap_coeff[2]; - Tap = Tap * r + Tap_coeff[1]; - Tap = Tap * r + Tap_coeff[0]; + Tap = Tap * r + Tap_coeff[5]; + Tap = Tap * r + Tap_coeff[4]; + Tap = Tap * r + Tap_coeff[3]; + Tap = Tap * r + Tap_coeff[2]; + Tap = Tap * r + Tap_coeff[1]; + Tap = Tap * r + Tap_coeff[0]; } - return(Tap); -} + return (Tap); + } /* ----Calculate the derivatives of long-range cutoff term */ - inline double calc_dTap(double r_ij, double Rcut) { - double dTap,r; - double Tap_coeff[8] = {1.0,0.0,0.0,0.0,-35.0,84.0,-70.0,20.0}; + inline double calc_dTap(double r_ij, double Rcut) + { + double dTap, r; + double Tap_coeff[8] = {1.0, 0.0, 0.0, 0.0, -35.0, 84.0, -70.0, 20.0}; - r = r_ij/Rcut; - if (r >= 1.0) {dTap = 0.0;} - else { - dTap = 7.0*Tap_coeff[7] * r + 6.0*Tap_coeff[6]; - dTap = dTap * r + 5.0*Tap_coeff[5]; - dTap = dTap * r + 4.0*Tap_coeff[4]; - dTap = dTap * r + 3.0*Tap_coeff[3]; - dTap = dTap * r + 2.0*Tap_coeff[2]; - dTap = dTap * r + Tap_coeff[1]; - dTap = dTap/Rcut; + r = r_ij / Rcut; + if (r >= 1.0) { + dTap = 0.0; + } else { + dTap = 7.0 * Tap_coeff[7] * r + 6.0 * Tap_coeff[6]; + dTap = dTap * r + 5.0 * Tap_coeff[5]; + dTap = dTap * r + 4.0 * Tap_coeff[4]; + dTap = dTap * r + 3.0 * Tap_coeff[3]; + dTap = dTap * r + 2.0 * Tap_coeff[2]; + dTap = dTap * r + Tap_coeff[1]; + dTap = dTap / Rcut; } - return(dTap); + return (dTap); } }; -} +} // namespace LAMMPS_NS #endif #endif @@ -132,4 +136,3 @@ All pair coefficients must be set in the data file or by the pair_coeff command before running a simulation. */ - diff --git a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp index 45ad36dd7c..c5a2781762 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_kolmogorov_crespi_full.h b/src/USER-MISC/pair_kolmogorov_crespi_full.h index 7e67f1460f..a87e8374ad 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_full.h +++ b/src/USER-MISC/pair_kolmogorov_crespi_full.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(kolmogorov/crespi/full,PairKolmogorovCrespiFull) - +// clang-format off +PairStyle(kolmogorov/crespi/full,PairKolmogorovCrespiFull); +// clang-format on #else #ifndef LMP_PAIR_KolmogorovCrespi_FULL_H @@ -42,22 +42,21 @@ class PairKolmogorovCrespiFull : public Pair { protected: int me; - int maxlocal; // size of numneigh, firstneigh arrays - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - MyPage *ipage; // neighbor list pages - int *KC_numneigh; // # of pair neighbors for each atom - int **KC_firstneigh; // ptr to 1st neighbor of each atom - int tap_flag; // flag to turn on/off taper function - + int maxlocal; // size of numneigh, firstneigh arrays + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + MyPage *ipage; // neighbor list pages + int *KC_numneigh; // # of pair neighbors for each atom + int **KC_firstneigh; // ptr to 1st neighbor of each atom + int tap_flag; // flag to turn on/off taper function struct Param { - double z0,C0,C2,C4,C,delta,lambda,A,S; - double delta2inv,z06,rcut; - int ielement,jelement; + double z0, C0, C2, C4, C, delta, lambda, A, S; + double delta2inv, z06, rcut; + int ielement, jelement; }; - Param *params; // parameter set for I-J interactions - int nmax; // max # of atoms + Param *params; // parameter set for I-J interactions + int nmax; // max # of atoms double cut_global; double cut_normal; @@ -68,52 +67,55 @@ class PairKolmogorovCrespiFull : public Pair { double ***dnormdri; double ****dnormal; - void read_file( char * ); + void read_file(char *); void allocate(); - /* ----Calculate the long-range cutoff term */ - inline double calc_Tap(double r_ij, double Rcut) { - double Tap,r; - double Tap_coeff[8] = {1.0,0.0,0.0,0.0,-35.0,84.0,-70.0,20.0}; + inline double calc_Tap(double r_ij, double Rcut) + { + double Tap, r; + double Tap_coeff[8] = {1.0, 0.0, 0.0, 0.0, -35.0, 84.0, -70.0, 20.0}; - r = r_ij/Rcut; - if (r >= 1.0) {Tap = 0.0;} - else{ + r = r_ij / Rcut; + if (r >= 1.0) { + Tap = 0.0; + } else { Tap = Tap_coeff[7] * r + Tap_coeff[6]; - Tap = Tap * r + Tap_coeff[5]; - Tap = Tap * r + Tap_coeff[4]; - Tap = Tap * r + Tap_coeff[3]; - Tap = Tap * r + Tap_coeff[2]; - Tap = Tap * r + Tap_coeff[1]; - Tap = Tap * r + Tap_coeff[0]; + Tap = Tap * r + Tap_coeff[5]; + Tap = Tap * r + Tap_coeff[4]; + Tap = Tap * r + Tap_coeff[3]; + Tap = Tap * r + Tap_coeff[2]; + Tap = Tap * r + Tap_coeff[1]; + Tap = Tap * r + Tap_coeff[0]; } - return(Tap); + return (Tap); } /* ----Calculate the derivatives of long-range cutoff term */ - inline double calc_dTap(double r_ij, double Rcut) { - double dTap,r; - double Tap_coeff[8] = {1.0,0.0,0.0,0.0,-35.0,84.0,-70.0,20.0}; + inline double calc_dTap(double r_ij, double Rcut) + { + double dTap, r; + double Tap_coeff[8] = {1.0, 0.0, 0.0, 0.0, -35.0, 84.0, -70.0, 20.0}; - r = r_ij/Rcut; - if (r >= 1.0) {dTap = 0.0;} - else { - dTap = 7.0*Tap_coeff[7] * r + 6.0*Tap_coeff[6]; - dTap = dTap * r + 5.0*Tap_coeff[5]; - dTap = dTap * r + 4.0*Tap_coeff[4]; - dTap = dTap * r + 3.0*Tap_coeff[3]; - dTap = dTap * r + 2.0*Tap_coeff[2]; - dTap = dTap * r + Tap_coeff[1]; - dTap = dTap/Rcut; + r = r_ij / Rcut; + if (r >= 1.0) { + dTap = 0.0; + } else { + dTap = 7.0 * Tap_coeff[7] * r + 6.0 * Tap_coeff[6]; + dTap = dTap * r + 5.0 * Tap_coeff[5]; + dTap = dTap * r + 4.0 * Tap_coeff[4]; + dTap = dTap * r + 3.0 * Tap_coeff[3]; + dTap = dTap * r + 2.0 * Tap_coeff[2]; + dTap = dTap * r + Tap_coeff[1]; + dTap = dTap / Rcut; } - return(dTap); + return (dTap); } }; -} +} // namespace LAMMPS_NS #endif #endif @@ -136,4 +138,3 @@ All pair coefficients must be set in the data file or by the pair_coeff command before running a simulation. */ - diff --git a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp index 4b5de2314e..d5a60bd2c9 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_kolmogorov_crespi_z.h b/src/USER-MISC/pair_kolmogorov_crespi_z.h index e8574411bf..9db07b59f7 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_z.h +++ b/src/USER-MISC/pair_kolmogorov_crespi_z.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(kolmogorov/crespi/z,PairKolmogorovCrespiZ) - +// clang-format off +PairStyle(kolmogorov/crespi/z,PairKolmogorovCrespiZ); +// clang-format on #else #ifndef LMP_PAIR_KolmogorovCrespiZ_H @@ -38,20 +38,20 @@ class PairKolmogorovCrespiZ : public Pair { int me; struct Param { - double z0,C0,C2,C4,C,delta,lambda,A,S; - double delta2inv,z06; - int ielement,jelement; + double z0, C0, C2, C4, C, delta, lambda, A, S; + double delta2inv, z06; + int ielement, jelement; }; - Param *params; // parameter set for I-J interactions + Param *params; // parameter set for I-J interactions double cut_global; double **cut; double **offset; - void read_file( char * ); + void read_file(char *); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif @@ -74,4 +74,3 @@ All pair coefficients must be set in the data file or by the pair_coeff command before running a simulation. */ - diff --git a/src/USER-MISC/pair_lebedeva_z.cpp b/src/USER-MISC/pair_lebedeva_z.cpp index afd7209c6b..57e9535a1c 100644 --- a/src/USER-MISC/pair_lebedeva_z.cpp +++ b/src/USER-MISC/pair_lebedeva_z.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_lebedeva_z.h b/src/USER-MISC/pair_lebedeva_z.h index c7c99ef78c..afe2ac1b81 100644 --- a/src/USER-MISC/pair_lebedeva_z.h +++ b/src/USER-MISC/pair_lebedeva_z.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lebedeva/z,PairLebedevaZ) - +// clang-format off +PairStyle(lebedeva/z,PairLebedevaZ); +// clang-format on #else #ifndef LMP_PAIR_LEBEDEVA_Z_H @@ -38,20 +38,20 @@ class PairLebedevaZ : public Pair { int me; struct Param { - double z0,A,B,C,alpha,D1,D2,lambda1,lambda2,S; - double z02,z06; - int ielement,jelement; + double z0, A, B, C, alpha, D1, D2, lambda1, lambda2, S; + double z02, z06; + int ielement, jelement; }; - Param *params; // parameter set for I-J interactions + Param *params; // parameter set for I-J interactions double cut_global; double **cut; double **offset; - void read_file( char * ); + void read_file(char *); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif @@ -74,4 +74,3 @@ All pair coefficients must be set in the data file or by the pair_coeff command before running a simulation. */ - diff --git a/src/USER-MISC/pair_lennard_mdf.cpp b/src/USER-MISC/pair_lennard_mdf.cpp index 75913b0a0c..87f89c6780 100644 --- a/src/USER-MISC/pair_lennard_mdf.cpp +++ b/src/USER-MISC/pair_lennard_mdf.cpp @@ -1,7 +1,8 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_lennard_mdf.h b/src/USER-MISC/pair_lennard_mdf.h index 3a56ceb04a..96e7ccb5f7 100644 --- a/src/USER-MISC/pair_lennard_mdf.h +++ b/src/USER-MISC/pair_lennard_mdf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lennard/mdf,PairLennardMDF) - +// clang-format off +PairStyle(lennard/mdf,PairLennardMDF); +// clang-format on #else #ifndef LMP_PAIR_LENNARD_MDF_H @@ -43,15 +43,15 @@ class PairLennardMDF : public Pair { void *extract(const char *, int &); protected: - double cut_global,cut_inner_global; - double **cut,**cut_inner,**cut_inner_sq; - double **aparm,**bparm; - double **lj1,**lj2,**lj3,**lj4; + double cut_global, cut_inner_global; + double **cut, **cut_inner, **cut_inner_sq; + double **aparm, **bparm; + double **lj1, **lj2, **lj3, **lj4; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_list.cpp b/src/USER-MISC/pair_list.cpp index a3a3caa81d..d1051ecb11 100644 --- a/src/USER-MISC/pair_list.cpp +++ b/src/USER-MISC/pair_list.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_list.h b/src/USER-MISC/pair_list.h index 73284f5a36..60fd3a7a24 100644 --- a/src/USER-MISC/pair_list.h +++ b/src/USER-MISC/pair_list.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(list,PairList) - +// clang-format off +PairStyle(list,PairList); +// clang-format on #else #ifndef LMP_PAIR_LIST_H @@ -39,12 +39,18 @@ class PairList : public Pair { protected: void allocate(); - enum { NONE=0, HARM, MORSE, LJ126 }; + enum { NONE = 0, HARM, MORSE, LJ126 }; // potential specific parameters - struct harm_p { double k, r0; }; - struct morse_p { double d0, alpha, r0; }; - struct lj126_p { double epsilon, sigma; }; + struct harm_p { + double k, r0; + }; + struct morse_p { + double d0, alpha, r0; + }; + struct lj126_p { + double epsilon, sigma; + }; union parm_u { struct harm_p harm; @@ -53,21 +59,21 @@ class PairList : public Pair { }; typedef struct { - tagint id1,id2; // global atom ids - double cutsq; // cutoff**2 for this pair - double offset; // energy offset - union parm_u parm; // parameters for style + tagint id1, id2; // global atom ids + double cutsq; // cutoff**2 for this pair + double offset; // energy offset + union parm_u parm; // parameters for style } list_parm_t; protected: - double cut_global; // global cutoff distance - int *style; // list of styles for pair interactions - list_parm_t *params; // lisf of pair interaction parameters - int npairs; // # of atom pairs in global list - int check_flag; // 1 if checking for missing pairs + double cut_global; // global cutoff distance + int *style; // list of styles for pair interactions + list_parm_t *params; // lisf of pair interaction parameters + int npairs; // # of atom pairs in global list + int check_flag; // 1 if checking for missing pairs }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_lj_expand_coul_long.cpp b/src/USER-MISC/pair_lj_expand_coul_long.cpp index 84eb86aaa8..685871db3b 100644 --- a/src/USER-MISC/pair_lj_expand_coul_long.cpp +++ b/src/USER-MISC/pair_lj_expand_coul_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_lj_expand_coul_long.h b/src/USER-MISC/pair_lj_expand_coul_long.h index 41ccd4f357..6d5dddb69e 100644 --- a/src/USER-MISC/pair_lj_expand_coul_long.h +++ b/src/USER-MISC/pair_lj_expand_coul_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/expand/coul/long,PairLJExpandCoulLong) - +// clang-format off +PairStyle(lj/expand/coul/long,PairLJExpandCoulLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_EXPAND_COUL_LONG_H @@ -49,18 +49,18 @@ class PairLJExpandCoulLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset,**shift; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset, **shift; double *cut_respa; - double qdist; // TIP4P distance from O site to negative charge + double qdist; // TIP4P distance from O site to negative charge double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_lj_mdf.cpp b/src/USER-MISC/pair_lj_mdf.cpp index ed028c20ec..eb435e3c65 100644 --- a/src/USER-MISC/pair_lj_mdf.cpp +++ b/src/USER-MISC/pair_lj_mdf.cpp @@ -1,7 +1,8 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_lj_mdf.h b/src/USER-MISC/pair_lj_mdf.h index 34e33e16d4..777e935624 100644 --- a/src/USER-MISC/pair_lj_mdf.h +++ b/src/USER-MISC/pair_lj_mdf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/mdf,PairLJMDF) - +// clang-format off +PairStyle(lj/mdf,PairLJMDF); +// clang-format on #else #ifndef LMP_PAIR_LJ_MDF_H @@ -43,15 +43,15 @@ class PairLJMDF : public Pair { void *extract(const char *, int &); protected: - double cut_global,cut_inner_global; - double **cut,**cut_inner,**cut_inner_sq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; + double cut_global, cut_inner_global; + double **cut, **cut_inner, **cut_inner_sq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_lj_sf_dipole_sf.cpp b/src/USER-MISC/pair_lj_sf_dipole_sf.cpp index b193885eff..be18f50822 100644 --- a/src/USER-MISC/pair_lj_sf_dipole_sf.cpp +++ b/src/USER-MISC/pair_lj_sf_dipole_sf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_lj_sf_dipole_sf.h b/src/USER-MISC/pair_lj_sf_dipole_sf.h index 1c3ec982f9..93d416ec60 100644 --- a/src/USER-MISC/pair_lj_sf_dipole_sf.h +++ b/src/USER-MISC/pair_lj_sf_dipole_sf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/sf/dipole/sf,PairLJSFDipoleSF) - +// clang-format off +PairStyle(lj/sf/dipole/sf,PairLJSFDipoleSF); +// clang-format on #else #ifndef LMP_PAIR_LJ_SF_DIPOLE_SF_H @@ -41,17 +41,17 @@ class PairLJSFDipoleSF : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; double **scale; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_local_density.cpp b/src/USER-MISC/pair_local_density.cpp index 3e5af5f7c3..f5944ac826 100644 --- a/src/USER-MISC/pair_local_density.cpp +++ b/src/USER-MISC/pair_local_density.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_local_density.h b/src/USER-MISC/pair_local_density.h index 339d04c963..ab968bdc4a 100644 --- a/src/USER-MISC/pair_local_density.h +++ b/src/USER-MISC/pair_local_density.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -15,11 +15,10 @@ David Rosenberger: TU Darmstadt -------------------------------------------------------------------------*/ - #ifdef PAIR_CLASS - -PairStyle(local/density,PairLocalDensity) - +// clang-format off +PairStyle(local/density,PairLocalDensity); +// clang-format on #else #ifndef LMP_PAIR_LOCAL_DENSITY_H @@ -27,62 +26,60 @@ PairStyle(local/density,PairLocalDensity) #include "pair.h" - namespace LAMMPS_NS { class PairLocalDensity : public Pair { - public: - PairLocalDensity(class LAMMPS *); - virtual ~PairLocalDensity(); - virtual void compute(int, int); - void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - double single(int, int, int, int, double, double, double, double &); + public: + PairLocalDensity(class LAMMPS *); + virtual ~PairLocalDensity(); + virtual void compute(int, int); + void settings(int, char **); + virtual void coeff(int, char **); + void init_style(); + double init_one(int, int); + double single(int, int, int, int, double, double, double, double &); - virtual int pack_comm(int, int *, double *, int, int *); - virtual void unpack_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + virtual int pack_comm(int, int *, double *, int, int *); + virtual void unpack_comm(int, int, double *); + int pack_reverse_comm(int, int, double *); + void unpack_reverse_comm(int, int *, double *); + double memory_usage(); + protected: + //------------------------------------------------------------------------ + //This information is read from the tabulated input file - protected: - //------------------------------------------------------------------------ - //This information is read from the tabulated input file + int nLD, nrho; // number of LD types + int **a, **b; // central and neigh atom filters + double *uppercut, *lowercut; // upper and lower cutoffs + double *uppercutsq, *lowercutsq; // square of above cutoffs + double *c0, *c2, *c4, *c6; // coeffs for indicator function + double *rho_min, *rho_max, *delta_rho; // min, max & grid-size for LDs + double **rho, **frho; // LD and LD function tables - int nLD, nrho; // number of LD types - int **a, **b; // central and neigh atom filters - double *uppercut, *lowercut; // upper and lower cutoffs - double *uppercutsq, *lowercutsq; // square of above cutoffs - double *c0, *c2, *c4, *c6; // coeffs for indicator function - double *rho_min, *rho_max, *delta_rho; // min, max & grid-size for LDs - double **rho, **frho; // LD and LD function tables + //------------------------------------------------------------------------ - //------------------------------------------------------------------------ + double ***frho_spline; // splined LD potentials + double cutmax; // max cutoff for all elements + double cutforcesq; // square of global upper cutoff - double ***frho_spline; // splined LD potentials - double cutmax; // max cutoff for all elements - double cutforcesq; // square of global upper cutoff + int nmax; // max size of per-atom arrays + double **localrho; // per-atom LD + double **fp; // per-atom LD potential function derivative - int nmax; // max size of per-atom arrays - double **localrho; // per-atom LD - double **fp; // per-atom LD potential function derivative + void allocate(); - void allocate(); + // read tabulated input file + void parse_file(char *); - // read tabulated input file - void parse_file(char *); + // convert array to spline + void array2spline(); - // convert array to spline - void array2spline(); - - // cubic spline interpolation - void interpolate_cbspl(int, double, double *, double **); + // cubic spline interpolation + void interpolate_cbspl(int, double, double *, double **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_meam_spline.cpp b/src/USER-MISC/pair_meam_spline.cpp index e956d96cf2..a63b61c7b2 100644 --- a/src/USER-MISC/pair_meam_spline.cpp +++ b/src/USER-MISC/pair_meam_spline.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_meam_spline.h b/src/USER-MISC/pair_meam_spline.h index 533db2e8ab..c20077f2eb 100644 --- a/src/USER-MISC/pair_meam_spline.h +++ b/src/USER-MISC/pair_meam_spline.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(meam/spline,PairMEAMSpline) - +// clang-format off +PairStyle(meam/spline,PairMEAMSpline); +// clang-format on #else #ifndef LMP_PAIR_MEAM_SPLINE_H @@ -37,28 +37,27 @@ namespace LAMMPS_NS { #define SPLINE_MEAM_SUPPORT_NON_GRID_SPLINES 0 -class PairMEAMSpline : public Pair -{ -public: +class PairMEAMSpline : public Pair { + public: PairMEAMSpline(class LAMMPS *); virtual ~PairMEAMSpline(); virtual void compute(int, int); void settings(int, char **); void coeff(int, char **); void get_coeff(double *, double *); - double pair_density(int ); - double three_body_density(int ); + double pair_density(int); + double three_body_density(int); void init_style(); void init_list(int, class NeighList *); double init_one(int, int); // helper functions for compute() - int ij_to_potl(const int itype, const int jtype, const int ntypes) const { - return jtype - 1 + (itype-1)*ntypes - (itype-1)*itype/2; + int ij_to_potl(const int itype, const int jtype, const int ntypes) const + { + return jtype - 1 + (itype - 1) * ntypes - (itype - 1) * itype / 2; } - int i_to_potl(const int itype) const { return itype-1; } - + int i_to_potl(const int itype) const { return itype - 1; } int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); @@ -66,14 +65,15 @@ public: void unpack_reverse_comm(int, int *, double *); double memory_usage(); -protected: + protected: class SplineFunction { - public: + public: /// Default constructor. SplineFunction() : X(nullptr), Xs(nullptr), Y(nullptr), Y2(nullptr), Ydelta(nullptr), N(0) {} /// Destructor. - ~SplineFunction() { + ~SplineFunction() + { delete[] X; delete[] Xs; delete[] Y; @@ -82,7 +82,8 @@ protected: } /// Initialization of spline function. - void init(int _N, double _deriv0, double _derivN) { + void init(int _N, double _deriv0, double _derivN) + { N = _N; deriv0 = _deriv0; derivN = _derivN; @@ -99,97 +100,98 @@ protected: } /// Adds a knot to the spline. - void setKnot(int n, double x, double y) { X[n] = x; Y[n] = y; } + void setKnot(int n, double x, double y) + { + X[n] = x; + Y[n] = y; + } /// Returns the number of knots. int numKnots() const { return N; } /// Parses the spline knots from a text file. - void parse(FILE* fp, Error* error, bool isNewFormat); + void parse(FILE *fp, Error *error, bool isNewFormat); /// Calculates the second derivatives of the cubic spline. - void prepareSpline(Error* error); + void prepareSpline(Error *error); /// Evaluates the spline function at position x. inline double eval(double x) const { x -= xmin; - if (x <= 0.0) { // Left extrapolation. + if (x <= 0.0) { // Left extrapolation. return Y[0] + deriv0 * x; - } - else if (x >= xmax_shifted) { // Right extrapolation. - return Y[N-1] + derivN * (x - xmax_shifted); - } - else { + } else if (x >= xmax_shifted) { // Right extrapolation. + return Y[N - 1] + derivN * (x - xmax_shifted); + } else { #if SPLINE_MEAM_SUPPORT_NON_GRID_SPLINES // Do interval search. int klo = 0; - int khi = N-1; - while(khi - klo > 1) { + int khi = N - 1; + while (khi - klo > 1) { int k = (khi + klo) / 2; - if (Xs[k] > x) khi = k; - else klo = k; + if (Xs[k] > x) + khi = k; + else + klo = k; } double h = Xs[khi] - Xs[klo]; // Do spline interpolation. - double a = (Xs[khi] - x)/h; - double b = 1.0 - a; // = (x - X[klo])/h + double a = (Xs[khi] - x) / h; + double b = 1.0 - a; // = (x - X[klo])/h return a * Y[klo] + b * Y[khi] + - ((a*a*a - a) * Y2[klo] + (b*b*b - b) * Y2[khi])*(h*h)/6.0; + ((a * a * a - a) * Y2[klo] + (b * b * b - b) * Y2[khi]) * (h * h) / 6.0; #else // For a spline with regular grid, we directly calculate the interval X is in. - int klo = (int)(x*inv_h); + int klo = (int) (x * inv_h); int khi = klo + 1; double a = Xs[khi] - x; double b = h - a; return Y[khi] - a * Ydelta[klo] + - ((a*a - hsq) * a * Y2[klo] + (b*b - hsq) * b * Y2[khi]); + ((a * a - hsq) * a * Y2[klo] + (b * b - hsq) * b * Y2[khi]); #endif } } /// Evaluates the spline function and its first derivative at position x. - inline double eval(double x, double& deriv) const + inline double eval(double x, double &deriv) const { x -= xmin; - if (x <= 0.0) { // Left extrapolation. + if (x <= 0.0) { // Left extrapolation. deriv = deriv0; return Y[0] + deriv0 * x; - } - else if (x >= xmax_shifted) { // Right extrapolation. + } else if (x >= xmax_shifted) { // Right extrapolation. deriv = derivN; - return Y[N-1] + derivN * (x - xmax_shifted); - } - else { + return Y[N - 1] + derivN * (x - xmax_shifted); + } else { #if SPLINE_MEAM_SUPPORT_NON_GRID_SPLINES // Do interval search. int klo = 0; - int khi = N-1; - while(khi - klo > 1) { + int khi = N - 1; + while (khi - klo > 1) { int k = (khi + klo) / 2; - if (Xs[k] > x) khi = k; - else klo = k; + if (Xs[k] > x) + khi = k; + else + klo = k; } double h = Xs[khi] - Xs[klo]; // Do spline interpolation. - double a = (Xs[khi] - x)/h; - double b = 1.0 - a; // = (x - X[klo])/h + double a = (Xs[khi] - x) / h; + double b = 1.0 - a; // = (x - X[klo])/h deriv = (Y[khi] - Y[klo]) / h + - ((3.0*b*b - 1.0) * Y2[khi] - - (3.0*a*a - 1.0) * Y2[klo]) * h / 6.0; + ((3.0 * b * b - 1.0) * Y2[khi] - (3.0 * a * a - 1.0) * Y2[klo]) * h / 6.0; return a * Y[klo] + b * Y[khi] + - ((a*a*a - a) * Y2[klo] + - (b*b*b - b) * Y2[khi]) * (h*h) / 6.0; + ((a * a * a - a) * Y2[klo] + (b * b * b - b) * Y2[khi]) * (h * h) / 6.0; #else // For a spline with regular grid, we directly calculate the interval X is in. - int klo = (int)(x*inv_h); + int klo = (int) (x * inv_h); int khi = klo + 1; double a = Xs[khi] - x; double b = h - a; - deriv = Ydelta[klo] + ((3.0*b*b - hsq) * Y2[khi] - - (3.0*a*a - hsq) * Y2[klo]); + deriv = Ydelta[klo] + ((3.0 * b * b - hsq) * Y2[khi] - (3.0 * a * a - hsq) * Y2[klo]); return Y[khi] - a * Ydelta[klo] + - ((a*a - hsq) * a * Y2[klo] + (b*b - hsq) * b * Y2[khi]); + ((a * a - hsq) * a * Y2[klo] + (b * b - hsq) * b * Y2[khi]); #endif } } @@ -198,60 +200,63 @@ protected: double memory_usage() const { return sizeof(*this) + sizeof(X[0]) * N * 3; } /// Returns the cutoff radius of this function. - double cutoff() const { return X[N-1]; } + double cutoff() const { return X[N - 1]; } /// Writes a Gnuplot script that plots the spline function. - void writeGnuplot(const char* filename, const char* title = nullptr) const; + void writeGnuplot(const char *filename, const char *title = nullptr) const; /// Broadcasts the spline function parameters to all processors. - void communicate(MPI_Comm& world, int me); + void communicate(MPI_Comm &world, int me); - private: - double* X; // Positions of spline knots - double* Xs; // Shifted positions of spline knots - double* Y; // Function values at spline knots - double* Y2; // Second derivatives at spline knots - double* Ydelta; // If this is a grid spline, Ydelta[i] = (Y[i+1]-Y[i])/h - int N; // Number of spline knots - double deriv0; // First derivative at knot 0 - double derivN; // First derivative at knot (N-1) - double xmin; // The beginning of the interval on which the spline function is defined. - double xmax; // The end of the interval on which the spline function is defined. - int isGridSpline;// Indicates that all spline knots are on a regular grid. - double h; // The distance between knots if this is a grid spline with equidistant knots. - double hsq; // The squared distance between knots if this is a grid spline with equidistant knots. - double inv_h; // (1/h), used to avoid numerical errors in binnning for grid spline with equidistant knots. - double xmax_shifted; // The end of the spline interval after it has been shifted to begin at X=0. + private: + double *X; // Positions of spline knots + double *Xs; // Shifted positions of spline knots + double *Y; // Function values at spline knots + double *Y2; // Second derivatives at spline knots + double *Ydelta; // If this is a grid spline, Ydelta[i] = (Y[i+1]-Y[i])/h + int N; // Number of spline knots + double deriv0; // First derivative at knot 0 + double derivN; // First derivative at knot (N-1) + double xmin; // The beginning of the interval on which the spline function is defined. + double xmax; // The end of the interval on which the spline function is defined. + int isGridSpline; // Indicates that all spline knots are on a regular grid. + double h; // The distance between knots if this is a grid spline with equidistant knots. + double + hsq; // The squared distance between knots if this is a grid spline with equidistant knots. + double + inv_h; // (1/h), used to avoid numerical errors in binnning for grid spline with equidistant knots. + double + xmax_shifted; // The end of the spline interval after it has been shifted to begin at X=0. }; /// Helper data structure for potential routine. struct MEAM2Body { - int tag; // holds the index of the second atom (j) + int tag; // holds the index of the second atom (j) double r; double f, fprime; double del[3]; }; - SplineFunction* phis; // Phi_i(r_ij) - SplineFunction* rhos; // Rho_ij(r_ij) - SplineFunction* fs; // f_i(r_ij) - SplineFunction* Us; // U_i(rho) - SplineFunction* gs; // g_ij(cos_theta) - double* zero_atom_energies; // Shift embedding energy by this value to make it zero for a single atom in vacuum. + SplineFunction *phis; // Phi_i(r_ij) + SplineFunction *rhos; // Rho_ij(r_ij) + SplineFunction *fs; // f_i(r_ij) + SplineFunction *Us; // U_i(rho) + SplineFunction *gs; // g_ij(cos_theta) + double * + zero_atom_energies; // Shift embedding energy by this value to make it zero for a single atom in vacuum. - double cutoff; // The cutoff radius + double cutoff; // The cutoff radius - double* Uprime_values; // Used for temporary storage of U'(rho) values - int nmax; // Size of temporary array. - int maxNeighbors; // The last maximum number of neighbors a single atoms has. - MEAM2Body* twoBodyInfo; // Temporary array. + double *Uprime_values; // Used for temporary storage of U'(rho) values + int nmax; // Size of temporary array. + int maxNeighbors; // The last maximum number of neighbors a single atoms has. + MEAM2Body *twoBodyInfo; // Temporary array. - void read_file(const char* filename); + void read_file(const char *filename); void allocate(); - }; -} +} // namespace LAMMPS_NS #endif #endif @@ -297,5 +302,3 @@ protected: * * See file 'pair_spline_meam.cpp' for history of changes. ------------------------------------------------------------------------- */ - - diff --git a/src/USER-MISC/pair_meam_sw_spline.cpp b/src/USER-MISC/pair_meam_sw_spline.cpp index ff7b89fbe7..74437b70f6 100644 --- a/src/USER-MISC/pair_meam_sw_spline.cpp +++ b/src/USER-MISC/pair_meam_sw_spline.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_meam_sw_spline.h b/src/USER-MISC/pair_meam_sw_spline.h index 7046c504fe..6f065f53f4 100644 --- a/src/USER-MISC/pair_meam_sw_spline.h +++ b/src/USER-MISC/pair_meam_sw_spline.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(meam/sw/spline,PairMEAMSWSpline) - +// clang-format off +PairStyle(meam/sw/spline,PairMEAMSWSpline); +// clang-format on #else #ifndef LMP_PAIR_MEAM_SW_SPLINE_H @@ -35,209 +35,221 @@ namespace LAMMPS_NS { #define SPLINE_MEAMSW_SUPPORT_NON_GRID_SPLINES 0 -class PairMEAMSWSpline : public Pair -{ -public: - PairMEAMSWSpline(class LAMMPS *); - virtual ~PairMEAMSWSpline(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - void init_list(int, class NeighList *); - double init_one(int, int); +class PairMEAMSWSpline : public Pair { + public: + PairMEAMSWSpline(class LAMMPS *); + virtual ~PairMEAMSWSpline(); + virtual void compute(int, int); + void settings(int, char **); + void coeff(int, char **); + void init_style(); + void init_list(int, class NeighList *); + double init_one(int, int); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); + int pack_reverse_comm(int, int, double *); + void unpack_reverse_comm(int, int *, double *); + double memory_usage(); -protected: + protected: + class SplineFunction { + public: + /// Default constructor. + SplineFunction() : X(nullptr), Xs(nullptr), Y(nullptr), Y2(nullptr), Ydelta(nullptr), N(0) {} - class SplineFunction { - public: + /// Destructor. + ~SplineFunction() + { + delete[] X; + delete[] Xs; + delete[] Y; + delete[] Y2; + delete[] Ydelta; + } - /// Default constructor. - SplineFunction() : X(nullptr), Xs(nullptr), Y(nullptr), Y2(nullptr), Ydelta(nullptr), N(0) {} + /// Initialization of spline function. + void init(int _n, double _deriv0, double _derivN) + { + N = _n; + deriv0 = _deriv0; + derivN = _derivN; + delete[] X; + delete[] Xs; + delete[] Y; + delete[] Y2; + delete[] Ydelta; + X = new double[N]; + Xs = new double[N]; + Y = new double[N]; + Y2 = new double[N]; + Ydelta = new double[N]; + } - /// Destructor. - ~SplineFunction() { - delete[] X; - delete[] Xs; - delete[] Y; - delete[] Y2; - delete[] Ydelta; - } + /// Adds a knot to the spline. + void setKnot(int n, double x, double y) + { + X[n] = x; + Y[n] = y; + } - /// Initialization of spline function. - void init(int _n, double _deriv0, double _derivN) { - N = _n; - deriv0 = _deriv0; - derivN = _derivN; - delete[] X; - delete[] Xs; - delete[] Y; - delete[] Y2; - delete[] Ydelta; - X = new double[N]; - Xs = new double[N]; - Y = new double[N]; - Y2 = new double[N]; - Ydelta = new double[N]; - } + /// Returns the number of knots. + int numKnots() const { return N; } - /// Adds a knot to the spline. - void setKnot(int n, double x, double y) { X[n] = x; Y[n] = y; } + /// Parses the spline knots from a text file. + void parse(FILE *fp, Error *error); - /// Returns the number of knots. - int numKnots() const { return N; } + /// Calculates the second derivatives of the cubic spline. + void prepareSpline(Error *error); - /// Parses the spline knots from a text file. - void parse(FILE* fp, Error* error); - - /// Calculates the second derivatives of the cubic spline. - void prepareSpline(Error* error); - - /// Evaluates the spline function at position x. - inline double eval(double x) const - { - x -= xmin; - if (x <= 0.0) { // Left extrapolation. - return Y[0] + deriv0 * x; - } - else if (x >= xmax_shifted) { // Right extrapolation. - return Y[N-1] + derivN * (x - xmax_shifted); - } - else { + /// Evaluates the spline function at position x. + inline double eval(double x) const + { + x -= xmin; + if (x <= 0.0) { // Left extrapolation. + return Y[0] + deriv0 * x; + } else if (x >= xmax_shifted) { // Right extrapolation. + return Y[N - 1] + derivN * (x - xmax_shifted); + } else { #if SPLINE_MEAMSW_SUPPORT_NON_GRID_SPLINES - // Do interval search. - int klo = 0; - int khi = N-1; - while(khi - klo > 1) { - int k = (khi + klo) / 2; - if (Xs[k] > x) khi = k; - else klo = k; - } - double h = Xs[khi] - Xs[klo]; - // Do spline interpolation. - double a = (Xs[khi] - x)/h; - double b = 1.0 - a; // = (x - X[klo])/h - return a * Y[klo] + b * Y[khi] + ((a*a*a - a) * Y2[klo] + (b*b*b - b) * Y2[khi])*(h*h)/6.0; + // Do interval search. + int klo = 0; + int khi = N - 1; + while (khi - klo > 1) { + int k = (khi + klo) / 2; + if (Xs[k] > x) + khi = k; + else + klo = k; + } + double h = Xs[khi] - Xs[klo]; + // Do spline interpolation. + double a = (Xs[khi] - x) / h; + double b = 1.0 - a; // = (x - X[klo])/h + return a * Y[klo] + b * Y[khi] + + ((a * a * a - a) * Y2[klo] + (b * b * b - b) * Y2[khi]) * (h * h) / 6.0; #else - // For a spline with grid points, we can directly calculate the interval X is in. - // - int klo = (int)(x*inv_h); - if ( klo > N - 2 ) klo = N - 2; - int khi = klo + 1; - double a = Xs[khi] - x; - double b = h - a; - return Y[khi] - a * Ydelta[klo] + ((a*a - hsq) * a * Y2[klo] + (b*b - hsq) * b * Y2[khi]); + // For a spline with grid points, we can directly calculate the interval X is in. + // + int klo = (int) (x * inv_h); + if (klo > N - 2) klo = N - 2; + int khi = klo + 1; + double a = Xs[khi] - x; + double b = h - a; + return Y[khi] - a * Ydelta[klo] + + ((a * a - hsq) * a * Y2[klo] + (b * b - hsq) * b * Y2[khi]); #endif - } - } + } + } - /// Evaluates the spline function and its first derivative at position x. - inline double eval(double x, double& deriv) const - { - x -= xmin; - if (x <= 0.0) { // Left extrapolation. - deriv = deriv0; - return Y[0] + deriv0 * x; - } - else if (x >= xmax_shifted) { // Right extrapolation. - deriv = derivN; - return Y[N-1] + derivN * (x - xmax_shifted); - } - else { + /// Evaluates the spline function and its first derivative at position x. + inline double eval(double x, double &deriv) const + { + x -= xmin; + if (x <= 0.0) { // Left extrapolation. + deriv = deriv0; + return Y[0] + deriv0 * x; + } else if (x >= xmax_shifted) { // Right extrapolation. + deriv = derivN; + return Y[N - 1] + derivN * (x - xmax_shifted); + } else { #if SPLINE_MEAMSW_SUPPORT_NON_GRID_SPLINES - // Do interval search. - int klo = 0; - int khi = N-1; - while(khi - klo > 1) { - int k = (khi + klo) / 2; - if (Xs[k] > x) khi = k; - else klo = k; - } - double h = Xs[khi] - Xs[klo]; - // Do spline interpolation. - double a = (Xs[khi] - x)/h; - double b = 1.0 - a; // = (x - X[klo])/h - deriv = (Y[khi] - Y[klo]) / h + ((3.0*b*b - 1.0) * Y2[khi] - (3.0*a*a - 1.0) * Y2[klo]) * h / 6.0; - return a * Y[klo] + b * Y[khi] + ((a*a*a - a) * Y2[klo] + (b*b*b - b) * Y2[khi]) * (h*h) / 6.0; + // Do interval search. + int klo = 0; + int khi = N - 1; + while (khi - klo > 1) { + int k = (khi + klo) / 2; + if (Xs[k] > x) + khi = k; + else + klo = k; + } + double h = Xs[khi] - Xs[klo]; + // Do spline interpolation. + double a = (Xs[khi] - x) / h; + double b = 1.0 - a; // = (x - X[klo])/h + deriv = (Y[khi] - Y[klo]) / h + + ((3.0 * b * b - 1.0) * Y2[khi] - (3.0 * a * a - 1.0) * Y2[klo]) * h / 6.0; + return a * Y[klo] + b * Y[khi] + + ((a * a * a - a) * Y2[klo] + (b * b * b - b) * Y2[khi]) * (h * h) / 6.0; #else - // For a spline with grid points, we can directly calculate the interval X is in. - int klo = (int)(x*inv_h); - if ( klo > N - 2 ) klo = N - 2; - int khi = klo + 1; - double a = Xs[khi] - x; - double b = h - a; - deriv = Ydelta[klo] + ((3.0*b*b - hsq) * Y2[khi] - (3.0*a*a - hsq) * Y2[klo]); - return Y[khi] - a * Ydelta[klo] + ((a*a - hsq) * a * Y2[klo] + (b*b - hsq) * b * Y2[khi]); + // For a spline with grid points, we can directly calculate the interval X is in. + int klo = (int) (x * inv_h); + if (klo > N - 2) klo = N - 2; + int khi = klo + 1; + double a = Xs[khi] - x; + double b = h - a; + deriv = Ydelta[klo] + ((3.0 * b * b - hsq) * Y2[khi] - (3.0 * a * a - hsq) * Y2[klo]); + return Y[khi] - a * Ydelta[klo] + + ((a * a - hsq) * a * Y2[klo] + (b * b - hsq) * b * Y2[khi]); #endif - } - } + } + } - /// Returns the number of bytes used by this function object. - double memory_usage() const { return sizeof(*this) + sizeof(X[0]) * N * 3; } + /// Returns the number of bytes used by this function object. + double memory_usage() const { return sizeof(*this) + sizeof(X[0]) * N * 3; } - /// Returns the cutoff radius of this function. - double cutoff() const { return X[N-1]; } + /// Returns the cutoff radius of this function. + double cutoff() const { return X[N - 1]; } - /// Writes a Gnuplot script that plots the spline function. - void writeGnuplot(const char* filename, const char* title = nullptr) const; + /// Writes a Gnuplot script that plots the spline function. + void writeGnuplot(const char *filename, const char *title = nullptr) const; - /// Broadcasts the spline function parameters to all processors. - void communicate(MPI_Comm& world, int me); + /// Broadcasts the spline function parameters to all processors. + void communicate(MPI_Comm &world, int me); - private: - double* X; // Positions of spline knots - double* Xs; // Shifted positions of spline knots - double* Y; // Function values at spline knots - double* Y2; // Second derivatives at spline knots - double* Ydelta; // If this is a grid spline, Ydelta[i] = (Y[i+1]-Y[i])/h - int N; // Number of spline knots - double deriv0; // First derivative at knot 0 - double derivN; // First derivative at knot (N-1) - double xmin; // The beginning of the interval on which the spline function is defined. - double xmax; // The end of the interval on which the spline function is defined. - int isGridSpline; // Indicates that all spline knots are on a regular grid. - double h; // The distance between knots if this is a grid spline with equidistant knots. - double hsq; // The squared distance between knots if this is a grid spline with equidistant knots. - double inv_h; // (1/h), used to avoid numerical errors in binnning for grid spline with equidistant knots. - double xmax_shifted; // The end of the spline interval after it has been shifted to begin at X=0. - }; + private: + double *X; // Positions of spline knots + double *Xs; // Shifted positions of spline knots + double *Y; // Function values at spline knots + double *Y2; // Second derivatives at spline knots + double *Ydelta; // If this is a grid spline, Ydelta[i] = (Y[i+1]-Y[i])/h + int N; // Number of spline knots + double deriv0; // First derivative at knot 0 + double derivN; // First derivative at knot (N-1) + double xmin; // The beginning of the interval on which the spline function is defined. + double xmax; // The end of the interval on which the spline function is defined. + int isGridSpline; // Indicates that all spline knots are on a regular grid. + double h; // The distance between knots if this is a grid spline with equidistant knots. + double + hsq; // The squared distance between knots if this is a grid spline with equidistant knots. + double + inv_h; // (1/h), used to avoid numerical errors in binnning for grid spline with equidistant knots. + double + xmax_shifted; // The end of the spline interval after it has been shifted to begin at X=0. + }; - /// Helper data structure for potential routine. - struct MEAM2Body { - int tag; - double r; - double f, fprime; - double F, Fprime; - double del[3]; - }; + /// Helper data structure for potential routine. + struct MEAM2Body { + int tag; + double r; + double f, fprime; + double F, Fprime; + double del[3]; + }; - SplineFunction phi; // Phi(r_ij) - SplineFunction rho; // Rho(r_ij) - SplineFunction f; // f(r_ij) - SplineFunction U; // U(rho) - SplineFunction g; // g(cos_theta) - SplineFunction F; // F(r_ij) - SplineFunction G; // G(cos_theta) - double zero_atom_energy; // Shift embedding energy by this value to make it zero for a single atom in vacuum. + SplineFunction phi; // Phi(r_ij) + SplineFunction rho; // Rho(r_ij) + SplineFunction f; // f(r_ij) + SplineFunction U; // U(rho) + SplineFunction g; // g(cos_theta) + SplineFunction F; // F(r_ij) + SplineFunction G; // G(cos_theta) + double + zero_atom_energy; // Shift embedding energy by this value to make it zero for a single atom in vacuum. - double cutoff; // The cutoff radius + double cutoff; // The cutoff radius - double* Uprime_values; // Used for temporary storage of U'(rho) values - int nmax; // Size of temporary array. - int maxNeighbors; // The last maximum number of neighbors a single atoms has. - MEAM2Body* twoBodyInfo; // Temporary array. + double *Uprime_values; // Used for temporary storage of U'(rho) values + int nmax; // Size of temporary array. + int maxNeighbors; // The last maximum number of neighbors a single atoms has. + MEAM2Body *twoBodyInfo; // Temporary array. - void read_file(const char* filename); - void allocate(); + void read_file(const char *filename); + void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_momb.cpp b/src/USER-MISC/pair_momb.cpp index 12671b7237..2adb206308 100644 --- a/src/USER-MISC/pair_momb.cpp +++ b/src/USER-MISC/pair_momb.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_momb.h b/src/USER-MISC/pair_momb.h index 50962130be..1116320ef0 100644 --- a/src/USER-MISC/pair_momb.h +++ b/src/USER-MISC/pair_momb.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(momb,PairMomb) - +// clang-format off +PairStyle(momb,PairMomb); +// clang-format on #else #ifndef LMP_PAIR_MOMB_H @@ -44,15 +44,15 @@ class PairMomb : public Pair { protected: double cut_global; double **cut; - double sscale,dscale; - double **d0,**alpha,**r0,**c,**rr; + double sscale, dscale; + double **d0, **alpha, **r0, **c, **rr; double **morse1; double **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_morse_smooth_linear.cpp b/src/USER-MISC/pair_morse_smooth_linear.cpp index 861959822d..59949a7aed 100644 --- a/src/USER-MISC/pair_morse_smooth_linear.cpp +++ b/src/USER-MISC/pair_morse_smooth_linear.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_morse_smooth_linear.h b/src/USER-MISC/pair_morse_smooth_linear.h index 83d2287421..18f2767b5f 100644 --- a/src/USER-MISC/pair_morse_smooth_linear.h +++ b/src/USER-MISC/pair_morse_smooth_linear.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(morse/smooth/linear,PairMorseSmoothLinear) - +// clang-format off +PairStyle(morse/smooth/linear,PairMorseSmoothLinear); +// clang-format on #else #ifndef LMP_PAIR_MORSE_SMOOTH_LINEAR_H @@ -47,7 +47,7 @@ class PairMorseSmoothLinear : public Pair { protected: double cut_global; double **cut; - double **d0,**alpha,**r0; + double **d0, **alpha, **r0; double **morse1; double **der_at_cutoff; double **offset; @@ -55,7 +55,7 @@ class PairMorseSmoothLinear : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_srp.cpp b/src/USER-MISC/pair_srp.cpp index d32d56f5b7..c09d3726c2 100644 --- a/src/USER-MISC/pair_srp.cpp +++ b/src/USER-MISC/pair_srp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_srp.h b/src/USER-MISC/pair_srp.h index 1719dbed10..4c56edaaf3 100644 --- a/src/USER-MISC/pair_srp.h +++ b/src/USER-MISC/pair_srp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(srp,PairSRP) - +// clang-format off +PairStyle(srp,PairSRP); +// clang-format on #else #ifndef LMP_PAIR_SRP_H @@ -41,11 +41,11 @@ class PairSRP : public Pair { virtual void read_restart_settings(FILE *); private: - inline void onetwoexclude(int* &, int &, int* &, int* &, int** &); + inline void onetwoexclude(int *&, int &, int *&, int *&, int **&); inline void remapBonds(int &); void allocate(); - void getMinDist(double** &, double &, double &, double &, double &, - double &, int &, int &, int &, int &); + void getMinDist(double **&, double &, double &, double &, double &, double &, int &, int &, int &, + int &); bool min, midpoint; double **cut; double **a0; @@ -55,11 +55,11 @@ class PairSRP : public Pair { int btype; class Fix *f_srp; char *fix_id; - int exclude,maxcount; + int exclude, maxcount; int **segment; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_tersoff_table.cpp b/src/USER-MISC/pair_tersoff_table.cpp index ed05961fa7..016213e505 100644 --- a/src/USER-MISC/pair_tersoff_table.cpp +++ b/src/USER-MISC/pair_tersoff_table.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_tersoff_table.h b/src/USER-MISC/pair_tersoff_table.h index cf1f44a745..662fd532b7 100644 --- a/src/USER-MISC/pair_tersoff_table.h +++ b/src/USER-MISC/pair_tersoff_table.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -21,9 +21,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/table,PairTersoffTable) - +// clang-format off +PairStyle(tersoff/table,PairTersoffTable); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_TABLE_H @@ -47,19 +47,18 @@ class PairTersoffTable : public Pair { protected: struct Param { - double lam1,lam2,lam3; - double c,d,h; - double gamma,powerm; - double powern,beta; - double biga,bigb,cutoffR, cutoffS; - double cut,cutsq; - int ielement,jelement,kelement; + double lam1, lam2, lam3; + double c, d, h; + double gamma, powerm; + double powern, beta; + double biga, bigb, cutoffR, cutoffS; + double cut, cutsq; + int ielement, jelement, kelement; int powermint; }; - - double cutmax; // max cutoff for all elements - Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction void allocate(); @@ -84,7 +83,7 @@ class PairTersoffTable : public Pair { void deallocateGrids(void); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_wf_cut.cpp b/src/USER-MISC/pair_wf_cut.cpp index 451b3f1e49..cf2813ab5a 100644 --- a/src/USER-MISC/pair_wf_cut.cpp +++ b/src/USER-MISC/pair_wf_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/pair_wf_cut.h b/src/USER-MISC/pair_wf_cut.h index bbad8caf9c..132703ce29 100644 --- a/src/USER-MISC/pair_wf_cut.h +++ b/src/USER-MISC/pair_wf_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(wf/cut,PairWFCut) - +// clang-format off +PairStyle(wf/cut,PairWFCut); +// clang-format on #else #ifndef LMP_PAIR_WF_CUT_H @@ -43,16 +43,16 @@ class PairWFCut : public Pair { void *extract(const char *, int &); protected: - int **nu,**mu; + int **nu, **mu; double cut_global; double **cut; - double **epsilon,**sigma; - double **nm,**e0nm,**rcmu,**sigma_mu,**offset; + double **epsilon, **sigma; + double **nm, **e0nm, **rcmu, **sigma_mu, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/temper_grem.cpp b/src/USER-MISC/temper_grem.cpp index ee60ab375d..d50d0c6b4d 100644 --- a/src/USER-MISC/temper_grem.cpp +++ b/src/USER-MISC/temper_grem.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/temper_grem.h b/src/USER-MISC/temper_grem.h index 1bdd920233..cdcf6a26aa 100644 --- a/src/USER-MISC/temper_grem.h +++ b/src/USER-MISC/temper_grem.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(temper/grem,TemperGrem) - +// clang-format off +CommandStyle(temper/grem,TemperGrem); +// clang-format on #else #ifndef LMP_TEMPER_GREM_H @@ -31,34 +31,34 @@ class TemperGrem : public Command { void command(int, char **); private: - int me,me_universe; // my proc ID in world and universe - int iworld,nworlds; // world info - double boltz; // copy from output->boltz - MPI_Comm roots; // MPI comm with 1 root proc from each world - class RanPark *ranswap,*ranboltz; // RNGs for swapping and Boltz factor - int nevery; // # of timesteps between swaps - int nswaps; // # of tempering swaps to perform - int seed_swap; // 0 = toggle swaps, n = RNG for swap direction - int seed_boltz; // seed for Boltz factor comparison - int whichfix; // index of temperature fix to use - int fixstyle; // what kind of temperature fix is used + int me, me_universe; // my proc ID in world and universe + int iworld, nworlds; // world info + double boltz; // copy from output->boltz + MPI_Comm roots; // MPI comm with 1 root proc from each world + class RanPark *ranswap, *ranboltz; // RNGs for swapping and Boltz factor + int nevery; // # of timesteps between swaps + int nswaps; // # of tempering swaps to perform + int seed_swap; // 0 = toggle swaps, n = RNG for swap direction + int seed_boltz; // seed for Boltz factor comparison + int whichfix; // index of temperature fix to use + int fixstyle; // what kind of temperature fix is used - int my_set_lambda; // which set lambda I am simulating - double *set_lambda; // static list of replica set lambdas - int *lambda2world; // lambda2world[i] = world simulating set lambda i - int *world2lambda; // world2lambda[i] = lambda simulated by world i - int *world2root; // world2root[i] = root proc of world i + int my_set_lambda; // which set lambda I am simulating + double *set_lambda; // static list of replica set lambdas + int *lambda2world; // lambda2world[i] = world simulating set lambda i + int *world2lambda; // world2lambda[i] = lambda simulated by world i + int *world2root; // world2root[i] = root proc of world i void print_status(); - class FixGrem * fix_grem; + class FixGrem *fix_grem; protected: char *id_nh; int pressflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/temper_npt.cpp b/src/USER-MISC/temper_npt.cpp index 1ed55a9cf3..700aa582db 100644 --- a/src/USER-MISC/temper_npt.cpp +++ b/src/USER-MISC/temper_npt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MISC/temper_npt.h b/src/USER-MISC/temper_npt.h index 1c345cae12..47eec7053b 100644 --- a/src/USER-MISC/temper_npt.h +++ b/src/USER-MISC/temper_npt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(temper/npt,TemperNPT) - +// clang-format off +CommandStyle(temper/npt,TemperNPT); +// clang-format on #else #ifndef LMP_TEMPERNPT_H @@ -32,30 +32,30 @@ class TemperNPT : public Command { void command(int, char **); private: - int me,me_universe; // my proc ID in world and universe - int iworld,nworlds; // world info - double boltz; // copy from output->boltz + int me, me_universe; // my proc ID in world and universe + int iworld, nworlds; // world info + double boltz; // copy from output->boltz double nktv2p; - MPI_Comm roots; // MPI comm with 1 root proc from each world - class RanPark *ranswap,*ranboltz; // RNGs for swapping and Boltz factor - int nevery; // # of timesteps between swaps - int nswaps; // # of tempering swaps to perform - int seed_swap; // 0 = toggle swaps, n = RNG for swap direction - int seed_boltz; // seed for Boltz factor comparison - int whichfix; // index of temperature fix to use - int fixstyle; // what kind of temperature fix is used + MPI_Comm roots; // MPI comm with 1 root proc from each world + class RanPark *ranswap, *ranboltz; // RNGs for swapping and Boltz factor + int nevery; // # of timesteps between swaps + int nswaps; // # of tempering swaps to perform + int seed_swap; // 0 = toggle swaps, n = RNG for swap direction + int seed_boltz; // seed for Boltz factor comparison + int whichfix; // index of temperature fix to use + int fixstyle; // what kind of temperature fix is used - int my_set_temp; // which set temp I am simulating - double *set_temp; // static list of replica set temperatures - int *temp2world; // temp2world[i] = world simulating set temp i - int *world2temp; // world2temp[i] = temp simulated by world i - int *world2root; // world2root[i] = root proc of world i + int my_set_temp; // which set temp I am simulating + double *set_temp; // static list of replica set temperatures + int *temp2world; // temp2world[i] = world simulating set temp i + int *world2temp; // world2temp[i] = temp simulated by world i + int *world2root; // world2root[i] = root proc of world i void scale_velocities(int, int); void print_status(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOFFF/angle_class2_p6.cpp b/src/USER-MOFFF/angle_class2_p6.cpp index c6cc477ec1..ae5a6b0852 100644 --- a/src/USER-MOFFF/angle_class2_p6.cpp +++ b/src/USER-MOFFF/angle_class2_p6.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MOFFF/angle_class2_p6.h b/src/USER-MOFFF/angle_class2_p6.h index caea234eeb..fcefa99eb2 100644 --- a/src/USER-MOFFF/angle_class2_p6.h +++ b/src/USER-MOFFF/angle_class2_p6.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(class2/p6,AngleClass2P6) - +// clang-format off +AngleStyle(class2/p6,AngleClass2P6); +// clang-format on #else #ifndef LMP_ANGLE_CLASS2_P6_H @@ -37,15 +37,15 @@ class AngleClass2P6 : public Angle { double single(int, int, int, int); protected: - double *theta0,*k2,*k3,*k4,*k5,*k6; - double *bb_k,*bb_r1,*bb_r2; - double *ba_k1,*ba_k2,*ba_r1,*ba_r2; - int *setflag_a,*setflag_bb,*setflag_ba; + double *theta0, *k2, *k3, *k4, *k5, *k6; + double *bb_k, *bb_r1, *bb_r2; + double *ba_k1, *ba_k2, *ba_r1, *ba_r2; + int *setflag_a, *setflag_bb, *setflag_ba; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOFFF/angle_cosine_buck6d.cpp b/src/USER-MOFFF/angle_cosine_buck6d.cpp index 277ee8830b..711db0373a 100644 --- a/src/USER-MOFFF/angle_cosine_buck6d.cpp +++ b/src/USER-MOFFF/angle_cosine_buck6d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MOFFF/angle_cosine_buck6d.h b/src/USER-MOFFF/angle_cosine_buck6d.h index 467abfb56a..44d47ea39d 100644 --- a/src/USER-MOFFF/angle_cosine_buck6d.h +++ b/src/USER-MOFFF/angle_cosine_buck6d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine/buck6d, AngleCosineBuck6d) - +// clang-format off +AngleStyle(cosine/buck6d, AngleCosineBuck6d); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_BUCK6D_H @@ -38,16 +38,16 @@ class AngleCosineBuck6d : public Angle { double single(int, int, int, int); protected: - double *k,*th0; - double *eps,*d0; - double **buck6d1,**buck6d2,**buck6d3,**buck6d4,**cut_ljsq; - double **c0,**c1,**c2,**c3,**c4,**c5,**rsmooth_sq,**offset; + double *k, *th0; + double *eps, *d0; + double **buck6d1, **buck6d2, **buck6d3, **buck6d4, **cut_ljsq; + double **c0, **c1, **c2, **c3, **c4, **c5, **rsmooth_sq, **offset; int *multiplicity; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOFFF/improper_inversion_harmonic.cpp b/src/USER-MOFFF/improper_inversion_harmonic.cpp index c678f3cd9f..12494c805a 100644 --- a/src/USER-MOFFF/improper_inversion_harmonic.cpp +++ b/src/USER-MOFFF/improper_inversion_harmonic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MOFFF/improper_inversion_harmonic.h b/src/USER-MOFFF/improper_inversion_harmonic.h index cff0c14d92..5ab8e78a3c 100644 --- a/src/USER-MOFFF/improper_inversion_harmonic.h +++ b/src/USER-MOFFF/improper_inversion_harmonic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(inversion/harmonic,ImproperInversionHarmonic) - +// clang-format off +ImproperStyle(inversion/harmonic,ImproperInversionHarmonic); +// clang-format on #else #ifndef LMP_IMPROPER_INVERSION_HARMONIC_H @@ -36,18 +36,16 @@ class ImproperInversionHarmonic : public Improper { protected: double *kw, *w0; - void invang(const int &i1,const int &i2,const int &i3,const int &i4, - const int &type,const int &evflag,const int &eflag, - const double &vb1x, const double &vb1y, const double &vb1z, - const double &rrvb1, const double &rr2vb1, - const double &vb2x, const double &vb2y, const double &vb2z, - const double &rrvb2, const double &rr2vb2, - const double &vb3x, const double &vb3y, const double &vb3z, - const double &rrvb3, const double &rr2vb3); + void invang(const int &i1, const int &i2, const int &i3, const int &i4, const int &type, + const int &evflag, const int &eflag, const double &vb1x, const double &vb1y, + const double &vb1z, const double &rrvb1, const double &rr2vb1, const double &vb2x, + const double &vb2y, const double &vb2z, const double &rrvb2, const double &rr2vb2, + const double &vb3x, const double &vb3y, const double &vb3z, const double &rrvb3, + const double &rr2vb3); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp index 714fbe1774..b480a04b04 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.h b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.h index 7fb22094d7..bce07e89f1 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.h +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck6d/coul/gauss/dsf,PairBuck6dCoulGaussDSF) - +// clang-format off +PairStyle(buck6d/coul/gauss/dsf,PairBuck6dCoulGaussDSF); +// clang-format on #else #ifndef LMP_PAIR_BUCK6D_COUL_GAUSS_DSF_H @@ -44,18 +44,18 @@ class PairBuck6dCoulGaussDSF : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; + double **cut_lj, **cut_ljsq; double **alpha_ij; - double **buck6d1,**buck6d2,**buck6d3,**buck6d4,**offset; - double **f_shift_ij,**e_shift_ij; - double cut_coul,cut_coulsq; + double **buck6d1, **buck6d2, **buck6d3, **buck6d4, **offset; + double **f_shift_ij, **e_shift_ij; + double cut_coul, cut_coulsq; double vdwl_smooth; - double **c0,**c1,**c2,**c3,**c4,**c5,**rsmooth_sq; + double **c0, **c1, **c2, **c3, **c4, **c5, **rsmooth_sq; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp index d2f52f83dc..79849fad2a 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.h b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.h index c814143cc4..f25328d82e 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.h +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck6d/coul/gauss/long,PairBuck6dCoulGaussLong) - +// clang-format off +PairStyle(buck6d/coul/gauss/long,PairBuck6dCoulGaussLong); +// clang-format on #else #ifndef LMP_PAIR_BUCK6D_COUL_GAUSS_LONG_H @@ -44,19 +44,19 @@ class PairBuck6dCoulGaussLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; + double **cut_lj, **cut_ljsq; double **alpha_ij; - double **buck6d1,**buck6d2,**buck6d3,**buck6d4,**offset; + double **buck6d1, **buck6d2, **buck6d3, **buck6d4, **offset; double cut_coul, cut_coulsq; double vdwl_smooth, coul_smooth; - double c0_c,c1_c,c2_c,c3_c,c4_c,c5_c,rsmooth_sq_c; - double **c0,**c1,**c2,**c3,**c4,**c5,**rsmooth_sq; + double c0_c, c1_c, c2_c, c3_c, c4_c, c5_c, rsmooth_sq_c; + double **c0, **c1, **c2, **c3, **c4, **c5, **rsmooth_sq; double g_ewald; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOLFILE/dump_molfile.cpp b/src/USER-MOLFILE/dump_molfile.cpp index 20790d4b32..c1c4120405 100644 --- a/src/USER-MOLFILE/dump_molfile.cpp +++ b/src/USER-MOLFILE/dump_molfile.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MOLFILE/dump_molfile.h b/src/USER-MOLFILE/dump_molfile.h index f55c2f0762..968ed783ca 100644 --- a/src/USER-MOLFILE/dump_molfile.h +++ b/src/USER-MOLFILE/dump_molfile.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(molfile,DumpMolfile) - +// clang-format off +DumpStyle(molfile,DumpMolfile); +// clang-format on #else #ifndef LMP_DUMP_MOLFILE_H @@ -28,34 +28,34 @@ namespace LAMMPS_NS { class DumpMolfile : public Dump { public: - DumpMolfile(LAMMPS *, int, char**); + DumpMolfile(LAMMPS *, int, char **); virtual ~DumpMolfile(); virtual void write(); protected: - class MolfileInterface *mf; //< handles low-level I/O + class MolfileInterface *mf; //< handles low-level I/O // per-atom data float *coords, *vels, *masses, *charges, *radiuses; - int *types, *molids; + int *types, *molids; char **typenames; - int natoms,me,ntotal,ntypes; + int natoms, me, ntotal, ntypes; int need_structure; - int unwrap_flag; // 1 if writing unwrapped atom coords, 0 if not - int velocity_flag; // 1 if writing velocities, 0 if not - int topology_flag; // 1 if writing topology data, 0 if not - float cell[6]; // cell parameters: A, B, C, alpha, beta, gamma + int unwrap_flag; // 1 if writing unwrapped atom coords, 0 if not + int velocity_flag; // 1 if writing velocities, 0 if not + int topology_flag; // 1 if writing topology data, 0 if not + float cell[6]; // cell parameters: A, B, C, alpha, beta, gamma virtual void init_style(); virtual int modify_param(int, char **); - virtual void write_header(bigint) {}; + virtual void write_header(bigint){}; virtual void pack(tagint *); virtual void write_data(int, double *); virtual double memory_usage(); virtual void openfile(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOLFILE/molfile_interface.cpp b/src/USER-MOLFILE/molfile_interface.cpp index dc40859127..1cdc698a97 100644 --- a/src/USER-MOLFILE/molfile_interface.cpp +++ b/src/USER-MOLFILE/molfile_interface.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MOLFILE/molfile_interface.h b/src/USER-MOLFILE/molfile_interface.h index 8ac0f35bbf..4be74d5cbe 100644 --- a/src/USER-MOLFILE/molfile_interface.h +++ b/src/USER-MOLFILE/molfile_interface.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,47 +23,56 @@ namespace LAMMPS_NS { // This class provides an abstract interface // to the VMD plugin library. -class MolfileInterface -{ +class MolfileInterface { public: // plugin modes. - enum {M_NONE=0, - M_READ = 1<<0, M_WRITE = 1<<1, - M_RSTRUCT = 1<<2, M_WSTRUCT = 1<<3, - M_RBONDS = 1<<4, M_WBONDS = 1<<5, - M_RANGLES = 1<<6, M_WANGLES = 1<<7, - M_RVOL = 1<<8, M_WVOL = 1<<9, - M_RVELS = 1<<10, M_WVELS = 1<<11, - M_LAST = 1<<12 }; + enum { + M_NONE = 0, + M_READ = 1 << 0, + M_WRITE = 1 << 1, + M_RSTRUCT = 1 << 2, + M_WSTRUCT = 1 << 3, + M_RBONDS = 1 << 4, + M_WBONDS = 1 << 5, + M_RANGLES = 1 << 6, + M_WANGLES = 1 << 7, + M_RVOL = 1 << 8, + M_WVOL = 1 << 9, + M_RVELS = 1 << 10, + M_WVELS = 1 << 11, + M_LAST = 1 << 12 + }; // plugin finder return values. - enum {E_NONE=0, //< nothing happened - E_DIR, //< path is not a directory or not readable - E_FILE, //< file not a DSO or not readable - E_SYMBOL, //< DSO is not a VMD plugin - E_TYPE, //< plugin is not of the correct type - E_ABI, //< plugin ABI does not match - E_MODE, //< plugin does not support desired mode - E_VERSION, //< plugin is not newer as the current one - E_MATCH, //< plugin matches - E_LAST //< last entry + enum { + E_NONE = 0, //< nothing happened + E_DIR, //< path is not a directory or not readable + E_FILE, //< file not a DSO or not readable + E_SYMBOL, //< DSO is not a VMD plugin + E_TYPE, //< plugin is not of the correct type + E_ABI, //< plugin ABI does not match + E_MODE, //< plugin does not support desired mode + E_VERSION, //< plugin is not newer as the current one + E_MATCH, //< plugin matches + E_LAST //< last entry }; // atom structure properties. deliberately not complete. - enum {P_NONE=0, //< no structure information available - P_NAME=1<<0, //< atom name, char[16] - P_TYPE=1<<1, //< atom type, char[16] - P_RESN=1<<2, //< residue name, char[ 8] - P_RESI=1<<3, //< residue index, int - P_SEGN=1<<4, //< segment name, char[ 8] - P_CHAI=1<<5, //< chain id, char[ 2] - P_OCCP=1<<6, //< occupancy, float - P_BFAC=1<<7, //< B factor, float - P_MASS=1<<8, //< atom mass, float - P_CHRG=1<<9, //< atom charge, float - P_RADS=1<<10, //< atom radius, float - P_ATMN=1<<11, //< atomic number, int - P_LAST=1<<12 //< last entry + enum { + P_NONE = 0, //< no structure information available + P_NAME = 1 << 0, //< atom name, char[16] + P_TYPE = 1 << 1, //< atom type, char[16] + P_RESN = 1 << 2, //< residue name, char[ 8] + P_RESI = 1 << 3, //< residue index, int + P_SEGN = 1 << 4, //< segment name, char[ 8] + P_CHAI = 1 << 5, //< chain id, char[ 2] + P_OCCP = 1 << 6, //< occupancy, float + P_BFAC = 1 << 7, //< B factor, float + P_MASS = 1 << 8, //< atom mass, float + P_CHRG = 1 << 9, //< atom charge, float + P_RADS = 1 << 10, //< atom radius, float + P_ATMN = 1 << 11, //< atomic number, int + P_LAST = 1 << 12 //< last entry }; MolfileInterface(const char *type, const int mode); @@ -71,9 +80,9 @@ class MolfileInterface // disallowed default methods private: - MolfileInterface() {}; - MolfileInterface(const MolfileInterface &) {}; - MolfileInterface &operator =(const MolfileInterface &) {return *this;}; + MolfileInterface(){}; + MolfileInterface(const MolfileInterface &){}; + MolfileInterface &operator=(const MolfileInterface &) { return *this; }; public: // search in the given directory path for a molfile plugin that @@ -106,9 +115,9 @@ class MolfileInterface // true if file stream is active. bool is_open() const { return (_ptr != 0); }; // true if file format requires or provides atom properties - bool has_props() const { return (_mode & (M_RSTRUCT|M_WSTRUCT)) != 0; }; + bool has_props() const { return (_mode & (M_RSTRUCT | M_WSTRUCT)) != 0; }; // true if file format can read or write velocities - bool has_vels() const { return (_mode & (M_RVELS|M_WVELS)) != 0; }; + bool has_vels() const { return (_mode & (M_RVELS | M_WVELS)) != 0; }; // return number of atoms in current file. -1 if closed/invalid; bool get_natoms() const { return _natoms; }; @@ -144,18 +153,18 @@ class MolfileInterface // internal data protected: - void *_plugin; // pointer to plugin struct - void *_dso; // handle to DSO - void *_ptr; // pointer to plugin data handle - void *_info; // pointer to atomic info data - char *_type; // canonical plugin name - char *_name; // plugin formatted name - int _natoms; // number of atoms - int _mode; // plugin mode of operation - int _caps; // plugin capabilities - int _props; // accumulated/available properties + void *_plugin; // pointer to plugin struct + void *_dso; // handle to DSO + void *_ptr; // pointer to plugin data handle + void *_info; // pointer to atomic info data + char *_type; // canonical plugin name + char *_name; // plugin formatted name + int _natoms; // number of atoms + int _mode; // plugin mode of operation + int _caps; // plugin capabilities + int _props; // accumulated/available properties }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-MOLFILE/reader_molfile.cpp b/src/USER-MOLFILE/reader_molfile.cpp index 4820d9a861..e04b615018 100644 --- a/src/USER-MOLFILE/reader_molfile.cpp +++ b/src/USER-MOLFILE/reader_molfile.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-MOLFILE/reader_molfile.h b/src/USER-MOLFILE/reader_molfile.h index d02f3e7986..1f7fead9c0 100644 --- a/src/USER-MOLFILE/reader_molfile.h +++ b/src/USER-MOLFILE/reader_molfile.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef READER_CLASS - -ReaderStyle(molfile,ReaderMolfile) - +// clang-format off +ReaderStyle(molfile,ReaderMolfile); +// clang-format on #else #ifndef LMP_READER_MOLFILE_H @@ -35,31 +35,31 @@ class ReaderMolfile : public Reader { virtual int read_time(bigint &); virtual void skip(); - virtual bigint read_header(double [3][3], int &, int &, int, int, int *, char **, - int, int, int &, int &, int &, int &); + virtual bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, + int &, int &, int &); virtual void read_atoms(int, int, double **); virtual void open_file(const char *); virtual void close_file(); -private: - int *fieldindex; // mapping of input fields to dump + private: + int *fieldindex; // mapping of input fields to dump class MolfileInterface *mf; - float *coords; // pointer to temporary coordinate storage - float *vels; // pointer to temporary velocity storage - int *types; // pointer to temporary type info storage - float cell[6]; // box info (stored as, a, b, c, alpha, beta, gamma) - int natoms; // current number of atoms - int needvels; // 1 if velocities are required, otherwise 0 + float *coords; // pointer to temporary coordinate storage + float *vels; // pointer to temporary velocity storage + int *types; // pointer to temporary type info storage + float cell[6]; // box info (stored as, a, b, c, alpha, beta, gamma) + int natoms; // current number of atoms + int needvels; // 1 if velocities are required, otherwise 0 - bigint nstep; // current (time) step number - bigint nid; // current atom id. + bigint nstep; // current (time) step number + bigint nid; // current atom id. int me; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-NETCDF/README b/src/USER-NETCDF/README index fc2af83529..714cbc67d0 100644 --- a/src/USER-NETCDF/README +++ b/src/USER-NETCDF/README @@ -9,7 +9,7 @@ on your system. See lib/netcdf/README for additional details. PACKAGE DESCRIPTION ------------------- -This is a LAMMPS (https://lammps.sandia.gov/) dump style for output into a NetCDF +This is a LAMMPS (https://www.lammps.org/) dump style for output into a NetCDF database. The database format follows the AMBER NetCDF trajectory convention (http://ambermd.org/netcdf/nctraj.xhtml), but includes extensions to this convention. These extension are: diff --git a/src/USER-NETCDF/dump_netcdf.cpp b/src/USER-NETCDF/dump_netcdf.cpp index bdd79d0d05..e13bea910f 100644 --- a/src/USER-NETCDF/dump_netcdf.cpp +++ b/src/USER-NETCDF/dump_netcdf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-NETCDF/dump_netcdf.h b/src/USER-NETCDF/dump_netcdf.h index a996ffc847..dd9c50873e 100644 --- a/src/USER-NETCDF/dump_netcdf.h +++ b/src/USER-NETCDF/dump_netcdf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,9 +18,9 @@ #if defined(LMP_HAS_NETCDF) #ifdef DUMP_CLASS - -DumpStyle(netcdf,DumpNetCDF) - +// clang-format off +DumpStyle(netcdf,DumpNetCDF); +// clang-format on #else #ifndef LMP_DUMP_NETCDF_H @@ -31,7 +31,7 @@ DumpStyle(netcdf,DumpNetCDF) namespace LAMMPS_NS { const int NC_FIELD_NAME_MAX = 100; -const int DUMP_NC_MAX_DIMS = 100; +const int DUMP_NC_MAX_DIMS = 100; class DumpNetCDF : public DumpCustom { public: @@ -42,32 +42,32 @@ class DumpNetCDF : public DumpCustom { private: // per-atoms quantities (positions, velocities, etc.) struct nc_perat_t { - int dims; // number of dimensions - int field[DUMP_NC_MAX_DIMS]; // field indices corresponding to the dim. - char name[NC_FIELD_NAME_MAX]; // field name - int var; // NetCDF variable + int dims; // number of dimensions + int field[DUMP_NC_MAX_DIMS]; // field indices corresponding to the dim. + char name[NC_FIELD_NAME_MAX]; // field name + int var; // NetCDF variable - bool constant; // is this property per file (not per frame) - int ndumped; // number of enties written for this prop. + bool constant; // is this property per file (not per frame) + int ndumped; // number of enties written for this prop. }; - int framei; // current frame index - int blocki; // current block index - int ndata; // number of data blocks to expect + int framei; // current frame index + int blocki; // current block index + int ndata; // number of data blocks to expect - bigint ntotalgr; // # of atoms + bigint ntotalgr; // # of atoms - int n_perat; // # of netcdf per-atom properties - nc_perat_t *perat; // per-atom properties + int n_perat; // # of netcdf per-atom properties + nc_perat_t *perat; // per-atom properties - int *thermovar; // NetCDF variables for thermo output + int *thermovar; // NetCDF variables for thermo output - bool double_precision; // write everything as double precision - bool thermo; // write thermo output to netcdf file + bool double_precision; // write everything as double precision + bool thermo; // write thermo output to netcdf file - bigint n_buffer; // size of buffer - bigint *int_buffer; // buffer for passing data to netcdf - double *double_buffer; // buffer for passing data to netcdf + bigint n_buffer; // size of buffer + bigint *int_buffer; // buffer for passing data to netcdf + double *double_buffer; // buffer for passing data to netcdf int ncid; @@ -97,7 +97,7 @@ class DumpNetCDF : public DumpCustom { void ncerr(int, const char *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-NETCDF/dump_netcdf_mpiio.cpp b/src/USER-NETCDF/dump_netcdf_mpiio.cpp index cd83d1cbff..bf5b1a26ca 100644 --- a/src/USER-NETCDF/dump_netcdf_mpiio.cpp +++ b/src/USER-NETCDF/dump_netcdf_mpiio.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-NETCDF/dump_netcdf_mpiio.h b/src/USER-NETCDF/dump_netcdf_mpiio.h index 2d1cd3ca2b..56c07fc3d3 100644 --- a/src/USER-NETCDF/dump_netcdf_mpiio.h +++ b/src/USER-NETCDF/dump_netcdf_mpiio.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,9 +18,9 @@ #if defined(LMP_HAS_PNETCDF) #ifdef DUMP_CLASS - -DumpStyle(netcdf/mpiio,DumpNetCDFMPIIO) - +// clang-format off +DumpStyle(netcdf/mpiio,DumpNetCDFMPIIO); +// clang-format on #else #ifndef LMP_DUMP_NETCDF_MPIIO_H @@ -31,7 +31,7 @@ DumpStyle(netcdf/mpiio,DumpNetCDFMPIIO) namespace LAMMPS_NS { const int NC_MPIIO_FIELD_NAME_MAX = 100; -const int DUMP_NC_MPIIO_MAX_DIMS = 100; +const int DUMP_NC_MPIIO_MAX_DIMS = 100; class DumpNetCDFMPIIO : public DumpCustom { public: @@ -42,31 +42,31 @@ class DumpNetCDFMPIIO : public DumpCustom { private: // per-atoms quantities (positions, velocities, etc.) struct nc_perat_t { - int dims; // number of dimensions - int field[DUMP_NC_MPIIO_MAX_DIMS]; // field indices corresponding to the dim. - char name[NC_MPIIO_FIELD_NAME_MAX]; // field name - int var; // NetCDF variable + int dims; // number of dimensions + int field[DUMP_NC_MPIIO_MAX_DIMS]; // field indices corresponding to the dim. + char name[NC_MPIIO_FIELD_NAME_MAX]; // field name + int var; // NetCDF variable }; typedef void (DumpNetCDFMPIIO::*funcptr_t)(void *); - int framei; // current frame index - int blocki; // current block index - int ndata; // number of data blocks to expect + int framei; // current frame index + int blocki; // current block index + int ndata; // number of data blocks to expect - bigint ntotalgr; // # of atoms + bigint ntotalgr; // # of atoms - int n_perat; // # of netcdf per-atom properties - nc_perat_t *perat; // per-atom properties + int n_perat; // # of netcdf per-atom properties + nc_perat_t *perat; // per-atom properties - int *thermovar; // NetCDF variables for thermo output + int *thermovar; // NetCDF variables for thermo output - bool double_precision; // write everything as double precision - bool thermo; // write thermo output to netcdf file + bool double_precision; // write everything as double precision + bool thermo; // write thermo output to netcdf file - bigint n_buffer; // size of buffer - bigint *int_buffer; // buffer for passing data to netcdf - double *double_buffer; // buffer for passing data to netcdf + bigint n_buffer; // size of buffer + bigint *int_buffer; // buffer for passing data to netcdf + double *double_buffer; // buffer for passing data to netcdf int ncid; @@ -97,7 +97,7 @@ class DumpNetCDFMPIIO : public DumpCustom { void ncerr(int, const char *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_charmm_omp.cpp b/src/USER-OMP/angle_charmm_omp.cpp index 9daa6ef29b..1c84828c63 100644 --- a/src/USER-OMP/angle_charmm_omp.cpp +++ b/src/USER-OMP/angle_charmm_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_charmm_omp.h b/src/USER-OMP/angle_charmm_omp.h index a96d62cad4..80e3777071 100644 --- a/src/USER-OMP/angle_charmm_omp.h +++ b/src/USER-OMP/angle_charmm_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(charmm/omp,AngleCharmmOMP) - +// clang-format off +AngleStyle(charmm/omp,AngleCharmmOMP); +// clang-format on #else #ifndef LMP_ANGLE_CHARMM_OMP_H @@ -37,10 +37,10 @@ class AngleCharmmOMP : public AngleCharmm, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_class2_omp.cpp b/src/USER-OMP/angle_class2_omp.cpp index 4622115e45..02ad63cd56 100644 --- a/src/USER-OMP/angle_class2_omp.cpp +++ b/src/USER-OMP/angle_class2_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_class2_omp.h b/src/USER-OMP/angle_class2_omp.h index 1f06e2bf06..03ab80ce23 100644 --- a/src/USER-OMP/angle_class2_omp.h +++ b/src/USER-OMP/angle_class2_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(class2/omp,AngleClass2OMP) - +// clang-format off +AngleStyle(class2/omp,AngleClass2OMP); +// clang-format on #else #ifndef LMP_ANGLE_CLASS2_OMP_H @@ -37,10 +37,10 @@ class AngleClass2OMP : public AngleClass2, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_cosine_delta_omp.cpp b/src/USER-OMP/angle_cosine_delta_omp.cpp index c43e93b366..e60d0748df 100644 --- a/src/USER-OMP/angle_cosine_delta_omp.cpp +++ b/src/USER-OMP/angle_cosine_delta_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_cosine_delta_omp.h b/src/USER-OMP/angle_cosine_delta_omp.h index 3dbafe2682..5cd17c5c17 100644 --- a/src/USER-OMP/angle_cosine_delta_omp.h +++ b/src/USER-OMP/angle_cosine_delta_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine/delta/omp,AngleCosineDeltaOMP) - +// clang-format off +AngleStyle(cosine/delta/omp,AngleCosineDeltaOMP); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_DELTA_OMP_H @@ -37,10 +37,10 @@ class AngleCosineDeltaOMP : public AngleCosineDelta, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_cosine_omp.cpp b/src/USER-OMP/angle_cosine_omp.cpp index 38a573c056..d0c27dfab0 100644 --- a/src/USER-OMP/angle_cosine_omp.cpp +++ b/src/USER-OMP/angle_cosine_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_cosine_omp.h b/src/USER-OMP/angle_cosine_omp.h index cb7468a1f9..a02f5340ff 100644 --- a/src/USER-OMP/angle_cosine_omp.h +++ b/src/USER-OMP/angle_cosine_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine/omp,AngleCosineOMP) - +// clang-format off +AngleStyle(cosine/omp,AngleCosineOMP); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_OMP_H @@ -37,10 +37,10 @@ class AngleCosineOMP : public AngleCosine, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_cosine_periodic_omp.cpp b/src/USER-OMP/angle_cosine_periodic_omp.cpp index 55af772a40..58db02d6f7 100644 --- a/src/USER-OMP/angle_cosine_periodic_omp.cpp +++ b/src/USER-OMP/angle_cosine_periodic_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_cosine_periodic_omp.h b/src/USER-OMP/angle_cosine_periodic_omp.h index db4a683141..30507be888 100644 --- a/src/USER-OMP/angle_cosine_periodic_omp.h +++ b/src/USER-OMP/angle_cosine_periodic_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine/periodic/omp,AngleCosinePeriodicOMP) - +// clang-format off +AngleStyle(cosine/periodic/omp,AngleCosinePeriodicOMP); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_PERIODIC_OMP_H @@ -37,10 +37,10 @@ class AngleCosinePeriodicOMP : public AngleCosinePeriodic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_cosine_shift_exp_omp.cpp b/src/USER-OMP/angle_cosine_shift_exp_omp.cpp index 28d757d770..f2abf1f1b0 100644 --- a/src/USER-OMP/angle_cosine_shift_exp_omp.cpp +++ b/src/USER-OMP/angle_cosine_shift_exp_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_cosine_shift_exp_omp.h b/src/USER-OMP/angle_cosine_shift_exp_omp.h index 4a42872b1e..e8003e6168 100644 --- a/src/USER-OMP/angle_cosine_shift_exp_omp.h +++ b/src/USER-OMP/angle_cosine_shift_exp_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine/shift/exp/omp,AngleCosineShiftExpOMP) - +// clang-format off +AngleStyle(cosine/shift/exp/omp,AngleCosineShiftExpOMP); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_SHIFT_EXP_OMP_H @@ -37,10 +37,10 @@ class AngleCosineShiftExpOMP : public AngleCosineShiftExp, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_cosine_shift_omp.cpp b/src/USER-OMP/angle_cosine_shift_omp.cpp index 34dde8e677..4d6e1ab81a 100644 --- a/src/USER-OMP/angle_cosine_shift_omp.cpp +++ b/src/USER-OMP/angle_cosine_shift_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_cosine_shift_omp.h b/src/USER-OMP/angle_cosine_shift_omp.h index 25b6234c52..2502534c28 100644 --- a/src/USER-OMP/angle_cosine_shift_omp.h +++ b/src/USER-OMP/angle_cosine_shift_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine/shift/omp,AngleCosineShiftOMP) - +// clang-format off +AngleStyle(cosine/shift/omp,AngleCosineShiftOMP); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_SHIFT_OMP_H @@ -37,10 +37,10 @@ class AngleCosineShiftOMP : public AngleCosineShift, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_cosine_squared_omp.cpp b/src/USER-OMP/angle_cosine_squared_omp.cpp index 00b34c8ac1..65b73216c7 100644 --- a/src/USER-OMP/angle_cosine_squared_omp.cpp +++ b/src/USER-OMP/angle_cosine_squared_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_cosine_squared_omp.h b/src/USER-OMP/angle_cosine_squared_omp.h index 4fcd360125..028fe66be3 100644 --- a/src/USER-OMP/angle_cosine_squared_omp.h +++ b/src/USER-OMP/angle_cosine_squared_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cosine/squared/omp,AngleCosineSquaredOMP) - +// clang-format off +AngleStyle(cosine/squared/omp,AngleCosineSquaredOMP); +// clang-format on #else #ifndef LMP_ANGLE_COSINE_SQUARED_OMP_H @@ -37,10 +37,10 @@ class AngleCosineSquaredOMP : public AngleCosineSquared, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_dipole_omp.cpp b/src/USER-OMP/angle_dipole_omp.cpp index ddf31752cb..4ff307f77f 100644 --- a/src/USER-OMP/angle_dipole_omp.cpp +++ b/src/USER-OMP/angle_dipole_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_dipole_omp.h b/src/USER-OMP/angle_dipole_omp.h index b8c4067e0b..fd3376d80f 100644 --- a/src/USER-OMP/angle_dipole_omp.h +++ b/src/USER-OMP/angle_dipole_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(dipole/omp,AngleDipoleOMP) - +// clang-format off +AngleStyle(dipole/omp,AngleDipoleOMP); +// clang-format on #else #ifndef LMP_ANGLE_DIPOLE_OMP_H @@ -36,11 +36,10 @@ class AngleDipoleOMP : public AngleDipole, public ThrOMP { virtual void compute(int, int); private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_fourier_omp.cpp b/src/USER-OMP/angle_fourier_omp.cpp index 63110ba23e..d7a05f6850 100644 --- a/src/USER-OMP/angle_fourier_omp.cpp +++ b/src/USER-OMP/angle_fourier_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_fourier_omp.h b/src/USER-OMP/angle_fourier_omp.h index b273e01207..94ea79aaa0 100644 --- a/src/USER-OMP/angle_fourier_omp.h +++ b/src/USER-OMP/angle_fourier_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(fourier/omp,AngleFourierOMP) - +// clang-format off +AngleStyle(fourier/omp,AngleFourierOMP); +// clang-format on #else #ifndef LMP_ANGLE_FOURIER_OMP_H @@ -37,10 +37,10 @@ class AngleFourierOMP : public AngleFourier, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_fourier_simple_omp.cpp b/src/USER-OMP/angle_fourier_simple_omp.cpp index 0be602f3b0..b6318f306b 100644 --- a/src/USER-OMP/angle_fourier_simple_omp.cpp +++ b/src/USER-OMP/angle_fourier_simple_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_fourier_simple_omp.h b/src/USER-OMP/angle_fourier_simple_omp.h index 68710a8b95..43893732d3 100644 --- a/src/USER-OMP/angle_fourier_simple_omp.h +++ b/src/USER-OMP/angle_fourier_simple_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(fourier/simple/omp,AngleFourierSimpleOMP) - +// clang-format off +AngleStyle(fourier/simple/omp,AngleFourierSimpleOMP); +// clang-format on #else #ifndef LMP_ANGLE_FOURIER_SIMPLE_OMP_H @@ -37,10 +37,10 @@ class AngleFourierSimpleOMP : public AngleFourierSimple, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_harmonic_omp.cpp b/src/USER-OMP/angle_harmonic_omp.cpp index fffbfdc6f0..2d1a34570d 100644 --- a/src/USER-OMP/angle_harmonic_omp.cpp +++ b/src/USER-OMP/angle_harmonic_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_harmonic_omp.h b/src/USER-OMP/angle_harmonic_omp.h index b617a0e5b6..4e292deed9 100644 --- a/src/USER-OMP/angle_harmonic_omp.h +++ b/src/USER-OMP/angle_harmonic_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(harmonic/omp,AngleHarmonicOMP) - +// clang-format off +AngleStyle(harmonic/omp,AngleHarmonicOMP); +// clang-format on #else #ifndef LMP_ANGLE_HARMONIC_OMP_H @@ -37,10 +37,10 @@ class AngleHarmonicOMP : public AngleHarmonic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_quartic_omp.cpp b/src/USER-OMP/angle_quartic_omp.cpp index 84284a00ee..3770319323 100644 --- a/src/USER-OMP/angle_quartic_omp.cpp +++ b/src/USER-OMP/angle_quartic_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_quartic_omp.h b/src/USER-OMP/angle_quartic_omp.h index 7bb85d6277..a2bb6666ea 100644 --- a/src/USER-OMP/angle_quartic_omp.h +++ b/src/USER-OMP/angle_quartic_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(quartic/omp,AngleQuarticOMP) - +// clang-format off +AngleStyle(quartic/omp,AngleQuarticOMP); +// clang-format on #else #ifndef LMP_ANGLE_QUARTIC_OMP_H @@ -37,10 +37,10 @@ class AngleQuarticOMP : public AngleQuartic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_sdk_omp.cpp b/src/USER-OMP/angle_sdk_omp.cpp index 69d3349707..8fcfb3df08 100644 --- a/src/USER-OMP/angle_sdk_omp.cpp +++ b/src/USER-OMP/angle_sdk_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_sdk_omp.h b/src/USER-OMP/angle_sdk_omp.h index 7bed2d6878..1c32222488 100644 --- a/src/USER-OMP/angle_sdk_omp.h +++ b/src/USER-OMP/angle_sdk_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(sdk/omp,AngleSDKOMP) - +// clang-format off +AngleStyle(sdk/omp,AngleSDKOMP); +// clang-format on #else #ifndef LMP_ANGLE_SDK_OMP_H @@ -37,10 +37,10 @@ class AngleSDKOMP : public AngleSDK, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_table_omp.cpp b/src/USER-OMP/angle_table_omp.cpp index 4bda92c307..892f9295a5 100644 --- a/src/USER-OMP/angle_table_omp.cpp +++ b/src/USER-OMP/angle_table_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/angle_table_omp.h b/src/USER-OMP/angle_table_omp.h index 84d5ded7d9..1e8a55c56a 100644 --- a/src/USER-OMP/angle_table_omp.h +++ b/src/USER-OMP/angle_table_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(table/omp,AngleTableOMP) - +// clang-format off +AngleStyle(table/omp,AngleTableOMP); +// clang-format on #else #ifndef LMP_ANGLE_TABLE_OMP_H @@ -37,10 +37,10 @@ class AngleTableOMP : public AngleTable, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_class2_omp.cpp b/src/USER-OMP/bond_class2_omp.cpp index d5f4da728f..170e97d13d 100644 --- a/src/USER-OMP/bond_class2_omp.cpp +++ b/src/USER-OMP/bond_class2_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/bond_class2_omp.h b/src/USER-OMP/bond_class2_omp.h index e65d5006dd..0a868c6ef4 100644 --- a/src/USER-OMP/bond_class2_omp.h +++ b/src/USER-OMP/bond_class2_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(class2/omp,BondClass2OMP) - +// clang-format off +BondStyle(class2/omp,BondClass2OMP); +// clang-format on #else #ifndef LMP_BOND_CLASS2_OMP_H @@ -37,10 +37,10 @@ class BondClass2OMP : public BondClass2, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_fene_expand_omp.cpp b/src/USER-OMP/bond_fene_expand_omp.cpp index 30fe27bc56..56ea5b52a0 100644 --- a/src/USER-OMP/bond_fene_expand_omp.cpp +++ b/src/USER-OMP/bond_fene_expand_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/bond_fene_expand_omp.h b/src/USER-OMP/bond_fene_expand_omp.h index 4323dea61e..e44444dd06 100644 --- a/src/USER-OMP/bond_fene_expand_omp.h +++ b/src/USER-OMP/bond_fene_expand_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(fene/expand/omp,BondFENEExpandOMP) - +// clang-format off +BondStyle(fene/expand/omp,BondFENEExpandOMP); +// clang-format on #else #ifndef LMP_BOND_FENE_EXPAND_OMP_H @@ -37,10 +37,10 @@ class BondFENEExpandOMP : public BondFENEExpand, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_fene_omp.cpp b/src/USER-OMP/bond_fene_omp.cpp index fa636d396c..57afe43a18 100644 --- a/src/USER-OMP/bond_fene_omp.cpp +++ b/src/USER-OMP/bond_fene_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/bond_fene_omp.h b/src/USER-OMP/bond_fene_omp.h index 432321db9b..65ef8e993d 100644 --- a/src/USER-OMP/bond_fene_omp.h +++ b/src/USER-OMP/bond_fene_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(fene/omp,BondFENEOMP) - +// clang-format off +BondStyle(fene/omp,BondFENEOMP); +// clang-format on #else #ifndef LMP_BOND_FENE_OMP_H @@ -37,10 +37,10 @@ class BondFENEOMP : public BondFENE, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_gromos_omp.cpp b/src/USER-OMP/bond_gromos_omp.cpp index 21fff2e379..bba8f15230 100644 --- a/src/USER-OMP/bond_gromos_omp.cpp +++ b/src/USER-OMP/bond_gromos_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/bond_gromos_omp.h b/src/USER-OMP/bond_gromos_omp.h index be7280d279..8077dad2ba 100644 --- a/src/USER-OMP/bond_gromos_omp.h +++ b/src/USER-OMP/bond_gromos_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(gromos/omp,BondGromosOMP) - +// clang-format off +BondStyle(gromos/omp,BondGromosOMP); +// clang-format on #else #ifndef LMP_BOND_GROMOS_OMP_H @@ -37,10 +37,10 @@ class BondGromosOMP : public BondGromos, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_harmonic_omp.cpp b/src/USER-OMP/bond_harmonic_omp.cpp index fedd83eb1e..5ad816bf1b 100644 --- a/src/USER-OMP/bond_harmonic_omp.cpp +++ b/src/USER-OMP/bond_harmonic_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/bond_harmonic_omp.h b/src/USER-OMP/bond_harmonic_omp.h index 77fa490e5f..eab41e6515 100644 --- a/src/USER-OMP/bond_harmonic_omp.h +++ b/src/USER-OMP/bond_harmonic_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(harmonic/omp,BondHarmonicOMP) - +// clang-format off +BondStyle(harmonic/omp,BondHarmonicOMP); +// clang-format on #else #ifndef LMP_BOND_HARMONIC_OMP_H @@ -37,10 +37,10 @@ class BondHarmonicOMP : public BondHarmonic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp b/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp index 2ceaefd100..3d462a8305 100644 --- a/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp +++ b/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/bond_harmonic_shift_cut_omp.h b/src/USER-OMP/bond_harmonic_shift_cut_omp.h index 2220b683fc..3f467b943d 100644 --- a/src/USER-OMP/bond_harmonic_shift_cut_omp.h +++ b/src/USER-OMP/bond_harmonic_shift_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(harmonic/shift/cut/omp,BondHarmonicShiftCutOMP) - +// clang-format off +BondStyle(harmonic/shift/cut/omp,BondHarmonicShiftCutOMP); +// clang-format on #else #ifndef LMP_BOND_HARMONIC_SHIFT_CUT_OMP_H @@ -37,10 +37,10 @@ class BondHarmonicShiftCutOMP : public BondHarmonicShiftCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_harmonic_shift_omp.cpp b/src/USER-OMP/bond_harmonic_shift_omp.cpp index ce06752ba2..567287bcc7 100644 --- a/src/USER-OMP/bond_harmonic_shift_omp.cpp +++ b/src/USER-OMP/bond_harmonic_shift_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/bond_harmonic_shift_omp.h b/src/USER-OMP/bond_harmonic_shift_omp.h index e614ebfbc0..b7004b7d14 100644 --- a/src/USER-OMP/bond_harmonic_shift_omp.h +++ b/src/USER-OMP/bond_harmonic_shift_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(harmonic/shift/omp,BondHarmonicShiftOMP) - +// clang-format off +BondStyle(harmonic/shift/omp,BondHarmonicShiftOMP); +// clang-format on #else #ifndef LMP_BOND_HARMONIC_SHIFT_OMP_H @@ -37,10 +37,10 @@ class BondHarmonicShiftOMP : public BondHarmonicShift, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_morse_omp.cpp b/src/USER-OMP/bond_morse_omp.cpp index c37bee3fbd..3e9c5a9b5b 100644 --- a/src/USER-OMP/bond_morse_omp.cpp +++ b/src/USER-OMP/bond_morse_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/bond_morse_omp.h b/src/USER-OMP/bond_morse_omp.h index ac90359c7e..2184488e0f 100644 --- a/src/USER-OMP/bond_morse_omp.h +++ b/src/USER-OMP/bond_morse_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(morse/omp,BondMorseOMP) - +// clang-format off +BondStyle(morse/omp,BondMorseOMP); +// clang-format on #else #ifndef LMP_BOND_MORSE_OMP_H @@ -37,10 +37,10 @@ class BondMorseOMP : public BondMorse, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_nonlinear_omp.cpp b/src/USER-OMP/bond_nonlinear_omp.cpp index 8accb9cacb..4a011a1f8a 100644 --- a/src/USER-OMP/bond_nonlinear_omp.cpp +++ b/src/USER-OMP/bond_nonlinear_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/bond_nonlinear_omp.h b/src/USER-OMP/bond_nonlinear_omp.h index 0f27990729..bdf496093f 100644 --- a/src/USER-OMP/bond_nonlinear_omp.h +++ b/src/USER-OMP/bond_nonlinear_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(nonlinear/omp,BondNonlinearOMP) - +// clang-format off +BondStyle(nonlinear/omp,BondNonlinearOMP); +// clang-format on #else #ifndef LMP_BOND_NONLINEAR_OMP_H @@ -37,10 +37,10 @@ class BondNonlinearOMP : public BondNonlinear, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_quartic_omp.cpp b/src/USER-OMP/bond_quartic_omp.cpp index 1f39a7cee1..00e8357644 100644 --- a/src/USER-OMP/bond_quartic_omp.cpp +++ b/src/USER-OMP/bond_quartic_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/bond_quartic_omp.h b/src/USER-OMP/bond_quartic_omp.h index 2d538b5a7b..169da27562 100644 --- a/src/USER-OMP/bond_quartic_omp.h +++ b/src/USER-OMP/bond_quartic_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(quartic/omp,BondQuarticOMP) - +// clang-format off +BondStyle(quartic/omp,BondQuarticOMP); +// clang-format on #else #ifndef LMP_BOND_QUARTIC_OMP_H @@ -37,10 +37,10 @@ class BondQuarticOMP : public BondQuartic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_table_omp.cpp b/src/USER-OMP/bond_table_omp.cpp index dff7bc6fcb..faadca456a 100644 --- a/src/USER-OMP/bond_table_omp.cpp +++ b/src/USER-OMP/bond_table_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/bond_table_omp.h b/src/USER-OMP/bond_table_omp.h index 4c9e7dc29f..d6147709e3 100644 --- a/src/USER-OMP/bond_table_omp.h +++ b/src/USER-OMP/bond_table_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(table/omp,BondTableOMP) - +// clang-format off +BondStyle(table/omp,BondTableOMP); +// clang-format on #else #ifndef LMP_BOND_TABLE_OMP_H @@ -37,10 +37,10 @@ class BondTableOMP : public BondTable, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_charmm_omp.cpp b/src/USER-OMP/dihedral_charmm_omp.cpp index b4ffba4749..4835669158 100644 --- a/src/USER-OMP/dihedral_charmm_omp.cpp +++ b/src/USER-OMP/dihedral_charmm_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/dihedral_charmm_omp.h b/src/USER-OMP/dihedral_charmm_omp.h index 0164a00083..b326cf9329 100644 --- a/src/USER-OMP/dihedral_charmm_omp.h +++ b/src/USER-OMP/dihedral_charmm_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(charmm/omp,DihedralCharmmOMP) - +// clang-format off +DihedralStyle(charmm/omp,DihedralCharmmOMP); +// clang-format on #else #ifndef LMP_DIHEDRAL_CHARMM_OMP_H @@ -37,10 +37,10 @@ class DihedralCharmmOMP : public DihedralCharmm, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_class2_omp.cpp b/src/USER-OMP/dihedral_class2_omp.cpp index f25c1a58f6..2f922b0bdf 100644 --- a/src/USER-OMP/dihedral_class2_omp.cpp +++ b/src/USER-OMP/dihedral_class2_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/dihedral_class2_omp.h b/src/USER-OMP/dihedral_class2_omp.h index 5f332ec372..f80dbafdec 100644 --- a/src/USER-OMP/dihedral_class2_omp.h +++ b/src/USER-OMP/dihedral_class2_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(class2/omp,DihedralClass2OMP) - +// clang-format off +DihedralStyle(class2/omp,DihedralClass2OMP); +// clang-format on #else #ifndef LMP_DIHEDRAL_CLASS2_OMP_H @@ -37,10 +37,10 @@ class DihedralClass2OMP : public DihedralClass2, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp b/src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp index 34a7b5c3d1..b4dbc4538a 100644 --- a/src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp +++ b/src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/dihedral_cosine_shift_exp_omp.h b/src/USER-OMP/dihedral_cosine_shift_exp_omp.h index 226a23c99f..862a2d6428 100644 --- a/src/USER-OMP/dihedral_cosine_shift_exp_omp.h +++ b/src/USER-OMP/dihedral_cosine_shift_exp_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(cosine/shift/exp/omp,DihedralCosineShiftExpOMP) - +// clang-format off +DihedralStyle(cosine/shift/exp/omp,DihedralCosineShiftExpOMP); +// clang-format on #else #ifndef LMP_DIHEDRAL_COSINE_SHIFT_EXP_OMP_H @@ -37,10 +37,10 @@ class DihedralCosineShiftExpOMP : public DihedralCosineShiftExp, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_fourier_omp.cpp b/src/USER-OMP/dihedral_fourier_omp.cpp index 392fb46a0f..e735f01953 100644 --- a/src/USER-OMP/dihedral_fourier_omp.cpp +++ b/src/USER-OMP/dihedral_fourier_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/dihedral_fourier_omp.h b/src/USER-OMP/dihedral_fourier_omp.h index 34d1a1ca53..d493f4a2b9 100644 --- a/src/USER-OMP/dihedral_fourier_omp.h +++ b/src/USER-OMP/dihedral_fourier_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(fourier/omp,DihedralFourierOMP) - +// clang-format off +DihedralStyle(fourier/omp,DihedralFourierOMP); +// clang-format on #else #ifndef LMP_DIHEDRAL_FOURIER_OMP_H @@ -37,10 +37,10 @@ class DihedralFourierOMP : public DihedralFourier, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_harmonic_omp.cpp b/src/USER-OMP/dihedral_harmonic_omp.cpp index 937432d34e..c780bf0b30 100644 --- a/src/USER-OMP/dihedral_harmonic_omp.cpp +++ b/src/USER-OMP/dihedral_harmonic_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/dihedral_harmonic_omp.h b/src/USER-OMP/dihedral_harmonic_omp.h index 7b8390352f..5a29dbc647 100644 --- a/src/USER-OMP/dihedral_harmonic_omp.h +++ b/src/USER-OMP/dihedral_harmonic_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(harmonic/omp,DihedralHarmonicOMP) - +// clang-format off +DihedralStyle(harmonic/omp,DihedralHarmonicOMP); +// clang-format on #else #ifndef LMP_DIHEDRAL_HARMONIC_OMP_H @@ -37,10 +37,10 @@ class DihedralHarmonicOMP : public DihedralHarmonic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_helix_omp.cpp b/src/USER-OMP/dihedral_helix_omp.cpp index dc3c86f334..a2f2778935 100644 --- a/src/USER-OMP/dihedral_helix_omp.cpp +++ b/src/USER-OMP/dihedral_helix_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/dihedral_helix_omp.h b/src/USER-OMP/dihedral_helix_omp.h index 589971eed2..1361519be2 100644 --- a/src/USER-OMP/dihedral_helix_omp.h +++ b/src/USER-OMP/dihedral_helix_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(helix/omp,DihedralHelixOMP) - +// clang-format off +DihedralStyle(helix/omp,DihedralHelixOMP); +// clang-format on #else #ifndef LMP_DIHEDRAL_HELIX_OMP_H @@ -37,10 +37,10 @@ class DihedralHelixOMP : public DihedralHelix, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_multi_harmonic_omp.cpp b/src/USER-OMP/dihedral_multi_harmonic_omp.cpp index f60de18d4e..19519ea644 100644 --- a/src/USER-OMP/dihedral_multi_harmonic_omp.cpp +++ b/src/USER-OMP/dihedral_multi_harmonic_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/dihedral_multi_harmonic_omp.h b/src/USER-OMP/dihedral_multi_harmonic_omp.h index d4893c336c..977915e2b2 100644 --- a/src/USER-OMP/dihedral_multi_harmonic_omp.h +++ b/src/USER-OMP/dihedral_multi_harmonic_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(multi/harmonic/omp,DihedralMultiHarmonicOMP) - +// clang-format off +DihedralStyle(multi/harmonic/omp,DihedralMultiHarmonicOMP); +// clang-format on #else #ifndef LMP_DIHEDRAL_MULTI_HARMONIC_OMP_H @@ -37,10 +37,10 @@ class DihedralMultiHarmonicOMP : public DihedralMultiHarmonic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_nharmonic_omp.cpp b/src/USER-OMP/dihedral_nharmonic_omp.cpp index 5a6889b6f7..66f7ab5fe9 100644 --- a/src/USER-OMP/dihedral_nharmonic_omp.cpp +++ b/src/USER-OMP/dihedral_nharmonic_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/dihedral_nharmonic_omp.h b/src/USER-OMP/dihedral_nharmonic_omp.h index 74c2d031cf..f7bff45358 100644 --- a/src/USER-OMP/dihedral_nharmonic_omp.h +++ b/src/USER-OMP/dihedral_nharmonic_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(nharmonic/omp,DihedralNHarmonicOMP) - +// clang-format off +DihedralStyle(nharmonic/omp,DihedralNHarmonicOMP); +// clang-format on #else #ifndef LMP_DIHEDRAL_NHARMONIC_OMP_H @@ -37,10 +37,10 @@ class DihedralNHarmonicOMP : public DihedralNHarmonic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_opls_omp.cpp b/src/USER-OMP/dihedral_opls_omp.cpp index 118be9165a..e24d658350 100644 --- a/src/USER-OMP/dihedral_opls_omp.cpp +++ b/src/USER-OMP/dihedral_opls_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/dihedral_opls_omp.h b/src/USER-OMP/dihedral_opls_omp.h index 4ac8efeb50..cec4229e09 100644 --- a/src/USER-OMP/dihedral_opls_omp.h +++ b/src/USER-OMP/dihedral_opls_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(opls/omp,DihedralOPLSOMP) - +// clang-format off +DihedralStyle(opls/omp,DihedralOPLSOMP); +// clang-format on #else #ifndef LMP_DIHEDRAL_OPLS_OMP_H @@ -37,10 +37,10 @@ class DihedralOPLSOMP : public DihedralOPLS, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_quadratic_omp.cpp b/src/USER-OMP/dihedral_quadratic_omp.cpp index b7756f5c73..30ab8ff413 100644 --- a/src/USER-OMP/dihedral_quadratic_omp.cpp +++ b/src/USER-OMP/dihedral_quadratic_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/dihedral_quadratic_omp.h b/src/USER-OMP/dihedral_quadratic_omp.h index 73420ed7d2..9f31bc88ed 100644 --- a/src/USER-OMP/dihedral_quadratic_omp.h +++ b/src/USER-OMP/dihedral_quadratic_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(quadratic/omp,DihedralQuadraticOMP) - +// clang-format off +DihedralStyle(quadratic/omp,DihedralQuadraticOMP); +// clang-format on #else #ifndef LMP_DIHEDRAL_QUADRATIC_OMP_H @@ -37,10 +37,10 @@ class DihedralQuadraticOMP : public DihedralQuadratic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_table_omp.cpp b/src/USER-OMP/dihedral_table_omp.cpp index 6d6acc27e6..6e5ba8ec73 100644 --- a/src/USER-OMP/dihedral_table_omp.cpp +++ b/src/USER-OMP/dihedral_table_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/dihedral_table_omp.h b/src/USER-OMP/dihedral_table_omp.h index 5c66e0f1c5..b1a121e7be 100644 --- a/src/USER-OMP/dihedral_table_omp.h +++ b/src/USER-OMP/dihedral_table_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(table/omp,DihedralTableOMP) - +// clang-format off +DihedralStyle(table/omp,DihedralTableOMP); +// clang-format on #else #ifndef LMP_DIHEDRAL_TABLE_OMP_H @@ -37,10 +37,10 @@ class DihedralTableOMP : public DihedralTable, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/domain_omp.cpp b/src/USER-OMP/domain_omp.cpp index 758a69a325..94a0b094a7 100644 --- a/src/USER-OMP/domain_omp.cpp +++ b/src/USER-OMP/domain_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/ewald_omp.cpp b/src/USER-OMP/ewald_omp.cpp index 9d2cd244c2..5f47b03096 100644 --- a/src/USER-OMP/ewald_omp.cpp +++ b/src/USER-OMP/ewald_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/ewald_omp.h b/src/USER-OMP/ewald_omp.h index 1dcba93921..6547b0fbf6 100644 --- a/src/USER-OMP/ewald_omp.h +++ b/src/USER-OMP/ewald_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(ewald/omp,EwaldOMP) - +// clang-format off +KSpaceStyle(ewald/omp,EwaldOMP); +// clang-format on #else #ifndef LMP_EWALD_OMP_H @@ -25,10 +25,10 @@ KSpaceStyle(ewald/omp,EwaldOMP) namespace LAMMPS_NS { - class EwaldOMP : public Ewald, public ThrOMP { +class EwaldOMP : public Ewald, public ThrOMP { public: EwaldOMP(class LAMMPS *); - virtual ~EwaldOMP() { }; + virtual ~EwaldOMP(){}; virtual void allocate(); virtual void compute(int, int); @@ -37,7 +37,7 @@ namespace LAMMPS_NS { virtual void eik_dot_r_triclinic(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_gravity_omp.cpp b/src/USER-OMP/fix_gravity_omp.cpp index 9ee6e832a3..c9f9104547 100644 --- a/src/USER-OMP/fix_gravity_omp.cpp +++ b/src/USER-OMP/fix_gravity_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_gravity_omp.h b/src/USER-OMP/fix_gravity_omp.h index d7a4db1211..da7187202a 100644 --- a/src/USER-OMP/fix_gravity_omp.h +++ b/src/USER-OMP/fix_gravity_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(gravity/omp,FixGravityOMP) - +// clang-format off +FixStyle(gravity/omp,FixGravityOMP); +// clang-format on #else #ifndef LMP_FIX_GRAVITY_OMP_H @@ -32,7 +32,7 @@ class FixGravityOMP : public FixGravity { virtual void post_force_respa(int, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_neigh_history_omp.cpp b/src/USER-OMP/fix_neigh_history_omp.cpp index dbb11867b0..50599b2669 100644 --- a/src/USER-OMP/fix_neigh_history_omp.cpp +++ b/src/USER-OMP/fix_neigh_history_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_neigh_history_omp.h b/src/USER-OMP/fix_neigh_history_omp.h index 2bdb1b8dd1..d373cff7c9 100644 --- a/src/USER-OMP/fix_neigh_history_omp.h +++ b/src/USER-OMP/fix_neigh_history_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(NEIGH_HISTORY/omp,FixNeighHistoryOMP) - +// clang-format off +FixStyle(NEIGH_HISTORY/omp,FixNeighHistoryOMP); +// clang-format on #else #ifndef LMP_FIX_NEIGH_HISTORY_OMP_H @@ -34,7 +34,7 @@ class FixNeighHistoryOMP : public FixNeighHistory { void post_neighbor(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nh_asphere_omp.cpp b/src/USER-OMP/fix_nh_asphere_omp.cpp index 815f029c24..9325038790 100644 --- a/src/USER-OMP/fix_nh_asphere_omp.cpp +++ b/src/USER-OMP/fix_nh_asphere_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_nh_asphere_omp.h b/src/USER-OMP/fix_nh_asphere_omp.h index 3a6b40f334..d6332c2b03 100644 --- a/src/USER-OMP/fix_nh_asphere_omp.h +++ b/src/USER-OMP/fix_nh_asphere_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -33,7 +33,7 @@ class FixNHAsphereOMP : public FixNHOMP { virtual void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-OMP/fix_nh_omp.cpp b/src/USER-OMP/fix_nh_omp.cpp index 2354729ba9..c2601c1b22 100644 --- a/src/USER-OMP/fix_nh_omp.cpp +++ b/src/USER-OMP/fix_nh_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_nh_omp.h b/src/USER-OMP/fix_nh_omp.h index bc5c748111..2c16b18987 100644 --- a/src/USER-OMP/fix_nh_omp.h +++ b/src/USER-OMP/fix_nh_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,8 +20,8 @@ namespace LAMMPS_NS { class FixNHOMP : public FixNH { public: - FixNHOMP(class LAMMPS *lmp, int narg, char **args) : FixNH(lmp,narg,args) {}; - virtual ~FixNHOMP() {}; + FixNHOMP(class LAMMPS *lmp, int narg, char **args) : FixNH(lmp, narg, args){}; + virtual ~FixNHOMP(){}; protected: virtual void remap(); @@ -31,7 +31,7 @@ class FixNHOMP : public FixNH { virtual void nve_x(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-OMP/fix_nh_sphere_omp.cpp b/src/USER-OMP/fix_nh_sphere_omp.cpp index e79280e5ce..2c00a8ffb7 100644 --- a/src/USER-OMP/fix_nh_sphere_omp.cpp +++ b/src/USER-OMP/fix_nh_sphere_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_nh_sphere_omp.h b/src/USER-OMP/fix_nh_sphere_omp.h index f3f961e295..bbbae69bfa 100644 --- a/src/USER-OMP/fix_nh_sphere_omp.h +++ b/src/USER-OMP/fix_nh_sphere_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -29,7 +29,7 @@ class FixNHSphereOMP : public FixNHOMP { virtual void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-OMP/fix_nph_asphere_omp.cpp b/src/USER-OMP/fix_nph_asphere_omp.cpp index eeeb4ef2ea..c7a28e84f4 100644 --- a/src/USER-OMP/fix_nph_asphere_omp.cpp +++ b/src/USER-OMP/fix_nph_asphere_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_nph_asphere_omp.h b/src/USER-OMP/fix_nph_asphere_omp.h index 874b15ff36..7cf5e817db 100644 --- a/src/USER-OMP/fix_nph_asphere_omp.h +++ b/src/USER-OMP/fix_nph_asphere_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nph/asphere/omp,FixNPHAsphereOMP) - +// clang-format off +FixStyle(nph/asphere/omp,FixNPHAsphereOMP); +// clang-format on #else #ifndef LMP_FIX_NPH_ASPHERE_OMP_H @@ -30,7 +30,7 @@ class FixNPHAsphereOMP : public FixNHAsphereOMP { virtual ~FixNPHAsphereOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nph_omp.cpp b/src/USER-OMP/fix_nph_omp.cpp index 733600b4bf..861d8f32ef 100644 --- a/src/USER-OMP/fix_nph_omp.cpp +++ b/src/USER-OMP/fix_nph_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_nph_omp.h b/src/USER-OMP/fix_nph_omp.h index 3522ae831f..3ad206c688 100644 --- a/src/USER-OMP/fix_nph_omp.h +++ b/src/USER-OMP/fix_nph_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nph/omp,FixNPHOMP) - +// clang-format off +FixStyle(nph/omp,FixNPHOMP); +// clang-format on #else #ifndef LMP_FIX_NPH_OMP_H @@ -30,7 +30,7 @@ class FixNPHOMP : public FixNHOMP { ~FixNPHOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nph_sphere_omp.cpp b/src/USER-OMP/fix_nph_sphere_omp.cpp index 35387b51f2..8f8aa32b09 100644 --- a/src/USER-OMP/fix_nph_sphere_omp.cpp +++ b/src/USER-OMP/fix_nph_sphere_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_nph_sphere_omp.h b/src/USER-OMP/fix_nph_sphere_omp.h index d3ada129c4..fec448374f 100644 --- a/src/USER-OMP/fix_nph_sphere_omp.h +++ b/src/USER-OMP/fix_nph_sphere_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nph/sphere/omp,FixNPHSphereOMP) - +// clang-format off +FixStyle(nph/sphere/omp,FixNPHSphereOMP); +// clang-format on #else #ifndef LMP_FIX_NPH_SPHERE_OMP_H @@ -30,7 +30,7 @@ class FixNPHSphereOMP : public FixNHSphereOMP { virtual ~FixNPHSphereOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_npt_asphere_omp.cpp b/src/USER-OMP/fix_npt_asphere_omp.cpp index e896db8712..23b4111988 100644 --- a/src/USER-OMP/fix_npt_asphere_omp.cpp +++ b/src/USER-OMP/fix_npt_asphere_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_npt_asphere_omp.h b/src/USER-OMP/fix_npt_asphere_omp.h index ca88944f2f..17827c941a 100644 --- a/src/USER-OMP/fix_npt_asphere_omp.h +++ b/src/USER-OMP/fix_npt_asphere_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt/asphere/omp,FixNPTAsphereOMP) - +// clang-format off +FixStyle(npt/asphere/omp,FixNPTAsphereOMP); +// clang-format on #else #ifndef LMP_FIX_NPT_ASPHERE_OMP_H @@ -30,7 +30,7 @@ class FixNPTAsphereOMP : public FixNHAsphereOMP { virtual ~FixNPTAsphereOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_npt_omp.cpp b/src/USER-OMP/fix_npt_omp.cpp index 386be81acc..4d618f8d6f 100644 --- a/src/USER-OMP/fix_npt_omp.cpp +++ b/src/USER-OMP/fix_npt_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_npt_omp.h b/src/USER-OMP/fix_npt_omp.h index 45a81282f1..e6abd4a71c 100644 --- a/src/USER-OMP/fix_npt_omp.h +++ b/src/USER-OMP/fix_npt_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt/omp,FixNPTOMP) - +// clang-format off +FixStyle(npt/omp,FixNPTOMP); +// clang-format on #else #ifndef LMP_FIX_NPT_OMP_H @@ -30,7 +30,7 @@ class FixNPTOMP : public FixNHOMP { ~FixNPTOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_npt_sphere_omp.cpp b/src/USER-OMP/fix_npt_sphere_omp.cpp index 4e40fb63d5..b82747013c 100644 --- a/src/USER-OMP/fix_npt_sphere_omp.cpp +++ b/src/USER-OMP/fix_npt_sphere_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_npt_sphere_omp.h b/src/USER-OMP/fix_npt_sphere_omp.h index 790e166993..bdd7438418 100644 --- a/src/USER-OMP/fix_npt_sphere_omp.h +++ b/src/USER-OMP/fix_npt_sphere_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt/sphere/omp,FixNPTSphereOMP) - +// clang-format off +FixStyle(npt/sphere/omp,FixNPTSphereOMP); +// clang-format on #else #ifndef LMP_FIX_NPT_SPHERE_OMP_H @@ -30,7 +30,7 @@ class FixNPTSphereOMP : public FixNHSphereOMP { virtual ~FixNPTSphereOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nve_omp.cpp b/src/USER-OMP/fix_nve_omp.cpp index 85cf4888f5..1380d4ea18 100644 --- a/src/USER-OMP/fix_nve_omp.cpp +++ b/src/USER-OMP/fix_nve_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_nve_omp.h b/src/USER-OMP/fix_nve_omp.h index 6be58073b5..8ad347a00e 100644 --- a/src/USER-OMP/fix_nve_omp.h +++ b/src/USER-OMP/fix_nve_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/omp,FixNVEOMP) - +// clang-format off +FixStyle(nve/omp,FixNVEOMP); +// clang-format on #else #ifndef LMP_FIX_NVE_OMP_H @@ -32,7 +32,7 @@ class FixNVEOMP : public FixNVE { virtual void final_integrate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nve_sphere_omp.cpp b/src/USER-OMP/fix_nve_sphere_omp.cpp index fce4355e7b..ca7367bce0 100644 --- a/src/USER-OMP/fix_nve_sphere_omp.cpp +++ b/src/USER-OMP/fix_nve_sphere_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_nve_sphere_omp.h b/src/USER-OMP/fix_nve_sphere_omp.h index a8454f7187..60b3bd4e49 100644 --- a/src/USER-OMP/fix_nve_sphere_omp.h +++ b/src/USER-OMP/fix_nve_sphere_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/sphere/omp,FixNVESphereOMP) - +// clang-format off +FixStyle(nve/sphere/omp,FixNVESphereOMP); +// clang-format on #else #ifndef LMP_FIX_NVE_SPHERE_OMP_H @@ -26,14 +26,13 @@ namespace LAMMPS_NS { class FixNVESphereOMP : public FixNVESphere { public: - FixNVESphereOMP(class LAMMPS *lmp, int narg, char **arg) : - FixNVESphere(lmp, narg, arg) {}; + FixNVESphereOMP(class LAMMPS *lmp, int narg, char **arg) : FixNVESphere(lmp, narg, arg){}; virtual void initial_integrate(int); virtual void final_integrate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nvt_asphere_omp.cpp b/src/USER-OMP/fix_nvt_asphere_omp.cpp index 2ed5632fad..5ab29323bb 100644 --- a/src/USER-OMP/fix_nvt_asphere_omp.cpp +++ b/src/USER-OMP/fix_nvt_asphere_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_nvt_asphere_omp.h b/src/USER-OMP/fix_nvt_asphere_omp.h index 55a36b2096..1e1e5c3198 100644 --- a/src/USER-OMP/fix_nvt_asphere_omp.h +++ b/src/USER-OMP/fix_nvt_asphere_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/asphere/omp,FixNVTAsphereOMP) - +// clang-format off +FixStyle(nvt/asphere/omp,FixNVTAsphereOMP); +// clang-format on #else #ifndef LMP_FIX_NVT_ASPHERE_OMP_H @@ -30,7 +30,7 @@ class FixNVTAsphereOMP : public FixNHAsphereOMP { virtual ~FixNVTAsphereOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nvt_omp.cpp b/src/USER-OMP/fix_nvt_omp.cpp index 6dc59b2db6..fdcea48e15 100644 --- a/src/USER-OMP/fix_nvt_omp.cpp +++ b/src/USER-OMP/fix_nvt_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_nvt_omp.h b/src/USER-OMP/fix_nvt_omp.h index f931419459..94f05d0bcd 100644 --- a/src/USER-OMP/fix_nvt_omp.h +++ b/src/USER-OMP/fix_nvt_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/omp,FixNVTOMP) - +// clang-format off +FixStyle(nvt/omp,FixNVTOMP); +// clang-format on #else #ifndef LMP_FIX_NVT_OMP_H @@ -30,7 +30,7 @@ class FixNVTOMP : public FixNHOMP { ~FixNVTOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nvt_sllod_omp.cpp b/src/USER-OMP/fix_nvt_sllod_omp.cpp index 3193d58386..3a36b0eff5 100644 --- a/src/USER-OMP/fix_nvt_sllod_omp.cpp +++ b/src/USER-OMP/fix_nvt_sllod_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_nvt_sllod_omp.h b/src/USER-OMP/fix_nvt_sllod_omp.h index 223e9fa2fc..b24c698c7a 100644 --- a/src/USER-OMP/fix_nvt_sllod_omp.h +++ b/src/USER-OMP/fix_nvt_sllod_omp.h @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/sllod/omp,FixNVTSllodOMP) - +// clang-format off +FixStyle(nvt/sllod/omp,FixNVTSllodOMP); +// clang-format on #else #ifndef LMP_FIX_NVT_SLLOD_OMP_H @@ -36,7 +36,7 @@ class FixNVTSllodOMP : public FixNHOMP { virtual void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nvt_sphere_omp.cpp b/src/USER-OMP/fix_nvt_sphere_omp.cpp index d53d9ec32d..a3130c6ec4 100644 --- a/src/USER-OMP/fix_nvt_sphere_omp.cpp +++ b/src/USER-OMP/fix_nvt_sphere_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_nvt_sphere_omp.h b/src/USER-OMP/fix_nvt_sphere_omp.h index eb42ef1f8c..08f93740eb 100644 --- a/src/USER-OMP/fix_nvt_sphere_omp.h +++ b/src/USER-OMP/fix_nvt_sphere_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/sphere/omp,FixNVTSphereOMP) - +// clang-format off +FixStyle(nvt/sphere/omp,FixNVTSphereOMP); +// clang-format on #else #ifndef LMP_FIX_NVT_SPHERE_OMP_H @@ -30,7 +30,7 @@ class FixNVTSphereOMP : public FixNHSphereOMP { virtual ~FixNVTSphereOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index ccc86325db..eb19c3a2d2 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_omp.h b/src/USER-OMP/fix_omp.h index 3f8ea27ae9..3f62cb7876 100644 --- a/src/USER-OMP/fix_omp.h +++ b/src/USER-OMP/fix_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(OMP,FixOMP) - +// clang-format off +FixStyle(OMP,FixOMP); +// clang-format on #else #ifndef LMP_FIX_OMP_H @@ -22,7 +22,6 @@ FixStyle(OMP,FixOMP) #include "fix.h" - namespace LAMMPS_NS { class ThrData; @@ -40,43 +39,43 @@ class FixOMP : public Fix { virtual void min_setup(int flag) { setup(flag); } virtual void pre_force(int); - virtual void setup_pre_force(int vflag) { pre_force(vflag); } - virtual void min_setup_pre_force(int vflag) { pre_force(vflag); } - virtual void min_pre_force(int vflag) { pre_force(vflag); } - virtual void setup_pre_force_respa(int vflag,int) { pre_force(vflag); } - virtual void pre_force_respa(int vflag,int,int) { pre_force(vflag); } + virtual void setup_pre_force(int vflag) { pre_force(vflag); } + virtual void min_setup_pre_force(int vflag) { pre_force(vflag); } + virtual void min_pre_force(int vflag) { pre_force(vflag); } + virtual void setup_pre_force_respa(int vflag, int) { pre_force(vflag); } + virtual void pre_force_respa(int vflag, int, int) { pre_force(vflag); } virtual double memory_usage(); protected: ThrData **thr; - void *last_omp_style; // pointer to the style that needs - // to do the general force reduction - void *last_pair_hybrid; // pointer to the pair style that needs - // to call virial_fdot_compute() + void *last_omp_style; // pointer to the style that needs + // to do the general force reduction + void *last_pair_hybrid; // pointer to the pair style that needs + // to call virial_fdot_compute() // signal that an /omp style did the force reduction. needed by respa/omp - void did_reduce() { _reduced = true; } + void did_reduce() { _reduced = true; } public: - ThrData *get_thr(int tid) { return thr[tid]; } - int get_nthr() const { return _nthr; } + ThrData *get_thr(int tid) { return thr[tid]; } + int get_nthr() const { return _nthr; } bool get_neighbor() const { return _neighbor; } - bool get_mixed() const { return _mixed; } - bool get_reduced() const { return _reduced; } + bool get_mixed() const { return _mixed; } + bool get_reduced() const { return _reduced; } private: - int _nthr; // number of currently active ThrData objects - bool _neighbor; // en/disable threads for neighbor list construction - bool _mixed; // whether to prefer mixed precision compute kernels - bool _reduced; // whether forces have been reduced for this step - bool _pair_compute_flag; // whether pair_compute is called - bool _kspace_compute_flag; // whether kspace_compute is called + int _nthr; // number of currently active ThrData objects + bool _neighbor; // en/disable threads for neighbor list construction + bool _mixed; // whether to prefer mixed precision compute kernels + bool _reduced; // whether forces have been reduced for this step + bool _pair_compute_flag; // whether pair_compute is called + bool _kspace_compute_flag; // whether kspace_compute is called void set_neighbor_omp(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_peri_neigh_omp.cpp b/src/USER-OMP/fix_peri_neigh_omp.cpp index ccfda9419b..e24a8ec838 100644 --- a/src/USER-OMP/fix_peri_neigh_omp.cpp +++ b/src/USER-OMP/fix_peri_neigh_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_peri_neigh_omp.h b/src/USER-OMP/fix_peri_neigh_omp.h index d0c144beb7..c7d4a6be57 100644 --- a/src/USER-OMP/fix_peri_neigh_omp.h +++ b/src/USER-OMP/fix_peri_neigh_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(PERI_NEIGH_OMP,FixPeriNeighOMP) - +// clang-format off +FixStyle(PERI_NEIGH_OMP,FixPeriNeighOMP); +// clang-format on #else #ifndef LMP_FIX_PERI_NEIGH_OMP_H @@ -27,12 +27,11 @@ namespace LAMMPS_NS { class FixPeriNeighOMP : public FixPeriNeigh { public: - FixPeriNeighOMP(class LAMMPS *lmp, int narg, char **argv) : - FixPeriNeigh(lmp,narg,argv) {}; + FixPeriNeighOMP(class LAMMPS *lmp, int narg, char **argv) : FixPeriNeigh(lmp, narg, argv){}; virtual void init(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_qeq_comb_omp.cpp b/src/USER-OMP/fix_qeq_comb_omp.cpp index 17b932baf0..7dd1bfbb69 100644 --- a/src/USER-OMP/fix_qeq_comb_omp.cpp +++ b/src/USER-OMP/fix_qeq_comb_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_qeq_comb_omp.h b/src/USER-OMP/fix_qeq_comb_omp.h index 707ce146c1..e7de0d4fa5 100644 --- a/src/USER-OMP/fix_qeq_comb_omp.h +++ b/src/USER-OMP/fix_qeq_comb_omp.h @@ -1,15 +1,15 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(qeq/comb/omp,FixQEQCombOMP) - +// clang-format off +FixStyle(qeq/comb/omp,FixQEQCombOMP); +// clang-format on #else #ifndef LMP_FIX_QEQ_COMB_OMP_H @@ -26,7 +26,7 @@ class FixQEQCombOMP : public FixQEQComb { virtual void post_force(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_qeq_reax_omp.cpp b/src/USER-OMP/fix_qeq_reax_omp.cpp index 7ddbe77f87..91c61cc946 100644 --- a/src/USER-OMP/fix_qeq_reax_omp.cpp +++ b/src/USER-OMP/fix_qeq_reax_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_qeq_reax_omp.h b/src/USER-OMP/fix_qeq_reax_omp.h index 323b1bdb09..62855a6f78 100644 --- a/src/USER-OMP/fix_qeq_reax_omp.h +++ b/src/USER-OMP/fix_qeq_reax_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(qeq/reax/omp,FixQEqReaxOMP) - +// clang-format off +FixStyle(qeq/reax/omp,FixQEqReaxOMP); +// clang-format on #else #ifndef LMP_FIX_QEQ_REAX_OMP_H @@ -40,27 +40,27 @@ class FixQEqReaxOMP : public FixQEqReax { int do_aspc; int aspc_order, aspc_order_max; double aspc_omega; - double * aspc_b; + double *aspc_b; virtual void allocate_storage(); virtual void deallocate_storage(); virtual void init_matvec(); virtual void compute_H(); - virtual int CG(double*,double*); - virtual void sparse_matvec(sparse_matrix*,double*,double*); + virtual int CG(double *, double *); + virtual void sparse_matvec(sparse_matrix *, double *, double *); virtual void calculate_Q(); - virtual void vector_sum(double*,double,double*,double,double*,int); - virtual void vector_add(double*, double, double*,int); + virtual void vector_sum(double *, double, double *, double, double *, int); + virtual void vector_add(double *, double, double *, int); // dual CG support - virtual int dual_CG(double*,double*,double*,double*); - virtual void dual_sparse_matvec(sparse_matrix*,double*,double*,double*); - virtual void dual_sparse_matvec(sparse_matrix*,double*,double*); + virtual int dual_CG(double *, double *, double *, double *); + virtual void dual_sparse_matvec(sparse_matrix *, double *, double *, double *); + virtual void dual_sparse_matvec(sparse_matrix *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_rigid_nh_omp.cpp b/src/USER-OMP/fix_rigid_nh_omp.cpp index ae6cb92cee..d95585e0ac 100644 --- a/src/USER-OMP/fix_rigid_nh_omp.cpp +++ b/src/USER-OMP/fix_rigid_nh_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_rigid_nh_omp.h b/src/USER-OMP/fix_rigid_nh_omp.h index ceebccf620..d923257e2f 100644 --- a/src/USER-OMP/fix_rigid_nh_omp.h +++ b/src/USER-OMP/fix_rigid_nh_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,8 +20,7 @@ namespace LAMMPS_NS { class FixRigidNHOMP : public FixRigidNH { public: - FixRigidNHOMP(class LAMMPS *lmp, int narg, char **args) - : FixRigidNH(lmp,narg,args) {} + FixRigidNHOMP(class LAMMPS *lmp, int narg, char **args) : FixRigidNH(lmp, narg, args) {} virtual ~FixRigidNHOMP() {} virtual void initial_integrate(int); @@ -31,11 +30,11 @@ class FixRigidNHOMP : public FixRigidNH { protected: virtual void compute_forces_and_torques(); - private: // copied from FixRigidOMP + private: // copied from FixRigidOMP template void set_xv_thr(); template void set_v_thr(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-OMP/fix_rigid_nph_omp.cpp b/src/USER-OMP/fix_rigid_nph_omp.cpp index 80bfbe8141..7bbf0fad81 100644 --- a/src/USER-OMP/fix_rigid_nph_omp.cpp +++ b/src/USER-OMP/fix_rigid_nph_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_rigid_nph_omp.h b/src/USER-OMP/fix_rigid_nph_omp.h index 25f8cbe4f2..e0ac1a2156 100644 --- a/src/USER-OMP/fix_rigid_nph_omp.h +++ b/src/USER-OMP/fix_rigid_nph_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/nph/omp,FixRigidNPHOMP) - +// clang-format off +FixStyle(rigid/nph/omp,FixRigidNPHOMP); +// clang-format on #else #ifndef LMP_FIX_RIGID_NPH_OMP_H @@ -30,8 +30,7 @@ class FixRigidNPHOMP : public FixRigidNHOMP { ~FixRigidNPHOMP() {} }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_rigid_npt_omp.cpp b/src/USER-OMP/fix_rigid_npt_omp.cpp index f832dda618..c661d68482 100644 --- a/src/USER-OMP/fix_rigid_npt_omp.cpp +++ b/src/USER-OMP/fix_rigid_npt_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_rigid_npt_omp.h b/src/USER-OMP/fix_rigid_npt_omp.h index c68371cb87..9e6487fac7 100644 --- a/src/USER-OMP/fix_rigid_npt_omp.h +++ b/src/USER-OMP/fix_rigid_npt_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/npt/omp,FixRigidNPTOMP) - +// clang-format off +FixStyle(rigid/npt/omp,FixRigidNPTOMP); +// clang-format on #else #ifndef LMP_FIX_RIGID_NPT_OMP_H @@ -30,8 +30,7 @@ class FixRigidNPTOMP : public FixRigidNHOMP { ~FixRigidNPTOMP() {} }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_rigid_nve_omp.cpp b/src/USER-OMP/fix_rigid_nve_omp.cpp index 8e07962293..2073a3c924 100644 --- a/src/USER-OMP/fix_rigid_nve_omp.cpp +++ b/src/USER-OMP/fix_rigid_nve_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_rigid_nve_omp.h b/src/USER-OMP/fix_rigid_nve_omp.h index 3f5f21ed7a..e3276b9974 100644 --- a/src/USER-OMP/fix_rigid_nve_omp.h +++ b/src/USER-OMP/fix_rigid_nve_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/nve/omp,FixRigidNVEOMP) - +// clang-format off +FixStyle(rigid/nve/omp,FixRigidNVEOMP); +// clang-format on #else #ifndef LMP_FIX_RIGID_NVE_OMP_H @@ -30,7 +30,7 @@ class FixRigidNVEOMP : public FixRigidNHOMP { ~FixRigidNVEOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_rigid_nvt_omp.cpp b/src/USER-OMP/fix_rigid_nvt_omp.cpp index 8b24a50224..141b6e57d3 100644 --- a/src/USER-OMP/fix_rigid_nvt_omp.cpp +++ b/src/USER-OMP/fix_rigid_nvt_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_rigid_nvt_omp.h b/src/USER-OMP/fix_rigid_nvt_omp.h index e6db85573c..06e71b7de5 100644 --- a/src/USER-OMP/fix_rigid_nvt_omp.h +++ b/src/USER-OMP/fix_rigid_nvt_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/nvt/omp,FixRigidNVTOMP) - +// clang-format off +FixStyle(rigid/nvt/omp,FixRigidNVTOMP); +// clang-format on #else #ifndef LMP_FIX_RIGID_NVT_OMP_H @@ -30,7 +30,7 @@ class FixRigidNVTOMP : public FixRigidNHOMP { ~FixRigidNVTOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_rigid_omp.cpp b/src/USER-OMP/fix_rigid_omp.cpp index 99e967f472..97a2b50827 100644 --- a/src/USER-OMP/fix_rigid_omp.cpp +++ b/src/USER-OMP/fix_rigid_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_rigid_omp.h b/src/USER-OMP/fix_rigid_omp.h index 40810bd04c..8b7354642c 100644 --- a/src/USER-OMP/fix_rigid_omp.h +++ b/src/USER-OMP/fix_rigid_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/omp,FixRigidOMP) - +// clang-format off +FixStyle(rigid/omp,FixRigidOMP); +// clang-format on #else #ifndef LMP_FIX_RIGID_OMP_H @@ -26,8 +26,7 @@ namespace LAMMPS_NS { class FixRigidOMP : public FixRigid { public: - FixRigidOMP(class LAMMPS *lmp, int narg, char **args) - : FixRigid(lmp,narg,args) {} + FixRigidOMP(class LAMMPS *lmp, int narg, char **args) : FixRigid(lmp, narg, args) {} ~FixRigidOMP() {} virtual void initial_integrate(int); @@ -41,7 +40,7 @@ class FixRigidOMP : public FixRigid { template void set_v_thr(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_rigid_small_omp.cpp b/src/USER-OMP/fix_rigid_small_omp.cpp index 9da8958305..222ae054b3 100644 --- a/src/USER-OMP/fix_rigid_small_omp.cpp +++ b/src/USER-OMP/fix_rigid_small_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/fix_rigid_small_omp.h b/src/USER-OMP/fix_rigid_small_omp.h index dbb9e50421..fcbb78534d 100644 --- a/src/USER-OMP/fix_rigid_small_omp.h +++ b/src/USER-OMP/fix_rigid_small_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/small/omp,FixRigidSmallOMP) - +// clang-format off +FixStyle(rigid/small/omp,FixRigidSmallOMP); +// clang-format on #else #ifndef LMP_FIX_RIGID_SMALL_OMP_H @@ -26,9 +26,8 @@ namespace LAMMPS_NS { class FixRigidSmallOMP : public FixRigidSmall { public: - FixRigidSmallOMP(class LAMMPS *lmp, int narg, char **args) - : FixRigidSmall(lmp,narg,args) {}; - virtual ~FixRigidSmallOMP() {}; + FixRigidSmallOMP(class LAMMPS *lmp, int narg, char **args) : FixRigidSmall(lmp, narg, args){}; + virtual ~FixRigidSmallOMP(){}; virtual void initial_integrate(int); virtual void final_integrate(); @@ -41,7 +40,7 @@ class FixRigidSmallOMP : public FixRigidSmall { template void set_v_thr(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_class2_omp.cpp b/src/USER-OMP/improper_class2_omp.cpp index 43cdde3773..ae3bad0f19 100644 --- a/src/USER-OMP/improper_class2_omp.cpp +++ b/src/USER-OMP/improper_class2_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/improper_class2_omp.h b/src/USER-OMP/improper_class2_omp.h index f8f7e7b9f1..4930e5795d 100644 --- a/src/USER-OMP/improper_class2_omp.h +++ b/src/USER-OMP/improper_class2_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(class2/omp,ImproperClass2OMP) - +// clang-format off +ImproperStyle(class2/omp,ImproperClass2OMP); +// clang-format on #else #ifndef LMP_IMPROPER_CLASS2_OMP_H @@ -37,14 +37,13 @@ class ImproperClass2OMP : public ImproperClass2, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); template - void angleangle_thr(int, int, ThrData * const thr); - + void angleangle_thr(int, int, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_cossq_omp.cpp b/src/USER-OMP/improper_cossq_omp.cpp index c8dc68261c..0a41ec45e2 100644 --- a/src/USER-OMP/improper_cossq_omp.cpp +++ b/src/USER-OMP/improper_cossq_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/improper_cossq_omp.h b/src/USER-OMP/improper_cossq_omp.h index 929731f445..98069222b3 100644 --- a/src/USER-OMP/improper_cossq_omp.h +++ b/src/USER-OMP/improper_cossq_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(cossq/omp,ImproperCossqOMP) - +// clang-format off +ImproperStyle(cossq/omp,ImproperCossqOMP); +// clang-format on #else #ifndef LMP_IMPROPER_COSSQ_OMP_H @@ -37,10 +37,10 @@ class ImproperCossqOMP : public ImproperCossq, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_cvff_omp.cpp b/src/USER-OMP/improper_cvff_omp.cpp index c2761cef68..cb71bb802b 100644 --- a/src/USER-OMP/improper_cvff_omp.cpp +++ b/src/USER-OMP/improper_cvff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/improper_cvff_omp.h b/src/USER-OMP/improper_cvff_omp.h index 14f5bd7b7d..b994ec0547 100644 --- a/src/USER-OMP/improper_cvff_omp.h +++ b/src/USER-OMP/improper_cvff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(cvff/omp,ImproperCvffOMP) - +// clang-format off +ImproperStyle(cvff/omp,ImproperCvffOMP); +// clang-format on #else #ifndef LMP_IMPROPER_CVFF_OMP_H @@ -37,10 +37,10 @@ class ImproperCvffOMP : public ImproperCvff, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_fourier_omp.cpp b/src/USER-OMP/improper_fourier_omp.cpp index 90387b6b95..3f5e270633 100644 --- a/src/USER-OMP/improper_fourier_omp.cpp +++ b/src/USER-OMP/improper_fourier_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/improper_fourier_omp.h b/src/USER-OMP/improper_fourier_omp.h index b30694c424..734b17e101 100644 --- a/src/USER-OMP/improper_fourier_omp.h +++ b/src/USER-OMP/improper_fourier_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(fourier/omp,ImproperFourierOMP) - +// clang-format off +ImproperStyle(fourier/omp,ImproperFourierOMP); +// clang-format on #else #ifndef LMP_IMPROPER_FOURIER_OMP_H @@ -37,17 +37,15 @@ class ImproperFourierOMP : public ImproperFourier, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); template - void add1_thr(const int,const int,const int,const int,const int, - const double &, const double &, const double &, - const double &, const double &, const double &, - const double &, const double &, const double &, - ThrData * const thr); + void add1_thr(const int, const int, const int, const int, const int, const double &, + const double &, const double &, const double &, const double &, const double &, + const double &, const double &, const double &, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_harmonic_omp.cpp b/src/USER-OMP/improper_harmonic_omp.cpp index 92a05a89b2..5b96aad793 100644 --- a/src/USER-OMP/improper_harmonic_omp.cpp +++ b/src/USER-OMP/improper_harmonic_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/improper_harmonic_omp.h b/src/USER-OMP/improper_harmonic_omp.h index 4a8000af53..78eb32e505 100644 --- a/src/USER-OMP/improper_harmonic_omp.h +++ b/src/USER-OMP/improper_harmonic_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(harmonic/omp,ImproperHarmonicOMP) - +// clang-format off +ImproperStyle(harmonic/omp,ImproperHarmonicOMP); +// clang-format on #else #ifndef LMP_IMPROPER_HARMONIC_OMP_H @@ -37,10 +37,10 @@ class ImproperHarmonicOMP : public ImproperHarmonic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_ring_omp.cpp b/src/USER-OMP/improper_ring_omp.cpp index 29d06b1295..1be36ac71c 100644 --- a/src/USER-OMP/improper_ring_omp.cpp +++ b/src/USER-OMP/improper_ring_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/improper_ring_omp.h b/src/USER-OMP/improper_ring_omp.h index 4378b8933e..9199830be7 100644 --- a/src/USER-OMP/improper_ring_omp.h +++ b/src/USER-OMP/improper_ring_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(ring/omp,ImproperRingOMP) - +// clang-format off +ImproperStyle(ring/omp,ImproperRingOMP); +// clang-format on #else #ifndef LMP_IMPROPER_RING_OMP_H @@ -37,10 +37,10 @@ class ImproperRingOMP : public ImproperRing, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_umbrella_omp.cpp b/src/USER-OMP/improper_umbrella_omp.cpp index 122e2b5fd2..cfd9778be0 100644 --- a/src/USER-OMP/improper_umbrella_omp.cpp +++ b/src/USER-OMP/improper_umbrella_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/improper_umbrella_omp.h b/src/USER-OMP/improper_umbrella_omp.h index 190ea0ac72..17dd81ca80 100644 --- a/src/USER-OMP/improper_umbrella_omp.h +++ b/src/USER-OMP/improper_umbrella_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(umbrella/omp,ImproperUmbrellaOMP) - +// clang-format off +ImproperStyle(umbrella/omp,ImproperUmbrellaOMP); +// clang-format on #else #ifndef LMP_IMPROPER_UMBRELLA_OMP_H @@ -37,10 +37,10 @@ class ImproperUmbrellaOMP : public ImproperUmbrella, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/msm_cg_omp.cpp b/src/USER-OMP/msm_cg_omp.cpp index b3f173d550..6e67b3e1be 100644 --- a/src/USER-OMP/msm_cg_omp.cpp +++ b/src/USER-OMP/msm_cg_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/msm_cg_omp.h b/src/USER-OMP/msm_cg_omp.h index c6ece318ca..ae38dc8027 100644 --- a/src/USER-OMP/msm_cg_omp.h +++ b/src/USER-OMP/msm_cg_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(msm/cg/omp,MSMCGOMP) - +// clang-format off +KSpaceStyle(msm/cg/omp,MSMCGOMP); +// clang-format on #else #ifndef LMP_MSM_CG_OMP_H @@ -44,7 +44,7 @@ class MSMCGOMP : public MSMOMP { virtual void fieldforce_peratom(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/msm_omp.cpp b/src/USER-OMP/msm_omp.cpp index 75e6260169..f4b298cc10 100644 --- a/src/USER-OMP/msm_omp.cpp +++ b/src/USER-OMP/msm_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/msm_omp.h b/src/USER-OMP/msm_omp.h index 88cb16c157..3beaab4bcd 100644 --- a/src/USER-OMP/msm_omp.h +++ b/src/USER-OMP/msm_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(msm/omp,MSMOMP) - +// clang-format off +KSpaceStyle(msm/omp,MSMOMP); +// clang-format on #else #ifndef LMP_MSM_OMP_H @@ -25,22 +25,21 @@ KSpaceStyle(msm/omp,MSMOMP) namespace LAMMPS_NS { - class MSMOMP : public MSM, public ThrOMP { +class MSMOMP : public MSM, public ThrOMP { public: MSMOMP(class LAMMPS *); - virtual ~MSMOMP () {}; + virtual ~MSMOMP(){}; protected: virtual void direct(int); - virtual void compute(int,int); + virtual void compute(int, int); private: template void direct_eval(int); template void direct_peratom(int); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_bin_atomonly_omp.cpp b/src/USER-OMP/npair_full_bin_atomonly_omp.cpp index 1637805081..b821ee85f7 100644 --- a/src/USER-OMP/npair_full_bin_atomonly_omp.cpp +++ b/src/USER-OMP/npair_full_bin_atomonly_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_full_bin_atomonly_omp.h b/src/USER-OMP/npair_full_bin_atomonly_omp.h index aa7bece0c2..2cdc5d086d 100644 --- a/src/USER-OMP/npair_full_bin_atomonly_omp.h +++ b/src/USER-OMP/npair_full_bin_atomonly_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/bin/atomonly/omp, NPairFullBinAtomonlyOmp, NP_FULL | NP_BIN | NP_ATOMONLY | NP_OMP | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_BIN_ATOMONLY_OMP_H @@ -34,7 +34,7 @@ class NPairFullBinAtomonlyOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_bin_ghost_omp.cpp b/src/USER-OMP/npair_full_bin_ghost_omp.cpp index 6bd081a7a9..f014170546 100644 --- a/src/USER-OMP/npair_full_bin_ghost_omp.cpp +++ b/src/USER-OMP/npair_full_bin_ghost_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_full_bin_ghost_omp.h b/src/USER-OMP/npair_full_bin_ghost_omp.h index a833ec36ad..0483cf7575 100644 --- a/src/USER-OMP/npair_full_bin_ghost_omp.h +++ b/src/USER-OMP/npair_full_bin_ghost_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/bin/ghost/omp, NPairFullBinGhostOmp, NP_FULL | NP_BIN | NP_GHOST | NP_OMP | NP_NEWTON | NP_NEWTOFF | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_BIN_GHOST_OMP_H @@ -34,7 +34,7 @@ class NPairFullBinGhostOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_bin_omp.cpp b/src/USER-OMP/npair_full_bin_omp.cpp index c52253b2b9..106f430776 100644 --- a/src/USER-OMP/npair_full_bin_omp.cpp +++ b/src/USER-OMP/npair_full_bin_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_full_bin_omp.h b/src/USER-OMP/npair_full_bin_omp.h index dcf8bd20a6..f701556950 100644 --- a/src/USER-OMP/npair_full_bin_omp.h +++ b/src/USER-OMP/npair_full_bin_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/bin/omp, NPairFullBinOmp, NP_FULL | NP_BIN | NP_OMP | NP_NEWTON | NP_NEWTOFF | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_BIN_OMP_H @@ -34,7 +34,7 @@ class NPairFullBinOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_multi_old_omp.cpp b/src/USER-OMP/npair_full_multi_old_omp.cpp index 46890f6438..6480c55d59 100644 --- a/src/USER-OMP/npair_full_multi_old_omp.cpp +++ b/src/USER-OMP/npair_full_multi_old_omp.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,16 +11,16 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_full_multi_old_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" #include "atom.h" #include "atom_vec.h" -#include "molecule.h" #include "domain.h" -#include "my_page.h" #include "error.h" +#include "molecule.h" +#include "my_page.h" +#include "neigh_list.h" +#include "npair_omp.h" +#include "omp_compat.h" using namespace LAMMPS_NS; @@ -46,11 +46,11 @@ void NPairFullMultiOldOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,k,n,itype,jtype,ibin,which,ns,imol,iatom; + int i, j, k, n, itype, jtype, ibin, which, ns, imol, iatom; tagint tagprev; - double xtmp,ytmp,ztmp,delx,dely,delz,rsq; - int *neighptr,*s; - double *cutsq,*distsq; + double xtmp, ytmp, ztmp, delx, dely, delz, rsq; + int *neighptr, *s; + double *cutsq, *distsq; // loop over each atom, storing neighbors @@ -99,32 +99,35 @@ void NPairFullMultiOldOmp::build(NeighList *list) cutsq = cutneighsq[itype]; ns = nstencil_multi_old[itype]; for (k = 0; k < ns; k++) { - for (j = binhead[ibin+s[k]]; j >= 0; j = bins[j]) { + for (j = binhead[ibin + s[k]]; j >= 0; j = bins[j]) { jtype = type[j]; if (cutsq[jtype] < distsq[k]) continue; if (i == j) continue; - 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; + rsq = delx * delx + dely * dely + delz * delz; if (rsq <= cutneighsq[itype][jtype]) { 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)) + 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 (which > 0) neighptr[n++] = j ^ (which << SBBITS); - } else 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; } } } @@ -133,8 +136,7 @@ void NPairFullMultiOldOmp::build(NeighList *list) firstneigh[i] = neighptr; numneigh[i] = n; ipage.vgot(n); - if (ipage.status()) - error->one(FLERR,"Neighbor list overflow, boost neigh_modify one"); + if (ipage.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one"); } NPAIR_OMP_CLOSE; list->inum = nlocal; diff --git a/src/USER-OMP/npair_full_multi_old_omp.h b/src/USER-OMP/npair_full_multi_old_omp.h index 608bee6da8..0b28db12d6 100644 --- a/src/USER-OMP/npair_full_multi_old_omp.h +++ b/src/USER-OMP/npair_full_multi_old_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/multi/old/omp, NPairFullMultiOldOmp, NP_FULL | NP_MULTI_OLD | NP_OMP | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_MULTI_OLD_OMP_H @@ -34,7 +34,7 @@ class NPairFullMultiOldOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_multi_omp.cpp b/src/USER-OMP/npair_full_multi_omp.cpp index f1eeae6453..e66d736c7f 100644 --- a/src/USER-OMP/npair_full_multi_omp.cpp +++ b/src/USER-OMP/npair_full_multi_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_full_multi_omp.h b/src/USER-OMP/npair_full_multi_omp.h index 71154e225e..8ee3cadbc8 100644 --- a/src/USER-OMP/npair_full_multi_omp.h +++ b/src/USER-OMP/npair_full_multi_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/multi/omp, NPairFullMultiOmp, NP_FULL | NP_MULTI | NP_OMP | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_MULTI_OMP_H @@ -34,7 +34,7 @@ class NPairFullMultiOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_nsq_ghost_omp.cpp b/src/USER-OMP/npair_full_nsq_ghost_omp.cpp index ecc2d6d372..ba268bf193 100644 --- a/src/USER-OMP/npair_full_nsq_ghost_omp.cpp +++ b/src/USER-OMP/npair_full_nsq_ghost_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_full_nsq_ghost_omp.h b/src/USER-OMP/npair_full_nsq_ghost_omp.h index 06cb73c393..b34d1fb74d 100644 --- a/src/USER-OMP/npair_full_nsq_ghost_omp.h +++ b/src/USER-OMP/npair_full_nsq_ghost_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/nsq/ghost/omp, NPairFullNsqGhostOmp, NP_FULL | NP_NSQ | NP_GHOST | NP_OMP | NP_NEWTON | NP_NEWTOFF | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_NSQ_GHOST_OMP_H @@ -34,7 +34,7 @@ class NPairFullNsqGhostOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_nsq_omp.cpp b/src/USER-OMP/npair_full_nsq_omp.cpp index 2a20f0d98f..1c44629ba5 100644 --- a/src/USER-OMP/npair_full_nsq_omp.cpp +++ b/src/USER-OMP/npair_full_nsq_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_full_nsq_omp.h b/src/USER-OMP/npair_full_nsq_omp.h index a2b6e884ad..e16f830e97 100644 --- a/src/USER-OMP/npair_full_nsq_omp.h +++ b/src/USER-OMP/npair_full_nsq_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/nsq/omp, NPairFullNsqOmp, NP_FULL | NP_NSQ | NP_OMP | NP_NEWTON | NP_NEWTOFF | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_NSQ_OMP_H @@ -34,7 +34,7 @@ class NPairFullNsqOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_bin_atomonly_newton_omp.cpp b/src/USER-OMP/npair_half_bin_atomonly_newton_omp.cpp index 2e4ab6509a..bd8999560c 100644 --- a/src/USER-OMP/npair_half_bin_atomonly_newton_omp.cpp +++ b/src/USER-OMP/npair_half_bin_atomonly_newton_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_bin_atomonly_newton_omp.h b/src/USER-OMP/npair_half_bin_atomonly_newton_omp.h index 6ad9f3eee2..9ebf5c6f65 100644 --- a/src/USER-OMP/npair_half_bin_atomonly_newton_omp.h +++ b/src/USER-OMP/npair_half_bin_atomonly_newton_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/atomonly/newton/omp, NPairHalfBinAtomonlyNewtonOmp, - NP_HALF | NP_BIN | NP_ATOMONLY | NP_NEWTON | NP_OMP | NP_ORTHO) - + NP_HALF | NP_BIN | NP_ATOMONLY | NP_NEWTON | NP_OMP | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_ATOMONLY_NEWTON_OMP_H @@ -33,7 +33,7 @@ class NPairHalfBinAtomonlyNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.cpp b/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.cpp index d270b21542..ff90dd26ed 100644 --- a/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.cpp +++ b/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.h b/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.h index 443caa01c6..2c94ff83f3 100644 --- a/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.h +++ b/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/newtoff/ghost/omp, NPairHalfBinNewtoffGhostOmp, NP_HALF | NP_BIN | NP_NEWTOFF | NP_GHOST | NP_OMP | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_NEWTOFF_GHOST_OMP_H @@ -34,7 +34,7 @@ class NPairHalfBinNewtoffGhostOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_bin_newtoff_omp.cpp b/src/USER-OMP/npair_half_bin_newtoff_omp.cpp index 86aca5a97c..796d5bf24e 100644 --- a/src/USER-OMP/npair_half_bin_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_bin_newtoff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_bin_newtoff_omp.h b/src/USER-OMP/npair_half_bin_newtoff_omp.h index 80d2c3a206..849766e803 100644 --- a/src/USER-OMP/npair_half_bin_newtoff_omp.h +++ b/src/USER-OMP/npair_half_bin_newtoff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/newtoff/omp, NPairHalfBinNewtoffOmp, - NP_HALF | NP_BIN | NP_NEWTOFF | NP_OMP | NP_ORTHO | NP_TRI) - + NP_HALF | NP_BIN | NP_NEWTOFF | NP_OMP | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_NEWTOFF_OMP_H @@ -33,7 +33,7 @@ class NPairHalfBinNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_bin_newton_omp.cpp b/src/USER-OMP/npair_half_bin_newton_omp.cpp index bc0e4f5ce9..d2e6ef9743 100644 --- a/src/USER-OMP/npair_half_bin_newton_omp.cpp +++ b/src/USER-OMP/npair_half_bin_newton_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_bin_newton_omp.h b/src/USER-OMP/npair_half_bin_newton_omp.h index f74aae6035..ddbb46b57e 100644 --- a/src/USER-OMP/npair_half_bin_newton_omp.h +++ b/src/USER-OMP/npair_half_bin_newton_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/newton/omp, NPairHalfBinNewtonOmp, - NP_HALF | NP_BIN | NP_NEWTON | NP_OMP | NP_ORTHO) - + NP_HALF | NP_BIN | NP_NEWTON | NP_OMP | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_NEWTON_OMP_H @@ -33,7 +33,7 @@ class NPairHalfBinNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_bin_newton_tri_omp.cpp b/src/USER-OMP/npair_half_bin_newton_tri_omp.cpp index c97e03ed5e..9e44fd6f87 100644 --- a/src/USER-OMP/npair_half_bin_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_bin_newton_tri_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_bin_newton_tri_omp.h b/src/USER-OMP/npair_half_bin_newton_tri_omp.h index f430bbf098..0506b1a561 100644 --- a/src/USER-OMP/npair_half_bin_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_bin_newton_tri_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/newton/tri/omp, NPairHalfBinNewtonTriOmp, - NP_HALF | NP_BIN | NP_NEWTON | NP_TRI | NP_OMP) - + NP_HALF | NP_BIN | NP_NEWTON | NP_TRI | NP_OMP); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_NEWTON_TRI_OMP_H @@ -33,7 +33,7 @@ class NPairHalfBinNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_multi_newtoff_omp.cpp b/src/USER-OMP/npair_half_multi_newtoff_omp.cpp index d1d3ba6808..852f87d5b5 100644 --- a/src/USER-OMP/npair_half_multi_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_multi_newtoff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_multi_newtoff_omp.h b/src/USER-OMP/npair_half_multi_newtoff_omp.h index a930ee8635..1be3c8d0e7 100644 --- a/src/USER-OMP/npair_half_multi_newtoff_omp.h +++ b/src/USER-OMP/npair_half_multi_newtoff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/multi/newtoff/omp, NPairHalfMultiNewtoffOmp, - NP_HALF | NP_MULTI | NP_NEWTOFF | NP_OMP | NP_ORTHO | NP_TRI) - + NP_HALF | NP_MULTI | NP_NEWTOFF | NP_OMP | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_MULTI_NEWTOFF_OMP_H @@ -33,7 +33,7 @@ class NPairHalfMultiNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_multi_newton_omp.cpp b/src/USER-OMP/npair_half_multi_newton_omp.cpp index 124b3d7c55..d78df77bec 100644 --- a/src/USER-OMP/npair_half_multi_newton_omp.cpp +++ b/src/USER-OMP/npair_half_multi_newton_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_multi_newton_omp.h b/src/USER-OMP/npair_half_multi_newton_omp.h index 49657e8ee1..a665f788dc 100644 --- a/src/USER-OMP/npair_half_multi_newton_omp.h +++ b/src/USER-OMP/npair_half_multi_newton_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/multi/newton/omp, NPairHalfMultiNewtonOmp, - NP_HALF | NP_MULTI | NP_NEWTON | NP_OMP | NP_ORTHO) - + NP_HALF | NP_MULTI | NP_NEWTON | NP_OMP | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_MULTI_NEWTON_OMP_H @@ -33,7 +33,7 @@ class NPairHalfMultiNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_multi_newton_tri_omp.cpp b/src/USER-OMP/npair_half_multi_newton_tri_omp.cpp index c023d801cd..a453851c4c 100644 --- a/src/USER-OMP/npair_half_multi_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_multi_newton_tri_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_multi_newton_tri_omp.h b/src/USER-OMP/npair_half_multi_newton_tri_omp.h index 3958bf5d22..a4cb2245b0 100644 --- a/src/USER-OMP/npair_half_multi_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_multi_newton_tri_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/multi/newton/tri/omp, NPairHalfMultiNewtonTriOmp, - NP_HALF | NP_MULTI | NP_NEWTON | NP_TRI | NP_OMP) - + NP_HALF | NP_MULTI | NP_NEWTON | NP_TRI | NP_OMP); +// clang-format on #else #ifndef LMP_NPAIR_HALF_MULTI_NEWTON_TRI_OMP_H @@ -33,7 +33,7 @@ class NPairHalfMultiNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_multi_old_newtoff_omp.cpp b/src/USER-OMP/npair_half_multi_old_newtoff_omp.cpp index 961bac8fb7..79120c905c 100644 --- a/src/USER-OMP/npair_half_multi_old_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_multi_old_newtoff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_multi_old_newtoff_omp.h b/src/USER-OMP/npair_half_multi_old_newtoff_omp.h index c52c7235ff..1ad1f2c91c 100644 --- a/src/USER-OMP/npair_half_multi_old_newtoff_omp.h +++ b/src/USER-OMP/npair_half_multi_old_newtoff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/multi/old/newtoff/omp, NPairHalfMultiOldNewtoffOmp, - NP_HALF | NP_MULTI_OLD | NP_NEWTOFF | NP_OMP | NP_ORTHO | NP_TRI) - + NP_HALF | NP_MULTI_OLD | NP_NEWTOFF | NP_OMP | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_MULTI_OLD_NEWTOFF_OMP_H @@ -33,7 +33,7 @@ class NPairHalfMultiOldNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_multi_old_newton_omp.cpp b/src/USER-OMP/npair_half_multi_old_newton_omp.cpp index affae74dbd..8588796a15 100644 --- a/src/USER-OMP/npair_half_multi_old_newton_omp.cpp +++ b/src/USER-OMP/npair_half_multi_old_newton_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_multi_old_newton_omp.h b/src/USER-OMP/npair_half_multi_old_newton_omp.h index a868e6eaac..66e67ec818 100644 --- a/src/USER-OMP/npair_half_multi_old_newton_omp.h +++ b/src/USER-OMP/npair_half_multi_old_newton_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/multi/old/newton/omp, NPairHalfMultiOldNewtonOmp, - NP_HALF | NP_MULTI_OLD | NP_NEWTON | NP_OMP | NP_ORTHO) - + NP_HALF | NP_MULTI_OLD | NP_NEWTON | NP_OMP | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_MULTI_OLD_NEWTON_OMP_H @@ -33,7 +33,7 @@ class NPairHalfMultiOldNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_multi_old_newton_tri_omp.cpp b/src/USER-OMP/npair_half_multi_old_newton_tri_omp.cpp index c023b08cb7..78430df20e 100644 --- a/src/USER-OMP/npair_half_multi_old_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_multi_old_newton_tri_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_multi_old_newton_tri_omp.h b/src/USER-OMP/npair_half_multi_old_newton_tri_omp.h index 90df0b680f..2147a88ee6 100644 --- a/src/USER-OMP/npair_half_multi_old_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_multi_old_newton_tri_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/multi/old/newton/tri/omp, NPairHalfMultiOldNewtonTriOmp, - NP_HALF | NP_MULTI_OLD | NP_NEWTON | NP_TRI | NP_OMP) - + NP_HALF | NP_MULTI_OLD | NP_NEWTON | NP_TRI | NP_OMP); +// clang-format on #else #ifndef LMP_NPAIR_HALF_MULTI_OLD_NEWTON_TRI_OMP_H @@ -33,7 +33,7 @@ class NPairHalfMultiOldNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.cpp b/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.cpp index 13f253eae0..7776f62cda 100644 --- a/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.cpp +++ b/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.h b/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.h index 5e66f8bee5..84e066b618 100644 --- a/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.h +++ b/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/nsq/newtoff/ghost/omp, NPairHalfNsqNewtoffGhostOmp, NP_HALF | NP_NSQ | NP_NEWTOFF | NP_GHOST | NP_OMP | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_NSQ_NEWTOFF_GHOST_OMP_H @@ -34,7 +34,7 @@ class NPairHalfNsqNewtoffGhostOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_nsq_newtoff_omp.cpp b/src/USER-OMP/npair_half_nsq_newtoff_omp.cpp index 7213aaaa2e..12883967d5 100644 --- a/src/USER-OMP/npair_half_nsq_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_nsq_newtoff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_nsq_newtoff_omp.h b/src/USER-OMP/npair_half_nsq_newtoff_omp.h index 009abb4cf3..68ed500e9f 100644 --- a/src/USER-OMP/npair_half_nsq_newtoff_omp.h +++ b/src/USER-OMP/npair_half_nsq_newtoff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/nsq/newtoff/omp, NPairHalfNsqNewtoffOmp, - NP_HALF | NP_NSQ | NP_NEWTOFF | NP_OMP | NP_ORTHO | NP_TRI) - + NP_HALF | NP_NSQ | NP_NEWTOFF | NP_OMP | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_NSQ_NEWTOFF_OMP_H @@ -33,7 +33,7 @@ class NPairHalfNsqNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_nsq_newton_omp.cpp b/src/USER-OMP/npair_half_nsq_newton_omp.cpp index a54ed939eb..92c62d4a09 100644 --- a/src/USER-OMP/npair_half_nsq_newton_omp.cpp +++ b/src/USER-OMP/npair_half_nsq_newton_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_nsq_newton_omp.h b/src/USER-OMP/npair_half_nsq_newton_omp.h index 3f45dc9a54..94575915d2 100644 --- a/src/USER-OMP/npair_half_nsq_newton_omp.h +++ b/src/USER-OMP/npair_half_nsq_newton_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/nsq/newton/omp, NPairHalfNsqNewtonOmp, - NP_HALF | NP_NSQ | NP_NEWTON | NP_OMP | NP_ORTHO | NP_TRI) - + NP_HALF | NP_NSQ | NP_NEWTON | NP_OMP | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_NSQ_NEWTON_OMP_H @@ -33,7 +33,7 @@ class NPairHalfNsqNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_respa_bin_newtoff_omp.cpp b/src/USER-OMP/npair_half_respa_bin_newtoff_omp.cpp index 88ead0b8e2..ced2fac83d 100644 --- a/src/USER-OMP/npair_half_respa_bin_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_respa_bin_newtoff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_respa_bin_newtoff_omp.h b/src/USER-OMP/npair_half_respa_bin_newtoff_omp.h index fc7d3d35f2..1d2a7f31e5 100644 --- a/src/USER-OMP/npair_half_respa_bin_newtoff_omp.h +++ b/src/USER-OMP/npair_half_respa_bin_newtoff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/respa/bin/newtoff/omp, NPairHalfRespaBinNewtoffOmp, NP_HALF | NP_RESPA | NP_BIN | NP_NEWTOFF | NP_OMP | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_RESPA_BIN_NEWTOFF_OMP_H @@ -34,7 +34,7 @@ class NPairHalfRespaBinNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_respa_bin_newton_omp.cpp b/src/USER-OMP/npair_half_respa_bin_newton_omp.cpp index 303b6861e7..372f0e0715 100644 --- a/src/USER-OMP/npair_half_respa_bin_newton_omp.cpp +++ b/src/USER-OMP/npair_half_respa_bin_newton_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_respa_bin_newton_omp.h b/src/USER-OMP/npair_half_respa_bin_newton_omp.h index 6b3d9bd037..f6e30722f0 100644 --- a/src/USER-OMP/npair_half_respa_bin_newton_omp.h +++ b/src/USER-OMP/npair_half_respa_bin_newton_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/respa/bin/newton/omp, NPairHalfRespaBinNewtonOmp, - NP_HALF | NP_RESPA | NP_BIN | NP_NEWTON | NP_OMP | NP_ORTHO) - + NP_HALF | NP_RESPA | NP_BIN | NP_NEWTON | NP_OMP | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_RESPA_BIN_NEWTON_OMP_H @@ -33,7 +33,7 @@ class NPairHalfRespaBinNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.cpp b/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.cpp index 8c2fddbd55..59305ec667 100644 --- a/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.h b/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.h index 72e0ec077d..f1a4d16b21 100644 --- a/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/respa/bin/newton/tri/omp, NPairHalfRespaBinNewtonTriOmp, - NP_HALF | NP_RESPA | NP_BIN | NP_NEWTON | NP_TRI | NP_OMP) - + NP_HALF | NP_RESPA | NP_BIN | NP_NEWTON | NP_TRI | NP_OMP); +// clang-format on #else #ifndef LMP_NPAIR_HALF_RESPA_BIN_NEWTON_TRI_OMP_H @@ -33,7 +33,7 @@ class NPairHalfRespaBinNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.cpp b/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.cpp index 6f091b0115..8f99a66b6b 100644 --- a/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.h b/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.h index 7f53113b8a..7c9a3cc8d2 100644 --- a/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.h +++ b/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/respa/nsq/newtoff/omp, NPairHalfRespaNsqNewtoffOmp, NP_HALF | NP_RESPA | NP_NSQ | NP_NEWTOFF | NP_OMP | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_RESPA_NSQ_NEWTOFF_OMP_H @@ -34,7 +34,7 @@ class NPairHalfRespaNsqNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_respa_nsq_newton_omp.cpp b/src/USER-OMP/npair_half_respa_nsq_newton_omp.cpp index 680da1171f..a2b055355a 100644 --- a/src/USER-OMP/npair_half_respa_nsq_newton_omp.cpp +++ b/src/USER-OMP/npair_half_respa_nsq_newton_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_respa_nsq_newton_omp.h b/src/USER-OMP/npair_half_respa_nsq_newton_omp.h index b8b9ccbac3..7adda81885 100644 --- a/src/USER-OMP/npair_half_respa_nsq_newton_omp.h +++ b/src/USER-OMP/npair_half_respa_nsq_newton_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/respa/nsq/newton/omp, NPairHalfRespaNsqNewtonOmp, NP_HALF | NP_RESPA | NP_NSQ | NP_NEWTON | NP_OMP | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_RESPA_NSQ_NEWTON_OMP_H @@ -34,7 +34,7 @@ class NPairHalfRespaNsqNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_bin_newtoff_omp.cpp b/src/USER-OMP/npair_half_size_bin_newtoff_omp.cpp index caea9e13d7..445c2ff286 100644 --- a/src/USER-OMP/npair_half_size_bin_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_size_bin_newtoff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_size_bin_newtoff_omp.h b/src/USER-OMP/npair_half_size_bin_newtoff_omp.h index 26b99cf834..728a435ffe 100644 --- a/src/USER-OMP/npair_half_size_bin_newtoff_omp.h +++ b/src/USER-OMP/npair_half_size_bin_newtoff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/bin/newtoff/omp, NPairHalfSizeBinNewtoffOmp, NP_HALF | NP_SIZE | NP_BIN | NP_NEWTOFF | NP_OMP | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_BIN_NEWTOFF_OMP_H @@ -34,7 +34,7 @@ class NPairHalfSizeBinNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_bin_newton_omp.cpp b/src/USER-OMP/npair_half_size_bin_newton_omp.cpp index 188e936cc4..be110f07e0 100644 --- a/src/USER-OMP/npair_half_size_bin_newton_omp.cpp +++ b/src/USER-OMP/npair_half_size_bin_newton_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_size_bin_newton_omp.h b/src/USER-OMP/npair_half_size_bin_newton_omp.h index 62d0fcdbf7..0902f0f417 100644 --- a/src/USER-OMP/npair_half_size_bin_newton_omp.h +++ b/src/USER-OMP/npair_half_size_bin_newton_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/bin/newton/omp, NPairHalfSizeBinNewtonOmp, - NP_HALF | NP_SIZE | NP_BIN | NP_NEWTON | NP_OMP | NP_ORTHO) - + NP_HALF | NP_SIZE | NP_BIN | NP_NEWTON | NP_OMP | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_BIN_NEWTON_OMP_H @@ -33,7 +33,7 @@ class NPairHalfSizeBinNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_bin_newton_tri_omp.cpp b/src/USER-OMP/npair_half_size_bin_newton_tri_omp.cpp index d0c6841c3e..bc3bda1181 100644 --- a/src/USER-OMP/npair_half_size_bin_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_size_bin_newton_tri_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_size_bin_newton_tri_omp.h b/src/USER-OMP/npair_half_size_bin_newton_tri_omp.h index 76e4512226..4b1ca9e71b 100644 --- a/src/USER-OMP/npair_half_size_bin_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_size_bin_newton_tri_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/bin/newton/tri/omp, NPairHalfSizeBinNewtonTriOmp, - NP_HALF | NP_SIZE | NP_BIN | NP_NEWTON | NP_TRI | NP_OMP) - + NP_HALF | NP_SIZE | NP_BIN | NP_NEWTON | NP_TRI | NP_OMP); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_BIN_NEWTON_TRI_OMP_H @@ -33,7 +33,7 @@ class NPairHalfSizeBinNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_multi_newtoff_omp.cpp b/src/USER-OMP/npair_half_size_multi_newtoff_omp.cpp index c6af398548..c774d4a0a8 100644 --- a/src/USER-OMP/npair_half_size_multi_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_size_multi_newtoff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_size_multi_newtoff_omp.h b/src/USER-OMP/npair_half_size_multi_newtoff_omp.h index baeb3392d0..5865a977ed 100644 --- a/src/USER-OMP/npair_half_size_multi_newtoff_omp.h +++ b/src/USER-OMP/npair_half_size_multi_newtoff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/multi/newtoff/omp, NPairHalfSizeMultiNewtoffOmp, - NP_HALF | NP_SIZE | NP_MULTI | NP_NEWTOFF | NP_OMP | NP_ORTHO | NP_TRI) - + NP_HALF | NP_SIZE | NP_MULTI | NP_NEWTOFF | NP_OMP | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_MULTI_NEWTOFF_OMP_H @@ -33,7 +33,7 @@ class NPairHalfSizeMultiNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_multi_newton_omp.cpp b/src/USER-OMP/npair_half_size_multi_newton_omp.cpp index cf69668424..f9e4c95030 100644 --- a/src/USER-OMP/npair_half_size_multi_newton_omp.cpp +++ b/src/USER-OMP/npair_half_size_multi_newton_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_size_multi_newton_omp.h b/src/USER-OMP/npair_half_size_multi_newton_omp.h index 8f05bd908b..3f9e76adbf 100644 --- a/src/USER-OMP/npair_half_size_multi_newton_omp.h +++ b/src/USER-OMP/npair_half_size_multi_newton_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/multi/newton/omp, NPairHalfSizeMultiNewtonOmp, - NP_HALF | NP_SIZE | NP_MULTI | NP_NEWTON | NP_OMP | NP_ORTHO) - + NP_HALF | NP_SIZE | NP_MULTI | NP_NEWTON | NP_OMP | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_MULTI_NEWTON_OMP_H @@ -33,7 +33,7 @@ class NPairHalfSizeMultiNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_multi_newton_tri_omp.cpp b/src/USER-OMP/npair_half_size_multi_newton_tri_omp.cpp index 1084b8b453..b9a914078f 100644 --- a/src/USER-OMP/npair_half_size_multi_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_size_multi_newton_tri_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_size_multi_newton_tri_omp.h b/src/USER-OMP/npair_half_size_multi_newton_tri_omp.h index 4a2043fbf2..fa0b2ead6c 100644 --- a/src/USER-OMP/npair_half_size_multi_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_size_multi_newton_tri_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/multi/newton/tri/omp, NPairHalfSizeMultiNewtonTriOmp, - NP_HALF | NP_SIZE | NP_MULTI | NP_NEWTON | NP_TRI | NP_OMP) - + NP_HALF | NP_SIZE | NP_MULTI | NP_NEWTON | NP_TRI | NP_OMP); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_MULTI_NEWTON_TRI_OMP_H @@ -33,7 +33,7 @@ class NPairHalfSizeMultiNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_multi_old_newtoff_omp.cpp b/src/USER-OMP/npair_half_size_multi_old_newtoff_omp.cpp index 22128b29df..eadcde2154 100644 --- a/src/USER-OMP/npair_half_size_multi_old_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_size_multi_old_newtoff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_size_multi_old_newtoff_omp.h b/src/USER-OMP/npair_half_size_multi_old_newtoff_omp.h index af1be7fa0e..fa61e86b92 100644 --- a/src/USER-OMP/npair_half_size_multi_old_newtoff_omp.h +++ b/src/USER-OMP/npair_half_size_multi_old_newtoff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/multi/old/newtoff/omp, NPairHalfSizeMultiOldNewtoffOmp, NP_HALF | NP_SIZE | NP_MULTI_OLD | NP_NEWTOFF | NP_OMP | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_MULTI_OLD_NEWTOFF_OMP_H @@ -34,7 +34,7 @@ class NPairHalfSizeMultiOldNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_multi_old_newton_omp.cpp b/src/USER-OMP/npair_half_size_multi_old_newton_omp.cpp index 6747778dd6..eb154dce3a 100644 --- a/src/USER-OMP/npair_half_size_multi_old_newton_omp.cpp +++ b/src/USER-OMP/npair_half_size_multi_old_newton_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_size_multi_old_newton_omp.h b/src/USER-OMP/npair_half_size_multi_old_newton_omp.h index e9cd44c25c..c406e3524e 100644 --- a/src/USER-OMP/npair_half_size_multi_old_newton_omp.h +++ b/src/USER-OMP/npair_half_size_multi_old_newton_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/multi/old/newton/omp, NPairHalfSizeMultiOldNewtonOmp, - NP_HALF | NP_SIZE | NP_MULTI_OLD | NP_NEWTON | NP_OMP | NP_ORTHO) - + NP_HALF | NP_SIZE | NP_MULTI_OLD | NP_NEWTON | NP_OMP | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_MULTI_OLD_NEWTON_OMP_H @@ -33,7 +33,7 @@ class NPairHalfSizeMultiOldNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_multi_old_newton_tri_omp.cpp b/src/USER-OMP/npair_half_size_multi_old_newton_tri_omp.cpp index 73c36681f1..e67c1463f7 100644 --- a/src/USER-OMP/npair_half_size_multi_old_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_size_multi_old_newton_tri_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_size_multi_old_newton_tri_omp.h b/src/USER-OMP/npair_half_size_multi_old_newton_tri_omp.h index fccaf210f7..37156c7a43 100644 --- a/src/USER-OMP/npair_half_size_multi_old_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_size_multi_old_newton_tri_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/multi/old/newton/tri/omp, NPairHalfSizeMultiOldNewtonTriOmp, - NP_HALF | NP_SIZE | NP_MULTI_OLD | NP_NEWTON | NP_TRI | NP_OMP) - + NP_HALF | NP_SIZE | NP_MULTI_OLD | NP_NEWTON | NP_TRI | NP_OMP); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_MULTI_OLD_NEWTON_TRI_OMP_H @@ -33,7 +33,7 @@ class NPairHalfSizeMultiOldNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_nsq_newtoff_omp.cpp b/src/USER-OMP/npair_half_size_nsq_newtoff_omp.cpp index 452a17fafe..f182492efe 100644 --- a/src/USER-OMP/npair_half_size_nsq_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_size_nsq_newtoff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_size_nsq_newtoff_omp.h b/src/USER-OMP/npair_half_size_nsq_newtoff_omp.h index 0b018323a9..2d3c21aa73 100644 --- a/src/USER-OMP/npair_half_size_nsq_newtoff_omp.h +++ b/src/USER-OMP/npair_half_size_nsq_newtoff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/nsq/newtoff/omp, NPairHalfSizeNsqNewtoffOmp, NP_HALF | NP_SIZE | NP_NSQ | NP_NEWTOFF | NP_OMP | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_NSQ_NEWTOFF_OMP_H @@ -34,7 +34,7 @@ class NPairHalfSizeNsqNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_nsq_newton_omp.cpp b/src/USER-OMP/npair_half_size_nsq_newton_omp.cpp index e63c564a0e..fdea8f4468 100644 --- a/src/USER-OMP/npair_half_size_nsq_newton_omp.cpp +++ b/src/USER-OMP/npair_half_size_nsq_newton_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_half_size_nsq_newton_omp.h b/src/USER-OMP/npair_half_size_nsq_newton_omp.h index 26d22e7cf4..bb7eb3e071 100644 --- a/src/USER-OMP/npair_half_size_nsq_newton_omp.h +++ b/src/USER-OMP/npair_half_size_nsq_newton_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/nsq/newton/omp, NPairHalfSizeNsqNewtonOmp, NP_HALF | NP_SIZE | NP_NSQ | NP_NEWTON | NP_OMP | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_NSQ_NEWTON_OMP_H @@ -34,7 +34,7 @@ class NPairHalfSizeNsqNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_halffull_newtoff_omp.cpp b/src/USER-OMP/npair_halffull_newtoff_omp.cpp index 378859beff..9abbbae48f 100644 --- a/src/USER-OMP/npair_halffull_newtoff_omp.cpp +++ b/src/USER-OMP/npair_halffull_newtoff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_halffull_newtoff_omp.h b/src/USER-OMP/npair_halffull_newtoff_omp.h index 2d304f0c04..8cd7b64004 100644 --- a/src/USER-OMP/npair_halffull_newtoff_omp.h +++ b/src/USER-OMP/npair_halffull_newtoff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,16 +12,17 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(halffull/newtoff/omp, NPairHalffullNewtoffOmp, NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | NP_HALF | - NP_ORTHO | NP_TRI |NP_OMP) + NP_ORTHO | NP_TRI |NP_OMP); NPairStyle(halffull/newtoff/skip/omp, NPairHalffullNewtoffOmp, NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | NP_HALF | - NP_ORTHO | NP_TRI | NP_SKIP | NP_OMP) + NP_ORTHO | NP_TRI | NP_SKIP | NP_OMP); +// clang-format on #else #ifndef LMP_NPAIR_HALFFULL_NEWTOFF_OMP_H @@ -38,7 +39,7 @@ class NPairHalffullNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_halffull_newton_omp.cpp b/src/USER-OMP/npair_halffull_newton_omp.cpp index c9852b526f..66b4e4b3b6 100644 --- a/src/USER-OMP/npair_halffull_newton_omp.cpp +++ b/src/USER-OMP/npair_halffull_newton_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/npair_halffull_newton_omp.h b/src/USER-OMP/npair_halffull_newton_omp.h index c4abf95d6d..78ca839a43 100644 --- a/src/USER-OMP/npair_halffull_newton_omp.h +++ b/src/USER-OMP/npair_halffull_newton_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,17 +12,17 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(halffull/newton/omp, NPairHalffullNewtonOmp, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_ORTHO | NP_TRI| NP_OMP) + NP_ORTHO | NP_TRI| NP_OMP); NPairStyle(halffull/newton/skip/omp, NPairHalffullNewtonOmp, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_ORTHO | NP_TRI | NP_SKIP | NP_OMP) - + NP_ORTHO | NP_TRI | NP_SKIP | NP_OMP); +// clang-format on #else #ifndef LMP_NPAIR_HALFFULL_NEWTON_OMP_H @@ -39,7 +39,7 @@ class NPairHalffullNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_omp.h b/src/USER-OMP/npair_omp.h index bfcda382ed..b9ac9b2cc6 100644 --- a/src/USER-OMP/npair_omp.h +++ b/src/USER-OMP/npair_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,10 +19,10 @@ #endif #include "comm.h" -#include "modify.h" -#include "timer.h" #include "fix_omp.h" +#include "modify.h" #include "thr_data.h" +#include "timer.h" namespace LAMMPS_NS { @@ -30,39 +30,38 @@ namespace LAMMPS_NS { #if defined(_OPENMP) // get access to number of threads and per-thread data structures via FixOMP -#define NPAIR_OMP_INIT \ - const int nthreads = comm->nthreads; \ +#define NPAIR_OMP_INIT \ + const int nthreads = comm->nthreads; \ const int ifix = modify->find_fix("package_omp") // get thread id and then assign each thread a fixed chunk of atoms -#define NPAIR_OMP_SETUP(num) \ - { \ - const int tid = omp_get_thread_num(); \ - const int idelta = 1 + num/nthreads; \ - const int ifrom = tid*idelta; \ - const int ito = ((ifrom + idelta) > num) \ - ? num : (ifrom+idelta); \ - FixOMP *fix = static_cast(modify->fix[ifix]); \ - ThrData *thr = fix->get_thr(tid); \ +#define NPAIR_OMP_SETUP(num) \ + { \ + const int tid = omp_get_thread_num(); \ + const int idelta = 1 + num / nthreads; \ + const int ifrom = tid * idelta; \ + const int ito = ((ifrom + idelta) > num) ? num : (ifrom + idelta); \ + FixOMP *fix = static_cast(modify->fix[ifix]); \ + ThrData *thr = fix->get_thr(tid); \ thr->timer(Timer::START); -#define NPAIR_OMP_CLOSE \ - thr->timer(Timer::NEIGH); \ - } +#define NPAIR_OMP_CLOSE \ + thr->timer(Timer::NEIGH); \ + } #else /* !defined(_OPENMP) */ #define NPAIR_OMP_INIT -#define NPAIR_OMP_SETUP(num) \ - const int tid = 0; \ - const int ifrom = 0; \ +#define NPAIR_OMP_SETUP(num) \ + const int tid = 0; \ + const int ifrom = 0; \ const int ito = num #define NPAIR_OMP_CLOSE #endif -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-OMP/npair_skip_omp.h b/src/USER-OMP/npair_skip_omp.h index d15ba59717..fcc930dc2c 100644 --- a/src/USER-OMP/npair_skip_omp.h +++ b/src/USER-OMP/npair_skip_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -15,42 +15,42 @@ // just forward the requests to the corresponding non-omp versions. #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(skip/omp, NPairSkip, NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_OMP) + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_OMP); NPairStyle(skip/half/respa/omp, NPairSkipRespa, NP_SKIP | NP_RESPA | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_OMP) + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_OMP); NPairStyle(skip/half/size/omp, NPairSkipSize, NP_SKIP | NP_SIZE | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_OMP) + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_OMP); NPairStyle(skip/size/off2on/omp, NPairSkipSizeOff2on, NP_SKIP | NP_SIZE | NP_OFF2ON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | NP_MULTI_OLD | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_OMP) + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_OMP); NPairStyle(skip/size/off2on/oneside/omp, NPairSkipSizeOff2onOneside, NP_SKIP | NP_SIZE | NP_OFF2ON | NP_ONESIDE | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | NP_NEWTON | NP_NEWTOFF | - NP_ORTHO | NP_TRI | NP_OMP) + NP_ORTHO | NP_TRI | NP_OMP); NPairStyle(skip/ghost/omp, NPairSkip, NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_OMP | NP_GHOST) - + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_OMP | NP_GHOST); +// clang-format off #endif /* ERROR/WARNING messages: diff --git a/src/USER-OMP/pair_adp_omp.cpp b/src/USER-OMP/pair_adp_omp.cpp index bd92936ecb..2289743251 100644 --- a/src/USER-OMP/pair_adp_omp.cpp +++ b/src/USER-OMP/pair_adp_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_adp_omp.h b/src/USER-OMP/pair_adp_omp.h index de40ee2d5d..d60d004dc1 100644 --- a/src/USER-OMP/pair_adp_omp.h +++ b/src/USER-OMP/pair_adp_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(adp/omp,PairADPOMP) - +// clang-format off +PairStyle(adp/omp,PairADPOMP); +// clang-format on #else #ifndef LMP_PAIR_ADP_OMP_H @@ -39,10 +39,10 @@ class PairADPOMP : public PairADP, public ThrOMP { private: template - void eval(int iifrom, int iito, ThrData * const thr); + void eval(int iifrom, int iito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_agni_omp.cpp b/src/USER-OMP/pair_agni_omp.cpp index 258c833cdf..814845108f 100644 --- a/src/USER-OMP/pair_agni_omp.cpp +++ b/src/USER-OMP/pair_agni_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_agni_omp.h b/src/USER-OMP/pair_agni_omp.h index 506916467f..832db111d3 100644 --- a/src/USER-OMP/pair_agni_omp.h +++ b/src/USER-OMP/pair_agni_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(agni/omp,PairAGNIOMP) - +// clang-format off +PairStyle(agni/omp,PairAGNIOMP); +// clang-format on #else #ifndef LMP_PAIR_AGNI_OMP_H @@ -39,10 +39,10 @@ class PairAGNIOMP : public PairAGNI, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_airebo_morse_omp.cpp b/src/USER-OMP/pair_airebo_morse_omp.cpp index d11ced793d..965f895add 100644 --- a/src/USER-OMP/pair_airebo_morse_omp.cpp +++ b/src/USER-OMP/pair_airebo_morse_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pair_airebo_morse_omp.h b/src/USER-OMP/pair_airebo_morse_omp.h index 748ce991fa..aea460098f 100644 --- a/src/USER-OMP/pair_airebo_morse_omp.h +++ b/src/USER-OMP/pair_airebo_morse_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(airebo/morse/omp,PairAIREBOMorseOMP) - +// clang-format off +PairStyle(airebo/morse/omp,PairAIREBOMorseOMP); +// clang-format on #else #ifndef LMP_PAIR_AIREBO_MORSE_OMP_H @@ -30,7 +30,7 @@ class PairAIREBOMorseOMP : public PairAIREBOOMP { virtual void settings(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_airebo_omp.cpp b/src/USER-OMP/pair_airebo_omp.cpp index 39593c61de..2e3b35b799 100644 --- a/src/USER-OMP/pair_airebo_omp.cpp +++ b/src/USER-OMP/pair_airebo_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_airebo_omp.h b/src/USER-OMP/pair_airebo_omp.h index 75b86dae85..9c5b29545f 100644 --- a/src/USER-OMP/pair_airebo_omp.h +++ b/src/USER-OMP/pair_airebo_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov See the README file in the top-level LAMMPS directory. @@ -11,9 +11,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(airebo/omp,PairAIREBOOMP) - +// clang-format off +PairStyle(airebo/omp,PairAIREBOOMP); +// clang-format on #else #ifndef LMP_PAIR_AIREBO_OMP_H @@ -33,22 +33,20 @@ class PairAIREBOOMP : public PairAIREBO, public ThrOMP { virtual double memory_usage(); protected: - double bondorder_thr(int i, int j, double rij[3], double rijmag, - double VA, int vflag_atom, ThrData * const thr); - double bondorderLJ_thr(int i, int j, double rij[3], double rijmag, - double VA, double rij0[3], double rijmag0, - int vflag_atom, ThrData * const thr); + double bondorder_thr(int i, int j, double rij[3], double rijmag, double VA, int vflag_atom, + ThrData *const thr); + double bondorderLJ_thr(int i, int j, double rij[3], double rijmag, double VA, double rij0[3], + double rijmag0, int vflag_atom, ThrData *const thr); - void FREBO_thr(int ifrom, int ito, int evflag, int eflag, - int vflag_atom, double *pv0, ThrData * const thr); - void FLJ_thr(int ifrom, int ito, int evflag, int eflag, - int vflag_atom, double *pv1, ThrData * const thr); - void TORSION_thr(int ifrom, int ito, int evflag, int eflag, - double *pv2, ThrData * const thr); + void FREBO_thr(int ifrom, int ito, int evflag, int eflag, int vflag_atom, double *pv0, + ThrData *const thr); + void FLJ_thr(int ifrom, int ito, int evflag, int eflag, int vflag_atom, double *pv1, + ThrData *const thr); + void TORSION_thr(int ifrom, int ito, int evflag, int eflag, double *pv2, ThrData *const thr); void REBO_neigh_thr(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_beck_omp.cpp b/src/USER-OMP/pair_beck_omp.cpp index 3b592f9f45..5f9a9efa8a 100644 --- a/src/USER-OMP/pair_beck_omp.cpp +++ b/src/USER-OMP/pair_beck_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_beck_omp.h b/src/USER-OMP/pair_beck_omp.h index f1166c7c46..b21ea4dda8 100644 --- a/src/USER-OMP/pair_beck_omp.h +++ b/src/USER-OMP/pair_beck_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(beck/omp,PairBeckOMP) - +// clang-format off +PairStyle(beck/omp,PairBeckOMP); +// clang-format on #else #ifndef LMP_PAIR_BECK_OMP_H @@ -39,10 +39,10 @@ class PairBeckOMP : public PairBeck, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_born_coul_long_omp.cpp b/src/USER-OMP/pair_born_coul_long_omp.cpp index 6eba50fdb5..99851bb943 100644 --- a/src/USER-OMP/pair_born_coul_long_omp.cpp +++ b/src/USER-OMP/pair_born_coul_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_born_coul_long_omp.h b/src/USER-OMP/pair_born_coul_long_omp.h index 403cc09658..78923925b0 100644 --- a/src/USER-OMP/pair_born_coul_long_omp.h +++ b/src/USER-OMP/pair_born_coul_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/long/omp,PairBornCoulLongOMP) - +// clang-format off +PairStyle(born/coul/long/omp,PairBornCoulLongOMP); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_LONG_OMP_H @@ -39,10 +39,10 @@ class PairBornCoulLongOMP : public PairBornCoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_born_coul_msm_omp.cpp b/src/USER-OMP/pair_born_coul_msm_omp.cpp index 8bc1f7a79e..0fe1456ec7 100644 --- a/src/USER-OMP/pair_born_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_born_coul_msm_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_born_coul_msm_omp.h b/src/USER-OMP/pair_born_coul_msm_omp.h index 96262de856..71845a574d 100644 --- a/src/USER-OMP/pair_born_coul_msm_omp.h +++ b/src/USER-OMP/pair_born_coul_msm_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/msm/omp,PairBornCoulMSMOMP) - +// clang-format off +PairStyle(born/coul/msm/omp,PairBornCoulMSMOMP); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_MSM_OMP_H @@ -39,10 +39,10 @@ class PairBornCoulMSMOMP : public PairBornCoulMSM, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_born_coul_wolf_omp.cpp b/src/USER-OMP/pair_born_coul_wolf_omp.cpp index 7556522dc4..32d7830faf 100644 --- a/src/USER-OMP/pair_born_coul_wolf_omp.cpp +++ b/src/USER-OMP/pair_born_coul_wolf_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_born_coul_wolf_omp.h b/src/USER-OMP/pair_born_coul_wolf_omp.h index e7e8194383..9037fa7554 100644 --- a/src/USER-OMP/pair_born_coul_wolf_omp.h +++ b/src/USER-OMP/pair_born_coul_wolf_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/wolf/omp,PairBornCoulWolfOMP) - +// clang-format off +PairStyle(born/coul/wolf/omp,PairBornCoulWolfOMP); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_WOLF_OMP_H @@ -39,10 +39,10 @@ class PairBornCoulWolfOMP : public PairBornCoulWolf, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_born_omp.cpp b/src/USER-OMP/pair_born_omp.cpp index 4be90aa86f..ea6d64fc33 100644 --- a/src/USER-OMP/pair_born_omp.cpp +++ b/src/USER-OMP/pair_born_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_born_omp.h b/src/USER-OMP/pair_born_omp.h index e153178547..198e3148aa 100644 --- a/src/USER-OMP/pair_born_omp.h +++ b/src/USER-OMP/pair_born_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/omp,PairBornOMP) - +// clang-format off +PairStyle(born/omp,PairBornOMP); +// clang-format on #else #ifndef LMP_PAIR_BORN_OMP_H @@ -39,10 +39,10 @@ class PairBornOMP : public PairBorn, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_brownian_omp.cpp b/src/USER-OMP/pair_brownian_omp.cpp index a82b8d575c..b34b854d74 100644 --- a/src/USER-OMP/pair_brownian_omp.cpp +++ b/src/USER-OMP/pair_brownian_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_brownian_omp.h b/src/USER-OMP/pair_brownian_omp.h index 04c5185384..42ca4babc6 100644 --- a/src/USER-OMP/pair_brownian_omp.h +++ b/src/USER-OMP/pair_brownian_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(brownian/omp,PairBrownianOMP) - +// clang-format off +PairStyle(brownian/omp,PairBrownianOMP); +// clang-format on #else #ifndef LMP_PAIR_BROWNIAN_OMP_H @@ -44,10 +44,10 @@ class PairBrownianOMP : public PairBrownian, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_brownian_poly_omp.cpp b/src/USER-OMP/pair_brownian_poly_omp.cpp index 124617afab..1ccd753fbe 100644 --- a/src/USER-OMP/pair_brownian_poly_omp.cpp +++ b/src/USER-OMP/pair_brownian_poly_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_brownian_poly_omp.h b/src/USER-OMP/pair_brownian_poly_omp.h index 2e2fb2148e..1fe54e809d 100644 --- a/src/USER-OMP/pair_brownian_poly_omp.h +++ b/src/USER-OMP/pair_brownian_poly_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(brownian/poly/omp,PairBrownianPolyOMP) - +// clang-format off +PairStyle(brownian/poly/omp,PairBrownianPolyOMP); +// clang-format on #else #ifndef LMP_PAIR_BROWNIAN_POLY_OMP_H @@ -43,11 +43,10 @@ class PairBrownianPolyOMP : public PairBrownianPoly, public ThrOMP { int nthreads; private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_buck_coul_cut_omp.cpp b/src/USER-OMP/pair_buck_coul_cut_omp.cpp index 763bf62cba..0df45126bf 100644 --- a/src/USER-OMP/pair_buck_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_buck_coul_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_buck_coul_cut_omp.h b/src/USER-OMP/pair_buck_coul_cut_omp.h index eb3205d09b..163950cad7 100644 --- a/src/USER-OMP/pair_buck_coul_cut_omp.h +++ b/src/USER-OMP/pair_buck_coul_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/coul/cut/omp,PairBuckCoulCutOMP) - +// clang-format off +PairStyle(buck/coul/cut/omp,PairBuckCoulCutOMP); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_CUT_OMP_H @@ -39,10 +39,10 @@ class PairBuckCoulCutOMP : public PairBuckCoulCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_buck_coul_long_omp.cpp b/src/USER-OMP/pair_buck_coul_long_omp.cpp index 49d197961c..396b4edd3c 100644 --- a/src/USER-OMP/pair_buck_coul_long_omp.cpp +++ b/src/USER-OMP/pair_buck_coul_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_buck_coul_long_omp.h b/src/USER-OMP/pair_buck_coul_long_omp.h index 6792064aac..7f55db80c1 100644 --- a/src/USER-OMP/pair_buck_coul_long_omp.h +++ b/src/USER-OMP/pair_buck_coul_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/coul/long/omp,PairBuckCoulLongOMP) - +// clang-format off +PairStyle(buck/coul/long/omp,PairBuckCoulLongOMP); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_LONG_OMP_H @@ -39,10 +39,10 @@ class PairBuckCoulLongOMP : public PairBuckCoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_buck_coul_msm_omp.cpp b/src/USER-OMP/pair_buck_coul_msm_omp.cpp index 284f95833e..6442f45eac 100644 --- a/src/USER-OMP/pair_buck_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_buck_coul_msm_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_buck_coul_msm_omp.h b/src/USER-OMP/pair_buck_coul_msm_omp.h index 56a89b8a23..8377bb2077 100644 --- a/src/USER-OMP/pair_buck_coul_msm_omp.h +++ b/src/USER-OMP/pair_buck_coul_msm_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/coul/msm/omp,PairBuckCoulMSMOMP) - +// clang-format off +PairStyle(buck/coul/msm/omp,PairBuckCoulMSMOMP); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_MSM_OMP_H @@ -39,10 +39,10 @@ class PairBuckCoulMSMOMP : public PairBuckCoulMSM, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_buck_long_coul_long_omp.cpp b/src/USER-OMP/pair_buck_long_coul_long_omp.cpp index 1da7c6db60..4fd746b9a4 100644 --- a/src/USER-OMP/pair_buck_long_coul_long_omp.cpp +++ b/src/USER-OMP/pair_buck_long_coul_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pair_buck_long_coul_long_omp.h b/src/USER-OMP/pair_buck_long_coul_long_omp.h index 7359bb0630..76502fd05c 100644 --- a/src/USER-OMP/pair_buck_long_coul_long_omp.h +++ b/src/USER-OMP/pair_buck_long_coul_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/long/coul/long/omp,PairBuckLongCoulLongOMP) - +// clang-format off +PairStyle(buck/long/coul/long/omp,PairBuckLongCoulLongOMP); +// clang-format on #else #ifndef LMP_PAIR_BUCK_LONG_COUL_LONG_OMP_H @@ -36,22 +36,19 @@ class PairBuckLongCoulLongOMP : public PairBuckLongCoulLong, public ThrOMP { virtual void compute_outer(int, int); private: - template - void eval(int, int, ThrData * const); - - template - void eval_outer(int, int, ThrData * const); + template + void eval(int, int, ThrData *const); + template + void eval_outer(int, int, ThrData *const); void eval_inner(int, int, ThrData *const); void eval_middle(int, int, ThrData *const); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_buck_omp.cpp b/src/USER-OMP/pair_buck_omp.cpp index 7bddf00048..88314f912a 100644 --- a/src/USER-OMP/pair_buck_omp.cpp +++ b/src/USER-OMP/pair_buck_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_buck_omp.h b/src/USER-OMP/pair_buck_omp.h index 77c01bbc75..f57cab14bc 100644 --- a/src/USER-OMP/pair_buck_omp.h +++ b/src/USER-OMP/pair_buck_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/omp,PairBuckOMP) - +// clang-format off +PairStyle(buck/omp,PairBuckOMP); +// clang-format on #else #ifndef LMP_PAIR_BUCK_OMP_H @@ -39,10 +39,10 @@ class PairBuckOMP : public PairBuck, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_colloid_omp.cpp b/src/USER-OMP/pair_colloid_omp.cpp index ec387b019c..ecd560bb8e 100644 --- a/src/USER-OMP/pair_colloid_omp.cpp +++ b/src/USER-OMP/pair_colloid_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_colloid_omp.h b/src/USER-OMP/pair_colloid_omp.h index bd35d153c9..bcebbd4437 100644 --- a/src/USER-OMP/pair_colloid_omp.h +++ b/src/USER-OMP/pair_colloid_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(colloid/omp,PairColloidOMP) - +// clang-format off +PairStyle(colloid/omp,PairColloidOMP); +// clang-format on #else #ifndef LMP_PAIR_COLLOID_OMP_H @@ -39,10 +39,10 @@ class PairColloidOMP : public PairColloid, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_comb_omp.cpp b/src/USER-OMP/pair_comb_omp.cpp index 52c8855738..7c0c14f7e5 100644 --- a/src/USER-OMP/pair_comb_omp.cpp +++ b/src/USER-OMP/pair_comb_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_comb_omp.h b/src/USER-OMP/pair_comb_omp.h index ebd5ed0a97..69adc2fe3e 100644 --- a/src/USER-OMP/pair_comb_omp.h +++ b/src/USER-OMP/pair_comb_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov See the README file in the top-level LAMMPS directory. @@ -11,9 +11,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(comb/omp,PairCombOMP) - +// clang-format off +PairStyle(comb/omp,PairCombOMP); +// clang-format on #else #ifndef LMP_PAIR_COMB_OMP_H @@ -36,12 +36,12 @@ class PairCombOMP : public PairComb, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); void Short_neigh_thr(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_cut_global_omp.cpp b/src/USER-OMP/pair_coul_cut_global_omp.cpp index 36fee39fc8..7305f9c025 100644 --- a/src/USER-OMP/pair_coul_cut_global_omp.cpp +++ b/src/USER-OMP/pair_coul_cut_global_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pair_coul_cut_global_omp.h b/src/USER-OMP/pair_coul_cut_global_omp.h index 7662dbbc9f..118b769e0b 100644 --- a/src/USER-OMP/pair_coul_cut_global_omp.h +++ b/src/USER-OMP/pair_coul_cut_global_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/cut/global/omp,PairCoulCutGlobalOMP) - +// clang-format off +PairStyle(coul/cut/global/omp,PairCoulCutGlobalOMP); +// clang-format on #else #ifndef LMP_PAIR_COUL_CUT_GLOBAL_OMP_H @@ -31,7 +31,7 @@ class PairCoulCutGlobalOMP : public PairCoulCutOMP { void *extract(const char *, int &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_cut_omp.cpp b/src/USER-OMP/pair_coul_cut_omp.cpp index 6f8ac34a2d..c1d672e637 100644 --- a/src/USER-OMP/pair_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_coul_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_coul_cut_omp.h b/src/USER-OMP/pair_coul_cut_omp.h index 6708b3ff8c..1cfad1f91a 100644 --- a/src/USER-OMP/pair_coul_cut_omp.h +++ b/src/USER-OMP/pair_coul_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/cut/omp,PairCoulCutOMP) - +// clang-format off +PairStyle(coul/cut/omp,PairCoulCutOMP); +// clang-format on #else #ifndef LMP_PAIR_COUL_CUT_OMP_H @@ -39,10 +39,10 @@ class PairCoulCutOMP : public PairCoulCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_cut_soft_omp.cpp b/src/USER-OMP/pair_coul_cut_soft_omp.cpp index c4cc6e03b0..d5669b200a 100644 --- a/src/USER-OMP/pair_coul_cut_soft_omp.cpp +++ b/src/USER-OMP/pair_coul_cut_soft_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_coul_cut_soft_omp.h b/src/USER-OMP/pair_coul_cut_soft_omp.h index 2c806170c0..54bcc58efd 100644 --- a/src/USER-OMP/pair_coul_cut_soft_omp.h +++ b/src/USER-OMP/pair_coul_cut_soft_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/cut/soft/omp,PairCoulCutSoftOMP) - +// clang-format off +PairStyle(coul/cut/soft/omp,PairCoulCutSoftOMP); +// clang-format on #else #ifndef LMP_PAIR_COUL_CUT_SOFT_OMP_H @@ -39,10 +39,10 @@ class PairCoulCutSoftOMP : public PairCoulCutSoft, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_debye_omp.cpp b/src/USER-OMP/pair_coul_debye_omp.cpp index 7e21007d5e..757b7ec66e 100644 --- a/src/USER-OMP/pair_coul_debye_omp.cpp +++ b/src/USER-OMP/pair_coul_debye_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_coul_debye_omp.h b/src/USER-OMP/pair_coul_debye_omp.h index 669e13b6a7..f993c6bafd 100644 --- a/src/USER-OMP/pair_coul_debye_omp.h +++ b/src/USER-OMP/pair_coul_debye_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/debye/omp,PairCoulDebyeOMP) - +// clang-format off +PairStyle(coul/debye/omp,PairCoulDebyeOMP); +// clang-format on #else #ifndef LMP_PAIR_COUL_DEBYE_OMP_H @@ -39,10 +39,10 @@ class PairCoulDebyeOMP : public PairCoulDebye, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_diel_omp.cpp b/src/USER-OMP/pair_coul_diel_omp.cpp index 32807d9a6d..be2f771e67 100644 --- a/src/USER-OMP/pair_coul_diel_omp.cpp +++ b/src/USER-OMP/pair_coul_diel_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_coul_diel_omp.h b/src/USER-OMP/pair_coul_diel_omp.h index 53ab03d0e0..5a86469056 100644 --- a/src/USER-OMP/pair_coul_diel_omp.h +++ b/src/USER-OMP/pair_coul_diel_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/diel/omp,PairCoulDielOMP) - +// clang-format off +PairStyle(coul/diel/omp,PairCoulDielOMP); +// clang-format on #else #ifndef LMP_PAIR_COUL_DIEL_OMP_H @@ -39,10 +39,10 @@ class PairCoulDielOMP : public PairCoulDiel, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_dsf_omp.cpp b/src/USER-OMP/pair_coul_dsf_omp.cpp index 24fdb3e27b..6df673ee80 100644 --- a/src/USER-OMP/pair_coul_dsf_omp.cpp +++ b/src/USER-OMP/pair_coul_dsf_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_coul_dsf_omp.h b/src/USER-OMP/pair_coul_dsf_omp.h index 99b34ac6d3..1ad36b5c39 100644 --- a/src/USER-OMP/pair_coul_dsf_omp.h +++ b/src/USER-OMP/pair_coul_dsf_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/dsf/omp,PairCoulDSFOMP) - +// clang-format off +PairStyle(coul/dsf/omp,PairCoulDSFOMP); +// clang-format on #else #ifndef LMP_PAIR_COUL_DSF_OMP_H @@ -39,10 +39,10 @@ class PairCoulDSFOMP : public PairCoulDSF, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_long_omp.cpp b/src/USER-OMP/pair_coul_long_omp.cpp index 1f118a33b4..9c15243f87 100644 --- a/src/USER-OMP/pair_coul_long_omp.cpp +++ b/src/USER-OMP/pair_coul_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_coul_long_omp.h b/src/USER-OMP/pair_coul_long_omp.h index 7f0f08eca3..80cfa8e601 100644 --- a/src/USER-OMP/pair_coul_long_omp.h +++ b/src/USER-OMP/pair_coul_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/long/omp,PairCoulLongOMP) - +// clang-format off +PairStyle(coul/long/omp,PairCoulLongOMP); +// clang-format on #else #ifndef LMP_PAIR_COUL_LONG_OMP_H @@ -39,10 +39,10 @@ class PairCoulLongOMP : public PairCoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_long_soft_omp.cpp b/src/USER-OMP/pair_coul_long_soft_omp.cpp index 412e8c488e..0c31d8020e 100644 --- a/src/USER-OMP/pair_coul_long_soft_omp.cpp +++ b/src/USER-OMP/pair_coul_long_soft_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_coul_long_soft_omp.h b/src/USER-OMP/pair_coul_long_soft_omp.h index 07ae676805..e4cb6cdadb 100644 --- a/src/USER-OMP/pair_coul_long_soft_omp.h +++ b/src/USER-OMP/pair_coul_long_soft_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/long/soft/omp,PairCoulLongSoftOMP) - +// clang-format off +PairStyle(coul/long/soft/omp,PairCoulLongSoftOMP); +// clang-format on #else #ifndef LMP_PAIR_COUL_LONG_SOFT_OMP_H @@ -39,10 +39,10 @@ class PairCoulLongSoftOMP : public PairCoulLongSoft, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_msm_omp.cpp b/src/USER-OMP/pair_coul_msm_omp.cpp index 25c86719be..5165797fd6 100644 --- a/src/USER-OMP/pair_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_coul_msm_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_coul_msm_omp.h b/src/USER-OMP/pair_coul_msm_omp.h index acd369820e..4780567b4a 100644 --- a/src/USER-OMP/pair_coul_msm_omp.h +++ b/src/USER-OMP/pair_coul_msm_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/msm/omp,PairCoulMSMOMP) - +// clang-format off +PairStyle(coul/msm/omp,PairCoulMSMOMP); +// clang-format on #else #ifndef LMP_PAIR_COUL_MSM_OMP_H @@ -39,10 +39,10 @@ class PairCoulMSMOMP : public PairCoulMSM, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_wolf_omp.cpp b/src/USER-OMP/pair_coul_wolf_omp.cpp index 6114e56a3e..99d320353d 100644 --- a/src/USER-OMP/pair_coul_wolf_omp.cpp +++ b/src/USER-OMP/pair_coul_wolf_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_coul_wolf_omp.h b/src/USER-OMP/pair_coul_wolf_omp.h index 2d5508eca4..09bec2e39c 100644 --- a/src/USER-OMP/pair_coul_wolf_omp.h +++ b/src/USER-OMP/pair_coul_wolf_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/wolf/omp,PairCoulWolfOMP) - +// clang-format off +PairStyle(coul/wolf/omp,PairCoulWolfOMP); +// clang-format on #else #ifndef LMP_PAIR_COUL_WOLF_OMP_H @@ -39,10 +39,10 @@ class PairCoulWolfOMP : public PairCoulWolf, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_dpd_omp.cpp b/src/USER-OMP/pair_dpd_omp.cpp index 97a3c5c647..db03581762 100644 --- a/src/USER-OMP/pair_dpd_omp.cpp +++ b/src/USER-OMP/pair_dpd_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_dpd_omp.h b/src/USER-OMP/pair_dpd_omp.h index d39189eeec..73f80eff03 100644 --- a/src/USER-OMP/pair_dpd_omp.h +++ b/src/USER-OMP/pair_dpd_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dpd/omp,PairDPDOMP) - +// clang-format off +PairStyle(dpd/omp,PairDPDOMP); +// clang-format on #else #ifndef LMP_PAIR_DPD_OMP_H @@ -44,10 +44,10 @@ class PairDPDOMP : public PairDPD, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_dpd_tstat_omp.cpp b/src/USER-OMP/pair_dpd_tstat_omp.cpp index 5e1b145494..8a329321a8 100644 --- a/src/USER-OMP/pair_dpd_tstat_omp.cpp +++ b/src/USER-OMP/pair_dpd_tstat_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_dpd_tstat_omp.h b/src/USER-OMP/pair_dpd_tstat_omp.h index 5bea953378..79c928075a 100644 --- a/src/USER-OMP/pair_dpd_tstat_omp.h +++ b/src/USER-OMP/pair_dpd_tstat_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dpd/tstat/omp,PairDPDTstatOMP) - +// clang-format off +PairStyle(dpd/tstat/omp,PairDPDTstatOMP); +// clang-format on #else #ifndef LMP_PAIR_DPD_TSTAT_OMP_H @@ -44,10 +44,10 @@ class PairDPDTstatOMP : public PairDPDTstat, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_eam_alloy_omp.cpp b/src/USER-OMP/pair_eam_alloy_omp.cpp index 37cc1aa6f1..814533c9f8 100644 --- a/src/USER-OMP/pair_eam_alloy_omp.cpp +++ b/src/USER-OMP/pair_eam_alloy_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pair_eam_alloy_omp.h b/src/USER-OMP/pair_eam_alloy_omp.h index 282c94878c..d51b9698fc 100644 --- a/src/USER-OMP/pair_eam_alloy_omp.h +++ b/src/USER-OMP/pair_eam_alloy_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/alloy/omp,PairEAMAlloyOMP) - +// clang-format off +PairStyle(eam/alloy/omp,PairEAMAlloyOMP); +// clang-format on #else #ifndef LMP_PAIR_EAM_ALLOY_OMP_H @@ -37,7 +37,7 @@ class PairEAMAlloyOMP : virtual public PairEAMOMP { void file2array(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_eam_fs_omp.cpp b/src/USER-OMP/pair_eam_fs_omp.cpp index 41a2a2eeba..395b79701a 100644 --- a/src/USER-OMP/pair_eam_fs_omp.cpp +++ b/src/USER-OMP/pair_eam_fs_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pair_eam_fs_omp.h b/src/USER-OMP/pair_eam_fs_omp.h index 5560c113dd..6455cbbd17 100644 --- a/src/USER-OMP/pair_eam_fs_omp.h +++ b/src/USER-OMP/pair_eam_fs_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/fs/omp,PairEAMFSOMP) - +// clang-format off +PairStyle(eam/fs/omp,PairEAMFSOMP); +// clang-format on #else #ifndef LMP_PAIR_EAM_FS_OMP_H @@ -37,7 +37,7 @@ class PairEAMFSOMP : virtual public PairEAMOMP { void file2array(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_eam_omp.cpp b/src/USER-OMP/pair_eam_omp.cpp index bf4d9f778f..6b4a3f79b2 100644 --- a/src/USER-OMP/pair_eam_omp.cpp +++ b/src/USER-OMP/pair_eam_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_eam_omp.h b/src/USER-OMP/pair_eam_omp.h index 46630a82c9..14531f0105 100644 --- a/src/USER-OMP/pair_eam_omp.h +++ b/src/USER-OMP/pair_eam_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eam/omp,PairEAMOMP) - +// clang-format off +PairStyle(eam/omp,PairEAMOMP); +// clang-format on #else #ifndef LMP_PAIR_EAM_OMP_H @@ -39,10 +39,10 @@ class PairEAMOMP : public PairEAM, public ThrOMP { private: template - void eval(int iifrom, int iito, ThrData * const thr); + void eval(int iifrom, int iito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_edip_omp.cpp b/src/USER-OMP/pair_edip_omp.cpp index b2e8708305..a23764f959 100644 --- a/src/USER-OMP/pair_edip_omp.cpp +++ b/src/USER-OMP/pair_edip_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_edip_omp.h b/src/USER-OMP/pair_edip_omp.h index 512c0d33af..a3b99ec46e 100644 --- a/src/USER-OMP/pair_edip_omp.h +++ b/src/USER-OMP/pair_edip_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov See the README file in the top-level LAMMPS directory. @@ -11,9 +11,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(edip/omp,PairEDIPOMP) - +// clang-format off +PairStyle(edip/omp,PairEDIPOMP); +// clang-format on #else #ifndef LMP_PAIR_EDIP_OMP_H @@ -34,10 +34,10 @@ class PairEDIPOMP : public PairEDIP, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_eim_omp.cpp b/src/USER-OMP/pair_eim_omp.cpp index ab5cfcde72..1d6261e889 100644 --- a/src/USER-OMP/pair_eim_omp.cpp +++ b/src/USER-OMP/pair_eim_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_eim_omp.h b/src/USER-OMP/pair_eim_omp.h index 737ac53cb7..8242c2d141 100644 --- a/src/USER-OMP/pair_eim_omp.h +++ b/src/USER-OMP/pair_eim_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(eim/omp,PairEIMOMP) - +// clang-format off +PairStyle(eim/omp,PairEIMOMP); +// clang-format on #else #ifndef LMP_PAIR_EIM_OMP_H @@ -39,10 +39,10 @@ class PairEIMOMP : public PairEIM, public ThrOMP { private: template - void eval(int iifrom, int iito, ThrData * const thr); + void eval(int iifrom, int iito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_gauss_cut_omp.cpp b/src/USER-OMP/pair_gauss_cut_omp.cpp index 3440dc7392..a36cb7c981 100644 --- a/src/USER-OMP/pair_gauss_cut_omp.cpp +++ b/src/USER-OMP/pair_gauss_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_gauss_cut_omp.h b/src/USER-OMP/pair_gauss_cut_omp.h index 7bf96f4530..d59daf3c3b 100644 --- a/src/USER-OMP/pair_gauss_cut_omp.h +++ b/src/USER-OMP/pair_gauss_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gauss/cut/omp,PairGaussCutOMP) - +// clang-format off +PairStyle(gauss/cut/omp,PairGaussCutOMP); +// clang-format on #else #ifndef LMP_PAIR_GAUSS_CUT_OMP_H @@ -39,10 +39,10 @@ class PairGaussCutOMP : public PairGaussCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_gauss_omp.cpp b/src/USER-OMP/pair_gauss_omp.cpp index e0c5ce5b01..eb8630d12c 100644 --- a/src/USER-OMP/pair_gauss_omp.cpp +++ b/src/USER-OMP/pair_gauss_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_gauss_omp.h b/src/USER-OMP/pair_gauss_omp.h index 0b60e7f019..ec5ca92f70 100644 --- a/src/USER-OMP/pair_gauss_omp.h +++ b/src/USER-OMP/pair_gauss_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gauss/omp,PairGaussOMP) - +// clang-format off +PairStyle(gauss/omp,PairGaussOMP); +// clang-format on #else #ifndef LMP_PAIR_GAUSS_OMP_H @@ -39,10 +39,10 @@ class PairGaussOMP : public PairGauss, public ThrOMP { private: template - double eval(int ifrom, int ito, ThrData * const thr); + double eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_gayberne_omp.cpp b/src/USER-OMP/pair_gayberne_omp.cpp index ac1c52f525..2476243305 100644 --- a/src/USER-OMP/pair_gayberne_omp.cpp +++ b/src/USER-OMP/pair_gayberne_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_gayberne_omp.h b/src/USER-OMP/pair_gayberne_omp.h index ef6dfb1d8c..89d5f22023 100644 --- a/src/USER-OMP/pair_gayberne_omp.h +++ b/src/USER-OMP/pair_gayberne_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gayberne/omp,PairGayBerneOMP) - +// clang-format off +PairStyle(gayberne/omp,PairGayBerneOMP); +// clang-format on #else #ifndef LMP_PAIR_GAYBERNE_OMP_H @@ -39,10 +39,10 @@ class PairGayBerneOMP : public PairGayBerne, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_gran_hertz_history_omp.cpp b/src/USER-OMP/pair_gran_hertz_history_omp.cpp index 200075a316..34999c5c1d 100644 --- a/src/USER-OMP/pair_gran_hertz_history_omp.cpp +++ b/src/USER-OMP/pair_gran_hertz_history_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_gran_hertz_history_omp.h b/src/USER-OMP/pair_gran_hertz_history_omp.h index dd3dd62114..029d37c6f8 100644 --- a/src/USER-OMP/pair_gran_hertz_history_omp.h +++ b/src/USER-OMP/pair_gran_hertz_history_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gran/hertz/history/omp,PairGranHertzHistoryOMP) - +// clang-format off +PairStyle(gran/hertz/history/omp,PairGranHertzHistoryOMP); +// clang-format on #else #ifndef LMP_PAIR_GRAN_HERTZ_HISTORY_OMP_H @@ -39,10 +39,10 @@ class PairGranHertzHistoryOMP : public PairGranHertzHistory, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_gran_hooke_history_omp.cpp b/src/USER-OMP/pair_gran_hooke_history_omp.cpp index 0ba9607bd9..1ff68b3093 100644 --- a/src/USER-OMP/pair_gran_hooke_history_omp.cpp +++ b/src/USER-OMP/pair_gran_hooke_history_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_gran_hooke_history_omp.h b/src/USER-OMP/pair_gran_hooke_history_omp.h index 9b114c3c1e..3f0dd1d503 100644 --- a/src/USER-OMP/pair_gran_hooke_history_omp.h +++ b/src/USER-OMP/pair_gran_hooke_history_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gran/hooke/history/omp,PairGranHookeHistoryOMP) - +// clang-format off +PairStyle(gran/hooke/history/omp,PairGranHookeHistoryOMP); +// clang-format on #else #ifndef LMP_PAIR_GRAN_HOOKE_HISTORY_OMP_H @@ -39,10 +39,10 @@ class PairGranHookeHistoryOMP : public PairGranHookeHistory, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_gran_hooke_omp.cpp b/src/USER-OMP/pair_gran_hooke_omp.cpp index 451b074fa9..067b64ff55 100644 --- a/src/USER-OMP/pair_gran_hooke_omp.cpp +++ b/src/USER-OMP/pair_gran_hooke_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_gran_hooke_omp.h b/src/USER-OMP/pair_gran_hooke_omp.h index 6210314004..158b128558 100644 --- a/src/USER-OMP/pair_gran_hooke_omp.h +++ b/src/USER-OMP/pair_gran_hooke_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gran/hooke/omp,PairGranHookeOMP) - +// clang-format off +PairStyle(gran/hooke/omp,PairGranHookeOMP); +// clang-format on #else #ifndef LMP_PAIR_GRAN_HOOKE_OMP_H @@ -38,11 +38,10 @@ class PairGranHookeOMP : public PairGranHooke, public ThrOMP { virtual double memory_usage(); private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp index 9abc0c236e..6d2fc10a3a 100644 --- a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_hbond_dreiding_lj_omp.h b/src/USER-OMP/pair_hbond_dreiding_lj_omp.h index 47e73dd889..b3a97c59db 100644 --- a/src/USER-OMP/pair_hbond_dreiding_lj_omp.h +++ b/src/USER-OMP/pair_hbond_dreiding_lj_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(hbond/dreiding/lj/omp,PairHbondDreidingLJOMP) - +// clang-format off +PairStyle(hbond/dreiding/lj/omp,PairHbondDreidingLJOMP); +// clang-format on #else #ifndef LMP_PAIR_HBOND_DREIDING_LJ_OMP_H @@ -43,10 +43,10 @@ class PairHbondDreidingLJOMP : public PairHbondDreidingLJ, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp index 1cc416219d..badefcd985 100644 --- a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_hbond_dreiding_morse_omp.h b/src/USER-OMP/pair_hbond_dreiding_morse_omp.h index 5db8419de5..44b0671087 100644 --- a/src/USER-OMP/pair_hbond_dreiding_morse_omp.h +++ b/src/USER-OMP/pair_hbond_dreiding_morse_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(hbond/dreiding/morse/omp,PairHbondDreidingMorseOMP) - +// clang-format off +PairStyle(hbond/dreiding/morse/omp,PairHbondDreidingMorseOMP); +// clang-format on #else #ifndef LMP_PAIR_HBOND_DREIDING_MORSE_OMP_H @@ -43,10 +43,10 @@ class PairHbondDreidingMorseOMP : public PairHbondDreidingMorse, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj96_cut_omp.cpp b/src/USER-OMP/pair_lj96_cut_omp.cpp index 4a3cbf535c..177edcd00f 100644 --- a/src/USER-OMP/pair_lj96_cut_omp.cpp +++ b/src/USER-OMP/pair_lj96_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj96_cut_omp.h b/src/USER-OMP/pair_lj96_cut_omp.h index 7061def774..de2460c99f 100644 --- a/src/USER-OMP/pair_lj96_cut_omp.h +++ b/src/USER-OMP/pair_lj96_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj96/cut/omp,PairLJ96CutOMP) - +// clang-format off +PairStyle(lj96/cut/omp,PairLJ96CutOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ96_CUT_OMP_H @@ -39,10 +39,10 @@ class PairLJ96CutOMP : public PairLJ96Cut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp index 50aae36596..8f7152b97d 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h index ce5eda3b24..e3b8d40d18 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h +++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/charmm/implicit/omp,PairLJCharmmCoulCharmmImplicitOMP) - +// clang-format off +PairStyle(lj/charmm/coul/charmm/implicit/omp,PairLJCharmmCoulCharmmImplicitOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_CHARMM_IMPLICIT_OMP_H @@ -39,10 +39,10 @@ class PairLJCharmmCoulCharmmImplicitOMP : public PairLJCharmmCoulCharmmImplicit, private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp index 2db3ed74c5..0ccb471760 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h index 2e2275fa8c..83d1e8bdc1 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h +++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/charmm/omp,PairLJCharmmCoulCharmmOMP) - +// clang-format off +PairStyle(lj/charmm/coul/charmm/omp,PairLJCharmmCoulCharmmOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_CHARMM_OMP_H @@ -39,10 +39,10 @@ class PairLJCharmmCoulCharmmOMP : public PairLJCharmmCoulCharmm, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp index 60eea32115..5fabdf7b1a 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_omp.h b/src/USER-OMP/pair_lj_charmm_coul_long_omp.h index b0e09c55eb..c507c5e29e 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_long_omp.h +++ b/src/USER-OMP/pair_lj_charmm_coul_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/long/omp,PairLJCharmmCoulLongOMP) - +// clang-format off +PairStyle(lj/charmm/coul/long/omp,PairLJCharmmCoulLongOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_OMP_H @@ -39,10 +39,10 @@ class PairLJCharmmCoulLongOMP : public PairLJCharmmCoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp index d7dd868b67..7f65e405f2 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.h b/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.h index b12e46d3a9..757ddb689d 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.h +++ b/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/long/soft/omp,PairLJCharmmCoulLongSoftOMP) - +// clang-format off +PairStyle(lj/charmm/coul/long/soft/omp,PairLJCharmmCoulLongSoftOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_SOFT_OMP_H @@ -39,10 +39,10 @@ class PairLJCharmmCoulLongSoftOMP : public PairLJCharmmCoulLongSoft, public ThrO private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp index 84f7fb84b5..ee46f92e31 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_charmm_coul_msm_omp.h b/src/USER-OMP/pair_lj_charmm_coul_msm_omp.h index e3ebf6c8fc..08f109e53e 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_msm_omp.h +++ b/src/USER-OMP/pair_lj_charmm_coul_msm_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/charmm/coul/msm/omp,PairLJCharmmCoulMSMOMP) - +// clang-format off +PairStyle(lj/charmm/coul/msm/omp,PairLJCharmmCoulMSMOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CHARMM_COUL_MSM_OMP_H @@ -39,10 +39,10 @@ class PairLJCharmmCoulMSMOMP : public PairLJCharmmCoulMSM, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp b/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp index 575d441a0e..1fc2abf8ba 100644 --- a/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_class2_coul_cut_omp.h b/src/USER-OMP/pair_lj_class2_coul_cut_omp.h index 0beb5db2d1..dbd9b77799 100644 --- a/src/USER-OMP/pair_lj_class2_coul_cut_omp.h +++ b/src/USER-OMP/pair_lj_class2_coul_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/coul/cut/omp,PairLJClass2CoulCutOMP) - +// clang-format off +PairStyle(lj/class2/coul/cut/omp,PairLJClass2CoulCutOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_COUL_CUT_OMP_H @@ -39,10 +39,10 @@ class PairLJClass2CoulCutOMP : public PairLJClass2CoulCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp b/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp index cc88720c8d..01115c6cb2 100644 --- a/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_class2_coul_long_omp.h b/src/USER-OMP/pair_lj_class2_coul_long_omp.h index 87221ac58b..2db5dc9642 100644 --- a/src/USER-OMP/pair_lj_class2_coul_long_omp.h +++ b/src/USER-OMP/pair_lj_class2_coul_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/coul/long/omp,PairLJClass2CoulLongOMP) - +// clang-format off +PairStyle(lj/class2/coul/long/omp,PairLJClass2CoulLongOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_COUL_LONG_OMP_H @@ -39,10 +39,10 @@ class PairLJClass2CoulLongOMP : public PairLJClass2CoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_class2_omp.cpp b/src/USER-OMP/pair_lj_class2_omp.cpp index 2de2fef774..758cd8fae0 100644 --- a/src/USER-OMP/pair_lj_class2_omp.cpp +++ b/src/USER-OMP/pair_lj_class2_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_class2_omp.h b/src/USER-OMP/pair_lj_class2_omp.h index 35b3c9529b..38e072a7f3 100644 --- a/src/USER-OMP/pair_lj_class2_omp.h +++ b/src/USER-OMP/pair_lj_class2_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/class2/omp,PairLJClass2OMP) - +// clang-format off +PairStyle(lj/class2/omp,PairLJClass2OMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CLASS2_OMP_H @@ -39,10 +39,10 @@ class PairLJClass2OMP : public PairLJClass2, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cubic_omp.cpp b/src/USER-OMP/pair_lj_cubic_omp.cpp index e96b3d0a79..e6e72096c9 100644 --- a/src/USER-OMP/pair_lj_cubic_omp.cpp +++ b/src/USER-OMP/pair_lj_cubic_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cubic_omp.h b/src/USER-OMP/pair_lj_cubic_omp.h index f305869446..a4e74d95b9 100644 --- a/src/USER-OMP/pair_lj_cubic_omp.h +++ b/src/USER-OMP/pair_lj_cubic_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cubic/omp,PairLJCubicOMP) - +// clang-format off +PairStyle(lj/cubic/omp,PairLJCubicOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUBIC_OMP_H @@ -39,10 +39,10 @@ class PairLJCubicOMP : public PairLJCubic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp index 099513771b..e86bd88936 100644 --- a/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_omp.h b/src/USER-OMP/pair_lj_cut_coul_cut_omp.h index 9f4ccac03e..36a35b112e 100644 --- a/src/USER-OMP/pair_lj_cut_coul_cut_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/cut/omp,PairLJCutCoulCutOMP) - +// clang-format off +PairStyle(lj/cut/coul/cut/omp,PairLJCutCoulCutOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_CUT_OMP_H @@ -39,10 +39,10 @@ class PairLJCutCoulCutOMP : public PairLJCutCoulCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp index a060595cf9..b44d56d6f3 100644 --- a/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.h b/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.h index 8a6f443436..bc25b7e18a 100644 --- a/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/cut/soft/omp,PairLJCutCoulCutSoftOMP) - +// clang-format off +PairStyle(lj/cut/coul/cut/soft/omp,PairLJCutCoulCutSoftOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_CUT_SOFT_OMP_H @@ -39,10 +39,10 @@ class PairLJCutCoulCutSoftOMP : public PairLJCutCoulCutSoft, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp index 1b257cc768..9996149e58 100644 --- a/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_coul_debye_omp.h b/src/USER-OMP/pair_lj_cut_coul_debye_omp.h index a2e9c5e426..8e565bdcdf 100644 --- a/src/USER-OMP/pair_lj_cut_coul_debye_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_debye_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/debye/omp,PairLJCutCoulDebyeOMP) - +// clang-format off +PairStyle(lj/cut/coul/debye/omp,PairLJCutCoulDebyeOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_DEBYE_OMP_H @@ -39,10 +39,10 @@ class PairLJCutCoulDebyeOMP : public PairLJCutCoulDebye, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp index 202b8295d3..59cd3e7467 100644 --- a/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_coul_dsf_omp.h b/src/USER-OMP/pair_lj_cut_coul_dsf_omp.h index d0c702962e..06ec6348e8 100644 --- a/src/USER-OMP/pair_lj_cut_coul_dsf_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_dsf_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/dsf/omp,PairLJCutCoulDSFOMP) - +// clang-format off +PairStyle(lj/cut/coul/dsf/omp,PairLJCutCoulDSFOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_DSF_OMP_H @@ -39,10 +39,10 @@ class PairLJCutCoulDSFOMP : public PairLJCutCoulDSF, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp index 6ccb737020..c66ccb40cc 100644 --- a/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_coul_long_omp.h b/src/USER-OMP/pair_lj_cut_coul_long_omp.h index abf7dbf755..d18ca10f8e 100644 --- a/src/USER-OMP/pair_lj_cut_coul_long_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/long/omp,PairLJCutCoulLongOMP) - +// clang-format off +PairStyle(lj/cut/coul/long/omp,PairLJCutCoulLongOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_LONG_OMP_H @@ -39,10 +39,10 @@ class PairLJCutCoulLongOMP : public PairLJCutCoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp index 4ab668109c..5911f38072 100644 --- a/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.h b/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.h index 636e050481..8ee2d3ced0 100644 --- a/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/long/soft/omp,PairLJCutCoulLongSoftOMP) - +// clang-format off +PairStyle(lj/cut/coul/long/soft/omp,PairLJCutCoulLongSoftOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_LONG_SOFT_OMP_H @@ -39,10 +39,10 @@ class PairLJCutCoulLongSoftOMP : public PairLJCutCoulLongSoft, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp index 3033b37af8..ccc92489b4 100644 --- a/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_coul_msm_omp.h b/src/USER-OMP/pair_lj_cut_coul_msm_omp.h index cb49f14163..900a975991 100644 --- a/src/USER-OMP/pair_lj_cut_coul_msm_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_msm_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/msm/omp,PairLJCutCoulMSMOMP) - +// clang-format off +PairStyle(lj/cut/coul/msm/omp,PairLJCutCoulMSMOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_MSM_OMP_H @@ -39,10 +39,10 @@ class PairLJCutCoulMSMOMP : public PairLJCutCoulMSM, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp index ffb9c122ed..5c00a88702 100644 --- a/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_coul_wolf_omp.h b/src/USER-OMP/pair_lj_cut_coul_wolf_omp.h index 744720c13a..b108769aee 100644 --- a/src/USER-OMP/pair_lj_cut_coul_wolf_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_wolf_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/wolf/omp,PairLJCutCoulWolfOMP) - +// clang-format off +PairStyle(lj/cut/coul/wolf/omp,PairLJCutCoulWolfOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_WOLF_OMP_H @@ -39,10 +39,10 @@ class PairLJCutCoulWolfOMP : public PairLJCutCoulWolf, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp index 3ec901fbf5..3da8e9f59c 100644 --- a/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_dipole_cut_omp.h b/src/USER-OMP/pair_lj_cut_dipole_cut_omp.h index 96b01aa22d..584810d1c2 100644 --- a/src/USER-OMP/pair_lj_cut_dipole_cut_omp.h +++ b/src/USER-OMP/pair_lj_cut_dipole_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/dipole/cut/omp,PairLJCutDipoleCutOMP) - +// clang-format off +PairStyle(lj/cut/dipole/cut/omp,PairLJCutDipoleCutOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_DIPOLE_CUT_OMP_H @@ -39,10 +39,10 @@ class PairLJCutDipoleCutOMP : public PairLJCutDipoleCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_omp.cpp index 8f45b05386..e62c422e15 100644 --- a/src/USER-OMP/pair_lj_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_omp.h b/src/USER-OMP/pair_lj_cut_omp.h index 6b5e4e168a..1e93a589c4 100644 --- a/src/USER-OMP/pair_lj_cut_omp.h +++ b/src/USER-OMP/pair_lj_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/omp,PairLJCutOMP) - +// clang-format off +PairStyle(lj/cut/omp,PairLJCutOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_OMP_H @@ -39,10 +39,10 @@ class PairLJCutOMP : public PairLJCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_soft_omp.cpp index 71edf2ff22..ac39009ebe 100644 --- a/src/USER-OMP/pair_lj_cut_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_soft_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_soft_omp.h b/src/USER-OMP/pair_lj_cut_soft_omp.h index 2790bd106d..8139cfb6fd 100644 --- a/src/USER-OMP/pair_lj_cut_soft_omp.h +++ b/src/USER-OMP/pair_lj_cut_soft_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/soft/omp,PairLJCutSoftOMP) - +// clang-format off +PairStyle(lj/cut/soft/omp,PairLJCutSoftOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_SOFT_OMP_H @@ -39,10 +39,10 @@ class PairLJCutSoftOMP : public PairLJCutSoft, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp b/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp index 33968f1710..e81dfbe242 100644 --- a/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pair_lj_cut_thole_long_omp.h b/src/USER-OMP/pair_lj_cut_thole_long_omp.h index 844b1b3799..9e0e56a35f 100644 --- a/src/USER-OMP/pair_lj_cut_thole_long_omp.h +++ b/src/USER-OMP/pair_lj_cut_thole_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/thole/long/omp,PairLJCutTholeLongOMP) - +// clang-format off +PairStyle(lj/cut/thole/long/omp,PairLJCutTholeLongOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_THOLE_LONG_OMP_H @@ -33,10 +33,10 @@ class PairLJCutTholeLongOMP : public PairLJCutTholeLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp index a7f4b0bc1e..3c02a5898f 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.h b/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.h index 3fc7592e73..a0700930ab 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.h +++ b/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/tip4p/cut/omp,PairLJCutTIP4PCutOMP) - +// clang-format off +PairStyle(lj/cut/tip4p/cut/omp,PairLJCutTIP4PCutOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_TIP4P_CUT_OMP_H @@ -42,12 +42,11 @@ class PairLJCutTIP4PCutOMP : public PairLJCutTIP4PCut, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template < int, int, int > void eval(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; + template void eval(int, int, ThrData *const); + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp b/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp index 5923b93a44..06858a7b52 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_tip4p_long_omp.h b/src/USER-OMP/pair_lj_cut_tip4p_long_omp.h index ba5556130c..49598158dc 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_long_omp.h +++ b/src/USER-OMP/pair_lj_cut_tip4p_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/tip4p/long/omp,PairLJCutTIP4PLongOMP) - +// clang-format off +PairStyle(lj/cut/tip4p/long/omp,PairLJCutTIP4PLongOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_TIP4P_LONG_OMP_H @@ -42,12 +42,11 @@ class PairLJCutTIP4PLongOMP : public PairLJCutTIP4PLong, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template < int, int, int, int > void eval(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; + template void eval(int, int, ThrData *const); + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp index 3f39160eb0..8ba108e3a4 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.h b/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.h index 208e9f3589..9ca41a122b 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.h +++ b/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/tip4p/long/soft/omp,PairLJCutTIP4PLongSoftOMP) - +// clang-format off +PairStyle(lj/cut/tip4p/long/soft/omp,PairLJCutTIP4PLongSoftOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_TIP4P_LONG_SOFT_OMP_H @@ -42,12 +42,11 @@ class PairLJCutTIP4PLongSoftOMP : public PairLJCutTIP4PLongSoft, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template < int, int, int > void eval(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; + template void eval(int, int, ThrData *const); + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_expand_omp.cpp b/src/USER-OMP/pair_lj_expand_omp.cpp index 914dec144a..e22c773f97 100644 --- a/src/USER-OMP/pair_lj_expand_omp.cpp +++ b/src/USER-OMP/pair_lj_expand_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_expand_omp.h b/src/USER-OMP/pair_lj_expand_omp.h index d1723fabe2..3be4b6113d 100644 --- a/src/USER-OMP/pair_lj_expand_omp.h +++ b/src/USER-OMP/pair_lj_expand_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/expand/omp,PairLJExpandOMP) - +// clang-format off +PairStyle(lj/expand/omp,PairLJExpandOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_EXPAND_OMP_H @@ -39,10 +39,10 @@ class PairLJExpandOMP : public PairLJExpand, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp index 0d9aa3039c..ad75760f2b 100644 --- a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp +++ b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h index da014d73c1..60c2d755b0 100644 --- a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h +++ b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/gromacs/coul/gromacs/omp,PairLJGromacsCoulGromacsOMP) - +// clang-format off +PairStyle(lj/gromacs/coul/gromacs/omp,PairLJGromacsCoulGromacsOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_GROMACS_COUL_GROMACS_OMP_H @@ -39,10 +39,10 @@ class PairLJGromacsCoulGromacsOMP : public PairLJGromacsCoulGromacs, public ThrO private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_gromacs_omp.cpp b/src/USER-OMP/pair_lj_gromacs_omp.cpp index c459ff3f0b..fd1001e30b 100644 --- a/src/USER-OMP/pair_lj_gromacs_omp.cpp +++ b/src/USER-OMP/pair_lj_gromacs_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_gromacs_omp.h b/src/USER-OMP/pair_lj_gromacs_omp.h index 7073f6de67..ae69bae5f5 100644 --- a/src/USER-OMP/pair_lj_gromacs_omp.h +++ b/src/USER-OMP/pair_lj_gromacs_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/gromacs/omp,PairLJGromacsOMP) - +// clang-format off +PairStyle(lj/gromacs/omp,PairLJGromacsOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_GROMACS_OMP_H @@ -39,10 +39,10 @@ class PairLJGromacsOMP : public PairLJGromacs, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_long_coul_long_omp.cpp b/src/USER-OMP/pair_lj_long_coul_long_omp.cpp index 980efb7c84..a2758c545c 100644 --- a/src/USER-OMP/pair_lj_long_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_long_coul_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_long_coul_long_omp.h b/src/USER-OMP/pair_lj_long_coul_long_omp.h index 5e410ce3c7..7ada6e7686 100644 --- a/src/USER-OMP/pair_lj_long_coul_long_omp.h +++ b/src/USER-OMP/pair_lj_long_coul_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/long/coul/long/omp,PairLJLongCoulLongOMP) - +// clang-format off +PairStyle(lj/long/coul/long/omp,PairLJLongCoulLongOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_LONG_COUL_LONG_OMP_H @@ -41,25 +41,19 @@ class PairLJLongCoulLongOMP : public PairLJLongCoulLong, public ThrOMP { virtual double memory_usage(); private: - template - void eval(int, int, ThrData * const); - - template - void eval_outer(int, int, ThrData * const); + template + void eval(int, int, ThrData *const); + template + void eval_outer(int, int, ThrData *const); void eval_inner(int, int, ThrData *const); void eval_middle(int, int, ThrData *const); - - - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp b/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp index bf8ac76740..d6068c6e7a 100644 --- a/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_long_tip4p_long_omp.h b/src/USER-OMP/pair_lj_long_tip4p_long_omp.h index 6c7eab6bc5..0399b356a4 100644 --- a/src/USER-OMP/pair_lj_long_tip4p_long_omp.h +++ b/src/USER-OMP/pair_lj_long_tip4p_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/long/tip4p/long/omp,PairLJLongTIP4PLongOMP) - +// clang-format off +PairStyle(lj/long/tip4p/long/omp,PairLJLongTIP4PLongOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_LONG_TIP4P_LONG_OMP_H @@ -45,28 +45,21 @@ class PairLJLongTIP4PLongOMP : public PairLJLongTIP4PLong, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template - void eval(int, int, ThrData * const); - - template - void eval_outer(int, int, ThrData * const); + template + void eval(int, int, ThrData *const); + template + void eval_outer(int, int, ThrData *const); void eval_inner(int, int, ThrData *const); void eval_middle(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; - - - + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_relres_omp.cpp b/src/USER-OMP/pair_lj_relres_omp.cpp index 15f1905d0e..250710cfa1 100644 --- a/src/USER-OMP/pair_lj_relres_omp.cpp +++ b/src/USER-OMP/pair_lj_relres_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_relres_omp.h b/src/USER-OMP/pair_lj_relres_omp.h index 429e27b6ca..bab35650ca 100644 --- a/src/USER-OMP/pair_lj_relres_omp.h +++ b/src/USER-OMP/pair_lj_relres_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/relres/omp,PairLJRelResOMP) - +// clang-format off +PairStyle(lj/relres/omp,PairLJRelResOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_RELRES_OMP_H @@ -39,10 +39,10 @@ class PairLJRelResOMP : public PairLJRelRes, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp b/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp index 0166520ca8..747aa88fa6 100644 --- a/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_sdk_coul_long_omp.h b/src/USER-OMP/pair_lj_sdk_coul_long_omp.h index 2ff3aa2025..7fc55ffde4 100644 --- a/src/USER-OMP/pair_lj_sdk_coul_long_omp.h +++ b/src/USER-OMP/pair_lj_sdk_coul_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/sdk/coul/long/omp,PairLJSDKCoulLongOMP) - +// clang-format off +PairStyle(lj/sdk/coul/long/omp,PairLJSDKCoulLongOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_SDK_COUL_LONG_OMP_H @@ -39,10 +39,10 @@ class PairLJSDKCoulLongOMP : public PairLJSDKCoulLong, public ThrOMP { private: template - void eval_thr(int ifrom, int ito, ThrData * const thr); + void eval_thr(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp b/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp index 0c47033637..b9e62b7bdf 100644 --- a/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_sdk_coul_msm_omp.h b/src/USER-OMP/pair_lj_sdk_coul_msm_omp.h index ad9e20d29c..d9f800b3a4 100644 --- a/src/USER-OMP/pair_lj_sdk_coul_msm_omp.h +++ b/src/USER-OMP/pair_lj_sdk_coul_msm_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/sdk/coul/msm/omp,PairLJSDKCoulMSMOMP) - +// clang-format off +PairStyle(lj/sdk/coul/msm/omp,PairLJSDKCoulMSMOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_SDK_COUL_MSM_OMP_H @@ -39,10 +39,10 @@ class PairLJSDKCoulMSMOMP : public PairLJSDKCoulMSM, public ThrOMP { private: template - void eval_msm_thr(int ifrom, int ito, ThrData * const thr); + void eval_msm_thr(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_sdk_omp.cpp b/src/USER-OMP/pair_lj_sdk_omp.cpp index e6bd564a2c..05a7bac568 100644 --- a/src/USER-OMP/pair_lj_sdk_omp.cpp +++ b/src/USER-OMP/pair_lj_sdk_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_sdk_omp.h b/src/USER-OMP/pair_lj_sdk_omp.h index b9186d3e78..ebd262f333 100644 --- a/src/USER-OMP/pair_lj_sdk_omp.h +++ b/src/USER-OMP/pair_lj_sdk_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/sdk/omp,PairLJSDKOMP) - +// clang-format off +PairStyle(lj/sdk/omp,PairLJSDKOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_SDK_OMP_H @@ -39,10 +39,10 @@ class PairLJSDKOMP : public PairLJSDK, public ThrOMP { private: template - void eval_thr(int ifrom, int ito, ThrData * const thr); + void eval_thr(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp b/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp index a890a1d568..70ce7e5a23 100644 --- a/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp +++ b/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_sf_dipole_sf_omp.h b/src/USER-OMP/pair_lj_sf_dipole_sf_omp.h index 46bbafccd2..fd57a466b0 100644 --- a/src/USER-OMP/pair_lj_sf_dipole_sf_omp.h +++ b/src/USER-OMP/pair_lj_sf_dipole_sf_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/sf/dipole/sf/omp,PairLJSFDipoleSFOMP) - +// clang-format off +PairStyle(lj/sf/dipole/sf/omp,PairLJSFDipoleSFOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_SF_DIPOLE_SF_OMP_H @@ -39,10 +39,10 @@ class PairLJSFDipoleSFOMP : public PairLJSFDipoleSF, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_smooth_linear_omp.cpp b/src/USER-OMP/pair_lj_smooth_linear_omp.cpp index aa823ec1ea..21589a7480 100644 --- a/src/USER-OMP/pair_lj_smooth_linear_omp.cpp +++ b/src/USER-OMP/pair_lj_smooth_linear_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_smooth_linear_omp.h b/src/USER-OMP/pair_lj_smooth_linear_omp.h index b63e4e5d8f..e39362f6f7 100644 --- a/src/USER-OMP/pair_lj_smooth_linear_omp.h +++ b/src/USER-OMP/pair_lj_smooth_linear_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,10 +16,10 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/smooth/linear/omp,PairLJSmoothLinearOMP) -PairStyle(lj/sf/omp,PairLJSmoothLinearOMP) - +// clang-format off +PairStyle(lj/smooth/linear/omp,PairLJSmoothLinearOMP); +PairStyle(lj/sf/omp,PairLJSmoothLinearOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_SMOOTH_LINEAR_OMP_H @@ -40,10 +40,10 @@ class PairLJSmoothLinearOMP : public PairLJSmoothLinear, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_smooth_omp.cpp b/src/USER-OMP/pair_lj_smooth_omp.cpp index b39435dfa1..6831459c7c 100644 --- a/src/USER-OMP/pair_lj_smooth_omp.cpp +++ b/src/USER-OMP/pair_lj_smooth_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lj_smooth_omp.h b/src/USER-OMP/pair_lj_smooth_omp.h index c621fd60bc..b2497aa7a5 100644 --- a/src/USER-OMP/pair_lj_smooth_omp.h +++ b/src/USER-OMP/pair_lj_smooth_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/smooth/omp,PairLJSmoothOMP) - +// clang-format off +PairStyle(lj/smooth/omp,PairLJSmoothOMP); +// clang-format on #else #ifndef LMP_PAIR_LJ_SMOOTH_OMP_H @@ -39,10 +39,10 @@ class PairLJSmoothOMP : public PairLJSmooth, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lubricate_omp.cpp b/src/USER-OMP/pair_lubricate_omp.cpp index 4291850820..0233ea5a06 100644 --- a/src/USER-OMP/pair_lubricate_omp.cpp +++ b/src/USER-OMP/pair_lubricate_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lubricate_omp.h b/src/USER-OMP/pair_lubricate_omp.h index 203c1db03b..27dbe73dd8 100644 --- a/src/USER-OMP/pair_lubricate_omp.h +++ b/src/USER-OMP/pair_lubricate_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lubricate/omp,PairLubricateOMP) - +// clang-format off +PairStyle(lubricate/omp,PairLubricateOMP); +// clang-format on #else #ifndef LMP_PAIR_LUBRICATE_OMP_H @@ -40,10 +40,10 @@ class PairLubricateOMP : public PairLubricate, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lubricate_poly_omp.cpp b/src/USER-OMP/pair_lubricate_poly_omp.cpp index 4226c96e1b..d3ad6b926c 100644 --- a/src/USER-OMP/pair_lubricate_poly_omp.cpp +++ b/src/USER-OMP/pair_lubricate_poly_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_lubricate_poly_omp.h b/src/USER-OMP/pair_lubricate_poly_omp.h index d72115fd46..7fdfed6c62 100644 --- a/src/USER-OMP/pair_lubricate_poly_omp.h +++ b/src/USER-OMP/pair_lubricate_poly_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lubricate/poly/omp,PairLubricateOMP) - +// clang-format off +PairStyle(lubricate/poly/omp,PairLubricateOMP); +// clang-format on #else #ifndef LMP_PAIR_LUBRICATE_POLY_OMP_H @@ -40,10 +40,10 @@ class PairLubricatePolyOMP : public PairLubricatePoly, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_meam_spline_omp.cpp b/src/USER-OMP/pair_meam_spline_omp.cpp index bb8ab8af7c..dff95c1d97 100644 --- a/src/USER-OMP/pair_meam_spline_omp.cpp +++ b/src/USER-OMP/pair_meam_spline_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_meam_spline_omp.h b/src/USER-OMP/pair_meam_spline_omp.h index 553b80320a..7086705320 100644 --- a/src/USER-OMP/pair_meam_spline_omp.h +++ b/src/USER-OMP/pair_meam_spline_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(meam/spline/omp,PairMEAMSplineOMP) - +// clang-format off +PairStyle(meam/spline/omp,PairMEAMSplineOMP); +// clang-format on #else #ifndef LMP_PAIR_MEAM_SPLINE_OMP_H @@ -38,11 +38,10 @@ class PairMEAMSplineOMP : public PairMEAMSpline, public ThrOMP { virtual double memory_usage(); private: - template - void eval(int iifrom, int iito, ThrData * const thr); + template void eval(int iifrom, int iito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_morse_omp.cpp b/src/USER-OMP/pair_morse_omp.cpp index a74ef5e7e3..7078ffee30 100644 --- a/src/USER-OMP/pair_morse_omp.cpp +++ b/src/USER-OMP/pair_morse_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_morse_omp.h b/src/USER-OMP/pair_morse_omp.h index b73880dd8a..e390ef1cd2 100644 --- a/src/USER-OMP/pair_morse_omp.h +++ b/src/USER-OMP/pair_morse_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(morse/omp,PairMorseOMP) - +// clang-format off +PairStyle(morse/omp,PairMorseOMP); +// clang-format on #else #ifndef LMP_PAIR_MORSE_OMP_H @@ -39,10 +39,10 @@ class PairMorseOMP : public PairMorse, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_morse_smooth_linear_omp.cpp b/src/USER-OMP/pair_morse_smooth_linear_omp.cpp index 2cc38586f2..85088dc30f 100644 --- a/src/USER-OMP/pair_morse_smooth_linear_omp.cpp +++ b/src/USER-OMP/pair_morse_smooth_linear_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_morse_smooth_linear_omp.h b/src/USER-OMP/pair_morse_smooth_linear_omp.h index 1753e69842..ed1ad5c88c 100644 --- a/src/USER-OMP/pair_morse_smooth_linear_omp.h +++ b/src/USER-OMP/pair_morse_smooth_linear_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(morse/smooth/linear/omp,PairMorseSmoothLinearOMP) - +// clang-format off +PairStyle(morse/smooth/linear/omp,PairMorseSmoothLinearOMP); +// clang-format on #else #ifndef LMP_PAIR_MORSE_SMOOTH_LINEAR_OMP_H @@ -34,10 +34,10 @@ class PairMorseSmoothLinearOMP : public PairMorseSmoothLinear, public ThrOMP { private: template - void eval( int ifrom, int ito, ThrData * const thr ); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp b/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp index e8d7ab1794..b888dbdb82 100644 --- a/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_nm_cut_coul_cut_omp.h b/src/USER-OMP/pair_nm_cut_coul_cut_omp.h index 7a073ad3f6..3d3aefb8f1 100644 --- a/src/USER-OMP/pair_nm_cut_coul_cut_omp.h +++ b/src/USER-OMP/pair_nm_cut_coul_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(nm/cut/coul/cut/omp,PairNMCutCoulCutOMP) - +// clang-format off +PairStyle(nm/cut/coul/cut/omp,PairNMCutCoulCutOMP); +// clang-format on #else #ifndef LMP_PAIR_NM_CUT_COUL_CUT_OMP_H @@ -39,10 +39,10 @@ class PairNMCutCoulCutOMP : public PairNMCutCoulCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp b/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp index 2b27dade17..bacf06a06a 100644 --- a/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp +++ b/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_nm_cut_coul_long_omp.h b/src/USER-OMP/pair_nm_cut_coul_long_omp.h index 1457ef18eb..1519af2547 100644 --- a/src/USER-OMP/pair_nm_cut_coul_long_omp.h +++ b/src/USER-OMP/pair_nm_cut_coul_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(nm/cut/coul/long/omp,PairNMCutCoulLongOMP) - +// clang-format off +PairStyle(nm/cut/coul/long/omp,PairNMCutCoulLongOMP); +// clang-format on #else #ifndef LMP_PAIR_NM_CUT_COUL_LONG_OMP_H @@ -39,10 +39,10 @@ class PairNMCutCoulLongOMP : public PairNMCutCoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_nm_cut_omp.cpp b/src/USER-OMP/pair_nm_cut_omp.cpp index fc27574ab9..6c4765023a 100644 --- a/src/USER-OMP/pair_nm_cut_omp.cpp +++ b/src/USER-OMP/pair_nm_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_nm_cut_omp.h b/src/USER-OMP/pair_nm_cut_omp.h index 5276708164..15f90dff33 100644 --- a/src/USER-OMP/pair_nm_cut_omp.h +++ b/src/USER-OMP/pair_nm_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(nm/cut/omp,PairNMCutOMP) - +// clang-format off +PairStyle(nm/cut/omp,PairNMCutOMP); +// clang-format on #else #ifndef LMP_PAIR_NM_CUT_OMP_H @@ -39,10 +39,10 @@ class PairNMCutOMP : public PairNMCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_peri_lps_omp.cpp b/src/USER-OMP/pair_peri_lps_omp.cpp index 1e1f77cf56..b88794e274 100644 --- a/src/USER-OMP/pair_peri_lps_omp.cpp +++ b/src/USER-OMP/pair_peri_lps_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_peri_lps_omp.h b/src/USER-OMP/pair_peri_lps_omp.h index 00322f95b1..4bb71bbe5f 100644 --- a/src/USER-OMP/pair_peri_lps_omp.h +++ b/src/USER-OMP/pair_peri_lps_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(peri/lps/omp,PairPeriLPSOMP) - +// clang-format off +PairStyle(peri/lps/omp,PairPeriLPSOMP); +// clang-format on #else #ifndef LMP_PAIR_PERI_LPS_OMP_H @@ -40,13 +40,12 @@ class PairPeriLPSOMP : public PairPeriLPS, public ThrOMP { protected: void compute_dilatation_thr(int ifrom, int ito); - private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_peri_pmb_omp.cpp b/src/USER-OMP/pair_peri_pmb_omp.cpp index 0063db0e06..73abf1c7e9 100644 --- a/src/USER-OMP/pair_peri_pmb_omp.cpp +++ b/src/USER-OMP/pair_peri_pmb_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_peri_pmb_omp.h b/src/USER-OMP/pair_peri_pmb_omp.h index 378926c830..e2017f841e 100644 --- a/src/USER-OMP/pair_peri_pmb_omp.h +++ b/src/USER-OMP/pair_peri_pmb_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(peri/pmb/omp,PairPeriPMBOMP) - +// clang-format off +PairStyle(peri/pmb/omp,PairPeriPMBOMP); +// clang-format on #else #ifndef LMP_PAIR_PERI_PMB_OMP_H @@ -39,10 +39,10 @@ class PairPeriPMBOMP : public PairPeriPMB, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_reaxc_omp.cpp b/src/USER-OMP/pair_reaxc_omp.cpp index d10a4573f1..8535b87dbe 100644 --- a/src/USER-OMP/pair_reaxc_omp.cpp +++ b/src/USER-OMP/pair_reaxc_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pair_reaxc_omp.h b/src/USER-OMP/pair_reaxc_omp.h index 08823489ef..895dc646af 100644 --- a/src/USER-OMP/pair_reaxc_omp.h +++ b/src/USER-OMP/pair_reaxc_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(reax/c/omp,PairReaxCOMP) - +// clang-format off +PairStyle(reax/c/omp,PairReaxCOMP); +// clang-format on #else #ifndef LMP_PAIR_REAXC_OMP_H @@ -32,47 +32,47 @@ class PairReaxCOMP : public PairReaxC, public ThrOMP { virtual void compute(int, int); virtual void init_style(); - inline FixOMP *getFixOMP() { - return fix; - }; + inline FixOMP *getFixOMP() { return fix; }; - inline void ev_setup_thr_proxy(int eflagparm, int vflagparm, int nallparm, - double *eatomparm, double **vatomparm, - double **cvatomparm, ThrData *thrparm) { - ev_setup_thr(eflagparm, vflagparm, nallparm, eatomparm, vatomparm, - cvatomparm, thrparm); + inline void ev_setup_thr_proxy(int eflagparm, int vflagparm, int nallparm, double *eatomparm, + double **vatomparm, double **cvatomparm, ThrData *thrparm) + { + ev_setup_thr(eflagparm, vflagparm, nallparm, eatomparm, vatomparm, cvatomparm, thrparm); }; // reduce per thread data as needed - inline void reduce_thr_proxy(void * const styleparm, const int eflagparm, - const int vflagparm, ThrData * const thrparm) { + inline void reduce_thr_proxy(void *const styleparm, const int eflagparm, const int vflagparm, + ThrData *const thrparm) + { reduce_thr(styleparm, eflagparm, vflagparm, thrparm); } - inline void ev_tally_thr_proxy(Pair * const pairparm, const int iparm, const int jparm, + inline void ev_tally_thr_proxy(Pair *const pairparm, const int iparm, const int jparm, const int nlocalparm, const int newton_pairparm, const double evdwlparm, const double ecoulparm, const double fpairparm, const double delxparm, const double delyparm, const double delzparm, - ThrData * const thrparm) { - ev_tally_thr(pairparm, iparm, jparm, nlocalparm, newton_pairparm, - evdwlparm, ecoulparm, fpairparm, delxparm, delyparm, delzparm, thrparm); + ThrData *const thrparm) + { + ev_tally_thr(pairparm, iparm, jparm, nlocalparm, newton_pairparm, evdwlparm, ecoulparm, + fpairparm, delxparm, delyparm, delzparm, thrparm); } - inline void ev_tally_xyz_thr_proxy(Pair * const pairparm, const int iparm, const int jparm, + inline void ev_tally_xyz_thr_proxy(Pair *const pairparm, const int iparm, const int jparm, const int nlocalparm, const int newton_pairparm, const double evdwlparm, const double ecoulparm, const double fxparm, const double fyparm, const double fzparm, const double delxparm, const double delyparm, - const double delzparm, ThrData * const thrparm) { - ev_tally_xyz_thr(pairparm, iparm, jparm, nlocalparm, newton_pairparm, - evdwlparm, ecoulparm, fxparm, fyparm, fzparm, - delxparm, delyparm, delzparm, thrparm); + const double delzparm, ThrData *const thrparm) + { + ev_tally_xyz_thr(pairparm, iparm, jparm, nlocalparm, newton_pairparm, evdwlparm, ecoulparm, + fxparm, fyparm, fzparm, delxparm, delyparm, delzparm, thrparm); } - inline void ev_tally3_thr_proxy(Pair * const pairparm,int i, int j, int k, - double evdwl, double ecoul, double *fj, double *fk, - double *drji, double *drki, ThrData * const thrparm) { + inline void ev_tally3_thr_proxy(Pair *const pairparm, int i, int j, int k, double evdwl, + double ecoul, double *fj, double *fk, double *drji, double *drki, + ThrData *const thrparm) + { ev_tally3_thr(pairparm, i, j, k, evdwl, ecoul, fj, fk, drji, drki, thrparm); } @@ -85,10 +85,10 @@ class PairReaxCOMP : public PairReaxC, public ThrOMP { virtual void FindBond(); // work array used in write_reax_lists() - int * num_nbrs_offset; + int *num_nbrs_offset; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_rebo_omp.cpp b/src/USER-OMP/pair_rebo_omp.cpp index bb7719d967..b3f964f0f1 100644 --- a/src/USER-OMP/pair_rebo_omp.cpp +++ b/src/USER-OMP/pair_rebo_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pair_rebo_omp.h b/src/USER-OMP/pair_rebo_omp.h index 0f256bb65b..5629a37318 100644 --- a/src/USER-OMP/pair_rebo_omp.h +++ b/src/USER-OMP/pair_rebo_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(rebo/omp,PairREBOOMP) - +// clang-format off +PairStyle(rebo/omp,PairREBOOMP); +// clang-format on #else #ifndef LMP_PAIR_REBO_OMP_H @@ -28,11 +28,12 @@ class PairREBOOMP : public PairAIREBOOMP { public: PairREBOOMP(class LAMMPS *); virtual void settings(int, char **); + protected: void spline_init(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_resquared_omp.cpp b/src/USER-OMP/pair_resquared_omp.cpp index 00979cc7f5..af75e8b161 100644 --- a/src/USER-OMP/pair_resquared_omp.cpp +++ b/src/USER-OMP/pair_resquared_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_resquared_omp.h b/src/USER-OMP/pair_resquared_omp.h index d06747191b..58718104ff 100644 --- a/src/USER-OMP/pair_resquared_omp.h +++ b/src/USER-OMP/pair_resquared_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(resquared/omp,PairRESquaredOMP) - +// clang-format off +PairStyle(resquared/omp,PairRESquaredOMP); +// clang-format on #else #ifndef LMP_PAIR_RESQUARED_OMP_H @@ -39,10 +39,10 @@ class PairRESquaredOMP : public PairRESquared, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_soft_omp.cpp b/src/USER-OMP/pair_soft_omp.cpp index 997617ff8f..b524d8a371 100644 --- a/src/USER-OMP/pair_soft_omp.cpp +++ b/src/USER-OMP/pair_soft_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_soft_omp.h b/src/USER-OMP/pair_soft_omp.h index c930cafc1e..6435f5b4ca 100644 --- a/src/USER-OMP/pair_soft_omp.h +++ b/src/USER-OMP/pair_soft_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(soft/omp,PairSoftOMP) - +// clang-format off +PairStyle(soft/omp,PairSoftOMP); +// clang-format on #else #ifndef LMP_PAIR_SOFT_OMP_H @@ -39,10 +39,10 @@ class PairSoftOMP : public PairSoft, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_sw_omp.cpp b/src/USER-OMP/pair_sw_omp.cpp index 28e450f517..22cf2b4dba 100644 --- a/src/USER-OMP/pair_sw_omp.cpp +++ b/src/USER-OMP/pair_sw_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_sw_omp.h b/src/USER-OMP/pair_sw_omp.h index 546ff75bfa..263e25e99a 100644 --- a/src/USER-OMP/pair_sw_omp.h +++ b/src/USER-OMP/pair_sw_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(sw/omp,PairSWOMP) - +// clang-format off +PairStyle(sw/omp,PairSWOMP); +// clang-format on #else #ifndef LMP_PAIR_SW_OMP_H @@ -38,11 +38,10 @@ class PairSWOMP : public PairSW, public ThrOMP { virtual double memory_usage(); private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_table_omp.cpp b/src/USER-OMP/pair_table_omp.cpp index bb6703ba92..72d5ecd4de 100644 --- a/src/USER-OMP/pair_table_omp.cpp +++ b/src/USER-OMP/pair_table_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_table_omp.h b/src/USER-OMP/pair_table_omp.h index d4a773b11f..f3a02ce55e 100644 --- a/src/USER-OMP/pair_table_omp.h +++ b/src/USER-OMP/pair_table_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(table/omp,PairTableOMP) - +// clang-format off +PairStyle(table/omp,PairTableOMP); +// clang-format on #else #ifndef LMP_PAIR_TABLE_OMP_H @@ -39,10 +39,10 @@ class PairTableOMP : public PairTable, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tersoff_mod_c_omp.cpp b/src/USER-OMP/pair_tersoff_mod_c_omp.cpp index 9da74e36b1..0d66e83b00 100644 --- a/src/USER-OMP/pair_tersoff_mod_c_omp.cpp +++ b/src/USER-OMP/pair_tersoff_mod_c_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_tersoff_mod_c_omp.h b/src/USER-OMP/pair_tersoff_mod_c_omp.h index 9d613b502e..787089efc4 100644 --- a/src/USER-OMP/pair_tersoff_mod_c_omp.h +++ b/src/USER-OMP/pair_tersoff_mod_c_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov See the README file in the top-level LAMMPS directory. @@ -11,9 +11,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/mod/c/omp,PairTersoffMODCOMP) - +// clang-format off +PairStyle(tersoff/mod/c/omp,PairTersoffMODCOMP); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_MOD_C_OMP_H @@ -34,10 +34,10 @@ class PairTersoffMODCOMP : public PairTersoffMODC, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tersoff_mod_omp.cpp b/src/USER-OMP/pair_tersoff_mod_omp.cpp index 28d64ca19f..b3e3b89283 100644 --- a/src/USER-OMP/pair_tersoff_mod_omp.cpp +++ b/src/USER-OMP/pair_tersoff_mod_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_tersoff_mod_omp.h b/src/USER-OMP/pair_tersoff_mod_omp.h index 2f4db53b3a..e7dd8b6178 100644 --- a/src/USER-OMP/pair_tersoff_mod_omp.h +++ b/src/USER-OMP/pair_tersoff_mod_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov See the README file in the top-level LAMMPS directory. @@ -11,9 +11,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/mod/omp,PairTersoffMODOMP) - +// clang-format off +PairStyle(tersoff/mod/omp,PairTersoffMODOMP); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_MOD_OMP_H @@ -34,10 +34,10 @@ class PairTersoffMODOMP : public PairTersoffMOD, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tersoff_omp.cpp b/src/USER-OMP/pair_tersoff_omp.cpp index 55bb7791a4..6bf48792eb 100644 --- a/src/USER-OMP/pair_tersoff_omp.cpp +++ b/src/USER-OMP/pair_tersoff_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_tersoff_omp.h b/src/USER-OMP/pair_tersoff_omp.h index b70bc3cf87..e044615138 100644 --- a/src/USER-OMP/pair_tersoff_omp.h +++ b/src/USER-OMP/pair_tersoff_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov See the README file in the top-level LAMMPS directory. @@ -11,9 +11,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/omp,PairTersoffOMP) - +// clang-format off +PairStyle(tersoff/omp,PairTersoffOMP); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_OMP_H @@ -34,10 +34,10 @@ class PairTersoffOMP : public PairTersoff, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tersoff_table_omp.cpp b/src/USER-OMP/pair_tersoff_table_omp.cpp index 02752c8577..a91f361f79 100644 --- a/src/USER-OMP/pair_tersoff_table_omp.cpp +++ b/src/USER-OMP/pair_tersoff_table_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_tersoff_table_omp.h b/src/USER-OMP/pair_tersoff_table_omp.h index 8f77e2316c..ce5260f77f 100644 --- a/src/USER-OMP/pair_tersoff_table_omp.h +++ b/src/USER-OMP/pair_tersoff_table_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov See the README file in the top-level LAMMPS directory. @@ -11,9 +11,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/table/omp,PairTersoffTableOMP) - +// clang-format off +PairStyle(tersoff/table/omp,PairTersoffTableOMP); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_TABLE_OMP_H @@ -34,7 +34,6 @@ class PairTersoffTableOMP : public PairTersoffTable, public ThrOMP { virtual double memory_usage(); protected: - double ***thrGtetaFunction, ***thrGtetaFunctionDerived; double **thrCutoffFunction, **thrCutoffFunctionDerived; @@ -42,11 +41,10 @@ class PairTersoffTableOMP : public PairTersoffTable, public ThrOMP { void deallocatePreLoops(void); private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tersoff_zbl_omp.cpp b/src/USER-OMP/pair_tersoff_zbl_omp.cpp index c0fef02a23..9541695611 100644 --- a/src/USER-OMP/pair_tersoff_zbl_omp.cpp +++ b/src/USER-OMP/pair_tersoff_zbl_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pair_tersoff_zbl_omp.h b/src/USER-OMP/pair_tersoff_zbl_omp.h index 1e76d04b76..60426ea77c 100644 --- a/src/USER-OMP/pair_tersoff_zbl_omp.h +++ b/src/USER-OMP/pair_tersoff_zbl_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov See the README file in the top-level LAMMPS directory. @@ -11,9 +11,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tersoff/zbl/omp,PairTersoffZBLOMP) - +// clang-format off +PairStyle(tersoff/zbl/omp,PairTersoffZBLOMP); +// clang-format on #else #ifndef LMP_PAIR_TERSOFF_ZBL_OMP_H @@ -29,17 +29,16 @@ class PairTersoffZBLOMP : public PairTersoffOMP { virtual ~PairTersoffZBLOMP() {} protected: - double global_a_0; // Bohr radius for Coulomb repulsion - double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion - double global_e; // proton charge (negative of electron charge) + double global_a_0; // Bohr radius for Coulomb repulsion + double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion + double global_e; // proton charge (negative of electron charge) virtual void read_file(char *); virtual void repulsive(Param *, double, double &, int, double &); virtual void force_zeta(Param *, double, double, double &, double &, int, double &); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tip4p_cut_omp.cpp b/src/USER-OMP/pair_tip4p_cut_omp.cpp index 93bc23bf85..fb3e907761 100644 --- a/src/USER-OMP/pair_tip4p_cut_omp.cpp +++ b/src/USER-OMP/pair_tip4p_cut_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_tip4p_cut_omp.h b/src/USER-OMP/pair_tip4p_cut_omp.h index c546e7bdf9..c9b1b367fe 100644 --- a/src/USER-OMP/pair_tip4p_cut_omp.h +++ b/src/USER-OMP/pair_tip4p_cut_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tip4p/cut/omp,PairTIP4PCutOMP) - +// clang-format off +PairStyle(tip4p/cut/omp,PairTIP4PCutOMP); +// clang-format on #else #ifndef LMP_PAIR_TIP4P_CUT_OMP_H @@ -42,12 +42,11 @@ class PairTIP4PCutOMP : public PairTIP4PCut, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template < int, int, int > void eval(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; + template void eval(int, int, ThrData *const); + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tip4p_long_omp.cpp b/src/USER-OMP/pair_tip4p_long_omp.cpp index d6e945d9d7..2f08746db5 100644 --- a/src/USER-OMP/pair_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_tip4p_long_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_tip4p_long_omp.h b/src/USER-OMP/pair_tip4p_long_omp.h index 489d68ee50..f19c2c6528 100644 --- a/src/USER-OMP/pair_tip4p_long_omp.h +++ b/src/USER-OMP/pair_tip4p_long_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tip4p/long/omp,PairTIP4PLongOMP) - +// clang-format off +PairStyle(tip4p/long/omp,PairTIP4PLongOMP); +// clang-format on #else #ifndef LMP_PAIR_TIP4P_LONG_OMP_H @@ -42,12 +42,11 @@ class PairTIP4PLongOMP : public PairTIP4PLong, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template < int, int, int, int > void eval(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; + template void eval(int, int, ThrData *const); + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tip4p_long_soft_omp.cpp b/src/USER-OMP/pair_tip4p_long_soft_omp.cpp index c99d80229b..3bbb0717ab 100644 --- a/src/USER-OMP/pair_tip4p_long_soft_omp.cpp +++ b/src/USER-OMP/pair_tip4p_long_soft_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_tip4p_long_soft_omp.h b/src/USER-OMP/pair_tip4p_long_soft_omp.h index 89b1ecffc8..21b29310e5 100644 --- a/src/USER-OMP/pair_tip4p_long_soft_omp.h +++ b/src/USER-OMP/pair_tip4p_long_soft_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(tip4p/long/soft/omp,PairTIP4PLongSoftOMP) - +// clang-format off +PairStyle(tip4p/long/soft/omp,PairTIP4PLongSoftOMP); +// clang-format on #else #ifndef LMP_PAIR_TIP4P_LONG_SOFT_OMP_H @@ -42,12 +42,11 @@ class PairTIP4PLongSoftOMP : public PairTIP4PLongSoft, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template < int, int, int > void eval(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; + template void eval(int, int, ThrData *const); + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_ufm_omp.cpp b/src/USER-OMP/pair_ufm_omp.cpp index b9a6e7248f..2140de5546 100644 --- a/src/USER-OMP/pair_ufm_omp.cpp +++ b/src/USER-OMP/pair_ufm_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_ufm_omp.h b/src/USER-OMP/pair_ufm_omp.h index b17265a820..2c25393bba 100644 --- a/src/USER-OMP/pair_ufm_omp.h +++ b/src/USER-OMP/pair_ufm_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,9 +18,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(ufm/omp,PairUFMOMP) - +// clang-format off +PairStyle(ufm/omp,PairUFMOMP); +// clang-format on #else #ifndef LMP_PAIR_UFM_OMP_H @@ -41,10 +41,10 @@ class PairUFMOMP : public PairUFM, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_vashishta_omp.cpp b/src/USER-OMP/pair_vashishta_omp.cpp index daac740dbf..3e5a13ae06 100644 --- a/src/USER-OMP/pair_vashishta_omp.cpp +++ b/src/USER-OMP/pair_vashishta_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_vashishta_omp.h b/src/USER-OMP/pair_vashishta_omp.h index 6ea60ea5ad..f5b9fd1fb2 100644 --- a/src/USER-OMP/pair_vashishta_omp.h +++ b/src/USER-OMP/pair_vashishta_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(vashishta/omp,PairVashishtaOMP) - +// clang-format off +PairStyle(vashishta/omp,PairVashishtaOMP); +// clang-format on #else #ifndef LMP_PAIR_VASHISHTA_OMP_H @@ -38,11 +38,10 @@ class PairVashishtaOMP : public PairVashishta, public ThrOMP { virtual double memory_usage(); private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_vashishta_table_omp.cpp b/src/USER-OMP/pair_vashishta_table_omp.cpp index c03d827d9b..c40259af88 100644 --- a/src/USER-OMP/pair_vashishta_table_omp.cpp +++ b/src/USER-OMP/pair_vashishta_table_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_vashishta_table_omp.h b/src/USER-OMP/pair_vashishta_table_omp.h index e19ff9662a..5f2a147361 100644 --- a/src/USER-OMP/pair_vashishta_table_omp.h +++ b/src/USER-OMP/pair_vashishta_table_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(vashishta/table/omp,PairVashishtaTableOMP) - +// clang-format off +PairStyle(vashishta/table/omp,PairVashishtaTableOMP); +// clang-format on #else #ifndef LMP_PAIR_VASHISHTA_TABLE_OMP_H @@ -38,11 +38,10 @@ class PairVashishtaTableOMP : public PairVashishtaTable, public ThrOMP { virtual double memory_usage(); private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_yukawa_colloid_omp.cpp b/src/USER-OMP/pair_yukawa_colloid_omp.cpp index bf1ef651fe..a6fea6f0d4 100644 --- a/src/USER-OMP/pair_yukawa_colloid_omp.cpp +++ b/src/USER-OMP/pair_yukawa_colloid_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_yukawa_colloid_omp.h b/src/USER-OMP/pair_yukawa_colloid_omp.h index cec1e2977b..a1b0a840b3 100644 --- a/src/USER-OMP/pair_yukawa_colloid_omp.h +++ b/src/USER-OMP/pair_yukawa_colloid_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(yukawa/colloid/omp,PairYukawaColloidOMP) - +// clang-format off +PairStyle(yukawa/colloid/omp,PairYukawaColloidOMP); +// clang-format on #else #ifndef LMP_PAIR_YUKAWA_COLLOID_OMP_H @@ -39,10 +39,10 @@ class PairYukawaColloidOMP : public PairYukawaColloid, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_yukawa_omp.cpp b/src/USER-OMP/pair_yukawa_omp.cpp index 3928568b72..ac7b2302ad 100644 --- a/src/USER-OMP/pair_yukawa_omp.cpp +++ b/src/USER-OMP/pair_yukawa_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_yukawa_omp.h b/src/USER-OMP/pair_yukawa_omp.h index 943ea1dd8e..3d956d74c2 100644 --- a/src/USER-OMP/pair_yukawa_omp.h +++ b/src/USER-OMP/pair_yukawa_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(yukawa/omp,PairYukawaOMP) - +// clang-format off +PairStyle(yukawa/omp,PairYukawaOMP); +// clang-format on #else #ifndef LMP_PAIR_YUKAWA_OMP_H @@ -39,10 +39,10 @@ class PairYukawaOMP : public PairYukawa, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_zbl_omp.cpp b/src/USER-OMP/pair_zbl_omp.cpp index 6794789f25..1ce0200b99 100644 --- a/src/USER-OMP/pair_zbl_omp.cpp +++ b/src/USER-OMP/pair_zbl_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. diff --git a/src/USER-OMP/pair_zbl_omp.h b/src/USER-OMP/pair_zbl_omp.h index ee40f2b1c7..65965b759a 100644 --- a/src/USER-OMP/pair_zbl_omp.h +++ b/src/USER-OMP/pair_zbl_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(zbl/omp,PairZBLOMP) - +// clang-format off +PairStyle(zbl/omp,PairZBLOMP); +// clang-format on #else #ifndef LMP_PAIR_ZBL_OMP_H @@ -39,10 +39,10 @@ class PairZBLOMP : public PairZBL, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pppm_cg_omp.cpp b/src/USER-OMP/pppm_cg_omp.cpp index 5e393b6c52..1a245b1323 100644 --- a/src/USER-OMP/pppm_cg_omp.cpp +++ b/src/USER-OMP/pppm_cg_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pppm_cg_omp.h b/src/USER-OMP/pppm_cg_omp.h index 1a965ce848..ca21b2ccc5 100644 --- a/src/USER-OMP/pppm_cg_omp.h +++ b/src/USER-OMP/pppm_cg_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/cg/omp,PPPMCGOMP) - +// clang-format off +KSpaceStyle(pppm/cg/omp,PPPMCGOMP); +// clang-format on #else #ifndef LMP_PPPM_CG_OMP_H @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class PPPMCGOMP : public PPPMCG, public ThrOMP { public: PPPMCGOMP(class LAMMPS *); - virtual ~PPPMCGOMP (); + virtual ~PPPMCGOMP(); virtual void compute(int, int); protected: @@ -43,13 +43,13 @@ class PPPMCGOMP : public PPPMCG, public ThrOMP { virtual void fieldforce_peratom(); private: - void compute_rho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &); - void compute_drho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &); + void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &); + void compute_drho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pppm_disp_omp.cpp b/src/USER-OMP/pppm_disp_omp.cpp index fb7d0394fb..3c9767e85d 100644 --- a/src/USER-OMP/pppm_disp_omp.cpp +++ b/src/USER-OMP/pppm_disp_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pppm_disp_omp.h b/src/USER-OMP/pppm_disp_omp.h index b6114e8b7a..384b359523 100644 --- a/src/USER-OMP/pppm_disp_omp.h +++ b/src/USER-OMP/pppm_disp_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/disp/omp,PPPMDispOMP) - +// clang-format off +KSpaceStyle(pppm/disp/omp,PPPMDispOMP); +// clang-format on #else #ifndef LMP_PPPM_DISP_OMP_H @@ -25,10 +25,10 @@ KSpaceStyle(pppm/disp/omp,PPPMDispOMP) namespace LAMMPS_NS { - class PPPMDispOMP : public PPPMDisp, public ThrOMP { +class PPPMDispOMP : public PPPMDisp, public ThrOMP { public: PPPMDispOMP(class LAMMPS *); - virtual ~PPPMDispOMP (); + virtual ~PPPMDispOMP(); virtual void compute(int, int); protected: @@ -37,10 +37,8 @@ namespace LAMMPS_NS { virtual void compute_gf(); virtual void compute_gf_6(); - virtual void particle_map(double,double,double, - double,int**,int,int, - int,int,int,int,int,int); - + virtual void particle_map(double, double, double, double, int **, int, int, int, int, int, int, + int, int); virtual void fieldforce_c_ik(); virtual void fieldforce_c_ad(); @@ -56,18 +54,15 @@ namespace LAMMPS_NS { virtual void make_rho_g(); virtual void make_rho_a(); - void compute_rho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &, - const int, FFT_SCALAR * const * const); - void compute_drho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &, - const int, FFT_SCALAR * const * const); -// void compute_rho_coeff(); -// void slabcorr(int); - + void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &, const int, FFT_SCALAR *const *const); + void compute_drho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &, const int, FFT_SCALAR *const *const); + // void compute_rho_coeff(); + // void slabcorr(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pppm_disp_tip4p_omp.cpp b/src/USER-OMP/pppm_disp_tip4p_omp.cpp index 8749fd4901..083577f16f 100644 --- a/src/USER-OMP/pppm_disp_tip4p_omp.cpp +++ b/src/USER-OMP/pppm_disp_tip4p_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pppm_disp_tip4p_omp.h b/src/USER-OMP/pppm_disp_tip4p_omp.h index 3351a056a9..c85bbe9437 100644 --- a/src/USER-OMP/pppm_disp_tip4p_omp.h +++ b/src/USER-OMP/pppm_disp_tip4p_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/disp/tip4p/omp,PPPMDispTIP4POMP) - +// clang-format off +KSpaceStyle(pppm/disp/tip4p/omp,PPPMDispTIP4POMP); +// clang-format on #else #ifndef LMP_PPPM_DISP_TIP4P_OMP_H @@ -25,10 +25,10 @@ KSpaceStyle(pppm/disp/tip4p/omp,PPPMDispTIP4POMP) namespace LAMMPS_NS { - class PPPMDispTIP4POMP : public PPPMDispTIP4P, public ThrOMP { +class PPPMDispTIP4POMP : public PPPMDispTIP4P, public ThrOMP { public: PPPMDispTIP4POMP(class LAMMPS *); - virtual ~PPPMDispTIP4POMP (); + virtual ~PPPMDispTIP4POMP(); protected: virtual void allocate(); @@ -36,15 +36,13 @@ namespace LAMMPS_NS { virtual void compute_gf(); virtual void compute_gf_6(); - virtual void compute(int,int); + virtual void compute(int, int); - virtual void particle_map(double, double, double, - double, int **, int, int, - int, int, int, int, int, int); - virtual void particle_map_c(double, double, double, - double, int **, int, int, - int, int, int, int, int, int); - virtual void make_rho_c(); // XXX: not (yet) multi-threaded + virtual void particle_map(double, double, double, double, int **, int, int, int, int, int, int, + int, int); + virtual void particle_map_c(double, double, double, double, int **, int, int, int, int, int, int, + int, int); + virtual void make_rho_c(); // XXX: not (yet) multi-threaded virtual void make_rho_g(); virtual void make_rho_a(); @@ -58,18 +56,15 @@ namespace LAMMPS_NS { virtual void fieldforce_a_ad(); virtual void fieldforce_a_peratom(); - private: - void compute_rho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &, - const int, FFT_SCALAR * const * const); - void compute_drho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &, - const int, FFT_SCALAR * const * const); + private: + void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &, const int, FFT_SCALAR *const *const); + void compute_drho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &, const int, FFT_SCALAR *const *const); virtual void find_M_thr(int, int &, int &, dbl3_t &); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pppm_omp.cpp b/src/USER-OMP/pppm_omp.cpp index b508462d40..e82a6b0b13 100644 --- a/src/USER-OMP/pppm_omp.cpp +++ b/src/USER-OMP/pppm_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pppm_omp.h b/src/USER-OMP/pppm_omp.h index 1df65d927e..3c17ede721 100644 --- a/src/USER-OMP/pppm_omp.h +++ b/src/USER-OMP/pppm_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/omp,PPPMOMP) - +// clang-format off +KSpaceStyle(pppm/omp,PPPMOMP); +// clang-format on #else #ifndef LMP_PPPM_OMP_H @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class PPPMOMP : public PPPM, public ThrOMP { public: PPPMOMP(class LAMMPS *); - virtual ~PPPMOMP (); + virtual ~PPPMOMP(); virtual void compute(int, int); protected: @@ -43,15 +43,14 @@ class PPPMOMP : public PPPM, public ThrOMP { virtual void fieldforce_peratom(); private: - void compute_rho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &); - void compute_drho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &); -// void slabcorr(int); - + void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &); + void compute_drho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &); + // void slabcorr(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pppm_tip4p_omp.cpp b/src/USER-OMP/pppm_tip4p_omp.cpp index ffee265282..9d8832681e 100644 --- a/src/USER-OMP/pppm_tip4p_omp.cpp +++ b/src/USER-OMP/pppm_tip4p_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/pppm_tip4p_omp.h b/src/USER-OMP/pppm_tip4p_omp.h index 7685bbbd6c..ba445b0353 100644 --- a/src/USER-OMP/pppm_tip4p_omp.h +++ b/src/USER-OMP/pppm_tip4p_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(pppm/tip4p/omp,PPPMTIP4POMP) - +// clang-format off +KSpaceStyle(pppm/tip4p/omp,PPPMTIP4POMP); +// clang-format on #else #ifndef LMP_PPPM_TIP4P_OMP_H @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class PPPMTIP4POMP : public PPPMTIP4P, public ThrOMP { public: PPPMTIP4POMP(class LAMMPS *); - virtual ~PPPMTIP4POMP (); + virtual ~PPPMTIP4POMP(); virtual void compute(int, int); protected: @@ -38,25 +38,24 @@ class PPPMTIP4POMP : public PPPMTIP4P, public ThrOMP { virtual void compute_gf_ad(); virtual void particle_map(); - virtual void make_rho(); // XXX: not (yet) multi-threaded + virtual void make_rho(); // XXX: not (yet) multi-threaded virtual void fieldforce_ik(); virtual void fieldforce_ad(); // virtual void fieldforce_peratom(); XXX: need to benchmark first. private: - void compute_rho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &); - void compute_drho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &); + void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &); + void compute_drho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &); void find_M_thr(const int, int &, int &, dbl3_t &); -// void slabcorr(int); // XXX: not (yet) multi-threaded - + // void slabcorr(int); // XXX: not (yet) multi-threaded }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/reaxc_bond_orders_omp.cpp b/src/USER-OMP/reaxc_bond_orders_omp.cpp index 499c5f2933..ec94baced5 100644 --- a/src/USER-OMP/reaxc_bond_orders_omp.cpp +++ b/src/USER-OMP/reaxc_bond_orders_omp.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program Website: https://www.cs.purdue.edu/puremd diff --git a/src/USER-OMP/reaxc_bond_orders_omp.h b/src/USER-OMP/reaxc_bond_orders_omp.h index 2027a8628e..46dc25148d 100644 --- a/src/USER-OMP/reaxc_bond_orders_omp.h +++ b/src/USER-OMP/reaxc_bond_orders_omp.h @@ -31,14 +31,14 @@ #include "reaxc_types.h" -void Add_dBond_to_ForcesOMP( reax_system*, int, int, storage*, reax_list** ); -void Add_dBond_to_Forces_NPTOMP( reax_system *system, int, int, - simulation_data*, storage*, reax_list** ); +void Add_dBond_to_ForcesOMP(reax_system *, int, int, storage *, reax_list **); +void Add_dBond_to_Forces_NPTOMP(reax_system *system, int, int, simulation_data *, storage *, + reax_list **); -int BOp_OMP(storage*, reax_list*, double, int, int, far_neighbor_data*, - single_body_parameters*, single_body_parameters*, two_body_parameters*, - int, double, double, double, double, double, double, double); +int BOp_OMP(storage *, reax_list *, double, int, int, far_neighbor_data *, single_body_parameters *, + single_body_parameters *, two_body_parameters *, int, double, double, double, double, + double, double, double); -void BOOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void BOOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *); #endif diff --git a/src/USER-OMP/reaxc_bonds_omp.cpp b/src/USER-OMP/reaxc_bonds_omp.cpp index 30d50a4e70..f7f0cf5c4f 100644 --- a/src/USER-OMP/reaxc_bonds_omp.cpp +++ b/src/USER-OMP/reaxc_bonds_omp.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program Website: https://www.cs.purdue.edu/puremd diff --git a/src/USER-OMP/reaxc_bonds_omp.h b/src/USER-OMP/reaxc_bonds_omp.h index e5fb0f99e1..19403c35da 100644 --- a/src/USER-OMP/reaxc_bonds_omp.h +++ b/src/USER-OMP/reaxc_bonds_omp.h @@ -31,7 +31,7 @@ #include "reaxc_types.h" -void BondsOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void BondsOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *); #endif diff --git a/src/USER-OMP/reaxc_forces_omp.cpp b/src/USER-OMP/reaxc_forces_omp.cpp index 5eb939cf8c..05091c7eb5 100644 --- a/src/USER-OMP/reaxc_forces_omp.cpp +++ b/src/USER-OMP/reaxc_forces_omp.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program Website: https://www.cs.purdue.edu/puremd diff --git a/src/USER-OMP/reaxc_forces_omp.h b/src/USER-OMP/reaxc_forces_omp.h index 6df0288656..c42aed1282 100644 --- a/src/USER-OMP/reaxc_forces_omp.h +++ b/src/USER-OMP/reaxc_forces_omp.h @@ -31,7 +31,7 @@ #include "reaxc_types.h" -void Init_Force_FunctionsOMP( control_params* ); -void Compute_ForcesOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls*, mpi_datatypes* ); +void Init_Force_FunctionsOMP(control_params *); +void Compute_ForcesOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *, mpi_datatypes *); #endif diff --git a/src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp b/src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp index c0fe4e3792..7701063ebf 100644 --- a/src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp +++ b/src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program Website: https://www.cs.purdue.edu/puremd diff --git a/src/USER-OMP/reaxc_hydrogen_bonds_omp.h b/src/USER-OMP/reaxc_hydrogen_bonds_omp.h index 8c3d04448a..3703b09058 100644 --- a/src/USER-OMP/reaxc_hydrogen_bonds_omp.h +++ b/src/USER-OMP/reaxc_hydrogen_bonds_omp.h @@ -31,7 +31,7 @@ #include "reaxc_types.h" -void Hydrogen_BondsOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void Hydrogen_BondsOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *); #endif diff --git a/src/USER-OMP/reaxc_init_md_omp.cpp b/src/USER-OMP/reaxc_init_md_omp.cpp index 7450470095..226bfaf53c 100644 --- a/src/USER-OMP/reaxc_init_md_omp.cpp +++ b/src/USER-OMP/reaxc_init_md_omp.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program Website: https://www.cs.purdue.edu/puremd diff --git a/src/USER-OMP/reaxc_init_md_omp.h b/src/USER-OMP/reaxc_init_md_omp.h index 45478ec632..c4292ae4c0 100644 --- a/src/USER-OMP/reaxc_init_md_omp.h +++ b/src/USER-OMP/reaxc_init_md_omp.h @@ -33,6 +33,6 @@ #include -void InitializeOMP( reax_system*, control_params*, simulation_data*, storage*, - reax_list**, output_controls*, mpi_datatypes*, MPI_Comm ); +void InitializeOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *, mpi_datatypes *, MPI_Comm); #endif diff --git a/src/USER-OMP/reaxc_multi_body_omp.cpp b/src/USER-OMP/reaxc_multi_body_omp.cpp index e2af2d96ad..d42a203044 100644 --- a/src/USER-OMP/reaxc_multi_body_omp.cpp +++ b/src/USER-OMP/reaxc_multi_body_omp.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program Website: https://www.cs.purdue.edu/puremd diff --git a/src/USER-OMP/reaxc_multi_body_omp.h b/src/USER-OMP/reaxc_multi_body_omp.h index 772aafbb31..c5e7de6b57 100644 --- a/src/USER-OMP/reaxc_multi_body_omp.h +++ b/src/USER-OMP/reaxc_multi_body_omp.h @@ -31,7 +31,7 @@ #include "reaxc_types.h" -void Atom_EnergyOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void Atom_EnergyOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *); #endif diff --git a/src/USER-OMP/reaxc_nonbonded_omp.cpp b/src/USER-OMP/reaxc_nonbonded_omp.cpp index 7abcb5b42a..32f4d5f8b4 100644 --- a/src/USER-OMP/reaxc_nonbonded_omp.cpp +++ b/src/USER-OMP/reaxc_nonbonded_omp.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program Website: https://www.cs.purdue.edu/puremd diff --git a/src/USER-OMP/reaxc_nonbonded_omp.h b/src/USER-OMP/reaxc_nonbonded_omp.h index a5d895533a..779642b83d 100644 --- a/src/USER-OMP/reaxc_nonbonded_omp.h +++ b/src/USER-OMP/reaxc_nonbonded_omp.h @@ -31,10 +31,9 @@ #include "reaxc_types.h" -void vdW_Coulomb_Energy_OMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void vdW_Coulomb_Energy_OMP(reax_system *, control_params *, simulation_data *, storage *, + reax_list **, output_controls *); -void Tabulated_vdW_Coulomb_Energy_OMP( reax_system*, control_params*, - simulation_data*, storage*, - reax_list**, output_controls* ); +void Tabulated_vdW_Coulomb_Energy_OMP(reax_system *, control_params *, simulation_data *, storage *, + reax_list **, output_controls *); #endif diff --git a/src/USER-OMP/reaxc_torsion_angles_omp.cpp b/src/USER-OMP/reaxc_torsion_angles_omp.cpp index cb92a9a68c..96d4966a00 100644 --- a/src/USER-OMP/reaxc_torsion_angles_omp.cpp +++ b/src/USER-OMP/reaxc_torsion_angles_omp.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program Website: https://www.cs.purdue.edu/puremd diff --git a/src/USER-OMP/reaxc_torsion_angles_omp.h b/src/USER-OMP/reaxc_torsion_angles_omp.h index 62cb760f41..4b62f90241 100644 --- a/src/USER-OMP/reaxc_torsion_angles_omp.h +++ b/src/USER-OMP/reaxc_torsion_angles_omp.h @@ -29,10 +29,10 @@ #ifndef __TORSION_ANGLES_OMP_H_ #define __TORSION_ANGLES_OMP_H_ -#include "reaxc_types.h" #include "reaxc_torsion_angles.h" +#include "reaxc_types.h" -void Torsion_AnglesOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void Torsion_AnglesOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *); #endif diff --git a/src/USER-OMP/reaxc_valence_angles_omp.cpp b/src/USER-OMP/reaxc_valence_angles_omp.cpp index 8b6f1e7617..49a7e874cd 100644 --- a/src/USER-OMP/reaxc_valence_angles_omp.cpp +++ b/src/USER-OMP/reaxc_valence_angles_omp.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program Website: https://www.cs.purdue.edu/puremd diff --git a/src/USER-OMP/reaxc_valence_angles_omp.h b/src/USER-OMP/reaxc_valence_angles_omp.h index 5a8d992b0d..f1a4fef505 100644 --- a/src/USER-OMP/reaxc_valence_angles_omp.h +++ b/src/USER-OMP/reaxc_valence_angles_omp.h @@ -31,9 +31,9 @@ #include "reaxc_types.h" -void Valence_AnglesOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void Valence_AnglesOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *); -void Calculate_dCos_ThetaOMP( rvec, double, rvec, double, rvec*, rvec*, rvec* ); +void Calculate_dCos_ThetaOMP(rvec, double, rvec, double, rvec *, rvec *, rvec *); #endif diff --git a/src/USER-OMP/respa_omp.cpp b/src/USER-OMP/respa_omp.cpp index c9ba867cfa..cc4d3925b1 100644 --- a/src/USER-OMP/respa_omp.cpp +++ b/src/USER-OMP/respa_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/respa_omp.h b/src/USER-OMP/respa_omp.h index 6c676328b2..9d20ec23cb 100644 --- a/src/USER-OMP/respa_omp.h +++ b/src/USER-OMP/respa_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef INTEGRATE_CLASS - -IntegrateStyle(respa/omp,RespaOMP) - +// clang-format off +IntegrateStyle(respa/omp,RespaOMP); +// clang-format on #else #ifndef LMP_RESPA_OMP_H @@ -37,7 +37,7 @@ class RespaOMP : public Respa, public ThrOMP { virtual void recurse(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/thr_data.cpp b/src/USER-OMP/thr_data.cpp index 951b9b2311..5ff0263eea 100644 --- a/src/USER-OMP/thr_data.cpp +++ b/src/USER-OMP/thr_data.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ------------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/thr_data.h b/src/USER-OMP/thr_data.h index 1ec198c726..f054738b56 100644 --- a/src/USER-OMP/thr_data.h +++ b/src/USER-OMP/thr_data.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -31,14 +31,21 @@ class ThrData { public: ThrData(int tid, class Timer *t); - ~ThrData() { delete _timer; _timer = nullptr; }; + ~ThrData() + { + delete _timer; + _timer = nullptr; + }; - void check_tid(int); // thread id consistency check - int get_tid() const { return _tid; }; // our thread id. + void check_tid(int); // thread id consistency check + int get_tid() const { return _tid; }; // our thread id. // inline wrapper, to make this more efficient // when per-thread timers are off - void timer(enum Timer::ttype flag) { if (_timer) _stamp(flag); }; + void timer(enum Timer::ttype flag) + { + if (_timer) _stamp(flag); + }; double get_time(enum Timer::ttype flag); // erase accumulator contents and hook up force arrays @@ -51,9 +58,9 @@ class ThrData { double *get_drho() const { return _drho; }; // setup and erase per atom arrays - void init_adp(int, double *, double **, double **); // ADP (+ EAM) - void init_eam(int, double *); // EAM - void init_eim(int, double *, double *); // EIM (+ EAM) + void init_adp(int, double *, double **, double **); // ADP (+ EAM) + void init_eam(int, double *); // EAM + void init_eim(int, double *, double *); // EIM (+ EAM) void init_pppm(int, class Memory *); void init_pppm_disp(int, class Memory *); @@ -71,19 +78,19 @@ class ThrData { void *get_drho1d_6() const { return _drho1d_6; }; private: - double eng_vdwl; // non-bonded non-coulomb energy - double eng_coul; // non-bonded coulomb energy - double eng_bond; // bond energy - double eng_angle; // angle energy - double eng_dihed; // dihedral energy - double eng_imprp; // improper energy - double eng_kspce; // kspace energy - double virial_pair[6]; // virial contribution from non-bonded - double virial_bond[6]; // virial contribution from bonds - double virial_angle[6]; // virial contribution from angles - double virial_dihed[6]; // virial contribution from dihedrals - double virial_imprp[6]; // virial contribution from impropers - double virial_kspce[6]; // virial contribution from kspace + double eng_vdwl; // non-bonded non-coulomb energy + double eng_coul; // non-bonded coulomb energy + double eng_bond; // bond energy + double eng_angle; // angle energy + double eng_dihed; // dihedral energy + double eng_imprp; // improper energy + double eng_kspce; // kspace energy + double virial_pair[6]; // virial contribution from non-bonded + double virial_bond[6]; // virial contribution from bonds + double virial_angle[6]; // virial contribution from angles + double virial_dihed[6]; // virial contribution from dihedrals + double virial_imprp[6]; // virial contribution from impropers + double virial_kspce[6]; // virial contribution from kspace double *eatom_pair; double *eatom_bond; double *eatom_angle; @@ -111,10 +118,10 @@ class ThrData { double *_drho; // these are maintained by individual pair styles - double **_mu, **_lambda; // ADP (+ EAM) - double *_rhoB, *_D_values; // CDEAM (+ EAM) - double *_rho; // EAM - double *_fp; // EIM (+ EAM) + double **_mu, **_lambda; // ADP (+ EAM) + double *_rhoB, *_D_values; // CDEAM (+ EAM) + double *_rho; // EAM + double *_fp; // EIM (+ EAM) // this is for pppm/omp void *_rho1d; @@ -137,9 +144,9 @@ class ThrData { double memory_usage(); - // disabled default methods + // disabled default methods private: - ThrData() : _tid(-1), _timer(nullptr) {}; + ThrData() : _tid(-1), _timer(nullptr){}; }; //////////////////////////////////////////////////////////////////////// @@ -147,5 +154,5 @@ class ThrData { //////////////////////////////////////////////////////////////////////// // generic per thread data reduction for continuous arrays of nthreads*nmax size void data_reduce_thr(double *, int, int, int, int); -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-OMP/thr_omp.cpp b/src/USER-OMP/thr_omp.cpp index e590aedc87..4685e116be 100644 --- a/src/USER-OMP/thr_omp.cpp +++ b/src/USER-OMP/thr_omp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ------------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-OMP/thr_omp.h b/src/USER-OMP/thr_omp.h index 966970eb4d..77835122e0 100644 --- a/src/USER-OMP/thr_omp.h +++ b/src/USER-OMP/thr_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -21,10 +21,10 @@ #if defined(_OPENMP) #include #endif -#include "pointers.h" #include "error.h" -#include "fix_omp.h" // IWYU pragma: export -#include "thr_data.h" // IWYU pragma: export +#include "fix_omp.h" // IWYU pragma: export +#include "pointers.h" +#include "thr_data.h" // IWYU pragma: export namespace LAMMPS_NS { @@ -38,8 +38,8 @@ class Improper; class ThrOMP { protected: - LAMMPS *lmp; // reference to base lammps object. - FixOMP *fix; // pointer to fix_omp; + LAMMPS *lmp; // reference to base lammps object. + FixOMP *fix; // pointer to fix_omp; const int thr_style; int thr_error; @@ -50,30 +50,39 @@ class ThrOMP { double memory_usage_thr(); - inline void sync_threads() { + inline void sync_threads() + { #if defined(_OPENMP) #pragma omp barrier #endif - { ; } - }; + { + ; + } + }; - enum {THR_NONE=0,THR_PAIR=1,THR_BOND=1<<1,THR_ANGLE=1<<2, - THR_DIHEDRAL=1<<3,THR_IMPROPER=1<<4,THR_KSPACE=1<<5, - THR_CHARMM=1<<6, /*THR_PROXY=1<<7,THR_HYBRID=1<<8, */ - THR_FIX=1<<9,THR_INTGR=1<<10}; + enum { + THR_NONE = 0, + THR_PAIR = 1, + THR_BOND = 1 << 1, + THR_ANGLE = 1 << 2, + THR_DIHEDRAL = 1 << 3, + THR_IMPROPER = 1 << 4, + THR_KSPACE = 1 << 5, + THR_CHARMM = 1 << 6, /*THR_PROXY=1<<7,THR_HYBRID=1<<8, */ + THR_FIX = 1 << 9, + THR_INTGR = 1 << 10 + }; protected: // extra ev_tally setup work for threaded styles void ev_setup_thr(int, int, int, double *, double **, double **, ThrData *); // compute global per thread virial contribution from per-thread force - void virial_fdotr_compute_thr(double * const, const double * const * const, - const double * const * const, - const int, const int, const int); + void virial_fdotr_compute_thr(double *const, const double *const *const, + const double *const *const, const int, const int, const int); // reduce per thread data as needed - void reduce_thr(void * const style, const int eflag, const int vflag, - ThrData * const thr); + void reduce_thr(void *const style, const int eflag, const int vflag, ThrData *const thr); // thread safe variant error abort support. // signals an error condition in any thread by making @@ -83,105 +92,103 @@ class ThrOMP { // returns false if no error found on any thread. // use return value to jump/return to end of threaded region. - bool check_error_thr(const bool cond, const int tid, const char *fname, - const int line, const char *errmsg) { + bool check_error_thr(const bool cond, const int tid, const char *fname, const int line, + const char *errmsg) + { if (cond) { #if defined(_OPENMP) #pragma omp atomic ++thr_error; #endif - if (tid > 0) return true; - else lmp->error->one(fname,line,errmsg); + if (tid > 0) + return true; + else + lmp->error->one(fname, line, errmsg); } else { if (thr_error > 0) { - if (tid == 0) lmp->error->one(fname,line,errmsg); - else return true; - } else return false; + if (tid == 0) + lmp->error->one(fname, line, errmsg); + else + return true; + } else + return false; } return false; }; protected: - // threading adapted versions of the ev_tally infrastructure // style specific versions (need access to style class flags) // Pair - void e_tally_thr(Pair * const, const int, const int, const int, - const int, const double, const double, ThrData * const); - void v_tally_thr(Pair * const, const int, const int, const int, - const int, const double * const, ThrData * const); + void e_tally_thr(Pair *const, const int, const int, const int, const int, const double, + const double, ThrData *const); + void v_tally_thr(Pair *const, const int, const int, const int, const int, const double *const, + ThrData *const); - void ev_tally_thr(Pair * const, const int, const int, const int, const int, - const double, const double, const double, const double, - const double, const double, ThrData * const); - void ev_tally_xyz_thr(Pair * const, const int, const int, const int, - const int, const double, const double, const double, - const double, const double, const double, - const double, const double, ThrData * const); - void ev_tally_xyz_full_thr(Pair * const, const int, const double, const double, - const double, const double, const double, - const double, const double, const double, ThrData * const); - void ev_tally3_thr(Pair * const, const int, const int, const int, const double, - const double, const double * const, const double * const, - const double * const, const double * const, ThrData * const); - void ev_tally4_thr(Pair * const, const int, const int, const int, const int, - const double, const double * const, const double * const, - const double * const, const double * const, const double * const, - const double * const, ThrData * const); + void ev_tally_thr(Pair *const, const int, const int, const int, const int, const double, + const double, const double, const double, const double, const double, + ThrData *const); + void ev_tally_xyz_thr(Pair *const, const int, const int, const int, const int, const double, + const double, const double, const double, const double, const double, + const double, const double, ThrData *const); + void ev_tally_xyz_full_thr(Pair *const, const int, const double, const double, const double, + const double, const double, const double, const double, const double, + ThrData *const); + void ev_tally3_thr(Pair *const, const int, const int, const int, const double, const double, + const double *const, const double *const, const double *const, + const double *const, ThrData *const); + void ev_tally4_thr(Pair *const, const int, const int, const int, const int, const double, + const double *const, const double *const, const double *const, + const double *const, const double *const, const double *const, ThrData *const); // Bond - void ev_tally_thr(Bond * const, const int, const int, const int, const int, - const double, const double, const double, const double, - const double, ThrData * const); + void ev_tally_thr(Bond *const, const int, const int, const int, const int, const double, + const double, const double, const double, const double, ThrData *const); // Angle - void ev_tally_thr(Angle * const, const int, const int, const int, const int, const int, - const double, const double * const, const double * const, + void ev_tally_thr(Angle *const, const int, const int, const int, const int, const int, + const double, const double *const, const double *const, const double, const double, const double, const double, const double, const double, - const double, ThrData * const thr); - void ev_tally13_thr(Angle * const, const int, const int, const int, const int, - const double, const double, const double, const double, - const double, ThrData * const thr); + ThrData *const thr); + void ev_tally13_thr(Angle *const, const int, const int, const int, const int, const double, + const double, const double, const double, const double, ThrData *const thr); // Dihedral - void ev_tally_thr(Dihedral * const, const int, const int, const int, const int, const int, - const int, const double, const double * const, const double * const, - const double * const, const double, const double, const double, + void ev_tally_thr(Dihedral *const, const int, const int, const int, const int, const int, + const int, const double, const double *const, const double *const, + const double *const, const double, const double, const double, const double, const double, const double, const double, const double, const double, - const double, ThrData * const); + ThrData *const); // Improper - void ev_tally_thr(Improper * const, const int, const int, const int, const int, const int, - const int, const double, const double * const, const double * const, - const double * const, const double, const double, const double, + void ev_tally_thr(Improper *const, const int, const int, const int, const int, const int, + const int, const double, const double *const, const double *const, + const double *const, const double, const double, const double, const double, const double, const double, const double, const double, const double, - const double, ThrData * const); + ThrData *const); // style independent versions - void v_tally2_thr(const int, const int, const double, const double * const, ThrData * const); - void v_tally3_thr(const int, const int, const int, const double * const, const double * const, - const double * const, const double * const, ThrData * const); - void v_tally4_thr(const int, const int, const int, const int, const double * const, - const double * const, const double * const, const double * const, - const double * const, const double * const, ThrData * const); - void ev_tally_list_thr(Pair * const, const int, const int * const, - const double * const, const double, const double, - ThrData * const); - + void v_tally2_thr(const int, const int, const double, const double *const, ThrData *const); + void v_tally3_thr(const int, const int, const int, const double *const, const double *const, + const double *const, const double *const, ThrData *const); + void v_tally4_thr(const int, const int, const int, const int, const double *const, + const double *const, const double *const, const double *const, + const double *const, const double *const, ThrData *const); + void ev_tally_list_thr(Pair *const, const int, const int *const, const double *const, + const double, const double, ThrData *const); }; // set loop range thread id, and force array offset for threaded runs. -static inline void loop_setup_thr(int &ifrom, int &ito, int &tid, - int inum, int nthreads) +static inline void loop_setup_thr(int &ifrom, int &ito, int &tid, int inum, int nthreads) { #if defined(_OPENMP) tid = omp_get_thread_num(); // each thread works on a fixed chunk of atoms. - const int idelta = 1 + inum/nthreads; - ifrom = tid*idelta; - ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; + const int idelta = 1 + inum / nthreads; + ifrom = tid * idelta; + ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; #else tid = 0; ifrom = 0; @@ -192,12 +199,22 @@ static inline void loop_setup_thr(int &ifrom, int &ito, int &tid, // helpful definitions to help compilers optimizing code better -typedef struct { double x,y,z; } dbl3_t; -typedef struct { double x,y,z,w; } dbl4_t; -typedef struct { int a,b,t; } int3_t; -typedef struct { int a,b,c,t; } int4_t; -typedef struct { int a,b,c,d,t; } int5_t; +typedef struct { + double x, y, z; +} dbl3_t; +typedef struct { + double x, y, z, w; +} dbl4_t; +typedef struct { + int a, b, t; +} int3_t; +typedef struct { + int a, b, c, t; +} int4_t; +typedef struct { + int a, b, c, d, t; +} int5_t; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-PACE/pair_pace.cpp b/src/USER-PACE/pair_pace.cpp index 3d0fafad30..952fd07a1a 100644 --- a/src/USER-PACE/pair_pace.cpp +++ b/src/USER-PACE/pair_pace.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-PACE/pair_pace.h b/src/USER-PACE/pair_pace.h index 397b6dd1a9..c5cfa05b7e 100644 --- a/src/USER-PACE/pair_pace.h +++ b/src/USER-PACE/pair_pace.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov This software is distributed under the GNU General Public License. @@ -19,16 +19,14 @@ Copyright 2021 Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, ^4: University of British Columbia, Vancouver, BC, Canada */ - // // Created by Lysogorskiy Yury on 27.02.20. // - #ifdef PAIR_CLASS - -PairStyle(pace,PairPACE) - +// clang-format off +PairStyle(pace,PairPACE); +// clang-format on #else #ifndef LMP_PAIR_PACE_H @@ -57,9 +55,9 @@ class PairPACE : public Pair { virtual void allocate(); double **scale; - bool recursive; // "recursive" option for ACERecursiveEvaluator + bool recursive; // "recursive" option for ACERecursiveEvaluator }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index aabf4adfab..810111998e 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-PHONON/dynamical_matrix.h b/src/USER-PHONON/dynamical_matrix.h index d8c3ad411b..cc70cd026e 100644 --- a/src/USER-PHONON/dynamical_matrix.h +++ b/src/USER-PHONON/dynamical_matrix.h @@ -3,9 +3,9 @@ // #ifdef COMMAND_CLASS - -CommandStyle(dynamical_matrix,DynamicalMatrix) - +// clang-format off +CommandStyle(dynamical_matrix,DynamicalMatrix); +// clang-format on #else #ifndef LMP_DYNAMICAL_MATRIX_H @@ -23,21 +23,20 @@ class DynamicalMatrix : public Command { void setup(); protected: - int eflag,vflag; // flags for energy/virial computation - int external_force_clear; // clear forces locally or externally + int eflag, vflag; // flags for energy/virial computation + int external_force_clear; // clear forces locally or externally - - int triclinic; // 0 if domain is orthog, 1 if triclinic + int triclinic; // 0 if domain is orthog, 1 if triclinic int pairflag; - int pair_compute_flag; // 0 if pair->compute is skipped - int kspace_compute_flag; // 0 if kspace->compute is skipped + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped - int nvec; // local atomic dof = length of xvec + int nvec; // local atomic dof = length of xvec void update_force(); void force_clear(); - virtual void openfile(const char* filename); + virtual void openfile(const char *filename); private: void options(int, char **); @@ -53,22 +52,21 @@ class DynamicalMatrix : public Command { double conv_distance; double conv_mass; double del; - int igroup,groupbit; - bigint gcount; // number of atoms in group - bigint dynlen; // rank of dynamical matrix + int igroup, groupbit; + bigint gcount; // number of atoms in group + bigint dynlen; // rank of dynamical matrix int scaleflag; int me; bigint *groupmap; - int compressed; // 1 if dump file is written compressed, 0 no - int binaryflag; // 1 if dump file is written binary, 0 no - int file_opened; // 1 if openfile method has been called, 0 no - int file_flag; // 1 custom file name, 0 dynmat.dat + int compressed; // 1 if dump file is written compressed, 0 no + int binaryflag; // 1 if dump file is written binary, 0 no + int file_opened; // 1 if openfile method has been called, 0 no + int file_flag; // 1 custom file name, 0 dynmat.dat FILE *fp; }; -} +} // namespace LAMMPS_NS - -#endif //LMP_DYNAMICAL_MATRIX_H +#endif //LMP_DYNAMICAL_MATRIX_H #endif diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index 1f8fe1c9cb..bb4ada4cb8 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-PHONON/fix_phonon.h b/src/USER-PHONON/fix_phonon.h index f75139ce42..0e3c251528 100644 --- a/src/USER-PHONON/fix_phonon.h +++ b/src/USER-PHONON/fix_phonon.h @@ -24,9 +24,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(phonon,FixPhonon) - +// clang-format off +FixStyle(phonon,FixPhonon); +// clang-format on #else #ifndef FIX_PHONON_H @@ -40,8 +40,8 @@ typedef double FFT_SCALAR; #define MPI_FFT_SCALAR MPI_DOUBLE #endif -#include #include "fix.h" +#include #include namespace LAMMPS_NS { @@ -51,7 +51,7 @@ class FixPhonon : public Fix { FixPhonon(class LAMMPS *, int, char **); ~FixPhonon(); - int setmask(); + int setmask(); void init(); void setup(int); void end_of_step(); @@ -60,66 +60,66 @@ class FixPhonon : public Fix { int modify_param(int, char **); private: - int me,nprocs; - bigint waitsteps; // wait these number of timesteps before recording atom positions - bigint prev_nstep; // number of steps from previous run(s); to judge if waitsteps is reached. - int nfreq, ifreq; // after this number of measurement (nfreq), the result will be output once - int nx,ny,nz,nucell,ntotal; // surface dimensions in x- and y-direction, number of atom per unit surface cell - int neval; // # of evaluations - int sysdim; // system dimension - int ngroup, nfind; // total number of atoms in group; total number of atoms on this proc - char *prefix, *logfile; // prefix of output file names + int me, nprocs; + bigint waitsteps; // wait these number of timesteps before recording atom positions + bigint prev_nstep; // number of steps from previous run(s); to judge if waitsteps is reached. + int nfreq, ifreq; // after this number of measurement (nfreq), the result will be output once + int nx, ny, nz, nucell, + ntotal; // surface dimensions in x- and y-direction, number of atom per unit surface cell + int neval; // # of evaluations + int sysdim; // system dimension + int ngroup, nfind; // total number of atoms in group; total number of atoms on this proc + char *prefix, *logfile; // prefix of output file names FILE *flog; double *M_inv_sqrt; - class FFT3d *fft; // to do fft via the fft3d wrapper - int nxlo,nxhi,mysize; // size info for local MPI_FFTW - int mynpt,mynq,fft_nsend; + class FFT3d *fft; // to do fft via the fft3d wrapper + int nxlo, nxhi, mysize; // size info for local MPI_FFTW + int mynpt, mynq, fft_nsend; int *fft_cnts, *fft_disp; int fft_dim, fft_dim2; FFT_SCALAR *fft_data; - tagint itag; // index variables - int idx, idq; // more index variables - std::map tag2surf; // Mapping info - std::map surf2tag; // more Mapping info + tagint itag; // index variables + int idx, idq; // more index variables + std::map tag2surf; // Mapping info + std::map surf2tag; // more Mapping info - double **RIloc; // R(r) and index on local proc - double **RIall; // gathered R(r) and index - double **Rsort; // sorted R(r) - double **Rnow; // Current R(r) on local proc - double **Rsum; // Accumulated R(r) on local proc + double **RIloc; // R(r) and index on local proc + double **RIall; // gathered R(r) and index + double **Rsort; // sorted R(r) + double **Rnow; // Current R(r) on local proc + double **Rsum; // Accumulated R(r) on local proc - int *recvcnts, *displs; // MPI related variables + int *recvcnts, *displs; // MPI related variables - std::complex **Rqnow; // Current R(q) on local proc - std::complex **Rqsum; // Accumulator for conj(R(q)_alpha)*R(q)_beta - std::complex **Phi_q; // Phi's on local proc - std::complex **Phi_all; // Phi for all + std::complex **Rqnow; // Current R(q) on local proc + std::complex **Rqsum; // Accumulator for conj(R(q)_alpha)*R(q)_beta + std::complex **Phi_q; // Phi's on local proc + std::complex **Phi_all; // Phi for all - void readmap(); // to read the mapping of gf atoms - char *mapfile; // file name of the map file + void readmap(); // to read the mapping of gf atoms + char *mapfile; // file name of the map file - void getmass(); // to get the mass of each atom in a unit cell + void getmass(); // to get the mass of each atom in a unit cell int nasr; - void postprocess(); // to post process the data - void EnforceASR(); // to apply acoustic sum rule to gamma point force constant matrix + void postprocess(); // to post process the data + void EnforceASR(); // to apply acoustic sum rule to gamma point force constant matrix - char *id_temp; // compute id for temperature - double *TempSum; // to get the average temperature vector - double inv_nTemp; // inverse of number of atoms in temperature group - class Compute *temperature; // compute that computes the temperature + char *id_temp; // compute id for temperature + double *TempSum; // to get the average temperature vector + double inv_nTemp; // inverse of number of atoms in temperature group + class Compute *temperature; // compute that computes the temperature double hsum[6], **basis; int *basetype; // private methods to do matrix inversion - void GaussJordan(int, std::complex*); - + void GaussJordan(int, std::complex *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 1cf52d83bb..e9add72267 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-PHONON/third_order.h b/src/USER-PHONON/third_order.h index 56a0266937..fa8741cfc6 100644 --- a/src/USER-PHONON/third_order.h +++ b/src/USER-PHONON/third_order.h @@ -2,11 +2,10 @@ // Created by charlie sievers on 7/5/18. // - #ifdef COMMAND_CLASS - -CommandStyle(third_order,ThirdOrder) - +// clang-format off +CommandStyle(third_order,ThirdOrder); +// clang-format on #else #ifndef LMP_THIRD_ORDER_H @@ -16,61 +15,57 @@ CommandStyle(third_order,ThirdOrder) namespace LAMMPS_NS { - class ThirdOrder : public Command { - public: - ThirdOrder(class LAMMPS *); - virtual ~ThirdOrder(); - void command(int, char **); - void setup(); +class ThirdOrder : public Command { + public: + ThirdOrder(class LAMMPS *); + virtual ~ThirdOrder(); + void command(int, char **); + void setup(); - protected: - int eflag,vflag; // flags for energy/virial computation - int external_force_clear; // clear forces locally or externally + protected: + int eflag, vflag; // flags for energy/virial computation + int external_force_clear; // clear forces locally or externally + int triclinic; // 0 if domain is orthog, 1 if triclinic + int pairflag; - int triclinic; // 0 if domain is orthog, 1 if triclinic - int pairflag; + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped - int pair_compute_flag; // 0 if pair->compute is skipped - int kspace_compute_flag; // 0 if kspace->compute is skipped + int nvec; // local atomic dof = length of xvec - int nvec; // local atomic dof = length of xvec + void update_force(); + void force_clear(); + virtual void openfile(const char *filename); - void update_force(); - void force_clear(); - virtual void openfile(const char* filename); + private: + void options(int, char **); + void create_groupmap(); + void calculateMatrix(); + void convert_units(const char *style); + void displace_atom(int local_idx, int direction, int magnitude); + void writeMatrix(double *, bigint, int, bigint, int); + double conversion; + double conv_energy; + double conv_distance; + double conv_mass; + double del; + int igroup, groupbit; + bigint dynlen; + int scaleflag; + int me; + bigint gcount; // number of atoms in group + bigint *groupmap; - private: - void options(int, char **); - void create_groupmap(); - void calculateMatrix(); - void convert_units(const char *style); - void displace_atom(int local_idx, int direction, int magnitude); - void writeMatrix(double *, bigint, int, bigint, int); + int compressed; // 1 if dump file is written compressed, 0 no + int binaryflag; // 1 if dump file is written binary, 0 no + int file_opened; // 1 if openfile method has been called, 0 no + int file_flag; // 1 custom file name, 0 dynmat.dat - double conversion; - double conv_energy; - double conv_distance; - double conv_mass; - double del; - int igroup,groupbit; - bigint dynlen; - int scaleflag; - int me; - bigint gcount; // number of atoms in group - bigint *groupmap; + FILE *fp; +}; +} // namespace LAMMPS_NS - int compressed; // 1 if dump file is written compressed, 0 no - int binaryflag; // 1 if dump file is written binary, 0 no - int file_opened; // 1 if openfile method has been called, 0 no - int file_flag; // 1 custom file name, 0 dynmat.dat - - FILE *fp; - }; -} - - -#endif //LMP_THIRD_ORDER_H +#endif //LMP_THIRD_ORDER_H #endif - diff --git a/src/USER-PLUMED/fix_plumed.cpp b/src/USER-PLUMED/fix_plumed.cpp index 293f4b0556..c34afe6d3f 100644 --- a/src/USER-PLUMED/fix_plumed.cpp +++ b/src/USER-PLUMED/fix_plumed.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-PLUMED/fix_plumed.h b/src/USER-PLUMED/fix_plumed.h index 43096e8a26..0d9e226d38 100644 --- a/src/USER-PLUMED/fix_plumed.h +++ b/src/USER-PLUMED/fix_plumed.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(plumed,FixPlumed) - +// clang-format off +FixStyle(plumed,FixPlumed); +// clang-format on #else #ifndef LMP_FIX_PLUMED_H @@ -24,7 +24,7 @@ FixStyle(plumed,FixPlumed) // forward declaration namespace PLMD { - class Plumed; +class Plumed; } namespace LAMMPS_NS { @@ -46,23 +46,22 @@ class FixPlumed : public Fix { double memory_usage(); private: - - PLMD::Plumed *p; // pointer to plumed object - int nlocal; // number of atoms local to this process - int natoms; // total number of atoms - int *gatindex; // array of atom indexes local to this process - double *masses; // array of masses for local atoms - double *charges; // array of charges for local atoms - int nlevels_respa; // this is something to enable respa - double bias; // output bias potential - class Compute *c_pe; // Compute for the energy - class Compute *c_press; // Compute for the pressure - int plumedNeedsEnergy; // Flag to trigger calculation of the - // energy and virial - char *id_pe, *id_press; // ID for potential energy and pressure compute + PLMD::Plumed *p; // pointer to plumed object + int nlocal; // number of atoms local to this process + int natoms; // total number of atoms + int *gatindex; // array of atom indexes local to this process + double *masses; // array of masses for local atoms + double *charges; // array of charges for local atoms + int nlevels_respa; // this is something to enable respa + double bias; // output bias potential + class Compute *c_pe; // Compute for the energy + class Compute *c_press; // Compute for the pressure + int plumedNeedsEnergy; // Flag to trigger calculation of the + // energy and virial + char *id_pe, *id_press; // ID for potential energy and pressure compute }; -}; +}; // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-PTM/README b/src/USER-PTM/README index f6165a7881..b4102e5585 100644 --- a/src/USER-PTM/README +++ b/src/USER-PTM/README @@ -6,7 +6,7 @@ The method is currently (Fall 2018) included in OVITO, LAMMPS, and ASAP. OVITO PTM documentation: http://www.ovito.org/manual/particles.modifiers.polyhedral_template_matching.html -LAMMPS PTM documentation: https://lammps.sandia.gov/doc/compute_ptm_atom.html +LAMMPS PTM documentation: https://docs.lammps.org/compute_ptm_atom.html ASAP PTM documentation: http://wiki.fysik.dtu.dk/asap/Local%20crystalline%20order diff --git a/src/USER-PTM/compute_ptm_atom.cpp b/src/USER-PTM/compute_ptm_atom.cpp index 95f1cf5ad9..301e3d577d 100644 --- a/src/USER-PTM/compute_ptm_atom.cpp +++ b/src/USER-PTM/compute_ptm_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -36,7 +37,9 @@ under #include #include +#include "ptm_constants.h" #include "ptm_functions.h" +#include "ptm_initialize_data.h" #define NUM_COLUMNS 7 #define PTM_LAMMPS_UNKNOWN -1 diff --git a/src/USER-PTM/compute_ptm_atom.h b/src/USER-PTM/compute_ptm_atom.h index 2d6bfbb904..3df1c2518e 100644 --- a/src/USER-PTM/compute_ptm_atom.h +++ b/src/USER-PTM/compute_ptm_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(ptm/atom,ComputePTMAtom) - +// clang-format off +ComputeStyle(ptm/atom,ComputePTMAtom); +// clang-format on #else #ifndef LMP_COMPUTE_PTM_ATOM_H @@ -42,8 +42,7 @@ class ComputePTMAtom : public Compute { int group2bit; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-PTM/ptm_alloy_types.cpp b/src/USER-PTM/ptm_alloy_types.cpp index b6b94a3733..850bbdf199 100644 --- a/src/USER-PTM/ptm_alloy_types.cpp +++ b/src/USER-PTM/ptm_alloy_types.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_alloy_types.h b/src/USER-PTM/ptm_alloy_types.h index e51ec1dd01..e1b56b39b2 100644 --- a/src/USER-PTM/ptm_alloy_types.h +++ b/src/USER-PTM/ptm_alloy_types.h @@ -14,9 +14,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI namespace ptm { -int32_t find_alloy_type(const refdata_t* ref, int8_t* mapping, int32_t* numbers); +int32_t find_alloy_type(const refdata_t *ref, int8_t *mapping, int32_t *numbers); } #endif - diff --git a/src/USER-PTM/ptm_alt_templates.h b/src/USER-PTM/ptm_alt_templates.h index 6a348315bf..7eb8ba25af 100644 --- a/src/USER-PTM/ptm_alt_templates.h +++ b/src/USER-PTM/ptm_alt_templates.h @@ -7,11 +7,14 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +// clang-format off + #ifndef PTM_ALT_TEMPLATES_H #define PTM_ALT_TEMPLATES_H -#include +#include "ptm_constants.h" +#include const double ptm_template_hcp_alt1[PTM_NUM_POINTS_HCP][3] = { { 0, 0, 0 }, @@ -125,3 +128,4 @@ const double ptm_template_graphene_alt1[PTM_NUM_POINTS_GRAPHENE][3] = { #endif +// clang-format on diff --git a/src/USER-PTM/ptm_canonical_coloured.cpp b/src/USER-PTM/ptm_canonical_coloured.cpp index 86c3f90b3b..e1a338562c 100644 --- a/src/USER-PTM/ptm_canonical_coloured.cpp +++ b/src/USER-PTM/ptm_canonical_coloured.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_canonical_coloured.h b/src/USER-PTM/ptm_canonical_coloured.h index 3ba2daebcd..a8af028fb1 100644 --- a/src/USER-PTM/ptm_canonical_coloured.h +++ b/src/USER-PTM/ptm_canonical_coloured.h @@ -10,12 +10,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #ifndef PTM_CANONICAL_COLOURED_H #define PTM_CANONICAL_COLOURED_H -#include +#include namespace ptm { -int canonical_form_coloured(int num_facets, int8_t facets[][3], int num_nodes, int8_t* degree, int8_t* colours, int8_t* canonical_labelling, int8_t* best_code, uint64_t* p_hash); +int canonical_form_coloured(int num_facets, int8_t facets[][3], int num_nodes, int8_t *degree, + int8_t *colours, int8_t *canonical_labelling, int8_t *best_code, + uint64_t *p_hash); } #endif - diff --git a/src/USER-PTM/ptm_constants.cpp b/src/USER-PTM/ptm_constants.cpp index 47d6d010f0..1ca8f0b88a 100644 --- a/src/USER-PTM/ptm_constants.cpp +++ b/src/USER-PTM/ptm_constants.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_constants.h b/src/USER-PTM/ptm_constants.h index 898ded6b49..55c79584f7 100644 --- a/src/USER-PTM/ptm_constants.h +++ b/src/USER-PTM/ptm_constants.h @@ -7,6 +7,8 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +// clang-format off + #ifndef PTM_CONSTANTS_H #define PTM_CONSTANTS_H @@ -94,3 +96,4 @@ extern const double ptm_template_graphene[PTM_NUM_POINTS_GRAPHENE][3]; #endif +// clang-format on diff --git a/src/USER-PTM/ptm_convex_hull_incremental.cpp b/src/USER-PTM/ptm_convex_hull_incremental.cpp index 8dd06e8168..580d88c578 100644 --- a/src/USER-PTM/ptm_convex_hull_incremental.cpp +++ b/src/USER-PTM/ptm_convex_hull_incremental.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_convex_hull_incremental.h b/src/USER-PTM/ptm_convex_hull_incremental.h index 1d51ae4dec..796c787937 100644 --- a/src/USER-PTM/ptm_convex_hull_incremental.h +++ b/src/USER-PTM/ptm_convex_hull_incremental.h @@ -10,30 +10,29 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #ifndef PTM_CONVEX_HULL_INCREMENTAL_H #define PTM_CONVEX_HULL_INCREMENTAL_H - -#include -#include #include "ptm_constants.h" +#include +#include namespace ptm { -typedef struct -{ - int8_t facets[PTM_MAX_FACETS][3]; - double plane_normal[PTM_MAX_FACETS][3]; - bool processed[PTM_MAX_POINTS]; - int initial_vertices[4]; - double barycentre[3]; - int num_facets; - int num_prev; - bool ok; +typedef struct { + int8_t facets[PTM_MAX_FACETS][3]; + double plane_normal[PTM_MAX_FACETS][3]; + bool processed[PTM_MAX_POINTS]; + int initial_vertices[4]; + double barycentre[3]; + int num_facets; + int num_prev; + bool ok; } convexhull_t; -void add_facet(const double (*points)[3], int a, int b, int c, int8_t* facet, double* plane_normal, double* barycentre); -int get_convex_hull(int num_points, const double (*points)[3], convexhull_t* ch, int8_t simplex[][3]); +void add_facet(const double (*points)[3], int a, int b, int c, int8_t *facet, double *plane_normal, + double *barycentre); +int get_convex_hull(int num_points, const double (*points)[3], convexhull_t *ch, + int8_t simplex[][3]); -} +} // namespace ptm #endif - diff --git a/src/USER-PTM/ptm_deformation_gradient.cpp b/src/USER-PTM/ptm_deformation_gradient.cpp index 2715c21aab..571eb181bc 100644 --- a/src/USER-PTM/ptm_deformation_gradient.cpp +++ b/src/USER-PTM/ptm_deformation_gradient.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_deformation_gradient.h b/src/USER-PTM/ptm_deformation_gradient.h index 6c686431f6..07a7fdd23b 100644 --- a/src/USER-PTM/ptm_deformation_gradient.h +++ b/src/USER-PTM/ptm_deformation_gradient.h @@ -7,6 +7,8 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +// clang-format off + #ifndef PTM_DEFORMATION_GRADIENT_H #define PTM_DEFORMATION_GRADIENT_H @@ -263,3 +265,4 @@ const double penrose_graphene_alt1[PTM_NUM_POINTS_GRAPHENE][3] = { #endif +// clang-format on diff --git a/src/USER-PTM/ptm_functions.h b/src/USER-PTM/ptm_functions.h index 44d3157e95..b521b8d323 100644 --- a/src/USER-PTM/ptm_functions.h +++ b/src/USER-PTM/ptm_functions.h @@ -10,11 +10,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #ifndef PTM_FUNCTIONS_H #define PTM_FUNCTIONS_H -#include -#include -#include "ptm_initialize_data.h" -#include "ptm_constants.h" +#include +#include +#include +#include "ptm_constants.h" +#include "ptm_initialize_data.h" //------------------------------------ // function declarations @@ -23,17 +24,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI extern "C" { #endif - -int ptm_index( ptm_local_handle_t local_handle, - size_t atom_index, 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]), void* nbrlist, - int32_t flags, bool output_conventional_orientation, //inputs - int32_t* p_type, int32_t* p_alloy_type, double* p_scale, double* p_rmsd, double* q, double* F, double* F_res, double* U, double* P, double* p_interatomic_distance, double* p_lattice_constant, - size_t* output_indices); //outputs - +int ptm_index(ptm_local_handle_t local_handle, size_t atom_index, + 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]), + void *nbrlist, int32_t flags, bool output_conventional_orientation, //inputs + int32_t *p_type, int32_t *p_alloy_type, double *p_scale, double *p_rmsd, double *q, + double *F, double *F_res, double *U, double *P, double *p_interatomic_distance, + double *p_lattice_constant, + size_t *output_indices); //outputs #ifdef __cplusplus } #endif #endif - diff --git a/src/USER-PTM/ptm_fundamental_mappings.h b/src/USER-PTM/ptm_fundamental_mappings.h index f5921c9cfb..e863c5a645 100644 --- a/src/USER-PTM/ptm_fundamental_mappings.h +++ b/src/USER-PTM/ptm_fundamental_mappings.h @@ -7,10 +7,12 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +// clang-format off + #ifndef PTM_FUNDAMENTAL_MAPPINGS_H #define PTM_FUNDAMENTAL_MAPPINGS_H -#include +#include namespace ptm { @@ -27,7 +29,6 @@ namespace ptm { #define NUM_CONVENTIONAL_DCUB_MAPPINGS 24 #define NUM_CONVENTIONAL_DHEX_MAPPINGS 12 - //----------------------------------------------------------------------------- // sc //----------------------------------------------------------------------------- @@ -327,3 +328,4 @@ const int8_t mapping_graphene_conventional[NUM_CONVENTIONAL_GRAPHENE_MAPPINGS][P #endif +// clang-format on diff --git a/src/USER-PTM/ptm_graph_data.cpp b/src/USER-PTM/ptm_graph_data.cpp index d2e67358cc..5621d4e7c0 100644 --- a/src/USER-PTM/ptm_graph_data.cpp +++ b/src/USER-PTM/ptm_graph_data.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_graph_data.h b/src/USER-PTM/ptm_graph_data.h index 31547b0a6e..7a89fd3102 100644 --- a/src/USER-PTM/ptm_graph_data.h +++ b/src/USER-PTM/ptm_graph_data.h @@ -10,19 +10,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #ifndef PTM_GRAPH_DATA_H #define PTM_GRAPH_DATA_H -#include #include "ptm_constants.h" +#include namespace ptm { -typedef struct -{ - int id; - uint64_t hash; - int automorphism_index; - int num_automorphisms; - int8_t canonical_labelling[PTM_MAX_POINTS]; - int8_t facets[PTM_MAX_FACETS][3]; +typedef struct { + int id; + uint64_t hash; + int automorphism_index; + int num_automorphisms; + int8_t canonical_labelling[PTM_MAX_POINTS]; + int8_t facets[PTM_MAX_FACETS][3]; } graph_t; #define NUM_SC_GRAPHS 1 @@ -43,7 +42,6 @@ extern graph_t graphs_bcc[NUM_BCC_GRAPHS]; extern graph_t graphs_dcub[NUM_DCUB_GRAPHS]; extern graph_t graphs_dhex[NUM_DHEX_GRAPHS]; -} +} // namespace ptm #endif - diff --git a/src/USER-PTM/ptm_graph_tools.cpp b/src/USER-PTM/ptm_graph_tools.cpp index a2dbd1719f..41657449d1 100644 --- a/src/USER-PTM/ptm_graph_tools.cpp +++ b/src/USER-PTM/ptm_graph_tools.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_graph_tools.h b/src/USER-PTM/ptm_graph_tools.h index 3bd6b72fbb..3c1bf54000 100644 --- a/src/USER-PTM/ptm_graph_tools.h +++ b/src/USER-PTM/ptm_graph_tools.h @@ -10,15 +10,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #ifndef PTM_GRAPH_TOOLS_H #define PTM_GRAPH_TOOLS_H -#include #include "ptm_constants.h" +#include namespace ptm { bool build_facet_map(int num_facets, int8_t facets[][3], int8_t common[PTM_MAX_NBRS][PTM_MAX_NBRS]); -int graph_degree(int num_facets, int8_t facets[][3], int num_nodes, int8_t* degree); +int graph_degree(int num_facets, int8_t facets[][3], int num_nodes, int8_t *degree); -} +} // namespace ptm #endif - diff --git a/src/USER-PTM/ptm_index.cpp b/src/USER-PTM/ptm_index.cpp index 7c912ed5b9..a0798b9e88 100644 --- a/src/USER-PTM/ptm_index.cpp +++ b/src/USER-PTM/ptm_index.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_initialize_data.cpp b/src/USER-PTM/ptm_initialize_data.cpp index ff8245fe44..a536894887 100644 --- a/src/USER-PTM/ptm_initialize_data.cpp +++ b/src/USER-PTM/ptm_initialize_data.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_initialize_data.h b/src/USER-PTM/ptm_initialize_data.h index dd1cddd9f2..05e84f56c3 100644 --- a/src/USER-PTM/ptm_initialize_data.h +++ b/src/USER-PTM/ptm_initialize_data.h @@ -10,205 +10,209 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #ifndef PTM_INITIALIZE_DATA_H #define PTM_INITIALIZE_DATA_H - -#include "ptm_graph_data.h" +#include "ptm_alt_templates.h" +#include "ptm_constants.h" #include "ptm_deformation_gradient.h" #include "ptm_fundamental_mappings.h" -#include "ptm_alt_templates.h" -#include - +#include "ptm_graph_data.h" namespace ptm { -typedef struct -{ - int type; - int num_nbrs; - int num_facets; - int max_degree; - int num_graphs; - graph_t* graphs; - const double (*points)[3]; - const double (*points_alt1)[3]; - const double (*points_alt2)[3]; - const double (*points_alt3)[3]; - const double (*penrose)[3]; - const double (*penrose_alt1)[3]; - const double (*penrose_alt2)[3]; - const double (*penrose_alt3)[3]; - int num_mappings; - const int8_t (*mapping)[PTM_MAX_POINTS]; - const int8_t (*mapping_conventional)[PTM_MAX_POINTS]; - const int8_t *template_indices; +typedef struct { + int type; + int num_nbrs; + int num_facets; + int max_degree; + int num_graphs; + graph_t *graphs; + const double (*points)[3]; + const double (*points_alt1)[3]; + const double (*points_alt2)[3]; + const double (*points_alt3)[3]; + const double (*penrose)[3]; + const double (*penrose_alt1)[3]; + const double (*penrose_alt2)[3]; + const double (*penrose_alt3)[3]; + int num_mappings; + const int8_t (*mapping)[PTM_MAX_POINTS]; + const int8_t (*mapping_conventional)[PTM_MAX_POINTS]; + const int8_t *template_indices; } refdata_t; +const refdata_t structure_sc = { + PTM_MATCH_SC, //.type + 6, //.num_nbrs + 8, //.num_facets + 4, //.max_degree + NUM_SC_GRAPHS, //.num_graphs + graphs_sc, //.graphs + ptm_template_sc, //.points + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 + penrose_sc, //.penrose + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 + NUM_CUBIC_MAPPINGS, //.num_mappings + mapping_sc, //.mapping + nullptr, //.mapping_conventional + nullptr, //.template_indices +}; -const refdata_t structure_sc = { PTM_MATCH_SC, //.type - 6, //.num_nbrs - 8, //.num_facets - 4, //.max_degree - NUM_SC_GRAPHS, //.num_graphs - graphs_sc, //.graphs - ptm_template_sc, //.points - nullptr, //.points_alt1 - nullptr, //.points_alt2 - nullptr, //.points_alt3 - penrose_sc, //.penrose - nullptr, //.penrose_alt1 - nullptr, //.penrose_alt2 - nullptr, //.penrose_alt3 - NUM_CUBIC_MAPPINGS, //.num_mappings - mapping_sc, //.mapping - nullptr, //.mapping_conventional - nullptr, //.template_indices - }; +const refdata_t structure_fcc = { + PTM_MATCH_FCC, //.type + 12, //.num_nbrs + 20, //.num_facets + 6, //.max_degree + NUM_FCC_GRAPHS, //.num_graphs + graphs_fcc, //.graphs + ptm_template_fcc, //.points + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 + penrose_fcc, //.penrose + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 + NUM_CUBIC_MAPPINGS, //.num_mappings + mapping_fcc, //.mapping + nullptr, //.mapping_conventional + nullptr, //.template_indices +}; -const refdata_t structure_fcc = { PTM_MATCH_FCC, //.type - 12, //.num_nbrs - 20, //.num_facets - 6, //.max_degree - NUM_FCC_GRAPHS, //.num_graphs - graphs_fcc, //.graphs - ptm_template_fcc, //.points - nullptr, //.points_alt1 - nullptr, //.points_alt2 - nullptr, //.points_alt3 - penrose_fcc, //.penrose - nullptr, //.penrose_alt1 - nullptr, //.penrose_alt2 - nullptr, //.penrose_alt3 - NUM_CUBIC_MAPPINGS, //.num_mappings - mapping_fcc, //.mapping - nullptr, //.mapping_conventional - nullptr, //.template_indices - }; +const refdata_t structure_hcp = { + PTM_MATCH_HCP, //.type + 12, //.num_nbrs + 20, //.num_facets + 6, //.max_degree + NUM_HCP_GRAPHS, //.num_graphs + graphs_hcp, //.graphs + ptm_template_hcp, //.points + ptm_template_hcp_alt1, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 + penrose_hcp, //.penrose + penrose_hcp_alt1, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 + NUM_HEX_MAPPINGS, //.num_mappings + mapping_hcp, //.mapping + mapping_hcp_conventional, //.mapping_conventional + template_indices_hcp, //.template_indices +}; -const refdata_t structure_hcp = { PTM_MATCH_HCP, //.type - 12, //.num_nbrs - 20, //.num_facets - 6, //.max_degree - NUM_HCP_GRAPHS, //.num_graphs - graphs_hcp, //.graphs - ptm_template_hcp, //.points - ptm_template_hcp_alt1, //.points_alt1 - nullptr, //.points_alt2 - nullptr, //.points_alt3 - penrose_hcp, //.penrose - penrose_hcp_alt1, //.penrose_alt1 - nullptr, //.penrose_alt2 - nullptr, //.penrose_alt3 - NUM_HEX_MAPPINGS, //.num_mappings - mapping_hcp, //.mapping - mapping_hcp_conventional, //.mapping_conventional - template_indices_hcp, //.template_indices - }; +const refdata_t structure_ico = { + PTM_MATCH_ICO, //.type + 12, //.num_nbrs + 20, //.num_facets + 6, //.max_degree + NUM_ICO_GRAPHS, //.num_graphs + graphs_ico, //.graphs + ptm_template_ico, //.points + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 + penrose_ico, //.penrose + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 + NUM_ICO_MAPPINGS, //.num_mappings + mapping_ico, //.mapping + nullptr, //.mapping_conventional + nullptr, //.template_indices +}; -const refdata_t structure_ico = { PTM_MATCH_ICO, //.type - 12, //.num_nbrs - 20, //.num_facets - 6, //.max_degree - NUM_ICO_GRAPHS, //.num_graphs - graphs_ico, //.graphs - ptm_template_ico, //.points - nullptr, //.points_alt1 - nullptr, //.points_alt2 - nullptr, //.points_alt3 - penrose_ico, //.penrose - nullptr, //.penrose_alt1 - nullptr, //.penrose_alt2 - nullptr, //.penrose_alt3 - NUM_ICO_MAPPINGS, //.num_mappings - mapping_ico, //.mapping - nullptr, //.mapping_conventional - nullptr, //.template_indices - }; +const refdata_t structure_bcc = { + PTM_MATCH_BCC, //.type + 14, //.num_nbrs + 24, //.num_facets + 8, //.max_degree + NUM_BCC_GRAPHS, //.num_graphs + graphs_bcc, //.graphs + ptm_template_bcc, //.points + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 + penrose_bcc, //.penrose + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 + NUM_CUBIC_MAPPINGS, //.num_mappings + mapping_bcc, //.mapping + nullptr, //.mapping_conventional + nullptr, //.template_indices +}; -const refdata_t structure_bcc = { PTM_MATCH_BCC, //.type - 14, //.num_nbrs - 24, //.num_facets - 8, //.max_degree - NUM_BCC_GRAPHS, //.num_graphs - graphs_bcc, //.graphs - ptm_template_bcc, //.points - nullptr, //.points_alt1 - nullptr, //.points_alt2 - nullptr, //.points_alt3 - penrose_bcc, //.penrose - nullptr, //.penrose_alt1 - nullptr, //.penrose_alt2 - nullptr, //.penrose_alt3 - NUM_CUBIC_MAPPINGS, //.num_mappings - mapping_bcc, //.mapping - nullptr, //.mapping_conventional - nullptr, //.template_indices - }; +const refdata_t structure_dcub = { + PTM_MATCH_DCUB, //.type + 16, //.num_nbrs + 28, //.num_facets + 8, //.max_degree + NUM_DCUB_GRAPHS, //.num_graphs + graphs_dcub, //.graphs + ptm_template_dcub, //.points + ptm_template_dcub_alt1, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 + penrose_dcub, //.penrose + penrose_dcub_alt1, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 + NUM_DCUB_MAPPINGS, //.num_mappings + mapping_dcub, //.mapping + mapping_dcub_conventional, //.mapping_conventional + template_indices_dcub, //.template_indices +}; -const refdata_t structure_dcub = { PTM_MATCH_DCUB, //.type - 16, //.num_nbrs - 28, //.num_facets - 8, //.max_degree - NUM_DCUB_GRAPHS, //.num_graphs - graphs_dcub, //.graphs - ptm_template_dcub, //.points - ptm_template_dcub_alt1, //.points_alt1 - nullptr, //.points_alt2 - nullptr, //.points_alt3 - penrose_dcub, //.penrose - penrose_dcub_alt1, //.penrose_alt1 - nullptr, //.penrose_alt2 - nullptr, //.penrose_alt3 - NUM_DCUB_MAPPINGS, //.num_mappings - mapping_dcub, //.mapping - mapping_dcub_conventional, //.mapping_conventional - template_indices_dcub, //.template_indices - }; +const refdata_t structure_dhex = { + PTM_MATCH_DHEX, //.type + 16, //.num_nbrs + 28, //.num_facets + 8, //.max_degree + NUM_DHEX_GRAPHS, //.num_graphs + graphs_dhex, //.graphs + ptm_template_dhex, //.points + ptm_template_dhex_alt1, //.points_alt1 + ptm_template_dhex_alt2, //.points_alt2 + ptm_template_dhex_alt3, //.points_alt3 + penrose_dhex, //.penrose + penrose_dhex_alt1, //.penrose_alt1 + penrose_dhex_alt2, //.penrose_alt2 + penrose_dhex_alt3, //.penrose_alt3 + NUM_DHEX_MAPPINGS, //.num_mappings + mapping_dhex, //.mapping + mapping_dhex_conventional, //.mapping_conventional + template_indices_dhex, //.template_indices +}; -const refdata_t structure_dhex = { PTM_MATCH_DHEX, //.type - 16, //.num_nbrs - 28, //.num_facets - 8, //.max_degree - NUM_DHEX_GRAPHS, //.num_graphs - graphs_dhex, //.graphs - ptm_template_dhex, //.points - ptm_template_dhex_alt1, //.points_alt1 - ptm_template_dhex_alt2, //.points_alt2 - ptm_template_dhex_alt3, //.points_alt3 - penrose_dhex, //.penrose - penrose_dhex_alt1, //.penrose_alt1 - penrose_dhex_alt2, //.penrose_alt2 - penrose_dhex_alt3, //.penrose_alt3 - NUM_DHEX_MAPPINGS, //.num_mappings - mapping_dhex, //.mapping - mapping_dhex_conventional, //.mapping_conventional - template_indices_dhex, //.template_indices - }; - -const refdata_t structure_graphene = { PTM_MATCH_GRAPHENE, //.type - 9, //.num_nbrs - -1, //.num_facets - -1, //.max_degree - -1, //.num_graphs - nullptr, //.graphs - ptm_template_graphene, //.points - ptm_template_graphene_alt1, //.points_alt1 - nullptr, //.points_alt2 - nullptr, //.points_alt3 - penrose_graphene, //.penrose - penrose_graphene_alt1, //.penrose_alt1 - nullptr, //.penrose_alt2 - nullptr, //.penrose_alt3 - -1, //.num_mappings - mapping_graphene, //.mapping - mapping_graphene_conventional, //.mapping_conventional - template_indices_graphene, //.template_indices - }; -} +const refdata_t structure_graphene = { + PTM_MATCH_GRAPHENE, //.type + 9, //.num_nbrs + -1, //.num_facets + -1, //.max_degree + -1, //.num_graphs + nullptr, //.graphs + ptm_template_graphene, //.points + ptm_template_graphene_alt1, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 + penrose_graphene, //.penrose + penrose_graphene_alt1, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 + -1, //.num_mappings + mapping_graphene, //.mapping + mapping_graphene_conventional, //.mapping_conventional + template_indices_graphene, //.template_indices +}; +} // namespace ptm #ifdef __cplusplus extern "C" { #endif -typedef struct ptm_local_handle* ptm_local_handle_t; +typedef struct ptm_local_handle *ptm_local_handle_t; ptm_local_handle_t ptm_initialize_local(); void ptm_uninitialize_local(ptm_local_handle_t ptr); @@ -219,11 +223,8 @@ int ptm_initialize_global(); //------------------------------------ extern bool ptm_initialized; - #ifdef __cplusplus } #endif - #endif - diff --git a/src/USER-PTM/ptm_neighbour_ordering.cpp b/src/USER-PTM/ptm_neighbour_ordering.cpp index 1332b8819b..cae938a7bb 100644 --- a/src/USER-PTM/ptm_neighbour_ordering.cpp +++ b/src/USER-PTM/ptm_neighbour_ordering.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_neighbour_ordering.h b/src/USER-PTM/ptm_neighbour_ordering.h index 2a619880bb..84baf63f51 100644 --- a/src/USER-PTM/ptm_neighbour_ordering.h +++ b/src/USER-PTM/ptm_neighbour_ordering.h @@ -11,22 +11,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #define PTM_NEIGHBOUR_ORDERING_H #include -#include +#include namespace ptm { -int calculate_neighbour_ordering( void* _voronoi_handle, size_t atom_index, int min_points, 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]), void* nbrlist, bool calc_solid_angles, - size_t* nbr_indices, double (*points)[3], int32_t* numbers); +int calculate_neighbour_ordering(void *_voronoi_handle, size_t atom_index, int min_points, + 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]), + void *nbrlist, bool calc_solid_angles, size_t *nbr_indices, + double (*points)[3], int32_t *numbers); -int calculate_two_shell_neighbour_ordering( void* _voronoi_handle, size_t atom_index, 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]), void* nbrlist, - int num_inner, int num_outer, int max_snbrs, bool calc_solid_angles, - size_t* nbr_indices, double (*points)[3], int32_t* numbers); +int calculate_two_shell_neighbour_ordering( + void *_voronoi_handle, size_t atom_index, + 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]), + void *nbrlist, int num_inner, int num_outer, int max_snbrs, bool calc_solid_angles, + size_t *nbr_indices, double (*points)[3], int32_t *numbers); -void* voronoi_initialize_local(); -void voronoi_uninitialize_local(void* ptr); +void *voronoi_initialize_local(); +void voronoi_uninitialize_local(void *ptr); -} +} // namespace ptm #endif - diff --git a/src/USER-PTM/ptm_normalize_vertices.cpp b/src/USER-PTM/ptm_normalize_vertices.cpp index 8817e9faaf..1cd3df073b 100644 --- a/src/USER-PTM/ptm_normalize_vertices.cpp +++ b/src/USER-PTM/ptm_normalize_vertices.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_normalize_vertices.h b/src/USER-PTM/ptm_normalize_vertices.h index 558cd62008..ba6ca375a3 100644 --- a/src/USER-PTM/ptm_normalize_vertices.h +++ b/src/USER-PTM/ptm_normalize_vertices.h @@ -15,7 +15,6 @@ namespace ptm { void subtract_barycentre(int num, double (*points)[3], double (*normalized)[3]); double normalize_vertices(int num, double (*points)[3], double (*normalized)[3]); -} +} // namespace ptm #endif - diff --git a/src/USER-PTM/ptm_polar.cpp b/src/USER-PTM/ptm_polar.cpp index 5e234127a9..a14b8253a4 100644 --- a/src/USER-PTM/ptm_polar.cpp +++ b/src/USER-PTM/ptm_polar.cpp @@ -1,3 +1,4 @@ +// clang-format off /******************************************************************************* * -/_|:|_|_\- * diff --git a/src/USER-PTM/ptm_polar.h b/src/USER-PTM/ptm_polar.h index f11dd98ee9..c1cb76124d 100644 --- a/src/USER-PTM/ptm_polar.h +++ b/src/USER-PTM/ptm_polar.h @@ -10,15 +10,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #ifndef PTM_POLAR_H #define PTM_POLAR_H -#include +#include namespace ptm { -int polar_decomposition_3x3(double* _A, bool right_sided, double* U, double* P); -void InnerProduct(double *A, int num, const double (*coords1)[3], double (*coords2)[3], int8_t* permutation); -int FastCalcRMSDAndRotation(double *A, double E0, double *p_nrmsdsq, double *q, double* U); +int polar_decomposition_3x3(double *_A, bool right_sided, double *U, double *P); +void InnerProduct(double *A, int num, const double (*coords1)[3], double (*coords2)[3], + int8_t *permutation); +int FastCalcRMSDAndRotation(double *A, double E0, double *p_nrmsdsq, double *q, double *U); -} +} // namespace ptm #endif - diff --git a/src/USER-PTM/ptm_quat.cpp b/src/USER-PTM/ptm_quat.cpp index 527f4d1116..c62ec0b9ed 100644 --- a/src/USER-PTM/ptm_quat.cpp +++ b/src/USER-PTM/ptm_quat.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_quat.h b/src/USER-PTM/ptm_quat.h index 6f4d88920e..cb79698eca 100644 --- a/src/USER-PTM/ptm_quat.h +++ b/src/USER-PTM/ptm_quat.h @@ -12,20 +12,19 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI namespace ptm { -int rotate_quaternion_into_cubic_fundamental_zone(double* q); -int rotate_quaternion_into_diamond_cubic_fundamental_zone(double* q); -int rotate_quaternion_into_icosahedral_fundamental_zone(double* q); -int rotate_quaternion_into_hcp_fundamental_zone(double* q); -int rotate_quaternion_into_hcp_conventional_fundamental_zone(double* q); -int rotate_quaternion_into_diamond_hexagonal_fundamental_zone(double* q); +int rotate_quaternion_into_cubic_fundamental_zone(double *q); +int rotate_quaternion_into_diamond_cubic_fundamental_zone(double *q); +int rotate_quaternion_into_icosahedral_fundamental_zone(double *q); +int rotate_quaternion_into_hcp_fundamental_zone(double *q); +int rotate_quaternion_into_hcp_conventional_fundamental_zone(double *q); +int rotate_quaternion_into_diamond_hexagonal_fundamental_zone(double *q); -void normalize_quaternion(double* q); -void quaternion_to_rotation_matrix(double* q, double* U); -void rotation_matrix_to_quaternion(double* u, double* q); -double quat_dot(double* a, double* b); -double quat_misorientation(double* q1, double* q2); +void normalize_quaternion(double *q); +void quaternion_to_rotation_matrix(double *q, double *U); +void rotation_matrix_to_quaternion(double *u, double *q); +double quat_dot(double *a, double *b); +double quat_misorientation(double *q1, double *q2); -} +} // namespace ptm #endif - diff --git a/src/USER-PTM/ptm_structure_matcher.cpp b/src/USER-PTM/ptm_structure_matcher.cpp index b587ad225f..ce4ed3b772 100644 --- a/src/USER-PTM/ptm_structure_matcher.cpp +++ b/src/USER-PTM/ptm_structure_matcher.cpp @@ -1,3 +1,4 @@ +// clang-format off /*Copyright (c) 2016 PM Larsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/src/USER-PTM/ptm_structure_matcher.h b/src/USER-PTM/ptm_structure_matcher.h index 63bc5ed1fe..a636a1b9d6 100644 --- a/src/USER-PTM/ptm_structure_matcher.h +++ b/src/USER-PTM/ptm_structure_matcher.h @@ -10,27 +10,28 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #ifndef PTM_STRUCTURE_MATCHER_H #define PTM_STRUCTURE_MATCHER_H -#include "ptm_initialize_data.h" #include "ptm_constants.h" #include "ptm_convex_hull_incremental.h" +#include "ptm_initialize_data.h" namespace ptm { -typedef struct -{ - double rmsd; - double scale; - double q[4]; //rotation in quaternion form (rigid body transformation) - int8_t mapping[PTM_MAX_POINTS]; - const refdata_t* ref_struct; +typedef struct { + double rmsd; + double scale; + double q[4]; //rotation in quaternion form (rigid body transformation) + int8_t mapping[PTM_MAX_POINTS]; + const refdata_t *ref_struct; } result_t; -int match_general(const refdata_t* s, double (*ch_points)[3], double (*points)[3], convexhull_t* ch, result_t* res); -int match_fcc_hcp_ico(double (*ch_points)[3], double (*points)[3], int32_t flags, convexhull_t* ch, result_t* res); -int match_dcub_dhex(double (*ch_points)[3], double (*points)[3], int32_t flags, convexhull_t* ch, result_t* res); -int match_graphene(double (*points)[3], result_t* res); +int match_general(const refdata_t *s, double (*ch_points)[3], double (*points)[3], convexhull_t *ch, + result_t *res); +int match_fcc_hcp_ico(double (*ch_points)[3], double (*points)[3], int32_t flags, convexhull_t *ch, + result_t *res); +int match_dcub_dhex(double (*ch_points)[3], double (*points)[3], int32_t flags, convexhull_t *ch, + result_t *res); +int match_graphene(double (*points)[3], result_t *res); -} +} // namespace ptm #endif - diff --git a/src/USER-PTM/ptm_voronoi_cell.cpp b/src/USER-PTM/ptm_voronoi_cell.cpp index ab0b9172aa..10a5710f99 100644 --- a/src/USER-PTM/ptm_voronoi_cell.cpp +++ b/src/USER-PTM/ptm_voronoi_cell.cpp @@ -1,3 +1,4 @@ +// clang-format off /* Voro++ Copyright (c) 2008, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required diff --git a/src/USER-PTM/ptm_voronoi_cell.h b/src/USER-PTM/ptm_voronoi_cell.h index 138f290c42..6fea7a7175 100644 --- a/src/USER-PTM/ptm_voronoi_cell.h +++ b/src/USER-PTM/ptm_voronoi_cell.h @@ -40,6 +40,7 @@ works, incorporate into other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form. */ +// clang-format off // Voro++, a 3D cell-based Voronoi library // @@ -362,3 +363,4 @@ class voronoicell_neighbor : public voronoicell_base { #endif +// clang-format on diff --git a/src/USER-PTM/ptm_voronoi_config.h b/src/USER-PTM/ptm_voronoi_config.h index ca5dcd9559..44a0d89d14 100644 --- a/src/USER-PTM/ptm_voronoi_config.h +++ b/src/USER-PTM/ptm_voronoi_config.h @@ -40,7 +40,6 @@ works, incorporate into other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form. */ - // Voro++, a 3D cell-based Voronoi library // // Author : Chris H. Rycroft (LBL / UC Berkeley) @@ -59,53 +58,53 @@ namespace ptm_voro { // These constants set the initial memory allocation for the Voronoi cell /** The initial memory allocation for the number of vertices. */ -const int init_vertices=256; +const int init_vertices = 256; /** The initial memory allocation for the maximum vertex order. */ -const int init_vertex_order=64; +const int init_vertex_order = 64; /** The initial memory allocation for the number of regular vertices of order * 3. */ -const int init_3_vertices=256; +const int init_3_vertices = 256; /** The initial memory allocation for the number of vertices of higher order. */ -const int init_n_vertices=8; +const int init_n_vertices = 8; /** The initial buffer size for marginal cases used by the suretest class. */ -const int init_marginal=64; +const int init_marginal = 64; /** The initial size for the delete stack. */ -const int init_delete_size=256; +const int init_delete_size = 256; /** The initial size for the auxiliary delete stack. */ -const int init_delete2_size=256; +const int init_delete2_size = 256; /** The initial size for the wall pointer array. */ -const int init_wall_size=32; +const int init_wall_size = 32; /** The default initial size for the ordering class. */ -const int init_ordering_size=4096; +const int init_ordering_size = 4096; /** The initial size of the pre_container chunk index. */ -const int init_chunk_size=256; +const int init_chunk_size = 256; // If the initial memory is too small, the program dynamically allocates more. // However, if the limits below are reached, then the program bails out. /** The maximum memory allocation for the number of vertices. */ -const int max_vertices=16777216; +const int max_vertices = 16777216; /** The maximum memory allocation for the maximum vertex order. */ -const int max_vertex_order=2048; +const int max_vertex_order = 2048; /** The maximum memory allocation for the any particular order of vertex. */ -const int max_n_vertices=16777216; +const int max_n_vertices = 16777216; /** The maximum buffer size for marginal cases used by the suretest class. */ -const int max_marginal=16777216; +const int max_marginal = 16777216; /** The maximum size for the delete stack. */ -const int max_delete_size=16777216; +const int max_delete_size = 16777216; /** The maximum size for the auxiliary delete stack. */ -const int max_delete2_size=16777216; +const int max_delete2_size = 16777216; /** The maximum amount of particle memory allocated for a single region. */ -const int max_particle_memory=16777216; +const int max_particle_memory = 16777216; /** The maximum size for the wall pointer array. */ -const int max_wall_size=2048; +const int max_wall_size = 2048; /** The maximum size for the ordering class. */ -const int max_ordering_size=67108864; +const int max_ordering_size = 67108864; /** The maximum size for the pre_container chunk index. */ -const int max_chunk_size=65536; +const int max_chunk_size = 65536; /** The chunk size in the pre_container classes. */ -const int pre_container_chunk_size=1024; +const int pre_container_chunk_size = 1024; #ifndef VOROPP_VERBOSE /** Voro++ can print a number of different status and debugging messages to @@ -120,30 +119,30 @@ const int pre_container_chunk_size=1024; /** If a point is within this distance of a cutting plane, then the code * assumes that point exactly lies on the plane. */ -const double tolerance=1e-11; +const double tolerance = 1e-11; /** If a point is within this distance of a cutting plane, then the code stores * whether this point is inside, outside, or exactly on the cutting plane in * the marginal cases buffer, to prevent the test giving a different result on * a subsequent evaluation due to floating point rounding errors. */ -const double tolerance2=2e-11; +const double tolerance2 = 2e-11; /** The square of the tolerance, used when deciding whether some squared * quantities are large enough to be used. */ -const double tolerance_sq=tolerance*tolerance; +const double tolerance_sq = tolerance * tolerance; /** A large number that is used in the computation. */ -const double large_number=1e30; +const double large_number = 1e30; /** A radius to use as a placeholder when no other information is available. */ -const double default_radius=0.5; +const double default_radius = 0.5; /** The maximum number of shells of periodic images to test over. */ -const int max_unit_voro_shells=10; +const int max_unit_voro_shells = 10; /** A guess for the optimal number of particles per block, used to set up the * container grid. */ -const double optimal_particles=5.6; +const double optimal_particles = 5.6; /** If this is set to 1, then the code reports any instances of particles being * put outside of the container geometry. */ @@ -167,6 +166,6 @@ const double optimal_particles=5.6; * arguments passed to the command line utility. */ #define VOROPP_CMD_LINE_ERROR 4 -} +} // namespace ptm_voro #endif diff --git a/src/USER-QMMM/fix_qmmm.cpp b/src/USER-QMMM/fix_qmmm.cpp index fab658f8f2..1f24728eca 100644 --- a/src/USER-QMMM/fix_qmmm.cpp +++ b/src/USER-QMMM/fix_qmmm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-QMMM/fix_qmmm.h b/src/USER-QMMM/fix_qmmm.h index f7f599e8f1..830e52d772 100644 --- a/src/USER-QMMM/fix_qmmm.h +++ b/src/USER-QMMM/fix_qmmm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,11 +11,10 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - #ifdef FIX_CLASS - -FixStyle(qmmm,FixQMMM) - +// clang-format off +FixStyle(qmmm,FixQMMM); +// clang-format on #else #ifndef LMP_FIX_QMMM_H @@ -47,35 +46,35 @@ class FixQMMM : public Fix { int ec_fill_radii(double *, int); protected: - MPI_Comm qm_comm; // intra communicator with QM subsystem - MPI_Comm mm_comm; // intra communicator with MM subsystem - void *comm_buf; // message buffer for internal communication - void *qm_idmap; // hash for mapping QM atom indices to consistent order. - tagint *qm_remap; // list of the hash keys for reverse mapping. - void *mm_idmap; // hash for mapping MM atom indices to consistent order. - tagint *mm_remap; // list of the hash keys for reverse mapping. - double *qm_coord; // QM system coordinates - double *qm_charge; // QM system charges - double *mm_coord; // MM system coordinates used for electrostatic coupling - int *mm_type; // system atom types used for electrostatic coupling - double *qm_force; // QM force data buffer - double *mm_force; // MM slave force data buffer - double qmmm_fscale; // scale factor for forces. in case VMD's units are off. + MPI_Comm qm_comm; // intra communicator with QM subsystem + MPI_Comm mm_comm; // intra communicator with MM subsystem + void *comm_buf; // message buffer for internal communication + void *qm_idmap; // hash for mapping QM atom indices to consistent order. + tagint *qm_remap; // list of the hash keys for reverse mapping. + void *mm_idmap; // hash for mapping MM atom indices to consistent order. + tagint *mm_remap; // list of the hash keys for reverse mapping. + double *qm_coord; // QM system coordinates + double *qm_charge; // QM system charges + double *mm_coord; // MM system coordinates used for electrostatic coupling + int *mm_type; // system atom types used for electrostatic coupling + double *qm_force; // QM force data buffer + double *mm_force; // MM slave force data buffer + double qmmm_fscale; // scale factor for forces. in case VMD's units are off. - int num_qm; // total number of QM atoms controlled by this fix - int num_mm; // total number of MM atoms for electrostatic coupling - int mm_group; // group of MM atoms for electrostatic coupling - int mm_grbit; // group of MM atoms for electrostatic coupling - int comm_mode; // QM/MM communication method (MPI or shmemq) - int qmmm_mode; // QM/MM coupling mode (mechanical or electrostatic) - int qmmm_role; // role in QM/MM coupling (MM master or MM slave) - int size_one; // size of one element in communication buffer - int maxbuf; // size of communication buffer - int do_init; // flag for one time initialization - int verbose; // print level (<= 0 means no output) + int num_qm; // total number of QM atoms controlled by this fix + int num_mm; // total number of MM atoms for electrostatic coupling + int mm_group; // group of MM atoms for electrostatic coupling + int mm_grbit; // group of MM atoms for electrostatic coupling + int comm_mode; // QM/MM communication method (MPI or shmemq) + int qmmm_mode; // QM/MM coupling mode (mechanical or electrostatic) + int qmmm_role; // role in QM/MM coupling (MM master or MM slave) + int size_one; // size of one element in communication buffer + int maxbuf; // size of communication buffer + int do_init; // flag for one time initialization + int verbose; // print level (<= 0 means no output) }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index a21f5a59f0..88588f6c01 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -220,7 +221,7 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) // create a new compute potential energy compute id_pe = utils::strdup(std::string(id) + "_pe"); - modify->add_compute(fmt::format("{} all pe",id_temp)); + modify->add_compute(fmt::format("{} all pe",id_pe)); peflag = 1; // allocate qbmsst diff --git a/src/USER-QTB/fix_qbmsst.h b/src/USER-QTB/fix_qbmsst.h index 31e9ae77cc..819bbd63a3 100644 --- a/src/USER-QTB/fix_qbmsst.h +++ b/src/USER-QTB/fix_qbmsst.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -17,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(qbmsst,FixQBMSST) - +// clang-format off +FixStyle(qbmsst,FixQBMSST); +// clang-format on #else #ifndef FIX_QBMSST_H @@ -51,58 +51,59 @@ class FixQBMSST : public Fix { private: // msst parameters - int direction; // Direction of shock - double velocity; // Velocity of the shock - double qmass; // Effective cell mass - double mu; // Effective cell viscosity - double e0; // Initial energy - double v0; // Initial volume - double p0; // Initial pressure - int p0_set; // Is pressure set - int v0_set; // Is volume set - int e0_set; // Is energy set - double tscale; // Converts thermal energy to compressive strain ke at simulation start - char *id_temp,*id_press, *id_pe; // Strings with identifiers of created computes. - int tflag,pflag,vsflag,peflag; // Flags to keep track of computes that were created. - double dtv; // update->dt - double dtf; // Full step size - double dthalf; // half step size - bigint ntotal; // atom->natoms - double boltz,nktv2p, mvv2e; // Boltzmann factor and unit conversions - class Compute *temperature; // Computes created to evaluate - class Compute *pressure; // thermodynamic quantities. + int direction; // Direction of shock + double velocity; // Velocity of the shock + double qmass; // Effective cell mass + double mu; // Effective cell viscosity + double e0; // Initial energy + double v0; // Initial volume + double p0; // Initial pressure + int p0_set; // Is pressure set + int v0_set; // Is volume set + int e0_set; // Is energy set + double tscale; // Converts thermal energy to compressive strain ke at simulation start + char *id_temp, *id_press, *id_pe; // Strings with identifiers of created computes. + int tflag, pflag, vsflag, peflag; // Flags to keep track of computes that were created. + double dtv; // update->dt + double dtf; // Full step size + double dthalf; // half step size + bigint ntotal; // atom->natoms + double boltz, nktv2p, mvv2e; // Boltzmann factor and unit conversions + class Compute *temperature; // Computes created to evaluate + class Compute *pressure; // thermodynamic quantities. class Compute *pe; - double **old_velocity; // Saved velocities. - int atoms_allocated; // size of old_velocity + double **old_velocity; // Saved velocities. + int atoms_allocated; // size of old_velocity double dilation[3]; - double omega[3]; // Time derivative of the volume. - double total_mass; // Mass of the computational cell - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int *rfix; // indices of rigid fixes - double p_current[3]; // pressure - double velocity_sum; // Sum of the velocities squared. - double lagrangian_position; // Lagrangian location of computational cell + double omega[3]; // Time derivative of the volume. + double total_mass; // Mass of the computational cell + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int *rfix; // indices of rigid fixes + double p_current[3]; // pressure + double velocity_sum; // Sum of the velocities squared. + double lagrangian_position; // Lagrangian location of computational cell // qbmsst parameters - double t_period, fric_coef; // friction coefficient - int seed; // seed for the random number generator - double f_max; // frequency cutoff - int N_f; // number of frequency grid - double eta; // coupling coefficient between shock and the qtb - int beta; // average beta steps before updating the qtb temperature - double t_init; // initial qtb temperature - int qtb_set; // 1 if its a restarting qbmsst, 0 if not - int counter_l, counter_mu; // counter l and mu - double t_current; // qtb temperature - double h_timestep; // time step to update the random forces - int alpha; // number of time steps to update the random forces - class RanMars *random; // random number generator - double *gfactor; // factors of random forces - double *omega_H,*time_H; // H gives the desired power spectrum - double **random_array_0, **random_array_1, **random_array_2; // random number arrays give independence between atoms and directions - double **fran; // random forces - double old_eavg; // average previous energies + double t_period, fric_coef; // friction coefficient + int seed; // seed for the random number generator + double f_max; // frequency cutoff + int N_f; // number of frequency grid + double eta; // coupling coefficient between shock and the qtb + int beta; // average beta steps before updating the qtb temperature + double t_init; // initial qtb temperature + int qtb_set; // 1 if its a restarting qbmsst, 0 if not + int counter_l, counter_mu; // counter l and mu + double t_current; // qtb temperature + double h_timestep; // time step to update the random forces + int alpha; // number of time steps to update the random forces + class RanMars *random; // random number generator + double *gfactor; // factors of random forces + double *omega_H, *time_H; // H gives the desired power spectrum + double **random_array_0, **random_array_1, + **random_array_2; // random number arrays give independence between atoms and directions + double **fran; // random forces + double old_eavg; // average previous energies // functions void couple(); @@ -118,7 +119,7 @@ class FixQBMSST : public Fix { double compute_lagrangian_position(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-QTB/fix_qtb.cpp b/src/USER-QTB/fix_qtb.cpp index a4f6e8678f..ab82759e79 100644 --- a/src/USER-QTB/fix_qtb.cpp +++ b/src/USER-QTB/fix_qtb.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-QTB/fix_qtb.h b/src/USER-QTB/fix_qtb.h index 88726e7253..1f52e9f4b0 100644 --- a/src/USER-QTB/fix_qtb.h +++ b/src/USER-QTB/fix_qtb.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -17,9 +17,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(qtb,FixQTB) - +// clang-format off +FixStyle(qtb,FixQTB); +// clang-format on #else #ifndef LMP_FIX_QTB_H @@ -47,26 +47,26 @@ class FixQTB : public Fix { private: // qtb parameters - int counter_mu; // counter l and mu - double t_period, fric_coef; // friction coefficient - int seed; // seed for the random number generator - double f_max; // frequency cutoff - int N_f; // number of frequency grid - double t_target; // target qtb temperature + int counter_mu; // counter l and mu + double t_period, fric_coef; // friction coefficient + int seed; // seed for the random number generator + double f_max; // frequency cutoff + int N_f; // number of frequency grid + double t_target; // target qtb temperature char *id_temp; class Compute *temperature; - double h_timestep; // time step to update the random forces - int alpha; // number of time steps to update the random forces - class RanMars *random; // random number generator - double *gfactor1,*gfactor3; // factors of frictions and random forces - double *omega_H,*time_H; // H gives the desired power spectrum + double h_timestep; // time step to update the random forces + int alpha; // number of time steps to update the random forces + class RanMars *random; // random number generator + double *gfactor1, *gfactor3; // factors of frictions and random forces + double *omega_H, *time_H; // H gives the desired power spectrum // random number arrays give independence between atoms and directions double **random_array_0, **random_array_1, **random_array_2; int nlevels_respa; - double **fran, fsum[3], fsumall[3]; // random forces and their sums + double **fran, fsum[3], fsumall[3]; // random forces and their sums }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-QUIP/pair_quip.cpp b/src/USER-QUIP/pair_quip.cpp index 365ab3b414..20f1b5a2fd 100644 --- a/src/USER-QUIP/pair_quip.cpp +++ b/src/USER-QUIP/pair_quip.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-QUIP/pair_quip.h b/src/USER-QUIP/pair_quip.h index b6029f0c40..3040dc0ffd 100644 --- a/src/USER-QUIP/pair_quip.h +++ b/src/USER-QUIP/pair_quip.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(quip,PairQUIP) - +// clang-format off +PairStyle(quip,PairQUIP); +// clang-format on #else #ifndef LMP_PAIR_QUIP_H @@ -22,15 +22,11 @@ PairStyle(quip,PairQUIP) #include "pair.h" -extern "C" -{ - int quip_lammps_api_version(); - void quip_lammps_wrapper(int*, int*, int*, int*, - int*, int*, int*, - int*, int*, double*, - int*, int*, double*, - double*, double*, double*, double*, double*); - void quip_lammps_potential_initialise(int*, int*, double*, char*, int*, char*, int*); +extern "C" { +int quip_lammps_api_version(); +void quip_lammps_wrapper(int *, int *, int *, int *, int *, int *, int *, int *, int *, double *, + int *, int *, double *, double *, double *, double *, double *, double *); +void quip_lammps_potential_initialise(int *, int *, double *, char *, int *, char *, int *); } namespace LAMMPS_NS { @@ -49,17 +45,16 @@ class PairQUIP : public Pair { private: double cutoff; - int* quip_potential; + int *quip_potential; int n_quip_potential; - int *map; // mapping from atom types to elements - char *quip_file; // mapping from atom types to elements + int *map; // mapping from atom types to elements + char *quip_file; // mapping from atom types to elements int n_quip_file; - char *quip_string; // mapping from atom types to elements + char *quip_string; // mapping from atom types to elements int n_quip_string; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 14191cb10d..46d7efdf8d 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator -https://lammps.sandia.gov/, Sandia National Laboratories +https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -2212,6 +2213,7 @@ double FixBondReact::rxnfunction(std::string rxnfunc, std::string varid, if (rxnfunc == "rxnsum") return sumvvec; if (rxnfunc == "rxnave") return sumvvec/nsum; + return 0.0; } /* ---------------------------------------------------------------------- diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index 15c640684f..abb2b5b123 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(bond/react,FixBondReact) - +// clang-format off +FixStyle(bond/react,FixBondReact); +// clang-format on #else #ifndef LMP_FIX_BOND_REACT_H @@ -30,10 +30,9 @@ namespace LAMMPS_NS { class FixBondReact : public Fix { public: - - enum {MAXLINE=256}; // max length of line read from files - enum {MAXCONIDS=4}; // max # of IDs used by any constraint - enum {MAXCONPAR=5}; // max # of constraint parameters + enum { MAXLINE = 256 }; // max length of line read from files + enum { MAXCONIDS = 4 }; // max # of IDs used by any constraint + enum { MAXCONPAR = 5 }; // max # of constraint parameters FixBondReact(class LAMMPS *, int, char **); ~FixBondReact(); @@ -52,15 +51,15 @@ class FixBondReact : public Fix { double memory_usage(); private: - int me,nprocs; + int me, nprocs; int newton_bond; int nreacts; int *nevery; FILE *fp; - int *iatomtype,*jatomtype; + int *iatomtype, *jatomtype; int *seed; - double **cutsq,*fraction; - int *max_rxn,*nlocalskips,*nghostlyskips; + double **cutsq, *fraction; + int *max_rxn, *nlocalskips, *nghostlyskips; tagint lastcheck; int stabilization_flag; int reset_mol_ids_flag; @@ -77,100 +76,102 @@ class FixBondReact : public Fix { int nrxnfunction; std::vector rxnfunclist; int narrhenius; - int **var_flag,**var_id; // for keyword values with variable inputs + int **var_flag, **var_id; // for keyword values with variable inputs int status; int *groupbits; - int rxnID; // integer ID for identifying current bond/react - char **rxn_name; // name of reaction + int rxnID; // integer ID for identifying current bond/react + char **rxn_name; // name of reaction int *reaction_count; int *reaction_count_total; - int nmax; // max num local atoms - int max_natoms; // max natoms in a molecule template - tagint *partner,*finalpartner; + int nmax; // max num local atoms + int max_natoms; // max natoms in a molecule template + tagint *partner, *finalpartner; double **distsq; int *nattempt; int maxattempt; int allnattempt; tagint ***attempt; - class Molecule *onemol; // pre-reacted molecule template - class Molecule *twomol; // post-reacted molecule template - Fix *fix1; // nve/limit used to relax reaction sites - Fix *fix2; // properties/atom used to indicate 1) relaxing atoms - // 2) to which 'react' atom belongs - Fix *fix3; // property/atom used for system-wide thermostat - class RanMars **random; // random number for 'prob' keyword - class RanMars **rrhandom; // random number for Arrhenius constraint + class Molecule *onemol; // pre-reacted molecule template + class Molecule *twomol; // post-reacted molecule template + Fix *fix1; // nve/limit used to relax reaction sites + Fix *fix2; // properties/atom used to indicate 1) relaxing atoms + // 2) to which 'react' atom belongs + Fix *fix3; // property/atom used for system-wide thermostat + class RanMars **random; // random number for 'prob' keyword + class RanMars **rrhandom; // random number for Arrhenius constraint class NeighList *list; - class ResetMolIDs *reset_mol_ids; // class for resetting mol IDs + class ResetMolIDs *reset_mol_ids; // class for resetting mol IDs - int *reacted_mol,*unreacted_mol; - int *limit_duration; // indicates how long to relax - char *nve_limit_xmax; // indicates max distance allowed to move when relaxing - char *id_fix1; // id of internally created fix nve/limit - char *id_fix2; // id of internally created fix per-atom properties - char *id_fix3; // id of internally created 'stabilization group' per-atom property fix - char *statted_id; // name of 'stabilization group' per-atom property - char *master_group; // group containing relaxing atoms from all fix rxns - char *exclude_group; // group for system-wide thermostat + int *reacted_mol, *unreacted_mol; + int *limit_duration; // indicates how long to relax + char *nve_limit_xmax; // indicates max distance allowed to move when relaxing + char *id_fix1; // id of internally created fix nve/limit + char *id_fix2; // id of internally created fix per-atom properties + char *id_fix3; // id of internally created 'stabilization group' per-atom property fix + char *statted_id; // name of 'stabilization group' per-atom property + char *master_group; // group containing relaxing atoms from all fix rxns + char *exclude_group; // group for system-wide thermostat - int countflag,commflag; + int countflag, commflag; int nlevels_respa; - void superimpose_algorithm(); // main function of the superimpose algorithm + void superimpose_algorithm(); // main function of the superimpose algorithm - int *ibonding,*jbonding; - int *closeneigh; // indicates if bonding atoms of a rxn are 1-2, 1-3, or 1-4 neighbors - int nedge,nequivalent,ndelete,ncreate,nchiral; // # edge, equivalent atoms in mapping file - int attempted_rxn; // there was an attempt! + int *ibonding, *jbonding; + int *closeneigh; // indicates if bonding atoms of a rxn are 1-2, 1-3, or 1-4 neighbors + int nedge, nequivalent, ndelete, ncreate, nchiral; // # edge, equivalent atoms in mapping file + int attempted_rxn; // there was an attempt! int *local_rxn_count; int *ghostly_rxn_count; - int avail_guesses; // num of restore points available - int *guess_branch; // used when there is more than two choices when guessing - int **restore_pt; // contains info about restore points - tagint **restore; // contaings info about restore points - int *pioneer_count; // counts pioneers + int avail_guesses; // num of restore points available + int *guess_branch; // used when there is more than two choices when guessing + int **restore_pt; // contains info about restore points + tagint **restore; // contaings info about restore points + int *pioneer_count; // counts pioneers - int **edge; // atoms in molecule templates with incorrect valences - int ***equivalences; // relation between pre- and post-reacted templates - int ***reverse_equiv; // re-ordered equivalences - int **landlocked_atoms; // all atoms at least three bonds away from edge atoms - int **custom_charges; // atoms whose charge should be updated - int **delete_atoms; // atoms in pre-reacted templates to delete - int **create_atoms; // atoms in post-reacted templates to create - int ***chiral_atoms; // pre-react chiral atoms. 1) flag 2) orientation 3-4) ordered atom types + int **edge; // atoms in molecule templates with incorrect valences + int ***equivalences; // relation between pre- and post-reacted templates + int ***reverse_equiv; // re-ordered equivalences + int **landlocked_atoms; // all atoms at least three bonds away from edge atoms + int **custom_charges; // atoms whose charge should be updated + int **delete_atoms; // atoms in pre-reacted templates to delete + int **create_atoms; // atoms in post-reacted templates to create + int ***chiral_atoms; // pre-react chiral atoms. 1) flag 2) orientation 3-4) ordered atom types int nvvec; - double *vvec; // per-atom vector to store variable constraint atom-style variable values + double *vvec; // per-atom vector to store variable constraint atom-style variable values - int **nxspecial,**onemol_nxspecial,**twomol_nxspecial; // full number of 1-4 neighbors - tagint **xspecial,**onemol_xspecial,**twomol_xspecial; // full 1-4 neighbor list + int **nxspecial, **onemol_nxspecial, **twomol_nxspecial; // full number of 1-4 neighbors + tagint **xspecial, **onemol_xspecial, **twomol_xspecial; // full 1-4 neighbor list - int pion,neigh,trace; // important indices for various loops. required for restore points - int lcl_inst; // reaction instance - tagint **glove; // 1st colmn: pre-reacted template, 2nd colmn: global IDs + int pion, neigh, trace; // important indices for various loops. required for restore points + int lcl_inst; // reaction instance + tagint **glove; // 1st colmn: pre-reacted template, 2nd colmn: global IDs // for all mega_gloves and global_mega_glove: first row is the ID of bond/react - tagint **local_mega_glove; // consolidation local of reaction instances - tagint **ghostly_mega_glove; // consolidation nonlocal of reaction instances - tagint **global_mega_glove; // consolidation (inter-processor) of gloves containing nonlocal atoms - int *localsendlist; // indicates ghosts of other procs - int local_num_mega; // num of local reaction instances - int ghostly_num_mega; // num of ghostly reaction instances - int global_megasize; // num of reaction instances in global_mega_glove - int *pioneers; // during Superimpose Algorithm, atoms which have been assigned, but whose first neighbors haven't - int glove_counter; // used to determine when to terminate Superimpose Algorithm + tagint **local_mega_glove; // consolidation local of reaction instances + tagint **ghostly_mega_glove; // consolidation nonlocal of reaction instances + tagint * + *global_mega_glove; // consolidation (inter-processor) of gloves containing nonlocal atoms + int *localsendlist; // indicates ghosts of other procs + int local_num_mega; // num of local reaction instances + int ghostly_num_mega; // num of ghostly reaction instances + int global_megasize; // num of reaction instances in global_mega_glove + int * + pioneers; // during Superimpose Algorithm, atoms which have been assigned, but whose first neighbors haven't + int glove_counter; // used to determine when to terminate Superimpose Algorithm void read(int); void EdgeIDs(char *, int); void Equivalences(char *, int); void DeleteAtoms(char *, int); - void CreateAtoms(char *,int); + void CreateAtoms(char *, int); void CustomCharges(int, int); void ChiralCenters(char *, int); void ReadConstraints(char *, int); void readID(char *, int, int, int); - void make_a_guess (); + void make_a_guess(); void neighbor_loop(); void check_a_neighbor(); void crosscheck_the_neighbor(); @@ -181,7 +182,7 @@ class FixBondReact : public Fix { double get_temperature(tagint **, int, int); double custom_constraint(std::string); double rxnfunction(std::string, std::string, std::string); - int get_chirality(double[12]); // get handedness given an ordered set of coordinates + int get_chirality(double[12]); // get handedness given an ordered set of coordinates void open(char *); void readline(char *); @@ -197,7 +198,7 @@ class FixBondReact : public Fix { int insert_atoms(tagint **, int); void unlimit_bond(); void limit_bond(int); - void dedup_mega_gloves(int); //dedup global mega_glove + void dedup_mega_gloves(int); //dedup global mega_glove virtual void write_restart(FILE *); virtual void restart(char *buf); @@ -220,10 +221,9 @@ class FixBondReact : public Fix { // DEBUG void print_bb(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-REACTION/superpose3d.h b/src/USER-REACTION/superpose3d.h index 51de3ea739..d3836691d1 100644 --- a/src/USER-REACTION/superpose3d.h +++ b/src/USER-REACTION/superpose3d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -25,7 +25,7 @@ #ifndef LMP_SUPERPOSE3D_H #define LMP_SUPERPOSE3D_H -#include "math_eigen_impl.h" //functions to calculate eigenvalues and eigenvectors +#include "math_eigen_impl.h" //functions to calculate eigenvalues and eigenvectors // ----------------------------------------------------------- // ------------------------ INTERFACE ------------------------ @@ -35,32 +35,30 @@ /// Superpose(). It is useful for calculating the optimal /// superposition (rotations, translations, and scale transformations) /// between two point clouds of the same size. -template +template class Superpose3D { -private: - size_t N; //number of points in the point clouds - Scalar *aWeights; //weights applied to points when computing RMSD - MathEigen::Jacobi eigen_calc; // calc eigenvectors - Scalar **aaXf_shifted; //preallocated space for fixed point cloud (Nx3 array) - Scalar **aaXm_shifted; //preallocated space for mobile point cloud (Nx3 array) + private: + size_t N; //number of points in the point clouds + Scalar *aWeights; //weights applied to points when computing RMSD + MathEigen::Jacobi eigen_calc; // calc eigenvectors + Scalar **aaXf_shifted; //preallocated space for fixed point cloud (Nx3 array) + Scalar **aaXm_shifted; //preallocated space for mobile point cloud (Nx3 array) -public: + public: // The following data members store the rotation, translation and scale // after optimal superposition - Scalar **R; //!< store optimal rotation here (this is a 3x3 array). - Scalar T[3]; //!< store optimal translation here - Scalar c; //!< store optimal scale (typically 1 unless requested by the user) - Scalar q[4]; //!< quaternion corresponding to the rotation stored in R. - // The first entry of q is cos(θ/2). The remaining 3 entries - // of q are the axis of rotation (with length sin(θ/2)). - // (Note: This is not the same as "p" from Diamond's 1988 paper.) + Scalar **R; //!< store optimal rotation here (this is a 3x3 array). + Scalar T[3]; //!< store optimal translation here + Scalar c; //!< store optimal scale (typically 1 unless requested by the user) + Scalar q[4]; //!< quaternion corresponding to the rotation stored in R. + // The first entry of q is cos(θ/2). The remaining 3 entries + // of q are the axis of rotation (with length sin(θ/2)). + // (Note: This is not the same as "p" from Diamond's 1988 paper.) - Superpose3D(size_t N = 0); //!< N=number of points in both point clouds + Superpose3D(size_t N = 0); //!< N=number of points in both point clouds - Superpose3D(size_t N, //!< N = number of points in both point clouds - ConstArray aWeights); //!< weight per point for computing RMSD + Superpose3D(size_t N, //!< N = number of points in both point clouds + ConstArray aWeights); //!< weight per point for computing RMSD ~Superpose3D(); @@ -108,65 +106,62 @@ public: /// After this function is called, the optimal rotation, translation, /// and scale (if requested) will be stored in the "R", "T", and "c" /// public data members. - Scalar Superpose(ConstArrayOfCoords aaXf, //!< coords for the "frozen" object - ConstArrayOfCoords aaXm, //!< coords for the "mobile" object - bool allow_rescale=false //!< rescale mobile object? (c≠1?) - ); + Scalar Superpose(ConstArrayOfCoords aaXf, //!< coords for the "frozen" object + ConstArrayOfCoords aaXm, //!< coords for the "mobile" object + bool allow_rescale = false //!< rescale mobile object? (c≠1?) + ); // C++ boilerplate: copy and move constructor, swap, and assignment operator - Superpose3D(const Superpose3D& source); - Superpose3D(Superpose3D&& other); - void swap(Superpose3D &other); - Superpose3D& operator = (Superpose3D source); - -private: + Superpose3D(const Superpose3D &source); + Superpose3D(Superpose3D &&other); + void swap(Superpose3D &other); + Superpose3D & + operator=(Superpose3D source); + private: // memory management: void Alloc(size_t N); void Init(); void Dealloc(); -}; // class Superpose3D - - - - +}; // class Superpose3D // -------------- IMPLEMENTATION -------------- +template static inline Scalar SQR(Scalar x) +{ + return x * x; +} -template -static inline Scalar SQR(Scalar x) {return x*x;} - -template -Scalar Superpose3D:: -Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object - ConstArrayOfCoords aaXm, // coords for the "mobile" object - bool allow_rescale) // rescale mobile object? (c!=1?) +template +Scalar Superpose3D::Superpose( + ConstArrayOfCoords aaXf, // coords for the "frozen" object + ConstArrayOfCoords aaXm, // coords for the "mobile" object + bool allow_rescale) // rescale mobile object? (c!=1?) { // Find the center of mass of each object: Scalar aCenter_f[3] = {0.0, 0.0, 0.0}; Scalar aCenter_m[3] = {0.0, 0.0, 0.0}; Scalar sum_weights = 0.0; - for (size_t n=0; n < N; n++) { + for (size_t n = 0; n < N; n++) { Scalar weight = aWeights[n]; - for (int d=0; d < 3; d++) { - aCenter_f[d] += aaXf[n][d]*weight; - aCenter_m[d] += aaXm[n][d]*weight; + for (int d = 0; d < 3; d++) { + aCenter_f[d] += aaXf[n][d] * weight; + aCenter_m[d] += aaXm[n][d] * weight; } sum_weights += weight; } //assert(sum_weights != 0.0); - for (int d=0; d < 3; d++) { + for (int d = 0; d < 3; d++) { aCenter_f[d] /= sum_weights; aCenter_m[d] /= sum_weights; } //Subtract the centers-of-mass from the original coordinates for each object - for (size_t n=0; n < N; n++) { - for (int d=0; d < 3; d++) { + for (size_t n = 0; n < N; n++) { + for (int d = 0; d < 3; d++) { // shift the coordinates so that the new center of mass is at the origin aaXf_shifted[n][d] = aaXf[n][d] - aCenter_f[d]; aaXm_shifted[n][d] = aaXm[n][d] - aCenter_m[d]; @@ -175,29 +170,24 @@ Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object // Calculate the "M" array from the Diamond paper (equation 16) Scalar M[3][3]; - for (int i=0; i < 3; i++) - for (int j=0; j < 3; j++) - M[i][j] = 0.0; + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) M[i][j] = 0.0; - for (size_t n=0; n < N; n++) { + for (size_t n = 0; n < N; n++) { Scalar weight = aWeights[n]; - for (int i=0; i < 3; i++) { - for (int j=0; j < 3; j++) { - M[i][j] += weight * aaXm_shifted[n][i] * aaXf_shifted[n][j]; - } + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { M[i][j] += weight * aaXm_shifted[n][i] * aaXf_shifted[n][j]; } } } // Calculate Q (equation 17) Scalar traceM = 0.0; - for (int i=0; i < 3; i++) - traceM += M[i][i]; + for (int i = 0; i < 3; i++) traceM += M[i][i]; Scalar Q[3][3]; - for (int i=0; i < 3; i++) { - for (int j=0; j < 3; j++) { + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { Q[i][j] = M[i][j] + M[j][i]; - if (i==j) - Q[i][j] -= 2.0 * traceM; + if (i == j) Q[i][j] -= 2.0 * traceM; } } @@ -212,15 +202,14 @@ Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object // Scalar P[4][4]; // ...because most matrix solvers expect arrays in pointer-to-pointer format. // (a different format). Below I create a fixed size matrix P in this format. - Scalar _P[4*4]; // Contiguous 1D array for storing contents of the 2D P array - Scalar *P[4]; // This version of P has has ** (pointer-to-pointer) format. - for (int i=0; i < 4; i++) // We must make sure that - P[i] = &(_P[4*i]); // P[i] points to the appropriate location in memory + Scalar _P[4 * 4]; // Contiguous 1D array for storing contents of the 2D P array + Scalar *P[4]; // This version of P has has ** (pointer-to-pointer) format. + for (int i = 0; i < 4; i++) // We must make sure that + P[i] = &(_P[4 * i]); // P[i] points to the appropriate location in memory // Now fill the P array - for (int i=0; i < 3; i++) - for (int j=0; j < 3; j++) - P[i][j] = Q[i][j]; + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) P[i][j] = Q[i][j]; P[0][3] = V[0]; P[3][0] = V[0]; P[1][3] = V[1]; @@ -230,89 +219,86 @@ Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object P[3][3] = 0.0; // The vector "p" contains the optimal rotation (backwards quaternion format) - Scalar p[4] = {0.0, 0.0, 0.0, 1.0}; // default value - Scalar pPp = 0.0; // = p^T * P * p (zero by default) - Scalar rmsd = 0.0; // default value + Scalar p[4] = {0.0, 0.0, 0.0, 1.0}; // default value + Scalar pPp = 0.0; // = p^T * P * p (zero by default) + Scalar rmsd = 0.0; // default value - bool singular = N<2; // (it doesn't make sense to rotate a single point) + bool singular = N < 2; // (it doesn't make sense to rotate a single point) - if (! singular) { + if (!singular) { // Calculate the principal eigenvalue and eigenvector of matrix P. // Store the principal eigenvector in "p" // The vector "p" will contain the optimal rotation (in quaternion format) - Scalar Evl[4]; // Store the eigenvalues of P here. - Scalar *Evc[4]; // Store the eigevectors here. This version has ** format. - Scalar _Evc[4*4]; // Contiguous 1D array for storing contents of "Evc" array - for (int i=0; i < 4; i++) // We must make sure that - Evc[i] = &(_Evc[4*i]); // Evc[i] points to the correct location in memory + Scalar Evl[4]; // Store the eigenvalues of P here. + Scalar *Evc[4]; // Store the eigevectors here. This version has ** format. + Scalar _Evc[4 * 4]; // Contiguous 1D array for storing contents of "Evc" array + for (int i = 0; i < 4; i++) // We must make sure that + Evc[i] = &(_Evc[4 * i]); // Evc[i] points to the correct location in memory eigen_calc.Diagonalize(P, Evl, Evc); // Note: The eigenvalues are sorted in decreasing order by default. - pPp = Evl[0]; // = the maximum eigenvalue of P - for (int i=0; i < 4; i++) - p[i] = Evc[0][i]; //copy eigenvector corresponding to this eigenvalue to p - } //if (! singular) + pPp = Evl[0]; // = the maximum eigenvalue of P + for (int i = 0; i < 4; i++) + p[i] = Evc[0][i]; //copy eigenvector corresponding to this eigenvalue to p + } //if (! singular) // Now normalize p Scalar pnorm = 0.0; - for (int i=0; i < 4; i++) - pnorm += p[i]*p[i]; + for (int i = 0; i < 4; i++) pnorm += p[i] * p[i]; pnorm = sqrt(pnorm); - for (int i=0; i < 4; i++) - p[i] /= pnorm; + for (int i = 0; i < 4; i++) p[i] /= pnorm; // Finally, calculate the rotation matrix corresponding to "p" // (convert a quaternion into a 3x3 rotation matrix) - R[0][0] = (p[0]*p[0])-(p[1]*p[1])-(p[2]*p[2])+(p[3]*p[3]); - R[1][1] = -(p[0]*p[0])+(p[1]*p[1])-(p[2]*p[2])+(p[3]*p[3]); - R[2][2] = -(p[0]*p[0])-(p[1]*p[1])+(p[2]*p[2])+(p[3]*p[3]); - R[0][1] = 2*(p[0]*p[1] - p[2]*p[3]); - R[1][0] = 2*(p[0]*p[1] + p[2]*p[3]); - R[1][2] = 2*(p[1]*p[2] - p[0]*p[3]); - R[2][1] = 2*(p[1]*p[2] + p[0]*p[3]); - R[0][2] = 2*(p[0]*p[2] + p[1]*p[3]); - R[2][0] = 2*(p[0]*p[2] - p[1]*p[3]); + R[0][0] = (p[0] * p[0]) - (p[1] * p[1]) - (p[2] * p[2]) + (p[3] * p[3]); + R[1][1] = -(p[0] * p[0]) + (p[1] * p[1]) - (p[2] * p[2]) + (p[3] * p[3]); + R[2][2] = -(p[0] * p[0]) - (p[1] * p[1]) + (p[2] * p[2]) + (p[3] * p[3]); + R[0][1] = 2 * (p[0] * p[1] - p[2] * p[3]); + R[1][0] = 2 * (p[0] * p[1] + p[2] * p[3]); + R[1][2] = 2 * (p[1] * p[2] - p[0] * p[3]); + R[2][1] = 2 * (p[1] * p[2] + p[0] * p[3]); + R[0][2] = 2 * (p[0] * p[2] + p[1] * p[3]); + R[2][0] = 2 * (p[0] * p[2] - p[1] * p[3]); - q[0] = p[3]; // Note: The "p" variable is not a quaternion in the - q[1] = p[0]; // conventional sense because its elements - q[2] = p[1]; // are in the wrong order. I correct for that here. - q[3] = p[2]; // "q" is the quaternion correspond to rotation R. + q[0] = p[3]; // Note: The "p" variable is not a quaternion in the + q[1] = p[0]; // conventional sense because its elements + q[2] = p[1]; // are in the wrong order. I correct for that here. + q[3] = p[2]; // "q" is the quaternion correspond to rotation R. // Optional: Decide the scale factor, c - c = 1.0; // by default, don't rescale the coordinates + c = 1.0; // by default, don't rescale the coordinates - if ((allow_rescale) && (! singular)) { + if ((allow_rescale) && (!singular)) { Scalar Waxaixai = 0.0; Scalar WaxaiXai = 0.0; - for (size_t a=0; a < N; a++) { + for (size_t a = 0; a < N; a++) { Scalar weight = aWeights[a]; - for (int i=0; i < 3; i++) { + for (int i = 0; i < 3; i++) { Waxaixai += weight * aaXm_shifted[a][i] * aaXm_shifted[a][i]; WaxaiXai += weight * aaXm_shifted[a][i] * aaXf_shifted[a][i]; } } c = (WaxaiXai + pPp) / Waxaixai; - } // if (allow_rescale) + } // if (allow_rescale) // Finally compute the RMSD between the two coordinate sets: // First compute E0 from equation 24 of the paper Scalar E0 = 0.0; - for (size_t n=0; n < N; n++) { + for (size_t n = 0; n < N; n++) { Scalar weight = aWeights[n]; - for (int d=0; d < 3; d++) + for (int d = 0; d < 3; d++) // (remember to include the scale factor "c" that we inserted) - E0 += weight * (SQR(aaXf_shifted[n][d] - c*aaXm_shifted[n][d])); + E0 += weight * (SQR(aaXf_shifted[n][d] - c * aaXm_shifted[n][d])); } - Scalar sum_sqr_dist = E0 - c*2.0*pPp; - if (sum_sqr_dist < 0.0) //(edge case due to rounding error) + Scalar sum_sqr_dist = E0 - c * 2.0 * pPp; + if (sum_sqr_dist < 0.0) //(edge case due to rounding error) sum_sqr_dist = 0.0; - if (! singular) - rmsd = sqrt(sum_sqr_dist/sum_weights); + if (!singular) rmsd = sqrt(sum_sqr_dist / sum_weights); // Lastly, calculate the translational offset. // If c!=1, this is slightly more complicated than it seems. Recall that: @@ -328,58 +314,53 @@ Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object // In the code, Xcm_i is represented by "aCenter_f[i]" // and xcm_j is represented by "aCenter_m[j]" - for (int i=0; i < 3; i++) { + for (int i = 0; i < 3; i++) { T[i] = aCenter_f[i]; - for (int j=0; j < 3; j++) { - T[i] -= c*R[i][j]*aCenter_m[j]; - } + for (int j = 0; j < 3; j++) { T[i] -= c * R[i][j] * aCenter_m[j]; } } return rmsd; -} //Superpose3D::Superpose(aaXf, aaXm, allow_rescale) +} //Superpose3D::Superpose(aaXf, aaXm, allow_rescale) - -template -void Superpose3D:: -SetNumPoints(size_t N) { +template +void Superpose3D::SetNumPoints(size_t N) +{ Dealloc(); Alloc(N); } -template -void Superpose3D:: -SetWeights(ConstArray aWeights) { - for (size_t i = 0; i < N; i++) - this->aWeights[i] = aWeights[i]; +template +void Superpose3D::SetWeights(ConstArray aWeights) +{ + for (size_t i = 0; i < N; i++) this->aWeights[i] = aWeights[i]; } -template -Superpose3D::Superpose3D(size_t N) - :eigen_calc(4) +template +Superpose3D::Superpose3D(size_t N) : eigen_calc(4) { Init(); Alloc(N); } -template -Superpose3D:: -Superpose3D(size_t N, ConstArray aWeights) - :eigen_calc(4) +template +Superpose3D::Superpose3D(size_t N, ConstArray aWeights) : + eigen_calc(4) { Init(); Alloc(N); SetWeights(aWeights); } -template -Superpose3D::~Superpose3D() { +template +Superpose3D::~Superpose3D() +{ Dealloc(); } -template -void Superpose3D:: -Init() { +template +void Superpose3D::Init() +{ R = nullptr; aWeights = nullptr; aaXf_shifted = nullptr; @@ -388,37 +369,32 @@ Init() { // memory management: -template -void Superpose3D:: -Alloc(size_t N) { +template +void Superpose3D::Alloc(size_t N) +{ this->N = N; - aWeights = new Scalar [N]; - for (size_t i = 0; i < N; i++) - aWeights[i] = 1.0 / N; + aWeights = new Scalar[N]; + for (size_t i = 0; i < N; i++) aWeights[i] = 1.0 / N; MathEigen::Alloc2D(3, 3, &R); MathEigen::Alloc2D(N, 3, &aaXf_shifted); MathEigen::Alloc2D(N, 3, &aaXm_shifted); } -template -void Superpose3D:: -Dealloc() { - if (R) - MathEigen::Dealloc2D(&R); - if (aWeights) - delete [] aWeights; - if (aaXf_shifted) - MathEigen::Dealloc2D(&aaXf_shifted); - if (aaXm_shifted) - MathEigen::Dealloc2D(&aaXm_shifted); +template +void Superpose3D::Dealloc() +{ + if (R) MathEigen::Dealloc2D(&R); + if (aWeights) delete[] aWeights; + if (aaXf_shifted) MathEigen::Dealloc2D(&aaXf_shifted); + if (aaXm_shifted) MathEigen::Dealloc2D(&aaXm_shifted); } // memory management: copy and move constructor, swap, and assignment operator: -template -Superpose3D:: -Superpose3D(const Superpose3D& source) - :eigen_calc(4) +template +Superpose3D::Superpose3D( + const Superpose3D &source) : + eigen_calc(4) { Init(); Alloc(source.N); @@ -426,18 +402,15 @@ Superpose3D(const Superpose3D& source) //assert(N == source.N); for (int i = 0; i < N; i++) { - std::copy(source.aaXf_shifted[i], - source.aaXf_shifted[i] + 3, - aaXf_shifted[i]); - std::copy(source.aaXm_shifted[i], - source.aaXm_shifted[i] + 3, - aaXm_shifted[i]); + std::copy(source.aaXf_shifted[i], source.aaXf_shifted[i] + 3, aaXf_shifted[i]); + std::copy(source.aaXm_shifted[i], source.aaXm_shifted[i] + 3, aaXm_shifted[i]); } } -template -void Superpose3D:: -swap(Superpose3D &other) { +template +void Superpose3D::swap( + Superpose3D &other) +{ std::swap(N, other.N); std::swap(R, other.R); std::swap(aaXf_shifted, other.aaXf_shifted); @@ -445,21 +418,22 @@ swap(Superpose3D &other) { } // Move constructor (C++11) -template -Superpose3D:: -Superpose3D(Superpose3D&& other) { +template +Superpose3D::Superpose3D( + Superpose3D &&other) +{ Init(); swap(*this, other); } // Using the "copy-swap" idiom for the assignment operator -template -Superpose3D& -Superpose3D:: -operator = (Superpose3D source) { +template +Superpose3D & +Superpose3D::operator=( + Superpose3D source) +{ this->swap(source); return *this; } - -#endif //#ifndef LMP_SUPERPOSE3D_H +#endif //#ifndef LMP_SUPERPOSE3D_H diff --git a/src/USER-REAXC/compute_spec_atom.cpp b/src/USER-REAXC/compute_spec_atom.cpp index ebd7784c1c..1381f2cf96 100644 --- a/src/USER-REAXC/compute_spec_atom.cpp +++ b/src/USER-REAXC/compute_spec_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Labo0ratories + https://www.lammps.org/, Sandia National Labo0ratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-REAXC/compute_spec_atom.h b/src/USER-REAXC/compute_spec_atom.h index a7411bbed3..ce4ce5b1cc 100644 --- a/src/USER-REAXC/compute_spec_atom.h +++ b/src/USER-REAXC/compute_spec_atom.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Labo0ratories + https://www.lammps.org/, Sandia National Labo0ratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(SPEC/ATOM,ComputeSpecAtom) - +// clang-format off +ComputeStyle(SPEC/ATOM,ComputeSpecAtom); +// clang-format on #else #ifndef LMP_COMPUTE_SPEC_ATOM_H diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index 3109950ff2..9663d2ea49 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-REAXC/fix_qeq_reax.h b/src/USER-REAXC/fix_qeq_reax.h index 65e1643a0c..f87c7c6294 100644 --- a/src/USER-REAXC/fix_qeq_reax.h +++ b/src/USER-REAXC/fix_qeq_reax.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(qeq/reax,FixQEqReax) - +// clang-format off +FixStyle(qeq/reax,FixQEqReax); +// clang-format on #else #ifndef LMP_FIX_QEQ_REAX_H diff --git a/src/USER-REAXC/fix_reaxc.cpp b/src/USER-REAXC/fix_reaxc.cpp index c178b32097..2b39ef5a0e 100644 --- a/src/USER-REAXC/fix_reaxc.cpp +++ b/src/USER-REAXC/fix_reaxc.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-REAXC/fix_reaxc.h b/src/USER-REAXC/fix_reaxc.h index 6fefb975fd..6347f30c23 100644 --- a/src/USER-REAXC/fix_reaxc.h +++ b/src/USER-REAXC/fix_reaxc.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(REAXC,FixReaxC) - +// clang-format off +FixStyle(REAXC,FixReaxC); +// clang-format on #else #ifndef LMP_FIX_REAXC_H diff --git a/src/USER-REAXC/fix_reaxc_bonds.cpp b/src/USER-REAXC/fix_reaxc_bonds.cpp index 0cb78521f2..5fb095578c 100644 --- a/src/USER-REAXC/fix_reaxc_bonds.cpp +++ b/src/USER-REAXC/fix_reaxc_bonds.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-REAXC/fix_reaxc_bonds.h b/src/USER-REAXC/fix_reaxc_bonds.h index a19135f25a..fbca39fa95 100644 --- a/src/USER-REAXC/fix_reaxc_bonds.h +++ b/src/USER-REAXC/fix_reaxc_bonds.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(reax/c/bonds,FixReaxCBonds) - +// clang-format off +FixStyle(reax/c/bonds,FixReaxCBonds); +// clang-format on #else #ifndef LMP_FIX_REAXC_BONDS_H diff --git a/src/USER-REAXC/fix_reaxc_species.cpp b/src/USER-REAXC/fix_reaxc_species.cpp index 81b1dafa61..be464f9a97 100644 --- a/src/USER-REAXC/fix_reaxc_species.cpp +++ b/src/USER-REAXC/fix_reaxc_species.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-REAXC/fix_reaxc_species.h b/src/USER-REAXC/fix_reaxc_species.h index 35e3f31ab0..225e0bcf24 100644 --- a/src/USER-REAXC/fix_reaxc_species.h +++ b/src/USER-REAXC/fix_reaxc_species.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +13,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(reax/c/species,FixReaxCSpecies) - +// clang-format off +FixStyle(reax/c/species,FixReaxCSpecies); +// clang-format on #else #ifndef LMP_FIX_REAXC_SPECIES_H diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index 4d6f240ec6..100606e9e3 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-REAXC/pair_reaxc.h b/src/USER-REAXC/pair_reaxc.h index d3fad7f63f..c8293ef417 100644 --- a/src/USER-REAXC/pair_reaxc.h +++ b/src/USER-REAXC/pair_reaxc.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(reax/c,PairReaxC) - +// clang-format off +PairStyle(reax/c,PairReaxC); +// clang-format on #else #ifndef LMP_PAIR_REAXC_H diff --git a/src/USER-REAXC/reaxc_allocate.cpp b/src/USER-REAXC/reaxc_allocate.cpp index 9ba92b9dfa..1cb101b118 100644 --- a/src/USER-REAXC/reaxc_allocate.cpp +++ b/src/USER-REAXC/reaxc_allocate.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_allocate.h b/src/USER-REAXC/reaxc_allocate.h index be203340f6..b5e6f542ee 100644 --- a/src/USER-REAXC/reaxc_allocate.h +++ b/src/USER-REAXC/reaxc_allocate.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_bond_orders.cpp b/src/USER-REAXC/reaxc_bond_orders.cpp index 6a854e1805..bfc04d96a8 100644 --- a/src/USER-REAXC/reaxc_bond_orders.cpp +++ b/src/USER-REAXC/reaxc_bond_orders.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_bond_orders.h b/src/USER-REAXC/reaxc_bond_orders.h index 3631d90c89..63550061d0 100644 --- a/src/USER-REAXC/reaxc_bond_orders.h +++ b/src/USER-REAXC/reaxc_bond_orders.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_bonds.cpp b/src/USER-REAXC/reaxc_bonds.cpp index c706a2fd79..9ace195ee0 100644 --- a/src/USER-REAXC/reaxc_bonds.cpp +++ b/src/USER-REAXC/reaxc_bonds.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_bonds.h b/src/USER-REAXC/reaxc_bonds.h index a4a1fb0b44..49a869c766 100644 --- a/src/USER-REAXC/reaxc_bonds.h +++ b/src/USER-REAXC/reaxc_bonds.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_control.cpp b/src/USER-REAXC/reaxc_control.cpp index b717b6b97f..84c5feeec2 100644 --- a/src/USER-REAXC/reaxc_control.cpp +++ b/src/USER-REAXC/reaxc_control.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_control.h b/src/USER-REAXC/reaxc_control.h index b2b455d6b8..9c818b0554 100644 --- a/src/USER-REAXC/reaxc_control.h +++ b/src/USER-REAXC/reaxc_control.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_defs.h b/src/USER-REAXC/reaxc_defs.h index 3ead22842a..b98d8a2828 100644 --- a/src/USER-REAXC/reaxc_defs.h +++ b/src/USER-REAXC/reaxc_defs.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- diff --git a/src/USER-REAXC/reaxc_ffield.cpp b/src/USER-REAXC/reaxc_ffield.cpp index e54b3b75e0..0b771bf356 100644 --- a/src/USER-REAXC/reaxc_ffield.cpp +++ b/src/USER-REAXC/reaxc_ffield.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_ffield.h b/src/USER-REAXC/reaxc_ffield.h index b6fe1c9ea9..76edfe8b7e 100644 --- a/src/USER-REAXC/reaxc_ffield.h +++ b/src/USER-REAXC/reaxc_ffield.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_forces.cpp b/src/USER-REAXC/reaxc_forces.cpp index cde80e9866..7860ab6b32 100644 --- a/src/USER-REAXC/reaxc_forces.cpp +++ b/src/USER-REAXC/reaxc_forces.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_forces.h b/src/USER-REAXC/reaxc_forces.h index bfad2e9b71..ef23a84a18 100644 --- a/src/USER-REAXC/reaxc_forces.h +++ b/src/USER-REAXC/reaxc_forces.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_hydrogen_bonds.cpp b/src/USER-REAXC/reaxc_hydrogen_bonds.cpp index ac94d7b62c..9d0cbbe97c 100644 --- a/src/USER-REAXC/reaxc_hydrogen_bonds.cpp +++ b/src/USER-REAXC/reaxc_hydrogen_bonds.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_hydrogen_bonds.h b/src/USER-REAXC/reaxc_hydrogen_bonds.h index 04d3d26d5c..1d88f1edcf 100644 --- a/src/USER-REAXC/reaxc_hydrogen_bonds.h +++ b/src/USER-REAXC/reaxc_hydrogen_bonds.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_init_md.cpp b/src/USER-REAXC/reaxc_init_md.cpp index 7794a16ecd..3d0a60c862 100644 --- a/src/USER-REAXC/reaxc_init_md.cpp +++ b/src/USER-REAXC/reaxc_init_md.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_init_md.h b/src/USER-REAXC/reaxc_init_md.h index 5d593f50ea..b7c1d38bbc 100644 --- a/src/USER-REAXC/reaxc_init_md.h +++ b/src/USER-REAXC/reaxc_init_md.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_io_tools.cpp b/src/USER-REAXC/reaxc_io_tools.cpp index 5864ab6a15..0e254b2c88 100644 --- a/src/USER-REAXC/reaxc_io_tools.cpp +++ b/src/USER-REAXC/reaxc_io_tools.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_io_tools.h b/src/USER-REAXC/reaxc_io_tools.h index a3f22fccc2..b43d6cd11f 100644 --- a/src/USER-REAXC/reaxc_io_tools.h +++ b/src/USER-REAXC/reaxc_io_tools.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_list.cpp b/src/USER-REAXC/reaxc_list.cpp index ff5cf98900..a02f7d2fd7 100644 --- a/src/USER-REAXC/reaxc_list.cpp +++ b/src/USER-REAXC/reaxc_list.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_list.h b/src/USER-REAXC/reaxc_list.h index 28567252da..323656537d 100644 --- a/src/USER-REAXC/reaxc_list.h +++ b/src/USER-REAXC/reaxc_list.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_lookup.cpp b/src/USER-REAXC/reaxc_lookup.cpp index b45a6da265..33922e2022 100644 --- a/src/USER-REAXC/reaxc_lookup.cpp +++ b/src/USER-REAXC/reaxc_lookup.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_lookup.h b/src/USER-REAXC/reaxc_lookup.h index 3aae7e0b63..abbac23e1f 100644 --- a/src/USER-REAXC/reaxc_lookup.h +++ b/src/USER-REAXC/reaxc_lookup.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_multi_body.cpp b/src/USER-REAXC/reaxc_multi_body.cpp index ab66e3352a..778bb1ad41 100644 --- a/src/USER-REAXC/reaxc_multi_body.cpp +++ b/src/USER-REAXC/reaxc_multi_body.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_multi_body.h b/src/USER-REAXC/reaxc_multi_body.h index a17c9f484e..5d60140b44 100644 --- a/src/USER-REAXC/reaxc_multi_body.h +++ b/src/USER-REAXC/reaxc_multi_body.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_nonbonded.cpp b/src/USER-REAXC/reaxc_nonbonded.cpp index 97790aa997..31265bd2e8 100644 --- a/src/USER-REAXC/reaxc_nonbonded.cpp +++ b/src/USER-REAXC/reaxc_nonbonded.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_nonbonded.h b/src/USER-REAXC/reaxc_nonbonded.h index 9a29d4d8c1..64c69e9f30 100644 --- a/src/USER-REAXC/reaxc_nonbonded.h +++ b/src/USER-REAXC/reaxc_nonbonded.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_reset_tools.cpp b/src/USER-REAXC/reaxc_reset_tools.cpp index 4367be8217..adfde2494c 100644 --- a/src/USER-REAXC/reaxc_reset_tools.cpp +++ b/src/USER-REAXC/reaxc_reset_tools.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_reset_tools.h b/src/USER-REAXC/reaxc_reset_tools.h index 20d1ab6964..15e584eaac 100644 --- a/src/USER-REAXC/reaxc_reset_tools.h +++ b/src/USER-REAXC/reaxc_reset_tools.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_system_props.cpp b/src/USER-REAXC/reaxc_system_props.cpp index e2cd7215aa..ec50692c6f 100644 --- a/src/USER-REAXC/reaxc_system_props.cpp +++ b/src/USER-REAXC/reaxc_system_props.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_system_props.h b/src/USER-REAXC/reaxc_system_props.h index 4d80e22966..27c80d02bf 100644 --- a/src/USER-REAXC/reaxc_system_props.h +++ b/src/USER-REAXC/reaxc_system_props.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_tool_box.cpp b/src/USER-REAXC/reaxc_tool_box.cpp index abab3f2b43..b047954d22 100644 --- a/src/USER-REAXC/reaxc_tool_box.cpp +++ b/src/USER-REAXC/reaxc_tool_box.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_tool_box.h b/src/USER-REAXC/reaxc_tool_box.h index 773b4f3f3d..6dc6217c92 100644 --- a/src/USER-REAXC/reaxc_tool_box.h +++ b/src/USER-REAXC/reaxc_tool_box.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_torsion_angles.cpp b/src/USER-REAXC/reaxc_torsion_angles.cpp index 305e83707d..de23597fd8 100644 --- a/src/USER-REAXC/reaxc_torsion_angles.cpp +++ b/src/USER-REAXC/reaxc_torsion_angles.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_torsion_angles.h b/src/USER-REAXC/reaxc_torsion_angles.h index 755e8c6532..e18bc9d4c7 100644 --- a/src/USER-REAXC/reaxc_torsion_angles.h +++ b/src/USER-REAXC/reaxc_torsion_angles.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_traj.cpp b/src/USER-REAXC/reaxc_traj.cpp index 66a1c70b0e..637a69ed0f 100644 --- a/src/USER-REAXC/reaxc_traj.cpp +++ b/src/USER-REAXC/reaxc_traj.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_traj.h b/src/USER-REAXC/reaxc_traj.h index 2ff5995204..3321410a22 100644 --- a/src/USER-REAXC/reaxc_traj.h +++ b/src/USER-REAXC/reaxc_traj.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_types.h b/src/USER-REAXC/reaxc_types.h index 36678ad2b0..f4b8bb0a2e 100644 --- a/src/USER-REAXC/reaxc_types.h +++ b/src/USER-REAXC/reaxc_types.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_valence_angles.cpp b/src/USER-REAXC/reaxc_valence_angles.cpp index 9aec0a1f05..26dba52512 100644 --- a/src/USER-REAXC/reaxc_valence_angles.cpp +++ b/src/USER-REAXC/reaxc_valence_angles.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_valence_angles.h b/src/USER-REAXC/reaxc_valence_angles.h index 31936ba190..a5dc12c16b 100644 --- a/src/USER-REAXC/reaxc_valence_angles.h +++ b/src/USER-REAXC/reaxc_valence_angles.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_vector.cpp b/src/USER-REAXC/reaxc_vector.cpp index e0e3a14782..5497d41c9b 100644 --- a/src/USER-REAXC/reaxc_vector.cpp +++ b/src/USER-REAXC/reaxc_vector.cpp @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_vector.h b/src/USER-REAXC/reaxc_vector.h index 549c1f927c..f2068d4d4f 100644 --- a/src/USER-REAXC/reaxc_vector.h +++ b/src/USER-REAXC/reaxc_vector.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-SCAFACOS/scafacos.cpp b/src/USER-SCAFACOS/scafacos.cpp index fa12cffe4c..51bf4fb45e 100644 --- a/src/USER-SCAFACOS/scafacos.cpp +++ b/src/USER-SCAFACOS/scafacos.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SCAFACOS/scafacos.h b/src/USER-SCAFACOS/scafacos.h index 62517561de..b42c4df437 100644 --- a/src/USER-SCAFACOS/scafacos.h +++ b/src/USER-SCAFACOS/scafacos.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(scafacos,Scafacos) - +// clang-format off +KSpaceStyle(scafacos,Scafacos); +// clang-format on #else #ifndef LMP_SCAFACOS_H @@ -41,30 +41,30 @@ class Scafacos : public KSpace { char *method; double tolerance; - double *xpbc,*epot,**efield; + double *xpbc, *epot, **efield; int tolerance_type; - int initialized,maxatom; + int initialized, maxatom; int fmm_tuning_flag; - void* fcs; // ScaFaCoS handle + void *fcs; // ScaFaCoS handle // simulation state: box, natoms // so ScaFaCoS can detect if changes, e.g. for NPT - double old_box_x[3],old_box_y[3],old_box_z[3]; + double old_box_x[3], old_box_y[3], old_box_z[3]; double old_origin[3]; int old_periodicity[3]; int old_natoms; double virial_int[9]; - void check_result(void*); + void check_result(void *); void setup_handle(); bool box_has_changed(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp index 38d0966c8f..220019ea98 100644 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SDPD/fix_meso_move.h b/src/USER-SDPD/fix_meso_move.h index 27532fe5b6..5a649128e5 100644 --- a/src/USER-SDPD/fix_meso_move.h +++ b/src/USER-SDPD/fix_meso_move.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(meso/move,FixMesoMove) - +// clang-format off +FixStyle(meso/move,FixMesoMove); +// clang-format on #else #ifndef LMP_FIX_MESO_MOVE_H @@ -26,48 +26,48 @@ namespace LAMMPS_NS { class FixMesoMove : public Fix { public: - FixMesoMove (class LAMMPS *, int, char **); - ~FixMesoMove (); - int setmask (); - void init (); - void setup_pre_force (int); - void initial_integrate (int); - void final_integrate (); + FixMesoMove(class LAMMPS *, int, char **); + ~FixMesoMove(); + int setmask(); + void init(); + void setup_pre_force(int); + void initial_integrate(int); + void final_integrate(); - double memory_usage (); - void write_restart (FILE *); - void restart (char *); - void grow_arrays (int); - void copy_arrays (int, int, int); - void set_arrays (int); - int pack_exchange (int, double *); - int unpack_exchange (int, double *); - int pack_restart (int, double *); - void unpack_restart (int, int); - int maxsize_restart (); - int size_restart (int); + double memory_usage(); + void write_restart(FILE *); + void restart(char *); + void grow_arrays(int); + void copy_arrays(int, int, int); + void set_arrays(int); + int pack_exchange(int, double *); + int unpack_exchange(int, double *); + int pack_restart(int, double *); + void unpack_restart(int, int); + int maxsize_restart(); + int size_restart(int); - void reset_dt (); + void reset_dt(); private: - char *xvarstr,*yvarstr,*zvarstr,*vxvarstr,*vyvarstr,*vzvarstr; + char *xvarstr, *yvarstr, *zvarstr, *vxvarstr, *vyvarstr, *vzvarstr; int mstyle; - int vxflag,vyflag,vzflag,axflag,ayflag,azflag; - double vx,vy,vz,ax,ay,az; - double period,omega_rotate; - double point[3],axis[3],runit[3]; - double dt,dtv,dtf; - int xvar,yvar,zvar,vxvar,vyvar,vzvar; - int xvarstyle,yvarstyle,zvarstyle,vxvarstyle,vyvarstyle,vzvarstyle; + int vxflag, vyflag, vzflag, axflag, ayflag, azflag; + double vx, vy, vz, ax, ay, az; + double period, omega_rotate; + double point[3], axis[3], runit[3]; + double dt, dtv, dtf; + int xvar, yvar, zvar, vxvar, vyvar, vzvar; + int xvarstyle, yvarstyle, zvarstyle, vxvarstyle, vyvarstyle, vzvarstyle; int time_origin; - double **xoriginal; // original coords of atoms - int displaceflag,velocityflag; + double **xoriginal; // original coords of atoms + int displaceflag, velocityflag; int maxatom; - double **displace,**velocity; + double **displace, **velocity; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SDPD/fix_rigid_meso.cpp b/src/USER-SDPD/fix_rigid_meso.cpp index 6847c4e2e5..7f5a069f38 100644 --- a/src/USER-SDPD/fix_rigid_meso.cpp +++ b/src/USER-SDPD/fix_rigid_meso.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SDPD/fix_rigid_meso.h b/src/USER-SDPD/fix_rigid_meso.h index fcec79e4c3..02f6ca74da 100644 --- a/src/USER-SDPD/fix_rigid_meso.h +++ b/src/USER-SDPD/fix_rigid_meso.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(rigid/meso,FixRigidMeso) - +// clang-format off +FixStyle(rigid/meso,FixRigidMeso); +// clang-format on #else #ifndef LMP_FIX_RIGID_MESO_H @@ -26,22 +26,22 @@ namespace LAMMPS_NS { class FixRigidMeso : public FixRigid { public: - FixRigidMeso (class LAMMPS *, int, char **); - ~FixRigidMeso (); - int setmask (); - void setup (int); - void initial_integrate (int); - void final_integrate (); - double compute_scalar () { return 0.0; } - double compute_array (int, int); + FixRigidMeso(class LAMMPS *, int, char **); + ~FixRigidMeso(); + int setmask(); + void setup(int); + void initial_integrate(int); + void final_integrate(); + double compute_scalar() { return 0.0; } + double compute_array(int, int); protected: - void set_xv (); - void set_v (); - double **conjqm; // conjugate quaternion momentum + void set_xv(); + void set_v(); + double **conjqm; // conjugate quaternion momentum }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp index db7e5f0222..1e797938f9 100644 --- a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp +++ b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.h b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.h index 95f62bf166..bafd270e96 100644 --- a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.h +++ b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(sdpd/taitwater/isothermal,PairSDPDTaitwaterIsothermal) - +// clang-format off +PairStyle(sdpd/taitwater/isothermal,PairSDPDTaitwaterIsothermal); +// clang-format on #else #ifndef LMP_PAIR_SDPD_TAITWATER_MORRIS_ISOTHERMAL_H @@ -22,20 +22,20 @@ PairStyle(sdpd/taitwater/isothermal,PairSDPDTaitwaterIsothermal) #include "pair.h" #ifdef USE_ZEST -#include #include "zest.hpp" +#include #endif namespace LAMMPS_NS { class PairSDPDTaitwaterIsothermal : public Pair { public: - PairSDPDTaitwaterIsothermal (class LAMMPS *); - virtual ~PairSDPDTaitwaterIsothermal (); - virtual void compute (int, int); - void settings (int, char **); - void coeff (int, char **); - virtual double init_one (int, int); + PairSDPDTaitwaterIsothermal(class LAMMPS *); + virtual ~PairSDPDTaitwaterIsothermal(); + virtual void compute(int, int); + void settings(int, char **); + void coeff(int, char **); + virtual double init_one(int, int); virtual void init_style(); protected: @@ -43,18 +43,18 @@ class PairSDPDTaitwaterIsothermal : public Pair { double *rho0, *soundspeed, *B; double **cut; - void allocate (); + void allocate(); unsigned int seed; #ifdef USE_ZEST std::mt19937_64 generator; - Ziggurat gaussian; + Ziggurat gaussian; #else class RanMars *random; #endif }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/atom_vec_smd.cpp b/src/USER-SMD/atom_vec_smd.cpp index a7e7532c65..2cae7517ec 100644 --- a/src/USER-SMD/atom_vec_smd.cpp +++ b/src/USER-SMD/atom_vec_smd.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/atom_vec_smd.h b/src/USER-SMD/atom_vec_smd.h index b5738d9b3f..8ad6448bba 100644 --- a/src/USER-SMD/atom_vec_smd.h +++ b/src/USER-SMD/atom_vec_smd.h @@ -11,7 +11,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(smd,AtomVecSMD) - +// clang-format off +AtomStyle(smd,AtomVecSMD); +// clang-format on #else #ifndef LMP_ATOM_VEC_SMD_H @@ -46,12 +46,12 @@ class AtomVecSMD : public AtomVec { private: tagint *molecule; - double *esph,*desph,*vfrac,*rmass,*radius,*contact_radius; - double *eff_plastic_strain,*eff_plastic_strain_rate,*damage; - double **x0,**smd_data_9,**smd_stress,**vest; + double *esph, *desph, *vfrac, *rmass, *radius, *contact_radius; + double *eff_plastic_strain, *eff_plastic_strain_rate, *damage; + double **x0, **smd_data_9, **smd_stress, **vest; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_contact_radius.cpp b/src/USER-SMD/compute_smd_contact_radius.cpp index 3f09b30b97..82186c96b4 100644 --- a/src/USER-SMD/compute_smd_contact_radius.cpp +++ b/src/USER-SMD/compute_smd_contact_radius.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_contact_radius.h b/src/USER-SMD/compute_smd_contact_radius.h index 2c3098936f..503ae386a7 100644 --- a/src/USER-SMD/compute_smd_contact_radius.h +++ b/src/USER-SMD/compute_smd_contact_radius.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/contact/radius,ComputeSMDContactRadius) - +// clang-format off +ComputeStyle(smd/contact/radius,ComputeSMDContactRadius); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_CONTACT_RADIUS_H @@ -49,7 +48,7 @@ class ComputeSMDContactRadius : public Compute { double *contact_radius_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_damage.cpp b/src/USER-SMD/compute_smd_damage.cpp index cf5b966dc0..23a74123bf 100644 --- a/src/USER-SMD/compute_smd_damage.cpp +++ b/src/USER-SMD/compute_smd_damage.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_damage.h b/src/USER-SMD/compute_smd_damage.h index 5c3e96b339..21956c9819 100644 --- a/src/USER-SMD/compute_smd_damage.h +++ b/src/USER-SMD/compute_smd_damage.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/damage,ComputeSMDDamage) - +// clang-format off +ComputeStyle(smd/damage,ComputeSMDDamage); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_DAMAGE_H @@ -49,7 +48,7 @@ class ComputeSMDDamage : public Compute { double *damage_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_hourglass_error.cpp b/src/USER-SMD/compute_smd_hourglass_error.cpp index c226f526cd..53289c6d12 100644 --- a/src/USER-SMD/compute_smd_hourglass_error.cpp +++ b/src/USER-SMD/compute_smd_hourglass_error.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_hourglass_error.h b/src/USER-SMD/compute_smd_hourglass_error.h index 4807164cb1..b7e513f182 100644 --- a/src/USER-SMD/compute_smd_hourglass_error.h +++ b/src/USER-SMD/compute_smd_hourglass_error.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/hourglass/error,ComputeSMDHourglassError) - +// clang-format off +ComputeStyle(smd/hourglass/error,ComputeSMDHourglassError); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_HOURGLASS_ERROR_H @@ -49,7 +48,7 @@ class ComputeSMDHourglassError : public Compute { double *hourglass_error_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_internal_energy.cpp b/src/USER-SMD/compute_smd_internal_energy.cpp index ccebe0ffdd..aa59d7cc00 100644 --- a/src/USER-SMD/compute_smd_internal_energy.cpp +++ b/src/USER-SMD/compute_smd_internal_energy.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_internal_energy.h b/src/USER-SMD/compute_smd_internal_energy.h index 0f11c2c9fe..3277bf028c 100644 --- a/src/USER-SMD/compute_smd_internal_energy.h +++ b/src/USER-SMD/compute_smd_internal_energy.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/internal/energy,ComputeSMDInternalEnergy) - +// clang-format off +ComputeStyle(smd/internal/energy,ComputeSMDInternalEnergy); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_INTERNAL_ENERGY_H @@ -49,7 +48,7 @@ class ComputeSMDInternalEnergy : public Compute { double *internal_energy_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_plastic_strain.cpp b/src/USER-SMD/compute_smd_plastic_strain.cpp index 375802fa6e..5d98650226 100644 --- a/src/USER-SMD/compute_smd_plastic_strain.cpp +++ b/src/USER-SMD/compute_smd_plastic_strain.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_plastic_strain.h b/src/USER-SMD/compute_smd_plastic_strain.h index fdc1f8af8d..92409afbf8 100644 --- a/src/USER-SMD/compute_smd_plastic_strain.h +++ b/src/USER-SMD/compute_smd_plastic_strain.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/plastic/strain,ComputeSMDPlasticStrain) - +// clang-format off +ComputeStyle(smd/plastic/strain,ComputeSMDPlasticStrain); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_PLASTIC_STRAIN_H @@ -49,7 +48,7 @@ class ComputeSMDPlasticStrain : public Compute { double *plastic_strain_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_plastic_strain_rate.cpp b/src/USER-SMD/compute_smd_plastic_strain_rate.cpp index ce24a4a4ee..da9f4846cc 100644 --- a/src/USER-SMD/compute_smd_plastic_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_plastic_strain_rate.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_plastic_strain_rate.h b/src/USER-SMD/compute_smd_plastic_strain_rate.h index 3311a5d28d..745b9ed3cc 100644 --- a/src/USER-SMD/compute_smd_plastic_strain_rate.h +++ b/src/USER-SMD/compute_smd_plastic_strain_rate.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/plastic/strain/rate,ComputeSMDPlasticStrainRate) - +// clang-format off +ComputeStyle(smd/plastic/strain/rate,ComputeSMDPlasticStrainRate); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_PLASTIC_STRAIN_RATE_H @@ -49,7 +48,7 @@ class ComputeSMDPlasticStrainRate : public Compute { double *plastic_strain_rate_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_rho.cpp b/src/USER-SMD/compute_smd_rho.cpp index e570090e2a..cffe71ade3 100644 --- a/src/USER-SMD/compute_smd_rho.cpp +++ b/src/USER-SMD/compute_smd_rho.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_rho.h b/src/USER-SMD/compute_smd_rho.h index 9ee1ee11da..85335bbce8 100644 --- a/src/USER-SMD/compute_smd_rho.h +++ b/src/USER-SMD/compute_smd_rho.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/rho,ComputeSMDRho) - +// clang-format off +ComputeStyle(smd/rho,ComputeSMDRho); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_RHO_H @@ -49,7 +48,7 @@ class ComputeSMDRho : public Compute { double *rhoVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_defgrad.cpp b/src/USER-SMD/compute_smd_tlsph_defgrad.cpp index 277df87eec..0611dab47b 100644 --- a/src/USER-SMD/compute_smd_tlsph_defgrad.cpp +++ b/src/USER-SMD/compute_smd_tlsph_defgrad.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_tlsph_defgrad.h b/src/USER-SMD/compute_smd_tlsph_defgrad.h index 2882d3bde6..ece997771b 100644 --- a/src/USER-SMD/compute_smd_tlsph_defgrad.h +++ b/src/USER-SMD/compute_smd_tlsph_defgrad.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/tlsph/defgrad,ComputeSMDTLSPHDefgrad) - +// clang-format off +ComputeStyle(smd/tlsph/defgrad,ComputeSMDTLSPHDefgrad); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_TLSPH_DEFGRAD_H @@ -49,7 +48,7 @@ class ComputeSMDTLSPHDefgrad : public Compute { double **defgradVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_dt.cpp b/src/USER-SMD/compute_smd_tlsph_dt.cpp index 54de8a7cd4..8000de9c59 100644 --- a/src/USER-SMD/compute_smd_tlsph_dt.cpp +++ b/src/USER-SMD/compute_smd_tlsph_dt.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_tlsph_dt.h b/src/USER-SMD/compute_smd_tlsph_dt.h index 6d0172f3f9..1fedd6d36d 100644 --- a/src/USER-SMD/compute_smd_tlsph_dt.h +++ b/src/USER-SMD/compute_smd_tlsph_dt.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/tlsph/dt,ComputeSMDTlsphDt) - +// clang-format off +ComputeStyle(smd/tlsph/dt,ComputeSMDTlsphDt); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_TLSPH_DT_H @@ -49,7 +48,7 @@ class ComputeSMDTlsphDt : public Compute { double *dt_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp b/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp index 6d77fc38da..f7d95410ae 100644 --- a/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp +++ b/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_tlsph_num_neighs.h b/src/USER-SMD/compute_smd_tlsph_num_neighs.h index bd8bf80b90..ad6311d60d 100644 --- a/src/USER-SMD/compute_smd_tlsph_num_neighs.h +++ b/src/USER-SMD/compute_smd_tlsph_num_neighs.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/tlsph/num/neighs,ComputeSMDTLSPHNumNeighs) - +// clang-format off +ComputeStyle(smd/tlsph/num/neighs,ComputeSMDTLSPHNumNeighs); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_TLSPH_NUM_NEIGHS_H @@ -49,7 +48,7 @@ class ComputeSMDTLSPHNumNeighs : public Compute { double *numNeighsRefConfigOutput; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_shape.cpp b/src/USER-SMD/compute_smd_tlsph_shape.cpp index a32c15af28..b2d38b2af2 100644 --- a/src/USER-SMD/compute_smd_tlsph_shape.cpp +++ b/src/USER-SMD/compute_smd_tlsph_shape.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_tlsph_shape.h b/src/USER-SMD/compute_smd_tlsph_shape.h index 422073dffe..c1b9b69bfb 100644 --- a/src/USER-SMD/compute_smd_tlsph_shape.h +++ b/src/USER-SMD/compute_smd_tlsph_shape.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/tlsph/shape,ComputeSmdTlsphShape) - +// clang-format off +ComputeStyle(smd/tlsph/shape,ComputeSmdTlsphShape); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_TLSPH_SHAPE_H @@ -49,7 +48,7 @@ class ComputeSmdTlsphShape : public Compute { double **strainVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_strain.cpp b/src/USER-SMD/compute_smd_tlsph_strain.cpp index c3eae3bfe9..19ce976509 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain.cpp +++ b/src/USER-SMD/compute_smd_tlsph_strain.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_tlsph_strain.h b/src/USER-SMD/compute_smd_tlsph_strain.h index 1ebdfa5ba2..f94385b7fe 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain.h +++ b/src/USER-SMD/compute_smd_tlsph_strain.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/tlsph/strain,ComputeSMDTLSPHstrain) - +// clang-format off +ComputeStyle(smd/tlsph/strain,ComputeSMDTLSPHstrain); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_TLSPH_STRAIN_H @@ -49,7 +48,7 @@ class ComputeSMDTLSPHstrain : public Compute { double **strainVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp b/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp index e6de94abf9..adb0bbcf6d 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_tlsph_strain_rate.h b/src/USER-SMD/compute_smd_tlsph_strain_rate.h index ccaec219a6..35d2a80519 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain_rate.h +++ b/src/USER-SMD/compute_smd_tlsph_strain_rate.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/tlsph/strain/rate,ComputeSMDTLSPHStrainRate) - +// clang-format off +ComputeStyle(smd/tlsph/strain/rate,ComputeSMDTLSPHStrainRate); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_TLSPH_STRAIN_RATE_H @@ -49,7 +48,7 @@ class ComputeSMDTLSPHStrainRate : public Compute { double **strain_rate_array; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_stress.cpp b/src/USER-SMD/compute_smd_tlsph_stress.cpp index 26bb78a1db..75a06a45e9 100644 --- a/src/USER-SMD/compute_smd_tlsph_stress.cpp +++ b/src/USER-SMD/compute_smd_tlsph_stress.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_tlsph_stress.h b/src/USER-SMD/compute_smd_tlsph_stress.h index 97a01282d7..7bb0250620 100644 --- a/src/USER-SMD/compute_smd_tlsph_stress.h +++ b/src/USER-SMD/compute_smd_tlsph_stress.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/tlsph/stress, ComputeSMDTLSPHStress) - +// clang-format off +ComputeStyle(smd/tlsph/stress,ComputeSMDTLSPHStress); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_TLSPH_STRESS_H @@ -49,7 +48,7 @@ class ComputeSMDTLSPHStress : public Compute { double **stress_array; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_triangle_vertices.cpp b/src/USER-SMD/compute_smd_triangle_vertices.cpp index 6b949196f9..c4b832faa3 100644 --- a/src/USER-SMD/compute_smd_triangle_vertices.cpp +++ b/src/USER-SMD/compute_smd_triangle_vertices.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_triangle_vertices.h b/src/USER-SMD/compute_smd_triangle_vertices.h index 5c6e178e14..fe369580aa 100644 --- a/src/USER-SMD/compute_smd_triangle_vertices.h +++ b/src/USER-SMD/compute_smd_triangle_vertices.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/triangle/vertices,ComputeSMDTriangleVertices) - +// clang-format off +ComputeStyle(smd/triangle/vertices,ComputeSMDTriangleVertices); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_TRIANGLE_VERTICES_H @@ -49,7 +48,7 @@ class ComputeSMDTriangleVertices : public Compute { double **outputVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_ulsph_effm.cpp b/src/USER-SMD/compute_smd_ulsph_effm.cpp index c3fdd5bab9..edf9355f20 100644 --- a/src/USER-SMD/compute_smd_ulsph_effm.cpp +++ b/src/USER-SMD/compute_smd_ulsph_effm.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_ulsph_effm.h b/src/USER-SMD/compute_smd_ulsph_effm.h index c4c5025a12..8839f1dcbc 100644 --- a/src/USER-SMD/compute_smd_ulsph_effm.h +++ b/src/USER-SMD/compute_smd_ulsph_effm.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/ulsph/effm,ComputeSMD_Ulsph_Effm) - +// clang-format off +ComputeStyle(smd/ulsph/effm,ComputeSMD_Ulsph_Effm); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_ULSPH_EFFM_H @@ -49,7 +48,7 @@ class ComputeSMD_Ulsph_Effm : public Compute { double *dt_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp b/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp index ff40172dea..5b900fc15d 100644 --- a/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp +++ b/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_ulsph_num_neighs.h b/src/USER-SMD/compute_smd_ulsph_num_neighs.h index cc3b56c0be..75217d7685 100644 --- a/src/USER-SMD/compute_smd_ulsph_num_neighs.h +++ b/src/USER-SMD/compute_smd_ulsph_num_neighs.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/ulsph/num/neighs,ComputeSMDULSPHNumNeighs) - +// clang-format off +ComputeStyle(smd/ulsph/num/neighs,ComputeSMDULSPHNumNeighs); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_ULSPH_NUM_NEIGHS_H @@ -49,7 +48,7 @@ class ComputeSMDULSPHNumNeighs : public Compute { double *numNeighsOutput; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_ulsph_strain.cpp b/src/USER-SMD/compute_smd_ulsph_strain.cpp index fc4d0c6ecf..3dbfc02391 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain.cpp +++ b/src/USER-SMD/compute_smd_ulsph_strain.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_ulsph_strain.h b/src/USER-SMD/compute_smd_ulsph_strain.h index 37a33a8307..6265a9ab5e 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain.h +++ b/src/USER-SMD/compute_smd_ulsph_strain.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/ulsph/strain,ComputeSMDULSPHstrain) - +// clang-format off +ComputeStyle(smd/ulsph/strain,ComputeSMDULSPHstrain); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_ULSPH_STRAIN_H @@ -49,7 +48,7 @@ class ComputeSMDULSPHstrain : public Compute { double **strainVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp b/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp index dfd746b332..d44a6bac70 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_ulsph_strain_rate.h b/src/USER-SMD/compute_smd_ulsph_strain_rate.h index b306259aaf..8ccd5695c1 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain_rate.h +++ b/src/USER-SMD/compute_smd_ulsph_strain_rate.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/ulsph/strain/rate,ComputeSMDULSPHStrainRate) - +// clang-format off +ComputeStyle(smd/ulsph/strain/rate,ComputeSMDULSPHStrainRate); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_ULSPH_STRAIN_RATE_H @@ -49,7 +48,7 @@ class ComputeSMDULSPHStrainRate : public Compute { double **strain_rate_array; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_ulsph_stress.cpp b/src/USER-SMD/compute_smd_ulsph_stress.cpp index 6a5363136e..eadfbfc1b0 100644 --- a/src/USER-SMD/compute_smd_ulsph_stress.cpp +++ b/src/USER-SMD/compute_smd_ulsph_stress.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_ulsph_stress.h b/src/USER-SMD/compute_smd_ulsph_stress.h index 17183d9f57..bcb6098b64 100644 --- a/src/USER-SMD/compute_smd_ulsph_stress.h +++ b/src/USER-SMD/compute_smd_ulsph_stress.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/ulsph/stress, ComputeSMDULSPHStress) - +// clang-format off +ComputeStyle(smd/ulsph/stress,ComputeSMDULSPHStress); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_ULSPH_STRESS_H @@ -49,7 +48,7 @@ class ComputeSMDULSPHStress : public Compute { double **stress_array; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_vol.cpp b/src/USER-SMD/compute_smd_vol.cpp index 410fc145f9..873699a591 100644 --- a/src/USER-SMD/compute_smd_vol.cpp +++ b/src/USER-SMD/compute_smd_vol.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/compute_smd_vol.h b/src/USER-SMD/compute_smd_vol.h index 9b2b9e4728..ab9143d41c 100644 --- a/src/USER-SMD/compute_smd_vol.h +++ b/src/USER-SMD/compute_smd_vol.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(smd/vol,ComputeSMDVol) - +// clang-format off +ComputeStyle(smd/vol,ComputeSMDVol); +// clang-format on #else #ifndef LMP_COMPUTE_SMD_VOL_H @@ -50,7 +49,7 @@ class ComputeSMDVol : public Compute { double *volVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/fix_smd_adjust_dt.cpp b/src/USER-SMD/fix_smd_adjust_dt.cpp index 7d1eed2fa5..dc5dbd08a9 100644 --- a/src/USER-SMD/fix_smd_adjust_dt.cpp +++ b/src/USER-SMD/fix_smd_adjust_dt.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/fix_smd_adjust_dt.h b/src/USER-SMD/fix_smd_adjust_dt.h index 777519a35c..5f6b350be3 100644 --- a/src/USER-SMD/fix_smd_adjust_dt.h +++ b/src/USER-SMD/fix_smd_adjust_dt.h @@ -11,7 +11,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(smd/adjust_dt,FixSMDTlsphDtReset) - +// clang-format off +FixStyle(smd/adjust_dt,FixSMDTlsphDtReset); +// clang-format on #else #ifndef LMP_FIX_TLSPH_DT_RESET_H @@ -35,26 +35,25 @@ FixStyle(smd/adjust_dt,FixSMDTlsphDtReset) namespace LAMMPS_NS { -class FixSMDTlsphDtReset: public Fix { -public: - FixSMDTlsphDtReset(class LAMMPS *, int, char **); - ~FixSMDTlsphDtReset() { - } - int setmask(); - void init(); - void setup(int); - void initial_integrate(int); - void end_of_step(); - double compute_scalar(); - void write_restart(FILE *); - void restart(char *); +class FixSMDTlsphDtReset : public Fix { + public: + FixSMDTlsphDtReset(class LAMMPS *, int, char **); + ~FixSMDTlsphDtReset() {} + int setmask(); + void init(); + void setup(int); + void initial_integrate(int); + void end_of_step(); + double compute_scalar(); + void write_restart(FILE *); + void restart(char *); -private: - double safety_factor; - double dt, t_elapsed; + private: + double safety_factor; + double dt, t_elapsed; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/fix_smd_integrate_tlsph.cpp b/src/USER-SMD/fix_smd_integrate_tlsph.cpp index 9298798977..a8257dfebe 100644 --- a/src/USER-SMD/fix_smd_integrate_tlsph.cpp +++ b/src/USER-SMD/fix_smd_integrate_tlsph.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/fix_smd_integrate_tlsph.h b/src/USER-SMD/fix_smd_integrate_tlsph.h index 495bd65427..c5f86092a4 100644 --- a/src/USER-SMD/fix_smd_integrate_tlsph.h +++ b/src/USER-SMD/fix_smd_integrate_tlsph.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(smd/integrate_tlsph,FixSMDIntegrateTlsph) - +// clang-format off +FixStyle(smd/integrate_tlsph,FixSMDIntegrateTlsph); +// clang-format on #else #ifndef LMP_FIX_SMD_INTEGRATE_TLSPH_H @@ -36,28 +35,28 @@ FixStyle(smd/integrate_tlsph,FixSMDIntegrateTlsph) namespace LAMMPS_NS { -class FixSMDIntegrateTlsph: public Fix { - friend class Neighbor; - friend class PairTlsph; -public: - FixSMDIntegrateTlsph(class LAMMPS *, int, char **); - virtual ~FixSMDIntegrateTlsph() { - } - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void reset_dt(); +class FixSMDIntegrateTlsph : public Fix { + friend class Neighbor; + friend class PairTlsph; -protected: - double dtv, dtf, vlimit, vlimitsq; - int mass_require; - bool xsphFlag; + public: + FixSMDIntegrateTlsph(class LAMMPS *, int, char **); + virtual ~FixSMDIntegrateTlsph() {} + int setmask(); + virtual void init(); + virtual void initial_integrate(int); + virtual void final_integrate(); + virtual void reset_dt(); - class Pair *pair; + protected: + double dtv, dtf, vlimit, vlimitsq; + int mass_require; + bool xsphFlag; + + class Pair *pair; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/fix_smd_integrate_ulsph.cpp b/src/USER-SMD/fix_smd_integrate_ulsph.cpp index 8a40becf8d..2c9b71c400 100644 --- a/src/USER-SMD/fix_smd_integrate_ulsph.cpp +++ b/src/USER-SMD/fix_smd_integrate_ulsph.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/fix_smd_integrate_ulsph.h b/src/USER-SMD/fix_smd_integrate_ulsph.h index 5339671ab1..36afceeaaa 100644 --- a/src/USER-SMD/fix_smd_integrate_ulsph.h +++ b/src/USER-SMD/fix_smd_integrate_ulsph.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(smd/integrate_ulsph,FixSMDIntegrateUlsph) - +// clang-format off +FixStyle(smd/integrate_ulsph,FixSMDIntegrateUlsph); +// clang-format on #else #ifndef LMP_FIX_SMD_INTEGRATE_ULSPH_H @@ -47,18 +46,19 @@ class FixSMDIntegrateUlsph : public Fix { private: class NeighList *list; + protected: - double dtv,dtf, vlimit, vlimitsq; + double dtv, dtf, vlimit, vlimitsq; int mass_require; bool xsphFlag; bool adjust_radius_flag; double adjust_radius_factor; - int min_nn, max_nn; // number of SPH neighbors should lie within this interval + int min_nn, max_nn; // number of SPH neighbors should lie within this interval class Pair *pair; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/fix_smd_move_triangulated_surface.cpp b/src/USER-SMD/fix_smd_move_triangulated_surface.cpp index 58b9889031..15ba0ef828 100644 --- a/src/USER-SMD/fix_smd_move_triangulated_surface.cpp +++ b/src/USER-SMD/fix_smd_move_triangulated_surface.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/fix_smd_move_triangulated_surface.h b/src/USER-SMD/fix_smd_move_triangulated_surface.h index 9d0b3e6692..8fce159121 100644 --- a/src/USER-SMD/fix_smd_move_triangulated_surface.h +++ b/src/USER-SMD/fix_smd_move_triangulated_surface.h @@ -11,7 +11,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,41 +23,41 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(smd/move_tri_surf,FixSMDMoveTriSurf) - +// clang-format off +FixStyle(smd/move_tri_surf,FixSMDMoveTriSurf); +// clang-format on #else #ifndef LMP_FIX_SMD_INTEGRATE_TRIANGULAR_SURFACE_H #define LMP_FIX_SMD_INTEGRATE_TRIANGULAR_SURFACE_H -#include #include "fix.h" +#include namespace LAMMPS_NS { -class FixSMDMoveTriSurf: public Fix { -public: - FixSMDMoveTriSurf(class LAMMPS *, int, char **); - ~FixSMDMoveTriSurf(); - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - void reset_dt(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); +class FixSMDMoveTriSurf : public Fix { + public: + FixSMDMoveTriSurf(class LAMMPS *, int, char **); + ~FixSMDMoveTriSurf(); + int setmask(); + virtual void init(); + virtual void initial_integrate(int); + void reset_dt(); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); -protected: - double dtv; - bool linearFlag, wiggleFlag, rotateFlag; - double vx, vy, vz; - Eigen::Vector3d rotation_axis, origin; - double rotation_period; - Eigen::Matrix3d u_cross, uxu; - double wiggle_travel, wiggle_max_travel, wiggle_direction; + protected: + double dtv; + bool linearFlag, wiggleFlag, rotateFlag; + double vx, vy, vz; + Eigen::Vector3d rotation_axis, origin; + double rotation_period; + Eigen::Matrix3d u_cross, uxu; + double wiggle_travel, wiggle_max_travel, wiggle_direction; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/fix_smd_setvel.cpp b/src/USER-SMD/fix_smd_setvel.cpp index 312deb4d19..c0c0fccd46 100644 --- a/src/USER-SMD/fix_smd_setvel.cpp +++ b/src/USER-SMD/fix_smd_setvel.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -12,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/fix_smd_setvel.h b/src/USER-SMD/fix_smd_setvel.h index af4f556942..8791d58c3f 100644 --- a/src/USER-SMD/fix_smd_setvel.h +++ b/src/USER-SMD/fix_smd_setvel.h @@ -11,7 +11,7 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(smd/setvel,FixSMDSetVel) - +// clang-format off +FixStyle(smd/setvel,FixSMDSetVel); +// clang-format on #else #ifndef LMP_FIX_SMD_SETVEL_H @@ -49,19 +49,19 @@ class FixSMDSetVel : public Fix { double memory_usage(); private: - double xvalue,yvalue,zvalue; - int varflag,iregion; - char *xstr,*ystr,*zstr; + double xvalue, yvalue, zvalue; + int varflag, iregion; + char *xstr, *ystr, *zstr; char *idregion; - int xvar,yvar,zvar,xstyle,ystyle,zstyle; - double foriginal[3],foriginal_all[3]; + int xvar, yvar, zvar, xstyle, ystyle, zstyle; + double foriginal[3], foriginal_all[3]; int force_flag; int maxatom; double **sforce; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp index 685278d846..77d8bcc804 100644 --- a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp +++ b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -13,7 +14,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/fix_smd_tlsph_reference_configuration.h b/src/USER-SMD/fix_smd_tlsph_reference_configuration.h index 29f759d3a3..a5a26797e0 100644 --- a/src/USER-SMD/fix_smd_tlsph_reference_configuration.h +++ b/src/USER-SMD/fix_smd_tlsph_reference_configuration.h @@ -13,7 +13,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,11 +24,10 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - #ifdef FIX_CLASS - -FixStyle(SMD_TLSPH_NEIGHBORS,FixSMD_TLSPH_ReferenceConfiguration) - +// clang-format off +FixStyle(SMD_TLSPH_NEIGHBORS,FixSMD_TLSPH_ReferenceConfiguration); +// clang-format on #else #ifndef LMP_FIX_SMD_TLSPH_REFERENCE_H @@ -38,48 +37,46 @@ FixStyle(SMD_TLSPH_NEIGHBORS,FixSMD_TLSPH_ReferenceConfiguration) namespace LAMMPS_NS { -class FixSMD_TLSPH_ReferenceConfiguration: public Fix { - friend class Neighbor; - friend class PairTlsph; +class FixSMD_TLSPH_ReferenceConfiguration : public Fix { + friend class Neighbor; + friend class PairTlsph; -public: - FixSMD_TLSPH_ReferenceConfiguration(class LAMMPS *, int, char **); - ~FixSMD_TLSPH_ReferenceConfiguration(); - int setmask(); - void init(); - void setup(int); - void pre_exchange(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + public: + FixSMD_TLSPH_ReferenceConfiguration(class LAMMPS *, int, char **); + ~FixSMD_TLSPH_ReferenceConfiguration(); + int setmask(); + void init(); + void setup(int); + void pre_exchange(); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + double memory_usage(); + void grow_arrays(int); + void copy_arrays(int, int, int); + int pack_exchange(int, double *); + int unpack_exchange(int, double *); + int pack_restart(int, double *); + void unpack_restart(int, int); + int size_restart(int); + int maxsize_restart(); - bool crack_exclude(int i, int j); - bool get_line_intersection(int i, int j); + bool crack_exclude(int i, int j); + bool get_line_intersection(int i, int j); -protected: - int updateFlag; // flag to update reference configuration - int nmax; - int maxpartner; - int *npartner; // # of touching partners of each atom - tagint **partner; // global atom IDs for the partners - float **wfd_list, **wf_list, **energy_per_bond; - float **degradation_ij; // per-pair interaction degradation status - - class Pair *pair; + protected: + int updateFlag; // flag to update reference configuration + int nmax; + int maxpartner; + int *npartner; // # of touching partners of each atom + tagint **partner; // global atom IDs for the partners + float **wfd_list, **wf_list, **energy_per_bond; + float **degradation_ij; // per-pair interaction degradation status + class Pair *pair; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-SMD/fix_smd_wall_surface.cpp b/src/USER-SMD/fix_smd_wall_surface.cpp index 4c9c469bda..2e2366f085 100644 --- a/src/USER-SMD/fix_smd_wall_surface.cpp +++ b/src/USER-SMD/fix_smd_wall_surface.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/fix_smd_wall_surface.h b/src/USER-SMD/fix_smd_wall_surface.h index 7f96222ff5..74d7784eee 100644 --- a/src/USER-SMD/fix_smd_wall_surface.h +++ b/src/USER-SMD/fix_smd_wall_surface.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(smd/wall_surface,FixSMDWallSurface) - +// clang-format off +FixStyle(smd/wall_surface,FixSMDWallSurface); +// clang-format on #else #ifndef LMP_FIX_SMD_WALL_SURFACE_H @@ -24,27 +24,26 @@ FixStyle(smd/wall_surface,FixSMDWallSurface) namespace LAMMPS_NS { -class FixSMDWallSurface: public Fix { +class FixSMDWallSurface : public Fix { -public: - FixSMDWallSurface(class LAMMPS *, int, char **); - virtual ~FixSMDWallSurface(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); + public: + FixSMDWallSurface(class LAMMPS *, int, char **); + virtual ~FixSMDWallSurface(); + int setmask(); + void init(); + void setup(int); + void min_setup(int); - void read_triangles(int pass); + void read_triangles(int pass); -private: - int first; // flag for first time initialization - double sublo[3], subhi[3]; // epsilon-extended proc sub-box for adding atoms; - char *filename; - int wall_particle_type; - int wall_molecule_id; + private: + int first; // flag for first time initialization + double sublo[3], subhi[3]; // epsilon-extended proc sub-box for adding atoms; + char *filename; + int wall_particle_type; + int wall_molecule_id; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-SMD/pair_smd_hertz.cpp b/src/USER-SMD/pair_smd_hertz.cpp index 763a0431c7..24e6802a14 100644 --- a/src/USER-SMD/pair_smd_hertz.cpp +++ b/src/USER-SMD/pair_smd_hertz.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/pair_smd_hertz.h b/src/USER-SMD/pair_smd_hertz.h index 2cdfaceb51..0d3c5b880b 100644 --- a/src/USER-SMD/pair_smd_hertz.h +++ b/src/USER-SMD/pair_smd_hertz.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(smd/hertz,PairHertz) - +// clang-format off +PairStyle(smd/hertz,PairHertz); +// clang-format on #else #ifndef LMP_SMD_HERTZ_H @@ -53,17 +52,16 @@ class PairHertz : public Pair { double **bulkmodulus; double **kn; - double *onerad_dynamic,*onerad_frozen; - double *maxrad_dynamic,*maxrad_frozen; + double *onerad_dynamic, *onerad_frozen; + double *maxrad_dynamic, *maxrad_frozen; double scale; - double stable_time_increment; // stable time step size + double stable_time_increment; // stable time step size void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-SMD/pair_smd_tlsph.cpp b/src/USER-SMD/pair_smd_tlsph.cpp index bf9fcdc1e7..62e8e5e1c1 100644 --- a/src/USER-SMD/pair_smd_tlsph.cpp +++ b/src/USER-SMD/pair_smd_tlsph.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/pair_smd_tlsph.h b/src/USER-SMD/pair_smd_tlsph.h index 4a5d55c768..b641ca71e5 100644 --- a/src/USER-SMD/pair_smd_tlsph.h +++ b/src/USER-SMD/pair_smd_tlsph.h @@ -11,7 +11,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(smd/tlsph,PairTlsph) - +// clang-format off +PairStyle(smd/tlsph,PairTlsph); +// clang-format on #else #ifndef LMP_TLSPH_NEW_H @@ -36,169 +36,178 @@ PairStyle(smd/tlsph,PairTlsph) namespace LAMMPS_NS { -class PairTlsph: public Pair { -public: +class PairTlsph : public Pair { + public: + PairTlsph(class LAMMPS *); + virtual ~PairTlsph(); + virtual void compute(int, int); + void settings(int, char **); + void coeff(int, char **); + double init_one(int, int); + void init_style(); + void init_list(int, class NeighList *); + void write_restart_settings(FILE *) {} + void read_restart_settings(FILE *) {} + virtual double memory_usage(); + void compute_shape_matrix(void); + void material_model(void); + void *extract(const char *, int &); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); + void AssembleStress(); - PairTlsph(class LAMMPS *); - virtual ~PairTlsph(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); - void init_list(int, class NeighList *); - void write_restart_settings(FILE *) { - } - void read_restart_settings(FILE *) { - } - virtual double memory_usage(); - void compute_shape_matrix(void); - void material_model(void); - void *extract(const char *, int &); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - void AssembleStress(); + void PreCompute(); + void ComputeForces(int eflag, int vflag); + void effective_longitudinal_modulus(const int itype, const double dt, const double d_iso, + const double p_rate, const Eigen::Matrix3d d_dev, + const Eigen::Matrix3d sigma_dev_rate, const double damage, + double &K_eff, double &mu_eff, double &M_eff); - void PreCompute(); - void ComputeForces(int eflag, int vflag); - void effective_longitudinal_modulus(const int itype, const double dt, const double d_iso, const double p_rate, - const Eigen::Matrix3d d_dev, const Eigen::Matrix3d sigma_dev_rate, const double damage, double &K_eff, double &mu_eff, double &M_eff); + void 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); + void ComputeStressDeviator(const int i, const Eigen::Matrix3d sigmaInitial_dev, + const Eigen::Matrix3d d_dev, Eigen::Matrix3d &sigmaFinal_dev, + Eigen::Matrix3d &sigma_dev_rate, double &plastic_strain_increment); + void ComputeDamage(const int i, const Eigen::Matrix3d strain, const Eigen::Matrix3d sigmaFinal, + Eigen::Matrix3d &sigma_damaged); - void 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); - void ComputeStressDeviator(const int i, const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, Eigen::Matrix3d &sigmaFinal_dev, - Eigen::Matrix3d &sigma_dev_rate, double &plastic_strain_increment); - void ComputeDamage(const int i, const Eigen::Matrix3d strain, const Eigen::Matrix3d sigmaFinal, Eigen::Matrix3d &sigma_damaged); + protected: + void allocate(); + char *suffix; - -protected: - void allocate(); - char *suffix; - - /* + /* * per-type arrays */ - int *strengthModel, *eos; - double *onerad_dynamic, *onerad_frozen, *maxrad_dynamic, *maxrad_frozen; + int *strengthModel, *eos; + double *onerad_dynamic, *onerad_frozen, *maxrad_dynamic, *maxrad_frozen; - /* + /* * per atom arrays */ - Eigen::Matrix3d *K, *PK1, *Fdot, *Fincr; - Eigen::Matrix3d *R; // rotation matrix - Eigen::Matrix3d *FincrInv; - Eigen::Matrix3d *D, *W; // strain rate and spin tensor - Eigen::Vector3d *smoothVelDifference; - Eigen::Matrix3d *CauchyStress; - double *detF, *particle_dt; - double *hourglass_error; - int *numNeighsRefConfig; + Eigen::Matrix3d *K, *PK1, *Fdot, *Fincr; + Eigen::Matrix3d *R; // rotation matrix + Eigen::Matrix3d *FincrInv; + Eigen::Matrix3d *D, *W; // strain rate and spin tensor + Eigen::Vector3d *smoothVelDifference; + Eigen::Matrix3d *CauchyStress; + double *detF, *particle_dt; + double *hourglass_error; + int *numNeighsRefConfig; - int nmax; // max number of atoms on this proc - double hMin; // minimum kernel radius for two particles - double dtCFL; - double dtRelative; // relative velocity of two particles, divided by sound speed - int updateFlag; - double update_threshold; // updateFlage is set to one if the relative displacement of a pair exceeds update_threshold - double cut_comm; + int nmax; // max number of atoms on this proc + double hMin; // minimum kernel radius for two particles + double dtCFL; + double dtRelative; // relative velocity of two particles, divided by sound speed + int updateFlag; + double + update_threshold; // updateFlage is set to one if the relative displacement of a pair exceeds update_threshold + double cut_comm; - enum { - UPDATE_NONE = 5000, UPDATE_CONSTANT_THRESHOLD = 5001, UPDATE_PAIRWISE_RATIO = 5002, - }; + enum { + UPDATE_NONE = 5000, + UPDATE_CONSTANT_THRESHOLD = 5001, + UPDATE_PAIRWISE_RATIO = 5002, + }; - enum { - LINEAR_DEFGRAD = 0, - STRENGTH_LINEAR = 1, - STRENGTH_LINEAR_PLASTIC = 2, - STRENGTH_JOHNSON_COOK = 3, - STRENGTH_NONE = 4, - EOS_LINEAR = 5, - EOS_SHOCK = 6, - EOS_POLYNOMIAL = 7, - EOS_NONE = 8, - REFERENCE_DENSITY = 9, - YOUNGS_MODULUS = 10, - POISSON_RATIO = 11, - HOURGLASS_CONTROL_AMPLITUDE = 12, - HEAT_CAPACITY = 13, - LAME_LAMBDA = 14, - SHEAR_MODULUS = 15, - M_MODULUS = 16, - SIGNAL_VELOCITY = 17, - BULK_MODULUS = 18, - VISCOSITY_Q1 = 19, - VISCOSITY_Q2 = 20, - YIELD_STRESS = 21, - FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD = 22, - JC_A = 23, - JC_B = 24, - JC_a = 25, - JC_C = 26, - JC_epdot0 = 27, - JC_T0 = 28, - JC_Tmelt = 29, - JC_M = 30, - EOS_SHOCK_C0 = 31, - EOS_SHOCK_S = 32, - EOS_SHOCK_GAMMA = 33, - HARDENING_PARAMETER = 34, - FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD = 35, - FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD = 36, - FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD = 37, - EOS_POLYNOMIAL_C0 = 38, - EOS_POLYNOMIAL_C1 = 39, - EOS_POLYNOMIAL_C2 = 40, - EOS_POLYNOMIAL_C3 = 41, - EOS_POLYNOMIAL_C4 = 42, - EOS_POLYNOMIAL_C5 = 43, - EOS_POLYNOMIAL_C6 = 44, + enum { + LINEAR_DEFGRAD = 0, + STRENGTH_LINEAR = 1, + STRENGTH_LINEAR_PLASTIC = 2, + STRENGTH_JOHNSON_COOK = 3, + STRENGTH_NONE = 4, + EOS_LINEAR = 5, + EOS_SHOCK = 6, + EOS_POLYNOMIAL = 7, + EOS_NONE = 8, + REFERENCE_DENSITY = 9, + YOUNGS_MODULUS = 10, + POISSON_RATIO = 11, + HOURGLASS_CONTROL_AMPLITUDE = 12, + HEAT_CAPACITY = 13, + LAME_LAMBDA = 14, + SHEAR_MODULUS = 15, + M_MODULUS = 16, + SIGNAL_VELOCITY = 17, + BULK_MODULUS = 18, + VISCOSITY_Q1 = 19, + VISCOSITY_Q2 = 20, + YIELD_STRESS = 21, + FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD = 22, + JC_A = 23, + JC_B = 24, + JC_a = 25, + JC_C = 26, + JC_epdot0 = 27, + JC_T0 = 28, + JC_Tmelt = 29, + JC_M = 30, + EOS_SHOCK_C0 = 31, + EOS_SHOCK_S = 32, + EOS_SHOCK_GAMMA = 33, + HARDENING_PARAMETER = 34, + FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD = 35, + FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD = 36, + FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD = 37, + EOS_POLYNOMIAL_C0 = 38, + EOS_POLYNOMIAL_C1 = 39, + EOS_POLYNOMIAL_C2 = 40, + EOS_POLYNOMIAL_C3 = 41, + EOS_POLYNOMIAL_C4 = 42, + EOS_POLYNOMIAL_C5 = 43, + EOS_POLYNOMIAL_C6 = 44, - FAILURE_JC_D1 = 45, - FAILURE_JC_D2 = 46, - FAILURE_JC_D3 = 47, - FAILURE_JC_D4 = 48, - FAILURE_JC_EPDOT0 = 49, + FAILURE_JC_D1 = 45, + FAILURE_JC_D2 = 46, + FAILURE_JC_D3 = 47, + FAILURE_JC_D4 = 48, + FAILURE_JC_EPDOT0 = 49, - CRITICAL_ENERGY_RELEASE_RATE = 50, + CRITICAL_ENERGY_RELEASE_RATE = 50, - MAX_KEY_VALUE = 51 - }; + MAX_KEY_VALUE = 51 + }; - struct failure_types { // this is defined per type and determines which failure/damage model is active - bool failure_none; - bool failure_max_principal_strain; - bool failure_max_principal_stress; - bool failure_max_plastic_strain; - bool failure_johnson_cook; - bool failure_max_pairwise_strain; - bool integration_point_wise; // true if failure model applies to stress/strain state of integration point - bool failure_energy_release_rate; + struct + failure_types { // this is defined per type and determines which failure/damage model is active + bool failure_none; + bool failure_max_principal_strain; + bool failure_max_principal_stress; + bool failure_max_plastic_strain; + bool failure_johnson_cook; + bool failure_max_pairwise_strain; + bool + integration_point_wise; // true if failure model applies to stress/strain state of integration point + bool failure_energy_release_rate; - failure_types() { - failure_none = true; - failure_max_principal_strain = false; - failure_max_principal_stress = false; - failure_max_plastic_strain = false; - failure_johnson_cook = false; - failure_max_pairwise_strain = false; - integration_point_wise = false; - failure_energy_release_rate = false; - //printf("constructed failure type\n"); - } - }; - failure_types *failureModel; + failure_types() + { + failure_none = true; + failure_max_principal_strain = false; + failure_max_principal_stress = false; + failure_max_plastic_strain = false; + failure_johnson_cook = false; + failure_max_pairwise_strain = false; + integration_point_wise = false; + failure_energy_release_rate = false; + //printf("constructed failure type\n"); + } + }; + failure_types *failureModel; - int ifix_tlsph; - int update_method; + int ifix_tlsph; + int update_method; - class FixSMD_TLSPH_ReferenceConfiguration *fix_tlsph_reference_configuration; + class FixSMD_TLSPH_ReferenceConfiguration *fix_tlsph_reference_configuration; -private: - double **Lookup; // holds per-type material parameters for the quantities defined in enum statement above. - bool first; // if first is true, do not perform any computations, because reference configuration is not ready yet. + private: + double ** + Lookup; // holds per-type material parameters for the quantities defined in enum statement above. + bool + first; // if first is true, do not perform any computations, because reference configuration is not ready yet. }; -} +} // namespace LAMMPS_NS #endif #endif @@ -221,4 +230,3 @@ private: * Blei: rho = 11.34e-6, c0=2000, s=1.46, Gamma=2.77 * Stahl 1403: rho = 7.86e-3, c=4569, s=1.49, Gamma=2.17 */ - diff --git a/src/USER-SMD/pair_smd_triangulated_surface.cpp b/src/USER-SMD/pair_smd_triangulated_surface.cpp index 544a31c817..36a34b5f1c 100644 --- a/src/USER-SMD/pair_smd_triangulated_surface.cpp +++ b/src/USER-SMD/pair_smd_triangulated_surface.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/pair_smd_triangulated_surface.h b/src/USER-SMD/pair_smd_triangulated_surface.h index 6b4e83616c..5e2c8e3fc4 100644 --- a/src/USER-SMD/pair_smd_triangulated_surface.h +++ b/src/USER-SMD/pair_smd_triangulated_surface.h @@ -9,10 +9,9 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(smd/tri_surface,PairTriSurf) - +// clang-format off +PairStyle(smd/tri_surface,PairTriSurf); +// clang-format on #else #ifndef LMP_SMD_TRI_SURFACE_H @@ -35,7 +34,6 @@ PairStyle(smd/tri_surface,PairTriSurf) #include "pair.h" #include - namespace LAMMPS_NS { class PairTriSurf : public Pair { @@ -49,8 +47,9 @@ class PairTriSurf : public Pair { void init_style(); void init_list(int, class NeighList *); virtual double memory_usage(); - void PointTriangleDistance(const Eigen::Vector3d P, const Eigen::Vector3d TRI1, const Eigen::Vector3d TRI2, const Eigen::Vector3d TRI3, - Eigen::Vector3d &CP, double &dist); + void PointTriangleDistance(const Eigen::Vector3d P, const Eigen::Vector3d TRI1, + const Eigen::Vector3d TRI2, const Eigen::Vector3d TRI3, + Eigen::Vector3d &CP, double &dist); double clamp(const double a, const double min, const double max); void *extract(const char *, int &); @@ -58,16 +57,16 @@ class PairTriSurf : public Pair { double **bulkmodulus; double **kn; - double *onerad_dynamic,*onerad_frozen; - double *maxrad_dynamic,*maxrad_frozen; + double *onerad_dynamic, *onerad_frozen; + double *maxrad_dynamic, *maxrad_frozen; double scale; - double stable_time_increment; // stable time step size + double stable_time_increment; // stable time step size void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/pair_smd_ulsph.cpp b/src/USER-SMD/pair_smd_ulsph.cpp index 510d3e1a66..38a80195e9 100644 --- a/src/USER-SMD/pair_smd_ulsph.cpp +++ b/src/USER-SMD/pair_smd_ulsph.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/pair_smd_ulsph.h b/src/USER-SMD/pair_smd_ulsph.h index 5313985bf7..b9ae311917 100644 --- a/src/USER-SMD/pair_smd_ulsph.h +++ b/src/USER-SMD/pair_smd_ulsph.h @@ -11,7 +11,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,9 +23,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(smd/ulsph,PairULSPH) - +// clang-format off +PairStyle(smd/ulsph,PairULSPH); +// clang-format on #else #ifndef LMP_ULSPH_H @@ -36,101 +36,98 @@ PairStyle(smd/ulsph,PairULSPH) namespace LAMMPS_NS { -class PairULSPH: public Pair { -public: - PairULSPH(class LAMMPS *); - virtual ~PairULSPH(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); - void init_list(int, class NeighList *); - virtual double memory_usage(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - void AssembleStressTensor(); - void *extract(const char *, int &); - void PreCompute(); - void PreCompute_DensitySummation(); - double effective_shear_modulus(const Eigen::Matrix3d d_dev, const Eigen::Matrix3d deltaStressDev, const double dt, const int itype); +class PairULSPH : public Pair { + public: + PairULSPH(class LAMMPS *); + virtual ~PairULSPH(); + virtual void compute(int, int); + void settings(int, char **); + void coeff(int, char **); + double init_one(int, int); + void init_style(); + void init_list(int, class NeighList *); + virtual double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); + void AssembleStressTensor(); + void *extract(const char *, int &); + void PreCompute(); + void PreCompute_DensitySummation(); + double effective_shear_modulus(const Eigen::Matrix3d d_dev, const Eigen::Matrix3d deltaStressDev, + const double dt, const int itype); - Eigen::Vector3d ComputeHourglassForce(const int i, const int itype, const int j, const int jtype, const Eigen::Vector3d dv, - const Eigen::Vector3d xij, const Eigen::Vector3d g, const double c_ij, const double mu_ij, const double rho_ij); + Eigen::Vector3d ComputeHourglassForce(const int i, const int itype, const int j, const int jtype, + const Eigen::Vector3d dv, const Eigen::Vector3d xij, + const Eigen::Vector3d g, const double c_ij, + const double mu_ij, const double rho_ij); -protected: + protected: + double *c0_type; // reference speed of sound defined per particle type + double *rho0; // reference mass density per type + double *Q1; // linear artificial viscosity coeff + int *eos, *viscosity, *strength; // eos and strength material models + double **artificial_pressure; // true/false: use Monaghan's artificial pressure correction? + double **artificial_stress; // artificial stress amplitude - double *c0_type; // reference speed of sound defined per particle type - double *rho0; // reference mass density per type - double *Q1; // linear artificial viscosity coeff - int *eos, *viscosity, *strength; // eos and strength material models - double **artificial_pressure; // true/false: use Monaghan's artificial pressure correction? - double **artificial_stress; // artificial stress amplitude + double *onerad_dynamic, *onerad_frozen; + double *maxrad_dynamic, *maxrad_frozen; - double *onerad_dynamic, *onerad_frozen; - double *maxrad_dynamic, *maxrad_frozen; + void allocate(); - void allocate(); + int nmax; // max number of atoms on this proc + int *numNeighs; + Eigen::Matrix3d *K; + double *shepardWeight, *c0, *rho; + Eigen::Vector3d *smoothVel; + Eigen::Matrix3d *stressTensor, *L, *F; - int nmax; // max number of atoms on this proc - int *numNeighs; - Eigen::Matrix3d *K; - double *shepardWeight, *c0, *rho; - Eigen::Vector3d *smoothVel; - Eigen::Matrix3d *stressTensor, *L, *F; + double dtCFL; - double dtCFL; + private: + // enumerate EOSs. MUST BE IN THE RANGE [1000, 2000) + enum { + EOS_LINEAR = 1000, + EOS_PERFECT_GAS = 1001, + EOS_TAIT = 1002, + }; -private: + // enumerate physical viscosity models. MUST BE IN THE RANGE [2000, 3000) + enum { VISCOSITY_NEWTON = 2000 }; - // enumerate EOSs. MUST BE IN THE RANGE [1000, 2000) - enum { - EOS_LINEAR = 1000, EOS_PERFECT_GAS = 1001, EOS_TAIT = 1002, - }; + // enumerate strength models. MUST BE IN THE RANGE [3000, 4000) + enum { STRENGTH_LINEAR = 3000, STRENGTH_LINEAR_PLASTIC = 3001 }; - // enumerate physical viscosity models. MUST BE IN THE RANGE [2000, 3000) - enum { - VISCOSITY_NEWTON = 2000 - }; + // enumerate some quantitities and associate these with integer values such that they can be used for lookup in an array structure + enum { + NONE = 0, + BULK_MODULUS = 1, + HOURGLASS_CONTROL_AMPLITUDE = 2, + EOS_TAIT_EXPONENT = 3, + REFERENCE_SOUNDSPEED = 4, + REFERENCE_DENSITY = 5, + EOS_PERFECT_GAS_GAMMA = 6, + SHEAR_MODULUS = 7, + YIELD_STRENGTH = 8, + YOUNGS_MODULUS = 9, + POISSON_RATIO = 10, + LAME_LAMBDA = 11, + HEAT_CAPACITY = 12, + M_MODULUS = 13, + HARDENING_PARAMETER = 14, + VISCOSITY_MU = 15, + MAX_KEY_VALUE = 16 + }; + double ** + Lookup; // holds per-type material parameters for the quantities defined in enum statement above. - // enumerate strength models. MUST BE IN THE RANGE [3000, 4000) - enum { - STRENGTH_LINEAR = 3000, STRENGTH_LINEAR_PLASTIC = 3001 - }; - - // enumerate some quantitities and associate these with integer values such that they can be used for lookup in an array structure - enum { - NONE = 0, - BULK_MODULUS = 1, - HOURGLASS_CONTROL_AMPLITUDE = 2, - EOS_TAIT_EXPONENT = 3, - REFERENCE_SOUNDSPEED = 4, - REFERENCE_DENSITY = 5, - EOS_PERFECT_GAS_GAMMA = 6, - SHEAR_MODULUS = 7, - YIELD_STRENGTH = 8, - YOUNGS_MODULUS = 9, - POISSON_RATIO = 10, - LAME_LAMBDA = 11, - HEAT_CAPACITY = 12, - M_MODULUS = 13, - HARDENING_PARAMETER = 14, - VISCOSITY_MU = 15, - MAX_KEY_VALUE = 16 - }; - double **Lookup; // holds per-type material parameters for the quantities defined in enum statement above. - - bool velocity_gradient_required; - int updateFlag; // indicates if any relative particle pair movement is significant compared to smoothing length - - - bool density_summation, density_continuity, velocity_gradient, gradient_correction_flag; - double *effm; + bool velocity_gradient_required; + int updateFlag; // indicates if any relative particle pair movement is significant compared to smoothing length + bool density_summation, density_continuity, velocity_gradient, gradient_correction_flag; + double *effm; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-SMD/smd_kernels.h b/src/USER-SMD/smd_kernels.h index 3bc89b7e64..67244b64d3 100644 --- a/src/USER-SMD/smd_kernels.h +++ b/src/USER-SMD/smd_kernels.h @@ -13,134 +13,142 @@ #define SMD_KERNEL_FUNCTIONS_H_ namespace SMD_Kernels { -static inline double Kernel_Wendland_Quintic_NotNormalized(const double r, const double h) { - if (r < h) { - double q = 2.0 * r / h; - return pow(1.0 - 0.5 * q, 4) * (2.0 * q + 1.0); - } else { - return 0.0; - } +static inline double Kernel_Wendland_Quintic_NotNormalized(const double r, const double h) +{ + if (r < h) { + double q = 2.0 * r / h; + return pow(1.0 - 0.5 * q, 4) * (2.0 * q + 1.0); + } else { + return 0.0; + } } -static inline double Kernel_Cubic_Spline(const double r, const double h) { - double q = 2.0 * r / h; - if (q > 2.0) { - return 0.0; - } else if ((q <= 2.0) && (q > 1.0)) { - return pow(2.0 - q, 3.0) / 6.0; - } else if ((q >= 0.0) && (q <= 1.0)) { - return 2. / 3. - q * q + 0.5 * q * q * q; - } else { - return 0.0; - } +static inline double Kernel_Cubic_Spline(const double r, const double h) +{ + double q = 2.0 * r / h; + if (q > 2.0) { + return 0.0; + } else if ((q <= 2.0) && (q > 1.0)) { + return pow(2.0 - q, 3.0) / 6.0; + } else if ((q >= 0.0) && (q <= 1.0)) { + return 2. / 3. - q * q + 0.5 * q * q * q; + } else { + return 0.0; + } } -static inline double Kernel_Barbara(const double r, const double h) { - double arg = (1.570796327 * (r + h)) / h; - double hsq = h * h; - //wf = (1.680351548 * (cos(arg) + 1.)) / hsq; - return -2.639490040 * sin(arg) / (hsq * h); +static inline double Kernel_Barbara(const double r, const double h) +{ + double arg = (1.570796327 * (r + h)) / h; + double hsq = h * h; + //wf = (1.680351548 * (cos(arg) + 1.)) / hsq; + return -2.639490040 * sin(arg) / (hsq * h); } -static inline void spiky_kernel_and_derivative(const double h, const double r, const int dimension, double &wf, double &wfd) { +static inline void spiky_kernel_and_derivative(const double h, const double r, const int dimension, + double &wf, double &wfd) +{ - /* + /* * Spiky kernel */ - if (r > h) { - printf("r=%f > h=%f in Spiky kernel\n", r, h); - wf = wfd = 0.0; - return; - } + if (r > h) { + printf("r=%f > h=%f in Spiky kernel\n", r, h); + wf = wfd = 0.0; + return; + } - double hr = h - r; // [m] - if (dimension == 2) { - double n = 0.3141592654e0 * h * h * h * h * h; // [m^5] - wfd = -3.0e0 * hr * hr / n; // [m*m/m^5] = [1/m^3] ==> correct for dW/dr in 2D - wf = -0.333333333333e0 * hr * wfd; // [m/m^3] ==> [1/m^2] correct for W in 2D - } else { - wfd = -14.0323944878e0 * hr * hr / (h * h * h * h * h * h); // [1/m^4] ==> correct for dW/dr in 3D - wf = -0.333333333333e0 * hr * wfd; // [m/m^4] ==> [1/m^3] correct for W in 3D - } - - // alternative formulation -// double hr = h - r; -// -// /* -// * Spiky kernel -// */ -// -// if (domain->dimension == 2) { -// double h5 = h * h * h * h * h; -// wf = 3.183098861e0 * hr * hr * hr / h5; -// wfd = -9.549296583 * hr * hr / h5; -// -// } else { -// double h6 = h * h * h * h * h * h; -// wf = 4.774648292 * hr * hr * hr / h6; -// wfd = -14.32394487 * hr * hr / h6; -// } -// } + double hr = h - r; // [m] + if (dimension == 2) { + double n = 0.3141592654e0 * h * h * h * h * h; // [m^5] + wfd = -3.0e0 * hr * hr / n; // [m*m/m^5] = [1/m^3] ==> correct for dW/dr in 2D + wf = -0.333333333333e0 * hr * wfd; // [m/m^3] ==> [1/m^2] correct for W in 2D + } else { + wfd = -14.0323944878e0 * hr * hr / + (h * h * h * h * h * h); // [1/m^4] ==> correct for dW/dr in 3D + wf = -0.333333333333e0 * hr * wfd; // [m/m^4] ==> [1/m^3] correct for W in 3D + } + // alternative formulation + // double hr = h - r; + // + // /* + // * Spiky kernel + // */ + // + // if (domain->dimension == 2) { + // double h5 = h * h * h * h * h; + // wf = 3.183098861e0 * hr * hr * hr / h5; + // wfd = -9.549296583 * hr * hr / h5; + // + // } else { + // double h6 = h * h * h * h * h * h; + // wf = 4.774648292 * hr * hr * hr / h6; + // wfd = -14.32394487 * hr * hr / h6; + // } + // } } -static inline void barbara_kernel_and_derivative(const double h, const double r, const int dimension, double &wf, double &wfd) { +static inline void barbara_kernel_and_derivative(const double h, const double r, + const int dimension, double &wf, double &wfd) +{ - /* + /* * Barbara kernel */ - double arg = (1.570796327 * (r + h)) / h; - double hsq = h * h; + double arg = (1.570796327 * (r + h)) / h; + double hsq = h * h; - if (r > h) { - printf("r = %f > h = %f in barbara kernel function\n", r, h); - exit(1); - //wf = wfd = 0.0; - //return; - } + if (r > h) { + printf("r = %f > h = %f in barbara kernel function\n", r, h); + exit(1); + //wf = wfd = 0.0; + //return; + } - if (dimension == 2) { - wf = (1.680351548 * (cos(arg) + 1.)) / hsq; - wfd = -2.639490040 * sin(arg) / (hsq * h); - } else { - wf = 2.051578323 * (cos(arg) + 1.) / (hsq * h); - wfd = -3.222611694 * sin(arg) / (hsq * hsq); - } + if (dimension == 2) { + wf = (1.680351548 * (cos(arg) + 1.)) / hsq; + wfd = -2.639490040 * sin(arg) / (hsq * h); + } else { + wf = 2.051578323 * (cos(arg) + 1.) / (hsq * h); + wfd = -3.222611694 * sin(arg) / (hsq * hsq); + } } /* * compute a normalized smoothing kernel only */ -static inline void Poly6Kernel(const double hsq, const double h, const double rsq, const int dimension, double &wf) { +static inline void Poly6Kernel(const double hsq, const double h, const double rsq, + const int dimension, double &wf) +{ - double tmp = hsq - rsq; - if (dimension == 2) { - wf = tmp * tmp * tmp / (0.7853981635e0 * hsq * hsq * hsq * hsq); - } else { - wf = tmp * tmp * tmp / (0.6382918409e0 * hsq * hsq * hsq * hsq * h); - } + double tmp = hsq - rsq; + if (dimension == 2) { + wf = tmp * tmp * tmp / (0.7853981635e0 * hsq * hsq * hsq * hsq); + } else { + wf = tmp * tmp * tmp / (0.6382918409e0 * hsq * hsq * hsq * hsq * h); + } } /* * M4 Prime Kernel */ -static inline void M4PrimeKernel(const double s, double &wf) { - if (s < 1.0) { - //wf = 1.0 - 2.5 * s * s + (3./2.) * s * s * s; - wf = 1.0 - s * s *(2.5 -1.5 *s); - } else if (s < 2.0) { - //wf = 0.5 * (1.0 - s) * ((2.0 - s) * (2.0 - s)); - wf = 2.0 + (-4.0 + (2.5 - 0.5 * s)*s)*s; - } else { - wf = 0.0; - } +static inline void M4PrimeKernel(const double s, double &wf) +{ + if (s < 1.0) { + //wf = 1.0 - 2.5 * s * s + (3./2.) * s * s * s; + wf = 1.0 - s * s * (2.5 - 1.5 * s); + } else if (s < 2.0) { + //wf = 0.5 * (1.0 - s) * ((2.0 - s) * (2.0 - s)); + wf = 2.0 + (-4.0 + (2.5 - 0.5 * s) * s) * s; + } else { + wf = 0.0; + } } -} - - +} // namespace SMD_Kernels #endif /* SMD_KERNEL_FUNCTIONS_H_ */ diff --git a/src/USER-SMD/smd_material_models.cpp b/src/USER-SMD/smd_material_models.cpp index 0d02cbe062..a49b5b034d 100644 --- a/src/USER-SMD/smd_material_models.cpp +++ b/src/USER-SMD/smd_material_models.cpp @@ -1,3 +1,4 @@ +// clang-format off /* ---------------------------------------------------------------------- * * *** Smooth Mach Dynamics *** @@ -11,7 +12,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMD/smd_material_models.h b/src/USER-SMD/smd_material_models.h index 761ac4ec8a..89dca2155a 100644 --- a/src/USER-SMD/smd_material_models.h +++ b/src/USER-SMD/smd_material_models.h @@ -11,7 +11,7 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -31,25 +31,33 @@ * EOS models */ void LinearEOS(double lambda, double pInitial, double d, double dt, double &pFinal, double &p_rate); -void ShockEOS(double rho, double rho0, double e, double e0, double c0, double S, double Gamma, double pInitial, double dt, - double &pFinal, double &p_rate); -void polynomialEOS(double rho, double rho0, double e, double C0, double C1, double C2, double C3, double C4, double C5, double C6, - double pInitial, double dt, double &pFinal, double &p_rate); -void TaitEOS_density(const double exponent, const double c0_reference, const double rho_reference, const double rho_current, - double &pressure, double &sound_speed); -void PerfectGasEOS(const double gamma, const double vol, const double mass, const double energy, double &pFinal__, double &c0); +void ShockEOS(double rho, double rho0, double e, double e0, double c0, double S, double Gamma, + double pInitial, double dt, double &pFinal, double &p_rate); +void polynomialEOS(double rho, double rho0, double e, double C0, double C1, double C2, double C3, + double C4, double C5, double C6, double pInitial, double dt, double &pFinal, + double &p_rate); +void TaitEOS_density(const double exponent, const double c0_reference, const double rho_reference, + const double rho_current, double &pressure, double &sound_speed); +void PerfectGasEOS(const double gamma, const double vol, const double mass, const double energy, + double &pFinal__, double &c0); /* * Material strength models */ -void LinearStrength(const double mu, const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, const double dt, - Eigen::Matrix3d &sigmaFinal_dev__, Eigen::Matrix3d &sigma_dev_rate__); -void LinearPlasticStrength(const double G, const double yieldStress, const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, - const double dt, Eigen::Matrix3d &sigmaFinal_dev__, Eigen::Matrix3d &sigma_dev_rate__, double &plastic_strain_increment); -void JohnsonCookStrength(const double G, const double cp, const double espec, const double A, const double B, const double a, - const double C, const double epdot0, const double T0, const double Tmelt, const double M, const double dt, const double ep, - const double epdot, const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, Eigen::Matrix3d &sigmaFinal_dev__, - Eigen::Matrix3d &sigma_dev_rate__, double &plastic_strain_increment); +void LinearStrength(const double mu, const Eigen::Matrix3d sigmaInitial_dev, + const Eigen::Matrix3d d_dev, const double dt, Eigen::Matrix3d &sigmaFinal_dev__, + Eigen::Matrix3d &sigma_dev_rate__); +void LinearPlasticStrength(const double G, const double yieldStress, + const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, + const double dt, Eigen::Matrix3d &sigmaFinal_dev__, + Eigen::Matrix3d &sigma_dev_rate__, double &plastic_strain_increment); +void JohnsonCookStrength(const double G, const double cp, const double espec, const double A, + const double B, const double a, const double C, const double epdot0, + const double T0, const double Tmelt, const double M, const double dt, + const double ep, const double epdot, + const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, + Eigen::Matrix3d &sigmaFinal_dev__, Eigen::Matrix3d &sigma_dev_rate__, + double &plastic_strain_increment); /* * Damage models @@ -57,9 +65,8 @@ void JohnsonCookStrength(const double G, const double cp, const double espec, co bool IsotropicMaxStrainDamage(const Eigen::Matrix3d E, const double maxStrain); bool IsotropicMaxStressDamage(const Eigen::Matrix3d E, const double maxStrain); -double JohnsonCookFailureStrain(const double p, const Eigen::Matrix3d Sdev, const double d1, const double d2, const double d3, - const double d4, const double epdot0, const double epdot); - - +double JohnsonCookFailureStrain(const double p, const Eigen::Matrix3d Sdev, const double d1, + const double d2, const double d3, const double d4, + const double epdot0, const double epdot); #endif /* SMD_MATERIAL_MODELS_H_ */ diff --git a/src/USER-SMD/smd_math.h b/src/USER-SMD/smd_math.h index 52e7c983d5..de8658b59c 100644 --- a/src/USER-SMD/smd_math.h +++ b/src/USER-SMD/smd_math.h @@ -16,23 +16,25 @@ #include namespace SMD_Math { -static inline void LimitDoubleMagnitude(double &x, const double limit) { - /* +static inline void LimitDoubleMagnitude(double &x, const double limit) +{ + /* * if |x| exceeds limit, set x to limit with the sign of x */ - if (fabs(x) > limit) { // limit delVdotDelR to a fraction of speed of sound - x = limit * copysign(1.0, x); - } + if (fabs(x) > limit) { // limit delVdotDelR to a fraction of speed of sound + x = limit * copysign(1.0, x); + } } /* * deviator of a tensor */ -static inline Eigen::Matrix3d Deviator(const Eigen::Matrix3d M) { - Eigen::Matrix3d eye; - eye.setIdentity(); - eye *= M.trace() / 3.0; - return M - eye; +static inline Eigen::Matrix3d Deviator(const Eigen::Matrix3d M) +{ + Eigen::Matrix3d eye; + eye.setIdentity(); + eye *= M.trace() / 3.0; + return M - eye; } /* @@ -50,211 +52,230 @@ static inline Eigen::Matrix3d Deviator(const Eigen::Matrix3d M) { * obtained again from an SVD. The rotation should proper now, i.e., det(R) = +1. */ -static inline bool PolDec(Eigen::Matrix3d M, Eigen::Matrix3d &R, Eigen::Matrix3d &T, bool scaleF) { +static inline bool PolDec(Eigen::Matrix3d M, Eigen::Matrix3d &R, Eigen::Matrix3d &T, bool scaleF) +{ - Eigen::JacobiSVD svd(M, Eigen::ComputeFullU | Eigen::ComputeFullV); // SVD(A) = U S V* - Eigen::Vector3d S_eigenvalues = svd.singularValues(); - Eigen::Matrix3d S = svd.singularValues().asDiagonal(); - Eigen::Matrix3d U = svd.matrixU(); - Eigen::Matrix3d V = svd.matrixV(); - Eigen::Matrix3d eye; - eye.setIdentity(); + Eigen::JacobiSVD svd( + M, Eigen::ComputeFullU | Eigen::ComputeFullV); // SVD(A) = U S V* + Eigen::Vector3d S_eigenvalues = svd.singularValues(); + Eigen::Matrix3d S = svd.singularValues().asDiagonal(); + Eigen::Matrix3d U = svd.matrixU(); + Eigen::Matrix3d V = svd.matrixV(); + Eigen::Matrix3d eye; + eye.setIdentity(); - // now do polar decomposition into M = R * T, where R is rotation - // and T is translation matrix - R = U * V.transpose(); - T = V * S * V.transpose(); + // now do polar decomposition into M = R * T, where R is rotation + // and T is translation matrix + R = U * V.transpose(); + T = V * S * V.transpose(); - if (R.determinant() < 0.0) { // this is an improper rotation - // identify the smallest entry in S and flip its sign - int imin; - S_eigenvalues.minCoeff(&imin); - S(imin, imin) *= -1.0; + if (R.determinant() < 0.0) { // this is an improper rotation + // identify the smallest entry in S and flip its sign + int imin; + S_eigenvalues.minCoeff(&imin); + S(imin, imin) *= -1.0; - R = M * V * S.inverse() * V.transpose(); // recompute R using flipped stretch eigenvalues - } + R = M * V * S.inverse() * V.transpose(); // recompute R using flipped stretch eigenvalues + } - /* + /* * scale S to avoid small principal strains */ - if (scaleF) { - double min = 0.3; // 0.3^2 = 0.09, should suffice for most problems - double max = 2.0; - for (int i = 0; i < 3; i++) { - if (S(i, i) < min) { - S(i, i) = min; - } else if (S(i, i) > max) { - S(i, i) = max; - } - } - T = V * S * V.transpose(); - } + if (scaleF) { + double min = 0.3; // 0.3^2 = 0.09, should suffice for most problems + double max = 2.0; + for (int i = 0; i < 3; i++) { + if (S(i, i) < min) { + S(i, i) = min; + } else if (S(i, i) > max) { + S(i, i) = max; + } + } + T = V * S * V.transpose(); + } - if (R.determinant() > 0.0) { - return true; - } else { - return false; - } + if (R.determinant() > 0.0) { + return true; + } else { + return false; + } } /* * Pseudo-inverse via SVD */ -static inline void pseudo_inverse_SVD(Eigen::Matrix3d &M) { +static inline void pseudo_inverse_SVD(Eigen::Matrix3d &M) +{ - Eigen::JacobiSVD svd(M, Eigen::ComputeFullU); // one Eigevector base is sufficient because matrix is square and symmetric + Eigen::JacobiSVD svd( + M, + Eigen:: + ComputeFullU); // one Eigevector base is sufficient because matrix is square and symmetric - Eigen::Vector3d singularValuesInv; - Eigen::Vector3d singularValues = svd.singularValues(); + Eigen::Vector3d singularValuesInv; + Eigen::Vector3d singularValues = svd.singularValues(); - double pinvtoler = 1.0e-16; // 2d machining example goes unstable if this value is increased (1.0e-16). - for (int row = 0; row < 3; row++) { - if (singularValues(row) > pinvtoler) { - singularValuesInv(row) = 1.0 / singularValues(row); - } else { - singularValuesInv(row) = 0.0; - } - } + double pinvtoler = + 1.0e-16; // 2d machining example goes unstable if this value is increased (1.0e-16). + for (int row = 0; row < 3; row++) { + if (singularValues(row) > pinvtoler) { + singularValuesInv(row) = 1.0 / singularValues(row); + } else { + singularValuesInv(row) = 0.0; + } + } - M = svd.matrixU() * singularValuesInv.asDiagonal() * svd.matrixU().transpose(); + M = svd.matrixU() * singularValuesInv.asDiagonal() * svd.matrixU().transpose(); } /* * test if two matrices are equal */ -static inline double TestMatricesEqual(Eigen::Matrix3d A, Eigen::Matrix3d B, double eps) { - Eigen::Matrix3d diff; - diff = A - B; - double norm = diff.norm(); - if (norm > eps) { - std::cout << "Matrices A and B are not equal! The L2-norm difference is: " << norm << "\n" - << "Here is matrix A:\n" << A << "\n" - << "Here is matrix B:\n" << B << std::endl; - } - return norm; +static inline double TestMatricesEqual(Eigen::Matrix3d A, Eigen::Matrix3d B, double eps) +{ + Eigen::Matrix3d diff; + diff = A - B; + double norm = diff.norm(); + if (norm > eps) { + std::cout << "Matrices A and B are not equal! The L2-norm difference is: " << norm << "\n" + << "Here is matrix A:\n" + << A << "\n" + << "Here is matrix B:\n" + << B << std::endl; + } + return norm; } /* ---------------------------------------------------------------------- Limit eigenvalues of a matrix to upper and lower bounds. ------------------------------------------------------------------------- */ -static inline Eigen::Matrix3d LimitEigenvalues(Eigen::Matrix3d S, double limitEigenvalue) { +static inline Eigen::Matrix3d LimitEigenvalues(Eigen::Matrix3d S, double limitEigenvalue) +{ - /* + /* * compute Eigenvalues of matrix S */ - Eigen::SelfAdjointEigenSolver < Eigen::Matrix3d > es; - es.compute(S); + Eigen::SelfAdjointEigenSolver es; + es.compute(S); - double max_eigenvalue = es.eigenvalues().maxCoeff(); - double min_eigenvalue = es.eigenvalues().minCoeff(); - double amax_eigenvalue = fabs(max_eigenvalue); - double amin_eigenvalue = fabs(min_eigenvalue); + double max_eigenvalue = es.eigenvalues().maxCoeff(); + double min_eigenvalue = es.eigenvalues().minCoeff(); + double amax_eigenvalue = fabs(max_eigenvalue); + double amin_eigenvalue = fabs(min_eigenvalue); - if ((amax_eigenvalue > limitEigenvalue) || (amin_eigenvalue > limitEigenvalue)) { - if (amax_eigenvalue > amin_eigenvalue) { // need to scale with max_eigenvalue - double scale = amax_eigenvalue / limitEigenvalue; - Eigen::Matrix3d V = es.eigenvectors(); - Eigen::Matrix3d S_diag = V.inverse() * S * V; // diagonalized input matrix - S_diag /= scale; - Eigen::Matrix3d S_scaled = V * S_diag * V.inverse(); // undiagonalize matrix - return S_scaled; - } else { // need to scale using min_eigenvalue - double scale = amin_eigenvalue / limitEigenvalue; - Eigen::Matrix3d V = es.eigenvectors(); - Eigen::Matrix3d S_diag = V.inverse() * S * V; // diagonalized input matrix - S_diag /= scale; - Eigen::Matrix3d S_scaled = V * S_diag * V.inverse(); // undiagonalize matrix - return S_scaled; - } - } else { // limiting does not apply - return S; - } + if ((amax_eigenvalue > limitEigenvalue) || (amin_eigenvalue > limitEigenvalue)) { + if (amax_eigenvalue > amin_eigenvalue) { // need to scale with max_eigenvalue + double scale = amax_eigenvalue / limitEigenvalue; + Eigen::Matrix3d V = es.eigenvectors(); + Eigen::Matrix3d S_diag = V.inverse() * S * V; // diagonalized input matrix + S_diag /= scale; + Eigen::Matrix3d S_scaled = V * S_diag * V.inverse(); // undiagonalize matrix + return S_scaled; + } else { // need to scale using min_eigenvalue + double scale = amin_eigenvalue / limitEigenvalue; + Eigen::Matrix3d V = es.eigenvectors(); + Eigen::Matrix3d S_diag = V.inverse() * S * V; // diagonalized input matrix + S_diag /= scale; + Eigen::Matrix3d S_scaled = V * S_diag * V.inverse(); // undiagonalize matrix + return S_scaled; + } + } else { // limiting does not apply + return S; + } } -static inline bool LimitMinMaxEigenvalues(Eigen::Matrix3d &S, double min, double max) { +static inline bool LimitMinMaxEigenvalues(Eigen::Matrix3d &S, double min, double max) +{ - /* + /* * compute Eigenvalues of matrix S */ - Eigen::SelfAdjointEigenSolver < Eigen::Matrix3d > es; - es.compute(S); + Eigen::SelfAdjointEigenSolver es; + es.compute(S); - if ((es.eigenvalues().maxCoeff() > max) || (es.eigenvalues().minCoeff() < min)) { - Eigen::Matrix3d S_diag = es.eigenvalues().asDiagonal(); - Eigen::Matrix3d V = es.eigenvectors(); - for (int i = 0; i < 3; i++) { - if (S_diag(i, i) < min) { - //printf("limiting eigenvalue %f --> %f\n", S_diag(i, i), min); - //printf("these are the eigenvalues of U: %f %f %f\n", es.eigenvalues()(0), es.eigenvalues()(1), es.eigenvalues()(2)); - S_diag(i, i) = min; - } else if (S_diag(i, i) > max) { - //printf("limiting eigenvalue %f --> %f\n", S_diag(i, i), max); - S_diag(i, i) = max; - } - } - S = V * S_diag * V.inverse(); // undiagonalize matrix - return true; - } else { - return false; - } + if ((es.eigenvalues().maxCoeff() > max) || (es.eigenvalues().minCoeff() < min)) { + Eigen::Matrix3d S_diag = es.eigenvalues().asDiagonal(); + Eigen::Matrix3d V = es.eigenvectors(); + for (int i = 0; i < 3; i++) { + if (S_diag(i, i) < min) { + //printf("limiting eigenvalue %f --> %f\n", S_diag(i, i), min); + //printf("these are the eigenvalues of U: %f %f %f\n", es.eigenvalues()(0), es.eigenvalues()(1), es.eigenvalues()(2)); + S_diag(i, i) = min; + } else if (S_diag(i, i) > max) { + //printf("limiting eigenvalue %f --> %f\n", S_diag(i, i), max); + S_diag(i, i) = max; + } + } + S = V * S_diag * V.inverse(); // undiagonalize matrix + return true; + } else { + return false; + } } -static inline void reconstruct_rank_deficient_shape_matrix(Eigen::Matrix3d &K) { +static inline void reconstruct_rank_deficient_shape_matrix(Eigen::Matrix3d &K) +{ - Eigen::JacobiSVD svd(K, Eigen::ComputeFullU | Eigen::ComputeFullV); - Eigen::Vector3d singularValues = svd.singularValues(); + Eigen::JacobiSVD svd(K, Eigen::ComputeFullU | Eigen::ComputeFullV); + Eigen::Vector3d singularValues = svd.singularValues(); - for (int i = 0; i < 3; i++) { - if (singularValues(i) < 1.0e-8) { - singularValues(i) = 1.0; - } - } + for (int i = 0; i < 3; i++) { + if (singularValues(i) < 1.0e-8) { singularValues(i) = 1.0; } + } -// int imin; -// double minev = singularValues.minCoeff(&imin); -// -// printf("min eigenvalue=%f has index %d\n", minev, imin); -// Vector3d singularVec = U.col(0).cross(U.col(1)); -// cout << "the eigenvalues are " << endl << singularValues << endl; -// cout << "the singular vector is " << endl << singularVec << endl; -// -// // reconstruct original K -// -// singularValues(2) = 1.0; + // int imin; + // double minev = singularValues.minCoeff(&imin); + // + // printf("min eigenvalue=%f has index %d\n", minev, imin); + // Vector3d singularVec = U.col(0).cross(U.col(1)); + // cout << "the eigenvalues are " << endl << singularValues << endl; + // cout << "the singular vector is " << endl << singularVec << endl; + // + // // reconstruct original K + // + // singularValues(2) = 1.0; - K = svd.matrixU() * singularValues.asDiagonal() * svd.matrixV().transpose(); - //cout << "the reconstructed K is " << endl << K << endl; - //exit(1); + K = svd.matrixU() * singularValues.asDiagonal() * svd.matrixV().transpose(); + //cout << "the reconstructed K is " << endl << K << endl; + //exit(1); } /* ---------------------------------------------------------------------- helper functions for crack_exclude ------------------------------------------------------------------------- */ -static inline bool IsOnSegment(double xi, double yi, double xj, double yj, double xk, double yk) { - return (xi <= xk || xj <= xk) && (xk <= xi || xk <= xj) && (yi <= yk || yj <= yk) && (yk <= yi || yk <= yj); +static inline bool IsOnSegment(double xi, double yi, double xj, double yj, double xk, double yk) +{ + return (xi <= xk || xj <= xk) && (xk <= xi || xk <= xj) && (yi <= yk || yj <= yk) && + (yk <= yi || yk <= yj); } -static inline char ComputeDirection(double xi, double yi, double xj, double yj, double xk, double yk) { - double a = (xk - xi) * (yj - yi); - double b = (xj - xi) * (yk - yi); - return a < b ? -1.0 : a > b ? 1.0 : 0; +static inline char ComputeDirection(double xi, double yi, double xj, double yj, double xk, + double yk) +{ + double a = (xk - xi) * (yj - yi); + double b = (xj - xi) * (yk - yi); + return a < b ? -1.0 : a > b ? 1.0 : 0; } /** Do line segments (x1, y1)--(x2, y2) and (x3, y3)--(x4, y4) intersect? */ -static inline bool DoLineSegmentsIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { - char d1 = ComputeDirection(x3, y3, x4, y4, x1, y1); - char d2 = ComputeDirection(x3, y3, x4, y4, x2, y2); - char d3 = ComputeDirection(x1, y1, x2, y2, x3, y3); - char d4 = ComputeDirection(x1, y1, x2, y2, x4, y4); - return (((d1 > 0 && d2 < 0) || (d1 < 0 && d2 > 0)) && ((d3 > 0 && d4 < 0) || (d3 < 0 && d4 > 0))) - || (d1 == 0 && IsOnSegment(x3, y3, x4, y4, x1, y1)) || (d2 == 0 && IsOnSegment(x3, y3, x4, y4, x2, y2)) - || (d3 == 0 && IsOnSegment(x1, y1, x2, y2, x3, y3)) || (d4 == 0 && IsOnSegment(x1, y1, x2, y2, x4, y4)); +static inline bool DoLineSegmentsIntersect(double x1, double y1, double x2, double y2, double x3, + double y3, double x4, double y4) +{ + char d1 = ComputeDirection(x3, y3, x4, y4, x1, y1); + char d2 = ComputeDirection(x3, y3, x4, y4, x2, y2); + char d3 = ComputeDirection(x1, y1, x2, y2, x3, y3); + char d4 = ComputeDirection(x1, y1, x2, y2, x4, y4); + return (((d1 > 0 && d2 < 0) || (d1 < 0 && d2 > 0)) && + ((d3 > 0 && d4 < 0) || (d3 < 0 && d4 > 0))) || + (d1 == 0 && IsOnSegment(x3, y3, x4, y4, x1, y1)) || + (d2 == 0 && IsOnSegment(x3, y3, x4, y4, x2, y2)) || + (d3 == 0 && IsOnSegment(x1, y1, x2, y2, x3, y3)) || + (d4 == 0 && IsOnSegment(x1, y1, x2, y2, x4, y4)); } -} +} // namespace SMD_Math #endif /* SMD_MATH_H_ */ - diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp index 5a27855a47..ff2da85789 100644 --- a/src/USER-SMTBQ/pair_smtbq.cpp +++ b/src/USER-SMTBQ/pair_smtbq.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SMTBQ/pair_smtbq.h b/src/USER-SMTBQ/pair_smtbq.h index b110b6aaae..ec2de51fbc 100644 --- a/src/USER-SMTBQ/pair_smtbq.h +++ b/src/USER-SMTBQ/pair_smtbq.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(smtbq,PairSMTBQ) - +// clang-format off +PairStyle(smtbq,PairSMTBQ); +// clang-format on #else #ifndef LMP_PAIR_SMTBQ_H @@ -36,151 +36,150 @@ class PairSMTBQ : public Pair { double init_one(int, int); double memory_usage(); - -protected: + protected: struct Param { - double sto,n0,ne,chi,dj; - double R,dzeta; //Rayon slater + double sto, n0, ne, chi, dj; + double R, dzeta; //Rayon slater double cutsq; - double qform, masse; // Charge formelle + double qform, masse; // Charge formelle char *nom; }; struct Intparam { - double a,p,ksi,q,r0,dc1,dc2; - double abuck,rhobuck,neig_cut,aOO,bOO,r1OO,r2OO; - char *typepot,*mode; + double a, p, ksi, q, r0, dc1, dc2; + double abuck, rhobuck, neig_cut, aOO, bOO, r1OO, r2OO; + char *typepot, *mode; int intsm; }; - double rmin,dr,ds; // table parameter + double rmin, dr, ds; // table parameter int kmax; - bigint Qstep; // Frequency of charge resolution - double precision; // accuracy of convergence - int loopmax; // max of iteration + bigint Qstep; // Frequency of charge resolution + double precision; // accuracy of convergence + int loopmax; // max of iteration - double cutmax; // max cutoff for all elements - char *QEqMode; // name of QEqMode - char *Bavard; // Verbose parameter - char *writepot; // write or not the electronegativity component - char *writeenerg; // write or not the energy component - char *QInitMode; // mode of initialization of charges - double zlim1QEq; // z limit for QEq equilibration - double zlim2QEq; // z limit for QEq equilibration - double QOxInit; // Initial charge for oxygen atoms (if the charge is not specified) - int maxintparam; // max # of interaction sets - int maxintsm; // max # of interaction SM - double r1Coord,r2Coord; - Param *params; // parameter set for an I atom - Intparam *intparams; // parameter set for an I interaction + double cutmax; // max cutoff for all elements + char *QEqMode; // name of QEqMode + char *Bavard; // Verbose parameter + char *writepot; // write or not the electronegativity component + char *writeenerg; // write or not the energy component + char *QInitMode; // mode of initialization of charges + double zlim1QEq; // z limit for QEq equilibration + double zlim2QEq; // z limit for QEq equilibration + double QOxInit; // Initial charge for oxygen atoms (if the charge is not specified) + int maxintparam; // max # of interaction sets + int maxintsm; // max # of interaction SM + double r1Coord, r2Coord; + Param *params; // parameter set for an I atom + Intparam *intparams; // parameter set for an I interaction - int nmax,*nQEqall,*nQEqaall,*nQEqcall; - double *qf,*q1,*q2,Nevery,Neverypot; + int nmax, *nQEqall, *nQEqaall, *nQEqcall; + double *qf, *q1, *q2, Nevery, Neverypot; -// Coulombian interaction - double *esm, **fafb, **dfafb, *fafbOxOxSurf, *dfafbOxOxSurf, *fafbTiOxSurf,*dfafbTiOxSurf; - double *potqn, *dpotqn, Vself, *Zsm,*coord, *fafbOxOxBB, *dfafbOxOxBB,*fafbTiOxBB, *dfafbTiOxBB ; - int **intype, **coultype; - int *NCo; - double coordOxBulk,coordOxSurf,ROxSurf,coordOxBB,ROxBB; + // Coulombian interaction + double *esm, **fafb, **dfafb, *fafbOxOxSurf, *dfafbOxOxSurf, *fafbTiOxSurf, *dfafbTiOxSurf; + double *potqn, *dpotqn, Vself, *Zsm, *coord, *fafbOxOxBB, *dfafbOxOxBB, *fafbTiOxBB, *dfafbTiOxBB; + int **intype, **coultype; + int *NCo; + double coordOxBulk, coordOxSurf, ROxSurf, coordOxBB, ROxBB; -// Covalent interaction - double *ecov, *potmad, *potself, *potcov; //, *chimet; - double **tabsmb,**dtabsmb, **tabsmr, **dtabsmr, *sbcov, *sbmet; - double ncov; + // Covalent interaction + double *ecov, *potmad, *potself, *potcov; //, *chimet; + double **tabsmb, **dtabsmb, **tabsmr, **dtabsmr, *sbcov, *sbmet; + double ncov; -// Neighbor Table - int nteam,cluster,*hybrid; - int *nvsm, **vsm, *flag_QEq; + // Neighbor Table + int nteam, cluster, *hybrid; + int *nvsm, **vsm, *flag_QEq; -// Parallelisation - int me, nproc; - double *tab_comm; + // Parallelisation + int me, nproc; + double *tab_comm; -// GAMMAS function - double *fct; + // GAMMAS function + double *fct; -// HERE its routines -// ===================================== - void allocate(); - virtual void read_file(char *); + // HERE its routines + // ===================================== + void allocate(); + virtual void read_file(char *); - void tabsm(); - void tabqeq(); + void tabsm(); + void tabqeq(); - void potqeq(int, int, double, double, double, - double &, int, double &); - void pot_ES (int, int, double, double &); - void pot_ES2 (int, int, double, double &); + void potqeq(int, int, double, double, double, double &, int, double &); + void pot_ES(int, int, double, double &); + void pot_ES2(int, int, double, double &); - double self(Param *, double); - double qfo_self(Param *, double); + double self(Param *, double); + double qfo_self(Param *, double); - virtual void repulsive(Intparam *, double, int, int, double &, int, double &); - virtual void rep_OO (Intparam *, double, double &, int, double &); - virtual void Attr_OO (Intparam *, double, double &, int, double &); - virtual void attractive(Intparam *, double, int, int, double, int, double ); - void f_att(Intparam *, int, int, double, double &) ; - void pot_COV(Param *, int, double &); - double potmet(Intparam *, double, int, double, int, double); + virtual void repulsive(Intparam *, double, int, int, double &, int, double &); + virtual void rep_OO(Intparam *, double, double &, int, double &); + virtual void Attr_OO(Intparam *, double, double &, int, double &); + virtual void attractive(Intparam *, double, int, int, double, int, double); + void f_att(Intparam *, int, int, double, double &); + void pot_COV(Param *, int, double &); + double potmet(Intparam *, double, int, double, int, double); - double fcoupure(double, double, double); - double fcoupured(double, double, double); + double fcoupure(double, double, double); + double fcoupured(double, double, double); - double fcoup2(double, double, double); - double Intfcoup2(double, double, double); - double Primfcoup2(double, double, double); + double fcoup2(double, double, double); + double Intfcoup2(double, double, double); + double Primfcoup2(double, double, double); - void groupBulkFromSlab_QEq(); - void groupQEqAllParallel_QEq(); - void groupQEqAll_QEq(); - void groupSurface_QEq(); - void QForce_charge(int); - void Charge(); - void Init_charge(int*, int*, int*); - void CheckEnergyVSForce(); + void groupBulkFromSlab_QEq(); + void groupQEqAllParallel_QEq(); + void groupQEqAll_QEq(); + void groupSurface_QEq(); + void QForce_charge(int); + void Charge(); + void Init_charge(int *, int *, int *); + void CheckEnergyVSForce(); -// =========================================== -// Communication pack - int pack_forward_comm (int, int*, double*, int, int*); - void unpack_forward_comm (int, int, double*); - int pack_reverse_comm (int, int, double*); - void unpack_reverse_comm (int, int*, double*); - void forward (double*); void reverse (double*); - void forward_int (int*); void reverse_int (int*); + // =========================================== + // Communication pack + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); + int pack_reverse_comm(int, int, double *); + void unpack_reverse_comm(int, int *, double *); + void forward(double *); + void reverse(double *); + void forward_int(int *); + void reverse_int(int *); - int Tokenize( char* , char*** ); + int Tokenize(char *, char ***); - template const T& min ( const T& a, const T& b ) { - return !(b const T &min(const T &a, const T &b) + { + return !(b < a) ? a : b; // or: return !comp(b,a)?a:b; for the comp version + } -// ============================================= -// Gammas function - void gammas(double &, double &, double &, double &, double &, double &, - double &, double &, double &, double &, double &, double &, - double &, double &, double &); + // ============================================= + // Gammas function + void gammas(double &, double &, double &, double &, double &, double &, double &, double &, + double &, double &, double &, double &, double &, double &, double &); - void css(double &, double, double, double, double, double, - double &, double &, double &, double &,double &, - double &, double &, double &, double &); + void css(double &, double, double, double, double, double, double &, double &, double &, double &, + double &, double &, double &, double &, double &); - double coeffs(int, int, int); + double coeffs(int, int, int); - double binm(int, int); - void caintgs (double, int, double *); - void cbintgs( double, int, double *); + double binm(int, int); + void caintgs(double, int, double *); + void cbintgs(double, int, double *); -// ===================================== -// short range neighbor list + // ===================================== + // short range neighbor list void add_pages(int howmany = 1); -// void Short_neigh(); + // void Short_neigh(); int maxpage, pgsize, oneatom, **pages; double cutmin; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/atom_vec_sph.cpp b/src/USER-SPH/atom_vec_sph.cpp index 2a2f688b34..46f9d828e8 100644 --- a/src/USER-SPH/atom_vec_sph.cpp +++ b/src/USER-SPH/atom_vec_sph.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SPH/atom_vec_sph.h b/src/USER-SPH/atom_vec_sph.h index e6a8185760..2ff254da68 100644 --- a/src/USER-SPH/atom_vec_sph.h +++ b/src/USER-SPH/atom_vec_sph.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(sph,AtomVecSPH) - +// clang-format off +AtomStyle(sph,AtomVecSPH); +// clang-format on #else #ifndef LMP_ATOM_VEC_SPH_H @@ -36,11 +36,11 @@ class AtomVecSPH : public AtomVec { void pack_property_atom(int, double *, int, int); private: - double *rho,*drho,*esph,*desph,*cv; + double *rho, *drho, *esph, *desph, *cv; double **vest; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/compute_sph_e_atom.cpp b/src/USER-SPH/compute_sph_e_atom.cpp index 249de1498b..24f81c7997 100644 --- a/src/USER-SPH/compute_sph_e_atom.cpp +++ b/src/USER-SPH/compute_sph_e_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SPH/compute_sph_e_atom.h b/src/USER-SPH/compute_sph_e_atom.h index 885a7bbcb6..fa6d995dcc 100644 --- a/src/USER-SPH/compute_sph_e_atom.h +++ b/src/USER-SPH/compute_sph_e_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(sph/e/atom,ComputeSPHEAtom) - +// clang-format off +ComputeStyle(sph/e/atom,ComputeSPHEAtom); +// clang-format on #else #ifndef LMP_COMPUTE_SPH_E_ATOM_H @@ -37,7 +37,7 @@ class ComputeSPHEAtom : public Compute { double *evector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/compute_sph_rho_atom.cpp b/src/USER-SPH/compute_sph_rho_atom.cpp index 76f46ccdd7..08d47326e1 100644 --- a/src/USER-SPH/compute_sph_rho_atom.cpp +++ b/src/USER-SPH/compute_sph_rho_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SPH/compute_sph_rho_atom.h b/src/USER-SPH/compute_sph_rho_atom.h index 37ba49a63f..9c3a367b6c 100644 --- a/src/USER-SPH/compute_sph_rho_atom.h +++ b/src/USER-SPH/compute_sph_rho_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(sph/rho/atom,ComputeSPHRhoAtom) - +// clang-format off +ComputeStyle(sph/rho/atom,ComputeSPHRhoAtom); +// clang-format on #else #ifndef LMP_COMPUTE_MESO_SPH_ATOM_H @@ -37,7 +37,7 @@ class ComputeSPHRhoAtom : public Compute { double *rhoVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/compute_sph_t_atom.cpp b/src/USER-SPH/compute_sph_t_atom.cpp index d33630c227..88e6e3443a 100644 --- a/src/USER-SPH/compute_sph_t_atom.cpp +++ b/src/USER-SPH/compute_sph_t_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SPH/compute_sph_t_atom.h b/src/USER-SPH/compute_sph_t_atom.h index 7489c00299..937ab6da33 100644 --- a/src/USER-SPH/compute_sph_t_atom.h +++ b/src/USER-SPH/compute_sph_t_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(sph/t/atom,ComputeSPHTAtom) - +// clang-format off +ComputeStyle(sph/t/atom,ComputeSPHTAtom); +// clang-format on #else #ifndef LMP_COMPUTE_SPH_T_ATOM_H @@ -37,7 +37,7 @@ class ComputeSPHTAtom : public Compute { double *tvector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/fix_sph.cpp b/src/USER-SPH/fix_sph.cpp index 7c58ac1248..9711653951 100644 --- a/src/USER-SPH/fix_sph.cpp +++ b/src/USER-SPH/fix_sph.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SPH/fix_sph.h b/src/USER-SPH/fix_sph.h index 590612e2bd..5b3d25f666 100644 --- a/src/USER-SPH/fix_sph.h +++ b/src/USER-SPH/fix_sph.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(sph,FixSPH) - +// clang-format off +FixStyle(sph,FixSPH); +// clang-format on #else #ifndef LMP_FIX_SPH_H @@ -36,15 +36,16 @@ class FixSPH : public Fix { private: class NeighList *list; + protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; class Pair *pair; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/fix_sph_stationary.cpp b/src/USER-SPH/fix_sph_stationary.cpp index 27cdd3129d..bb3fc6547a 100644 --- a/src/USER-SPH/fix_sph_stationary.cpp +++ b/src/USER-SPH/fix_sph_stationary.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SPH/fix_sph_stationary.h b/src/USER-SPH/fix_sph_stationary.h index 90cc164ff1..8dde541b0a 100644 --- a/src/USER-SPH/fix_sph_stationary.h +++ b/src/USER-SPH/fix_sph_stationary.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(sph/stationary,FixSPHStationary) - +// clang-format off +FixStyle(sph/stationary,FixSPHStationary); +// clang-format on #else #ifndef LMP_FIX_SPH_STATIONARY_H @@ -35,15 +35,16 @@ class FixSPHStationary : public Fix { private: class NeighList *list; + protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; class Pair *pair; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/pair_sph_heatconduction.cpp b/src/USER-SPH/pair_sph_heatconduction.cpp index 9402d3dcb2..7a7a5774bd 100644 --- a/src/USER-SPH/pair_sph_heatconduction.cpp +++ b/src/USER-SPH/pair_sph_heatconduction.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SPH/pair_sph_heatconduction.h b/src/USER-SPH/pair_sph_heatconduction.h index 43ff122cf7..bf8a96773f 100644 --- a/src/USER-SPH/pair_sph_heatconduction.h +++ b/src/USER-SPH/pair_sph_heatconduction.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(sph/heatconduction,PairSPHHeatConduction) - +// clang-format off +PairStyle(sph/heatconduction,PairSPHHeatConduction); +// clang-format on #else #ifndef LMP_PAIR_SPH_HEATCONDUCTION_H @@ -39,7 +39,7 @@ class PairSPHHeatConduction : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/pair_sph_idealgas.cpp b/src/USER-SPH/pair_sph_idealgas.cpp index ffb6f29470..41e0f011b7 100644 --- a/src/USER-SPH/pair_sph_idealgas.cpp +++ b/src/USER-SPH/pair_sph_idealgas.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SPH/pair_sph_idealgas.h b/src/USER-SPH/pair_sph_idealgas.h index a0920aece2..ad185bcd25 100644 --- a/src/USER-SPH/pair_sph_idealgas.h +++ b/src/USER-SPH/pair_sph_idealgas.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(sph/idealgas,PairSPHIdealGas) - +// clang-format off +PairStyle(sph/idealgas,PairSPHIdealGas); +// clang-format on #else #ifndef LMP_PAIR_IDEALGAS_H @@ -35,12 +35,12 @@ class PairSPHIdealGas : public Pair { virtual double single(int, int, int, int, double, double, double, double &); protected: - double **cut,**viscosity; + double **cut, **viscosity; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/pair_sph_lj.cpp b/src/USER-SPH/pair_sph_lj.cpp index 47e5ba79d6..4ace66809d 100644 --- a/src/USER-SPH/pair_sph_lj.cpp +++ b/src/USER-SPH/pair_sph_lj.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SPH/pair_sph_lj.h b/src/USER-SPH/pair_sph_lj.h index 2929e69783..a934993805 100644 --- a/src/USER-SPH/pair_sph_lj.h +++ b/src/USER-SPH/pair_sph_lj.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(sph/lj,PairSPHLJ) - +// clang-format off +PairStyle(sph/lj,PairSPHLJ); +// clang-format on #else #ifndef LMP_PAIR_LJ_H @@ -37,12 +37,12 @@ class PairSPHLJ : public Pair { void LJEOS2(double, double, double, double *, double *); protected: - double **cut,**viscosity; + double **cut, **viscosity; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/pair_sph_rhosum.cpp b/src/USER-SPH/pair_sph_rhosum.cpp index 7b5eeed58b..6d052eff01 100644 --- a/src/USER-SPH/pair_sph_rhosum.cpp +++ b/src/USER-SPH/pair_sph_rhosum.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SPH/pair_sph_rhosum.h b/src/USER-SPH/pair_sph_rhosum.h index d7a168fbcb..9874e6e2eb 100644 --- a/src/USER-SPH/pair_sph_rhosum.h +++ b/src/USER-SPH/pair_sph_rhosum.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(sph/rhosum,PairSPHRhoSum) - +// clang-format off +PairStyle(sph/rhosum,PairSPHRhoSum); +// clang-format on #else #ifndef LMP_PAIR_SPH_RHOSUM_H @@ -44,7 +44,7 @@ class PairSPHRhoSum : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/pair_sph_taitwater.cpp b/src/USER-SPH/pair_sph_taitwater.cpp index 5ad70e7bcc..eb05ab6f93 100644 --- a/src/USER-SPH/pair_sph_taitwater.cpp +++ b/src/USER-SPH/pair_sph_taitwater.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SPH/pair_sph_taitwater.h b/src/USER-SPH/pair_sph_taitwater.h index 41473da8d2..d162106691 100644 --- a/src/USER-SPH/pair_sph_taitwater.h +++ b/src/USER-SPH/pair_sph_taitwater.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(sph/taitwater,PairSPHTaitwater) - +// clang-format off +PairStyle(sph/taitwater,PairSPHTaitwater); +// clang-format on #else #ifndef LMP_PAIR_TAITWATER_H @@ -35,13 +35,13 @@ class PairSPHTaitwater : public Pair { protected: double *rho0, *soundspeed, *B; - double **cut,**viscosity; + double **cut, **viscosity; int first; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/pair_sph_taitwater_morris.cpp b/src/USER-SPH/pair_sph_taitwater_morris.cpp index 3d12b41b08..0cbecc1dcb 100644 --- a/src/USER-SPH/pair_sph_taitwater_morris.cpp +++ b/src/USER-SPH/pair_sph_taitwater_morris.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-SPH/pair_sph_taitwater_morris.h b/src/USER-SPH/pair_sph_taitwater_morris.h index 8d98e7a0ed..7c1d377319 100644 --- a/src/USER-SPH/pair_sph_taitwater_morris.h +++ b/src/USER-SPH/pair_sph_taitwater_morris.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(sph/taitwater/morris,PairSPHTaitwaterMorris) - +// clang-format off +PairStyle(sph/taitwater/morris,PairSPHTaitwaterMorris); +// clang-format on #else #ifndef LMP_PAIR_TAITWATER_MORRIS_H @@ -35,13 +35,13 @@ class PairSPHTaitwaterMorris : public Pair { protected: double *rho0, *soundspeed, *B; - double **cut,**viscosity; + double **cut, **viscosity; int first; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-TALLY/compute_force_tally.cpp b/src/USER-TALLY/compute_force_tally.cpp index 21c518f3d7..bc9a79713b 100644 --- a/src/USER-TALLY/compute_force_tally.cpp +++ b/src/USER-TALLY/compute_force_tally.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-TALLY/compute_force_tally.h b/src/USER-TALLY/compute_force_tally.h index 86703d1187..f35ea9ad0a 100644 --- a/src/USER-TALLY/compute_force_tally.h +++ b/src/USER-TALLY/compute_force_tally.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(force/tally,ComputeForceTally) - +// clang-format off +ComputeStyle(force/tally,ComputeForceTally); +// clang-format on #else #ifndef LMP_COMPUTE_FORCE_TALLY_H @@ -40,17 +40,16 @@ class ComputeForceTally : public Compute { double memory_usage(); void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, - double, double, double, - double, double, double); + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); + private: bigint did_setup; - int nmax,igroup2,groupbit2; + int nmax, igroup2, groupbit2; double **fatom; double ftotal[3]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-TALLY/compute_heat_flux_tally.cpp b/src/USER-TALLY/compute_heat_flux_tally.cpp index 002d0e3238..96456bf775 100644 --- a/src/USER-TALLY/compute_heat_flux_tally.cpp +++ b/src/USER-TALLY/compute_heat_flux_tally.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-TALLY/compute_heat_flux_tally.h b/src/USER-TALLY/compute_heat_flux_tally.h index 9f96946a19..234afa8c68 100644 --- a/src/USER-TALLY/compute_heat_flux_tally.h +++ b/src/USER-TALLY/compute_heat_flux_tally.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(heat/flux/tally,ComputeHeatFluxTally) - +// clang-format off +ComputeStyle(heat/flux/tally,ComputeHeatFluxTally); +// clang-format on #else #ifndef LMP_COMPUTE_HEAT_FLUX_TALLY_H @@ -39,18 +39,16 @@ class ComputeHeatFluxTally : public Compute { double memory_usage(); void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, - double, double, double, - double, double, double); + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); private: bigint did_setup; - int nmax,igroup2,groupbit2; - double **stress,*eatom; + int nmax, igroup2, groupbit2; + double **stress, *eatom; double *heatj; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-TALLY/compute_pe_mol_tally.cpp b/src/USER-TALLY/compute_pe_mol_tally.cpp index 97c1a7ffbe..329c9ff429 100644 --- a/src/USER-TALLY/compute_pe_mol_tally.cpp +++ b/src/USER-TALLY/compute_pe_mol_tally.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-TALLY/compute_pe_mol_tally.h b/src/USER-TALLY/compute_pe_mol_tally.h index 8c3bf3627d..3f7457aad5 100644 --- a/src/USER-TALLY/compute_pe_mol_tally.h +++ b/src/USER-TALLY/compute_pe_mol_tally.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(pe/mol/tally,ComputePEMolTally) - +// clang-format off +ComputeStyle(pe/mol/tally,ComputePEMolTally); +// clang-format on #else #ifndef LMP_COMPUTE_PE_MOL_TALLY_H @@ -34,17 +34,15 @@ class ComputePEMolTally : public Compute { void compute_vector(); void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, - double, double, double, - double, double, double); + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); private: bigint did_setup; - int igroup2,groupbit2; + int igroup2, groupbit2; double etotal[4]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-TALLY/compute_pe_tally.cpp b/src/USER-TALLY/compute_pe_tally.cpp index 451c785b13..dae233f830 100644 --- a/src/USER-TALLY/compute_pe_tally.cpp +++ b/src/USER-TALLY/compute_pe_tally.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-TALLY/compute_pe_tally.h b/src/USER-TALLY/compute_pe_tally.h index f9d008f820..8f6f42a685 100644 --- a/src/USER-TALLY/compute_pe_tally.h +++ b/src/USER-TALLY/compute_pe_tally.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(pe/tally,ComputePETally) - +// clang-format off +ComputeStyle(pe/tally,ComputePETally); +// clang-format on #else #ifndef LMP_COMPUTE_PETALLY_H @@ -40,18 +40,16 @@ class ComputePETally : public Compute { double memory_usage(); void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, - double, double, double, - double, double, double); + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); private: bigint did_setup; - int nmax,igroup2,groupbit2; + int nmax, igroup2, groupbit2; double **eatom; double etotal[2]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-TALLY/compute_stress_tally.cpp b/src/USER-TALLY/compute_stress_tally.cpp index e32a134ec3..8ae42ddf02 100644 --- a/src/USER-TALLY/compute_stress_tally.cpp +++ b/src/USER-TALLY/compute_stress_tally.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-TALLY/compute_stress_tally.h b/src/USER-TALLY/compute_stress_tally.h index 4236586822..709a8caa8f 100644 --- a/src/USER-TALLY/compute_stress_tally.h +++ b/src/USER-TALLY/compute_stress_tally.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(stress/tally,ComputeStressTally) - +// clang-format off +ComputeStyle(stress/tally,ComputeStressTally); +// clang-format on #else #ifndef LMP_COMPUTE_STRESS_TALLY_H @@ -40,18 +40,16 @@ class ComputeStressTally : public Compute { double memory_usage(); void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, - double, double, double, - double, double, double); + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); private: bigint did_setup; - int nmax,igroup2,groupbit2; + int nmax, igroup2, groupbit2; double **stress; double *virial; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-UEF/compute_pressure_uef.cpp b/src/USER-UEF/compute_pressure_uef.cpp index bb097defab..5105a58ddf 100644 --- a/src/USER-UEF/compute_pressure_uef.cpp +++ b/src/USER-UEF/compute_pressure_uef.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-UEF/compute_pressure_uef.h b/src/USER-UEF/compute_pressure_uef.h index 9957ab4dd3..cbbd241119 100644 --- a/src/USER-UEF/compute_pressure_uef.h +++ b/src/USER-UEF/compute_pressure_uef.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(pressure/uef,ComputePressureUef) - +// clang-format off +ComputeStyle(pressure/uef,ComputePressureUef); +// clang-format on #else #ifndef LMP_COMPUTE_PRESSURE_UEF_H @@ -34,18 +34,16 @@ class ComputePressureUef : public ComputePressure { virtual void compute_vector(); virtual double compute_scalar(); void update_rot(); - bool in_fix; //true if this compute is used in fix/nvt/npt - + bool in_fix; //true if this compute is used in fix/nvt/npt protected: - bool ext_flags[3]; // true if used in average output pressure - void virial_rot(double*,const double[3][3]); + bool ext_flags[3]; // true if used in average output pressure + void virial_rot(double *, const double[3][3]); int ifix_uef; double rot[3][3]; }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-UEF/compute_temp_uef.cpp b/src/USER-UEF/compute_temp_uef.cpp index 0fb80c7724..23536330c0 100644 --- a/src/USER-UEF/compute_temp_uef.cpp +++ b/src/USER-UEF/compute_temp_uef.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-UEF/compute_temp_uef.h b/src/USER-UEF/compute_temp_uef.h index 638d87076a..92e9293040 100644 --- a/src/USER-UEF/compute_temp_uef.h +++ b/src/USER-UEF/compute_temp_uef.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/uef,ComputeTempUef) - +// clang-format off +ComputeStyle(temp/uef,ComputeTempUef); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_UEF_H @@ -35,15 +35,13 @@ class ComputeTempUef : public ComputeTemp { void yes_rot(); void no_rot(); - protected: bool rot_flag; - void virial_rot(double*,const double[3][3]); + void virial_rot(double *, const double[3][3]); int ifix_uef; }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-UEF/dump_cfg_uef.cpp b/src/USER-UEF/dump_cfg_uef.cpp index 3f39bb5700..aea0bad8cf 100644 --- a/src/USER-UEF/dump_cfg_uef.cpp +++ b/src/USER-UEF/dump_cfg_uef.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-UEF/dump_cfg_uef.h b/src/USER-UEF/dump_cfg_uef.h index 345d100721..56df6db033 100644 --- a/src/USER-UEF/dump_cfg_uef.h +++ b/src/USER-UEF/dump_cfg_uef.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(cfg/uef,DumpCFGUef) - +// clang-format off +DumpStyle(cfg/uef,DumpCFGUef); +// clang-format on #else #ifndef LMP_DUMP_CFG_UEF_H @@ -28,8 +28,7 @@ namespace LAMMPS_NS { class DumpCFGUef : public DumpCFG { public: - DumpCFGUef(LAMMPS *lmp, int narg, char **arg) : - DumpCFG(lmp, narg, arg) {} + DumpCFGUef(LAMMPS *lmp, int narg, char **arg) : DumpCFG(lmp, narg, arg) {} void init_style(); void write_header(bigint); @@ -37,7 +36,7 @@ class DumpCFGUef : public DumpCFG { int ifix_uef; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-UEF/fix_nh_uef.cpp b/src/USER-UEF/fix_nh_uef.cpp index 91125fd4ed..9563644ede 100644 --- a/src/USER-UEF/fix_nh_uef.cpp +++ b/src/USER-UEF/fix_nh_uef.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-UEF/fix_nh_uef.h b/src/USER-UEF/fix_nh_uef.h index 0629db5aa1..b8fb776366 100644 --- a/src/USER-UEF/fix_nh_uef.h +++ b/src/USER-UEF/fix_nh_uef.h @@ -13,17 +13,16 @@ Contributing Author: David Nicholson (MIT) ------------------------------------------------------------------------- */ - #ifndef LMP_FIX_NH_UEF_H #define LMP_FIX_NH_UEF_H #include "fix_nh.h" namespace LAMMPS_NS { - // forward declaration - namespace UEF_utils { - class UEFBox; - } +// forward declaration +namespace UEF_utils { + class UEFBox; +} class FixNHUef : public FixNH { public: @@ -33,7 +32,7 @@ class FixNHUef : public FixNH { virtual void init(); virtual void setup(int); virtual void pre_exchange(); - virtual int pack_restart_data(double*); + virtual int pack_restart_data(double *); virtual void restart(char *); virtual void end_of_step(); virtual void initial_integrate(int); @@ -42,7 +41,7 @@ class FixNHUef : public FixNH { virtual void final_integrate_respa(int, int); virtual void post_run(); void get_rot(double[3][3]); - void get_ext_flags(bool*); + void get_ext_flags(bool *); void get_box(double[3][3]); protected: @@ -50,26 +49,26 @@ class FixNHUef : public FixNH { virtual int size_restart_global(); virtual void nve_x(); virtual void nve_v(); - void rotate_x(double [3][3]); + void rotate_x(double[3][3]); void inv_rotate_x(double[3][3]); void rotate_v(double[3][3]); void inv_rotate_v(double[3][3]); void rotate_f(double[3][3]); void inv_rotate_f(double[3][3]); - double strain[2],erate[2]; // strain/strain rate : [e_x, e_y] - // always assume traceless e_z = -e_x-e_y + double strain[2], erate[2]; // strain/strain rate : [e_x, e_y] + // always assume traceless e_z = -e_x-e_y - int rem; //this is for the narg kluge + int rem; //this is for the narg kluge - UEF_utils::UEFBox *uefbox; // interface for the special simulation box + UEF_utils::UEFBox *uefbox; // interface for the special simulation box - double rot[3][3]; // rotation matrix - bool ext_flags[3]; // flags for external "free surfaces" - bool nearly_equal(double,double,double); + double rot[3][3]; // rotation matrix + bool ext_flags[3]; // flags for external "free surfaces" + bool nearly_equal(double, double, double); //bool rotate_output; // experimental feature. Too many issues for now }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-UEF/fix_npt_uef.cpp b/src/USER-UEF/fix_npt_uef.cpp index dc9666ce0f..cc7b14c015 100644 --- a/src/USER-UEF/fix_npt_uef.cpp +++ b/src/USER-UEF/fix_npt_uef.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-UEF/fix_npt_uef.h b/src/USER-UEF/fix_npt_uef.h index 74b4e55048..a46b388412 100644 --- a/src/USER-UEF/fix_npt_uef.h +++ b/src/USER-UEF/fix_npt_uef.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt/uef,FixNPTUef) - +// clang-format off +FixStyle(npt/uef,FixNPTUef); +// clang-format on #else #ifndef LMP_FIX_NPT_UEF_H @@ -32,7 +32,7 @@ class FixNPTUef : public FixNHUef { ~FixNPTUef() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-UEF/fix_nvt_uef.cpp b/src/USER-UEF/fix_nvt_uef.cpp index 1a81649325..fee8f711fa 100644 --- a/src/USER-UEF/fix_nvt_uef.cpp +++ b/src/USER-UEF/fix_nvt_uef.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-UEF/fix_nvt_uef.h b/src/USER-UEF/fix_nvt_uef.h index 76ed7fd1ca..7192aa6412 100644 --- a/src/USER-UEF/fix_nvt_uef.h +++ b/src/USER-UEF/fix_nvt_uef.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/uef,FixNVTUef) - +// clang-format off +FixStyle(nvt/uef,FixNVTUef); +// clang-format on #else #ifndef LMP_FIX_NVT_UEF_H @@ -32,7 +32,7 @@ class FixNVTUef : public FixNHUef { ~FixNVTUef() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-UEF/uef_utils.cpp b/src/USER-UEF/uef_utils.cpp index 4febbbb577..68829c9e78 100644 --- a/src/USER-UEF/uef_utils.cpp +++ b/src/USER-UEF/uef_utils.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-UEF/uef_utils.h b/src/USER-UEF/uef_utils.h index 13ee0dfa5a..073fbf6d0a 100644 --- a/src/USER-UEF/uef_utils.h +++ b/src/USER-UEF/uef_utils.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,127 +16,116 @@ #ifndef LMP_UEF_UTILS_H #define LMP_UEF_UTILS_H -namespace LAMMPS_NS{ namespace UEF_utils { +namespace LAMMPS_NS { +namespace UEF_utils { -class UEFBox -{ - public: + class UEFBox { + public: UEFBox(); void set_strain(const double, const double); - void step_deform(const double,const double); + void step_deform(const double, const double); bool reduce(); void get_box(double[3][3], double); void get_rot(double[3][3]); void get_inverse_cob(int[3][3]); - private: - double l0[3][3]; // initial basis - double w1[3],w2[3],winv[3][3];//omega1 and omega2 (spectra of automorphisms) + + private: + double l0[3][3]; // initial basis + double w1[3], w2[3], winv[3][3]; //omega1 and omega2 (spectra of automorphisms) double theta[2]; double l[3][3], rot[3][3], lrot[3][3]; - int r[3][3],ri[3][3],a1[3][3],a2[3][3],a1i[3][3],a2i[3][3]; -}; + int r[3][3], ri[3][3], a1[3][3], a2[3][3], a1i[3][3], a2i[3][3]; + }; -// lattice reduction routines + // lattice reduction routines -void greedy(double[3][3],int[3][3],int[3][3]); -void col_sort(double[3][3],int[3][3],int[3][3]); -void red12(double[3][3],int[3][3],int[3][3]); -void greedy_recurse(double[3][3],int[3][3],int[3][3]); -void red3(double [3][3],int r[3][3],int[3][3]); -void make_unique(double[3][3],int[3][3],int[3][3]); -void rotation_matrix(double[3][3],double[3][3],const double [3][3]); + void greedy(double[3][3], int[3][3], int[3][3]); + void col_sort(double[3][3], int[3][3], int[3][3]); + void red12(double[3][3], int[3][3], int[3][3]); + void greedy_recurse(double[3][3], int[3][3], int[3][3]); + void red3(double[3][3], int r[3][3], int[3][3]); + void make_unique(double[3][3], int[3][3], int[3][3]); + void rotation_matrix(double[3][3], double[3][3], const double[3][3]); -// A few utility functions for 3x3 arrays + // A few utility functions for 3x3 arrays -template -T col_prod(T x[3][3], int c1, int c2) -{ - return x[0][c1]*x[0][c2]+x[1][c1]*x[1][c2]+x[2][c1]*x[2][c2]; -} - -template -void col_swap(T x[3][3], int c1, int c2) -{ - for (int k=0;k<3;k++) { - T t = x[k][c2]; - x[k][c2]=x[k][c1]; - x[k][c1]=t; + template T col_prod(T x[3][3], int c1, int c2) + { + return x[0][c1] * x[0][c2] + x[1][c1] * x[1][c2] + x[2][c1] * x[2][c2]; } -} -template -void neg_col(T x[3][3], int c1) -{ - x[0][c1] = -x[0][c1]; - x[1][c1] = -x[1][c1]; - x[2][c1] = -x[2][c1]; -} - -template -void neg_row(T x[3][3], int c1) -{ - x[c1][0] = -x[c1][0]; - x[c1][1] = -x[c1][1]; - x[c1][2] = -x[c1][2]; -} - -template -T det(T x[3][3]) -{ - double val; - val = x[0][0]*(x[1][1]*x[2][2] - x[1][2]*x[2][1]); - val -= x[0][1]*(x[1][0]*x[2][2] - x[1][2]*x[2][0]); - val += x[0][2]*(x[1][0]*x[2][1] - x[1][1]*x[2][0]); - return val; -} - -template -bool mat_same(T x1[3][3], T x2[3][3]) -{ - bool v = true; - for (int k=0;k<3;k++) - for (int j=0;j<3;j++) - v &= (x1[k][j]==x2[k][j]); - return v; -} - -template -void transpose(T m[3][3]) -{ - for (int k=0;k<3;k++) - for (int j=k+1;j<3;j++) { - T x = m[k][j]; - m[k][j] = m[j][k]; - m[j][k] = x; + template void col_swap(T x[3][3], int c1, int c2) + { + for (int k = 0; k < 3; k++) { + T t = x[k][c2]; + x[k][c2] = x[k][c1]; + x[k][c1] = t; } -} + } -template -void mul_m1(T1 m1[3][3], const T2 m2[3][3]) -{ - T1 t[3][3]; - for (int k=0;k<3;k++) - for (int j=0;j<3;j++) - t[k][j]=m1[k][j]; + template void neg_col(T x[3][3], int c1) + { + x[0][c1] = -x[0][c1]; + x[1][c1] = -x[1][c1]; + x[2][c1] = -x[2][c1]; + } - for (int k=0;k<3;k++) - for (int j=0;j<3;j++) - m1[k][j] = t[k][0]*m2[0][j] + t[k][1]*m2[1][j] + t[k][2]*m2[2][j]; -} + template void neg_row(T x[3][3], int c1) + { + x[c1][0] = -x[c1][0]; + x[c1][1] = -x[c1][1]; + x[c1][2] = -x[c1][2]; + } -template -void mul_m2(const T1 m1[3][3], T2 m2[3][3]) -{ - T2 t[3][3]; - for (int k=0;k<3;k++) - for (int j=0;j<3;j++) - t[k][j]=m2[k][j]; + template T det(T x[3][3]) + { + double val; + val = x[0][0] * (x[1][1] * x[2][2] - x[1][2] * x[2][1]); + val -= x[0][1] * (x[1][0] * x[2][2] - x[1][2] * x[2][0]); + val += x[0][2] * (x[1][0] * x[2][1] - x[1][1] * x[2][0]); + return val; + } - for (int k=0;k<3;k++) - for (int j=0;j<3;j++) - m2[k][j] = m1[k][0]*t[0][j] + m1[k][1]*t[1][j] + m1[k][2]*t[2][j]; -} + template bool mat_same(T x1[3][3], T x2[3][3]) + { + bool v = true; + for (int k = 0; k < 3; k++) + for (int j = 0; j < 3; j++) v &= (x1[k][j] == x2[k][j]); + return v; + } -} -} + template void transpose(T m[3][3]) + { + for (int k = 0; k < 3; k++) + for (int j = k + 1; j < 3; j++) { + T x = m[k][j]; + m[k][j] = m[j][k]; + m[j][k] = x; + } + } + + template void mul_m1(T1 m1[3][3], const T2 m2[3][3]) + { + T1 t[3][3]; + for (int k = 0; k < 3; k++) + for (int j = 0; j < 3; j++) t[k][j] = m1[k][j]; + + for (int k = 0; k < 3; k++) + for (int j = 0; j < 3; j++) + m1[k][j] = t[k][0] * m2[0][j] + t[k][1] * m2[1][j] + t[k][2] * m2[2][j]; + } + + template void mul_m2(const T1 m1[3][3], T2 m2[3][3]) + { + T2 t[3][3]; + for (int k = 0; k < 3; k++) + for (int j = 0; j < 3; j++) t[k][j] = m2[k][j]; + + for (int k = 0; k < 3; k++) + for (int j = 0; j < 3; j++) + m2[k][j] = m1[k][0] * t[0][j] + m1[k][1] * t[1][j] + m1[k][2] * t[2][j]; + } + +} // namespace UEF_utils +} // namespace LAMMPS_NS #endif diff --git a/src/USER-VTK/dump_vtk.cpp b/src/USER-VTK/dump_vtk.cpp index 8b970820d2..28fab54482 100644 --- a/src/USER-VTK/dump_vtk.cpp +++ b/src/USER-VTK/dump_vtk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-VTK/dump_vtk.h b/src/USER-VTK/dump_vtk.h index 9ff57c642b..9f01469442 100644 --- a/src/USER-VTK/dump_vtk.h +++ b/src/USER-VTK/dump_vtk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(vtk,DumpVTK) - +// clang-format off +DumpStyle(vtk,DumpVTK); +// clang-format on #else #ifndef LMP_DUMP_VTK_H @@ -28,10 +28,9 @@ DumpStyle(vtk,DumpVTK) #include #include - -#include -#include #include +#include +#include class vtkAbstractArray; class vtkRectilinearGrid; @@ -61,14 +60,15 @@ class DumpVTK : public DumpCustom { virtual ~DumpVTK(); virtual void write(); + protected: - char *label; // string for dump file header + char *label; // string for dump file header - int vtk_file_format; // which vtk file format to write (vtk, vtp, vtu ...) + int vtk_file_format; // which vtk file format to write (vtk, vtp, vtu ...) - std::map field2index; // which compute,fix,variable calcs this field - std::map argindex; // index into compute,fix scalar_atom,vector_atom - // 0 for scalar_atom, 1-N for vector_atom values + std::map field2index; // which compute,fix,variable calcs this field + std::map argindex; // index into compute,fix scalar_atom,vector_atom + // 0 for scalar_atom, 1-N for vector_atom values // private methods @@ -88,11 +88,11 @@ class DumpVTK : public DumpCustom { virtual int modify_param(int, char **); typedef void (DumpVTK::*FnPtrHeader)(bigint); - FnPtrHeader header_choice; // ptr to write header functions + FnPtrHeader header_choice; // ptr to write header functions void header_vtk(bigint); typedef void (DumpVTK::*FnPtrWrite)(int, double *); - FnPtrWrite write_choice; // ptr to write data functions + FnPtrWrite write_choice; // ptr to write data functions void write_vtk(int, double *); void write_vtp(int, double *); void write_vtu(int, double *); @@ -105,26 +105,26 @@ class DumpVTK : public DumpCustom { void write_domain_vtu_triclinic(); typedef void (DumpVTK::*FnPtrPack)(int); - std::map pack_choice; // ptrs to pack functions - std::map vtype; // data type - std::map name; // attribute labels - std::set vector_set; // set of vector attributes + std::map pack_choice; // ptrs to pack functions + std::map vtype; // data type + std::map name; // attribute labels + std::set vector_set; // set of vector attributes int current_pack_choice_key; // vtk data containers vtkSmartPointer points; vtkSmartPointer pointsCells; - std::map > myarrays; + std::map> myarrays; int n_calls_; - double (*boxcorners)[3]; // corners of triclinic domain box + double (*boxcorners)[3]; // corners of triclinic domain box char *filecurrent; char *domainfilecurrent; char *parallelfilecurrent; char *multiname_ex; void setFileCurrent(); - void buf2arrays(int, double *); // transfer data from buf array to vtk arrays + void buf2arrays(int, double *); // transfer data from buf array to vtk arrays void reset_vtk_data_containers(); // customize by adding a method prototype @@ -134,7 +134,7 @@ class DumpVTK : public DumpCustom { void pack_custom(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-YAFF/angle_cross.cpp b/src/USER-YAFF/angle_cross.cpp index f167b51306..7ba687ca34 100644 --- a/src/USER-YAFF/angle_cross.cpp +++ b/src/USER-YAFF/angle_cross.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-YAFF/angle_cross.h b/src/USER-YAFF/angle_cross.h index 56b3579f50..a23aea3f38 100644 --- a/src/USER-YAFF/angle_cross.h +++ b/src/USER-YAFF/angle_cross.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(cross,AngleCross) - +// clang-format off +AngleStyle(cross,AngleCross); +// clang-format on #else #ifndef LMP_ANGLE_CROSS_H @@ -37,12 +37,12 @@ class AngleCross : public Angle { double single(int, int, int, int); protected: - double *kss,*kbs0,*kbs1,*r00,*r01,*theta0; + double *kss, *kbs0, *kbs1, *r00, *r01, *theta0; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-YAFF/angle_mm3.cpp b/src/USER-YAFF/angle_mm3.cpp index f39725413b..9bfce2a841 100644 --- a/src/USER-YAFF/angle_mm3.cpp +++ b/src/USER-YAFF/angle_mm3.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-YAFF/angle_mm3.h b/src/USER-YAFF/angle_mm3.h index 00d0a2a073..c61823813e 100644 --- a/src/USER-YAFF/angle_mm3.h +++ b/src/USER-YAFF/angle_mm3.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(mm3,AngleMM3) - +// clang-format off +AngleStyle(mm3,AngleMM3); +// clang-format on #else #ifndef LMP_ANGLE_MM3_H @@ -37,12 +37,12 @@ class AngleMM3 : public Angle { double single(int, int, int, int); protected: - double *theta0,*k2; + double *theta0, *k2; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-YAFF/bond_mm3.cpp b/src/USER-YAFF/bond_mm3.cpp index 67d9c14bbe..7d6cb7cfff 100644 --- a/src/USER-YAFF/bond_mm3.cpp +++ b/src/USER-YAFF/bond_mm3.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-YAFF/bond_mm3.h b/src/USER-YAFF/bond_mm3.h index 8b02ff0249..aece32e359 100644 --- a/src/USER-YAFF/bond_mm3.h +++ b/src/USER-YAFF/bond_mm3.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(mm3,BondMM3) - +// clang-format off +BondStyle(mm3,BondMM3); +// clang-format on #else #ifndef LMP_BOND_MM3_H @@ -37,12 +37,12 @@ class BondMM3 : public Bond { double single(int, double, int, int, double &); protected: - double *r0,*k2; + double *r0, *k2; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-YAFF/improper_distharm.cpp b/src/USER-YAFF/improper_distharm.cpp index d32dd3deca..3a176c1f23 100644 --- a/src/USER-YAFF/improper_distharm.cpp +++ b/src/USER-YAFF/improper_distharm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-YAFF/improper_distharm.h b/src/USER-YAFF/improper_distharm.h index 1603e57194..e30c63981c 100644 --- a/src/USER-YAFF/improper_distharm.h +++ b/src/USER-YAFF/improper_distharm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(distharm,ImproperDistHarm) - +// clang-format off +ImproperStyle(distharm,ImproperDistHarm); +// clang-format on #else #ifndef LMP_IMPROPER_DISTHARM_H @@ -34,13 +34,12 @@ class ImproperDistHarm : public Improper { void read_restart(FILE *); private: - double *k,*chi; + double *k, *chi; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-YAFF/improper_sqdistharm.cpp b/src/USER-YAFF/improper_sqdistharm.cpp index 4bebdf9967..f542ec5f6c 100644 --- a/src/USER-YAFF/improper_sqdistharm.cpp +++ b/src/USER-YAFF/improper_sqdistharm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-YAFF/improper_sqdistharm.h b/src/USER-YAFF/improper_sqdistharm.h index 327f1683f6..57727929de 100644 --- a/src/USER-YAFF/improper_sqdistharm.h +++ b/src/USER-YAFF/improper_sqdistharm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(sqdistharm,ImproperSQDistHarm) - +// clang-format off +ImproperStyle(sqdistharm,ImproperSQDistHarm); +// clang-format on #else #ifndef LMP_IMPROPER_SQDISTHARM_H @@ -34,13 +34,12 @@ class ImproperSQDistHarm : public Improper { void read_restart(FILE *); private: - double *k,*chi; + double *k, *chi; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp index 72fa4ff064..2b366560ca 100644 --- a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp +++ b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.h b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.h index 1a8d34ea2c..10fd765f34 100644 --- a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.h +++ b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/switch3/coulgauss/long,PairLJSwitch3CoulGaussLong) - +// clang-format off +PairStyle(lj/switch3/coulgauss/long,PairLJSwitch3CoulGaussLong); +// clang-format on #else #ifndef LMP_PAIR_LJ_SWITCH3_COULGAUSS_LONG_H @@ -47,18 +47,18 @@ class PairLJSwitch3CoulGaussLong : public Pair { protected: double cut_lj_global; double truncw, truncwi; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma,**gamma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma, **gamma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; - double qdist; // TIP4P distance from O site to negative charge + double qdist; // TIP4P distance from O site to negative charge double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp index 4e52226eaf..ec9e1d8c5a 100644 --- a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp +++ b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.h b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.h index f737481e35..9dec102bee 100644 --- a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.h +++ b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(mm3/switch3/coulgauss/long,PairMM3Switch3CoulGaussLong) - +// clang-format off +PairStyle(mm3/switch3/coulgauss/long,PairMM3Switch3CoulGaussLong); +// clang-format on #else #ifndef LMP_PAIR_MM3_SWITCH3_COULGAUSS_LONG_H @@ -47,18 +47,18 @@ class PairMM3Switch3CoulGaussLong : public Pair { protected: double cut_lj_global; double truncw, truncwi; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma,**gamma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma, **gamma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; - double qdist; // TIP4P distance from O site to negative charge + double qdist; // TIP4P distance from O site to negative charge double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp index d9cd746ca6..04277ed3c0 100644 --- a/src/VORONOI/compute_voronoi_atom.cpp +++ b/src/VORONOI/compute_voronoi_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/VORONOI/compute_voronoi_atom.h b/src/VORONOI/compute_voronoi_atom.h index d38f2b5885..de49636d76 100644 --- a/src/VORONOI/compute_voronoi_atom.h +++ b/src/VORONOI/compute_voronoi_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(voronoi/atom,ComputeVoronoi) - +// clang-format off +ComputeStyle(voronoi/atom,ComputeVoronoi); +// clang-format on #else #ifndef LMP_COMPUTE_VORONOI_H @@ -23,10 +23,10 @@ ComputeStyle(voronoi/atom,ComputeVoronoi) #include "compute.h" namespace voro { - class container; - class container_poly; - class voronoicell_neighbor; -} +class container; +class container_poly; +class voronoicell_neighbor; +} // namespace voro namespace LAMMPS_NS { @@ -50,7 +50,7 @@ class ComputeVoronoi : public Compute { void buildCells(); void checkOccupation(); void loopCells(); - void processCell(voro::voronoicell_neighbor&, int); + void processCell(voro::voronoicell_neighbor &, int); int nmax, rmax, maxedge, sgroupbit; char *radstr; @@ -66,7 +66,7 @@ class ComputeVoronoi : public Compute { double **faces; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/accelerator_kokkos.h b/src/accelerator_kokkos.h index 5a510c77c3..5601e8b855 100644 --- a/src/accelerator_kokkos.h +++ b/src/accelerator_kokkos.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,14 +19,14 @@ #ifdef LMP_KOKKOS -#include "kokkos.h" // IWYU pragma: export -#include "atom_kokkos.h" // IWYU pragma: export -#include "comm_kokkos.h" // IWYU pragma: export -#include "comm_tiled_kokkos.h" // IWYU pragma: export -#include "domain_kokkos.h" // IWYU pragma: export -#include "neighbor_kokkos.h" // IWYU pragma: export -#include "memory_kokkos.h" // IWYU pragma: export -#include "modify_kokkos.h" // IWYU pragma: export +#include "atom_kokkos.h" // IWYU pragma: export +#include "comm_kokkos.h" // IWYU pragma: export +#include "comm_tiled_kokkos.h" // IWYU pragma: export +#include "domain_kokkos.h" // IWYU pragma: export +#include "kokkos.h" // IWYU pragma: export +#include "memory_kokkos.h" // IWYU pragma: export +#include "modify_kokkos.h" // IWYU pragma: export +#include "neighbor_kokkos.h" // IWYU pragma: export #define LAMMPS_INLINE KOKKOS_INLINE_FUNCTION @@ -39,9 +39,9 @@ #include "comm_brick.h" #include "comm_tiled.h" #include "domain.h" -#include "neighbor.h" #include "memory.h" #include "modify.h" +#include "neighbor.h" #define LAMMPS_INLINE inline @@ -54,11 +54,11 @@ class KokkosLMP { int ngpus; int numa; - KokkosLMP(class LAMMPS *, int, char **) {kokkos_exists = 0;} + KokkosLMP(class LAMMPS *, int, char **) { kokkos_exists = 0; } ~KokkosLMP() {} void accelerator(int, char **) {} - int neigh_list_kokkos(int) {return 0;} - int neigh_count(int) {return 0;} + int neigh_list_kokkos(int) { return 0; } + int neigh_count(int) { return 0; } }; class Kokkos { @@ -84,7 +84,7 @@ class CommKokkos : public CommBrick { class CommTiledKokkos : public CommTiled { public: CommTiledKokkos(class LAMMPS *lmp) : CommTiled(lmp) {} - CommTiledKokkos(class LAMMPS *lmp, Comm *oldcomm) : CommTiled(lmp,oldcomm) {} + CommTiledKokkos(class LAMMPS *lmp, Comm *oldcomm) : CommTiled(lmp, oldcomm) {} ~CommTiledKokkos() {} }; @@ -104,7 +104,7 @@ class MemoryKokkos : public Memory { public: MemoryKokkos(class LAMMPS *lmp) : Memory(lmp) {} ~MemoryKokkos() {} - void grow_kokkos(tagint **, tagint **, int, int, const char*) {} + void grow_kokkos(tagint **, tagint **, int, int, const char *) {} }; class ModifyKokkos : public Modify { @@ -121,7 +121,7 @@ class DAT { typedef int tdual_int_2d; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/accelerator_omp.h b/src/accelerator_omp.h index 498f3dc417..3f3be3c975 100644 --- a/src/accelerator_omp.h +++ b/src/accelerator_omp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -33,11 +33,11 @@ class DomainOMP : public Domain { // multi-threaded versions virtual void pbc(); virtual void lamda2x(int); - virtual void lamda2x(double *lamda, double *x) {Domain::lamda2x(lamda,x);} + virtual void lamda2x(double *lamda, double *x) { Domain::lamda2x(lamda, x); } virtual void x2lamda(int); - virtual void x2lamda(double *x, double *lamda) {Domain::x2lamda(x,lamda);} + virtual void x2lamda(double *x, double *lamda) { Domain::x2lamda(x, lamda); } }; -} +} // namespace LAMMPS_NS #endif /* LMP_DOMAIN_OMP_H */ diff --git a/src/angle.cpp b/src/angle.cpp index 110608a867..d822418141 100644 --- a/src/angle.cpp +++ b/src/angle.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/angle.h b/src/angle.h index bd48a9ee83..3a6521003e 100644 --- a/src/angle.h +++ b/src/angle.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,31 +14,32 @@ #ifndef LMP_ANGLE_H #define LMP_ANGLE_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Angle : protected Pointers { friend class ThrOMP; friend class FixOMP; + public: int allocated; int *setflag; - 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 - double **cvatom; // accumulated per-atom centroid virial + 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 + double **cvatom; // accumulated per-atom centroid virial - int centroidstressflag; // centroid stress compared to two-body stress - // CENTROID_SAME = same as two-body stress - // CENTROID_AVAIL = different and implemented - // CENTROID_NOTAVAIL = different, not yet implemented + int centroidstressflag; // centroid stress compared to two-body stress + // CENTROID_SAME = same as two-body stress + // CENTROID_AVAIL = different and implemented + // CENTROID_NOTAVAIL = different, not yet implemented // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; int copymode; Angle(class LAMMPS *); @@ -47,34 +48,38 @@ class Angle : protected Pointers { virtual void compute(int, int) = 0; virtual void settings(int, char **) {} virtual void coeff(int, char **) = 0; - virtual void init_style() {}; + virtual void init_style(){}; virtual double equilibrium_angle(int) = 0; virtual void write_restart(FILE *) = 0; virtual void read_restart(FILE *) = 0; - virtual void write_restart_settings(FILE *) {}; - virtual void read_restart_settings(FILE *) {}; + virtual void write_restart_settings(FILE *){}; + virtual void read_restart_settings(FILE *){}; virtual void write_data(FILE *) {} virtual double single(int, int, int, int) = 0; virtual double memory_usage(); protected: - int suffix_flag; // suffix compatibility flag + int suffix_flag; // suffix compatibility flag int evflag; - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom,cvflag_atom; - int maxeatom,maxvatom,maxcvatom; + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom, cvflag_atom; + int maxeatom, maxvatom, maxcvatom; - void ev_init(int eflag, int vflag, int alloc = 1) { - if (eflag||vflag) ev_setup(eflag, vflag, alloc); - else evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = cvflag_atom = 0; + void ev_init(int eflag, int vflag, int alloc = 1) + { + if (eflag || vflag) + ev_setup(eflag, vflag, alloc); + else + evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = + cvflag_atom = 0; } void ev_setup(int, int, int alloc = 1); - void ev_tally(int, int, int, int, int, double, double *, double *, - double, double, double, double, double, double); + void ev_tally(int, int, int, int, int, double, double *, double *, double, double, double, double, + double, double); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/angle_deprecated.cpp b/src/angle_deprecated.cpp index ccb624b39e..9a4ca8c877 100644 --- a/src/angle_deprecated.cpp +++ b/src/angle_deprecated.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/angle_deprecated.h b/src/angle_deprecated.h index 4882bc3ca9..ba94e0ef10 100644 --- a/src/angle_deprecated.h +++ b/src/angle_deprecated.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(DEPRECATED,AngleDeprecated) - +// clang-format off +AngleStyle(DEPRECATED,AngleDeprecated); +// clang-format on #else #ifndef LMP_ANGLE_DEPRECATED_H @@ -38,7 +38,7 @@ class AngleDeprecated : public Angle { virtual double single(int, int, int, int) { return 0.0; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/angle_hybrid.cpp b/src/angle_hybrid.cpp index 1295776bef..4fb382790e 100644 --- a/src/angle_hybrid.cpp +++ b/src/angle_hybrid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/angle_hybrid.h b/src/angle_hybrid.h index 61193283e4..f0286af6f5 100644 --- a/src/angle_hybrid.h +++ b/src/angle_hybrid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(hybrid,AngleHybrid) - +// clang-format off +AngleStyle(hybrid,AngleHybrid); +// clang-format on #else #ifndef LMP_ANGLE_HYBRID_H @@ -26,9 +26,9 @@ namespace LAMMPS_NS { class AngleHybrid : public Angle { public: - int nstyles; // # of different angle styles - Angle **styles; // class list for each Angle style - char **keywords; // keyword for each Angle style + int nstyles; // # of different angle styles + Angle **styles; // class list for each Angle style + char **keywords; // keyword for each Angle style AngleHybrid(class LAMMPS *); ~AngleHybrid(); @@ -43,16 +43,16 @@ class AngleHybrid : public Angle { double memory_usage(); private: - int *map; // which style each angle type points to + int *map; // which style each angle type points to - int *nanglelist; // # of angles in sub-style anglelists - int *maxangle; // max # of angles sub-style lists can store - int ***anglelist; // anglelist for each sub-style + int *nanglelist; // # of angles in sub-style anglelists + int *maxangle; // max # of angles sub-style lists can store + int ***anglelist; // anglelist for each sub-style void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/angle_zero.cpp b/src/angle_zero.cpp index 42ed741686..153a2ad48d 100644 --- a/src/angle_zero.cpp +++ b/src/angle_zero.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/angle_zero.h b/src/angle_zero.h index 843991f95d..c41fc1a6ff 100644 --- a/src/angle_zero.h +++ b/src/angle_zero.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ANGLE_CLASS - -AngleStyle(zero,AngleZero) - +// clang-format off +AngleStyle(zero,AngleZero); +// clang-format on #else #ifndef LMP_ANGLE_ZERO_H @@ -46,7 +46,7 @@ class AngleZero : public Angle { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/arg_info.cpp b/src/arg_info.cpp index 9e4f572fea..b83bb141fa 100644 --- a/src/arg_info.cpp +++ b/src/arg_info.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,8 +13,8 @@ #include "arg_info.h" -#include #include +#include using namespace LAMMPS_NS; @@ -28,46 +28,51 @@ using namespace LAMMPS_NS; * \param arg string with possible reference * \param allowed integer with bitmap of allowed types of references */ -ArgInfo::ArgInfo(const std::string &arg, int allowed) - : type(NONE), dim(0), index1(-1), index2(-1) +ArgInfo::ArgInfo(const std::string &arg, int allowed) : type(NONE), dim(0), index1(-1), index2(-1) { if ((arg.size() > 2) && (arg[1] == '_')) { - if ((arg[0] == 'c') && (allowed & COMPUTE)) type = COMPUTE; - else if ((arg[0] == 'f') && (allowed & FIX)) type = FIX; - else if ((arg[0] == 'v') && (allowed & VARIABLE)) type = VARIABLE; - else if ((arg[0] == 'd') && (allowed & DNAME)) type = DNAME; - else if ((arg[0] == 'i') && (allowed & INAME)) type = INAME; + if ((arg[0] == 'c') && (allowed & COMPUTE)) + type = COMPUTE; + else if ((arg[0] == 'f') && (allowed & FIX)) + type = FIX; + else if ((arg[0] == 'v') && (allowed & VARIABLE)) + type = VARIABLE; + else if ((arg[0] == 'd') && (allowed & DNAME)) + type = DNAME; + else if ((arg[0] == 'i') && (allowed & INAME)) + type = INAME; else { index1 = 0; name = arg; return; } - std::size_t has_idx1 = arg.find('[',2); + std::size_t has_idx1 = arg.find('[', 2); if (has_idx1 != std::string::npos) { - name = arg.substr(2,has_idx1-2); + name = arg.substr(2, has_idx1 - 2); dim = 1; - std::size_t has_idx2 = arg.find('[',has_idx1+1); + std::size_t has_idx2 = arg.find('[', has_idx1 + 1); if (has_idx2 != std::string::npos) { dim = 2; - if (arg[arg.size()-1] != ']') { + if (arg[arg.size() - 1] != ']') { type = UNKNOWN; } else { try { - index2 = std::stoi(arg.substr(has_idx2+1,arg.size()-(has_idx2+2))); + index2 = std::stoi(arg.substr(has_idx2 + 1, arg.size() - (has_idx2 + 2))); } catch (std::invalid_argument &) { type = UNKNOWN; } } - } else has_idx2 = arg.size(); + } else + has_idx2 = arg.size(); - if (arg[has_idx2-1] != ']') { + if (arg[has_idx2 - 1] != ']') { type = UNKNOWN; } else { try { - index1 = std::stoi(arg.substr(has_idx1+1,arg.size()-(has_idx2+2))); + index1 = std::stoi(arg.substr(has_idx1 + 1, arg.size() - (has_idx2 + 2))); } catch (std::invalid_argument &) { type = UNKNOWN; } @@ -96,8 +101,7 @@ ArgInfo::ArgInfo(const std::string &arg, int allowed) char *ArgInfo::copy_name() { - char *dest = new char[name.size()+1]; - strcpy(dest,name.c_str()); + char *dest = new char[name.size() + 1]; + strcpy(dest, name.c_str()); // NOLINT return dest; } - diff --git a/src/arg_info.h b/src/arg_info.h index 7b8865a1f7..e9d976db8d 100644 --- a/src/arg_info.h +++ b/src/arg_info.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,40 +19,41 @@ #include namespace LAMMPS_NS { - class ArgInfo { - public: - /*! constants for argument types */ - enum ArgTypes { - ERROR =-2, - UNKNOWN =-1, - NONE = 0, - X = 1<<0, - V = 1<<1, - F = 1<<2, - COMPUTE = 1<<3, - FIX = 1<<4, - VARIABLE = 1<<5, - KEYWORD = 1<<6, - TYPE = 1<<7, - MOLECULE = 1<<8, - DNAME = 1<<9, - INAME = 1<<10, - DENSITY_NUMBER = 1<<11, - DENSITY_MASS = 1<<12, - MASS = 1<<13, - TEMPERATURE = 1<<14, - BIN1D = 1<<15, - BIN2D = 1<<16, - BIN3D = 1<<17, - BINSPHERE = 1<<18, - BINCYLINDER = 1<<19 - }; +class ArgInfo { + public: + // clang-format off + /*! constants for argument types */ + enum ArgTypes { + ERROR =-2, + UNKNOWN =-1, + NONE = 0, + X = 1<<0, + V = 1<<1, + F = 1<<2, + COMPUTE = 1<<3, + FIX = 1<<4, + VARIABLE = 1<<5, + KEYWORD = 1<<6, + TYPE = 1<<7, + MOLECULE = 1<<8, + DNAME = 1<<9, + INAME = 1<<10, + DENSITY_NUMBER = 1<<11, + DENSITY_MASS = 1<<12, + MASS = 1<<13, + TEMPERATURE = 1<<14, + BIN1D = 1<<15, + BIN2D = 1<<16, + BIN3D = 1<<17, + BINSPHERE = 1<<18, + BINCYLINDER = 1<<19 + }; + // clang-format on + ArgInfo(const std::string &arg, int allowed = COMPUTE | FIX | VARIABLE); + virtual ~ArgInfo() {} - ArgInfo(const std::string &arg, int allowed=COMPUTE|FIX|VARIABLE); - virtual ~ArgInfo() {} - - public: - /*! get type of reference + public: + /*! get type of reference * * Return a type constant for the reference. This may be either * COMPUTE, FIX, VARIABLE (if not restricted to a subset of those @@ -62,33 +63,33 @@ namespace LAMMPS_NS { * * \return integer with a constant from ArgTypes enumerator */ - int get_type() const { return type; } + int get_type() const { return type; } - /*! get dimension of reference + /*! get dimension of reference * * This will return either 0, 1, 2 depending on whether the * reference has no, one or two "[{number}]" postfixes. * * \return integer with the dimensionality of the reference */ - int get_dim() const { return dim; } + int get_dim() const { return dim; } - /*! get index of first dimension + /*! get index of first dimension * * This will return the number in the first "[{number}]" * postfix or 0 if there is no postfix. * * \return integer with index or the postfix or 0 */ - int get_index1() const { return index1; } + int get_index1() const { return index1; } - /*! get index of second dimension + /*! get index of second dimension * * This will return the number in the second "[{number}]" * postfix or -1 if there is no second postfix. * * \return integer with index of the postfix or -1 */ - int get_index2() const { return index2; } + int get_index2() const { return index2; } - /*! return reference to the ID or name of the reference + /*! return reference to the ID or name of the reference * * This string is pointing to an internal storage element and * is only valid to use while the ArgInfo class instance is @@ -96,18 +97,18 @@ namespace LAMMPS_NS { * with copy_name(). * * \return C-style char * string */ - const char *get_name() const { return name.c_str(); } + const char *get_name() const { return name.c_str(); } - char *copy_name(); + char *copy_name(); - private: - std::string name; - int type, dim, index1, index2; + private: + std::string name; + int type, dim, index1, index2; - // disabled standard methods - ArgInfo() {} - ArgInfo(const ArgInfo &) {} - void operator=(const ArgInfo &) {} - }; -} + // disabled standard methods + ArgInfo() {} + ArgInfo(const ArgInfo &) {} + void operator=(const ArgInfo &) {} +}; +} // namespace LAMMPS_NS #endif diff --git a/src/atom.cpp b/src/atom.cpp index 70ed5a3836..219beee01c 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/atom.h b/src/atom.h index a8166bde65..2fbd12b38e 100644 --- a/src/atom.h +++ b/src/atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -21,73 +21,73 @@ namespace LAMMPS_NS { - // forward declaration +// forward declaration - class AtomVec; +class AtomVec; class Atom : protected Pointers { public: char *atom_style; AtomVec *avec; - enum{DOUBLE,INT,BIGINT}; - enum{GROW=0,RESTART=1,BORDER=2}; - enum{ATOMIC=0,MOLECULAR=1,TEMPLATE=2}; - enum{MAP_NONE=0,MAP_ARRAY=1,MAP_HASH=2,MAP_YES=3}; + enum { DOUBLE, INT, BIGINT }; + enum { GROW = 0, RESTART = 1, BORDER = 2 }; + enum { ATOMIC = 0, MOLECULAR = 1, TEMPLATE = 2 }; + enum { MAP_NONE = 0, MAP_ARRAY = 1, MAP_HASH = 2, MAP_YES = 3 }; // atom counts - bigint natoms; // total # of atoms in system, could be 0 - // natoms may not be current if atoms lost - int nlocal,nghost; // # of owned and ghost atoms on this proc - int nmax; // max # of owned+ghost in arrays on this proc - int tag_enable; // 0/1 if atom ID tags are defined - int molecular; // 0 = atomic, 1 = standard molecular system, - // 2 = molecule template system - bigint nellipsoids; // number of ellipsoids - bigint nlines; // number of lines - bigint ntris; // number of triangles - bigint nbodies; // number of bodies + bigint natoms; // total # of atoms in system, could be 0 + // natoms may not be current if atoms lost + int nlocal, nghost; // # of owned and ghost atoms on this proc + int nmax; // max # of owned+ghost in arrays on this proc + int tag_enable; // 0/1 if atom ID tags are defined + int molecular; // 0 = atomic, 1 = standard molecular system, + // 2 = molecule template system + bigint nellipsoids; // number of ellipsoids + bigint nlines; // number of lines + bigint ntris; // number of triangles + bigint nbodies; // number of bodies // system properties - bigint nbonds,nangles,ndihedrals,nimpropers; - int ntypes,nbondtypes,nangletypes,ndihedraltypes,nimpropertypes; - int bond_per_atom,angle_per_atom,dihedral_per_atom,improper_per_atom; - int extra_bond_per_atom,extra_angle_per_atom; - int extra_dihedral_per_atom,extra_improper_per_atom; + bigint nbonds, nangles, ndihedrals, nimpropers; + int ntypes, nbondtypes, nangletypes, ndihedraltypes, nimpropertypes; + int bond_per_atom, angle_per_atom, dihedral_per_atom, improper_per_atom; + int extra_bond_per_atom, extra_angle_per_atom; + int extra_dihedral_per_atom, extra_improper_per_atom; - int firstgroup; // store atoms in this group first, -1 if unset - int nfirst; // # of atoms in first group on this proc - char *firstgroupname; // group-ID to store first, null pointer if unset + int firstgroup; // store atoms in this group first, -1 if unset + int nfirst; // # of atoms in first group on this proc + char *firstgroupname; // group-ID to store first, null pointer if unset // -------------------------------------------------------------------- // 1st customization section: customize by adding new per-atom variable // per-atom vectors and arrays tagint *tag; - int *type,*mask; + int *type, *mask; imageint *image; - double **x,**v,**f; + double **x, **v, **f; // charged and dipolar particles double *rmass; - double *q,**mu; + double *q, **mu; // finite-size particles double *radius; - double **omega,**angmom,**torque; - int *ellipsoid,*line,*tri,*body; + double **omega, **angmom, **torque; + int *ellipsoid, *line, *tri, *body; // molecular systems tagint *molecule; - int *molindex,*molatom; + int *molindex, *molatom; - int **nspecial; // 0,1,2 = cumulative # of 1-2,1-3,1-4 neighs - tagint **special; // IDs of 1-2,1-3,1-4 neighs of each atom - int maxspecial; // special[nlocal][maxspecial] + int **nspecial; // 0,1,2 = cumulative # of 1-2,1-3,1-4 neighs + tagint **special; // IDs of 1-2,1-3,1-4 neighs of each atom + int maxspecial; // special[nlocal][maxspecial] int *num_bond; int **bond_type; @@ -95,46 +95,46 @@ class Atom : protected Pointers { int *num_angle; int **angle_type; - tagint **angle_atom1,**angle_atom2,**angle_atom3; + tagint **angle_atom1, **angle_atom2, **angle_atom3; int *num_dihedral; int **dihedral_type; - tagint **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4; + tagint **dihedral_atom1, **dihedral_atom2, **dihedral_atom3, **dihedral_atom4; int *num_improper; int **improper_type; - tagint **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4; + tagint **improper_atom1, **improper_atom2, **improper_atom3, **improper_atom4; // PERI package - double *vfrac,*s0; + double *vfrac, *s0; double **x0; // SPIN package - double **sp,**fm,**fm_long; + double **sp, **fm, **fm_long; // USER_EFF and USER-AWPMD packages int *spin; - double *eradius,*ervel,*erforce; + double *eradius, *ervel, *erforce; double *ervelforce; - double **cs,**csforce,**vforce; + double **cs, **csforce, **vforce; int *etag; // USER-DPD package - double *uCond,*uMech,*uChem,*uCGnew,*uCG; + double *uCond, *uMech, *uChem, *uCGnew, *uCG; double *duChem; double *dpdTheta; int nspecies_dpd; // USER-MESO package - double **cc,**cc_flux; // cc = chemical concentration - double *edpd_temp,*edpd_flux; // temperature and heat flux + double **cc, **cc_flux; // cc = chemical concentration + double *edpd_temp, *edpd_flux; // temperature and heat flux double *vest_temp; - double *edpd_cv; // heat capacity + double *edpd_cv; // heat capacity int cc_species; // USER-MESONT package @@ -154,7 +154,7 @@ class Atom : protected Pointers { // USER-SPH package - double *rho,*drho,*esph,*desph,*cv; + double *rho, *drho, *esph, *desph, *cv; double **vest; // end of customization section @@ -166,17 +166,17 @@ class Atom : protected Pointers { // most are existence flags for per-atom vectors and arrays // 1 if variable is used, 0 if not - int sphere_flag,ellipsoid_flag,line_flag,tri_flag,body_flag; - int peri_flag,electron_flag; - int wavepacket_flag,sph_flag; + int sphere_flag, ellipsoid_flag, line_flag, tri_flag, body_flag; + int peri_flag, electron_flag; + int wavepacket_flag, sph_flag; - int molecule_flag,molindex_flag,molatom_flag; - int q_flag,mu_flag; - int rmass_flag,radius_flag,omega_flag,torque_flag,angmom_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; - int dpd_flag,edpd_flag,tdpd_flag; + int molecule_flag, molindex_flag, molatom_flag; + int q_flag, mu_flag; + int rmass_flag, radius_flag, omega_flag, torque_flag, angmom_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; + int dpd_flag, edpd_flag, tdpd_flag; int mesont_flag; // SPIN package @@ -186,9 +186,9 @@ class Atom : protected Pointers { // USER-SMD package int x0_flag; - int smd_flag,damage_flag; - int contact_radius_flag,smd_data_9_flag,smd_stress_flag; - int eff_plastic_strain_flag,eff_plastic_strain_rate_flag; + int smd_flag, damage_flag; + int contact_radius_flag, smd_data_9_flag, smd_stress_flag; + int eff_plastic_strain_flag, eff_plastic_strain_rate_flag; // Peridynamics scale factor, used by dump cfg @@ -211,14 +211,14 @@ class Atom : protected Pointers { }; PerAtom *peratom; - int nperatom,maxperatom; + int nperatom, maxperatom; // custom arrays used by fix property/atom int **ivector; double **dvector; - char **iname,**dname; - int nivector,ndvector; + char **iname, **dname; + int nivector, ndvector; // molecule templates // each template can be a set of consecutive molecules @@ -239,32 +239,32 @@ class Atom : protected Pointers { // callback ptrs for atom arrays managed by fix classes - int nextra_grow,nextra_restart,nextra_border; // # of callbacks of each type - int *extra_grow,*extra_restart,*extra_border; // index of fix to callback to - int nextra_grow_max,nextra_restart_max; // size of callback lists + int nextra_grow, nextra_restart, nextra_border; // # of callbacks of each type + int *extra_grow, *extra_restart, *extra_border; // index of fix to callback to + int nextra_grow_max, nextra_restart_max; // size of callback lists int nextra_border_max; int nextra_store; - int map_style; // style of atom map: 0=none, 1=array, 2=hash - int map_user; // user requested map style: - // 0 = no request, 1=array, 2=hash, 3=yes - tagint map_tag_max; // max atom ID that map() is setup for - std::set *unique_tags; // set to ensure that bodies have unique tags + int map_style; // style of atom map: 0=none, 1=array, 2=hash + int map_user; // user requested map style: + // 0 = no request, 1=array, 2=hash, 3=yes + tagint map_tag_max; // max atom ID that map() is setup for + std::set *unique_tags; // set to ensure that bodies have unique tags // spatial sorting of atoms - int sortfreq; // sort atoms every this many steps, 0 = off - bigint nextsort; // next timestep to sort on - double userbinsize; // requested sort bin size + int sortfreq; // sort atoms every this many steps, 0 = off + bigint nextsort; // next timestep to sort on + double userbinsize; // requested sort bin size // indices of atoms with same ID - int *sametag; // sametag[I] = next atom with same ID, -1 if no more + int *sametag; // sametag[I] = next atom with same ID, -1 if no more // AtomVec factory types and map typedef AtomVec *(*AtomVecCreator)(LAMMPS *); - typedef std::map AtomVecCreatorMap; + typedef std::map AtomVecCreatorMap; AtomVecCreatorMap *avec_map; // -------------------------------------------------------------------- @@ -275,10 +275,9 @@ class Atom : protected Pointers { void settings(class Atom *); void peratom_create(); - void add_peratom(const char *, void *, int, int, int threadflag=0); + void add_peratom(const char *, void *, int, int, int threadflag = 0); void add_peratom_change_columns(const char *, int); - void add_peratom_vary(const char *, void *, int, int *, - void *, int collength=0); + void add_peratom_vary(const char *, void *, int, int *, void *, int collength = 0); void create_avec(const std::string &, int, char **, int); virtual AtomVec *new_avec(const std::string &, int, int &); @@ -337,13 +336,13 @@ class Atom : protected Pointers { void *extract(const char *); int extract_datatype(const char *); - inline int* get_map_array() {return map_array;}; - inline int get_map_size() {return map_tag_max+1;}; - inline int get_max_same() {return max_same;}; - inline int get_map_maxarray() {return map_maxarray+1;}; + inline int *get_map_array() { return map_array; }; + inline int get_map_size() { return map_tag_max + 1; }; + inline int get_max_same() { return max_same; }; + inline int get_map_maxarray() { return map_maxarray + 1; }; // NOTE: placeholder method until KOKKOS/AtomVec is refactored - int memcheck(const char *) {return 1;} + int memcheck(const char *) { return 1; } double memory_usage(); @@ -351,10 +350,14 @@ class Atom : protected Pointers { // map lookup function inlined for efficiency // return -1 if no map defined - inline int map(tagint global) { - if (map_style == 1) return map_array[global]; - else if (map_style == 2) return map_find_hash(global); - else return -1; + inline int map(tagint global) + { + if (map_style == 1) + return map_array[global]; + else if (map_style == 2) + return map_find_hash(global); + else + return -1; }; void map_init(int check = 1); @@ -366,37 +369,36 @@ class Atom : protected Pointers { int map_find_hash(tagint); protected: - // global to local ID mapping - int *map_array; // direct map via array that holds map_tag_max - int map_maxarray; // allocated size of map_array (1 larger than this) + int *map_array; // direct map via array that holds map_tag_max + int map_maxarray; // allocated size of map_array (1 larger than this) - struct HashElem { // hashed map - tagint global; // key to search on = global ID - int local; // value associated with key = local index - int next; // next entry in this bucket, -1 if last + struct HashElem { // hashed map + tagint global; // key to search on = global ID + int local; // value associated with key = local index + int next; // next entry in this bucket, -1 if last }; - int map_nhash; // # of entries hash table can hold - int map_nused; // # of actual entries in hash table - int map_free; // ptr to 1st unused entry in hash table - int map_nbucket; // # of hash buckets - int *map_bucket; // ptr to 1st entry in each bucket - HashElem *map_hash; // hash table + int map_nhash; // # of entries hash table can hold + int map_nused; // # of actual entries in hash table + int map_free; // ptr to 1st unused entry in hash table + int map_nbucket; // # of hash buckets + int *map_bucket; // ptr to 1st entry in each bucket + HashElem *map_hash; // hash table - int max_same; // allocated size of sametag + int max_same; // allocated size of sametag // spatial sorting of atoms - int nbins; // # of sorting bins - int nbinx,nbiny,nbinz; // bins in each dimension - int maxbin; // max # of bins - int maxnext; // max size of next,permute - int *binhead; // 1st atom in each bin - int *next; // next atom in bin - int *permute; // permutation vector - double bininvx,bininvy,bininvz; // inverse actual bin sizes - double bboxlo[3],bboxhi[3]; // bounding box of my sub-domain + int nbins; // # of sorting bins + int nbinx, nbiny, nbinz; // bins in each dimension + int maxbin; // max # of bins + int maxnext; // max size of next,permute + int *binhead; // 1st atom in each bin + int *next; // next atom in bin + int *permute; // permutation vector + double bininvx, bininvy, bininvz; // inverse actual bin sizes + double bboxlo[3], bboxhi[3]; // bounding box of my sub-domain void set_atomflag_defaults(); void setup_sort_bins(); @@ -406,7 +408,7 @@ class Atom : protected Pointers { template static AtomVec *avec_creator(LAMMPS *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/atom_map.cpp b/src/atom_map.cpp index 6961d599c5..95f09d2639 100644 --- a/src/atom_map.cpp +++ b/src/atom_map.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/atom_map.h b/src/atom_map.h index 1b98c69c26..73f824b43b 100644 --- a/src/atom_map.h +++ b/src/atom_map.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/atom_masks.h b/src/atom_masks.h index 84faa492fb..00ad0e6e0f 100644 --- a/src/atom_masks.h +++ b/src/atom_masks.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index 9ae5a86039..dd13cf3ae0 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/atom_vec.h b/src/atom_vec.h index a1bd8fd812..a65fd17dcd 100644 --- a/src/atom_vec.h +++ b/src/atom_vec.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,56 +14,56 @@ #ifndef LMP_ATOM_VEC_H #define LMP_ATOM_VEC_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export #include namespace LAMMPS_NS { class AtomVec : protected Pointers { public: - enum {PER_ATOM=0,PER_TYPE=1}; - int molecular; // 0 = atomic, 1 = molecular system, 2 = molecular template system - int bonds_allow,angles_allow; // 1 if bonds, angles are used - int dihedrals_allow,impropers_allow; // 1 if dihedrals, impropers used - int mass_type; // 1 if per-type masses - int dipole_type; // 1 if per-type dipole moments - int forceclearflag; // 1 if has forceclear() method + enum { PER_ATOM = 0, PER_TYPE = 1 }; + int molecular; // 0 = atomic, 1 = molecular system, 2 = molecular template system + int bonds_allow, angles_allow; // 1 if bonds, angles are used + int dihedrals_allow, impropers_allow; // 1 if dihedrals, impropers used + int mass_type; // 1 if per-type masses + int dipole_type; // 1 if per-type dipole moments + int forceclearflag; // 1 if has forceclear() method - int comm_x_only; // 1 if only exchange x in forward comm - int comm_f_only; // 1 if only exchange f in reverse comm + int comm_x_only; // 1 if only exchange x in forward comm + int comm_f_only; // 1 if only exchange f in reverse comm - int size_forward; // # of values per atom in comm - int size_reverse; // # in reverse comm - int size_border; // # in border comm - int size_velocity; // # of velocity based quantities - int size_data_atom; // number of values in Atom line - int size_data_vel; // number of values in Velocity line - int xcol_data; // column (1-N) where x is in Atom line - int maxexchange; // max size of exchanged atom - // only needs to be set if size > BUFEXTRA + int size_forward; // # of values per atom in comm + int size_reverse; // # in reverse comm + int size_border; // # in border comm + int size_velocity; // # of velocity based quantities + int size_data_atom; // number of values in Atom line + int size_data_vel; // number of values in Velocity line + int xcol_data; // column (1-N) where x is in Atom line + int maxexchange; // max size of exchanged atom + // only needs to be set if size > BUFEXTRA - int bonus_flag; // 1 if stores bonus data - int size_forward_bonus; // # in forward bonus comm - int size_border_bonus; // # in border bonus comm - int size_restart_bonus_one; // # in restart bonus comm - int size_data_bonus; // number of values in Bonus line + int bonus_flag; // 1 if stores bonus data + int size_forward_bonus; // # in forward bonus comm + int size_border_bonus; // # in border bonus comm + int size_restart_bonus_one; // # in restart bonus comm + int size_data_bonus; // number of values in Bonus line - class Molecule **onemols; // list of molecules for style template - int nset; // # of molecules in list + class Molecule **onemols; // list of molecules for style template + int nset; // # of molecules in list - int kokkosable; // 1 if atom style is KOKKOS-enabled + int kokkosable; // 1 if atom style is KOKKOS-enabled - int nargcopy; // copy of command-line args for atom_style command - char **argcopy; // used when AtomVec is realloced (restart,replicate) + int nargcopy; // copy of command-line args for atom_style command + char **argcopy; // used when AtomVec is realloced (restart,replicate) // additional list of peratom fields operated on by different methods // set or created by child styles - char *fields_grow,*fields_copy; - char *fields_comm,*fields_comm_vel,*fields_reverse; - char *fields_border,*fields_border_vel; - char *fields_exchange,*fields_restart; - char *fields_create,*fields_data_atom,*fields_data_vel; + char *fields_grow, *fields_copy; + char *fields_comm, *fields_comm_vel, *fields_reverse; + char *fields_border, *fields_border_vel; + char *fields_exchange, *fields_restart; + char *fields_create, *fields_data_atom, *fields_data_vel; // methods @@ -89,7 +89,7 @@ class AtomVec : protected Pointers { virtual void unpack_comm(int, int, double *); virtual void unpack_comm_vel(int, int, double *); - virtual int pack_comm_bonus(int, int *, double *) {return 0;} + virtual int pack_comm_bonus(int, int *, double *) { return 0; } virtual void unpack_comm_bonus(int, int, double *) {} virtual int pack_reverse(int, int, double *); @@ -100,14 +100,14 @@ class AtomVec : protected Pointers { virtual void unpack_border(int, int, double *); virtual void unpack_border_vel(int, int, double *); - virtual int pack_border_bonus(int, int *, double *) {return 0;} - virtual int unpack_border_bonus(int, int, double *) {return 0;} + virtual int pack_border_bonus(int, int *, double *) { return 0; } + virtual int unpack_border_bonus(int, int, double *) { return 0; } virtual int pack_exchange(int, double *); virtual int unpack_exchange(double *); - virtual int pack_exchange_bonus(int, double *) {return 0;} - virtual int unpack_exchange_bonus(int, double *) {return 0;} + virtual int pack_exchange_bonus(int, double *) { return 0; } + virtual int unpack_exchange_bonus(int, double *) { return 0; } virtual int size_restart(); virtual int pack_restart(int, double *); @@ -117,9 +117,9 @@ class AtomVec : protected Pointers { virtual void pack_restart_post(int) {} virtual void unpack_restart_init(int) {} - virtual int size_restart_bonus() {return 0;} - virtual int pack_restart_bonus(int, double *) {return 0;} - virtual int unpack_restart_bonus(int, double *) {return 0;} + virtual int size_restart_bonus() { return 0; } + virtual int pack_restart_bonus(int, double *) { return 0; } + virtual int unpack_restart_bonus(int, double *) { return 0; } virtual void create_atom(int, double *); virtual void create_atom_post(int) {} @@ -147,55 +147,55 @@ class AtomVec : protected Pointers { virtual int pack_improper(tagint **); virtual void write_improper(FILE *, int, tagint **, int); - virtual int pack_data_bonus(double *, int) {return 0;} + virtual int pack_data_bonus(double *, int) { return 0; } virtual void write_data_bonus(FILE *, int, double *, int) {} - virtual int property_atom(char *) {return -1;} + virtual int property_atom(char *) { return -1; } virtual void pack_property_atom(int, double *, int, int) {} virtual double memory_usage(); - virtual double memory_usage_bonus() {return 0;} + virtual double memory_usage_bonus() { return 0; } // old hybrid functions, needed by Kokkos package - virtual int pack_comm_hybrid(int, int *, double *) {return 0;} - virtual int unpack_comm_hybrid(int, int, double *) {return 0;} - virtual int pack_reverse_hybrid(int, int, double *) {return 0;} - virtual int unpack_reverse_hybrid(int, int *, double *) {return 0;} - virtual int pack_border_hybrid(int, int *, double *) {return 0;} - virtual int unpack_border_hybrid(int, int, double *) {return 0;} - virtual int data_atom_hybrid(int, char **) {return 0;} - virtual int data_vel_hybrid(int, char **) {return 0;} - virtual int pack_data_hybrid(int, double *) {return 0;} - virtual int write_data_hybrid(FILE *, double *) {return 0;} - virtual int pack_vel_hybrid(int, double *) {return 0;} - virtual int write_vel_hybrid(FILE *, double *) {return 0;} + virtual int pack_comm_hybrid(int, int *, double *) { return 0; } + virtual int unpack_comm_hybrid(int, int, double *) { return 0; } + virtual int pack_reverse_hybrid(int, int, double *) { return 0; } + virtual int unpack_reverse_hybrid(int, int *, double *) { return 0; } + virtual int pack_border_hybrid(int, int *, double *) { return 0; } + virtual int unpack_border_hybrid(int, int, double *) { return 0; } + virtual int data_atom_hybrid(int, char **) { return 0; } + virtual int data_vel_hybrid(int, char **) { return 0; } + virtual int pack_data_hybrid(int, double *) { return 0; } + virtual int write_data_hybrid(FILE *, double *) { return 0; } + virtual int pack_vel_hybrid(int, double *) { return 0; } + virtual int write_vel_hybrid(FILE *, double *) { return 0; } protected: - int nmax; // local copy of atom->nmax - int deform_vremap; // local copy of domain properties + int nmax; // local copy of atom->nmax + int deform_vremap; // local copy of domain properties int deform_groupbit; double *h_rate; - tagint *tag; // peratom fields common to all styles - int *type,*mask; + tagint *tag; // peratom fields common to all styles + int *type, *mask; imageint *image; - double **x,**v,**f; + double **x, **v, **f; // standard list of peratom fields always operated on by different methods // common to all styles, so not listed in field strings - const char *default_grow,*default_copy; - const char *default_comm,*default_comm_vel,*default_reverse; - const char *default_border,*default_border_vel; - const char *default_exchange,*default_restart; - const char *default_create,*default_data_atom,*default_data_vel; + const char *default_grow, *default_copy; + const char *default_comm, *default_comm_vel, *default_reverse; + const char *default_border, *default_border_vel; + const char *default_exchange, *default_restart; + const char *default_create, *default_data_atom, *default_data_vel; struct Method { std::vector pdata; std::vector datatype; std::vector cols; - std::vector maxcols; + std::vector maxcols; std::vector collength; std::vector plength; std::vector index; @@ -203,13 +203,13 @@ class AtomVec : protected Pointers { void resize(int nfield); }; - Method mgrow,mcopy; - Method mcomm,mcomm_vel,mreverse,mborder,mborder_vel,mexchange,mrestart; - Method mcreate,mdata_atom,mdata_vel; + Method mgrow, mcopy; + Method mcomm, mcomm_vel, mreverse, mborder, mborder_vel, mexchange, mrestart; + Method mcreate, mdata_atom, mdata_vel; - int ngrow,ncopy; - int ncomm,ncomm_vel,nreverse,nborder,nborder_vel,nexchange,nrestart; - int ncreate,ndata_atom,ndata_vel; + int ngrow, ncopy; + int ncomm, ncomm_vel, nreverse, nborder, nborder_vel, nexchange, nrestart; + int ncreate, ndata_atom, ndata_vel; // thread info for fields that are duplicated over threads // used by fields in grow() and memory_usage() @@ -225,7 +225,7 @@ class AtomVec : protected Pointers { void init_method(int, Method *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/atom_vec_atomic.cpp b/src/atom_vec_atomic.cpp index 9535568d63..88584981f5 100644 --- a/src/atom_vec_atomic.cpp +++ b/src/atom_vec_atomic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/atom_vec_atomic.h b/src/atom_vec_atomic.h index 61f8e8f37e..c4132f8201 100644 --- a/src/atom_vec_atomic.h +++ b/src/atom_vec_atomic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(atomic,AtomVecAtomic) - +// clang-format off +AtomStyle(atomic,AtomVecAtomic); +// clang-format on #else #ifndef LMP_ATOM_VEC_ATOMIC_H @@ -30,7 +30,7 @@ class AtomVecAtomic : public AtomVec { ~AtomVecAtomic() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index 533d7975c1..4670b88af8 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -104,16 +105,18 @@ void AtomVecBody::process_args(int narg, char **arg) if (narg < 1) error->all(FLERR,"Invalid atom_style body command"); - if (0) bptr = nullptr; + if (0) { + bptr = nullptr; #define BODY_CLASS #define BodyStyle(key,Class) \ - else if (strcmp(arg[0],#key) == 0) bptr = new Class(lmp,narg,arg); + } else if (strcmp(arg[0],#key) == 0) { \ + bptr = new Class(lmp,narg,arg); #include "style_body.h" #undef BodyStyle #undef BODY_CLASS - else error->all(FLERR,utils:: + } else error->all(FLERR,utils:: check_packages_for_style("body",arg[0],lmp).c_str()); bptr->avec = this; diff --git a/src/atom_vec_body.h b/src/atom_vec_body.h index 611f8485af..3168c5d23a 100644 --- a/src/atom_vec_body.h +++ b/src/atom_vec_body.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(body,AtomVecBody) - +// clang-format off +AtomStyle(body,AtomVecBody); +// clang-format on #else #ifndef LMP_ATOM_VEC_BODY_H @@ -31,8 +31,8 @@ class AtomVecBody : public AtomVec { struct Bonus { double quat[4]; double inertia[3]; - int ninteger,ndouble; - int iindex,dindex; + int ninteger, ndouble; + int iindex, dindex; int *ivalue; double *dvalue; int ilocal; @@ -75,11 +75,11 @@ class AtomVecBody : public AtomVec { private: int *body; - double *rmass,*radius; + double *rmass, *radius; double **angmom; - int nghost_bonus,nmax_bonus; - int intdoubleratio; // sizeof(double) / sizeof(int) + int nghost_bonus, nmax_bonus; + int intdoubleratio; // sizeof(double) / sizeof(int) int body_flag; MyPoolChunk *icp; @@ -90,7 +90,7 @@ class AtomVecBody : public AtomVec { // check(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_charge.cpp b/src/atom_vec_charge.cpp index cb28dd4a58..ca66048558 100644 --- a/src/atom_vec_charge.cpp +++ b/src/atom_vec_charge.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/atom_vec_charge.h b/src/atom_vec_charge.h index 4f14d1027e..750c03e493 100644 --- a/src/atom_vec_charge.h +++ b/src/atom_vec_charge.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(charge,AtomVecCharge) - +// clang-format off +AtomStyle(charge,AtomVecCharge); +// clang-format on #else #ifndef LMP_ATOM_VEC_CHARGE_H @@ -29,7 +29,7 @@ class AtomVecCharge : public AtomVec { AtomVecCharge(class LAMMPS *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp index b4cb4616a7..38c4893f61 100644 --- a/src/atom_vec_ellipsoid.cpp +++ b/src/atom_vec_ellipsoid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/atom_vec_ellipsoid.h b/src/atom_vec_ellipsoid.h index 2f9caffb18..6a77d9886c 100644 --- a/src/atom_vec_ellipsoid.h +++ b/src/atom_vec_ellipsoid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(ellipsoid,AtomVecEllipsoid) - +// clang-format off +AtomStyle(ellipsoid,AtomVecEllipsoid); +// clang-format on #else #ifndef LMP_ATOM_VEC_ELLIPSOID_H @@ -70,7 +70,7 @@ class AtomVecEllipsoid : public AtomVec { double *rmass; double **angmom; - int nghost_bonus,nmax_bonus; + int nghost_bonus, nmax_bonus; int ellipsoid_flag; double rmass_one; @@ -78,7 +78,7 @@ class AtomVecEllipsoid : public AtomVec { void copy_bonus_all(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp index 7faa5cc145..4327420cee 100644 --- a/src/atom_vec_hybrid.cpp +++ b/src/atom_vec_hybrid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/atom_vec_hybrid.h b/src/atom_vec_hybrid.h index 9ff8ab643e..3c804a462c 100644 --- a/src/atom_vec_hybrid.h +++ b/src/atom_vec_hybrid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(hybrid,AtomVecHybrid) - +// clang-format off +AtomStyle(hybrid,AtomVecHybrid); +// clang-format on #else #ifndef LMP_ATOM_VEC_HYBRID_H @@ -82,7 +82,7 @@ class AtomVecHybrid : public AtomVec { int known_style(char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp index 696110ab77..bfc6c7e6d7 100644 --- a/src/atom_vec_line.cpp +++ b/src/atom_vec_line.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/atom_vec_line.h b/src/atom_vec_line.h index 726328a12c..176cfc0dd9 100644 --- a/src/atom_vec_line.h +++ b/src/atom_vec_line.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(line,AtomVecLine) - +// clang-format off +AtomStyle(line,AtomVecLine); +// clang-format on #else #ifndef LMP_ATOM_VEC_LINE_H @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class AtomVecLine : public AtomVec { public: struct Bonus { - double length,theta; + double length, theta; int ilocal; }; struct Bonus *bonus; @@ -67,10 +67,10 @@ class AtomVecLine : public AtomVec { private: int *line; - double *radius,*rmass; + double *radius, *rmass; double **omega; - int nghost_bonus,nmax_bonus; + int nghost_bonus, nmax_bonus; int line_flag; double rmass_one; @@ -79,7 +79,7 @@ class AtomVecLine : public AtomVec { // void consistency_check(int, char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_sphere.cpp b/src/atom_vec_sphere.cpp index 4a451b1ed6..5a69944501 100644 --- a/src/atom_vec_sphere.cpp +++ b/src/atom_vec_sphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/atom_vec_sphere.h b/src/atom_vec_sphere.h index 3a556c76f9..cf33bea364 100644 --- a/src/atom_vec_sphere.h +++ b/src/atom_vec_sphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(sphere,AtomVecSphere) - +// clang-format off +AtomStyle(sphere,AtomVecSphere); +// clang-format on #else #ifndef LMP_ATOM_VEC_SPHERE_H @@ -37,14 +37,14 @@ class AtomVecSphere : public AtomVec { void pack_data_post(int); private: - double *radius,*rmass; + double *radius, *rmass; double **omega; int radvary; - double radius_one,rmass_one; + double radius_one, rmass_one; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index 44a0986cb8..6a1cad5f5c 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/atom_vec_tri.h b/src/atom_vec_tri.h index 4f0151b2fd..36ec8d6948 100644 --- a/src/atom_vec_tri.h +++ b/src/atom_vec_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef ATOM_CLASS - -AtomStyle(tri,AtomVecTri) - +// clang-format off +AtomStyle(tri,AtomVecTri); +// clang-format on #else #ifndef LMP_ATOM_VEC_TRI_H @@ -28,7 +28,7 @@ class AtomVecTri : public AtomVec { public: struct Bonus { double quat[4]; - double c1[3],c2[3],c3[3]; + double c1[3], c2[3], c3[3]; double inertia[3]; int ilocal; }; @@ -69,10 +69,10 @@ class AtomVecTri : public AtomVec { private: int *tri; - double *radius,*rmass; - double **omega,**angmom; + double *radius, *rmass; + double **omega, **angmom; - int nghost_bonus,nmax_bonus; + int nghost_bonus, nmax_bonus; int tri_flag; double rmass_one; @@ -80,7 +80,7 @@ class AtomVecTri : public AtomVec { void copy_bonus_all(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/balance.cpp b/src/balance.cpp index 898faacb83..03ee4a8195 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/balance.h b/src/balance.h index 731dde9094..0f2df8c5ee 100644 --- a/src/balance.h +++ b/src/balance.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(balance,Balance) - +// clang-format off +CommandStyle(balance,Balance); +// clang-format on #else #ifndef LMP_BALANCE_H @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class Balance : public Command { public: class RCB *rcb; - class FixStore *fixstore; // per-atom weights stored in FixStore - int wtflag; // 1 if particle weighting is used - int varflag; // 1 if weight style var(iable) is used - int outflag; // 1 for output of balance results to file + class FixStore *fixstore; // per-atom weights stored in FixStore + int wtflag; // 1 if particle weighting is used + int varflag; // 1 if weight style var(iable) is used + int outflag; // 1 for output of balance results to file Balance(class LAMMPS *); ~Balance(); @@ -46,38 +46,38 @@ class Balance : public Command { void dumpout(bigint); private: - int me,nprocs; + int me, nprocs; - double thresh; // threshold to perform LB - int style; // style of LB - int xflag,yflag,zflag; // xyz LB flags - double *user_xsplit,*user_ysplit,*user_zsplit; // params for xyz LB - int oldrcb; // use old-style RCB compute + double thresh; // threshold to perform LB + int style; // style of LB + int xflag, yflag, zflag; // xyz LB flags + double *user_xsplit, *user_ysplit, *user_zsplit; // params for xyz LB + int oldrcb; // use old-style RCB compute - int nitermax; // params for shift LB + int nitermax; // params for shift LB double stopthresh; char bstr[4]; - int shift_allocate; // 1 if SHIFT vectors have been allocated - int ndim; // length of balance string bstr - int *bdim; // XYZ for each character in bstr - double *onecost; // work vector of counts in one dim - double *allcost; // counts for slices in one dim - double *sum; // cumulative count for slices in one dim - double *target; // target sum for slices in one dim - double *lo,*hi; // lo/hi split coords that bound each target - double *losum,*hisum; // cumulative counts at lo/hi coords - int rho; // 0 for geometric recursion - // 1 for density weighted recursion + int shift_allocate; // 1 if SHIFT vectors have been allocated + int ndim; // length of balance string bstr + int *bdim; // XYZ for each character in bstr + double *onecost; // work vector of counts in one dim + double *allcost; // counts for slices in one dim + double *sum; // cumulative count for slices in one dim + double *target; // target sum for slices in one dim + double *lo, *hi; // lo/hi split coords that bound each target + double *losum, *hisum; // cumulative counts at lo/hi coords + int rho; // 0 for geometric recursion + // 1 for density weighted recursion - double *proccost; // particle cost per processor - double *allproccost; // proccost summed across procs + double *proccost; // particle cost per processor + double *allproccost; // proccost summed across procs - int nimbalance; // number of user-specified weight styles - class Imbalance **imbalances; // list of Imb classes, one per weight style - double *weight; // ptr to FixStore weight vector + int nimbalance; // number of user-specified weight styles + class Imbalance **imbalances; // list of Imb classes, one per weight style + double *weight; // ptr to FixStore weight vector - FILE *fp; // balance output file + FILE *fp; // balance output file int firststep; double imbalance_splits(); @@ -90,7 +90,7 @@ class Balance : public Command { #endif }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/body.cpp b/src/body.cpp index 2c4121b0cc..51b2672040 100644 --- a/src/body.cpp +++ b/src/body.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/body.h b/src/body.h index 72e66a3a15..27832d2eda 100644 --- a/src/body.h +++ b/src/body.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,8 +14,8 @@ #ifndef LMP_BODY_H #define LMP_BODY_H +#include "atom_vec_body.h" // IWYU pragma: keep #include "pointers.h" -#include "atom_vec_body.h" // IWYU pragma: keep namespace LAMMPS_NS { @@ -25,24 +25,23 @@ class Body : protected Pointers { MyPoolChunk *dcp; char *style; - int size_forward; // max extra values packed for comm - int size_border; // max extra values packed for border comm - int maxexchange; // max size of exchanged atom + int size_forward; // max extra values packed for comm + int size_border; // max extra values packed for border comm + int maxexchange; // max size of exchanged atom - AtomVecBody *avec; // ptr to class that stores body bonus info + AtomVecBody *avec; // ptr to class that stores body bonus info Body(class LAMMPS *, int, char **); virtual ~Body(); // methods implemented by child classes - virtual int pack_comm_body(struct AtomVecBody::Bonus *, double *) {return 0;} - virtual int unpack_comm_body(struct AtomVecBody::Bonus *, double *) {return 0;} - virtual int pack_border_body(struct AtomVecBody::Bonus *, double *) {return 0;} - virtual int unpack_border_body(struct AtomVecBody::Bonus *, - double *) {return 0;} + virtual int pack_comm_body(struct AtomVecBody::Bonus *, double *) { return 0; } + virtual int unpack_comm_body(struct AtomVecBody::Bonus *, double *) { return 0; } + virtual int pack_border_body(struct AtomVecBody::Bonus *, double *) { return 0; } + virtual int unpack_border_body(struct AtomVecBody::Bonus *, double *) { return 0; } - virtual void data_body(int, int, int, int*, double *) = 0; + virtual void data_body(int, int, int, int *, double *) = 0; virtual int pack_data_body(tagint, int, double *) = 0; virtual int write_data_body(FILE *, double *) = 0; @@ -51,10 +50,10 @@ class Body : protected Pointers { virtual void output(int, int, double *) = 0; virtual int image(int, double, double, int *&, double **&) = 0; - virtual double radius_body(int, int, int *, double *) {return 0.0;} + virtual double radius_body(int, int, int *, double *) { return 0.0; } }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/bond.cpp b/src/bond.cpp index 22a7b27eda..cc13ad6b86 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/bond.h b/src/bond.h index e148113ea9..b2b2008b9e 100644 --- a/src/bond.h +++ b/src/bond.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,27 +14,28 @@ #ifndef LMP_BOND_H #define LMP_BOND_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Bond : protected Pointers { friend class ThrOMP; friend class FixOMP; + public: int allocated; int *setflag; - 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 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 reinitflag; // 1 if compatible with fix adapt and alike + int reinitflag; // 1 if compatible with fix adapt and alike // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; int copymode; Bond(class LAMMPS *); @@ -47,33 +48,37 @@ class Bond : protected Pointers { virtual double equilibrium_distance(int) = 0; virtual void write_restart(FILE *) = 0; virtual void read_restart(FILE *) = 0; - virtual void write_restart_settings(FILE *) {}; - virtual void read_restart_settings(FILE *) {}; + virtual void write_restart_settings(FILE *){}; + virtual void read_restart_settings(FILE *){}; virtual void write_data(FILE *) {} virtual double single(int, double, int, int, double &) = 0; virtual double memory_usage(); - virtual void *extract(const char *, int &) {return nullptr;} + virtual void *extract(const char *, int &) { return nullptr; } virtual void reinit(); - void write_file(int, char**); + void write_file(int, char **); protected: - int suffix_flag; // suffix compatibility flag + int suffix_flag; // suffix compatibility flag int evflag; - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom; - int maxeatom,maxvatom; + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom; + int maxeatom, maxvatom; - void ev_init(int eflag, int vflag, int alloc = 1) { - if (eflag||vflag) ev_setup(eflag, vflag, alloc); - else evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = 0; + void ev_init(int eflag, int vflag, int alloc = 1) + { + if (eflag || vflag) + ev_setup(eflag, vflag, alloc); + else + evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = + 0; } void ev_setup(int, int, int alloc = 1); void ev_tally(int, int, int, int, double, double, double, double, double); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/bond_deprecated.cpp b/src/bond_deprecated.cpp index 0c7fe6ed8b..4f5ec58071 100644 --- a/src/bond_deprecated.cpp +++ b/src/bond_deprecated.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/bond_deprecated.h b/src/bond_deprecated.h index 64fb74e545..43f58da093 100644 --- a/src/bond_deprecated.h +++ b/src/bond_deprecated.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(DEPRECATED,BondDeprecated) - +// clang-format off +BondStyle(DEPRECATED,BondDeprecated); +// clang-format on #else #ifndef LMP_BOND_DEPRECATED_H @@ -38,7 +38,7 @@ class BondDeprecated : public Bond { virtual double single(int, double, int, int, double &) { return 0.0; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp index 3a316d995d..920c251f55 100644 --- a/src/bond_hybrid.cpp +++ b/src/bond_hybrid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/bond_hybrid.h b/src/bond_hybrid.h index 5a53ab47df..d5e059b317 100644 --- a/src/bond_hybrid.h +++ b/src/bond_hybrid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(hybrid,BondHybrid) - +// clang-format off +BondStyle(hybrid,BondHybrid); +// clang-format on #else #ifndef LMP_BOND_HYBRID_H @@ -28,9 +28,9 @@ class BondHybrid : public Bond { friend class Force; public: - int nstyles; // # of different bond styles - Bond **styles; // class list for each Bond style - char **keywords; // keyword for each Bond style + int nstyles; // # of different bond styles + Bond **styles; // class list for each Bond style + char **keywords; // keyword for each Bond style BondHybrid(class LAMMPS *); ~BondHybrid(); @@ -45,16 +45,16 @@ class BondHybrid : public Bond { double memory_usage(); private: - int *map; // which style each bond type points to - int has_quartic; // which style, if any is a quartic bond style - int *nbondlist; // # of bonds in sub-style bondlists - int *maxbond; // max # of bonds sub-style lists can store - int ***bondlist; // bondlist for each sub-style + int *map; // which style each bond type points to + int has_quartic; // which style, if any is a quartic bond style + int *nbondlist; // # of bonds in sub-style bondlists + int *maxbond; // max # of bonds sub-style lists can store + int ***bondlist; // bondlist for each sub-style void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/bond_zero.cpp b/src/bond_zero.cpp index fa124a49ae..3307831331 100644 --- a/src/bond_zero.cpp +++ b/src/bond_zero.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/bond_zero.h b/src/bond_zero.h index fdd16d3561..c8ed3a666e 100644 --- a/src/bond_zero.h +++ b/src/bond_zero.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef BOND_CLASS - -BondStyle(zero,BondZero) - +// clang-format off +BondStyle(zero,BondZero); +// clang-format on #else #ifndef LMP_BOND_ZERO_H @@ -47,7 +47,7 @@ class BondZero : public Bond { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/change_box.cpp b/src/change_box.cpp index d57ce3e640..91d65bfcad 100644 --- a/src/change_box.cpp +++ b/src/change_box.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/change_box.h b/src/change_box.h index 9527260aa9..cfa3a2f3e1 100644 --- a/src/change_box.h +++ b/src/change_box.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(change_box,ChangeBox) - +// clang-format off +CommandStyle(change_box,ChangeBox); +// clang-format on #else #ifndef LMP_CHANGE_BOX_H @@ -34,25 +34,25 @@ class ChangeBox : public Command { double scale[3]; struct Operation { - int style,flavor; - int dim,boundindex; - int vdim1,vdim2; - double flo,fhi,ftilt; - double dlo,dhi,dtilt; + int style, flavor; + int dim, boundindex; + int vdim1, vdim2; + double flo, fhi, ftilt; + double dlo, dhi, dtilt; double scale; }; Operation *ops; int nops; - double boxlo[3],h_inv[6]; + double boxlo[3], h_inv[6]; void options(int, char **); void save_box_state(); void volume_preserve(int, int, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/citeme.cpp b/src/citeme.cpp index b8a1d656d9..35ff062874 100644 --- a/src/citeme.cpp +++ b/src/citeme.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/citeme.h b/src/citeme.h index 4694b5b783..8f0e6c4bca 100644 --- a/src/citeme.h +++ b/src/citeme.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,21 +23,21 @@ class CiteMe : protected Pointers { public: CiteMe(class LAMMPS *, int, int, const char *); virtual ~CiteMe(); - void add(const std::string &); // register publication for output - void flush(); // flush buffers to screen and logfile - enum {VERBOSE, TERSE}; + void add(const std::string &); // register publication for output + void flush(); // flush buffers to screen and logfile + enum { VERBOSE, TERSE }; private: - FILE *fp; // explicit citation file pointer or NULL - std::string citefile; // name of the explicit citation file. - int screen_flag; // determine whether verbose or terse output - int logfile_flag; // determine whether verbose or terse output - std::string scrbuffer; // output buffer for screen - std::string logbuffer; // output buffer for logfile + FILE *fp; // explicit citation file pointer or NULL + std::string citefile; // name of the explicit citation file. + int screen_flag; // determine whether verbose or terse output + int logfile_flag; // determine whether verbose or terse output + std::string scrbuffer; // output buffer for screen + std::string logbuffer; // output buffer for logfile typedef std::set citeset; - citeset *cs; // registered set of publications + citeset *cs; // registered set of publications }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/comm.cpp b/src/comm.cpp index 650c39bac3..2dddba11c2 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/comm.h b/src/comm.h index df016c0b72..e7c07522a9 100644 --- a/src/comm.h +++ b/src/comm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,7 +14,7 @@ #ifndef LMP_COMM_H #define LMP_COMM_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { @@ -24,41 +24,41 @@ class Comm : protected Pointers { int layout; // LAYOUT_UNIFORM = equal-sized bricks // LAYOUT_NONUNIFORM = logical bricks, but diff sizes via LB // LAYOUT_TILED = general tiling, due to RCB LB - enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; - int mode; // 0 = single cutoff, 1 = multi-collection cutoff, 2 = multiold-type cutoff - enum{SINGLE,MULTI,MULTIOLD}; + enum { LAYOUT_UNIFORM, LAYOUT_NONUNIFORM, LAYOUT_TILED }; + int mode; // 0 = single cutoff, 1 = multi-collection cutoff, 2 = multiold-type cutoff + enum { SINGLE, MULTI, MULTIOLD }; - int me,nprocs; // proc info - int ghost_velocity; // 1 if ghost atoms have velocity, 0 if not - double cutghost[3]; // cutoffs used for acquiring ghost atoms - double cutghostuser; // user-specified ghost cutoff (mode == SINGLE) - double *cutusermulti; // per collection user ghost cutoff (mode == MULTI) - double *cutusermultiold; // per type user ghost cutoff (mode == MULTIOLD) - int ncollections; // # of collections known by comm, used to test if # has changed - int ncollections_cutoff; // # of collections stored b cutoff/multi - int recv_from_partition; // recv proc layout from this partition - int send_to_partition; // send my proc layout to this partition - // -1 if no recv or send - int other_partition_style; // 0 = recv layout dims must be multiple of - // my layout dims + int me, nprocs; // proc info + int ghost_velocity; // 1 if ghost atoms have velocity, 0 if not + double cutghost[3]; // cutoffs used for acquiring ghost atoms + double cutghostuser; // user-specified ghost cutoff (mode == SINGLE) + double *cutusermulti; // per collection user ghost cutoff (mode == MULTI) + double *cutusermultiold; // per type user ghost cutoff (mode == MULTIOLD) + int ncollections; // # of collections known by comm, used to test if # has changed + int ncollections_cutoff; // # of collections stored b cutoff/multi + int recv_from_partition; // recv proc layout from this partition + int send_to_partition; // send my proc layout to this partition + // -1 if no recv or send + int other_partition_style; // 0 = recv layout dims must be multiple of + // my layout dims - int nthreads; // OpenMP threads per MPI process + int nthreads; // OpenMP threads per MPI process // public settings specific to layout = UNIFORM, NONUNIFORM - int procgrid[3]; // procs assigned in each dim of 3d grid - int user_procgrid[3]; // user request for procs in each dim - int myloc[3]; // which proc I am in each dim - int procneigh[3][2]; // my 6 neighboring procs, 0/1 = left/right - double *xsplit,*ysplit,*zsplit; // fractional (0-1) sub-domain sizes - int ***grid2proc; // which proc owns i,j,k loc in 3d grid + int procgrid[3]; // procs assigned in each dim of 3d grid + int user_procgrid[3]; // user request for procs in each dim + int myloc[3]; // which proc I am in each dim + int procneigh[3][2]; // my 6 neighboring procs, 0/1 = left/right + double *xsplit, *ysplit, *zsplit; // fractional (0-1) sub-domain sizes + int ***grid2proc; // which proc owns i,j,k loc in 3d grid // public settings specific to layout = TILED - int rcbnew; // 1 if just reset by rebalance, else 0 - double mysplit[3][2]; // fractional (0-1) bounds of my sub-domain - double rcbcutfrac; // fractional RCB cut by this proc - int rcbcutdim; // dimension of RCB cut + int rcbnew; // 1 if just reset by rebalance, else 0 + double mysplit[3][2]; // fractional (0-1) bounds of my sub-domain + double rcbcutfrac; // fractional RCB cut by this proc + int rcbcutdim; // dimension of RCB cut // methods @@ -69,23 +69,23 @@ class Comm : protected Pointers { virtual void init(); void modify_params(int, char **); - void set_processors(int, char **); // set 3d processor grid attributes - virtual void set_proc_grid(int outflag = 1); // setup 3d grid of procs + void set_processors(int, char **); // set 3d processor grid attributes + virtual void set_proc_grid(int outflag = 1); // setup 3d grid of procs - double get_comm_cutoff(); // determine communication cutoff + double get_comm_cutoff(); // determine communication cutoff - virtual void setup() = 0; // setup 3d comm pattern - virtual void forward_comm(int dummy = 0) = 0; // forward comm of atom coords - virtual void reverse_comm() = 0; // reverse comm of forces - virtual void exchange() = 0; // move atoms to new procs - virtual void borders() = 0; // setup list of atoms to comm + virtual void setup() = 0; // setup 3d comm pattern + virtual void forward_comm(int dummy = 0) = 0; // forward comm of atom coords + virtual void reverse_comm() = 0; // reverse comm of forces + 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 virtual void forward_comm_pair(class Pair *) = 0; virtual void reverse_comm_pair(class Pair *) = 0; - virtual void forward_comm_fix(class Fix *, int size=0) = 0; - virtual void reverse_comm_fix(class Fix *, int size=0) = 0; + virtual void forward_comm_fix(class Fix *, int size = 0) = 0; + virtual void reverse_comm_fix(class Fix *, int size = 0) = 0; virtual void reverse_comm_fix_variable(class Fix *) = 0; virtual void forward_comm_compute(class Compute *) = 0; virtual void reverse_comm_compute(class Compute *) = 0; @@ -111,63 +111,61 @@ class Comm : protected Pointers { // non-virtual functions common to all Comm styles - void ring(int, int, void *, int, void (*)(int, char *, void *), - void *, void *, int self = 1); + void ring(int, int, void *, int, void (*)(int, char *, void *), void *, void *, int self = 1); int rendezvous(int, int, char *, int, int, int *, - int (*)(int, char *, int &, int *&, char *&, void *), - int, char *&, int, void *, int statflag=0); + int (*)(int, char *, int &, int *&, char *&, void *), int, char *&, int, void *, + int statflag = 0); // extract data useful to other classes - virtual void *extract(const char *, int &) {return nullptr;} + virtual void *extract(const char *, int &) { return nullptr; } protected: - int bordergroup; // only communicate this group in borders + int bordergroup; // only communicate this group in borders - int triclinic; // 0 if domain is orthog, 1 if triclinic - int map_style; // non-0 if global->local mapping is done - int comm_x_only,comm_f_only; // 1 if only exchange x,f in for/rev comm + int triclinic; // 0 if domain is orthog, 1 if triclinic + int map_style; // non-0 if global->local mapping is done + int comm_x_only, comm_f_only; // 1 if only exchange x,f in for/rev comm - int size_forward; // # of per-atom datums in forward comm - int size_reverse; // # of datums in reverse comm - int size_border; // # of datums in forward border comm + int size_forward; // # of per-atom datums in forward comm + int size_reverse; // # of datums in reverse comm + int size_border; // # of datums in forward border comm - int maxforward,maxreverse; // max # of datums in forward/reverse comm - int maxexchange; // max size of one exchanged atom - int maxexchange_atom; // contribution to maxexchange from AtomVec - int maxexchange_fix; // static contribution to maxexchange from Fixes - int maxexchange_fix_dynamic; // 1 if a fix has a dynamic contribution - int bufextra; // augment send buf size for an exchange atom + int maxforward, maxreverse; // max # of datums in forward/reverse comm + int maxexchange; // max size of one exchanged atom + int maxexchange_atom; // contribution to maxexchange from AtomVec + int maxexchange_fix; // static contribution to maxexchange from Fixes + int maxexchange_fix_dynamic; // 1 if a fix has a dynamic contribution + int bufextra; // augment send buf size for an exchange atom + int gridflag; // option for creating 3d grid + int mapflag; // option for mapping procs to 3d grid + char xyz[4]; // xyz mapping of procs to 3d grid + char *customfile; // file with custom proc map + char *outfile; // proc grid/map output file - int gridflag; // option for creating 3d grid - int mapflag; // option for mapping procs to 3d grid - char xyz[4]; // xyz mapping of procs to 3d grid - char *customfile; // file with custom proc map - char *outfile; // proc grid/map output file - - int otherflag; // 1 if this partition dependent on another - int other_style; // style of dependency - int other_procgrid[3]; // proc layout of another partition - int other_coregrid[3]; // core layout of another partition - int ncores; // # of cores per node - int coregrid[3]; // 3d grid of cores within a node - int user_coregrid[3]; // user request for cores in each dim - int multi_reduce; // 1 if multi cutoff is intra-collection cutoff + int otherflag; // 1 if this partition dependent on another + int other_style; // style of dependency + int other_procgrid[3]; // proc layout of another partition + int other_coregrid[3]; // core layout of another partition + int ncores; // # of cores per node + int coregrid[3]; // 3d grid of cores within a node + int user_coregrid[3]; // user request for cores in each dim + int multi_reduce; // 1 if multi cutoff is intra-collection cutoff void init_exchange(); int rendezvous_irregular(int, char *, int, int, int *, - int (*)(int, char *, int &, int *&, char *&, void *), - int, char *&, int, void *, int); + int (*)(int, char *, int &, int *&, char *&, void *), int, char *&, int, + void *, int); int rendezvous_all2all(int, char *, int, int, int *, - int (*)(int, char *, int &, int *&, char *&, void *), - int, char *&, int, void *, int); + int (*)(int, char *, int &, int *&, char *&, void *), int, char *&, int, + void *, int); void rendezvous_stats(int, int, int, int, int, int, bigint); public: - enum{MULTIPLE}; + enum { MULTIPLE }; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/comm_brick.cpp b/src/comm_brick.cpp index 3d80bfceb0..ab1b27f1b2 100644 --- a/src/comm_brick.cpp +++ b/src/comm_brick.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/comm_brick.h b/src/comm_brick.h index aa75966249..9ff177837d 100644 --- a/src/comm_brick.h +++ b/src/comm_brick.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -33,69 +33,69 @@ class CommBrick : public Comm { virtual void forward_comm_pair(class Pair *); // forward comm from a Pair virtual void reverse_comm_pair(class Pair *); // reverse comm from a Pair - virtual void forward_comm_fix(class Fix *, int size=0); - // forward comm from a Fix - virtual void reverse_comm_fix(class Fix *, int size=0); - // reverse comm from a Fix + virtual void forward_comm_fix(class Fix *, int size = 0); + // forward comm from a Fix + virtual void reverse_comm_fix(class Fix *, int size = 0); + // reverse comm from a Fix virtual void reverse_comm_fix_variable(class Fix *); - // variable size reverse comm from a Fix - virtual void forward_comm_compute(class Compute *); // forward from a Compute - virtual void reverse_comm_compute(class Compute *); // reverse from a Compute - virtual void forward_comm_dump(class Dump *); // forward comm from a Dump - virtual void reverse_comm_dump(class Dump *); // reverse comm from a Dump + // variable size reverse comm from a Fix + virtual void forward_comm_compute(class Compute *); // forward from a Compute + virtual void reverse_comm_compute(class Compute *); // reverse from a Compute + virtual void forward_comm_dump(class Dump *); // forward comm from a Dump + virtual void reverse_comm_dump(class Dump *); // reverse comm from a Dump - void forward_comm_array(int, double **); // forward comm of array - int exchange_variable(int, double *, double *&); // exchange on neigh stencil - void *extract(const char *,int &); + void forward_comm_array(int, double **); // forward comm of array + int exchange_variable(int, double *, double *&); // exchange on neigh stencil + void *extract(const char *, int &); virtual double memory_usage(); protected: - int nswap; // # of swaps to perform = sum of maxneed - int recvneed[3][2]; // # of procs away I recv atoms from - int sendneed[3][2]; // # of procs away I send atoms to - int maxneed[3]; // max procs away any proc needs, per dim - int maxswap; // max # of swaps memory is allocated for - int *sendnum,*recvnum; // # of atoms to send/recv in each swap - int *sendproc,*recvproc; // proc to send/recv to/from at each swap - int *size_forward_recv; // # of values to recv in each forward comm - int *size_reverse_send; // # to send in each reverse comm - int *size_reverse_recv; // # to recv in each reverse comm - double *slablo,*slabhi; // bounds of slab to send at each swap - double **multilo,**multihi; // bounds of slabs for multi-collection swap - double **multioldlo,**multioldhi; // bounds of slabs for multi-type swap - double **cutghostmulti; // cutghost on a per-collection basis - double **cutghostmultiold; // cutghost on a per-type basis - int *pbc_flag; // general flag for sending atoms thru PBC - int **pbc; // dimension flags for PBC adjustments + int nswap; // # of swaps to perform = sum of maxneed + int recvneed[3][2]; // # of procs away I recv atoms from + int sendneed[3][2]; // # of procs away I send atoms to + int maxneed[3]; // max procs away any proc needs, per dim + int maxswap; // max # of swaps memory is allocated for + int *sendnum, *recvnum; // # of atoms to send/recv in each swap + int *sendproc, *recvproc; // proc to send/recv to/from at each swap + int *size_forward_recv; // # of values to recv in each forward comm + int *size_reverse_send; // # to send in each reverse comm + int *size_reverse_recv; // # to recv in each reverse comm + double *slablo, *slabhi; // bounds of slab to send at each swap + double **multilo, **multihi; // bounds of slabs for multi-collection swap + double **multioldlo, **multioldhi; // bounds of slabs for multi-type swap + double **cutghostmulti; // cutghost on a per-collection basis + double **cutghostmultiold; // cutghost on a per-type basis + int *pbc_flag; // general flag for sending atoms thru PBC + int **pbc; // dimension flags for PBC adjustments - int *firstrecv; // where to put 1st recv atom in each swap - int **sendlist; // list of atoms to send in each swap - int *localsendlist; // indexed list of local sendlist atoms - int *maxsendlist; // max size of send list for each swap + int *firstrecv; // where to put 1st recv atom in each swap + int **sendlist; // list of atoms to send in each swap + int *localsendlist; // indexed list of local sendlist atoms + int *maxsendlist; // max size of send list for each swap - double *buf_send; // send buffer for all comm - double *buf_recv; // recv buffer for all comm - int maxsend,maxrecv; // current size of send/recv buffer - int smax,rmax; // max size in atoms of single borders send/recv + double *buf_send; // send buffer for all comm + double *buf_recv; // recv buffer for all comm + int maxsend, maxrecv; // current size of send/recv buffer + int smax, rmax; // max size in atoms of single borders send/recv // NOTE: init_buffers is called from a constructor and must not be made virtual void init_buffers(); int updown(int, int, int, double, int, double *); - // compare cutoff to procs - virtual void grow_send(int, int); // reallocate send buffer - virtual void grow_recv(int); // free/allocate recv buffer - virtual void grow_list(int, int); // reallocate one sendlist - virtual void grow_swap(int); // grow swap, multi, and multi/old arrays - virtual void allocate_swap(int); // allocate swap arrays - virtual void allocate_multi(int); // allocate multi arrays - virtual void allocate_multiold(int); // allocate multi/old arrays - virtual void free_swap(); // free swap arrays - virtual void free_multi(); // free multi arrays - virtual void free_multiold(); // free multi/old arrays + // compare cutoff to procs + virtual void grow_send(int, int); // reallocate send buffer + virtual void grow_recv(int); // free/allocate recv buffer + virtual void grow_list(int, int); // reallocate one sendlist + virtual void grow_swap(int); // grow swap, multi, and multi/old arrays + virtual void allocate_swap(int); // allocate swap arrays + virtual void allocate_multi(int); // allocate multi arrays + virtual void allocate_multiold(int); // allocate multi/old arrays + virtual void free_swap(); // free swap arrays + virtual void free_multi(); // free multi arrays + virtual void free_multiold(); // free multi/old arrays }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/comm_tiled.cpp b/src/comm_tiled.cpp index d5c2244424..e9175094f8 100644 --- a/src/comm_tiled.cpp +++ b/src/comm_tiled.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/comm_tiled.h b/src/comm_tiled.h index ed492f4a45..75109e097d 100644 --- a/src/comm_tiled.h +++ b/src/comm_tiled.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -25,7 +25,7 @@ class CommTiled : public Comm { virtual ~CommTiled(); void init(); - void setup(); // setup comm pattern + void setup(); // setup comm pattern virtual void forward_comm(int dummy = 0); // forward comm of atom coords virtual void reverse_comm(); // reverse comm of forces virtual void exchange(); // move atoms to new procs @@ -33,19 +33,19 @@ class CommTiled : public Comm { virtual void forward_comm_pair(class Pair *); // forward comm from a Pair virtual void reverse_comm_pair(class Pair *); // reverse comm from a Pair - virtual void forward_comm_fix(class Fix *, int size=0); - // forward comm from a Fix - virtual void reverse_comm_fix(class Fix *, int size=0); - // reverse comm from a Fix + virtual void forward_comm_fix(class Fix *, int size = 0); + // forward comm from a Fix + virtual void reverse_comm_fix(class Fix *, int size = 0); + // reverse comm from a Fix virtual void reverse_comm_fix_variable(class Fix *); - // variable size reverse comm from a Fix - virtual void forward_comm_compute(class Compute *); // forward from a Compute - virtual void reverse_comm_compute(class Compute *); // reverse from a Compute - virtual void forward_comm_dump(class Dump *); // forward comm from a Dump - virtual void reverse_comm_dump(class Dump *); // reverse comm from a Dump + // variable size reverse comm from a Fix + virtual void forward_comm_compute(class Compute *); // forward from a Compute + virtual void reverse_comm_compute(class Compute *); // reverse from a Compute + virtual void forward_comm_dump(class Dump *); // forward comm from a Dump + virtual void reverse_comm_dump(class Dump *); // reverse comm from a Dump - virtual void forward_comm_array(int, double **); // forward comm of array - virtual int exchange_variable(int, double *, double *&); // exchange on neigh stencil + virtual void forward_comm_array(int, double **); // forward comm of array + virtual int exchange_variable(int, double *, double *&); // exchange on neigh stencil void coord2proc_setup(); int coord2proc(double *, int &, int &, int &); @@ -53,69 +53,69 @@ class CommTiled : public Comm { double memory_usage(); private: - int nswap; // # of swaps to perform = 2*dim - int maxswap; // largest nswap can be = 6 + int nswap; // # of swaps to perform = 2*dim + int maxswap; // largest nswap can be = 6 // forward/reverse comm info, proc lists include self - int *nsendproc,*nrecvproc; // # of procs to send/recv to/from per swap - int *sendother,*recvother; // 1 if send/recv to/from other proc per swap - int *sendself; // 1 if send to self per swap - int *nprocmax; // current max # of send procs per swap - int **sendproc,**recvproc; // procs to send/recv to/from per swap - int **sendnum,**recvnum; // # of atoms to send/recv per swap/proc - int **size_forward_recv; // # of values to recv in each forward swap/proc - int **firstrecv; // where to put 1st recv atom per swap/proc - int **size_reverse_send; // # of values to send in each reverse swap/proc - int **size_reverse_recv; // # of values to recv in each reverse swap/proc - int **forward_recv_offset; // forward comm offsets in buf_recv per swap/proc - int **reverse_recv_offset; // reverse comm offsets in buf_recv per swap/proc - int ***sendlist; // list of atoms to send per swap/proc - int **maxsendlist; // max size of send list per swap/proc - int **pbc_flag; // general flag for sending atoms thru PBC - int ***pbc; // dimension flags for PBC adjustments + int *nsendproc, *nrecvproc; // # of procs to send/recv to/from per swap + int *sendother, *recvother; // 1 if send/recv to/from other proc per swap + int *sendself; // 1 if send to self per swap + int *nprocmax; // current max # of send procs per swap + int **sendproc, **recvproc; // procs to send/recv to/from per swap + int **sendnum, **recvnum; // # of atoms to send/recv per swap/proc + int **size_forward_recv; // # of values to recv in each forward swap/proc + int **firstrecv; // where to put 1st recv atom per swap/proc + int **size_reverse_send; // # of values to send in each reverse swap/proc + int **size_reverse_recv; // # of values to recv in each reverse swap/proc + int **forward_recv_offset; // forward comm offsets in buf_recv per swap/proc + int **reverse_recv_offset; // reverse comm offsets in buf_recv per swap/proc + int ***sendlist; // list of atoms to send per swap/proc + int **maxsendlist; // max size of send list per swap/proc + int **pbc_flag; // general flag for sending atoms thru PBC + int ***pbc; // dimension flags for PBC adjustments - double ***sendbox; // bounding box of atoms to send per swap/proc + double ***sendbox; // bounding box of atoms to send per swap/proc - double **cutghostmulti; // cutghost on a per-collection basis - double **cutghostmultiold; // cutghost on a per-type basis - double ****sendbox_multi; // bounding box of atoms to send - // per swap/proc for multi comm - double ****sendbox_multiold; // bounding box of atoms to send - // per swap/proc for multi/old comm + double **cutghostmulti; // cutghost on a per-collection basis + double **cutghostmultiold; // cutghost on a per-type basis + double ****sendbox_multi; // bounding box of atoms to send + // per swap/proc for multi comm + double ****sendbox_multiold; // bounding box of atoms to send + // per swap/proc for multi/old comm // exchange comm info, proc lists do not include self - int *nexchproc; // # of procs to send/recv to/from in each dim - int *nexchprocmax; // current max # of exch procs for each dim - int **exchproc; // procs to exchange with per dim - int **exchnum; // # of values received per dim/proc + int *nexchproc; // # of procs to send/recv to/from in each dim + int *nexchprocmax; // current max # of exch procs for each dim + int **exchproc; // procs to exchange with per dim + int **exchnum; // # of values received per dim/proc - double *buf_send; // send buffer for all comm - double *buf_recv; // recv buffer for all comm - int maxsend,maxrecv; // current size of send/recv buffer - int smaxone,rmaxone; // max size in atoms of single borders send/recv - int smaxall,rmaxall; // max size in atoms of any borders send/recv - // for comm to all procs in one swap + double *buf_send; // send buffer for all comm + double *buf_recv; // recv buffer for all comm + int maxsend, maxrecv; // current size of send/recv buffer + int smaxone, rmaxone; // max size in atoms of single borders send/recv + int smaxall, rmaxall; // max size in atoms of any borders send/recv + // for comm to all procs in one swap - int maxrequest; // max size of Request vector + int maxrequest; // max size of Request vector MPI_Request *requests; struct RCBinfo { - double mysplit[3][2]; // fractional RCB bounding box for one proc - double cutfrac; // fractional position of cut this proc owns - int dim; // dimension = 0/1/2 of cut + double mysplit[3][2]; // fractional RCB bounding box for one proc + double cutfrac; // fractional position of cut this proc owns + int dim; // dimension = 0/1/2 of cut }; - RCBinfo *rcbinfo; // list of RCB info for all procs + RCBinfo *rcbinfo; // list of RCB info for all procs - int noverlap; // # of overlapping procs - int maxoverlap; // current max length of overlap - int *overlap; // list of overlapping procs + int noverlap; // # of overlapping procs + int maxoverlap; // current max length of overlap + int *overlap; // list of overlapping procs - double *prd; // local ptrs to Domain attributes - double *boxlo,*boxhi; - double *sublo,*subhi; + double *prd; // local ptrs to Domain attributes + double *boxlo, *boxhi; + double *sublo, *subhi; int dimension; // NOTE: init_buffers is called from a constructor and must not be made virtual @@ -146,18 +146,17 @@ class CommTiled : public Comm { int point_drop_tiled_recurse(double *, int, int); int closer_subbox_edge(int, double *); - void grow_send(int, int); // reallocate send buffer - void grow_recv(int); // free/allocate recv buffer - void grow_list(int, int, int); // reallocate sendlist for one swap/proc - void allocate_swap(int); // allocate swap arrays - void grow_swap_send(int, int, int); // grow swap arrays for send and recv - void grow_swap_send_multi(int, int); // grow multi swap arrays for send and recv + void grow_send(int, int); // reallocate send buffer + void grow_recv(int); // free/allocate recv buffer + void grow_list(int, int, int); // reallocate sendlist for one swap/proc + void allocate_swap(int); // allocate swap arrays + void grow_swap_send(int, int, int); // grow swap arrays for send and recv + void grow_swap_send_multi(int, int); // grow multi swap arrays for send and recv void grow_swap_recv(int, int); - void deallocate_swap(int); // deallocate swap arrays - + void deallocate_swap(int); // deallocate swap arrays }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/command.h b/src/command.h index 169fbc0c92..5e5f9d45bd 100644 --- a/src/command.h +++ b/src/command.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,10 +20,10 @@ namespace LAMMPS_NS { class Command : protected Pointers { public: - Command(class LAMMPS *lmp) : Pointers(lmp) {}; + Command(class LAMMPS *lmp) : Pointers(lmp){}; virtual void command(int, char **) = 0; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/compute.cpp b/src/compute.cpp index 46bd0d0fc8..76a953484b 100644 --- a/src/compute.cpp +++ b/src/compute.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute.h b/src/compute.h index f0af428610..05fded9b44 100644 --- a/src/compute.h +++ b/src/compute.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,12 +14,13 @@ #ifndef LMP_COMPUTE_H #define LMP_COMPUTE_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Compute : protected Pointers { public: + // clang-format off enum { INVOKED_NONE = 0, INVOKED_SCALAR = 1<<0, @@ -28,78 +29,79 @@ class Compute : protected Pointers { INVOKED_PERATOM = 1<<3, INVOKED_LOCAL = 1<<4, }; - static int instance_total; // # of Compute classes ever instantiated + // clang-format on + static int instance_total; // # of Compute classes ever instantiated - char *id,*style; - int igroup,groupbit; + char *id, *style; + int igroup, groupbit; - double scalar; // computed global scalar - double *vector; // computed global vector - double **array; // computed global array - double *vector_atom; // computed per-atom vector - double **array_atom; // computed per-atom array - double *vector_local; // computed local vector - double **array_local; // computed local array + double scalar; // computed global scalar + double *vector; // computed global vector + double **array; // computed global array + double *vector_atom; // computed per-atom vector + double **array_atom; // computed per-atom array + double *vector_local; // computed local vector + double **array_local; // computed local array - int scalar_flag; // 0/1 if compute_scalar() function exists - int vector_flag; // 0/1 if compute_vector() function exists - int array_flag; // 0/1 if compute_array() function exists - int size_vector; // length of global vector - int size_array_rows; // rows in global array - int size_array_cols; // columns in global array - int size_vector_variable; // 1 if vec length is unknown in advance - int size_array_rows_variable; // 1 if array rows is unknown in advance + int scalar_flag; // 0/1 if compute_scalar() function exists + int vector_flag; // 0/1 if compute_vector() function exists + int array_flag; // 0/1 if compute_array() function exists + int size_vector; // length of global vector + int size_array_rows; // rows in global array + int size_array_cols; // columns in global array + int size_vector_variable; // 1 if vec length is unknown in advance + int size_array_rows_variable; // 1 if array rows is unknown in advance int peratom_flag; // 0/1 if compute_peratom() function exists int size_peratom_cols; // 0 = vector, N = columns in peratom array - int local_flag; // 0/1 if compute_local() function exists - int size_local_rows; // rows in local vector or array - int size_local_cols; // 0 = vector, N = columns in local array + int local_flag; // 0/1 if compute_local() function exists + int size_local_rows; // rows in local vector or array + int size_local_cols; // 0 = vector, N = columns in local array - int extscalar; // 0/1 if global scalar is intensive/extensive - int extvector; // 0/1/-1 if global vector is all int/ext/extlist - int *extlist; // list of 0/1 int/ext for each vec component - int extarray; // 0/1 if global array is all intensive/extensive + int extscalar; // 0/1 if global scalar is intensive/extensive + int extvector; // 0/1/-1 if global vector is all int/ext/extlist + int *extlist; // list of 0/1 int/ext for each vec component + int extarray; // 0/1 if global array is all intensive/extensive - int tempflag; // 1 if Compute can be used as temperature - // must have both compute_scalar, compute_vector - int pressflag; // 1 if Compute can be used as pressure (uses virial) - // must have both compute_scalar, compute_vector - int pressatomflag; // 1 if Compute calculates per-atom virial - // 2 if Compute calculates per-atom centroid virial - // 3 if Compute calculates both - int peflag; // 1 if Compute calculates PE (uses Force energies) - int peatomflag; // 1 if Compute calculates per-atom PE + int tempflag; // 1 if Compute can be used as temperature + // must have both compute_scalar, compute_vector + int pressflag; // 1 if Compute can be used as pressure (uses virial) + // must have both compute_scalar, compute_vector + int pressatomflag; // 1 if Compute calculates per-atom virial + // 2 if Compute calculates per-atom centroid virial + // 3 if Compute calculates both + int peflag; // 1 if Compute calculates PE (uses Force energies) + int peatomflag; // 1 if Compute calculates per-atom PE int create_attribute; // 1 if compute stores attributes that need // setting when a new atom is created - int tempbias; // 0/1 if Compute temp includes self/extra bias + int tempbias; // 0/1 if Compute temp includes self/extra bias - int timeflag; // 1 if Compute stores list of timesteps it's called on - int ntime; // # of entries in time list - int maxtime; // max # of entries time list can hold - bigint *tlist; // list of timesteps the Compute is called on + int timeflag; // 1 if Compute stores list of timesteps it's called on + int ntime; // # of entries in time list + int maxtime; // max # of entries time list can hold + bigint *tlist; // list of timesteps the Compute is called on - int invoked_flag; // non-zero if invoked or accessed this step, 0 if not - bigint invoked_scalar; // last timestep on which compute_scalar() was invoked - bigint invoked_vector; // ditto for compute_vector() - bigint invoked_array; // ditto for compute_array() - bigint invoked_peratom; // ditto for compute_peratom() - bigint invoked_local; // ditto for compute_local() + int invoked_flag; // non-zero if invoked or accessed this step, 0 if not + bigint invoked_scalar; // last timestep on which compute_scalar() was invoked + bigint invoked_vector; // ditto for compute_vector() + bigint invoked_array; // ditto for compute_array() + bigint invoked_peratom; // ditto for compute_peratom() + bigint invoked_local; // ditto for compute_local() - double dof; // degrees-of-freedom for temperature + double dof; // degrees-of-freedom for temperature - int comm_forward; // size of forward communication (0 if none) - int comm_reverse; // size of reverse communication (0 if none) - int dynamic_group_allow; // 1 if can be used with dynamic group, else 0 + int comm_forward; // size of forward communication (0 if none) + int comm_reverse; // size of reverse communication (0 if none) + int dynamic_group_allow; // 1 if can be used with dynamic group, else 0 // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; - int copymode,kokkosable; + int copymode, kokkosable; Compute(class LAMMPS *, int, char **); virtual ~Compute(); @@ -109,20 +111,20 @@ class Compute : protected Pointers { virtual void init() = 0; virtual void init_list(int, class NeighList *) {} virtual void setup() {} - virtual double compute_scalar() {return 0.0;} + virtual double compute_scalar() { return 0.0; } virtual void compute_vector() {} virtual void compute_array() {} virtual void compute_peratom() {} virtual void compute_local() {} virtual void set_arrays(int) {} - virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;} + 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 int pack_reverse_comm(int, int, double *) { return 0; } virtual void unpack_reverse_comm(int, int *, double *) {} virtual void dof_remove_pre() {} - virtual int dof_remove(int) {return 0;} + virtual int dof_remove(int) { return 0; } virtual void remove_bias(int, double *) {} virtual void remove_bias_thr(int, double *, double *) {} virtual void remove_bias_all() {} @@ -135,7 +137,7 @@ class Compute : protected Pointers { virtual void lock_enable() {} virtual void lock_disable() {} - virtual int lock_length() {return 0;} + virtual int lock_length() { return 0; } virtual void lock(class Fix *, bigint, bigint) {} virtual void unlock(class Fix *) {} @@ -145,36 +147,35 @@ class Compute : protected Pointers { int matchstep(bigint); void clearstep(); - virtual double memory_usage() {return 0.0;} + virtual double memory_usage() { return 0.0; } virtual void pair_setup_callback(int, int) {} - virtual void pair_tally_callback(int, int, int, int, - double, double, double, - double, double, double) {} + virtual void pair_tally_callback(int, int, int, int, double, double, double, double, double, + double) + { + } protected: - int instance_me; // which Compute class instantiation I am + int instance_me; // which Compute class instantiation I am - double natoms_temp; // # of atoms used for temperature calculation - double extra_dof; // extra DOF for temperature computes - int fix_dof; // DOF due to fixes - int dynamic; // recount atoms for temperature computes - int dynamic_user; // user request for temp compute to be dynamic + double natoms_temp; // # of atoms used for temperature calculation + double extra_dof; // extra DOF for temperature computes + int fix_dof; // DOF due to fixes + int dynamic; // recount atoms for temperature computes + int dynamic_user; // user request for temp compute to be dynamic - double vbias[3]; // stored velocity bias for one atom - double **vbiasall; // stored velocity bias for all atoms - int maxbias; // size of vbiasall array + double vbias[3]; // stored velocity bias for one atom + double **vbiasall; // stored velocity bias for all atoms + int maxbias; // size of vbiasall array - inline int sbmask(int j) const { - return j >> SBBITS & 3; - } + inline int sbmask(int j) const { return j >> SBBITS & 3; } // private methods void adjust_dof_fix(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/compute_adf.cpp b/src/compute_adf.cpp index e58782131c..0cfed0cd80 100644 --- a/src/compute_adf.cpp +++ b/src/compute_adf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_adf.h b/src/compute_adf.h index ab16c5b01d..6f7f8f35a4 100644 --- a/src/compute_adf.h +++ b/src/compute_adf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(adf,ComputeADF) - +// clang-format off +ComputeStyle(adf,ComputeADF); +// clang-format on #else #ifndef LMP_COMPUTE_ADF_H @@ -33,38 +33,38 @@ class ComputeADF : public Compute { void compute_array(); private: - int nbin; // # of adf bins - int ntriples; // # of adf triples - double deltax,deltaxinv; // bin width and inverse-width - int *ilo,*ihi,*jlo,*jhi,*klo,*khi; - double **hist; // histogram bins - double **histall; // summed histogram bins across all procs + int nbin; // # of adf bins + int ntriples; // # of adf triples + double deltax, deltaxinv; // bin width and inverse-width + int *ilo, *ihi, *jlo, *jhi, *klo, *khi; + double **hist; // histogram bins + double **histall; // summed histogram bins across all procs - double *rcutinnerj, *rcutinnerk; // list of inner cutoffs - double *rcutouterj, *rcutouterk; // list of outer cutoffs + double *rcutinnerj, *rcutinnerk; // list of inner cutoffs + double *rcutouterj, *rcutouterk; // list of outer cutoffs - class NeighList *list; // full neighbor list + class NeighList *list; // full neighbor list - int *iatomcount; // local number of central atoms - int *iatomcountall; // total number of central atoms - int **iatomflag; // 1 if type is central atom in ADF - int *maxjatom, *maxkatom; // allocated size jatom, katom neighlist - int *numjatom, *numkatom; // actual size of jatom, katom neighlist - int **neighjatom, **neighkatom;// list of short neighbor lists - int **jatomflag, **katomflag; // 1 if type is neighbor atom in ADF + int *iatomcount; // local number of central atoms + int *iatomcountall; // total number of central atoms + int **iatomflag; // 1 if type is central atom in ADF + int *maxjatom, *maxkatom; // allocated size jatom, katom neighlist + int *numjatom, *numkatom; // actual size of jatom, katom neighlist + int **neighjatom, **neighkatom; // list of short neighbor lists + int **jatomflag, **katomflag; // 1 if type is neighbor atom in ADF - int *maxjkatom; // allocated size short neighlist - int *numjkatom; // actual size of short neighlist - int **neighjkatom; // list of short neighbor lists - int **bothjkatom; // 1 if atom is in both jatom and katom lists - double ***delrjkatom; // list of 4-vectors: delx, dely, delx, and 1/r + int *maxjkatom; // allocated size short neighlist + int *numjkatom; // actual size of short neighlist + int **neighjkatom; // list of short neighbor lists + int **bothjkatom; // 1 if atom is in both jatom and katom lists + double ***delrjkatom; // list of 4-vectors: delx, dely, delx, and 1/r double rad2deg; // conversion factor from radians to degrees int ordinate_style; // DEGREE, RADIAN, or COSINE - int cutflag; // 1 if at least one outer cutoff specified + int cutflag; // 1 if at least one outer cutoff specified }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_aggregate_atom.cpp b/src/compute_aggregate_atom.cpp index 212195eb1a..818d8657b8 100644 --- a/src/compute_aggregate_atom.cpp +++ b/src/compute_aggregate_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_aggregate_atom.h b/src/compute_aggregate_atom.h index 9b4d9312d0..9bacf37ae1 100644 --- a/src/compute_aggregate_atom.h +++ b/src/compute_aggregate_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(aggregate/atom,ComputeAggregateAtom) - +// clang-format off +ComputeStyle(aggregate/atom,ComputeAggregateAtom); +// clang-format on #else #ifndef LMP_COMPUTE_AGGREGATE_ATOM_H @@ -38,13 +38,13 @@ class ComputeAggregateAtom : public Compute { double memory_usage(); private: - int nmax,commflag; + int nmax, commflag; double cutsq; class NeighList *list; double *aggregateID; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_angle.cpp b/src/compute_angle.cpp index fb881d86f2..a7980c3885 100644 --- a/src/compute_angle.cpp +++ b/src/compute_angle.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_angle.h b/src/compute_angle.h index 6c84ace307..efdbebee10 100644 --- a/src/compute_angle.h +++ b/src/compute_angle.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(angle,ComputeAngle) - +// clang-format off +ComputeStyle(angle,ComputeAngle); +// clang-format on #else #ifndef LMP_COMPUTE_ANGLE_H @@ -37,7 +37,7 @@ class ComputeAngle : public Compute { double *emine; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_angle_local.cpp b/src/compute_angle_local.cpp index d0630f07eb..fa0b52f39c 100644 --- a/src/compute_angle_local.cpp +++ b/src/compute_angle_local.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_angle_local.h b/src/compute_angle_local.h index 4338246cd2..3aebfae0a8 100644 --- a/src/compute_angle_local.h +++ b/src/compute_angle_local.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(angle/local,ComputeAngleLocal) - +// clang-format off +ComputeStyle(angle/local,ComputeAngleLocal); +// clang-format on #else #ifndef LMP_COMPUTE_ANGLE_LOCAL_H @@ -33,10 +33,10 @@ class ComputeAngleLocal : public Compute { double memory_usage(); private: - int nvalues,nvar,ncount,setflag,tflag; + int nvalues, nvar, ncount, setflag, tflag; int tvar; - int *bstyle,*vvar; + int *bstyle, *vvar; char *tstr; char **vstr; @@ -48,7 +48,7 @@ class ComputeAngleLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_angmom_chunk.cpp b/src/compute_angmom_chunk.cpp index 4fd2e14661..787dc43fc6 100644 --- a/src/compute_angmom_chunk.cpp +++ b/src/compute_angmom_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -43,7 +44,7 @@ ComputeAngmomChunk::ComputeAngmomChunk(LAMMPS *lmp, int narg, char **arg) : idchunk = utils::strdup(arg[3]); - init(); + ComputeAngmomChunk::init(); // chunk-based data diff --git a/src/compute_angmom_chunk.h b/src/compute_angmom_chunk.h index 81f4988560..384de5cc33 100644 --- a/src/compute_angmom_chunk.h +++ b/src/compute_angmom_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(angmom/chunk,ComputeAngmomChunk) - +// clang-format off +ComputeStyle(angmom/chunk,ComputeAngmomChunk); +// clang-format on #else #ifndef LMP_COMPUTE_ANGMOM_CHUNK_H @@ -40,18 +40,18 @@ class ComputeAngmomChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; - double *massproc,*masstotal; - double **com,**comall; - double **angmom,**angmomall; + double *massproc, *masstotal; + double **com, **comall; + double **angmom, **angmomall; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_bond.cpp b/src/compute_bond.cpp index 18cb6c3614..90d451c9f8 100644 --- a/src/compute_bond.cpp +++ b/src/compute_bond.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_bond.h b/src/compute_bond.h index f1e18e2bb4..174fcb06f3 100644 --- a/src/compute_bond.h +++ b/src/compute_bond.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(bond,ComputeBond) - +// clang-format off +ComputeStyle(bond,ComputeBond); +// clang-format on #else #ifndef LMP_COMPUTE_BOND_H @@ -37,7 +37,7 @@ class ComputeBond : public Compute { double *emine; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_bond_local.cpp b/src/compute_bond_local.cpp index 053c4c83dc..275924d0e5 100644 --- a/src/compute_bond_local.cpp +++ b/src/compute_bond_local.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_bond_local.h b/src/compute_bond_local.h index b400456c53..5ecbaac2a0 100644 --- a/src/compute_bond_local.h +++ b/src/compute_bond_local.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(bond/local,ComputeBondLocal) - +// clang-format off +ComputeStyle(bond/local,ComputeBondLocal); +// clang-format on #else #ifndef LMP_COMPUTE_BOND_LOCAL_H @@ -35,11 +35,11 @@ class ComputeBondLocal : public Compute { double memory_usage(); private: - int nvalues,nvar,ncount,setflag; + int nvalues, nvar, ncount, setflag; - int singleflag,velflag,ghostvelflag,initflag; + int singleflag, velflag, ghostvelflag, initflag; int dvar; - int *bstyle,*vvar; + int *bstyle, *vvar; char *dstr; char **vstr; @@ -51,7 +51,7 @@ class ComputeBondLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index 8a9bb1fdf4..5816bee17a 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_centro_atom.h b/src/compute_centro_atom.h index 480919d4bf..c7e66cfad1 100644 --- a/src/compute_centro_atom.h +++ b/src/compute_centro_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(centro/atom,ComputeCentroAtom) - +// clang-format off +ComputeStyle(centro/atom,ComputeCentroAtom); +// clang-format on #else #ifndef COMPUTE_CENTRO_ATOM_H @@ -34,7 +34,7 @@ class ComputeCentroAtom : public Compute { double memory_usage(); private: - int nmax,maxneigh,nnn; + int nmax, maxneigh, nnn; double *distsq; int *nearest; class NeighList *list; @@ -45,7 +45,7 @@ class ComputeCentroAtom : public Compute { void select2(int, int, double *, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_centroid_stress_atom.cpp b/src/compute_centroid_stress_atom.cpp index a0abbe8406..c35b6a63e7 100644 --- a/src/compute_centroid_stress_atom.cpp +++ b/src/compute_centroid_stress_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_centroid_stress_atom.h b/src/compute_centroid_stress_atom.h index 88350262eb..d332788aa4 100644 --- a/src/compute_centroid_stress_atom.h +++ b/src/compute_centroid_stress_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(centroid/stress/atom,ComputeCentroidStressAtom) - +// clang-format off +ComputeStyle(centroid/stress/atom,ComputeCentroidStressAtom); +// clang-format on #else #ifndef LMP_COMPUTE_CENTROID_STRESS_ATOM_H @@ -35,8 +35,8 @@ class ComputeCentroidStressAtom : public Compute { double memory_usage(); private: - int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag; - int kspaceflag,fixflag,biasflag; + int keflag, pairflag, bondflag, angleflag, dihedralflag, improperflag; + int kspaceflag, fixflag, biasflag; Compute *temperature; char *id_temp; @@ -44,7 +44,7 @@ class ComputeCentroidStressAtom : public Compute { double **stress; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index 16090eb0ec..81eafcf8d6 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_chunk_atom.h b/src/compute_chunk_atom.h index da8e0db182..e2c3ebe96b 100644 --- a/src/compute_chunk_atom.h +++ b/src/compute_chunk_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(chunk/atom,ComputeChunkAtom) - +// clang-format off +ComputeStyle(chunk/atom,ComputeChunkAtom); +// clang-format on #else #ifndef LMP_COMPUTE_CHUNK_ATOM_H @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ComputeChunkAtom : public Compute { public: - int nchunk,ncoord,compress,idsflag,lockcount; + int nchunk, ncoord, compress, idsflag, lockcount; int computeflag; // 1 if this compute invokes other computes double chunk_volume_scalar; double *chunk_volume_vec; double **coord; - int *ichunk,*chunkID; + int *ichunk, *chunkID; ComputeChunkAtom(class LAMMPS *, int, char **); ~ComputeChunkAtom(); @@ -49,39 +49,39 @@ class ComputeChunkAtom : public Compute { void compute_ichunk(); private: - int which,binflag; - int regionflag,nchunksetflag,nchunkflag,discard; - int limit,limitstyle,limitfirst; - int scaleflag,pbcflag; - double xscale,yscale,zscale; + int which, binflag; + int regionflag, nchunksetflag, nchunkflag, discard; + int limit, limitstyle, limitfirst; + int scaleflag, pbcflag; + double xscale, yscale, zscale; int argindex; char *cfvid; // xyz spatial bins int ndim; - int dim[3],originflag[3],nlayers[3]; - int minflag[3],maxflag[3]; - double origin[3],delta[3]; - double offset[3],invdelta[3]; - double minvalue[3],maxvalue[3]; + int dim[3], originflag[3], nlayers[3]; + int minflag[3], maxflag[3]; + double origin[3], delta[3]; + double offset[3], invdelta[3]; + double minvalue[3], maxvalue[3]; // spherical spatial bins double sorigin_user[3]; double sorigin[3]; - double sradmin_user,sradmax_user; - double sradmin,sradmax,sinvrad; + double sradmin_user, sradmax_user; + double sradmin, sradmax, sinvrad; int nsbin; // cylindrical spatial bins double corigin_user[3]; double corigin[3]; - double cradmin_user,cradmax_user; - double cradmin,cradmax,cinvrad; - int cdim1,cdim2; - int ncbin,ncplane; + double cradmin_user, cradmax_user; + double cradmin, cradmax, cinvrad; + int cdim1, cdim2; + int ncbin, ncplane; char *idregion; class Region *region; @@ -95,18 +95,18 @@ class ComputeChunkAtom : public Compute { char *id_fix; class FixStore *fixstore; - class Fix *lockfix; // ptr to FixAveChunk that is locking out setups - // null pointer if no lock currently in place - bigint lockstart,lockstop; // timesteps for start and stop of locking + class Fix *lockfix; // ptr to FixAveChunk that is locking out setups + // null pointer if no lock currently in place + bigint lockstart, lockstop; // timesteps for start and stop of locking - bigint invoked_setup; // last timestep setup_chunks and nchunk calculated - bigint invoked_ichunk; // last timestep ichunk values calculated - int nmax,nmaxint; + bigint invoked_setup; // last timestep setup_chunks and nchunk calculated + bigint invoked_ichunk; // last timestep ichunk values calculated + int nmax, nmaxint; double *chunk; - int molcheck; // one-time check if all molecule atoms in chunk - int *exclude; // 1 if atom is not assigned to any chunk - std::map *hash; // store original chunks IDs before compression + int molcheck; // one-time check if all molecule atoms in chunk + int *exclude; // 1 if atom is not assigned to any chunk + std::map *hash; // store original chunks IDs before compression // callback function for ring communication @@ -127,7 +127,7 @@ class ComputeChunkAtom : public Compute { void readdim(int, char **, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_chunk_spread_atom.cpp b/src/compute_chunk_spread_atom.cpp index f552454e72..7409a6de78 100644 --- a/src/compute_chunk_spread_atom.cpp +++ b/src/compute_chunk_spread_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_chunk_spread_atom.h b/src/compute_chunk_spread_atom.h index fd5407e455..b7cc1d4739 100644 --- a/src/compute_chunk_spread_atom.h +++ b/src/compute_chunk_spread_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(chunk/spread/atom,ComputeChunkSpreadAtom) - +// clang-format off +ComputeStyle(chunk/spread/atom,ComputeChunkSpreadAtom); +// clang-format on #else #ifndef LMP_COMPUTE_CHUNK_SPREAD_ATOM_H @@ -33,10 +33,10 @@ class ComputeChunkSpreadAtom : public Compute { double memory_usage(); protected: - int mode,nvalues; + int mode, nvalues; char *idchunk; char **ids; - int *which,*argindex,*value2index; + int *which, *argindex, *value2index; int nmax; class ComputeChunkAtom *cchunk; @@ -44,7 +44,7 @@ class ComputeChunkSpreadAtom : public Compute { void init_chunk(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_cluster_atom.cpp b/src/compute_cluster_atom.cpp index 4de5a2321c..476af0bfa2 100644 --- a/src/compute_cluster_atom.cpp +++ b/src/compute_cluster_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_cluster_atom.h b/src/compute_cluster_atom.h index 4d6be634d1..2f9bd8955c 100644 --- a/src/compute_cluster_atom.h +++ b/src/compute_cluster_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(cluster/atom,ComputeClusterAtom) - +// clang-format off +ComputeStyle(cluster/atom,ComputeClusterAtom); +// clang-format on #else #ifndef LMP_COMPUTE_CLUSTER_ATOM_H @@ -36,13 +36,13 @@ class ComputeClusterAtom : public Compute { double memory_usage(); private: - int nmax,commflag; + int nmax, commflag; double cutsq; class NeighList *list; double *clusterID; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp index 318450e2b7..e002e54983 100644 --- a/src/compute_cna_atom.cpp +++ b/src/compute_cna_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_cna_atom.h b/src/compute_cna_atom.h index e04ca3a41c..4546a3f66e 100644 --- a/src/compute_cna_atom.h +++ b/src/compute_cna_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(cna/atom,ComputeCNAAtom) - +// clang-format off +ComputeStyle(cna/atom,ComputeCNAAtom); +// clang-format on #else #ifndef LMP_COMPUTE_CNA_ATOM_H @@ -42,7 +42,7 @@ class ComputeCNAAtom : public Compute { double *pattern; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_com.cpp b/src/compute_com.cpp index 6dee73f82a..e40fb6d9b3 100644 --- a/src/compute_com.cpp +++ b/src/compute_com.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_com.h b/src/compute_com.h index d45f363749..73cd0739e9 100644 --- a/src/compute_com.h +++ b/src/compute_com.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(com,ComputeCOM) - +// clang-format off +ComputeStyle(com,ComputeCOM); +// clang-format on #else #ifndef LMP_COMPUTE_COM_H @@ -35,7 +35,7 @@ class ComputeCOM : public Compute { double masstotal; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_com_chunk.cpp b/src/compute_com_chunk.cpp index a67b412b9e..1fac12d9ba 100644 --- a/src/compute_com_chunk.cpp +++ b/src/compute_com_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -45,7 +46,7 @@ ComputeCOMChunk::ComputeCOMChunk(LAMMPS *lmp, int narg, char **arg) : idchunk = utils::strdup(arg[3]); - init(); + ComputeCOMChunk::init(); // chunk-based data diff --git a/src/compute_com_chunk.h b/src/compute_com_chunk.h index c009f71ad2..c2aedaabed 100644 --- a/src/compute_com_chunk.h +++ b/src/compute_com_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(com/chunk,ComputeCOMChunk) - +// clang-format off +ComputeStyle(com/chunk,ComputeCOMChunk); +// clang-format on #else #ifndef LMP_COMPUTE_COM_CHUNK_H @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class ComputeCOMChunk : public Compute { public: - char *idchunk; // fields accessed by other classes + char *idchunk; // fields accessed by other classes double *masstotal; ComputeCOMChunk(class LAMMPS *, int, char **); @@ -44,17 +44,17 @@ class ComputeCOMChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; - int firstflag,massneed; + int nchunk, maxchunk; + int firstflag, massneed; class ComputeChunkAtom *cchunk; double *massproc; - double **com,**comall; + double **com, **comall; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_contact_atom.cpp b/src/compute_contact_atom.cpp index 272c677333..46e1389423 100644 --- a/src/compute_contact_atom.cpp +++ b/src/compute_contact_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_contact_atom.h b/src/compute_contact_atom.h index 67910ab340..6be62e4b31 100644 --- a/src/compute_contact_atom.h +++ b/src/compute_contact_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(contact/atom,ComputeContactAtom) - +// clang-format off +ComputeStyle(contact/atom,ComputeContactAtom); +// clang-format on #else #ifndef LMP_COMPUTE_CONTACT_ATOM_H @@ -41,7 +41,7 @@ class ComputeContactAtom : public Compute { double *contact; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_coord_atom.cpp b/src/compute_coord_atom.cpp index aba22e3f60..b61f158d0d 100644 --- a/src/compute_coord_atom.cpp +++ b/src/compute_coord_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_coord_atom.h b/src/compute_coord_atom.h index dd1815dac2..9ac0a8c3b3 100644 --- a/src/compute_coord_atom.h +++ b/src/compute_coord_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(coord/atom,ComputeCoordAtom) - +// clang-format off +ComputeStyle(coord/atom,ComputeCoordAtom); +// clang-format on #else #ifndef LMP_COMPUTE_COORD_ATOM_H @@ -34,28 +34,28 @@ class ComputeCoordAtom : public Compute { int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); double memory_usage(); - enum {NONE,CUTOFF,ORIENT}; + enum { NONE, CUTOFF, ORIENT }; protected: - int nmax,ncol; + int nmax, ncol; double cutsq; class NeighList *list; - int *typelo,*typehi; + int *typelo, *typehi; double *cvec; double **carray; char *group2; - int jgroup,jgroupbit; + int jgroup, jgroupbit; class ComputeOrientOrderAtom *c_orientorder; char *id_orientorder; double threshold; double **normv; - int cstyle,nqlist,l; + int cstyle, nqlist, l; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_deprecated.cpp b/src/compute_deprecated.cpp index 0f5b7407e8..4747afdf99 100644 --- a/src/compute_deprecated.cpp +++ b/src/compute_deprecated.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_deprecated.h b/src/compute_deprecated.h index 9082c72eae..74dd997f2a 100644 --- a/src/compute_deprecated.h +++ b/src/compute_deprecated.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - +// clang-format off // list all deprecated and removed compute styles here - -ComputeStyle(DEPRECATED,ComputeDeprecated) - +ComputeStyle(DEPRECATED,ComputeDeprecated); +// clang-format on #else #ifndef LMP_COMPUTE_DEPRECATED_H @@ -33,7 +32,7 @@ class ComputeDeprecated : public Compute { void init() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_dihedral.cpp b/src/compute_dihedral.cpp index fb2c9db4b7..a411ce1a8b 100644 --- a/src/compute_dihedral.cpp +++ b/src/compute_dihedral.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_dihedral.h b/src/compute_dihedral.h index 8f59108735..f5bf756d0e 100644 --- a/src/compute_dihedral.h +++ b/src/compute_dihedral.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(dihedral,ComputeDihedral) - +// clang-format off +ComputeStyle(dihedral,ComputeDihedral); +// clang-format on #else #ifndef LMP_COMPUTE_DIHEDRAL_H @@ -37,7 +37,7 @@ class ComputeDihedral : public Compute { double *emine; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_dihedral_local.cpp b/src/compute_dihedral_local.cpp index 908acff98c..dbb02ff795 100644 --- a/src/compute_dihedral_local.cpp +++ b/src/compute_dihedral_local.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_dihedral_local.h b/src/compute_dihedral_local.h index fd084dbd19..a74d277776 100644 --- a/src/compute_dihedral_local.h +++ b/src/compute_dihedral_local.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(dihedral/local,ComputeDihedralLocal) - +// clang-format off +ComputeStyle(dihedral/local,ComputeDihedralLocal); +// clang-format on #else #ifndef LMP_COMPUTE_DIHEDRAL_LOCAL_H @@ -33,10 +33,10 @@ class ComputeDihedralLocal : public Compute { double memory_usage(); private: - int nvalues,nvar,ncount,setflag; + int nvalues, nvar, ncount, setflag; int pvar; - int *bstyle,*vvar; + int *bstyle, *vvar; char *pstr; char **vstr; @@ -48,7 +48,7 @@ class ComputeDihedralLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_dipole_chunk.cpp b/src/compute_dipole_chunk.cpp index 5594229a97..161f4a5c2b 100644 --- a/src/compute_dipole_chunk.cpp +++ b/src/compute_dipole_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +15,11 @@ #include "compute_dipole_chunk.h" #include "atom.h" +#include "comm.h" #include "compute_chunk_atom.h" #include "domain.h" #include "error.h" +#include "force.h" #include "math_special.h" #include "memory.h" #include "modify.h" @@ -59,7 +62,7 @@ ComputeDipoleChunk::ComputeDipoleChunk(LAMMPS *lmp, int narg, char **arg) : else error->all(FLERR,"Illegal compute dipole/chunk command"); } - init(); + ComputeDipoleChunk::init(); // chunk-based data @@ -94,6 +97,10 @@ void ComputeDipoleChunk::init() cchunk = (ComputeChunkAtom *) modify->compute[icompute]; if (strcmp(cchunk->style,"chunk/atom") != 0) error->all(FLERR,"Compute dipole/chunk does not use chunk/atom compute"); + + if ((force->pair_match("/tip4p/",0) != nullptr) && (comm->me == 0)) + error->warning(FLERR,"Computed dipole moments may be incorrect when " + "using a tip4p pair style"); } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_dipole_chunk.h b/src/compute_dipole_chunk.h index 19c052367b..b44852d543 100644 --- a/src/compute_dipole_chunk.h +++ b/src/compute_dipole_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(dipole/chunk,ComputeDipoleChunk) - +// clang-format off +ComputeStyle(dipole/chunk,ComputeDipoleChunk); +// clang-format on #else #ifndef LMP_COMPUTE_DIPOLE_CHUNK_H @@ -40,20 +40,20 @@ class ComputeDipoleChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; - double *massproc,*masstotal; - double *chrgproc,*chrgtotal; - double **com,**comall; - double **dipole,**dipoleall; + double *massproc, *masstotal; + double *chrgproc, *chrgtotal; + double **com, **comall; + double **dipole, **dipoleall; int usecenter; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index 4e4b87f99c..68776c1936 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_displace_atom.h b/src/compute_displace_atom.h index 212619d3ce..79e0a67f7a 100644 --- a/src/compute_displace_atom.h +++ b/src/compute_displace_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(displace/atom,ComputeDisplaceAtom) - +// clang-format off +ComputeStyle(displace/atom,ComputeDisplaceAtom); +// clang-format on #else #ifndef LMP_COMPUTE_DISPLACE_ATOM_H @@ -40,12 +40,12 @@ class ComputeDisplaceAtom : public Compute { char *id_fix; class FixStore *fix; - int refreshflag,ivar,nvmax; // refresh option is enabled - char *rvar; // for incremental dumps + int refreshflag, ivar, nvmax; // refresh option is enabled + char *rvar; // for incremental dumps double *varatom; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_erotate_sphere.cpp b/src/compute_erotate_sphere.cpp index c7ead78557..22b7c4b46d 100644 --- a/src/compute_erotate_sphere.cpp +++ b/src/compute_erotate_sphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_erotate_sphere.h b/src/compute_erotate_sphere.h index ef75084859..09f0604dbd 100644 --- a/src/compute_erotate_sphere.h +++ b/src/compute_erotate_sphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(erotate/sphere,ComputeERotateSphere) - +// clang-format off +ComputeStyle(erotate/sphere,ComputeERotateSphere); +// clang-format on #else #ifndef LMP_COMPUTE_EROTATE_SPHERE_H @@ -35,7 +35,7 @@ class ComputeERotateSphere : public Compute { double pfactor; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_erotate_sphere_atom.cpp b/src/compute_erotate_sphere_atom.cpp index cdedfd3509..af4f902f83 100644 --- a/src/compute_erotate_sphere_atom.cpp +++ b/src/compute_erotate_sphere_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_erotate_sphere_atom.h b/src/compute_erotate_sphere_atom.h index ee909c9151..b44576d523 100644 --- a/src/compute_erotate_sphere_atom.h +++ b/src/compute_erotate_sphere_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(erotate/sphere/atom,ComputeErotateSphereAtom) - +// clang-format off +ComputeStyle(erotate/sphere/atom,ComputeErotateSphereAtom); +// clang-format on #else #ifndef LMP_COMPUTE_EROTATE_SPHERE_ATOM_H @@ -38,7 +38,7 @@ class ComputeErotateSphereAtom : public Compute { double *erot; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_fragment_atom.cpp b/src/compute_fragment_atom.cpp index 5e4f6e92d3..b0a72080df 100644 --- a/src/compute_fragment_atom.cpp +++ b/src/compute_fragment_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_fragment_atom.h b/src/compute_fragment_atom.h index a8bc87c64e..4cf7478d61 100644 --- a/src/compute_fragment_atom.h +++ b/src/compute_fragment_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(fragment/atom,ComputeFragmentAtom) - +// clang-format off +ComputeStyle(fragment/atom,ComputeFragmentAtom); +// clang-format on #else #ifndef LMP_COMPUTE_FRAGMENT_ATOM_H @@ -35,12 +35,12 @@ class ComputeFragmentAtom : public Compute { double memory_usage(); private: - int nmax,commflag,singleflag; - int *stack,*clist,*markflag; + int nmax, commflag, singleflag; + int *stack, *clist, *markflag; double *fragmentID; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_global_atom.cpp b/src/compute_global_atom.cpp index 5097032708..d64ae5a641 100644 --- a/src/compute_global_atom.cpp +++ b/src/compute_global_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_global_atom.h b/src/compute_global_atom.h index b47c0cce22..4f5d5ea00d 100644 --- a/src/compute_global_atom.h +++ b/src/compute_global_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(global/atom,ComputeGlobalAtom) - +// clang-format off +ComputeStyle(global/atom,ComputeGlobalAtom); +// clang-format on #else #ifndef LMP_COMPUTE_GLOBAL_ATOM_H @@ -33,20 +33,20 @@ class ComputeGlobalAtom : public Compute { double memory_usage(); protected: - int whichref,indexref,ref2index; + int whichref, indexref, ref2index; char *idref; int nvalues; - int *which,*argindex,*value2index; + int *which, *argindex, *value2index; char **ids; - int nmax,maxvector; + int nmax, maxvector; int *indices; double *varatom; double *vecglobal; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_group_group.cpp b/src/compute_group_group.cpp index 7912b4e031..161126b53a 100644 --- a/src/compute_group_group.cpp +++ b/src/compute_group_group.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_group_group.h b/src/compute_group_group.h index b579863a55..1a34a19fe6 100644 --- a/src/compute_group_group.h +++ b/src/compute_group_group.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(group/group,ComputeGroupGroup) - +// clang-format off +ComputeStyle(group/group,ComputeGroupGroup); +// clang-format on #else #ifndef LMP_COMPUTE_GROUP_GROUP_H @@ -35,10 +35,10 @@ class ComputeGroupGroup : public Compute { private: char *group2; - int jgroup,jgroupbit,othergroupbit; + int jgroup, jgroupbit, othergroupbit; double **cutsq; - double e_self,e_correction; - int pairflag,kspaceflag,boundaryflag,molflag; + double e_self, e_correction; + int pairflag, kspaceflag, boundaryflag, molflag; class Pair *pair; class NeighList *list; class KSpace *kspace; @@ -48,7 +48,7 @@ class ComputeGroupGroup : public Compute { void kspace_correction(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_gyration.cpp b/src/compute_gyration.cpp index e55896e8a5..623f7b9c92 100644 --- a/src/compute_gyration.cpp +++ b/src/compute_gyration.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_gyration.h b/src/compute_gyration.h index ad31f7b382..2eccb46409 100644 --- a/src/compute_gyration.h +++ b/src/compute_gyration.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(gyration,ComputeGyration) - +// clang-format off +ComputeStyle(gyration,ComputeGyration); +// clang-format on #else #ifndef LMP_COMPUTE_GYRATION_H @@ -36,7 +36,7 @@ class ComputeGyration : public Compute { double masstotal; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_gyration_chunk.cpp b/src/compute_gyration_chunk.cpp index bedc815c34..fe6022cd47 100644 --- a/src/compute_gyration_chunk.cpp +++ b/src/compute_gyration_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -38,7 +39,7 @@ ComputeGyrationChunk::ComputeGyrationChunk(LAMMPS *lmp, int narg, char **arg) : idchunk = utils::strdup(arg[3]); - init(); + ComputeGyrationChunk::init(); // optional args diff --git a/src/compute_gyration_chunk.h b/src/compute_gyration_chunk.h index 7c1c15791a..1ac6fec341 100644 --- a/src/compute_gyration_chunk.h +++ b/src/compute_gyration_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(gyration/chunk,ComputeGyrationChunk) - +// clang-format off +ComputeStyle(gyration/chunk,ComputeGyrationChunk); +// clang-format on #else #ifndef LMP_COMPUTE_GYRATION_CHUNK_H @@ -41,22 +41,22 @@ class ComputeGyrationChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; int tensor; - double *massproc,*masstotal; - double **com,**comall; - double *rg,*rgall; - double **rgt,**rgtall; + double *massproc, *masstotal; + double **com, **comall; + double *rg, *rgall; + double **rgt, **rgtall; void com_chunk(); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_heat_flux.cpp b/src/compute_heat_flux.cpp index b2e5662a6b..d363d0ae5d 100644 --- a/src/compute_heat_flux.cpp +++ b/src/compute_heat_flux.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_heat_flux.h b/src/compute_heat_flux.h index e31989840b..d8466106e3 100644 --- a/src/compute_heat_flux.h +++ b/src/compute_heat_flux.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(heat/flux,ComputeHeatFlux) - +// clang-format off +ComputeStyle(heat/flux,ComputeHeatFlux); +// clang-format on #else #ifndef LMP_COMPUTE_HEAT_FLUX_H @@ -32,11 +32,11 @@ class ComputeHeatFlux : public Compute { void compute_vector(); private: - char *id_ke,*id_pe,*id_stress; - class Compute *c_ke,*c_pe,*c_stress; + char *id_ke, *id_pe, *id_stress; + class Compute *c_ke, *c_pe, *c_stress; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_hexorder_atom.cpp b/src/compute_hexorder_atom.cpp index 827d8d3692..4fd4dc34a0 100644 --- a/src/compute_hexorder_atom.cpp +++ b/src/compute_hexorder_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_hexorder_atom.h b/src/compute_hexorder_atom.h index 194ae35c4e..34653621ea 100644 --- a/src/compute_hexorder_atom.h +++ b/src/compute_hexorder_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(hexorder/atom,ComputeHexOrderAtom) - +// clang-format off +ComputeStyle(hexorder/atom,ComputeHexOrderAtom); +// clang-format on #else #ifndef LMP_COMPUTE_HEXORDER_ATOM_H @@ -34,7 +34,7 @@ class ComputeHexOrderAtom : public Compute { double memory_usage(); private: - int nmax,maxneigh,ncol,nnn,ndegree; + int nmax, maxneigh, ncol, nnn, ndegree; double cutsq; class NeighList *list; double *distsq; @@ -42,12 +42,12 @@ class ComputeHexOrderAtom : public Compute { double **qnarray; - void calc_qn_complex(double, double, double&, double&); - void calc_qn_trig(double, double, double&, double&); + void calc_qn_complex(double, double, double &, double &); + void calc_qn_trig(double, double, double &, double &); void select2(int, int, double *, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_improper.cpp b/src/compute_improper.cpp index 827c049a0d..42bb247ac0 100644 --- a/src/compute_improper.cpp +++ b/src/compute_improper.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_improper.h b/src/compute_improper.h index 7b66bd9aca..4d7597bcd2 100644 --- a/src/compute_improper.h +++ b/src/compute_improper.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(improper,ComputeImproper) - +// clang-format off +ComputeStyle(improper,ComputeImproper); +// clang-format on #else #ifndef LMP_COMPUTE_IMPROPER_H @@ -37,7 +37,7 @@ class ComputeImproper : public Compute { double *emine; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp index 5d78e585e8..7a80ce982a 100644 --- a/src/compute_improper_local.cpp +++ b/src/compute_improper_local.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_improper_local.h b/src/compute_improper_local.h index 1ff26b912e..7fe64d12c3 100644 --- a/src/compute_improper_local.h +++ b/src/compute_improper_local.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(improper/local,ComputeImproperLocal) - +// clang-format off +ComputeStyle(improper/local,ComputeImproperLocal); +// clang-format on #else #ifndef LMP_COMPUTE_IMPROPER_LOCAL_H @@ -33,7 +33,7 @@ class ComputeImproperLocal : public Compute { double memory_usage(); private: - int nvalues,cflag; + int nvalues, cflag; int ncount; int nmax; @@ -44,7 +44,7 @@ class ComputeImproperLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_inertia_chunk.cpp b/src/compute_inertia_chunk.cpp index 095a573e54..e60192b3ab 100644 --- a/src/compute_inertia_chunk.cpp +++ b/src/compute_inertia_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -43,7 +44,7 @@ ComputeInertiaChunk::ComputeInertiaChunk(LAMMPS *lmp, int narg, char **arg) : idchunk = utils::strdup(arg[3]); - init(); + ComputeInertiaChunk::init(); // chunk-based data diff --git a/src/compute_inertia_chunk.h b/src/compute_inertia_chunk.h index bf42bb66f3..8f8a1c522d 100644 --- a/src/compute_inertia_chunk.h +++ b/src/compute_inertia_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(inertia/chunk,ComputeInertiaChunk) - +// clang-format off +ComputeStyle(inertia/chunk,ComputeInertiaChunk); +// clang-format on #else #ifndef LMP_COMPUTE_INERTIA_CHUNK_H @@ -40,18 +40,18 @@ class ComputeInertiaChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; - double *massproc,*masstotal; - double **com,**comall; - double **inertia,**inertiaall; + double *massproc, *masstotal; + double **com, **comall; + double **inertia, **inertiaall; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_ke.cpp b/src/compute_ke.cpp index 62edcf8f0f..ea011eccc1 100644 --- a/src/compute_ke.cpp +++ b/src/compute_ke.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_ke.h b/src/compute_ke.h index 6561146d29..f9043e2a84 100644 --- a/src/compute_ke.h +++ b/src/compute_ke.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(ke,ComputeKE) - +// clang-format off +ComputeStyle(ke,ComputeKE); +// clang-format on #else #ifndef LMP_COMPUTE_KE_H @@ -34,7 +34,7 @@ class ComputeKE : public Compute { double pfactor; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_ke_atom.cpp b/src/compute_ke_atom.cpp index 17dbd82ee1..3f0a0f85ab 100644 --- a/src/compute_ke_atom.cpp +++ b/src/compute_ke_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_ke_atom.h b/src/compute_ke_atom.h index 9444aec7f6..e676dec920 100644 --- a/src/compute_ke_atom.h +++ b/src/compute_ke_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(ke/atom,ComputeKEAtom) - +// clang-format off +ComputeStyle(ke/atom,ComputeKEAtom); +// clang-format on #else #ifndef LMP_COMPUTE_KE_ATOM_H @@ -37,7 +37,7 @@ class ComputeKEAtom : public Compute { double *ke; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_msd.cpp b/src/compute_msd.cpp index 659931fb5a..ce9e10304e 100644 --- a/src/compute_msd.cpp +++ b/src/compute_msd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_msd.h b/src/compute_msd.h index 3022369256..9649559756 100644 --- a/src/compute_msd.h +++ b/src/compute_msd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(msd,ComputeMSD) - +// clang-format off +ComputeStyle(msd,ComputeMSD); +// clang-format on #else #ifndef LMP_COMPUTE_MSD_H @@ -33,16 +33,16 @@ class ComputeMSD : public Compute { void set_arrays(int); protected: - int comflag; // comflag = 1 if reference moves with center of mass - int avflag; // avflag = 1 if using average position as reference - int naverage; // number of samples for average position + int comflag; // comflag = 1 if reference moves with center of mass + int avflag; // avflag = 1 if using average position as reference + int naverage; // number of samples for average position bigint nmsd; double masstotal; char *id_fix; class FixStore *fix; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_msd_chunk.cpp b/src/compute_msd_chunk.cpp index 39ed9d1f1c..74528da2f6 100644 --- a/src/compute_msd_chunk.cpp +++ b/src/compute_msd_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -47,7 +48,7 @@ ComputeMSDChunk::ComputeMSDChunk(LAMMPS *lmp, int narg, char **arg) : idchunk = utils::strdup(arg[3]); firstflag = 1; - init(); + ComputeMSDChunk::init(); // create a new fix STORE style for reference positions // id = compute-ID + COMPUTE_STORE, fix group = compute group diff --git a/src/compute_msd_chunk.h b/src/compute_msd_chunk.h index 657cf45ab4..3dbf994909 100644 --- a/src/compute_msd_chunk.h +++ b/src/compute_msd_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(msd/chunk,ComputeMSDChunk) - +// clang-format off +ComputeStyle(msd/chunk,ComputeMSDChunk); +// clang-format on #else #ifndef LMP_COMPUTE_MSD_CHUNK_H @@ -48,14 +48,14 @@ class ComputeMSDChunk : public Compute { class FixStore *fix; int firstflag; - double *massproc,*masstotal; - double **com,**comall; + double *massproc, *masstotal; + double **com, **comall; double **msd; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_omega_chunk.cpp b/src/compute_omega_chunk.cpp index 9b81d1f19e..1422614ae1 100644 --- a/src/compute_omega_chunk.cpp +++ b/src/compute_omega_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -47,7 +48,7 @@ ComputeOmegaChunk::ComputeOmegaChunk(LAMMPS *lmp, int narg, char **arg) : idchunk = utils::strdup(arg[3]); - init(); + ComputeOmegaChunk::init(); // chunk-based data diff --git a/src/compute_omega_chunk.h b/src/compute_omega_chunk.h index ae4fb9d682..f1fc87f0ed 100644 --- a/src/compute_omega_chunk.h +++ b/src/compute_omega_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(omega/chunk,ComputeOmegaChunk) - +// clang-format off +ComputeStyle(omega/chunk,ComputeOmegaChunk); +// clang-format on #else #ifndef LMP_COMPUTE_OMEGA_CHUNK_H @@ -40,20 +40,20 @@ class ComputeOmegaChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; - double *massproc,*masstotal; - double **com,**comall; - double **inertia,**inertiaall; - double **angmom,**angmomall; + double *massproc, *masstotal; + double **com, **comall; + double **inertia, **inertiaall; + double **angmom, **angmomall; double **omega; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index 98b8b7cb80..b77e68062f 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_orientorder_atom.h b/src/compute_orientorder_atom.h index 7ddc45253a..3394feb4ab 100644 --- a/src/compute_orientorder_atom.h +++ b/src/compute_orientorder_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(orientorder/atom,ComputeOrientOrderAtom) - +// clang-format off +ComputeStyle(orientorder/atom,ComputeOrientOrderAtom); +// clang-format on #else #ifndef LMP_COMPUTE_ORIENTORDER_ATOM_H @@ -38,7 +38,7 @@ class ComputeOrientOrderAtom : public Compute { int nqlist; protected: - int nmax,maxneigh,ncol,nnn; + int nmax, maxneigh, ncol, nnn; class NeighList *list; double *distsq; int *nearest; @@ -49,20 +49,19 @@ class ComputeOrientOrderAtom : public Compute { double **qnm_i; void select3(int, int, double *, int *, double **); - void calc_boop(double **rlist, int numNeighbors, - double qn[], int nlist[], int nnlist); + void calc_boop(double **rlist, int numNeighbors, double qn[], int nlist[], int nnlist); double dist(const double r[]); double polar_prefactor(int, int, double); double associated_legendre(int, int, double); virtual void init_clebsch_gordan(); - double *cglist; // Clebsch-Gordan coeffs + double *cglist; // Clebsch-Gordan coeffs int idxcg_max; int chunksize; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_pair.cpp b/src/compute_pair.cpp index aa9df260b1..a5bf54d5ef 100644 --- a/src/compute_pair.cpp +++ b/src/compute_pair.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_pair.h b/src/compute_pair.h index 565b25c84d..c2de4b7bc4 100644 --- a/src/compute_pair.h +++ b/src/compute_pair.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(pair,ComputePair) - +// clang-format off +ComputeStyle(pair,ComputePair); +// clang-format on #else #ifndef LMP_COMPUTE_PAIR_H @@ -33,13 +33,13 @@ class ComputePair : public Compute { void compute_vector(); private: - int evalue,npair,nsub; + int evalue, npair, nsub; char *pstyle; class Pair *pair; double *one; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_pair_local.cpp b/src/compute_pair_local.cpp index 6bc1d7b6cb..af0f20014c 100644 --- a/src/compute_pair_local.cpp +++ b/src/compute_pair_local.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_pair_local.h b/src/compute_pair_local.h index e23cd2e67a..8a3f5860fd 100644 --- a/src/compute_pair_local.h +++ b/src/compute_pair_local.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(pair/local,ComputePairLocal) - +// clang-format off +ComputeStyle(pair/local,ComputePairLocal); +// clang-format on #else #ifndef LMP_COMPUTE_PAIR_LOCAL_H @@ -34,10 +34,10 @@ class ComputePairLocal : public Compute { double memory_usage(); private: - int nvalues,ncount,cutstyle; + int nvalues, ncount, cutstyle; - int *pstyle; // style of each requested output - int *pindex; // for pI, index of the output (0 to M-1) + int *pstyle; // style of each requested output + int *pindex; // for pI, index of the output (0 to M-1) int singleflag; int nmax; @@ -50,7 +50,7 @@ class ComputePairLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_pe.cpp b/src/compute_pe.cpp index db9ed97455..e48b436c85 100644 --- a/src/compute_pe.cpp +++ b/src/compute_pe.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_pe.h b/src/compute_pe.h index 21c0eaaebc..7dbced863d 100644 --- a/src/compute_pe.h +++ b/src/compute_pe.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(pe,ComputePE) - +// clang-format off +ComputeStyle(pe,ComputePE); +// clang-format on #else #ifndef LMP_COMPUTE_PE_H @@ -32,10 +32,10 @@ class ComputePE : public Compute { double compute_scalar(); private: - int pairflag,bondflag,angleflag,dihedralflag,improperflag,kspaceflag,fixflag; + int pairflag, bondflag, angleflag, dihedralflag, improperflag, kspaceflag, fixflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_pe_atom.cpp b/src/compute_pe_atom.cpp index 48172f19b5..3df72726c8 100644 --- a/src/compute_pe_atom.cpp +++ b/src/compute_pe_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_pe_atom.h b/src/compute_pe_atom.h index 781aeecc0f..57015550ac 100644 --- a/src/compute_pe_atom.h +++ b/src/compute_pe_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(pe/atom,ComputePEAtom) - +// clang-format off +ComputeStyle(pe/atom,ComputePEAtom); +// clang-format on #else #ifndef LMP_COMPUTE_PE_ATOM_H @@ -35,13 +35,13 @@ class ComputePEAtom : public Compute { double memory_usage(); private: - int pairflag,bondflag,angleflag,dihedralflag,improperflag; - int kspaceflag,fixflag; + int pairflag, bondflag, angleflag, dihedralflag, improperflag; + int kspaceflag, fixflag; int nmax; double *energy; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp index 3bf66f42ce..435ef7a3e9 100644 --- a/src/compute_pressure.cpp +++ b/src/compute_pressure.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_pressure.h b/src/compute_pressure.h index fc67b1b699..f0dcda7330 100644 --- a/src/compute_pressure.h +++ b/src/compute_pressure.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(pressure,ComputePressure) - +// clang-format off +ComputeStyle(pressure,ComputePressure); +// clang-format on #else #ifndef LMP_COMPUTE_PRESSURE_H @@ -34,17 +34,17 @@ class ComputePressure : public Compute { void reset_extra_compute_fix(const char *); protected: - double boltz,nktv2p,inv_volume; - int nvirial,dimension; + double boltz, nktv2p, inv_volume; + int nvirial, dimension; double **vptr; double *kspace_virial; Compute *temperature; char *id_temp; - double virial[6]; // ordering: xx,yy,zz,xy,xz,yz + double virial[6]; // ordering: xx,yy,zz,xy,xz,yz int pairhybridflag; class Pair *pairhybrid; - int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag; - int fixflag,kspaceflag; + int keflag, pairflag, bondflag, angleflag, dihedralflag, improperflag; + int fixflag, kspaceflag; void virial_compute(int, int); @@ -53,7 +53,7 @@ class ComputePressure : public Compute { int nsub; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index cb45753e8e..c9d0353e6c 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_property_atom.h b/src/compute_property_atom.h index dc2bf92817..929bc6ede0 100644 --- a/src/compute_property_atom.h +++ b/src/compute_property_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(property/atom,ComputePropertyAtom) - +// clang-format off +ComputeStyle(property/atom,ComputePropertyAtom); +// clang-format on #else #ifndef LMP_COMPUTE_PROPERTY_ATOM_H @@ -43,7 +43,7 @@ class ComputePropertyAtom : public Compute { class AtomVecBody *avec_body; typedef void (ComputePropertyAtom::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions + FnPtrPack *pack_choice; // ptrs to pack functions void pack_id(int); void pack_molecule(int); @@ -135,7 +135,7 @@ class ComputePropertyAtom : public Compute { void pack_property_atom(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_property_chunk.cpp b/src/compute_property_chunk.cpp index 72e9831b0c..1fc430d13c 100644 --- a/src/compute_property_chunk.cpp +++ b/src/compute_property_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -35,7 +36,7 @@ ComputePropertyChunk::ComputePropertyChunk(LAMMPS *lmp, int narg, char **arg) : idchunk = utils::strdup(arg[3]); - init(); + ComputePropertyChunk::init(); // parse values diff --git a/src/compute_property_chunk.h b/src/compute_property_chunk.h index aef41ce719..2f882f1930 100644 --- a/src/compute_property_chunk.h +++ b/src/compute_property_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(property/chunk,ComputePropertyChunk) - +// clang-format off +ComputeStyle(property/chunk,ComputePropertyChunk); +// clang-format on #else #ifndef LMP_COMPUTE_CHUNK_MOLECULE_H @@ -41,19 +41,19 @@ class ComputePropertyChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; int *ichunk; - int nvalues,countflag; + int nvalues, countflag; double *buf; - int *count_one,*count_all; + int *count_one, *count_all; void allocate(); typedef void (ComputePropertyChunk::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions + FnPtrPack *pack_choice; // ptrs to pack functions void pack_count(int); void pack_id(int); @@ -62,7 +62,7 @@ class ComputePropertyChunk : public Compute { void pack_coord3(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp index 91d806582b..7fd6d876ed 100644 --- a/src/compute_property_local.cpp +++ b/src/compute_property_local.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_property_local.h b/src/compute_property_local.h index 085e2e1f7a..419c31eeb2 100644 --- a/src/compute_property_local.h +++ b/src/compute_property_local.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(property/local,ComputePropertyLocal) - +// clang-format off +ComputeStyle(property/local,ComputePropertyLocal); +// clang-format on #else #ifndef LMP_COMPUTE_PROPERTY_LOCAL_H @@ -34,7 +34,7 @@ class ComputePropertyLocal : public Compute { double memory_usage(); private: - int nvalues,kindflag,cutstyle; + int nvalues, kindflag, cutstyle; int nmax; double *vlocal; @@ -54,7 +54,7 @@ class ComputePropertyLocal : public Compute { void reallocate(int); typedef void (ComputePropertyLocal::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions + FnPtrPack *pack_choice; // ptrs to pack functions void pack_patom1(int); void pack_patom2(int); @@ -83,7 +83,7 @@ class ComputePropertyLocal : public Compute { void pack_itype(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_rdf.cpp b/src/compute_rdf.cpp index e5f55ecf4b..59b456d40e 100644 --- a/src/compute_rdf.cpp +++ b/src/compute_rdf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_rdf.h b/src/compute_rdf.h index f1cbc0e512..4a0de6522f 100644 --- a/src/compute_rdf.h +++ b/src/compute_rdf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(rdf,ComputeRDF) - +// clang-format off +ComputeStyle(rdf,ComputeRDF); +// clang-format on #else #ifndef LMP_COMPUTE_RDF_H @@ -33,28 +33,28 @@ class ComputeRDF : public Compute { void compute_array(); private: - int nbin; // # of rdf bins - int cutflag; // user cutoff flag - int npairs; // # of rdf pairs - double delr,delrinv; // bin width and its inverse - double cutoff_user; // user-specified cutoff - double mycutneigh; // user-specified cutoff + neighbor skin - int ***rdfpair; // map 2 type pair to rdf pair for each histo - int **nrdfpair; // # of histograms for each type pair - int *ilo,*ihi,*jlo,*jhi; - double **hist; // histogram bins - double **histall; // summed histogram bins across all procs + int nbin; // # of rdf bins + int cutflag; // user cutoff flag + int npairs; // # of rdf pairs + double delr, delrinv; // bin width and its inverse + double cutoff_user; // user-specified cutoff + double mycutneigh; // user-specified cutoff + neighbor skin + int ***rdfpair; // map 2 type pair to rdf pair for each histo + int **nrdfpair; // # of histograms for each type pair + int *ilo, *ihi, *jlo, *jhi; + double **hist; // histogram bins + double **histall; // summed histogram bins across all procs int *typecount; - int *icount,*jcount; + int *icount, *jcount; int *duplicates; - class NeighList *list; // half neighbor list + class NeighList *list; // half neighbor list void init_norm(); bigint natoms_old; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index 6e961df47a..a471b954ed 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_reduce.h b/src/compute_reduce.h index 09a83ace11..24745a456a 100644 --- a/src/compute_reduce.h +++ b/src/compute_reduce.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,22 +12,22 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(reduce,ComputeReduce) - +// clang-format off +ComputeStyle(reduce,ComputeReduce); +// clang-format on #else #ifndef LMP_COMPUTE_REDUCE_H #define LMP_COMPUTE_REDUCE_H -#include "compute.h" // IWYU pragma: export +#include "compute.h" // IWYU pragma: export namespace LAMMPS_NS { class ComputeReduce : public Compute { public: - enum {SUM,SUMSQ,MINN,MAXX,AVE,AVESQ}; - enum {PERATOM,LOCAL}; + enum { SUM, SUMSQ, MINN, MAXX, AVE, AVESQ }; + enum { PERATOM, LOCAL }; ComputeReduce(class LAMMPS *, int, char **); virtual ~ComputeReduce(); @@ -38,11 +38,11 @@ class ComputeReduce : public Compute { protected: int me; - int mode,nvalues,iregion; - int *which,*argindex,*flavor,*value2index; + int mode, nvalues, iregion; + int *which, *argindex, *flavor, *value2index; char **ids; double *onevec; - int *replace,*indices,*owner; + int *replace, *indices, *owner; int index; char *idregion; @@ -53,14 +53,14 @@ class ComputeReduce : public Compute { double value; int proc; }; - Pair pairme,pairall; + Pair pairme, pairall; virtual double compute_one(int, int); virtual bigint count(int); void combine(double &, double, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_reduce_chunk.cpp b/src/compute_reduce_chunk.cpp index e895a13b18..a2aac9c95c 100644 --- a/src/compute_reduce_chunk.cpp +++ b/src/compute_reduce_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_reduce_chunk.h b/src/compute_reduce_chunk.h index 886dc61542..350db72df7 100644 --- a/src/compute_reduce_chunk.h +++ b/src/compute_reduce_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(reduce/chunk,ComputeReduceChunk) - +// clang-format off +ComputeStyle(reduce/chunk,ComputeReduceChunk); +// clang-format on #else #ifndef LMP_COMPUTE_REDUCE_CHUNK_H @@ -41,16 +41,16 @@ class ComputeReduceChunk : public Compute { double memory_usage(); private: - int mode,nvalues; - int *which,*argindex,*value2index; + int mode, nvalues; + int *which, *argindex, *value2index; char *idchunk; char **ids; int nchunk; - int maxchunk,maxatom; + int maxchunk, maxatom; double initvalue; - double *vlocal,*vglobal; - double **alocal,**aglobal; + double *vlocal, *vglobal; + double **alocal, **aglobal; double *varatom; class ComputeChunkAtom *cchunk; @@ -61,7 +61,7 @@ class ComputeReduceChunk : public Compute { void combine(double &, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_reduce_region.cpp b/src/compute_reduce_region.cpp index 0a8526bb8f..1aace48f41 100644 --- a/src/compute_reduce_region.cpp +++ b/src/compute_reduce_region.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_reduce_region.h b/src/compute_reduce_region.h index 02f58b7424..08d7e9a55f 100644 --- a/src/compute_reduce_region.h +++ b/src/compute_reduce_region.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(reduce/region,ComputeReduceRegion) - +// clang-format off +ComputeStyle(reduce/region,ComputeReduceRegion); +// clang-format on #else #ifndef LMP_COMPUTE_REDUCE_REGION_H @@ -34,7 +34,7 @@ class ComputeReduceRegion : public ComputeReduce { bigint count(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_slice.cpp b/src/compute_slice.cpp index 313dc3266a..42eacc2523 100644 --- a/src/compute_slice.cpp +++ b/src/compute_slice.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_slice.h b/src/compute_slice.h index 3ffc5d52b5..cd70516f11 100644 --- a/src/compute_slice.h +++ b/src/compute_slice.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(slice,ComputeSlice) - +// clang-format off +ComputeStyle(slice,ComputeSlice); +// clang-format on #else #ifndef LMP_COMPUTE_SLICE_H @@ -34,14 +34,14 @@ class ComputeSlice : public Compute { private: int me; - int nstart,nstop,nskip,nvalues; - int *which,*argindex,*value2index; + int nstart, nstop, nskip, nvalues; + int *which, *argindex, *value2index; char **ids; void extract_one(int, double *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index 0d27031326..d71623bc54 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_stress_atom.h b/src/compute_stress_atom.h index b22b021f69..4d126df0b4 100644 --- a/src/compute_stress_atom.h +++ b/src/compute_stress_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(stress/atom,ComputeStressAtom) - +// clang-format off +ComputeStyle(stress/atom,ComputeStressAtom); +// clang-format on #else #ifndef LMP_COMPUTE_STRESS_ATOM_H @@ -35,8 +35,8 @@ class ComputeStressAtom : public Compute { double memory_usage(); private: - int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag; - int kspaceflag,fixflag,biasflag; + int keflag, pairflag, bondflag, angleflag, dihedralflag, improperflag; + int kspaceflag, fixflag, biasflag; Compute *temperature; char *id_temp; @@ -44,7 +44,7 @@ class ComputeStressAtom : public Compute { double **stress; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp.cpp b/src/compute_temp.cpp index 66381e09e6..b225cee2a1 100644 --- a/src/compute_temp.cpp +++ b/src/compute_temp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_temp.h b/src/compute_temp.h index 520c7e5027..efc7ff2ab0 100644 --- a/src/compute_temp.h +++ b/src/compute_temp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp,ComputeTemp) - +// clang-format off +ComputeStyle(temp,ComputeTemp); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_H @@ -39,7 +39,7 @@ class ComputeTemp : public Compute { virtual void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_chunk.cpp b/src/compute_temp_chunk.cpp index 4ae0cc37c8..60014c7e21 100644 --- a/src/compute_temp_chunk.cpp +++ b/src/compute_temp_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -47,7 +48,7 @@ ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) : idchunk = utils::strdup(arg[3]); biasflag = 0; - init(); + ComputeTempChunk::init(); // optional per-chunk values diff --git a/src/compute_temp_chunk.h b/src/compute_temp_chunk.h index ac3c76b660..7a84cad902 100644 --- a/src/compute_temp_chunk.h +++ b/src/compute_temp_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/chunk,ComputeTempChunk) - +// clang-format off +ComputeStyle(temp/chunk,ComputeTempChunk); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_CHUNK_H @@ -47,20 +47,20 @@ class ComputeTempChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk,comflag,biasflag; + int nchunk, maxchunk, comflag, biasflag; int nvalues; int *which; char *idchunk; class ComputeChunkAtom *cchunk; - double adof,cdof; + double adof, cdof; char *id_bias; - class Compute *tbias; // ptr to additional bias compute + class Compute *tbias; // ptr to additional bias compute bigint comstep; - double *sum,*sumall; - int *count,*countall; - double *massproc,*masstotal; - double **vcm,**vcmall; + double *sum, *sumall; + int *count, *countall; + double *massproc, *masstotal; + double **vcm, **vcmall; void vcm_compute(); void temperature(int); @@ -69,7 +69,7 @@ class ComputeTempChunk : public Compute { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_com.cpp b/src/compute_temp_com.cpp index 0ab9ba78fb..4ed4a669a5 100644 --- a/src/compute_temp_com.cpp +++ b/src/compute_temp_com.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_temp_com.h b/src/compute_temp_com.h index 95c3d41b7b..3887bcdbd2 100644 --- a/src/compute_temp_com.h +++ b/src/compute_temp_com.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/com,ComputeTempCOM) - +// clang-format off +ComputeStyle(temp/com,ComputeTempCOM); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_COM_H @@ -41,13 +41,12 @@ class ComputeTempCOM : public Compute { void restore_bias_thr(int, double *, double *); private: - double tfactor,masstotal; + double tfactor, masstotal; void dof_compute(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_deform.cpp b/src/compute_temp_deform.cpp index ab2e919966..0c158e96e6 100644 --- a/src/compute_temp_deform.cpp +++ b/src/compute_temp_deform.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_temp_deform.h b/src/compute_temp_deform.h index 836a858a70..572d09d041 100644 --- a/src/compute_temp_deform.h +++ b/src/compute_temp_deform.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/deform,ComputeTempDeform) - +// clang-format off +ComputeStyle(temp/deform,ComputeTempDeform); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_DEFORM_H @@ -47,7 +47,7 @@ class ComputeTempDeform : public Compute { virtual void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_partial.cpp b/src/compute_temp_partial.cpp index 66dd5dd882..72297c8379 100644 --- a/src/compute_temp_partial.cpp +++ b/src/compute_temp_partial.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_temp_partial.h b/src/compute_temp_partial.h index d4a6e78352..8021e8cc57 100644 --- a/src/compute_temp_partial.h +++ b/src/compute_temp_partial.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/partial,ComputeTempPartial) - +// clang-format off +ComputeStyle(temp/partial,ComputeTempPartial); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_PARTIAL_H @@ -44,13 +44,13 @@ class ComputeTempPartial : public Compute { double memory_usage(); protected: - int xflag,yflag,zflag; + int xflag, yflag, zflag; double tfactor; void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index 11fe72440f..ff6bc36a08 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_temp_profile.h b/src/compute_temp_profile.h index d82fbd780e..9cad1f26ec 100644 --- a/src/compute_temp_profile.h +++ b/src/compute_temp_profile.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/profile,ComputeTempProfile) - +// clang-format off +ComputeStyle(temp/profile,ComputeTempProfile); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_PROFILE_H @@ -43,20 +43,20 @@ class ComputeTempProfile : public Compute { double memory_usage(); private: - int xflag,yflag,zflag,ncount,outflag; - int nbinx,nbiny,nbinz,nbins; - int ivx,ivy,ivz; + int xflag, yflag, zflag, ncount, outflag; + int nbinx, nbiny, nbinz, nbins; + int ivx, ivy, ivz; double tfactor; - int box_change,triclinic; + int box_change, triclinic; int *periodicity; - double *boxlo,*boxhi,*prd; + double *boxlo, *boxhi, *prd; double invdelta[3]; int maxatom; int *bin; - double **vbin,**binave; - double *tbin,*tbinall; + double **vbin, **binave; + double *tbin, *tbinall; void dof_compute(); void bin_average(); @@ -64,7 +64,7 @@ class ComputeTempProfile : public Compute { void bin_assign(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_ramp.cpp b/src/compute_temp_ramp.cpp index 0425aa89c5..9630b70cf9 100644 --- a/src/compute_temp_ramp.cpp +++ b/src/compute_temp_ramp.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_temp_ramp.h b/src/compute_temp_ramp.h index cebf73c001..55fc989c3c 100644 --- a/src/compute_temp_ramp.h +++ b/src/compute_temp_ramp.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/ramp,ComputeTempRamp) - +// clang-format off +ComputeStyle(temp/ramp,ComputeTempRamp); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_RAMP_H @@ -43,16 +43,16 @@ class ComputeTempRamp : public Compute { private: int coord_dim; - double coord_lo,coord_hi; + double coord_lo, coord_hi; int v_dim; - double v_lo,v_hi; + double v_lo, v_hi; int scaleflag; - double tfactor,xscale,yscale,zscale; + double tfactor, xscale, yscale, zscale; void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_region.cpp b/src/compute_temp_region.cpp index 535a0166c5..34c0206eeb 100644 --- a/src/compute_temp_region.cpp +++ b/src/compute_temp_region.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_temp_region.h b/src/compute_temp_region.h index a7cc343a91..ba730f91ab 100644 --- a/src/compute_temp_region.h +++ b/src/compute_temp_region.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/region,ComputeTempRegion) - +// clang-format off +ComputeStyle(temp/region,ComputeTempRegion); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_REGION_H @@ -49,7 +49,7 @@ class ComputeTempRegion : public Compute { char *idregion; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_sphere.cpp b/src/compute_temp_sphere.cpp index 5cd7dce43a..a1e3665cc9 100644 --- a/src/compute_temp_sphere.cpp +++ b/src/compute_temp_sphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_temp_sphere.h b/src/compute_temp_sphere.h index 2bd6553033..0e0ae0bc59 100644 --- a/src/compute_temp_sphere.h +++ b/src/compute_temp_sphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(temp/sphere,ComputeTempSphere) - +// clang-format off +ComputeStyle(temp/sphere,ComputeTempSphere); +// clang-format on #else #ifndef LMP_COMPUTE_TEMP_SPHERE_H @@ -42,12 +42,12 @@ class ComputeTempSphere : public Compute { int mode; double tfactor; char *id_bias; - Compute *tbias; // ptr to additional bias compute + Compute *tbias; // ptr to additional bias compute void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_torque_chunk.cpp b/src/compute_torque_chunk.cpp index 158bf178e8..508956bb27 100644 --- a/src/compute_torque_chunk.cpp +++ b/src/compute_torque_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -42,7 +43,7 @@ ComputeTorqueChunk::ComputeTorqueChunk(LAMMPS *lmp, int narg, char **arg) : idchunk = utils::strdup(arg[3]); - init(); + ComputeTorqueChunk::init(); // chunk-based data diff --git a/src/compute_torque_chunk.h b/src/compute_torque_chunk.h index e05be3b578..928af35236 100644 --- a/src/compute_torque_chunk.h +++ b/src/compute_torque_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(torque/chunk,ComputeTorqueChunk) - +// clang-format off +ComputeStyle(torque/chunk,ComputeTorqueChunk); +// clang-format on #else #ifndef LMP_COMPUTE_TORQUE_CHUNK_H @@ -40,18 +40,18 @@ class ComputeTorqueChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; - double *massproc,*masstotal; - double **com,**comall; - double **torque,**torqueall; + double *massproc, *masstotal; + double **com, **comall; + double **torque, **torqueall; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_vacf.cpp b/src/compute_vacf.cpp index 33c49ecf96..ba88c6d2c1 100644 --- a/src/compute_vacf.cpp +++ b/src/compute_vacf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/compute_vacf.h b/src/compute_vacf.h index 4e1ed0c858..bb318a2b1a 100644 --- a/src/compute_vacf.h +++ b/src/compute_vacf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(vacf,ComputeVACF) - +// clang-format off +ComputeStyle(vacf,ComputeVACF); +// clang-format on #else #ifndef LMP_COMPUTE_VACF_H @@ -38,7 +38,7 @@ class ComputeVACF : public Compute { class FixStore *fix; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_vcm_chunk.cpp b/src/compute_vcm_chunk.cpp index dd4bac208f..8148ed3356 100644 --- a/src/compute_vcm_chunk.cpp +++ b/src/compute_vcm_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -43,7 +44,7 @@ ComputeVCMChunk::ComputeVCMChunk(LAMMPS *lmp, int narg, char **arg) : idchunk = utils::strdup(arg[3]); - init(); + ComputeVCMChunk::init(); // chunk-based data diff --git a/src/compute_vcm_chunk.h b/src/compute_vcm_chunk.h index eeaf017502..3f25a73585 100644 --- a/src/compute_vcm_chunk.h +++ b/src/compute_vcm_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMPUTE_CLASS - -ComputeStyle(vcm/chunk,ComputeVCMChunk) - +// clang-format off +ComputeStyle(vcm/chunk,ComputeVCMChunk); +// clang-format on #else #ifndef LMP_COMPUTE_VCM_CHUNK_H @@ -41,18 +41,18 @@ class ComputeVCMChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; - int firstflag,massneed; + int nchunk, maxchunk; + int firstflag, massneed; char *idchunk; class ComputeChunkAtom *cchunk; - double *massproc,*masstotal; - double **vcm,**vcmall; + double *massproc, *masstotal; + double **vcm, **vcmall; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 0cec1eba33..02efba7e93 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/create_atoms.h b/src/create_atoms.h index 0d3ba58721..1d62c801e8 100644 --- a/src/create_atoms.h +++ b/src/create_atoms.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(create_atoms,CreateAtoms) - +// clang-format off +CommandStyle(create_atoms,CreateAtoms); +// clang-format on #else #ifndef LMP_CREATE_ATOMS_H @@ -30,25 +30,25 @@ class CreateAtoms : public Command { void command(int, char **); private: - int me,nprocs; - int ntype,style,mode,nregion,nbasis,nrandom,seed; + int me, nprocs; + int ntype, style, mode, nregion, nbasis, nrandom, seed; int remapflag; int subsetflag; bigint nsubset; double subsetfrac; int *basistype; - double xone[3],quatone[4]; + double xone[3], quatone[4]; - int varflag,vvar,xvar,yvar,zvar; - char *vstr,*xstr,*ystr,*zstr; - char *xstr_copy,*ystr_copy,*zstr_copy; + int varflag, vvar, xvar, yvar, zvar; + char *vstr, *xstr, *ystr, *zstr; + char *xstr_copy, *ystr_copy, *zstr_copy; - int ilo,ihi,jlo,jhi,klo,khi; + int ilo, ihi, jlo, jhi, klo, khi; - int nlatt; // number of owned lattice sites - int nlatt_overflow; // 1 if local nlatt exceeds a 32-bit int + int nlatt; // number of owned lattice sites + int nlatt_overflow; // 1 if local nlatt exceeds a 32-bit int - int *flag; // flag subset of particles to insert on lattice + int *flag; // flag subset of particles to insert on lattice int *next; class Molecule *onemol; @@ -56,17 +56,17 @@ class CreateAtoms : public Command { class RanMars *ranlatt; int triclinic; - double sublo[3],subhi[3]; // epsilon-extended proc sub-box for adding atoms + double sublo[3], subhi[3]; // epsilon-extended proc sub-box for adding atoms void add_single(); void add_random(); void add_lattice(); void loop_lattice(int); void add_molecule(double *, double * = nullptr); - int vartest(double *); // evaluate a variable with new atom position + int vartest(double *); // evaluate a variable with new atom position }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index 1e77778cd5..99cfdfa958 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/create_bonds.h b/src/create_bonds.h index b39ed00832..eae90bef7f 100644 --- a/src/create_bonds.h +++ b/src/create_bonds.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(create_bonds,CreateBonds) - +// clang-format off +CommandStyle(create_bonds,CreateBonds); +// clang-format on #else #ifndef LMP_CREATE_BONDS_H @@ -30,10 +30,10 @@ class CreateBonds : public Command { void command(int, char **); private: - int igroup,group1bit,group2bit; - int btype,atype,dtype; - tagint batom1,batom2,aatom1,aatom2,aatom3,datom1,datom2,datom3,datom4; - double rmin,rmax; + int igroup, group1bit, group2bit; + int btype, atype, dtype; + tagint batom1, batom2, aatom1, aatom2, aatom3, datom1, datom2, datom3, datom4; + double rmin, rmax; void many(); void single_bond(); @@ -42,7 +42,7 @@ class CreateBonds : public Command { void single_improper(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/create_box.cpp b/src/create_box.cpp index 1350b6f392..34d840dfd3 100644 --- a/src/create_box.cpp +++ b/src/create_box.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/create_box.h b/src/create_box.h index 2d9eb10f26..c5a24f280a 100644 --- a/src/create_box.h +++ b/src/create_box.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(create_box,CreateBox) - +// clang-format off +CommandStyle(create_box,CreateBox); +// clang-format on #else #ifndef LMP_CREATE_BOX_H @@ -30,7 +30,7 @@ class CreateBox : public Command { void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index 326201c9a2..a9c25200d1 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/delete_atoms.h b/src/delete_atoms.h index f6e889fd80..07d1b1352a 100644 --- a/src/delete_atoms.h +++ b/src/delete_atoms.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(delete_atoms,DeleteAtoms) - +// clang-format off +CommandStyle(delete_atoms,DeleteAtoms); +// clang-format on #else #ifndef LMP_DELETE_ATOMS_H @@ -32,8 +32,8 @@ class DeleteAtoms : public Command { private: int *dlist; - int allflag,compress_flag,bond_flag,mol_flag; - std::map *hash; + int allflag, compress_flag, bond_flag, mol_flag; + std::map *hash; void delete_group(int, char **); void delete_region(int, char **); @@ -45,9 +45,7 @@ class DeleteAtoms : public Command { void recount_topology(); void options(int, char **); - inline int sbmask(int j) const { - return j >> SBBITS & 3; - } + inline int sbmask(int j) const { return j >> SBBITS & 3; } // callback functions for ring communication @@ -55,7 +53,7 @@ class DeleteAtoms : public Command { static void molring(int, char *, void *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/delete_bonds.cpp b/src/delete_bonds.cpp index 74029c8d5b..9947434da3 100644 --- a/src/delete_bonds.cpp +++ b/src/delete_bonds.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/delete_bonds.h b/src/delete_bonds.h index 563da5057a..6146104161 100644 --- a/src/delete_bonds.h +++ b/src/delete_bonds.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(delete_bonds,DeleteBonds) - +// clang-format off +CommandStyle(delete_bonds,DeleteBonds); +// clang-format on #else #ifndef LMP_DELETE_BONDS_H @@ -30,7 +30,7 @@ class DeleteBonds : public Command { void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/deprecated.cpp b/src/deprecated.cpp index 4e596abb43..fb2fa887b1 100644 --- a/src/deprecated.cpp +++ b/src/deprecated.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/deprecated.h b/src/deprecated.h index 42d8cca42f..b06599edf4 100644 --- a/src/deprecated.h +++ b/src/deprecated.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,15 +12,15 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(DEPRECATED,Deprecated) -CommandStyle(reset_ids,Deprecated) -CommandStyle(kim_init,Deprecated) -CommandStyle(kim_interactions,Deprecated) -CommandStyle(kim_param,Deprecated) -CommandStyle(kim_property,Deprecated) -CommandStyle(kim_query,Deprecated) - +// clang-format off +CommandStyle(DEPRECATED,Deprecated); +CommandStyle(reset_ids,Deprecated); +CommandStyle(kim_init,Deprecated); +CommandStyle(kim_interactions,Deprecated); +CommandStyle(kim_param,Deprecated); +CommandStyle(kim_property,Deprecated); +CommandStyle(kim_query,Deprecated); +// clang-format on #else #ifndef LMP_DEPRECATED_H @@ -32,11 +32,11 @@ namespace LAMMPS_NS { class Deprecated : public Command { public: - Deprecated(class LAMMPS *lmp) : Command(lmp) {}; + Deprecated(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dihedral.cpp b/src/dihedral.cpp index 7b448e6a84..a0b6746a2c 100644 --- a/src/dihedral.cpp +++ b/src/dihedral.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dihedral.h b/src/dihedral.h index 718b7675ee..81daeef201 100644 --- a/src/dihedral.h +++ b/src/dihedral.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,31 +14,32 @@ #ifndef LMP_DIHEDRAL_H #define LMP_DIHEDRAL_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Dihedral : protected Pointers { friend class ThrOMP; friend class FixOMP; + public: int allocated; int *setflag; - int writedata; // 1 if writes coeffs to data file - double energy; // accumulated energy - double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz - double *eatom,**vatom; // accumulated per-atom energy/virial - double **cvatom; // accumulated per-atom centroid virial + int writedata; // 1 if writes coeffs to data file + double energy; // accumulated energy + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz + double *eatom, **vatom; // accumulated per-atom energy/virial + double **cvatom; // accumulated per-atom centroid virial - int centroidstressflag; // centroid stress compared to two-body stress - // CENTROID_SAME = same as two-body stress - // CENTROID_AVAIL = different and implemented - // CENTROID_NOTAVAIL = different, not yet implemented + int centroidstressflag; // centroid stress compared to two-body stress + // CENTROID_SAME = same as two-body stress + // CENTROID_AVAIL = different and implemented + // CENTROID_NOTAVAIL = different, not yet implemented // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; int copymode; Dihedral(class LAMMPS *); @@ -50,32 +51,34 @@ class Dihedral : protected Pointers { virtual void coeff(int, char **) = 0; virtual void write_restart(FILE *) = 0; virtual void read_restart(FILE *) = 0; - virtual void write_restart_settings(FILE *) {}; - virtual void read_restart_settings(FILE *) {}; + virtual void write_restart_settings(FILE *){}; + virtual void read_restart_settings(FILE *){}; virtual void write_data(FILE *) {} virtual double memory_usage(); protected: - int suffix_flag; // suffix compatibility flag + int suffix_flag; // suffix compatibility flag int evflag; - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom,cvflag_atom; - int maxeatom,maxvatom,maxcvatom; + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom, cvflag_atom; + int maxeatom, maxvatom, maxcvatom; - void ev_init(int eflag, int vflag, int alloc = 1) { - if (eflag||vflag) ev_setup(eflag, vflag, alloc); - else evflag = eflag_either = eflag_global = eflag_atom - = vflag_either = vflag_global = vflag_atom = cvflag_atom = 0; + void ev_init(int eflag, int vflag, int alloc = 1) + { + if (eflag || vflag) + ev_setup(eflag, vflag, alloc); + else + evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = + cvflag_atom = 0; } void ev_setup(int, int, int alloc = 1); - void ev_tally(int, int, int, int, int, int, double, - double *, double *, double *, double, double, double, - double, double, double, double, double, double); + void ev_tally(int, int, int, int, int, int, double, double *, double *, double *, double, double, + double, double, double, double, double, double, double); void problem(const char *, int, int, int, int, int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/dihedral_deprecated.cpp b/src/dihedral_deprecated.cpp index 1f40f8a025..b1964d5210 100644 --- a/src/dihedral_deprecated.cpp +++ b/src/dihedral_deprecated.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dihedral_deprecated.h b/src/dihedral_deprecated.h index 8aa95d4525..a0a287931e 100644 --- a/src/dihedral_deprecated.h +++ b/src/dihedral_deprecated.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(DEPRECATED,DihedralDeprecated) - +// clang-format off +DihedralStyle(DEPRECATED,DihedralDeprecated); +// clang-format on #else #ifndef LMP_DIHEDRAL_DEPRECATED_H @@ -36,7 +36,7 @@ class DihedralDeprecated : public Dihedral { virtual void read_restart(FILE *) {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dihedral_hybrid.cpp b/src/dihedral_hybrid.cpp index caebd2a079..8088719491 100644 --- a/src/dihedral_hybrid.cpp +++ b/src/dihedral_hybrid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dihedral_hybrid.h b/src/dihedral_hybrid.h index 6904e8ecbe..04a88e7651 100644 --- a/src/dihedral_hybrid.h +++ b/src/dihedral_hybrid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(hybrid,DihedralHybrid) - +// clang-format off +DihedralStyle(hybrid,DihedralHybrid); +// clang-format on #else #ifndef LMP_DIHEDRAL_HYBRID_H @@ -26,9 +26,9 @@ namespace LAMMPS_NS { class DihedralHybrid : public Dihedral { public: - int nstyles; // # of different dihedral styles - Dihedral **styles; // class list for each Dihedral style - char **keywords; // keyword for each dihedral style + int nstyles; // # of different dihedral styles + Dihedral **styles; // class list for each Dihedral style + char **keywords; // keyword for each dihedral style DihedralHybrid(class LAMMPS *); ~DihedralHybrid(); @@ -41,16 +41,16 @@ class DihedralHybrid : public Dihedral { double memory_usage(); private: - int *map; // which style each dihedral type points to + int *map; // which style each dihedral type points to - int *ndihedrallist; // # of dihedrals in sub-style dihedrallists - int *maxdihedral; // max # of dihedrals sub-style lists can store - int ***dihedrallist; // dihedrallist for each sub-style + int *ndihedrallist; // # of dihedrals in sub-style dihedrallists + int *maxdihedral; // max # of dihedrals sub-style lists can store + int ***dihedrallist; // dihedrallist for each sub-style void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dihedral_zero.cpp b/src/dihedral_zero.cpp index ab4c12c226..b995e2f935 100644 --- a/src/dihedral_zero.cpp +++ b/src/dihedral_zero.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dihedral_zero.h b/src/dihedral_zero.h index 4609ba60d9..7349f95130 100644 --- a/src/dihedral_zero.h +++ b/src/dihedral_zero.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #ifdef DIHEDRAL_CLASS - -DihedralStyle(zero,DihedralZero) - +// clang-format off +DihedralStyle(zero,DihedralZero); +// clang-format on #else #ifndef LMP_DIHEDRAL_ZERO_H @@ -46,7 +46,7 @@ class DihedralZero : public Dihedral { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp index a8d55b8011..88298c1241 100644 --- a/src/displace_atoms.cpp +++ b/src/displace_atoms.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/displace_atoms.h b/src/displace_atoms.h index fecbc0ade3..e1a0947125 100644 --- a/src/displace_atoms.h +++ b/src/displace_atoms.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(displace_atoms,DisplaceAtoms) - +// clang-format off +CommandStyle(displace_atoms,DisplaceAtoms); +// clang-format on #else #ifndef LMP_DISPLACE_ATOMS_H @@ -31,7 +31,7 @@ class DisplaceAtoms : public Command { void command(int, char **); private: - int igroup,groupbit; + int igroup, groupbit; int scaleflag; double *mvec; @@ -39,7 +39,7 @@ class DisplaceAtoms : public Command { void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/domain.cpp b/src/domain.cpp index 8e666f2a45..5f780d523c 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/domain.h b/src/domain.h index 89b326f83b..2a812218f1 100644 --- a/src/domain.h +++ b/src/domain.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,91 +20,91 @@ #include namespace LAMMPS_NS { - class Region; +class Region; class Domain : protected Pointers { public: - int box_exist; // 0 = not yet created, 1 = exists - int dimension; // 2 = 2d, 3 = 3d - int nonperiodic; // 0 = periodic in all 3 dims - // 1 = periodic or fixed in all 6 - // 2 = shrink-wrap in any of 6 - int xperiodic,yperiodic,zperiodic; // 0 = non-periodic, 1 = periodic - int periodicity[3]; // xyz periodicity as array + int box_exist; // 0 = not yet created, 1 = exists + int dimension; // 2 = 2d, 3 = 3d + int nonperiodic; // 0 = periodic in all 3 dims + // 1 = periodic or fixed in all 6 + // 2 = shrink-wrap in any of 6 + int xperiodic, yperiodic, zperiodic; // 0 = non-periodic, 1 = periodic + int periodicity[3]; // xyz periodicity as array - int boundary[3][2]; // settings for 6 boundaries - // 0 = periodic - // 1 = fixed non-periodic - // 2 = shrink-wrap non-periodic - // 3 = shrink-wrap non-per w/ min + int boundary[3][2]; // settings for 6 boundaries + // 0 = periodic + // 1 = fixed non-periodic + // 2 = shrink-wrap non-periodic + // 3 = shrink-wrap non-per w/ min - int triclinic; // 0 = orthog box, 1 = triclinic - int tiltsmall; // 1 if limit tilt, else 0 + int triclinic; // 0 = orthog box, 1 = triclinic + int tiltsmall; // 1 if limit tilt, else 0 - // orthogonal box - double xprd,yprd,zprd; // global box dimensions - double xprd_half,yprd_half,zprd_half; // half dimensions - double prd[3]; // array form of dimensions - double prd_half[3]; // array form of half dimensions + // orthogonal box + double xprd, yprd, zprd; // global box dimensions + double xprd_half, yprd_half, zprd_half; // half dimensions + double prd[3]; // array form of dimensions + double prd_half[3]; // array form of half dimensions - // triclinic box - // xprd,xprd_half,prd,prd_half = - // same as if untilted - double prd_lamda[3]; // lamda box = (1,1,1) - double prd_half_lamda[3]; // lamda half box = (0.5,0.5,0.5) + // triclinic box + // xprd,xprd_half,prd,prd_half = + // same as if untilted + double prd_lamda[3]; // lamda box = (1,1,1) + double prd_half_lamda[3]; // lamda half box = (0.5,0.5,0.5) - double boxlo[3],boxhi[3]; // orthogonal box global bounds + double boxlo[3], boxhi[3]; // orthogonal box global bounds - // triclinic box - // boxlo/hi = same as if untilted - double boxlo_lamda[3],boxhi_lamda[3]; // lamda box = (0,1) - double boxlo_bound[3],boxhi_bound[3]; // bounding box of tilted domain - double corners[8][3]; // 8 corner points + // triclinic box + // boxlo/hi = same as if untilted + double boxlo_lamda[3], boxhi_lamda[3]; // lamda box = (0,1) + double boxlo_bound[3], boxhi_bound[3]; // bounding box of tilted domain + double corners[8][3]; // 8 corner points - // orthogonal box & triclinic box - double minxlo,minxhi; // minimum size of global box - double minylo,minyhi; // when shrink-wrapping - double minzlo,minzhi; // tri only possible for non-skew dims + // orthogonal box & triclinic box + double minxlo, minxhi; // minimum size of global box + double minylo, minyhi; // when shrink-wrapping + double minzlo, minzhi; // tri only possible for non-skew dims - // orthogonal box - double sublo[3],subhi[3]; // sub-box bounds on this proc + // orthogonal box + double sublo[3], subhi[3]; // sub-box bounds on this proc - // triclinic box - // sublo/hi = undefined - double sublo_lamda[3],subhi_lamda[3]; // bounds of subbox in lamda + // triclinic box + // sublo/hi = undefined + double sublo_lamda[3], subhi_lamda[3]; // bounds of subbox in lamda - // triclinic box - double xy,xz,yz; // 3 tilt factors - double h[6],h_inv[6]; // shape matrix in Voigt ordering - // Voigt = xx,yy,zz,yz,xz,xy - double h_rate[6],h_ratelo[3]; // rate of box size/shape change + // triclinic box + double xy, xz, yz; // 3 tilt factors + double h[6], h_inv[6]; // shape matrix in Voigt ordering + // Voigt = xx,yy,zz,yz,xz,xy + double h_rate[6], h_ratelo[3]; // rate of box size/shape change - int box_change; // 1 if any of next 3 flags are set, else 0 - int box_change_size; // 1 if box size changes, 0 if not - int box_change_shape; // 1 if box shape changes, 0 if not - int box_change_domain; // 1 if proc sub-domains change, 0 if not + int box_change; // 1 if any of next 3 flags are set, else 0 + int box_change_size; // 1 if box size changes, 0 if not + int box_change_shape; // 1 if box shape changes, 0 if not + int box_change_domain; // 1 if proc sub-domains change, 0 if not - int deform_flag; // 1 if fix deform exist, else 0 - int deform_vremap; // 1 if fix deform remaps v, else 0 - int deform_groupbit; // atom group to perform v remap for + int deform_flag; // 1 if fix deform exist, else 0 + int deform_vremap; // 1 if fix deform remaps v, else 0 + int deform_groupbit; // atom group to perform v remap for - class Lattice *lattice; // user-defined lattice + class Lattice *lattice; // user-defined lattice - int nregion; // # of defined Regions - int maxregion; // max # list can hold - Region **regions; // list of defined Regions + int nregion; // # of defined Regions + int maxregion; // max # list can hold + Region **regions; // list of defined Regions int copymode; - enum{NO_REMAP,X_REMAP,V_REMAP}; + enum { NO_REMAP, X_REMAP, V_REMAP }; - typedef Region *(*RegionCreator)(LAMMPS *,int,char**); - typedef std::map RegionCreatorMap; + typedef Region *(*RegionCreator)(LAMMPS *, int, char **); + typedef std::map RegionCreatorMap; RegionCreatorMap *region_map; Domain(class LAMMPS *); virtual ~Domain(); virtual void init(); - void set_initial_box(int expandflag=1); + void set_initial_box(int expandflag = 1); virtual void set_global_box(); virtual void set_lamda_box(); virtual void set_local_box(); @@ -117,8 +117,8 @@ class Domain : protected Pointers { void minimum_image(double *); void minimum_image_once(double *); int closest_image(int, int); - int closest_image(const double * const, int); - void closest_image(const double * const, const double * const, double * const); + int closest_image(const double *const, int); + void closest_image(const double *const, const double *const, double *const); void remap(double *, imageint &); void remap(double *); void remap_near(double *, double *); @@ -156,7 +156,8 @@ class Domain : protected Pointers { // but is a far-away image that should be treated as an unbonded neighbor // inline since called from neighbor build inner loop - inline int minimum_image_check(double dx, double dy, double dz) { + inline int minimum_image_check(double dx, double dy, double dz) + { if (xperiodic && fabs(dx) > xprd_half) return 1; if (yperiodic && fabs(dy) > yprd_half) return 1; if (zperiodic && fabs(dz) > zprd_half) return 1; @@ -164,13 +165,13 @@ class Domain : protected Pointers { } protected: - double small[3]; // fractions of box lengths + double small[3]; // fractions of box lengths private: - template static Region *region_creator(LAMMPS *,int,char**); + template static Region *region_creator(LAMMPS *, int, char **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/dump.cpp b/src/dump.cpp index c483d90fc3..1f54724925 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dump.h b/src/dump.h index 351365fa0e..05e09a929a 100644 --- a/src/dump.h +++ b/src/dump.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,26 +14,26 @@ #ifndef LMP_DUMP_H #define LMP_DUMP_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Dump : protected Pointers { public: - char *id; // user-defined name of Dump - char *style; // style of Dump - char *filename; // user-specified file - int igroup,groupbit; // group that Dump is performed on + char *id; // user-defined name of Dump + char *style; // style of Dump + char *filename; // user-specified file + int igroup, groupbit; // group that Dump is performed on - int first_flag; // 0 if no initial dump, 1 if yes initial dump - int clearstep; // 1 if dump invokes computes, 0 if not + int first_flag; // 0 if no initial dump, 1 if yes initial dump + int clearstep; // 1 if dump invokes computes, 0 if not - int comm_forward; // size of forward communication (0 if none) - int comm_reverse; // size of reverse communication (0 if none) + int comm_forward; // size of forward communication (0 if none) + int comm_reverse; // size of reverse communication (0 if none) #if defined(LMP_QSORT) // static variable across all Dump objects - static Dump *dumpptr; // holds a ptr to Dump currently being used + static Dump *dumpptr; // holds a ptr to Dump currently being used #endif Dump(class LAMMPS *, int, char **); @@ -41,97 +41,97 @@ class Dump : protected Pointers { void init(); virtual void write(); - virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;} + 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 int pack_reverse_comm(int, int, double *) { return 0; } virtual void unpack_reverse_comm(int, int *, double *) {} void modify_params(int, char **); virtual double memory_usage(); protected: - int me,nprocs; // proc info + int me, nprocs; // proc info - int compressed; // 1 if dump file is written compressed, 0 no - int binary; // 1 if dump file is written binary, 0 no - int multifile; // 0 = one big file, 1 = one file per timestep - int multiproc; // 0 = proc 0 writes for all, - // else # of procs writing files - int nclusterprocs; // # of procs in my cluster that write to one file - int filewriter; // 1 if this proc writes a file, else 0 - int fileproc; // ID of proc in my cluster who writes to file - char *multiname; // filename with % converted to cluster ID - MPI_Comm clustercomm; // MPI communicator within my cluster of procs + int compressed; // 1 if dump file is written compressed, 0 no + int binary; // 1 if dump file is written binary, 0 no + int multifile; // 0 = one big file, 1 = one file per timestep + int multiproc; // 0 = proc 0 writes for all, + // else # of procs writing files + int nclusterprocs; // # of procs in my cluster that write to one file + int filewriter; // 1 if this proc writes a file, else 0 + int fileproc; // ID of proc in my cluster who writes to file + 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 append_flag; // 1 if open file in append mode, 0 if not - int buffer_allow; // 1 if style allows for buffer_flag, 0 if not - int buffer_flag; // 1 if buffer output as one big string, 0 if not - int padflag; // timestep padding in filename - int pbcflag; // 1 if remap dumped atoms via PBC, 0 if not - int singlefile_opened; // 1 = one big file, already opened, else 0 - int sortcol; // 0 to sort on ID, 1-N on columns - int sortcolm1; // sortcol - 1 - int sortorder; // ASCEND or DESCEND - int time_flag; // 1 if output accumulated time - int unit_flag; // 1 if dump should contain unit information - int unit_count; // # of times the unit information was written - int delay_flag; // 1 if delay output until delaystep + 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 append_flag; // 1 if open file in append mode, 0 if not + int buffer_allow; // 1 if style allows for buffer_flag, 0 if not + int buffer_flag; // 1 if buffer output as one big string, 0 if not + int padflag; // timestep padding in filename + int pbcflag; // 1 if remap dumped atoms via PBC, 0 if not + int singlefile_opened; // 1 = one big file, already opened, else 0 + int sortcol; // 0 to sort on ID, 1-N on columns + int sortcolm1; // sortcol - 1 + int sortorder; // ASCEND or DESCEND + int time_flag; // 1 if output accumulated time + int unit_flag; // 1 if dump should contain unit information + int unit_count; // # of times the unit information was written + int delay_flag; // 1 if delay output until delaystep bigint delaystep; - int refreshflag; // 1 if dump_modify refresh specified - char *refresh; // compute ID to invoke refresh() on - int irefresh; // index of compute + int refreshflag; // 1 if dump_modify refresh specified + char *refresh; // compute ID to invoke refresh() on + int irefresh; // index of compute - char boundstr[9]; // encoding of boundary flags + char boundstr[9]; // encoding of boundary flags - char *format; // format string for the file write - char *format_default; // default format string + char *format; // format string for the file write + char *format_default; // default format string char *format_line_user; // user-specified format strings char *format_float_user; char *format_int_user; char *format_bigint_user; char **format_column_user; - enum{INT,DOUBLE,STRING,BIGINT}; + enum { INT, DOUBLE, STRING, BIGINT }; - FILE *fp; // file to write dump to - int size_one; // # of quantities for one atom - int nme; // # of atoms in this dump from me - int nsme; // # of chars in string output from me + FILE *fp; // file to write dump to + int size_one; // # of quantities for one atom + int nme; // # of atoms in this dump from me + int nsme; // # of chars in string output from me - double boxxlo,boxxhi; // local copies of domain values - double boxylo,boxyhi; // lo/hi are bounding box for triclinic - double boxzlo,boxzhi; - double boxxy,boxxz,boxyz; + double boxxlo, boxxhi; // local copies of domain values + double boxylo, boxyhi; // lo/hi are bounding box for triclinic + double boxzlo, boxzhi; + double boxxy, boxxz, boxyz; - int maxfiles; // max number of files created, -1 == infinite - int numfiles; // number of files in names list - int fileidx; // index of file in names list - char **nameslist; // list of history file names + int maxfiles; // max number of files created, -1 == infinite + int numfiles; // number of files in names list + int fileidx; // index of file in names list + char **nameslist; // list of history file names - bigint ntotal; // total # of per-atom lines in snapshot - int reorderflag; // 1 if OK to reorder instead of sort - int ntotal_reorder; // # of atoms that must be in snapshot - int nme_reorder; // # of atoms I must own in snapshot - tagint idlo; // lowest ID I own when reordering + bigint ntotal; // total # of per-atom lines in snapshot + int reorderflag; // 1 if OK to reorder instead of sort + int ntotal_reorder; // # of atoms that must be in snapshot + int nme_reorder; // # of atoms I must own in snapshot + tagint idlo; // lowest ID I own when reordering - int maxbuf; // size of buf - double *buf; // memory for atom quantities - int maxsbuf; // size of sbuf - char *sbuf; // memory for atom quantities in string format + int maxbuf; // size of buf + double *buf; // memory for atom quantities + int maxsbuf; // size of sbuf + char *sbuf; // memory for atom quantities in string format - int maxids; // size of ids - int maxsort; // size of bufsort, idsort, index - int maxproc; // size of proclist - tagint *ids; // list of atom IDs, if sorting on IDs + int maxids; // size of ids + int maxsort; // size of bufsort, idsort, index + int maxproc; // size of proclist + tagint *ids; // list of atom IDs, if sorting on IDs double *bufsort; tagint *idsort; - int *index,*proclist; + int *index, *proclist; - double **xpbc,**vpbc; + double **xpbc, **vpbc; imageint *imagepbc; int maxpbc; @@ -139,11 +139,11 @@ class Dump : protected Pointers { virtual void init_style() = 0; virtual void openfile(); - virtual int modify_param(int, char **) {return 0;} + virtual int modify_param(int, char **) { return 0; } virtual void write_header(bigint) = 0; virtual int count(); virtual void pack(tagint *) = 0; - virtual int convert_string(int, double *) {return 0;} + virtual int convert_string(int, double *) { return 0; } virtual void write_data(int, double *) = 0; void pbc_allocate(); double compute_time(); @@ -160,7 +160,7 @@ class Dump : protected Pointers { #endif }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp index ab043e67c8..79aaa1ffcd 100644 --- a/src/dump_atom.cpp +++ b/src/dump_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dump_atom.h b/src/dump_atom.h index 5d95cff7b9..b960bf3665 100644 --- a/src/dump_atom.h +++ b/src/dump_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(atom,DumpAtom) - +// clang-format off +DumpStyle(atom,DumpAtom); +// clang-format on #else #ifndef LMP_DUMP_ATOM_H @@ -26,17 +26,17 @@ namespace LAMMPS_NS { class DumpAtom : public Dump { public: - DumpAtom(LAMMPS *, int, char**); + DumpAtom(LAMMPS *, int, char **); - const char * MAGIC_STRING = "DUMPATOM"; - const int FORMAT_REVISION = 0x0002; - const int ENDIAN = 0x0001; + const char *MAGIC_STRING = "DUMPATOM"; + const int FORMAT_REVISION = 0x0002; + const int ENDIAN = 0x0001; protected: - 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 + 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 + char *columns; // column labels void init_style(); int modify_param(int, char **); @@ -54,14 +54,14 @@ class DumpAtom : public Dump { void format_revision_binary(); typedef void (DumpAtom::*FnPtrHeader)(bigint); - FnPtrHeader header_choice; // ptr to write header functions + FnPtrHeader header_choice; // ptr to write header functions void header_binary(bigint); void header_binary_triclinic(bigint); void header_item(bigint); void header_item_triclinic(bigint); typedef void (DumpAtom::*FnPtrPack)(tagint *); - FnPtrPack pack_choice; // ptr to pack functions + FnPtrPack pack_choice; // ptr to pack functions void pack_scale_image(tagint *); void pack_scale_noimage(tagint *); void pack_noscale_image(tagint *); @@ -70,19 +70,19 @@ class DumpAtom : public Dump { void pack_scale_noimage_triclinic(tagint *); typedef int (DumpAtom::*FnPtrConvert)(int, double *); - FnPtrConvert convert_choice; // ptr to convert data functions + FnPtrConvert convert_choice; // ptr to convert data functions int convert_image(int, double *); int convert_noimage(int, double *); typedef void (DumpAtom::*FnPtrWrite)(int, double *); - FnPtrWrite write_choice; // ptr to write data functions + FnPtrWrite write_choice; // ptr to write data functions void write_binary(int, double *); void write_string(int, double *); void write_lines_image(int, double *); void write_lines_noimage(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index 0ff32720d4..28f5a35a4b 100644 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dump_cfg.h b/src/dump_cfg.h index f42cbf4611..49699a2789 100644 --- a/src/dump_cfg.h +++ b/src/dump_cfg.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(cfg,DumpCFG) - +// clang-format off +DumpStyle(cfg,DumpCFG); +// clang-format on #else #ifndef LMP_DUMP_CFG_H @@ -26,14 +26,14 @@ namespace LAMMPS_NS { class DumpCFG : public DumpCustom { public: - int multifile_override; // used by write_dump command + int multifile_override; // used by write_dump command DumpCFG(class LAMMPS *, int, char **); virtual ~DumpCFG(); protected: - char **auxname; // name strings of auxiliary properties - int unwrapflag; // 1 if unwrapped coordinates are requested + char **auxname; // name strings of auxiliary properties + int unwrapflag; // 1 if unwrapped coordinates are requested void init_style(); virtual void write_header(bigint); @@ -41,12 +41,12 @@ class DumpCFG : public DumpCustom { virtual void write_data(int, double *); typedef void (DumpCFG::*FnPtrWrite)(int, double *); - FnPtrWrite write_choice; // ptr to write data functions + FnPtrWrite write_choice; // ptr to write data functions void write_string(int, double *); void write_lines(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index 2e752d7f31..5f2acfda57 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dump_custom.h b/src/dump_custom.h index f8890c036a..1bf1dc46b6 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(custom,DumpCustom) - +// clang-format off +DumpStyle(custom,DumpCustom); +// clang-format on #else #ifndef LMP_DUMP_CUSTOM_H @@ -29,70 +29,70 @@ class DumpCustom : public Dump { DumpCustom(class LAMMPS *, int, char **); virtual ~DumpCustom(); - const char * MAGIC_STRING = "DUMPCUSTOM"; - const int FORMAT_REVISION = 0x0002; - const int ENDIAN = 0x0001; + const char *MAGIC_STRING = "DUMPCUSTOM"; + const int FORMAT_REVISION = 0x0002; + const int ENDIAN = 0x0001; protected: - int nevery; // dump frequency for output - int iregion; // -1 if no region, else which region - char *idregion; // region ID + int nevery; // dump frequency for output + int iregion; // -1 if no region, else which region + char *idregion; // region ID - int nthresh; // # of defined thresholds - int nthreshlast; // # of defined thresholds with value = LAST + int nthresh; // # of defined thresholds + int nthreshlast; // # of defined thresholds with value = LAST - int *thresh_array; // array to threshold on for each nthresh - int *thresh_op; // threshold operation for each nthresh - double *thresh_value; // threshold value for each nthresh - int *thresh_last; // for threshold value = LAST, - // index into thresh_fix - // -1 if not LAST, value is numeric + int *thresh_array; // array to threshold on for each nthresh + int *thresh_op; // threshold operation for each nthresh + double *thresh_value; // threshold value for each nthresh + int *thresh_last; // for threshold value = LAST, + // index into thresh_fix + // -1 if not LAST, value is numeric - class FixStore **thresh_fix; // stores values for each threshold LAST - char **thresh_fixID; // IDs of thresh_fixes - int *thresh_first; // 1 the first time a FixStore values accessed + class FixStore **thresh_fix; // stores values for each threshold LAST + char **thresh_fixID; // IDs of thresh_fixes + int *thresh_first; // 1 the first time a FixStore values accessed - int expand; // flag for whether field args were expanded - char **earg; // field names with wildcard expansion - int nargnew; // size of earg + int expand; // flag for whether field args were expanded + char **earg; // field names with wildcard expansion + int nargnew; // size of earg - int *vtype; // type of each vector (INT, DOUBLE) - char **vformat; // format string for each vector element + int *vtype; // type of each vector (INT, DOUBLE) + char **vformat; // format string for each vector element - char *columns; // column labels + char *columns; // column labels - int nchoose; // # of selected atoms - int maxlocal; // size of atom selection and variable arrays - int *choose; // local indices of selected atoms - double *dchoose; // value for each atom to threshold against - int *clist; // compressed list of indices of selected atoms + int nchoose; // # of selected atoms + int maxlocal; // size of atom selection and variable arrays + int *choose; // local indices of selected atoms + double *dchoose; // value for each atom to threshold against + int *clist; // compressed list of indices of selected atoms - int nfield; // # of keywords listed by user - int ioptional; // index of start of optional args + int nfield; // # of keywords listed by user + int ioptional; // index of start of optional args - int *field2index; // which compute,fix,variable calcs this field - int *argindex; // index into compute,fix scalar_atom,vector_atom - // 0 for scalar_atom, 1-N for vector_atom values + int *field2index; // which compute,fix,variable calcs this field + int *argindex; // index into compute,fix scalar_atom,vector_atom + // 0 for scalar_atom, 1-N for vector_atom values - int ncompute; // # of Compute objects used by dump - char **id_compute; // their IDs - class Compute **compute; // list of ptrs to the Compute objects + int ncompute; // # of Compute objects used by dump + char **id_compute; // their IDs + class Compute **compute; // list of ptrs to the Compute objects - int nfix; // # of Fix objects used by dump - char **id_fix; // their IDs - class Fix **fix; // list of ptrs to the Fix objects + int nfix; // # of Fix objects used by dump + char **id_fix; // their IDs + class Fix **fix; // list of ptrs to the Fix objects - int nvariable; // # of Variables used by dump - char **id_variable; // their names - int *variable; // list of indices for the Variables - double **vbuf; // local storage for variable evaluation + int nvariable; // # of Variables used by dump + char **id_variable; // their names + int *variable; // list of indices for the Variables + double **vbuf; // local storage for variable evaluation - int ncustom; // # of custom atom properties - char **id_custom; // their names - int *flag_custom; // their data type + int ncustom; // # of custom atom properties + char **id_custom; // their names + int *flag_custom; // their data type - int ntypes; // # of atom types - char **typenames; // array of element names for each type + int ntypes; // # of atom types + char **typenames; // array of element names for each type // private methods @@ -120,19 +120,19 @@ class DumpCustom : public Dump { void format_revision_binary(); typedef void (DumpCustom::*FnPtrHeader)(bigint); - FnPtrHeader header_choice; // ptr to write header functions + FnPtrHeader header_choice; // ptr to write header functions void header_binary(bigint); void header_binary_triclinic(bigint); void header_item(bigint); void header_item_triclinic(bigint); typedef int (DumpCustom::*FnPtrConvert)(int, double *); - FnPtrConvert convert_choice; // ptr to convert data functions + FnPtrConvert convert_choice; // ptr to convert data functions int convert_image(int, double *); int convert_noimage(int, double *); typedef void (DumpCustom::*FnPtrWrite)(int, double *); - FnPtrWrite write_choice; // ptr to write data functions + FnPtrWrite write_choice; // ptr to write data functions void write_binary(int, double *); void write_string(int, double *); void write_lines(int, double *); @@ -140,7 +140,7 @@ class DumpCustom : public Dump { // customize by adding a method prototype typedef void (DumpCustom::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions + FnPtrPack *pack_choice; // ptrs to pack functions void pack_compute(int); void pack_fix(int); @@ -204,7 +204,7 @@ class DumpCustom : public Dump { void pack_tqz(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_dcd.cpp b/src/dump_dcd.cpp index 230a4f2d8d..268c273064 100644 --- a/src/dump_dcd.cpp +++ b/src/dump_dcd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dump_dcd.h b/src/dump_dcd.h index 7b32b8f17c..b445742104 100644 --- a/src/dump_dcd.h +++ b/src/dump_dcd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(dcd,DumpDCD) - +// clang-format off +DumpStyle(dcd,DumpDCD); +// clang-format on #else #ifndef LMP_DUMP_DCD_H @@ -26,15 +26,15 @@ namespace LAMMPS_NS { class DumpDCD : public Dump { public: - DumpDCD(LAMMPS *, int, char**); + DumpDCD(LAMMPS *, int, char **); virtual ~DumpDCD(); private: - int natoms,ntotal; - int headerflag,nevery_save,nframes; + int natoms, ntotal; + int headerflag, nevery_save, nframes; - float *coords,*xf,*yf,*zf; - int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no + float *coords, *xf, *yf, *zf; + int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no void init_style(); void openfile(); @@ -48,7 +48,7 @@ class DumpDCD : public Dump { void write_dcd_header(const char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_deprecated.cpp b/src/dump_deprecated.cpp index 8d99ee1b18..fdd9d06dbc 100644 --- a/src/dump_deprecated.cpp +++ b/src/dump_deprecated.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dump_deprecated.h b/src/dump_deprecated.h index 7b2f35728f..811fde2edb 100644 --- a/src/dump_deprecated.h +++ b/src/dump_deprecated.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - +// clang-format off // list all deprecated and removed dump styles here - -DumpStyle(DEPRECATED,DumpDeprecated) - +DumpStyle(DEPRECATED,DumpDeprecated); +// clang-format on #else #ifndef LMP_DUMP_DEPRECATED_H @@ -34,9 +33,9 @@ class DumpDeprecated : public Dump { virtual void write_header(bigint) {} virtual void pack(tagint *) {} virtual void write_data(int, double *) {} - }; +}; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_image.cpp b/src/dump_image.cpp index c5dd7b455a..f6ca49851d 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dump_image.h b/src/dump_image.h index 528aa9a8f7..e3bf1a9183 100644 --- a/src/dump_image.h +++ b/src/dump_image.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(image,DumpImage) - +// clang-format off +DumpStyle(image,DumpImage); +// clang-format on #else #ifndef LMP_DUMP_IMAGE_H @@ -26,69 +26,69 @@ namespace LAMMPS_NS { class DumpImage : public DumpCustom { public: - int multifile_override; // used by write_dump command + int multifile_override; // used by write_dump command - DumpImage(class LAMMPS *, int, char**); + DumpImage(class LAMMPS *, int, char **); virtual ~DumpImage(); int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); protected: int filetype; - enum{PPM,JPG,PNG}; + enum { PPM, JPG, PNG }; - int atomflag; // 0/1 for draw atoms - int acolor,adiam; // what determines color/diam of atoms - double adiamvalue; // atom diameter value + int atomflag; // 0/1 for draw atoms + int acolor, adiam; // what determines color/diam of atoms + double adiamvalue; // atom diameter value - int lineflag; // 0/1 for draw atoms as lines - int lcolor,ldiam; // what determines color/diam of lines - double ldiamvalue; // line diameter value - int triflag; // 0/1 for draw atoms as triangles - int tcolor,tstyle; // what determines color/style of tris - double tdiamvalue; // tri edge diameter value - int bodyflag; // 0/1 for draw atoms as bodies - int bodycolor; // what determines color of bodies - double bodyflag1,bodyflag2; // user-specified params for drawing bodies - int fixflag; // 0/1 to draw what fix provides - int fixcolor; // what determines color of fix objects - double fixflag1,fixflag2; // user-specified params for fix objects + int lineflag; // 0/1 for draw atoms as lines + int lcolor, ldiam; // what determines color/diam of lines + double ldiamvalue; // line diameter value + int triflag; // 0/1 for draw atoms as triangles + int tcolor, tstyle; // what determines color/style of tris + double tdiamvalue; // tri edge diameter value + int bodyflag; // 0/1 for draw atoms as bodies + int bodycolor; // what determines color of bodies + double bodyflag1, bodyflag2; // user-specified params for drawing bodies + int fixflag; // 0/1 to draw what fix provides + int fixcolor; // what determines color of fix objects + double fixflag1, fixflag2; // user-specified params for fix objects - int bondflag; // 0/1 for draw bonds - int bcolor,bdiam; // what determines color/diam of bonds - double bdiamvalue; // bond diameter value + int bondflag; // 0/1 for draw bonds + int bcolor, bdiam; // what determines color/diam of bonds + double bdiamvalue; // bond diameter value - int extraflag; // 0/1 for any of line/tri/body flag set - char *thetastr,*phistr; // variables for view theta,phi - int thetavar,phivar; // index to theta,phi vars - int cflag; // static/dynamic box center - double cx,cy,cz; // fractional box center - char *cxstr,*cystr,*czstr; // variables for box center - int cxvar,cyvar,czvar; // index to box center vars - char *upxstr,*upystr,*upzstr; // view up vector variables - int upxvar,upyvar,upzvar; // index to up vector vars - char *zoomstr; // view zoom variable name - int zoomvar; // index to zoom variable - int boxflag,axesflag; // 0/1 for draw box and axes - double boxdiam,axeslen,axesdiam; // params for drawing box and axes + int extraflag; // 0/1 for any of line/tri/body flag set + char *thetastr, *phistr; // variables for view theta,phi + int thetavar, phivar; // index to theta,phi vars + int cflag; // static/dynamic box center + double cx, cy, cz; // fractional box center + char *cxstr, *cystr, *czstr; // variables for box center + int cxvar, cyvar, czvar; // index to box center vars + char *upxstr, *upystr, *upzstr; // view up vector variables + int upxvar, upyvar, upzvar; // index to up vector vars + char *zoomstr; // view zoom variable name + int zoomvar; // index to zoom variable + int boxflag, axesflag; // 0/1 for draw box and axes + double boxdiam, axeslen, axesdiam; // params for drawing box and axes int subboxflag; double subboxdiam; - int viewflag; // overall view is static or dynamic + int viewflag; // overall view is static or dynamic - double *diamtype,*diamelement,*bdiamtype; // per-type diameters - double **colortype,**colorelement,**bcolortype; // per-type colors + double *diamtype, *diamelement, *bdiamtype; // per-type diameters + double **colortype, **colorelement, **bcolortype; // per-type colors class AtomVecLine *avec_line; // ptrs to atom style (sub)classes class AtomVecTri *avec_tri; class AtomVecBody *avec_body; - class Fix *fixptr; // ptr to Fix that provides image data + class Fix *fixptr; // ptr to Fix that provides image data - class Image *image; // class that renders each image + class Image *image; // class that renders each image - int *chooseghost; // extended choose array for comm - double **bufcopy; // buffer for communicating bond/atom info + int *chooseghost; // extended choose array for comm + double **bufcopy; // buffer for communicating bond/atom info int maxbufcopy; virtual void init_style(); @@ -102,7 +102,7 @@ class DumpImage : public DumpCustom { void create_image(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_local.cpp b/src/dump_local.cpp index 66f9bdb150..437d5c353c 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dump_local.h b/src/dump_local.h index 470f37a99c..1bbdbb1db7 100644 --- a/src/dump_local.h +++ b/src/dump_local.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(local,DumpLocal) - +// clang-format off +DumpStyle(local,DumpLocal); +// clang-format on #else #ifndef LMP_DUMP_LOCAL_H @@ -30,28 +30,28 @@ class DumpLocal : public Dump { virtual ~DumpLocal(); protected: - int nevery; // dump frequency to check Fix against - char *label; // string for dump file header + int nevery; // dump frequency to check Fix against + char *label; // string for dump file header - int nmine; // # of lines I am dumping - int *vtype; // type of each vector (INT, DOUBLE) - char **vformat; // format string for each vector element + int nmine; // # of lines I am dumping + int *vtype; // type of each vector (INT, DOUBLE) + char **vformat; // format string for each vector element - char *columns; // column labels + char *columns; // column labels - int nfield; // # of keywords listed by user + int nfield; // # of keywords listed by user - int *field2index; // which compute,fix,variable calcs this field - int *argindex; // index into compute,fix scalar_atom,vector_atom - // 0 for scalar_atom, 1-N for vector_atom values + int *field2index; // which compute,fix,variable calcs this field + int *argindex; // index into compute,fix scalar_atom,vector_atom + // 0 for scalar_atom, 1-N for vector_atom values - int ncompute; // # of Compute objects used by dump - char **id_compute; // their IDs - class Compute **compute; // list of ptrs to the Compute objects + int ncompute; // # of Compute objects used by dump + char **id_compute; // their IDs + class Compute **compute; // list of ptrs to the Compute objects - int nfix; // # of Fix objects used by dump - char **id_fix; // their IDs - class Fix **fix; // list of ptrs to the Fix objects + int nfix; // # of Fix objects used by dump + char **id_fix; // their IDs + class Fix **fix; // list of ptrs to the Fix objects void init_style(); int modify_param(int, char **); @@ -66,21 +66,21 @@ class DumpLocal : public Dump { int add_fix(const char *); typedef void (DumpLocal::*FnPtrWrite)(int, double *); - FnPtrWrite write_choice; // ptr to write data functions + FnPtrWrite write_choice; // ptr to write data functions void write_string(int, double *); void write_lines(int, double *); // customize by adding a method prototype typedef void (DumpLocal::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions + FnPtrPack *pack_choice; // ptrs to pack functions void pack_index(int); void pack_compute(int); void pack_fix(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_movie.cpp b/src/dump_movie.cpp index c224b9d292..fb834b5fb0 100644 --- a/src/dump_movie.cpp +++ b/src/dump_movie.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dump_movie.h b/src/dump_movie.h index e65d11cbc4..1c41cb09b5 100644 --- a/src/dump_movie.h +++ b/src/dump_movie.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(movie,DumpMovie) - +// clang-format off +DumpStyle(movie,DumpMovie); +// clang-format on #else #ifndef LMP_DUMP_MOVIE_H @@ -26,18 +26,18 @@ namespace LAMMPS_NS { class DumpMovie : public DumpImage { public: - DumpMovie(LAMMPS *, int, char**); + DumpMovie(LAMMPS *, int, char **); virtual void openfile(); virtual void init_style(); virtual int modify_param(int, char **); protected: - double framerate; // frame rate of animation - int bitrate; // bitrate of video file in kbps + double framerate; // frame rate of animation + int bitrate; // bitrate of video file in kbps }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_xyz.cpp b/src/dump_xyz.cpp index 5f478a2443..ebbd432f5d 100644 --- a/src/dump_xyz.cpp +++ b/src/dump_xyz.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/dump_xyz.h b/src/dump_xyz.h index 1733ce3c48..b517a1db13 100644 --- a/src/dump_xyz.h +++ b/src/dump_xyz.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef DUMP_CLASS - -DumpStyle(xyz,DumpXYZ) - +// clang-format off +DumpStyle(xyz,DumpXYZ); +// clang-format on #else #ifndef LMP_DUMP_XYZ_H @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class DumpXYZ : public Dump { public: - DumpXYZ(class LAMMPS *, int, char**); + DumpXYZ(class LAMMPS *, int, char **); virtual ~DumpXYZ(); protected: @@ -41,12 +41,12 @@ class DumpXYZ : public Dump { int modify_param(int, char **); typedef void (DumpXYZ::*FnPtrWrite)(int, double *); - FnPtrWrite write_choice; // ptr to write data functions + FnPtrWrite write_choice; // ptr to write data functions void write_string(int, double *); void write_lines(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/error.cpp b/src/error.cpp index 660acf775b..491c72bdbb 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/error.h b/src/error.h index fb82b05b34..b92a8f1e7a 100644 --- a/src/error.h +++ b/src/error.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -26,36 +26,38 @@ class Error : protected Pointers { public: Error(class LAMMPS *); - [[ noreturn ]] void universe_all(const std::string &, int, const std::string &); - [[ noreturn ]] void universe_one(const std::string &, int, const std::string &); + [[noreturn]] void universe_all(const std::string &, int, const std::string &); + [[noreturn]] void universe_one(const std::string &, int, const std::string &); void universe_warn(const std::string &, int, const std::string &); - [[ noreturn ]] void all(const std::string &, int, const std::string &); + [[noreturn]] void all(const std::string &, int, const std::string &); template - void all(const std::string &file, int line, const S &format, - Args&&... args) { + void all(const std::string &file, int line, const S &format, Args &&...args) + { _all(file, line, format, fmt::make_args_checked(format, args...)); } - [[ noreturn ]] void one(const std::string &, int, const std::string &); + [[noreturn]] void one(const std::string &, int, const std::string &); template - void one(const std::string &file, int line, const S &format, - Args&&... args) { + void one(const std::string &file, int line, const S &format, Args &&...args) + { _one(file, line, format, fmt::make_args_checked(format, args...)); } void warning(const std::string &, int, const std::string &); template - void warning(const std::string &file, int line, const S &format, Args&&... args) { + void warning(const std::string &file, int line, const S &format, Args &&...args) + { _warning(file, line, format, fmt::make_args_checked(format, args...)); } void message(const std::string &, int, const std::string &); template - void message(const std::string &file, int line, const S &format, Args&&... args) { + void message(const std::string &file, int line, const S &format, Args &&...args) + { _message(file, line, format, fmt::make_args_checked(format, args...)); } - [[ noreturn ]] void done(int = 0); // 1 would be fully backwards compatible + [[noreturn]] void done(int = 0); // 1 would be fully backwards compatible int get_numwarn() const { return numwarn; } int get_maxwarn() const { return maxwarn; } @@ -76,15 +78,13 @@ class Error : protected Pointers { private: int numwarn, maxwarn, allwarn; // internal versions that accept explicit fmtlib arguments - [[ noreturn ]] void _all(const std::string &, int, fmt::string_view, - fmt::format_args args); - [[ noreturn ]] void _one(const std::string &, int, fmt::string_view, - fmt::format_args args); + [[noreturn]] void _all(const std::string &, int, fmt::string_view, fmt::format_args args); + [[noreturn]] void _one(const std::string &, int, fmt::string_view, fmt::format_args args); void _warning(const std::string &, int, fmt::string_view, fmt::format_args args); void _message(const std::string &, int, fmt::string_view, fmt::format_args args); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/exceptions.h b/src/exceptions.h index 53d49b6fde..d05e14eeb7 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,45 +14,35 @@ #ifndef LMP_EXCEPTIONS_H #define LMP_EXCEPTIONS_H +#include #include #include -#include namespace LAMMPS_NS { -class LAMMPSException : public std::exception -{ -public: +class LAMMPSException : public std::exception { + public: std::string message; - LAMMPSException(const std::string &msg) : message(msg) { - } + LAMMPSException(const std::string &msg) : message(msg) {} - ~LAMMPSException() throw() { - } + ~LAMMPSException() throw() {} - virtual const char * what() const throw() { - return message.c_str(); - } + virtual const char *what() const throw() { return message.c_str(); } }; class LAMMPSAbortException : public LAMMPSException { -public: + public: MPI_Comm universe; LAMMPSAbortException(const std::string &msg, MPI_Comm universe) : - LAMMPSException(msg), - universe(universe) + LAMMPSException(msg), universe(universe) { } }; -enum ErrorType { - ERROR_NONE = 0, - ERROR_NORMAL = 1, - ERROR_ABORT = 2 -}; +enum ErrorType { ERROR_NONE = 0, ERROR_NORMAL = 1, ERROR_ABORT = 2 }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/file_writer.h b/src/file_writer.h index f9b4abcb59..473975d7fe 100644 --- a/src/file_writer.h +++ b/src/file_writer.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,30 +23,27 @@ namespace LAMMPS_NS { class FileWriter { -public: - FileWriter() = default; - virtual ~FileWriter() = default; - virtual void open(const std::string &path, bool append = false) = 0; - virtual void close() = 0; - virtual void flush() = 0; - virtual size_t write(const void * buffer, size_t length) = 0; - virtual bool isopen() const = 0; + public: + FileWriter() = default; + virtual ~FileWriter() = default; + virtual void open(const std::string &path, bool append = false) = 0; + virtual void close() = 0; + virtual void flush() = 0; + virtual size_t write(const void *buffer, size_t length) = 0; + virtual bool isopen() const = 0; }; class FileWriterException : public std::exception { std::string message; -public: - FileWriterException(const std::string &msg) : message(msg) { - } - ~FileWriterException() throw() { - } + public: + FileWriterException(const std::string &msg) : message(msg) {} - virtual const char * what() const throw() { - return message.c_str(); - } + ~FileWriterException() throw() {} + + virtual const char *what() const throw() { return message.c_str(); } }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/finish.cpp b/src/finish.cpp index 42dc163e13..210b48dcb7 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/finish.h b/src/finish.h index 08ee4e571a..8eeb4c213d 100644 --- a/src/finish.h +++ b/src/finish.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -27,7 +27,7 @@ class Finish : protected Pointers { void stats(int, double *, double *, double *, double *, int, int *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/fix.cpp b/src/fix.cpp index e3e2b12ed2..8f5b60535c 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix.h b/src/fix.h index c8e5d0900e..251c286ec0 100644 --- a/src/fix.h +++ b/src/fix.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,111 +14,119 @@ #ifndef LMP_FIX_H #define LMP_FIX_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Fix : protected Pointers { public: - static int instance_total; // # of Fix classes ever instantiated + static int instance_total; // # of Fix classes ever instantiated - char *id,*style; - int igroup,groupbit; + char *id, *style; + int igroup, groupbit; - int restart_global; // 1 if Fix saves global state, 0 if not - int restart_peratom; // 1 if Fix saves peratom state, 0 if not - int restart_file; // 1 if Fix writes own restart file, 0 if not - int force_reneighbor; // 1 if Fix forces reneighboring, 0 if not + int restart_global; // 1 if Fix saves global state, 0 if not + int restart_peratom; // 1 if Fix saves peratom state, 0 if not + int restart_file; // 1 if Fix writes own restart file, 0 if not + int force_reneighbor; // 1 if Fix forces reneighboring, 0 if not - int box_change; // >0 if Fix changes box size, shape, or sub-domains, 0 if not + int box_change; // >0 if Fix changes box size, shape, or sub-domains, 0 if not + // clang-format off enum { - NO_BOX_CHANGE = 0, BOX_CHANGE_ANY = 1<<0, BOX_CHANGE_DOMAIN = 1<<1, - BOX_CHANGE_X = 1<<2, BOX_CHANGE_Y = 1<<3, BOX_CHANGE_Z = 1<<4, - BOX_CHANGE_YZ = 1<<5, BOX_CHANGE_XZ = 1<<6, BOX_CHANGE_XY = 1<<7, - BOX_CHANGE_SIZE = BOX_CHANGE_X | BOX_CHANGE_Y | BOX_CHANGE_Z, - BOX_CHANGE_SHAPE = BOX_CHANGE_YZ | BOX_CHANGE_XZ | BOX_CHANGE_XY + NO_BOX_CHANGE = 0, + BOX_CHANGE_ANY = 1 << 0, + BOX_CHANGE_DOMAIN = 1 << 1, + BOX_CHANGE_X = 1 << 2, + BOX_CHANGE_Y = 1 << 3, + BOX_CHANGE_Z = 1 << 4, + BOX_CHANGE_YZ = 1 << 5, + BOX_CHANGE_XZ = 1 << 6, + BOX_CHANGE_XY = 1 << 7, + BOX_CHANGE_SIZE = BOX_CHANGE_X | BOX_CHANGE_Y | BOX_CHANGE_Z, + BOX_CHANGE_SHAPE = BOX_CHANGE_YZ | BOX_CHANGE_XZ | BOX_CHANGE_XY }; + // clang-format on - bigint next_reneighbor; // next timestep to force a reneighboring - int nevery; // how often to call an end_of_step fix - int thermo_energy; // 1 if fix_modify energy enabled, 0 if not - int thermo_virial; // 1 if fix_modify virial enabled, 0 if not - int energy_global_flag; // 1 if contributes to global eng - int energy_peratom_flag; // 1 if contributes to peratom eng - int virial_global_flag; // 1 if contributes to global virial - int virial_peratom_flag; // 1 if contributes to peratom virial - int ecouple_flag; // 1 if thermostat fix outputs cumulative - // reservoir energy via compute_scalar() - int time_integrate; // 1 if performs time integration, 0 if no - int rigid_flag; // 1 if integrates rigid bodies, 0 if not - int no_change_box; // 1 if cannot swap ortho <-> triclinic - int time_depend; // 1 if requires continuous timestepping - int create_attribute; // 1 if fix stores attributes that need - // setting when a new atom is created - int restart_pbc; // 1 if fix moves atoms (except integrate) - // so write_restart must remap to PBC - int wd_header; // # of header values fix writes to data file - int wd_section; // # of sections fix writes to data file - int dynamic_group_allow; // 1 if can be used with dynamic group, else 0 - int dof_flag; // 1 if has dof() method (not min_dof()) - int special_alter_flag; // 1 if has special_alter() meth for spec lists - int enforce2d_flag; // 1 if has enforce2d method - int respa_level_support; // 1 if fix supports fix_modify respa - int respa_level; // which respa level to apply fix (1-Nrespa) - int maxexchange; // max # of per-atom values for Comm::exchange() - int maxexchange_dynamic; // 1 if fix sets maxexchange dynamically - int pre_exchange_migrate; // 1 if fix migrates atoms in pre_exchange() - int stores_ids; // 1 if fix stores atom IDs + bigint next_reneighbor; // next timestep to force a reneighboring + int nevery; // how often to call an end_of_step fix + int thermo_energy; // 1 if fix_modify energy enabled, 0 if not + int thermo_virial; // 1 if fix_modify virial enabled, 0 if not + int energy_global_flag; // 1 if contributes to global eng + int energy_peratom_flag; // 1 if contributes to peratom eng + int virial_global_flag; // 1 if contributes to global virial + int virial_peratom_flag; // 1 if contributes to peratom virial + int ecouple_flag; // 1 if thermostat fix outputs cumulative + // reservoir energy via compute_scalar() + int time_integrate; // 1 if performs time integration, 0 if no + int rigid_flag; // 1 if integrates rigid bodies, 0 if not + int no_change_box; // 1 if cannot swap ortho <-> triclinic + int time_depend; // 1 if requires continuous timestepping + int create_attribute; // 1 if fix stores attributes that need + // setting when a new atom is created + int restart_pbc; // 1 if fix moves atoms (except integrate) + // so write_restart must remap to PBC + int wd_header; // # of header values fix writes to data file + int wd_section; // # of sections fix writes to data file + int dynamic_group_allow; // 1 if can be used with dynamic group, else 0 + int dof_flag; // 1 if has dof() method (not min_dof()) + int special_alter_flag; // 1 if has special_alter() meth for spec lists + int enforce2d_flag; // 1 if has enforce2d method + int respa_level_support; // 1 if fix supports fix_modify respa + int respa_level; // which respa level to apply fix (1-Nrespa) + int maxexchange; // max # of per-atom values for Comm::exchange() + int maxexchange_dynamic; // 1 if fix sets maxexchange dynamically + int pre_exchange_migrate; // 1 if fix migrates atoms in pre_exchange() + int stores_ids; // 1 if fix stores atom IDs - int scalar_flag; // 0/1 if compute_scalar() function exists - int vector_flag; // 0/1 if compute_vector() function exists - int array_flag; // 0/1 if compute_array() function exists - int size_vector; // length of global vector - int size_array_rows; // rows in global array - int size_array_cols; // columns in global array - int size_vector_variable; // 1 if vec length is unknown in advance - int size_array_rows_variable; // 1 if array rows is unknown in advance - int global_freq; // frequency s/v data is available at + int scalar_flag; // 0/1 if compute_scalar() function exists + int vector_flag; // 0/1 if compute_vector() function exists + int array_flag; // 0/1 if compute_array() function exists + int size_vector; // length of global vector + int size_array_rows; // rows in global array + int size_array_cols; // columns in global array + int size_vector_variable; // 1 if vec length is unknown in advance + int size_array_rows_variable; // 1 if array rows is unknown in advance + int global_freq; // frequency s/v data is available at - int peratom_flag; // 0/1 if per-atom data is stored - int size_peratom_cols; // 0 = vector, N = columns in peratom array - int peratom_freq; // frequency per-atom data is available at + int peratom_flag; // 0/1 if per-atom data is stored + int size_peratom_cols; // 0 = vector, N = columns in peratom array + int peratom_freq; // frequency per-atom data is available at - int local_flag; // 0/1 if local data is stored - int size_local_rows; // rows in local vector or array - int size_local_cols; // 0 = vector, N = columns in local array - int local_freq; // frequency local data is available at + int local_flag; // 0/1 if local data is stored + int size_local_rows; // rows in local vector or array + int size_local_cols; // 0 = vector, N = columns in local array + int local_freq; // frequency local data is available at - int extscalar; // 0/1 if global scalar is intensive/extensive - int extvector; // 0/1/-1 if global vector is all int/ext/extlist - int *extlist; // list of 0/1 int/ext for each vec component - int extarray; // 0/1 if global array is intensive/extensive + int extscalar; // 0/1 if global scalar is intensive/extensive + int extvector; // 0/1/-1 if global vector is all int/ext/extlist + int *extlist; // list of 0/1 int/ext for each vec component + int extarray; // 0/1 if global array is intensive/extensive - double *vector_atom; // computed per-atom vector - double **array_atom; // computed per-atom array - double *vector_local; // computed local vector - double **array_local; // computed local array + double *vector_atom; // computed per-atom vector + double **array_atom; // computed per-atom array + double *vector_local; // computed local vector + double **array_local; // computed local array - int comm_forward; // size of forward communication (0 if none) - int comm_reverse; // size of reverse communication (0 if none) - int comm_border; // size of border communication (0 if none) + int comm_forward; // size of forward communication (0 if none) + int comm_reverse; // size of reverse communication (0 if none) + int comm_border; // size of border communication (0 if none) - double virial[6]; // virial for this timestep - double *eatom,**vatom; // per-atom energy/virial for this timestep + double virial[6]; // virial for this timestep + double *eatom, **vatom; // per-atom energy/virial for this timestep - int centroidstressflag; // centroid stress compared to two-body stress - // CENTROID_SAME = same as two-body stress - // CENTROID_AVAIL = different and implemented - // CENTROID_NOTAVAIL = different, not yet implemented + int centroidstressflag; // centroid stress compared to two-body stress + // CENTROID_SAME = same as two-body stress + // CENTROID_AVAIL = different and implemented + // CENTROID_NOTAVAIL = different, not yet implemented - int restart_reset; // 1 if restart just re-initialized fix + int restart_reset; // 1 if restart just re-initialized fix // KOKKOS host/device flag and data masks - int kokkosable; // 1 if Kokkos fix - int forward_comm_device; // 1 if forward comm on Device + int kokkosable; // 1 if Kokkos fix + int forward_comm_device; // 1 if forward comm on Device ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; Fix(class LAMMPS *, int, char **); virtual ~Fix(); @@ -142,7 +150,7 @@ class Fix : protected Pointers { virtual void pre_neighbor() {} virtual void post_neighbor() {} virtual void pre_force(int) {} - virtual void pre_reverse(int,int) {} + virtual void pre_reverse(int, int) {} virtual void post_force(int) {} virtual void final_integrate() {} virtual void end_of_step() {} @@ -158,14 +166,14 @@ class Fix : protected Pointers { virtual void set_molecule(int, tagint, int, double *, double *, double *); virtual void clear_bonus() {} - virtual int pack_border(int, int *, double *) {return 0;} - virtual int unpack_border(int, int, double *) {return 0;} - virtual int pack_exchange(int, double *) {return 0;} - virtual int unpack_exchange(int, double *) {return 0;} - virtual int pack_restart(int, double *) {return 0;} + virtual int pack_border(int, int *, double *) { return 0; } + virtual int unpack_border(int, int, double *) { return 0; } + virtual int pack_exchange(int, double *) { return 0; } + virtual int unpack_exchange(int, double *) { return 0; } + virtual int pack_restart(int, double *) { return 0; } virtual void unpack_restart(int, int) {} - virtual int size_restart(int) {return 0;} - virtual int maxsize_restart() {return 0;} + virtual int size_restart(int) { return 0; } + virtual int maxsize_restart() { return 0; } virtual void setup_pre_force_respa(int, int) {} virtual void initial_integrate_respa(int, int, int) {} @@ -178,30 +186,30 @@ class Fix : protected Pointers { virtual void min_pre_neighbor() {} virtual void min_post_neighbor() {} virtual void min_pre_force(int) {} - virtual void min_pre_reverse(int,int) {} + virtual void min_pre_reverse(int, int) {} virtual void min_post_force(int) {} - virtual double min_energy(double *) {return 0.0;} + virtual double min_energy(double *) { return 0.0; } virtual void min_store() {} virtual void min_clearstore() {} virtual void min_pushstore() {} virtual void min_popstore() {} - virtual int min_reset_ref() {return 0;} + virtual int min_reset_ref() { return 0; } virtual void min_step(double, double *) {} - virtual double max_alpha(double *) {return 0.0;} - virtual int min_dof() {return 0;} + virtual double max_alpha(double *) { return 0.0; } + virtual int min_dof() { return 0; } - virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;} + 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_size(int, int) {return 0;} - virtual int pack_reverse_comm(int, int, double *) {return 0;} + virtual int pack_reverse_comm_size(int, int) { return 0; } + virtual int pack_reverse_comm(int, int, double *) { return 0; } virtual void unpack_reverse_comm(int, int *, double *) {} - virtual double compute_scalar() {return 0.0;} - virtual double compute_vector(int) {return 0.0;} - virtual double compute_array(int,int) {return 0.0;} + virtual double compute_scalar() { return 0.0; } + virtual double compute_vector(int) { return 0.0; } + virtual double compute_array(int, int) { return 0.0; } - virtual int dof(int) {return 0;} + virtual int dof(int) { return 0; } virtual void deform(int) {} virtual void reset_target(double) {} virtual void reset_dt() {} @@ -209,7 +217,7 @@ class Fix : protected Pointers { virtual void read_data_header(char *) {} virtual void read_data_section(char *, int, char *, tagint) {} - virtual bigint read_data_skip_lines(char *) {return 0;} + virtual bigint read_data_skip_lines(char *) { return 0; } virtual void write_data_header(FILE *, int) {} virtual void write_data_section_size(int, int &, int &) {} @@ -222,37 +230,43 @@ class Fix : protected Pointers { virtual void rebuild_special() {} - virtual int image(int *&, double **&) {return 0;} + virtual int image(int *&, double **&) { return 0; } - virtual int modify_param(int, char **) {return 0;} - virtual void *extract(const char *, int &) {return nullptr;} + virtual int modify_param(int, char **) { return 0; } + virtual void *extract(const char *, int &) { return nullptr; } - virtual double memory_usage() {return 0.0;} + virtual double memory_usage() { return 0.0; } protected: - int instance_me; // which Fix class instantiation I am + int instance_me; // which Fix class instantiation I am int evflag; - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom; - int maxeatom,maxvatom; + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom; + int maxeatom, maxvatom; - int copymode; // if set, do not deallocate during destruction - // required when classes are used as functors by Kokkos + int copymode; // if set, do not deallocate during destruction + // required when classes are used as functors by Kokkos int dynamic; // recount atoms for temperature computes - void ev_init(int eflag, int vflag) { - if ((eflag && thermo_energy) || (vflag && thermo_virial)) ev_setup(eflag, vflag); - else evflag = eflag_either = eflag_global = eflag_atom = - vflag_either = vflag_global = vflag_atom = 0; + void ev_init(int eflag, int vflag) + { + if ((eflag && thermo_energy) || (vflag && thermo_virial)) + ev_setup(eflag, vflag); + else + evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = + 0; } void ev_setup(int, int); void ev_tally(int, int *, double, double, double *); - void v_init(int vflag) { - if (vflag && thermo_virial) v_setup(vflag); - else evflag = vflag_either = vflag_global = vflag_atom = 0; + void v_init(int vflag) + { + if (vflag && thermo_virial) + v_setup(vflag); + else + evflag = vflag_either = vflag_global = vflag_atom = 0; } void v_setup(int); void v_tally(int, int *, double, double *); @@ -262,33 +276,33 @@ class Fix : protected Pointers { namespace FixConst { enum { - INITIAL_INTEGRATE = 1<<0, - POST_INTEGRATE = 1<<1, - PRE_EXCHANGE = 1<<2, - PRE_NEIGHBOR = 1<<3, - POST_NEIGHBOR = 1<<4, - PRE_FORCE = 1<<5, - PRE_REVERSE = 1<<6, - POST_FORCE = 1<<7, - FINAL_INTEGRATE = 1<<8, - END_OF_STEP = 1<<9, - POST_RUN = 1<<10, - INITIAL_INTEGRATE_RESPA = 1<<11, - POST_INTEGRATE_RESPA = 1<<12, - PRE_FORCE_RESPA = 1<<13, - POST_FORCE_RESPA = 1<<14, - FINAL_INTEGRATE_RESPA = 1<<15, - MIN_PRE_EXCHANGE = 1<<16, - MIN_PRE_NEIGHBOR = 1<<17, - MIN_POST_NEIGHBOR = 1<<18, - MIN_PRE_FORCE = 1<<19, - MIN_PRE_REVERSE = 1<<20, - MIN_POST_FORCE = 1<<21, - MIN_ENERGY = 1<<22 + INITIAL_INTEGRATE = 1 << 0, + POST_INTEGRATE = 1 << 1, + PRE_EXCHANGE = 1 << 2, + PRE_NEIGHBOR = 1 << 3, + POST_NEIGHBOR = 1 << 4, + PRE_FORCE = 1 << 5, + PRE_REVERSE = 1 << 6, + POST_FORCE = 1 << 7, + FINAL_INTEGRATE = 1 << 8, + END_OF_STEP = 1 << 9, + POST_RUN = 1 << 10, + INITIAL_INTEGRATE_RESPA = 1 << 11, + POST_INTEGRATE_RESPA = 1 << 12, + PRE_FORCE_RESPA = 1 << 13, + POST_FORCE_RESPA = 1 << 14, + FINAL_INTEGRATE_RESPA = 1 << 15, + MIN_PRE_EXCHANGE = 1 << 16, + MIN_PRE_NEIGHBOR = 1 << 17, + MIN_POST_NEIGHBOR = 1 << 18, + MIN_PRE_FORCE = 1 << 19, + MIN_PRE_REVERSE = 1 << 20, + MIN_POST_FORCE = 1 << 21, + MIN_ENERGY = 1 << 22 }; } -} +} // namespace LAMMPS_NS #endif diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index 7db16badc9..670c0dc4be 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_adapt.h b/src/fix_adapt.h index 18e1837160..db3dcf269c 100644 --- a/src/fix_adapt.h +++ b/src/fix_adapt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(adapt,FixAdapt) - +// clang-format off +FixStyle(adapt,FixAdapt); +// clang-format on #else #ifndef LMP_FIX_ADAPT_H @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixAdapt : public Fix { public: - int diamflag; // 1 if atom diameters will vary, for AtomVecGranular + int diamflag; // 1 if atom diameters will vary, for AtomVecGranular int chgflag; FixAdapt(class LAMMPS *, int, char **); @@ -37,31 +37,31 @@ class FixAdapt : public Fix { void setup_pre_force(int); void pre_force(int); void post_run(); - void setup_pre_force_respa(int,int); - void pre_force_respa(int,int,int); + void setup_pre_force_respa(int, int); + void pre_force_respa(int, int, int); void set_arrays(int); void write_restart(FILE *); void restart(char *); private: - int nadapt,resetflag,scaleflag,massflag; + int nadapt, resetflag, scaleflag, massflag; int anypair, anybond; int nlevels_respa; - char *id_fix_diam,*id_fix_chg; - class FixStore *fix_diam,*fix_chg; - double previous_diam_scale,previous_chg_scale; + char *id_fix_diam, *id_fix_chg; + class FixStore *fix_diam, *fix_chg; + double previous_diam_scale, previous_chg_scale; int discflag; struct Adapt { - int which,ivar; + int which, ivar; char *var; - char *pstyle,*pparam; - char *bstyle,*bparam; - int ilo,ihi,jlo,jhi; - int pdim,bdim; - double *scalar,scalar_orig; - double *vector,*vector_orig; - double **array,**array_orig; + char *pstyle, *pparam; + char *bstyle, *bparam; + int ilo, ihi, jlo, jhi; + int pdim, bdim; + double *scalar, scalar_orig; + double *vector, *vector_orig; + double **array, **array_orig; int aparam; class Pair *pair; class Bond *bond; @@ -74,7 +74,7 @@ class FixAdapt : public Fix { void restore_settings(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index a9f6248995..1aff86fb58 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_addforce.h b/src/fix_addforce.h index da7890bf6e..507bb26acb 100644 --- a/src/fix_addforce.h +++ b/src/fix_addforce.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(addforce,FixAddForce) - +// clang-format off +FixStyle(addforce,FixAddForce); +// clang-format on #else #ifndef LMP_FIX_ADDFORCE_H @@ -40,12 +40,12 @@ class FixAddForce : public Fix { double memory_usage(); private: - double xvalue,yvalue,zvalue; - int varflag,iregion; - char *xstr,*ystr,*zstr,*estr; + double xvalue, yvalue, zvalue; + int varflag, iregion; + char *xstr, *ystr, *zstr, *estr; char *idregion; - int xvar,yvar,zvar,evar,xstyle,ystyle,zstyle,estyle; - double foriginal[4],foriginal_all[4]; + int xvar, yvar, zvar, evar, xstyle, ystyle, zstyle, estyle; + double foriginal[4], foriginal_all[4]; int force_flag; int ilevel_respa; @@ -53,7 +53,7 @@ class FixAddForce : public Fix { double **sforce; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index affdf001f9..1b55e65bb1 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_ave_atom.h b/src/fix_ave_atom.h index a24da0878e..0cb1ad80bc 100644 --- a/src/fix_ave_atom.h +++ b/src/fix_ave_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(ave/atom,FixAveAtom) - +// clang-format off +FixStyle(ave/atom,FixAveAtom); +// clang-format on #else #ifndef LMP_FIX_AVE_ATOM_H @@ -41,16 +41,16 @@ class FixAveAtom : public Fix { private: int nvalues; - int nrepeat,irepeat; - bigint nvalid,nvalid_last; - int *which,*argindex,*value2index; + int nrepeat, irepeat; + bigint nvalid, nvalid_last; + int *which, *argindex, *value2index; char **ids; double **array; bigint nextvalid(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index 16e1bbc001..1328a27376 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_ave_chunk.h b/src/fix_ave_chunk.h index 09424f21c7..e7beed341f 100644 --- a/src/fix_ave_chunk.h +++ b/src/fix_ave_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(ave/chunk,FixAveChunk) - +// clang-format off +FixStyle(ave/chunk,FixAveChunk); +// clang-format on #else #ifndef LMP_FIX_AVE_CHUNK_H @@ -32,31 +32,31 @@ class FixAveChunk : public Fix { void init(); void setup(int); void end_of_step(); - double compute_array(int,int); + double compute_array(int, int); double memory_usage(); private: int nvalues; - int nrepeat,nfreq,irepeat; - int normflag,scaleflag,overwrite,biasflag,colextra; - bigint nvalid,nvalid_last; - double adof,cdof; - char *format,*format_user; - char *tstring,*sstring,*id_bias; - int *which,*argindex,*value2index; + int nrepeat, nfreq, irepeat; + int normflag, scaleflag, overwrite, biasflag, colextra; + bigint nvalid, nvalid_last; + double adof, cdof; + char *format, *format_user; + char *tstring, *sstring, *id_bias; + int *which, *argindex, *value2index; char **ids; - class Compute *tbias; // ptr to additional bias compute + class Compute *tbias; // ptr to additional bias compute FILE *fp; - int densityflag; // 1 if density/number or density/mass requested - int volflag; // SCALAR/VECTOR for density normalization by volume + int densityflag; // 1 if density/number or density/mass requested + int volflag; // SCALAR/VECTOR for density normalization by volume double chunk_volume_scalar; double *chunk_volume_vec; - int ave,nwindow; - int normcount,iwindow,window_limit; + int ave, nwindow; + int normcount, iwindow, window_limit; - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; int lockforever; @@ -69,16 +69,16 @@ class FixAveChunk : public Fix { // one,many,sum vecs/arrays are used with a single Nfreq epoch // total,list vecs/arrays are used across epochs - double *count_one,*count_many,*count_sum; - double **values_one,**values_many,**values_sum; - double *count_total,**count_list; - double **values_total,***values_list; + double *count_one, *count_many, *count_sum; + double **values_one, **values_many, **values_sum; + double *count_total, **count_list; + double **values_total, ***values_list; void allocate(); bigint nextvalid(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index 8793793682..92b5ea3693 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_ave_correlate.h b/src/fix_ave_correlate.h index 3a44ed141a..d551ba7b92 100644 --- a/src/fix_ave_correlate.h +++ b/src/fix_ave_correlate.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(ave/correlate,FixAveCorrelate) - +// clang-format off +FixStyle(ave/correlate,FixAveCorrelate); +// clang-format on #else #ifndef LMP_FIX_AVE_CORRELATE_H @@ -32,36 +32,36 @@ class FixAveCorrelate : public Fix { void init(); void setup(int); void end_of_step(); - double compute_array(int,int); + double compute_array(int, int); private: - int me,nvalues; - int nrepeat,nfreq; - bigint nvalid,nvalid_last; - int *which,*argindex,*value2index; + int me, nvalues; + int nrepeat, nfreq; + bigint nvalid, nvalid_last; + int *which, *argindex, *value2index; char **ids; FILE *fp; - int type,ave,startstep,overwrite; + int type, ave, startstep, overwrite; double prefactor; long filepos; - int firstindex; // index in values ring of earliest time sample - int lastindex; // index in values ring of latest time sample - int nsample; // number of time samples in values ring + int firstindex; // index in values ring of earliest time sample + int lastindex; // index in values ring of latest time sample + int nsample; // number of time samples in values ring - int npair; // number of correlation pairs to calculate + int npair; // number of correlation pairs to calculate int *count; - double **values,**corr; + double **values, **corr; - int *save_count; // saved values at Nfreq for output via compute_array() + int *save_count; // saved values at Nfreq for output via compute_array() double **save_corr; void accumulate(); bigint nextvalid(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index 7cacbda407..92b03035b3 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_ave_histo.h b/src/fix_ave_histo.h index 52c42a52e7..0158d04377 100644 --- a/src/fix_ave_histo.h +++ b/src/fix_ave_histo.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(ave/histo,FixAveHisto) - +// clang-format off +FixStyle(ave/histo,FixAveHisto); +// clang-format on #else #ifndef LMP_FIX_AVE_HISTO_H @@ -33,33 +33,33 @@ class FixAveHisto : public Fix { void setup(int); virtual void end_of_step(); double compute_vector(int); - double compute_array(int,int); + double compute_array(int, int); protected: - int me,nvalues; - int nrepeat,nfreq,irepeat; - bigint nvalid,nvalid_last; - int *which,*argindex,*value2index; + int me, nvalues; + int nrepeat, nfreq, irepeat; + bigint nvalid, nvalid_last; + int *which, *argindex, *value2index; char **ids; FILE *fp; - double lo,hi,binsize,bininv; - int kind,beyond,overwrite; + double lo, hi, binsize, bininv; + int kind, beyond, overwrite; long filepos; - double stats[4],stats_total[4],stats_all[4]; + double stats[4], stats_total[4], stats_all[4]; double **stats_list; int nbins; - double *bin,*bin_total,*bin_all; + double *bin, *bin_total, *bin_all; double **bin_list; double *coord; double *vector; int maxatom; - int ave,nwindow,startstep,mode; - char *title1,*title2,*title3; - int iwindow,window_limit; + int ave, nwindow, startstep, mode; + char *title1, *title2, *title3; + int iwindow, window_limit; void bin_one(double); void bin_vector(int, double *, int); @@ -68,7 +68,7 @@ class FixAveHisto : public Fix { bigint nextvalid(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_ave_histo_weight.cpp b/src/fix_ave_histo_weight.cpp index 27412cf9ef..63321bf53e 100644 --- a/src/fix_ave_histo_weight.cpp +++ b/src/fix_ave_histo_weight.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_ave_histo_weight.h b/src/fix_ave_histo_weight.h index f7b54204bb..cd1d1c0465 100644 --- a/src/fix_ave_histo_weight.h +++ b/src/fix_ave_histo_weight.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(ave/histo/weight,FixAveHistoWeight) - +// clang-format off +FixStyle(ave/histo/weight,FixAveHistoWeight); +// clang-format on #else #ifndef LMP_FIX_AVE_HISTO_WEIGHT_H @@ -36,7 +36,7 @@ class FixAveHistoWeight : public FixAveHisto { void bin_atoms_weights(double *, int, double *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index a434a6990f..da9cd89e5e 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_ave_time.h b/src/fix_ave_time.h index a1658e0037..391a06f495 100644 --- a/src/fix_ave_time.h +++ b/src/fix_ave_time.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(ave/time,FixAveTime) - +// clang-format off +FixStyle(ave/time,FixAveTime); +// clang-format on #else #ifndef LMP_FIX_AVE_TIME_H @@ -34,14 +34,14 @@ class FixAveTime : public Fix { void end_of_step(); double compute_scalar(); double compute_vector(int); - double compute_array(int,int); + double compute_array(int, int); private: - int me,nvalues; - int nrepeat,nfreq,irepeat; - bigint nvalid,nvalid_last; - int *which,*argindex,*value2index,*offcol; - int *varlen; // 1 if value is from variable-length compute + int me, nvalues; + int nrepeat, nfreq, irepeat; + bigint nvalid, nvalid_last; + int *which, *argindex, *value2index, *offcol; + int *varlen; // 1 if value is from variable-length compute char **ids; FILE *fp; int nrows; @@ -49,14 +49,14 @@ class FixAveTime : public Fix { int all_variable_length; int lockforever; - int ave,nwindow,startstep,mode; - int noff,overwrite; + int ave, nwindow, startstep, mode; + int noff, overwrite; int *offlist; - char *format,*format_user; - char *title1,*title2,*title3; + char *format, *format_user; + char *title1, *title2, *title3; long filepos; - int norm,iwindow,window_limit; + int norm, iwindow, window_limit; double *vector; double *vector_total; double **vector_list; @@ -73,7 +73,7 @@ class FixAveTime : public Fix { bigint nextvalid(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_aveforce.cpp b/src/fix_aveforce.cpp index 867643499a..cd8009c81b 100644 --- a/src/fix_aveforce.cpp +++ b/src/fix_aveforce.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_aveforce.h b/src/fix_aveforce.h index 0c6c28224f..c9e7735a42 100644 --- a/src/fix_aveforce.h +++ b/src/fix_aveforce.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(aveforce,FixAveForce) - +// clang-format off +FixStyle(aveforce,FixAveForce); +// clang-format on #else #ifndef LMP_FIX_AVEFORCE_H @@ -38,17 +38,17 @@ class FixAveForce : public Fix { double compute_vector(int); private: - double xvalue,yvalue,zvalue; + double xvalue, yvalue, zvalue; int varflag; - char *xstr,*ystr,*zstr; + char *xstr, *ystr, *zstr; char *idregion; - int xvar,yvar,zvar,xstyle,ystyle,zstyle; + int xvar, yvar, zvar, xstyle, ystyle, zstyle; int iregion; double foriginal_all[4]; - int nlevels_respa,ilevel_respa; + int nlevels_respa, ilevel_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_balance.cpp b/src/fix_balance.cpp index 889fd60430..40fa7255f6 100644 --- a/src/fix_balance.cpp +++ b/src/fix_balance.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_balance.h b/src/fix_balance.h index 588ce9892f..02e4a159a9 100644 --- a/src/fix_balance.h +++ b/src/fix_balance.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(balance,FixBalance) - +// clang-format off +FixStyle(balance,FixBalance); +// clang-format on #else #ifndef LMP_FIX_BALANCE_H @@ -40,19 +40,19 @@ class FixBalance : public Fix { double memory_usage(); private: - int nevery,lbstyle,nitermax; - double thresh,stopthresh; + int nevery, lbstyle, nitermax; + double thresh, stopthresh; char bstr[4]; - int wtflag; // 1 for weighted balancing + int wtflag; // 1 for weighted balancing - double imbnow; // current imbalance factor - double imbprev; // imbalance factor before last rebalancing - double imbfinal; // imbalance factor after last rebalancing - double maxloadperproc; // max load on any processor - int itercount; // iteration count of last call to Balance - int kspace_flag; // 1 if KSpace solver defined + double imbnow; // current imbalance factor + double imbprev; // imbalance factor before last rebalancing + double imbfinal; // imbalance factor after last rebalancing + double maxloadperproc; // max load on any processor + int itercount; // iteration count of last call to Balance + int kspace_flag; // 1 if KSpace solver defined int pending; - bigint lastbalance; // last timestep balancing was attempted + bigint lastbalance; // last timestep balancing was attempted class Balance *balance; class Irregular *irregular; @@ -60,7 +60,7 @@ class FixBalance : public Fix { void rebalance(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_box_relax.cpp b/src/fix_box_relax.cpp index 76bd8f05c2..8783e12b75 100644 --- a/src/fix_box_relax.cpp +++ b/src/fix_box_relax.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_box_relax.h b/src/fix_box_relax.h index 19fa2f8db5..228f1ad88a 100644 --- a/src/fix_box_relax.h +++ b/src/fix_box_relax.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(box/relax,FixBoxRelax) - +// clang-format off +FixStyle(box/relax,FixBoxRelax); +// clang-format on #else #ifndef LMP_FIX_BOX_RELAX_H @@ -45,42 +45,42 @@ class FixBoxRelax : public Fix { private: int p_flag[6]; - int pstyle,pcouple,allremap; + int pstyle, pcouple, allremap; int dimension; - double p_target[6],p_current[6]; - double vol0,xprdinit,yprdinit,zprdinit; - double vmax,pv2e,pflagsum; + double p_target[6], p_current[6]; + double vol0, xprdinit, yprdinit, zprdinit; + double vmax, pv2e, pflagsum; int kspace_flag; - int current_lifo; // LIFO stack pointer - double boxlo0[2][3]; // box bounds at start of line search + int current_lifo; // LIFO stack pointer + double boxlo0[2][3]; // box bounds at start of line search double boxhi0[2][3]; - double boxtilt0[2][3]; // xy,xz,yz tilts at start of line search - double ds[6]; // increment in scale matrix + double boxtilt0[2][3]; // xy,xz,yz tilts at start of line search + double ds[6]; // increment in scale matrix - int scaleyz; // 1 if yz scaled with lz - int scalexz; // 1 if xz scaled with lz - int scalexy; // 1 if xy scaled with ly + int scaleyz; // 1 if yz scaled with lz + int scalexz; // 1 if xz scaled with lz + int scalexy; // 1 if xy scaled with ly - double fixedpoint[3]; // Location of dilation fixed-point + double fixedpoint[3]; // Location of dilation fixed-point - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tflag,pflag; + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tflag, pflag; int nrigid; int *rfix; - double sigma[6]; // scaled target stress - double utsigma[3]; // weighting for upper-tri elements - // of modified sigma - int sigmamod_flag; // 1 if modified sigma to be used - double fdev[6]; // Deviatoric force on cell - int deviatoric_flag; // 0 if target stress tensor is hydrostatic - double h0[6]; // h_inv of reference (zero strain) box - double h0_inv[6]; // h_inv of reference (zero strain) box - int nreset_h0; // interval for resetting h0 - double p_hydro; // hydrostatic component of target stress + double sigma[6]; // scaled target stress + double utsigma[3]; // weighting for upper-tri elements + // of modified sigma + int sigmamod_flag; // 1 if modified sigma to be used + double fdev[6]; // Deviatoric force on cell + int deviatoric_flag; // 0 if target stress tensor is hydrostatic + double h0[6]; // h_inv of reference (zero strain) box + double h0_inv[6]; // h_inv of reference (zero strain) box + int nreset_h0; // interval for resetting h0 + double p_hydro; // hydrostatic component of target stress void remap(); void couple(); @@ -92,7 +92,7 @@ class FixBoxRelax : public Fix { double compute_scalar(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_controller.cpp b/src/fix_controller.cpp index c611dee271..71005e4427 100644 --- a/src/fix_controller.cpp +++ b/src/fix_controller.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_controller.h b/src/fix_controller.h index 1c98b3bbf9..b5678690bd 100644 --- a/src/fix_controller.h +++ b/src/fix_controller.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(controller,FixController) - +// clang-format off +FixStyle(controller,FixController); +// clang-format on #else #ifndef LMP_FIX_CONTROLLER_H @@ -35,20 +35,20 @@ class FixController : public Fix { double compute_vector(int); private: - double kp,ki,kd,alpha,tau; + double kp, ki, kd, alpha, tau; double setpoint; - int pvwhich,pvindex; - char *pvID,*cvID; + int pvwhich, pvindex; + char *pvID, *cvID; int firsttime; - double control,err,olderr,deltaerr,sumerr; + double control, err, olderr, deltaerr, sumerr; class Compute *pcompute; class Fix *pfix; - int pvar,cvar; + int pvar, cvar; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_deform.cpp b/src/fix_deform.cpp index e37dce0e88..4d923ae7ff 100644 --- a/src/fix_deform.cpp +++ b/src/fix_deform.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_deform.h b/src/fix_deform.h index ebec11a57a..c1becf58f9 100644 --- a/src/fix_deform.h +++ b/src/fix_deform.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(deform,FixDeform) - +// clang-format off +FixStyle(deform,FixDeform); +// clang-format on #else #ifndef LMP_FIX_DEFORM_H @@ -26,8 +26,8 @@ namespace LAMMPS_NS { class FixDeform : public Fix { public: - int remapflag; // whether x,v are remapped across PBC - int dimflag[6]; // which dims are deformed + int remapflag; // whether x,v are remapped across PBC + int dimflag[6]; // which dims are deformed FixDeform(class LAMMPS *, int, char **); virtual ~FixDeform(); @@ -40,38 +40,38 @@ class FixDeform : public Fix { double memory_usage(); protected: - int triclinic,scaleflag,flipflag; - int flip,flipxy,flipxz,flipyz; - double *h_rate,*h_ratelo; - int varflag; // 1 if VARIABLE option is used, 0 if not - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int *rfix; // indices of rigid fixes - class Irregular *irregular; // for migrating atoms after box flips + int triclinic, scaleflag, flipflag; + int flip, flipxy, flipxz, flipyz; + double *h_rate, *h_ratelo; + int varflag; // 1 if VARIABLE option is used, 0 if not + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int *rfix; // indices of rigid fixes + class Irregular *irregular; // for migrating atoms after box flips double TWOPI; struct Set { - int style,substyle; - double flo,fhi,ftilt; - double dlo,dhi,dtilt; - double scale,vel,rate; - double amplitude,tperiod; - double lo_initial,hi_initial; - double lo_start,hi_start,lo_stop,hi_stop,lo_target,hi_target; - double tilt_initial,tilt_start,tilt_stop,tilt_target,tilt_flip; - double tilt_min,tilt_max; - double vol_initial,vol_start; - int fixed,dynamic1,dynamic2; - char *hstr,*hratestr; - int hvar,hratevar; + int style, substyle; + double flo, fhi, ftilt; + double dlo, dhi, dtilt; + double scale, vel, rate; + double amplitude, tperiod; + double lo_initial, hi_initial; + double lo_start, hi_start, lo_stop, hi_stop, lo_target, hi_target; + double tilt_initial, tilt_start, tilt_stop, tilt_target, tilt_flip; + double tilt_min, tilt_max; + double vol_initial, vol_start; + int fixed, dynamic1, dynamic2; + char *hstr, *hratestr; + int hvar, hratevar; }; Set *set; void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_deprecated.cpp b/src/fix_deprecated.cpp index c58ddb7710..c7422eeaf8 100644 --- a/src/fix_deprecated.cpp +++ b/src/fix_deprecated.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_deprecated.h b/src/fix_deprecated.h index aa2bcad6c2..a2260ad652 100644 --- a/src/fix_deprecated.h +++ b/src/fix_deprecated.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,13 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - +// clang-format off // list all deprecated and removed fix styles here - -FixStyle(DEPRECATED,FixDeprecated) -FixStyle(ave/spatial,FixDeprecated) -FixStyle(ave/spatial/sphere,FixDeprecated) - +FixStyle(DEPRECATED,FixDeprecated); +FixStyle(ave/spatial,FixDeprecated); +FixStyle(ave/spatial/sphere,FixDeprecated); +// clang-format on #else #ifndef LMP_FIX_DEPRECATED_H @@ -32,11 +31,11 @@ class FixDeprecated : public Fix { public: FixDeprecated(class LAMMPS *, int, char **); ~FixDeprecated() {} - int setmask() {return 0;} + int setmask() { return 0; } void init() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_drag.cpp b/src/fix_drag.cpp index 03209ce729..69aa104d52 100644 --- a/src/fix_drag.cpp +++ b/src/fix_drag.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_drag.h b/src/fix_drag.h index ff4bae1a66..b5e978f590 100644 --- a/src/fix_drag.h +++ b/src/fix_drag.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(drag,FixDrag) - +// clang-format off +FixStyle(drag,FixDrag); +// clang-format on #else #ifndef LMP_FIX_DRAG_H @@ -35,16 +35,16 @@ class FixDrag : public Fix { double compute_vector(int); private: - double xc,yc,zc; + double xc, yc, zc; double f_mag; - int xflag,yflag,zflag; + int xflag, yflag, zflag; double delta; int ilevel_respa; - double ftotal[3],ftotal_all[3]; + double ftotal[3], ftotal_all[3]; int force_flag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_dt_reset.cpp b/src/fix_dt_reset.cpp index 34cecc45de..6dfac5ff3e 100644 --- a/src/fix_dt_reset.cpp +++ b/src/fix_dt_reset.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_dt_reset.h b/src/fix_dt_reset.h index 54638d32aa..01cca3b41f 100644 --- a/src/fix_dt_reset.h +++ b/src/fix_dt_reset.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(dt/reset,FixDtReset) - +// clang-format off +FixStyle(dt/reset,FixDtReset); +// clang-format on #else #ifndef LMP_FIX_DT_RESET_H @@ -36,14 +36,14 @@ class FixDtReset : public Fix { private: bigint laststep; - int minbound,maxbound; - double tmin,tmax,xmax,emax; - double ftm2v,mvv2e; - double dt,t_laststep; + int minbound, maxbound; + double tmin, tmax, xmax, emax; + double ftm2v, mvv2e; + double dt, t_laststep; int respaflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_dummy.cpp b/src/fix_dummy.cpp index 0db001c9d6..d8a4df173b 100644 --- a/src/fix_dummy.cpp +++ b/src/fix_dummy.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_dummy.h b/src/fix_dummy.h index 485d676bb5..970e9fb23a 100644 --- a/src/fix_dummy.h +++ b/src/fix_dummy.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(DUMMY,FixDummy) - +// clang-format off +FixStyle(DUMMY,FixDummy); +// clang-format on #else #ifndef LMP_FIX_DUMMY_H @@ -31,13 +31,13 @@ class FixDummy : public Fix { int setmask(); protected: - int initial_integrate_flag,final_integrate_flag; - int pre_exchange_flag,pre_neighbor_flag; - int pre_force_flag,post_force_flag; + int initial_integrate_flag, final_integrate_flag; + int pre_exchange_flag, pre_neighbor_flag; + int pre_force_flag, post_force_flag; int end_of_step_flag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_enforce2d.cpp b/src/fix_enforce2d.cpp index c27e523efe..abff16d21e 100644 --- a/src/fix_enforce2d.cpp +++ b/src/fix_enforce2d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_enforce2d.h b/src/fix_enforce2d.h index 6cb0dada35..afaa28f06f 100644 --- a/src/fix_enforce2d.h +++ b/src/fix_enforce2d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(enforce2d,FixEnforce2D) - +// clang-format off +FixStyle(enforce2d,FixEnforce2D); +// clang-format on #else #ifndef LMP_FIX_ENFORCE2D_H @@ -41,7 +41,7 @@ class FixEnforce2D : public Fix { class Fix **flist; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_external.cpp b/src/fix_external.cpp index c2bd447a47..8bede4ee19 100644 --- a/src/fix_external.cpp +++ b/src/fix_external.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_external.h b/src/fix_external.h index 33da5ea526..0ace978f99 100644 --- a/src/fix_external.h +++ b/src/fix_external.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(external,FixExternal) - +// clang-format off +FixStyle(external,FixExternal); +// clang-format on #else #ifndef LMP_FIX_EXTERNAL_H @@ -46,7 +46,7 @@ class FixExternal : public Fix { void set_energy_peratom(double *); void set_virial_peratom(double **); void set_vector_length(int); - void set_vector(int,double); + void set_vector(int, double); double memory_usage(); void grow_arrays(int); @@ -58,14 +58,14 @@ class FixExternal : public Fix { void set_callback(FnPtr, void *); private: - int mode,ncall,napply,eflag_caller; + int mode, ncall, napply, eflag_caller; FnPtr callback; void *ptr_caller; double user_energy; double *caller_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index 8c6baab1ee..743fc705d2 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_gravity.h b/src/fix_gravity.h index f1b1995ae4..31b6eb3478 100644 --- a/src/fix_gravity.h +++ b/src/fix_gravity.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(gravity,FixGravity) - +// clang-format off +FixStyle(gravity,FixGravity); +// clang-format on #else #ifndef LMP_FIX_GRAVITY_H @@ -39,28 +39,28 @@ class FixGravity : public Fix { void *extract(const char *, int &); protected: - int style,disable; + int style, disable; double magnitude; - double vert,phi,theta; - double xdir,ydir,zdir; - double xgrav,ygrav,zgrav,xacc,yacc,zacc; + double vert, phi, theta; + double xdir, ydir, zdir; + double xgrav, ygrav, zgrav, xacc, yacc, zacc; double degree2rad; int ilevel_respa; int time_origin; double gvec[3]; int eflag; - double egrav,egrav_all; + double egrav, egrav_all; int varflag; - int mstyle,vstyle,pstyle,tstyle,xstyle,ystyle,zstyle; - int mvar,vvar,pvar,tvar,xvar,yvar,zvar; - char *mstr,*vstr,*pstr,*tstr,*xstr,*ystr,*zstr; + int mstyle, vstyle, pstyle, tstyle, xstyle, ystyle, zstyle; + int mvar, vvar, pvar, tvar, xvar, yvar, zvar; + char *mstr, *vstr, *pstr, *tstr, *xstr, *ystr, *zstr; void set_acceleration(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_group.cpp b/src/fix_group.cpp index ebd729c737..a66aab982e 100644 --- a/src/fix_group.cpp +++ b/src/fix_group.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_group.h b/src/fix_group.h index 9e2dd370bc..ff25ce4135 100644 --- a/src/fix_group.h +++ b/src/fix_group.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(GROUP,FixGroup) - +// clang-format off +FixStyle(GROUP,FixGroup); +// clang-format on #else #ifndef LMP_FIX_GROUP_H @@ -32,14 +32,14 @@ class FixGroup : public Fix { void init(); void setup(int); void post_integrate(); - void post_integrate_respa(int,int); - void *extract(const char *,int &); + void post_integrate_respa(int, int); + void *extract(const char *, int &); private: - int gbit,gbitinverse; - int regionflag,varflag,propflag,typeflag; - int iregion,ivar,iprop; - char *idregion,*idvar,*idprop; + int gbit, gbitinverse; + int regionflag, varflag, propflag, typeflag; + int iregion, ivar, iprop; + char *idregion, *idvar, *idprop; class Region *region; int nlevels_respa; @@ -47,7 +47,7 @@ class FixGroup : public Fix { void set_group(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_halt.cpp b/src/fix_halt.cpp index a27c830be1..95faca893c 100644 --- a/src/fix_halt.cpp +++ b/src/fix_halt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_halt.h b/src/fix_halt.h index 67f8be6d3c..73eab2d930 100644 --- a/src/fix_halt.h +++ b/src/fix_halt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(halt,FixHalt) - +// clang-format off +FixStyle(halt,FixHalt); +// clang-format on #else #ifndef LMP_FIX_HALT_H @@ -35,9 +35,9 @@ class FixHalt : public Fix { void post_run(); private: - int attribute,operation,eflag,msgflag,ivar; - bigint nextstep,thisstep; - double value,tratio; + int attribute, operation, eflag, msgflag, ivar; + bigint nextstep, thisstep; + double value, tratio; char *idvar; char *dlimit_path; @@ -46,7 +46,7 @@ class FixHalt : public Fix { double diskfree(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_heat.cpp b/src/fix_heat.cpp index 14f2cceca2..6ceaf9c71e 100644 --- a/src/fix_heat.cpp +++ b/src/fix_heat.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_heat.h b/src/fix_heat.h index 31594e7de9..a6a0e00813 100644 --- a/src/fix_heat.h +++ b/src/fix_heat.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(heat,FixHeat) - +// clang-format off +FixStyle(heat,FixHeat); +// clang-format on #else #ifndef LMP_FIX_HEAT_H @@ -41,14 +41,14 @@ class FixHeat : public Fix { double scale; char *idregion; char *hstr; - int hstyle,hvar; + int hstyle, hvar; int maxatom; double *vheat; double *vscale; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp index d2a7ba0d2a..838d9bdaab 100644 --- a/src/fix_indent.cpp +++ b/src/fix_indent.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_indent.h b/src/fix_indent.h index 9cf833cb54..e8b9d7055f 100644 --- a/src/fix_indent.h +++ b/src/fix_indent.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(indent,FixIndent) - +// clang-format off +FixStyle(indent,FixIndent); +// clang-format on #else #ifndef LMP_FIX_INDENT_H @@ -39,20 +39,20 @@ class FixIndent : public Fix { double compute_vector(int); private: - int istyle,scaleflag,side; - double k,k3; - char *xstr,*ystr,*zstr,*rstr,*pstr; - int xvar,yvar,zvar,rvar,pvar; - double xvalue,yvalue,zvalue,rvalue,pvalue; - int indenter_flag,planeside; - double indenter[4],indenter_all[4]; - int cdim,varflag; + int istyle, scaleflag, side; + double k, k3; + char *xstr, *ystr, *zstr, *rstr, *pstr; + int xvar, yvar, zvar, rvar, pvar; + double xvalue, yvalue, zvalue, rvalue, pvalue; + int indenter_flag, planeside; + double indenter[4], indenter_all[4]; + int cdim, varflag; int ilevel_respa; void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index bf9d5cad23..92fa6a42c5 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_langevin.h b/src/fix_langevin.h index 8d787fcd86..2c881d9329 100644 --- a/src/fix_langevin.h +++ b/src/fix_langevin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(langevin,FixLangevin) - +// clang-format off +FixStyle(langevin,FixLangevin); +// clang-format on #else #ifndef LMP_FIX_LANGEVIN_H @@ -47,24 +47,24 @@ class FixLangevin : public Fix { int unpack_exchange(int, double *); protected: - int gjfflag,nvalues,osflag,oflag,tallyflag,zeroflag,tbiasflag; + int gjfflag, nvalues, osflag, oflag, tallyflag, zeroflag, tbiasflag; int flangevin_allocated; double ascale; - double t_start,t_stop,t_period,t_target; - double *gfactor1,*gfactor2,*ratio; - double energy,energy_onestep; + double t_start, t_stop, t_period, t_target; + double *gfactor1, *gfactor2, *ratio; + double energy, energy_onestep; double tsqrt; - int tstyle,tvar; - double gjfa, gjfsib; //gjf a and gjf sqrt inverse b + int tstyle, tvar; + double gjfa, gjfsib; //gjf a and gjf sqrt inverse b char *tstr; class AtomVecEllipsoid *avec; - int maxatom1,maxatom2; + int maxatom1, maxatom2; double **flangevin; double *tforce; double **franprev; - double **lv; //half step velocity + double **lv; //half step velocity char *id_temp; class Compute *temperature; @@ -73,8 +73,7 @@ class FixLangevin : public Fix { class RanMars *random; int seed; - template < int Tp_TSTYLEATOM, int Tp_GJF, int Tp_TALLY, - int Tp_BIAS, int Tp_RMASS, int Tp_ZERO > + template void post_force_templated(); void omega_thermostat(); @@ -82,7 +81,7 @@ class FixLangevin : public Fix { void compute_target(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_lineforce.cpp b/src/fix_lineforce.cpp index d95aacfd93..90901534ad 100644 --- a/src/fix_lineforce.cpp +++ b/src/fix_lineforce.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_lineforce.h b/src/fix_lineforce.h index 0d56743047..8151fc86db 100644 --- a/src/fix_lineforce.h +++ b/src/fix_lineforce.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(lineforce,FixLineForce) - +// clang-format off +FixStyle(lineforce,FixLineForce); +// clang-format on #else #ifndef LMP_FIX_LINEFORCE_H @@ -35,10 +35,10 @@ class FixLineForce : public Fix { void min_post_force(int); private: - double xdir,ydir,zdir; + double xdir, ydir, zdir; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_minimize.cpp b/src/fix_minimize.cpp index 8aefe5ef5d..43f0943b14 100644 --- a/src/fix_minimize.cpp +++ b/src/fix_minimize.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_minimize.h b/src/fix_minimize.h index 6b9aaa7936..690b2790de 100644 --- a/src/fix_minimize.h +++ b/src/fix_minimize.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(MINIMIZE,FixMinimize) - +// clang-format off +FixStyle(MINIMIZE,FixMinimize); +// clang-format on #else #ifndef LMP_FIX_MINIMIZE_H @@ -48,12 +48,12 @@ class FixMinimize : public Fix { int nvector; int *peratom; double **vectors; - double boxlo[3],boxhi[3]; + double boxlo[3], boxhi[3]; void box_swap(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_momentum.cpp b/src/fix_momentum.cpp index 509da7d0fd..19a9bd0acd 100644 --- a/src/fix_momentum.cpp +++ b/src/fix_momentum.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_momentum.h b/src/fix_momentum.h index 1c0de195d4..43d3d174be 100644 --- a/src/fix_momentum.h +++ b/src/fix_momentum.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(momentum,FixMomentum) - +// clang-format off +FixStyle(momentum,FixMomentum); +// clang-format on #else #ifndef LMP_FIX_MOMENTUM_H @@ -32,12 +32,12 @@ class FixMomentum : public Fix { void end_of_step(); protected: - int linear,angular,rescale; - int xflag,yflag,zflag; + int linear, angular, rescale; + int xflag, yflag, zflag; double masstotal; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_move.cpp b/src/fix_move.cpp index 6b640cd747..2cd945f082 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_move.h b/src/fix_move.h index 67b50ec3fa..02f573e000 100644 --- a/src/fix_move.h +++ b/src/fix_move.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(move,FixMove) - +// clang-format off +FixStyle(move,FixMove); +// clang-format on #else #ifndef LMP_FIX_MOVE_H @@ -51,27 +51,27 @@ class FixMove : public Fix { void reset_dt(); private: - char *xvarstr,*yvarstr,*zvarstr,*vxvarstr,*vyvarstr,*vzvarstr; + char *xvarstr, *yvarstr, *zvarstr, *vxvarstr, *vyvarstr, *vzvarstr; int mstyle; - int vxflag,vyflag,vzflag,axflag,ayflag,azflag; - double vx,vy,vz,ax,ay,az; - double period,omega_rotate; - double point[3],axis[3],runit[3]; - double dt,dtv,dtf; - int xvar,yvar,zvar,vxvar,vyvar,vzvar; - int xvarstyle,yvarstyle,zvarstyle,vxvarstyle,vyvarstyle,vzvarstyle; - int extra_flag,omega_flag,angmom_flag; - int radius_flag,ellipsoid_flag,line_flag,tri_flag,body_flag; - int theta_flag,quat_flag; - int nlevels_respa,nrestart; + int vxflag, vyflag, vzflag, axflag, ayflag, azflag; + double vx, vy, vz, ax, ay, az; + double period, omega_rotate; + double point[3], axis[3], runit[3]; + double dt, dtv, dtf; + int xvar, yvar, zvar, vxvar, vyvar, vzvar; + int xvarstyle, yvarstyle, zvarstyle, vxvarstyle, vyvarstyle, vzvarstyle; + int extra_flag, omega_flag, angmom_flag; + int radius_flag, ellipsoid_flag, line_flag, tri_flag, body_flag; + int theta_flag, quat_flag; + int nlevels_respa, nrestart; int time_origin; - double **xoriginal; // original coords of atoms - double *toriginal; // original theta of atoms - double **qoriginal; // original quat of atoms - int displaceflag,velocityflag; + double **xoriginal; // original coords of atoms + double *toriginal; // original theta of atoms + double **qoriginal; // original quat of atoms + int displaceflag, velocityflag; int maxatom; - double **displace,**velocity; + double **displace, **velocity; class AtomVecEllipsoid *avec_ellipsoid; class AtomVecLine *avec_line; @@ -79,7 +79,7 @@ class FixMove : public Fix { class AtomVecBody *avec_body; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index cccf6ad0a2..15d49793b2 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_neigh_history.h b/src/fix_neigh_history.h index 57391cfa9a..de89c9a3cb 100644 --- a/src/fix_neigh_history.h +++ b/src/fix_neigh_history.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(NEIGH_HISTORY,FixNeighHistory) - +// clang-format off +FixStyle(NEIGH_HISTORY,FixNeighHistory); +// clang-format on #else #ifndef LMP_FIX_NEIGH_HISTORY_H @@ -26,11 +26,11 @@ namespace LAMMPS_NS { class FixNeighHistory : public Fix { public: - int nlocal_neigh; // nlocal at last time neigh list was built - int nall_neigh; // ditto for nlocal+nghost - int **firstflag; // ptr to each atom's neighbor flsg - double **firstvalue; // ptr to each atom's values - class Pair *pair; // ptr to pair style that uses neighbor history + int nlocal_neigh; // nlocal at last time neigh list was built + int nall_neigh; // ditto for nlocal+nghost + int **firstflag; // ptr to each atom's neighbor flsg + double **firstvalue; // ptr to each atom's values + class Pair *pair; // ptr to pair style that uses neighbor history FixNeighHistory(class LAMMPS *, int, char **); ~FixNeighHistory(); @@ -60,44 +60,42 @@ class FixNeighHistory : public Fix { int maxsize_restart(); protected: - int newton_pair; // same as force setting - int dnum,dnumbytes; // dnum = # of values per neighbor - int onesided; // 1 for line/tri history, else 0 + int newton_pair; // same as force setting + int dnum, dnumbytes; // dnum = # of values per neighbor + int onesided; // 1 for line/tri history, else 0 - int maxatom; // max size of firstflag and firstvalue - int commflag; // mode of reverse comm to get ghost info + int maxatom; // max size of firstflag and firstvalue + int commflag; // mode of reverse comm to get ghost info double *zeroes; // per-atom data structures // partners = flagged neighbors of an atom - int *npartner; // # of partners of each atom - tagint **partner; // global atom IDs for the partners - double **valuepartner; // values for the partners - int maxpartner; // max # of partners for any of my atoms + int *npartner; // # of partners of each atom + tagint **partner; // global atom IDs for the partners + double **valuepartner; // values for the partners + int maxpartner; // max # of partners for any of my atoms // per-atom data structs pointed to by partner & valuepartner - int pgsize,oneatom; // copy of settings in Neighbor - MyPage *ipage_atom; // pages of partner atom IDs - MyPage *dpage_atom; // pages of partner values + int pgsize, oneatom; // copy of settings in Neighbor + MyPage *ipage_atom; // pages of partner atom IDs + MyPage *dpage_atom; // pages of partner values // per-neighbor data structs pointed to by firstflag & firstvalue - MyPage *ipage_neigh; // pages of local atom indices - MyPage *dpage_neigh; // pages of partner values + MyPage *ipage_neigh; // pages of local atom indices + MyPage *dpage_neigh; // pages of partner values virtual void pre_exchange_onesided(); virtual void pre_exchange_newton(); virtual void pre_exchange_no_newton(); void allocate_pages(); - inline int sbmask(int j) const { - return j >> SBBITS & 3; - } + inline int sbmask(int j) const { return j >> SBBITS & 3; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index e8b58a6152..40940977a6 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_nh.h b/src/fix_nh.h index f784afefd8..ef541a0e05 100644 --- a/src/fix_nh.h +++ b/src/fix_nh.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,7 +14,7 @@ #ifndef LMP_FIX_NH_H #define LMP_FIX_NH_H -#include "fix.h" // IWYU pragma: export +#include "fix.h" // IWYU pragma: export namespace LAMMPS_NS { @@ -33,104 +33,104 @@ class FixNH : public Fix { double compute_scalar(); virtual double compute_vector(int); void write_restart(FILE *); - virtual int pack_restart_data(double *); // pack restart data + virtual int pack_restart_data(double *); // pack restart data virtual void restart(char *); int modify_param(int, char **); void reset_target(double); void reset_dt(); - virtual void *extract(const char*,int &); + virtual void *extract(const char *, int &); double memory_usage(); protected: - int dimension,which; - double dtv,dtf,dthalf,dt4,dt8,dto; - double boltz,nktv2p,tdof; - double vol0; // reference volume - double t0; // reference temperature - // used for barostat mass - double t_start,t_stop; - double t_current,t_target,ke_target; + int dimension, which; + double dtv, dtf, dthalf, dt4, dt8, dto; + double boltz, nktv2p, tdof; + double vol0; // reference volume + double t0; // reference temperature + // used for barostat mass + double t_start, t_stop; + double t_current, t_target, ke_target; double t_freq; - int tstat_flag; // 1 if control T - int pstat_flag; // 1 if control P + int tstat_flag; // 1 if control T + int pstat_flag; // 1 if control P - int pstyle,pcouple,allremap; - int p_flag[6]; // 1 if control P on this dim, 0 if not - double p_start[6],p_stop[6]; - double p_freq[6],p_target[6]; - double omega[6],omega_dot[6]; + int pstyle, pcouple, allremap; + int p_flag[6]; // 1 if control P on this dim, 0 if not + double p_start[6], p_stop[6]; + double p_freq[6], p_target[6]; + double omega[6], omega_dot[6]; double omega_mass[6]; double p_current[6]; - double drag,tdrag_factor; // drag factor on particle thermostat - double pdrag_factor; // drag factor on barostat - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int dilate_group_bit; // mask for dilation group - int *rfix; // indices of rigid fixes - char *id_dilate; // group name to dilate - class Irregular *irregular; // for migrating atoms after box flips + double drag, tdrag_factor; // drag factor on particle thermostat + double pdrag_factor; // drag factor on barostat + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int dilate_group_bit; // mask for dilation group + int *rfix; // indices of rigid fixes + char *id_dilate; // group name to dilate + class Irregular *irregular; // for migrating atoms after box flips - double p_temp; // target temperature for barostat + double p_temp; // target temperature for barostat int p_temp_flag; int nlevels_respa; double *step_respa; - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tcomputeflag,pcomputeflag; // 1 = compute was created by fix - // 0 = created externally + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tcomputeflag, pcomputeflag; // 1 = compute was created by fix + // 0 = created externally - double *eta,*eta_dot; // chain thermostat for particles + double *eta, *eta_dot; // chain thermostat for particles double *eta_dotdot; double *eta_mass; - int mtchain; // length of chain - int mtchain_default_flag; // 1 = mtchain is default + int mtchain; // length of chain + int mtchain_default_flag; // 1 = mtchain is default - double *etap; // chain thermostat for barostat + double *etap; // chain thermostat for barostat double *etap_dot; double *etap_dotdot; double *etap_mass; - int mpchain; // length of chain + int mpchain; // length of chain - int mtk_flag; // 0 if using Hoover barostat - int pdim; // number of barostatted dims - double p_freq_max; // maximum barostat frequency + int mtk_flag; // 0 if using Hoover barostat + int pdim; // number of barostatted dims + double p_freq_max; // maximum barostat frequency - double p_hydro; // hydrostatic target pressure + double p_hydro; // hydrostatic target pressure - int nc_tchain,nc_pchain; + int nc_tchain, nc_pchain; double factor_eta; - double sigma[6]; // scaled target stress - double fdev[6]; // deviatoric force on barostat - int deviatoric_flag; // 0 if target stress tensor is hydrostatic - double h0_inv[6]; // h_inv of reference (zero strain) box - int nreset_h0; // interval for resetting h0 + double sigma[6]; // scaled target stress + double fdev[6]; // deviatoric force on barostat + int deviatoric_flag; // 0 if target stress tensor is hydrostatic + double h0_inv[6]; // h_inv of reference (zero strain) box + int nreset_h0; // interval for resetting h0 - double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections + double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections - int eta_mass_flag; // 1 if eta_mass updated, 0 if not. - int omega_mass_flag; // 1 if omega_mass updated, 0 if not. - int etap_mass_flag; // 1 if etap_mass updated, 0 if not. - int dipole_flag; // 1 if dipole is updated, 0 if not. - int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not + int eta_mass_flag; // 1 if eta_mass updated, 0 if not. + int omega_mass_flag; // 1 if omega_mass updated, 0 if not. + int etap_mass_flag; // 1 if etap_mass updated, 0 if not. + int dipole_flag; // 1 if dipole is updated, 0 if not. + int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not - int scaleyz; // 1 if yz scaled with lz - int scalexz; // 1 if xz scaled with lz - int scalexy; // 1 if xy scaled with ly - int flipflag; // 1 if box flips are invoked as needed + int scaleyz; // 1 if yz scaled with lz + int scalexz; // 1 if xz scaled with lz + int scalexy; // 1 if xy scaled with ly + int flipflag; // 1 if box flips are invoked as needed - int pre_exchange_flag; // set if pre_exchange needed for box flips + int pre_exchange_flag; // set if pre_exchange needed for box flips - double fixedpoint[3]; // location of dilation fixed-point + double fixedpoint[3]; // location of dilation fixed-point void couple(); virtual void remap(); void nhc_temp_integrate(); void nhc_press_integrate(); - virtual void nve_x(); // may be overwritten by child classes + virtual void nve_x(); // may be overwritten by child classes virtual void nve_v(); virtual void nh_v_press(); virtual void nh_v_temp(); @@ -144,7 +144,7 @@ class FixNH : public Fix { void nh_omega_dot(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/fix_nh_sphere.cpp b/src/fix_nh_sphere.cpp index ae1fab6cea..3aa22ffe3e 100644 --- a/src/fix_nh_sphere.cpp +++ b/src/fix_nh_sphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_nh_sphere.h b/src/fix_nh_sphere.h index a4710f2691..d07e63fb77 100644 --- a/src/fix_nh_sphere.h +++ b/src/fix_nh_sphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -32,7 +32,7 @@ class FixNHSphere : public FixNH { void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/fix_nph.cpp b/src/fix_nph.cpp index 5b160689dd..2f007c803e 100644 --- a/src/fix_nph.cpp +++ b/src/fix_nph.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_nph.h b/src/fix_nph.h index eb20844a1b..f485bd9b81 100644 --- a/src/fix_nph.h +++ b/src/fix_nph.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nph,FixNPH) - +// clang-format off +FixStyle(nph,FixNPH); +// clang-format on #else #ifndef LMP_FIX_NPH_H @@ -30,7 +30,7 @@ class FixNPH : public FixNH { ~FixNPH() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nph_sphere.cpp b/src/fix_nph_sphere.cpp index 1266cb2b9d..bd51c3b7f7 100644 --- a/src/fix_nph_sphere.cpp +++ b/src/fix_nph_sphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_nph_sphere.h b/src/fix_nph_sphere.h index 5bfa68b2fc..6376176b20 100644 --- a/src/fix_nph_sphere.h +++ b/src/fix_nph_sphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nph/sphere,FixNPHSphere) - +// clang-format off +FixStyle(nph/sphere,FixNPHSphere); +// clang-format on #else #ifndef LMP_FIX_NPH_SPHERE_H @@ -30,7 +30,7 @@ class FixNPHSphere : public FixNHSphere { ~FixNPHSphere() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_npt.cpp b/src/fix_npt.cpp index 78acf0cf7e..fb02919041 100644 --- a/src/fix_npt.cpp +++ b/src/fix_npt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_npt.h b/src/fix_npt.h index 137c44e8bc..582467c4d0 100644 --- a/src/fix_npt.h +++ b/src/fix_npt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt,FixNPT) - +// clang-format off +FixStyle(npt,FixNPT); +// clang-format on #else #ifndef LMP_FIX_NPT_H @@ -30,7 +30,7 @@ class FixNPT : public FixNH { ~FixNPT() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_npt_sphere.cpp b/src/fix_npt_sphere.cpp index 8bbd43d4cf..fe5d5df6f6 100644 --- a/src/fix_npt_sphere.cpp +++ b/src/fix_npt_sphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_npt_sphere.h b/src/fix_npt_sphere.h index 4d49399cff..b53328b5f8 100644 --- a/src/fix_npt_sphere.h +++ b/src/fix_npt_sphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(npt/sphere,FixNPTSphere) - +// clang-format off +FixStyle(npt/sphere,FixNPTSphere); +// clang-format on #else #ifndef LMP_FIX_NPT_SPHERE_H @@ -30,7 +30,7 @@ class FixNPTSphere : public FixNHSphere { ~FixNPTSphere() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_numdiff.cpp b/src/fix_numdiff.cpp index 495e196749..dbe2f0a9dc 100644 --- a/src/fix_numdiff.cpp +++ b/src/fix_numdiff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_numdiff.h b/src/fix_numdiff.h index e00edf3ee2..b6b97c21bd 100644 --- a/src/fix_numdiff.h +++ b/src/fix_numdiff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(numdiff,FixNumDiff) - +// clang-format off +FixStyle(numdiff,FixNumDiff); +// clang-format on #else #ifndef LMP_FIX_NUMDIFF_H @@ -37,20 +37,20 @@ class FixNumDiff : public Fix { void min_post_force(int); double memory_usage(); -private: + private: double delta; int maxatom; int ilevel_respa; - int pair_compute_flag; // 0 if pair->compute is skipped - int kspace_compute_flag; // 0 if kspace->compute is skipped + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped char *id_pe; class Compute *pe; - double **numdiff_forces; // finite diff forces - double **temp_x; // original coords - double **temp_f; // original forces + double **numdiff_forces; // finite diff forces + double **temp_x; // original coords + double **temp_f; // original forces void calculate_forces(); void displace_atoms(int, int, int); @@ -60,7 +60,7 @@ private: void reallocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nve.cpp b/src/fix_nve.cpp index e14ff47e46..0ac89f5e26 100644 --- a/src/fix_nve.cpp +++ b/src/fix_nve.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_nve.h b/src/fix_nve.h index b453c0d2b1..864da8596c 100644 --- a/src/fix_nve.h +++ b/src/fix_nve.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve,FixNVE) - +// clang-format off +FixStyle(nve,FixNVE); +// clang-format on #else #ifndef LMP_FIX_NVE_H @@ -37,12 +37,12 @@ class FixNVE : public Fix { virtual void reset_dt(); protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nve_limit.cpp b/src/fix_nve_limit.cpp index 58dc023991..9aba474789 100644 --- a/src/fix_nve_limit.cpp +++ b/src/fix_nve_limit.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_nve_limit.h b/src/fix_nve_limit.h index 5b69d1532c..d23b680796 100644 --- a/src/fix_nve_limit.h +++ b/src/fix_nve_limit.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/limit,FixNVELimit) - +// clang-format off +FixStyle(nve/limit,FixNVELimit); +// clang-format on #else #ifndef LMP_FIX_NVE_LIMIT_H @@ -37,13 +37,13 @@ class FixNVELimit : public Fix { double compute_scalar(); private: - double dtv,dtf; + double dtv, dtf; double *step_respa; int ncount; - double xlimit,vlimitsq; + double xlimit, vlimitsq; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nve_noforce.cpp b/src/fix_nve_noforce.cpp index e6bca3b608..de24c7fef0 100644 --- a/src/fix_nve_noforce.cpp +++ b/src/fix_nve_noforce.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_nve_noforce.h b/src/fix_nve_noforce.h index da4e8c5246..fe3081aac2 100644 --- a/src/fix_nve_noforce.h +++ b/src/fix_nve_noforce.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/noforce,FixNVENoforce) - +// clang-format off +FixStyle(nve/noforce,FixNVENoforce); +// clang-format on #else #ifndef LMP_FIX_NVE_NOFORCE_H @@ -38,7 +38,7 @@ class FixNVENoforce : public Fix { double *step_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nve_sphere.cpp b/src/fix_nve_sphere.cpp index 2760acea95..543b94b46b 100644 --- a/src/fix_nve_sphere.cpp +++ b/src/fix_nve_sphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_nve_sphere.h b/src/fix_nve_sphere.h index bbd2245b99..7eb6b39b35 100644 --- a/src/fix_nve_sphere.h +++ b/src/fix_nve_sphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nve/sphere,FixNVESphere) - +// clang-format off +FixStyle(nve/sphere,FixNVESphere); +// clang-format on #else #ifndef LMP_FIX_NVE_SPHERE_H @@ -38,7 +38,7 @@ class FixNVESphere : public FixNVE { int dlm; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nvt.cpp b/src/fix_nvt.cpp index 14251a269a..e27f3ccc67 100644 --- a/src/fix_nvt.cpp +++ b/src/fix_nvt.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_nvt.h b/src/fix_nvt.h index ec5707e4ea..f6ab23b96b 100644 --- a/src/fix_nvt.h +++ b/src/fix_nvt.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt,FixNVT) - +// clang-format off +FixStyle(nvt,FixNVT); +// clang-format on #else #ifndef LMP_FIX_NVT_H @@ -30,7 +30,7 @@ class FixNVT : public FixNH { ~FixNVT() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nvt_sllod.cpp b/src/fix_nvt_sllod.cpp index ba81adee0c..cd819f8705 100644 --- a/src/fix_nvt_sllod.cpp +++ b/src/fix_nvt_sllod.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_nvt_sllod.h b/src/fix_nvt_sllod.h index 40794b67ee..dbd15458ca 100644 --- a/src/fix_nvt_sllod.h +++ b/src/fix_nvt_sllod.h @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/sllod,FixNVTSllod) - +// clang-format off +FixStyle(nvt/sllod,FixNVTSllod); +// clang-format on #else #ifndef LMP_FIX_NVT_SLLOD_H @@ -36,7 +36,7 @@ class FixNVTSllod : public FixNH { void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nvt_sphere.cpp b/src/fix_nvt_sphere.cpp index 0733a27678..aff4462356 100644 --- a/src/fix_nvt_sphere.cpp +++ b/src/fix_nvt_sphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_nvt_sphere.h b/src/fix_nvt_sphere.h index 0c34f89186..e0d7716fdb 100644 --- a/src/fix_nvt_sphere.h +++ b/src/fix_nvt_sphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(nvt/sphere,FixNVTSphere) - +// clang-format off +FixStyle(nvt/sphere,FixNVTSphere); +// clang-format on #else #ifndef LMP_FIX_NVT_SPHERE_H @@ -30,7 +30,7 @@ class FixNVTSphere : public FixNHSphere { ~FixNVTSphere() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_planeforce.cpp b/src/fix_planeforce.cpp index fe6f3d6500..baad522ec6 100644 --- a/src/fix_planeforce.cpp +++ b/src/fix_planeforce.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_planeforce.h b/src/fix_planeforce.h index f0c3fa3de6..12a8b3f34a 100644 --- a/src/fix_planeforce.h +++ b/src/fix_planeforce.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(planeforce,FixPlaneForce) - +// clang-format off +FixStyle(planeforce,FixPlaneForce); +// clang-format on #else #ifndef LMP_FIX_PLANEFORCE_H @@ -35,10 +35,10 @@ class FixPlaneForce : public Fix { void min_post_force(int); private: - double xdir,ydir,zdir; + double xdir, ydir, zdir; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_press_berendsen.cpp b/src/fix_press_berendsen.cpp index 9cd9de9485..e03e943eb5 100644 --- a/src/fix_press_berendsen.cpp +++ b/src/fix_press_berendsen.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_press_berendsen.h b/src/fix_press_berendsen.h index 1849957c6b..806e6698f7 100644 --- a/src/fix_press_berendsen.h +++ b/src/fix_press_berendsen.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(press/berendsen,FixPressBerendsen) - +// clang-format off +FixStyle(press/berendsen,FixPressBerendsen); +// clang-format on #else #ifndef LMP_FIX_PRESS_BERENDSEN_H @@ -35,28 +35,28 @@ class FixPressBerendsen : public Fix { int modify_param(int, char **); protected: - int dimension,which; + int dimension, which; double bulkmodulus; - int pstyle,pcouple,allremap; - int p_flag[3]; // 1 if control P on this dim, 0 if not - double p_start[3],p_stop[3]; - double p_period[3],p_target[3]; - double p_current[3],dilation[3]; + int pstyle, pcouple, allremap; + int p_flag[3]; // 1 if control P on this dim, 0 if not + double p_start[3], p_stop[3]; + double p_period[3], p_target[3]; + double p_current[3], dilation[3]; double factor[3]; - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int *rfix; // indices of rigid fixes + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int *rfix; // indices of rigid fixes - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tflag,pflag; + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tflag, pflag; void couple(); void remap(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_print.cpp b/src/fix_print.cpp index 43bab3f848..fa1eba4842 100644 --- a/src/fix_print.cpp +++ b/src/fix_print.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_print.h b/src/fix_print.h index c806e50385..82e72d725a 100644 --- a/src/fix_print.h +++ b/src/fix_print.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(print,FixPrint) - +// clang-format off +FixStyle(print,FixPrint); +// clang-format on #else #ifndef LMP_FIX_PRINT_H @@ -34,16 +34,16 @@ class FixPrint : public Fix { void end_of_step(); private: - int me,screenflag; + int me, screenflag; FILE *fp; - char *text,*copy,*work; - int maxcopy,maxwork; + char *text, *copy, *work; + int maxcopy, maxwork; char *var_print; int ivar_print; bigint next_print; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 82c15eea1b..4d22faf83b 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_property_atom.h b/src/fix_property_atom.h index 68ca40d41e..4d25545f9d 100644 --- a/src/fix_property_atom.h +++ b/src/fix_property_atom.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(property/atom,FixPropertyAtom) - +// clang-format off +FixStyle(property/atom,FixPropertyAtom); +// clang-format on #else #ifndef LMP_FIX_PROPERTY_ATOM_H @@ -51,15 +51,15 @@ class FixPropertyAtom : public Fix { double memory_usage(); protected: - int nvalue,border; - int molecule_flag,q_flag,rmass_flag; - int *style,*index; + int nvalue, border; + int molecule_flag, q_flag, rmass_flag; + int *style, *index; char *astyle; - int nmax_old; // length of peratom arrays the last time they grew + int nmax_old; // length of peratom arrays the last time they grew }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_read_restart.cpp b/src/fix_read_restart.cpp index 3c7ef4c564..1b22144643 100644 --- a/src/fix_read_restart.cpp +++ b/src/fix_read_restart.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_read_restart.h b/src/fix_read_restart.h index f33d08680a..8431803f05 100644 --- a/src/fix_read_restart.h +++ b/src/fix_read_restart.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(READ_RESTART,FixReadRestart) - +// clang-format off +FixStyle(READ_RESTART,FixReadRestart); +// clang-format on #else #ifndef LMP_FIX_READ_RESTART_H @@ -40,10 +40,10 @@ class FixReadRestart : public Fix { int unpack_exchange(int, double *); private: - int nextra; // max number of extra values for any atom + int nextra; // max number of extra values for any atom }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_recenter.cpp b/src/fix_recenter.cpp index f5e4513d74..76e59014be 100644 --- a/src/fix_recenter.cpp +++ b/src/fix_recenter.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_recenter.h b/src/fix_recenter.h index 6f0f3f9e13..53fe65100b 100644 --- a/src/fix_recenter.h +++ b/src/fix_recenter.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(recenter,FixRecenter) - +// clang-format off +FixStyle(recenter,FixRecenter); +// clang-format on #else #ifndef LMP_FIX_RECENTER_H @@ -35,14 +35,14 @@ class FixRecenter : public Fix { double compute_vector(int); private: - int group2bit,scaleflag; - int xflag,yflag,zflag; - int xinitflag,yinitflag,zinitflag; + int group2bit, scaleflag; + int xflag, yflag, zflag; + int xinitflag, yinitflag, zinitflag; int nlevels_respa; - double xcom,ycom,zcom,xinit,yinit,zinit,masstotal,distance,shift[3]; + double xcom, ycom, zcom, xinit, yinit, zinit, masstotal, distance, shift[3]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_respa.cpp b/src/fix_respa.cpp index 99b3c18843..64cd44ed42 100644 --- a/src/fix_respa.cpp +++ b/src/fix_respa.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_respa.h b/src/fix_respa.h index 62788ea187..a1c477c6d7 100644 --- a/src/fix_respa.h +++ b/src/fix_respa.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(RESPA,FixRespa) - +// clang-format off +FixStyle(RESPA,FixRespa); +// clang-format on #else #ifndef LMP_FIX_RESPA_H @@ -43,12 +43,12 @@ class FixRespa : public Fix { private: int nlevels; - int store_torque; // 1 if torques should be stored in addition to forces - double ***f_level; // force at each rRESPA level - double ***t_level; // torque at each rRESPA level + int store_torque; // 1 if torques should be stored in addition to forces + double ***f_level; // force at each rRESPA level + double ***t_level; // torque at each rRESPA level }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp index b7321dd530..fc3356f88d 100644 --- a/src/fix_restrain.cpp +++ b/src/fix_restrain.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_restrain.h b/src/fix_restrain.h index 63f64ba4bf..d42d639204 100644 --- a/src/fix_restrain.h +++ b/src/fix_restrain.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(restrain,FixRestrain) - +// clang-format off +FixStyle(restrain,FixRestrain); +// clang-format on #else #ifndef LMP_FIX_RESTRAIN_H @@ -40,17 +40,17 @@ class FixRestrain : public Fix { private: int ilevel_respa; - int nrestrain,maxrestrain; + int nrestrain, maxrestrain; int *rstyle; int *mult; tagint **ids; - double *kstart,*kstop,*deqstart,*deqstop,*target; - double *cos_target,*sin_target; - double energy,energy_all; - double ebond,ebond_all; - double elbound,elbound_all; - double eangle,eangle_all; - double edihed,edihed_all; + double *kstart, *kstop, *deqstart, *deqstop, *target; + double *cos_target, *sin_target; + double energy, energy_all; + double ebond, ebond_all; + double elbound, elbound_all; + double eangle, eangle_all; + double edihed, edihed_all; void restrain_bond(int); void restrain_lbound(int); @@ -58,7 +58,7 @@ class FixRestrain : public Fix { void restrain_dihedral(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp index d59d091f42..75b79617b6 100644 --- a/src/fix_setforce.cpp +++ b/src/fix_setforce.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_setforce.h b/src/fix_setforce.h index 9b479b6cf0..aed39abaf0 100644 --- a/src/fix_setforce.h +++ b/src/fix_setforce.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(setforce,FixSetForce) - +// clang-format off +FixStyle(setforce,FixSetForce); +// clang-format on #else #ifndef LMP_FIX_SET_FORCE_H @@ -40,20 +40,20 @@ class FixSetForce : public Fix { double memory_usage(); protected: - double xvalue,yvalue,zvalue; - int varflag,iregion; - char *xstr,*ystr,*zstr; + double xvalue, yvalue, zvalue; + int varflag, iregion; + char *xstr, *ystr, *zstr; char *idregion; - int xvar,yvar,zvar,xstyle,ystyle,zstyle; - double foriginal[3],foriginal_all[3],foriginal_saved[3]; + int xvar, yvar, zvar, xstyle, ystyle, zstyle; + double foriginal[3], foriginal_all[3], foriginal_saved[3]; int force_flag; - int nlevels_respa,ilevel_respa; + int nlevels_respa, ilevel_respa; int maxatom; double **sforce; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_spring.cpp b/src/fix_spring.cpp index 200d9f072a..dc3001c0fc 100644 --- a/src/fix_spring.cpp +++ b/src/fix_spring.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_spring.h b/src/fix_spring.h index 8373dc80b4..d8a2a30307 100644 --- a/src/fix_spring.h +++ b/src/fix_spring.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(spring,FixSpring) - +// clang-format off +FixStyle(spring,FixSpring); +// clang-format on #else #ifndef LMP_FIX_SPRING_H @@ -39,21 +39,21 @@ class FixSpring : public Fix { double compute_vector(int); private: - double xc,yc,zc,r0; + double xc, yc, zc, r0; double k_spring; - int xflag,yflag,zflag; + int xflag, yflag, zflag; int styleflag; char *group2; - int igroup2,group2bit; - double masstotal,masstotal2; + int igroup2, group2bit; + double masstotal, masstotal2; int ilevel_respa; - double espring,ftotal[4]; + double espring, ftotal[4]; void spring_tether(); void spring_couple(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_spring_chunk.cpp b/src/fix_spring_chunk.cpp index a007aabefc..90db93b9ad 100644 --- a/src/fix_spring_chunk.cpp +++ b/src/fix_spring_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_spring_chunk.h b/src/fix_spring_chunk.h index 87d798e7f9..53f4c67810 100644 --- a/src/fix_spring_chunk.h +++ b/src/fix_spring_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(spring/chunk,FixSpringChunk) - +// clang-format off +FixStyle(spring/chunk,FixSpringChunk); +// clang-format on #else #ifndef LMP_FIX_SPRING_CHUNK_H @@ -43,16 +43,16 @@ class FixSpringChunk : public Fix { int ilevel_respa; double k_spring; double esprings; - char *idchunk,*idcom; + char *idchunk, *idcom; int nchunk; - double **com0,**fcom; + double **com0, **fcom; class ComputeChunkAtom *cchunk; class ComputeCOMChunk *ccom; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_spring_rg.cpp b/src/fix_spring_rg.cpp index 58249bbd2d..a6bdbd3631 100644 --- a/src/fix_spring_rg.cpp +++ b/src/fix_spring_rg.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_spring_rg.h b/src/fix_spring_rg.h index a19a852d80..997580c4c2 100644 --- a/src/fix_spring_rg.h +++ b/src/fix_spring_rg.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(spring/rg,FixSpringRG) - +// clang-format off +FixStyle(spring/rg,FixSpringRG); +// clang-format on #else #ifndef LMP_FIX_SPRING_RG_H @@ -37,11 +37,11 @@ class FixSpringRG : public Fix { double compute_scalar(); private: - int ilevel_respa,rg0_flag; - double rg0,k,masstotal; + int ilevel_respa, rg0_flag; + double rg0, k, masstotal; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index 9f649faec0..43fe9e40b6 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_spring_self.h b/src/fix_spring_self.h index a4ad306e8d..03c12ca13b 100644 --- a/src/fix_spring_self.h +++ b/src/fix_spring_self.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(spring/self,FixSpringSelf) - +// clang-format off +FixStyle(spring/self,FixSpringSelf); +// clang-format on #else #ifndef LMP_FIX_SPRING_SELF_H @@ -48,13 +48,13 @@ class FixSpringSelf : public Fix { int maxsize_restart(); private: - double k,espring; - double **xoriginal; // original coords of atoms + double k, espring; + double **xoriginal; // original coords of atoms int xflag, yflag, zflag; int ilevel_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_store.cpp b/src/fix_store.cpp index f979cf9da0..e121cd8f08 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_store.h b/src/fix_store.h index ce0055147a..a30e2d5c1f 100644 --- a/src/fix_store.h +++ b/src/fix_store.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(STORE,FixStore) - +// clang-format off +FixStyle(STORE,FixStore); +// clang-format on #else #ifndef LMP_FIX_STORE_H @@ -26,10 +26,10 @@ namespace LAMMPS_NS { class FixStore : public Fix { public: - int nrow,ncol; // size of global data array - int nvalues; // number of per-atom values - double *vstore; // vector storage for GLOBAL or PERATOM - double **astore; // array storage for GLOBAL or PERATOM + int nrow, ncol; // size of global data array + int nvalues; // number of per-atom values + double *vstore; // vector storage for GLOBAL or PERATOM + double **astore; // array storage for GLOBAL or PERATOM int disable; // 1 if operations (except grow) are currently disabled FixStore(class LAMMPS *, int, char **); @@ -52,13 +52,13 @@ class FixStore : public Fix { double memory_usage(); private: - int flavor; // GLOBAL or PERATOM - int vecflag; // 1 if ncol=1 or nvalues=1 + int flavor; // GLOBAL or PERATOM + int vecflag; // 1 if ncol=1 or nvalues=1 - double *rbuf; // restart buffer for GLOBAL vec/array + double *rbuf; // restart buffer for GLOBAL vec/array }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_store_force.cpp b/src/fix_store_force.cpp index 7ebd4db75a..f7832cd599 100644 --- a/src/fix_store_force.cpp +++ b/src/fix_store_force.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_store_force.h b/src/fix_store_force.h index 197fa19c2c..31b042b5ca 100644 --- a/src/fix_store_force.h +++ b/src/fix_store_force.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(store/force,FixStoreForce) - +// clang-format off +FixStyle(store/force,FixStoreForce); +// clang-format on #else #ifndef LMP_FIX_STORE_FORCE_H @@ -40,10 +40,10 @@ class FixStoreForce : public Fix { private: int nlevels_respa; int nmax; - double **foriginal; // stored force on atoms + double **foriginal; // stored force on atoms }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index fff7133edb..2a97ebceb6 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_store_state.h b/src/fix_store_state.h index 8deb407408..59c17341f1 100644 --- a/src/fix_store_state.h +++ b/src/fix_store_state.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(store/state,FixStoreState) - +// clang-format off +FixStyle(store/state,FixStoreState); +// clang-format on #else #ifndef LMP_FIX_STORE_STATE_H @@ -45,19 +45,19 @@ class FixStoreState : public Fix { private: int nvalues; - int *which,*argindex,*value2index; + int *which, *argindex, *value2index; char **ids; - double **values; // archived atom properties - double *vbuf; // 1d ptr to values + double **values; // archived atom properties + double *vbuf; // 1d ptr to values int comflag; - double cm[3]; // center of mass + double cm[3]; // center of mass - int kflag,cfv_flag,firstflag; - int cfv_any; // 1 if any compute/fix/variable specified + int kflag, cfv_flag, firstflag; + int cfv_any; // 1 if any compute/fix/variable specified typedef void (FixStoreState::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions + FnPtrPack *pack_choice; // ptrs to pack functions void pack_id(int); void pack_molecule(int); @@ -114,7 +114,7 @@ class FixStoreState : public Fix { void pack_tqz(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp index 38ce9de333..19ec4b52bd 100644 --- a/src/fix_temp_berendsen.cpp +++ b/src/fix_temp_berendsen.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_temp_berendsen.h b/src/fix_temp_berendsen.h index 625408b1b9..f45a5e7f03 100644 --- a/src/fix_temp_berendsen.h +++ b/src/fix_temp_berendsen.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(temp/berendsen,FixTempBerendsen) - +// clang-format off +FixStyle(temp/berendsen,FixTempBerendsen); +// clang-format on #else #ifndef LMP_FIX_TEMP_BERENDSEN_H @@ -40,9 +40,9 @@ class FixTempBerendsen : public Fix { private: int which; - double t_start,t_stop,t_period,t_target; + double t_start, t_stop, t_period, t_target; double energy; - int tstyle,tvar; + int tstyle, tvar; char *tstr; char *id_temp; @@ -50,7 +50,7 @@ class FixTempBerendsen : public Fix { int tflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_temp_csld.cpp b/src/fix_temp_csld.cpp index bf3d0eb7f6..f4da7a3c5b 100644 --- a/src/fix_temp_csld.cpp +++ b/src/fix_temp_csld.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_temp_csld.h b/src/fix_temp_csld.h index d4e5f206d7..687e79079f 100644 --- a/src/fix_temp_csld.h +++ b/src/fix_temp_csld.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(temp/csld,FixTempCSLD) - +// clang-format off +FixStyle(temp/csld,FixTempCSLD); +// clang-format on #else #ifndef LMP_FIX_TEMP_CSLD_H @@ -39,11 +39,11 @@ class FixTempCSLD : public Fix { virtual void *extract(const char *, int &); private: - double t_start,t_stop,t_period,t_target; + double t_start, t_stop, t_period, t_target; double **vhold; double energy; - int nmax,which; - int tstyle,tvar; + int nmax, which; + int tstyle, tvar; char *tstr; char *id_temp; @@ -53,7 +53,7 @@ class FixTempCSLD : public Fix { class RanMars *random; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_temp_csvr.cpp b/src/fix_temp_csvr.cpp index 2d04243a11..ca9e4b8684 100644 --- a/src/fix_temp_csvr.cpp +++ b/src/fix_temp_csvr.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -39,6 +40,7 @@ using namespace FixConst; enum{NOBIAS,BIAS}; enum{CONSTANT,EQUAL}; +static constexpr int PRNGSIZE = 98+2+3; /* ---------------------------------------------------------------------- */ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : @@ -330,7 +332,6 @@ double FixTempCSVR::compute_scalar() void FixTempCSVR::write_restart(FILE *fp) { - const int PRNGSIZE = 98+2+3; int nsize = PRNGSIZE*comm->nprocs+2; // pRNG state per proc + nprocs + energy double *list = nullptr; if (comm->me == 0) { @@ -363,7 +364,7 @@ void FixTempCSVR::restart(char *buf) if (nprocs != comm->nprocs) { if (comm->me == 0) error->warning(FLERR,"Different number of procs. Cannot restore RNG state."); - } else random->set_state(list+2+comm->me*103); + } else random->set_state(list+2+comm->me*PRNGSIZE); } /* ---------------------------------------------------------------------- diff --git a/src/fix_temp_csvr.h b/src/fix_temp_csvr.h index da61789f6c..ce6c785841 100644 --- a/src/fix_temp_csvr.h +++ b/src/fix_temp_csvr.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(temp/csvr,FixTempCSVR) - +// clang-format off +FixStyle(temp/csvr,FixTempCSVR); +// clang-format on #else #ifndef LMP_FIX_TEMP_CSVR_H @@ -39,10 +39,10 @@ class FixTempCSVR : public Fix { virtual void *extract(const char *, int &); private: - double t_start,t_stop,t_period,t_target; + double t_start, t_stop, t_period, t_target; double energy; - int nmax,which; - int tstyle,tvar; + int nmax, which; + int tstyle, tvar; char *tstr; char *id_temp; @@ -57,7 +57,7 @@ class FixTempCSVR : public Fix { double gamdev(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index 73c55f2793..2b3db70d4b 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_temp_rescale.h b/src/fix_temp_rescale.h index 3f2f0ac174..c24f35eb34 100644 --- a/src/fix_temp_rescale.h +++ b/src/fix_temp_rescale.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(temp/rescale,FixTempRescale) - +// clang-format off +FixStyle(temp/rescale,FixTempRescale); +// clang-format on #else #ifndef LMP_FIX_TEMP_RESCALE_H @@ -40,9 +40,9 @@ class FixTempRescale : public Fix { protected: int which; - double t_start,t_stop,t_window,t_target; - double fraction,energy,efactor; - int tstyle,tvar; + double t_start, t_stop, t_window, t_target; + double fraction, energy, efactor; + int tstyle, tvar; char *tstr; char *id_temp; @@ -50,7 +50,7 @@ class FixTempRescale : public Fix { int tflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp index ea76ca137b..c8dd39910b 100644 --- a/src/fix_tmd.cpp +++ b/src/fix_tmd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_tmd.h b/src/fix_tmd.h index c1151734d7..fd818eb583 100644 --- a/src/fix_tmd.h +++ b/src/fix_tmd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(tmd,FixTMD) - +// clang-format off +FixStyle(tmd,FixTMD); +// clang-format on #else #ifndef LMP_FIX_TMD_H @@ -42,20 +42,20 @@ class FixTMD : public Fix { private: int me; - int nfileevery,compressed; + int nfileevery, compressed; bigint previous_stat; FILE *fp; - double rho_start,rho_stop,rho_old,masstotal; - double dtv,dtf; + double rho_start, rho_stop, rho_old, masstotal; + double dtv, dtf; double *step_respa; - double work_lambda,work_analytical; - double **xf,**xold; + double work_lambda, work_analytical; + double **xf, **xold; void readfile(char *); void open(char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_vector.cpp b/src/fix_vector.cpp index 71a8bb3d3c..9066182ed1 100644 --- a/src/fix_vector.cpp +++ b/src/fix_vector.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_vector.h b/src/fix_vector.h index 8859870b71..2d82a22d9d 100644 --- a/src/fix_vector.h +++ b/src/fix_vector.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(vector,FixVector) - +// clang-format off +FixStyle(vector,FixVector); +// clang-format on #else #ifndef LMP_FIX_VECTOR_H @@ -33,22 +33,22 @@ class FixVector : public Fix { void setup(int); void end_of_step(); double compute_vector(int); - double compute_array(int,int); + double compute_array(int, int); private: int nvalues; - int *which,*argindex,*value2index; + int *which, *argindex, *value2index; char **ids; - bigint nextstep,initialstep; + bigint nextstep, initialstep; - int ncount; // # of values currently in growing vector or array - int ncountmax; // max # of values vector/array can hold + int ncount; // # of values currently in growing vector or array + int ncountmax; // max # of values vector/array can hold double *vector; double **array; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_viscous.cpp b/src/fix_viscous.cpp index 0c7d682ae2..a13100ee48 100644 --- a/src/fix_viscous.cpp +++ b/src/fix_viscous.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_viscous.h b/src/fix_viscous.h index 7ce58c1c86..08970094bc 100644 --- a/src/fix_viscous.h +++ b/src/fix_viscous.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(viscous,FixViscous) - +// clang-format off +FixStyle(viscous,FixViscous); +// clang-format on #else #ifndef LMP_FIX_VISCOUS_H @@ -41,7 +41,7 @@ class FixViscous : public Fix { int ilevel_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index 280ce848c6..8f5c0dabe8 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_wall.h b/src/fix_wall.h index 680fb50eb7..9d44ff4e4c 100644 --- a/src/fix_wall.h +++ b/src/fix_wall.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,7 +23,7 @@ class FixWall : public Fix { int nwall; int wallwhich[6]; double coord0[6]; - int xflag; // 1 if any wall position is a variable + int xflag; // 1 if any wall position is a variable int xstyle[6]; int xindex[6]; char *xstr[6]; @@ -45,19 +45,19 @@ class FixWall : public Fix { virtual void wall_particle(int, int, double) = 0; protected: - double epsilon[6],sigma[6],alpha[6],cutoff[6]; - double ewall[7],ewall_all[7]; - double xscale,yscale,zscale; - int estyle[6],sstyle[6],astyle[6],wstyle[6]; - int eindex[6],sindex[6]; - char *estr[6],*sstr[6],*astr[6]; - int varflag; // 1 if any wall position,epsilon,sigma is a var - int eflag; // per-wall flag for energy summation + double epsilon[6], sigma[6], alpha[6], cutoff[6]; + double ewall[7], ewall_all[7]; + double xscale, yscale, zscale; + int estyle[6], sstyle[6], astyle[6], wstyle[6]; + int eindex[6], sindex[6]; + char *estr[6], *sstr[6], *astr[6]; + int varflag; // 1 if any wall position,epsilon,sigma is a var + int eflag; // per-wall flag for energy summation int ilevel_respa; int fldflag; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/fix_wall_harmonic.cpp b/src/fix_wall_harmonic.cpp index ffd950262b..1afca23c96 100644 --- a/src/fix_wall_harmonic.cpp +++ b/src/fix_wall_harmonic.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_wall_harmonic.h b/src/fix_wall_harmonic.h index 32a458c1ba..473504d47d 100644 --- a/src/fix_wall_harmonic.h +++ b/src/fix_wall_harmonic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/harmonic,FixWallHarmonic) - +// clang-format off +FixStyle(wall/harmonic,FixWallHarmonic); +// clang-format on #else #ifndef LMP_FIX_WALL_HARMONIC_H @@ -31,7 +31,7 @@ class FixWallHarmonic : public FixWall { void wall_particle(int, int, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_wall_lj1043.cpp b/src/fix_wall_lj1043.cpp index 03ef4c91a6..592636b937 100644 --- a/src/fix_wall_lj1043.cpp +++ b/src/fix_wall_lj1043.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_wall_lj1043.h b/src/fix_wall_lj1043.h index 502fac293d..17d5836302 100644 --- a/src/fix_wall_lj1043.h +++ b/src/fix_wall_lj1043.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/lj1043,FixWallLJ1043) - +// clang-format off +FixStyle(wall/lj1043,FixWallLJ1043); +// clang-format on #else #ifndef LMP_FIX_WALL_LJ1043_H @@ -31,12 +31,10 @@ class FixWallLJ1043 : public FixWall { void wall_particle(int, int, double); private: - double coeff1[6],coeff2[6],coeff3[6],coeff4[6],coeff5[6],coeff6[6], - coeff7[6],offset[6]; + double coeff1[6], coeff2[6], coeff3[6], coeff4[6], coeff5[6], coeff6[6], coeff7[6], offset[6]; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/fix_wall_lj126.cpp b/src/fix_wall_lj126.cpp index 93d529c866..068663bd85 100644 --- a/src/fix_wall_lj126.cpp +++ b/src/fix_wall_lj126.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_wall_lj126.h b/src/fix_wall_lj126.h index 8f833fa077..2ea768ba65 100644 --- a/src/fix_wall_lj126.h +++ b/src/fix_wall_lj126.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/lj126,FixWallLJ126) - +// clang-format off +FixStyle(wall/lj126,FixWallLJ126); +// clang-format on #else #ifndef LMP_FIX_WALL_LJ126_H @@ -31,10 +31,10 @@ class FixWallLJ126 : public FixWall { void wall_particle(int, int, double); private: - double coeff1[6],coeff2[6],coeff3[6],coeff4[6],offset[6]; + double coeff1[6], coeff2[6], coeff3[6], coeff4[6], offset[6]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_wall_lj93.cpp b/src/fix_wall_lj93.cpp index 454d42df55..5a93732461 100644 --- a/src/fix_wall_lj93.cpp +++ b/src/fix_wall_lj93.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_wall_lj93.h b/src/fix_wall_lj93.h index 1942464997..4326e7acc0 100644 --- a/src/fix_wall_lj93.h +++ b/src/fix_wall_lj93.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/lj93,FixWallLJ93) - +// clang-format off +FixStyle(wall/lj93,FixWallLJ93); +// clang-format on #else #ifndef LMP_FIX_WALL_LJ93_H @@ -31,10 +31,10 @@ class FixWallLJ93 : public FixWall { virtual void wall_particle(int, int, double); protected: - double coeff1[6],coeff2[6],coeff3[6],coeff4[6],offset[6]; + double coeff1[6], coeff2[6], coeff3[6], coeff4[6], offset[6]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_wall_morse.cpp b/src/fix_wall_morse.cpp index b306aea671..afac920c01 100644 --- a/src/fix_wall_morse.cpp +++ b/src/fix_wall_morse.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_wall_morse.h b/src/fix_wall_morse.h index 1106ee85be..55ab2c0cd8 100644 --- a/src/fix_wall_morse.h +++ b/src/fix_wall_morse.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/morse,FixWallMorse) - +// clang-format off +FixStyle(wall/morse,FixWallMorse); +// clang-format on #else #ifndef LMP_FIX_WALL_MORSE_H @@ -31,10 +31,10 @@ class FixWallMorse : public FixWall { void wall_particle(int, int, double); private: - double coeff1[6],offset[6]; + double coeff1[6], offset[6]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_wall_reflect.cpp b/src/fix_wall_reflect.cpp index 77c3cd368f..ac5940c513 100644 --- a/src/fix_wall_reflect.cpp +++ b/src/fix_wall_reflect.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/fix_wall_reflect.h b/src/fix_wall_reflect.h index 409cc984ae..45b5c8d2d2 100644 --- a/src/fix_wall_reflect.h +++ b/src/fix_wall_reflect.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/reflect,FixWallReflect) - +// clang-format off +FixStyle(wall/reflect,FixWallReflect); +// clang-format on #else #ifndef LMP_FIX_WALL_REFLECT_H @@ -26,8 +26,8 @@ namespace LAMMPS_NS { class FixWallReflect : public Fix { public: - enum{XLO=0,XHI=1,YLO=2,YHI=3,ZLO=4,ZHI=5}; - enum{NONE=0,EDGE,CONSTANT,VARIABLE}; + enum { XLO = 0, XHI = 1, YLO = 2, YHI = 3, ZLO = 4, ZHI = 5 }; + enum { NONE = 0, EDGE, CONSTANT, VARIABLE }; FixWallReflect(class LAMMPS *, int, char **); virtual ~FixWallReflect(); @@ -37,17 +37,17 @@ class FixWallReflect : public Fix { protected: int nwall; - int wallwhich[6],wallstyle[6]; + int wallwhich[6], wallstyle[6]; double coord0[6]; char *varstr[6]; int varindex[6]; int varflag; - double xscale,yscale,zscale; + double xscale, yscale, zscale; virtual void wall_particle(int m, int which, double coord); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp index e5c9167ce4..909f777dce 100644 --- a/src/fix_wall_region.cpp +++ b/src/fix_wall_region.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -396,7 +397,7 @@ void FixWallRegion::morse(double r) { double dr = r - sigma; double dexp = exp(-alpha * dr); - fwall = coeff1 * (dexp*dexp - dexp) / r; + fwall = coeff1 * (dexp*dexp - dexp); eng = epsilon * (dexp*dexp - 2.0*dexp) - offset; } diff --git a/src/fix_wall_region.h b/src/fix_wall_region.h index 36b19bb2ff..e72ada5301 100644 --- a/src/fix_wall_region.h +++ b/src/fix_wall_region.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef FIX_CLASS - -FixStyle(wall/region,FixWallRegion) - +// clang-format off +FixStyle(wall/region,FixWallRegion); +// clang-format on #else #ifndef LMP_FIX_WALL_REGION_H @@ -39,17 +39,17 @@ class FixWallRegion : public Fix { double compute_vector(int); private: - int style,iregion; - double epsilon,sigma,cutoff; + int style, iregion; + double epsilon, sigma, cutoff; double alpha; int eflag; - double ewall[4],ewall_all[4]; + double ewall[4], ewall_all[4]; int ilevel_respa; char *idregion; - double coeff1,coeff2,coeff3,coeff4,offset; - double coeff5,coeff6,coeff7; - double eng,fwall; + double coeff1, coeff2, coeff3, coeff4, offset; + double coeff5, coeff6, coeff7; + double eng, fwall; void lj93(double); void lj126(double); @@ -59,7 +59,7 @@ class FixWallRegion : public Fix { void harmonic(double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fmt/.clang-format b/src/fmt/.clang-format new file mode 100644 index 0000000000..9d159247d5 --- /dev/null +++ b/src/fmt/.clang-format @@ -0,0 +1,2 @@ +DisableFormat: true +SortIncludes: false diff --git a/src/fmtlib_format.cpp b/src/fmtlib_format.cpp index 6141d964a7..ff95f64d3e 100644 --- a/src/fmtlib_format.cpp +++ b/src/fmtlib_format.cpp @@ -1,3 +1,4 @@ +// clang-format off // Formatting library for C++ // // Copyright (c) 2012 - 2016, Victor Zverovich diff --git a/src/fmtlib_os.cpp b/src/fmtlib_os.cpp index 6850024588..8cb2bf5e35 100644 --- a/src/fmtlib_os.cpp +++ b/src/fmtlib_os.cpp @@ -1,3 +1,4 @@ +// clang-format off // Formatting library for C++ - optional OS-specific functionality // // Copyright (c) 2012 - 2016, Victor Zverovich diff --git a/src/force.cpp b/src/force.cpp index aa93b0af7d..0f5d49e9c8 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -448,7 +449,7 @@ Angle *Force::new_angle(const std::string &style, int trysuffix, int &sflag) if (lmp->suffix2) { sflag = 2; - std::string estyle = style + "/" + lmp->suffix; + std::string estyle = style + "/" + lmp->suffix2; if (angle_map->find(estyle) != angle_map->end()) { AngleCreator &angle_creator = (*angle_map)[estyle]; return angle_creator(lmp); @@ -678,7 +679,7 @@ KSpace *Force::new_kspace(const std::string &style, int trysuffix, int &sflag) } if (lmp->suffix2) { - sflag = 1; + sflag = 2; std::string estyle = style + "/" + lmp->suffix2; if (kspace_map->find(estyle) != kspace_map->end()) { KSpaceCreator &kspace_creator = (*kspace_map)[estyle]; diff --git a/src/force.h b/src/force.h index e2ad12be97..09e13c7bd1 100644 --- a/src/force.h +++ b/src/force.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,19 +19,16 @@ #include namespace LAMMPS_NS { - class Angle; - class Bond; - class Dihedral; - class Improper; - class KSpace; - class Pair; +class Angle; +class Bond; +class Dihedral; +class Improper; +class KSpace; +class Pair; -enum { - ENERGY_NONE = 0x00, - ENERGY_GLOBAL = 0x01, - ENERGY_ATOM = 0x02 -}; +enum { ENERGY_NONE = 0x00, ENERGY_GLOBAL = 0x01, ENERGY_ATOM = 0x02 }; +// clang-format off enum { VIRIAL_NONE = 0x00, VIRIAL_PAIR = 0x01, @@ -39,39 +36,36 @@ enum { VIRIAL_ATOM = 0x04, VIRIAL_CENTROID = 0x08 }; +// clang-format on -enum { - CENTROID_SAME = 0, - CENTROID_AVAIL = 1, - CENTROID_NOTAVAIL = 2 -}; +enum { CENTROID_SAME = 0, CENTROID_AVAIL = 1, CENTROID_NOTAVAIL = 2 }; class Force : protected Pointers { public: - double boltz; // Boltzmann constant (eng/degree-K) - double hplanck; // Planck's constant (energy-time) - double mvv2e; // conversion of mv^2 to energy - double ftm2v; // conversion of ft/m to velocity - double mv2d; // conversion of mass/volume to density - double nktv2p; // conversion of NkT/V to pressure - double qqr2e; // conversion of q^2/r to energy - double qe2f; // conversion of qE to force - double vxmu2f; // conversion of vx dynamic-visc to force - double xxt2kmu; // conversion of xx/t to kinematic-visc - double dielectric; // dielectric constant - double qqrd2e; // q^2/r to energy w/ dielectric constant - double e_mass; // electron mass - double hhmrr2e; // conversion of (hbar)^2/(mr^2) to energy - double mvh2r; // conversion of mv/hbar to distance - // hbar = h/(2*pi) - double angstrom; // 1 angstrom in native units - double femtosecond; // 1 femtosecond in native units - double qelectron; // 1 electron charge abs() in native units + double boltz; // Boltzmann constant (eng/degree-K) + double hplanck; // Planck's constant (energy-time) + double mvv2e; // conversion of mv^2 to energy + double ftm2v; // conversion of ft/m to velocity + double mv2d; // conversion of mass/volume to density + double nktv2p; // conversion of NkT/V to pressure + double qqr2e; // conversion of q^2/r to energy + double qe2f; // conversion of qE to force + double vxmu2f; // conversion of vx dynamic-visc to force + double xxt2kmu; // conversion of xx/t to kinematic-visc + double dielectric; // dielectric constant + double qqrd2e; // q^2/r to energy w/ dielectric constant + double e_mass; // electron mass + double hhmrr2e; // conversion of (hbar)^2/(mr^2) to energy + double mvh2r; // conversion of mv/hbar to distance + // hbar = h/(2*pi) + double angstrom; // 1 angstrom in native units + double femtosecond; // 1 femtosecond in native units + double qelectron; // 1 electron charge abs() in native units - double qqr2e_lammps_real; // different versions of this constant - double qqr2e_charmm_real; // used by new CHARMM pair styles + double qqr2e_lammps_real; // different versions of this constant + double qqr2e_charmm_real; // used by new CHARMM pair styles - int newton,newton_pair,newton_bond; // Newton's 3rd law settings + int newton, newton_pair, newton_bond; // Newton's 3rd law settings Pair *pair; char *pair_style; @@ -99,12 +93,12 @@ class Force : protected Pointers { typedef Improper *(*ImproperCreator)(LAMMPS *); typedef KSpace *(*KSpaceCreator)(LAMMPS *); - typedef std::map PairCreatorMap; - typedef std::map BondCreatorMap; - typedef std::map AngleCreatorMap; - typedef std::map DihedralCreatorMap; - typedef std::map ImproperCreatorMap; - typedef std::map KSpaceCreatorMap; + typedef std::map PairCreatorMap; + typedef std::map BondCreatorMap; + typedef std::map AngleCreatorMap; + typedef std::map DihedralCreatorMap; + typedef std::map ImproperCreatorMap; + typedef std::map KSpaceCreatorMap; PairCreatorMap *pair_map; BondCreatorMap *bond_map; @@ -113,7 +107,7 @@ class Force : protected Pointers { ImproperCreatorMap *improper_map; KSpaceCreatorMap *kspace_map; - // index [0] is not used in these arrays + // index [0] is not used in these arrays double special_lj[4]; // 1-2, 1-3, 1-4 prefactors for LJ double special_coul[4]; // 1-2, 1-3, 1-4 prefactors for Coulombics int special_angle; // 0 if defined angles are ignored @@ -129,7 +123,7 @@ class Force : protected Pointers { void create_pair(const std::string &, int); Pair *new_pair(const std::string &, int, int &); - Pair *pair_match(const std::string &, int, int nsub=0); + Pair *pair_match(const std::string &, int, int nsub = 0); char *pair_match_ptr(Pair *); void create_bond(const std::string &, int); @@ -167,7 +161,7 @@ class Force : protected Pointers { template static KSpace *kspace_creator(LAMMPS *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/group.cpp b/src/group.cpp index 901dccba25..ab058b49da 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/group.h b/src/group.h index 17f9b4d564..8d4270bbad 100644 --- a/src/group.h +++ b/src/group.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,52 +22,52 @@ namespace LAMMPS_NS { class Group : protected Pointers { public: - int ngroup; // # of defined groups - char **names; // name of each group - int *bitmask; // one-bit mask for each group - int *inversemask; // inverse mask for each group - int *dynamic; // 1 if dynamic, 0 if not + int ngroup; // # of defined groups + char **names; // name of each group + int *bitmask; // one-bit mask for each group + int *inversemask; // inverse mask for each group + int *dynamic; // 1 if dynamic, 0 if not Group(class LAMMPS *); ~Group(); - void assign(int, char **); // assign atoms to a group - void assign(const std::string &); // convenience function - void create(const std::string &, int *); // add flagged atoms to a group - int find(const std::string &); // lookup name in list of groups - int find_or_create(const char *); // lookup name or create new group + void assign(int, char **); // assign atoms to a group + void assign(const std::string &); // convenience function + void create(const std::string &, int *); // add flagged atoms to a group + int find(const std::string &); // lookup name in list of groups + int find_or_create(const char *); // lookup name or create new group void write_restart(FILE *); void read_restart(FILE *); - bigint count_all(); // count atoms in group all - bigint count(int); // count atoms in group - bigint count(int,int); // count atoms in group & region - double mass(int); // total mass of atoms in group - double mass(int,int); - double charge(int); // total charge of atoms in group - double charge(int,int); - void bounds(int, double *); // bounds of atoms in group + bigint count_all(); // count atoms in group all + bigint count(int); // count atoms in group + bigint count(int, int); // count atoms in group & region + double mass(int); // total mass of atoms in group + double mass(int, int); + double charge(int); // total charge of atoms in group + double charge(int, int); + void bounds(int, double *); // bounds of atoms in group void bounds(int, double *, int); - void xcm(int, double, double *); // center-of-mass coords of group + void xcm(int, double, double *); // center-of-mass coords of group void xcm(int, double, double *, int); - void vcm(int, double, double *); // center-of-mass velocity of group + void vcm(int, double, double *); // center-of-mass velocity of group void vcm(int, double, double *, int); - void fcm(int, double *); // total force on group + void fcm(int, double *); // total force on group void fcm(int, double *, int); - double ke(int); // kinetic energy of group + double ke(int); // kinetic energy of group double ke(int, int); - double gyration(int, double, double *); // radius-of-gyration of group + double gyration(int, double, double *); // radius-of-gyration of group double gyration(int, double, double *, int); void angmom(int, double *, double *); // angular momentum of group void angmom(int, double *, double *, int); void torque(int, double *, double *); // torque on group void torque(int, double *, double *, int); - void inertia(int, double *, double [3][3]); // inertia tensor - void inertia(int, double *, double [3][3], int); - void omega(double *, double [3][3], double *); // angular velocity + void inertia(int, double *, double[3][3]); // inertia tensor + void inertia(int, double *, double[3][3], int); + void omega(double *, double[3][3], double *); // angular velocity private: int me; - std::map *hash; + std::map *hash; int find_unused(); void add_molecules(int, int); @@ -78,7 +78,7 @@ class Group : protected Pointers { int molbit; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/hashlittle.cpp b/src/hashlittle.cpp index a76e36050f..3aeb0825de 100644 --- a/src/hashlittle.cpp +++ b/src/hashlittle.cpp @@ -1,3 +1,4 @@ +// clang-format off // Hash function hashlittle() // from lookup3.c, by Bob Jenkins, May 2006, Public Domain // bob_jenkins@burtleburtle.net diff --git a/src/hashlittle.h b/src/hashlittle.h index aafde922b7..95f8da2170 100644 --- a/src/hashlittle.h +++ b/src/hashlittle.h @@ -9,6 +9,6 @@ #include namespace LAMMPS_NS { - uint32_t hashlittle(const void *key, size_t length, uint32_t); +uint32_t hashlittle(const void *key, size_t length, uint32_t); } #endif diff --git a/src/image.cpp b/src/image.cpp index 0acef0bceb..33127fcf89 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/image.h b/src/image.h index 5a08430fc9..f9937cacfa 100644 --- a/src/image.h +++ b/src/image.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,25 +14,25 @@ #ifndef LMP_IMAGE_H #define LMP_IMAGE_H -#include #include "pointers.h" +#include namespace LAMMPS_NS { class Image : protected Pointers { public: - int width,height; // size of image - double theta,phi; // view image from theta,phi - double xctr,yctr,zctr; // center of image in user coords - double up[3]; // up direction in image - double zoom; // zoom factor - double persp; // perspective factor - double shiny; // shininess of objects - int ssao; // SSAO on or off - int seed; // RN seed for SSAO - double ssaoint; // strength of shading from 0 to 1 - double *boxcolor; // color to draw box outline with - int background[3]; // RGB values of background + int width, height; // size of image + double theta, phi; // view image from theta,phi + double xctr, yctr, zctr; // center of image in user coords + double up[3]; // up direction in image + double zoom; // zoom factor + double persp; // perspective factor + double shiny; // shininess of objects + int ssao; // SSAO on or off + int seed; // RN seed for SSAO + double ssaoint; // strength of shading from 0 to 1 + double *boxcolor; // color to draw box outline with + int background[3]; // RGB values of background Image(class LAMMPS *, int); ~Image(); @@ -59,23 +59,23 @@ class Image : protected Pointers { int addcolor(char *, double, double, double); double *element2color(char *); double element2diam(char *); - double *color2rgb(const char *, int index=0); + double *color2rgb(const char *, int index = 0); int default_colors(); private: - int me,nprocs; + int me, nprocs; int npixels; class ColorMap **maps; int nmap; - double *depthBuffer,*surfaceBuffer; - double *depthcopy,*surfacecopy; - unsigned char *imageBuffer,*rgbcopy,*writeBuffer; + double *depthBuffer, *surfaceBuffer; + double *depthcopy, *surfacecopy; + unsigned char *imageBuffer, *rgbcopy, *writeBuffer; // MPI_Gatherv - int *recvcounts,*displs; + int *recvcounts, *displs; // constant view params @@ -105,8 +105,8 @@ class Image : protected Pointers { double zdist; double tanPerPixel; - double camDir[3],camUp[3],camRight[4],camPos[3]; - double keyLightDir[3],fillLightDir[3],backLightDir[3]; + double camDir[3], camUp[3], camRight[4], camPos[3]; + double keyLightDir[3], fillLightDir[3], backLightDir[3]; double keyHalfDir[3]; // color values @@ -121,20 +121,24 @@ class Image : protected Pointers { // internal methods - void draw_pixel(int, int, double, double *, double*); + void draw_pixel(int, int, double, double *, double *); void compute_SSAO(); // inline functions - inline double saturate(double v) { - if (v < 0.0) return 0.0; - else if (v > 1.0) return 1.0; - else return v; + inline double saturate(double v) + { + if (v < 0.0) + return 0.0; + else if (v > 1.0) + return 1.0; + else + return v; } - inline double distance(double* a, double* b) { - return sqrt((a[0] - b[0]) * (a[0] - b[0]) + - (a[1] - b[1]) * (a[1] - b[1]) + + inline double distance(double *a, double *b) + { + return sqrt((a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]) + (a[2] - b[2]) * (a[2] - b[2])); } }; @@ -143,9 +147,9 @@ class Image : protected Pointers { class ColorMap : protected Pointers { public: - int dynamic; // 0/1 if lo/hi bounds are static/dynamic + int dynamic; // 0/1 if lo/hi bounds are static/dynamic - ColorMap(class LAMMPS *, class Image*); + ColorMap(class LAMMPS *, class Image *); ~ColorMap(); int reset(int, char **); int minmax(double, double); @@ -153,24 +157,24 @@ class ColorMap : protected Pointers { private: class Image *image; // caller with color2rgb() method - int mstyle,mrange; // 2-letter style/range of color map - int mlo,mhi; // bounds = NUMERIC or MINVALUE or MAXVALUE - double mlovalue,mhivalue; // user bounds if NUMERIC - double locurrent,hicurrent; // current bounds for this snapshot - double mbinsize,mbinsizeinv; // bin size for sequential color map + int mstyle, mrange; // 2-letter style/range of color map + int mlo, mhi; // bounds = NUMERIC or MINVALUE or MAXVALUE + double mlovalue, mhivalue; // user bounds if NUMERIC + double locurrent, hicurrent; // current bounds for this snapshot + double mbinsize, mbinsizeinv; // bin size for sequential color map double interpolate[3]; // local storage for returned RGB color struct MapEntry { - int single,lo,hi; // NUMERIC or MINVALUE or MAXVALUE - double svalue,lvalue,hvalue; // actual value - double *color; // RGB values + int single, lo, hi; // NUMERIC or MINVALUE or MAXVALUE + double svalue, lvalue, hvalue; // actual value + double *color; // RGB values }; MapEntry *mentry; int nentry; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/imbalance.cpp b/src/imbalance.cpp index 10be2dd3e6..80cbd8654a 100644 --- a/src/imbalance.cpp +++ b/src/imbalance.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/imbalance.h b/src/imbalance.h index cd6ad81389..06cbc97933 100644 --- a/src/imbalance.h +++ b/src/imbalance.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,7 +14,7 @@ #ifndef LMP_IMBALANCE_H #define LMP_IMBALANCE_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export #include namespace LAMMPS_NS { @@ -22,12 +22,12 @@ namespace LAMMPS_NS { class Imbalance : protected Pointers { public: Imbalance(class LAMMPS *); - virtual ~Imbalance() {}; + virtual ~Imbalance(){}; // parse options. return number of arguments consumed (required) virtual int options(int, char **) = 0; // reinitialize internal data (needed for fix balance) (optional) - virtual void init(int) {}; + virtual void init(int){}; // compute and apply weight factors to local atom array (required) virtual void compute(double *) = 0; // print information about the state of this imbalance compute (required) @@ -40,6 +40,6 @@ class Imbalance : protected Pointers { //Imbalance &operator=(const Imbalance &) {return *this;}; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/imbalance_group.cpp b/src/imbalance_group.cpp index 09de0c8f90..f4c883ff4c 100644 --- a/src/imbalance_group.cpp +++ b/src/imbalance_group.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/imbalance_group.h b/src/imbalance_group.h index 2eec6eb494..0a8eab4363 100644 --- a/src/imbalance_group.h +++ b/src/imbalance_group.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -31,12 +31,12 @@ class ImbalanceGroup : public Imbalance { virtual std::string info() override; private: - int num; // number of groups with weights - int *id; // numerical IDs of groups - double *factor; // group weight factors + int num; // number of groups with weights + int *id; // numerical IDs of groups + double *factor; // group weight factors }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/imbalance_neigh.cpp b/src/imbalance_neigh.cpp index 4c6da87740..3a523114ee 100644 --- a/src/imbalance_neigh.cpp +++ b/src/imbalance_neigh.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/imbalance_neigh.h b/src/imbalance_neigh.h index 40dc090030..e5422076fa 100644 --- a/src/imbalance_neigh.h +++ b/src/imbalance_neigh.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -32,11 +32,11 @@ class ImbalanceNeigh : public Imbalance { virtual std::string info() override; private: - double factor; // weight factor for neighbor imbalance - int did_warn; // 1 if warned about no suitable neighbor list + double factor; // weight factor for neighbor imbalance + int did_warn; // 1 if warned about no suitable neighbor list }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/imbalance_store.cpp b/src/imbalance_store.cpp index e72ef4d50b..d03e44bca6 100644 --- a/src/imbalance_store.cpp +++ b/src/imbalance_store.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/imbalance_store.h b/src/imbalance_store.h index 2328c61966..55f6873645 100644 --- a/src/imbalance_store.h +++ b/src/imbalance_store.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -32,10 +32,10 @@ class ImbalanceStore : public Imbalance { virtual std::string info() override; private: - char *name; // property name + char *name; // property name }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/imbalance_time.cpp b/src/imbalance_time.cpp index 8aa562267d..8c5104381d 100644 --- a/src/imbalance_time.cpp +++ b/src/imbalance_time.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/imbalance_time.h b/src/imbalance_time.h index 3617bf1abd..cd000a6c4f 100644 --- a/src/imbalance_time.h +++ b/src/imbalance_time.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -34,11 +34,11 @@ class ImbalanceTime : public Imbalance { virtual std::string info() override; private: - double factor; // weight factor for time imbalance - double last; // combined wall time from last call + double factor; // weight factor for time imbalance + double last; // combined wall time from last call }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/imbalance_var.cpp b/src/imbalance_var.cpp index 64f98a6a26..8679216b94 100644 --- a/src/imbalance_var.cpp +++ b/src/imbalance_var.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/imbalance_var.h b/src/imbalance_var.h index 6c852f00d2..d1959f311d 100644 --- a/src/imbalance_var.h +++ b/src/imbalance_var.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -34,11 +34,11 @@ class ImbalanceVar : public Imbalance { virtual std::string info() override; private: - char *name; // variable name - int id; // variable index + char *name; // variable name + int id; // variable index }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/improper.cpp b/src/improper.cpp index 5b1fbfdaab..00033880f0 100644 --- a/src/improper.cpp +++ b/src/improper.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/improper.h b/src/improper.h index 8be2516eac..1f88204a6b 100644 --- a/src/improper.h +++ b/src/improper.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,31 +14,32 @@ #ifndef LMP_IMPROPER_H #define LMP_IMPROPER_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Improper : protected Pointers { friend class ThrOMP; friend class FixOMP; + public: int allocated; int *setflag; - 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 - double **cvatom; // accumulated per-atom centroid virial + 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 + double **cvatom; // accumulated per-atom centroid virial - int centroidstressflag; // centroid stress compared to two-body stress - // CENTROID_SAME = same as two-body stress - // CENTROID_AVAIL = different and implemented - // CENTROID_NOTAVAIL = different, not yet implemented + int centroidstressflag; // centroid stress compared to two-body stress + // CENTROID_SAME = same as two-body stress + // CENTROID_AVAIL = different and implemented + // CENTROID_NOTAVAIL = different, not yet implemented // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; int copymode; Improper(class LAMMPS *); @@ -50,31 +51,34 @@ class Improper : protected Pointers { virtual void coeff(int, char **) = 0; virtual void write_restart(FILE *) = 0; virtual void read_restart(FILE *) = 0; - virtual void write_restart_settings(FILE *) {}; - virtual void read_restart_settings(FILE *) {}; + virtual void write_restart_settings(FILE *){}; + virtual void read_restart_settings(FILE *){}; virtual void write_data(FILE *) {} virtual double memory_usage(); protected: - int suffix_flag; // suffix compatibility flag + int suffix_flag; // suffix compatibility flag int evflag; - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom,cvflag_atom; - int maxeatom,maxvatom,maxcvatom; + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom, cvflag_atom; + int maxeatom, maxvatom, maxcvatom; - void ev_init(int eflag, int vflag, int alloc = 1) { - if (eflag||vflag) ev_setup(eflag, vflag, alloc); - else evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = cvflag_atom = 0; + void ev_init(int eflag, int vflag, int alloc = 1) + { + if (eflag || vflag) + ev_setup(eflag, vflag, alloc); + else + evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = + cvflag_atom = 0; } void ev_setup(int, int, int alloc = 1); - void ev_tally(int, int, int, int, int, int, double, - double *, double *, double *, double, double, double, - double, double, double, double, double, double); + void ev_tally(int, int, int, int, int, int, double, double *, double *, double *, double, double, + double, double, double, double, double, double, double); void problem(const char *, int, int, int, int, int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/improper_deprecated.cpp b/src/improper_deprecated.cpp index fd4a0f6285..7e03825346 100644 --- a/src/improper_deprecated.cpp +++ b/src/improper_deprecated.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/improper_deprecated.h b/src/improper_deprecated.h index 6f3e777dcb..ea080ba3cb 100644 --- a/src/improper_deprecated.h +++ b/src/improper_deprecated.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(DEPRECATED,ImproperDeprecated) - +// clang-format off +ImproperStyle(DEPRECATED,ImproperDeprecated); +// clang-format on #else #ifndef LMP_IMPROPER_DEPRECATED_H @@ -36,7 +36,7 @@ class ImproperDeprecated : public Improper { virtual void read_restart(FILE *) {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/improper_hybrid.cpp b/src/improper_hybrid.cpp index 23f6633ef2..a5781beba2 100644 --- a/src/improper_hybrid.cpp +++ b/src/improper_hybrid.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/improper_hybrid.h b/src/improper_hybrid.h index f208a7055e..e680ec9119 100644 --- a/src/improper_hybrid.h +++ b/src/improper_hybrid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(hybrid,ImproperHybrid) - +// clang-format off +ImproperStyle(hybrid,ImproperHybrid); +// clang-format on #else #ifndef LMP_IMPROPER_HYBRID_H @@ -26,9 +26,9 @@ namespace LAMMPS_NS { class ImproperHybrid : public Improper { public: - int nstyles; // # of different improper styles - Improper **styles; // class list for each Improper style - char **keywords; // keyword for each improper style + int nstyles; // # of different improper styles + Improper **styles; // class list for each Improper style + char **keywords; // keyword for each improper style ImproperHybrid(class LAMMPS *); ~ImproperHybrid(); @@ -41,16 +41,16 @@ class ImproperHybrid : public Improper { double memory_usage(); private: - int *map; // which style each improper type points to + int *map; // which style each improper type points to - int *nimproperlist; // # of impropers in sub-style improperlists - int *maximproper; // max # of impropers sub-style lists can store - int ***improperlist; // improperlist for each sub-style + int *nimproperlist; // # of impropers in sub-style improperlists + int *maximproper; // max # of impropers sub-style lists can store + int ***improperlist; // improperlist for each sub-style void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/improper_zero.cpp b/src/improper_zero.cpp index f177ff10d2..a29396d18d 100644 --- a/src/improper_zero.cpp +++ b/src/improper_zero.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/improper_zero.h b/src/improper_zero.h index 78c560ba13..9b1dfa4e73 100644 --- a/src/improper_zero.h +++ b/src/improper_zero.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef IMPROPER_CLASS - -ImproperStyle(zero,ImproperZero) - +// clang-format off +ImproperStyle(zero,ImproperZero); +// clang-format on #else #ifndef LMP_IMPROPER_ZERO_H @@ -42,7 +42,7 @@ class ImproperZero : public Improper { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/info.cpp b/src/info.cpp index b9c320bf2e..12546b6be9 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/info.h b/src/info.h index f376adf8dc..d000b3c443 100644 --- a/src/info.h +++ b/src/info.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(info,Info) - +// clang-format off +CommandStyle(info,Info); +// clang-format on #else #ifndef LMP_INFO_H @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class Info : public Command { public: - Info(class LAMMPS *lmp) : Command(lmp) {}; + Info(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); bool is_active(const char *, const char *); @@ -44,8 +44,7 @@ class Info : public Command { static bool has_ffmpeg_support(); static bool has_exceptions(); static bool has_package(const std::string &); - static bool has_accelerator_feature(const std::string &, - const std::string &, + static bool has_accelerator_feature(const std::string &, const std::string &, const std::string &); static bool has_gpu_device(); static std::string get_gpu_device_info(); @@ -56,31 +55,31 @@ class Info : public Command { static std::string get_mpi_vendor(); static std::string get_mpi_info(int &, int &); static std::string get_cxx_info(); - static std::string get_accelerator_info(const std::string &pkg=""); + static std::string get_accelerator_info(const std::string &pkg = ""); void get_memory_info(double *); char **get_variable_names(int &num); -private: - void available_styles(FILE * out, int flags); + private: + void available_styles(FILE *out, int flags); - void atom_styles(FILE * out); - void integrate_styles(FILE * out); - void minimize_styles(FILE * out); - void pair_styles(FILE * out); - void bond_styles(FILE * out); - void angle_styles(FILE * out); - void dihedral_styles(FILE * out); - void improper_styles(FILE * out); - void kspace_styles(FILE * out); - void fix_styles(FILE * out); - void compute_styles(FILE * out); - void region_styles(FILE * out); - void dump_styles(FILE * out); - void command_styles(FILE * out); + void atom_styles(FILE *out); + void integrate_styles(FILE *out); + void minimize_styles(FILE *out); + void pair_styles(FILE *out); + void bond_styles(FILE *out); + void angle_styles(FILE *out); + void dihedral_styles(FILE *out); + void improper_styles(FILE *out); + void kspace_styles(FILE *out); + void fix_styles(FILE *out); + void compute_styles(FILE *out); + void region_styles(FILE *out); + void dump_styles(FILE *out); + void command_styles(FILE *out); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/input.cpp b/src/input.cpp index ebd8b3af2e..1ef88be866 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/input.h b/src/input.h index 59369ac7cf..d82816aa04 100644 --- a/src/input.h +++ b/src/input.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,7 +19,7 @@ #include namespace LAMMPS_NS { - class Command; +class Command; class Input : protected Pointers { friend class Info; @@ -34,47 +34,47 @@ class Input : protected Pointers { Input(class LAMMPS *, int, char **); ~Input(); - void file(); // process all input - void file(const char *); // process an input script - char *one(const std::string&); // process a single command + void file(); // process all input + void file(const char *); // process an input script + char *one(const std::string &); // process a single command void substitute(char *&, char *&, int &, int &, int); - // substitute for variables in a string - void write_echo(const std::string &); // send text to active echo file pointers + // substitute for variables in a string + void write_echo(const std::string &); // send text to active echo file pointers protected: - char *command; // ptr to current command - int echo_screen; // 0 = no, 1 = yes - int echo_log; // 0 = no, 1 = yes + char *command; // ptr to current command + int echo_screen; // 0 = no, 1 = yes + int echo_log; // 0 = no, 1 = yes private: - int me; // proc ID - int maxarg; // max # of args in arg - char *line,*copy,*work; // input line & copy and work string - int maxline,maxcopy,maxwork; // max lengths of char strings - int nfile,maxfile; // current # and max # of open input files - int label_active; // 0 = no label, 1 = looking for label - char *labelstr; // label string being looked for - int jump_skip; // 1 if skipping next jump, 0 otherwise - bool utf8_warn; // true if need to warn about UTF-8 chars + int me; // proc ID + int maxarg; // max # of args in arg + char *line, *copy, *work; // input line & copy and work string + int maxline, maxcopy, maxwork; // max lengths of char strings + int nfile, maxfile; // current # and max # of open input files + int label_active; // 0 = no label, 1 = looking for label + char *labelstr; // label string being looked for + int jump_skip; // 1 if skipping next jump, 0 otherwise + bool utf8_warn; // true if need to warn about UTF-8 chars - FILE **infiles; // list of open input files + FILE **infiles; // list of open input files public: - typedef Command * (*CommandCreator)(LAMMPS *); - typedef std::map CommandCreatorMap; + typedef Command *(*CommandCreator)(LAMMPS *); + typedef std::map CommandCreatorMap; CommandCreatorMap *command_map; protected: template static Command *command_creator(LAMMPS *); private: - void parse(); // parse an input text line - char *nextword(char *, char **); // find next word in string with quotes - int numtriple(char *); // count number of triple quotes - void reallocate(char *&, int &, int); // reallocate a char string - int execute_command(); // execute a single command + void parse(); // parse an input text line + char *nextword(char *, char **); // find next word in string with quotes + int numtriple(char *); // count number of triple quotes + void reallocate(char *&, int &, int); // reallocate a char string + int execute_command(); // execute a single command - void clear(); // input script commands + void clear(); // input script commands void echo(); void ifthenelse(); void include(); @@ -90,7 +90,7 @@ class Input : protected Pointers { void shell(); void variable_command(); - void angle_coeff(); // LAMMPS commands + void angle_coeff(); // LAMMPS commands void angle_style(); void atom_modify(); void atom_style(); @@ -147,7 +147,7 @@ class Input : protected Pointers { void units(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/integrate.cpp b/src/integrate.cpp index f866840f1c..52d34fb943 100644 --- a/src/integrate.cpp +++ b/src/integrate.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/integrate.h b/src/integrate.h index eb4e3107f9..e38fad79dc 100644 --- a/src/integrate.h +++ b/src/integrate.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -28,29 +28,29 @@ class Integrate : protected Pointers { virtual void run(int) = 0; virtual void cleanup() {} virtual void reset_dt() {} - virtual double memory_usage() {return 0;} + virtual double memory_usage() { return 0; } protected: - int eflag,vflag; // flags for energy/virial computation - int virial_style; // compute virial explicitly or implicitly - int external_force_clear; // clear forces locally or externally + int eflag, vflag; // flags for energy/virial computation + int virial_style; // compute virial explicitly or implicitly + int external_force_clear; // clear forces locally or externally - int nelist_global,nelist_atom; // # of PE,virial computes to check - int nvlist_global,nvlist_atom,ncvlist_atom; - class Compute **elist_global; // lists of PE,virial Computes + int nelist_global, nelist_atom; // # of PE,virial computes to check + int nvlist_global, nvlist_atom, ncvlist_atom; + class Compute **elist_global; // lists of PE,virial Computes class Compute **elist_atom; class Compute **vlist_global; class Compute **vlist_atom; class Compute **cvlist_atom; - int pair_compute_flag; // 0 if pair->compute is skipped - int kspace_compute_flag; // 0 if kspace->compute is skipped + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped void ev_setup(); void ev_set(bigint); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/irregular.cpp b/src/irregular.cpp index 77a4405e88..bc7dfe038d 100644 --- a/src/irregular.cpp +++ b/src/irregular.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/irregular.h b/src/irregular.h index 1a30cb05e7..f874a82c57 100644 --- a/src/irregular.h +++ b/src/irregular.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,7 +20,6 @@ namespace LAMMPS_NS { class Irregular : protected Pointers { public: - #if defined(LMP_QSORT) // static variable across all Irregular objects, for qsort callback @@ -29,8 +28,7 @@ class Irregular : protected Pointers { Irregular(class LAMMPS *); ~Irregular(); - void migrate_atoms(int sortflag = 0, int preassign = 0, - int *procassign = nullptr); + void migrate_atoms(int sortflag = 0, int preassign = 0, int *procassign = nullptr); int migrate_check(); int create_data(int, int *, int sortflag = 0); int create_data_grouped(int, int *, int sortflag = 0); @@ -39,50 +37,50 @@ class Irregular : protected Pointers { double memory_usage(); private: - int me,nprocs; + int me, nprocs; int triclinic; int map_style; - int bufextra; // augment send buf size for a migrating atom - int maxsend,maxrecv; // size of buf send/recv in # of doubles - double *buf_send,*buf_recv; // bufs used in migrate_atoms - int maxdbuf; // size of double buf in bytes - double *dbuf; // double buf for largest single atom send - int maxbuf; // size of char buf in bytes - char *buf; // char buf for largest single data send - int maxindex; // combined size of index_send + index_self + int bufextra; // augment send buf size for a migrating atom + int maxsend, maxrecv; // size of buf send/recv in # of doubles + double *buf_send, *buf_recv; // bufs used in migrate_atoms + int maxdbuf; // size of double buf in bytes + double *dbuf; // double buf for largest single atom send + int maxbuf; // size of char buf in bytes + char *buf; // char buf for largest single data send + int maxindex; // combined size of index_send + index_self - int *mproclist,*msizes; // persistent vectors in migrate_atoms - int maxlocal; // allocated size of mproclist and msizes + int *mproclist, *msizes; // persistent vectors in migrate_atoms + int maxlocal; // allocated size of mproclist and msizes - int *work1,*work2; // work vectors + int *work1, *work2; // work vectors // plan params for irregular communication of atoms or datums // no params refer to atoms/data copied to self - int nsend_proc; // # of messages to send - int nrecv_proc; // # of messages to recv - int sendmax_proc; // # of doubles/datums in largest send message - int *proc_send; // list of procs to send to - int *num_send; // # of atoms/datums to send to each proc - int *index_send; // list of which atoms/datums to send to each proc - int *proc_recv; // list of procs to recv from - MPI_Request *request; // MPI requests for posted recvs - MPI_Status *status; // MPI statuses for WaitAll + int nsend_proc; // # of messages to send + int nrecv_proc; // # of messages to recv + int sendmax_proc; // # of doubles/datums in largest send message + int *proc_send; // list of procs to send to + int *num_send; // # of atoms/datums to send to each proc + int *index_send; // list of which atoms/datums to send to each proc + int *proc_recv; // list of procs to recv from + MPI_Request *request; // MPI requests for posted recvs + MPI_Status *status; // MPI statuses for WaitAll // extra plan params plan for irregular communication of atoms // no params refer to atoms copied to self - int *length_send; // # of doubles to send to each proc - int *length_recv; // # of doubles to recv from each proc - int *offset_send; // where each atom starts in send buffer + int *length_send; // # of doubles to send to each proc + int *length_recv; // # of doubles to recv from each proc + int *offset_send; // where each atom starts in send buffer // extra plan params plan for irregular communication of datums // 2 self params refer to data copied to self - int *num_recv; // # of datums to recv from each proc - int num_self; // # of datums to copy to self - int *index_self; // list of which datums to copy to self + int *num_recv; // # of datums to recv from each proc + int num_self; // # of datums to copy to self + int *index_self; // list of which datums to copy to self // private methods @@ -92,12 +90,12 @@ class Irregular : protected Pointers { int binary(double, int, double *); - void init_exchange(); // reset bufxtra - void grow_send(int,int); // reallocate send buffer - void grow_recv(int); // free/allocate recv buffer + void init_exchange(); // reset bufxtra + void grow_send(int, int); // reallocate send buffer + void grow_recv(int); // free/allocate recv buffer }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/kspace.cpp b/src/kspace.cpp index fa7e68d90e..a18a9ca702 100644 --- a/src/kspace.cpp +++ b/src/kspace.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/kspace.h b/src/kspace.h index 8f081487a6..22453d51a8 100644 --- a/src/kspace.h +++ b/src/kspace.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,7 +14,7 @@ #ifndef LMP_KSPACE_H #define LMP_KSPACE_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export #ifdef FFT_SINGLE typedef float FFT_SCALAR; @@ -29,74 +29,75 @@ namespace LAMMPS_NS { class KSpace : protected Pointers { friend class ThrOMP; friend class FixOMP; - public: - double energy; // accumulated energies - double energy_1,energy_6; - double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz - double *eatom,**vatom; // accumulated per-atom energy/virial - double e2group; // accumulated group-group energy - double f2group[3]; // accumulated group-group force - int triclinic_support; // 1 if supports triclinic geometries - int ewaldflag; // 1 if a Ewald solver - int pppmflag; // 1 if a PPPM solver - int msmflag; // 1 if a MSM solver - int dispersionflag; // 1 if a LJ/dispersion solver - int tip4pflag; // 1 if a TIP4P solver - int dipoleflag; // 1 if a dipole solver - int spinflag; // 1 if a spin solver + public: + double energy; // accumulated energies + double energy_1, energy_6; + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz + double *eatom, **vatom; // accumulated per-atom energy/virial + double e2group; // accumulated group-group energy + double f2group[3]; // accumulated group-group force + int triclinic_support; // 1 if supports triclinic geometries + + int ewaldflag; // 1 if a Ewald solver + int pppmflag; // 1 if a PPPM solver + int msmflag; // 1 if a MSM solver + int dispersionflag; // 1 if a LJ/dispersion solver + int tip4pflag; // 1 if a TIP4P solver + int dipoleflag; // 1 if a dipole solver + int spinflag; // 1 if a spin solver int differentiation_flag; - int neighrequest_flag; // used to avoid obsolete construction - // of neighbor lists - int mixflag; // 1 if geometric mixing rules are enforced - // for LJ coefficients + int neighrequest_flag; // used to avoid obsolete construction + // of neighbor lists + int mixflag; // 1 if geometric mixing rules are enforced + // for LJ coefficients int slabflag; - int scalar_pressure_flag; // 1 if using MSM fast scalar pressure + int scalar_pressure_flag; // 1 if using MSM fast scalar pressure double slab_volfactor; - int warn_nonneutral; // 0 = error if non-neutral system - // 1 = warn once if non-neutral system - // 2 = warn, but already warned - int warn_nocharge; // 0 = already warned - // 1 = warn if zero charge + int warn_nonneutral; // 0 = error if non-neutral system + // 1 = warn once if non-neutral system + // 2 = warn, but already warned + int warn_nocharge; // 0 = already warned + // 1 = warn if zero charge - int order,order_6,order_allocated; - double accuracy; // accuracy of KSpace solver (force units) - double accuracy_absolute; // user-specified accuracy in force units - double accuracy_relative; // user-specified dimensionless accuracy - // accuracy = acc_rel * two_charge_force - double accuracy_real_6; // real space accuracy for - // dispersion solver (force units) - double accuracy_kspace_6; // reciprocal space accuracy for - // dispersion solver (force units) - int auto_disp_flag; // use automatic parameter generation for pppm/disp - double two_charge_force; // force in user units of two point - // charges separated by 1 Angstrom + int order, order_6, order_allocated; + double accuracy; // accuracy of KSpace solver (force units) + double accuracy_absolute; // user-specified accuracy in force units + double accuracy_relative; // user-specified dimensionless accuracy + // accuracy = acc_rel * two_charge_force + double accuracy_real_6; // real space accuracy for + // dispersion solver (force units) + double accuracy_kspace_6; // reciprocal space accuracy for + // dispersion solver (force units) + int auto_disp_flag; // use automatic parameter generation for pppm/disp + double two_charge_force; // force in user units of two point + // charges separated by 1 Angstrom - double g_ewald,g_ewald_6; - int nx_pppm,ny_pppm,nz_pppm; // global FFT grid for Coulombics - int nx_pppm_6,ny_pppm_6,nz_pppm_6; // global FFT grid for dispersion - int nx_msm_max,ny_msm_max,nz_msm_max; + double g_ewald, g_ewald_6; + int nx_pppm, ny_pppm, nz_pppm; // global FFT grid for Coulombics + int nx_pppm_6, ny_pppm_6, nz_pppm_6; // global FFT grid for dispersion + int nx_msm_max, ny_msm_max, nz_msm_max; - int group_group_enable; // 1 if style supports group/group calculation + int group_group_enable; // 1 if style supports group/group calculation - int centroidstressflag; // centroid stress compared to two-body stress - // CENTROID_SAME = same as two-body stress - // CENTROID_AVAIL = different and implemented - // CENTROID_NOTAVAIL = different, not yet implemented + int centroidstressflag; // centroid stress compared to two-body stress + // CENTROID_SAME = same as two-body stress + // CENTROID_AVAIL = different and implemented + // CENTROID_NOTAVAIL = different, not yet implemented // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; int copymode; - int compute_flag; // 0 if skip compute() - int fftbench; // 0 if skip FFT timing - int collective_flag; // 1 if use MPI collectives for FFT/remap - int stagger_flag; // 1 if using staggered PPPM grids + int compute_flag; // 0 if skip compute() + int fftbench; // 0 if skip FFT timing + int collective_flag; // 1 if use MPI collectives for FFT/remap + int stagger_flag; // 1 if using staggered PPPM grids - double splittol; // tolerance for when to truncate splitting + double splittol; // tolerance for when to truncate splitting KSpace(class LAMMPS *); virtual ~KSpace(); @@ -119,26 +120,26 @@ class KSpace : protected Pointers { // general child-class methods - virtual void settings(int, char **) {}; + virtual void settings(int, char **){}; virtual void init() = 0; virtual void setup() = 0; - virtual void setup_grid() {}; + virtual void setup_grid(){}; virtual void compute(int, int) = 0; - virtual void compute_group_group(int, int, int) {}; + virtual void compute_group_group(int, int, int){}; - virtual void pack_forward_grid(int, void *, int, int *) {}; - virtual void unpack_forward_grid(int, void *, int, int *) {}; - virtual void pack_reverse_grid(int, void *, int, int *) {}; - virtual void unpack_reverse_grid(int, void *, int, int *) {}; + virtual void pack_forward_grid(int, void *, int, int *){}; + virtual void unpack_forward_grid(int, void *, int, int *){}; + virtual void pack_reverse_grid(int, void *, int, int *){}; + virtual void unpack_reverse_grid(int, void *, int, int *){}; - virtual int timing(int, double &, double &) {return 0;} - virtual int timing_1d(int, double &) {return 0;} - virtual int timing_3d(int, double &) {return 0;} + virtual int timing(int, double &, double &) { return 0; } + virtual int timing_1d(int, double &) { return 0; } + virtual int timing_3d(int, double &) { return 0; } - virtual int modify_param(int, char **) {return 0;} - virtual double memory_usage() {return 0.0;} + virtual int modify_param(int, char **) { return 0; } + virtual double memory_usage() { return 0.0; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- compute gamma for MSM and pair styles see Eq 4 from Parallel Computing 35 (2009) 164-177 ------------------------------------------------------------------------- */ @@ -146,19 +147,20 @@ class KSpace : protected Pointers { double gamma(const double &rho) const { if (rho <= 1.0) { - const int split_order = order/2; - const double rho2 = rho*rho; + const int split_order = order / 2; + const double rho2 = rho * rho; double g = gcons[split_order][0]; double rho_n = rho2; for (int n = 1; n <= split_order; n++) { - g += gcons[split_order][n]*rho_n; + g += gcons[split_order][n] * rho_n; rho_n *= rho2; } return g; - } else return (1.0/rho); + } else + return (1.0 / rho); } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- compute the derivative of gamma for MSM and pair styles see Eq 4 from Parallel Computing 35 (2009) 164-177 ------------------------------------------------------------------------- */ @@ -166,50 +168,55 @@ class KSpace : protected Pointers { double dgamma(const double &rho) const { if (rho <= 1.0) { - const int split_order = order/2; - const double rho2 = rho*rho; - double dg = dgcons[split_order][0]*rho; - double rho_n = rho*rho2; + const int split_order = order / 2; + const double rho2 = rho * rho; + double dg = dgcons[split_order][0] * rho; + double rho_n = rho * rho2; for (int n = 1; n < split_order; n++) { - dg += dgcons[split_order][n]*rho_n; + dg += dgcons[split_order][n] * rho_n; rho_n *= rho2; } return dg; - } else return (-1.0/rho/rho); + } else + return (-1.0 / rho / rho); } double **get_gcons() { return gcons; } double **get_dgcons() { return dgcons; } protected: - int gridflag,gridflag_6; - int gewaldflag,gewaldflag_6; - int minorder,overlap_allowed; + int gridflag, gridflag_6; + int gewaldflag, gewaldflag_6; + int minorder, overlap_allowed; int adjust_cutoff_flag; - int suffix_flag; // suffix compatibility flag + int suffix_flag; // suffix compatibility flag bigint natoms_original; - double scale,qqrd2e; - double qsum,qsqsum,q2; - double **gcons,**dgcons; // accumulated per-atom energy/virial + double scale, qqrd2e; + double qsum, qsqsum, q2; + double **gcons, **dgcons; // accumulated per-atom energy/virial - int evflag,evflag_atom; - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom; - int maxeatom,maxvatom; + int evflag, evflag_atom; + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom; + int maxeatom, maxvatom; - int kewaldflag; // 1 if kspace range set for Ewald sum - int kx_ewald,ky_ewald,kz_ewald; // kspace settings for Ewald sum + int kewaldflag; // 1 if kspace range set for Ewald sum + int kx_ewald, ky_ewald, kz_ewald; // kspace settings for Ewald sum void pair_check(); - void ev_init(int eflag, int vflag, int alloc = 1) { - if (eflag||vflag) ev_setup(eflag, vflag, alloc); - else evflag = evflag_atom = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = 0; + void ev_init(int eflag, int vflag, int alloc = 1) + { + if (eflag || vflag) + ev_setup(eflag, vflag, alloc); + else + evflag = evflag_atom = eflag_either = eflag_global = eflag_atom = vflag_either = + vflag_global = vflag_atom = 0; } void ev_setup(int, int, int alloc = 1); double estimate_table_accuracy(double, double); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/kspace_deprecated.cpp b/src/kspace_deprecated.cpp index 26494c3514..46a3e6df6b 100644 --- a/src/kspace_deprecated.cpp +++ b/src/kspace_deprecated.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/kspace_deprecated.h b/src/kspace_deprecated.h index ff127ea492..09c3a90e33 100644 --- a/src/kspace_deprecated.h +++ b/src/kspace_deprecated.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef KSPACE_CLASS - -KSpaceStyle(DEPRECATED,KSpaceDeprecated) - +// clang-format off +KSpaceStyle(DEPRECATED,KSpaceDeprecated); +// clang-format on #else #ifndef LMP_KSPACE_DEPRECATED_H @@ -30,12 +30,12 @@ class KSpaceDeprecated : public KSpace { virtual ~KSpaceDeprecated() {} virtual void init() {} - virtual void settings(int, char**); + virtual void settings(int, char **); virtual void setup() {} virtual void compute(int, int) {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/lammps.cpp b/src/lammps.cpp index 85d56069bc..1d9a41b4d5 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -1141,6 +1142,7 @@ void _noopt LAMMPS::help() "-in none/filename : read input from file or stdin (default) (-i)\n" "-kokkos on/off ... : turn KOKKOS mode on or off (-k)\n" "-log none/filename : where to send log output (-l)\n" + "-mdi '' : pass flags to the MolSSI Driver Interface\n" "-mpicolor color : which exe in a multi-exe mpirun cmd (-m)\n" "-cite : select citation reminder style (-c)\n" "-nocite : disable citation reminder (-nc)\n" diff --git a/src/lammps.h b/src/lammps.h index b8e084edba..9592f9af05 100644 --- a/src/lammps.h +++ b/src/lammps.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,63 +14,63 @@ #ifndef LMP_LAMMPS_H #define LMP_LAMMPS_H -#include #include +#include namespace LAMMPS_NS { class LAMMPS { public: - // ptrs to fundamental LAMMPS classes - class Memory *memory; // memory allocation functions - class Error *error; // error handling - class Universe *universe; // universe of processors - class Input *input; // input script processing - // ptrs to top-level LAMMPS-specific classes - class Atom *atom; // atom-based quantities - class Update *update; // integrators/minimizers - class Neighbor *neighbor; // neighbor lists - class Comm *comm; // inter-processor communication - class Domain *domain; // simulation box - class Force *force; // inter-particle forces - class Modify *modify; // fixes and computes - class Group *group; // groups of atoms - class Output *output; // thermo/dump/restart - class Timer *timer; // CPU timing info + // ptrs to fundamental LAMMPS classes + class Memory *memory; // memory allocation functions + class Error *error; // error handling + class Universe *universe; // universe of processors + class Input *input; // input script processing + // ptrs to top-level LAMMPS-specific classes + class Atom *atom; // atom-based quantities + class Update *update; // integrators/minimizers + class Neighbor *neighbor; // neighbor lists + class Comm *comm; // inter-processor communication + class Domain *domain; // simulation box + class Force *force; // inter-particle forces + class Modify *modify; // fixes and computes + class Group *group; // groups of atoms + class Output *output; // thermo/dump/restart + class Timer *timer; // CPU timing info - const char *version; // LAMMPS version string = date - int num_ver; // numeric version id derived from *version* - // that is constructed so that will be greater - // for newer versions in numeric or string - // value comparisons + const char *version; // LAMMPS version string = date + int num_ver; // numeric version id derived from *version* + // that is constructed so that will be greater + // for newer versions in numeric or string + // value comparisons - MPI_Comm world; // MPI communicator - FILE *infile; // infile - FILE *screen; // screen output - FILE *logfile; // logfile + MPI_Comm world; // MPI communicator + FILE *infile; // infile + FILE *screen; // screen output + FILE *logfile; // logfile - double initclock; // wall clock at instantiation + double initclock; // wall clock at instantiation - char *suffix,*suffix2,*suffixp;// suffixes to add to input script style names - int suffix_enable; // 1 if suffixes are enabled, 0 if disabled - char *exename; // pointer to argv[0] - char ***packargs; // arguments for cmdline package commands - int num_package; // number of cmdline package commands + char *suffix, *suffix2, *suffixp; // suffixes to add to input script style names + int suffix_enable; // 1 if suffixes are enabled, 0 if disabled + char *exename; // pointer to argv[0] + char ***packargs; // arguments for cmdline package commands + int num_package; // number of cmdline package commands - int clientserver; // 0 = neither, 1 = client, 2 = server - void *cslib; // client/server messaging via CSlib - MPI_Comm cscomm; // MPI comm for client+server in mpi/one mode + int clientserver; // 0 = neither, 1 = client, 2 = server + void *cslib; // client/server messaging via CSlib + MPI_Comm cscomm; // MPI comm for client+server in mpi/one mode - class KokkosLMP *kokkos; // KOKKOS accelerator class - class AtomKokkos *atomKK; // KOKKOS version of Atom class - class MemoryKokkos *memoryKK; // KOKKOS version of Memory class + class KokkosLMP *kokkos; // KOKKOS accelerator class + class AtomKokkos *atomKK; // KOKKOS version of Atom class + class MemoryKokkos *memoryKK; // KOKKOS version of Memory class - class Python *python; // Python interface + class Python *python; // Python interface - class CiteMe *citeme; // handle citation info + class CiteMe *citeme; // handle citation info const char *match_style(const char *style, const char *name); - static const char * installed_packages[]; + static const char *installed_packages[]; static bool is_installed_pkg(const char *pkg); static const bool has_git_info; @@ -91,12 +91,12 @@ class LAMMPS { void init_pkg_lists(); void help(); /// Default constructor. Declared private to prohibit its use - LAMMPS() {}; + LAMMPS(){}; /// Copy constructor. Declared private to prohibit its use - LAMMPS(const LAMMPS &) {}; + LAMMPS(const LAMMPS &){}; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/lammpsplugin.h b/src/lammpsplugin.h index 0884ac8f84..93bf418893 100644 --- a/src/lammpsplugin.h +++ b/src/lammpsplugin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,29 +18,29 @@ extern "C" { - typedef void *(lammpsplugin_factory1)(void *); - typedef void *(lammpsplugin_factory2)(void *, int, char **); +typedef void *(lammpsplugin_factory1) (void *); +typedef void *(lammpsplugin_factory2) (void *, int, char **); - typedef struct { - const char *version; - const char *style; - const char *name; - const char *info; - const char *author; - union { - lammpsplugin_factory1 *v1; - lammpsplugin_factory2 *v2; - } creator; - void *handle; - } lammpsplugin_t; +typedef struct { + const char *version; + const char *style; + const char *name; + const char *info; + const char *author; + union { + lammpsplugin_factory1 *v1; + lammpsplugin_factory2 *v2; + } creator; + void *handle; +} lammpsplugin_t; - typedef void (*lammpsplugin_regfunc)(lammpsplugin_t *, void *); - typedef void (*lammpsplugin_initfunc)(void *, void *, void *); +typedef void (*lammpsplugin_regfunc)(lammpsplugin_t *, void *); +typedef void (*lammpsplugin_initfunc)(void *, void *, void *); - // prototype for initializer function required - // to load a plugin; uses C bindings +// prototype for initializer function required +// to load a plugin; uses C bindings - void lammpsplugin_init(void *, void *, void *); +void lammpsplugin_init(void *, void *, void *); } #endif diff --git a/src/lattice.cpp b/src/lattice.cpp index bfc0b5b9ef..be69fc1821 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/lattice.h b/src/lattice.h index eae97c3506..07df77e630 100644 --- a/src/lattice.h +++ b/src/lattice.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,30 +20,30 @@ namespace LAMMPS_NS { class Lattice : protected Pointers { public: - enum{NONE,SC,BCC,FCC,HCP,DIAMOND,SQ,SQ2,HEX,CUSTOM}; + enum { NONE, SC, BCC, FCC, HCP, DIAMOND, SQ, SQ2, HEX, CUSTOM }; - int style; // NONE,SC,FCC,etc - double xlattice,ylattice,zlattice; // lattice scale factors in 3 dims - double a1[3],a2[3],a3[3]; // edge vectors of unit cell - int nbasis; // # of basis atoms in unit cell - double **basis; // fractional coords of each basis atom - // within unit cell (0 <= coord < 1) + int style; // NONE,SC,FCC,etc + double xlattice, ylattice, zlattice; // lattice scale factors in 3 dims + double a1[3], a2[3], a3[3]; // edge vectors of unit cell + int nbasis; // # of basis atoms in unit cell + double **basis; // fractional coords of each basis atom + // within unit cell (0 <= coord < 1) Lattice(class LAMMPS *, int, char **); ~Lattice(); void lattice2box(double &, double &, double &); void box2lattice(double &, double &, double &); - void bbox(int, double, double, double, - double &, double &, double &, double &, double &, double &); + void bbox(int, double, double, double, double &, double &, double &, double &, double &, + double &); -private: + private: double scale; - double origin[3]; // lattice origin - int orientx[3]; // lattice orientation vecs - int orienty[3]; // orientx = what lattice dir lies - int orientz[3]; // along x dim in box + double origin[3]; // lattice origin + int orientx[3]; // lattice orientation vecs + int orienty[3]; // orientx = what lattice dir lies + int orientz[3]; // along x dim in box - double primitive[3][3]; // lattice <-> box transform matrices + double primitive[3][3]; // lattice <-> box transform matrices double priminv[3][3]; double rotaterow[3][3]; double rotatecol[3][3]; @@ -57,7 +57,7 @@ private: void cross(double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/library.cpp b/src/library.cpp index 2e2f7a3d0d..8625296172 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -673,7 +674,8 @@ void lammps_extract_box(void *handle, double *boxlo, double *boxhi, This function sets the simulation box dimensions (upper and lower bounds and tilt factors) from the provided data and then re-initializes the box -information and all derived settings. +information and all derived settings. It may only be called before atoms +are created. \endverbatim * @@ -692,12 +694,16 @@ void lammps_reset_box(void *handle, double *boxlo, double *boxhi, BEGIN_CAPTURE { - // error if box does not exist - if ((lmp->domain->box_exist == 0) - && (lmp->comm->me == 0)) { - lmp->error->warning(FLERR,"Calling lammps_reset_box without a box"); + if (lmp->atom->natoms > 0) + lmp->error->all(FLERR,"Calling lammps_reset_box not supported when atoms exist"); + + // warn and do nothing if no box exists + if (lmp->domain->box_exist == 0) { + if (lmp->comm->me == 0) + lmp->error->warning(FLERR,"Ignoring call to lammps_reset_box without a box"); return; } + domain->boxlo[0] = boxlo[0]; domain->boxlo[1] = boxlo[1]; domain->boxlo[2] = boxlo[2]; diff --git a/src/library.h b/src/library.h index a199c86652..70ece96716 100644 --- a/src/library.h +++ b/src/library.h @@ -1,6 +1,6 @@ /* -*- c -*- ------------------------------------------------------------ LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,9 +24,7 @@ /* We follow the behavior of regular LAMMPS compilation and assume * -DLAMMPS_SMALLBIG when no define is set. */ -#if !defined(LAMMPS_BIGBIG) \ - && !defined(LAMMPS_SMALLBIG) \ - && !defined(LAMMPS_SMALLSMALL) +#if !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG) && !defined(LAMMPS_SMALLSMALL) #define LAMMPS_SMALLBIG #endif @@ -37,7 +35,7 @@ #endif #if defined(LAMMPS_BIGBIG) || defined(LAMMPS_SMALLBIG) -#include /* for int64_t */ +#include /* for int64_t */ #endif /** Data type constants for extracting data from atoms, computes and fixes @@ -45,13 +43,13 @@ * Must be kept in sync with the equivalent constants in lammps/constants.py */ enum _LMP_DATATYPE_CONST { - LAMMPS_INT = 0, /*!< 32-bit integer (array) */ - LAMMPS_INT_2D = 1, /*!< two-dimensional 32-bit integer array */ - LAMMPS_DOUBLE = 2, /*!< 64-bit double (array) */ - LAMMPS_DOUBLE_2D = 3, /*!< two-dimensional 64-bit double array */ - LAMMPS_INT64 = 4, /*!< 64-bit integer (array) */ - LAMMPS_INT64_2D = 5, /*!< two-dimensional 64-bit integer array */ - LAMMPS_STRING = 6 /*!< C-String */ + LAMMPS_INT = 0, /*!< 32-bit integer (array) */ + LAMMPS_INT_2D = 1, /*!< two-dimensional 32-bit integer array */ + LAMMPS_DOUBLE = 2, /*!< 64-bit double (array) */ + LAMMPS_DOUBLE_2D = 3, /*!< two-dimensional 64-bit double array */ + LAMMPS_INT64 = 4, /*!< 64-bit integer (array) */ + LAMMPS_INT64_2D = 5, /*!< two-dimensional 64-bit integer array */ + LAMMPS_STRING = 6 /*!< C-String */ }; /** Style constants for extracting data from computes and fixes. @@ -59,9 +57,9 @@ enum _LMP_DATATYPE_CONST { * Must be kept in sync with the equivalent constants in lammps/constants.py */ enum _LMP_STYLE_CONST { - LMP_STYLE_GLOBAL=0, /*!< return global data */ - LMP_STYLE_ATOM =1, /*!< return per-atom data */ - LMP_STYLE_LOCAL =2 /*!< return local data */ + LMP_STYLE_GLOBAL = 0, /*!< return global data */ + LMP_STYLE_ATOM = 1, /*!< return per-atom data */ + LMP_STYLE_LOCAL = 2 /*!< return local data */ }; /** Type and size constants for extracting data from computes and fixes. @@ -69,12 +67,12 @@ enum _LMP_STYLE_CONST { * Must be kept in sync with the equivalent constants in lammps/constants.py */ enum _LMP_TYPE_CONST { - LMP_TYPE_SCALAR=0, /*!< return scalar */ - LMP_TYPE_VECTOR=1, /*!< return vector */ - LMP_TYPE_ARRAY =2, /*!< return array */ - LMP_SIZE_VECTOR=3, /*!< return length of vector */ - LMP_SIZE_ROWS =4, /*!< return number of rows */ - LMP_SIZE_COLS =5 /*!< return number of columns */ + LMP_TYPE_SCALAR = 0, /*!< return scalar */ + LMP_TYPE_VECTOR = 1, /*!< return vector */ + LMP_TYPE_ARRAY = 2, /*!< return array */ + LMP_SIZE_VECTOR = 3, /*!< return length of vector */ + LMP_SIZE_ROWS = 4, /*!< return number of rows */ + LMP_SIZE_COLS = 5 /*!< return number of columns */ }; /* Ifdefs to allow this file to be included in C and C++ programs */ @@ -92,20 +90,20 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr); #endif void *lammps_open_no_mpi(int argc, char **argv, void **ptr); void *lammps_open_fortran(int argc, char **argv, int f_comm); -void lammps_close(void *handle); +void lammps_close(void *handle); -void lammps_mpi_init(); -void lammps_mpi_finalize(); +void lammps_mpi_init(); +void lammps_mpi_finalize(); /* ---------------------------------------------------------------------- * Library functions to process commands * ---------------------------------------------------------------------- */ -void lammps_file(void *handle, const char *file); +void lammps_file(void *handle, const char *file); char *lammps_command(void *handle, const char *cmd); -void lammps_commands_list(void *handle, int ncmd, const char **cmds); -void lammps_commands_string(void *handle, const char *str); +void lammps_commands_list(void *handle, int ncmd, const char **cmds); +void lammps_commands_string(void *handle, const char *str); /* ----------------------------------------------------------------------- * Library functions to extract info from LAMMPS or set data in LAMMPS @@ -114,17 +112,15 @@ void lammps_commands_string(void *handle, const char *str); double lammps_get_natoms(void *handle); double lammps_get_thermo(void *handle, const char *keyword); -void lammps_extract_box(void *handle, double *boxlo, double *boxhi, - double *xy, double *yz, double *xz, - int *pflags, int *boxflag); -void lammps_reset_box(void *handle, double *boxlo, double *boxhi, - double xy, double yz, double xz); +void lammps_extract_box(void *handle, double *boxlo, double *boxhi, double *xy, double *yz, + double *xz, int *pflags, int *boxflag); +void lammps_reset_box(void *handle, double *boxlo, double *boxhi, double xy, double yz, double xz); void lammps_memory_usage(void *handle, double *meminfo); -int lammps_get_mpi_comm(void *handle); +int lammps_get_mpi_comm(void *handle); -int lammps_extract_setting(void *handle, const char *keyword); -int lammps_extract_global_datatype(void *handle, const char *name); +int lammps_extract_setting(void *handle, const char *keyword); +int lammps_extract_global_datatype(void *handle, const char *name); void *lammps_extract_global(void *handle, const char *name); /* ---------------------------------------------------------------------- @@ -132,7 +128,7 @@ void *lammps_extract_global(void *handle, const char *name); * ---------------------------------------------------------------------- */ int lammps_extract_atom_datatype(void *handle, const char *name); -void *lammps_extract_atom(void *handle, const char *name); +void *lammps_extract_atom(void *handle, const char *name); /* ---------------------------------------------------------------------- * Library functions to access data from computes, fixes, variables in LAMMPS @@ -141,7 +137,7 @@ void *lammps_extract_atom(void *handle, const char *name); void *lammps_extract_compute(void *handle, const char *, int, int); void *lammps_extract_fix(void *handle, const char *, int, int, int, int); void *lammps_extract_variable(void *handle, const char *, const char *); -int lammps_set_variable(void *, char *, char *); +int lammps_set_variable(void *, char *, char *); /* ---------------------------------------------------------------------- * Library functions for scatter/gather operations of data @@ -149,22 +145,26 @@ int lammps_set_variable(void *, char *, char *); void lammps_gather_atoms(void *handle, char *name, int type, int count, void *data); void lammps_gather_atoms_concat(void *handle, char *name, int type, int count, void *data); -void lammps_gather_atoms_subset(void *handle, char *name, int type, int count, int ndata, int *ids, void *data); +void lammps_gather_atoms_subset(void *handle, char *name, int type, int count, int ndata, int *ids, + void *data); void lammps_scatter_atoms(void *handle, char *name, int type, int count, void *data); -void lammps_scatter_atoms_subset(void *handle, char *name, int type, int count, int ndata, int *ids, void *data); +void lammps_scatter_atoms_subset(void *handle, char *name, int type, int count, int ndata, int *ids, + void *data); 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); -void lammps_gather_subset(void *handle, char *name, int type, int count, int ndata, int *ids, void *data); +void lammps_gather_subset(void *handle, char *name, int type, int count, int ndata, int *ids, + void *data); 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); +void lammps_scatter_subset(void *handle, char *name, int type, int count, int ndata, int *ids, + void *data); #if !defined(LAMMPS_BIGBIG) -int lammps_create_atoms(void *handle, int n, const int *id, const int *type, - const double *x, const double *v, const int *image, int bexpand); +int lammps_create_atoms(void *handle, int n, const int *id, const int *type, const double *x, + const double *v, const int *image, int bexpand); #else -int lammps_create_atoms(void *handle, int n, const int64_t *id, const int *type, - const double *x, const double *v, const int64_t* image, int bexpand); +int lammps_create_atoms(void *handle, int n, const int64_t *id, const int *type, const double *x, + const double *v, const int64_t *image, int bexpand); #endif /* ---------------------------------------------------------------------- @@ -175,13 +175,14 @@ int lammps_find_pair_neighlist(void *handle, const char *style, int exact, int n int lammps_find_fix_neighlist(void *handle, const char *id, int request); int lammps_find_compute_neighlist(void *handle, const char *id, int request); int lammps_neighlist_num_elements(void *handle, int idx); -void lammps_neighlist_element_neighbors(void *handle, int idx, int element, int *iatom, int *numneigh, int **neighbors); +void lammps_neighlist_element_neighbors(void *handle, int idx, int element, int *iatom, + int *numneigh, int **neighbors); /* ---------------------------------------------------------------------- * Library functions for retrieving configuration information * ---------------------------------------------------------------------- */ -int lammps_version(void *handle); +int lammps_version(void *handle); void lammps_get_os_info(char *buffer, int buf_size); int lammps_config_has_mpi_support(); @@ -224,20 +225,20 @@ void lammps_decode_image_flags(int64_t image, int *flags); #if defined(LAMMPS_BIGBIG) typedef void (*FixExternalFnPtr)(void *, int64_t, int, int64_t *, double **, double **); -void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void*); +void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void *); #elif defined(LAMMPS_SMALLBIG) typedef void (*FixExternalFnPtr)(void *, int64_t, int, int *, double **, double **); -void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void*); +void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void *); #else typedef void (*FixExternalFnPtr)(void *, int, int, int *, double **, double **); -void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void*); +void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void *); #endif void lammps_fix_external_set_energy_global(void *, char *, double); void lammps_fix_external_set_virial_global(void *, char *, double *); void lammps_free(void *ptr); -int lammps_is_running(void *handle); +int lammps_is_running(void *handle); void lammps_force_timeout(void *handle); int lammps_has_error(void *handle); diff --git a/src/lmppython.cpp b/src/lmppython.cpp index 742e912411..44b469eed3 100644 --- a/src/lmppython.cpp +++ b/src/lmppython.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/lmppython.h b/src/lmppython.h index 57a77628a7..3c7ae396bc 100644 --- a/src/lmppython.h +++ b/src/lmppython.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,7 +19,7 @@ namespace LAMMPS_NS { class PythonInterface { -public: + public: virtual ~PythonInterface(); virtual void command(int, char **) = 0; virtual void invoke_function(int, char *) = 0; @@ -32,7 +32,7 @@ public: }; class Python : protected Pointers { -public: + public: Python(class LAMMPS *); ~Python(); @@ -40,7 +40,7 @@ public: void invoke_function(int, char *); int find(const char *); int variable_match(const char *, const char *, int); - char * long_string(int ifunc); + char *long_string(int ifunc); int execute_string(char *); int execute_file(char *); bool has_minimum_version(int major, int minor); @@ -48,11 +48,11 @@ public: bool is_enabled() const; void init(); -private: - PythonInterface * impl; + private: + PythonInterface *impl; }; -} +} // namespace LAMMPS_NS #endif /* ERROR/WARNING messages: diff --git a/src/lmprestart.h b/src/lmprestart.h index 745a1c45d1..526b9676bf 100644 --- a/src/lmprestart.h +++ b/src/lmprestart.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -10,7 +10,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - +// clang-format off #ifndef LMP_RESTART_H #define LMP_RESTART_H diff --git a/src/lmptype.h b/src/lmptype.h index 3134624004..6a7a7ef1b9 100644 --- a/src/lmptype.h +++ b/src/lmptype.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -42,10 +42,10 @@ #define __STDC_FORMAT_MACROS #endif -#include // IWYU pragma: export -#include // IWYU pragma: export -#include // IWYU pragma: export -#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export // grrr - IBM Power6 does not provide this def in their system header files @@ -102,9 +102,9 @@ typedef int64_t bigint; #define ATOTAGINT atoi #define ATOBIGINT ATOLL -#define LAMMPS_TAGINT LAMMPS_INT +#define LAMMPS_TAGINT LAMMPS_INT #define LAMMPS_TAGINT_2D LAMMPS_INT_2D -#define LAMMPS_BIGINT LAMMPS_INT64 +#define LAMMPS_BIGINT LAMMPS_INT64 #define LAMMPS_BIGINT_2D LAMMPS_INT64_2D #define IMGMASK 1023 @@ -139,9 +139,9 @@ typedef int64_t bigint; #define ATOTAGINT ATOLL #define ATOBIGINT ATOLL -#define LAMMPS_TAGINT LAMMPS_INT64 +#define LAMMPS_TAGINT LAMMPS_INT64 #define LAMMPS_TAGINT_2D LAMMPS_INT64_2D -#define LAMMPS_BIGINT LAMMPS_INT64 +#define LAMMPS_BIGINT LAMMPS_INT64 #define LAMMPS_BIGINT_2D LAMMPS_INT64_2D #define IMGMASK 2097151 @@ -175,9 +175,9 @@ typedef int bigint; #define ATOTAGINT atoi #define ATOBIGINT atoi -#define LAMMPS_TAGINT LAMMPS_INT +#define LAMMPS_TAGINT LAMMPS_INT #define LAMMPS_TAGINT_2D LAMMPS_INT_2D -#define LAMMPS_BIGINT LAMMPS_INT +#define LAMMPS_BIGINT LAMMPS_INT #define LAMMPS_BIGINT_2D LAMMPS_INT_2D #define IMGMASK 1023 @@ -218,14 +218,14 @@ typedef int bigint; The typecasts prevent compiler warnings about possible truncation issues. \endverbatim */ - union ubuf { - double d; - int64_t i; - ubuf(const double &arg) : d(arg) {} - ubuf(const int64_t &arg) : i(arg) {} - ubuf(const int &arg) : i(arg) {} - }; -} +union ubuf { + double d; + int64_t i; + ubuf(const double &arg) : d(arg) {} + ubuf(const int64_t &arg) : i(arg) {} + ubuf(const int &arg) : i(arg) {} +}; +} // namespace LAMMPS_NS // preprocessor macros for compiler specific settings // clear previous definitions to avoid redefinition warning @@ -243,18 +243,18 @@ The typecasts prevent compiler warnings about possible truncation issues. // define stack variable alignment #if defined(__INTEL_LLVM_COMPILER) || defined(__INTEL_COMPILER) -#define _alignvar(expr,val) __declspec(align(val)) expr -#elif defined(__GNUC__) -#define _alignvar(expr,val) expr __attribute((aligned(val))) +#define _alignvar(expr, val) __declspec(align(val)) expr +#elif defined(__GNUC__) || defined(__PGI) +#define _alignvar(expr, val) expr __attribute((aligned(val))) #else -#define _alignvar(expr,val) expr +#define _alignvar(expr, val) expr #endif // declaration to lift aliasing restrictions -#if defined(__INTEL_LLVM_COMPILER) || defined(__INTEL_COMPILER) +#if defined(__INTEL_COMPILER) || defined(__PGI) #define _noalias restrict -#elif defined(__GNUC__) +#elif defined(__GNUC__) || defined(__INTEL_LLVM_COMPILER) #define _noalias __restrict #else #define _noalias @@ -265,27 +265,27 @@ The typecasts prevent compiler warnings about possible truncation issues. // Disable for broken -D_FORTIFY_SOURCE feature. #if defined(__clang__) -# define _noopt __attribute__((optnone)) +#define _noopt __attribute__((optnone)) #elif defined(__INTEL_COMPILER) -# define _noopt +#define _noopt #elif defined(__PGI) -# define _noopt +#define _noopt #elif defined(__GNUC__) -# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) -# if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0) -# define _noopt __attribute__((optimize("no-var-tracking-assignments"))) -# else -# define _noopt __attribute__((optimize("O0","no-var-tracking-assignments"))) -# endif -# else -# if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0) -# define _noopt -# else -# define _noopt __attribute__((optimize("O0"))) -# endif -# endif +#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) +#if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0) +#define _noopt __attribute__((optimize("no-var-tracking-assignments"))) #else -# define _noopt +#define _noopt __attribute__((optimize("O0", "no-var-tracking-assignments"))) +#endif +#else +#if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0) +#define _noopt +#else +#define _noopt __attribute__((optimize("O0"))) +#endif +#endif +#else +#define _noopt #endif // settings to enable LAMMPS to build under Windows @@ -296,6 +296,6 @@ The typecasts prevent compiler warnings about possible truncation issues. // suppress unused parameter warning -#define LMP_UNUSED_PARAM(x) (void)(x) +#define LMP_UNUSED_PARAM(x) (void) (x) #endif diff --git a/src/lmpwindows.h b/src/lmpwindows.h index 59210f35c3..f9812d3ec1 100644 --- a/src/lmpwindows.h +++ b/src/lmpwindows.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -15,9 +15,9 @@ #if !defined(__MINGW32__) #include "erf.h" #endif -#include #include #include +#include // LAMMPS uses usleep with 100 ms arguments, no microsecond precision needed #if !defined(__MINGW32__) #include "sleep.h" @@ -34,32 +34,36 @@ // the following functions are defined to get rid of // 'ambiguous call to overloaded function' error in VSS for mismatched type arguments #if !defined(__MINGW32__) -inline double pow(int i, int j){ - return pow((double)i,j); +inline double pow(int i, int j) +{ + return pow((double) i, j); } -inline double fabs(int i){ +inline double fabs(int i) +{ return fabs((double) i); } -inline double sqrt(int i){ +inline double sqrt(int i) +{ return sqrt((double) i); } #endif -inline double trunc(double x) { +inline double trunc(double x) +{ return x > 0 ? floor(x) : ceil(x); } // Windows version of mkdir function does not have permission flags #ifndef S_IRWXU -# define S_IRWXU 0 +#define S_IRWXU 0 #endif #ifndef S_IRGRP -# define S_IRGRP 0 +#define S_IRGRP 0 #endif #ifndef S_IXGRP -# define S_IXGRP 0 +#define S_IXGRP 0 #endif -inline int mkdir(const char *path, int){ +inline int mkdir(const char *path, int) +{ return _mkdir(path); } - diff --git a/src/main.cpp b/src/main.cpp index 26f12683b9..8399ecab45 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,14 @@ ------------------------------------------------------------------------- */ #include "lammps.h" -#include "input.h" -#include +#include "input.h" +#if defined(LAMMPS_EXCEPTIONS) +#include "exceptions.h" +#endif + #include +#include #if defined(LAMMPS_TRAP_FPE) && defined(_GNU_SOURCE) #include @@ -25,6 +29,11 @@ #include "exceptions.h" #endif +// import MolSSI Driver Interface library +#if defined(LMP_USER_MDI) +#include +#endif + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- @@ -33,13 +42,28 @@ using namespace LAMMPS_NS; int main(int argc, char **argv) { - MPI_Init(&argc,&argv); + MPI_Init(&argc, &argv); -// enable trapping selected floating point exceptions. -// this uses GNU extensions and is only tested on Linux -// therefore we make it depend on -D_GNU_SOURCE, too. + MPI_Comm lammps_comm = MPI_COMM_WORLD; + +#if defined(LMP_USER_MDI) + // initialize MDI interface, if compiled in + + int mdi_flag; + if (MDI_Init(&argc, &argv)) MPI_Abort(MPI_COMM_WORLD, 1); + if (MDI_Initialized(&mdi_flag)) MPI_Abort(MPI_COMM_WORLD, 1); + + // get the MPI communicator that spans all ranks running LAMMPS + // when using MDI, this may be a subset of MPI_COMM_WORLD + + if (mdi_flag) + if (MDI_MPI_get_world_comm(&lammps_comm)) MPI_Abort(MPI_COMM_WORLD, 1); +#endif #if defined(LAMMPS_TRAP_FPE) && defined(_GNU_SOURCE) + // enable trapping selected floating point exceptions. + // this uses GNU extensions and is only tested on Linux + // therefore we make it depend on -D_GNU_SOURCE, too. fesetenv(FE_NOMASK_ENV); fedisableexcept(FE_ALL_EXCEPT); feenableexcept(FE_DIVBYZERO); @@ -49,31 +73,31 @@ int main(int argc, char **argv) #ifdef LAMMPS_EXCEPTIONS try { - LAMMPS *lammps = new LAMMPS(argc,argv,MPI_COMM_WORLD); + LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm); lammps->input->file(); delete lammps; - } catch(LAMMPSAbortException &ae) { + } catch (LAMMPSAbortException &ae) { MPI_Abort(ae.universe, 1); - } catch(LAMMPSException &e) { - MPI_Barrier(MPI_COMM_WORLD); + } catch (LAMMPSException &e) { + MPI_Barrier(lammps_comm); MPI_Finalize(); exit(1); - } catch(fmt::format_error &fe) { - fprintf(stderr,"fmt::format_error: %s\n", fe.what()); + } catch (fmt::format_error &fe) { + fprintf(stderr, "fmt::format_error: %s\n", fe.what()); MPI_Abort(MPI_COMM_WORLD, 1); exit(1); } #else try { - LAMMPS *lammps = new LAMMPS(argc,argv,MPI_COMM_WORLD); + LAMMPS *lammps = new LAMMPS(argc, argv, lammps_comm); lammps->input->file(); delete lammps; - } catch(fmt::format_error &fe) { - fprintf(stderr,"fmt::format_error: %s\n", fe.what()); + } catch (fmt::format_error &fe) { + fprintf(stderr, "fmt::format_error: %s\n", fe.what()); MPI_Abort(MPI_COMM_WORLD, 1); exit(1); } #endif - MPI_Barrier(MPI_COMM_WORLD); + MPI_Barrier(lammps_comm); MPI_Finalize(); } diff --git a/src/math_const.h b/src/math_const.h index f8740a5d8c..cd9deab623 100644 --- a/src/math_const.h +++ b/src/math_const.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -17,20 +17,20 @@ namespace LAMMPS_NS { namespace MathConst { - static constexpr double THIRD = 1.0/3.0; - static constexpr double TWOTHIRDS = 2.0/3.0; - static constexpr double MY_PI = 3.14159265358979323846; // pi - static constexpr double MY_2PI = 6.28318530717958647692; // 2pi - static constexpr double MY_3PI = 9.42477796076937971538; // 3pi - static constexpr double MY_4PI = 12.56637061435917295384; // 4pi - static constexpr double MY_PI2 = 1.57079632679489661923; // pi/2 - static constexpr double MY_PI4 = 0.78539816339744830962; // pi/4 - static constexpr double MY_PIS = 1.77245385090551602729; // sqrt(pi) - static constexpr double MY_ISPI4 = 1.12837916709551257389; // 1/sqrt(pi/4) - static constexpr double MY_SQRT2 = 1.41421356237309504880; // sqrt(2) - static constexpr double MY_CUBEROOT2 = 1.25992104989487316476; // 2*(1/3) -} + static constexpr double THIRD = 1.0 / 3.0; + static constexpr double TWOTHIRDS = 2.0 / 3.0; + static constexpr double MY_PI = 3.14159265358979323846; // pi + static constexpr double MY_2PI = 6.28318530717958647692; // 2pi + static constexpr double MY_3PI = 9.42477796076937971538; // 3pi + static constexpr double MY_4PI = 12.56637061435917295384; // 4pi + static constexpr double MY_PI2 = 1.57079632679489661923; // pi/2 + static constexpr double MY_PI4 = 0.78539816339744830962; // pi/4 + static constexpr double MY_PIS = 1.77245385090551602729; // sqrt(pi) + static constexpr double MY_ISPI4 = 1.12837916709551257389; // 1/sqrt(pi/4) + static constexpr double MY_SQRT2 = 1.41421356237309504880; // sqrt(2) + static constexpr double MY_CUBEROOT2 = 1.25992104989487316476; // 2*(1/3) +} // namespace MathConst -} +} // namespace LAMMPS_NS #endif diff --git a/src/math_eigen.cpp b/src/math_eigen.cpp index 10caccd0e5..f8fed1853b 100644 --- a/src/math_eigen.cpp +++ b/src/math_eigen.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/math_eigen.h b/src/math_eigen.h index 4ecc0d6fc9..756ec78f5c 100644 --- a/src/math_eigen.h +++ b/src/math_eigen.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, 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,7 +11,6 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - #ifndef LMP_MATH_EIGEN_H #define LMP_MATH_EIGEN_H @@ -25,12 +24,12 @@ namespace MathEigen { * \param evec store the eigenvectors here... * \return 0 if eigenvalue calculation converged, 1 if it failed */ -int jacobi3(double const* const* mat, double *eval, double **evec); +int jacobi3(double const *const *mat, double *eval, double **evec); /** \overload */ int jacobi3(double const mat[3][3], double *eval, double evec[3][3]); -} +} // namespace MathEigen -#endif //#ifndef LMP_MATH_EIGEN_H +#endif //#ifndef LMP_MATH_EIGEN_H diff --git a/src/math_eigen_impl.h b/src/math_eigen_impl.h index 26867083f7..132434e547 100644 --- a/src/math_eigen_impl.h +++ b/src/math_eigen_impl.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/math_extra.cpp b/src/math_extra.cpp index 59e66242b3..54f6204182 100644 --- a/src/math_extra.cpp +++ b/src/math_extra.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/math_extra.h b/src/math_extra.h index 90b8f8a686..7c71e4c11b 100644 --- a/src/math_extra.h +++ b/src/math_extra.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,126 +22,102 @@ namespace MathExtra { - // 3 vector operations +// 3 vector operations - inline void copy3(const double *v, double *ans); - inline void zero3(double *v); - inline void norm3(double *v); - inline void normalize3(const double *v, double *ans); - inline void snormalize3(const double, const double *v, double *ans); - inline void negate3(double *v); - inline void scale3(const double s, double *v); - inline void scale3(const double s, const double *v, double *ans); - inline void add3(const double *v1, const double *v2, double *ans); - inline void scaleadd3(const double s, const double *v1, const double *v2, - double *ans); - inline void scaleadd3(const double s1, const double *v1, - const double s2, const double *v2, double *ans); - inline void sub3(const double *v1, const double *v2, double *ans); - inline double len3(const double *v); - inline double lensq3(const double *v); - inline double distsq3(const double *v1, const double *v2); - inline double dot3(const double *v1, const double *v2); - inline void cross3(const double *v1, const double *v2, double *ans); +inline void copy3(const double *v, double *ans); +inline void zero3(double *v); +inline void norm3(double *v); +inline void normalize3(const double *v, double *ans); +inline void snormalize3(const double, const double *v, double *ans); +inline void negate3(double *v); +inline void scale3(const double s, double *v); +inline void scale3(const double s, const double *v, double *ans); +inline void add3(const double *v1, const double *v2, double *ans); +inline void scaleadd3(const double s, const double *v1, const double *v2, double *ans); +inline void scaleadd3(const double s1, const double *v1, const double s2, const double *v2, + double *ans); +inline void sub3(const double *v1, const double *v2, double *ans); +inline double len3(const double *v); +inline double lensq3(const double *v); +inline double distsq3(const double *v1, const double *v2); +inline double dot3(const double *v1, const double *v2); +inline void cross3(const double *v1, const double *v2, double *ans); - // 3x3 matrix operations +// 3x3 matrix operations - inline void zeromat3(double m[3][3]); - inline void zeromat3(double **m); +inline void zeromat3(double m[3][3]); +inline void zeromat3(double **m); - inline void col2mat(const double *ex, const double *ey, const double *ez, - double m[3][3]); - inline double det3(const double mat[3][3]); - inline void diag_times3(const double *d, const double m[3][3], - double ans[3][3]); - inline void times3_diag(const double m[3][3], const double *d, - double ans[3][3]); - inline void plus3(const double m[3][3], const double m2[3][3], - double ans[3][3]); - inline void plus3(const double m[3][3], double **m2, double **ans); - inline void minus3(const double m[3][3], const double m2[3][3], - double ans[3][3]); - inline void minus3(double **m, const double m2[3][3], - double ans[3][3]); +inline void col2mat(const double *ex, const double *ey, const double *ez, double m[3][3]); +inline double det3(const double mat[3][3]); +inline void diag_times3(const double *d, const double m[3][3], double ans[3][3]); +inline void times3_diag(const double m[3][3], const double *d, double ans[3][3]); +inline void plus3(const double m[3][3], const double m2[3][3], double ans[3][3]); +inline void plus3(const double m[3][3], double **m2, double **ans); +inline void minus3(const double m[3][3], const double m2[3][3], double ans[3][3]); +inline void minus3(double **m, const double m2[3][3], double ans[3][3]); - inline void times3(const double m[3][3], const double m2[3][3], - double ans[3][3]); - inline void transpose_times3(const double m[3][3], const double m2[3][3], - double ans[3][3]); - inline void times3_transpose(const double m[3][3], const double m2[3][3], - double ans[3][3]); - inline void invert3(const double mat[3][3], double ans[3][3]); - inline void matvec(const double mat[3][3], const double *vec, double *ans); - inline void matvec(const double *ex, const double *ey, const double *ez, - const double *vec, double *ans); - inline void transpose_matvec(const double mat[3][3], const double *vec, - double *ans); - inline void transpose_matvec(const double *ex, const double *ey, - const double *ez, const double *v, - double *ans); - inline void transpose_diag3(const double m[3][3], const double *d, - double ans[3][3]); - inline void vecmat(const double *v, const double m[3][3], double *ans); - inline void scalar_times3(const double f, double m[3][3]); - inline void outer3(const double *v1, const double *v2, - double ans[3][3]); +inline void times3(const double m[3][3], const double m2[3][3], double ans[3][3]); +inline void transpose_times3(const double m[3][3], const double m2[3][3], double ans[3][3]); +inline void times3_transpose(const double m[3][3], const double m2[3][3], double ans[3][3]); +inline void invert3(const double mat[3][3], double ans[3][3]); +inline void matvec(const double mat[3][3], const double *vec, double *ans); +inline void matvec(const double *ex, const double *ey, const double *ez, const double *vec, + double *ans); +inline void transpose_matvec(const double mat[3][3], const double *vec, double *ans); +inline void transpose_matvec(const double *ex, const double *ey, const double *ez, const double *v, + double *ans); +inline void transpose_diag3(const double m[3][3], const double *d, double ans[3][3]); +inline void vecmat(const double *v, const double m[3][3], double *ans); +inline void scalar_times3(const double f, double m[3][3]); +inline void outer3(const double *v1, const double *v2, double ans[3][3]); - 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 no_squish_rotate(int k, double *p, double *q, double *inertia, - double dt); +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 no_squish_rotate(int k, double *p, double *q, double *inertia, double dt); - // shape matrix operations - // upper-triangular 3x3 matrix stored in Voigt ordering as 6-vector +// shape matrix operations +// upper-triangular 3x3 matrix stored in Voigt ordering as 6-vector - inline void multiply_shape_shape(const double *one, const double *two, - double *ans); +inline void multiply_shape_shape(const double *one, const double *two, double *ans); - // quaternion operations +// quaternion operations - inline void qnormalize(double *q); - inline void qconjugate(double *q, double *qc); - 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 axisangle_to_quat(const double *v, const double angle, - double *quat); +inline void qnormalize(double *q); +inline void qconjugate(double *q, double *qc); +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 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); - void omega_to_angmom(double *w, double *ex, double *ey, double *ez, - double *idiag, double *m); - void mq_to_omega(double *m, double *q, double *moments, double *w); - void exyz_to_q(double *ex, double *ey, double *ez, double *q); - void q_to_exyz(double *q, double *ex, double *ey, double *ez); - void quat_to_mat(const double *quat, double mat[3][3]); - void quat_to_mat_trans(const double *quat, double mat[3][3]); +void angmom_to_omega(double *m, double *ex, double *ey, double *ez, double *idiag, double *w); +void omega_to_angmom(double *w, double *ex, double *ey, double *ez, double *idiag, double *m); +void mq_to_omega(double *m, double *q, double *moments, double *w); +void exyz_to_q(double *ex, double *ey, double *ez, double *q); +void q_to_exyz(double *q, double *ex, double *ey, double *ez); +void quat_to_mat(const double *quat, double mat[3][3]); +void quat_to_mat_trans(const double *quat, double mat[3][3]); - // rotation operations +// rotation operations - inline void rotation_generator_x(const double m[3][3], double ans[3][3]); - inline void rotation_generator_y(const double m[3][3], double ans[3][3]); - inline void rotation_generator_z(const double m[3][3], double ans[3][3]); +inline void rotation_generator_x(const double m[3][3], double ans[3][3]); +inline void rotation_generator_y(const double m[3][3], double ans[3][3]); +inline void rotation_generator_z(const double m[3][3], double ans[3][3]); - void BuildRxMatrix(double R[3][3], const double angle); - void BuildRyMatrix(double R[3][3], const double angle); - void BuildRzMatrix(double R[3][3], const double angle); +void BuildRxMatrix(double R[3][3], const double angle); +void BuildRyMatrix(double R[3][3], const double angle); +void BuildRzMatrix(double R[3][3], const double angle); - // moment of inertia operations +// moment of inertia operations - void inertia_ellipsoid(double *shape, double *quat, double mass, - double *inertia); - void inertia_line(double length, double theta, double mass, - double *inertia); - void inertia_triangle(double *v0, double *v1, double *v2, - double mass, double *inertia); - void inertia_triangle(double *idiag, double *quat, double mass, - double *inertia); -} +void inertia_ellipsoid(double *shape, double *quat, double mass, double *inertia); +void inertia_line(double length, double theta, double mass, double *inertia); +void inertia_triangle(double *v0, double *v1, double *v2, double mass, double *inertia); +void inertia_triangle(double *idiag, double *quat, double mass, double *inertia); +} // namespace MathExtra /* ---------------------------------------------------------------------- copy a vector, return in ans @@ -171,9 +147,9 @@ inline void MathExtra::zero3(double *v) inline void MathExtra::norm3(double *v) { - const double val = v[0]*v[0]+v[1]*v[1]+v[2]*v[2]; + const double val = v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; if (val > 0.0) { - const double scale = 1.0/sqrt(val); + const double scale = 1.0 / sqrt(val); v[0] *= scale; v[1] *= scale; v[2] *= scale; @@ -186,12 +162,12 @@ inline void MathExtra::norm3(double *v) inline void MathExtra::normalize3(const double *v, double *ans) { - const double val = v[0]*v[0]+v[1]*v[1]+v[2]*v[2]; + const double val = v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; if (val > 0.0) { - double scale = 1.0/sqrt(val); - ans[0] = v[0]*scale; - ans[1] = v[1]*scale; - ans[2] = v[2]*scale; + double scale = 1.0 / sqrt(val); + ans[0] = v[0] * scale; + ans[1] = v[1] * scale; + ans[2] = v[2] * scale; } } @@ -199,15 +175,14 @@ inline void MathExtra::normalize3(const double *v, double *ans) scale a vector to length ------------------------------------------------------------------------- */ -inline void MathExtra::snormalize3(const double length, const double *v, - double *ans) +inline void MathExtra::snormalize3(const double length, const double *v, double *ans) { - const double val = v[0]*v[0]+v[1]*v[1]+v[2]*v[2]; + const double val = v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; if (val > 0.0) { - double scale = length/sqrt(val); - ans[0] = v[0]*scale; - ans[1] = v[1]*scale; - ans[2] = v[2]*scale; + double scale = length / sqrt(val); + ans[0] = v[0] * scale; + ans[1] = v[1] * scale; + ans[2] = v[2] * scale; } } @@ -239,9 +214,9 @@ inline void MathExtra::scale3(const double s, double *v) inline void MathExtra::scale3(const double s, const double *v, double *ans) { - ans[0] = s*v[0]; - ans[1] = s*v[1]; - ans[2] = s*v[2]; + ans[0] = s * v[0]; + ans[1] = s * v[1]; + ans[2] = s * v[2]; } /* ---------------------------------------------------------------------- @@ -259,25 +234,23 @@ inline void MathExtra::add3(const double *v1, const double *v2, double *ans) ans = s*v1 + v2 ------------------------------------------------------------------------- */ -inline void MathExtra::scaleadd3(const double s, const double *v1, - const double *v2, double *ans) +inline void MathExtra::scaleadd3(const double s, const double *v1, const double *v2, double *ans) { - ans[0] = s*v1[0] + v2[0]; - ans[1] = s*v1[1] + v2[1]; - ans[2] = s*v1[2] + v2[2]; + ans[0] = s * v1[0] + v2[0]; + ans[1] = s * v1[1] + v2[1]; + ans[2] = s * v1[2] + v2[2]; } /* ---------------------------------------------------------------------- ans = s1*v1 + s2*v2 ------------------------------------------------------------------------- */ -inline void MathExtra::scaleadd3(const double s1, const double *v1, - const double s2, const double *v2, - double *ans) +inline void MathExtra::scaleadd3(const double s1, const double *v1, const double s2, + const double *v2, double *ans) { - ans[0] = s1*v1[0] + s2*v2[0]; - ans[1] = s1*v1[1] + s2*v2[1]; - ans[2] = s1*v1[2] + s2*v2[2]; + ans[0] = s1 * v1[0] + s2 * v2[0]; + ans[1] = s1 * v1[1] + s2 * v2[1]; + ans[2] = s1 * v1[2] + s2 * v2[2]; } /* ---------------------------------------------------------------------- @@ -297,7 +270,7 @@ inline void MathExtra::sub3(const double *v1, const double *v2, double *ans) inline double MathExtra::len3(const double *v) { - return sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); + return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); } /* ---------------------------------------------------------------------- @@ -306,7 +279,7 @@ inline double MathExtra::len3(const double *v) inline double MathExtra::lensq3(const double *v) { - return v[0]*v[0] + v[1]*v[1] + v[2]*v[2]; + return v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; } /* ---------------------------------------------------------------------- @@ -318,7 +291,7 @@ inline double MathExtra::distsq3(const double *v1, const double *v2) double dx = v1[0] - v2[0]; double dy = v1[1] - v2[1]; double dz = v1[2] - v2[2]; - return dx*dx + dy*dy + dz*dz; + return dx * dx + dy * dy + dz * dz; } /* ---------------------------------------------------------------------- @@ -327,7 +300,7 @@ inline double MathExtra::distsq3(const double *v1, const double *v2) inline double MathExtra::dot3(const double *v1, const double *v2) { - return v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]; + return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]; } /* ---------------------------------------------------------------------- @@ -336,17 +309,16 @@ inline double MathExtra::dot3(const double *v1, const double *v2) inline void MathExtra::cross3(const double *v1, const double *v2, double *ans) { - ans[0] = v1[1]*v2[2] - v1[2]*v2[1]; - ans[1] = v1[2]*v2[0] - v1[0]*v2[2]; - ans[2] = v1[0]*v2[1] - v1[1]*v2[0]; + ans[0] = v1[1] * v2[2] - v1[2] * v2[1]; + ans[1] = v1[2] * v2[0] - v1[0] * v2[2]; + ans[2] = v1[0] * v2[1] - v1[1] * v2[0]; } /* ---------------------------------------------------------------------- construct matrix from 3 column vectors ------------------------------------------------------------------------- */ -void MathExtra::col2mat(const double *ex, const double *ey, const double *ez, - double m[3][3]) +void MathExtra::col2mat(const double *ex, const double *ey, const double *ez, double m[3][3]) { m[0][0] = ex[0]; m[1][0] = ex[1]; @@ -365,9 +337,9 @@ void MathExtra::col2mat(const double *ex, const double *ey, const double *ez, inline double MathExtra::det3(const double m[3][3]) { - double ans = m[0][0]*m[1][1]*m[2][2] - m[0][0]*m[1][2]*m[2][1] - - m[1][0]*m[0][1]*m[2][2] + m[1][0]*m[0][2]*m[2][1] + - m[2][0]*m[0][1]*m[1][2] - m[2][0]*m[0][2]*m[1][1]; + double ans = m[0][0] * m[1][1] * m[2][2] - m[0][0] * m[1][2] * m[2][1] - + m[1][0] * m[0][1] * m[2][2] + m[1][0] * m[0][2] * m[2][1] + m[2][0] * m[0][1] * m[1][2] - + m[2][0] * m[0][2] * m[1][1]; return ans; } @@ -375,108 +347,104 @@ inline double MathExtra::det3(const double m[3][3]) diagonal matrix times a full matrix ------------------------------------------------------------------------- */ -inline void MathExtra::diag_times3(const double *d, const double m[3][3], - double ans[3][3]) +inline void MathExtra::diag_times3(const double *d, const double m[3][3], double ans[3][3]) { - ans[0][0] = d[0]*m[0][0]; - ans[0][1] = d[0]*m[0][1]; - ans[0][2] = d[0]*m[0][2]; - ans[1][0] = d[1]*m[1][0]; - ans[1][1] = d[1]*m[1][1]; - ans[1][2] = d[1]*m[1][2]; - ans[2][0] = d[2]*m[2][0]; - ans[2][1] = d[2]*m[2][1]; - ans[2][2] = d[2]*m[2][2]; + ans[0][0] = d[0] * m[0][0]; + ans[0][1] = d[0] * m[0][1]; + ans[0][2] = d[0] * m[0][2]; + ans[1][0] = d[1] * m[1][0]; + ans[1][1] = d[1] * m[1][1]; + ans[1][2] = d[1] * m[1][2]; + ans[2][0] = d[2] * m[2][0]; + ans[2][1] = d[2] * m[2][1]; + ans[2][2] = d[2] * m[2][2]; } /* ---------------------------------------------------------------------- full matrix times a diagonal matrix ------------------------------------------------------------------------- */ -void MathExtra::times3_diag(const double m[3][3], const double *d, - double ans[3][3]) +void MathExtra::times3_diag(const double m[3][3], const double *d, double ans[3][3]) { - ans[0][0] = m[0][0]*d[0]; - ans[0][1] = m[0][1]*d[1]; - ans[0][2] = m[0][2]*d[2]; - ans[1][0] = m[1][0]*d[0]; - ans[1][1] = m[1][1]*d[1]; - ans[1][2] = m[1][2]*d[2]; - ans[2][0] = m[2][0]*d[0]; - ans[2][1] = m[2][1]*d[1]; - ans[2][2] = m[2][2]*d[2]; + ans[0][0] = m[0][0] * d[0]; + ans[0][1] = m[0][1] * d[1]; + ans[0][2] = m[0][2] * d[2]; + ans[1][0] = m[1][0] * d[0]; + ans[1][1] = m[1][1] * d[1]; + ans[1][2] = m[1][2] * d[2]; + ans[2][0] = m[2][0] * d[0]; + ans[2][1] = m[2][1] * d[1]; + ans[2][2] = m[2][2] * d[2]; } /* ---------------------------------------------------------------------- add two matrices ------------------------------------------------------------------------- */ -inline void MathExtra::plus3(const double m[3][3], const double m2[3][3], - double ans[3][3]) +inline void MathExtra::plus3(const double m[3][3], const double m2[3][3], double ans[3][3]) { - ans[0][0] = m[0][0]+m2[0][0]; - ans[0][1] = m[0][1]+m2[0][1]; - ans[0][2] = m[0][2]+m2[0][2]; - ans[1][0] = m[1][0]+m2[1][0]; - ans[1][1] = m[1][1]+m2[1][1]; - ans[1][2] = m[1][2]+m2[1][2]; - ans[2][0] = m[2][0]+m2[2][0]; - ans[2][1] = m[2][1]+m2[2][1]; - ans[2][2] = m[2][2]+m2[2][2]; + ans[0][0] = m[0][0] + m2[0][0]; + ans[0][1] = m[0][1] + m2[0][1]; + ans[0][2] = m[0][2] + m2[0][2]; + ans[1][0] = m[1][0] + m2[1][0]; + ans[1][1] = m[1][1] + m2[1][1]; + ans[1][2] = m[1][2] + m2[1][2]; + ans[2][0] = m[2][0] + m2[2][0]; + ans[2][1] = m[2][1] + m2[2][1]; + ans[2][2] = m[2][2] + m2[2][2]; } /* ---------------------------------------------------------------------- multiply mat1 times mat2 ------------------------------------------------------------------------- */ -inline void MathExtra::times3(const double m[3][3], const double m2[3][3], - double ans[3][3]) +inline void MathExtra::times3(const double m[3][3], const double m2[3][3], double ans[3][3]) { - ans[0][0] = m[0][0]*m2[0][0] + m[0][1]*m2[1][0] + m[0][2]*m2[2][0]; - ans[0][1] = m[0][0]*m2[0][1] + m[0][1]*m2[1][1] + m[0][2]*m2[2][1]; - ans[0][2] = m[0][0]*m2[0][2] + m[0][1]*m2[1][2] + m[0][2]*m2[2][2]; - ans[1][0] = m[1][0]*m2[0][0] + m[1][1]*m2[1][0] + m[1][2]*m2[2][0]; - ans[1][1] = m[1][0]*m2[0][1] + m[1][1]*m2[1][1] + m[1][2]*m2[2][1]; - ans[1][2] = m[1][0]*m2[0][2] + m[1][1]*m2[1][2] + m[1][2]*m2[2][2]; - ans[2][0] = m[2][0]*m2[0][0] + m[2][1]*m2[1][0] + m[2][2]*m2[2][0]; - ans[2][1] = m[2][0]*m2[0][1] + m[2][1]*m2[1][1] + m[2][2]*m2[2][1]; - ans[2][2] = m[2][0]*m2[0][2] + m[2][1]*m2[1][2] + m[2][2]*m2[2][2]; + ans[0][0] = m[0][0] * m2[0][0] + m[0][1] * m2[1][0] + m[0][2] * m2[2][0]; + ans[0][1] = m[0][0] * m2[0][1] + m[0][1] * m2[1][1] + m[0][2] * m2[2][1]; + ans[0][2] = m[0][0] * m2[0][2] + m[0][1] * m2[1][2] + m[0][2] * m2[2][2]; + ans[1][0] = m[1][0] * m2[0][0] + m[1][1] * m2[1][0] + m[1][2] * m2[2][0]; + ans[1][1] = m[1][0] * m2[0][1] + m[1][1] * m2[1][1] + m[1][2] * m2[2][1]; + ans[1][2] = m[1][0] * m2[0][2] + m[1][1] * m2[1][2] + m[1][2] * m2[2][2]; + ans[2][0] = m[2][0] * m2[0][0] + m[2][1] * m2[1][0] + m[2][2] * m2[2][0]; + ans[2][1] = m[2][0] * m2[0][1] + m[2][1] * m2[1][1] + m[2][2] * m2[2][1]; + ans[2][2] = m[2][0] * m2[0][2] + m[2][1] * m2[1][2] + m[2][2] * m2[2][2]; } /* ---------------------------------------------------------------------- multiply the transpose of mat1 times mat2 ------------------------------------------------------------------------- */ -inline void MathExtra::transpose_times3(const double m[3][3], - const double m2[3][3],double ans[3][3]) +inline void MathExtra::transpose_times3(const double m[3][3], const double m2[3][3], + double ans[3][3]) { - ans[0][0] = m[0][0]*m2[0][0] + m[1][0]*m2[1][0] + m[2][0]*m2[2][0]; - ans[0][1] = m[0][0]*m2[0][1] + m[1][0]*m2[1][1] + m[2][0]*m2[2][1]; - ans[0][2] = m[0][0]*m2[0][2] + m[1][0]*m2[1][2] + m[2][0]*m2[2][2]; - ans[1][0] = m[0][1]*m2[0][0] + m[1][1]*m2[1][0] + m[2][1]*m2[2][0]; - ans[1][1] = m[0][1]*m2[0][1] + m[1][1]*m2[1][1] + m[2][1]*m2[2][1]; - ans[1][2] = m[0][1]*m2[0][2] + m[1][1]*m2[1][2] + m[2][1]*m2[2][2]; - ans[2][0] = m[0][2]*m2[0][0] + m[1][2]*m2[1][0] + m[2][2]*m2[2][0]; - ans[2][1] = m[0][2]*m2[0][1] + m[1][2]*m2[1][1] + m[2][2]*m2[2][1]; - ans[2][2] = m[0][2]*m2[0][2] + m[1][2]*m2[1][2] + m[2][2]*m2[2][2]; + ans[0][0] = m[0][0] * m2[0][0] + m[1][0] * m2[1][0] + m[2][0] * m2[2][0]; + ans[0][1] = m[0][0] * m2[0][1] + m[1][0] * m2[1][1] + m[2][0] * m2[2][1]; + ans[0][2] = m[0][0] * m2[0][2] + m[1][0] * m2[1][2] + m[2][0] * m2[2][2]; + ans[1][0] = m[0][1] * m2[0][0] + m[1][1] * m2[1][0] + m[2][1] * m2[2][0]; + ans[1][1] = m[0][1] * m2[0][1] + m[1][1] * m2[1][1] + m[2][1] * m2[2][1]; + ans[1][2] = m[0][1] * m2[0][2] + m[1][1] * m2[1][2] + m[2][1] * m2[2][2]; + ans[2][0] = m[0][2] * m2[0][0] + m[1][2] * m2[1][0] + m[2][2] * m2[2][0]; + ans[2][1] = m[0][2] * m2[0][1] + m[1][2] * m2[1][1] + m[2][2] * m2[2][1]; + ans[2][2] = m[0][2] * m2[0][2] + m[1][2] * m2[1][2] + m[2][2] * m2[2][2]; } /* ---------------------------------------------------------------------- multiply mat1 times transpose of mat2 ------------------------------------------------------------------------- */ -inline void MathExtra::times3_transpose(const double m[3][3], - const double m2[3][3],double ans[3][3]) +inline void MathExtra::times3_transpose(const double m[3][3], const double m2[3][3], + double ans[3][3]) { - ans[0][0] = m[0][0]*m2[0][0] + m[0][1]*m2[0][1] + m[0][2]*m2[0][2]; - ans[0][1] = m[0][0]*m2[1][0] + m[0][1]*m2[1][1] + m[0][2]*m2[1][2]; - ans[0][2] = m[0][0]*m2[2][0] + m[0][1]*m2[2][1] + m[0][2]*m2[2][2]; - ans[1][0] = m[1][0]*m2[0][0] + m[1][1]*m2[0][1] + m[1][2]*m2[0][2]; - ans[1][1] = m[1][0]*m2[1][0] + m[1][1]*m2[1][1] + m[1][2]*m2[1][2]; - ans[1][2] = m[1][0]*m2[2][0] + m[1][1]*m2[2][1] + m[1][2]*m2[2][2]; - ans[2][0] = m[2][0]*m2[0][0] + m[2][1]*m2[0][1] + m[2][2]*m2[0][2]; - ans[2][1] = m[2][0]*m2[1][0] + m[2][1]*m2[1][1] + m[2][2]*m2[1][2]; - ans[2][2] = m[2][0]*m2[2][0] + m[2][1]*m2[2][1] + m[2][2]*m2[2][2]; + ans[0][0] = m[0][0] * m2[0][0] + m[0][1] * m2[0][1] + m[0][2] * m2[0][2]; + ans[0][1] = m[0][0] * m2[1][0] + m[0][1] * m2[1][1] + m[0][2] * m2[1][2]; + ans[0][2] = m[0][0] * m2[2][0] + m[0][1] * m2[2][1] + m[0][2] * m2[2][2]; + ans[1][0] = m[1][0] * m2[0][0] + m[1][1] * m2[0][1] + m[1][2] * m2[0][2]; + ans[1][1] = m[1][0] * m2[1][0] + m[1][1] * m2[1][1] + m[1][2] * m2[1][2]; + ans[1][2] = m[1][0] * m2[2][0] + m[1][1] * m2[2][1] + m[1][2] * m2[2][2]; + ans[2][0] = m[2][0] * m2[0][0] + m[2][1] * m2[0][1] + m[2][2] * m2[0][2]; + ans[2][1] = m[2][0] * m2[1][0] + m[2][1] * m2[1][1] + m[2][2] * m2[1][2]; + ans[2][2] = m[2][0] * m2[2][0] + m[2][1] * m2[2][1] + m[2][2] * m2[2][2]; } /* ---------------------------------------------------------------------- @@ -486,98 +454,93 @@ inline void MathExtra::times3_transpose(const double m[3][3], inline void MathExtra::invert3(const double m[3][3], double ans[3][3]) { - double den = m[0][0]*m[1][1]*m[2][2]-m[0][0]*m[1][2]*m[2][1]; - den += -m[1][0]*m[0][1]*m[2][2]+m[1][0]*m[0][2]*m[2][1]; - den += m[2][0]*m[0][1]*m[1][2]-m[2][0]*m[0][2]*m[1][1]; + double den = m[0][0] * m[1][1] * m[2][2] - m[0][0] * m[1][2] * m[2][1]; + den += -m[1][0] * m[0][1] * m[2][2] + m[1][0] * m[0][2] * m[2][1]; + den += m[2][0] * m[0][1] * m[1][2] - m[2][0] * m[0][2] * m[1][1]; - ans[0][0] = (m[1][1]*m[2][2]-m[1][2]*m[2][1]) / den; - ans[0][1] = -(m[0][1]*m[2][2]-m[0][2]*m[2][1]) / den; - ans[0][2] = (m[0][1]*m[1][2]-m[0][2]*m[1][1]) / den; - ans[1][0] = -(m[1][0]*m[2][2]-m[1][2]*m[2][0]) / den; - ans[1][1] = (m[0][0]*m[2][2]-m[0][2]*m[2][0]) / den; - ans[1][2] = -(m[0][0]*m[1][2]-m[0][2]*m[1][0]) / den; - ans[2][0] = (m[1][0]*m[2][1]-m[1][1]*m[2][0]) / den; - ans[2][1] = -(m[0][0]*m[2][1]-m[0][1]*m[2][0]) / den; - ans[2][2] = (m[0][0]*m[1][1]-m[0][1]*m[1][0]) / den; + ans[0][0] = (m[1][1] * m[2][2] - m[1][2] * m[2][1]) / den; + ans[0][1] = -(m[0][1] * m[2][2] - m[0][2] * m[2][1]) / den; + ans[0][2] = (m[0][1] * m[1][2] - m[0][2] * m[1][1]) / den; + ans[1][0] = -(m[1][0] * m[2][2] - m[1][2] * m[2][0]) / den; + ans[1][1] = (m[0][0] * m[2][2] - m[0][2] * m[2][0]) / den; + ans[1][2] = -(m[0][0] * m[1][2] - m[0][2] * m[1][0]) / den; + ans[2][0] = (m[1][0] * m[2][1] - m[1][1] * m[2][0]) / den; + ans[2][1] = -(m[0][0] * m[2][1] - m[0][1] * m[2][0]) / den; + ans[2][2] = (m[0][0] * m[1][1] - m[0][1] * m[1][0]) / den; } /* ---------------------------------------------------------------------- matrix times vector ------------------------------------------------------------------------- */ -inline void MathExtra::matvec(const double m[3][3], const double *v, +inline void MathExtra::matvec(const double m[3][3], const double *v, double *ans) +{ + ans[0] = m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2]; + ans[1] = m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2]; + ans[2] = m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2]; +} + +/* ---------------------------------------------------------------------- + matrix times vector +------------------------------------------------------------------------- */ + +inline void MathExtra::matvec(const double *ex, const double *ey, const double *ez, const double *v, double *ans) { - ans[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2]; - ans[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2]; - ans[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2]; -} - -/* ---------------------------------------------------------------------- - matrix times vector -------------------------------------------------------------------------- */ - -inline void MathExtra::matvec(const double *ex, const double *ey, - const double *ez, const double *v, double *ans) -{ - ans[0] = ex[0]*v[0] + ey[0]*v[1] + ez[0]*v[2]; - ans[1] = ex[1]*v[0] + ey[1]*v[1] + ez[1]*v[2]; - ans[2] = ex[2]*v[0] + ey[2]*v[1] + ez[2]*v[2]; + ans[0] = ex[0] * v[0] + ey[0] * v[1] + ez[0] * v[2]; + ans[1] = ex[1] * v[0] + ey[1] * v[1] + ez[1] * v[2]; + ans[2] = ex[2] * v[0] + ey[2] * v[1] + ez[2] * v[2]; } /* ---------------------------------------------------------------------- transposed matrix times vector ------------------------------------------------------------------------- */ -inline void MathExtra::transpose_matvec(const double m[3][3], const double *v, - double *ans) +inline void MathExtra::transpose_matvec(const double m[3][3], const double *v, double *ans) { - ans[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2]; - ans[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2]; - ans[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2]; + ans[0] = m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2]; + ans[1] = m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2]; + ans[2] = m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2]; } /* ---------------------------------------------------------------------- transposed matrix times vector ------------------------------------------------------------------------- */ -inline void MathExtra::transpose_matvec(const double *ex, const double *ey, - const double *ez, const double *v, - double *ans) +inline void MathExtra::transpose_matvec(const double *ex, const double *ey, const double *ez, + const double *v, double *ans) { - ans[0] = ex[0]*v[0] + ex[1]*v[1] + ex[2]*v[2]; - ans[1] = ey[0]*v[0] + ey[1]*v[1] + ey[2]*v[2]; - ans[2] = ez[0]*v[0] + ez[1]*v[1] + ez[2]*v[2]; + ans[0] = ex[0] * v[0] + ex[1] * v[1] + ex[2] * v[2]; + ans[1] = ey[0] * v[0] + ey[1] * v[1] + ey[2] * v[2]; + ans[2] = ez[0] * v[0] + ez[1] * v[1] + ez[2] * v[2]; } /* ---------------------------------------------------------------------- transposed matrix times diagonal matrix ------------------------------------------------------------------------- */ -inline void MathExtra::transpose_diag3(const double m[3][3], const double *d, - double ans[3][3]) +inline void MathExtra::transpose_diag3(const double m[3][3], const double *d, double ans[3][3]) { - ans[0][0] = m[0][0]*d[0]; - ans[0][1] = m[1][0]*d[1]; - ans[0][2] = m[2][0]*d[2]; - ans[1][0] = m[0][1]*d[0]; - ans[1][1] = m[1][1]*d[1]; - ans[1][2] = m[2][1]*d[2]; - ans[2][0] = m[0][2]*d[0]; - ans[2][1] = m[1][2]*d[1]; - ans[2][2] = m[2][2]*d[2]; + ans[0][0] = m[0][0] * d[0]; + ans[0][1] = m[1][0] * d[1]; + ans[0][2] = m[2][0] * d[2]; + ans[1][0] = m[0][1] * d[0]; + ans[1][1] = m[1][1] * d[1]; + ans[1][2] = m[2][1] * d[2]; + ans[2][0] = m[0][2] * d[0]; + ans[2][1] = m[1][2] * d[1]; + ans[2][2] = m[2][2] * d[2]; } /* ---------------------------------------------------------------------- row vector times matrix ------------------------------------------------------------------------- */ -inline void MathExtra::vecmat(const double *v, const double m[3][3], - double *ans) +inline void MathExtra::vecmat(const double *v, const double m[3][3], double *ans) { - ans[0] = v[0]*m[0][0] + v[1]*m[1][0] + v[2]*m[2][0]; - ans[1] = v[0]*m[0][1] + v[1]*m[1][1] + v[2]*m[2][1]; - ans[2] = v[0]*m[0][2] + v[1]*m[1][2] + v[2]*m[2][2]; + ans[0] = v[0] * m[0][0] + v[1] * m[1][0] + v[2] * m[2][0]; + ans[1] = v[0] * m[0][1] + v[1] * m[1][1] + v[2] * m[2][1]; + ans[2] = v[0] * m[0][2] + v[1] * m[1][2] + v[2] * m[2][2]; } /* ---------------------------------------------------------------------- @@ -586,9 +549,15 @@ inline void MathExtra::vecmat(const double *v, const double m[3][3], inline void MathExtra::scalar_times3(const double f, double m[3][3]) { - m[0][0] *= f; m[0][1] *= f; m[0][2] *= f; - m[1][0] *= f; m[1][1] *= f; m[1][2] *= f; - m[2][0] *= f; m[2][1] *= f; m[2][2] *= f; + m[0][0] *= f; + m[0][1] *= f; + m[0][2] *= f; + m[1][0] *= f; + m[1][1] *= f; + m[1][2] *= f; + m[2][0] *= f; + m[2][1] *= f; + m[2][2] *= f; } /* ---------------------------------------------------------------------- @@ -596,15 +565,14 @@ inline void MathExtra::scalar_times3(const double f, double m[3][3]) upper-triangular 3x3, stored as 6-vector in Voigt ordering ------------------------------------------------------------------------- */ -inline void MathExtra::multiply_shape_shape(const double *one, - const double *two, double *ans) +inline void MathExtra::multiply_shape_shape(const double *one, const double *two, double *ans) { - ans[0] = one[0]*two[0]; - ans[1] = one[1]*two[1]; - ans[2] = one[2]*two[2]; - ans[3] = one[1]*two[3] + one[3]*two[2]; - ans[4] = one[0]*two[4] + one[5]*two[3] + one[4]*two[2]; - ans[5] = one[0]*two[5] + one[5]*two[1]; + ans[0] = one[0] * two[0]; + ans[1] = one[1] * two[1]; + ans[2] = one[2] * two[2]; + ans[3] = one[1] * two[3] + one[3] * two[2]; + ans[4] = one[0] * two[4] + one[5] * two[3] + one[4] * two[2]; + ans[5] = one[0] * two[5] + one[5] * two[1]; } /* ---------------------------------------------------------------------- @@ -613,7 +581,7 @@ inline void MathExtra::multiply_shape_shape(const double *one, inline void MathExtra::qnormalize(double *q) { - double norm = 1.0 / sqrt(q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]); + double norm = 1.0 / sqrt(q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]); q[0] *= norm; q[1] *= norm; q[2] *= norm; @@ -639,10 +607,10 @@ inline void MathExtra::qconjugate(double *q, double *qc) inline void MathExtra::vecquat(double *a, double *b, double *c) { - c[0] = -a[0]*b[1] - a[1]*b[2] - a[2]*b[3]; - c[1] = b[0]*a[0] + a[1]*b[3] - a[2]*b[2]; - c[2] = b[0]*a[1] + a[2]*b[1] - a[0]*b[3]; - c[3] = b[0]*a[2] + a[0]*b[2] - a[1]*b[1]; + c[0] = -a[0] * b[1] - a[1] * b[2] - a[2] * b[3]; + c[1] = b[0] * a[0] + a[1] * b[3] - a[2] * b[2]; + c[2] = b[0] * a[1] + a[2] * b[1] - a[0] * b[3]; + c[3] = b[0] * a[2] + a[0] * b[2] - a[1] * b[1]; } /* ---------------------------------------------------------------------- @@ -651,10 +619,10 @@ inline void MathExtra::vecquat(double *a, double *b, double *c) inline void MathExtra::quatvec(double *a, double *b, double *c) { - c[0] = -a[1]*b[0] - a[2]*b[1] - a[3]*b[2]; - c[1] = a[0]*b[0] + a[2]*b[2] - a[3]*b[1]; - c[2] = a[0]*b[1] + a[3]*b[0] - a[1]*b[2]; - c[3] = a[0]*b[2] + a[1]*b[1] - a[2]*b[0]; + c[0] = -a[1] * b[0] - a[2] * b[1] - a[3] * b[2]; + c[1] = a[0] * b[0] + a[2] * b[2] - a[3] * b[1]; + c[2] = a[0] * b[1] + a[3] * b[0] - a[1] * b[2]; + c[3] = a[0] * b[2] + a[1] * b[1] - a[2] * b[0]; } /* ---------------------------------------------------------------------- @@ -663,10 +631,10 @@ inline void MathExtra::quatvec(double *a, double *b, double *c) inline void MathExtra::quatquat(double *a, double *b, double *c) { - c[0] = a[0]*b[0] - a[1]*b[1] - a[2]*b[2] - a[3]*b[3]; - c[1] = a[0]*b[1] + b[0]*a[1] + a[2]*b[3] - a[3]*b[2]; - c[2] = a[0]*b[2] + b[0]*a[2] + a[3]*b[1] - a[1]*b[3]; - c[3] = a[0]*b[3] + b[0]*a[3] + a[1]*b[2] - a[2]*b[1]; + c[0] = a[0] * b[0] - a[1] * b[1] - a[2] * b[2] - a[3] * b[3]; + c[1] = a[0] * b[1] + b[0] * a[1] + a[2] * b[3] - a[3] * b[2]; + c[2] = a[0] * b[2] + b[0] * a[2] + a[3] * b[1] - a[1] * b[3]; + c[3] = a[0] * b[3] + b[0] * a[3] + a[1] * b[2] - a[2] * b[1]; } /* ---------------------------------------------------------------------- @@ -678,9 +646,9 @@ inline void MathExtra::quatquat(double *a, double *b, double *c) inline void MathExtra::invquatvec(double *a, double *b, double *c) { - c[0] = -a[1]*b[0] + a[0]*b[1] + a[3]*b[2] - a[2]*b[3]; - c[1] = -a[2]*b[0] - a[3]*b[1] + a[0]*b[2] + a[1]*b[3]; - c[2] = -a[3]*b[0] + a[2]*b[1] - a[1]*b[2] + a[0]*b[3]; + c[0] = -a[1] * b[0] + a[0] * b[1] + a[3] * b[2] - a[2] * b[3]; + c[1] = -a[2] * b[0] - a[3] * b[1] + a[0] * b[2] + a[1] * b[3]; + c[2] = -a[3] * b[0] + a[2] * b[1] - a[1] * b[2] + a[0] * b[3]; } /* ---------------------------------------------------------------------- @@ -688,23 +656,21 @@ inline void MathExtra::invquatvec(double *a, double *b, double *c) v MUST be a unit vector ------------------------------------------------------------------------- */ -inline void MathExtra::axisangle_to_quat(const double *v, const double angle, - double *quat) +inline void MathExtra::axisangle_to_quat(const double *v, const double angle, double *quat) { - double halfa = 0.5*angle; + double halfa = 0.5 * angle; double sina = sin(halfa); quat[0] = cos(halfa); - quat[1] = v[0]*sina; - quat[2] = v[1]*sina; - quat[3] = v[2]*sina; + quat[1] = v[0] * sina; + quat[2] = v[1] * sina; + quat[3] = v[2] * sina; } /* ---------------------------------------------------------------------- Apply principal rotation generator about x to rotation matrix m ------------------------------------------------------------------------- */ -inline void MathExtra::rotation_generator_x(const double m[3][3], - double ans[3][3]) +inline void MathExtra::rotation_generator_x(const double m[3][3], double ans[3][3]) { ans[0][0] = 0; ans[0][1] = -m[0][2]; @@ -721,8 +687,7 @@ inline void MathExtra::rotation_generator_x(const double m[3][3], Apply principal rotation generator about y to rotation matrix m ------------------------------------------------------------------------- */ -inline void MathExtra::rotation_generator_y(const double m[3][3], - double ans[3][3]) +inline void MathExtra::rotation_generator_y(const double m[3][3], double ans[3][3]) { ans[0][0] = m[0][2]; ans[0][1] = 0; @@ -739,8 +704,7 @@ inline void MathExtra::rotation_generator_y(const double m[3][3], Apply principal rotation generator about z to rotation matrix m ------------------------------------------------------------------------- */ -inline void MathExtra::rotation_generator_z(const double m[3][3], - double ans[3][3]) +inline void MathExtra::rotation_generator_z(const double m[3][3], double ans[3][3]) { ans[0][0] = -m[0][1]; ans[0][1] = m[0][0]; @@ -753,7 +717,7 @@ inline void MathExtra::rotation_generator_z(const double m[3][3], ans[2][2] = 0; } - // set matrix to zero +// set matrix to zero inline void MathExtra::zeromat3(double m[3][3]) { @@ -771,58 +735,60 @@ inline void MathExtra::zeromat3(double **m) // add two matrices -inline void MathExtra::plus3(const double m[3][3], double **m2, - double **ans) +inline void MathExtra::plus3(const double m[3][3], double **m2, double **ans) { - ans[0][0] = m[0][0]+m2[0][0]; - ans[0][1] = m[0][1]+m2[0][1]; - ans[0][2] = m[0][2]+m2[0][2]; - ans[1][0] = m[1][0]+m2[1][0]; - ans[1][1] = m[1][1]+m2[1][1]; - ans[1][2] = m[1][2]+m2[1][2]; - ans[2][0] = m[2][0]+m2[2][0]; - ans[2][1] = m[2][1]+m2[2][1]; - ans[2][2] = m[2][2]+m2[2][2]; + ans[0][0] = m[0][0] + m2[0][0]; + ans[0][1] = m[0][1] + m2[0][1]; + ans[0][2] = m[0][2] + m2[0][2]; + ans[1][0] = m[1][0] + m2[1][0]; + ans[1][1] = m[1][1] + m2[1][1]; + ans[1][2] = m[1][2] + m2[1][2]; + ans[2][0] = m[2][0] + m2[2][0]; + ans[2][1] = m[2][1] + m2[2][1]; + ans[2][2] = m[2][2] + m2[2][2]; } // subtract two matrices -inline void MathExtra::minus3(const double m[3][3], const double m2[3][3], - double ans[3][3]) +inline void MathExtra::minus3(const double m[3][3], const double m2[3][3], double ans[3][3]) { - ans[0][0] = m[0][0]-m2[0][0]; - ans[0][1] = m[0][1]-m2[0][1]; - ans[0][2] = m[0][2]-m2[0][2]; - ans[1][0] = m[1][0]-m2[1][0]; - ans[1][1] = m[1][1]-m2[1][1]; - ans[1][2] = m[1][2]-m2[1][2]; - ans[2][0] = m[2][0]-m2[2][0]; - ans[2][1] = m[2][1]-m2[2][1]; - ans[2][2] = m[2][2]-m2[2][2]; + ans[0][0] = m[0][0] - m2[0][0]; + ans[0][1] = m[0][1] - m2[0][1]; + ans[0][2] = m[0][2] - m2[0][2]; + ans[1][0] = m[1][0] - m2[1][0]; + ans[1][1] = m[1][1] - m2[1][1]; + ans[1][2] = m[1][2] - m2[1][2]; + ans[2][0] = m[2][0] - m2[2][0]; + ans[2][1] = m[2][1] - m2[2][1]; + ans[2][2] = m[2][2] - m2[2][2]; } -inline void MathExtra::minus3(double **m, const double m2[3][3], - double ans[3][3]) +inline void MathExtra::minus3(double **m, const double m2[3][3], double ans[3][3]) { - ans[0][0] = m[0][0]-m2[0][0]; - ans[0][1] = m[0][1]-m2[0][1]; - ans[0][2] = m[0][2]-m2[0][2]; - ans[1][0] = m[1][0]-m2[1][0]; - ans[1][1] = m[1][1]-m2[1][1]; - ans[1][2] = m[1][2]-m2[1][2]; - ans[2][0] = m[2][0]-m2[2][0]; - ans[2][1] = m[2][1]-m2[2][1]; - ans[2][2] = m[2][2]-m2[2][2]; + ans[0][0] = m[0][0] - m2[0][0]; + ans[0][1] = m[0][1] - m2[0][1]; + ans[0][2] = m[0][2] - m2[0][2]; + ans[1][0] = m[1][0] - m2[1][0]; + ans[1][1] = m[1][1] - m2[1][1]; + ans[1][2] = m[1][2] - m2[1][2]; + ans[2][0] = m[2][0] - m2[2][0]; + ans[2][1] = m[2][1] - m2[2][1]; + ans[2][2] = m[2][2] - m2[2][2]; } // compute outer product of two vectors -inline void MathExtra::outer3(const double *v1, const double *v2, - double ans[3][3]) +inline void MathExtra::outer3(const double *v1, const double *v2, double ans[3][3]) { - ans[0][0] = v1[0]*v2[0]; ans[0][1] = v1[0]*v2[1]; ans[0][2] = v1[0]*v2[2]; - ans[1][0] = v1[1]*v2[0]; ans[1][1] = v1[1]*v2[1]; ans[1][2] = v1[1]*v2[2]; - ans[2][0] = v1[2]*v2[0]; ans[2][1] = v1[2]*v2[1]; ans[2][2] = v1[2]*v2[2]; + ans[0][0] = v1[0] * v2[0]; + ans[0][1] = v1[0] * v2[1]; + ans[0][2] = v1[0] * v2[2]; + ans[1][0] = v1[1] * v2[0]; + ans[1][1] = v1[1] * v2[1]; + ans[1][2] = v1[1] * v2[2]; + ans[2][0] = v1[2] * v2[0]; + ans[2][1] = v1[2] * v2[1]; + ans[2][2] = v1[2] * v2[2]; } #endif diff --git a/src/math_special.cpp b/src/math_special.cpp index 8d48158e72..da99c5850a 100644 --- a/src/math_special.cpp +++ b/src/math_special.cpp @@ -1,3 +1,4 @@ +// clang-format off #include "math_special.h" #include diff --git a/src/math_special.h b/src/math_special.h index cf435db281..fa39d46321 100644 --- a/src/math_special.h +++ b/src/math_special.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -31,15 +31,17 @@ namespace MathSpecial { // fast 2**x function without argument checks for little endian CPUs extern double exp2_x86(double x); -// fast e**x function for little endian CPUs, falls back to libc on other platforms + // fast e**x function for little endian CPUs, falls back to libc on other platforms extern double fm_exp(double x); // scaled error function complement exp(x*x)*erfc(x) for coul/long styles static inline double my_erfcx(const double x) { - if (x >= 0.0) return erfcx_y100(400.0/(4.0+x)); - else return 2.0*exp(x*x) - erfcx_y100(400.0/(4.0-x)); + if (x >= 0.0) + return erfcx_y100(400.0 / (4.0 + x)); + else + return 2.0 * exp(x * x) - erfcx_y100(400.0 / (4.0 - x)); } // exp(-x*x) for coul/long styles @@ -47,7 +49,7 @@ namespace MathSpecial { static inline double expmsq(double x) { x *= x; - x *= 1.4426950408889634074; // log_2(e) + x *= 1.4426950408889634074; // log_2(e) #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ return (x < 1023.0) ? exp2_x86(-x) : 0.0; #else @@ -57,10 +59,10 @@ namespace MathSpecial { // x**2, use instead of pow(x,2.0) - static inline double square(const double &x) { return x*x; } + static inline double square(const double &x) { return x * x; } // x**3, use instead of pow(x,3.0) - static inline double cube(const double &x) { return x*x*x; } + static inline double cube(const double &x) { return x * x * x; } // return -1.0 for odd n, 1.0 for even n, like pow(-1.0,n) static inline double powsign(const int n) { return (n & 1) ? -1.0 : 1.0; } @@ -68,34 +70,36 @@ namespace MathSpecial { // optimized version of pow(x,n) with n being integer // up to 10x faster than pow(x,y) - static inline double powint(const double &x, const int n) { - double yy,ww; + static inline double powint(const double &x, const int n) + { + double yy, ww; if (x == 0.0) return 0.0; int nn = (n > 0) ? n : -n; ww = x; - for (yy = 1.0; nn != 0; nn >>= 1, ww *=ww) + for (yy = 1.0; nn != 0; nn >>= 1, ww *= ww) if (nn & 1) yy *= ww; - return (n > 0) ? yy : 1.0/yy; + return (n > 0) ? yy : 1.0 / yy; } // optimized version of (sin(x)/x)**n with n being a _positive_ integer - static inline double powsinxx(const double &x, int n) { - double yy,ww; + static inline double powsinxx(const double &x, int n) + { + double yy, ww; if (x == 0.0) return 1.0; - ww = sin(x)/x; + ww = sin(x) / x; - for (yy = 1.0; n != 0; n >>= 1, ww *=ww) + for (yy = 1.0; n != 0; n >>= 1, ww *= ww) if (n & 1) yy *= ww; return yy; } -} -} +} // namespace MathSpecial +} // namespace LAMMPS_NS #endif diff --git a/src/memory.cpp b/src/memory.cpp index 174932e35e..3e67ed1496 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/memory.h b/src/memory.h index b3ce1aa667..5171a4a718 100644 --- a/src/memory.h +++ b/src/memory.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -27,7 +27,7 @@ class Memory : protected Pointers { void sfree(void *); void fail(const char *); -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create/grow/destroy vecs and multidim arrays with contiguous memory blocks only use with primitive data types, e.g. 1d vec of ints, 2d array of doubles fail() prevents use with pointers, @@ -36,90 +36,92 @@ class Memory : protected Pointers { for these other cases, use smalloc/srealloc/sfree directly ------------------------------------------------------------------------- */ -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 1d array ------------------------------------------------------------------------- */ - template - TYPE *create(TYPE *&array, int n, const char *name) + template TYPE *create(TYPE *&array, int n, const char *name) { bigint nbytes = ((bigint) sizeof(TYPE)) * n; - array = (TYPE *) smalloc(nbytes,name); + array = (TYPE *) smalloc(nbytes, name); return array; } - template - TYPE **create(TYPE **& /*array*/, int /*n*/, const char *name) - {fail(name); return nullptr;} + template TYPE **create(TYPE **& /*array*/, int /*n*/, const char *name) + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- grow or shrink 1d array ------------------------------------------------------------------------- */ - template - TYPE *grow(TYPE *&array, int n, const char *name) + template TYPE *grow(TYPE *&array, int n, const char *name) { - if (array == nullptr) return create(array,n,name); + if (array == nullptr) return create(array, n, name); bigint nbytes = ((bigint) sizeof(TYPE)) * n; - array = (TYPE *) srealloc(array,nbytes,name); + array = (TYPE *) srealloc(array, nbytes, name); return array; } - template - TYPE **grow(TYPE **& /*array*/, int /*n*/, const char *name) - {fail(name); return nullptr;} + template TYPE **grow(TYPE **& /*array*/, int /*n*/, const char *name) + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 1d array ------------------------------------------------------------------------- */ - template - void destroy(TYPE *&array) { + template void destroy(TYPE *&array) + { sfree(array); array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 1d array with index from nlo to nhi inclusive cannot grow it ------------------------------------------------------------------------- */ - template - TYPE *create1d_offset(TYPE *&array, int nlo, int nhi, const char *name) + template TYPE *create1d_offset(TYPE *&array, int nlo, int nhi, const char *name) { - bigint nbytes = ((bigint) sizeof(TYPE)) * (nhi-nlo+1); - array = (TYPE *) smalloc(nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * (nhi - nlo + 1); + array = (TYPE *) smalloc(nbytes, name); array -= nlo; return array; } template TYPE **create1d_offset(TYPE **& /*array*/, int /*nlo*/, int /*nhi*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 1d array with index offset ------------------------------------------------------------------------- */ - template - void destroy1d_offset(TYPE *&array, int offset) + template void destroy1d_offset(TYPE *&array, int offset) { if (array) sfree(&array[offset]); array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 2d array ------------------------------------------------------------------------- */ - template - TYPE **create(TYPE **&array, int n1, int n2, const char *name) + template TYPE **create(TYPE **&array, int n1, int n2, const char *name) { - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2; - TYPE *data = (TYPE *) smalloc(nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2; + TYPE *data = (TYPE *) smalloc(nbytes, name); nbytes = ((bigint) sizeof(TYPE *)) * n1; - array = (TYPE **) smalloc(nbytes,name); + array = (TYPE **) smalloc(nbytes, name); bigint n = 0; for (int i = 0; i < n1; i++) { @@ -131,22 +133,24 @@ class Memory : protected Pointers { template TYPE ***create(TYPE ***& /*array*/, int /*n1*/, int /*n2*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 2d array last dim must stay the same ------------------------------------------------------------------------- */ - template - TYPE **grow(TYPE **&array, int n1, int n2, const char *name) + template TYPE **grow(TYPE **&array, int n1, int n2, const char *name) { - if (array == nullptr) return create(array,n1,n2,name); + if (array == nullptr) return create(array, n1, n2, name); - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2; - TYPE *data = (TYPE *) srealloc(array[0],nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2; + TYPE *data = (TYPE *) srealloc(array[0], nbytes, name); nbytes = ((bigint) sizeof(TYPE *)) * n1; - array = (TYPE **) srealloc(array,nbytes,name); + array = (TYPE **) srealloc(array, nbytes, name); bigint n = 0; for (int i = 0; i < n1; i++) { @@ -158,14 +162,16 @@ class Memory : protected Pointers { template TYPE ***grow(TYPE ***& /*array*/, int /*n1*/, int /*n2*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 2d array ------------------------------------------------------------------------- */ - template - void destroy(TYPE **&array) + template void destroy(TYPE **&array) { if (array == nullptr) return; sfree(array[0]); @@ -173,20 +179,19 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 2d array with a ragged 2nd dimension ------------------------------------------------------------------------- */ - template - TYPE **create_ragged(TYPE **&array, int n1, int *n2, const char *name) + template TYPE **create_ragged(TYPE **&array, int n1, int *n2, const char *name) { bigint n2sum = 0; for (int i = 0; i < n1; i++) n2sum += n2[i]; bigint nbytes = ((bigint) sizeof(TYPE)) * n2sum; - TYPE *data = (TYPE *) smalloc(nbytes,name); + TYPE *data = (TYPE *) smalloc(nbytes, name); nbytes = ((bigint) sizeof(TYPE *)) * n1; - array = (TYPE **) smalloc(nbytes,name); + array = (TYPE **) smalloc(nbytes, name); bigint n = 0; for (int i = 0; i < n1; i++) { @@ -198,33 +203,38 @@ class Memory : protected Pointers { template TYPE ***create_ragged(TYPE ***& /*array*/, int /*n1*/, int * /*n2*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 2d array with 2nd index from n2lo to n2hi inclusive cannot grow it ------------------------------------------------------------------------- */ template - TYPE **create2d_offset(TYPE **&array, int n1, int n2lo, int n2hi, - const char *name) + TYPE **create2d_offset(TYPE **&array, int n1, int n2lo, int n2hi, const char *name) { int n2 = n2hi - n2lo + 1; - create(array,n1,n2,name); + create(array, n1, n2, name); for (int i = 0; i < n1; i++) array[i] -= n2lo; return array; } template TYPE ***create2d_offset(TYPE ***& /*array*/, int /*n1*/, int /*n2lo*/, int /*n2hi*/, - const char *name) {fail(name); return nullptr;} + const char *name) + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 2d array with 2nd index offset ------------------------------------------------------------------------- */ - template - void destroy2d_offset(TYPE **&array, int offset) + template void destroy2d_offset(TYPE **&array, int offset) { if (array == nullptr) return; sfree(&array[0][offset]); @@ -232,28 +242,27 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 3d array ------------------------------------------------------------------------- */ - template - TYPE ***create(TYPE ***&array, int n1, int n2, int n3, const char *name) + template TYPE ***create(TYPE ***&array, int n1, int n2, int n3, const char *name) { - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3; - TYPE *data = (TYPE *) smalloc(nbytes,name); - nbytes = ((bigint) sizeof(TYPE *)) * n1*n2; - TYPE **plane = (TYPE **) smalloc(nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3; + TYPE *data = (TYPE *) smalloc(nbytes, name); + nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2; + TYPE **plane = (TYPE **) smalloc(nbytes, name); nbytes = ((bigint) sizeof(TYPE **)) * n1; - array = (TYPE ***) smalloc(nbytes,name); + array = (TYPE ***) smalloc(nbytes, name); - int i,j; + int i, j; bigint m; bigint n = 0; for (i = 0; i < n1; i++) { m = ((bigint) i) * n2; array[i] = &plane[m]; for (j = 0; j < n2; j++) { - plane[m+j] = &data[n]; + plane[m + j] = &data[n]; n += n3; } } @@ -262,33 +271,35 @@ class Memory : protected Pointers { template TYPE ****create(TYPE ****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 3d array last 2 dims must stay the same ------------------------------------------------------------------------- */ - template - TYPE ***grow(TYPE ***&array, int n1, int n2, int n3, const char *name) + template TYPE ***grow(TYPE ***&array, int n1, int n2, int n3, const char *name) { - if (array == nullptr) return create(array,n1,n2,n3,name); + if (array == nullptr) return create(array, n1, n2, n3, name); - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3; - TYPE *data = (TYPE *) srealloc(array[0][0],nbytes,name); - nbytes = ((bigint) sizeof(TYPE *)) * n1*n2; - TYPE **plane = (TYPE **) srealloc(array[0],nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3; + TYPE *data = (TYPE *) srealloc(array[0][0], nbytes, name); + nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2; + TYPE **plane = (TYPE **) srealloc(array[0], nbytes, name); nbytes = ((bigint) sizeof(TYPE **)) * n1; - array = (TYPE ***) srealloc(array,nbytes,name); + array = (TYPE ***) srealloc(array, nbytes, name); - int i,j; + int i, j; bigint m; bigint n = 0; for (i = 0; i < n1; i++) { m = ((bigint) i) * n2; array[i] = &plane[m]; for (j = 0; j < n2; j++) { - plane[m+j] = &data[n]; + plane[m + j] = &data[n]; n += n3; } } @@ -297,14 +308,16 @@ class Memory : protected Pointers { template TYPE ****grow(TYPE ****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 3d array ------------------------------------------------------------------------- */ - template - void destroy(TYPE ***&array) + template void destroy(TYPE ***&array) { if (array == nullptr) return; sfree(array[0][0]); @@ -313,32 +326,33 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 3d array with 1st index from n1lo to n1hi inclusive cannot grow it ------------------------------------------------------------------------- */ template - TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi, - int n2, int n3, const char *name) + TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi, int n2, int n3, const char *name) { int n1 = n1hi - n1lo + 1; - create(array,n1,n2,n3,name); + create(array, n1, n2, n3, name); array -= n1lo; return array; } template - TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, - int /*n2*/, int /*n3*/, const char *name) - {fail(name); return nullptr;} + TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, int /*n2*/, int /*n3*/, + const char *name) + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- free a 3d array with 1st index offset ------------------------------------------------------------------------- */ - template - void destroy3d_offset(TYPE ***&array, int offset) + template void destroy3d_offset(TYPE ***&array, int offset) { if (array == nullptr) return; sfree(&array[offset][0][0]); @@ -347,7 +361,7 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 3d array with 1st index from n1lo to n1hi inclusive, 2nd index from n2lo to n2hi inclusive, @@ -356,14 +370,13 @@ class Memory : protected Pointers { ------------------------------------------------------------------------- */ template - TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi, - int n2lo, int n2hi, int n3lo, int n3hi, - const char *name) + TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi, int n2lo, int n2hi, int n3lo, + int n3hi, const char *name) { int n1 = n1hi - n1lo + 1; int n2 = n2hi - n2lo + 1; int n3 = n3hi - n3lo + 1; - create(array,n1,n2,n3,name); + create(array, n1, n2, n3, name); bigint m = ((bigint) n1) * n2; for (bigint i = 0; i < m; i++) array[0][i] -= n3lo; @@ -373,18 +386,19 @@ class Memory : protected Pointers { } template - TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, - int /*n2lo*/, int /*n2hi*/, int /*n3lo*/, int /*n3hi*/, - const char *name) - {fail(name); return nullptr;} + TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, int /*n2lo*/, + int /*n2hi*/, int /*n3lo*/, int /*n3hi*/, const char *name) + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- free a 3d array with all 3 indices offset ------------------------------------------------------------------------- */ template - void destroy3d_offset(TYPE ***&array, - int n1_offset, int n2_offset, int n3_offset) + void destroy3d_offset(TYPE ***&array, int n1_offset, int n2_offset, int n3_offset) { if (array == nullptr) return; sfree(&array[n1_offset][n2_offset][n3_offset]); @@ -393,35 +407,34 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 4d array ------------------------------------------------------------------------- */ template - TYPE ****create(TYPE ****&array, int n1, int n2, int n3, int n4, - const char *name) + TYPE ****create(TYPE ****&array, int n1, int n2, int n3, int n4, const char *name) { - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4; - TYPE *data = (TYPE *) smalloc(nbytes,name); - nbytes = ((bigint) sizeof(TYPE *)) * n1*n2*n3; - TYPE **cube = (TYPE **) smalloc(nbytes,name); - nbytes = ((bigint) sizeof(TYPE **)) * n1*n2; - TYPE ***plane = (TYPE ***) smalloc(nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3 * n4; + TYPE *data = (TYPE *) smalloc(nbytes, name); + nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2 * n3; + TYPE **cube = (TYPE **) smalloc(nbytes, name); + nbytes = ((bigint) sizeof(TYPE **)) * n1 * n2; + TYPE ***plane = (TYPE ***) smalloc(nbytes, name); nbytes = ((bigint) sizeof(TYPE ***)) * n1; - array = (TYPE ****) smalloc(nbytes,name); + array = (TYPE ****) smalloc(nbytes, name); - bigint i,j,k; - bigint m1,m2; + bigint i, j, k; + bigint m1, m2; bigint n = 0; for (i = 0; i < n1; i++) { m2 = i * n2; array[i] = &plane[m2]; for (j = 0; j < n2; j++) { m1 = i * n2 + j; - m2 = i * n2*n3 + j*n3; + m2 = i * n2 * n3 + j * n3; plane[m1] = &cube[m2]; for (k = 0; k < n3; k++) { - m1 = i * n2*n3 + j*n3 + k; + m1 = i * n2 * n3 + j * n3 + k; cube[m1] = &data[n]; n += n4; } @@ -433,61 +446,63 @@ class Memory : protected Pointers { template TYPE *****create(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 4d array last 3 dims must stay the same ------------------------------------------------------------------------- */ template - TYPE ****grow(TYPE ****&array, int n1, int n2, int n3, int n4, - const char *name) + TYPE ****grow(TYPE ****&array, int n1, int n2, int n3, int n4, const char *name) { - if (array == nullptr) return create(array, n1, n2, n3, n4, name); + if (array == nullptr) return create(array, n1, n2, n3, n4, name); - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4; - TYPE *data = (TYPE *)srealloc(array[0][0][0], nbytes, name); - nbytes = ((bigint) sizeof(TYPE *)) * n1*n2*n3; - TYPE **cube = (TYPE **)srealloc(array[0][0], nbytes, name); - nbytes = ((bigint) sizeof(TYPE **)) * n1*n2; - TYPE ***plane = (TYPE ***)srealloc(array[0], nbytes, name); - nbytes = ((bigint) sizeof(TYPE ***)) * n1; - array = (TYPE ****)srealloc(array, nbytes, name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3 * n4; + TYPE *data = (TYPE *) srealloc(array[0][0][0], nbytes, name); + nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2 * n3; + TYPE **cube = (TYPE **) srealloc(array[0][0], nbytes, name); + nbytes = ((bigint) sizeof(TYPE **)) * n1 * n2; + TYPE ***plane = (TYPE ***) srealloc(array[0], nbytes, name); + nbytes = ((bigint) sizeof(TYPE ***)) * n1; + array = (TYPE ****) srealloc(array, nbytes, name); - int i, j, k; - bigint m1, m2; - bigint n = 0; - for (i = 0; i < n1; i++) { - m2 = ((bigint)i) * n2; - array[i] = &plane[m2]; - for (j = 0; j < n2; j++) { - m1 = ((bigint)i) * n2 + j; - m2 = ((bigint)i) * n2*n3 + j*n3; - plane[m1] = &cube[m2]; - for (k = 0; k < n3; k++) { - m1 = ((bigint)i) * n2*n3 + j*n3 + k; - cube[m1] = &data[n]; - n += n4; - } - } - } - return array; + int i, j, k; + bigint m1, m2; + bigint n = 0; + for (i = 0; i < n1; i++) { + m2 = ((bigint) i) * n2; + array[i] = &plane[m2]; + for (j = 0; j < n2; j++) { + m1 = ((bigint) i) * n2 + j; + m2 = ((bigint) i) * n2 * n3 + j * n3; + plane[m1] = &cube[m2]; + for (k = 0; k < n3; k++) { + m1 = ((bigint) i) * n2 * n3 + j * n3 + k; + cube[m1] = &data[n]; + n += n4; + } + } + } + return array; } template TYPE *****grow(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, - const char *name) + const char *name) { - fail(name); return nullptr; + fail(name); + return nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 4d array ------------------------------------------------------------------------- */ - template - void destroy(TYPE ****&array) + template void destroy(TYPE ****&array) { if (array == nullptr) return; sfree(array[0][0][0]); @@ -497,7 +512,7 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 4d array with indices 2nd index from n2lo to n2hi inclusive 3rd index from n3lo to n3hi inclusive @@ -506,36 +521,36 @@ class Memory : protected Pointers { ------------------------------------------------------------------------- */ template - TYPE ****create4d_offset(TYPE ****&array, int n1, int n2lo, int n2hi, - int n3lo, int n3hi, int n4lo, int n4hi, - const char *name) + TYPE ****create4d_offset(TYPE ****&array, int n1, int n2lo, int n2hi, int n3lo, int n3hi, + int n4lo, int n4hi, const char *name) { int n2 = n2hi - n2lo + 1; int n3 = n3hi - n3lo + 1; int n4 = n4hi - n4lo + 1; - create(array,n1,n2,n3,n4,name); + create(array, n1, n2, n3, n4, name); bigint m = ((bigint) n1) * n2 * n3; for (bigint i = 0; i < m; i++) array[0][0][i] -= n4lo; m = ((bigint) n1) * n2; - for (bigint i = 0; i < m; i++) array [0][i] -= n3lo; + for (bigint i = 0; i < m; i++) array[0][i] -= n3lo; for (int i = 0; i < n1; i++) array[i] -= n2lo; return array; } template TYPE ****create4d_offset(TYPE *****& /*array*/, int /*n1*/, int /*n2lo*/, int /*n2hi*/, - int /*n3lo*/, int /*n3hi*/, int /*n4lo*/, int /*n4hi*/, - const char *name) - {fail(name); return nullptr;} + int /*n3lo*/, int /*n3hi*/, int /*n4lo*/, int /*n4hi*/, const char *name) + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- free a 4d array with indices 2,3, and 4 offset ------------------------------------------------------------------------- */ template - void destroy4d_offset(TYPE ****&array, - int n2_offset, int n3_offset, int n4_offset) + void destroy4d_offset(TYPE ****&array, int n2_offset, int n3_offset, int n4_offset) { if (array == nullptr) return; sfree(&array[0][n2_offset][n3_offset][n4_offset]); @@ -545,43 +560,40 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 5d array ------------------------------------------------------------------------- */ template - TYPE *****create(TYPE *****&array, int n1, int n2, int n3, int n4, - int n5, const char *name) + TYPE *****create(TYPE *****&array, int n1, int n2, int n3, int n4, int n5, const char *name) { - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4*n5; - TYPE *data = (TYPE *) smalloc(nbytes,name); - nbytes = ((bigint) sizeof(TYPE *)) * n1*n2*n3*n4; - TYPE **level4 = (TYPE **) smalloc(nbytes,name); - nbytes = ((bigint) sizeof(TYPE **)) * n1*n2*n3; - TYPE ***level3 = (TYPE ***) smalloc(nbytes,name); - nbytes = ((bigint) sizeof(TYPE ***)) * n1*n2; - TYPE ****level2 = (TYPE ****) smalloc(nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3 * n4 * n5; + TYPE *data = (TYPE *) smalloc(nbytes, name); + nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2 * n3 * n4; + TYPE **level4 = (TYPE **) smalloc(nbytes, name); + nbytes = ((bigint) sizeof(TYPE **)) * n1 * n2 * n3; + TYPE ***level3 = (TYPE ***) smalloc(nbytes, name); + nbytes = ((bigint) sizeof(TYPE ***)) * n1 * n2; + TYPE ****level2 = (TYPE ****) smalloc(nbytes, name); nbytes = ((bigint) sizeof(TYPE ****)) * n1; - array = (TYPE *****) smalloc(nbytes,name); + array = (TYPE *****) smalloc(nbytes, name); - int i,j,k,l; - bigint m1,m2; + int i, j, k, l; + bigint m1, m2; bigint n = 0; for (i = 0; i < n1; i++) { m2 = ((bigint) i) * n2; array[i] = &level2[m2]; for (j = 0; j < n2; j++) { m1 = ((bigint) i) * n2 + j; - m2 = ((bigint) i) * n2*n3 + ((bigint) j) * n3; + m2 = ((bigint) i) * n2 * n3 + ((bigint) j) * n3; level2[m1] = &level3[m2]; for (k = 0; k < n3; k++) { - m1 = ((bigint) i) * n2*n3 + ((bigint) j) * n3 + k; - m2 = ((bigint) i) * n2*n3*n4 + - ((bigint) j) * n3*n4 + ((bigint) k) * n4; + m1 = ((bigint) i) * n2 * n3 + ((bigint) j) * n3 + k; + m2 = ((bigint) i) * n2 * n3 * n4 + ((bigint) j) * n3 * n4 + ((bigint) k) * n4; level3[m1] = &level4[m2]; for (l = 0; l < n4; l++) { - m1 = ((bigint) i) * n2*n3*n4 + - ((bigint) j) * n3*n4 + ((bigint) k) * n4 + l; + m1 = ((bigint) i) * n2 * n3 * n4 + ((bigint) j) * n3 * n4 + ((bigint) k) * n4 + l; level4[m1] = &data[n]; n += n5; } @@ -594,14 +606,16 @@ class Memory : protected Pointers { template TYPE ******create(TYPE ******& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, int /*n5*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 5d array ------------------------------------------------------------------------- */ - template - void destroy(TYPE *****&array) + template void destroy(TYPE *****&array) { if (array == nullptr) return; sfree(array[0][0][0][0]); @@ -612,50 +626,46 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- memory usage of arrays, including pointers ------------------------------------------------------------------------- */ - template - double usage(TYPE *array, int n) + template double usage(TYPE *array, int n) { (void) array; double bytes = ((double) sizeof(TYPE)) * n; return bytes; } - template - double usage(TYPE **array, int n1, int n2) + template double usage(TYPE **array, int n1, int n2) { (void) array; - double bytes = ((double) sizeof(TYPE)) * n1*n2; + double bytes = ((double) sizeof(TYPE)) * n1 * n2; bytes += ((double) sizeof(TYPE *)) * n1; return bytes; } - template - double usage(TYPE ***array, int n1, int n2, int n3) + template double usage(TYPE ***array, int n1, int n2, int n3) { (void) array; - double bytes = ((double) sizeof(TYPE)) * n1*n2*n3; - bytes += ((double) sizeof(TYPE *)) * n1*n2; + double bytes = ((double) sizeof(TYPE)) * n1 * n2 * n3; + bytes += ((double) sizeof(TYPE *)) * n1 * n2; bytes += ((double) sizeof(TYPE **)) * n1; return bytes; } - template - double usage(TYPE ****array, int n1, int n2, int n3, int n4) + template double usage(TYPE ****array, int n1, int n2, int n3, int n4) { (void) array; - double bytes = ((double) sizeof(TYPE)) * n1*n2*n3*n4; - bytes += ((double) sizeof(TYPE *)) * n1*n2*n3; - bytes += ((double) sizeof(TYPE **)) * n1*n2; + double bytes = ((double) sizeof(TYPE)) * n1 * n2 * n3 * n4; + bytes += ((double) sizeof(TYPE *)) * n1 * n2 * n3; + bytes += ((double) sizeof(TYPE **)) * n1 * n2; bytes += ((double) sizeof(TYPE ***)) * n1; return bytes; } }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/min.cpp b/src/min.cpp index 80400f538c..8fe73dc9e1 100644 --- a/src/min.cpp +++ b/src/min.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/min.h b/src/min.h index 5d94519e5a..61af3e23b3 100644 --- a/src/min.h +++ b/src/min.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,36 +14,36 @@ #ifndef LMP_MIN_H #define LMP_MIN_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Min : protected Pointers { public: - double einitial,efinal,eprevious; - double fnorm2_init,fnorminf_init,fnorm2_final,fnorminf_final; + double einitial, efinal, eprevious; + double fnorm2_init, fnorminf_init, fnorm2_final, fnorminf_final; double alpha_final; - int niter,neval; + int niter, neval; int stop_condition; char *stopstr; - int searchflag; // 0 if damped dynamics, 1 if sub-cycles on local search + int searchflag; // 0 if damped dynamics, 1 if sub-cycles on local search Min(class LAMMPS *); virtual ~Min(); virtual void init(); - virtual void setup(int flag=1); + virtual void setup(int flag = 1); virtual void setup_minimal(int); virtual void run(int); void cleanup(); int request(class Pair *, int, double); - virtual double memory_usage() {return 0;} + virtual double memory_usage() { return 0; } void modify_params(int, char **); - virtual int modify_param(int, char **) {return 0;} + virtual int modify_param(int, char **) { return 0; } virtual double fnorm_sqr(); virtual double fnorm_inf(); virtual double fnorm_max(); - enum{TWO,MAX,INF}; + enum { TWO, MAX, INF }; // methods for spin minimizers double total_torque(); @@ -56,74 +56,86 @@ class Min : protected Pointers { virtual int iterate(int) = 0; // possible return values of iterate() method - enum{MAXITER,MAXEVAL,ETOL,FTOL,DOWNHILL,ZEROALPHA,ZEROFORCE, - ZEROQUAD,TRSMALL,INTERROR,TIMEOUT,MAXVDOTF}; + enum { + MAXITER, + MAXEVAL, + ETOL, + FTOL, + DOWNHILL, + ZEROALPHA, + ZEROFORCE, + ZEROQUAD, + TRSMALL, + INTERROR, + TIMEOUT, + MAXVDOTF + }; protected: - int eflag,vflag; // flags for energy/virial computation - int virial_style; // compute virial explicitly or implicitly - int external_force_clear; // clear forces locally or externally + int eflag, vflag; // flags for energy/virial computation + int virial_style; // compute virial explicitly or implicitly + int external_force_clear; // clear forces locally or externally - double dmax; // max dist to move any atom in one step - int linestyle; // 0 = backtrack, 1 = quadratic, 2 = forcezero - // 3 = spin_cubic, 4 = spin_none + double dmax; // max dist to move any atom in one step + int linestyle; // 0 = backtrack, 1 = quadratic, 2 = forcezero + // 3 = spin_cubic, 4 = spin_none - int normstyle; // TWO, MAX or INF flag for force norm evaluation + int normstyle; // TWO, MAX or INF flag for force norm evaluation - double dtinit; // store the default timestep + double dtinit; // store the default timestep // only for minimize style fire2 - int delaystep; // minium steps of dynamics - double dtgrow,dtshrink; // timestep increase, decrease - double alpha0,alphashrink; // mixing velocities+forces coefficient - double tmax,tmin; // timestep multiplicators max, min - int integrator; // Newton integration: euler, leapfrog, verlet... - int halfstepback_flag; // half step backward when v.f <= 0.0 - int delaystep_start_flag; // delay the initial dt_shrink - int max_vdotf_negatif; // maximum iteration with v.f > 0.0 + int delaystep; // minium steps of dynamics + double dtgrow, dtshrink; // timestep increase, decrease + double alpha0, alphashrink; // mixing velocities+forces coefficient + double tmax, tmin; // timestep multiplicators max, min + int integrator; // Newton integration: euler, leapfrog, verlet... + int halfstepback_flag; // half step backward when v.f <= 0.0 + int delaystep_start_flag; // delay the initial dt_shrink + int max_vdotf_negatif; // maximum iteration with v.f > 0.0 - int nelist_global,nelist_atom; // # of PE,virial computes to check - int nvlist_global,nvlist_atom,ncvlist_atom; - class Compute **elist_global; // lists of PE,virial Computes + int nelist_global, nelist_atom; // # of PE,virial computes to check + int nvlist_global, nvlist_atom, ncvlist_atom; + class Compute **elist_global; // lists of PE,virial Computes class Compute **elist_atom; class Compute **vlist_global; class Compute **vlist_atom; class Compute **cvlist_atom; - int triclinic; // 0 if domain is orthog, 1 if triclinic + int triclinic; // 0 if domain is orthog, 1 if triclinic int pairflag; - int torqueflag,extraflag; + int torqueflag, extraflag; - int pair_compute_flag; // 0 if pair->compute is skipped - int kspace_compute_flag; // 0 if kspace->compute is skipped + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped - int narray; // # of arrays stored by fix_minimize - class FixMinimize *fix_minimize; // fix that stores auxiliary data + int narray; // # of arrays stored by fix_minimize + class FixMinimize *fix_minimize; // fix that stores auxiliary data - class Compute *pe_compute; // compute for potential energy - double ecurrent; // current potential energy + class Compute *pe_compute; // compute for potential energy + double ecurrent; // current potential energy - bigint ndoftotal; // total dof for entire problem + bigint ndoftotal; // total dof for entire problem - int nvec; // local atomic dof = length of xvec - double *xvec; // variables for atomic dof, as 1d vector - double *fvec; // force vector for atomic dof, as 1d vector + int nvec; // local atomic dof = length of xvec + double *xvec; // variables for atomic dof, as 1d vector + double *fvec; // force vector for atomic dof, as 1d vector - int nextra_global; // # of extra global dof due to fixes - double *fextra; // force vector for extra global dof - // xextra is stored by fix + int nextra_global; // # of extra global dof due to fixes + double *fextra; // force vector for extra global dof + // xextra is stored by fix - int nextra_atom; // # of extra per-atom variables - double **xextra_atom; // ptr to the variable - double **fextra_atom; // ptr to the force on the variable - int *extra_peratom; // # of values in variable, e.g. 3 in x - int *extra_nlen; // total local length of variable, e.g 3*nlocal - double *extra_max; // max allowed change per iter for atom's var - class Pair **requestor; // Pair that stores/manipulates the variable + int nextra_atom; // # of extra per-atom variables + double **xextra_atom; // ptr to the variable + double **fextra_atom; // ptr to the force on the variable + int *extra_peratom; // # of values in variable, e.g. 3 in x + int *extra_nlen; // total local length of variable, e.g 3*nlocal + double *extra_max; // max allowed change per iter for atom's var + class Pair **requestor; // Pair that stores/manipulates the variable - int kokkosable; // 1 if this min style supports Kokkos + int kokkosable; // 1 if this min style supports Kokkos - int neigh_every,neigh_delay,neigh_dist_check; // neighboring params + int neigh_every, neigh_delay, neigh_dist_check; // neighboring params virtual double energy_force(int); virtual void force_clear(); @@ -134,7 +146,7 @@ class Min : protected Pointers { char *stopstrings(int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/min_cg.cpp b/src/min_cg.cpp index ae2eff9313..1c7ab8b8d5 100644 --- a/src/min_cg.cpp +++ b/src/min_cg.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/min_cg.h b/src/min_cg.h index 269726f803..9b50068509 100644 --- a/src/min_cg.h +++ b/src/min_cg.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef MINIMIZE_CLASS - -MinimizeStyle(cg,MinCG) - +// clang-format off +MinimizeStyle(cg,MinCG); +// clang-format on #else #ifndef LMP_MIN_CG_H @@ -30,7 +30,7 @@ class MinCG : public MinLineSearch { int iterate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/min_fire.cpp b/src/min_fire.cpp index e77a64edcd..8999d2a4a6 100644 --- a/src/min_fire.cpp +++ b/src/min_fire.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/min_fire.h b/src/min_fire.h index 18d64ff310..7e961b766a 100644 --- a/src/min_fire.h +++ b/src/min_fire.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef MINIMIZE_CLASS - -MinimizeStyle(fire,MinFire) - +// clang-format off +MinimizeStyle(fire,MinFire); +// clang-format on #else #ifndef LMP_MIN_FIRE_H @@ -34,13 +34,13 @@ class MinFire : public Min { int iterate(int); private: - double dt,dtmax,dtmin; + double dt, dtmax, dtmin; double alpha; - bigint last_negative,ntimestep_start; - int vdotf_negatif,flagv0; + bigint last_negative, ntimestep_start; + int vdotf_negatif, flagv0; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/min_fire_old.cpp b/src/min_fire_old.cpp index 8c5e17dbdb..40fc11de66 100644 --- a/src/min_fire_old.cpp +++ b/src/min_fire_old.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/min_fire_old.h b/src/min_fire_old.h index f46ff463b5..06fe13daec 100644 --- a/src/min_fire_old.h +++ b/src/min_fire_old.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef MINIMIZE_CLASS - -MinimizeStyle(fire/old,MinFireOld) - +// clang-format off +MinimizeStyle(fire/old,MinFireOld); +// clang-format on #else #ifndef LMP_MIN_FIRE_OLD_H @@ -34,12 +34,12 @@ class MinFireOld : public Min { int iterate(int); private: - double dt,dtmax; + double dt, dtmax; double alpha; bigint last_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/min_hftn.cpp b/src/min_hftn.cpp index c554981835..1c9ff0b237 100644 --- a/src/min_hftn.cpp +++ b/src/min_hftn.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/min_hftn.h b/src/min_hftn.h index afdfd005d4..3512d24220 100644 --- a/src/min_hftn.h +++ b/src/min_hftn.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef MINIMIZE_CLASS - -MinimizeStyle(hftn,MinHFTN) - +// clang-format off +MinimizeStyle(hftn,MinHFTN); +// clang-format on #else #ifndef LMP_MIN_HFTN_H @@ -22,106 +22,72 @@ MinimizeStyle(hftn,MinHFTN) #include "min.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { -class MinHFTN : public Min -{ - public: - - MinHFTN (LAMMPS *); - ~MinHFTN (void); +class MinHFTN : public Min { + public: + MinHFTN(LAMMPS *); + ~MinHFTN(void); void init(); void setup_style(); void reset_vectors(); - int iterate (int); - - private: + int iterate(int); + private: //---- THE ALGORITHM NEEDS TO STORE THIS MANY ATOM-BASED VECTORS, //---- IN ADDITION TO ATOM POSITIONS AND THE FORCE VECTOR. enum { - VEC_XK=0, //-- ATOM POSITIONS AT SUBITER START - VEC_CG_P, //-- STEP p IN CG SUBITER - VEC_CG_D, //-- DIRECTION d IN CG SUBITER - VEC_CG_HD, //-- HESSIAN-VECTOR PRODUCT Hd - VEC_CG_R, //-- RESIDUAL r IN CG SUBITER - VEC_DIF1, //-- FOR FINITE DIFFERENCING - VEC_DIF2, //-- FOR FINITE DIFFERENCING + VEC_XK = 0, //-- ATOM POSITIONS AT SUBITER START + VEC_CG_P, //-- STEP p IN CG SUBITER + VEC_CG_D, //-- DIRECTION d IN CG SUBITER + VEC_CG_HD, //-- HESSIAN-VECTOR PRODUCT Hd + VEC_CG_R, //-- RESIDUAL r IN CG SUBITER + VEC_DIF1, //-- FOR FINITE DIFFERENCING + VEC_DIF2, //-- FOR FINITE DIFFERENCING NUM_HFTN_ATOM_BASED_VECTORS }; //---- ATOM-BASED STORAGE VECTORS. - double * _daAVectors[NUM_HFTN_ATOM_BASED_VECTORS]; - double ** _daExtraAtom[NUM_HFTN_ATOM_BASED_VECTORS]; + double *_daAVectors[NUM_HFTN_ATOM_BASED_VECTORS]; + double **_daExtraAtom[NUM_HFTN_ATOM_BASED_VECTORS]; //---- GLOBAL DOF STORAGE. ELEMENT [0] IS X0 (XK), NOT USED IN THIS ARRAY. - double * _daExtraGlobal[NUM_HFTN_ATOM_BASED_VECTORS]; + double *_daExtraGlobal[NUM_HFTN_ATOM_BASED_VECTORS]; - int _nNumUnknowns; - FILE * _fpPrint; + int _nNumUnknowns; + FILE *_fpPrint; - int execute_hftn_ (const bool bPrintProgress, - const double dInitialEnergy, - const double dInitialForce2, - double & dFinalEnergy, - double & dFinalForce2); - bool compute_inner_cg_step_ (const double dTrustRadius, - const double dForceTol, - const int nMaxEvals, - const bool bHaveEvalAtXin, - const double dEnergyAtXin, - const double dForce2AtXin, - double & dEnergyAtXout, - double & dForce2AtXout, - int & nStepType, - double & dStepLength2, - double & dStepLengthInf); - double calc_xinf_using_mpi_ (void) const; - double calc_dot_prod_using_mpi_ (const int nIx1, - const int nIx2) const; - double calc_grad_dot_v_using_mpi_ (const int nIx) const; - void calc_dhd_dd_using_mpi_ (double & dDHD, - double & dDD) const; - void calc_ppnew_pdold_using_mpi_ (double & dPnewDotPnew, - double & dPoldDotD) const; - void calc_plengths_using_mpi_ (double & dStepLength2, - double & dStepLengthInf) const; - bool step_exceeds_TR_ (const double dTrustRadius, - const double dPP, - const double dPD, - const double dDD, - double & dTau) const; - bool step_exceeds_DMAX_ (void) const; - void adjust_step_to_tau_ (const double tau); - double compute_to_tr_ (const double dPP, - const double dPD, - const double dDD, - const double dTrustRadius, - const bool bConsiderBothRoots, - const double dDHD, - const double dPdotHD, - const double dGradDotD) const; - void evaluate_dir_der_ (const bool bUseForwardDiffs, - const int nIxDir, - const int nIxResult, - const bool bEvaluateAtX, - double & dNewEnergy); - void open_hftn_print_file_ (void); - void hftn_print_line_ (const bool bIsStepAccepted, - const int nIteration, - const int nTotalEvals, - const double dEnergy, - const double dForce2, - const int nStepType, - const double dTrustRadius, - const double dStepLength2, - const double dActualRed, - const double dPredictedRed) const; - void close_hftn_print_file_ (void); + int execute_hftn_(const bool bPrintProgress, const double dInitialEnergy, + const double dInitialForce2, double &dFinalEnergy, double &dFinalForce2); + bool compute_inner_cg_step_(const double dTrustRadius, const double dForceTol, + const int nMaxEvals, const bool bHaveEvalAtXin, + const double dEnergyAtXin, const double dForce2AtXin, + double &dEnergyAtXout, double &dForce2AtXout, int &nStepType, + double &dStepLength2, double &dStepLengthInf); + double calc_xinf_using_mpi_(void) const; + double calc_dot_prod_using_mpi_(const int nIx1, const int nIx2) const; + double calc_grad_dot_v_using_mpi_(const int nIx) const; + void calc_dhd_dd_using_mpi_(double &dDHD, double &dDD) const; + void calc_ppnew_pdold_using_mpi_(double &dPnewDotPnew, double &dPoldDotD) const; + void calc_plengths_using_mpi_(double &dStepLength2, double &dStepLengthInf) const; + bool step_exceeds_TR_(const double dTrustRadius, const double dPP, const double dPD, + const double dDD, double &dTau) const; + bool step_exceeds_DMAX_(void) const; + void adjust_step_to_tau_(const double tau); + double compute_to_tr_(const double dPP, const double dPD, const double dDD, + const double dTrustRadius, const bool bConsiderBothRoots, const double dDHD, + const double dPdotHD, const double dGradDotD) const; + void evaluate_dir_der_(const bool bUseForwardDiffs, const int nIxDir, const int nIxResult, + const bool bEvaluateAtX, double &dNewEnergy); + void open_hftn_print_file_(void); + void hftn_print_line_(const bool bIsStepAccepted, const int nIteration, const int nTotalEvals, + const double dEnergy, const double dForce2, const int nStepType, + const double dTrustRadius, const double dStepLength2, + const double dActualRed, const double dPredictedRed) const; + void close_hftn_print_file_(void); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/min_linesearch.cpp b/src/min_linesearch.cpp index 0c6dd46408..a5d0aa326c 100644 --- a/src/min_linesearch.cpp +++ b/src/min_linesearch.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/min_linesearch.h b/src/min_linesearch.h index ded5eb9871..505de7494e 100644 --- a/src/min_linesearch.h +++ b/src/min_linesearch.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -31,14 +31,14 @@ class MinLineSearch : public Min { // allocated and stored by fix_minimize // x,f are stored by parent or Atom class or Pair class - double *x0; // coords at start of linesearch - double *g; // old gradient vector - double *h; // search direction vector + double *x0; // coords at start of linesearch + double *g; // old gradient vector + double *h; // search direction vector - double *gextra; // g,h for extra global dof, x0 is stored by fix + double *gextra; // g,h for extra global dof, x0 is stored by fix double *hextra; - double **x0extra_atom; // x0,g,h for extra per-atom dof + double **x0extra_atom; // x0,g,h for extra per-atom dof double **gextra_atom; double **hextra_atom; @@ -52,6 +52,6 @@ class MinLineSearch : public Min { double compute_dir_deriv(double &); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/min_quickmin.cpp b/src/min_quickmin.cpp index c5707fff85..3191cb1429 100644 --- a/src/min_quickmin.cpp +++ b/src/min_quickmin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/min_quickmin.h b/src/min_quickmin.h index 5697b9e5c9..89022aa95b 100644 --- a/src/min_quickmin.h +++ b/src/min_quickmin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef MINIMIZE_CLASS - -MinimizeStyle(quickmin,MinQuickMin) - +// clang-format off +MinimizeStyle(quickmin,MinQuickMin); +// clang-format on #else #ifndef LMP_MIN_QUICKMIN_H @@ -38,7 +38,7 @@ class MinQuickMin : public Min { bigint last_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/min_sd.cpp b/src/min_sd.cpp index 47e8c750a6..eed6793b63 100644 --- a/src/min_sd.cpp +++ b/src/min_sd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/min_sd.h b/src/min_sd.h index 65fc3cfd8e..2ccc1ba698 100644 --- a/src/min_sd.h +++ b/src/min_sd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef MINIMIZE_CLASS - -MinimizeStyle(sd,MinSD) - +// clang-format off +MinimizeStyle(sd,MinSD); +// clang-format on #else #ifndef LMP_MIN_SD_H @@ -30,7 +30,7 @@ class MinSD : public MinLineSearch { int iterate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/minimize.cpp b/src/minimize.cpp index 1fb0d219cd..206bc51914 100644 --- a/src/minimize.cpp +++ b/src/minimize.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/minimize.h b/src/minimize.h index 1ea4d3f5ff..f1dc539388 100644 --- a/src/minimize.h +++ b/src/minimize.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(minimize,Minimize) - +// clang-format off +CommandStyle(minimize,Minimize); +// clang-format on #else #ifndef LMP_MINIMIZE_H @@ -30,7 +30,7 @@ class Minimize : public Command { void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/modify.cpp b/src/modify.cpp index 1d6a3d7178..c395575d7f 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/modify.h b/src/modify.h index c756800b12..5111ef43ab 100644 --- a/src/modify.h +++ b/src/modify.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,8 +20,8 @@ namespace LAMMPS_NS { - class Compute; - class Fix; +class Compute; +class Fix; class Modify : protected Pointers { friend class Info; @@ -30,26 +30,26 @@ class Modify : protected Pointers { friend class RespaOMP; public: - int n_initial_integrate,n_post_integrate,n_pre_exchange; - int n_pre_neighbor,n_post_neighbor; - int n_pre_force,n_pre_reverse,n_post_force; - int n_final_integrate,n_end_of_step; - int n_energy_couple,n_energy_global,n_energy_atom; - int n_initial_integrate_respa,n_post_integrate_respa; - int n_pre_force_respa,n_post_force_respa,n_final_integrate_respa; - int n_min_pre_exchange,n_min_pre_neighbor,n_min_post_neighbor; - int n_min_pre_force,n_min_pre_reverse,n_min_post_force,n_min_energy; + int n_initial_integrate, n_post_integrate, n_pre_exchange; + int n_pre_neighbor, n_post_neighbor; + int n_pre_force, n_pre_reverse, n_post_force; + int n_final_integrate, n_end_of_step; + int n_energy_couple, n_energy_global, n_energy_atom; + int n_initial_integrate_respa, n_post_integrate_respa; + int n_pre_force_respa, n_post_force_respa, n_final_integrate_respa; + int n_min_pre_exchange, n_min_pre_neighbor, n_min_post_neighbor; + int n_min_pre_force, n_min_pre_reverse, n_min_post_force, n_min_energy; - int restart_pbc_any; // 1 if any fix sets restart_pbc - int nfix_restart_global; // stored fix global info from restart file - int nfix_restart_peratom; // stored fix peratom info from restart file + int restart_pbc_any; // 1 if any fix sets restart_pbc + int nfix_restart_global; // stored fix global info from restart file + int nfix_restart_peratom; // stored fix peratom info from restart file - int nfix,maxfix; - Fix **fix; // list of fixes - int *fmask; // bit mask for when each fix is applied + int nfix, maxfix; + Fix **fix; // list of fixes + int *fmask; // bit mask for when each fix is applied - int ncompute,maxcompute; - Compute **compute; // list of computes + int ncompute, maxcompute; + Compute **compute; // list of computes Modify(class LAMMPS *); virtual ~Modify(); @@ -66,7 +66,7 @@ class Modify : protected Pointers { virtual void pre_neighbor(); virtual void post_neighbor(); virtual void pre_force(int); - virtual void pre_reverse(int,int); + virtual void pre_reverse(int, int); virtual void post_force(int); virtual void final_integrate(); virtual void end_of_step(); @@ -87,7 +87,7 @@ class Modify : protected Pointers { virtual void min_pre_neighbor(); virtual void min_post_neighbor(); virtual void min_pre_force(int); - virtual void min_pre_reverse(int,int); + virtual void min_pre_reverse(int, int); virtual void min_post_force(int); virtual double min_energy(double *); @@ -100,18 +100,18 @@ class Modify : protected Pointers { virtual int min_dof(); virtual int min_reset_ref(); - void add_fix(int, char **, int trysuffix=1); - void add_fix(const std::string &, int trysuffix=1); - void replace_fix(const char *, int, char **, int trysuffix=1); - void replace_fix(const std::string &, const std::string &, int trysuffix=1); + void add_fix(int, char **, int trysuffix = 1); + void add_fix(const std::string &, int trysuffix = 1); + void replace_fix(const char *, int, char **, int trysuffix = 1); + void replace_fix(const std::string &, const std::string &, int trysuffix = 1); void modify_fix(int, char **); void delete_fix(const std::string &); void delete_fix(int); int find_fix(const std::string &); int find_fix_by_style(const char *); - void add_compute(int, char **, int trysuffix=1); - void add_compute(const std::string &, int trysuffix=1); + void add_compute(int, char **, int trysuffix = 1); + void add_compute(const std::string &, int trysuffix = 1); void modify_compute(int, char **); void delete_compute(const std::string &); void delete_compute(int); @@ -134,37 +134,36 @@ class Modify : protected Pointers { double memory_usage(); protected: - // lists of fixes to apply at different stages of timestep - int *list_initial_integrate,*list_post_integrate; - int *list_pre_exchange,*list_pre_neighbor,*list_post_neighbor; - int *list_pre_force,*list_pre_reverse,*list_post_force; - int *list_final_integrate,*list_end_of_step; - int *list_energy_couple,*list_energy_global,*list_energy_atom; - int *list_initial_integrate_respa,*list_post_integrate_respa; - int *list_pre_force_respa,*list_post_force_respa; + int *list_initial_integrate, *list_post_integrate; + int *list_pre_exchange, *list_pre_neighbor, *list_post_neighbor; + int *list_pre_force, *list_pre_reverse, *list_post_force; + int *list_final_integrate, *list_end_of_step; + int *list_energy_couple, *list_energy_global, *list_energy_atom; + int *list_initial_integrate_respa, *list_post_integrate_respa; + int *list_pre_force_respa, *list_post_force_respa; int *list_final_integrate_respa; - int *list_min_pre_exchange,*list_min_pre_neighbor,*list_min_post_neighbor; - int *list_min_pre_force,*list_min_pre_reverse,*list_min_post_force; + int *list_min_pre_exchange, *list_min_pre_neighbor, *list_min_post_neighbor; + int *list_min_pre_force, *list_min_pre_reverse, *list_min_post_force; int *list_min_energy; int *end_of_step_every; - int n_timeflag; // list of computes that store time invocation + int n_timeflag; // list of computes that store time invocation int *list_timeflag; - char **id_restart_global; // stored fix global info - char **style_restart_global; // from read-in restart file + char **id_restart_global; // stored fix global info + char **style_restart_global; // from read-in restart file char **state_restart_global; int *used_restart_global; - char **id_restart_peratom; // stored fix peratom info - char **style_restart_peratom; // from read-in restart file + char **id_restart_peratom; // stored fix peratom info + char **style_restart_peratom; // from read-in restart file int *index_restart_peratom; int *used_restart_peratom; - int index_permanent; // fix/compute index returned to library call + int index_permanent; // fix/compute index returned to library call void list_init(int, int &, int *&); void list_init_end_of_step(int, int &, int *&); @@ -176,11 +175,11 @@ class Modify : protected Pointers { public: typedef Compute *(*ComputeCreator)(LAMMPS *, int, char **); - typedef std::map ComputeCreatorMap; + typedef std::map ComputeCreatorMap; ComputeCreatorMap *compute_map; typedef Fix *(*FixCreator)(LAMMPS *, int, char **); - typedef std::map FixCreatorMap; + typedef std::map FixCreatorMap; FixCreatorMap *fix_map; protected: @@ -189,7 +188,7 @@ class Modify : protected Pointers { template static Fix *fix_creator(LAMMPS *, int, char **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/molecule.cpp b/src/molecule.cpp index 9961014a10..1194f2c584 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/molecule.h b/src/molecule.h index 2beab65b4a..c7b54b921a 100644 --- a/src/molecule.h +++ b/src/molecule.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,36 +22,36 @@ namespace LAMMPS_NS { class Molecule : protected Pointers { public: - char *id; // template id of this molecule, same for all molecules in set - int nset; // if first in set, # of molecules in this set - // else 0 if not first in set - int last; // 1 if last molecule in set, else 0 + char *id; // template id of this molecule, same for all molecules in set + int nset; // if first in set, # of molecules in this set + // else 0 if not first in set + int last; // 1 if last molecule in set, else 0 // number of atoms,bonds,etc in molecule // nibody,ndbody = # of integer/double fields in body int natoms; - int nbonds,nangles,ndihedrals,nimpropers; - int ntypes,nmolecules,nfragments; - int nbondtypes,nangletypes,ndihedraltypes,nimpropertypes; - int nibody,ndbody; + int nbonds, nangles, ndihedrals, nimpropers; + int ntypes, nmolecules, nfragments; + int nbondtypes, nangletypes, ndihedraltypes, nimpropertypes; + int nibody, ndbody; // max bond,angle,etc per atom - int bond_per_atom,angle_per_atom,dihedral_per_atom,improper_per_atom; + int bond_per_atom, angle_per_atom, dihedral_per_atom, improper_per_atom; int maxspecial; // 1 if attribute defined in file, 0 if not - int xflag,typeflag,moleculeflag,fragmentflag,qflag,radiusflag,rmassflag; - int bondflag,angleflag,dihedralflag,improperflag; - int nspecialflag,specialflag; - int shakeflag,shakeflagflag,shakeatomflag,shaketypeflag; - int bodyflag,ibodyflag,dbodyflag; + int xflag, typeflag, moleculeflag, fragmentflag, qflag, radiusflag, rmassflag; + int bondflag, angleflag, dihedralflag, improperflag; + int nspecialflag, specialflag; + int shakeflag, shakeflagflag, shakeatomflag, shaketypeflag; + int bodyflag, ibodyflag, dbodyflag; // 1 if attribute defined or computed, 0 if not - int centerflag,massflag,comflag,inertiaflag; + int centerflag, massflag, comflag, inertiaflag; // 1 if molecule fields require atom IDs @@ -66,21 +66,21 @@ class Molecule : protected Pointers { double *radius; // radius of each atom double *rmass; // mass of each atom - int *num_bond; // bonds, angles, dihedrals, impropers for each atom + int *num_bond; // bonds, angles, dihedrals, impropers for each atom int **bond_type; tagint **bond_atom; int *num_angle; int **angle_type; - tagint **angle_atom1,**angle_atom2,**angle_atom3; + tagint **angle_atom1, **angle_atom2, **angle_atom3; int *num_dihedral; int **dihedral_type; - tagint **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4; + tagint **dihedral_atom1, **dihedral_atom2, **dihedral_atom3, **dihedral_atom4; int *num_improper; int **improper_type; - tagint **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4; + tagint **improper_atom1, **improper_atom2, **improper_atom3, **improper_atom4; int **nspecial; tagint **special; @@ -90,21 +90,21 @@ class Molecule : protected Pointers { int **shake_type; class AtomVecBody *avec_body; - int *ibodyparams; // integer and double body params + int *ibodyparams; // integer and double body params double *dbodyparams; // fragment info - int **fragmentmask; // nfragments by natoms + int **fragmentmask; // nfragments by natoms std::vector fragmentnames; - double center[3]; // geometric center of molecule - double masstotal; // total mass of molecule - double com[3]; // center of mass of molecule - double itensor[6]; // moments of inertia of molecule - double inertia[3]; // principal moments of inertia of molecule - double ex[3],ey[3],ez[3]; // principal axes of molecule in space coords - double quat[4]; // quaternion for orientation of molecule + double center[3]; // geometric center of molecule + double masstotal; // total mass of molecule + double com[3]; // center of mass of molecule + double itensor[6]; // moments of inertia of molecule + double inertia[3]; // principal moments of inertia of molecule + double ex[3], ey[3], ez[3]; // principal axes of molecule in space coords + double quat[4]; // quaternion for orientation of molecule double maxradius; // max radius of any atom in molecule double molradius; // radius of molecule from geometric center @@ -112,13 +112,13 @@ class Molecule : protected Pointers { int comatom; // index (1-Natom) of atom closest to COM double maxextent; // furthest any atom in molecule is from comatom - double **dx; // displacement of each atom relative to center - double **dxcom; // displacement of each atom relative to COM - double **dxbody; // displacement of each atom relative to COM - // in body frame (diagonalized interia tensor) + double **dx; // displacement of each atom relative to center + double **dxcom; // displacement of each atom relative to COM + double **dxbody; // displacement of each atom relative to COM + // in body frame (diagonalized interia tensor) - double *quat_external; // orientation imposed by external class - // e.g. FixPour or CreateAtoms + double *quat_external; // orientation imposed by external class + // e.g. FixPour or CreateAtoms Molecule(class LAMMPS *, int, char **, int &); ~Molecule(); @@ -133,7 +133,7 @@ class Molecule : protected Pointers { int me; FILE *fp; int *count; - int toffset,boffset,aoffset,doffset,ioffset; + int toffset, boffset, aoffset, doffset, ioffset; int autospecial; double sizescale; @@ -168,7 +168,7 @@ class Molecule : protected Pointers { // void print(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/mpiio.h b/src/mpiio.h index 839d748f9f..db5fa0847f 100644 --- a/src/mpiio.h +++ b/src/mpiio.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,7 +23,7 @@ #error "The MPIIO package cannot be compiled in serial with MPI STUBS" #endif -#include "restart_mpiio.h" // IWYU pragma: export +#include "restart_mpiio.h" // IWYU pragma: export #else @@ -36,16 +36,16 @@ class RestartMPIIO { public: int mpiio_exists; - RestartMPIIO(class LAMMPS *) {mpiio_exists = 0;} + RestartMPIIO(class LAMMPS *) { mpiio_exists = 0; } ~RestartMPIIO() {} void openForRead(const char *) {} void openForWrite(const char *) {} - void write(MPI_Offset,int,double *) {} - void read(MPI_Offset,long,double *) {} + void write(MPI_Offset, int, double *) {} + void read(MPI_Offset, long, double *) {} void close() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/my_page.cpp b/src/my_page.cpp index 3e29337ce5..7cbaca2ef7 100644 --- a/src/my_page.cpp +++ b/src/my_page.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/my_page.h b/src/my_page.h index d9617d5213..fcb7b63cff 100644 --- a/src/my_page.h +++ b/src/my_page.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -27,18 +27,16 @@ struct HyperOneCoeff { tagint tag; }; -template -class MyPage { +template class MyPage { public: - int ndatum; // total # of stored datums - int nchunk; // total # of stored chunks + int ndatum; // total # of stored datums + int nchunk; // total # of stored chunks MyPage(); virtual ~MyPage(); - int init(int user_maxchunk=1, int user_pagesize=1024, - int user_pagedelta=1); + int init(int user_maxchunk = 1, int user_pagesize = 1024, int user_pagedelta = 1); - T *get(int n=1); + T *get(int n = 1); /** Get pointer to location that can store *maxchunk* items. * @@ -48,8 +46,9 @@ class MyPage { * * \return pointer to chunk of memory or null pointer if run out of memory */ - T *vget() { - if (index+maxchunk <= pagesize) return &page[index]; + T *vget() + { + if (index + maxchunk <= pagesize) return &page[index]; ipage++; if (ipage == npage) { allocate(); @@ -69,7 +68,8 @@ class MyPage { * * \param n Number of items used in previously reserved chunk */ - void vgot(int n) { + void vgot(int n) + { if (n > maxchunk) errorflag = 1; ndatum += n; nchunk++; @@ -82,9 +82,7 @@ class MyPage { * * \return total storage used in bytes */ - double size() const { - return (double)npage*pagesize*sizeof(T); - } + double size() const { return (double) npage * pagesize * sizeof(T); } /** Return error status * @@ -93,23 +91,23 @@ class MyPage { int status() const { return errorflag; } private: - T **pages; // list of allocated pages - T *page; // ptr to current page - int npage; // # of allocated pages - int ipage; // index of current page - int index; // current index on current page + T **pages; // list of allocated pages + T *page; // ptr to current page + int npage; // # of allocated pages + int ipage; // index of current page + int index; // current index on current page - int maxchunk; // max # of datums in one requested chunk - int pagesize; // # of datums in one page, default = 1024 - int pagedelta; // # of pages to allocate at once, default = 1 + int maxchunk; // max # of datums in one requested chunk + int pagesize; // # of datums in one page, default = 1024 + int pagedelta; // # of pages to allocate at once, default = 1 - int errorflag; // flag > 0 if error has occurred - // 1 = chunk size exceeded maxchunk - // 2 = memory allocation error + int errorflag; // flag > 0 if error has occurred + // 1 = chunk size exceeded maxchunk + // 2 = memory allocation error void allocate(); void deallocate(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/my_pool_chunk.cpp b/src/my_pool_chunk.cpp index d824b0557b..1c770d0208 100644 --- a/src/my_pool_chunk.cpp +++ b/src/my_pool_chunk.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/my_pool_chunk.h b/src/my_pool_chunk.h index cfd4a9fa7b..ba71d6ac55 100644 --- a/src/my_pool_chunk.h +++ b/src/my_pool_chunk.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,11 +16,10 @@ namespace LAMMPS_NS { -template -class MyPoolChunk { +template class MyPoolChunk { public: - int ndatum; // total # of stored datums - int nchunk; // total # of stored chunks + int ndatum; // total # of stored datums + int nchunk; // total # of stored chunks MyPoolChunk(int user_minchunk = 1, int user_maxchunk = 1, int user_nbin = 1, int user_chunkperpage = 1024, int user_pagedelta = 1); @@ -53,25 +52,25 @@ class MyPoolChunk { int status() const { return errorflag; } private: - int minchunk; // min # of datums per chunk - int maxchunk; // max # of datums per chunk - int nbin; // # of bins to split min-to-max into - int chunkperpage; // # of chunks on every page, regardless of which bin - int pagedelta; // # of pages to allocate at once, default = 1 - int binsize; // delta in chunk sizes between adjacent bins - int errorflag; // flag > 0 if error has occurred - // 1 = invalid inputs - // 2 = memory allocation error - // 3 = chunk size exceeded maxchunk + int minchunk; // min # of datums per chunk + int maxchunk; // max # of datums per chunk + int nbin; // # of bins to split min-to-max into + int chunkperpage; // # of chunks on every page, regardless of which bin + int pagedelta; // # of pages to allocate at once, default = 1 + int binsize; // delta in chunk sizes between adjacent bins + int errorflag; // flag > 0 if error has occurred + // 1 = invalid inputs + // 2 = memory allocation error + // 3 = chunk size exceeded maxchunk - T **pages; // list of allocated pages - int *whichbin; // which bin each page belongs to - int npage; // # of allocated pages - int *freelist; // each chunk points to next unused chunk in same bin - int *freehead; // index of first unused chunk in each bin - int *chunksize; // size of chunks in each bin + T **pages; // list of allocated pages + int *whichbin; // which bin each page belongs to + int npage; // # of allocated pages + int *freelist; // each chunk points to next unused chunk in same bin + int *freehead; // index of first unused chunk in each bin + int *chunksize; // size of chunks in each bin void allocate(int ibin); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/nbin.cpp b/src/nbin.cpp index 7b604ca29d..89c0cfc851 100644 --- a/src/nbin.cpp +++ b/src/nbin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nbin.h b/src/nbin.h index 06b5f189be..6755158bc2 100644 --- a/src/nbin.h +++ b/src/nbin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,23 +20,23 @@ namespace LAMMPS_NS { class NBin : protected Pointers { public: - int istyle; // 1-N index into binnames - bigint last_bin; // last timestep atoms were binned - double cutoff_custom; // cutoff set by requestor + int istyle; // 1-N index into binnames + bigint last_bin; // last timestep atoms were binned + double cutoff_custom; // cutoff set by requestor // Variables for NBinStandard - int nbinx,nbiny,nbinz; // # of global bins - int mbins; // # of local bins and offset on this proc - int mbinx,mbiny,mbinz; - int mbinxlo,mbinylo,mbinzlo; + int nbinx, nbiny, nbinz; // # of global bins + int mbins; // # of local bins and offset on this proc + int mbinx, mbiny, mbinz; + int mbinxlo, mbinylo, mbinzlo; - double binsizex,binsizey,binsizez; // bin sizes and inverse sizes - double bininvx,bininvy,bininvz; + double binsizex, binsizey, binsizez; // bin sizes and inverse sizes + double bininvx, bininvy, bininvz; - int *binhead; // index of first atom in each bin - int *bins; // index of next atom in same bin - int *atom2bin; // bin assignment for each atom (local+ghost) + int *binhead; // index of first atom in each bin + int *bins; // index of next atom in same bin + int *atom2bin; // bin assignment for each atom (local+ghost) // Analogues for NBinMultimulti @@ -57,14 +57,13 @@ class NBin : protected Pointers { virtual void bin_atoms_setup(int) = 0; virtual void setup_bins(int) = 0; virtual void bin_atoms() = 0; - virtual double memory_usage() {return 0.0;} + virtual double memory_usage() { return 0.0; } // Kokkos package - int kokkos; // 1 if class stores Kokkos data + int kokkos; // 1 if class stores Kokkos data protected: - // data from Neighbor class int includegroup; @@ -72,7 +71,7 @@ class NBin : protected Pointers { double cutneighmax; int binsizeflag; double binsize_user; - double *bboxlo,*bboxhi; + double *bboxlo, *bboxhi; int ncollections; double **cutcollectionsq; @@ -83,13 +82,13 @@ class NBin : protected Pointers { // data for standard NBin - int maxatom; // size of bins array - int maxbin; // size of binhead array + int maxatom; // size of bins array + int maxbin; // size of binhead array // data for multi NBin - int maxcollections; // size of multi arrays - int * maxbins_multi; // size of 2nd dimension of binhead_multi array + int maxcollections; // size of multi arrays + int *maxbins_multi; // size of 2nd dimension of binhead_multi array // methods @@ -97,7 +96,7 @@ class NBin : protected Pointers { int coord2bin_multi(double *, int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/nbin_multi.cpp b/src/nbin_multi.cpp index 14ea62200c..1ddb1d69bd 100644 --- a/src/nbin_multi.cpp +++ b/src/nbin_multi.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nbin_multi.h b/src/nbin_multi.h index 7b79cf9653..cc58ee0649 100644 --- a/src/nbin_multi.h +++ b/src/nbin_multi.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NBIN_CLASS - +// clang-format off NBinStyle(multi, NBinMulti, - NB_MULTI) - + NB_MULTI); +// clang-format on #else #ifndef LMP_NBIN_MULTI_H @@ -28,7 +28,6 @@ namespace LAMMPS_NS { class NBinMulti : public NBin { public: - NBinMulti(class LAMMPS *); ~NBinMulti() {} void bin_atoms_setup(int); @@ -37,7 +36,7 @@ class NBinMulti : public NBin { double memory_usage(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nbin_standard.cpp b/src/nbin_standard.cpp index 031cdd8b62..d10c98835e 100644 --- a/src/nbin_standard.cpp +++ b/src/nbin_standard.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nbin_standard.h b/src/nbin_standard.h index 54a6cf8358..405c7c88f1 100644 --- a/src/nbin_standard.h +++ b/src/nbin_standard.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NBIN_CLASS - +// clang-format off NBinStyle(standard, NBinStandard, - NB_STANDARD) - + NB_STANDARD); +// clang-format on #else #ifndef LMP_NBIN_STANDARD_H @@ -36,7 +36,7 @@ class NBinStandard : public NBin { double memory_usage(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/neigh_list.cpp b/src/neigh_list.cpp index a51ecb7518..5dc56f8c60 100644 --- a/src/neigh_list.cpp +++ b/src/neigh_list.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/neigh_list.h b/src/neigh_list.h index 88d86aaffd..703d4c13a9 100644 --- a/src/neigh_list.h +++ b/src/neigh_list.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,19 +14,19 @@ #ifndef LMP_NEIGH_LIST_H #define LMP_NEIGH_LIST_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class NeighList : protected Pointers { public: enum RequestorType { NONE, PAIR, FIX, COMPUTE }; - void * requestor; // object that made request - RequestorType requestor_type; // type of requestor + void *requestor; // object that made request + RequestorType requestor_type; // type of requestor - int index; // index of which neigh list this is - // also indexes the request it came from - // and the npair list of NPair classes + int index; // index of which neigh list this is + // also indexes the request it came from + // and the npair list of NPair classes int bin_method; // 0 if no binning, else 1-N index into binnames int stencil_method; // 0 if no stencil, else 1-N index into stencilnames @@ -34,83 +34,83 @@ class NeighList : protected Pointers { // settings from NeighRequest - int occasional; // 0 if build every reneighbor, 1 if not - int ghost; // 1 if list stores neighbors of ghosts - int ssa; // 1 if list stores Shardlow data - int history; // 1 if there is neigh history (FixNeighHist) - int respaouter; // 1 if list is a rRespa outer list - int respamiddle; // 1 if there is also a rRespa middle list - int respainner; // 1 if there is also a rRespa inner list - int copy; // 1 if this list is copied from another list - int kk2cpu; // 1 if this list is copied from Kokkos to CPU - int copymode; // 1 if this is a Kokkos on-device copy - int id; // copied from neighbor list request + int occasional; // 0 if build every reneighbor, 1 if not + int ghost; // 1 if list stores neighbors of ghosts + int ssa; // 1 if list stores Shardlow data + int history; // 1 if there is neigh history (FixNeighHist) + int respaouter; // 1 if list is a rRespa outer list + int respamiddle; // 1 if there is also a rRespa middle list + int respainner; // 1 if there is also a rRespa inner list + int copy; // 1 if this list is copied from another list + int kk2cpu; // 1 if this list is copied from Kokkos to CPU + int copymode; // 1 if this is a Kokkos on-device copy + int id; // copied from neighbor list request // data structs to store neighbor pairs I,J and associated values - int inum; // # of I atoms neighbors are stored for - int gnum; // # of ghost atoms neighbors are stored for - int *ilist; // local indices of I atoms - int *numneigh; // # of J neighbors for each I atom - int **firstneigh; // ptr to 1st J int value of each I atom - int maxatom; // size of allocated per-atom arrays + int inum; // # of I atoms neighbors are stored for + int gnum; // # of ghost atoms neighbors are stored for + int *ilist; // local indices of I atoms + int *numneigh; // # of J neighbors for each I atom + int **firstneigh; // ptr to 1st J int value of each I atom + int maxatom; // size of allocated per-atom arrays - int pgsize; // size of each page - int oneatom; // max size for one atom - MyPage *ipage; // pages of neighbor indices + int pgsize; // size of each page + int oneatom; // max size for one atom + MyPage *ipage; // pages of neighbor indices // data structs to store rRESPA neighbor pairs I,J and associated values - int inum_inner; // # of I atoms neighbors are stored for - int gnum_inner; // # of ghost atoms neighbors are stored for - int *ilist_inner; // local indices of I atoms - int *numneigh_inner; // # of J neighbors for each I atom - int **firstneigh_inner; // ptr to 1st J int value of each I atom + int inum_inner; // # of I atoms neighbors are stored for + int gnum_inner; // # of ghost atoms neighbors are stored for + int *ilist_inner; // local indices of I atoms + int *numneigh_inner; // # of J neighbors for each I atom + int **firstneigh_inner; // ptr to 1st J int value of each I atom - int inum_middle; // # of I atoms neighbors are stored for - int gnum_middle; // # of ghost atoms neighbors are stored for - int *ilist_middle; // local indices of I atoms - int *numneigh_middle; // # of J neighbors for each I atom - int **firstneigh_middle; // ptr to 1st J int value of each I atom + int inum_middle; // # of I atoms neighbors are stored for + int gnum_middle; // # of ghost atoms neighbors are stored for + int *ilist_middle; // local indices of I atoms + int *numneigh_middle; // # of J neighbors for each I atom + int **firstneigh_middle; // ptr to 1st J int value of each I atom - MyPage *ipage_inner; // pages of neighbor indices for inner - MyPage *ipage_middle; // pages of neighbor indices for middle + MyPage *ipage_inner; // pages of neighbor indices for inner + MyPage *ipage_middle; // pages of neighbor indices for middle // atom types to skip when building list // copied info from corresponding request into realloced vec/array - int *iskip; // iskip[i] = 1 if atoms of type I are not in list - int **ijskip; // ijskip[i][j] = 1 if pairs of type I,J are not in list + int *iskip; // iskip[i] = 1 if atoms of type I are not in list + int **ijskip; // ijskip[i][j] = 1 if pairs of type I,J are not in list // settings and pointers for related neighbor lists and fixes - NeighList *listcopy; // me = copy list, point to list I copy from - NeighList *listskip; // me = skip list, point to list I skip from - NeighList *listfull; // me = half list, point to full I derive from + NeighList *listcopy; // me = copy list, point to list I copy from + NeighList *listskip; // me = skip list, point to list I skip from + NeighList *listfull; // me = half list, point to full I derive from - class Fix *fix_bond; // fix that stores bond info + class Fix *fix_bond; // fix that stores bond info // Kokkos package - int kokkos; // 1 if list stores Kokkos data + int kokkos; // 1 if list stores Kokkos data ExecutionSpace execution_space; // USER-DPD package and Shardlow Splitting Algorithm (SSA) support - class NPair *np; // ptr to NPair instance I depend on + class NPair *np; // ptr to NPair instance I depend on // methods NeighList(class LAMMPS *); virtual ~NeighList(); void post_constructor(class NeighRequest *); - void setup_pages(int, int); // setup page data structures - void grow(int,int); // grow all data structs - void print_attributes(); // debug routine - int get_maxlocal() {return maxatom;} + void setup_pages(int, int); // setup page data structures + void grow(int, int); // grow all data structs + void print_attributes(); // debug routine + int get_maxlocal() { return maxatom; } double memory_usage(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp index 8c8168952e..96ec568469 100644 --- a/src/neigh_request.cpp +++ b/src/neigh_request.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/neigh_request.h b/src/neigh_request.h index c58c17b4c5..30cf6592d1 100644 --- a/src/neigh_request.h +++ b/src/neigh_request.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,11 +20,11 @@ namespace LAMMPS_NS { class NeighRequest : protected Pointers { public: - int index; // index of which neigh request this is - void *requestor; // class that made request - int requestor_instance; // instance of that class (only Fix, Compute, Pair) - int id; // ID of request as stored by requestor - // used to track multiple requests from one class + int index; // index of which neigh request this is + void *requestor; // class that made request + int requestor_instance; // instance of that class (only Fix, Compute, Pair) + int id; // ID of request as stored by requestor + // used to track multiple requests from one class // ----------------------------- // flags set by requesting class for attributes of neighor list they need @@ -34,7 +34,7 @@ class NeighRequest : protected Pointers { // which class style requests the list // one flag is 1, others are 0 - int pair; // pair is set by default + int pair; // pair is set by default int fix; int compute; int command; @@ -43,42 +43,42 @@ class NeighRequest : protected Pointers { // half/full setting, determines which neighbors appear in list // one flag is 1, other is 0 - int half; // half neigh list (set by default) - int full; // full neigh list + int half; // half neigh list (set by default) + int full; // full neigh list // attribute flags, all are 0 by default - int occasional; // how often list is built - // 0 if needed every reneighboring during run - // 1 if only occasionally needed by a fix, compute, etc + int occasional; // how often list is built + // 0 if needed every reneighboring during run + // 1 if only occasionally needed by a fix, compute, etc - int newton; // which owned/ghost pairs appear in list - // 0 if use force::newton_pair setting - // 1 if override with pair newton on - // 2 if override with pair newton off + int newton; // which owned/ghost pairs appear in list + // 0 if use force::newton_pair setting + // 1 if override with pair newton on + // 2 if override with pair newton off - int ghost; // 1 if includes ghost atom neighbors - int size; // 1 if pair cutoff set by particle radius - int history; // 1 if there is also neigh history info (FixNeighHist) - int granonesided; // 1 if one-sided granular list for - // sphere/surf interactions - int respainner; // 1 if need a rRESPA inner list - int respamiddle; // 1 if need a rRESPA middle list - int respaouter; // 1 if need a rRESPA outer list - int bond; // 1 if store bond neighbors instead of atom neighs - int omp; // set by USER-OMP package - int intel; // set by USER-INTEL package - int kokkos_host; // set by KOKKOS package + int ghost; // 1 if includes ghost atom neighbors + int size; // 1 if pair cutoff set by particle radius + int history; // 1 if there is also neigh history info (FixNeighHist) + int granonesided; // 1 if one-sided granular list for + // sphere/surf interactions + int respainner; // 1 if need a rRESPA inner list + int respamiddle; // 1 if need a rRESPA middle list + int respaouter; // 1 if need a rRESPA outer list + int bond; // 1 if store bond neighbors instead of atom neighs + int omp; // set by USER-OMP package + int intel; // set by USER-INTEL package + int kokkos_host; // set by KOKKOS package int kokkos_device; - int ssa; // set by USER-DPD package, for Shardlow lists - int cut; // 1 if use a non-standard cutoff length - double cutoff; // special cutoff distance for this list + int ssa; // set by USER-DPD package, for Shardlow lists + int cut; // 1 if use a non-standard cutoff length + double cutoff; // special cutoff distance for this list // flags set by pair hybrid - int skip; // 1 if this list skips atom types from another list - int *iskip; // iskip[i] if atoms of type I are not in list - int **ijskip; // ijskip[i][j] if pairs of type I,J are not in list + int skip; // 1 if this list skips atom types from another list + int *iskip; // iskip[i] if atoms of type I are not in list + int **ijskip; // ijskip[i][j] if pairs of type I,J are not in list // command_style only set if command = 1 // allows print_pair_info() to access command name @@ -89,25 +89,25 @@ class NeighRequest : protected Pointers { // flags set by Neighbor class to morph original requests // ----------------------------- - int skiplist; // index of list to skip from - int off2on; // 1 if this is newton on list, but skips from off list + int skiplist; // index of list to skip from + int off2on; // 1 if this is newton on list, but skips from off list - int copy; // 1 if this list copied from another list - int copylist; // index of list to copy from + int copy; // 1 if this list copied from another list + int copylist; // index of list to copy from - int halffull; // 1 if half list computed from another full list - int halffulllist; // index of full list to derive half from + int halffull; // 1 if half list computed from another full list + int halffulllist; // index of full list to derive half from - int unique; // 1 if this list requires its own - // NStencil, Nbin class - because of requestor cutoff + int unique; // 1 if this list requires its own + // NStencil, Nbin class - because of requestor cutoff // ----------------------------- // internal settings made by Neighbor class // ----------------------------- - int index_bin; // index of NBin class assigned to this request - int index_stencil; // index of NStencil class assigned to this request - int index_pair; // index of NPair class assigned to this request + int index_bin; // index of NBin class assigned to this request + int index_stencil; // index of NStencil class assigned to this request + int index_pair; // index of NPair class assigned to this request // methods @@ -119,6 +119,6 @@ class NeighRequest : protected Pointers { void copy_request(NeighRequest *, int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 357784927b..9d94265002 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -2237,7 +2238,7 @@ void Neighbor::build(int topoflag) for (i = 0; i < npair_perpetual; i++) { m = plist[i]; - if (!lists[i]->copy || lists[i]->kk2cpu) + if (!lists[m]->copy || lists[m]->kk2cpu) lists[m]->grow(nlocal,nall); neigh_pair[m]->build_setup(); neigh_pair[m]->build(lists[m]); diff --git a/src/neighbor.h b/src/neighbor.h index 2aa1f203c4..a64e52fdbb 100644 --- a/src/neighbor.h +++ b/src/neighbor.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,86 +20,86 @@ namespace LAMMPS_NS { class Neighbor : protected Pointers { public: - enum{NSQ,BIN,MULTI_OLD,MULTI}; - int style; // 0,1,2,3 = nsq, bin, multi/old, multi - int every; // build every this many steps - int delay; // delay build for this many steps - int dist_check; // 0 = always build, 1 = only if 1/2 dist - int ago; // how many steps ago neighboring occurred - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - int includegroup; // only build pairwise lists for this group - int build_once; // 1 if only build lists once per run + enum { NSQ, BIN, MULTI_OLD, MULTI }; + int style; // 0,1,2,3 = nsq, bin, multi/old, multi + int every; // build every this many steps + int delay; // delay build for this many steps + int dist_check; // 0 = always build, 1 = only if 1/2 dist + int ago; // how many steps ago neighboring occurred + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + int includegroup; // only build pairwise lists for this group + int build_once; // 1 if only build lists once per run - double skin; // skin distance - double cutneighmin; // min neighbor cutoff for all type pairs - double cutneighmax; // max neighbor cutoff for all type pairs - double cutneighmaxsq; // cutneighmax squared - double **cutneighsq; // neighbor cutneigh sq for each type pair - double **cutneighghostsq; // cutneigh sq for each ghost type pair - double *cuttype; // for each type, max neigh cut w/ others - double *cuttypesq; // cuttype squared - double cut_inner_sq; // outer cutoff for inner neighbor list - double cut_middle_sq; // outer cutoff for middle neighbor list - double cut_middle_inside_sq; // inner cutoff for middle neighbor list + double skin; // skin distance + double cutneighmin; // min neighbor cutoff for all type pairs + double cutneighmax; // max neighbor cutoff for all type pairs + double cutneighmaxsq; // cutneighmax squared + double **cutneighsq; // neighbor cutneigh sq for each type pair + double **cutneighghostsq; // cutneigh sq for each ghost type pair + double *cuttype; // for each type, max neigh cut w/ others + double *cuttypesq; // cuttype squared + double cut_inner_sq; // outer cutoff for inner neighbor list + double cut_middle_sq; // outer cutoff for middle neighbor list + double cut_middle_inside_sq; // inner cutoff for middle neighbor list - int binsizeflag; // user-chosen bin size - double binsize_user; // set externally by some accelerator pkgs + int binsizeflag; // user-chosen bin size + double binsize_user; // set externally by some accelerator pkgs - bigint ncalls; // # of times build has been called - bigint ndanger; // # of dangerous builds - bigint lastcall; // timestep of last neighbor::build() call + bigint ncalls; // # of times build has been called + bigint ndanger; // # of dangerous builds + bigint lastcall; // timestep of last neighbor::build() call // geometry and static info, used by other Neigh classes - double *bboxlo,*bboxhi; // ptrs to full domain bounding box - // different for orthog vs triclinic + double *bboxlo, *bboxhi; // ptrs to full domain bounding box + // different for orthog vs triclinic // exclusion info, used by NeighPair - int exclude; // 0 if no type/group exclusions, 1 if yes + int exclude; // 0 if no type/group exclusions, 1 if yes - int nex_type; // # of entries in type exclusion list - int *ex1_type,*ex2_type; // pairs of types to exclude - int **ex_type; // 2d array of excluded type pairs + int nex_type; // # of entries in type exclusion list + int *ex1_type, *ex2_type; // pairs of types to exclude + int **ex_type; // 2d array of excluded type pairs - int nex_group; // # of entries in group exclusion list - int *ex1_group,*ex2_group; // pairs of group #'s to exclude - int *ex1_bit,*ex2_bit; // pairs of group bits to exclude + int nex_group; // # of entries in group exclusion list + int *ex1_group, *ex2_group; // pairs of group #'s to exclude + int *ex1_bit, *ex2_bit; // pairs of group bits to exclude - int nex_mol; // # of entries in molecule exclusion list - int *ex_mol_group; // molecule group #'s to exclude - int *ex_mol_bit; // molecule group bits to exclude - int *ex_mol_intra; // 0 = exclude if in 2 molecules (inter) - // 1 = exclude if in same molecule (intra) + int nex_mol; // # of entries in molecule exclusion list + int *ex_mol_group; // molecule group #'s to exclude + int *ex_mol_bit; // molecule group bits to exclude + int *ex_mol_intra; // 0 = exclude if in 2 molecules (inter) + // 1 = exclude if in same molecule (intra) // special info, used by NeighPair - int special_flag[4]; // flags for 1-2, 1-3, 1-4 neighbors + int special_flag[4]; // flags for 1-2, 1-3, 1-4 neighbors // cluster setting, used by NeighTopo - int cluster_check; // 1 if check bond/angle/etc satisfies minimg + int cluster_check; // 1 if check bond/angle/etc satisfies minimg // pairwise neighbor lists and corresponding requests - int nlist; // # of pairwise neighbor lists - int nrequest; // # of requests, same as nlist - int old_nrequest; // # of requests for previous run + int nlist; // # of pairwise neighbor lists + int nrequest; // # of requests, same as nlist + int old_nrequest; // # of requests for previous run class NeighList **lists; - class NeighRequest **requests; // from Pair,Fix,Compute,Command classes - class NeighRequest **old_requests; // copy of requests to compare to + class NeighRequest **requests; // from Pair,Fix,Compute,Command classes + class NeighRequest **old_requests; // copy of requests to compare to // data from topology neighbor lists - int nbondlist; // list of bonds to compute + int nbondlist; // list of bonds to compute int **bondlist; - int nanglelist; // list of angles to compute + int nanglelist; // list of angles to compute int **anglelist; - int ndihedrallist; // list of dihedrals to compute + int ndihedrallist; // list of dihedrals to compute int **dihedrallist; - int nimproperlist; // list of impropers to compute + int nimproperlist; // list of impropers to compute int **improperlist; // optional type grouping for multi @@ -119,74 +119,74 @@ class Neighbor : protected Pointers { Neighbor(class LAMMPS *); virtual ~Neighbor(); virtual void init(); - int request(void *, int instance=0); + int request(void *, int instance = 0); int decide(); // decide whether to build or not virtual int check_distance(); // check max distance moved since last build void setup_bins(); // setup bins based on box and cutoff virtual void build(int); // build all perpetual neighbor lists virtual void build_topology(); // pairwise topology neighbor lists - void build_one(class NeighList *list, int preflag=0); - // create a one-time pairwise neigh list - void set(int, char **); // set neighbor style and skin distance - void reset_timestep(bigint); // reset of timestep counter - void modify_params(int, char**); // modify params that control builds - void modify_params(const std::string &); // convenience overload + void build_one(class NeighList *list, int preflag = 0); + // create a one-time pairwise neigh list + void set(int, char **); // set neighbor style and skin distance + void reset_timestep(bigint); // reset of timestep counter + void modify_params(int, char **); // modify params that control builds + void modify_params(const std::string &); // convenience overload - void exclusion_group_group_delete(int, int); // rm a group-group exclusion - int exclude_setting(); // return exclude value to accelerator pkg - class NeighRequest *find_request(void *); // find a neighbor request - int any_full(); // Check if any old requests had full neighbor lists - void build_collection(int); // build peratom collection array starting at the given index + void exclusion_group_group_delete(int, int); // rm a group-group exclusion + int exclude_setting(); // return exclude value to accelerator pkg + class NeighRequest *find_request(void *); // find a neighbor request + int any_full(); // Check if any old requests had full neighbor lists + void build_collection(int); // build peratom collection array starting at the given index double memory_usage(); - bigint last_setup_bins; // step of last neighbor::setup_bins() call + bigint last_setup_bins; // step of last neighbor::setup_bins() call protected: - int me,nprocs; - int firsttime; // flag for calling init_styles() only once + int me, nprocs; + int firsttime; // flag for calling init_styles() only once - int dimension; // 2/3 for 2d/3d - int triclinic; // 0 if domain is orthog, 1 if triclinic - int newton_pair; // 0 if newton off for pairwise, 1 if on + int dimension; // 2/3 for 2d/3d + int triclinic; // 0 if domain is orthog, 1 if triclinic + int newton_pair; // 0 if newton off for pairwise, 1 if on - int must_check; // 1 if must check other classes to reneigh - int restart_check; // 1 if restart enabled, 0 if no - int fix_check; // # of fixes that induce reneigh - int *fixchecklist; // which fixes to check + int must_check; // 1 if must check other classes to reneigh + int restart_check; // 1 if restart enabled, 0 if no + int fix_check; // # of fixes that induce reneigh + int *fixchecklist; // which fixes to check - double triggersq; // trigger = build when atom moves this dist + double triggersq; // trigger = build when atom moves this dist - double **xhold; // atom coords at last neighbor build - int maxhold; // size of xhold array + double **xhold; // atom coords at last neighbor build + int maxhold; // size of xhold array - int boxcheck; // 1 if need to store box size - double boxlo_hold[3],boxhi_hold[3]; // box size at last neighbor build - double corners_hold[8][3]; // box corners at last neighbor build - double (*corners)[3]; // ptr to 8 corners of triclinic box + int boxcheck; // 1 if need to store box size + double boxlo_hold[3], boxhi_hold[3]; // box size at last neighbor build + double corners_hold[8][3]; // box corners at last neighbor build + double (*corners)[3]; // ptr to 8 corners of triclinic box - double inner[2],middle[2]; // rRESPA cutoffs for extra lists + double inner[2], middle[2]; // rRESPA cutoffs for extra lists - int old_style,old_triclinic; // previous run info - int old_pgsize,old_oneatom; // used to avoid re-creating neigh lists + int old_style, old_triclinic; // previous run info + int old_pgsize, old_oneatom; // used to avoid re-creating neigh lists - int nstencil_perpetual; // # of perpetual NeighStencil classes - int npair_perpetual; // #x of perpetual NeighPair classes - int *slist; // indices of them in neigh_stencil - int *plist; // indices of them in neigh_pair + int nstencil_perpetual; // # of perpetual NeighStencil classes + int npair_perpetual; // #x of perpetual NeighPair classes + int *slist; // indices of them in neigh_stencil + int *plist; // indices of them in neigh_pair - int maxex_type; // max # in exclusion type list - int maxex_group; // max # in exclusion group list - int maxex_mol; // max # in exclusion molecule list + int maxex_type; // max # in exclusion type list + int maxex_group; // max # in exclusion group list + int maxex_mol; // max # in exclusion molecule list - int maxatom; // max size of atom-based NeighList arrays - int maxrequest; // max size of NeighRequest list + int maxatom; // max size of atom-based NeighList arrays + int maxrequest; // max size of NeighRequest list // info for other Neigh classes: NBin,NStencil,NPair,NTopo - int nbin,nstencil; - int nbclass,nsclass,npclass; - int bondwhich,anglewhich,dihedralwhich,improperwhich; + int nbin, nstencil; + int nbclass, nsclass, npclass; + int bondwhich, anglewhich, dihedralwhich, improperwhich; typedef class NBin *(*BinCreator)(class LAMMPS *); BinCreator *binclass; @@ -251,59 +251,59 @@ class Neighbor : protected Pointers { namespace NeighConst { enum { - NB_INTEL = 1<<0, - NB_KOKKOS_DEVICE = 1<<1, - NB_KOKKOS_HOST = 1<<2, - NB_SSA = 1<<3, - NB_STANDARD = 1<<4, - NB_MULTI = 1<<5 + NB_INTEL = 1 << 0, + NB_KOKKOS_DEVICE = 1 << 1, + NB_KOKKOS_HOST = 1 << 2, + NB_SSA = 1 << 3, + NB_STANDARD = 1 << 4, + NB_MULTI = 1 << 5 }; enum { - NS_BIN = 1<<0, - NS_MULTI = 1<<1, - NS_HALF = 1<<2, - NS_FULL = 1<<3, - NS_2D = 1<<4, - NS_3D = 1<<5, - NS_ORTHO = 1<<6, - NS_TRI = 1<<7, - NS_GHOST = 1<<8, - NS_SSA = 1<<9, - NS_MULTI_OLD = 1<<10 + NS_BIN = 1 << 0, + NS_MULTI = 1 << 1, + NS_HALF = 1 << 2, + NS_FULL = 1 << 3, + NS_2D = 1 << 4, + NS_3D = 1 << 5, + NS_ORTHO = 1 << 6, + NS_TRI = 1 << 7, + NS_GHOST = 1 << 8, + NS_SSA = 1 << 9, + NS_MULTI_OLD = 1 << 10 }; enum { - NP_NSQ = 1<<0, - NP_BIN = 1<<1, - NP_MULTI = 1<<2, - NP_HALF = 1<<3, - NP_FULL = 1<<4, - NP_ORTHO = 1<<5, - NP_TRI = 1<<6, - NP_ATOMONLY = 1<<7, - NP_MOLONLY = 1<<8, - NP_NEWTON = 1<<9, - NP_NEWTOFF = 1<<10, - NP_GHOST = 1<<11, - NP_SIZE = 1<<12, - NP_ONESIDE = 1<<13, - NP_RESPA = 1<<14, - NP_BOND = 1<<15, - NP_OMP = 1<<16, - NP_INTEL = 1<<17, - NP_KOKKOS_DEVICE = 1<<18, - NP_KOKKOS_HOST = 1<<19, - NP_SSA = 1<<20, - NP_COPY = 1<<21, - NP_SKIP = 1<<22, - NP_HALF_FULL = 1<<23, - NP_OFF2ON = 1<<24, - NP_MULTI_OLD = 1<<25 + NP_NSQ = 1 << 0, + NP_BIN = 1 << 1, + NP_MULTI = 1 << 2, + NP_HALF = 1 << 3, + NP_FULL = 1 << 4, + NP_ORTHO = 1 << 5, + NP_TRI = 1 << 6, + NP_ATOMONLY = 1 << 7, + NP_MOLONLY = 1 << 8, + NP_NEWTON = 1 << 9, + NP_NEWTOFF = 1 << 10, + NP_GHOST = 1 << 11, + NP_SIZE = 1 << 12, + NP_ONESIDE = 1 << 13, + NP_RESPA = 1 << 14, + NP_BOND = 1 << 15, + NP_OMP = 1 << 16, + NP_INTEL = 1 << 17, + NP_KOKKOS_DEVICE = 1 << 18, + NP_KOKKOS_HOST = 1 << 19, + NP_SSA = 1 << 20, + NP_COPY = 1 << 21, + NP_SKIP = 1 << 22, + NP_HALF_FULL = 1 << 23, + NP_OFF2ON = 1 << 24, + NP_MULTI_OLD = 1 << 25 }; -} +} // namespace NeighConst -} +} // namespace LAMMPS_NS #endif diff --git a/src/npair.cpp b/src/npair.cpp index 1472da512a..24dde8c741 100644 --- a/src/npair.cpp +++ b/src/npair.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair.h b/src/npair.h index 5324eea406..35e08786ef 100644 --- a/src/npair.h +++ b/src/npair.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,12 +20,12 @@ namespace LAMMPS_NS { class NPair : protected Pointers { public: - int istyle; // 1-N index into pairnames - class NBin *nb; // ptr to NBin instance I depend on - class NStencil *ns; // ptr to NStencil instance I depend on - bigint last_build; // last timestep build performed + int istyle; // 1-N index into pairnames + class NBin *nb; // ptr to NBin instance I depend on + class NStencil *ns; // ptr to NStencil instance I depend on + bigint last_build; // last timestep build performed - double cutoff_custom; // cutoff set by requestor + double cutoff_custom; // cutoff set by requestor NPair(class LAMMPS *); virtual ~NPair(); @@ -35,7 +35,7 @@ class NPair : protected Pointers { virtual void build(class NeighList *) = 0; protected: - double **mycutneighsq; // per-type cutoffs when user specified + double **mycutneighsq; // per-type cutoffs when user specified // data from Neighbor class @@ -47,25 +47,25 @@ class NPair : protected Pointers { double cut_inner_sq; double cut_middle_sq; double cut_middle_inside_sq; - double *bboxlo,*bboxhi; + double *bboxlo, *bboxhi; int ncollections; double **cutcollectionsq; // exclusion data from Neighbor class - int nex_type; // # of entries in type exclusion list - int *ex1_type,*ex2_type; // pairs of types to exclude - int **ex_type; // 2d array of excluded type pairs + int nex_type; // # of entries in type exclusion list + int *ex1_type, *ex2_type; // pairs of types to exclude + int **ex_type; // 2d array of excluded type pairs - int nex_group; // # of entries in group exclusion list - int *ex1_group,*ex2_group; // pairs of group #'s to exclude - int *ex1_bit,*ex2_bit; // pairs of group bits to exclude + int nex_group; // # of entries in group exclusion list + int *ex1_group, *ex2_group; // pairs of group #'s to exclude + int *ex1_bit, *ex2_bit; // pairs of group bits to exclude - int nex_mol; // # of entries in molecule exclusion list - int *ex_mol_bit; // molecule group bits to exclude - int *ex_mol_group; // molecule group #'s to exclude - int *ex_mol_intra; // 0 = exclude if in 2 molecules (inter) - // 1 = exclude if in same molecule (intra) + int nex_mol; // # of entries in molecule exclusion list + int *ex_mol_bit; // molecule group bits to exclude + int *ex_mol_group; // molecule group #'s to exclude + int *ex_mol_intra; // 0 = exclude if in 2 molecules (inter) + // 1 = exclude if in same molecule (intra) // special data from Neighbor class @@ -73,12 +73,12 @@ class NPair : protected Pointers { // data from NBin class - int nbinx,nbiny,nbinz; + int nbinx, nbiny, nbinz; int mbins; - int mbinx,mbiny,mbinz; - int mbinxlo,mbinylo,mbinzlo; - double bininvx,bininvy,bininvz; - int *atom2bin,*bins; + int mbinx, mbiny, mbinz; + int mbinxlo, mbinylo, mbinzlo; + double bininvx, bininvy, bininvz; + int *atom2bin, *bins; int *binhead; int *nbinx_multi, *nbiny_multi, *nbinz_multi; @@ -97,8 +97,8 @@ class NPair : protected Pointers { int **stencil_multi_old; double **distsq_multi_old; - int ** nstencil_multi; - int *** stencil_multi; + int **nstencil_multi; + int ***stencil_multi; // data common to all NPair variants @@ -109,13 +109,11 @@ class NPair : protected Pointers { virtual void copy_bin_info(); virtual void copy_stencil_info(); - int exclusion(int, int, int, - int, int *, tagint *) const; // test for pair exclusion - int coord2bin(double *); // mapping atom coord to a bin - int coord2bin(double *, int &, int &, int&); // ditto - - int coord2bin(double *, int); // mapping atom coord to group bin + int exclusion(int, int, int, int, int *, tagint *) const; // test for pair exclusion + int coord2bin(double *); // mapping atom coord to a bin + int coord2bin(double *, int &, int &, int &); // ditto + int coord2bin(double *, int); // mapping atom coord to group bin // find_special: determine if atom j is in special list of atom i // if it is not, return 0 @@ -124,8 +122,8 @@ class NPair : protected Pointers { // if it is and special flag is 2 (otherwise), return 1,2,3 // for which level of neighbor it is (and which coeff it maps to) - inline int find_special(const tagint *list, const int *nspecial, - const tagint tag) const { + inline int find_special(const tagint *list, const int *nspecial, const tagint tag) const + { const int n1 = nspecial[0]; const int n2 = nspecial[1]; const int n3 = nspecial[2]; @@ -133,17 +131,26 @@ class NPair : protected Pointers { for (int i = 0; i < n3; i++) { if (list[i] == tag) { if (i < n1) { - if (special_flag[1] == 0) return -1; - else if (special_flag[1] == 1) return 0; - else return 1; + if (special_flag[1] == 0) + return -1; + else if (special_flag[1] == 1) + return 0; + else + return 1; } else if (i < n2) { - if (special_flag[2] == 0) return -1; - else if (special_flag[2] == 1) return 0; - else return 2; + if (special_flag[2] == 0) + return -1; + else if (special_flag[2] == 1) + return 0; + else + return 2; } else { - if (special_flag[3] == 0) return -1; - else if (special_flag[3] == 1) return 0; - else return 3; + if (special_flag[3] == 0) + return -1; + else if (special_flag[3] == 1) + return 0; + else + return 3; } } } @@ -154,7 +161,7 @@ class NPair : protected Pointers { ExecutionSpace execution_space; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/npair_copy.cpp b/src/npair_copy.cpp index dab7b3ac96..b3cab53e0a 100644 --- a/src/npair_copy.cpp +++ b/src/npair_copy.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_copy.h b/src/npair_copy.h index 2214ad754d..d21b6610bd 100644 --- a/src/npair_copy.h +++ b/src/npair_copy.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(copy, NPairCopy, - NP_COPY) - + NP_COPY); +// clang-format on #else #ifndef LMP_NPAIR_COPY_H @@ -33,7 +33,7 @@ class NPairCopy : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_bin.cpp b/src/npair_full_bin.cpp index 8fc179bc6d..64404ccf8d 100644 --- a/src/npair_full_bin.cpp +++ b/src/npair_full_bin.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_full_bin.h b/src/npair_full_bin.h index f744a9f227..7bc1c11fa9 100644 --- a/src/npair_full_bin.h +++ b/src/npair_full_bin.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/bin, NPairFullBin, NP_FULL | NP_BIN | NP_MOLONLY | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_BIN_H @@ -34,7 +34,7 @@ class NPairFullBin : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_bin_atomonly.cpp b/src/npair_full_bin_atomonly.cpp index 8ace197e30..b8c4378280 100644 --- a/src/npair_full_bin_atomonly.cpp +++ b/src/npair_full_bin_atomonly.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_full_bin_atomonly.h b/src/npair_full_bin_atomonly.h index 6f4e7ce6e2..a348f4f734 100644 --- a/src/npair_full_bin_atomonly.h +++ b/src/npair_full_bin_atomonly.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/bin/atomonly, NPairFullBinAtomonly, NP_FULL | NP_BIN | NP_ATOMONLY | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_BIN_ATOMONLY_H @@ -34,7 +34,7 @@ class NPairFullBinAtomonly : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_bin_ghost.cpp b/src/npair_full_bin_ghost.cpp index 76ad8eba2e..e051a1d75a 100644 --- a/src/npair_full_bin_ghost.cpp +++ b/src/npair_full_bin_ghost.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_full_bin_ghost.h b/src/npair_full_bin_ghost.h index f115875ae0..215ee75703 100644 --- a/src/npair_full_bin_ghost.h +++ b/src/npair_full_bin_ghost.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/bin/ghost, NPairFullBinGhost, NP_FULL | NP_BIN | NP_GHOST | NP_NEWTON | NP_NEWTOFF | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_BIN_GHOST_H @@ -34,7 +34,7 @@ class NPairFullBinGhost : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_multi.cpp b/src/npair_full_multi.cpp index c99d6f7a6b..6a9ba8e700 100644 --- a/src/npair_full_multi.cpp +++ b/src/npair_full_multi.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_full_multi.h b/src/npair_full_multi.h index 0f5079f5e8..4a1aa09fa1 100644 --- a/src/npair_full_multi.h +++ b/src/npair_full_multi.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/multi, NPairFullMulti, - NP_FULL | NP_MULTI | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_FULL | NP_MULTI | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_MULTI_H @@ -33,7 +33,7 @@ class NPairFullMulti : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_multi_old.cpp b/src/npair_full_multi_old.cpp index 5b9b451dbc..7b89f35268 100644 --- a/src/npair_full_multi_old.cpp +++ b/src/npair_full_multi_old.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_full_multi_old.h b/src/npair_full_multi_old.h index 5344a2f010..cd94eb9c9f 100644 --- a/src/npair_full_multi_old.h +++ b/src/npair_full_multi_old.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/multi/old, NPairFullMultiOld, - NP_FULL | NP_MULTI_OLD | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_FULL | NP_MULTI_OLD | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_MULTI_OLD_H @@ -33,7 +33,7 @@ class NPairFullMultiOld : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_nsq.cpp b/src/npair_full_nsq.cpp index f21b512151..c6427366f4 100644 --- a/src/npair_full_nsq.cpp +++ b/src/npair_full_nsq.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_full_nsq.h b/src/npair_full_nsq.h index c6b4fabc83..a3fdc498f1 100644 --- a/src/npair_full_nsq.h +++ b/src/npair_full_nsq.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/nsq, NPairFullNsq, - NP_FULL | NP_NSQ | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_FULL | NP_NSQ | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_NSQ_H @@ -33,7 +33,7 @@ class NPairFullNsq : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_nsq_ghost.cpp b/src/npair_full_nsq_ghost.cpp index a52e21439b..9550ae54f3 100644 --- a/src/npair_full_nsq_ghost.cpp +++ b/src/npair_full_nsq_ghost.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_full_nsq_ghost.h b/src/npair_full_nsq_ghost.h index 16ecb4e0aa..5b5e86fe9f 100644 --- a/src/npair_full_nsq_ghost.h +++ b/src/npair_full_nsq_ghost.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(full/nsq/ghost, NPairFullNsqGhost, NP_FULL | NP_NSQ | NP_GHOST | NP_NEWTON | NP_NEWTOFF | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_FULL_NSQ_GHOST_H @@ -34,7 +34,7 @@ class NPairFullNsqGhost : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_bin_atomonly_newton.cpp b/src/npair_half_bin_atomonly_newton.cpp index 2007bda728..db84d38f6e 100644 --- a/src/npair_half_bin_atomonly_newton.cpp +++ b/src/npair_half_bin_atomonly_newton.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_bin_atomonly_newton.h b/src/npair_half_bin_atomonly_newton.h index 7388fc8674..68c51ebcdb 100644 --- a/src/npair_half_bin_atomonly_newton.h +++ b/src/npair_half_bin_atomonly_newton.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/atomonly/newton, NPairHalfBinAtomonlyNewton, - NP_HALF | NP_BIN | NP_ATOMONLY | NP_NEWTON | NP_ORTHO) - + NP_HALF | NP_BIN | NP_ATOMONLY | NP_NEWTON | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_ATOMONLY_NEWTON_H @@ -33,7 +33,7 @@ class NPairHalfBinAtomonlyNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_bin_newtoff.cpp b/src/npair_half_bin_newtoff.cpp index 680a9c5c22..00318b2aa7 100644 --- a/src/npair_half_bin_newtoff.cpp +++ b/src/npair_half_bin_newtoff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_bin_newtoff.h b/src/npair_half_bin_newtoff.h index ba10094917..fd1b9d6cdf 100644 --- a/src/npair_half_bin_newtoff.h +++ b/src/npair_half_bin_newtoff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/newtoff, NPairHalfBinNewtoff, - NP_HALF | NP_BIN | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_HALF | NP_BIN | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_NEWTOFF_H @@ -33,7 +33,7 @@ class NPairHalfBinNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_bin_newtoff_ghost.cpp b/src/npair_half_bin_newtoff_ghost.cpp index 9a8c28ce11..b85e3328e1 100644 --- a/src/npair_half_bin_newtoff_ghost.cpp +++ b/src/npair_half_bin_newtoff_ghost.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_bin_newtoff_ghost.h b/src/npair_half_bin_newtoff_ghost.h index b0b1e2dd58..1abc3e0c0a 100644 --- a/src/npair_half_bin_newtoff_ghost.h +++ b/src/npair_half_bin_newtoff_ghost.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/newtoff/ghost, NPairHalfBinNewtoffGhost, - NP_HALF | NP_BIN | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI) - + NP_HALF | NP_BIN | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_NEWTOFF_GHOST_H @@ -33,7 +33,7 @@ class NPairHalfBinNewtoffGhost : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_bin_newton.cpp b/src/npair_half_bin_newton.cpp index a59068fe48..d07ebf01f9 100644 --- a/src/npair_half_bin_newton.cpp +++ b/src/npair_half_bin_newton.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_bin_newton.h b/src/npair_half_bin_newton.h index b1bec64e6b..7849aa741f 100644 --- a/src/npair_half_bin_newton.h +++ b/src/npair_half_bin_newton.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/newton, NPairHalfBinNewton, - NP_HALF | NP_BIN | NP_MOLONLY | NP_NEWTON | NP_ORTHO) - + NP_HALF | NP_BIN | NP_MOLONLY | NP_NEWTON | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_NEWTON_H @@ -33,7 +33,7 @@ class NPairHalfBinNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_bin_newton_tri.cpp b/src/npair_half_bin_newton_tri.cpp index 18cc44576a..ef2e48a417 100644 --- a/src/npair_half_bin_newton_tri.cpp +++ b/src/npair_half_bin_newton_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_bin_newton_tri.h b/src/npair_half_bin_newton_tri.h index f1fe9a47f7..d90cf41023 100644 --- a/src/npair_half_bin_newton_tri.h +++ b/src/npair_half_bin_newton_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/bin/newton/tri, NPairHalfBinNewtonTri, - NP_HALF | NP_BIN | NP_NEWTON | NP_TRI) - + NP_HALF | NP_BIN | NP_NEWTON | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_BIN_NEWTON_TRI_H @@ -33,7 +33,7 @@ class NPairHalfBinNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_multi_newtoff.cpp b/src/npair_half_multi_newtoff.cpp index 1efcfe447d..9aa9628fd6 100644 --- a/src/npair_half_multi_newtoff.cpp +++ b/src/npair_half_multi_newtoff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_multi_newtoff.h b/src/npair_half_multi_newtoff.h index 9341e69fb4..4837108667 100644 --- a/src/npair_half_multi_newtoff.h +++ b/src/npair_half_multi_newtoff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/multi/newtoff, NPairHalfMultiNewtoff, - NP_HALF | NP_MULTI | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_HALF | NP_MULTI | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_MULTI_NEWTOFF_H @@ -33,7 +33,7 @@ class NPairHalfMultiNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_multi_newton.cpp b/src/npair_half_multi_newton.cpp index a1a0aa07ca..3b1b34579b 100644 --- a/src/npair_half_multi_newton.cpp +++ b/src/npair_half_multi_newton.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_multi_newton.h b/src/npair_half_multi_newton.h index 628f5afa88..15cf6ee9c8 100644 --- a/src/npair_half_multi_newton.h +++ b/src/npair_half_multi_newton.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/multi/newton, NPairHalfMultiNewton, - NP_HALF | NP_MULTI | NP_NEWTON | NP_ORTHO) - + NP_HALF | NP_MULTI | NP_NEWTON | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_MULTI_NEWTON_H @@ -33,7 +33,7 @@ class NPairHalfMultiNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_multi_newton_tri.cpp b/src/npair_half_multi_newton_tri.cpp index eb01a91f28..4cc88a3755 100644 --- a/src/npair_half_multi_newton_tri.cpp +++ b/src/npair_half_multi_newton_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_multi_newton_tri.h b/src/npair_half_multi_newton_tri.h index daeb4025a5..4c4f920718 100644 --- a/src/npair_half_multi_newton_tri.h +++ b/src/npair_half_multi_newton_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/multi/newton/tri, NPairHalfMultiNewtonTri, - NP_HALF | NP_MULTI | NP_NEWTON | NP_TRI) - + NP_HALF | NP_MULTI | NP_NEWTON | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_MULTI_NEWTON_TRI_H @@ -33,7 +33,7 @@ class NPairHalfMultiNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_multi_old_newtoff.cpp b/src/npair_half_multi_old_newtoff.cpp index 58228a3057..eb6c7d9069 100644 --- a/src/npair_half_multi_old_newtoff.cpp +++ b/src/npair_half_multi_old_newtoff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_multi_old_newtoff.h b/src/npair_half_multi_old_newtoff.h index 58b7b4883d..97d6a7ea69 100644 --- a/src/npair_half_multi_old_newtoff.h +++ b/src/npair_half_multi_old_newtoff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/multi/old/newtoff, NPairHalfMultiOldNewtoff, - NP_HALF | NP_MULTI_OLD | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_HALF | NP_MULTI_OLD | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_MULTI_OLD_NEWTOFF_H @@ -33,7 +33,7 @@ class NPairHalfMultiOldNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_multi_old_newton.cpp b/src/npair_half_multi_old_newton.cpp index 94802ff05d..9708b3e879 100644 --- a/src/npair_half_multi_old_newton.cpp +++ b/src/npair_half_multi_old_newton.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_multi_old_newton.h b/src/npair_half_multi_old_newton.h index 388b2fe69c..c689aea70b 100644 --- a/src/npair_half_multi_old_newton.h +++ b/src/npair_half_multi_old_newton.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/multi/old/newton, NPairHalfMultiOldNewton, - NP_HALF | NP_MULTI_OLD | NP_NEWTON | NP_ORTHO) - + NP_HALF | NP_MULTI_OLD | NP_NEWTON | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_MULTI_OLD_NEWTON_H @@ -33,7 +33,7 @@ class NPairHalfMultiOldNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_multi_old_newton_tri.cpp b/src/npair_half_multi_old_newton_tri.cpp index 1046b897aa..683cc5f53c 100644 --- a/src/npair_half_multi_old_newton_tri.cpp +++ b/src/npair_half_multi_old_newton_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_multi_old_newton_tri.h b/src/npair_half_multi_old_newton_tri.h index 47502ab392..6fc2c49f11 100644 --- a/src/npair_half_multi_old_newton_tri.h +++ b/src/npair_half_multi_old_newton_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/multi/old/newton/tri, NPairHalfMultiOldNewtonTri, - NP_HALF | NP_MULTI_OLD | NP_NEWTON | NP_TRI) - + NP_HALF | NP_MULTI_OLD | NP_NEWTON | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_MULTI_OLD_NEWTON_TRI_H @@ -33,7 +33,7 @@ class NPairHalfMultiOldNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_nsq_newtoff.cpp b/src/npair_half_nsq_newtoff.cpp index 0dc58bbc31..affcdcf39f 100644 --- a/src/npair_half_nsq_newtoff.cpp +++ b/src/npair_half_nsq_newtoff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_nsq_newtoff.h b/src/npair_half_nsq_newtoff.h index 09d177c503..26a50c2f11 100644 --- a/src/npair_half_nsq_newtoff.h +++ b/src/npair_half_nsq_newtoff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/nsq/newtoff, NPairHalfNsqNewtoff, - NP_HALF | NP_NSQ | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_HALF | NP_NSQ | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_NSQ_NEWTOFF_H @@ -33,7 +33,7 @@ class NPairHalfNsqNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_nsq_newtoff_ghost.cpp b/src/npair_half_nsq_newtoff_ghost.cpp index 52769edf6c..eebee1208b 100644 --- a/src/npair_half_nsq_newtoff_ghost.cpp +++ b/src/npair_half_nsq_newtoff_ghost.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_nsq_newtoff_ghost.h b/src/npair_half_nsq_newtoff_ghost.h index 2ccf23e586..034b452540 100644 --- a/src/npair_half_nsq_newtoff_ghost.h +++ b/src/npair_half_nsq_newtoff_ghost.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/nsq/newtoff/ghost, NPairHalfNsqNewtoffGhost, - NP_HALF | NP_NSQ | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI) - + NP_HALF | NP_NSQ | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_NSQ_NEWTOFF_GHOST_H @@ -33,7 +33,7 @@ class NPairHalfNsqNewtoffGhost : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_nsq_newton.cpp b/src/npair_half_nsq_newton.cpp index 5c44b3fa6d..5263903657 100644 --- a/src/npair_half_nsq_newton.cpp +++ b/src/npair_half_nsq_newton.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_nsq_newton.h b/src/npair_half_nsq_newton.h index 82a786b91e..11170cec18 100644 --- a/src/npair_half_nsq_newton.h +++ b/src/npair_half_nsq_newton.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/nsq/newton, NPairHalfNsqNewton, - NP_HALF | NP_NSQ | NP_NEWTON | NP_ORTHO | NP_TRI) - + NP_HALF | NP_NSQ | NP_NEWTON | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_NSQ_NEWTON_H @@ -33,7 +33,7 @@ class NPairHalfNsqNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_respa_bin_newtoff.cpp b/src/npair_half_respa_bin_newtoff.cpp index b6cf3fd6d7..b0fb7cb097 100644 --- a/src/npair_half_respa_bin_newtoff.cpp +++ b/src/npair_half_respa_bin_newtoff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_respa_bin_newtoff.h b/src/npair_half_respa_bin_newtoff.h index afa528ec93..7c8f592645 100644 --- a/src/npair_half_respa_bin_newtoff.h +++ b/src/npair_half_respa_bin_newtoff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/respa/bin/newtoff, NPairHalfRespaBinNewtoff, - NP_HALF | NP_RESPA | NP_BIN | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_HALF | NP_RESPA | NP_BIN | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_RESPA_BIN_NEWTOFF_H @@ -33,7 +33,7 @@ class NPairHalfRespaBinNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_respa_bin_newton.cpp b/src/npair_half_respa_bin_newton.cpp index 4e162d1a3a..0bb6756497 100644 --- a/src/npair_half_respa_bin_newton.cpp +++ b/src/npair_half_respa_bin_newton.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_respa_bin_newton.h b/src/npair_half_respa_bin_newton.h index 43550d5ad6..5483e946a1 100644 --- a/src/npair_half_respa_bin_newton.h +++ b/src/npair_half_respa_bin_newton.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/respa/bin/newton, NPairHalfRespaBinNewton, - NP_HALF | NP_RESPA | NP_BIN | NP_NEWTON | NP_ORTHO) - + NP_HALF | NP_RESPA | NP_BIN | NP_NEWTON | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_RESPA_BIN_NEWTON_H @@ -33,7 +33,7 @@ class NPairHalfRespaBinNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_respa_bin_newton_tri.cpp b/src/npair_half_respa_bin_newton_tri.cpp index d78d8a5630..c6c569d794 100644 --- a/src/npair_half_respa_bin_newton_tri.cpp +++ b/src/npair_half_respa_bin_newton_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_respa_bin_newton_tri.h b/src/npair_half_respa_bin_newton_tri.h index 0a1c6ec48e..a45e89dff1 100644 --- a/src/npair_half_respa_bin_newton_tri.h +++ b/src/npair_half_respa_bin_newton_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/respa/bin/newton/tri, NPairHalfRespaBinNewtonTri, - NP_HALF | NP_RESPA | NP_BIN | NP_NEWTON | NP_TRI) - + NP_HALF | NP_RESPA | NP_BIN | NP_NEWTON | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_RESPA_BIN_NEWTON_TRI_H @@ -33,7 +33,7 @@ class NPairHalfRespaBinNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_respa_nsq_newtoff.cpp b/src/npair_half_respa_nsq_newtoff.cpp index 4bddcbdd42..ff512be7d9 100644 --- a/src/npair_half_respa_nsq_newtoff.cpp +++ b/src/npair_half_respa_nsq_newtoff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_respa_nsq_newtoff.h b/src/npair_half_respa_nsq_newtoff.h index b8667d0e8b..5bdd0f0abe 100644 --- a/src/npair_half_respa_nsq_newtoff.h +++ b/src/npair_half_respa_nsq_newtoff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/respa/nsq/newtoff, NPairHalfRespaNsqNewtoff, - NP_HALF | NP_RESPA | NP_NSQ | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_HALF | NP_RESPA | NP_NSQ | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_RESPA_NSQ_NEWTOFF_H @@ -33,7 +33,7 @@ class NPairHalfRespaNsqNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_respa_nsq_newton.cpp b/src/npair_half_respa_nsq_newton.cpp index cbc58d56de..941ce41159 100644 --- a/src/npair_half_respa_nsq_newton.cpp +++ b/src/npair_half_respa_nsq_newton.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_respa_nsq_newton.h b/src/npair_half_respa_nsq_newton.h index 80d038b565..bfa27fbfef 100644 --- a/src/npair_half_respa_nsq_newton.h +++ b/src/npair_half_respa_nsq_newton.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/respa/nsq/newton, NPairHalfRespaNsqNewton, - NP_HALF | NP_RESPA | NP_NSQ | NP_NEWTON | NP_ORTHO) - + NP_HALF | NP_RESPA | NP_NSQ | NP_NEWTON | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_RESPA_NSQ_NEWTON_H @@ -33,7 +33,7 @@ class NPairHalfRespaNsqNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_bin_newtoff.cpp b/src/npair_half_size_bin_newtoff.cpp index 5b9eee3672..e836503190 100644 --- a/src/npair_half_size_bin_newtoff.cpp +++ b/src/npair_half_size_bin_newtoff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_size_bin_newtoff.h b/src/npair_half_size_bin_newtoff.h index 02d021c4f8..6f2cb2424c 100644 --- a/src/npair_half_size_bin_newtoff.h +++ b/src/npair_half_size_bin_newtoff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/bin/newtoff, NPairHalfSizeBinNewtoff, - NP_HALF | NP_SIZE | NP_BIN | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_HALF | NP_SIZE | NP_BIN | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_BIN_NEWTOFF_H @@ -33,7 +33,7 @@ class NPairHalfSizeBinNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_bin_newton.cpp b/src/npair_half_size_bin_newton.cpp index 9cf4e744ab..b6a786b0cf 100644 --- a/src/npair_half_size_bin_newton.cpp +++ b/src/npair_half_size_bin_newton.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_size_bin_newton.h b/src/npair_half_size_bin_newton.h index 641cb90d39..8023361a29 100644 --- a/src/npair_half_size_bin_newton.h +++ b/src/npair_half_size_bin_newton.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/bin/newton, NPairHalfSizeBinNewton, - NP_HALF | NP_SIZE | NP_BIN | NP_NEWTON | NP_ORTHO) - + NP_HALF | NP_SIZE | NP_BIN | NP_NEWTON | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_BIN_NEWTON_H @@ -33,7 +33,7 @@ class NPairHalfSizeBinNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_bin_newton_tri.cpp b/src/npair_half_size_bin_newton_tri.cpp index 83f903c864..a86feb6f40 100644 --- a/src/npair_half_size_bin_newton_tri.cpp +++ b/src/npair_half_size_bin_newton_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_size_bin_newton_tri.h b/src/npair_half_size_bin_newton_tri.h index e4203f5322..86ce3a2b7d 100644 --- a/src/npair_half_size_bin_newton_tri.h +++ b/src/npair_half_size_bin_newton_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/bin/newton/tri, NPairHalfSizeBinNewtonTri, - NP_HALF | NP_SIZE | NP_BIN | NP_NEWTON | NP_TRI) - + NP_HALF | NP_SIZE | NP_BIN | NP_NEWTON | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_BIN_NEWTON_TRI_H @@ -33,7 +33,7 @@ class NPairHalfSizeBinNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_multi_newtoff.cpp b/src/npair_half_size_multi_newtoff.cpp index ec1f512fc0..f11f8c49cc 100644 --- a/src/npair_half_size_multi_newtoff.cpp +++ b/src/npair_half_size_multi_newtoff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_size_multi_newtoff.h b/src/npair_half_size_multi_newtoff.h index 01b5db4480..ccb395b24b 100644 --- a/src/npair_half_size_multi_newtoff.h +++ b/src/npair_half_size_multi_newtoff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/multi/newtoff, NPairHalfSizeMultiNewtoff, - NP_HALF | NP_SIZE | NP_MULTI | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_HALF | NP_SIZE | NP_MULTI | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_MULTI_NEWTOFF_H @@ -33,7 +33,7 @@ class NPairHalfSizeMultiNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_multi_newton.cpp b/src/npair_half_size_multi_newton.cpp index 95f31e1c52..376bf5f3b4 100644 --- a/src/npair_half_size_multi_newton.cpp +++ b/src/npair_half_size_multi_newton.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_size_multi_newton.h b/src/npair_half_size_multi_newton.h index ad20d2acf3..4584dd9f62 100644 --- a/src/npair_half_size_multi_newton.h +++ b/src/npair_half_size_multi_newton.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/multi/newton, NPairHalfSizeMultiNewton, - NP_HALF | NP_SIZE | NP_MULTI | NP_NEWTON | NP_ORTHO) - + NP_HALF | NP_SIZE | NP_MULTI | NP_NEWTON | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_MULTI_NEWTON_H @@ -33,7 +33,7 @@ class NPairHalfSizeMultiNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_multi_newton_tri.cpp b/src/npair_half_size_multi_newton_tri.cpp index 904321b697..6b96fd4849 100644 --- a/src/npair_half_size_multi_newton_tri.cpp +++ b/src/npair_half_size_multi_newton_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_size_multi_newton_tri.h b/src/npair_half_size_multi_newton_tri.h index bac776627a..789c4c3dac 100644 --- a/src/npair_half_size_multi_newton_tri.h +++ b/src/npair_half_size_multi_newton_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/multi/newton/tri, NPairHalfSizeMultiNewtonTri, - NP_HALF | NP_SIZE | NP_MULTI | NP_NEWTON | NP_TRI) - + NP_HALF | NP_SIZE | NP_MULTI | NP_NEWTON | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_MULTI_NEWTON_TRI_H @@ -33,7 +33,7 @@ class NPairHalfSizeMultiNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_multi_old_newtoff.cpp b/src/npair_half_size_multi_old_newtoff.cpp index 5bc74325ae..26bde10b0e 100644 --- a/src/npair_half_size_multi_old_newtoff.cpp +++ b/src/npair_half_size_multi_old_newtoff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_size_multi_old_newtoff.h b/src/npair_half_size_multi_old_newtoff.h index 2bb9200989..743ef3225d 100644 --- a/src/npair_half_size_multi_old_newtoff.h +++ b/src/npair_half_size_multi_old_newtoff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/multi/old/newtoff, NPairHalfSizeMultiOldNewtoff, - NP_HALF | NP_SIZE | NP_MULTI_OLD | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_HALF | NP_SIZE | NP_MULTI_OLD | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_MULTI_OLD_NEWTOFF_H @@ -33,7 +33,7 @@ class NPairHalfSizeMultiOldNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_multi_old_newton.cpp b/src/npair_half_size_multi_old_newton.cpp index 68d4133d7d..7f63679bc1 100644 --- a/src/npair_half_size_multi_old_newton.cpp +++ b/src/npair_half_size_multi_old_newton.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_size_multi_old_newton.h b/src/npair_half_size_multi_old_newton.h index 86a9bd8f00..749275814e 100644 --- a/src/npair_half_size_multi_old_newton.h +++ b/src/npair_half_size_multi_old_newton.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/multi/old/newton, NPairHalfSizeMultiOldNewton, - NP_HALF | NP_SIZE | NP_MULTI_OLD | NP_NEWTON | NP_ORTHO) - + NP_HALF | NP_SIZE | NP_MULTI_OLD | NP_NEWTON | NP_ORTHO); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_MULTI_OLD_NEWTON_H @@ -33,7 +33,7 @@ class NPairHalfSizeMultiOldNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_multi_old_newton_tri.cpp b/src/npair_half_size_multi_old_newton_tri.cpp index 45576899bc..f71a470479 100644 --- a/src/npair_half_size_multi_old_newton_tri.cpp +++ b/src/npair_half_size_multi_old_newton_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_size_multi_old_newton_tri.h b/src/npair_half_size_multi_old_newton_tri.h index ee899a52fd..e4099e655f 100644 --- a/src/npair_half_size_multi_old_newton_tri.h +++ b/src/npair_half_size_multi_old_newton_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/multi/old/newton/tri, NPairHalfSizeMultiOldNewtonTri, - NP_HALF | NP_SIZE | NP_MULTI_OLD | NP_NEWTON | NP_TRI) - + NP_HALF | NP_SIZE | NP_MULTI_OLD | NP_NEWTON | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_MULTI_OLD_NEWTON_TRI_H @@ -33,7 +33,7 @@ class NPairHalfSizeMultiOldNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_nsq_newtoff.cpp b/src/npair_half_size_nsq_newtoff.cpp index 79302042a6..e8eac6f54b 100644 --- a/src/npair_half_size_nsq_newtoff.cpp +++ b/src/npair_half_size_nsq_newtoff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_size_nsq_newtoff.h b/src/npair_half_size_nsq_newtoff.h index 1c94c2d22a..dbfdadd5a8 100644 --- a/src/npair_half_size_nsq_newtoff.h +++ b/src/npair_half_size_nsq_newtoff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/nsq/newtoff, NPairHalfSizeNsqNewtoff, - NP_HALF | NP_SIZE | NP_NSQ | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_HALF | NP_SIZE | NP_NSQ | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_NSQ_NEWTOFF_H @@ -33,7 +33,7 @@ class NPairHalfSizeNsqNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_nsq_newton.cpp b/src/npair_half_size_nsq_newton.cpp index 1ac6223afa..7f90596755 100644 --- a/src/npair_half_size_nsq_newton.cpp +++ b/src/npair_half_size_nsq_newton.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_half_size_nsq_newton.h b/src/npair_half_size_nsq_newton.h index 87869d976b..f3e6e7cdf8 100644 --- a/src/npair_half_size_nsq_newton.h +++ b/src/npair_half_size_nsq_newton.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(half/size/nsq/newton, NPairHalfSizeNsqNewton, - NP_HALF | NP_SIZE | NP_NSQ | NP_NEWTON | NP_ORTHO | NP_TRI) - + NP_HALF | NP_SIZE | NP_NSQ | NP_NEWTON | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_HALF_SIZE_NSQ_NEWTON_H @@ -33,7 +33,7 @@ class NPairHalfSizeNsqNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_halffull_newtoff.cpp b/src/npair_halffull_newtoff.cpp index 52f981e843..475325c2f0 100644 --- a/src/npair_halffull_newtoff.cpp +++ b/src/npair_halffull_newtoff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_halffull_newtoff.h b/src/npair_halffull_newtoff.h index 5126ced648..7662ee42fc 100644 --- a/src/npair_halffull_newtoff.h +++ b/src/npair_halffull_newtoff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,27 +12,27 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(halffull/newtoff, NPairHalffullNewtoff, NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | NP_HALF | - NP_ORTHO | NP_TRI) + NP_ORTHO | NP_TRI); NPairStyle(halffull/newtoff/skip, NPairHalffullNewtoff, NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | NP_HALF | - NP_ORTHO | NP_TRI | NP_SKIP) + NP_ORTHO | NP_TRI | NP_SKIP); NPairStyle(halffull/newtoff/ghost, NPairHalffullNewtoff, NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | NP_HALF | - NP_ORTHO | NP_TRI | NP_GHOST) + NP_ORTHO | NP_TRI | NP_GHOST); NPairStyle(halffull/newtoff/skip/ghost, NPairHalffullNewtoff, NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | NP_HALF | - NP_ORTHO | NP_TRI | NP_SKIP | NP_GHOST) - + NP_ORTHO | NP_TRI | NP_SKIP | NP_GHOST); +// clang-format on #else #ifndef LMP_NPAIR_HALFFULL_NEWTOFF_H @@ -49,7 +49,7 @@ class NPairHalffullNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_halffull_newton.cpp b/src/npair_halffull_newton.cpp index cf15af8f18..d9ba02d5b0 100644 --- a/src/npair_halffull_newton.cpp +++ b/src/npair_halffull_newton.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_halffull_newton.h b/src/npair_halffull_newton.h index cd7cd99d66..0dfe220972 100644 --- a/src/npair_halffull_newton.h +++ b/src/npair_halffull_newton.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,17 +12,17 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(halffull/newton, NPairHalffullNewton, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_ORTHO | NP_TRI) + NP_ORTHO | NP_TRI); NPairStyle(halffull/newton/skip, NPairHalffullNewton, NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_ORTHO | NP_TRI | NP_SKIP) - + NP_ORTHO | NP_TRI | NP_SKIP); +// clang-format on #else #ifndef LMP_NPAIR_HALFFULL_NEWTON_H @@ -39,7 +39,7 @@ class NPairHalffullNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_skip.cpp b/src/npair_skip.cpp index 6046464ecf..4ef0573dbb 100644 --- a/src/npair_skip.cpp +++ b/src/npair_skip.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_skip.h b/src/npair_skip.h index 1aece9cffd..5827d8a856 100644 --- a/src/npair_skip.h +++ b/src/npair_skip.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,19 +12,19 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(skip, NPairSkip, NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); NPairStyle(skip/ghost, NPairSkip, NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_GHOST) - + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_GHOST); +// clang-format on #else #ifndef LMP_NPAIR_SKIP_H @@ -41,7 +41,7 @@ class NPairSkip : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_skip_respa.cpp b/src/npair_skip_respa.cpp index d24a30794e..373fe3f8db 100644 --- a/src/npair_skip_respa.cpp +++ b/src/npair_skip_respa.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_skip_respa.h b/src/npair_skip_respa.h index 6414211c3f..64b3f7c7da 100644 --- a/src/npair_skip_respa.h +++ b/src/npair_skip_respa.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,13 +12,13 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(skip/half/respa, NPairSkipRespa, NP_SKIP | NP_RESPA | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_SKIP_RESPA_H @@ -35,7 +35,7 @@ class NPairSkipRespa : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_skip_size.cpp b/src/npair_skip_size.cpp index 40b70aed21..f4fe760e08 100644 --- a/src/npair_skip_size.cpp +++ b/src/npair_skip_size.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_skip_size.h b/src/npair_skip_size.h index 7ecabfc5b3..0864b568a1 100644 --- a/src/npair_skip_size.h +++ b/src/npair_skip_size.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(skip/half/size, NPairSkipSize, NP_SKIP | NP_SIZE | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_SKIP_SIZE_H @@ -34,7 +34,7 @@ class NPairSkipSize : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_skip_size_off2on.cpp b/src/npair_skip_size_off2on.cpp index 994910852b..e48ca345ff 100644 --- a/src/npair_skip_size_off2on.cpp +++ b/src/npair_skip_size_off2on.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_skip_size_off2on.h b/src/npair_skip_size_off2on.h index bd3b428dfe..a0205a3865 100644 --- a/src/npair_skip_size_off2on.h +++ b/src/npair_skip_size_off2on.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,13 +12,13 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(skip/size/off2on, NPairSkipSizeOff2on, NP_SKIP | NP_SIZE | NP_OFF2ON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | - NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) - + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_SKIP_SIZE_OFF2ON_H @@ -35,7 +35,7 @@ class NPairSkipSizeOff2on : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_skip_size_off2on_oneside.cpp b/src/npair_skip_size_off2on_oneside.cpp index 30ee2ff6ba..1e4b4ac78d 100644 --- a/src/npair_skip_size_off2on_oneside.cpp +++ b/src/npair_skip_size_off2on_oneside.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/npair_skip_size_off2on_oneside.h b/src/npair_skip_size_off2on_oneside.h index 5a95b95fae..2c3ec6f4ca 100644 --- a/src/npair_skip_size_off2on_oneside.h +++ b/src/npair_skip_size_off2on_oneside.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,13 +12,13 @@ ------------------------------------------------------------------------- */ #ifdef NPAIR_CLASS - +// clang-format off NPairStyle(skip/size/off2on/oneside, NPairSkipSizeOff2onOneside, NP_SKIP | NP_SIZE | NP_OFF2ON | NP_ONESIDE | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_MULTI_OLD | NP_NEWTON | NP_NEWTOFF | - NP_ORTHO | NP_TRI) - + NP_ORTHO | NP_TRI); +// clang-format on #else #ifndef LMP_NPAIR_SKIP_SIZE_OFF2ON_ONESIDE_H @@ -35,7 +35,7 @@ class NPairSkipSizeOff2onOneside : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil.cpp b/src/nstencil.cpp index c412c280ef..3d1f71a890 100644 --- a/src/nstencil.cpp +++ b/src/nstencil.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil.h b/src/nstencil.h index 821f9a7e55..d8febe356b 100644 --- a/src/nstencil.h +++ b/src/nstencil.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,32 +20,32 @@ namespace LAMMPS_NS { class NStencil : protected Pointers { public: - int istyle; // 1-N index into binnames - class NBin *nb; // ptr to NBin instance I depend on - bigint last_stencil; // last timestep stencil was created + int istyle; // 1-N index into binnames + class NBin *nb; // ptr to NBin instance I depend on + bigint last_stencil; // last timestep stencil was created - int nstencil; // # of bins in stencil - int *stencil; // list of bin offsets - int **stencilxyz; // bin offsets in xyz dims - int *nstencil_multi_old; // # bins in each type-based old multi stencil - int **stencil_multi_old; // list of bin offsets in each stencil - double **distsq_multi_old; // sq distances to bins in each stencil - int ** nstencil_multi; // # bins bins in each igroup-jgroup multi stencil - int *** stencil_multi; // list of bin offsets in each multi stencil - int ** maxstencil_multi; // max stencil size for each multi stencil - int maxcollections; // size of multi arrays + int nstencil; // # of bins in stencil + int *stencil; // list of bin offsets + int **stencilxyz; // bin offsets in xyz dims + int *nstencil_multi_old; // # bins in each type-based old multi stencil + int **stencil_multi_old; // list of bin offsets in each stencil + double **distsq_multi_old; // sq distances to bins in each stencil + int **nstencil_multi; // # bins bins in each igroup-jgroup multi stencil + int ***stencil_multi; // list of bin offsets in each multi stencil + int **maxstencil_multi; // max stencil size for each multi stencil + int maxcollections; // size of multi arrays - int sx,sy,sz; // extent of stencil in each dim - int **stencil_sx_multi; // analogs for each multi stencil + int sx, sy, sz; // extent of stencil in each dim + int **stencil_sx_multi; // analogs for each multi stencil int **stencil_sy_multi; int **stencil_sz_multi; - double cutoff_custom; // cutoff set by requestor + double cutoff_custom; // cutoff set by requestor // Arrays to store options for multi itype-jtype stencils - bool **flag_half_multi; // flag creation of a half stencil for icollection-jcollection - bool **flag_skip_multi; // skip creation of icollection-jcollection stencils (for newton on) - int **bin_collection_multi; // what collection to use for bin information + bool **flag_half_multi; // flag creation of a half stencil for icollection-jcollection + bool **flag_skip_multi; // skip creation of icollection-jcollection stencils (for newton on) + int **bin_collection_multi; // what collection to use for bin information NStencil(class LAMMPS *); virtual ~NStencil(); @@ -56,10 +56,9 @@ class NStencil : protected Pointers { virtual void create() = 0; - inline int get_maxstencil() {return maxstencil;} + inline int get_maxstencil() { return maxstencil; } protected: - // data from Neighbor class int neighstyle; @@ -73,9 +72,9 @@ class NStencil : protected Pointers { // data from NBin class - int mbinx,mbiny,mbinz; - double binsizex,binsizey,binsizez; - double bininvx,bininvy,bininvz; + int mbinx, mbiny, mbinz; + double binsizex, binsizey, binsizez; + double bininvx, bininvy, bininvz; // data from NBin class for multi @@ -100,25 +99,26 @@ class NStencil : protected Pointers { // data common to all NStencil variants - int xyzflag; // 1 if stencilxyz is allocated - int maxstencil; // max size of stencil - int maxstencil_multi_old; // max sizes of stencils + int xyzflag; // 1 if stencilxyz is allocated + int maxstencil; // max size of stencil + int maxstencil_multi_old; // max sizes of stencils int dimension; // methods for standard NStencil variants - void copy_bin_info(); // copy info from NBin class - double bin_distance(int, int, int); // distance between bin corners + void copy_bin_info(); // copy info from NBin class + double bin_distance(int, int, int); // distance between bin corners // methods for multi NStencil - double bin_distance_multi(int, int, int, int); // distance between bin corners for different collections - void copy_bin_info_multi(); // copy multi info from NBin class - virtual void set_stencil_properties(){} // determine which stencils to build and how + double bin_distance_multi(int, int, int, + int); // distance between bin corners for different collections + void copy_bin_info_multi(); // copy multi info from NBin class + virtual void set_stencil_properties() {} // determine which stencils to build and how }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/nstencil_full_bin_2d.cpp b/src/nstencil_full_bin_2d.cpp index 73e48c6b2f..ba4ca97ed6 100644 --- a/src/nstencil_full_bin_2d.cpp +++ b/src/nstencil_full_bin_2d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_full_bin_2d.h b/src/nstencil_full_bin_2d.h index 9e6678f1cb..fa691bba89 100644 --- a/src/nstencil_full_bin_2d.h +++ b/src/nstencil_full_bin_2d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(full/bin/2d, NStencilFullBin2d, - NS_FULL | NS_BIN | NS_2D | NS_ORTHO | NS_TRI) - + NS_FULL | NS_BIN | NS_2D | NS_ORTHO | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_FULL_BIN_2D_H @@ -33,7 +33,7 @@ class NStencilFullBin2d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_bin_3d.cpp b/src/nstencil_full_bin_3d.cpp index 1af207c18a..8aa593eb0b 100644 --- a/src/nstencil_full_bin_3d.cpp +++ b/src/nstencil_full_bin_3d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_full_bin_3d.h b/src/nstencil_full_bin_3d.h index 9e61976462..8753d10ed2 100644 --- a/src/nstencil_full_bin_3d.h +++ b/src/nstencil_full_bin_3d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(full/bin/3d, NStencilFullBin3d, - NS_FULL | NS_BIN | NS_3D | NS_ORTHO | NS_TRI) - + NS_FULL | NS_BIN | NS_3D | NS_ORTHO | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_FULL_BIN_3D_H @@ -33,7 +33,7 @@ class NStencilFullBin3d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_ghost_bin_2d.cpp b/src/nstencil_full_ghost_bin_2d.cpp index 9fb93e4b92..b5a6bac56c 100644 --- a/src/nstencil_full_ghost_bin_2d.cpp +++ b/src/nstencil_full_ghost_bin_2d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_full_ghost_bin_2d.h b/src/nstencil_full_ghost_bin_2d.h index adfbaab39c..4a69f8accd 100644 --- a/src/nstencil_full_ghost_bin_2d.h +++ b/src/nstencil_full_ghost_bin_2d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(full/ghost/bin/2d, NStencilFullGhostBin2d, - NS_FULL | NS_GHOST | NS_BIN | NS_2D | NS_ORTHO | NS_TRI) - + NS_FULL | NS_GHOST | NS_BIN | NS_2D | NS_ORTHO | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_FULL_GHOST_BIN_2D_H @@ -33,7 +33,7 @@ class NStencilFullGhostBin2d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_ghost_bin_3d.cpp b/src/nstencil_full_ghost_bin_3d.cpp index 583b7c981a..2023495c34 100644 --- a/src/nstencil_full_ghost_bin_3d.cpp +++ b/src/nstencil_full_ghost_bin_3d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_full_ghost_bin_3d.h b/src/nstencil_full_ghost_bin_3d.h index 675ba8d567..829bece6d0 100644 --- a/src/nstencil_full_ghost_bin_3d.h +++ b/src/nstencil_full_ghost_bin_3d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(full/ghost/bin/3d, NStencilFullGhostBin3d, - NS_FULL | NS_GHOST | NS_BIN | NS_3D | NS_ORTHO | NS_TRI) - + NS_FULL | NS_GHOST | NS_BIN | NS_3D | NS_ORTHO | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_FULL_GHOST_BIN_3D_H @@ -33,7 +33,7 @@ class NStencilFullGhostBin3d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_multi_2d.cpp b/src/nstencil_full_multi_2d.cpp index ae7bcad52e..7899ce7ad1 100644 --- a/src/nstencil_full_multi_2d.cpp +++ b/src/nstencil_full_multi_2d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_full_multi_2d.h b/src/nstencil_full_multi_2d.h index ba6cd22a39..cc50314f93 100644 --- a/src/nstencil_full_multi_2d.h +++ b/src/nstencil_full_multi_2d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(full/multi/2d, - NStencilFullMulti2d, NS_FULL | NS_MULTI | NS_2D | NS_ORTHO | NS_TRI) - + NStencilFullMulti2d, NS_FULL | NS_MULTI | NS_2D | NS_ORTHO | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_FULL_MULTI_2D_H @@ -33,10 +33,9 @@ class NStencilFullMulti2d : public NStencil { protected: void set_stencil_properties(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_multi_3d.cpp b/src/nstencil_full_multi_3d.cpp index 7bdf9561f1..746906bf47 100644 --- a/src/nstencil_full_multi_3d.cpp +++ b/src/nstencil_full_multi_3d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_full_multi_3d.h b/src/nstencil_full_multi_3d.h index d02a8b3588..ba80d602ab 100644 --- a/src/nstencil_full_multi_3d.h +++ b/src/nstencil_full_multi_3d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(full/multi/3d, - NStencilFullMulti3d, NS_FULL | NS_MULTI | NS_3D | NS_ORTHO | NS_TRI) - + NStencilFullMulti3d, NS_FULL | NS_MULTI | NS_3D | NS_ORTHO | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_FULL_MULTI_3D_H @@ -28,15 +28,14 @@ namespace LAMMPS_NS { class NStencilFullMulti3d : public NStencil { public: NStencilFullMulti3d(class LAMMPS *); - ~NStencilFullMulti3d(){} + ~NStencilFullMulti3d() {} void create(); protected: void set_stencil_properties(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_multi_old_2d.cpp b/src/nstencil_full_multi_old_2d.cpp index ec2dba322e..d653e1080e 100644 --- a/src/nstencil_full_multi_old_2d.cpp +++ b/src/nstencil_full_multi_old_2d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_full_multi_old_2d.h b/src/nstencil_full_multi_old_2d.h index 69829f47f1..1929fa09e5 100644 --- a/src/nstencil_full_multi_old_2d.h +++ b/src/nstencil_full_multi_old_2d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(full/multi/old/2d, NStencilFullMultiOld2d, - NS_FULL | NS_MULTI_OLD | NS_2D | NS_ORTHO | NS_TRI) - + NS_FULL | NS_MULTI_OLD | NS_2D | NS_ORTHO | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_FULL_MULTI_OLD_2D_H @@ -33,7 +33,7 @@ class NStencilFullMultiOld2d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_multi_old_3d.cpp b/src/nstencil_full_multi_old_3d.cpp index 2bfd962261..849ee5a9f9 100644 --- a/src/nstencil_full_multi_old_3d.cpp +++ b/src/nstencil_full_multi_old_3d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_full_multi_old_3d.h b/src/nstencil_full_multi_old_3d.h index 9c760682d0..33d4166251 100644 --- a/src/nstencil_full_multi_old_3d.h +++ b/src/nstencil_full_multi_old_3d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(full/multi/old/3d, NStencilFullMultiOld3d, - NS_FULL | NS_MULTI_OLD | NS_3D | NS_ORTHO | NS_TRI) - + NS_FULL | NS_MULTI_OLD | NS_3D | NS_ORTHO | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_FULL_MULTI_OLD_3D_H @@ -33,7 +33,7 @@ class NStencilFullMultiOld3d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_bin_2d.cpp b/src/nstencil_half_bin_2d.cpp index e74e26e89b..004d6a8016 100644 --- a/src/nstencil_half_bin_2d.cpp +++ b/src/nstencil_half_bin_2d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_half_bin_2d.h b/src/nstencil_half_bin_2d.h index fe5f4cf2da..c7e07e1472 100644 --- a/src/nstencil_half_bin_2d.h +++ b/src/nstencil_half_bin_2d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/bin/2d, NStencilHalfBin2d, - NS_HALF | NS_BIN | NS_2D | NS_ORTHO) - + NS_HALF | NS_BIN | NS_2D | NS_ORTHO); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_BIN_2D_H @@ -33,7 +33,7 @@ class NStencilHalfBin2d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_bin_2d_tri.cpp b/src/nstencil_half_bin_2d_tri.cpp index 914a0f4f3d..9f5ace1ed1 100644 --- a/src/nstencil_half_bin_2d_tri.cpp +++ b/src/nstencil_half_bin_2d_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_half_bin_2d_tri.h b/src/nstencil_half_bin_2d_tri.h index 1826e8807c..9d980a5ed6 100644 --- a/src/nstencil_half_bin_2d_tri.h +++ b/src/nstencil_half_bin_2d_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/bin/2d/tri, NStencilHalfBin2dTri, - NS_HALF | NS_BIN | NS_2D | NS_TRI) - + NS_HALF | NS_BIN | NS_2D | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_BIN_2D_TRI_H @@ -33,7 +33,7 @@ class NStencilHalfBin2dTri : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_bin_3d.cpp b/src/nstencil_half_bin_3d.cpp index 227a3af163..a8cacdb601 100644 --- a/src/nstencil_half_bin_3d.cpp +++ b/src/nstencil_half_bin_3d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_half_bin_3d.h b/src/nstencil_half_bin_3d.h index ae0f0d89f1..10d4eaa44b 100644 --- a/src/nstencil_half_bin_3d.h +++ b/src/nstencil_half_bin_3d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/bin/3d, NStencilHalfBin3d, - NS_HALF | NS_BIN | NS_3D | NS_ORTHO) - + NS_HALF | NS_BIN | NS_3D | NS_ORTHO); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_BIN_3D_H @@ -33,7 +33,7 @@ class NStencilHalfBin3d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_bin_3d_tri.cpp b/src/nstencil_half_bin_3d_tri.cpp index 9f2002e0a8..8d1920ae8c 100644 --- a/src/nstencil_half_bin_3d_tri.cpp +++ b/src/nstencil_half_bin_3d_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_half_bin_3d_tri.h b/src/nstencil_half_bin_3d_tri.h index 324182ed73..33158f32ae 100644 --- a/src/nstencil_half_bin_3d_tri.h +++ b/src/nstencil_half_bin_3d_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/bin/3d/tri, NStencilHalfBin3dTri, - NS_HALF | NS_BIN | NS_3D | NS_TRI) - + NS_HALF | NS_BIN | NS_3D | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_BIN_3D_TRI_H @@ -33,7 +33,7 @@ class NStencilHalfBin3dTri : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_2d.cpp b/src/nstencil_half_multi_2d.cpp index 6754ddb658..3428388ef1 100644 --- a/src/nstencil_half_multi_2d.cpp +++ b/src/nstencil_half_multi_2d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_half_multi_2d.h b/src/nstencil_half_multi_2d.h index 1e10e50411..be98e0a027 100644 --- a/src/nstencil_half_multi_2d.h +++ b/src/nstencil_half_multi_2d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/multi/2d, - NStencilHalfMulti2d, NS_HALF | NS_MULTI | NS_2D | NS_ORTHO) - + NStencilHalfMulti2d, NS_HALF | NS_MULTI | NS_2D | NS_ORTHO); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_MULTI_2D_H @@ -33,10 +33,9 @@ class NStencilHalfMulti2d : public NStencil { protected: void set_stencil_properties(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_2d_tri.cpp b/src/nstencil_half_multi_2d_tri.cpp index cd215ee384..5b647902fb 100644 --- a/src/nstencil_half_multi_2d_tri.cpp +++ b/src/nstencil_half_multi_2d_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_half_multi_2d_tri.h b/src/nstencil_half_multi_2d_tri.h index d04424478a..0404b8195b 100644 --- a/src/nstencil_half_multi_2d_tri.h +++ b/src/nstencil_half_multi_2d_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/multi/2d/tri, - NStencilHalfMulti2dTri, NS_HALF | NS_MULTI | NS_2D | NS_TRI) - + NStencilHalfMulti2dTri, NS_HALF | NS_MULTI | NS_2D | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_MULTI_2D_TRI_H @@ -35,7 +35,7 @@ class NStencilHalfMulti2dTri : public NStencil { void set_stencil_properties(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_3d.cpp b/src/nstencil_half_multi_3d.cpp index 6e60c34343..3623fd14ea 100644 --- a/src/nstencil_half_multi_3d.cpp +++ b/src/nstencil_half_multi_3d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_half_multi_3d.h b/src/nstencil_half_multi_3d.h index b86d7a3ad8..020bf1310f 100644 --- a/src/nstencil_half_multi_3d.h +++ b/src/nstencil_half_multi_3d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/multi/3d, - NStencilHalfMulti3d, NS_HALF | NS_MULTI | NS_3D | NS_ORTHO) - + NStencilHalfMulti3d, NS_HALF | NS_MULTI | NS_3D | NS_ORTHO); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_MULTI_3D_H @@ -33,10 +33,9 @@ class NStencilHalfMulti3d : public NStencil { protected: void set_stencil_properties(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_3d_tri.cpp b/src/nstencil_half_multi_3d_tri.cpp index 632ca5f0ed..9a680cf610 100644 --- a/src/nstencil_half_multi_3d_tri.cpp +++ b/src/nstencil_half_multi_3d_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_half_multi_3d_tri.h b/src/nstencil_half_multi_3d_tri.h index 59e66a0530..1e3058d50c 100644 --- a/src/nstencil_half_multi_3d_tri.h +++ b/src/nstencil_half_multi_3d_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/multi/3d/tri, - NStencilHalfMulti3dTri, NS_HALF | NS_MULTI | NS_3D | NS_TRI) - + NStencilHalfMulti3dTri, NS_HALF | NS_MULTI | NS_3D | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_MULTI_3D_TRI_H @@ -35,7 +35,7 @@ class NStencilHalfMulti3dTri : public NStencil { void set_stencil_properties(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_old_2d.cpp b/src/nstencil_half_multi_old_2d.cpp index 18efc14703..7a2f5a25e2 100644 --- a/src/nstencil_half_multi_old_2d.cpp +++ b/src/nstencil_half_multi_old_2d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_half_multi_old_2d.h b/src/nstencil_half_multi_old_2d.h index c64e805ca1..8d16b1a8f2 100644 --- a/src/nstencil_half_multi_old_2d.h +++ b/src/nstencil_half_multi_old_2d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/multi/old/2d, - NStencilHalfMultiOld2d, NS_HALF | NS_MULTI_OLD | NS_2D | NS_ORTHO) - + NStencilHalfMultiOld2d, NS_HALF | NS_MULTI_OLD | NS_2D | NS_ORTHO); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_MULTI_OLD_2D_H @@ -32,7 +32,7 @@ class NStencilHalfMultiOld2d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_old_2d_tri.cpp b/src/nstencil_half_multi_old_2d_tri.cpp index 24056c2ada..7e5158cc31 100644 --- a/src/nstencil_half_multi_old_2d_tri.cpp +++ b/src/nstencil_half_multi_old_2d_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_half_multi_old_2d_tri.h b/src/nstencil_half_multi_old_2d_tri.h index 23765b9167..72f9e41083 100644 --- a/src/nstencil_half_multi_old_2d_tri.h +++ b/src/nstencil_half_multi_old_2d_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/multi/old/2d/tri, - NStencilHalfMultiOld2dTri, NS_HALF | NS_MULTI_OLD | NS_2D | NS_TRI) - + NStencilHalfMultiOld2dTri, NS_HALF | NS_MULTI_OLD | NS_2D | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_MULTI_OLD_2D_TRI_H @@ -32,7 +32,7 @@ class NStencilHalfMultiOld2dTri : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_old_3d.cpp b/src/nstencil_half_multi_old_3d.cpp index ebdd09674d..cdb22c2d13 100644 --- a/src/nstencil_half_multi_old_3d.cpp +++ b/src/nstencil_half_multi_old_3d.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_half_multi_old_3d.h b/src/nstencil_half_multi_old_3d.h index 1c49216f82..7b050f3538 100644 --- a/src/nstencil_half_multi_old_3d.h +++ b/src/nstencil_half_multi_old_3d.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/multi_old/3d, - NStencilHalfMultiOld3d, NS_HALF | NS_MULTI_OLD | NS_3D | NS_ORTHO) - + NStencilHalfMultiOld3d, NS_HALF | NS_MULTI_OLD | NS_3D | NS_ORTHO); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_MULTI_OLD_3D_H @@ -32,7 +32,7 @@ class NStencilHalfMultiOld3d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_old_3d_tri.cpp b/src/nstencil_half_multi_old_3d_tri.cpp index 27dd320c6b..6fb9b6d3d1 100644 --- a/src/nstencil_half_multi_old_3d_tri.cpp +++ b/src/nstencil_half_multi_old_3d_tri.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/nstencil_half_multi_old_3d_tri.h b/src/nstencil_half_multi_old_3d_tri.h index d365f28e56..3ab71b5c61 100644 --- a/src/nstencil_half_multi_old_3d_tri.h +++ b/src/nstencil_half_multi_old_3d_tri.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef NSTENCIL_CLASS - +// clang-format off NStencilStyle(half/multi/old/3d/tri, - NStencilHalfMultiOld3dTri, NS_HALF | NS_MULTI_OLD | NS_3D | NS_TRI) - + NStencilHalfMultiOld3dTri, NS_HALF | NS_MULTI_OLD | NS_3D | NS_TRI); +// clang-format on #else #ifndef LMP_NSTENCIL_HALF_MULTI_OLD_3D_TRI_H @@ -32,7 +32,7 @@ class NStencilHalfMultiOld3dTri : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo.cpp b/src/ntopo.cpp index 78b7cca1b0..68b251be0f 100644 --- a/src/ntopo.cpp +++ b/src/ntopo.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo.h b/src/ntopo.h index 8a1899d810..9d8fe988fb 100644 --- a/src/ntopo.h +++ b/src/ntopo.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,8 +20,8 @@ namespace LAMMPS_NS { class NTopo : protected Pointers { public: - int nbondlist,nanglelist,ndihedrallist,nimproperlist; - int **bondlist,**anglelist,**dihedrallist,**improperlist; + int nbondlist, nanglelist, ndihedrallist, nimproperlist; + int **bondlist, **anglelist, **dihedrallist, **improperlist; NTopo(class LAMMPS *); virtual ~NTopo(); @@ -31,9 +31,9 @@ class NTopo : protected Pointers { double memory_usage(); protected: - int me,nprocs; - int maxbond,maxangle,maxdihedral,maximproper; - int cluster_check; // copy from Neighbor + int me, nprocs; + int maxbond, maxangle, maxdihedral, maximproper; + int cluster_check; // copy from Neighbor void allocate_bond(); void allocate_angle(); @@ -45,7 +45,7 @@ class NTopo : protected Pointers { void dihedral_check(int, int **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/ntopo_angle_all.cpp b/src/ntopo_angle_all.cpp index c8187c0469..915cbb5cb3 100644 --- a/src/ntopo_angle_all.cpp +++ b/src/ntopo_angle_all.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo_angle_all.h b/src/ntopo_angle_all.h index 6962e41c0c..ec8d08dd1c 100644 --- a/src/ntopo_angle_all.h +++ b/src/ntopo_angle_all.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef NTOPO_CLASS - -NTopoStyle(NTOPO_ANGLE_ALL,NTopoAngleAll) - +// clang-format off +NTopoStyle(NTOPO_ANGLE_ALL,NTopoAngleAll); +// clang-format on #else #ifndef LMP_TOPO_ANGLE_ALL_H @@ -31,7 +31,7 @@ class NTopoAngleAll : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_angle_partial.cpp b/src/ntopo_angle_partial.cpp index 1dea896758..5a09d15909 100644 --- a/src/ntopo_angle_partial.cpp +++ b/src/ntopo_angle_partial.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo_angle_partial.h b/src/ntopo_angle_partial.h index 5b5e3a8552..ee29a9dd98 100644 --- a/src/ntopo_angle_partial.h +++ b/src/ntopo_angle_partial.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef NTOPO_CLASS - -NTopoStyle(NTOPO_ANGLE_PARTIAL,NTopoAnglePartial) - +// clang-format off +NTopoStyle(NTOPO_ANGLE_PARTIAL,NTopoAnglePartial); +// clang-format on #else #ifndef LMP_TOPO_ANGLE_PARTIAL_H @@ -31,7 +31,7 @@ class NTopoAnglePartial : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_angle_template.cpp b/src/ntopo_angle_template.cpp index ede8c398dc..ff0b499c9e 100644 --- a/src/ntopo_angle_template.cpp +++ b/src/ntopo_angle_template.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo_angle_template.h b/src/ntopo_angle_template.h index 52ea9ff429..cfd48b0450 100644 --- a/src/ntopo_angle_template.h +++ b/src/ntopo_angle_template.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef NTOPO_CLASS - -NTopoStyle(NTOPO_ANGLE_TEMPLATE,NTopoAngleTemplate) - +// clang-format off +NTopoStyle(NTOPO_ANGLE_TEMPLATE,NTopoAngleTemplate); +// clang-format on #else #ifndef LMP_TOPO_ANGLE_TEMPLATE_H @@ -31,7 +31,7 @@ class NTopoAngleTemplate : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_bond_all.cpp b/src/ntopo_bond_all.cpp index 02d44f090c..ab397cab7b 100644 --- a/src/ntopo_bond_all.cpp +++ b/src/ntopo_bond_all.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo_bond_all.h b/src/ntopo_bond_all.h index 73411b6d30..de404446e8 100644 --- a/src/ntopo_bond_all.h +++ b/src/ntopo_bond_all.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef NTOPO_CLASS - -NTopoStyle(NTOPO_BOND_ALL,NTopoBondAll) - +// clang-format off +NTopoStyle(NTOPO_BOND_ALL,NTopoBondAll); +// clang-format on #else #ifndef LMP_TOPO_BOND_ALL_H @@ -31,7 +31,7 @@ class NTopoBondAll : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_bond_partial.cpp b/src/ntopo_bond_partial.cpp index c5afe08630..851703776b 100644 --- a/src/ntopo_bond_partial.cpp +++ b/src/ntopo_bond_partial.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo_bond_partial.h b/src/ntopo_bond_partial.h index 0b4c0c8719..4d334d1f0f 100644 --- a/src/ntopo_bond_partial.h +++ b/src/ntopo_bond_partial.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef NTOPO_CLASS - -NTopoStyle(NTOPO_BOND_PARTIAL,NTopoBondPartial) - +// clang-format off +NTopoStyle(NTOPO_BOND_PARTIAL,NTopoBondPartial); +// clang-format on #else #ifndef LMP_TOPO_BOND_PARTIAL_H @@ -31,7 +31,7 @@ class NTopoBondPartial : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_bond_template.cpp b/src/ntopo_bond_template.cpp index 45297fc92c..e2cb4d87c5 100644 --- a/src/ntopo_bond_template.cpp +++ b/src/ntopo_bond_template.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo_bond_template.h b/src/ntopo_bond_template.h index 4b69f927f7..b725ac85f9 100644 --- a/src/ntopo_bond_template.h +++ b/src/ntopo_bond_template.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef NTOPO_CLASS - -NTopoStyle(NTOPO_BOND_TEMPLATE,NTopoBondTemplate) - +// clang-format off +NTopoStyle(NTOPO_BOND_TEMPLATE,NTopoBondTemplate); +// clang-format on #else #ifndef LMP_TOPO_BOND_TEMPLATE_H @@ -31,7 +31,7 @@ class NTopoBondTemplate : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_dihedral_all.cpp b/src/ntopo_dihedral_all.cpp index cbe2e46e5c..e378e82d45 100644 --- a/src/ntopo_dihedral_all.cpp +++ b/src/ntopo_dihedral_all.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo_dihedral_all.h b/src/ntopo_dihedral_all.h index 67e44ddb02..0568bc9708 100644 --- a/src/ntopo_dihedral_all.h +++ b/src/ntopo_dihedral_all.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef NTOPO_CLASS - -NTopoStyle(NTOPO_DIHEDRAL_ALL,NTopoDihedralAll) - +// clang-format off +NTopoStyle(NTOPO_DIHEDRAL_ALL,NTopoDihedralAll); +// clang-format on #else #ifndef LMP_TOPO_DIHEDRAL_ALL_H @@ -31,7 +31,7 @@ class NTopoDihedralAll : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_dihedral_partial.cpp b/src/ntopo_dihedral_partial.cpp index c8a1f22100..c8c94b45e5 100644 --- a/src/ntopo_dihedral_partial.cpp +++ b/src/ntopo_dihedral_partial.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo_dihedral_partial.h b/src/ntopo_dihedral_partial.h index d2e47cc526..f439fe1dcd 100644 --- a/src/ntopo_dihedral_partial.h +++ b/src/ntopo_dihedral_partial.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef NTOPO_CLASS - -NTopoStyle(NTOPO_DIHEDRAL_PARTIAL,NTopoDihedralPartial) - +// clang-format off +NTopoStyle(NTOPO_DIHEDRAL_PARTIAL,NTopoDihedralPartial); +// clang-format on #else #ifndef LMP_TOPO_DIHEDRAL_PARTIAL_H @@ -31,7 +31,7 @@ class NTopoDihedralPartial : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_dihedral_template.cpp b/src/ntopo_dihedral_template.cpp index 564e7aca69..f7f7d7594a 100644 --- a/src/ntopo_dihedral_template.cpp +++ b/src/ntopo_dihedral_template.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo_dihedral_template.h b/src/ntopo_dihedral_template.h index e3ebb7fa48..67fe1c9072 100644 --- a/src/ntopo_dihedral_template.h +++ b/src/ntopo_dihedral_template.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef NTOPO_CLASS - -NTopoStyle(NTOPO_DIHEDRAL_TEMPLATE,NTopoDihedralTemplate) - +// clang-format off +NTopoStyle(NTOPO_DIHEDRAL_TEMPLATE,NTopoDihedralTemplate); +// clang-format on #else #ifndef LMP_TOPO_DIHEDRAL_TEMPLATE_H @@ -31,7 +31,7 @@ class NTopoDihedralTemplate : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_improper_all.cpp b/src/ntopo_improper_all.cpp index 52f323b735..ec9aab9827 100644 --- a/src/ntopo_improper_all.cpp +++ b/src/ntopo_improper_all.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo_improper_all.h b/src/ntopo_improper_all.h index 558c3a190b..26bbb1a642 100644 --- a/src/ntopo_improper_all.h +++ b/src/ntopo_improper_all.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef NTOPO_CLASS - -NTopoStyle(NTOPO_IMPROPER_ALL,NTopoImproperAll) - +// clang-format off +NTopoStyle(NTOPO_IMPROPER_ALL,NTopoImproperAll); +// clang-format on #else #ifndef LMP_TOPO_IMPROPER_ALL_H @@ -31,7 +31,7 @@ class NTopoImproperAll : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_improper_partial.cpp b/src/ntopo_improper_partial.cpp index 76d31061b7..be7f2531da 100644 --- a/src/ntopo_improper_partial.cpp +++ b/src/ntopo_improper_partial.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo_improper_partial.h b/src/ntopo_improper_partial.h index 417f7bb410..cc4baf1642 100644 --- a/src/ntopo_improper_partial.h +++ b/src/ntopo_improper_partial.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef NTOPO_CLASS - -NTopoStyle(NTOPO_IMPROPER_PARTIAL,NTopoImproperPartial) - +// clang-format off +NTopoStyle(NTOPO_IMPROPER_PARTIAL,NTopoImproperPartial); +// clang-format on #else #ifndef LMP_TOPO_IMPROPER_PARTIAL_H @@ -31,7 +31,7 @@ class NTopoImproperPartial : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_improper_template.cpp b/src/ntopo_improper_template.cpp index 7fd2f3352e..c714d6fef8 100644 --- a/src/ntopo_improper_template.cpp +++ b/src/ntopo_improper_template.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/ntopo_improper_template.h b/src/ntopo_improper_template.h index 8ddf22ba3b..510f067d66 100644 --- a/src/ntopo_improper_template.h +++ b/src/ntopo_improper_template.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef NTOPO_CLASS - -NTopoStyle(NTOPO_IMPROPER_TEMPLATE,NTopoImproperTemplate) - +// clang-format off +NTopoStyle(NTOPO_IMPROPER_TEMPLATE,NTopoImproperTemplate); +// clang-format on #else #ifndef LMP_TOPO_IMPROPER_TEMPLATE_H @@ -31,7 +31,7 @@ class NTopoImproperTemplate : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/omp_compat.h b/src/omp_compat.h index 5cb40a7c71..f7c33cedb6 100644 --- a/src/omp_compat.h +++ b/src/omp_compat.h @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2020) Sandia Corporation. Under the terms of Contract diff --git a/src/output.cpp b/src/output.cpp index 6f11079a75..90513619d3 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/output.h b/src/output.h index 2f00ff72f0..9ae8b7fc3d 100644 --- a/src/output.h +++ b/src/output.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -24,73 +24,72 @@ class Dump; class Output : protected Pointers { public: - bigint next; // next timestep for any kind of output + bigint next; // next timestep for any kind of output - bigint next_thermo; // next timestep for thermo output - int thermo_every; // output freq for thermo, 0 if first/last only - bigint last_thermo; // last timestep thermo was output - char *var_thermo; // variable name for thermo freq, null pointer if every - int ivar_thermo; // variable index for thermo frequency - class Thermo *thermo; // Thermodynamic computations + bigint next_thermo; // next timestep for thermo output + int thermo_every; // output freq for thermo, 0 if first/last only + bigint last_thermo; // last timestep thermo was output + char *var_thermo; // variable name for thermo freq, null pointer if every + int ivar_thermo; // variable index for thermo frequency + class Thermo *thermo; // Thermodynamic computations - int ndump; // # of Dumps defined - int max_dump; // max size of Dump list - bigint next_dump_any; // next timestep for any Dump - int *every_dump; // write freq for each Dump, 0 if var - bigint *next_dump; // next timestep to do each Dump - bigint *last_dump; // last timestep each snapshot was output - char **var_dump; // variable name for dump frequency - int *ivar_dump; // variable index for dump frequency - Dump **dump; // list of defined Dumps + int ndump; // # of Dumps defined + int max_dump; // max size of Dump list + bigint next_dump_any; // next timestep for any Dump + int *every_dump; // write freq for each Dump, 0 if var + bigint *next_dump; // next timestep to do each Dump + bigint *last_dump; // last timestep each snapshot was output + char **var_dump; // variable name for dump frequency + int *ivar_dump; // variable index for dump frequency + Dump **dump; // list of defined Dumps - int restart_flag; // 1 if any restart files are written - int restart_flag_single; // 1 if single restart files are written - int restart_flag_double; // 1 if double restart files are written - bigint next_restart; // next timestep to write any restart file - bigint next_restart_single; // next timestep to write a single restart file - bigint next_restart_double; // next timestep to write a double restart file - int restart_every_single; // single restart file write freq, 0 if var - int restart_every_double; // double restart file write freq, 0 if var - bigint last_restart; // last timestep any restart file was output - int restart_toggle; // 0 if use restart2a as prefix, 1 if restart2b - char *var_restart_single; // variable name for single restart freq - char *var_restart_double; // variable name for double restart freq - int ivar_restart_single; // index of var_restart_single - int ivar_restart_double; // index of var_restart_double - char *restart1; // name single restart file - char *restart2a,*restart2b; // names of double restart files - class WriteRestart *restart; // class for writing restart files + int restart_flag; // 1 if any restart files are written + int restart_flag_single; // 1 if single restart files are written + int restart_flag_double; // 1 if double restart files are written + bigint next_restart; // next timestep to write any restart file + bigint next_restart_single; // next timestep to write a single restart file + bigint next_restart_double; // next timestep to write a double restart file + int restart_every_single; // single restart file write freq, 0 if var + int restart_every_double; // double restart file write freq, 0 if var + bigint last_restart; // last timestep any restart file was output + int restart_toggle; // 0 if use restart2a as prefix, 1 if restart2b + char *var_restart_single; // variable name for single restart freq + char *var_restart_double; // variable name for double restart freq + int ivar_restart_single; // index of var_restart_single + int ivar_restart_double; // index of var_restart_double + char *restart1; // name single restart file + char *restart2a, *restart2b; // names of double restart files + class WriteRestart *restart; // class for writing restart files - - typedef Dump *(*DumpCreator)(LAMMPS *,int,char**); - typedef std::map DumpCreatorMap; + typedef Dump *(*DumpCreator)(LAMMPS *, int, char **); + typedef std::map DumpCreatorMap; DumpCreatorMap *dump_map; Output(class LAMMPS *); ~Output(); void init(); - void setup(int memflag = 1); // initial output before run/min - void write(bigint); // output for current timestep - void write_dump(bigint); // force output of dump snapshots - void write_restart(bigint); // force output of a restart file - void reset_timestep(bigint); // reset next timestep for all output + void setup(int memflag = 1); // initial output before run/min + void write(bigint); // output for current timestep + void write_dump(bigint); // force output of dump snapshots + void write_restart(bigint); // force output of a restart file + void reset_timestep(bigint); // reset next timestep for all output void add_dump(int, char **); // add a Dump to Dump list void modify_dump(int, char **); // modify a Dump void delete_dump(char *); // delete a Dump from Dump list int find_dump(const char *); // find a Dump ID - void set_thermo(int, char **); // set thermo output freqquency - void create_thermo(int, char **); // create a thermo style - void create_restart(int, char **); // create Restart and restart files + void set_thermo(int, char **); // set thermo output freqquency + void create_thermo(int, char **); // create a thermo style + void create_restart(int, char **); // create Restart and restart files - void memory_usage(); // print out memory usage + void memory_usage(); // print out memory usage private: template static Dump *dump_creator(LAMMPS *, int, char **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/pack.h b/src/pack.h index d17a8dfa7c..a3a4ddd90a 100644 --- a/src/pack.h +++ b/src/pack.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,12 +14,12 @@ // loop counters for doing a pack/unpack struct pack_plan_3d { - int nfast; // # of elements in fast index - int nmid; // # of elements in mid index - int nslow; // # of elements in slow index - int nstride_line; // stride between successive mid indices - int nstride_plane; // stride between successive slow indices - int nqty; // # of values/element + int nfast; // # of elements in fast index + int nmid; // # of elements in mid index + int nslow; // # of elements in slow index + int nstride_line; // stride between successive mid indices + int nstride_plane; // stride between successive slow indices + int nqty; // # of values/element }; #if !defined(FFT_PACK_POINTER) && !defined(FFT_PACK_MEMCPY) @@ -54,8 +54,8 @@ struct pack_plan_3d { static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) { - int in,out,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + int in, out, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -65,11 +65,10 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) in = 0; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_plane; + plane = slow * nstride_plane; for (mid = 0; mid < nmid; mid++) { - out = plane + mid*nstride_line; - for (fast = 0; fast < nfast; fast++) - buf[in++] = data[out++]; + out = plane + mid * nstride_line; + for (fast = 0; fast < nfast; fast++) buf[in++] = data[out++]; } } } @@ -80,8 +79,8 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + int in, out, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -91,11 +90,10 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan out = 0; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_plane; + plane = slow * nstride_plane; for (mid = 0; mid < nmid; mid++) { - in = plane + mid*nstride_line; - for (fast = 0; fast < nfast; fast++) - data[in++] = buf[out++]; + in = plane + mid * nstride_line; + for (fast = 0; fast < nfast; fast++) data[in++] = buf[out++]; } } } @@ -106,8 +104,8 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + int in, out, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -117,11 +115,10 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = 0; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { in = plane + mid; - for (fast = 0; fast < nfast; fast++, in += nstride_plane) - data[in] = buf[out++]; + for (fast = 0; fast < nfast; fast++, in += nstride_plane) data[in] = buf[out++]; } } } @@ -132,8 +129,8 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + int in, out, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -143,12 +140,12 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = 0; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - in = plane + 2*mid; + in = plane + 2 * mid; for (fast = 0; fast < nfast; fast++, in += nstride_plane) { data[in] = buf[out++]; - data[in+1] = buf[out++]; + data[in + 1] = buf[out++]; } } } @@ -161,8 +158,8 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,iqty,instart,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane,nqty; + int in, out, iqty, instart, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane, nqty; nfast = plan->nfast; nmid = plan->nmid; @@ -173,9 +170,9 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = 0; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - instart = plane + nqty*mid; + instart = plane + nqty * mid; for (fast = 0; fast < nfast; fast++, instart += nstride_plane) { in = instart; for (iqty = 0; iqty < nqty; iqty++) data[in++] = buf[out++]; @@ -191,8 +188,8 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane; + int in, out, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane; nfast = plan->nfast; nmid = plan->nmid; @@ -203,9 +200,8 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = 0; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - in = slow + mid*nstride_plane; - for (fast = 0; fast < nfast; fast++, in += nstride_line) - data[in] = buf[out++]; + in = slow + mid * nstride_plane; + for (fast = 0; fast < nfast; fast++, in += nstride_line) data[in] = buf[out++]; } } } @@ -217,8 +213,8 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane; + int in, out, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane; nfast = plan->nfast; nmid = plan->nmid; @@ -229,10 +225,10 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = 0; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - in = 2*slow + mid*nstride_plane; + in = 2 * slow + mid * nstride_plane; for (fast = 0; fast < nfast; fast++, in += nstride_line) { data[in] = buf[out++]; - data[in+1] = buf[out++]; + data[in + 1] = buf[out++]; } } } @@ -245,8 +241,8 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,iqty,instart,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,nqty; + int in, out, iqty, instart, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, nqty; nfast = plan->nfast; nmid = plan->nmid; @@ -258,7 +254,7 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = 0; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - instart = nqty*slow + mid*nstride_plane; + instart = nqty * slow + mid * nstride_plane; for (fast = 0; fast < nfast; fast++, instart += nstride_line) { in = instart; for (iqty = 0; iqty < nqty; iqty++) data[in++] = buf[out++]; @@ -282,9 +278,9 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -294,12 +290,11 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) in = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_plane; + plane = slow * nstride_plane; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+mid*nstride_line]); + begin = &(data[plane + mid * nstride_line]); end = begin + nfast; - for (out = begin; out < end; out++) - *(in++) = *out; + for (out = begin; out < end; out++) *(in++) = *out; } } } @@ -311,9 +306,9 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -323,12 +318,11 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_plane; + plane = slow * nstride_plane; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+mid*nstride_line]); + begin = &(data[plane + mid * nstride_line]); end = begin + nfast; - for (in = begin; in < end; in++) - *in = *(out++); + for (in = begin; in < end; in++) *in = *(out++); } } } @@ -340,9 +334,9 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -352,12 +346,11 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+mid]); - end = begin + nfast*nstride_plane; - for (in = begin; in < end; in += nstride_plane) - *in = *(out++); + begin = &(data[plane + mid]); + end = begin + nfast * nstride_plane; + for (in = begin; in < end; in += nstride_plane) *in = *(out++); } } } @@ -369,9 +362,9 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -381,13 +374,13 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+2*mid]); - end = begin + nfast*nstride_plane; + begin = &(data[plane + 2 * mid]); + end = begin + nfast * nstride_plane; for (in = begin; in < end; in += nstride_plane) { *in = *(out++); - *(in+1) = *(out++); + *(in + 1) = *(out++); } } } @@ -400,9 +393,9 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*instart,*begin,*end; - int iqty,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane,nqty; + PACK_DATA *in, *out, *instart, *begin, *end; + int iqty, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane, nqty; nfast = plan->nfast; nmid = plan->nmid; @@ -413,10 +406,10 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+nqty*mid]); - end = begin + nfast*nstride_plane; + begin = &(data[plane + nqty * mid]); + end = begin + nfast * nstride_plane; for (instart = begin; instart < end; instart += nstride_plane) { in = instart; for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++); @@ -432,9 +425,9 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane; nfast = plan->nfast; nmid = plan->nmid; @@ -445,10 +438,9 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - begin = &(data[slow+mid*nstride_plane]); - end = begin + nfast*nstride_line; - for (in = begin; in < end; in += nstride_line) - *in = *(out++); + begin = &(data[slow + mid * nstride_plane]); + end = begin + nfast * nstride_line; + for (in = begin; in < end; in += nstride_line) *in = *(out++); } } } @@ -460,9 +452,9 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane; nfast = plan->nfast; nmid = plan->nmid; @@ -473,11 +465,11 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - begin = &(data[2*slow+mid*nstride_plane]); - end = begin + nfast*nstride_line; + begin = &(data[2 * slow + mid * nstride_plane]); + end = begin + nfast * nstride_line; for (in = begin; in < end; in += nstride_line) { *in = *(out++); - *(in+1) = *(out++); + *(in + 1) = *(out++); } } } @@ -490,9 +482,9 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*instart,*begin,*end; - int iqty,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,nqty; + PACK_DATA *in, *out, *instart, *begin, *end; + int iqty, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, nqty; nfast = plan->nfast; nmid = plan->nmid; @@ -504,8 +496,8 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - begin = &(data[nqty*slow+mid*nstride_plane]); - end = begin + nfast*nstride_line; + begin = &(data[nqty * slow + mid * nstride_plane]); + end = begin + nfast * nstride_line; for (instart = begin; instart < end; instart += nstride_line) { in = instart; for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++); @@ -531,9 +523,9 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) { - PACK_DATA *in,*out; - int mid,slow,size; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane,upto; + PACK_DATA *in, *out; + int mid, slow, size; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane, upto; nfast = plan->nfast; nmid = plan->nmid; @@ -541,14 +533,14 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) nstride_line = plan->nstride_line; nstride_plane = plan->nstride_plane; - size = nfast*sizeof(PACK_DATA); + size = nfast * sizeof(PACK_DATA); for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_plane; - upto = slow*nmid*nfast; + plane = slow * nstride_plane; + upto = slow * nmid * nfast; for (mid = 0; mid < nmid; mid++) { - in = &(buf[upto+mid*nfast]); - out = &(data[plane+mid*nstride_line]); - memcpy(in,out,size); + in = &(buf[upto + mid * nfast]); + out = &(data[plane + mid * nstride_line]); + memcpy(in, out, size); } } } @@ -560,9 +552,9 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out; - int mid,slow,size; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane,upto; + PACK_DATA *in, *out; + int mid, slow, size; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane, upto; nfast = plan->nfast; nmid = plan->nmid; @@ -570,14 +562,14 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan nstride_line = plan->nstride_line; nstride_plane = plan->nstride_plane; - size = nfast*sizeof(PACK_DATA); + size = nfast * sizeof(PACK_DATA); for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_plane; - upto = slow*nmid*nfast; + plane = slow * nstride_plane; + upto = slow * nmid * nfast; for (mid = 0; mid < nmid; mid++) { - in = &(data[plane+mid*nstride_line]); - out = &(buf[upto+mid*nfast]); - memcpy(in,out,size); + in = &(data[plane + mid * nstride_line]); + out = &(buf[upto + mid * nfast]); + memcpy(in, out, size); } } } @@ -589,9 +581,9 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -601,12 +593,11 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+mid]); - end = begin + nfast*nstride_plane; - for (in = begin; in < end; in += nstride_plane) - *in = *(out++); + begin = &(data[plane + mid]); + end = begin + nfast * nstride_plane; + for (in = begin; in < end; in += nstride_plane) *in = *(out++); } } } @@ -618,9 +609,9 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -630,13 +621,13 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+2*mid]); - end = begin + nfast*nstride_plane; + begin = &(data[plane + 2 * mid]); + end = begin + nfast * nstride_plane; for (in = begin; in < end; in += nstride_plane) { *in = *(out++); - *(in+1) = *(out++); + *(in + 1) = *(out++); } } } @@ -649,9 +640,9 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*instart,*begin,*end; - int iqty,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane,nqty; + PACK_DATA *in, *out, *instart, *begin, *end; + int iqty, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane, nqty; nfast = plan->nfast; nmid = plan->nmid; @@ -662,10 +653,10 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+nqty*mid]); - end = begin + nfast*nstride_plane; + begin = &(data[plane + nqty * mid]); + end = begin + nfast * nstride_plane; for (instart = begin; instart < end; instart += nstride_plane) { in = instart; for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++); @@ -681,9 +672,9 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane; nfast = plan->nfast; nmid = plan->nmid; @@ -694,10 +685,9 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - begin = &(data[slow+mid*nstride_plane]); - end = begin + nfast*nstride_line; - for (in = begin; in < end; in += nstride_line) - *in = *(out++); + begin = &(data[slow + mid * nstride_plane]); + end = begin + nfast * nstride_line; + for (in = begin; in < end; in += nstride_line) *in = *(out++); } } } @@ -709,9 +699,9 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane; nfast = plan->nfast; nmid = plan->nmid; @@ -722,11 +712,11 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - begin = &(data[2*slow+mid*nstride_plane]); - end = begin + nfast*nstride_line; + begin = &(data[2 * slow + mid * nstride_plane]); + end = begin + nfast * nstride_line; for (in = begin; in < end; in += nstride_line) { *in = *(out++); - *(in+1) = *(out++); + *(in + 1) = *(out++); } } } @@ -739,9 +729,9 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*instart,*begin,*end; - int iqty,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,nqty; + PACK_DATA *in, *out, *instart, *begin, *end; + int iqty, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, nqty; nfast = plan->nfast; nmid = plan->nmid; @@ -753,8 +743,8 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - begin = &(data[nqty*slow+mid*nstride_plane]); - end = begin + nfast*nstride_line; + begin = &(data[nqty * slow + mid * nstride_plane]); + end = begin + nfast * nstride_line; for (instart = begin; instart < end; instart += nstride_line) { in = instart; for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++); diff --git a/src/pair.cpp b/src/pair.cpp index a8ea29b302..0fcc4bd62f 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair.h b/src/pair.h index ac0e5e7390..b19fa08c48 100644 --- a/src/pair.h +++ b/src/pair.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,7 +14,7 @@ #ifndef LMP_PAIR_H #define LMP_PAIR_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { @@ -32,91 +32,91 @@ class Pair : protected Pointers { friend class Info; public: - static int instance_total; // # of Pair classes ever instantiated + static int instance_total; // # of Pair classes ever instantiated - double eng_vdwl,eng_coul; // accumulated energies - double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz - double *eatom,**vatom; // accumulated per-atom energy/virial - double **cvatom; // accumulated per-atom centroid virial + double eng_vdwl, eng_coul; // accumulated energies + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz + double *eatom, **vatom; // accumulated per-atom energy/virial + double **cvatom; // accumulated per-atom centroid virial - double cutforce; // max cutoff for all atom pairs - double **cutsq; // cutoff sq for each atom pair - int **setflag; // 0/1 = whether each i,j has been set + double cutforce; // max cutoff for all atom pairs + double **cutsq; // cutoff sq for each atom pair + int **setflag; // 0/1 = whether each i,j has been set - 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 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 single_enable; // 1 if single() routine exists - int single_hessian_enable; // 1 if single_hessian() routine exists - int restartinfo; // 1 if pair style writes restart info - int respa_enable; // 1 if inner/middle/outer rRESPA routines - int one_coeff; // 1 if allows only one coeff * * call - int manybody_flag; // 1 if a manybody potential - int unit_convert_flag; // value != 0 indicates support for unit conversion. - int no_virial_fdotr_compute; // 1 if does not invoke virial_fdotr_compute() - int writedata; // 1 if writes coeffs to data file - int finitecutflag; // 1 if cut depends on finite atom size - int ghostneigh; // 1 if pair style needs neighbors of ghosts - double **cutghost; // cutoff for each ghost pair + int single_enable; // 1 if single() routine exists + int single_hessian_enable; // 1 if single_hessian() routine exists + int restartinfo; // 1 if pair style writes restart info + int respa_enable; // 1 if inner/middle/outer rRESPA routines + int one_coeff; // 1 if allows only one coeff * * call + int manybody_flag; // 1 if a manybody potential + int unit_convert_flag; // value != 0 indicates support for unit conversion. + int no_virial_fdotr_compute; // 1 if does not invoke virial_fdotr_compute() + int writedata; // 1 if writes coeffs to data file + int finitecutflag; // 1 if cut depends on finite atom size + int ghostneigh; // 1 if pair style needs neighbors of ghosts + double **cutghost; // cutoff for each ghost pair - int ewaldflag; // 1 if compatible with Ewald solver - int pppmflag; // 1 if compatible with PPPM solver - int msmflag; // 1 if compatible with MSM solver - int dispersionflag; // 1 if compatible with LJ/dispersion solver - int tip4pflag; // 1 if compatible with TIP4P solver - int dipoleflag; // 1 if compatible with dipole solver - int spinflag; // 1 if compatible with spin solver - int reinitflag; // 1 if compatible with fix adapt and alike + int ewaldflag; // 1 if compatible with Ewald solver + int pppmflag; // 1 if compatible with PPPM solver + int msmflag; // 1 if compatible with MSM solver + int dispersionflag; // 1 if compatible with LJ/dispersion solver + int tip4pflag; // 1 if compatible with TIP4P solver + int dipoleflag; // 1 if compatible with dipole solver + int spinflag; // 1 if compatible with spin solver + int reinitflag; // 1 if compatible with fix adapt and alike - int centroidstressflag; // centroid stress compared to two-body stress - // CENTROID_SAME = same as two-body stress - // CENTROID_AVAIL = different and implemented - // CENTROID_NOTAVAIL = different, not yet implemented + int centroidstressflag; // centroid stress compared to two-body stress + // CENTROID_SAME = same as two-body stress + // CENTROID_AVAIL = different and implemented + // CENTROID_NOTAVAIL = different, not yet implemented - int tail_flag; // pair_modify flag for LJ tail correction - double etail,ptail; // energy/pressure tail corrections - double etail_ij,ptail_ij; + int tail_flag; // pair_modify flag for LJ tail correction + double etail, ptail; // energy/pressure tail corrections + double etail_ij, ptail_ij; - int evflag; // energy,virial settings - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom,cvflag_atom; + int evflag; // energy,virial settings + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom, cvflag_atom; - int ncoultablebits; // size of Coulomb table, accessed by KSpace - int ndisptablebits; // size of dispersion table + int ncoultablebits; // size of Coulomb table, accessed by KSpace + int ndisptablebits; // size of dispersion table double tabinnersq; double tabinnerdispsq; - double *rtable,*drtable,*ftable,*dftable,*ctable,*dctable; - double *etable,*detable,*ptable,*dptable,*vtable,*dvtable; + double *rtable, *drtable, *ftable, *dftable, *ctable, *dctable; + double *etable, *detable, *ptable, *dptable, *vtable, *dvtable; double *rdisptable, *drdisptable, *fdisptable, *dfdisptable; double *edisptable, *dedisptable; - int ncoulshiftbits,ncoulmask; + int ncoulshiftbits, ncoulmask; int ndispshiftbits, ndispmask; - int nextra; // # of extra quantities pair style calculates - double *pvector; // vector of extra pair quantities + int nextra; // # of extra quantities pair style calculates + double *pvector; // vector of extra pair quantities - int single_extra; // number of extra single values calculated - double *svector; // vector of extra single quantities + int single_extra; // number of extra single values calculated + double *svector; // vector of extra single quantities - class NeighList *list; // standard neighbor list used by most pairs - class NeighList *listhalf; // half list used by some pairs - class NeighList *listfull; // full list used by some pairs + class NeighList *list; // standard neighbor list used by most pairs + class NeighList *listhalf; // half list used by some pairs + class NeighList *listfull; // full list used by some pairs - int allocated; // 0/1 = whether arrays are allocated - // public so external driver can check - int compute_flag; // 0 if skip compute() - int mixed_flag; // 1 if all itype != jtype coeffs are from mixing + int allocated; // 0/1 = whether arrays are allocated + // public so external driver can check + int compute_flag; // 0 if skip compute() + int mixed_flag; // 1 if all itype != jtype coeffs are from mixing - enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER}; // mixing options + enum { GEOMETRIC, ARITHMETIC, SIXTHPOWER }; // mixing options - int beyond_contact, nondefault_history_transfer; // for granular styles + int beyond_contact, nondefault_history_transfer; // for granular styles // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; - int kokkosable; // 1 if Kokkos pair + unsigned int datamask_read, datamask_modify; + int kokkosable; // 1 if Kokkos pair Pair(class LAMMPS *); virtual ~Pair(); @@ -136,15 +136,12 @@ class Pair : protected Pointers { // need to be public, so can be called by pair_style reaxc void v_tally(int, double *, double *); - void ev_tally(int, int, int, int, double, double, double, - double, double, double); - void ev_tally3(int, int, int, double, double, - double *, double *, double *, double *); + void ev_tally(int, int, int, int, double, double, double, double, double, double); + void ev_tally3(int, int, int, double, double, double *, double *, double *, double *); void v_tally3(int, int, int, double *, double *, double *, double *); - void v_tally4(int, int, int, int, double *, double *, double *, - double *, double *, double *); - void ev_tally_xyz(int, int, int, int, double, double, - double, double, double, double, double, double); + void v_tally4(int, int, int, int, double *, double *, double *, double *, double *, double *); + void ev_tally_xyz(int, int, int, int, double, double, double, double, double, double, double, + double); // general child-class methods @@ -153,20 +150,19 @@ class Pair : protected Pointers { virtual void compute_middle() {} virtual void compute_outer(int, int) {} - virtual double single(int, int, int, int, - double, double, double, - double& fforce) { + virtual double single(int, int, int, int, double, double, double, double &fforce) + { fforce = 0.0; return 0.0; } void hessian_twobody(double fforce, double dfac, double delr[3], double phiTensor[6]); - virtual double single_hessian(int, int, int, int, - double, double[3], double, double, - double& fforce, double d2u[6]) { + virtual double single_hessian(int, int, int, int, double, double[3], double, double, + double &fforce, double d2u[6]) + { fforce = 0.0; - for (int i=0; i<6; i++) d2u[i] = 0; + for (int i = 0; i < 6; i++) d2u[i] = 0; return 0.0; } @@ -175,7 +171,7 @@ class Pair : protected Pointers { virtual void init_style(); virtual void init_list(int, class NeighList *); - virtual double init_one(int, int) {return 0.0;} + virtual double init_one(int, int) { return 0.0; } virtual void init_tables(double, double *); virtual void init_tables_disp(double); @@ -189,62 +185,66 @@ class Pair : protected Pointers { virtual void write_data(FILE *) {} virtual void write_data_all(FILE *) {} - virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;} + 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 int pack_reverse_comm(int, int, double *) { return 0; } virtual void unpack_reverse_comm(int, int *, double *) {} virtual double memory_usage(); - void set_copymode(int value) {copymode = value;} + void set_copymode(int value) { copymode = value; } // specific child-class methods for certain Pair styles - virtual void *extract(const char *, int &) {return nullptr;} + virtual void *extract(const char *, int &) { return nullptr; } virtual void swap_eam(double *, double **) {} virtual void reset_dt() {} virtual void min_xf_pointers(int, double **, double **) {} virtual void min_xf_get(int) {} virtual void min_x_set(int) {} - virtual void transfer_history(double *, double*) {} - virtual double atom2cut(int) {return 0.0;} - virtual double radii2cut(double,double) {return 0.0;} + virtual void transfer_history(double *, double *) {} + virtual double atom2cut(int) { return 0.0; } + virtual double radii2cut(double, double) { return 0.0; } // management of callbacks to be run from ev_tally() protected: int num_tally_compute; class Compute **list_tally_compute; + public: virtual void add_tally_callback(class Compute *); virtual void del_tally_callback(class Compute *); protected: - int instance_me; // which Pair class instantiation I am - int special_lj[4]; // copied from force->special_lj for Kokkos - int suffix_flag; // suffix compatibility flag + int instance_me; // which Pair class instantiation I am + int special_lj[4]; // copied from force->special_lj for Kokkos + int suffix_flag; // suffix compatibility flag - // pair_modify settings - int offset_flag,mix_flag; // flags for offset and mixing + // pair_modify settings + int offset_flag, mix_flag; // flags for offset and mixing double tabinner; // inner cutoff for Coulomb table double tabinner_disp; // inner cutoff for dispersion table protected: // for mapping of elements to atom types and parameters // mostly used for manybody potentials - int nelements; // # of unique elements - char **elements; // names of unique elements - int *elem1param; // mapping from elements to parameters - int **elem2param; // mapping from element pairs to parameters - int ***elem3param; // mapping from element triplets to parameters - int *map; // mapping from atom types to elements - int nparams; // # of stored parameter sets - int maxparam; // max # of parameter sets - void map_element2type(int, char**, bool update_setflag=true); + int nelements; // # of unique elements + char **elements; // names of unique elements + int *elem1param; // mapping from elements to parameters + int **elem2param; // mapping from element pairs to parameters + int ***elem3param; // mapping from element triplets to parameters + int *map; // mapping from atom types to elements + int nparams; // # of stored parameter sets + int maxparam; // max # of parameter sets + void map_element2type(int, char **, bool update_setflag = true); public: // custom data type for accessing Coulomb tables - typedef union {int i; float f;} union_int_float_t; + typedef union { + int i; + float f; + } union_int_float_t; // Accessor for the user-intel package to determine virial calc for hybrid @@ -252,34 +252,33 @@ class Pair : protected Pointers { protected: int vflag_fdotr; - int maxeatom,maxvatom,maxcvatom; + int maxeatom, maxvatom, maxcvatom; - int copymode; // if set, do not deallocate during destruction - // required when classes are used as functors by Kokkos + int copymode; // if set, do not deallocate during destruction + // required when classes are used as functors by Kokkos - void ev_init(int eflag, int vflag, int alloc = 1) { - if (eflag||vflag) ev_setup(eflag, vflag, alloc); - else ev_unset(); + void ev_init(int eflag, int vflag, int alloc = 1) + { + if (eflag || vflag) + ev_setup(eflag, vflag, alloc); + else + ev_unset(); } virtual void ev_setup(int, int, int alloc = 1); void ev_unset(); void ev_tally_full(int, double, double, double, double, double, double); - void ev_tally_xyz_full(int, double, double, - double, double, double, double, double, double); - void ev_tally4(int, int, int, int, double, - double *, double *, double *, double *, double *, double *); + void ev_tally_xyz_full(int, double, double, double, double, double, double, double, double); + void ev_tally4(int, int, int, int, double, double *, double *, double *, double *, double *, + double *); void ev_tally_tip4p(int, int *, double *, double, double); void v_tally2(int, int, double, double *); - void v_tally_tensor(int, int, int, int, - double, double, double, double, double, double); + void v_tally_tensor(int, int, int, int, double, double, double, double, double, double); void virial_fdotr_compute(); - inline int sbmask(int j) const { - return j >> SBBITS & 3; - } + inline int sbmask(int j) const { return j >> SBBITS & 3; } }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/pair_beck.cpp b/src/pair_beck.cpp index a6e63fc4ec..07c40c2ff0 100644 --- a/src/pair_beck.cpp +++ b/src/pair_beck.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_beck.h b/src/pair_beck.h index 4cc16c3a2b..dc19456d64 100644 --- a/src/pair_beck.h +++ b/src/pair_beck.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(beck,PairBeck) - +// clang-format off +PairStyle(beck,PairBeck); +// clang-format on #else #ifndef PAIR_BECK_H @@ -41,13 +41,13 @@ class PairBeck : public Pair { protected: double cut_global; double **cut; - double **AA,**BB; - double **aa,**alpha,**beta; + double **AA, **BB; + double **aa, **alpha, **beta; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_born.cpp b/src/pair_born.cpp index 20b0798a43..dd2292a4e7 100644 --- a/src/pair_born.cpp +++ b/src/pair_born.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_born.h b/src/pair_born.h index 7d4c5d229c..32f633f069 100644 --- a/src/pair_born.h +++ b/src/pair_born.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born,PairBorn) - +// clang-format off +PairStyle(born,PairBorn); +// clang-format on #else #ifndef PAIR_BORN_H @@ -45,13 +45,13 @@ class PairBorn : public Pair { protected: double cut_global; double **cut; - double **a,**rho,**sigma,**c, **d; - double **rhoinv,**born1,**born2,**born3,**offset; + double **a, **rho, **sigma, **c, **d; + double **rhoinv, **born1, **born2, **born3, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_born_coul_dsf.cpp b/src/pair_born_coul_dsf.cpp index 7c8961e34c..3fac9a79c9 100644 --- a/src/pair_born_coul_dsf.cpp +++ b/src/pair_born_coul_dsf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_born_coul_dsf.h b/src/pair_born_coul_dsf.h index 20f2298ca7..01fa651630 100644 --- a/src/pair_born_coul_dsf.h +++ b/src/pair_born_coul_dsf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/dsf,PairBornCoulDSF) - +// clang-format off +PairStyle(born/coul/dsf,PairBornCoulDSF); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_DSF_H @@ -42,17 +42,17 @@ class PairBornCoulDSF : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_lj_global,alpha; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **a,**rho,**sigma,**c,**d; - double **rhoinv,**born1,**born2,**born3,**offset; - double f_shift,e_shift; + double cut_lj_global, alpha; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **a, **rho, **sigma, **c, **d; + double **rhoinv, **born1, **born2, **born3, **offset; + double f_shift, e_shift; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_born_coul_wolf.cpp b/src/pair_born_coul_wolf.cpp index fc8e1221e9..2fe4316011 100644 --- a/src/pair_born_coul_wolf.cpp +++ b/src/pair_born_coul_wolf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_born_coul_wolf.h b/src/pair_born_coul_wolf.h index 30aa59ec3e..2ddfe3ebcf 100644 --- a/src/pair_born_coul_wolf.h +++ b/src/pair_born_coul_wolf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(born/coul/wolf,PairBornCoulWolf) - +// clang-format off +PairStyle(born/coul/wolf,PairBornCoulWolf); +// clang-format on #else #ifndef LMP_PAIR_BORN_COUL_WOLF_H @@ -42,16 +42,16 @@ class PairBornCoulWolf : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_lj_global,alf; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **a,**rho,**sigma,**c,**d; - double **rhoinv,**born1,**born2,**born3,**offset; + double cut_lj_global, alf; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **a, **rho, **sigma, **c, **d; + double **rhoinv, **born1, **born2, **born3, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_buck.cpp b/src/pair_buck.cpp index 989c341add..8c6a4afd19 100644 --- a/src/pair_buck.cpp +++ b/src/pair_buck.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_buck.h b/src/pair_buck.h index d60368054d..2be7ebabe9 100644 --- a/src/pair_buck.h +++ b/src/pair_buck.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck,PairBuck) - +// clang-format off +PairStyle(buck,PairBuck); +// clang-format on #else #ifndef LMP_PAIR_BUCK_H @@ -44,13 +44,13 @@ class PairBuck : public Pair { protected: double cut_global; double **cut; - double **a,**rho,**c; - double **rhoinv,**buck1,**buck2,**offset; + double **a, **rho, **c; + double **rhoinv, **buck1, **buck2, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_buck_coul_cut.cpp b/src/pair_buck_coul_cut.cpp index bc95dfb6ab..edcd04df08 100644 --- a/src/pair_buck_coul_cut.cpp +++ b/src/pair_buck_coul_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_buck_coul_cut.h b/src/pair_buck_coul_cut.h index 64341f48ab..b8a5178528 100644 --- a/src/pair_buck_coul_cut.h +++ b/src/pair_buck_coul_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(buck/coul/cut,PairBuckCoulCut) - +// clang-format off +PairStyle(buck/coul/cut,PairBuckCoulCut); +// clang-format on #else #ifndef LMP_PAIR_BUCK_COUL_CUT_H @@ -43,16 +43,16 @@ class PairBuckCoulCut : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **a,**rho,**c; - double **rhoinv,**buck1,**buck2,**offset; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **a, **rho, **c; + double **rhoinv, **buck1, **buck2, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_coul_cut.cpp b/src/pair_coul_cut.cpp index 629d39a9c5..e07ff41f9c 100644 --- a/src/pair_coul_cut.cpp +++ b/src/pair_coul_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -36,6 +37,8 @@ PairCoulCut::PairCoulCut(LAMMPS *lmp) : Pair(lmp) { PairCoulCut::~PairCoulCut() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); diff --git a/src/pair_coul_cut.h b/src/pair_coul_cut.h index 732cd00f3b..2d1f902e0f 100644 --- a/src/pair_coul_cut.h +++ b/src/pair_coul_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/cut,PairCoulCut) - +// clang-format off +PairStyle(coul/cut,PairCoulCut); +// clang-format on #else #ifndef LMP_PAIR_COUL_CUT_H @@ -44,12 +44,12 @@ class PairCoulCut : public Pair { protected: double cut_global; - double **cut,**scale; + double **cut, **scale; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_coul_cut_global.cpp b/src/pair_coul_cut_global.cpp index fa3d394092..48f726c062 100644 --- a/src/pair_coul_cut_global.cpp +++ b/src/pair_coul_cut_global.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_coul_cut_global.h b/src/pair_coul_cut_global.h index f49700352e..c7520adc56 100644 --- a/src/pair_coul_cut_global.h +++ b/src/pair_coul_cut_global.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/cut/global,PairCoulCutGlobal) - +// clang-format off +PairStyle(coul/cut/global,PairCoulCutGlobal); +// clang-format on #else #ifndef LMP_PAIR_COUL_CUT_GLOBAL_H @@ -31,7 +31,7 @@ class PairCoulCutGlobal : public PairCoulCut { void *extract(const char *, int &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_coul_debye.cpp b/src/pair_coul_debye.cpp index 4b76c3844c..4320233569 100644 --- a/src/pair_coul_debye.cpp +++ b/src/pair_coul_debye.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_coul_debye.h b/src/pair_coul_debye.h index 36dd47b9bc..cd10786d9f 100644 --- a/src/pair_coul_debye.h +++ b/src/pair_coul_debye.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/debye,PairCoulDebye) - +// clang-format off +PairStyle(coul/debye,PairCoulDebye); +// clang-format on #else #ifndef LMP_PAIR_COUL_DEBYE_H @@ -37,7 +37,7 @@ class PairCoulDebye : public PairCoulCut { double kappa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_coul_dsf.cpp b/src/pair_coul_dsf.cpp index 20bae21594..98c9f7f5d6 100644 --- a/src/pair_coul_dsf.cpp +++ b/src/pair_coul_dsf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_coul_dsf.h b/src/pair_coul_dsf.h index 62cdebbc46..afbc573220 100644 --- a/src/pair_coul_dsf.h +++ b/src/pair_coul_dsf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/dsf,PairCoulDSF) - +// clang-format off +PairStyle(coul/dsf,PairCoulDSF); +// clang-format on #else #ifndef LMP_PAIR_COUL_DSF_H @@ -41,14 +41,14 @@ class PairCoulDSF : public Pair { void *extract(const char *, int &); protected: - double cut_coul,cut_coulsq; + double cut_coul, cut_coulsq; double alpha; - double f_shift,e_shift; + double f_shift, e_shift; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_coul_streitz.cpp b/src/pair_coul_streitz.cpp index 87bcd45736..0affa39799 100644 --- a/src/pair_coul_streitz.cpp +++ b/src/pair_coul_streitz.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_coul_streitz.h b/src/pair_coul_streitz.h index 5da3a77e1d..011c4a6b7a 100644 --- a/src/pair_coul_streitz.h +++ b/src/pair_coul_streitz.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/streitz,PairCoulStreitz) - +// clang-format off +PairStyle(coul/streitz,PairCoulStreitz); +// clang-format on #else #ifndef LMP_PAIR_COUL_Streitz_H @@ -46,7 +46,7 @@ class PairCoulStreitz : public Pair { int nmax; double precision; - Param *params; // parameter sets for elements + Param *params; // parameter sets for elements // Kspace parameters int kspacetype; @@ -66,18 +66,14 @@ class PairCoulStreitz : public Pair { virtual void read_file(char *); void setup_params(); double self(Param *, double); - void coulomb_integral_wolf(double, double, double, double &, double &, - double &, double &); - void wolf_sum(double, double, double, double, double, double, double, - double, double &, double &); - void coulomb_integral_ewald(double, double, double, double &, double &, - double &, double &); - void ewald_sum(double, double, double, double, double, double, double, - double, double &, double &, double); - + void coulomb_integral_wolf(double, double, double, double &, double &, double &, double &); + void wolf_sum(double, double, double, double, double, double, double, double, double &, double &); + void coulomb_integral_ewald(double, double, double, double &, double &, double &, double &); + void ewald_sum(double, double, double, double, double, double, double, double, double &, double &, + double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_coul_wolf.cpp b/src/pair_coul_wolf.cpp index 4466651237..3a260abf28 100644 --- a/src/pair_coul_wolf.cpp +++ b/src/pair_coul_wolf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_coul_wolf.h b/src/pair_coul_wolf.h index bf98332044..1edb0deb31 100644 --- a/src/pair_coul_wolf.h +++ b/src/pair_coul_wolf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(coul/wolf,PairCoulWolf) - +// clang-format off +PairStyle(coul/wolf,PairCoulWolf); +// clang-format on #else #ifndef LMP_PAIR_COUL_WOLF_H @@ -40,12 +40,12 @@ class PairCoulWolf : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_coul,cut_coulsq,alf; + double cut_coul, cut_coulsq, alf; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_deprecated.cpp b/src/pair_deprecated.cpp index 8b3a5a80fc..b691744cd4 100644 --- a/src/pair_deprecated.cpp +++ b/src/pair_deprecated.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_deprecated.h b/src/pair_deprecated.h index 8a14e7424d..36af2e0aa0 100644 --- a/src/pair_deprecated.h +++ b/src/pair_deprecated.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(DEPRECATED,PairDeprecated) -PairStyle(reax,PairDeprecated) - +// clang-format off +PairStyle(DEPRECATED,PairDeprecated); +PairStyle(reax,PairDeprecated); +// clang-format on #else #ifndef LMP_PAIR_DEPRECATED_H @@ -33,10 +33,9 @@ class PairDeprecated : public Pair { virtual void compute(int, int) {} virtual void settings(int, char **); virtual void coeff(int, char **) {} - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_dpd.cpp b/src/pair_dpd.cpp index e0a1510fc0..dec016706e 100644 --- a/src/pair_dpd.cpp +++ b/src/pair_dpd.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_dpd.h b/src/pair_dpd.h index 755c92f91e..5bb2ab33ab 100644 --- a/src/pair_dpd.h +++ b/src/pair_dpd.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dpd,PairDPD) - +// clang-format off +PairStyle(dpd,PairDPD); +// clang-format on #else #ifndef LMP_PAIR_DPD_H @@ -42,17 +42,17 @@ class PairDPD : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_global,temperature; + double cut_global, temperature; int seed; double **cut; - double **a0,**gamma; + double **a0, **gamma; double **sigma; class RanMars *random; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_dpd_tstat.cpp b/src/pair_dpd_tstat.cpp index 8499fb57aa..71c9151856 100644 --- a/src/pair_dpd_tstat.cpp +++ b/src/pair_dpd_tstat.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_dpd_tstat.h b/src/pair_dpd_tstat.h index b214304bc9..4d2e238bb4 100644 --- a/src/pair_dpd_tstat.h +++ b/src/pair_dpd_tstat.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(dpd/tstat,PairDPDTstat) - +// clang-format off +PairStyle(dpd/tstat,PairDPDTstat); +// clang-format on #else #ifndef LMP_PAIR_DPD_TSTAT_H @@ -39,10 +39,10 @@ class PairDPDTstat : public PairDPD { void write_data_all(FILE *); protected: - double t_start,t_stop; + double t_start, t_stop; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_gauss.cpp b/src/pair_gauss.cpp index 380f2a1965..70b01dbbc0 100644 --- a/src/pair_gauss.cpp +++ b/src/pair_gauss.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_gauss.h b/src/pair_gauss.h index b2802d46d6..d59ab074ef 100644 --- a/src/pair_gauss.h +++ b/src/pair_gauss.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(gauss,PairGauss) - +// clang-format off +PairStyle(gauss,PairGauss); +// clang-format on #else #ifndef PAIR_GAUSS_H @@ -28,7 +28,7 @@ class PairGauss : public Pair { public: PairGauss(class LAMMPS *); virtual ~PairGauss(); - virtual void compute(int,int); + virtual void compute(int, int); void settings(int, char **); void coeff(int, char **); double init_one(int, int); @@ -44,13 +44,13 @@ class PairGauss : public Pair { protected: double cut_global; double **cut; - double **a,**b; + double **a, **b; double **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 14d58f9414..c2bc37e931 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -1,7 +1,8 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -340,6 +341,8 @@ void PairHybrid::settings(int narg, char **arg) // multiple[i] = 1 to M if sub-style used multiple times, else 0 + int num_tip4p = 0, num_coul = 0; // count sub-styles with tip4p and coulomb + for (int i = 0; i < nstyles; i++) { int count = 0; for (int j = 0; j < nstyles; j++) { @@ -347,8 +350,22 @@ void PairHybrid::settings(int narg, char **arg) if (j == i) multiple[i] = count; } if (count == 1) multiple[i] = 0; + + if (utils::strmatch(keywords[i],"/tip4p/")) ++num_tip4p; + if (utils::strmatch(keywords[i],"/coul/") + || utils::strmatch(keywords[i],"^comb") + || utils::strmatch(keywords[i],"^reax/c")) ++num_coul; } + if ((num_tip4p > 1) && (comm->me == 0)) + error->warning(FLERR,"Using multiple tip4p sub-styles can result in " + "inconsistent calculation of coulomb interactions"); + + if ((num_tip4p > 0) && (num_coul > 0) && (comm->me == 0)) + error->warning(FLERR,"Using a tip4p sub-style with other sub-styles " + "that include coulomb interactions can result in " + "inconsistent calculation of the coulomb interactions"); + // set pair flags from sub-style flags flags(); diff --git a/src/pair_hybrid.h b/src/pair_hybrid.h index 68b08f3302..e3a2b1a562 100644 --- a/src/pair_hybrid.h +++ b/src/pair_hybrid.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(hybrid,PairHybrid) - +// clang-format off +PairStyle(hybrid,PairHybrid); +// clang-format on #else #ifndef LMP_PAIR_HYBRID_H @@ -35,6 +35,7 @@ class PairHybrid : public Pair { friend class Neighbor; friend class Respa; friend class PairDeprecated; + public: PairHybrid(class LAMMPS *); virtual ~PairHybrid(); @@ -61,37 +62,37 @@ class PairHybrid : public Pair { virtual void add_tally_callback(class Compute *); virtual void del_tally_callback(class Compute *); double atom2cut(int); - double radii2cut(double,double); + double radii2cut(double, double); protected: - int nstyles; // # of sub-styles - Pair **styles; // list of Pair style classes - char **keywords; // style name of each Pair style - int *multiple; // 0 if style used once, else Mth instance + int nstyles; // # of sub-styles + Pair **styles; // list of Pair style classes + char **keywords; // style name of each Pair style + int *multiple; // 0 if style used once, else Mth instance - int outerflag; // toggle compute() when invoked by outer() - int respaflag; // 1 if different substyles are assigned to - // different r-RESPA levels + int outerflag; // toggle compute() when invoked by outer() + int respaflag; // 1 if different substyles are assigned to + // different r-RESPA levels - int **nmap; // # of sub-styles itype,jtype points to - int ***map; // list of sub-styles itype,jtype points to - double **special_lj; // list of per style LJ exclusion factors - double **special_coul; // list of per style Coulomb exclusion factors - int *compute_tally; // list of on/off flags for tally computes + int **nmap; // # of sub-styles itype,jtype points to + int ***map; // list of sub-styles itype,jtype points to + double **special_lj; // list of per style LJ exclusion factors + double **special_coul; // list of per style Coulomb exclusion factors + int *compute_tally; // list of on/off flags for tally computes void allocate(); void flags(); virtual void init_svector(); - virtual void copy_svector(int,int); + virtual void copy_svector(int, int); - void modify_special(int, int, char**); + void modify_special(int, int, char **); double *save_special(); void set_special(int); void restore_special(double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_hybrid_overlay.cpp b/src/pair_hybrid_overlay.cpp index 814b3b2f20..09fd676dd3 100644 --- a/src/pair_hybrid_overlay.cpp +++ b/src/pair_hybrid_overlay.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_hybrid_overlay.h b/src/pair_hybrid_overlay.h index 33ec9dde34..a35261ede0 100644 --- a/src/pair_hybrid_overlay.h +++ b/src/pair_hybrid_overlay.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(hybrid/overlay,PairHybridOverlay) - +// clang-format off +PairStyle(hybrid/overlay,PairHybridOverlay); +// clang-format on #else #ifndef LMP_PAIR_HYBRID_OVERLAY_H @@ -31,10 +31,10 @@ class PairHybridOverlay : public PairHybrid { void coeff(int, char **); void init_svector(); - void copy_svector(int,int); + void copy_svector(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_hybrid_scaled.cpp b/src/pair_hybrid_scaled.cpp index b74515b083..90d1747075 100644 --- a/src/pair_hybrid_scaled.cpp +++ b/src/pair_hybrid_scaled.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_hybrid_scaled.h b/src/pair_hybrid_scaled.h index 7a7293d34f..12db39ae84 100644 --- a/src/pair_hybrid_scaled.h +++ b/src/pair_hybrid_scaled.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(hybrid/scaled,PairHybridScaled) - +// clang-format off +PairStyle(hybrid/scaled,PairHybridScaled); +// clang-format on #else #ifndef LMP_PAIR_HYBRID_SCALED_H @@ -32,7 +32,7 @@ class PairHybridScaled : public PairHybrid { PairHybridScaled(class LAMMPS *); virtual ~PairHybridScaled(); virtual void compute(int, int); - virtual void settings(int, char**); + virtual void settings(int, char **); virtual void coeff(int, char **); virtual void write_restart(FILE *); @@ -40,7 +40,7 @@ class PairHybridScaled : public PairHybrid { virtual double single(int, int, int, int, double, double, double, double &); void init_svector(); - void copy_svector(int,int); + void copy_svector(int, int); protected: double **fsum, **tsum; @@ -50,7 +50,7 @@ class PairHybridScaled : public PairHybrid { int nmaxfsum; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj96_cut.cpp b/src/pair_lj96_cut.cpp index 92cbb47440..b20ebf2c88 100644 --- a/src/pair_lj96_cut.cpp +++ b/src/pair_lj96_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_lj96_cut.h b/src/pair_lj96_cut.h index 782c71b85f..8bd9829b12 100644 --- a/src/pair_lj96_cut.h +++ b/src/pair_lj96_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj96/cut,PairLJ96Cut) - +// clang-format off +PairStyle(lj96/cut,PairLJ96Cut); +// clang-format on #else #ifndef LMP_PAIR_LJ96_CUT_H @@ -49,14 +49,14 @@ class PairLJ96Cut : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_cubic.cpp b/src/pair_lj_cubic.cpp index c5f1f5b257..b9dc3ea94e 100644 --- a/src/pair_lj_cubic.cpp +++ b/src/pair_lj_cubic.cpp @@ -1,7 +1,8 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_lj_cubic.h b/src/pair_lj_cubic.h index 0ce6701b89..b6db913460 100644 --- a/src/pair_lj_cubic.h +++ b/src/pair_lj_cubic.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cubic,PairLJCubic) - +// clang-format off +PairStyle(lj/cubic,PairLJCubic); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUBIC_H @@ -40,13 +40,13 @@ class PairLJCubic : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double **cut,**cut_inner,**cut_inner_sq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; + double **cut, **cut_inner, **cut_inner_sq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_cubic_const.h b/src/pair_lj_cubic_const.h index 3bf59d122d..ce3e578ebc 100644 --- a/src/pair_lj_cubic_const.h +++ b/src/pair_lj_cubic_const.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,14 +19,14 @@ namespace PairLJCubicConstants { // LJ quantities scaled by epsilon and rmin = sigma*2^1/6 - static constexpr double RT6TWO = 1.1224620483093730; // 2^1/6 - static constexpr double SS = 1.1086834179687215; // inflection point (13/7)^1/6 - static constexpr double PHIS = -0.7869822485207097; // energy at s - static constexpr double DPHIDS = 2.6899008972047196; // gradient at s - static constexpr double A3 = 27.9335700460986445; // cubic coefficient - static constexpr double SM = 1.5475372709146737; // cubic cutoff = s*67/48} -} -} + static constexpr double RT6TWO = 1.1224620483093730; // 2^1/6 + static constexpr double SS = 1.1086834179687215; // inflection point (13/7)^1/6 + static constexpr double PHIS = -0.7869822485207097; // energy at s + static constexpr double DPHIDS = 2.6899008972047196; // gradient at s + static constexpr double A3 = 27.9335700460986445; // cubic coefficient + static constexpr double SM = 1.5475372709146737; // cubic cutoff = s*67/48} +} // namespace PairLJCubicConstants +} // namespace LAMMPS_NS #endif // python script to compute the constants diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp index 32ac15da79..fd85f4751b 100644 --- a/src/pair_lj_cut.cpp +++ b/src/pair_lj_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -46,6 +47,8 @@ PairLJCut::PairLJCut(LAMMPS *lmp) : Pair(lmp) PairLJCut::~PairLJCut() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); diff --git a/src/pair_lj_cut.h b/src/pair_lj_cut.h index d5d71ba717..15b1d92175 100644 --- a/src/pair_lj_cut.h +++ b/src/pair_lj_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut,PairLJCut) - +// clang-format off +PairStyle(lj/cut,PairLJCut); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_H @@ -49,14 +49,14 @@ class PairLJCut : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_cut_coul_cut.cpp b/src/pair_lj_cut_coul_cut.cpp index 9ed84bd1a4..8fdc47d5f1 100644 --- a/src/pair_lj_cut_coul_cut.cpp +++ b/src/pair_lj_cut_coul_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -39,6 +40,8 @@ PairLJCutCoulCut::PairLJCutCoulCut(LAMMPS *lmp) : Pair(lmp) PairLJCutCoulCut::~PairLJCutCoulCut() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); diff --git a/src/pair_lj_cut_coul_cut.h b/src/pair_lj_cut_coul_cut.h index 7c3cef885e..e41d0ff20b 100644 --- a/src/pair_lj_cut_coul_cut.h +++ b/src/pair_lj_cut_coul_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/cut,PairLJCutCoulCut) - +// clang-format off +PairStyle(lj/cut/coul/cut,PairLJCutCoulCut); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_CUT_H @@ -43,16 +43,16 @@ class PairLJCutCoulCut : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_cut_coul_debye.cpp b/src/pair_lj_cut_coul_debye.cpp index 84832408cf..1c25b4b9c0 100644 --- a/src/pair_lj_cut_coul_debye.cpp +++ b/src/pair_lj_cut_coul_debye.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_lj_cut_coul_debye.h b/src/pair_lj_cut_coul_debye.h index 04e3540c06..8d9629db86 100644 --- a/src/pair_lj_cut_coul_debye.h +++ b/src/pair_lj_cut_coul_debye.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/debye,PairLJCutCoulDebye) - +// clang-format off +PairStyle(lj/cut/coul/debye,PairLJCutCoulDebye); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_DEBYE_H @@ -38,7 +38,7 @@ class PairLJCutCoulDebye : public PairLJCutCoulCut { double kappa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_cut_coul_dsf.cpp b/src/pair_lj_cut_coul_dsf.cpp index 3382ca1986..79afd1ebeb 100644 --- a/src/pair_lj_cut_coul_dsf.cpp +++ b/src/pair_lj_cut_coul_dsf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_lj_cut_coul_dsf.h b/src/pair_lj_cut_coul_dsf.h index c6391df692..200038ae9f 100644 --- a/src/pair_lj_cut_coul_dsf.h +++ b/src/pair_lj_cut_coul_dsf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/dsf,PairLJCutCoulDSF) - +// clang-format off +PairStyle(lj/cut/coul/dsf,PairLJCutCoulDSF); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_DSF_H @@ -42,18 +42,18 @@ class PairLJCutCoulDSF : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; - double cut_coul,cut_coulsq; + double cut_coul, cut_coulsq; double alpha; - double f_shift,e_shift; + double f_shift, e_shift; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_cut_coul_wolf.cpp b/src/pair_lj_cut_coul_wolf.cpp index f75422b684..a0b6e6587b 100644 --- a/src/pair_lj_cut_coul_wolf.cpp +++ b/src/pair_lj_cut_coul_wolf.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_lj_cut_coul_wolf.h b/src/pair_lj_cut_coul_wolf.h index 2622a0c702..779cc706e6 100644 --- a/src/pair_lj_cut_coul_wolf.h +++ b/src/pair_lj_cut_coul_wolf.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/cut/coul/wolf,PairLJCutCoulWolf) - +// clang-format off +PairStyle(lj/cut/coul/wolf,PairLJCutCoulWolf); +// clang-format on #else #ifndef LMP_PAIR_LJ_CUT_COUL_WOLF_H @@ -42,15 +42,15 @@ class PairLJCutCoulWolf : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; - double cut_coul,cut_coulsq,alf; + double **cut_lj, **cut_ljsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; + double cut_coul, cut_coulsq, alf; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_expand.cpp b/src/pair_lj_expand.cpp index bc6ef98785..9276e0804e 100644 --- a/src/pair_lj_expand.cpp +++ b/src/pair_lj_expand.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_lj_expand.h b/src/pair_lj_expand.h index b42cfb5cef..0cf8323927 100644 --- a/src/pair_lj_expand.h +++ b/src/pair_lj_expand.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/expand,PairLJExpand) - +// clang-format off +PairStyle(lj/expand,PairLJExpand); +// clang-format on #else #ifndef LMP_PAIR_LJ_EXPAND_H @@ -45,13 +45,13 @@ class PairLJExpand : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma,**shift; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **epsilon, **sigma, **shift; + double **lj1, **lj2, **lj3, **lj4, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_gromacs.cpp b/src/pair_lj_gromacs.cpp index 09d6f57dcf..83bf099649 100644 --- a/src/pair_lj_gromacs.cpp +++ b/src/pair_lj_gromacs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_lj_gromacs.h b/src/pair_lj_gromacs.h index c13f5bc4cc..5941be6ba5 100644 --- a/src/pair_lj_gromacs.h +++ b/src/pair_lj_gromacs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/gromacs,PairLJGromacs) - +// clang-format off +PairStyle(lj/gromacs,PairLJGromacs); +// clang-format on #else #ifndef LMP_PAIR_LJ_GROMACS_H @@ -41,16 +41,16 @@ class PairLJGromacs : public Pair { virtual double single(int, int, int, int, double, double, double, double &); protected: - double cut_inner_global,cut_global; - double **cut,**cut_inner,**cut_inner_sq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; - double **ljsw1,**ljsw2,**ljsw3,**ljsw4,**ljsw5; + double cut_inner_global, cut_global; + double **cut, **cut_inner, **cut_inner_sq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; + double **ljsw1, **ljsw2, **ljsw3, **ljsw4, **ljsw5; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_gromacs_coul_gromacs.cpp b/src/pair_lj_gromacs_coul_gromacs.cpp index 3f047d2334..9db42342d9 100644 --- a/src/pair_lj_gromacs_coul_gromacs.cpp +++ b/src/pair_lj_gromacs_coul_gromacs.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_lj_gromacs_coul_gromacs.h b/src/pair_lj_gromacs_coul_gromacs.h index 53be705181..d7075262cc 100644 --- a/src/pair_lj_gromacs_coul_gromacs.h +++ b/src/pair_lj_gromacs_coul_gromacs.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/gromacs/coul/gromacs,PairLJGromacsCoulGromacs) - +// clang-format off +PairStyle(lj/gromacs/coul/gromacs,PairLJGromacsCoulGromacs); +// clang-format on #else #ifndef LMP_PAIR_LJ_GROMACS_COUL_GROMACS_H @@ -42,17 +42,17 @@ class PairLJGromacsCoulGromacs : public Pair { virtual double single(int, int, int, int, double, double, double, double &); protected: - double cut_lj_inner,cut_lj,cut_coul_inner,cut_coul; - double cut_lj_innersq,cut_ljsq,cut_coul_innersq,cut_coulsq,cut_bothsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; - double **ljsw1,**ljsw2,**ljsw3,**ljsw4,**ljsw5; - double coulsw1,coulsw2,coulsw3,coulsw4,coulsw5; + double cut_lj_inner, cut_lj, cut_coul_inner, cut_coul; + double cut_lj_innersq, cut_ljsq, cut_coul_innersq, cut_coulsq, cut_bothsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; + double **ljsw1, **ljsw2, **ljsw3, **ljsw4, **ljsw5; + double coulsw1, coulsw2, coulsw3, coulsw4, coulsw5; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_relres.cpp b/src/pair_lj_relres.cpp index 2f6bba80b5..1ea3684171 100644 --- a/src/pair_lj_relres.cpp +++ b/src/pair_lj_relres.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_lj_relres.h b/src/pair_lj_relres.h index 7df8275dfd..7493440abd 100644 --- a/src/pair_lj_relres.h +++ b/src/pair_lj_relres.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/relres,PairLJRelRes) - +// clang-format off +PairStyle(lj/relres,PairLJRelRes); +// clang-format on #else #ifndef LMP_PAIR_LJ_RELRES_H @@ -42,19 +42,19 @@ class PairLJRelRes : public Pair { protected: double cut_inner_global, cut_global, cutf_inner_global, cutf_global; - double **cut,**cut_inner,**cut_inner_sq,**cutf,**cutfsq,**cutf_inner,**cutf_inner_sq; - double **epsilon,**sigma; - double **epsilonf,**sigmaf; - double **lj1,**lj2,**lj3,**lj4; - double **ljf1,**ljf2,**ljf3,**ljf4; - double **ljsw0,**ljsw1,**ljsw2,**ljsw3,**ljsw4; - double **ljswf0,**ljswf1,**ljswf2,**ljswf3,**ljswf4; - double **offset,**offsetsp,**offsetsm; + double **cut, **cut_inner, **cut_inner_sq, **cutf, **cutfsq, **cutf_inner, **cutf_inner_sq; + double **epsilon, **sigma; + double **epsilonf, **sigmaf; + double **lj1, **lj2, **lj3, **lj4; + double **ljf1, **ljf2, **ljf3, **ljf4; + double **ljsw0, **ljsw1, **ljsw2, **ljsw3, **ljsw4; + double **ljswf0, **ljswf1, **ljswf2, **ljswf3, **ljswf4; + double **offset, **offsetsp, **offsetsm; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_smooth.cpp b/src/pair_lj_smooth.cpp index f45dbaa6bc..f1aba212a3 100644 --- a/src/pair_lj_smooth.cpp +++ b/src/pair_lj_smooth.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_lj_smooth.h b/src/pair_lj_smooth.h index dd06d85a85..bb37a098f6 100644 --- a/src/pair_lj_smooth.h +++ b/src/pair_lj_smooth.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/smooth,PairLJSmooth) - +// clang-format off +PairStyle(lj/smooth,PairLJSmooth); +// clang-format on #else #ifndef LMP_PAIR_LJ_SMOOTH_H @@ -41,17 +41,17 @@ class PairLJSmooth : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_inner_global,cut_global; - double **cut,**cut_inner,**cut_inner_sq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; - double **ljsw0,**ljsw1,**ljsw2,**ljsw3,**ljsw4; + double cut_inner_global, cut_global; + double **cut, **cut_inner, **cut_inner_sq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; + double **ljsw0, **ljsw1, **ljsw2, **ljsw3, **ljsw4; double **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_smooth_linear.cpp b/src/pair_lj_smooth_linear.cpp index 54c0f2612d..7454a2f90c 100644 --- a/src/pair_lj_smooth_linear.cpp +++ b/src/pair_lj_smooth_linear.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_lj_smooth_linear.h b/src/pair_lj_smooth_linear.h index 74b591dbd1..6db6ef5c21 100644 --- a/src/pair_lj_smooth_linear.h +++ b/src/pair_lj_smooth_linear.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(lj/smooth/linear,PairLJSmoothLinear) -PairStyle(lj/sf,PairLJSmoothLinear) - +// clang-format off +PairStyle(lj/smooth/linear,PairLJSmoothLinear); +PairStyle(lj/sf,PairLJSmoothLinear); +// clang-format on #else #ifndef PAIR_LJ_SMOOTH_LINEAR_H @@ -38,19 +38,19 @@ class PairLJSmoothLinear : public Pair { void write_restart_settings(FILE *); void read_restart_settings(FILE *); double single(int, int, int, int, double, double, double, double &); - double single_hessian(int, int, int, int, double, double[3], double, double, double&, double[6]); + double single_hessian(int, int, int, int, double, double[3], double, double, double &, double[6]); protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **ljcut,**dljcut; - double **lj1,**lj2,**lj3,**lj4; + double **epsilon, **sigma; + double **ljcut, **dljcut; + double **lj1, **lj2, **lj3, **lj4; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_mie_cut.cpp b/src/pair_mie_cut.cpp index 503ed60d1b..4fd5dedb69 100644 --- a/src/pair_mie_cut.cpp +++ b/src/pair_mie_cut.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_mie_cut.h b/src/pair_mie_cut.h index fd381b9beb..5e4238fddd 100644 --- a/src/pair_mie_cut.h +++ b/src/pair_mie_cut.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(mie/cut,PairMIECut) - +// clang-format off +PairStyle(mie/cut,PairMIECut); +// clang-format on #else #ifndef LMP_PAIR_MIE_CUT_H @@ -47,15 +47,15 @@ class PairMIECut : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **gamR,**gamA,**Cmie; - double **mie1,**mie2,**mie3,**mie4,**offset; + double **epsilon, **sigma; + double **gamR, **gamA, **Cmie; + double **mie1, **mie2, **mie3, **mie4, **offset; double *cut_respa; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_morse.cpp b/src/pair_morse.cpp index e6d924dab6..64c5339950 100644 --- a/src/pair_morse.cpp +++ b/src/pair_morse.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -36,6 +37,8 @@ PairMorse::PairMorse(LAMMPS *lmp) : Pair(lmp) PairMorse::~PairMorse() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); diff --git a/src/pair_morse.h b/src/pair_morse.h index c5cc2ca72a..56854b020e 100644 --- a/src/pair_morse.h +++ b/src/pair_morse.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(morse,PairMorse) - +// clang-format off +PairStyle(morse,PairMorse); +// clang-format on #else #ifndef LMP_PAIR_MORSE_H @@ -45,14 +45,14 @@ class PairMorse : public Pair { protected: double cut_global; double **cut; - double **d0,**alpha,**r0; + double **d0, **alpha, **r0; double **morse1; double **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_soft.cpp b/src/pair_soft.cpp index 0118d60494..5802cfaf19 100644 --- a/src/pair_soft.cpp +++ b/src/pair_soft.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_soft.h b/src/pair_soft.h index 76e7028b03..1e024ec00c 100644 --- a/src/pair_soft.h +++ b/src/pair_soft.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(soft,PairSoft) - +// clang-format off +PairStyle(soft,PairSoft); +// clang-format on #else #ifndef LMP_PAIR_SOFT_H @@ -52,7 +52,7 @@ class PairSoft : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_table.cpp b/src/pair_table.cpp index 17bd222ca0..ee3a6454c9 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_table.h b/src/pair_table.h index 3def325303..acfd75365e 100644 --- a/src/pair_table.h +++ b/src/pair_table.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(table,PairTable) - +// clang-format off +PairStyle(table,PairTable); +// clang-format on #else #ifndef LMP_PAIR_TABLE_H @@ -40,18 +40,18 @@ class PairTable : public Pair { virtual double single(int, int, int, int, double, double, double, double &); void *extract(const char *, int &); - enum{LOOKUP,LINEAR,SPLINE,BITMAP}; + enum { LOOKUP, LINEAR, SPLINE, BITMAP }; protected: - int tabstyle,tablength; + int tabstyle, tablength; struct Table { - int ninput,rflag,fpflag,match,ntablebits; - int nshiftbits,nmask; - double rlo,rhi,fplo,fphi,cut; - double *rfile,*efile,*ffile; - double *e2file,*f2file; - double innersq,delta,invdelta,deltasq6; - double *rsq,*drsq,*e,*de,*f,*df,*e2,*f2; + int ninput, rflag, fpflag, match, ntablebits; + int nshiftbits, nmask; + double rlo, rhi, fplo, fphi, cut; + double *rfile, *efile, *ffile; + double *e2file, *f2file; + double innersq, delta, invdelta, deltasq6; + double *rsq, *drsq, *e, *de, *f, *df, *e2, *f2; }; int ntables; Table *tables; @@ -70,7 +70,7 @@ class PairTable : public Pair { static double splint(double *, double *, double *, int, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_ufm.cpp b/src/pair_ufm.cpp index 8decaa42a7..c2f7e25227 100644 --- a/src/pair_ufm.cpp +++ b/src/pair_ufm.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_ufm.h b/src/pair_ufm.h index 078fe4099e..714f886eb0 100644 --- a/src/pair_ufm.h +++ b/src/pair_ufm.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,9 +18,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(ufm,PairUFM) - +// clang-format off +PairStyle(ufm,PairUFM); +// clang-format on #else #ifndef LMP_PAIR_UFM_H @@ -49,14 +49,14 @@ class PairUFM : public Pair { protected: double cut_global; - double **cut,**scale; - double **epsilon,**sigma; - double **uf1,**uf2,**uf3,**offset; + double **cut, **scale; + double **epsilon, **sigma; + double **uf1, **uf2, **uf3, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_yukawa.cpp b/src/pair_yukawa.cpp index a24b7faecb..620ca294c3 100644 --- a/src/pair_yukawa.cpp +++ b/src/pair_yukawa.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -35,6 +36,8 @@ PairYukawa::PairYukawa(LAMMPS *lmp) : Pair(lmp) PairYukawa::~PairYukawa() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(cutsq); diff --git a/src/pair_yukawa.h b/src/pair_yukawa.h index 0641c6568b..975bb3c2ac 100644 --- a/src/pair_yukawa.h +++ b/src/pair_yukawa.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(yukawa,PairYukawa) - +// clang-format off +PairStyle(yukawa,PairYukawa); +// clang-format on #else #ifndef LMP_PAIR_YUKAWA_H @@ -44,12 +44,12 @@ class PairYukawa : public Pair { double cut_global; double kappa; double *rad; - double **cut,**a,**offset; + double **cut, **a, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_zbl.cpp b/src/pair_zbl.cpp index 80b623ff35..9e2f368f84 100644 --- a/src/pair_zbl.cpp +++ b/src/pair_zbl.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_zbl.h b/src/pair_zbl.h index 98789e7050..f9d6d92472 100644 --- a/src/pair_zbl.h +++ b/src/pair_zbl.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(zbl,PairZBL) - +// clang-format off +PairStyle(zbl,PairZBL); +// clang-format on #else #ifndef LMP_PAIR_ZBL_H @@ -45,8 +45,8 @@ class PairZBL : public Pair { double cut_global, cut_inner; double cut_globalsq, cut_innersq; double *z; - double **d1a,**d2a,**d3a,**d4a,**zze; - double **sw1,**sw2,**sw3,**sw4,**sw5; + double **d1a, **d2a, **d3a, **d4a, **zze; + double **sw1, **sw2, **sw3, **sw4, **sw5; virtual void allocate(); double e_zbl(double, int, int); @@ -54,7 +54,7 @@ class PairZBL : public Pair { double d2zbldr2(double, int, int); void set_coeff(int, int, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_zbl_const.h b/src/pair_zbl_const.h index 31f05a2e12..325c30034f 100644 --- a/src/pair_zbl_const.h +++ b/src/pair_zbl_const.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -29,6 +29,6 @@ namespace PairZBLConstants { static constexpr double d2 = 0.40290; static constexpr double d3 = 0.94229; static constexpr double d4 = 3.19980; -} -} +} // namespace PairZBLConstants +} // namespace LAMMPS_NS #endif diff --git a/src/pair_zero.cpp b/src/pair_zero.cpp index a4e8eeb76a..5c229d6b71 100644 --- a/src/pair_zero.cpp +++ b/src/pair_zero.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/pair_zero.h b/src/pair_zero.h index 49a8f2bed0..3d59fcbd1a 100644 --- a/src/pair_zero.h +++ b/src/pair_zero.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,9 +22,9 @@ ------------------------------------------------------------------------- */ #ifdef PAIR_CLASS - -PairStyle(zero,PairZero) - +// clang-format off +PairStyle(zero,PairZero); +// clang-format on #else #ifndef LMP_PAIR_ZERO_H @@ -59,7 +59,7 @@ class PairZero : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pointers.h b/src/pointers.h index 373d7a64a7..4ae50715c1 100644 --- a/src/pointers.h +++ b/src/pointers.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -10,6 +10,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +// clang-format off // Pointers class contains ptrs to master copy of // fundamental LAMMPS class ptrs stored in lammps.h @@ -41,7 +42,7 @@ namespace LAMMPS_NS { // enum used for KOKKOS host/device flags -enum ExecutionSpace{Host,Device}; +enum ExecutionSpace{ Host, Device }; // global forward declarations diff --git a/src/potential_file_reader.cpp b/src/potential_file_reader.cpp index a299eb32fc..c1fa157ef9 100644 --- a/src/potential_file_reader.cpp +++ b/src/potential_file_reader.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/potential_file_reader.h b/src/potential_file_reader.h index ca403bb876..c72bf6e48f 100644 --- a/src/potential_file_reader.h +++ b/src/potential_file_reader.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -18,50 +18,48 @@ #ifndef LMP_POTENTIAL_FILE_READER_H #define LMP_POTENTIAL_FILE_READER_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export #include "tokenizer.h" -namespace LAMMPS_NS -{ - class TextFileReader; +namespace LAMMPS_NS { +class TextFileReader; - class PotentialFileReader : protected Pointers { - protected: - TextFileReader *reader; - std::string filename; - std::string filetype; - int unit_convert; +class PotentialFileReader : protected Pointers { + protected: + TextFileReader *reader; + std::string filename; + std::string filetype; + int unit_convert; - TextFileReader *open_potential(const std::string& path); + TextFileReader *open_potential(const std::string &path); - public: - PotentialFileReader(class LAMMPS *lmp, const std::string &filename, - const std::string &potential_name, - const int auto_convert = 0); - PotentialFileReader(class LAMMPS *lmp, const std::string &filename, - const std::string &potential_name, - const std::string &name_suffix, - const int auto_convert = 0); - virtual ~PotentialFileReader(); + public: + PotentialFileReader(class LAMMPS *lmp, const std::string &filename, + const std::string &potential_name, const int auto_convert = 0); + PotentialFileReader(class LAMMPS *lmp, const std::string &filename, + const std::string &potential_name, const std::string &name_suffix, + const int auto_convert = 0); + virtual ~PotentialFileReader(); - void ignore_comments(bool value); + void ignore_comments(bool value); - void skip_line(); - char *next_line(int nparams = 0); - void next_dvector(double *list, int n); - ValueTokenizer next_values(int nparams, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); + void skip_line(); + char *next_line(int nparams = 0); + void next_dvector(double *list, int n); + ValueTokenizer next_values(int nparams, + const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); - // convenience functions - double next_double(); - int next_int(); - tagint next_tagint(); - bigint next_bigint(); - std::string next_string(); + // convenience functions + double next_double(); + int next_int(); + tagint next_tagint(); + bigint next_bigint(); + std::string next_string(); - // unit conversion info - int get_unit_convert() const { return unit_convert; } - }; + // unit conversion info + int get_unit_convert() const { return unit_convert; } +}; -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS #endif diff --git a/src/procmap.cpp b/src/procmap.cpp index 03a605c0d9..ed3839fe7b 100644 --- a/src/procmap.cpp +++ b/src/procmap.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/procmap.h b/src/procmap.h index f342b7d107..8cbf805f5a 100644 --- a/src/procmap.h +++ b/src/procmap.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -23,25 +23,24 @@ class ProcMap : protected Pointers { ProcMap(class LAMMPS *); ~ProcMap() {} void onelevel_grid(int, int *, int *, int, int, int *, int *); - void twolevel_grid(int, int *, int *, int, int *, int *, int, int, - int *, int *); + void twolevel_grid(int, int *, int *, int, int *, int *, int, int, int *, int *); void numa_grid(int, int *, int *, int *); void custom_grid(char *, int, int *, int *); - void cart_map(int, int *, int *, int [3][2], int ***); - void cart_map(int, int *, int, int *, int *, int [3][2], int ***); - void xyz_map(char *, int *, int *, int [3][2], int ***); - void xyz_map(char *, int *, int, int *, int *, int [3][2], int ***); - void numa_map(int, int *, int *, int [3][2], int ***); - void custom_map(int *, int *, int [3][2], int ***); + void cart_map(int, int *, int *, int[3][2], int ***); + void cart_map(int, int *, int, int *, int *, int[3][2], int ***); + void xyz_map(char *, int *, int *, int[3][2], int ***); + void xyz_map(char *, int *, int, int *, int *, int[3][2], int ***); + void numa_map(int, int *, int *, int[3][2], int ***); + void custom_map(int *, int *, int[3][2], int ***); void output(char *, int *, int ***); private: - int procs_per_node; // NUMA params + int procs_per_node; // NUMA params int procs_per_numa; - int node_id; // which node I am in - int nodegrid[3]; // 3d grid of nodes + int node_id; // which node I am in + int nodegrid[3]; // 3d grid of nodes - int **cmap; // info in custom grid file + int **cmap; // info in custom grid file int factor(int, int **); int combine_factors(int, int **, int, int **, int **); @@ -52,7 +51,7 @@ class ProcMap : protected Pointers { void grid_shift(int, int, int &, int &); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/random_mars.cpp b/src/random_mars.cpp index cefb246648..a0eb24eed3 100644 --- a/src/random_mars.cpp +++ b/src/random_mars.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/random_mars.h b/src/random_mars.h index e7862d19e4..ea241d4501 100644 --- a/src/random_mars.h +++ b/src/random_mars.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -35,11 +35,11 @@ class RanMars : protected Pointers { int save; double second; double *u; - int i97,j97; - double c,cd,cm; + int i97, j97; + double c, cd, cm; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/random_park.cpp b/src/random_park.cpp index 551e4cd6ca..34a5378a35 100644 --- a/src/random_park.cpp +++ b/src/random_park.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/random_park.h b/src/random_park.h index e469491b35..d230dfe40b 100644 --- a/src/random_park.h +++ b/src/random_park.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -28,11 +28,11 @@ class RanPark : protected Pointers { int state(); private: - int seed,save; + int seed, save; double second; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/rcb.cpp b/src/rcb.cpp index 6f123656a3..b4d1c135ec 100644 --- a/src/rcb.cpp +++ b/src/rcb.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/rcb.h b/src/rcb.h index 0d7cf0eb4e..4201247c59 100644 --- a/src/rcb.h +++ b/src/rcb.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,21 +22,21 @@ class RCB : protected Pointers { public: // set by compute() - int noriginal; // # of dots I own before balancing - int nfinal; // # of dots I own after balancing - int nkeep; // how many dots of noriginal I still own - // will be first nkept of nfinal list - int *recvproc; // proc IDs of nfinal dots - int *recvindex; // index of nfinal dots on owning procs - // based on input list for compute() - double *lo,*hi; // final bounding box of my RCB sub-domain - double cut; // single cut (in Tree) owned by this proc - int cutdim; // dimension (0,1,2) of the cut + int noriginal; // # of dots I own before balancing + int nfinal; // # of dots I own after balancing + int nkeep; // how many dots of noriginal I still own + // will be first nkept of nfinal list + int *recvproc; // proc IDs of nfinal dots + int *recvindex; // index of nfinal dots on owning procs + // based on input list for compute() + double *lo, *hi; // final bounding box of my RCB sub-domain + double cut; // single cut (in Tree) owned by this proc + int cutdim; // dimension (0,1,2) of the cut // set by invert() - int *sendproc; // proc to send each of my noriginal dots to - int *sendindex; // index of dot in receiver's nfinal list + int *sendproc; // proc to send each of my noriginal dots to + int *sendindex; // index of dot in receiver's nfinal list RCB(class LAMMPS *); ~RCB(); @@ -52,47 +52,47 @@ class RCB : protected Pointers { // RCB cut info struct Median { - double totallo,totalhi; // weight in each half of active partition - double valuelo,valuehi; // position of dot(s) nearest to cut - double wtlo,wthi; // total weight of dot(s) at that position - int countlo,counthi; // # of dots at that position - int proclo,prochi; // unique proc who owns a nearest dot + double totallo, totalhi; // weight in each half of active partition + double valuelo, valuehi; // position of dot(s) nearest to cut + double wtlo, wthi; // total weight of dot(s) at that position + int countlo, counthi; // # of dots at that position + int proclo, prochi; // unique proc who owns a nearest dot }; struct BBox { - double lo[3],hi[3]; // corner points of a bounding box + double lo[3], hi[3]; // corner points of a bounding box }; private: - int me,nprocs; + int me, nprocs; // point to balance on struct Dot { - double x[3]; // coord of point - double wt; // weight of point - int proc; // owning proc - int index; // index on owning proc + double x[3]; // coord of point + double wt; // weight of point + int proc; // owning proc + int index; // index on owning proc }; // tree of RCB cuts struct Tree { - double cut; // position of cut - int dim; // dimension = 0/1/2 of cut + double cut; // position of cut + int dim; // dimension = 0/1/2 of cut }; // inversion message struct Invert { - int rindex; // index on receiving proc - int sproc; // sending proc - int sindex; // index on sending proc + int rindex; // index on receiving proc + int sproc; // sending proc + int sindex; // index on sending proc }; - Dot *dots; // dots on this proc - int ndot; // # of dots on this proc - int maxdot; // allocated size of dots + Dot *dots; // dots on this proc + int ndot; // # of dots on this proc + int maxdot; // allocated size of dots int ndotorig; int nlist; @@ -104,29 +104,29 @@ class RCB : protected Pointers { int maxbuf; Dot *buf; - int maxrecv,maxsend; + int maxrecv, maxsend; BBox bbox; class Irregular *irregular; - MPI_Op box_op,med_op; - MPI_Datatype box_type,med_type; + MPI_Op box_op, med_op; + MPI_Datatype box_type, med_type; - int reuse; // 1/0 to use/not use previous cuts - int dottop; // dots >= this index are new - double bboxlo[3]; // bounding box of final RCB sub-domain + int reuse; // 1/0 to use/not use previous cuts + int dottop; // dots >= this index are new + double bboxlo[3]; // bounding box of final RCB sub-domain double bboxhi[3]; - Tree *tree; // tree of RCB cuts, used by reuse() - int counters[7]; // diagnostic counts - // 0 = # of median iterations - // 1 = # of points sent - // 2 = # of points received - // 3 = most points this proc ever owns - // 4 = most point memory this proc ever allocs - // 5 = # of times a previous cut is re-used - // 6 = # of reallocs of point vector + Tree *tree; // tree of RCB cuts, used by reuse() + int counters[7]; // diagnostic counts + // 0 = # of median iterations + // 1 = # of points sent + // 2 = # of points received + // 3 = most points this proc ever owns + // 4 = most point memory this proc ever allocs + // 5 = # of times a previous cut is re-used + // 6 = # of reallocs of point vector }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/read_data.cpp b/src/read_data.cpp index babb8d08f6..12ad6c3b8c 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/read_data.h b/src/read_data.h index 93f6e39feb..482c45e6e6 100644 --- a/src/read_data.h +++ b/src/read_data.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(read_data,ReadData) - +// clang-format off +CommandStyle(read_data,ReadData); +// clang-format on #else #ifndef LMP_READ_DATA_H @@ -31,20 +31,20 @@ class ReadData : public Command { void command(int, char **); private: - int me,compressed; - char *line,*keyword,*buffer,*style; + int me, compressed; + char *line, *keyword, *buffer, *style; FILE *fp; char **coeffarg; - int ncoeffarg,maxcoeffarg; - char argoffset1[8],argoffset2[8]; + int ncoeffarg, maxcoeffarg; + char argoffset1[8], argoffset2[8]; bigint id_offset, mol_offset; int nlocal_previous; bigint natoms; - bigint nbonds,nangles,ndihedrals,nimpropers; + bigint nbonds, nangles, ndihedrals, nimpropers; int ntypes; - int nbondtypes,nangletypes,ndihedraltypes,nimpropertypes; + int nbondtypes, nangletypes, ndihedraltypes, nimpropertypes; bigint nellipsoids; class AtomVecEllipsoid *avec_ellipsoid; @@ -57,18 +57,18 @@ class ReadData : public Command { // box info - double boxlo[3],boxhi[3]; - double xy,xz,yz; + double boxlo[3], boxhi[3]; + double xy, xz, yz; int triclinic; // optional args - int addflag,offsetflag,shiftflag,coeffflag; + int addflag, offsetflag, shiftflag, coeffflag; tagint addvalue; - int toffset,boffset,aoffset,doffset,ioffset; + int toffset, boffset, aoffset, doffset, ioffset; double shift[3]; - int extra_atom_types,extra_bond_types,extra_angle_types; - int extra_dihedral_types,extra_improper_types; + int extra_atom_types, extra_bond_types, extra_angle_types; + int extra_dihedral_types, extra_improper_types; int groupbit; int nfix; @@ -110,7 +110,7 @@ class ReadData : public Command { void fix(int, char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/read_dump.cpp b/src/read_dump.cpp index fbaab2cc5d..82f5c969df 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -232,20 +233,21 @@ void ReadDump::setup_reader(int narg, char **arg) // create Nreader reader classes per reader // match readerstyle to options in style_reader.h - if (0) return; // dummy line to enable else-if macro expansion + if (0) { + return; // dummy line to enable else-if macro expansion #define READER_CLASS #define ReaderStyle(key,Class) \ - else if (strcmp(readerstyle,#key) == 0) { \ - for (int i = 0; i < nreader; i++) \ + } else if (strcmp(readerstyle,#key) == 0) { \ + for (int i = 0; i < nreader; i++) { \ readers[i] = new Class(lmp); \ - } + } #include "style_reader.h" // IWYU pragma: keep #undef READER_CLASS // unrecognized style - else error->all(FLERR,utils::check_packages_for_style("reader",readerstyle,lmp)); + } else error->all(FLERR,utils::check_packages_for_style("reader",readerstyle,lmp)); if (utils::strmatch(readerstyle,"^adios")) { // everyone is a reader with adios diff --git a/src/read_dump.h b/src/read_dump.h index df467db583..92e5e69c47 100644 --- a/src/read_dump.h +++ b/src/read_dump.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(read_dump,ReadDump) - +// clang-format off +CommandStyle(read_dump,ReadDump); +// clang-format on #else #ifndef LMP_READ_DUMP_H @@ -40,62 +40,62 @@ class ReadDump : public Command { void atoms(); int fields_and_keywords(int, char **); -private: - int me,nprocs; + private: + int me, nprocs; - char **files; // list of input dump files to process - int nfile; // # of dump files to process (each may be parallel) - int currentfile; // current open file (0 to nfile-1) + char **files; // list of input dump files to process + int nfile; // # of dump files to process (each may be parallel) + int currentfile; // current open file (0 to nfile-1) - MPI_Comm clustercomm; // comm for proc cluster that reads/shares a file - int me_cluster,nprocs_cluster; // proc ID and count for my read cluster + MPI_Comm clustercomm; // comm for proc cluster that reads/shares a file + int me_cluster, nprocs_cluster; // proc ID and count for my read cluster - int multiproc; // 0 = each dump file is a single file - // 1 = each dump file is parallel (multiple files) - int multiproc_nfile; // number of parallel files in one dump file + int multiproc; // 0 = each dump file is a single file + // 1 = each dump file is parallel (multiple files) + int multiproc_nfile; // number of parallel files in one dump file - int nreader; // # of parallel dump files read by my cluster - int firstfile; // index of 1st dump file my cluster reads - // (0 to multiproc_nfile-1) - int filereader; // 1 if this proc reads from a dump file(s) - int parallel; // 1 if parallel reading (e.g. via ADIOS2) + int nreader; // # of parallel dump files read by my cluster + int firstfile; // index of 1st dump file my cluster reads + // (0 to multiproc_nfile-1) + int filereader; // 1 if this proc reads from a dump file(s) + int parallel; // 1 if parallel reading (e.g. via ADIOS2) - int dimension; // same as in Domain + int dimension; // same as in Domain int triclinic; - int boxflag; // overwrite simulation with dump file box params - int replaceflag,addflag; // flags for processing dump snapshot atoms - int trimflag,purgeflag; - int scaleflag; // user 0/1 if dump file coords are unscaled/scaled - int wrapflag; // user 0/1 if dump file coords are unwrapped/wrapped - char *readerstyle; // style of dump files to read + int boxflag; // overwrite simulation with dump file box params + int replaceflag, addflag; // flags for processing dump snapshot atoms + int trimflag, purgeflag; + int scaleflag; // user 0/1 if dump file coords are unscaled/scaled + int wrapflag; // user 0/1 if dump file coords are unwrapped/wrapped + char *readerstyle; // style of dump files to read - int nnew; // # of dump file atoms this proc owns - int nfield; // # of fields to extract from dump file - int *fieldtype; // type of each field = X,VY,IZ,etc - char **fieldlabel; // user specified label for field - double **fields; // per-atom field values - int maxnew; // allocation size of fields array - double **buf; // read buffer + int nnew; // # of dump file atoms this proc owns + int nfield; // # of fields to extract from dump file + int *fieldtype; // type of each field = X,VY,IZ,etc + char **fieldlabel; // user specified label for field + double **fields; // per-atom field values + int maxnew; // allocation size of fields array + double **buf; // read buffer - int scaled; // 0/1 if dump file coords are unscaled/scaled - int wrapped; // 0/1 if dump file coords are unwrapped/wrapped + int scaled; // 0/1 if dump file coords are unscaled/scaled + int wrapped; // 0/1 if dump file coords are unwrapped/wrapped - double box[3][3]; // dump file box parameters - double xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz; // dump snapshot box params - double xprd,yprd,zprd; + double box[3][3]; // dump file box parameters + double xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz; // dump snapshot box params + double xprd, yprd, zprd; - bigint *nsnapatoms; // # of atoms in one snapshot from - // one (parallel) dump file - // nreader-length vector b/c a reader proc - // may read from multiple parallel dump files + bigint *nsnapatoms; // # of atoms in one snapshot from + // one (parallel) dump file + // nreader-length vector b/c a reader proc + // may read from multiple parallel dump files - int npurge,nreplace,ntrim,nadd; // stats on processed atoms - int yindex,zindex; // field index for Y,Z coords + int npurge, nreplace, ntrim, nadd; // stats on processed atoms + int yindex, zindex; // field index for Y,Z coords - class Reader **readers; // class that reads a dump file - // nreader-length list of readers if proc reads - // from multiple parallel dump files + class Reader **readers; // class that reads a dump file + // nreader-length list of readers if proc reads + // from multiple parallel dump files void read_atoms(); void process_atoms(); @@ -111,7 +111,7 @@ private: double zfield(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/read_restart.cpp b/src/read_restart.cpp index 8518aca724..ac00a7d086 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/read_restart.h b/src/read_restart.h index 51b154bb52..a3f889fbc3 100644 --- a/src/read_restart.h +++ b/src/read_restart.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(read_restart,ReadRestart) - +// clang-format off +CommandStyle(read_restart,ReadRestart); +// clang-format on #else #ifndef LMP_READ_RESTART_H @@ -30,21 +30,21 @@ class ReadRestart : public Command { void command(int, char **); private: - int me,nprocs; + int me, nprocs; FILE *fp; - int multiproc; // 0 = restart file is a single file - // 1 = restart file is parallel (multiple files) - int multiproc_file; // # of parallel files in restart - int nprocs_file; // total # of procs that wrote restart file - int revision; // revision number of the restart file format + int multiproc; // 0 = restart file is a single file + // 1 = restart file is parallel (multiple files) + int multiproc_file; // # of parallel files in restart + int nprocs_file; // total # of procs that wrote restart file + int revision; // revision number of the restart file format // MPI-IO values - int mpiioflag; // 1 for MPIIO output, else 0 - class RestartMPIIO *mpiio; // MPIIO for restart file input + int mpiioflag; // 1 for MPIIO output, else 0 + class RestartMPIIO *mpiio; // MPIIO for restart file input bigint assignedChunkSize; - MPI_Offset assignedChunkOffset,headerOffset; + MPI_Offset assignedChunkOffset, headerOffset; void file_search(char *, char *); void header(); @@ -65,7 +65,7 @@ class ReadRestart : public Command { void read_double_vec(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/reader.cpp b/src/reader.cpp index ae6f7f5329..71036e7444 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/reader.h b/src/reader.h index a31fc99531..2d71750f98 100644 --- a/src/reader.h +++ b/src/reader.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -25,23 +25,23 @@ class Reader : protected Pointers { Reader(class LAMMPS *); virtual ~Reader() {} - virtual void settings(int, char**); + virtual void settings(int, char **); virtual int read_time(bigint &) = 0; virtual void skip() = 0; - virtual bigint read_header(double [3][3], int &, int &, int, int, int *, char **, - int, int, int &, int &, int &, int &) = 0; + virtual bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, + int &, int &, int &) = 0; virtual void read_atoms(int, int, double **) = 0; virtual void open_file(const char *); virtual void close_file(); protected: - FILE *fp; // pointer to opened file or pipe - int compressed; // flag for dump file compression + FILE *fp; // pointer to opened file or pipe + int compressed; // flag for dump file compression }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/reader_native.cpp b/src/reader_native.cpp index 7c8bd9c3a8..b490410d02 100644 --- a/src/reader_native.cpp +++ b/src/reader_native.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/reader_native.h b/src/reader_native.h index e2f5c04d7f..6b171ce77a 100644 --- a/src/reader_native.h +++ b/src/reader_native.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef READER_CLASS - -ReaderStyle(native,ReaderNative) - +// clang-format off +ReaderStyle(native,ReaderNative); +// clang-format on #else #ifndef LMP_READER_NATIVE_H @@ -35,21 +35,21 @@ class ReaderNative : public Reader { int read_time(bigint &); void skip(); - bigint read_header(double [3][3], int &, int &, int, int, int *, char **, - int, int, int &, int &, int &, int &); + bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, int &, + int &, int &); void read_atoms(int, int, double **); -private: - char *line; // line read from dump file + private: + char *line; // line read from dump file - int nwords; // # of per-atom columns in dump file - int *fieldindex; // + int nwords; // # of per-atom columns in dump file + int *fieldindex; // - int find_label(const std::string &label, const std::map & labels); + int find_label(const std::string &label, const std::map &labels); void read_lines(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/reader_xyz.cpp b/src/reader_xyz.cpp index b144857879..1f379bc0dd 100644 --- a/src/reader_xyz.cpp +++ b/src/reader_xyz.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/reader_xyz.h b/src/reader_xyz.h index 13cf069bd9..0807be719e 100644 --- a/src/reader_xyz.h +++ b/src/reader_xyz.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,9 +14,9 @@ ------------------------------------------------------------------------- */ #ifdef READER_CLASS - -ReaderStyle(xyz,ReaderXYZ) - +// clang-format off +ReaderStyle(xyz,ReaderXYZ); +// clang-format on #else #ifndef LMP_READER_XYZ_H @@ -33,22 +33,22 @@ class ReaderXYZ : public Reader { int read_time(bigint &); void skip(); - bigint read_header(double [3][3], int &, int &, int, int, int *, char **, - int, int, int &, int &, int &, int &); + bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, int &, + int &, int &); void read_atoms(int, int, double **); -private: - char *line; // line read from dump file - bigint nstep; // current (time) step number - bigint natoms; // current number of atoms - bigint nid; // current atom id. + private: + char *line; // line read from dump file + bigint nstep; // current (time) step number + bigint natoms; // current number of atoms + bigint nid; // current atom id. - int *fieldindex; // mapping of input fields to dump + int *fieldindex; // mapping of input fields to dump void read_lines(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region.cpp b/src/region.cpp index c442463d4f..750677ad8f 100644 --- a/src/region.cpp +++ b/src/region.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/region.h b/src/region.h index 54112283a9..043d3bdd36 100644 --- a/src/region.h +++ b/src/region.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -14,57 +14,57 @@ #ifndef LMP_REGION_H #define LMP_REGION_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Region : protected Pointers { public: - char *id,*style; + char *id, *style; int interior; // 1 for interior, 0 for exterior int scaleflag; // 1 for lattice, 0 for box - double xscale,yscale,zscale; // scale factors for box/lattice units - double extent_xlo,extent_xhi; // bounding box on region - double extent_ylo,extent_yhi; - double extent_zlo,extent_zhi; - int bboxflag; // 1 if bounding box is computable - int varshape; // 1 if region shape changes over time - int dynamic; // 1 if position/orient changes over time - int moveflag,rotateflag; // 1 if position/orientation changes - int openflag; // 1 if any face is open - int open_faces[6]; // flags for which faces are open + double xscale, yscale, zscale; // scale factors for box/lattice units + double extent_xlo, extent_xhi; // bounding box on region + double extent_ylo, extent_yhi; + double extent_zlo, extent_zhi; + int bboxflag; // 1 if bounding box is computable + int varshape; // 1 if region shape changes over time + int dynamic; // 1 if position/orient changes over time + int moveflag, rotateflag; // 1 if position/orientation changes + int openflag; // 1 if any face is open + int open_faces[6]; // flags for which faces are open - int copymode; // 1 if copy of original class + int copymode; // 1 if copy of original class // contact = particle near region surface (for soft interactions) // touch = particle touching region surface (for granular interactions) struct Contact { - double r; // distance between particle & surf, r > 0.0 - double delx,dely,delz; // vector from surface pt to particle - double radius; // curvature of region at contact point - int iwall; // unique id of wall for storing shear history - int varflag; // 1 if wall can be variable-controlled + double r; // distance between particle & surf, r > 0.0 + double delx, dely, delz; // vector from surface pt to particle + double radius; // curvature of region at contact point + int iwall; // unique id of wall for storing shear history + int varflag; // 1 if wall can be variable-controlled }; - Contact *contact; // list of contacts - int cmax; // max # of contacts possible with region - int tmax; // max # of touching contacts possible + Contact *contact; // list of contacts + int cmax; // max # of contacts possible with region + int tmax; // max # of touching contacts possible // motion attributes of region // public so can be accessed by other classes - double dx,dy,dz,theta; // current displacement and orientation - double v[3]; // translational velocity - double rpoint[3]; // current origin of rotation axis - double omega[3]; // angular velocity - double rprev; // speed of time-dependent radius, if applicable - double xcenter[3]; // translated/rotated center of cylinder/sphere (only used if varshape) - double prev[5]; // stores displacement (X3), angle and if - // necessary, region variable size (e.g. radius) - // at previous time step - int vel_timestep; // store timestep at which set_velocity was called - // prevents multiple fix/wall/gran/region calls - int nregion; // For union and intersect + double dx, dy, dz, theta; // current displacement and orientation + double v[3]; // translational velocity + double rpoint[3]; // current origin of rotation axis + double omega[3]; // angular velocity + double rprev; // speed of time-dependent radius, if applicable + double xcenter[3]; // translated/rotated center of cylinder/sphere (only used if varshape) + double prev[5]; // stores displacement (X3), angle and if + // necessary, region variable size (e.g. radius) + // at previous time step + int vel_timestep; // store timestep at which set_velocity was called + // prevents multiple fix/wall/gran/region calls + int nregion; // For union and intersect int size_restart; int *list; @@ -82,8 +82,8 @@ class Region : protected Pointers { virtual void set_velocity(); void velocity_contact(double *, double *, int); virtual void write_restart(FILE *); - virtual int restart(char *, int&); - virtual void length_restart_string(int&); + virtual int restart(char *, int &); + virtual void length_restart_string(int &); virtual void reset_vel(); // implemented by each region, not called by other classes @@ -94,25 +94,25 @@ class Region : protected Pointers { virtual void shape_update() {} virtual void pretransform(); virtual void set_velocity_shape() {} - virtual void velocity_contact_shape(double*, double*) {} + virtual void velocity_contact_shape(double *, double *) {} protected: void add_contact(int, double *, double, double, double); void options(int, char **); void point_on_line_segment(double *, double *, double *, double *); void forward_transform(double &, double &, double &); - double point[3],runit[3]; + double point[3], runit[3]; private: - char *xstr,*ystr,*zstr,*tstr; - int xvar,yvar,zvar,tvar; + char *xstr, *ystr, *zstr, *tstr; + int xvar, yvar, zvar, tvar; double axis[3]; void inverse_transform(double &, double &, double &); void rotate(double &, double &, double &, double); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/region_block.cpp b/src/region_block.cpp index 4e433f424a..36dad4ce84 100644 --- a/src/region_block.cpp +++ b/src/region_block.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/region_block.h b/src/region_block.h index cfb37185ac..943e6ce40f 100644 --- a/src/region_block.h +++ b/src/region_block.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef REGION_CLASS - -RegionStyle(block,RegBlock) - +// clang-format off +RegionStyle(block,RegBlock); +// clang-format on #else #ifndef LMP_REGION_BLOCK_H @@ -35,7 +35,7 @@ class RegBlock : public Region { int surface_exterior(double *, double); protected: - double xlo,xhi,ylo,yhi,zlo,zhi; + double xlo, xhi, ylo, yhi, zlo, zhi; double corners[6][4][3]; double face[6][3]; @@ -43,7 +43,7 @@ class RegBlock : public Region { int inside_face(double *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_cone.cpp b/src/region_cone.cpp index de3f8b254b..886170c64a 100644 --- a/src/region_cone.cpp +++ b/src/region_cone.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/region_cone.h b/src/region_cone.h index 0976749d95..917144613f 100644 --- a/src/region_cone.h +++ b/src/region_cone.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef REGION_CLASS - -RegionStyle(cone,RegCone) - +// clang-format off +RegionStyle(cone,RegCone); +// clang-format on #else #ifndef LMP_REGION_CONE_H @@ -34,15 +34,15 @@ class RegCone : public Region { private: char axis; - double c1,c2; - double radiuslo,radiushi; - double lo,hi; + double c1, c2; + double radiuslo, radiushi; + double lo, hi; double maxradius; double closest(double *, double *, double *, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index 2092a03b79..efa13bd02a 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/region_cylinder.h b/src/region_cylinder.h index 332826a855..70635e0a3f 100644 --- a/src/region_cylinder.h +++ b/src/region_cylinder.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef REGION_CLASS - -RegionStyle(cylinder,RegCylinder) - +// clang-format off +RegionStyle(cylinder,RegCylinder); +// clang-format on #else #ifndef LMP_REGION_CYLINDER_H @@ -40,19 +40,18 @@ class RegCylinder : public Region { private: char axis; - double c1,c2; + double c1, c2; double radius; - double lo,hi; - int c1style,c1var; - int c2style,c2var; - int rstyle,rvar; - char *c1str,*c2str,*rstr; + double lo, hi; + int c1style, c1var; + int c2style, c2var; + int rstyle, rvar; + char *c1str, *c2str, *rstr; void variable_check(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_deprecated.cpp b/src/region_deprecated.cpp index 93b89f0849..e6d81fdc44 100644 --- a/src/region_deprecated.cpp +++ b/src/region_deprecated.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/region_deprecated.h b/src/region_deprecated.h index f26a79277c..2c473e05f0 100644 --- a/src/region_deprecated.h +++ b/src/region_deprecated.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,11 +12,10 @@ ------------------------------------------------------------------------- */ #ifdef REGION_CLASS - +// clang-format off // list all deprecated and removed region styles here - -RegionStyle(DEPRECATED,RegionDeprecated) - +RegionStyle(DEPRECATED,RegionDeprecated); +// clang-format on #else #ifndef LMP_REGION_DEPRECATED_H @@ -34,9 +33,9 @@ class RegionDeprecated : public Region { virtual int inside(double, double, double) { return 0; } virtual int surface_interior(double *, double) { return 0; } virtual int surface_exterior(double *, double) { return 0; } - }; +}; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_intersect.cpp b/src/region_intersect.cpp index ad67dd1fe5..24b2da5a16 100644 --- a/src/region_intersect.cpp +++ b/src/region_intersect.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/region_intersect.h b/src/region_intersect.h index dde7c3e1e2..e1c35bb594 100644 --- a/src/region_intersect.h +++ b/src/region_intersect.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef REGION_CLASS - -RegionStyle(intersect,RegIntersect) - +// clang-format off +RegionStyle(intersect,RegIntersect); +// clang-format on #else #ifndef LMP_REGION_INTERSECT_H @@ -35,16 +35,16 @@ class RegIntersect : public Region { void shape_update(); void pretransform(); void set_velocity(); - void length_restart_string(int&); + void length_restart_string(int &); void write_restart(FILE *); - int restart(char *, int&); + int restart(char *, int &); void reset_vel(); private: char **idsub; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_plane.cpp b/src/region_plane.cpp index af74a51572..2e99e4a0f9 100644 --- a/src/region_plane.cpp +++ b/src/region_plane.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/region_plane.h b/src/region_plane.h index 67095248e8..b327498363 100644 --- a/src/region_plane.h +++ b/src/region_plane.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef REGION_CLASS - -RegionStyle(plane,RegPlane) - +// clang-format off +RegionStyle(plane,RegPlane); +// clang-format on #else #ifndef LMP_REGION_PLANE_H @@ -33,11 +33,11 @@ class RegPlane : public Region { int surface_exterior(double *, double); private: - double xp,yp,zp; + double xp, yp, zp; double normal[3]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_prism.cpp b/src/region_prism.cpp index 51c67c706c..375bd5ddab 100644 --- a/src/region_prism.cpp +++ b/src/region_prism.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/region_prism.h b/src/region_prism.h index f5914ba06a..0bc02079e8 100644 --- a/src/region_prism.h +++ b/src/region_prism.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef REGION_CLASS - -RegionStyle(prism,RegPrism) - +// clang-format off +RegionStyle(prism,RegPrism); +// clang-format on #else #ifndef LMP_REGION_PRISM_H @@ -35,22 +35,22 @@ class RegPrism : public Region { int surface_exterior(double *, double); private: - double xlo,xhi,ylo,yhi,zlo,zhi; - double xy,xz,yz; - double h[3][3],hinv[3][3]; + double xlo, xhi, ylo, yhi, zlo, zhi; + double xy, xz, yz; + double h[3][3], hinv[3][3]; int dimension; - double a[3],b[3],c[3]; // edge vectors of region - double clo[3],chi[3]; // opposite corners of prism - double face[6][3]; // unit normals of 6 prism faces - double corners[8][3]; // 8 corner pts of prism - int tri[12][3]; // 3 corner pts of 12 triangles (2 per face) + double a[3], b[3], c[3]; // edge vectors of region + double clo[3], chi[3]; // opposite corners of prism + double face[6][3]; // unit normals of 6 prism faces + double corners[8][3]; // 8 corner pts of prism + int tri[12][3]; // 3 corner pts of 12 triangles (2 per face) void find_nearest(double *, double &, double &, double &); int inside_tri(double *, double *, double *, double *, double *); double closest(double *, double *, double *, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_sphere.cpp b/src/region_sphere.cpp index 3a5a51834b..18493c258a 100644 --- a/src/region_sphere.cpp +++ b/src/region_sphere.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/region_sphere.h b/src/region_sphere.h index 4ca385c4ae..3cec54512e 100644 --- a/src/region_sphere.h +++ b/src/region_sphere.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef REGION_CLASS - -RegionStyle(sphere,RegSphere) - +// clang-format off +RegionStyle(sphere,RegSphere); +// clang-format on #else #ifndef LMP_REGION_SPHERE_H @@ -36,20 +36,19 @@ class RegSphere : public Region { void set_velocity_shape(); void velocity_contact_shape(double *, double *); - private: - double xc,yc,zc; + double xc, yc, zc; double radius; - int xstyle,xvar; - int ystyle,yvar; - int zstyle,zvar; - int rstyle,rvar; - char *xstr,*ystr,*zstr,*rstr; + int xstyle, xvar; + int ystyle, yvar; + int zstyle, zvar; + int rstyle, rvar; + char *xstr, *ystr, *zstr, *rstr; void variable_check(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_union.cpp b/src/region_union.cpp index 144bc4828c..b7e0518d75 100644 --- a/src/region_union.cpp +++ b/src/region_union.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/region_union.h b/src/region_union.h index a87d236afb..b9099d9f86 100644 --- a/src/region_union.h +++ b/src/region_union.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef REGION_CLASS - -RegionStyle(union,RegUnion) - +// clang-format off +RegionStyle(union,RegUnion); +// clang-format on #else #ifndef LMP_REGION_UNION_H @@ -35,15 +35,16 @@ class RegUnion : public Region { void shape_update(); void pretransform(); void set_velocity(); - void length_restart_string(int&); + void length_restart_string(int &); void write_restart(FILE *); - int restart(char *, int&); + int restart(char *, int &); void reset_vel(); + private: char **idsub; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/replicate.cpp b/src/replicate.cpp index 6a56feb906..2c2b512026 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/replicate.h b/src/replicate.h index 36d1c5ff32..48abd7b4be 100644 --- a/src/replicate.h +++ b/src/replicate.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(replicate,Replicate) - +// clang-format off +CommandStyle(replicate,Replicate); +// clang-format on #else #ifndef LMP_REPLICATE_H @@ -30,7 +30,7 @@ class Replicate : public Command { void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/rerun.cpp b/src/rerun.cpp index 9571724e2d..f9bb507a11 100644 --- a/src/rerun.cpp +++ b/src/rerun.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/rerun.h b/src/rerun.h index 46039a4360..272df6bb0a 100644 --- a/src/rerun.h +++ b/src/rerun.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(rerun,Rerun) - +// clang-format off +CommandStyle(rerun,Rerun); +// clang-format on #else #ifndef LMP_RERUN_H @@ -30,7 +30,7 @@ class Rerun : public Command { void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/reset_atom_ids.cpp b/src/reset_atom_ids.cpp index cc9a05d11e..3aea800b6f 100644 --- a/src/reset_atom_ids.cpp +++ b/src/reset_atom_ids.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/reset_atom_ids.h b/src/reset_atom_ids.h index f22b12b17f..b62dc25b77 100644 --- a/src/reset_atom_ids.h +++ b/src/reset_atom_ids.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(reset_atom_ids,ResetIDs) - +// clang-format off +CommandStyle(reset_atom_ids,ResetIDs); +// clang-format on #else #ifndef LMP_RESET_IDS_H @@ -28,7 +28,7 @@ class ResetIDs : public Command { public: struct AtomRvous { bigint ibin; - int proc,ilocal; + int proc, ilocal; double x[3]; }; @@ -46,7 +46,7 @@ class ResetIDs : public Command { void command(int, char **); private: - bigint binlo,binhi; + bigint binlo, binhi; // callback functions for rendezvous communication @@ -55,7 +55,7 @@ class ResetIDs : public Command { void sort(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/reset_mol_ids.cpp b/src/reset_mol_ids.cpp index 9501c19861..cf5bcdec6e 100644 --- a/src/reset_mol_ids.cpp +++ b/src/reset_mol_ids.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/reset_mol_ids.h b/src/reset_mol_ids.h index 8259acbf40..6fff49bb72 100644 --- a/src/reset_mol_ids.h +++ b/src/reset_mol_ids.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(reset_mol_ids,ResetMolIDs) - +// clang-format off +CommandStyle(reset_mol_ids,ResetMolIDs); +// clang-format on #else #ifndef LMP_RESET_MOL_IDS_H @@ -32,19 +32,19 @@ class ResetMolIDs : public Command { void create_computes(char *, char *); void reset(); -private: + private: std::string idfrag, idchunk; int nchunk; int groupbit; - int compressflag; // 1 = contiguous values for new IDs - int singleflag; // 0 = mol IDs of single atoms set to 0 - tagint offset; // offset for contiguous mol ID values + int compressflag; // 1 = contiguous values for new IDs + int singleflag; // 0 = mol IDs of single atoms set to 0 + tagint offset; // offset for contiguous mol ID values class ComputeFragmentAtom *cfa; class ComputeChunkAtom *cca; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/respa.cpp b/src/respa.cpp index aebee0f6eb..c51ec04131 100644 --- a/src/respa.cpp +++ b/src/respa.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/respa.h b/src/respa.h index 1076a3602c..5b6b9140e7 100644 --- a/src/respa.h +++ b/src/respa.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef INTEGRATE_CLASS - -IntegrateStyle(respa,Respa) - +// clang-format off +IntegrateStyle(respa,Respa); +// clang-format on #else #ifndef LMP_RESPA_H @@ -26,18 +26,18 @@ namespace LAMMPS_NS { class Respa : public Integrate { public: - // public so Fixes, Pairs, Neighbor can see them - int nlevels; // number of rRESPA levels - // 0 = innermost level, nlevels-1 = outermost level - double *step; // timestep at each level - int *loop; // sub-cycling factor at each level - double cutoff[4]; // cutoff[0] and cutoff[1] = between inner and middle - // cutoff[2] and cutoff[3] = between middle and outer - // if no middle then 0,1 = 2,3 + // public so Fixes, Pairs, Neighbor can see them + int nlevels; // number of rRESPA levels + // 0 = innermost level, nlevels-1 = outermost level + double *step; // timestep at each level + int *loop; // sub-cycling factor at each level + double cutoff[4]; // cutoff[0] and cutoff[1] = between inner and middle + // cutoff[2] and cutoff[3] = between middle and outer + // if no middle then 0,1 = 2,3 - int level_bond,level_angle,level_dihedral; // level to compute forces at - int level_improper,level_pair,level_kspace; - int level_inner,level_middle,level_outer; + int level_bond, level_angle, level_dihedral; // level to compute forces at + int level_improper, level_pair, level_kspace; + int level_inner, level_middle, level_outer; int nhybrid_styles; // number of hybrid pair styles int *hybrid_level; // level to compute pair hybrid sub-style at @@ -58,11 +58,11 @@ class Respa : public Integrate { void copy_flevel_f(int); protected: - int triclinic; // 0 if domain is orthog, 1 if triclinic - int torqueflag,extraflag; + int triclinic; // 0 if domain is orthog, 1 if triclinic + int torqueflag, extraflag; - int *newton; // newton flag at each level - class FixRespa *fix_respa; // Fix to store the force level array + int *newton; // newton flag at each level + class FixRespa *fix_respa; // Fix to store the force level array virtual void recurse(int); void force_clear(int); @@ -70,7 +70,7 @@ class Respa : public Integrate { void set_compute_flags(int ilevel); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/run.cpp b/src/run.cpp index 1534d506d6..2d8b4816a4 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/run.h b/src/run.h index 5557432d93..55af0cf6a0 100644 --- a/src/run.h +++ b/src/run.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(run,Run) - +// clang-format off +CommandStyle(run,Run); +// clang-format on #else #ifndef LMP_RUN_H @@ -30,7 +30,7 @@ class Run : public Command { void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/set.cpp b/src/set.cpp index c36df7f1c7..e8555774ac 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/set.h b/src/set.h index cc096bd3b0..35d258b5db 100644 --- a/src/set.h +++ b/src/set.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(set,Set) - +// clang-format off +CommandStyle(set,Set); +// clang-format on #else #ifndef LMP_SET_H @@ -26,21 +26,21 @@ namespace LAMMPS_NS { class Set : public Command { public: - Set(class LAMMPS *lmp) : Command(lmp) {}; + Set(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); private: char *id; int *select; - int style,ivalue,newtype,count,index_custom; - int ximage,yimage,zimage,ximageflag,yimageflag,zimageflag; + int style, ivalue, newtype, count, index_custom; + int ximage, yimage, zimage, ximageflag, yimageflag, zimageflag; int cc_index; bigint nsubset; - double dvalue,xvalue,yvalue,zvalue,wvalue,fraction; + double dvalue, xvalue, yvalue, zvalue, wvalue, fraction; - int varflag,varflag1,varflag2,varflag3,varflag4; - int ivar1,ivar2,ivar3,ivar4; - double *vec1,*vec2,*vec3,*vec4; + int varflag, varflag1, varflag2, varflag3, varflag4; + int ivar1, ivar2, ivar3, ivar4; + double *vec1, *vec2, *vec3, *vec4; int discflag; @@ -51,7 +51,7 @@ class Set : public Command { void varparse(const char *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/special.cpp b/src/special.cpp index 2d90f377a2..8a3b991fea 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/special.h b/src/special.h index b98beace90..8fb39ea563 100644 --- a/src/special.h +++ b/src/special.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -25,9 +25,9 @@ class Special : protected Pointers { void build(); private: - int me,nprocs; + int me, nprocs; int maxall; - tagint **onetwo,**onethree,**onefour; + tagint **onetwo, **onethree, **onefour; // data used by rendezvous callback methods @@ -41,7 +41,7 @@ class Special : protected Pointers { }; struct PairRvous { - tagint atomID,partnerID; + tagint atomID, partnerID; }; // private methods @@ -65,7 +65,7 @@ class Special : protected Pointers { static int rendezvous_pairs(int, char *, int &, int *&, char *&, void *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/suffix.h b/src/suffix.h index 32b2a3ce40..eaed5ffd4d 100644 --- a/src/suffix.h +++ b/src/suffix.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -17,15 +17,8 @@ namespace LAMMPS_NS { namespace Suffix { - enum { - NONE = 0, - OPT = 1<<0, - GPU = 1<<1, - OMP = 1<<2, - INTEL = 1<<3, - KOKKOS = 1<<4 - }; -} + enum { NONE = 0, OPT = 1 << 0, GPU = 1 << 1, OMP = 1 << 2, INTEL = 1 << 3, KOKKOS = 1 << 4 }; } +} // namespace LAMMPS_NS #endif diff --git a/src/table_file_reader.cpp b/src/table_file_reader.cpp index 69f382f1e5..9ee0c33649 100644 --- a/src/table_file_reader.cpp +++ b/src/table_file_reader.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/table_file_reader.h b/src/table_file_reader.h index b6db23e6f8..643e1ce93c 100644 --- a/src/table_file_reader.h +++ b/src/table_file_reader.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,17 +20,16 @@ #include "potential_file_reader.h" -namespace LAMMPS_NS -{ - class TableFileReader : public PotentialFileReader { - public: - TableFileReader(class LAMMPS *lmp, const std::string &filename, - const std::string &type, const int auto_convert = 0); - virtual ~TableFileReader(); +namespace LAMMPS_NS { +class TableFileReader : public PotentialFileReader { + public: + TableFileReader(class LAMMPS *lmp, const std::string &filename, const std::string &type, + const int auto_convert = 0); + virtual ~TableFileReader(); - char *find_section_start(const std::string &keyword); - }; + char *find_section_start(const std::string &keyword); +}; -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS #endif diff --git a/src/tabular_function.cpp b/src/tabular_function.cpp index b29aa3e8a6..a3a904d644 100644 --- a/src/tabular_function.cpp +++ b/src/tabular_function.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,9 +19,8 @@ using namespace LAMMPS_NS; TabularFunction::TabularFunction() : - size(0), xmin(0.0), xmax(0.0), xmaxsq(0.0), rdx(0.0), vmax(0.0), - xs(nullptr), ys(nullptr), ys1(nullptr), ys2(nullptr), ys3(nullptr), - ys4(nullptr), ys5(nullptr), ys6(nullptr) + size(0), xmin(0.0), xmax(0.0), xmaxsq(0.0), rdx(0.0), vmax(0.0), xs(nullptr), ys(nullptr), + ys1(nullptr), ys2(nullptr), ys3(nullptr), ys4(nullptr), ys5(nullptr), ys6(nullptr) { } diff --git a/src/tabular_function.h b/src/tabular_function.h index 6dcdcd7835..734424a8e6 100644 --- a/src/tabular_function.h +++ b/src/tabular_function.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/text_file_reader.cpp b/src/text_file_reader.cpp index 291d4348ea..d4847c67ee 100644 --- a/src/text_file_reader.cpp +++ b/src/text_file_reader.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/text_file_reader.h b/src/text_file_reader.h index 327d57c059..e1f875a4e6 100644 --- a/src/text_file_reader.h +++ b/src/text_file_reader.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,50 +22,46 @@ #include -namespace LAMMPS_NS -{ - class TextFileReader { - std::string filetype; - bool closefp; - static constexpr int MAXLINE = 1024; - char line[MAXLINE]; - FILE *fp; +namespace LAMMPS_NS { +class TextFileReader { + std::string filetype; + bool closefp; + static constexpr int MAXLINE = 1024; + char line[MAXLINE]; + FILE *fp; - public: - bool ignore_comments; //!< Controls whether comments are ignored + public: + bool ignore_comments; //!< Controls whether comments are ignored - TextFileReader(const std::string &filename, const std::string &filetype); - TextFileReader(FILE *fp, const std::string &filetype); + TextFileReader(const std::string &filename, const std::string &filetype); + TextFileReader(FILE *fp, const std::string &filetype); - ~TextFileReader(); + ~TextFileReader(); - void skip_line(); - char * next_line(int nparams = 0); + void skip_line(); + char *next_line(int nparams = 0); - void next_dvector(double * list, int n); - ValueTokenizer next_values(int nparams, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); - }; + void next_dvector(double *list, int n); + ValueTokenizer next_values(int nparams, + const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); +}; - class FileReaderException : public std::exception { - std::string message; - public: - FileReaderException(const std::string &msg) : message(msg) { - } +class FileReaderException : public std::exception { + std::string message; - ~FileReaderException() throw() { - } + public: + FileReaderException(const std::string &msg) : message(msg) {} - virtual const char * what() const throw() { - return message.c_str(); - } - }; + ~FileReaderException() throw() {} - class EOFException : public FileReaderException { - public: - EOFException(const std::string &msg) : FileReaderException(msg) { - } - }; + virtual const char *what() const throw() { return message.c_str(); } +}; -} // namespace LAMMPS_NS +class EOFException : public FileReaderException { + public: + EOFException(const std::string &msg) : FileReaderException(msg) {} +}; + +} // namespace LAMMPS_NS #endif diff --git a/src/thermo.cpp b/src/thermo.cpp index 9a543446a9..f030ac2391 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/thermo.h b/src/thermo.h index a7e849ca51..9439b0ef53 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,18 +19,18 @@ namespace LAMMPS_NS { class Thermo : protected Pointers { - friend class MinCG; // accesses compute_pe - friend class DumpNetCDF; // accesses thermo properties - friend class DumpNetCDFMPIIO; // accesses thermo properties + friend class MinCG; // accesses compute_pe + friend class DumpNetCDF; // accesses thermo properties + friend class DumpNetCDFMPIIO; // accesses thermo properties public: char *style; - int normflag; // 0 if do not normalize by atoms, 1 if normalize - int modified; // 1 if thermo_modify has been used, else 0 - int lostflag; // IGNORE,WARN,ERROR - int lostbond; // ditto for atoms in bonds + int normflag; // 0 if do not normalize by atoms, 1 if normalize + int modified; // 1 if thermo_modify has been used, else 0 + int lostflag; // IGNORE,WARN,ERROR + int lostbond; // ditto for atoms in bonds - enum {IGNORE,WARN,ERROR}; + enum { IGNORE, WARN, ERROR }; Thermo(class LAMMPS *, int, char **); ~Thermo(); @@ -46,62 +46,62 @@ class Thermo : protected Pointers { char **keyword; int *vtype; - int nfield,nfield_initial; + int nfield, nfield_initial; int me; char **format; char *format_line_user; - char *format_float_user,*format_int_user,*format_bigint_user; + char *format_float_user, *format_int_user, *format_bigint_user; char **format_column_user; - char *format_float_one_def,*format_float_multi_def; - char *format_int_one_def,*format_int_multi_def; + char *format_float_one_def, *format_float_multi_def; + char *format_int_one_def, *format_int_multi_def; char format_multi[128]; - char format_bigint_one_def[8],format_bigint_multi_def[8]; + char format_bigint_one_def[8], format_bigint_multi_def[8]; - int normvalue; // use this for normflag unless natoms = 0 - int normuserflag; // 0 if user has not set, 1 if has + int normvalue; // use this for normflag unless natoms = 0 + int normuserflag; // 0 if user has not set, 1 if has int normuser; int firststep; int lostbefore, warnbefore; - int flushflag,lineflag; + int flushflag, lineflag; - double last_tpcpu,last_spcpu; + double last_tpcpu, last_spcpu; double last_time; bigint last_step; bigint natoms; - // data used by routines that compute single values - int ivalue; // integer value to print - double dvalue; // double value to print - bigint bivalue; // big integer value to print - int ifield; // which field in thermo output is being computed - int *field2index; // which compute,fix,variable calcs this field - int *argindex1; // indices into compute,fix scalar,vector + // data used by routines that compute single values + int ivalue; // integer value to print + double dvalue; // double value to print + bigint bivalue; // big integer value to print + int ifield; // which field in thermo output is being computed + int *field2index; // which compute,fix,variable calcs this field + int *argindex1; // indices into compute,fix scalar,vector int *argindex2; - // data for keyword-specific Compute objects - // index = where they are in computes list - // id = ID of Compute objects - // Compute * = ptrs to the Compute objects - int index_temp,index_press_scalar,index_press_vector,index_pe; - char *id_temp,*id_press,*id_pe; - class Compute *temperature,*pressure,*pe; + // data for keyword-specific Compute objects + // index = where they are in computes list + // id = ID of Compute objects + // Compute * = ptrs to the Compute objects + int index_temp, index_press_scalar, index_press_vector, index_pe; + char *id_temp, *id_press, *id_pe; + class Compute *temperature, *pressure, *pe; int ncompute; // # of Compute objects called by thermo char **id_compute; // their IDs int *compute_which; // 0/1/2 if should call scalar,vector,array class Compute **computes; // list of ptrs to the Compute objects - int nfix; // # of Fix objects called by thermo - char **id_fix; // their IDs - class Fix **fixes; // list of ptrs to the Fix objects + int nfix; // # of Fix objects called by thermo + char **id_fix; // their IDs + class Fix **fixes; // list of ptrs to the Fix objects - int nvariable; // # of variables evaluated by thermo - char **id_variable; // list of variable names - int *variables; // list of Variable indices + int nvariable; // # of variables evaluated by thermo + char **id_variable; // list of variable names + int *variables; // list of Variable indices // private methods @@ -115,11 +115,11 @@ class Thermo : protected Pointers { typedef void (Thermo::*FnPtr)(); void addfield(const char *, FnPtr, int); - FnPtr *vfunc; // list of ptrs to functions + FnPtr *vfunc; // list of ptrs to functions void call_vfunc(int ifield); - void compute_compute(); // functions that compute a single value - void compute_fix(); // via calls to Compute,Fix,Variable classes + void compute_compute(); // functions that compute a single value + void compute_fix(); // via calls to Compute,Fix,Variable classes void compute_variable(); // functions that compute a single value @@ -206,7 +206,7 @@ class Thermo : protected Pointers { void compute_cellgamma(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/timer.cpp b/src/timer.cpp index 0258f4d044..79caab8b80 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/timer.h b/src/timer.h index 278ac1c65c..a1fb592e43 100644 --- a/src/timer.h +++ b/src/timer.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,24 +16,41 @@ #include "pointers.h" - namespace LAMMPS_NS { class Timer : protected Pointers { public: - - enum ttype {RESET=-2,START=-1,TOTAL=0,PAIR,BOND,KSPACE,NEIGH,COMM, - MODIFY,OUTPUT,SYNC,ALL,DEPHASE,DYNAMICS,QUENCH,NEB,REPCOMM, - REPOUT,NUM_TIMER}; - enum tlevel {OFF=0,LOOP,NORMAL,FULL}; + enum ttype { + RESET = -2, + START = -1, + TOTAL = 0, + PAIR, + BOND, + KSPACE, + NEIGH, + COMM, + MODIFY, + OUTPUT, + SYNC, + ALL, + DEPHASE, + DYNAMICS, + QUENCH, + NEB, + REPCOMM, + REPOUT, + NUM_TIMER + }; + enum tlevel { OFF = 0, LOOP, NORMAL, FULL }; Timer(class LAMMPS *); - ~Timer() {}; + ~Timer(){}; void init(); // inline function to reduce overhead if we want no detailed timings - void stamp(enum ttype which=START) { + void stamp(enum ttype which = START) + { if (_level > LOOP) _stamp(which); } @@ -42,10 +59,10 @@ class Timer : protected Pointers { // accessor methods for supported level of detail - bool has_loop() const { return (_level >= LOOP); } + bool has_loop() const { return (_level >= LOOP); } bool has_normal() const { return (_level >= NORMAL); } - bool has_full() const { return (_level >= FULL); } - bool has_sync() const { return (_sync != OFF); } + bool has_full() const { return (_level >= FULL); } + bool has_sync() const { return (_sync != OFF); } // flag if wallclock time is expired bool is_timeout() const { return (_timeout == 0.0); } @@ -53,10 +70,8 @@ class Timer : protected Pointers { double elapsed(enum ttype); double cpu(enum ttype); - double get_cpu(enum ttype which) const { - return cpu_array[which]; }; - double get_wall(enum ttype which) const { - return wall_array[which]; }; + double get_cpu(enum ttype which) const { return cpu_array[which]; }; + double get_wall(enum ttype which) const { return wall_array[which]; }; void set_wall(enum ttype, double); @@ -77,10 +92,13 @@ class Timer : protected Pointers { // check for timeout. inline wrapper around internal // function to reduce overhead in case there is no check. - bool check_timeout(int step) { + bool check_timeout(int step) + { if (_timeout == 0.0) return true; - if (_nextcheck != step) return false; - else return _check_timeout(); + if (_nextcheck != step) + return false; + else + return _check_timeout(); } void modify_params(int, char **); @@ -91,12 +109,12 @@ class Timer : protected Pointers { double previous_cpu; double previous_wall; double timeout_start; - int _level; // level of detail: off=0,loop=1,normal=2,full=3 - int _sync; // if nonzero, synchronize tasks before setting the timer - int _timeout; // max allowed wall time in seconds. infinity if negative - int _s_timeout; // copy of timeout for restoring after a forced timeout - int _checkfreq; // frequency of timeout checking - int _nextcheck; // loop number of next timeout check + int _level; // level of detail: off=0,loop=1,normal=2,full=3 + int _sync; // if nonzero, synchronize tasks before setting the timer + int _timeout; // max allowed wall time in seconds. infinity if negative + int _s_timeout; // copy of timeout for restoring after a forced timeout + int _checkfreq; // frequency of timeout checking + int _nextcheck; // loop number of next timeout check // update one specific timer array void _stamp(enum ttype); @@ -105,7 +123,7 @@ class Timer : protected Pointers { bool _check_timeout(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index 38cdfa73fb..538cd716ad 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -1,6 +1,7 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/tokenizer.h b/src/tokenizer.h index 8cc6d2d42b..e2a060d218 100644 --- a/src/tokenizer.h +++ b/src/tokenizer.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,98 +20,102 @@ #include "lmptype.h" -#include // IWYU pragma: export -#include // IWYU pragma: export -#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export namespace LAMMPS_NS { #define TOKENIZER_DEFAULT_SEPARATORS " \t\r\n\f" class Tokenizer { - std::string text; - std::string separators; - size_t start; - size_t ntokens; -public: - Tokenizer(const std::string &str, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); - Tokenizer(Tokenizer &&); - Tokenizer(const Tokenizer &); - Tokenizer& operator=(const Tokenizer&); - Tokenizer& operator=(Tokenizer&&); - void swap(Tokenizer &); + std::string text; + std::string separators; + size_t start; + size_t ntokens; - void reset(); - void skip(int n=1); - bool has_next() const; - bool contains(const std::string &str) const; - std::string next(); + public: + Tokenizer(const std::string &str, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); + Tokenizer(Tokenizer &&); + Tokenizer(const Tokenizer &); + Tokenizer &operator=(const Tokenizer &); + Tokenizer &operator=(Tokenizer &&); + void swap(Tokenizer &); - size_t count(); - std::vector as_vector(); + void reset(); + void skip(int n = 1); + bool has_next() const; + bool contains(const std::string &str) const; + std::string next(); + + size_t count(); + std::vector as_vector(); }; class TokenizerException : public std::exception { std::string message; -public: + + public: /** Thrown during retrieving or skipping tokens * * \param msg String with error message * \param token String of the token/word that caused the error */ TokenizerException(const std::string &msg, const std::string &token); - ~TokenizerException() throw() { - } + ~TokenizerException() throw() {} /** Retrieve message describing the thrown exception * \return string with error message */ - virtual const char * what() const throw() { - return message.c_str(); - } + virtual const char *what() const throw() { return message.c_str(); } }; class InvalidIntegerException : public TokenizerException { -public: + public: /** Thrown during converting string to integer number * * \param token String of the token/word that caused the error */ - InvalidIntegerException(const std::string &token) - : TokenizerException("Not a valid integer number", token) {} + InvalidIntegerException(const std::string &token) : + TokenizerException("Not a valid integer number", token) + { + } }; class InvalidFloatException : public TokenizerException { -public: + public: /** Thrown during converting string to floating point number * * \param token String of the token/word that caused the error */ - InvalidFloatException(const std::string &token) - : TokenizerException("Not a valid floating-point number", token) {} + InvalidFloatException(const std::string &token) : + TokenizerException("Not a valid floating-point number", token) + { + } }; class ValueTokenizer { - Tokenizer tokens; -public: - ValueTokenizer(const std::string &str, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); - ValueTokenizer(const ValueTokenizer &); - ValueTokenizer(ValueTokenizer &&); - ValueTokenizer& operator=(const ValueTokenizer&); - ValueTokenizer& operator=(ValueTokenizer&&); - void swap(ValueTokenizer &); + Tokenizer tokens; - std::string next_string(); - tagint next_tagint(); - bigint next_bigint(); - int next_int(); - double next_double(); + public: + ValueTokenizer(const std::string &str, + const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); + ValueTokenizer(const ValueTokenizer &); + ValueTokenizer(ValueTokenizer &&); + ValueTokenizer &operator=(const ValueTokenizer &); + ValueTokenizer &operator=(ValueTokenizer &&); + void swap(ValueTokenizer &); - bool has_next() const; - bool contains(const std::string &value) const; - void skip(int ntokens=1); + std::string next_string(); + tagint next_tagint(); + bigint next_bigint(); + int next_int(); + double next_double(); - size_t count(); + bool has_next() const; + bool contains(const std::string &value) const; + void skip(int ntokens = 1); + + size_t count(); }; - -} +} // namespace LAMMPS_NS #endif diff --git a/src/universe.cpp b/src/universe.cpp index 6dac83745c..fc3e79ab83 100644 --- a/src/universe.cpp +++ b/src/universe.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/universe.h b/src/universe.h index aca644ea4c..30644dcd6d 100644 --- a/src/universe.h +++ b/src/universe.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -20,21 +20,21 @@ namespace LAMMPS_NS { class Universe : protected Pointers { public: - MPI_Comm uworld; // communicator for entire universe - int me,nprocs; // my place in universe + MPI_Comm uworld; // communicator for entire universe + int me, nprocs; // my place in universe - FILE *uscreen; // universe screen output - FILE *ulogfile; // universe logfile + FILE *uscreen; // universe screen output + FILE *ulogfile; // universe logfile - int existflag; // 1 if universe exists due to -partition flag - int nworlds; // # of worlds in universe - int iworld; // which world I am in - int *procs_per_world; // # of procs in each world - int *root_proc; // root proc in each world + int existflag; // 1 if universe exists due to -partition flag + int nworlds; // # of worlds in universe + int iworld; // which world I am in + int *procs_per_world; // # of procs in each world + int *root_proc; // root proc in each world - MPI_Comm uorig; // original communicator passed to LAMMPS instance - int *uni2orig; // proc I in universe uworld is - // proc uni2orig[I] in original communicator + MPI_Comm uorig; // original communicator passed to LAMMPS instance + int *uni2orig; // proc I in universe uworld is + // proc uni2orig[I] in original communicator Universe(class LAMMPS *, MPI_Comm); ~Universe(); @@ -43,7 +43,7 @@ class Universe : protected Pointers { int consistent(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/update.cpp b/src/update.cpp index 542e272cb3..7f14597e7e 100644 --- a/src/update.cpp +++ b/src/update.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/update.h b/src/update.h index 86a9268536..b3fd1e4a3d 100644 --- a/src/update.h +++ b/src/update.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -22,25 +22,25 @@ namespace LAMMPS_NS { class Update : protected Pointers { public: - double dt; // timestep - double etol,ftol; // minimizer tolerances on energy/force - bigint ntimestep; // current step (dynamics or min iterations) - int nsteps; // # of steps to run (dynamics or min iter) - int whichflag; // 0 for unset, 1 for dynamics, 2 for min - double atime; // simulation time at atime_step - bigint atimestep; // last timestep atime was updated - bigint firststep,laststep; // 1st & last step of this run - bigint beginstep,endstep; // 1st and last step of multiple runs - int first_update; // 0 before initial update, 1 after - int max_eval; // max force evaluations for minimizer - int restrict_output; // 1 if output should not write dump/restart - int setupflag; // set when setup() is computing forces - int post_integrate; // 1 if now at post_integrate() in timestep - int multireplica; // 1 if min across replicas, else 0 - int dt_default; // 1 if dt is at default value, else 0 + double dt; // timestep + double etol, ftol; // minimizer tolerances on energy/force + bigint ntimestep; // current step (dynamics or min iterations) + int nsteps; // # of steps to run (dynamics or min iter) + int whichflag; // 0 for unset, 1 for dynamics, 2 for min + double atime; // simulation time at atime_step + bigint atimestep; // last timestep atime was updated + bigint firststep, laststep; // 1st & last step of this run + bigint beginstep, endstep; // 1st and last step of multiple runs + int first_update; // 0 before initial update, 1 after + int max_eval; // max force evaluations for minimizer + int restrict_output; // 1 if output should not write dump/restart + int setupflag; // set when setup() is computing forces + int post_integrate; // 1 if now at post_integrate() in timestep + int multireplica; // 1 if min across replicas, else 0 + int dt_default; // 1 if dt is at default value, else 0 - bigint eflag_global,eflag_atom; // timestep global/peratom eng is tallied on - bigint vflag_global,vflag_atom; // ditto for virial + bigint eflag_global, eflag_atom; // timestep global/peratom eng is tallied on + bigint vflag_global, vflag_atom; // ditto for virial char *unit_style; @@ -50,11 +50,11 @@ class Update : protected Pointers { class Min *minimize; char *minimize_style; - typedef Integrate *(*IntegrateCreator)(LAMMPS *,int,char**); + typedef Integrate *(*IntegrateCreator)(LAMMPS *, int, char **); typedef Min *(*MinimizeCreator)(LAMMPS *); - typedef std::map IntegrateCreatorMap; - typedef std::map MinimizeCreatorMap; + typedef std::map IntegrateCreatorMap; + typedef std::map MinimizeCreatorMap; IntegrateCreatorMap *integrate_map; MinimizeCreatorMap *minimize_map; @@ -78,7 +78,7 @@ class Update : protected Pointers { template static Min *minimize_creator(LAMMPS *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/utils.cpp b/src/utils.cpp index dc9ee453db..654d5d3301 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -28,7 +28,7 @@ #include #if defined(__linux__) -#include // for readlink +#include // for readlink #endif /*! \file utils.cpp */ @@ -64,24 +64,22 @@ * '(abc)+' Groups */ -extern "C" -{ - /** Match text against a (simplified) regular expression +extern "C" { +/** Match text against a (simplified) regular expression * (regexp will be compiled automatically). */ - static int re_match(const char *text, const char *pattern); +static int re_match(const char *text, const char *pattern); - /** Match find substring that matches a (simplified) regular expression +/** Match find substring that matches a (simplified) regular expression * (regexp will be compiled automatically). */ - static int re_find(const char *text, const char *pattern, int *matchlen); +static int re_find(const char *text, const char *pattern, int *matchlen); } //////////////////////////////////////////////////////////////////////// // Merge sort support functions -static void do_merge(int *idx, int *buf, int llo, int lhi, int rlo, int rhi, - void *ptr, int (*comp)(int, int, void *)); -static void insertion_sort(int *index, int num, void *ptr, - int (*comp)(int, int, void*)); +static void do_merge(int *idx, int *buf, int llo, int lhi, int rlo, int rhi, void *ptr, + int (*comp)(int, int, void *)); +static void insertion_sort(int *index, int num, void *ptr, int (*comp)(int, int, void *)); //////////////////////////////////////////////////////////////////////// @@ -104,7 +102,7 @@ using namespace LAMMPS_NS; */ bool utils::strmatch(const std::string &text, const std::string &pattern) { - const int pos = re_match(text.c_str(),pattern.c_str()); + const int pos = re_match(text.c_str(), pattern.c_str()); return (pos >= 0); } @@ -116,9 +114,9 @@ bool utils::strmatch(const std::string &text, const std::string &pattern) std::string utils::strfind(const std::string &text, const std::string &pattern) { int matchlen; - const int pos = re_find(text.c_str(),pattern.c_str(),&matchlen); - if ((pos >=0) && (matchlen > 0)) - return text.substr(pos,matchlen); + const int pos = re_find(text.c_str(), pattern.c_str(), &matchlen); + if ((pos >= 0) && (matchlen > 0)) + return text.substr(pos, matchlen); else return ""; } @@ -127,17 +125,16 @@ std::string utils::strfind(const std::string &text, const std::string &pattern) void utils::logmesg(LAMMPS *lmp, const std::string &mesg) { - if (lmp->screen) fputs(mesg.c_str(), lmp->screen); + if (lmp->screen) fputs(mesg.c_str(), lmp->screen); if (lmp->logfile) fputs(mesg.c_str(), lmp->logfile); } -void utils::fmtargs_logmesg(LAMMPS *lmp, fmt::string_view format, - fmt::format_args args) +void utils::fmtargs_logmesg(LAMMPS *lmp, fmt::string_view format, fmt::format_args args) { try { logmesg(lmp, fmt::vformat(format, args)); } catch (fmt::format_error &e) { - logmesg(lmp, std::string(e.what())+"\n"); + logmesg(lmp, std::string(e.what()) + "\n"); } } @@ -157,15 +154,15 @@ std::string utils::getsyserror() */ const char *utils::guesspath(char *buf, int len, FILE *fp) { - memset(buf,0,len); + memset(buf, 0, len); #if defined(__linux__) int fd = fileno(fp); // get pathname from /proc or copy (unknown) - if (readlink(fmt::format("/proc/self/fd/{}",fd).c_str(),buf,len-1) <= 0) - strncpy(buf,"(unknown)",len-1); + if (readlink(fmt::format("/proc/self/fd/{}", fd).c_str(), buf, len - 1) <= 0) + strncpy(buf, "(unknown)", len - 1); #else - strncpy(buf,"(unknown)",len-1); + strncpy(buf, "(unknown)", len - 1); #endif return buf; } @@ -177,7 +174,7 @@ char *utils::fgets_trunc(char *buf, int size, FILE *fp) { constexpr int MAXDUMMY = 256; char dummy[MAXDUMMY]; - char *ptr = fgets(buf,size,fp); + char *ptr = fgets(buf, size, fp); // EOF if (!ptr) return nullptr; @@ -185,22 +182,25 @@ char *utils::fgets_trunc(char *buf, int size, FILE *fp) int n = strlen(buf); // line is shorter than buffer, append newline if needed, - if (n < size-2) { - if (buf[n-1] != '\n') { + if (n < size - 2) { + if (buf[n - 1] != '\n') { buf[n] = '\n'; - buf[n+1] = '\0'; + buf[n + 1] = '\0'; } return buf; // line fits exactly. overwrite last but one character. - } else buf[size-2] = '\n'; + } else + buf[size - 2] = '\n'; // continue reading into dummy buffer until end of line or file do { - ptr = fgets(dummy,MAXDUMMY,fp); - if (ptr) n = strlen(ptr); - else n = 0; - } while (n == MAXDUMMY-1 && ptr[MAXDUMMY-1] != '\n'); + ptr = fgets(dummy, MAXDUMMY, fp); + if (ptr) + n = strlen(ptr); + else + n = 0; + } while (n == MAXDUMMY - 1 && ptr[MAXDUMMY - 1] != '\n'); // return first chunk return buf; @@ -208,17 +208,16 @@ char *utils::fgets_trunc(char *buf, int size, FILE *fp) #define MAXPATHLENBUF 1024 /* like fgets() but aborts with an error or EOF is encountered */ -void utils::sfgets(const char *srcname, int srcline, char *s, int size, - FILE *fp, const char *filename, Error *error) +void utils::sfgets(const char *srcname, int srcline, char *s, int size, FILE *fp, + const char *filename, Error *error) { - char *rv = fgets(s,size,fp); - if (rv == nullptr) { // something went wrong + char *rv = fgets(s, size, fp); + if (rv == nullptr) { // something went wrong char buf[MAXPATHLENBUF]; std::string errmsg; // try to figure out the file name from the file pointer - if (!filename) - filename = guesspath(buf,MAXPATHLENBUF,fp); + if (!filename) filename = guesspath(buf, MAXPATHLENBUF, fp); if (feof(fp)) { errmsg = "Unexpected end of file while reading file '"; @@ -230,24 +229,23 @@ void utils::sfgets(const char *srcname, int srcline, char *s, int size, errmsg += filename; errmsg += "'"; - if (error) error->one(srcname,srcline,errmsg); - if (s) *s = '\0'; // truncate string to empty in case error is null pointer + if (error) error->one(srcname, srcline, errmsg); + if (s) *s = '\0'; // truncate string to empty in case error is null pointer } return; } /* like fread() but aborts with an error or EOF is encountered */ -void utils::sfread(const char *srcname, int srcline, void *s, size_t size, - size_t num, FILE *fp, const char *filename, Error *error) +void utils::sfread(const char *srcname, int srcline, void *s, size_t size, size_t num, FILE *fp, + const char *filename, Error *error) { - size_t rv = fread(s,size,num,fp); - if (rv != num) { // something went wrong + size_t rv = fread(s, size, num, fp); + if (rv != num) { // something went wrong char buf[MAXPATHLENBUF]; std::string errmsg; // try to figure out the file name from the file pointer - if (!filename) - filename = guesspath(buf,MAXPATHLENBUF,fp); + if (!filename) filename = guesspath(buf, MAXPATHLENBUF, fp); if (feof(fp)) { errmsg = "Unexpected end of file while reading file '"; @@ -259,7 +257,7 @@ void utils::sfread(const char *srcname, int srcline, void *s, size_t size, errmsg += filename; errmsg += "'"; - if (error) error->one(srcname,srcline,errmsg); + if (error) error->one(srcname, srcline, errmsg); } return; } @@ -267,8 +265,7 @@ void utils::sfread(const char *srcname, int srcline, void *s, size_t size, /* ------------------------------------------------------------------ */ /* read N lines and broadcast */ -int utils::read_lines_from_file(FILE *fp, int nlines, int nmax, - char *buffer, int me, MPI_Comm comm) +int utils::read_lines_from_file(FILE *fp, int nlines, int nmax, char *buffer, int me, MPI_Comm comm) { char *ptr = buffer; *ptr = '\0'; @@ -276,8 +273,8 @@ int utils::read_lines_from_file(FILE *fp, int nlines, int nmax, if (me == 0) { if (fp) { for (int i = 0; i < nlines; i++) { - ptr = fgets_trunc(ptr,nmax,fp); - if (!ptr) break; // EOF? + ptr = fgets_trunc(ptr, nmax, fp); + if (!ptr) break; // EOF? // advance ptr to end of string ptr += strlen(ptr); // ensure buffer is null terminated. null char is start of next line. @@ -287,23 +284,22 @@ int utils::read_lines_from_file(FILE *fp, int nlines, int nmax, } int n = strlen(buffer); - MPI_Bcast(&n,1,MPI_INT,0,comm); + MPI_Bcast(&n, 1, MPI_INT, 0, comm); if (n == 0) return 1; - MPI_Bcast(buffer,n+1,MPI_CHAR,0,comm); + MPI_Bcast(buffer, n + 1, MPI_CHAR, 0, comm); return 0; } /* ------------------------------------------------------------------ */ -std::string utils::check_packages_for_style(const std::string &style, - const std::string &name, +std::string utils::check_packages_for_style(const std::string &style, const std::string &name, LAMMPS *lmp) { std::string errmsg = "Unrecognized " + style + " style '" + name + "'"; - const char *pkg = lmp->match_style(style.c_str(),name.c_str()); + const char *pkg = lmp->match_style(style.c_str(), name.c_str()); if (pkg) { - errmsg += fmt::format(" is part of the {} package",pkg); + errmsg += fmt::format(" is part of the {} package", pkg); if (lmp->is_installed_pkg(pkg)) errmsg += ", but seems to be missing because of a dependency"; else @@ -312,26 +308,24 @@ std::string utils::check_packages_for_style(const std::string &style, return errmsg; } - /* ---------------------------------------------------------------------- read a floating point value from a string generate an error if not a legitimate floating point value called by various commands to check validity of their arguments ------------------------------------------------------------------------- */ -double utils::numeric(const char *file, int line, const char *str, - bool do_abort, LAMMPS *lmp) +double utils::numeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp) { int n = 0; if (str) n = strlen(str); if (n == 0) { const char msg[] = "Expected floating point parameter instead of" - " NULL or empty string in input script or data file"; + " NULL or empty string in input script or data file"; if (do_abort) - lmp->error->one(file,line,msg); + lmp->error->one(file, line, msg); else - lmp->error->all(file,line,msg); + lmp->error->all(file, line, msg); } std::string buf(str); @@ -341,9 +335,9 @@ double utils::numeric(const char *file, int line, const char *str, std::string msg("Expected floating point parameter instead of '"); msg += buf + "' in input script or data file"; if (do_abort) - lmp->error->one(file,line,msg); + lmp->error->one(file, line, msg); else - lmp->error->all(file,line,msg); + lmp->error->all(file, line, msg); } return atof(buf.c_str()); @@ -355,19 +349,18 @@ double utils::numeric(const char *file, int line, const char *str, called by various commands to check validity of their arguments ------------------------------------------------------------------------- */ -int utils::inumeric(const char *file, int line, const char *str, - bool do_abort, LAMMPS *lmp) +int utils::inumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp) { int n = 0; if (str) n = strlen(str); if (n == 0) { const char msg[] = "Expected integer parameter instead of" - " NULL or empty string in input script or data file"; + " NULL or empty string in input script or data file"; if (do_abort) - lmp->error->one(file,line,msg); + lmp->error->one(file, line, msg); else - lmp->error->all(file,line,msg); + lmp->error->all(file, line, msg); } std::string buf(str); @@ -377,9 +370,9 @@ int utils::inumeric(const char *file, int line, const char *str, std::string msg("Expected integer parameter instead of '"); msg += buf + "' in input script or data file"; if (do_abort) - lmp->error->one(file,line,msg); + lmp->error->one(file, line, msg); else - lmp->error->all(file,line,msg); + lmp->error->all(file, line, msg); } return atoi(buf.c_str()); @@ -391,19 +384,18 @@ int utils::inumeric(const char *file, int line, const char *str, called by various commands to check validity of their arguments ------------------------------------------------------------------------- */ -bigint utils::bnumeric(const char *file, int line, const char *str, - bool do_abort, LAMMPS *lmp) +bigint utils::bnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp) { int n = 0; if (str) n = strlen(str); if (n == 0) { const char msg[] = "Expected integer parameter instead of" - " NULL or empty string in input script or data file"; + " NULL or empty string in input script or data file"; if (do_abort) - lmp->error->one(file,line,msg); + lmp->error->one(file, line, msg); else - lmp->error->all(file,line,msg); + lmp->error->all(file, line, msg); } std::string buf(str); @@ -413,9 +405,9 @@ bigint utils::bnumeric(const char *file, int line, const char *str, std::string msg("Expected integer parameter instead of '"); msg += buf + "' in input script or data file"; if (do_abort) - lmp->error->one(file,line,msg); + lmp->error->one(file, line, msg); else - lmp->error->all(file,line,msg); + lmp->error->all(file, line, msg); } return ATOBIGINT(buf.c_str()); @@ -427,19 +419,18 @@ bigint utils::bnumeric(const char *file, int line, const char *str, called by various commands to check validity of their arguments ------------------------------------------------------------------------- */ -tagint utils::tnumeric(const char *file, int line, const char *str, - bool do_abort, LAMMPS *lmp) +tagint utils::tnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp) { int n = 0; if (str) n = strlen(str); if (n == 0) { const char msg[] = "Expected integer parameter instead of" - " NULL or empty string in input script or data file"; + " NULL or empty string in input script or data file"; if (do_abort) - lmp->error->one(file,line,msg); + lmp->error->one(file, line, msg); else - lmp->error->all(file,line,msg); + lmp->error->all(file, line, msg); } std::string buf(str); @@ -449,9 +440,9 @@ tagint utils::tnumeric(const char *file, int line, const char *str, std::string msg("Expected integer parameter instead of '"); msg += buf + "' in input script or data file"; if (do_abort) - lmp->error->one(file,line,msg); + lmp->error->one(file, line, msg); else - lmp->error->all(file,line,msg); + lmp->error->all(file, line, msg); } return ATOTAGINT(buf.c_str()); @@ -460,7 +451,8 @@ tagint utils::tnumeric(const char *file, int line, const char *str, /* ---------------------------------------------------------------------- compute bounds implied by numeric str with a possible wildcard asterisk ------------------------------------------------------------------------- */ -template +// clang-format off +template void utils::bounds(const char *file, int line, const std::string &str, bigint nmin, bigint nmax, TYPE &nlo, TYPE &nhi, Error *error) { @@ -469,40 +461,40 @@ void utils::bounds(const char *file, int line, const std::string &str, // check for illegal charcters size_t found = str.find_first_not_of("*-0123456789"); if (found != std::string::npos) { - if (error) error->all(file,line,fmt::format("Invalid range string: {}",str)); + if (error) error->all(file, line, fmt::format("Invalid range string: {}", str)); return; } found = str.find_first_of("*"); if (found == std::string::npos) { // contains no '*' - nlo = nhi = strtol(str.c_str(),nullptr,10); - } else if (str.size() == 1) { // is only '*' + nlo = nhi = strtol(str.c_str(), nullptr, 10); + } else if (str.size() == 1) { // is only '*' nlo = nmin; nhi = nmax; - } else if (found == 0) { // is '*j' + } else if (found == 0) { // is '*j' nlo = nmin; - nhi = strtol(str.substr(1).c_str(),nullptr,10); - } else if (str.size() == found+1) { // is 'i*' - nlo = strtol(str.c_str(),nullptr,10); + nhi = strtol(str.substr(1).c_str(), nullptr, 10); + } else if (str.size() == found + 1) { // is 'i*' + nlo = strtol(str.c_str(), nullptr, 10); nhi = nmax; - } else { // is 'i*j' - nlo = strtol(str.c_str(),nullptr,10); - nhi = strtol(str.substr(found+1).c_str(),nullptr,10); + } else { // is 'i*j' + nlo = strtol(str.c_str(), nullptr, 10); + nhi = strtol(str.substr(found + 1).c_str(), nullptr, 10); } if (error) { - if ((nlo <= 0) || (nhi <=0)) - error->all(file,line,fmt::format("Invalid range string: {}",str)); + if ((nlo <= 0) || (nhi <= 0)) + error->all(file, line, fmt::format("Invalid range string: {}", str)); if (nlo < nmin) - error->all(file,line,fmt::format("Numeric index {} is out of bounds " - "({}-{})",nlo,nmin,nmax)); + error->all(file, line, fmt::format("Numeric index {} is out of bounds " + "({}-{})", nlo, nmin, nmax)); else if (nhi > nmax) - error->all(file,line,fmt::format("Numeric index {} is out of bounds " - "({}-{})",nhi,nmin,nmax)); + error->all(file, line, fmt::format("Numeric index {} is out of bounds " + "({}-{})", nhi, nmin, nmax)); else if (nlo > nhi) - error->all(file,line,fmt::format("Numeric index {} is out of bounds " - "({}-{})",nlo,nmin,nhi)); + error->all(file, line, fmt::format("Numeric index {} is out of bounds " + "({}-{})", nlo, nmin, nhi)); } } @@ -512,19 +504,20 @@ template void utils::bounds<>(const char *, int, const std::string &, bigint, bigint, long &, long &, Error *); template void utils::bounds<>(const char *, int, const std::string &, bigint, bigint, long long &, long long &, Error *); +// clang-format on /* ------------------------------------------------------------------------- Expand list of arguments in arg to earg if arg contains wildcards ------------------------------------------------------------------------- */ -int utils::expand_args(const char *file, int line, int narg, char **arg, - int mode, char **&earg, LAMMPS *lmp) +int utils::expand_args(const char *file, int line, int narg, char **arg, int mode, char **&earg, + LAMMPS *lmp) { int iarg; char *ptr = nullptr; for (iarg = 0; iarg < narg; iarg++) { - ptr = strchr(arg[iarg],'*'); + ptr = strchr(arg[iarg], '*'); if (ptr) break; } @@ -535,8 +528,8 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, // maxarg should always end up equal to newarg, so caller can free earg - int maxarg = narg-iarg; - earg = (char **) lmp->memory->smalloc(maxarg*sizeof(char *),"input:earg"); + int maxarg = narg - iarg; + earg = (char **) lmp->memory->smalloc(maxarg * sizeof(char *), "input:earg"); int newarg = 0, expandflag, nlo, nhi, nmax; std::string id, wc, tail; @@ -548,14 +541,14 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, // only match compute/fix reference with a '*' wildcard // number range in the first pair of square brackets - if (strmatch(word,"^[cf]_\\w+\\[\\d*\\*\\d*\\]")) { + if (strmatch(word, "^[cf]_\\w+\\[\\d*\\*\\d*\\]")) { // split off the compute/fix ID, the wildcard and trailing text size_t first = word.find("["); - size_t second = word.find("]",first+1); - id = word.substr(2,first-2); - wc = word.substr(first+1,second-first-1); - tail = word.substr(second+1); + size_t second = word.find("]", first + 1); + id = word.substr(2, first - 2); + wc = word.substr(first + 1, second - first - 1); + tail = word.substr(second + 1); if (word[0] == 'c') { int icompute = lmp->modify->find_compute(id); @@ -606,18 +599,16 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, if (expandflag) { // expand wild card string to nlo/nhi numbers - utils::bounds(file,line,wc,1,nmax,nlo,nhi,lmp->error); + utils::bounds(file, line, wc, 1, nmax, nlo, nhi, lmp->error); - if (newarg+nhi-nlo+1 > maxarg) { - maxarg += nhi-nlo+1; - earg = (char **) - lmp->memory->srealloc(earg,maxarg*sizeof(char *),"input:earg"); + if (newarg + nhi - nlo + 1 > maxarg) { + maxarg += nhi - nlo + 1; + earg = (char **) lmp->memory->srealloc(earg, maxarg * sizeof(char *), "input:earg"); } for (int index = nlo; index <= nhi; index++) { // assemble and duplicate expanded string - earg[newarg] = utils::strdup(fmt::format("{}_{}[{}]{}",word[0], - id,index,tail)); + earg[newarg] = utils::strdup(fmt::format("{}_{}[{}]{}", word[0], id, index, tail)); newarg++; } @@ -625,8 +616,7 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, // no expansion: duplicate original string if (newarg == maxarg) { maxarg++; - earg = (char **) - lmp->memory->srealloc(earg,maxarg*sizeof(char *),"input:earg"); + earg = (char **) lmp->memory->srealloc(earg, maxarg * sizeof(char *), "input:earg"); } earg[newarg] = utils::strdup(word); newarg++; @@ -647,8 +637,8 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, char *utils::strdup(const std::string &text) { - char *tmp = new char[text.size()+1]; - strcpy(tmp,text.c_str()); + char *tmp = new char[text.size() + 1]; + strcpy(tmp, text.c_str()); // NOLINT return tmp; } @@ -658,12 +648,12 @@ char *utils::strdup(const std::string &text) std::string utils::trim(const std::string &line) { - int beg = re_match(line.c_str(),"\\S+"); - int end = re_match(line.c_str(),"\\s+$"); + int beg = re_match(line.c_str(), "\\S+"); + int end = re_match(line.c_str(), "\\s+$"); if (beg < 0) beg = 0; if (end < 0) end = line.size(); - return line.substr(beg,end-beg); + return line.substr(beg, end - beg); } /* ---------------------------------------------------------------------- @@ -673,9 +663,7 @@ std::string utils::trim(const std::string &line) std::string utils::trim_comment(const std::string &line) { auto end = line.find_first_of("#"); - if (end != std::string::npos) { - return line.substr(0, end); - } + if (end != std::string::npos) { return line.substr(0, end); } return std::string(line); } @@ -685,101 +673,75 @@ std::string utils::trim_comment(const std::string &line) std::string utils::utf8_subst(const std::string &line) { - const unsigned char * const in = (const unsigned char *)line.c_str(); + const unsigned char *const in = (const unsigned char *) line.c_str(); const int len = line.size(); std::string out; - for (int i=0; i < len; ++i) { + for (int i = 0; i < len; ++i) { // UTF-8 2-byte character if ((in[i] & 0xe0U) == 0xc0U) { - if ((i+1) < len) { + if ((i + 1) < len) { // NON-BREAKING SPACE (U+00A0) - if ((in[i] == 0xc2U) && (in[i+1] == 0xa0U)) - out += ' ', ++i; + if ((in[i] == 0xc2U) && (in[i + 1] == 0xa0U)) out += ' ', ++i; // MODIFIER LETTER PLUS SIGN (U+02D6) - if ((in[i] == 0xcbU) && (in[i+1] == 0x96U)) - out += '+', ++i; + if ((in[i] == 0xcbU) && (in[i + 1] == 0x96U)) out += '+', ++i; // MODIFIER LETTER MINUS SIGN (U+02D7) - if ((in[i] == 0xcbU) && (in[i+1] == 0x97U)) - out += '-', ++i; + if ((in[i] == 0xcbU) && (in[i + 1] == 0x97U)) out += '-', ++i; } - // UTF-8 3-byte character + // UTF-8 3-byte character } else if ((in[i] & 0xf0U) == 0xe0U) { - if ((i+2) < len) { + if ((i + 2) < len) { // EN QUAD (U+2000) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x80U)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x80U)) out += ' ', i += 2; // EM QUAD (U+2001) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x81U)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x81U)) out += ' ', i += 2; // EN SPACE (U+2002) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x82U)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x82U)) out += ' ', i += 2; // EM SPACE (U+2003) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x83U)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x83U)) out += ' ', i += 2; // THREE-PER-EM SPACE (U+2004) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x84U)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x84U)) out += ' ', i += 2; // FOUR-PER-EM SPACE (U+2005) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x85U)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x85U)) out += ' ', i += 2; // SIX-PER-EM SPACE (U+2006) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x86U)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x86U)) out += ' ', i += 2; // FIGURE SPACE (U+2007) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x87U)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x87U)) out += ' ', i += 2; // PUNCTUATION SPACE (U+2008) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x88U)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x88U)) out += ' ', i += 2; // THIN SPACE (U+2009) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x89U)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x89U)) out += ' ', i += 2; // HAIR SPACE (U+200A) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x8aU)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x8aU)) out += ' ', i += 2; // ZERO WIDTH SPACE (U+200B) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x8bU)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x8bU)) out += ' ', i += 2; // LEFT SINGLE QUOTATION MARK (U+2018) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x98U)) - out += '\'', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x98U)) out += '\'', i += 2; // RIGHT SINGLE QUOTATION MARK (U+2019) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x99U)) - out += '\'', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x99U)) out += '\'', i += 2; // LEFT DOUBLE QUOTATION MARK (U+201C) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x9cU)) - out += '"', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x9cU)) out += '"', i += 2; // RIGHT DOUBLE QUOTATION MARK (U+201D) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0x9dU)) - out += '"', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0x9dU)) out += '"', i += 2; // NARROW NO-BREAK SPACE (U+202F) - if ((in[i] == 0xe2U) && (in[i+1] == 0x80U) && (in[i+2] == 0xafU)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x80U) && (in[i + 2] == 0xafU)) out += ' ', i += 2; // WORD JOINER (U+2060) - if ((in[i] == 0xe2U) && (in[i+1] == 0x81U) && (in[i+2] == 0xa0U)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x81U) && (in[i + 2] == 0xa0U)) out += ' ', i += 2; // INVISIBLE SEPARATOR (U+2063) - if ((in[i] == 0xe2U) && (in[i+1] == 0x81U) && (in[i+2] == 0xa3U)) - out += ' ', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x81U) && (in[i + 2] == 0xa3U)) out += ' ', i += 2; // INVISIBLE PLUS (U+2064) - if ((in[i] == 0xe2U) && (in[i+1] == 0x81U) && (in[i+2] == 0xa4U)) - out += '+', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x81U) && (in[i + 2] == 0xa4U)) out += '+', i += 2; // MINUS SIGN (U+2212) - if ((in[i] == 0xe2U) && (in[i+1] == 0x88U) && (in[i+2] == 0x92U)) - out += '-', i += 2; + if ((in[i] == 0xe2U) && (in[i + 1] == 0x88U) && (in[i + 2] == 0x92U)) out += '-', i += 2; // ZERO WIDTH NO-BREAK SPACE (U+FEFF) - if ((in[i] == 0xefU) && (in[i+1] == 0xbbU) && (in[i+2] == 0xbfU)) - out += ' ', i += 2; + if ((in[i] == 0xefU) && (in[i + 1] == 0xbbU) && (in[i + 2] == 0xbfU)) out += ' ', i += 2; } - // UTF-8 4-byte character + // UTF-8 4-byte character } else if ((in[i] & 0xf8U) == 0xf0U) { - if ((i+3) < len) { - ; - } - } else out += in[i]; + if ((i + 3) < len) { ; } + } else + out += in[i]; } return out; } @@ -788,13 +750,14 @@ std::string utils::utf8_subst(const std::string &line) return number of words ------------------------------------------------------------------------- */ -size_t utils::count_words(const char *text) { +size_t utils::count_words(const char *text) +{ size_t count = 0; - const char * buf = text; + const char *buf = text; char c = *buf; while (c) { - if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f') { + if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f') { c = *++buf; continue; }; @@ -803,9 +766,7 @@ size_t utils::count_words(const char *text) { c = *++buf; while (c) { - if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f') { - break; - } + if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f') { break; } c = *++buf; } } @@ -817,7 +778,8 @@ size_t utils::count_words(const char *text) { return number of words ------------------------------------------------------------------------- */ -size_t utils::count_words(const std::string &text) { +size_t utils::count_words(const std::string &text) +{ return utils::count_words(text.c_str()); } @@ -825,7 +787,8 @@ size_t utils::count_words(const std::string &text) { Return number of words ------------------------------------------------------------------------- */ -size_t utils::count_words(const std::string &text, const std::string &separators) { +size_t utils::count_words(const std::string &text, const std::string &separators) +{ size_t count = 0; size_t start = text.find_first_not_of(separators); @@ -846,7 +809,8 @@ size_t utils::count_words(const std::string &text, const std::string &separators Trim comment from string and return number of words ------------------------------------------------------------------------- */ -size_t utils::trim_and_count_words(const std::string &text, const std::string &separators) { +size_t utils::trim_and_count_words(const std::string &text, const std::string &separators) +{ return utils::count_words(utils::trim_comment(text), separators); } @@ -865,23 +829,22 @@ std::vector utils::split_words(const std::string &text) while (c) { // leading whitespace - if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f') { + if (c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f') { c = *++buf; ++beg; continue; }; len = 0; - // handle escaped/quoted text. - quoted: + // handle escaped/quoted text. + quoted: // handle single quote if (c == '\'') { ++beg; add = 1; c = *++buf; - while (((c != '\'') && (c != '\0')) - || ((c == '\\') && (buf[1] == '\''))) { + while (((c != '\'') && (c != '\0')) || ((c == '\\') && (buf[1] == '\''))) { if ((c == '\\') && (buf[1] == '\'')) { ++buf; ++len; @@ -897,8 +860,7 @@ std::vector utils::split_words(const std::string &text) ++beg; add = 1; c = *++buf; - while (((c != '"') && (c != '\0')) - || ((c == '\\') && (buf[1] == '"'))) { + while (((c != '"') && (c != '\0')) || ((c == '\\') && (buf[1] == '"'))) { if ((c == '\\') && (buf[1] == '"')) { ++buf; ++len; @@ -920,11 +882,10 @@ std::vector utils::split_words(const std::string &text) c = *++buf; ++len; } - if ((c == ' ') || (c == '\t') || (c == '\r') || (c == '\n') - || (c == '\f') || (c == '\0')) { - list.push_back(text.substr(beg,len)); - beg += len + add; - break; + if ((c == ' ') || (c == '\t') || (c == '\r') || (c == '\n') || (c == '\f') || (c == '\0')) { + list.push_back(text.substr(beg, len)); + beg += len + add; + break; } c = *++buf; ++len; @@ -945,10 +906,9 @@ std::vector utils::split_lines(const std::string &text) Return whether string is a valid integer number ------------------------------------------------------------------------- */ -bool utils::is_integer(const std::string &str) { - if (str.empty()) { - return false; - } +bool utils::is_integer(const std::string &str) +{ + if (str.empty()) return false; for (auto c : str) { if (isdigit(c) || c == '-' || c == '+') continue; @@ -961,10 +921,9 @@ bool utils::is_integer(const std::string &str) { Return whether string is a valid floating-point number ------------------------------------------------------------------------- */ -bool utils::is_double(const std::string &str) { - if (str.empty()) { - return false; - } +bool utils::is_double(const std::string &str) +{ + if (str.empty()) return false; for (auto c : str) { if (isdigit(c)) continue; @@ -979,10 +938,9 @@ bool utils::is_double(const std::string &str) { Return whether string is a valid ID string ------------------------------------------------------------------------- */ -bool utils::is_id(const std::string &str) { - if (str.empty()) { - return false; - } +bool utils::is_id(const std::string &str) +{ + if (str.empty()) return false; for (auto c : str) { if (isalnum(c) || (c == '_')) continue; @@ -995,7 +953,8 @@ bool utils::is_id(const std::string &str) { strip off leading part of path, return just the filename ------------------------------------------------------------------------- */ -std::string utils::path_basename(const std::string &path) { +std::string utils::path_basename(const std::string &path) +{ #if defined(_WIN32) size_t start = path.find_last_of("/\\"); #else @@ -1015,7 +974,8 @@ std::string utils::path_basename(const std::string &path) { Return only the leading part of a path, return just the directory ------------------------------------------------------------------------- */ -std::string utils::path_dirname(const std::string &path) { +std::string utils::path_dirname(const std::string &path) +{ #if defined(_WIN32) size_t start = path.find_last_of("/\\"); #else @@ -1024,27 +984,29 @@ std::string utils::path_dirname(const std::string &path) { if (start == std::string::npos) return "."; - return path.substr(0,start); + return path.substr(0, start); } /* ---------------------------------------------------------------------- join two paths ------------------------------------------------------------------------- */ -std::string utils::path_join(const std::string &a, const std::string &b) { - #if defined(_WIN32) - return fmt::format("{}\\{}", a, b); - #else - return fmt::format("{}/{}", a, b); - #endif +std::string utils::path_join(const std::string &a, const std::string &b) +{ +#if defined(_WIN32) + return fmt::format("{}\\{}", a, b); +#else + return fmt::format("{}/{}", a, b); +#endif } /* ---------------------------------------------------------------------- try to open file for reading ------------------------------------------------------------------------- */ -bool utils::file_is_readable(const std::string &path) { - FILE * fp = fopen(path.c_str(), "r"); +bool utils::file_is_readable(const std::string &path) +{ + FILE *fp = fopen(path.c_str(), "r"); if (fp) { fclose(fp); return true; @@ -1063,7 +1025,8 @@ bool utils::file_is_readable(const std::string &path) { #define OS_PATH_VAR_SEP ":" #endif -std::string utils::get_potential_file_path(const std::string &path) { +std::string utils::get_potential_file_path(const std::string &path) +{ std::string filepath = path; std::string filename = utils::path_basename(path); @@ -1074,16 +1037,14 @@ std::string utils::get_potential_file_path(const std::string &path) { const char *var = getenv("LAMMPS_POTENTIALS"); if (var != nullptr) { - Tokenizer dirs(var,OS_PATH_VAR_SEP); + Tokenizer dirs(var, OS_PATH_VAR_SEP); while (dirs.has_next()) { auto pot = utils::path_basename(filepath); auto dir = dirs.next(); filepath = utils::path_join(dir, pot); - if (utils::file_is_readable(filepath)) { - return filepath; - } + if (utils::file_is_readable(filepath)) { return filepath; } } } } @@ -1096,7 +1057,8 @@ std::string utils::get_potential_file_path(const std::string &path) { if it has a DATE field, return the following word ------------------------------------------------------------------------- */ -std::string utils::get_potential_date(const std::string &path, const std::string &potential_name) { +std::string utils::get_potential_date(const std::string &path, const std::string &potential_name) +{ TextFileReader reader(path, potential_name); reader.ignore_comments = false; @@ -1116,7 +1078,8 @@ std::string utils::get_potential_date(const std::string &path, const std::string if it has UNITS field, return following word ------------------------------------------------------------------------- */ -std::string utils::get_potential_units(const std::string &path, const std::string &potential_name) { +std::string utils::get_potential_units(const std::string &path, const std::string &potential_name) +{ TextFileReader reader(path, potential_name); reader.ignore_comments = false; @@ -1136,10 +1099,10 @@ std::string utils::get_potential_units(const std::string &path, const std::strin ------------------------------------------------------------------------- */ int utils::get_supported_conversions(const int property) { - if (property == ENERGY) { + if (property == ENERGY) return METAL2REAL | REAL2METAL; - } - return NOCONVERT; + else + return NOCONVERT; } /* ---------------------------------------------------------------------- @@ -1155,7 +1118,7 @@ double utils::get_conversion_factor(const int property, const int conversion) } else if (conversion == METAL2REAL) { return 23.060549; } else if (conversion == REAL2METAL) { - return 1.0/23.060549; + return 1.0 / 23.060549; } } return 0.0; @@ -1166,8 +1129,7 @@ double utils::get_conversion_factor(const int property, const int conversion) if fails, search in dir specified by env variable LAMMPS_POTENTIALS ------------------------------------------------------------------------- */ -FILE *utils::open_potential(const std::string &name, LAMMPS *lmp, - int *auto_convert) +FILE *utils::open_potential(const std::string &name, LAMMPS *lmp, int *auto_convert) { auto error = lmp->error; auto me = lmp->comm->me; @@ -1176,38 +1138,35 @@ FILE *utils::open_potential(const std::string &name, LAMMPS *lmp, if (!filepath.empty()) { std::string unit_style = lmp->update->unit_style; - std::string date = get_potential_date(filepath, "potential"); - std::string units = get_potential_units(filepath, "potential"); + std::string date = get_potential_date(filepath, "potential"); + std::string units = get_potential_units(filepath, "potential"); if (!date.empty() && (me == 0)) - logmesg(lmp,"Reading potential file {} with DATE: {}\n", name, date); + logmesg(lmp, "Reading potential file {} with DATE: {}\n", name, date); if (auto_convert == nullptr) { if (!units.empty() && (units != unit_style) && (me == 0)) { - error->one(FLERR, "Potential file {} requires {} units " - "but {} units are in use", name, units, - unit_style); + error->one(FLERR, "Potential file {} requires {} units but {} units are in use", name, + units, unit_style); return nullptr; } } else { if (units.empty() || units == unit_style) { *auto_convert = NOCONVERT; } else { - if ((units == "metal") && (unit_style == "real") - && (*auto_convert & METAL2REAL)) { + if ((units == "metal") && (unit_style == "real") && (*auto_convert & METAL2REAL)) { *auto_convert = METAL2REAL; - } else if ((units == "real") && (unit_style == "metal") - && (*auto_convert & REAL2METAL)) { + } else if ((units == "real") && (unit_style == "metal") && (*auto_convert & REAL2METAL)) { *auto_convert = REAL2METAL; } else { - error->one(FLERR, "Potential file {} requires {} units but {} units " - "are in use", name, units, unit_style); + error->one(FLERR, "Potential file {} requires {} units but {} units are in use", name, + units, unit_style); return nullptr; } } if ((*auto_convert != NOCONVERT) && (me == 0)) - error->warning(FLERR, "Converting potential file in {} units to {} " - "units", units, unit_style); + error->warning(FLERR, "Converting potential file in {} units to {} units", units, + unit_style); } return fopen(filepath.c_str(), "r"); } @@ -1241,8 +1200,10 @@ double utils::timespec2seconds(const std::string ×pec) return -1.0; } - if (i == 3) return (vals[0]*60 + vals[1])*60 + vals[2]; - else if (i == 2) return vals[0]*60 + vals[1]; + if (i == 3) + return (vals[0] * 60 + vals[1]) * 60 + vals[2]; + else if (i == 2) + return vals[0] * 60 + vals[1]; return vals[0]; } @@ -1253,24 +1214,36 @@ double utils::timespec2seconds(const std::string ×pec) int utils::date2num(const std::string &date) { std::size_t found = date.find_first_not_of("0123456789 "); - int num = strtol(date.substr(0,found).c_str(),nullptr,10); + int num = strtol(date.substr(0, found).c_str(), nullptr, 10); auto month = date.substr(found); found = month.find_first_of("0123456789 "); - num += strtol(month.substr(found).c_str(),nullptr,10)*10000; + num += strtol(month.substr(found).c_str(), nullptr, 10) * 10000; if (num < 1000000) num += 20000000; - if (strmatch(month,"^Jan")) num += 100; - else if (strmatch(month,"^Feb")) num += 200; - else if (strmatch(month,"^Mar")) num += 300; - else if (strmatch(month,"^Apr")) num += 400; - else if (strmatch(month,"^May")) num += 500; - else if (strmatch(month,"^Jun")) num += 600; - else if (strmatch(month,"^Jul")) num += 700; - else if (strmatch(month,"^Aug")) num += 800; - else if (strmatch(month,"^Sep")) num += 900; - else if (strmatch(month,"^Oct")) num += 1000; - else if (strmatch(month,"^Nov")) num += 1100; - else if (strmatch(month,"^Dec")) num += 1200; + if (strmatch(month, "^Jan")) + num += 100; + else if (strmatch(month, "^Feb")) + num += 200; + else if (strmatch(month, "^Mar")) + num += 300; + else if (strmatch(month, "^Apr")) + num += 400; + else if (strmatch(month, "^May")) + num += 500; + else if (strmatch(month, "^Jun")) + num += 600; + else if (strmatch(month, "^Jul")) + num += 700; + else if (strmatch(month, "^Aug")) + num += 800; + else if (strmatch(month, "^Sep")) + num += 900; + else if (strmatch(month, "^Oct")) + num += 1000; + else if (strmatch(month, "^Nov")) + num += 1100; + else if (strmatch(month, "^Dec")) + num += 1200; return num; } @@ -1279,19 +1252,18 @@ int utils::date2num(const std::string &date) * Pre-sort small sublists with insertion sort for better overall performance. ------------------------------------------------------------------------- */ -void utils::merge_sort(int *index, int num, void *ptr, - int (*comp)(int, int, void *)) +void utils::merge_sort(int *index, int num, void *ptr, int (*comp)(int, int, void *)) { if (num < 2) return; - int chunk,i,j; + int chunk, i, j; // do insertion sort on chunks of up to 64 elements chunk = 64; - for (i=0; i < num; i += chunk) { - j = (i+chunk > num) ? num-i : chunk; - insertion_sort(index+i,j,ptr,comp); + for (i = 0; i < num; i += chunk) { + j = (i + chunk > num) ? num - i : chunk; + insertion_sort(index + i, j, ptr, comp); } // already done? @@ -1312,27 +1284,29 @@ void utils::merge_sort(int *index, int num, void *ptr, // swap hold and destination buffer - int *tmp = dest; dest = hold; hold = tmp; + int *tmp = dest; + dest = hold; + hold = tmp; // merge from hold array to destination array - for (i=0; i < num-1; i += 2*chunk) { - j = i + 2*chunk; - if (j > num) j=num; - m = i+chunk; - if (m > num) m=num; - do_merge(dest,hold,i,m,m,j,ptr,comp); + for (i = 0; i < num - 1; i += 2 * chunk) { + j = i + 2 * chunk; + if (j > num) j = num; + m = i + chunk; + if (m > num) m = num; + do_merge(dest, hold, i, m, m, j, ptr, comp); } // copy all indices not handled by the chunked merge sort loop - for (; i < num ; i++) dest[i] = hold[i]; + for (; i < num; i++) dest[i] = hold[i]; chunk *= 2; } // if the final sorted data is in buf, copy back to index - if (dest == buf) memcpy(index,buf,sizeof(int)*num); + if (dest == buf) memcpy(index, buf, sizeof(int) * num); delete[] buf; } @@ -1343,17 +1317,16 @@ void utils::merge_sort(int *index, int num, void *ptr, * Merge sort part 2: Insertion sort for pre-sorting of small chunks ------------------------------------------------------------------------- */ -void insertion_sort(int *index, int num, void *ptr, - int (*comp)(int, int, void*)) +void insertion_sort(int *index, int num, void *ptr, int (*comp)(int, int, void *)) { if (num < 2) return; - for (int i=1; i < num; ++i) { + for (int i = 1; i < num; ++i) { int tmp = index[i]; - for (int j=i-1; j >= 0; --j) { - if ((*comp)(index[j],tmp,ptr) > 0) { - index[j+1] = index[j]; + for (int j = i - 1; j >= 0; --j) { + if ((*comp)(index[j], tmp, ptr) > 0) { + index[j + 1] = index[j]; } else { - index[j+1] = tmp; + index[j + 1] = tmp; break; } if (j == 0) index[0] = tmp; @@ -1365,16 +1338,17 @@ void insertion_sort(int *index, int num, void *ptr, * Merge sort part 3: Merge two sublists ------------------------------------------------------------------------- */ -static void do_merge(int *idx, int *buf, int llo, int lhi, int rlo, int rhi, - void *ptr, int (*comp)(int, int, void *)) +static void do_merge(int *idx, int *buf, int llo, int lhi, int rlo, int rhi, void *ptr, + int (*comp)(int, int, void *)) { int i = llo; int l = llo; int r = rlo; while ((l < lhi) && (r < rhi)) { - if ((*comp)(buf[l],buf[r],ptr) < 0) + if ((*comp)(buf[l], buf[r], ptr) < 0) idx[i++] = buf[l++]; - else idx[i++] = buf[r++]; + else + idx[i++] = buf[r++]; } while (l < lhi) idx[i++] = buf[l++]; @@ -1385,143 +1359,190 @@ static void do_merge(int *idx, int *buf, int llo, int lhi, int rlo, int rhi, extern "C" { - /* Typedef'd pointer to get abstract datatype. */ - typedef struct regex_t *re_t; - typedef struct regex_context_t *re_ctx_t; +/* Typedef'd pointer to get abstract datatype. */ +typedef struct regex_t *re_t; +typedef struct regex_context_t *re_ctx_t; - /* Compile regex string pattern to a regex_t-array. */ - static re_t re_compile(re_ctx_t context, const char *pattern); +/* Compile regex string pattern to a regex_t-array. */ +static re_t re_compile(re_ctx_t context, const char *pattern); - /* Find matches of the compiled pattern inside text. */ - static int re_matchp(const char *text, re_t pattern, int *matchlen); +/* Find matches of the compiled pattern inside text. */ +static int re_matchp(const char *text, re_t pattern, int *matchlen); /* Definitions: */ #define MAX_REGEXP_OBJECTS 30 /* Max number of regex symbols in expression. */ #define MAX_CHAR_CLASS_LEN 40 /* Max length of character-class buffer in. */ +enum { + UNUSED, + DOT, + BEGIN, + END, + QUESTIONMARK, + STAR, + PLUS, + CHAR, + CHAR_CLASS, + INV_CHAR_CLASS, + DIGIT, + NOT_DIGIT, + INTEGER, + NOT_INTEGER, + FLOAT, + NOT_FLOAT, + ALPHA, + NOT_ALPHA, + WHITESPACE, + NOT_WHITESPACE /*, BRANCH */ +}; - enum { UNUSED, DOT, BEGIN, END, QUESTIONMARK, STAR, PLUS, - CHAR, CHAR_CLASS, INV_CHAR_CLASS, DIGIT, NOT_DIGIT, - INTEGER, NOT_INTEGER, FLOAT, NOT_FLOAT, - ALPHA, NOT_ALPHA, WHITESPACE, NOT_WHITESPACE /*, BRANCH */ }; +typedef struct regex_t { + unsigned char type; /* CHAR, STAR, etc. */ + union { + unsigned char ch; /* the character itself */ + unsigned char *ccl; /* OR a pointer to characters in class */ + } u; +} regex_t; - typedef struct regex_t { - unsigned char type; /* CHAR, STAR, etc. */ - union { - unsigned char ch; /* the character itself */ - unsigned char *ccl; /* OR a pointer to characters in class */ - } u; - } regex_t; - - typedef struct regex_context_t { - /* MAX_REGEXP_OBJECTS is the max number of symbols in the expression. +typedef struct regex_context_t { + /* MAX_REGEXP_OBJECTS is the max number of symbols in the expression. MAX_CHAR_CLASS_LEN determines the size of buffer for chars in all char-classes in the expression. */ - regex_t re_compiled[MAX_REGEXP_OBJECTS]; - unsigned char ccl_buf[MAX_CHAR_CLASS_LEN]; - } regex_context_t; + regex_t re_compiled[MAX_REGEXP_OBJECTS]; + unsigned char ccl_buf[MAX_CHAR_CLASS_LEN]; +} regex_context_t; - int re_match(const char *text, const char *pattern) - { - regex_context_t context; - int dummy; - return re_matchp(text, re_compile(&context, pattern), &dummy); - } +int re_match(const char *text, const char *pattern) +{ + regex_context_t context; + int dummy; + return re_matchp(text, re_compile(&context, pattern), &dummy); +} - int re_find(const char *text, const char *pattern, int *matchlen) - { - regex_context_t context; - return re_matchp(text, re_compile(&context, pattern), matchlen); - } +int re_find(const char *text, const char *pattern, int *matchlen) +{ + regex_context_t context; + return re_matchp(text, re_compile(&context, pattern), matchlen); +} /* Private function declarations: */ - static int matchpattern(regex_t *pattern, const char *text, int *matchlen); - static int matchcharclass(char c, const char *str); - static int matchstar(regex_t p, regex_t *pattern, const char *text, int *matchlen); - static int matchplus(regex_t p, regex_t *pattern, const char *text, int *matchlen); - static int matchone(regex_t p, char c); - static int matchdigit(char c); - static int matchint(char c); - static int matchfloat(char c); - static int matchalpha(char c); - static int matchwhitespace(char c); - static int matchmetachar(char c, const char *str); - static int matchrange(char c, const char *str); - static int matchdot(char c); - static int ismetachar(char c); +static int matchpattern(regex_t *pattern, const char *text, int *matchlen); +static int matchcharclass(char c, const char *str); +static int matchstar(regex_t p, regex_t *pattern, const char *text, int *matchlen); +static int matchplus(regex_t p, regex_t *pattern, const char *text, int *matchlen); +static int matchone(regex_t p, char c); +static int matchdigit(char c); +static int matchint(char c); +static int matchfloat(char c); +static int matchalpha(char c); +static int matchwhitespace(char c); +static int matchmetachar(char c, const char *str); +static int matchrange(char c, const char *str); +static int matchdot(char c); +static int ismetachar(char c); /* Semi-public functions: */ - int re_matchp(const char *text, re_t pattern, int *matchlen) - { - *matchlen = 0; - if (pattern != 0) { - if (pattern[0].type == BEGIN) { - return ((matchpattern(&pattern[1], text, matchlen)) ? 0 : -1); - } else { - int idx = -1; +int re_matchp(const char *text, re_t pattern, int *matchlen) +{ + *matchlen = 0; + if (pattern != 0) { + if (pattern[0].type == BEGIN) { + return ((matchpattern(&pattern[1], text, matchlen)) ? 0 : -1); + } else { + int idx = -1; - do { - idx += 1; + do { + idx += 1; - if (matchpattern(pattern, text, matchlen)) { - if (text[0] == '\0') - return -1; + if (matchpattern(pattern, text, matchlen)) { + if (text[0] == '\0') return -1; - return idx; - } + return idx; } - while (*text++ != '\0'); - } + } while (*text++ != '\0'); } - return -1; } + return -1; +} - re_t re_compile(re_ctx_t context, const char *pattern) - { - regex_t * const re_compiled = context->re_compiled; - unsigned char * const ccl_buf = context->ccl_buf; - int ccl_bufidx = 1; +re_t re_compile(re_ctx_t context, const char *pattern) +{ + regex_t *const re_compiled = context->re_compiled; + unsigned char *const ccl_buf = context->ccl_buf; + int ccl_bufidx = 1; - char c; /* current char in pattern */ - int i = 0; /* index into pattern */ - int j = 0; /* index into re_compiled */ + char c; /* current char in pattern */ + int i = 0; /* index into pattern */ + int j = 0; /* index into re_compiled */ - while (pattern[i] != '\0' && (j+1 < MAX_REGEXP_OBJECTS)) { - c = pattern[i]; + while (pattern[i] != '\0' && (j + 1 < MAX_REGEXP_OBJECTS)) { + c = pattern[i]; - switch (c) { + switch (c) { /* Meta-characters: */ - case '^': { re_compiled[j].type = BEGIN; } break; - case '$': { re_compiled[j].type = END; } break; - case '.': { re_compiled[j].type = DOT; } break; - case '*': { re_compiled[j].type = STAR; } break; - case '+': { re_compiled[j].type = PLUS; } break; - case '?': { re_compiled[j].type = QUESTIONMARK; } break; + case '^': { + re_compiled[j].type = BEGIN; + } break; + case '$': { + re_compiled[j].type = END; + } break; + case '.': { + re_compiled[j].type = DOT; + } break; + case '*': { + re_compiled[j].type = STAR; + } break; + case '+': { + re_compiled[j].type = PLUS; + } break; + case '?': { + re_compiled[j].type = QUESTIONMARK; + } break; /* Escaped character-classes (\s \w ...): */ case '\\': { - if (pattern[i+1] != '\0') { + if (pattern[i + 1] != '\0') { /* Skip the escape-char '\\' */ i += 1; /* ... and check the next */ switch (pattern[i]) { - /* Meta-character: */ - case 'd': { re_compiled[j].type = DIGIT; } break; - case 'D': { re_compiled[j].type = NOT_DIGIT; } break; - case 'i': { re_compiled[j].type = INTEGER; } break; - case 'I': { re_compiled[j].type = NOT_INTEGER; } break; - case 'f': { re_compiled[j].type = FLOAT; } break; - case 'F': { re_compiled[j].type = NOT_FLOAT; } break; - case 'w': { re_compiled[j].type = ALPHA; } break; - case 'W': { re_compiled[j].type = NOT_ALPHA; } break; - case 's': { re_compiled[j].type = WHITESPACE; } break; - case 'S': { re_compiled[j].type = NOT_WHITESPACE; } break; + /* Meta-character: */ + case 'd': { + re_compiled[j].type = DIGIT; + } break; + case 'D': { + re_compiled[j].type = NOT_DIGIT; + } break; + case 'i': { + re_compiled[j].type = INTEGER; + } break; + case 'I': { + re_compiled[j].type = NOT_INTEGER; + } break; + case 'f': { + re_compiled[j].type = FLOAT; + } break; + case 'F': { + re_compiled[j].type = NOT_FLOAT; + } break; + case 'w': { + re_compiled[j].type = ALPHA; + } break; + case 'W': { + re_compiled[j].type = NOT_ALPHA; + } break; + case 's': { + re_compiled[j].type = WHITESPACE; + } break; + case 'S': { + re_compiled[j].type = NOT_WHITESPACE; + } break; - /* Escaped character, e.g. '.' or '$' */ - default: { - re_compiled[j].type = CHAR; - re_compiled[j].u.ch = pattern[i]; - } break; + /* Escaped character, e.g. '.' or '$' */ + default: { + re_compiled[j].type = CHAR; + re_compiled[j].u.ch = pattern[i]; + } break; } } /* '\\' as last char in pattern -> invalid regular expression. */ @@ -1533,10 +1554,10 @@ extern "C" { int buf_begin = ccl_bufidx; /* Look-ahead to determine if negated */ - if (pattern[i+1] == '^') { + if (pattern[i + 1] == '^') { re_compiled[j].type = INV_CHAR_CLASS; - i += 1; /* Increment i to avoid including '^' in the char-buffer */ - if (pattern[i+1] == 0) /* incomplete pattern, missing non-zero char after '^' */ + i += 1; /* Increment i to avoid including '^' in the char-buffer */ + if (pattern[i + 1] == 0) /* incomplete pattern, missing non-zero char after '^' */ { return 0; } @@ -1548,13 +1569,11 @@ extern "C" { while ((pattern[++i] != ']') && (pattern[i] != '\0')) { /* Missing ] */ if (pattern[i] == '\\') { - if (ccl_bufidx >= MAX_CHAR_CLASS_LEN - 1) { + if (ccl_bufidx >= MAX_CHAR_CLASS_LEN - 1) { return 0; } + if (pattern[i + 1] == 0) /* incomplete pattern, missing non-zero char after '\\' */ + { return 0; } - if (pattern[i+1] == 0) /* incomplete pattern, missing non-zero char after '\\' */ - { - return 0; - } ccl_buf[ccl_bufidx++] = pattern[i++]; } else if (ccl_bufidx >= MAX_CHAR_CLASS_LEN) { return 0; @@ -1571,221 +1590,225 @@ extern "C" { } break; /* Other characters: */ - default: - { + default: { re_compiled[j].type = CHAR; re_compiled[j].u.ch = c; } break; - } - /* no buffer-out-of-bounds access on invalid patterns - see https://github.com/kokke/tiny-regex-c/commit/1a279e04014b70b0695fba559a7c05d55e6ee90b */ - if (pattern[i] == 0) - { - return 0; - } - - i += 1; - j += 1; } - /* 'UNUSED' is a sentinel used to indicate end-of-pattern */ - re_compiled[j].type = UNUSED; + /* no buffer-out-of-bounds access on invalid patterns - + * see https://github.com/kokke/tiny-regex-c/commit/1a279e04014b70b0695fba559a7c05d55e6ee90b */ + if (pattern[i] == 0) { return 0; } - return (re_t) re_compiled; + i += 1; + j += 1; } + /* 'UNUSED' is a sentinel used to indicate end-of-pattern */ + re_compiled[j].type = UNUSED; + return (re_t) re_compiled; +} /* Private functions: */ - static int matchdigit(char c) - { - return ((c >= '0') && (c <= '9')); - } +static int matchdigit(char c) +{ + return ((c >= '0') && (c <= '9')); +} - static int matchint(char c) - { - return (matchdigit(c) || (c == '-') || (c == '+')); - } +static int matchint(char c) +{ + return (matchdigit(c) || (c == '-') || (c == '+')); +} - static int matchfloat(char c) - { - return (matchint(c) || (c == '.') || (c == 'e') || (c == 'E')); - } +static int matchfloat(char c) +{ + return (matchint(c) || (c == '.') || (c == 'e') || (c == 'E')); +} - static int matchalpha(char c) - { - return ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')); - } +static int matchalpha(char c) +{ + return ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')); +} - static int matchwhitespace(char c) - { - return ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r') || (c == '\f') || (c == '\v')); - } +static int matchwhitespace(char c) +{ + return ((c == ' ') || (c == '\t') || (c == '\n') || (c == '\r') || (c == '\f') || (c == '\v')); +} - static int matchalphanum(char c) - { - return ((c == '_') || matchalpha(c) || matchdigit(c)); - } +static int matchalphanum(char c) +{ + return ((c == '_') || matchalpha(c) || matchdigit(c)); +} - static int matchrange(char c, const char *str) - { - return ((c != '-') && (str[0] != '\0') - && (str[0] != '-') && (str[1] == '-') - && (str[1] != '\0') && (str[2] != '\0') - && ((c >= str[0]) && (c <= str[2]))); - } +static int matchrange(char c, const char *str) +{ + return ((c != '-') && (str[0] != '\0') && (str[0] != '-') && (str[1] == '-') && + (str[1] != '\0') && (str[2] != '\0') && ((c >= str[0]) && (c <= str[2]))); +} - static int matchdot(char c) - { +static int matchdot(char c) +{ #if defined(RE_DOT_MATCHES_NEWLINE) && (RE_DOT_MATCHES_NEWLINE == 1) - (void)c; - return 1; + (void) c; + return 1; #else - return c != '\n' && c != '\r'; + return c != '\n' && c != '\r'; #endif - } +} - static int ismetachar(char c) - { - return ((c == 's') || (c == 'S') - || (c == 'w') || (c == 'W') - || (c == 'd') || (c == 'D')); - } +static int ismetachar(char c) +{ + return ((c == 's') || (c == 'S') || (c == 'w') || (c == 'W') || (c == 'd') || (c == 'D')); +} - static int matchmetachar(char c, const char *str) - { - switch (str[0]) { - case 'd': return matchdigit(c); - case 'D': return !matchdigit(c); - case 'i': return matchint(c); - case 'I': return !matchint(c); - case 'f': return matchfloat(c); - case 'F': return !matchfloat(c); - case 'w': return matchalphanum(c); - case 'W': return !matchalphanum(c); - case 's': return matchwhitespace(c); - case 'S': return !matchwhitespace(c); - default: return (c == str[0]); - } +static int matchmetachar(char c, const char *str) +{ + switch (str[0]) { + case 'd': + return matchdigit(c); + case 'D': + return !matchdigit(c); + case 'i': + return matchint(c); + case 'I': + return !matchint(c); + case 'f': + return matchfloat(c); + case 'F': + return !matchfloat(c); + case 'w': + return matchalphanum(c); + case 'W': + return !matchalphanum(c); + case 's': + return matchwhitespace(c); + case 'S': + return !matchwhitespace(c); + default: + return (c == str[0]); } +} - static int matchcharclass(char c, const char *str) - { - do { - if (matchrange(c, str)) { +static int matchcharclass(char c, const char *str) +{ + do { + if (matchrange(c, str)) { + return 1; + } else if (str[0] == '\\') { + /* Escape-char: increment str-ptr and match on next char */ + str += 1; + if (matchmetachar(c, str)) { + return 1; + } else if ((c == str[0]) && !ismetachar(c)) { return 1; - } else if (str[0] == '\\') { - /* Escape-char: increment str-ptr and match on next char */ - str += 1; - if (matchmetachar(c, str)) { - return 1; - } else if ((c == str[0]) && !ismetachar(c)) { - return 1; - } - } else if (c == str[0]) { - if (c == '-') { - return ((str[-1] == '\0') || (str[1] == '\0')); - } else { - return 1; - } } - } - while (*str++ != '\0'); - - return 0; - } - - static int matchone(regex_t p, char c) - { - switch (p.type) { - case DOT: return matchdot(c); - case CHAR_CLASS: return matchcharclass(c, (const char *)p.u.ccl); - case INV_CHAR_CLASS: return !matchcharclass(c, (const char *)p.u.ccl); - case DIGIT: return matchdigit(c); - case NOT_DIGIT: return !matchdigit(c); - case INTEGER: return matchint(c); - case NOT_INTEGER: return !matchint(c); - case FLOAT: return matchfloat(c); - case NOT_FLOAT: return !matchfloat(c); - case ALPHA: return matchalphanum(c); - case NOT_ALPHA: return !matchalphanum(c); - case WHITESPACE: return matchwhitespace(c); - case NOT_WHITESPACE: return !matchwhitespace(c); - default: return (p.u.ch == c); - } - } - - static int matchstar(regex_t p, regex_t *pattern, const char *text, int *matchlen) - { - int prelen = *matchlen; - const char *prepos = text; - while ((text[0] != '\0') && matchone(p, *text)) - { - text++; - (*matchlen)++; - } - while (text >= prepos) - { - if (matchpattern(pattern, text--, matchlen)) - return 1; - (*matchlen)--; - } - - *matchlen = prelen; - return 0; - } - - static int matchplus(regex_t p, regex_t *pattern, const char *text, int *matchlen) - { - const char *prepos = text; - while ((text[0] != '\0') && matchone(p, *text)) - { - text++; - (*matchlen)++; - } - while (text > prepos) - { - if (matchpattern(pattern, text--, matchlen)) - return 1; - (*matchlen)--; - } - return 0; - } - - static int matchquestion(regex_t p, regex_t *pattern, const char *text, int *matchlen) - { - if (p.type == UNUSED) - return 1; - if (matchpattern(pattern, text, matchlen)) - return 1; - if (*text && matchone(p, *text++)) - { - if (matchpattern(pattern, text, matchlen)) - { - (*matchlen)++; + } else if (c == str[0]) { + if (c == '-') { + return ((str[-1] == '\0') || (str[1] == '\0')); + } else { return 1; } } - return 0; + } while (*str++ != '\0'); + + return 0; +} + +static int matchone(regex_t p, char c) +{ + switch (p.type) { + case DOT: + return matchdot(c); + case CHAR_CLASS: + return matchcharclass(c, (const char *) p.u.ccl); + case INV_CHAR_CLASS: + return !matchcharclass(c, (const char *) p.u.ccl); + case DIGIT: + return matchdigit(c); + case NOT_DIGIT: + return !matchdigit(c); + case INTEGER: + return matchint(c); + case NOT_INTEGER: + return !matchint(c); + case FLOAT: + return matchfloat(c); + case NOT_FLOAT: + return !matchfloat(c); + case ALPHA: + return matchalphanum(c); + case NOT_ALPHA: + return !matchalphanum(c); + case WHITESPACE: + return matchwhitespace(c); + case NOT_WHITESPACE: + return !matchwhitespace(c); + default: + return (p.u.ch == c); } +} + +static int matchstar(regex_t p, regex_t *pattern, const char *text, int *matchlen) +{ + int prelen = *matchlen; + const char *prepos = text; + while ((text[0] != '\0') && matchone(p, *text)) { + text++; + (*matchlen)++; + } + while (text >= prepos) { + if (matchpattern(pattern, text--, matchlen)) return 1; + (*matchlen)--; + } + + *matchlen = prelen; + return 0; +} + +static int matchplus(regex_t p, regex_t *pattern, const char *text, int *matchlen) +{ + const char *prepos = text; + while ((text[0] != '\0') && matchone(p, *text)) { + text++; + (*matchlen)++; + } + while (text > prepos) { + if (matchpattern(pattern, text--, matchlen)) return 1; + (*matchlen)--; + } + return 0; +} + +static int matchquestion(regex_t p, regex_t *pattern, const char *text, int *matchlen) +{ + if (p.type == UNUSED) return 1; + if (matchpattern(pattern, text, matchlen)) return 1; + if (*text && matchone(p, *text++)) { + if (matchpattern(pattern, text, matchlen)) { + (*matchlen)++; + return 1; + } + } + return 0; +} /* Iterative matching */ - static int matchpattern(regex_t *pattern, const char *text, int *matchlen) - { - int pre = *matchlen; - do { - if ((pattern[0].type == UNUSED) || (pattern[1].type == QUESTIONMARK)) { - return matchquestion(pattern[0], &pattern[2], text, matchlen); - } else if (pattern[1].type == STAR) { - return matchstar(pattern[0], &pattern[2], text, matchlen); - } else if (pattern[1].type == PLUS) { - return matchplus(pattern[0], &pattern[2], text, matchlen); - } else if ((pattern[0].type == END) && pattern[1].type == UNUSED) { - return (text[0] == '\0'); - } - (*matchlen)++; +static int matchpattern(regex_t *pattern, const char *text, int *matchlen) +{ + int pre = *matchlen; + do { + if ((pattern[0].type == UNUSED) || (pattern[1].type == QUESTIONMARK)) { + return matchquestion(pattern[0], &pattern[2], text, matchlen); + } else if (pattern[1].type == STAR) { + return matchstar(pattern[0], &pattern[2], text, matchlen); + } else if (pattern[1].type == PLUS) { + return matchplus(pattern[0], &pattern[2], text, matchlen); + } else if ((pattern[0].type == END) && pattern[1].type == UNUSED) { + return (text[0] == '\0'); } - while ((text[0] != '\0') && matchone(*pattern++, *text++)); - - *matchlen = pre; - return 0; - } + (*matchlen)++; + } while ((text[0] != '\0') && matchone(*pattern++, *text++)); + *matchlen = pre; + return 0; +} } diff --git a/src/utils.h b/src/utils.h index d60ba0a4f6..58b6df7725 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -16,8 +16,8 @@ /*! \file utils.h */ -#include "lmptype.h" #include "fmt/format.h" +#include "lmptype.h" #include @@ -27,34 +27,33 @@ namespace LAMMPS_NS { - // forward declarations - class Error; - class LAMMPS; +// forward declarations +class Error; +class LAMMPS; - namespace utils { +namespace utils { - /** Match text against a simplified regex pattern + /** Match text against a simplified regex pattern * * \param text the text to be matched against the pattern * \param pattern the search pattern, which may contain regexp markers * \return true if the pattern matches, false if not */ - bool strmatch(const std::string &text, const std::string &pattern); + bool strmatch(const std::string &text, const std::string &pattern); - /** Find sub-string that matches a simplified regex pattern + /** Find sub-string that matches a simplified regex pattern * * \param text the text to be matched against the pattern * \param pattern the search pattern, which may contain regexp markers * \return the string that matches the patters or an empty one */ - std::string strfind(const std::string &text, const std::string &pattern); + std::string strfind(const std::string &text, const std::string &pattern); - /* Internal function handling the argument list for logmesg(). */ + /* Internal function handling the argument list for logmesg(). */ - void fmtargs_logmesg(LAMMPS *lmp, fmt::string_view format, - fmt::format_args args); + void fmtargs_logmesg(LAMMPS *lmp, fmt::string_view format, fmt::format_args args); - /** Send formatted message to screen and logfile, if available + /** Send formatted message to screen and logfile, if available * * This function simplifies the repetitive task of outputting some * message to both the screen and/or the log file. The template @@ -65,28 +64,27 @@ namespace LAMMPS_NS { * \param format format string of message to be printed * \param args arguments to format string */ - template - void logmesg(LAMMPS *lmp, const S &format, Args&&... args) { - fmtargs_logmesg(lmp, format, - fmt::make_args_checked(format, args...)); - } + template void logmesg(LAMMPS *lmp, const S &format, Args &&...args) + { + fmtargs_logmesg(lmp, format, fmt::make_args_checked(format, args...)); + } - /** \overload + /** \overload * * \param lmp pointer to LAMMPS class instance * \param mesg string with message to be printed */ - void logmesg(LAMMPS *lmp, const std::string &mesg); + void logmesg(LAMMPS *lmp, const std::string &mesg); - /** Return a string representing the current system error status + /** Return a string representing the current system error status * * This is a wrapper around calling strerror(errno). * * \return error string */ - std::string getsyserror(); + std::string getsyserror(); - /** Wrapper around fgets() which reads whole lines but truncates the + /** Wrapper around fgets() which reads whole lines but truncates the * data to the buffer size and ensures a newline char at the end. * * This function is useful for reading line based text files with @@ -98,9 +96,9 @@ namespace LAMMPS_NS { * \param size size of buffer s (max number of bytes returned) * \param fp file pointer used by fgets() */ - char *fgets_trunc(char *s, int size, FILE *fp); + char *fgets_trunc(char *s, int size, FILE *fp); - /** Safe wrapper around fgets() which aborts on errors + /** Safe wrapper around fgets() which aborts on errors * or EOF and prints a suitable error message to help debugging. * * Use nullptr as the error parameter to avoid the abort on EOF or error. @@ -113,10 +111,10 @@ namespace LAMMPS_NS { * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) or nullptr */ - void sfgets(const char *srcname, int srcline, char *s, int size, - FILE *fp, const char *filename, Error *error); + void sfgets(const char *srcname, int srcline, char *s, int size, FILE *fp, const char *filename, + Error *error); - /** Safe wrapper around fread() which aborts on errors + /** Safe wrapper around fread() which aborts on errors * or EOF and prints a suitable error message to help debugging. * * Use nullptr as the error parameter to avoid the abort on EOF or error. @@ -130,10 +128,10 @@ namespace LAMMPS_NS { * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) or nullptr */ - void sfread(const char *srcname, int srcline, void *s, size_t size, - size_t num, FILE *fp, const char *filename, Error *error); + void sfread(const char *srcname, int srcline, void *s, size_t size, size_t num, FILE *fp, + const char *filename, Error *error); - /** Read N lines of text from file into buffer and broadcast them + /** Read N lines of text from file into buffer and broadcast them * * This function uses repeated calls to fread() to fill a buffer with * newline terminated text. If a line does not end in a newline (e.g. @@ -150,20 +148,19 @@ namespace LAMMPS_NS { * \param comm MPI communicator for broadcast * \return 1 if the read was short, 0 if read was successful */ - int read_lines_from_file(FILE *fp, int nlines, int nmax, - char *buffer, int me, MPI_Comm comm); + int read_lines_from_file(FILE *fp, int nlines, int nmax, char *buffer, int me, MPI_Comm comm); - /** Report if a requested style is in a package or may have a typo + /** Report if a requested style is in a package or may have a typo * * \param style type of style that is to be checked for * \param name name of style that was not found * \param lmp pointer to top-level LAMMPS class instance * \return string usable for error messages */ - std::string check_packages_for_style(const std::string &style, - const std::string &name, LAMMPS *lmp); + std::string check_packages_for_style(const std::string &style, const std::string &name, + LAMMPS *lmp); - /** Convert a string to a floating point number while checking + /** Convert a string to a floating point number while checking * if it is a valid floating point or integer number * * \param file name of source file for error message @@ -173,10 +170,9 @@ namespace LAMMPS_NS { * \param lmp pointer to top-level LAMMPS class instance * \return double precision floating point number */ - double numeric(const char *file, int line, const char *str, - bool do_abort, LAMMPS *lmp); + double numeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp); - /** Convert a string to an integer number while checking + /** Convert a string to an integer number while checking * if it is a valid integer number (regular int) * * \param file name of source file for error message @@ -186,10 +182,9 @@ namespace LAMMPS_NS { * \param lmp pointer to top-level LAMMPS class instance * \return integer number (regular int) */ - int inumeric(const char *file, int line, const char *str, - bool do_abort, LAMMPS *lmp); + int inumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp); - /** Convert a string to an integer number while checking + /** Convert a string to an integer number while checking * if it is a valid integer number (bigint) * * \param file name of source file for error message @@ -199,10 +194,9 @@ namespace LAMMPS_NS { * \param lmp pointer to top-level LAMMPS class instance * \return integer number (bigint) */ - bigint bnumeric(const char *file, int line, const char *str, - bool do_abort, LAMMPS *lmp); + bigint bnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp); - /** Convert a string to an integer number while checking + /** Convert a string to an integer number while checking * if it is a valid integer number (tagint) * * \param file name of source file for error message @@ -212,10 +206,9 @@ namespace LAMMPS_NS { * \param lmp pointer to top-level LAMMPS class instance * \return integer number (tagint) */ - tagint tnumeric(const char *file, int line, const char *str, - bool do_abort, LAMMPS *lmp); + tagint tnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp); - /** Compute index bounds derived from a string with a possible wildcard + /** Compute index bounds derived from a string with a possible wildcard * * This functions processes the string in *str* and set the values of *nlo* * and *nhi* according to the following five cases: @@ -235,11 +228,11 @@ namespace LAMMPS_NS { * \param nhi upper bound * \param error pointer to Error class for out-of-bounds messages */ - template - void bounds(const char *file, int line, const std::string &str, - bigint nmin, bigint nmax, TYPE &nlo, TYPE &nhi, Error *error); + template + void bounds(const char *file, int line, const std::string &str, bigint nmin, bigint nmax, + TYPE &nlo, TYPE &nhi, Error *error); - /** Expand list of arguments when containing fix/compute wildcards + /** Expand list of arguments when containing fix/compute wildcards * * This function searches the list of arguments in *arg* for strings * of the kind c_ID[*] or f_ID[*] referring to computes or fixes. @@ -264,10 +257,10 @@ namespace LAMMPS_NS { * \param lmp pointer to top-level LAMMPS class instance * \return number of arguments in expanded list */ - int expand_args(const char *file, int line, int narg, char **arg, - int mode, char **&earg, LAMMPS *lmp); + int expand_args(const char *file, int line, int narg, char **arg, int mode, char **&earg, + LAMMPS *lmp); - /** Make C-style copy of string in new storage + /** Make C-style copy of string in new storage * * This allocates a storage buffer and copies the C-style or * C++ style string into it. The buffer is allocated with "new" @@ -276,23 +269,23 @@ namespace LAMMPS_NS { * \param text string that should be copied * \return new buffer with copy of string */ - char *strdup(const std::string &text); + char *strdup(const std::string &text); - /** Trim leading and trailing whitespace. Like TRIM() in Fortran. + /** Trim leading and trailing whitespace. Like TRIM() in Fortran. * * \param line string that should be trimmed * \return new string without whitespace (string) */ - std::string trim(const std::string &line); + std::string trim(const std::string &line); - /** Return string with anything from '#' onward removed + /** Return string with anything from '#' onward removed * * \param line string that should be trimmed * \return new string without comment (string) */ - std::string trim_comment(const std::string &line); + std::string trim_comment(const std::string &line); - /** Check if a string will likely have UTF-8 encoded characters + /** 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 * all other characters are encoded as multiple bytes. For the multi-byte @@ -316,13 +309,14 @@ namespace LAMMPS_NS { * \param line string that should be checked * \return true if string contains UTF-8 encoded characters (bool) */ - inline bool has_utf8(const std::string &line) - { - for (auto c : line) if (c & 0x80U) return true; - return false; - } + inline bool has_utf8(const std::string &line) + { + for (auto c : line) + if (c & 0x80U) return true; + return false; + } - /** Replace known UTF-8 characters with ASCII equivalents + /** Replace known UTF-8 characters with ASCII equivalents * \verbatim embed:rst @@ -333,39 +327,39 @@ namespace LAMMPS_NS { * \param line string that should be converted * \return new string with ascii replacements (string) */ - std::string utf8_subst(const std::string &line); + std::string utf8_subst(const std::string &line); - /** Count words in string with custom choice of separating characters + /** Count words in string with custom choice of separating characters * * \param text string that should be searched * \param separators string containing characters that will be treated as whitespace * \return number of words found */ - size_t count_words(const std::string &text, const std::string &separators); + size_t count_words(const std::string &text, const std::string &separators); - /** Count words in string, ignore any whitespace matching " \t\r\n\f" + /** Count words in string, ignore any whitespace matching " \t\r\n\f" * * \param text string that should be searched * \return number of words found */ - size_t count_words(const std::string &text); + size_t count_words(const std::string &text); - /** Count words in C-string, ignore any whitespace matching " \t\r\n\f" + /** Count words in C-string, ignore any whitespace matching " \t\r\n\f" * * \param text string that should be searched * \return number of words found */ - size_t count_words(const char *text); + size_t count_words(const char *text); - /** Count words in a single line, trim anything from '#' onward + /** Count words in a single line, trim anything from '#' onward * * \param text string that should be trimmed and searched * \param separators string containing characters that will be treated as whitespace * \return number of words found */ - size_t trim_and_count_words(const std::string &text, const std::string &separators = " \t\r\n\f"); + size_t trim_and_count_words(const std::string &text, const std::string &separators = " \t\r\n\f"); - /** Take text and split into non-whitespace words. + /** Take text and split into non-whitespace words. * * This can handle strings with single and double quotes, escaped quotes, * and escaped codes within quotes, but due to using an STL container and @@ -379,41 +373,40 @@ namespace LAMMPS_NS { :cpp:class:`Tokenizer`, :cpp:class:`ValueTokenizer` \endverbatim - * * \param text string that should be split * \return STL vector with the words */ - std::vector split_words(const std::string &text); + std::vector split_words(const std::string &text); - /** Take multi-line text and split into lines + /** Take multi-line text and split into lines * * \param text string that should be split * \return STL vector with the lines */ - std::vector split_lines(const std::string &text); + std::vector split_lines(const std::string &text); - /** Check if string can be converted to valid integer + /** Check if string can be converted to valid integer * * \param str string that should be checked * \return true, if string contains valid a integer, false otherwise */ - bool is_integer(const std::string &str); + bool is_integer(const std::string &str); - /** Check if string can be converted to valid floating-point number + /** Check if string can be converted to valid floating-point number * * \param str string that should be checked * \return true, if string contains valid number, false otherwise */ - bool is_double(const std::string &str); + bool is_double(const std::string &str); - /** Check if string is a valid ID + /** Check if string is a valid ID * ID strings may contain only letters, numbers, and underscores. * * \param str string that should be checked * \return true, if string contains valid id, false otherwise */ - bool is_id(const std::string &str); + bool is_id(const std::string &str); - /** Try to detect pathname from FILE pointer. + /** Try to detect pathname from FILE pointer. * * Currently only supported on Linux, otherwise will report "(unknown)". * @@ -422,23 +415,23 @@ namespace LAMMPS_NS { * \param fp FILE pointer struct from STDIO library for which we want to detect the name * \return pointer to the storage buffer, i.e. buf */ - const char *guesspath(char *buf, int len, FILE *fp); + const char *guesspath(char *buf, int len, FILE *fp); - /** Strip off leading part of path, return just the filename + /** Strip off leading part of path, return just the filename * * \param path file path * \return file name */ - std::string path_basename(const std::string &path); + std::string path_basename(const std::string &path); - /** Return the directory part of a path. Return "." if empty + /** Return the directory part of a path. Return "." if empty * * \param path file path * \return directory name */ - std::string path_dirname(const std::string &path); + std::string path_dirname(const std::string &path); - /** Join two pathname segments + /** Join two pathname segments * * This uses the forward slash '/' character unless LAMMPS is compiled * for Windows where it used the equivalent backward slash '\\'. @@ -447,59 +440,57 @@ namespace LAMMPS_NS { * \param b second path * \return combined path */ - std::string path_join(const std::string &a, const std::string &b); + std::string path_join(const std::string &a, const std::string &b); - /** Check if file exists and is readable + /** Check if file exists and is readable * * \param path file path * \return true if file exists and is readable */ - bool file_is_readable(const std::string &path); + bool file_is_readable(const std::string &path); - /** Determine full path of potential file. If file is not found in current directory, + /** Determine full path of potential file. If file is not found in current directory, * search directories listed in LAMMPS_POTENTIALS environment variable * * \param path file path * \return full path to potential file */ - std::string get_potential_file_path(const std::string &path); + std::string get_potential_file_path(const std::string &path); - /** Read potential file and return DATE field if it is present + /** Read potential file and return DATE field if it is present * * \param path file path * \param potential_name name of potential that is being read * \return DATE field if present */ - std::string get_potential_date(const std::string &path, - const std::string &potential_name); + std::string get_potential_date(const std::string &path, const std::string &potential_name); - /** Read potential file and return UNITS field if it is present + /** Read potential file and return UNITS field if it is present * * \param path file path * \param potential_name name of potential that is being read * \return UNITS field if present */ - std::string get_potential_units(const std::string &path, - const std::string &potential_name); + std::string get_potential_units(const std::string &path, const std::string &potential_name); - enum { NOCONVERT = 0, METAL2REAL = 1, REAL2METAL = 1<<1 }; - enum { UNKNOWN = 0, ENERGY }; + enum { NOCONVERT = 0, METAL2REAL = 1, REAL2METAL = 1 << 1 }; + enum { UNKNOWN = 0, ENERGY }; - /** Return bitmask of available conversion factors for a given property + /** Return bitmask of available conversion factors for a given property * * \param property property to be converted * \return bitmask indicating available conversions */ - int get_supported_conversions(const int property); + int get_supported_conversions(const int property); - /** Return unit conversion factor for given property and selected from/to units + /** Return unit conversion factor for given property and selected from/to units * * \param property property to be converted * \param conversion constant indicating the conversion * \return conversion factor */ - double get_conversion_factor(const int property, const int conversion); + double get_conversion_factor(const int property, const int conversion); - /** Open a potential file as specified by *name* + /** Open a potential file as specified by *name* * * If opening the file directly fails, the function will search for * it in the list of folder pointed to by the environment variable @@ -520,18 +511,18 @@ namespace LAMMPS_NS { * \param auto_convert pointer to unit conversion bitmask or ``nullptr`` * \return FILE pointer of the opened potential file or ``nullptr`` */ - FILE *open_potential(const std::string &name, LAMMPS *lmp, int *auto_convert); + FILE *open_potential(const std::string &name, LAMMPS *lmp, int *auto_convert); - /** Convert a time string to seconds + /** Convert a time string to seconds * * The strings "off" and "unlimited" result in -1 * * \param timespec a string in the following format: ([[HH:]MM:]SS) * \return total in seconds */ - double timespec2seconds(const std::string ×pec); + double timespec2seconds(const std::string ×pec); - /** Convert a LAMMPS version date to a number + /** Convert a LAMMPS version date to a number * * This will generate a number YYYYMMDD from a date string * (with or without blanks) that is suitable for numerical @@ -546,9 +537,9 @@ namespace LAMMPS_NS { * * \param date string in the format (Day Month Year) * \return date code */ - int date2num(const std::string &date); + int date2num(const std::string &date); - /** Custom merge sort implementation + /** Custom merge sort implementation * * This function provides a custom upward hybrid merge sort * implementation with support to pass an opaque pointer to @@ -563,10 +554,9 @@ namespace LAMMPS_NS { * \param ptr Pointer to opaque object passed to comparison function * \param comp Pointer to comparison function */ - void merge_sort(int *index, int num, void *ptr, - int (*comp)(int, int, void *)); - } -} + void merge_sort(int *index, int num, void *ptr, int (*comp)(int, int, void *)); +} // namespace utils +} // namespace LAMMPS_NS #endif diff --git a/src/variable.cpp b/src/variable.cpp index 52b6ec35b9..953d0ddf85 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/variable.h b/src/variable.h index 2c63790ea9..845145d336 100644 --- a/src/variable.h +++ b/src/variable.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -19,7 +19,8 @@ namespace LAMMPS_NS { class Variable : protected Pointers { - friend class Info; + friend class Info; + public: Variable(class LAMMPS *); ~Variable(); @@ -50,58 +51,74 @@ class Variable : protected Pointers { double evaluate_boolean(char *); public: - int nvar; // # of defined variables - char **names; // name of each variable + int nvar; // # of defined variables + char **names; // name of each variable // must match "varstyles" array in info.cpp - enum{INDEX,LOOP,WORLD,UNIVERSE,ULOOP,STRING,GETENV, - SCALARFILE,ATOMFILE,FORMAT,EQUAL,ATOM,VECTOR,PYTHON,INTERNAL}; + enum { + INDEX, + LOOP, + WORLD, + UNIVERSE, + ULOOP, + STRING, + GETENV, + SCALARFILE, + ATOMFILE, + FORMAT, + EQUAL, + ATOM, + VECTOR, + PYTHON, + INTERNAL + }; private: int me; - int maxvar; // max # of variables following lists can hold - int *style; // style of each variable - int *num; // # of values for each variable - int *which; // next available value for each variable - int *pad; // 1 = pad loop/uloop variables with 0s, 0 = no pad - class VarReader **reader; // variable that reads from file - char ***data; // str value of each variable's values - double *dvalue; // single numeric value for internal variables + int maxvar; // max # of variables following lists can hold + int *style; // style of each variable + int *num; // # of values for each variable + int *which; // next available value for each variable + int *pad; // 1 = pad loop/uloop variables with 0s, 0 = no pad + class VarReader **reader; // variable that reads from file + char ***data; // str value of each variable's values + double *dvalue; // single numeric value for internal variables struct VecVar { - int n,nmax; + int n, nmax; bigint currentstep; double *values; }; VecVar *vecs; - int *eval_in_progress; // flag if evaluation of variable is in progress - int treetype; // ATOM or VECTOR flag for formula evaluation + int *eval_in_progress; // flag if evaluation of variable is in progress + int treetype; // ATOM or VECTOR flag for formula evaluation - class RanMars *randomequal; // random number generator for equal-style vars - class RanMars *randomatom; // random number generator for atom-style vars + class RanMars *randomequal; // random number generator for equal-style vars + class RanMars *randomatom; // random number generator for atom-style vars - int precedence[18]; // precedence level of math operators - // set length to include up to XOR in enum + int precedence[18]; // precedence level of math operators + // set length to include up to XOR in enum - struct Tree { // parse tree for atom-style or vector-style vars - double value; // single scalar - double *array; // per-atom or per-type list of doubles - int *iarray; // per-atom list of ints - bigint *barray; // per-atom list of bigints - int type; // operation, see enum{} in variable.cpp - int nvector; // length of array for vector-style variable - int nstride; // stride between atoms if array is a 2d array - int selfalloc; // 1 if array is allocated here, else 0 - int ivalue1,ivalue2; // extra values needed for gmask,rmask,grmask - int nextra; // # of additional args beyond first 2 - Tree *first,*second; // ptrs further down tree for first 2 args - Tree **extra; // ptrs further down tree for nextra args + struct Tree { // parse tree for atom-style or vector-style vars + double value; // single scalar + double *array; // per-atom or per-type list of doubles + int *iarray; // per-atom list of ints + bigint *barray; // per-atom list of bigints + int type; // operation, see enum{} in variable.cpp + int nvector; // length of array for vector-style variable + int nstride; // stride between atoms if array is a 2d array + int selfalloc; // 1 if array is allocated here, else 0 + int ivalue1, ivalue2; // extra values needed for gmask,rmask,grmask + int nextra; // # of additional args beyond first 2 + Tree *first, *second; // ptrs further down tree for first 2 args + Tree **extra; // ptrs further down tree for nextra args Tree() : - array(nullptr), iarray(nullptr), barray(nullptr), - selfalloc(0), ivalue1(0), ivalue2(0), nextra(0), - first(nullptr), second(nullptr), extra(nullptr) {} + array(nullptr), iarray(nullptr), barray(nullptr), selfalloc(0), ivalue1(0), ivalue2(0), + nextra(0), first(nullptr), second(nullptr), extra(nullptr) + { + } }; int compute_python(int); @@ -115,21 +132,16 @@ class Variable : protected Pointers { int compare_tree_vector(int, int); void free_tree(Tree *); int find_matching_paren(char *, int, char *&, int); - int math_function(char *, char *, Tree **, Tree **, - int &, double *, int &, int); - int group_function(char *, char *, Tree **, Tree **, - int &, double *, int &, int); + int math_function(char *, char *, Tree **, Tree **, int &, double *, int &, int); + int group_function(char *, char *, Tree **, Tree **, int &, double *, int &, int); int region_function(char *, int); - int special_function(char *, char *, Tree **, Tree **, - int &, double *, int &, int); - void peratom2global(int, char *, double *, int, tagint, - Tree **, Tree **, int &, double *, int &); + int special_function(char *, char *, Tree **, Tree **, int &, double *, int &, int); + void peratom2global(int, char *, double *, int, tagint, Tree **, Tree **, int &, double *, int &); int is_atom_vector(char *); void atom_vector(char *, Tree **, Tree **, int &); int parse_args(char *, char **); char *find_next_comma(char *); - void print_var_error(const std::string &, int, const std::string &, - int, int global=1); + void print_var_error(const std::string &, int, const std::string &, int, int global = 1); void print_tree(Tree *, int); }; @@ -144,12 +156,12 @@ class VarReader : protected Pointers { int read_peratom(); private: - int me,style; + int me, style; FILE *fp; char *buffer; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/velocity.cpp b/src/velocity.cpp index 44d1556676..acc374fa4a 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/velocity.h b/src/velocity.h index b86f7a8c32..f0a756350c 100644 --- a/src/velocity.h +++ b/src/velocity.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(velocity,Velocity) - +// clang-format off +CommandStyle(velocity,Velocity); +// clang-format on #else #ifndef LMP_VELOCITY_H @@ -33,11 +33,11 @@ class Velocity : public Command { void create(double, int); private: - int igroup,groupbit; + int igroup, groupbit; int style; - int dist_flag,sum_flag,momentum_flag,rotation_flag; - int bias_flag,loop_flag,scale_flag,rfix; - double xscale,yscale,zscale; + int dist_flag, sum_flag, momentum_flag, rotation_flag; + int bias_flag, loop_flag, scale_flag, rfix; + double xscale, yscale, zscale; class Compute *temperature; void set(int, char **); @@ -50,7 +50,7 @@ class Velocity : public Command { void zero_rotation(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/verlet.cpp b/src/verlet.cpp index 8d744275d2..b9b0b392e1 100644 --- a/src/verlet.cpp +++ b/src/verlet.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/verlet.h b/src/verlet.h index 91b69c2821..4348bcfa07 100644 --- a/src/verlet.h +++ b/src/verlet.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef INTEGRATE_CLASS - -IntegrateStyle(verlet,Verlet) - +// clang-format off +IntegrateStyle(verlet,Verlet); +// clang-format on #else #ifndef LMP_VERLET_H @@ -35,13 +35,13 @@ class Verlet : public Integrate { void cleanup(); protected: - int triclinic; // 0 if domain is orthog, 1 if triclinic - int torqueflag,extraflag; + int triclinic; // 0 if domain is orthog, 1 if triclinic + int torqueflag, extraflag; virtual void force_clear(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/version.h b/src/version.h index d7839fcbfe..39344fdf55 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "8 Apr 2021" +#define LAMMPS_VERSION "14 May 2021" diff --git a/src/write_coeff.cpp b/src/write_coeff.cpp index b0c547a7d6..e030148901 100644 --- a/src/write_coeff.cpp +++ b/src/write_coeff.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/write_coeff.h b/src/write_coeff.h index ddbeb958a1..d6a447080f 100644 --- a/src/write_coeff.h +++ b/src/write_coeff.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(write_coeff,WriteCoeff) - +// clang-format off +CommandStyle(write_coeff,WriteCoeff); +// clang-format on #else #ifndef LMP_WRITE_COEFF_H @@ -26,11 +26,11 @@ namespace LAMMPS_NS { class WriteCoeff : public Command { public: - WriteCoeff(class LAMMPS *lmp) : Command(lmp) {}; + WriteCoeff(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/write_data.cpp b/src/write_data.cpp index 3db35190b5..9016528049 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/write_data.h b/src/write_data.h index be13e03dc0..74e7e6136e 100644 --- a/src/write_data.h +++ b/src/write_data.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(write_data,WriteData) - +// clang-format off +CommandStyle(write_data,WriteData); +// clang-format on #else #ifndef LMP_WRITE_DATA_H @@ -31,15 +31,15 @@ class WriteData : public Command { void write(const std::string &); private: - int me,nprocs; + int me, nprocs; int pairflag; int coeffflag; int fixflag; FILE *fp; - bigint nbonds_local,nbonds; - bigint nangles_local,nangles; - bigint ndihedrals_local,ndihedrals; - bigint nimpropers_local,nimpropers; + bigint nbonds_local, nbonds; + bigint nangles_local, nangles; + bigint ndihedrals_local, ndihedrals; + bigint nimpropers_local, nimpropers; void header(); void type_arrays(); @@ -54,7 +54,7 @@ class WriteData : public Command { void fix(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/write_dump.cpp b/src/write_dump.cpp index eed7dd36fa..f5b351fae1 100644 --- a/src/write_dump.cpp +++ b/src/write_dump.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -56,15 +57,17 @@ void WriteDump::command(int narg, char **arg) for (int i = 2; i < modindex; ++i) dumpargs[i+2] = arg[i]; - if (0) return; // dummy line to enable else-if macro expansion + if (0) { + return; // dummy line to enable else-if macro expansion #define DUMP_CLASS #define DumpStyle(key,Class) \ - else if (strcmp(arg[1],#key) == 0) dump = new Class(lmp,modindex+2,dumpargs); + } else if (strcmp(arg[1],#key) == 0) { \ + dump = new Class(lmp,modindex+2,dumpargs); #include "style_dump.h" #undef DUMP_CLASS - else error->all(FLERR,utils::check_packages_for_style("dump",arg[1],lmp)); + } else error->all(FLERR,utils::check_packages_for_style("dump",arg[1],lmp)); if (modindex < narg) dump->modify_params(narg-modindex-1,&arg[modindex+1]); diff --git a/src/write_dump.h b/src/write_dump.h index 75a8b57fd5..bea5660a29 100644 --- a/src/write_dump.h +++ b/src/write_dump.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(write_dump,WriteDump) - +// clang-format off +CommandStyle(write_dump,WriteDump); +// clang-format on #else #ifndef LMP_WRITE_DUMP_H @@ -26,11 +26,11 @@ namespace LAMMPS_NS { class WriteDump : public Command { public: - WriteDump(class LAMMPS *lmp) : Command(lmp) {}; + WriteDump(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/write_restart.cpp b/src/write_restart.cpp index 45a0267d19..3624bf0332 100644 --- a/src/write_restart.cpp +++ b/src/write_restart.cpp @@ -1,6 +1,7 @@ +// clang-format off /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/src/write_restart.h b/src/write_restart.h index c04f18d50a..2e018e1036 100644 --- a/src/write_restart.h +++ b/src/write_restart.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #ifdef COMMAND_CLASS - -CommandStyle(write_restart,WriteRestart) - +// clang-format off +CommandStyle(write_restart,WriteRestart); +// clang-format on #else #ifndef LMP_WRITE_RESTART_H @@ -32,22 +32,22 @@ class WriteRestart : public Command { void write(std::string); private: - int me,nprocs; + int me, nprocs; FILE *fp; - bigint natoms; // natoms (sum of nlocal) to write into file + bigint natoms; // natoms (sum of nlocal) to write into file int noinit; - int multiproc; // 0 = proc 0 writes for all - // else # of procs writing files - int nclusterprocs; // # of procs in my cluster that write to one file - int filewriter; // 1 if this proc writes a file, else 0 - int fileproc; // ID of proc in my cluster who writes to file - int icluster; // which cluster I am in + int multiproc; // 0 = proc 0 writes for all + // else # of procs writing files + int nclusterprocs; // # of procs in my cluster that write to one file + int filewriter; // 1 if this proc writes a file, else 0 + int fileproc; // ID of proc in my cluster who writes to file + int icluster; // which cluster I am in // MPI-IO values - int mpiioflag; // 1 for MPIIO output, else 0 - class RestartMPIIO *mpiio; // MPIIO for restart file output + int mpiioflag; // 1 for MPIIO output, else 0 + class RestartMPIIO *mpiio; // MPIIO for restart file output MPI_Offset headerOffset; void header(); @@ -67,7 +67,7 @@ class WriteRestart : public Command { void write_double_vec(int, int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/tools/binary2txt.cpp b/tools/binary2txt.cpp index 1423fc6c24..58e2e36db0 100644 --- a/tools/binary2txt.cpp +++ b/tools/binary2txt.cpp @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/tools/coding_standard/homepage.py b/tools/coding_standard/homepage.py new file mode 100644 index 0000000000..299729f15d --- /dev/null +++ b/tools/coding_standard/homepage.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python3 +# Utility for detecting incorrect LAMMPS homepage URLs +# +# Written by Richard Berger (Temple University) +import os +import sys +import glob +import re +import yaml +import argparse +import shutil + +DEFAULT_CONFIG = """ +recursive: true +include: + - cmake/** + - doc + - doc/src/** + - python + - src/** + - tools/coding_standard +patterns: + - "*.c" + - "*.cmake" + - "*.cpp" + - "*.h" + - "*.md" + - "*.py" + - "*.rst" + - "*.sh" + - ".gitignore" + - "README" + - "requirements.txt" +""" + +def check_homepage(f): + pattern = re.compile(r'.*lammps.sandia.gov.*') + lineno = 1 + errors = set() + + for line in f: + if pattern.match(line): + errors.add(lineno) + lineno += 1 + + return errors + +def check_file(path): + if path.find('homepage.py') >= 0: return { 'homepage_errors' : '' } + encoding = 'UTF-8' + whitespace_errors = set() + try: + with open(path, 'r') as f: + homepage_errors = check_homepage(f) + except UnicodeDecodeError: + encoding = 'ISO-8859-1' + try: + with open(path, 'r', encoding=encoding) as f: + homepage_errors = check_homepage(f) + except Exception: + encoding = 'unknown' + + return { + 'homepage_errors': homepage_errors, + 'encoding': encoding + } + +def fix_file(path, check_result): + if path.find('homepage.py') >= 0: return + newfile = path + ".modified" + with open(newfile, 'w', encoding='UTF-8') as out: + with open(path, 'r', encoding=check_result['encoding']) as src: + for line in src: + newline = line.replace("lammps.sandia.gov/doc/","docs.lammps.org/") + newline = newline.replace("http://lammps.sandia.gov/","https://www.lammps.org/") + newline = newline.replace("http://lammps.sandia.gov,","https://www.lammps.org/") + newline = newline.replace("lammps.sandia.gov","www.lammps.org") + newline = newline.replace("http://www.lammps.org","https://www.lammps.org") + print(newline, end='', file=out) + shutil.copymode(path, newfile) + shutil.move(newfile, path) + +def check_folder(directory, config, fix=False, verbose=False): + success = True + files = [] + + for base_path in config['include']: + for pattern in config['patterns']: + path = os.path.join(directory, base_path, pattern) + files += glob.glob(path, recursive=config['recursive']) + + for f in files: + path = os.path.normpath(f) + + if verbose: + print("Checking file:", path) + + result = check_file(path) + + has_resolvable_errors = False + + for lineno in result['homepage_errors']: + print("[Error] Incorrect LAMMPS homepage @ {}:{}".format(path, lineno)) + has_resolvable_errors = True + + if has_resolvable_errors: + if fix: + print("Applying automatic fixes to file:", path) + fix_file(path, result) + else: + success = False + + return success + +def main(): + parser = argparse.ArgumentParser(description='Utility for detecting and fixing whitespace issues in LAMMPS') + parser.add_argument('-c', '--config', metavar='CONFIG_FILE', help='location of a optional configuration file') + parser.add_argument('-f', '--fix', action='store_true', help='automatically fix URLs') + parser.add_argument('-v', '--verbose', action='store_true', help='verbose output') + parser.add_argument('DIRECTORY', help='directory (or file) that should be checked') + args = parser.parse_args() + + if args.config: + with open(args.config, 'r') as cfile: + config = yaml.load(cfile, Loader=yaml.FullLoader) + else: + config = yaml.load(DEFAULT_CONFIG, Loader=yaml.FullLoader) + + if os.path.isdir(args.DIRECTORY): + if not check_folder(args.DIRECTORY, config, args.fix, args.verbose): + sys.exit(1) + else: + success = True + path = os.path.normpath(args.DIRECTORY) + + if args.verbose: + print("Checking file:", path) + + result = check_file(path) + + has_resolvable_errors = False + + for lineno in result['homepage_errors']: + print("[Error] Incorrect LAMMPS homepage @ {}:{}".format(path, lineno)) + has_resolvable_errors = True + + if has_resolvable_errors: + if args.fix: + print("Applying automatic fixes to file:", path) + fix_file(path, result) + else: + success = False + + if not success: + sys.exit(1) + +if __name__ == "__main__": + main() diff --git a/tools/eff/restart2data-pEFF.cpp b/tools/eff/restart2data-pEFF.cpp index fb0b851838..db827b52a6 100644 --- a/tools/eff/restart2data-pEFF.cpp +++ b/tools/eff/restart2data-pEFF.cpp @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/ + https://www.lammps.org/ Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/tools/magic b/tools/magic index ae20fa1c39..43e8affbd3 100644 --- a/tools/magic +++ b/tools/magic @@ -3,7 +3,7 @@ # your LAMMPS files and print some useful information. # Last change: 2021-03-15 by akohlmey@gmail.com -# Binary restart file for the LAMMPS MD code, https://lammps.sandia.gov +# Binary restart file for the LAMMPS MD code, https://www.lammps.org # written on a little endian machine 0 string LammpS\ RestartT LAMMPS binary restart file @@ -23,7 +23,7 @@ >>>>>&5 bequad x Timestep %lld, >>>>>>0x10 lelong 0x1000 Big Endian -# Atom style binary dump file for the LAMMPS MD code, https://lammps.sandia.gov +# Atom style binary dump file for the LAMMPS MD code, https://www.lammps.org # written on a little endian machine 0 lequad -8 @@ -39,7 +39,7 @@ >>>0x10 lelong 0x1000 Big Endian, >>>>0x18 bequad x First time step: %lld -# Atom style binary dump file for the LAMMPS MD code, https://lammps.sandia.gov +# Atom style binary dump file for the LAMMPS MD code, https://www.lammps.org # written on a little endian machine 0 lequad -10 >0x08 string DUMPCUSTOM LAMMPS custom style binary dump diff --git a/tools/mesont/dump2vtk.cpp b/tools/mesont/dump2vtk.cpp index 854d4bd3bb..e2b16178b8 100644 --- a/tools/mesont/dump2vtk.cpp +++ b/tools/mesont/dump2vtk.cpp @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/tools/offline/scripts/init_http_cache.sh b/tools/offline/scripts/init_http_cache.sh index 345ef87507..9bda6cdaa5 100755 --- a/tools/offline/scripts/init_http_cache.sh +++ b/tools/offline/scripts/init_http_cache.sh @@ -54,6 +54,7 @@ PLUMED_URL="https://github.com/plumed/plumed2/releases/download/v2.7.0/plumed-sr PACELIB_URL="https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.4.9.tar.gz" LATTE_URL="https://github.com/lanl/LATTE/archive/v1.2.2.tar.gz" SCAFACOS_URL="https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz" +MDI_URL="https://github.com/MolSSI-MDI/MDI_Library/archive/v1.2.9.tar.gz" GTEST_FILENAME="gtest-1.10.0.tar.gz" MATHJAX_FILENAME="mathjax-3.1.2.tar.gz" @@ -81,6 +82,7 @@ TARBALLS=( PACELIB_URL LATTE_URL SCAFACOS_URL + MDI_URL ) ############################################################################### diff --git a/tools/replica/README.md b/tools/replica/README.md index 9205d962b2..796799812e 100644 --- a/tools/replica/README.md +++ b/tools/replica/README.md @@ -1,6 +1,6 @@ ## reorder_remd_traj -LAMMPS Replica Exchange Molecular Dynamics (REMD) trajectories (implemented using the temper command) are arranged by replica, i.e., each trajectory is a continuous replica that records all the ups and downs in temperature. However, often the requirement is that trajectories be continuous in temperature. This requires the LAMMPS REMD trajectories to be re-ordered, which LAMMPS does not do automatically. (see the discussion [here](https://lammps.sandia.gov/threads/msg60440.html)). The reorderLAMMPSREMD tool does exactly this in parallel (using MPI) +LAMMPS Replica Exchange Molecular Dynamics (REMD) trajectories (implemented using the temper command) are arranged by replica, i.e., each trajectory is a continuous replica that records all the ups and downs in temperature. However, often the requirement is that trajectories be continuous in temperature. This requires the LAMMPS REMD trajectories to be re-ordered, which LAMMPS does not do automatically. (see the discussion [here](https://www.lammps.org/threads/msg60440.html)). The reorderLAMMPSREMD tool does exactly this in parallel (using MPI) (Protein folding trajectories in [Sanyal, Mittal and Shell, JPC, 2019, 151(4), 044111](https://aip.scitation.org/doi/abs/10.1063/1.5108761) were ordered in temperature space using this tool) @@ -49,7 +49,7 @@ So, when the dust settles, - `n` = replica number (0-15 in this case). Note: trajectories **must be in default LAMMPS format **(so stuff like dcd won't work) - You will also have a master LAMMPS log file (`logfn`) that contains the swap history of all the replicas - (for more details see [here](https://lammps.sandia.gov/doc/temper.html). Assume that this is called `log.peptide` + (for more details see [here](https://docs.lammps.org/temper.html). Assume that this is called `log.peptide` - Further you must have a txt file that numpy can read which stores all the temperature values (say this is called `temps.txt`) diff --git a/unittest/c-library/test_library_properties.cpp b/unittest/c-library/test_library_properties.cpp index 07e920bda7..cd405bfb93 100644 --- a/unittest/c-library/test_library_properties.cpp +++ b/unittest/c-library/test_library_properties.cpp @@ -161,6 +161,8 @@ TEST_F(LibraryProperties, box) boxhi[1] = 7.3; xy = 0.1; if (!verbose) ::testing::internal::CaptureStdout(); + // lammps_reset_box() may only be called without atoms + lammps_command(lmp, "delete_atoms group all bond yes"); lammps_reset_box(lmp, boxlo, boxhi, xy, yz, xz); if (!verbose) ::testing::internal::GetCapturedStdout(); lammps_extract_box(lmp, boxlo, boxhi, &xy, &yz, &xz, pflags, &boxflag); diff --git a/unittest/c-library/test_main.cpp b/unittest/c-library/test_main.cpp index c25b7ed266..7e262cfe10 100644 --- a/unittest/c-library/test_main.cpp +++ b/unittest/c-library/test_main.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/c-library/test_main.h b/unittest/c-library/test_main.h index ac9bc0d26a..567b913d27 100644 --- a/unittest/c-library/test_main.h +++ b/unittest/c-library/test_main.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/commands/test_groups.cpp b/unittest/commands/test_groups.cpp index 7feddcc685..51bbf63228 100644 --- a/unittest/commands/test_groups.cpp +++ b/unittest/commands/test_groups.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/commands/test_kim_commands.cpp b/unittest/commands/test_kim_commands.cpp index 83e1e5b2d2..526fd8163f 100644 --- a/unittest/commands/test_kim_commands.cpp +++ b/unittest/commands/test_kim_commands.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/commands/test_lattice_region.cpp b/unittest/commands/test_lattice_region.cpp index ae38f3a7f5..a4b76f02ef 100644 --- a/unittest/commands/test_lattice_region.cpp +++ b/unittest/commands/test_lattice_region.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/commands/test_reset_ids.cpp b/unittest/commands/test_reset_ids.cpp index 694fc9ac77..61da99b876 100644 --- a/unittest/commands/test_reset_ids.cpp +++ b/unittest/commands/test_reset_ids.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/commands/test_simple_commands.cpp b/unittest/commands/test_simple_commands.cpp index ac8317b3da..deb379ee41 100644 --- a/unittest/commands/test_simple_commands.cpp +++ b/unittest/commands/test_simple_commands.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/commands/test_variables.cpp b/unittest/commands/test_variables.cpp index 663a2a78a1..574fe42ad8 100644 --- a/unittest/commands/test_variables.cpp +++ b/unittest/commands/test_variables.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/cplusplus/test_lammps_class.cpp b/unittest/cplusplus/test_lammps_class.cpp index 04ad403db6..5288cfc2b6 100644 --- a/unittest/cplusplus/test_lammps_class.cpp +++ b/unittest/cplusplus/test_lammps_class.cpp @@ -362,7 +362,11 @@ TEST(LAMMPS_init, NoOpenMP) FILE *fp = fopen("in.lammps_class_noomp", "w"); fputs("\n", fp); fclose(fp); +#if defined(__WIN32) + _putenv("OMP_NUM_THREADS"); +#else unsetenv("OMP_NUM_THREADS"); +#endif const char *args[] = {"LAMMPS_init", "-in", "in.lammps_class_noomp", "-log", "none", "-nocite"}; char **argv = (char **)args; diff --git a/unittest/force-styles/CMakeLists.txt b/unittest/force-styles/CMakeLists.txt index 2c0977397a..86b0f4fdaf 100644 --- a/unittest/force-styles/CMakeLists.txt +++ b/unittest/force-styles/CMakeLists.txt @@ -26,7 +26,7 @@ set(TEST_INPUT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/tests) add_library(style_tests STATIC yaml_writer.cpp error_stats.cpp test_config_reader.cpp test_main.cpp) target_compile_definitions(style_tests PRIVATE -DTEST_INPUT_FOLDER=${TEST_INPUT_FOLDER}) target_include_directories(style_tests PRIVATE ${LAMMPS_SOURCE_DIR}) -target_link_libraries(style_tests PUBLIC GTest::GTest GTest::GMock Yaml::Yaml) +target_link_libraries(style_tests PUBLIC GTest::GTest GTest::GMock Yaml::Yaml lammps) if(BUILD_MPI) target_link_libraries(style_tests PUBLIC MPI::MPI_CXX) else() diff --git a/unittest/force-styles/error_stats.cpp b/unittest/force-styles/error_stats.cpp index 9b13bf0870..af8eba5a66 100644 --- a/unittest/force-styles/error_stats.cpp +++ b/unittest/force-styles/error_stats.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/error_stats.h b/unittest/force-styles/error_stats.h index b9c44e4027..14038e23f6 100644 --- a/unittest/force-styles/error_stats.h +++ b/unittest/force-styles/error_stats.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/test_angle_style.cpp b/unittest/force-styles/test_angle_style.cpp index f42594c7aa..8f858a3a04 100644 --- a/unittest/force-styles/test_angle_style.cpp +++ b/unittest/force-styles/test_angle_style.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/test_bond_style.cpp b/unittest/force-styles/test_bond_style.cpp index 229f7d72fd..2b5e11de20 100644 --- a/unittest/force-styles/test_bond_style.cpp +++ b/unittest/force-styles/test_bond_style.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/test_config.h b/unittest/force-styles/test_config.h index 0417b306cb..bf4f867f3b 100644 --- a/unittest/force-styles/test_config.h +++ b/unittest/force-styles/test_config.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/test_config_reader.cpp b/unittest/force-styles/test_config_reader.cpp index 977e04d435..41621ff3aa 100644 --- a/unittest/force-styles/test_config_reader.cpp +++ b/unittest/force-styles/test_config_reader.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/test_config_reader.h b/unittest/force-styles/test_config_reader.h index f82a2b7a15..bf69f149fe 100644 --- a/unittest/force-styles/test_config_reader.h +++ b/unittest/force-styles/test_config_reader.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/test_dihedral_style.cpp b/unittest/force-styles/test_dihedral_style.cpp index 2e7bb03dd6..718bcb5332 100644 --- a/unittest/force-styles/test_dihedral_style.cpp +++ b/unittest/force-styles/test_dihedral_style.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/test_fix_timestep.cpp b/unittest/force-styles/test_fix_timestep.cpp index 6ba3f7f6d7..645c41b2ae 100644 --- a/unittest/force-styles/test_fix_timestep.cpp +++ b/unittest/force-styles/test_fix_timestep.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/test_improper_style.cpp b/unittest/force-styles/test_improper_style.cpp index 070acf5ef3..52fc0f0b92 100644 --- a/unittest/force-styles/test_improper_style.cpp +++ b/unittest/force-styles/test_improper_style.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/test_main.cpp b/unittest/force-styles/test_main.cpp index e26eb6a8fb..c7a64682cf 100644 --- a/unittest/force-styles/test_main.cpp +++ b/unittest/force-styles/test_main.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/test_main.h b/unittest/force-styles/test_main.h index 0f30467f6b..f8971c64bf 100644 --- a/unittest/force-styles/test_main.h +++ b/unittest/force-styles/test_main.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/test_pair_style.cpp b/unittest/force-styles/test_pair_style.cpp index d40c7dc124..b8513237c5 100644 --- a/unittest/force-styles/test_pair_style.cpp +++ b/unittest/force-styles/test_pair_style.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/tests/manybody-pair-tersoff.yaml b/unittest/force-styles/tests/manybody-pair-tersoff.yaml index 8ebf41524e..5876ba1b5d 100644 --- a/unittest/force-styles/tests/manybody-pair-tersoff.yaml +++ b/unittest/force-styles/tests/manybody-pair-tersoff.yaml @@ -1,7 +1,7 @@ --- lammps_version: 10 Feb 2021 date_generated: Fri Feb 26 23:09:20 2021 -epsilon: 1e-11 +epsilon: 2e-11 prerequisites: ! | pair tersoff pre_commands: ! | diff --git a/unittest/force-styles/tests/mol-pair-buck.yaml b/unittest/force-styles/tests/mol-pair-buck.yaml index 6f4cd2474b..49445a9046 100644 --- a/unittest/force-styles/tests/mol-pair-buck.yaml +++ b/unittest/force-styles/tests/mol-pair-buck.yaml @@ -1,7 +1,7 @@ --- lammps_version: 10 Feb 2021 date_generated: Fri Feb 26 23:08:40 2021 -epsilon: 6e-14 +epsilon: 1.5e-13 prerequisites: ! | atom full pair buck diff --git a/unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml b/unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml index 5784f2e82b..7ed68a797e 100644 --- a/unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml +++ b/unittest/force-styles/tests/mol-pair-buck_coul_cut.yaml @@ -1,7 +1,7 @@ --- lammps_version: 10 Feb 2021 date_generated: Fri Feb 26 23:08:40 2021 -epsilon: 5e-14 +epsilon: 2e-13 prerequisites: ! | atom full pair buck/coul/cut diff --git a/unittest/force-styles/yaml_reader.h b/unittest/force-styles/yaml_reader.h index fc286838ca..c31ee4ee9d 100644 --- a/unittest/force-styles/yaml_reader.h +++ b/unittest/force-styles/yaml_reader.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/yaml_writer.cpp b/unittest/force-styles/yaml_writer.cpp index d299b7a879..efbb9b7654 100644 --- a/unittest/force-styles/yaml_writer.cpp +++ b/unittest/force-styles/yaml_writer.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/force-styles/yaml_writer.h b/unittest/force-styles/yaml_writer.h index 6cae7c2b24..31df8eb60d 100644 --- a/unittest/force-styles/yaml_writer.h +++ b/unittest/force-styles/yaml_writer.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/compressed_dump_test.h b/unittest/formats/compressed_dump_test.h index 6bc26e123d..a8293a9279 100644 --- a/unittest/formats/compressed_dump_test.h +++ b/unittest/formats/compressed_dump_test.h @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/compressed_dump_test_main.cpp b/unittest/formats/compressed_dump_test_main.cpp index e1334f1b9b..3c45ac45c7 100644 --- a/unittest/formats/compressed_dump_test_main.cpp +++ b/unittest/formats/compressed_dump_test_main.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_atom_styles.cpp b/unittest/formats/test_atom_styles.cpp index 980afc3182..d416074b81 100644 --- a/unittest/formats/test_atom_styles.cpp +++ b/unittest/formats/test_atom_styles.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_dump_atom.cpp b/unittest/formats/test_dump_atom.cpp index 669f4d38bd..b11dd4e800 100644 --- a/unittest/formats/test_dump_atom.cpp +++ b/unittest/formats/test_dump_atom.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_dump_atom_compressed.cpp b/unittest/formats/test_dump_atom_compressed.cpp index aeb747004e..86297ac84c 100644 --- a/unittest/formats/test_dump_atom_compressed.cpp +++ b/unittest/formats/test_dump_atom_compressed.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_dump_cfg.cpp b/unittest/formats/test_dump_cfg.cpp index 64930c3ac6..0acc8bc732 100644 --- a/unittest/formats/test_dump_cfg.cpp +++ b/unittest/formats/test_dump_cfg.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_dump_cfg_compressed.cpp b/unittest/formats/test_dump_cfg_compressed.cpp index 1a00f9520e..99da96c766 100644 --- a/unittest/formats/test_dump_cfg_compressed.cpp +++ b/unittest/formats/test_dump_cfg_compressed.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_dump_custom.cpp b/unittest/formats/test_dump_custom.cpp index f8a55bb2fb..772acaacb6 100644 --- a/unittest/formats/test_dump_custom.cpp +++ b/unittest/formats/test_dump_custom.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_dump_custom_compressed.cpp b/unittest/formats/test_dump_custom_compressed.cpp index cb45c1b837..dabca80a6e 100644 --- a/unittest/formats/test_dump_custom_compressed.cpp +++ b/unittest/formats/test_dump_custom_compressed.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_dump_local.cpp b/unittest/formats/test_dump_local.cpp index b122d71849..b18e3da054 100644 --- a/unittest/formats/test_dump_local.cpp +++ b/unittest/formats/test_dump_local.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_dump_local_compressed.cpp b/unittest/formats/test_dump_local_compressed.cpp index cd217354af..8636be347a 100644 --- a/unittest/formats/test_dump_local_compressed.cpp +++ b/unittest/formats/test_dump_local_compressed.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_dump_xyz_compressed.cpp b/unittest/formats/test_dump_xyz_compressed.cpp index d9aa8e370d..4cf31571ee 100644 --- a/unittest/formats/test_dump_xyz_compressed.cpp +++ b/unittest/formats/test_dump_xyz_compressed.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_eim_potential_file_reader.cpp b/unittest/formats/test_eim_potential_file_reader.cpp index 26f2795a85..762252c312 100644 --- a/unittest/formats/test_eim_potential_file_reader.cpp +++ b/unittest/formats/test_eim_potential_file_reader.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_file_operations.cpp b/unittest/formats/test_file_operations.cpp index 68311964c4..eb30b69cfd 100644 --- a/unittest/formats/test_file_operations.cpp +++ b/unittest/formats/test_file_operations.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_image_flags.cpp b/unittest/formats/test_image_flags.cpp index 63d85789e6..59fc6f0f6a 100644 --- a/unittest/formats/test_image_flags.cpp +++ b/unittest/formats/test_image_flags.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_molecule_file.cpp b/unittest/formats/test_molecule_file.cpp index 5712e31a30..90c52681ce 100644 --- a/unittest/formats/test_molecule_file.cpp +++ b/unittest/formats/test_molecule_file.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_pair_unit_convert.cpp b/unittest/formats/test_pair_unit_convert.cpp index bdd66f67a6..597471727e 100644 --- a/unittest/formats/test_pair_unit_convert.cpp +++ b/unittest/formats/test_pair_unit_convert.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_potential_file_reader.cpp b/unittest/formats/test_potential_file_reader.cpp index c25d1d49fe..646ce5dd0e 100644 --- a/unittest/formats/test_potential_file_reader.cpp +++ b/unittest/formats/test_potential_file_reader.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/formats/test_text_file_reader.cpp b/unittest/formats/test_text_file_reader.cpp index 3294881352..7e5f3921f5 100644 --- a/unittest/formats/test_text_file_reader.cpp +++ b/unittest/formats/test_text_file_reader.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/fortran/CMakeLists.txt b/unittest/fortran/CMakeLists.txt index fe63802e8b..9bd6c8f419 100644 --- a/unittest/fortran/CMakeLists.txt +++ b/unittest/fortran/CMakeLists.txt @@ -7,6 +7,7 @@ endif() include(CheckLanguage) check_language(Fortran) if(CMAKE_Fortran_COMPILER) + enable_language(C) enable_language(Fortran) get_filename_component(LAMMPS_FORTRAN_MODULE ${LAMMPS_SOURCE_DIR}/../fortran/lammps.f90 ABSOLUTE) if(BUILD_MPI) diff --git a/unittest/python/test_python_package.cpp b/unittest/python/test_python_package.cpp index c240d23875..735d49ac51 100644 --- a/unittest/python/test_python_package.cpp +++ b/unittest/python/test_python_package.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/testing/core.h b/unittest/testing/core.h index 843d135645..e332d57d8f 100644 --- a/unittest/testing/core.h +++ b/unittest/testing/core.h @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/testing/mpitesting.h b/unittest/testing/mpitesting.h index d73cf11d44..b7c9479696 100644 --- a/unittest/testing/mpitesting.h +++ b/unittest/testing/mpitesting.h @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/testing/systems/melt.h b/unittest/testing/systems/melt.h index 5ac92f562b..b61fec9927 100644 --- a/unittest/testing/systems/melt.h +++ b/unittest/testing/systems/melt.h @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/testing/test_mpi_main.h b/unittest/testing/test_mpi_main.h index 1e89ba3c8c..9e8ac4504a 100644 --- a/unittest/testing/test_mpi_main.h +++ b/unittest/testing/test_mpi_main.h @@ -1,6 +1,6 @@ /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/testing/utils.h b/unittest/testing/utils.h index 730c6fdb44..d4748e4ae8 100644 --- a/unittest/testing/utils.h +++ b/unittest/testing/utils.h @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories + https://www.lammps.org/ Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/utils/test_argutils.cpp b/unittest/utils/test_argutils.cpp index d836fc00c4..7d4653cc13 100644 --- a/unittest/utils/test_argutils.cpp +++ b/unittest/utils/test_argutils.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/utils/test_fmtlib.cpp b/unittest/utils/test_fmtlib.cpp index cf6c059df5..fb4e58e6da 100644 --- a/unittest/utils/test_fmtlib.cpp +++ b/unittest/utils/test_fmtlib.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/utils/test_mempool.cpp b/unittest/utils/test_mempool.cpp index 5ee809c422..5c545023b0 100644 --- a/unittest/utils/test_mempool.cpp +++ b/unittest/utils/test_mempool.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/utils/test_tokenizer.cpp b/unittest/utils/test_tokenizer.cpp index 275a86a05f..c62a947d5c 100644 --- a/unittest/utils/test_tokenizer.cpp +++ b/unittest/utils/test_tokenizer.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract diff --git a/unittest/utils/test_utils.cpp b/unittest/utils/test_utils.cpp index 0c6e38e342..4ce4733a6a 100644 --- a/unittest/utils/test_utils.cpp +++ b/unittest/utils/test_utils.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - https://lammps.sandia.gov/, Sandia National Laboratories + https://www.lammps.org/, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract