Merge branch 'master' into fix-ttm-grid
This commit is contained in:
@ -9,14 +9,16 @@ if(BUILD_TOOLS)
|
||||
check_language(Fortran)
|
||||
if(CMAKE_Fortran_COMPILER)
|
||||
enable_language(Fortran)
|
||||
add_executable(chain.x ${LAMMPS_TOOLS_DIR}/chain.f)
|
||||
add_executable(chain.x ${LAMMPS_TOOLS_DIR}/chain.f90)
|
||||
target_link_libraries(chain.x PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
|
||||
install(TARGETS chain.x DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
add_executable(micelle2d.x ${LAMMPS_TOOLS_DIR}/micelle2d.f90)
|
||||
target_link_libraries(micelle2d.x PRIVATE ${CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES})
|
||||
install(TARGETS chain.x micelle2d.x DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
else()
|
||||
message(WARNING "No suitable Fortran compiler found, skipping build of 'chain.x'")
|
||||
message(WARNING "No suitable Fortran compiler found, skipping build of 'chain.x' and 'micelle2d.x'")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "CMake build doesn't support fortran, skipping build of 'chain.x'")
|
||||
message(WARNING "CMake build doesn't support Fortran, skipping build of 'chain.x' and 'micelle2d.x'")
|
||||
endif()
|
||||
|
||||
enable_language(C)
|
||||
|
||||
@ -10,9 +10,9 @@ set(CMAKE_Fortran_COMPILER ${CLANG_FORTRAN} 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 -std=f95" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG -std=f95" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f95" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -Wextra -g -std=f2003" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-Wall -Wextra -g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" 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)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# preset that will restore gcc/g++ with support for MPI and OpenMP (on Linux boxes)
|
||||
# preset that will explicitly request gcc/g++ compilers with support for MPI and OpenMP
|
||||
|
||||
set(CMAKE_CXX_COMPILER "g++" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_COMPILER "gcc" CACHE STRING "" FORCE)
|
||||
@ -15,9 +15,9 @@ set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(MPI_Fortran "gfortran" CACHE STRING "" FORCE)
|
||||
set(MPI_Fortran_COMPILER "mpifort" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -g" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_DEBUG "-Wall -g -std=f2003" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-g -O2 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -DNDEBUG -std=f2003" CACHE STRING "" FORCE)
|
||||
unset(HAVE_OMP_H_INCLUDE CACHE)
|
||||
|
||||
set(OpenMP_C "gcc" CACHE STRING "" FORCE)
|
||||
|
||||
@ -22,4 +22,5 @@ page.
|
||||
Build_extras
|
||||
Build_manual
|
||||
Build_windows
|
||||
Build_diskspace
|
||||
Build_development
|
||||
|
||||
45
doc/src/Build_diskspace.rst
Normal file
45
doc/src/Build_diskspace.rst
Normal file
@ -0,0 +1,45 @@
|
||||
Notes for saving disk space when building LAMMPS from source
|
||||
------------------------------------------------------------
|
||||
|
||||
LAMMPS is a large software project with a large number of source files,
|
||||
extensive documentation, and a large collection of example files.
|
||||
When downloading LAMMPS by cloning the
|
||||
`git repository from GitHub <https://github.com/lammps/lammps>`_ this
|
||||
will by default also download the entire commit history since September 2006.
|
||||
Compiling LAMMPS will add the storage requirements of the compiled object
|
||||
files and libraries to the tally.
|
||||
|
||||
In a user account on an HPC cluster with filesystem quotas or in other
|
||||
environments with restricted disk space capacity it may be needed to
|
||||
reduce the storage requirements. Here are some suggestions:
|
||||
|
||||
- Create a so-called shallow repository by cloning only the last commit
|
||||
instead of the full project history by using ``git clone git@github.com:lammps/lammps --depth=1 --branch=master``.
|
||||
This reduces the downloaded size to about half. With ``--depth=1`` it is not possible to check out different
|
||||
versions/branches of LAMMPS, using ``--depth=1000`` will make multiple recent versions available at little
|
||||
extra storage needs (the entire git history had nearly 30,000 commits in fall 2021).
|
||||
|
||||
- Download a tar archive from either the `download section on the LAMMPS homepage <https://www.lammps.org/download.html>`_
|
||||
or from the `LAMMPS releases page on GitHub <https://github.com/lammps/lammps/releases>`_ these will not
|
||||
contain the git history at all.
|
||||
|
||||
- Build LAMMPS without the debug flag (remove ``-g`` from the machine makefile or use ``-DCMAKE_BUILD_TYPE=Release``)
|
||||
or use the ``strip`` command on the LAMMPS executable when no more debugging would be needed. The strip command
|
||||
may also be applied to the LAMMPS shared library. The static library may be deleted entirely.
|
||||
|
||||
- Delete compiled object files and libraries after copying the LAMMPS executable to a permanent location.
|
||||
When using the traditional build process, one may use ``make clean-<machine>`` or ``make clean-all``
|
||||
to delete object files in the src folder. For CMake based builds, one may use ``make clean`` or just
|
||||
delete the entire build folder.
|
||||
|
||||
- The folders containing the documentation tree (doc), the examples (examples) are not needed to build and
|
||||
run LAMMPS and can be safely deleted. Some files in the potentials folder are large and may be deleted,
|
||||
if not needed. The largest of those files (occupying about 120 MBytes combined) will only be downloaded on
|
||||
demand, when the corresponding package is installed.
|
||||
|
||||
- When using the CMake build procedure, the compilation can be done on a (local) scratch storage that will not
|
||||
count toward the quota. A local scratch file system may offer the additional benefit of speeding up creating
|
||||
object files and linking with libraries compared to a networked file system. Also with CMake (and unlike with
|
||||
the traditional make) it is possible to compile LAMMPS executables with different settings and packages included
|
||||
from the same source tree since all the configuration information is stored in the build folder. So it is
|
||||
not necessary to have multiple copies of LAMMPS.
|
||||
@ -29,7 +29,7 @@ The following folks deserve special recognition. Many of the packages
|
||||
they have written are unique for an MD code and LAMMPS would not be as
|
||||
general-purpose as it is without their expertise and efforts.
|
||||
|
||||
* Metin Aktulga (MSU), REAXFF package for C version of ReaxFF
|
||||
* Metin Aktulga (MSU), REAXFF package for C/C++ version of ReaxFF
|
||||
* Mike Brown (Intel), GPU and INTEL packages
|
||||
* Colin Denniston (U Western Ontario), LATBOLTZ package
|
||||
* Georg Ganzenmuller (EMI), MACHDYN and SPH packages
|
||||
@ -37,9 +37,10 @@ general-purpose as it is without their expertise and efforts.
|
||||
* Reese Jones (Sandia) and colleagues, ATC package for atom/continuum coupling
|
||||
* Christoph Kloss (DCS Computing), LIGGGHTS code for granular materials, built on top of LAMMPS
|
||||
* Rudra Mukherjee (JPL), POEMS package for articulated rigid body motion
|
||||
* Trung Ngyuen (Northwestern U), GPU and RIGID and BODY packages
|
||||
* Trung Ngyuen (Northwestern U), GPU, RIGID, BODY, and DIELECTRIC packages
|
||||
* Mike Parks (Sandia), PERI package for Peridynamics
|
||||
* Roy Pollock (LLNL), Ewald and PPPM solvers
|
||||
* Julien Tranchida (Sandia), SPIN package
|
||||
* Christian Trott (Sandia), CUDA and KOKKOS packages
|
||||
* Ilya Valuev (JIHT), AWPMD package for wave packet MD
|
||||
* Greg Wagner (Northwestern U), MEAM package for MEAM potential
|
||||
|
||||
@ -27,19 +27,19 @@ General features
|
||||
* distributed memory message-passing parallelism (MPI)
|
||||
* shared memory multi-threading parallelism (OpenMP)
|
||||
* spatial decomposition of simulation domain for MPI parallelism
|
||||
* particle decomposition inside of spatial decomposition for OpenMP parallelism
|
||||
* particle decomposition inside of spatial decomposition for OpenMP and GPU parallelism
|
||||
* GPLv2 licensed open-source distribution
|
||||
* highly portable C++-11
|
||||
* modular code with most functionality in optional packages
|
||||
* only depends on MPI library for basic parallel functionality
|
||||
* only depends on MPI library for basic parallel functionality, MPI stub for serial compilation
|
||||
* other libraries are optional and only required for specific packages
|
||||
* GPU (CUDA and OpenCL), Intel Xeon Phi, and OpenMP support for many code features
|
||||
* GPU (CUDA, OpenCL, HIP, SYCL), Intel Xeon Phi, and OpenMP support for many code features
|
||||
* easy to extend with new features and functionality
|
||||
* runs from an input script
|
||||
* syntax for defining and using variables and formulas
|
||||
* syntax for looping over runs and breaking out of loops
|
||||
* run one or multiple simulations simultaneously (in parallel) from one script
|
||||
* build as library, invoke LAMMPS through library interface or provided Python wrapper
|
||||
* build as library, invoke LAMMPS through library interface or provided Python wrapper or SWIG based wrappers
|
||||
* couple with other codes: LAMMPS calls other code, other code calls LAMMPS, umbrella code calls both
|
||||
|
||||
.. _particle:
|
||||
@ -57,9 +57,11 @@ Particle and model types
|
||||
* granular materials
|
||||
* coarse-grained mesoscale models
|
||||
* finite-size spherical and ellipsoidal particles
|
||||
* finite-size line segment (2d) and triangle (3d) particles
|
||||
* finite-size line segment (2d) and triangle (3d) particles
|
||||
* finite-size rounded polygons (2d) and polyhedra (3d) particles
|
||||
* point dipole particles
|
||||
* rigid collections of particles
|
||||
* particles with magnetic spin
|
||||
* rigid collections of n particles
|
||||
* hybrid combinations of these
|
||||
|
||||
.. _ff:
|
||||
@ -74,24 +76,28 @@ commands)
|
||||
|
||||
* pairwise potentials: Lennard-Jones, Buckingham, Morse, Born-Mayer-Huggins, Yukawa, soft, class 2 (COMPASS), hydrogen bond, tabulated
|
||||
* charged pairwise potentials: Coulombic, point-dipole
|
||||
* many-body potentials: EAM, Finnis/Sinclair EAM, modified EAM (MEAM), embedded ion method (EIM), EDIP, ADP, Stillinger-Weber, Tersoff, REBO, AIREBO, ReaxFF, COMB, SNAP, Streitz-Mintmire, 3-body polymorphic
|
||||
* long-range interactions for charge, point-dipoles, and LJ dispersion: Ewald, Wolf, PPPM (similar to particle-mesh Ewald)
|
||||
* many-body potentials: EAM, Finnis/Sinclair EAM, modified EAM (MEAM), embedded ion method (EIM), EDIP, ADP, Stillinger-Weber, Tersoff, REBO, AIREBO, ReaxFF, COMB, Streitz-Mintmire, 3-body polymorphic, BOP, Vashishta
|
||||
* machine learning potentials: SNAP, GAP, ACE, N2P2, RANN, AGNI
|
||||
* long-range interactions for charge, point-dipoles, and LJ dispersion: Ewald, Wolf, PPPM (similar to particle-mesh Ewald), MSM
|
||||
* polarization models: :doc:`QEq <fix_qeq>`, :doc:`core/shell model <Howto_coreshell>`, :doc:`Drude dipole model <Howto_drude>`
|
||||
* charge equilibration (QEq via dynamic, point, shielded, Slater methods)
|
||||
* coarse-grained potentials: DPD, GayBerne, REsquared, colloidal, DLVO
|
||||
* mesoscopic potentials: granular, Peridynamics, SPH
|
||||
* mesoscopic potentials: granular, Peridynamics, SPH, mesoscopic tubular potential (MESONT)
|
||||
* semi-empirical potentials: multi-ion generalized pseudopotential theory (MGPT), second moment tight binding + QEq (SMTB-Q), density functional tight-binding (LATTE)
|
||||
* electron force field (eFF, AWPMD)
|
||||
* bond potentials: harmonic, FENE, Morse, nonlinear, class 2, quartic (breakable)
|
||||
* angle potentials: harmonic, CHARMM, cosine, cosine/squared, cosine/periodic, class 2 (COMPASS)
|
||||
* dihedral potentials: harmonic, CHARMM, multi-harmonic, helix, class 2 (COMPASS), OPLS
|
||||
* improper potentials: harmonic, cvff, umbrella, class 2 (COMPASS)
|
||||
* bond potentials: harmonic, FENE, Morse, nonlinear, class 2, quartic (breakable), tabulated
|
||||
* angle potentials: harmonic, CHARMM, cosine, cosine/squared, cosine/periodic, class 2 (COMPASS), tabulated
|
||||
* dihedral potentials: harmonic, CHARMM, multi-harmonic, helix, class 2 (COMPASS), OPLS, tabulated
|
||||
* improper potentials: harmonic, cvff, umbrella, class 2 (COMPASS), tabulated
|
||||
* polymer potentials: all-atom, united-atom, bead-spring, breakable
|
||||
* water potentials: TIP3P, TIP4P, SPC
|
||||
* water potentials: TIP3P, TIP4P, SPC, SPC/E and variants
|
||||
* interlayer potentials for graphene and analogues
|
||||
* metal-organic framework potentials (QuickFF, MO-FF)
|
||||
* implicit solvent potentials: hydrodynamic lubrication, Debye
|
||||
* force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
|
||||
* force-field compatibility with common CHARMM, AMBER, DREIDING, OPLS, GROMACS, COMPASS options
|
||||
* access to the `OpenKIM Repository <http://openkim.org>`_ of potentials via :doc:`kim command <kim_commands>`
|
||||
* hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation
|
||||
* overlaid potentials: superposition of multiple pair potentials
|
||||
* hybrid potentials: multiple pair, bond, angle, dihedral, improper potentials can be used in one simulation
|
||||
* overlaid potentials: superposition of multiple pair potentials (including many-body) with optional scale factor
|
||||
|
||||
.. _create:
|
||||
|
||||
@ -124,9 +130,10 @@ Ensembles, constraints, and boundary conditions
|
||||
* harmonic (umbrella) constraint forces
|
||||
* rigid body constraints
|
||||
* SHAKE bond and angle constraints
|
||||
* Monte Carlo bond breaking, formation, swapping
|
||||
* motion constraints to manifold surfaces
|
||||
* Monte Carlo bond breaking, formation, swapping, template based reaction modeling
|
||||
* atom/molecule insertion and deletion
|
||||
* walls of various kinds
|
||||
* walls of various kinds, static and moving
|
||||
* non-equilibrium molecular dynamics (NEMD)
|
||||
* variety of additional boundary conditions and constraints
|
||||
|
||||
@ -150,6 +157,7 @@ Diagnostics
|
||||
^^^^^^^^^^^
|
||||
|
||||
* see various flavors of the :doc:`fix <fix>` and :doc:`compute <compute>` commands
|
||||
* introspection command for system, simulation, and compile time settings and configurations
|
||||
|
||||
.. _output:
|
||||
|
||||
@ -164,8 +172,9 @@ Output
|
||||
* parallel I/O of dump and restart files
|
||||
* per-atom quantities (energy, stress, centro-symmetry parameter, CNA, etc)
|
||||
* user-defined system-wide (log file) or per-atom (dump file) calculations
|
||||
* spatial and time averaging of per-atom quantities
|
||||
* time averaging of system-wide quantities
|
||||
* custom partitioning (chunks) for binning, and static or dynamic grouping of atoms for analysis
|
||||
* spatial, time, and per-chunk averaging of per-atom quantities
|
||||
* time averaging and histogramming of system-wide quantities
|
||||
* atom snapshots in native, XYZ, XTC, DCD, CFG formats
|
||||
|
||||
.. _replica1:
|
||||
@ -178,7 +187,7 @@ Multi-replica models
|
||||
* :doc:`parallel replica dynamics <prd>`
|
||||
* :doc:`temperature accelerated dynamics <tad>`
|
||||
* :doc:`parallel tempering <temper>`
|
||||
* :doc:`path-integral MD <fix_pimd>`
|
||||
* path-integral MD: `first variant <fix_pimd>`, `second variant <fix_ipi>`
|
||||
* multi-walker collective variables with :doc:`Colvars <fix_colvars>` and :doc:`Plumed <fix_plumed>`
|
||||
|
||||
.. _prepost:
|
||||
@ -210,11 +219,12 @@ page for details.
|
||||
These are LAMMPS capabilities which you may not think of as typical
|
||||
classical MD options:
|
||||
|
||||
* :doc:`static <balance>` and :doc:`dynamic load-balancing <fix_balance>`
|
||||
* :doc:`static <balance>` and :doc:`dynamic load-balancing <fix_balance>`, optional with recursive bisectioning decomposition
|
||||
* :doc:`generalized aspherical particles <Howto_body>`
|
||||
* :doc:`stochastic rotation dynamics (SRD) <fix_srd>`
|
||||
* :doc:`real-time visualization and interactive MD <fix_imd>`
|
||||
* :doc:`real-time visualization and interactive MD <fix_imd>`, :doc:`built-in renderer for images and movies <dump_image>`
|
||||
* calculate :doc:`virtual diffraction patterns <compute_xrd>`
|
||||
* calculate :doc:`finite temperature phonon dispersion <fix_phonon>` and the :doc:`dynamical matrix of minimized structures <dynamical_matrix>`
|
||||
* :doc:`atom-to-continuum coupling <fix_atc>` with finite elements
|
||||
* coupled rigid body integration via the :doc:`POEMS <fix_poems>` library
|
||||
* :doc:`QM/MM coupling <fix_qmmm>`
|
||||
|
||||
@ -1,40 +1,61 @@
|
||||
LAMMPS open-source license
|
||||
--------------------------
|
||||
|
||||
LAMMPS is a freely-available open-source code, distributed under the
|
||||
terms of the `GNU Public License Version 2 <gpl_>`_, which means you can
|
||||
use or modify the code however you wish for your own purposes, but have
|
||||
to adhere to certain rules when redistributing it or software derived
|
||||
GPL version of LAMMPS
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
LAMMPS is an open-source code, available free-of-charge, and distributed
|
||||
under the terms of the `GNU Public License Version 2 <gpl_>`_ (GPLv2),
|
||||
which means you can use or modify the code however you wish for your own
|
||||
purposes, but have to adhere to certain rules when redistributing it -
|
||||
specifically in binary form - or are distributing software derived
|
||||
from it or that includes parts of it.
|
||||
|
||||
LAMMPS comes with no warranty of any kind. As each source file states
|
||||
in its header, it is a copyrighted code that is distributed free-of-
|
||||
charge, under the terms of the `GNU Public License Version 2 <gpl_>`_
|
||||
(GPLv2). This is often referred to as open-source distribution - see
|
||||
`www.gnu.org <gnuorg_>`_ or `www.opensource.org <opensource_>`_. The
|
||||
legal text of the GPL is in the LICENSE file included in the LAMMPS
|
||||
distribution.
|
||||
LAMMPS comes with no warranty of any kind.
|
||||
|
||||
As each source file states in its header, it is a copyrighted code, and
|
||||
thus not in the public domain. For more information about open-source
|
||||
software and open-source distribution, see `www.gnu.org <gnuorg_>`_
|
||||
or `www.opensource.org <opensource_>`_. The legal text of the GPL as it
|
||||
applies to LAMMPS is in the LICENSE file included in the LAMMPS distribution.
|
||||
|
||||
.. _gpl: https://github.com/lammps/lammps/blob/master/LICENSE
|
||||
|
||||
.. _lgpl: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
||||
|
||||
.. _gnuorg: http://www.gnu.org
|
||||
|
||||
.. _opensource: http://www.opensource.org
|
||||
|
||||
Here is a summary of what the GPL means for LAMMPS users:
|
||||
Here is a more specific summary of what the GPL means for LAMMPS users:
|
||||
|
||||
(1) Anyone is free to use, modify, or extend LAMMPS in any way they
|
||||
(1) Anyone is free to use, copy, modify, or extend LAMMPS in any way they
|
||||
choose, including for commercial purposes.
|
||||
|
||||
(2) If you **distribute** a modified version of LAMMPS, it must remain
|
||||
open-source, meaning you distribute **all** of it under the terms of
|
||||
the GPL. You should clearly annotate such a code as a derivative version
|
||||
of LAMMPS.
|
||||
open-source, meaning you are required to distribute **all** of it under
|
||||
the terms of the GPL. You should clearly annotate such a modified code
|
||||
as a derivative version of LAMMPS.
|
||||
|
||||
(3) If you release any code that includes or uses LAMMPS source code,
|
||||
then it must also be open-sourced, meaning you distribute it under
|
||||
the terms of the GPL.
|
||||
the terms of the GPL. You may write code that interfaces LAMMPS to
|
||||
a differently licensed library. In that case the code that provides
|
||||
the interface must be licensed GPL, but not necessarily that library
|
||||
unless you are distributing binaries that require the library to run.
|
||||
|
||||
(4) If you give LAMMPS files to someone else, the GPL LICENSE file and
|
||||
source file headers (including the copyright and GPL notices) should
|
||||
remain part of the code.
|
||||
|
||||
|
||||
LGPL version of LAMMPS
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
We occasionally make stable LAMMPS releases available under the `GNU
|
||||
Lesser Public License v2.1 <lgpl_>`_. This is on request only and with
|
||||
non-LGPL compliant files removed. This allows uses linking non-GPL
|
||||
compatible software with the (otherwise unmodified) LAMMPS library
|
||||
or loading it dynamically at runtime. Any **modifications** to
|
||||
the LAMMPS code however, even with the LGPL licensed version, must still
|
||||
be made available under the same open source terms as LAMMPS itself.
|
||||
|
||||
@ -10,24 +10,26 @@ conditions. It can model 2d or 3d systems with only a few particles
|
||||
up to millions or billions.
|
||||
|
||||
LAMMPS can be built and run on a laptop or desktop machine, but is
|
||||
designed for parallel computers. It will run on any parallel machine
|
||||
that supports the `MPI <mpi_>`_ message-passing library. This includes
|
||||
shared-memory boxes and distributed-memory clusters and
|
||||
supercomputers.
|
||||
designed for parallel computers. It will run in serial and on any
|
||||
parallel machine that supports the `MPI <mpi_>`_ message-passing
|
||||
library. This includes shared-memory boxes and distributed-memory
|
||||
clusters and supercomputers. Parts of LAMMPS also support
|
||||
`OpenMP multi-threading <omp_>`_, vectorization and GPU acceleration.
|
||||
|
||||
.. _mpi: https://en.wikipedia.org/wiki/Message_Passing_Interface
|
||||
.. _lws: https://www.lammps.org
|
||||
.. _omp: https://www.openmp.org
|
||||
|
||||
LAMMPS is written in C++ and requires a compiler that is at least
|
||||
compatible with the C++-11 standard.
|
||||
Earlier versions were written in F77 and F90. See the `History page
|
||||
compatible with the C++-11 standard. Earlier versions were written in
|
||||
F77, F90, and C++-98. See the `History page
|
||||
<https://www.lammps.org/history.html>`_ of the website for details. All
|
||||
versions can be downloaded from the `LAMMPS website <lws_>`_.
|
||||
versions can be downloaded as source code from the `LAMMPS website
|
||||
<lws_>`_.
|
||||
|
||||
LAMMPS is designed to be easy to modify or extend with new
|
||||
capabilities, such as new force fields, atom types, boundary
|
||||
conditions, or diagnostics. See the :doc:`Modify <Modify>` page for
|
||||
more details.
|
||||
LAMMPS is designed to be easy to modify or extend with new capabilities,
|
||||
such as new force fields, atom types, boundary conditions, or
|
||||
diagnostics. See the :doc:`Modify <Modify>` page for more details.
|
||||
|
||||
In the most general sense, LAMMPS integrates Newton's equations of
|
||||
motion for a collection of interacting particles. A single particle
|
||||
@ -47,4 +49,5 @@ MPI parallelization to partition the simulation domain into small
|
||||
sub-domains of equal computational cost, one of which is assigned to
|
||||
each processor. Processors communicate and store "ghost" atom
|
||||
information for atoms that border their sub-domain. Multi-threading
|
||||
parallelization with with particle-decomposition can be used in addition.
|
||||
parallelization and GPU acceleration with with particle-decomposition
|
||||
can be used in addition.
|
||||
|
||||
@ -2,12 +2,21 @@ What does a LAMMPS version mean
|
||||
-------------------------------
|
||||
|
||||
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 <https://www.lammps.org/bug.html>`_. Every few
|
||||
months, the latest patch release is subjected to more thorough testing
|
||||
and labeled as a *stable* version.
|
||||
2014. LAMMPS is updated continuously and we aim to keep it working
|
||||
correctly and reliably at all times. You can follow its development
|
||||
in a public `git repository on GitHub <https://github.com/lammps/lammps>`_.
|
||||
|
||||
Whenever we fix a bug or update or add a feature, it will be merged into
|
||||
the `master` branch of the git repository. When a sufficient number of
|
||||
changes have accumulated *and* the software passes a set of automated
|
||||
tests, we release it in the next *patch* release, which are made every
|
||||
few weeks. Info on patch releases are on `this website page
|
||||
<https://www.lammps.org/bug.html>`_.
|
||||
|
||||
Once or twice a year, only bug fixes and small, non-intrusive changes are
|
||||
included for a period of time, and the code is subjected to more detailed
|
||||
and thorough testing than the default automated testing. The latest
|
||||
patch release after such a period is then labeled as a *stable* version.
|
||||
|
||||
Each version of LAMMPS contains all the features and bug-fixes up to
|
||||
and including its version date.
|
||||
|
||||
@ -172,7 +172,7 @@ Chris Lorenz (chris.lorenz at kcl.ac.uk), King's College London.
|
||||
chain tool
|
||||
----------------------
|
||||
|
||||
The file chain.f creates a LAMMPS data file containing bead-spring
|
||||
The file chain.f90 creates a LAMMPS data file containing bead-spring
|
||||
polymer chains and/or monomer solvent atoms. It uses a text file
|
||||
containing chain definition parameters as an input. The created
|
||||
chains and solvent atoms can strongly overlap, so LAMMPS needs to run
|
||||
|
||||
@ -19,7 +19,7 @@ Syntax
|
||||
|
||||
bondmax = length of longest bond in the system (in length units)
|
||||
tlimit = elapsed CPU time (in seconds)
|
||||
diskfree = free disk space (in megabytes)
|
||||
diskfree = free disk space (in MBytes)
|
||||
v_name = name of :doc:`equal-style variable <variable>`
|
||||
|
||||
* operator = "<" or "<=" or ">" or ">=" or "==" or "!=" or "\|\^"
|
||||
@ -81,7 +81,7 @@ the timer frequently across a large number of processors may be
|
||||
non-negligible.
|
||||
|
||||
The *diskfree* attribute will check for available disk space (in
|
||||
megabytes) on supported operating systems. By default it will
|
||||
MBytes) on supported operating systems. By default it will
|
||||
check the file system of the current working directory. This
|
||||
can be changed with the optional *path* keyword, which will take
|
||||
the path to a file or folder on the file system to be checked
|
||||
|
||||
@ -128,7 +128,7 @@ spectrum while consumes more memory. With fixed *f_max* and
|
||||
:math:`\gamma`, *N_f* should be big enough to converge the classical
|
||||
temperature :math:`T^{cl}` as a function of target quantum bath
|
||||
temperature. Memory usage per processor could be from 10 to 100
|
||||
Mbytes.
|
||||
MBytes.
|
||||
|
||||
.. note::
|
||||
|
||||
|
||||
@ -229,6 +229,11 @@ but you would need to create your own AIREBO or AIREBO-M potential file
|
||||
with coefficients listed in the appropriate units, if your simulation
|
||||
does not use "metal" units.
|
||||
|
||||
The pair styles provided here **only** support potential files parameterized
|
||||
for the elements carbon and hydrogen (designated with "C" and "H" in the
|
||||
*pair_coeff* command. Using potential files for other elements will trigger
|
||||
an error.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
|
||||
@ -135,7 +135,7 @@ with #) anywhere. Each non-blank non-comment line must contain one
|
||||
keyword/value pair. The required keywords are *rcutfac* and
|
||||
*twojmax*\ . Optional keywords are *rfac0*, *rmin0*,
|
||||
*switchflag*, *bzeroflag*, *quadraticflag*, *chemflag*,
|
||||
*bnormflag*, *wselfallflag*, and *chunksize*\ .
|
||||
*bnormflag*, *wselfallflag*, *chunksize*, and *parallelthresh*\ .
|
||||
|
||||
The default values for these keywords are
|
||||
|
||||
@ -147,7 +147,8 @@ The default values for these keywords are
|
||||
* *chemflag* = 0
|
||||
* *bnormflag* = 0
|
||||
* *wselfallflag* = 0
|
||||
* *chunksize* = 4096
|
||||
* *chunksize* = 32768
|
||||
* *parallelthresh* = 8192
|
||||
|
||||
If *quadraticflag* is set to 1, then the SNAP energy expression includes
|
||||
additional quadratic terms that have been shown to increase the overall
|
||||
@ -188,14 +189,24 @@ corresponding *K*-vector of linear coefficients for element
|
||||
which must equal the number of unique elements appearing in the LAMMPS
|
||||
pair_coeff command, to avoid ambiguity in the number of coefficients.
|
||||
|
||||
The keyword *chunksize* is only applicable when using the
|
||||
pair style *snap* with the KOKKOS package and is ignored otherwise.
|
||||
This keyword controls
|
||||
The keywords *chunksize* and *parallelthresh* are only applicable when
|
||||
using the pair style *snap* with the KOKKOS package on GPUs and are
|
||||
ignored otherwise.
|
||||
The *chunksize* keyword controls
|
||||
the number of atoms in each pass used to compute the bispectrum
|
||||
components and is used to avoid running out of memory. For example
|
||||
if there are 8192 atoms in the simulation and the *chunksize*
|
||||
is set to 4096, the bispectrum calculation will be broken up
|
||||
into two passes.
|
||||
into two passes (running on a single GPU).
|
||||
The *parallelthresh* keyword controls
|
||||
a crossover threshold for performing extra parallelism. For
|
||||
small systems, exposing additional parallism can be beneficial when
|
||||
there is not enough work to fully saturate the GPU threads otherwise.
|
||||
However, the extra parallelism also leads to more divergence
|
||||
and can hurt performance when the system is already large enough to
|
||||
saturate the GPU threads. Extra parallelism will be performed if the
|
||||
*chunksize* (or total number of atoms per GPU) is smaller than
|
||||
*parallelthresh*.
|
||||
|
||||
Detailed definitions for all the other keywords
|
||||
are given on the :doc:`compute sna/atom <compute_sna_atom>` doc page.
|
||||
|
||||
@ -1174,6 +1174,7 @@ googletest
|
||||
Gordan
|
||||
Goudeau
|
||||
GPa
|
||||
GPL
|
||||
gpu
|
||||
gpuID
|
||||
gpus
|
||||
@ -1689,6 +1690,7 @@ Lett
|
||||
Leuven
|
||||
Leven
|
||||
Lewy
|
||||
LGPL
|
||||
lgvdw
|
||||
Liang
|
||||
libatc
|
||||
@ -1889,7 +1891,6 @@ maxX
|
||||
Mayergoyz
|
||||
Mayoral
|
||||
mbt
|
||||
Mbytes
|
||||
MBytes
|
||||
mc
|
||||
McLachlan
|
||||
|
||||
@ -139,7 +139,6 @@ class UCL_Timer {
|
||||
cl_event start_event, stop_event;
|
||||
cl_command_queue _cq;
|
||||
double _total_time;
|
||||
double t_factor;
|
||||
bool _initialized;
|
||||
bool has_measured_time;
|
||||
};
|
||||
|
||||
@ -39,7 +39,7 @@ class UCL_D_Vec : public UCL_BaseMat {
|
||||
};
|
||||
typedef numtyp data_type;
|
||||
|
||||
UCL_D_Vec() : _cols(0), _row_bytes(0) {}
|
||||
UCL_D_Vec() : _row_bytes(0), _cols(0) {}
|
||||
~UCL_D_Vec() { _device_free(*this); }
|
||||
|
||||
/// Construct with n columns
|
||||
|
||||
@ -20,9 +20,13 @@
|
||||
#define tagint int
|
||||
#endif
|
||||
#ifdef LAMMPS_BIGBIG
|
||||
#include "inttypes.h"
|
||||
#ifdef USE_OPENCL
|
||||
#define tagint long
|
||||
#else
|
||||
#include "stdint.h"
|
||||
#define tagint int64_t
|
||||
#endif
|
||||
#endif
|
||||
#ifdef LAMMPS_SMALLSMALL
|
||||
#define tagint int
|
||||
#endif
|
||||
@ -39,9 +43,13 @@ _texture( q_tex,int2);
|
||||
#define tagint int
|
||||
#endif
|
||||
#ifdef LAMMPS_BIGBIG
|
||||
#include "inttypes.h"
|
||||
#ifdef USE_OPENCL
|
||||
#define tagint long
|
||||
#else
|
||||
#include "stdint.h"
|
||||
#define tagint int64_t
|
||||
#endif
|
||||
#endif
|
||||
#ifdef LAMMPS_SMALLSMALL
|
||||
#define tagint int
|
||||
#endif
|
||||
|
||||
@ -21,9 +21,13 @@
|
||||
#define tagint int
|
||||
#endif
|
||||
#ifdef LAMMPS_BIGBIG
|
||||
#include "inttypes.h"
|
||||
#ifdef USE_OPENCL
|
||||
#define tagint long
|
||||
#else
|
||||
#include "stdint.h"
|
||||
#define tagint int64_t
|
||||
#endif
|
||||
#endif
|
||||
#ifdef LAMMPS_SMALLSMALL
|
||||
#define tagint int
|
||||
#endif
|
||||
|
||||
@ -136,7 +136,7 @@ typedef int tagint;
|
||||
#define OCL_INT_TYPE "-DLAMMPS_SMALLBIG"
|
||||
#endif
|
||||
#ifdef LAMMPS_BIGBIG
|
||||
#include "inttypes.h"
|
||||
#include "stdint.h"
|
||||
typedef int64_t tagint;
|
||||
#define OCL_INT_TYPE "-DLAMMPS_BIGBIG"
|
||||
#endif
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Alexey N. Volkov, UA, avolkov1@ua.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module CNTPot !*************************************************************************************
|
||||
!
|
||||
@ -21,34 +21,34 @@ module CNTPot !*****************************************************************
|
||||
!
|
||||
! Carbon nanotubes internal potentials:
|
||||
! CNTSTRH0, harmonic stretching potential of type 0 with constant Young's modulus
|
||||
! CNTSTRH1, harmonic stretching potential of type 1 with variable Young's modulus
|
||||
! CNTSTRH1, harmonic stretching potential of type 1 with variable Young's modulus
|
||||
! CNTSTRNH0, non-harmonic stretching with fracture potential of type 0
|
||||
! CNTSTRNH1, non-harmonic stretching with fracture potential of type 1
|
||||
! CNTBNDH, harmonic bending potential
|
||||
! CNTBNDHB, harmonic bending-buckling potential
|
||||
! CNTBNDHBF, harmonic bending-buckling potential with fracture
|
||||
! CNTBNDHBF, harmonic bending-buckling potential with fracture
|
||||
! CNTTRS, torsion potential
|
||||
! CNTBRT, breathing potential
|
||||
!
|
||||
! The functional form and force constants of harmonic stretching, bending and
|
||||
! torsion potentials are taken from:
|
||||
! torsion potentials are taken from:
|
||||
! L.V. Zhigilei, Ch. Wei, D. Srivastava, Phys. Rev. B 71, 165417 (2005)
|
||||
!
|
||||
! The model of stress-strain curve for the non-harmonic potential with fracture
|
||||
! The model of stress-strain curve for the non-harmonic potential with fracture
|
||||
! is developed and parameterized using the following constants
|
||||
! -- Young's modulus
|
||||
! -- Young's modulus
|
||||
! -- maximum linear strain (only for the NH potential of type 1)
|
||||
! -- tensile strength (or fracture strain)
|
||||
! -- strain at failure (or fracture strain)
|
||||
! -- maximum strain.
|
||||
! All these parameters are assumed to be independent of CNT radius or chriality type.
|
||||
! In this model, the true strain at failure CNTSTREft and true tensile strength
|
||||
! In this model, the true strain at failure CNTSTREft and true tensile strength
|
||||
! CNTSTRSft are slightly different from the imposed values CNTSTREf and CNTSTRSf.
|
||||
!
|
||||
! The non-harmonic stretching potentials of types 0 and 1 are different from
|
||||
! The non-harmonic stretching potentials of types 0 and 1 are different from
|
||||
! each other by the functional form of the stress-strain curve
|
||||
!
|
||||
! Different parameterizations of CNTSTRH0, CNTSTRNH0 and CNTSTRNH1 potentials can be chosen,
|
||||
! Different parameterizations of CNTSTRH0, CNTSTRNH0 and CNTSTRNH1 potentials can be chosen,
|
||||
! see subroutine CNTSTRSetParameterization
|
||||
!
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
@ -75,47 +75,47 @@ implicit none
|
||||
integer(c_int), parameter :: CNTPOT_BFRACTURE = 5
|
||||
|
||||
! Harmonic stretching model (constant Young's modulus)
|
||||
integer(c_int), parameter :: CNTSTRMODEL_H0 = 0
|
||||
integer(c_int), parameter :: CNTSTRMODEL_H0 = 0
|
||||
! Harmonic stretching model (Young's modulus depends on radius)
|
||||
integer(c_int), parameter :: CNTSTRMODEL_H1 = 1
|
||||
integer(c_int), parameter :: CNTSTRMODEL_H1 = 1
|
||||
! Non-harmonic stretching with fracture, potential of type 0
|
||||
integer(c_int), parameter :: CNTSTRMODEL_NH0F = 2
|
||||
integer(c_int), parameter :: CNTSTRMODEL_NH0F = 2
|
||||
! Non-harmonic stretching without fracture, potential of type 1
|
||||
integer(c_int), parameter :: CNTSTRMODEL_NH1 = 3
|
||||
integer(c_int), parameter :: CNTSTRMODEL_NH1 = 3
|
||||
! Non-harmonic stretching with fracture, potential of type 1
|
||||
integer(c_int), parameter :: CNTSTRMODEL_NH1F = 4
|
||||
! Harmonic stretching model + axial buckling
|
||||
integer(c_int), parameter :: CNTSTRMODEL_H1B = 5
|
||||
integer(c_int), parameter :: CNTSTRMODEL_NH1F = 4
|
||||
! Harmonic stretching model + axial buckling
|
||||
integer(c_int), parameter :: CNTSTRMODEL_H1B = 5
|
||||
! Harmonic stretching model + axial buckling + hysteresis
|
||||
integer(c_int), parameter :: CNTSTRMODEL_H1BH = 6
|
||||
integer(c_int), parameter :: CNTSTRMODEL_H1BH = 6
|
||||
|
||||
integer(c_int), parameter :: CNTBNDMODEL_H = 0 ! Harmonic bending model
|
||||
integer(c_int), parameter :: CNTBNDMODEL_HB = 1 ! Harmonic bending - buckling model
|
||||
integer(c_int), parameter :: CNTBNDMODEL_HBF = 2 ! Harmonic bending - buckling - fracture model
|
||||
integer(c_int), parameter :: CNTBNDMODEL_HBH = 3 ! Harmonic bending - buckling + Hysteresis
|
||||
|
||||
|
||||
integer(c_int), parameter :: CNTPOTNMAX = 4000 ! Maximum number of points in the interpolation tables
|
||||
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Parameters of potentials
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
! Stretching potential
|
||||
|
||||
|
||||
! Type of the bending model
|
||||
integer(c_int) :: CNTSTRModel = CNTSTRMODEL_H1
|
||||
! Type of parameterization
|
||||
integer(c_int) :: CNTSTRParams = 0
|
||||
integer(c_int) :: CNTSTRParams = 0
|
||||
! Type of dependence of the Young's modulus on tube radius
|
||||
integer(c_int) :: CNTSTRYMT = 0
|
||||
|
||||
integer(c_int) :: CNTSTRYMT = 0
|
||||
|
||||
! Parameters of non-harmonic potential and fracture model
|
||||
real(c_double) :: CNTSTRR0 = 6.8d+00 ! Reference radius of nanotubes (A)
|
||||
! (this parameter is not used for the model
|
||||
! parametrization, but only for calculation of the
|
||||
real(c_double) :: CNTSTRR0 = 6.8d+00 ! Reference radius of nanotubes (A)
|
||||
! (this parameter is not used for the model
|
||||
! parametrization, but only for calculation of the
|
||||
! force constant in eV/A)
|
||||
real(c_double) :: CNTSTRD0 = 3.4d+00 ! CNT wall thickness (A)
|
||||
real(c_double) :: CNTSTREmin = -0.4d+00 ! Minimum strain in tabulated potential
|
||||
real(c_double) :: CNTSTRD0 = 3.4d+00 ! CNT wall thickness (A)
|
||||
real(c_double) :: CNTSTREmin = -0.4d+00 ! Minimum strain in tabulated potential
|
||||
real(c_double) :: CNTSTREmax = 0.13d+00 ! Maximum strain in tabulated potential.
|
||||
! Simultaneously, U=0 if E> CNTSTREmax
|
||||
real(c_double) :: CNTSTREl = 5.0d-02 ! Maximum linear strain
|
||||
@ -129,17 +129,17 @@ implicit none
|
||||
real(c_double) :: CNTSTRSi ! Maximum stress (not used in the model) (Pa)
|
||||
real(c_double) :: CNTSTRDf ! dF/dE at failure
|
||||
|
||||
real(c_double) :: CNTSTRAA, CNTSTRBB !
|
||||
real(c_double) :: CNTSTRAA, CNTSTRBB !
|
||||
real(c_double) :: CNTSTRAAA, CNTSTRBBB ! Auxiliary constants
|
||||
real(c_double) :: CNTSTRUl, CNTSTRUf !
|
||||
|
||||
real(c_double) :: CNTSTRUl, CNTSTRUf !
|
||||
|
||||
! Axial buckling - hysteresis approach
|
||||
real(c_double) :: CNTSTREc = -0.0142d+00 ! The minimum buckling strain
|
||||
real(c_double) :: CNTSTREc1 = -0.04d+00 ! Critical axial buckling strain
|
||||
real(c_double) :: CNTSTREc = -0.0142d+00 ! The minimum buckling strain
|
||||
real(c_double) :: CNTSTREc1 = -0.04d+00 ! Critical axial buckling strain
|
||||
real(c_double) :: CNTSTREc2 = -0.45d+00 ! Maximum buckling strain
|
||||
|
||||
|
||||
! Bending potential
|
||||
|
||||
|
||||
integer(c_int) :: CNTBNDModel = CNTBNDMODEL_H ! Type of the bending model
|
||||
! Buckling model parameters
|
||||
real(c_double) :: CNTBNDN = 1.0d+00 ! Buckling exponent
|
||||
@ -149,9 +149,9 @@ implicit none
|
||||
real(c_double) :: CNTBNDTF = M_PI * 120.0d+00 / 180.0d+00 ! Fracture buckling angle (rad)
|
||||
real(c_double) :: CNTBNDN1
|
||||
real(c_double) :: CNTBNDC2
|
||||
|
||||
|
||||
contains !******************************************************************************************
|
||||
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Stretching potential
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
@ -167,7 +167,7 @@ contains !**********************************************************************
|
||||
!-------------------------------------------------------------------------------------------
|
||||
integer(c_int), intent(in) :: PType
|
||||
!-------------------------------------------------------------------------------------------
|
||||
select case ( PType )
|
||||
select case ( PType )
|
||||
case ( 0 ) ! This parametrization is based on averaged exp. data of Ref. [1]
|
||||
CNTSTRR0 = 6.8d+00 ! Ref. [1]
|
||||
CNTSTRD0 = 3.4d+00 ! Ref. [1]
|
||||
@ -180,7 +180,7 @@ contains !**********************************************************************
|
||||
case ( 1 ) ! This parameterization is taken from Ref. [2] for (10,10) CNTs.
|
||||
! These values are obtained in MD simulations with REBO potential.
|
||||
! Values of Young's modulus, tensile strength and stress here
|
||||
! are close to those obtained in Ref. [3] for pristine (defectless)
|
||||
! are close to those obtained in Ref. [3] for pristine (defectless)
|
||||
! (5,5) CNT in semi-empirical QM calculations based on PM3 model
|
||||
CNTSTRR0 = 6.785d+00 ! Calculated with the usual formula for (10,10) CNT
|
||||
CNTSTRD0 = 3.35d+00 ! Ref. [2]
|
||||
@ -190,7 +190,7 @@ contains !**********************************************************************
|
||||
CNTSTREf = 27.9d-02 ! Corresponds to maximum strain in Ref. [2]
|
||||
CNTSTRS0 = 1.031e+12 ! Ref. [2]
|
||||
CNTSTRSf = 148.5d+09 ! Corresponds to tensile strength in Ref. [2]
|
||||
case ( 2 ) ! This parametrization is taken from Ref. [3] for (5,5) CNTs
|
||||
case ( 2 ) ! This parametrization is taken from Ref. [3] for (5,5) CNTs
|
||||
! with one atom vacancy defect obtained with the semi-empirical QM PM3 model
|
||||
CNTSTRR0 = 3.43d+00 ! Ref. [3]
|
||||
CNTSTRD0 = 3.4d+00 ! Ref. [3]
|
||||
@ -246,14 +246,14 @@ contains !**********************************************************************
|
||||
!
|
||||
! Stretching without fracture, harmonic potential, with axial buckling without hysteresis
|
||||
!
|
||||
|
||||
integer(c_int) function CNTSTRH1BCalc ( U, dUdL, L, R0, L0 ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
integer(c_int) function CNTSTRH1BCalc ( U, dUdL, L, R0, L0 ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! Young's modulus depends on R, see [4].
|
||||
! Axial buckling without hysteresis.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(out) :: U, dUdL
|
||||
real(c_double), intent(in) :: L, R0, L0
|
||||
real(c_double) :: E, K, Kbcl, dUbcl, d, ud
|
||||
real(c_double) :: E, K, Kbcl, dUbcl, d, ud
|
||||
!-------------------------------------------------------------------------------------------
|
||||
E = ( L - L0 ) / L0
|
||||
K = 86.64d+00 + 100.56d+00 * R0
|
||||
@ -266,7 +266,7 @@ contains !**********************************************************************
|
||||
dUbcl = 0.5d+00 * L0 * K * CNTSTREc * CNTSTREc - Kbcl * CNTSTREc
|
||||
U = Kbcl * E + dUbcl
|
||||
dUdL = Kbcl / L0
|
||||
CNTSTRH1BCalc = CNTPOT_STRETCHING
|
||||
CNTSTRH1BCalc = CNTPOT_STRETCHING
|
||||
else ! Return to harmonic potential
|
||||
d = -0.0142794
|
||||
dUdL = K * ( d + E - CNTSTREc2 )
|
||||
@ -274,7 +274,7 @@ contains !**********************************************************************
|
||||
Ud = 0.5d+00 * L0 * K * d * d
|
||||
U = 0.5d+00 * L0 * (d+E-CNTSTREc2) * dUdL + dUbcl - Ud
|
||||
CNTSTRH1BCalc = CNTPOT_STRETCHING
|
||||
end if
|
||||
end if
|
||||
end function CNTSTRH1BCalc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
!
|
||||
@ -290,7 +290,7 @@ contains !**********************************************************************
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double) :: E, K, dUbcl, Ebcl, Kbcl, Edu
|
||||
real(c_double) :: C, DE, t
|
||||
!-------------------------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------------------------
|
||||
E = ( L - L0 ) / L0
|
||||
K = 86.64d+00 + 100.56d+00 * R0
|
||||
Kbcl = -10.98d+00 * L0
|
||||
@ -319,7 +319,7 @@ contains !**********************************************************************
|
||||
dUdL = Kbcl / L0
|
||||
CNTSTRH1BHCalc = CNTPOT_SBUCKLING
|
||||
Ebuc = 0.5d+00 * L0 * K * CNTSTREc1 * CNTSTREc1 - Kbcl * CNTSTREc1 - dUbcl
|
||||
else ! Already buckled
|
||||
else ! Already buckled
|
||||
dUbcl = 0.5d+00 * L0 * K * CNTSTREc * CNTSTREc - Kbcl * CNTSTREc
|
||||
U = Kbcl * E + dUbcl
|
||||
dUdL = Kbcl / L0
|
||||
@ -331,7 +331,7 @@ contains !**********************************************************************
|
||||
U = 0.5d+00 * L0 * E * dUdL
|
||||
CNTSTRH1BHCalc = CNTPOT_STRETCHING
|
||||
Ebuc = 0.0d+00
|
||||
end if
|
||||
end if
|
||||
end function CNTSTRH1BHCalc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
!
|
||||
@ -345,26 +345,26 @@ contains !**********************************************************************
|
||||
!-------------------------------------------------------------------------------------------
|
||||
E = ( L - L0 ) / L0
|
||||
if ( E < CNTSTREf ) then
|
||||
dUdL = ( CNTSTRAA - CNTSTRBB * E ) * E
|
||||
dUdL = ( CNTSTRAA - CNTSTRBB * E ) * E
|
||||
U = ( CNTSTRAAA - CNTSTRBBB * E ) * E * E
|
||||
CNTSTRNH0FCalc = CNTPOT_STRETCHING
|
||||
else
|
||||
else
|
||||
dUdL = 0.0d+00
|
||||
U = 0.0d+00
|
||||
CNTSTRNH0FCalc = CNTPOT_SFRACTURE
|
||||
end if
|
||||
U = L0 * R0 * U
|
||||
dUdL = R0 * dUdL
|
||||
dUdL = R0 * dUdL
|
||||
end function CNTSTRNH0FCalc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine CNTSTRNH0Init () !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double) :: S
|
||||
!-------------------------------------------------------------------------------------------
|
||||
S = M_2PI * CNTSTRD0 * 1.0e-20 / K_MDFU
|
||||
CNTSTRSl = CNTSTRS0 * CNTSTREl
|
||||
CNTSTRF0 = CNTSTRS0 * S
|
||||
CNTSTRFl = CNTSTRSl * S
|
||||
CNTSTRFf = CNTSTRSf * S
|
||||
CNTSTRF0 = CNTSTRS0 * S
|
||||
CNTSTRFl = CNTSTRSl * S
|
||||
CNTSTRFf = CNTSTRSf * S
|
||||
CNTSTRAA = CNTSTRF0
|
||||
CNTSTRBB = ( CNTSTRF0 * CNTSTREf - CNTSTRFf ) / ( CNTSTREf * CNTSTREf )
|
||||
CNTSTRAAA= CNTSTRAA / 2.0d+00
|
||||
@ -375,11 +375,11 @@ contains !**********************************************************************
|
||||
CNTSTRSi = 0.0d+00
|
||||
CNTSTRDf = 0.0d+00
|
||||
end subroutine CNTSTRNH0Init !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!
|
||||
! Stretching without fracture, non-harmonic potential of type 1
|
||||
!
|
||||
|
||||
|
||||
integer(c_int) function CNTSTRNH1Calc ( U, dUdL, L, R0, L0 ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(out) :: U, dUdL
|
||||
real(c_double), intent(in) :: L, R0, L0
|
||||
@ -390,7 +390,7 @@ contains !**********************************************************************
|
||||
dUdL = CNTSTRF0 * E
|
||||
U = 0.5d+00 * E * dUdL
|
||||
CNTSTRNH1Calc = CNTPOT_STRETCHING
|
||||
else
|
||||
else
|
||||
DE = E - CNTSTREl
|
||||
C = 1.0 + CNTSTRBB * DE
|
||||
dUdL = CNTSTRFl + CNTSTRAA * ( 1.0d+00 - 1.0d+00 / C )
|
||||
@ -398,13 +398,13 @@ contains !**********************************************************************
|
||||
end if
|
||||
CNTSTRNH1Calc = CNTPOT_STRETCHING
|
||||
U = L0 * R0 * U
|
||||
dUdL = R0 * dUdL
|
||||
dUdL = R0 * dUdL
|
||||
end function CNTSTRNH1Calc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
!
|
||||
! Stretching with fracture, non-harmonic potential of type 1
|
||||
!
|
||||
|
||||
|
||||
integer(c_int) function CNTSTRNH1FCalc ( U, dUdL, L, R0, L0 ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(out) :: U, dUdL
|
||||
real(c_double), intent(in) :: L, R0, L0
|
||||
@ -421,24 +421,24 @@ contains !**********************************************************************
|
||||
dUdL = CNTSTRFl + CNTSTRAA * ( 1.0d+00 - 1.0d+00 / C )
|
||||
U = CNTSTRUl + CNTSTRAAA * DE - CNTSTRBBB * dlog ( C )
|
||||
CNTSTRNH1FCalc = CNTPOT_STRETCHING
|
||||
else
|
||||
else
|
||||
dUdL = 0.0d+00
|
||||
U = 0.0d+00
|
||||
CNTSTRNH1FCalc = CNTPOT_SFRACTURE
|
||||
end if
|
||||
U = L0 * R0 * U
|
||||
dUdL = R0 * dUdL
|
||||
dUdL = R0 * dUdL
|
||||
end function CNTSTRNH1FCalc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine CNTSTRNH1Init () !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double) :: S, C, E, t
|
||||
integer(c_int) :: i, CaseID
|
||||
!-------------------------------------------------------------------------------------------
|
||||
S = M_2PI * CNTSTRD0 * 1.0e-20 / K_MDFU
|
||||
CNTSTRSl = CNTSTRS0 * CNTSTREl
|
||||
CNTSTRF0 = CNTSTRS0 * S
|
||||
CNTSTRFl = CNTSTRSl * S
|
||||
CNTSTRFf = CNTSTRSf * S
|
||||
CNTSTRF0 = CNTSTRS0 * S
|
||||
CNTSTRFl = CNTSTRSl * S
|
||||
CNTSTRFf = CNTSTRSf * S
|
||||
CNTSTRAA = ( CNTSTRFf - CNTSTRFl ) * ( CNTSTREf * CNTSTRF0 - CNTSTRFl ) / ( CNTSTREf * CNTSTRF0 - CNTSTRFf )
|
||||
CNTSTRBB = CNTSTRF0 / CNTSTRAA
|
||||
CNTSTRAAA= CNTSTRFl + CNTSTRAA
|
||||
@ -449,7 +449,7 @@ contains !**********************************************************************
|
||||
CNTSTRUl = 0.5d+00 * CNTSTRFl * CNTSTREl
|
||||
CNTSTRUf = CNTSTRUl + ( CNTSTRFl + CNTSTRAA ) * ( CNTSTREf - CNTSTREl ) - CNTSTRAA * dlog ( C ) / CNTSTRBB
|
||||
end subroutine CNTSTRNH1Init !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!
|
||||
! General
|
||||
!
|
||||
@ -477,7 +477,7 @@ contains !**********************************************************************
|
||||
CNTSTRCalc = CNTSTRH1BHCalc ( U, dUdL, L, R0, L0, ABF, Ebuc )
|
||||
end select
|
||||
end function CNTSTRCalc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine CNTSTRInit ( STRModel, STRParams, YMType, Rref ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
integer(c_int), intent(in) :: STRModel, STRParams, YMType
|
||||
real(c_double), intent(in) :: Rref
|
||||
@ -498,13 +498,13 @@ contains !**********************************************************************
|
||||
else
|
||||
call CNTSTRNH1Init ()
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end subroutine CNTSTRInit !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Bending potentials
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
subroutine BendingGradients ( K, G0, G1, G2, R0, R1, R2 ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(inout) :: K
|
||||
real(c_double), dimension(0:2), intent(inout) :: G0, G1, G2
|
||||
@ -525,7 +525,7 @@ contains !**********************************************************************
|
||||
G2 = G2 / L2
|
||||
G1 = - ( G0 + G2 )
|
||||
end subroutine BendingGradients !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function CNTBNDHCalc ( U, dUdC, C, R0, L0 ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! Bending model of type 0:Harmonic bending potential.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -554,10 +554,10 @@ contains !**********************************************************************
|
||||
! Check the condition for buckling
|
||||
if ( C2 .ge. CNTBNDC2 ) then ! Buckling takes place
|
||||
Theta= M_PI - acos ( C )
|
||||
Kbnd = 63.8d+00 * R0**2.93d+00
|
||||
Kbnd = 63.8d+00 * R0**2.93d+00
|
||||
Kbcl = CNTBNDB * Kbnd / CNTBNDR
|
||||
DUbcl= Kbnd * ( CNTBNDB * ( M_PI - 2.0d+00 * atan ( 2.0 * CNTBNDR / L0 ) ) - 0.5d+00 * L0 / CNTBNDR ) &
|
||||
/ CNTBNDR
|
||||
DUbcl= Kbnd * ( CNTBNDB * ( M_PI - 2.0d+00 * atan ( 2.0 * CNTBNDR / L0 ) ) - 0.5d+00 * L0 / CNTBNDR ) &
|
||||
/ CNTBNDR
|
||||
U = Kbcl * abs( Theta )**CNTBNDN - DUbcl
|
||||
dUdC = Kbcl * CNTBNDN * abs( Theta )**CNTBNDN1 / sqrt ( 1.0d+00 - C * C )
|
||||
CNTBNDHBCalc = CNTPOT_BBUCKLING
|
||||
@ -568,7 +568,7 @@ contains !**********************************************************************
|
||||
CNTBNDHBCalc = CNTPOT_BENDING
|
||||
end if
|
||||
end function CNTBNDHBCalc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function CNTBNDHBFCalc ( U, dUdC, C, R0, L0 ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(out) :: U, dUdC
|
||||
real(c_double), intent(in) :: C, R0, L0
|
||||
@ -586,10 +586,10 @@ contains !**********************************************************************
|
||||
dUdC = 0.0d+00
|
||||
CNTBNDHBFCalc = CNTPOT_BFRACTURE
|
||||
else
|
||||
Kbnd = 63.8d+00 * R0**2.93d+00
|
||||
Kbnd = 63.8d+00 * R0**2.93d+00
|
||||
Kbcl = CNTBNDB * Kbnd / CNTBNDR
|
||||
DUbcl= Kbnd * ( CNTBNDB * ( M_PI - 2.0d+00 * atan ( 2.0 * CNTBNDR / L0 ) ) - &
|
||||
0.5d+00 * L0 / CNTBNDR ) / CNTBNDR
|
||||
0.5d+00 * L0 / CNTBNDR ) / CNTBNDR
|
||||
U = Kbcl * abs ( Theta )**CNTBNDN - DUbcl
|
||||
dUdC = Kbcl * CNTBNDN * abs ( Theta )**CNTBNDN1 / sqrt ( 1.0d+00 - C * C )
|
||||
CNTBNDHBFCalc = CNTPOT_BBUCKLING
|
||||
@ -601,7 +601,7 @@ contains !**********************************************************************
|
||||
CNTBNDHBFCalc = CNTPOT_BENDING
|
||||
end if
|
||||
end function CNTBNDHBFCalc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function CNTBNDHBHCalc ( U, dUdC, C, R0, L0, BBF, Ebuc ) !!!!!!!!!!!!!!!!!!!!
|
||||
! Bending model of type 1: Harmonic bending potential with buckling with hysteresis approach.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -611,16 +611,16 @@ contains !**********************************************************************
|
||||
real(c_double) :: E1, E2, C2, Kbnd, Kbcl,Theta,DUbcl, Ubcl, Cmin,Rmax
|
||||
!-------------------------------------------------------------------------------------------
|
||||
Rmax = 340.0d+00
|
||||
Cmin = 1.0/(Rmax*Rmax)
|
||||
Cmin = 1.0/(Rmax*Rmax)
|
||||
E1 = 1.0d+00 - C
|
||||
E2 = 1.0d+00 + C
|
||||
E2 = 1.0d+00 + C
|
||||
! Calculate the square of curvature
|
||||
C2 = 4.0d+00 * E2 / ( L0 * L0 * E1 )
|
||||
Theta = M_PI - acos ( C )
|
||||
if ( C2 .lt. Cmin ) then ! Harmonic bending
|
||||
if ( C2 .lt. Cmin ) then ! Harmonic bending
|
||||
Kbnd = 2.0d+00 * ( 63.8d+00 * R0**2.93d+00 ) / L0
|
||||
U = Kbnd * E2 / E1
|
||||
dUdC = 2.0d+00 * Kbnd / ( E1 * E1 )
|
||||
dUdC = 2.0d+00 * Kbnd / ( E1 * E1 )
|
||||
CNTBNDHBHCalc = CNTPOT_BENDING
|
||||
Ebuc = 0.0
|
||||
else if ( C2 .ge. Cmin .and. C2 .lt. CNTBNDC2 ) then ! Potential depends on buckling flag of a node
|
||||
@ -640,7 +640,7 @@ contains !**********************************************************************
|
||||
dUdC = Kbcl * CNTBNDN * abs( Theta )**CNTBNDN1 / sqrt ( 1.0d+00 - C * C )
|
||||
Ebuc = 0.0d+00
|
||||
CNTBNDHBHCalc = CNTPOT_BBUCKLING
|
||||
end if
|
||||
end if
|
||||
else ! Greater than buckling critical point
|
||||
if ( BBF .eq. 1 ) then ! Already buckled
|
||||
Theta= M_PI - acos ( C )
|
||||
@ -653,7 +653,7 @@ contains !**********************************************************************
|
||||
Ebuc = 0.0d00
|
||||
CNTBNDHBHCalc = CNTPOT_BBUCKLING
|
||||
else ! Newly buckled
|
||||
Theta= M_PI - acos ( C )
|
||||
Theta= M_PI - acos ( C )
|
||||
Kbnd = 63.8d+00 * R0**2.93d+00
|
||||
Kbcl = CNTBNDB * Kbnd / CNTBNDR
|
||||
DUbcl= 2.0d+00*Kbnd * &
|
||||
@ -666,11 +666,11 @@ contains !**********************************************************************
|
||||
end if
|
||||
end if
|
||||
end function CNTBNDHBHCalc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!
|
||||
! General
|
||||
!
|
||||
|
||||
|
||||
integer(c_int) function CNTBNDCalc ( U, dUdC, C, R0, L0, BBF, Ebuc ) !!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(out) :: U, dUdC, Ebuc
|
||||
real(c_double), intent(in) :: C, R0, L0
|
||||
@ -688,7 +688,7 @@ contains !**********************************************************************
|
||||
CNTBNDCalc = CNTBNDHBHCalc ( U, dUdC, C, R0, L0, BBF, Ebuc )
|
||||
end select
|
||||
end function CNTBNDCalc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine CNTBNDInit ( BNDModel ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
integer(c_int), intent(in) :: BNDModel
|
||||
real(c_double) :: A, E
|
||||
@ -710,5 +710,5 @@ contains !**********************************************************************
|
||||
call CNTSTRInit ( STRModel, STRParams, YMType, Rref )
|
||||
call CNTBNDInit ( BNDModel )
|
||||
end subroutine InitCNTPotModule !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
end module CNTPot !*********************************************************************************
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module ExportCNT !**********************************************************************************
|
||||
|
||||
@ -28,122 +28,122 @@ contains
|
||||
bind(c, name = "mesont_lib_InitCNTPotModule")
|
||||
integer(c_int), intent(in) :: STRModel, STRParams, YMType, BNDModel
|
||||
real(c_double), intent(in) :: Rref
|
||||
|
||||
|
||||
call InitCNTPotModule(STRModel, STRParams, YMType, BNDModel, Rref)
|
||||
endsubroutine
|
||||
|
||||
|
||||
subroutine TPBInit_() &
|
||||
bind(c, name = "mesont_lib_TPBInit")
|
||||
|
||||
|
||||
call TPBInit()
|
||||
endsubroutine
|
||||
|
||||
subroutine TPMInit_(M, N) &
|
||||
bind(c, name = "mesont_lib_TPMInit")
|
||||
integer(c_int), intent(in) :: M, N
|
||||
|
||||
|
||||
call TPMInit(M, N)
|
||||
endsubroutine
|
||||
|
||||
|
||||
subroutine SetTablePath_(TPMFile_, N) &
|
||||
bind(c, name = "mesont_lib_SetTablePath")
|
||||
integer(c_int), intent(in) :: N
|
||||
character(c_char), intent(in), dimension(N) :: TPMFile_
|
||||
integer :: i
|
||||
|
||||
|
||||
do i = 1, len(TPMFile)
|
||||
if (i <= N) then
|
||||
TPMFile(i:i) = TPMFile_(i)
|
||||
else
|
||||
else
|
||||
TPMFile(i:i) = ' '
|
||||
endif
|
||||
enddo
|
||||
endsubroutine
|
||||
|
||||
|
||||
function get_R_ () &
|
||||
bind(c, name = "mesont_lib_get_R")
|
||||
real(c_double) :: get_R_
|
||||
get_R_ = TPMR1
|
||||
return
|
||||
endfunction
|
||||
|
||||
|
||||
|
||||
subroutine TubeStretchingForceField_(U1, U2, F1, F2, S1, S2, X1, X2, R12, L12) &
|
||||
bind(c, name = "mesont_lib_TubeStretchingForceField")
|
||||
! Interaction energies associated with nodes X1 and X2
|
||||
real(c_double), intent(inout) :: U1, U2
|
||||
! Interaction energies associated with nodes X1 and X2
|
||||
real(c_double), intent(inout) :: U1, U2
|
||||
! Forces exerted on nodes X1 and X2
|
||||
real(c_double), intent(inout), dimension(0:2) :: F1, F2
|
||||
real(c_double), intent(inout), dimension(0:2) :: F1, F2
|
||||
! Contributions of nodes X1 and X2 to the virial stress tensor
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2
|
||||
! Coordinates of the segment nodes
|
||||
real(c_double), intent(in), dimension(0:2) :: X1, X2
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2
|
||||
! Coordinates of the segment nodes
|
||||
real(c_double), intent(in), dimension(0:2) :: X1, X2
|
||||
! Radius of a nanotube the segment (X1,X2) belongs to
|
||||
real(c_double), intent(in) :: R12
|
||||
real(c_double), intent(in) :: R12
|
||||
! Equilibrium length of segment (X1,X2)
|
||||
real(c_double), intent(in) :: L12
|
||||
|
||||
real(c_double), intent(in) :: L12
|
||||
|
||||
call TubeStretchingForceField(U1, U2, F1, F2, S1, S2, X1, X2, R12, L12)
|
||||
endsubroutine
|
||||
|
||||
subroutine TubeBendingForceField_(U1, U2, U3, F1, F2, F3, S1, S2, S3, X1, X2, X3, R123, L123, BBF2) &
|
||||
bind(c, name = "mesont_lib_TubeBendingForceField")
|
||||
! Interaction energies associated with nodes X1, X2, and X3
|
||||
real(c_double), intent(inout) :: U1, U2, U3
|
||||
real(c_double), intent(inout) :: U1, U2, U3
|
||||
! Forces exerted on nodes X1, X2, and X3
|
||||
real(c_double), intent(inout), dimension(0:2) :: F1, F2, F3
|
||||
real(c_double), intent(inout), dimension(0:2) :: F1, F2, F3
|
||||
! Contributions of nodes X1, X2, and X3 to the virial stress tensor
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2, S3
|
||||
! Coordinates of nodes
|
||||
real(c_double), intent(in), dimension(0:2) :: X1, X2, X3
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2, S3
|
||||
! Coordinates of nodes
|
||||
real(c_double), intent(in), dimension(0:2) :: X1, X2, X3
|
||||
! Radius of nanotube the segment (X1,X2) belongs to
|
||||
real(c_double), intent(in) :: R123
|
||||
real(c_double), intent(in) :: R123
|
||||
! Equilibrium length of segment (X1,X2) and (X2,X3) (It is assumed to be the same for both segments)
|
||||
real(c_double), intent(in) :: L123
|
||||
real(c_double), intent(in) :: L123
|
||||
integer(c_int), intent(inout) :: BBF2
|
||||
|
||||
|
||||
call TubeBendingForceField(U1, U2, U3, F1, F2, F3, S1, S2, S3, X1, X2, X3, R123, L123, BBF2 )
|
||||
endsubroutine
|
||||
|
||||
subroutine SegmentTubeForceField_(U1,U2,U,F1,F2,F,Fe,S1,S2,S,Se,X1,X2,R12,N,X,Xe,BBF,R,E1,E2,Ee,TPMType)&
|
||||
bind(c, name = "mesont_lib_SegmentTubeForceField")
|
||||
! Number of nodes in array X
|
||||
integer(c_int), intent(in) :: N
|
||||
integer(c_int), intent(in) :: N
|
||||
! Interaction energies associated with nodes X1 and X2
|
||||
real(c_double), intent(inout) :: U1, U2
|
||||
real(c_double), intent(inout) :: U1, U2
|
||||
! Interaction energies associated with nodes X
|
||||
real(c_double), intent(inout), dimension(0:N-1) :: U
|
||||
real(c_double), intent(inout), dimension(0:N-1) :: U
|
||||
! Forces exerted on nodes X1 and X2
|
||||
real(c_double), intent(inout), dimension(0:2) :: F1, F2
|
||||
real(c_double), intent(inout), dimension(0:2) :: F1, F2
|
||||
! Forces exerted on nodes X
|
||||
real(c_double), intent(inout), dimension(0:2,0:N-1) :: F
|
||||
real(c_double), intent(inout), dimension(0:2,0:N-1) :: F
|
||||
! Force exerted on node Xe (can be updated only if Ee > 0)
|
||||
real(c_double), intent(inout), dimension(0:2) :: Fe
|
||||
real(c_double), intent(inout), dimension(0:2) :: Fe
|
||||
! Contributions of nodes X1 and X2 to the virial stress tensor
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2
|
||||
! Contributions of nodes X to the virial stress tensor
|
||||
real(c_double), intent(inout), dimension(0:2,0:2,0:N-1) :: S
|
||||
real(c_double), intent(inout), dimension(0:2,0:2,0:N-1) :: S
|
||||
! Contributions of node Xe to the virial stress tensor (can be updated only if Ee > 0)
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: Se
|
||||
! Coordinates of the segment nodes
|
||||
real(c_double), intent(in), dimension(0:2) :: X1, X2
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: Se
|
||||
! Coordinates of the segment nodes
|
||||
real(c_double), intent(in), dimension(0:2) :: X1, X2
|
||||
! Radius of nanotube the segment (X1,X2) belongs to
|
||||
real(c_double), intent(in) :: R12
|
||||
real(c_double), intent(in) :: R12
|
||||
! Coordinates of the nanotube nodes
|
||||
real(c_double), intent(in), dimension(0:2,0:N-1) :: X
|
||||
real(c_double), intent(in), dimension(0:2,0:N-1) :: X
|
||||
! Additional node of the extended chain if Ee > 0
|
||||
real(c_double), intent(in), dimension(0:2) :: Xe
|
||||
! Bending buckling flags (BBF(i) = 1 in a case of buckling in node i)
|
||||
integer(c_int), intent(in), dimension(0:N-1) :: BBF
|
||||
real(c_double), intent(in), dimension(0:2) :: Xe
|
||||
! Bending buckling flags (BBF(i) = 1 in a case of buckling in node i)
|
||||
integer(c_int), intent(in), dimension(0:N-1) :: BBF
|
||||
! Radius of nanotube X
|
||||
real(c_double), intent(in) :: R
|
||||
! E1 = 1 if the chain node 0 is a CNT end; E2 = 1 if the chain node N-1 is a CNT end;
|
||||
integer(c_int), intent(in) :: E1, E2
|
||||
real(c_double), intent(in) :: R
|
||||
! E1 = 1 if the chain node 0 is a CNT end; E2 = 1 if the chain node N-1 is a CNT end;
|
||||
integer(c_int), intent(in) :: E1, E2
|
||||
! Parameter defining the type of the extended chain (0,1,2)
|
||||
integer(c_int), intent(in) :: Ee
|
||||
integer(c_int), intent(in) :: Ee
|
||||
! Type of the tubular potential (0 or 1)
|
||||
integer(c_int), intent(in) :: TPMType
|
||||
|
||||
integer(c_int), intent(in) :: TPMType
|
||||
|
||||
call SegmentTubeForceField(U1, U2, U, F1, F2, F, Fe, S1, S2, S, Se, X1, X2, R12, N, X, Xe, BBF, R, E1, E2, Ee, TPMType)
|
||||
endsubroutine
|
||||
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Alexey N. Volkov, UA, avolkov1@ua.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module LinFun2 !************************************************************************************
|
||||
!
|
||||
@ -26,7 +26,7 @@ module LinFun2 !****************************************************************
|
||||
!***************************************************************************************************
|
||||
use iso_c_binding, only : c_int, c_double, c_char
|
||||
implicit none
|
||||
|
||||
|
||||
contains !******************************************************************************************
|
||||
|
||||
real(c_double) function CalcLinFun1_0 ( i, X, N, P, F ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
@ -42,7 +42,7 @@ contains !**********************************************************************
|
||||
A = 1.0d+00 - A0
|
||||
CalcLinFun1_0 = A0 * F(i1) + A * F(i)
|
||||
end function CalcLinFun1_0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine CalcLinFun1_1 ( S, Sx1, i, X, N, P, F, Fx ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(out) :: S, Sx1
|
||||
integer(c_int), intent(in) :: i, N
|
||||
@ -78,7 +78,7 @@ contains !**********************************************************************
|
||||
G0 = B0 * F(i1,j1) + B * F(i1,j)
|
||||
CalcLinFun2_0 = A0 * G0 + A * G
|
||||
end function CalcLinFun2_0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine CalcLinFun2_1 ( S, Sx1, Sy1, i, j, X, Y, N1, N2, P1, P2, F, Fx, Fy ) !!!!!!!!!!!!
|
||||
real(c_double), intent(out) :: S, Sx1, Sy1
|
||||
integer(c_int), intent(in) :: i, j, N1, N2
|
||||
@ -95,19 +95,19 @@ contains !**********************************************************************
|
||||
A = 1.0d+00 - A0
|
||||
B0 = ( P2(j) - Y ) / ( P2(j) - P2(j1) )
|
||||
B = 1.0d+00 - B0
|
||||
|
||||
|
||||
G = B0 * F(i,j1) + B * F(i,j)
|
||||
G0 = B0 * F(i1,j1) + B * F(i1,j)
|
||||
S = A0 * G0 + A * G
|
||||
|
||||
|
||||
G = B0 * Fx(i,j1) + B * Fx(i,j)
|
||||
G0 = B0 * Fx(i1,j1) + B * Fx(i1,j)
|
||||
Sx1 = A0 * G0 + A * G
|
||||
|
||||
|
||||
G = B0 * Fy(i,j1) + B * Fy(i,j)
|
||||
G0 = B0 * Fy(i1,j1) + B * Fy(i1,j)
|
||||
Sy1 = A0 * G0 + A * G
|
||||
|
||||
|
||||
end subroutine CalcLinFun2_1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
end module LinFun2 !********************************************************************************
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Alexey N. Volkov, UA, avolkov1@ua.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module Spline1 !************************************************************************************
|
||||
!
|
||||
@ -64,7 +64,7 @@ contains !**********************************************************************
|
||||
!-------------------------------------------------------------------------------------------
|
||||
X(0) = F(0) / K1(0)
|
||||
F(0) = - K2(0) / K1(0)
|
||||
do i = 1, N - 1
|
||||
do i = 1, N - 1
|
||||
D = - ( K1(i) + F(i-1) * K0(i) )
|
||||
X(i) = ( K0(i) * X(i-1) - F(i) ) / D
|
||||
F(i) = K2(i) / D
|
||||
@ -85,8 +85,8 @@ contains !**********************************************************************
|
||||
K0(i) = P(i) - P(i-1)
|
||||
K1(i) = ( F(i) - F(i-1) ) / K0(i)
|
||||
end do
|
||||
select case ( CL )
|
||||
case (1)
|
||||
select case ( CL )
|
||||
case (1)
|
||||
K1(0) = 2.0d+00 / 3.0d+00
|
||||
K2(0) = 1.0d+00 / 3.0d+00
|
||||
D (0) = 2 * ( K1(1) - M(0) ) / K0(1)
|
||||
@ -98,14 +98,14 @@ contains !**********************************************************************
|
||||
K1(0) = 1.0d+00
|
||||
K2(0) = 0.0d+00
|
||||
D(0) = 0.0d+00
|
||||
end select
|
||||
end select
|
||||
Z = K1(N-1)
|
||||
do i = 1, N - 2
|
||||
do i = 1, N - 2
|
||||
D(i) = 6.0d+00 * ( K1(i+1) - K1(i) )
|
||||
K2(i) = K0(i+1)
|
||||
K1(i) = 2.0d+00 * ( K2(i) + K0(i) )
|
||||
end do
|
||||
select case ( CR )
|
||||
select case ( CR )
|
||||
case (1)
|
||||
D(N-1) = 2.0d+00 * ( M(N-1) - Z ) / K0(N-1)
|
||||
K1(N-1) = 2.0d+00 / 3.0d+00
|
||||
@ -118,14 +118,14 @@ contains !**********************************************************************
|
||||
K1(N-1) = 1.0d+00
|
||||
K0(N-1) = 0.0d+00
|
||||
D(N-1) = 0.0d+00
|
||||
end select
|
||||
end select
|
||||
call sprogonka3 ( N, K0, K1, K2, D, M )
|
||||
end subroutine CreateSpline1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
real(c_double) function CalcSpline1_0 ( i, X, N, P, F, M ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
integer(c_int), intent(in) :: i, N
|
||||
real(c_double), intent(in) :: X
|
||||
real(c_double), dimension(0:N-1), intent(in) :: P, F, M
|
||||
real(c_double), dimension(0:N-1), intent(in) :: P, F, M
|
||||
integer(c_int) :: j
|
||||
real(c_double) :: HL, HR, H, H6, H26, HR2, HL2, HRH, HLH
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -147,7 +147,7 @@ contains !**********************************************************************
|
||||
real(c_double), intent(out) :: S, S1
|
||||
integer(c_int), intent(in) :: i, N
|
||||
real(c_double), intent(in) :: X
|
||||
real(c_double), dimension(0:N-1), intent(in) :: P, F, M
|
||||
real(c_double), dimension(0:N-1), intent(in) :: P, F, M
|
||||
integer(c_int) :: j
|
||||
real(c_double) :: HL, HR, H, H6, H26, HR2, HL2, HRH, HLH
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -169,7 +169,7 @@ contains !**********************************************************************
|
||||
real(c_double), intent(out) :: S, S1, S2
|
||||
integer(c_int), intent(in) :: i, N
|
||||
real(c_double), intent(in) :: X
|
||||
real(c_double), dimension(0:N-1), intent(in) :: P, F, M
|
||||
real(c_double), dimension(0:N-1), intent(in) :: P, F, M
|
||||
integer(c_int) :: j
|
||||
real(c_double) :: HL, HR, H, H6, H26, HR2, HL2, HRH, HLH
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -185,7 +185,7 @@ contains !**********************************************************************
|
||||
HRH = HR / H
|
||||
S = ( M(j) * HR2 * HRH + M(i) * HL2 * HLH ) / 6.0d+00 + ( F(j) - M(j) * H26 ) * HRH + ( F(i) - M(i) * H26 ) * HLH
|
||||
S1 = ( ( M(i) * HL2 - M(j) * HR2 ) / 2.0d+00 + F(i) - F(j) ) / H - H6 * ( M(i) - M(j) )
|
||||
S2 = M(j) * HRH + M(i) * HLH
|
||||
S2 = M(j) * HRH + M(i) * HLH
|
||||
end subroutine CalcSpline1_2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
end module Spline1 !********************************************************************************
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Alexey N. Volkov, UA, avolkov1@ua.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module Spline2 !************************************************************************************
|
||||
!
|
||||
@ -79,7 +79,7 @@ contains !**********************************************************************
|
||||
Fxx = 0.0d+00
|
||||
Fyy = 0.0d+00
|
||||
Fxxyy = 0.0d+00
|
||||
|
||||
|
||||
do II = 0, N2A
|
||||
FF(0:N1-1) = F(0:N1-1,II)
|
||||
MM(0) = Fxx(0,II)
|
||||
@ -87,7 +87,7 @@ contains !**********************************************************************
|
||||
call CreateSpline1 ( CL, CR, N1, P1, FF, MM, DD, K0, K1, K2 )
|
||||
Fxx(0:N1-1,II) = MM(0:N1-1)
|
||||
end do
|
||||
|
||||
|
||||
do II = N2A + 1, N2 - 1
|
||||
FF(0:N1-N1A-1) = F(N1A:N1-1,II)
|
||||
MM(0) = Fxx(N1A,II)
|
||||
@ -103,7 +103,7 @@ contains !**********************************************************************
|
||||
call CreateSpline1 ( CD, CU, N2A + 1, P2, FF, MM, DD, K0, K1, K2 )
|
||||
Fyy(II,0:N2A) = MM(0:N2A)
|
||||
end do
|
||||
|
||||
|
||||
do II = N1A, N1 - 1
|
||||
MM(0) = Fyy(II,0)
|
||||
MM(N-1) = Fyy(II,N2-1)
|
||||
@ -111,19 +111,19 @@ contains !**********************************************************************
|
||||
call CreateSpline1 ( CD, CU, N2, P2, FF, MM, DD, K0, K1, K2 )
|
||||
Fyy(II,0:N2-1) = MM(0:N2-1)
|
||||
end do
|
||||
|
||||
|
||||
FF(0:N1-1) = Fyy(0:N1-1,0)
|
||||
call CreateSpline1 ( 3, 3, N1, P1, FF, MM, DD, K0, K1, K2 )
|
||||
Fxxyy(0:N1-1,0) = MM(0:N1-1)
|
||||
|
||||
|
||||
FF(0:N1A) = Fyy(0:N1A,N2A)
|
||||
call CreateSpline1 ( 3, 3, N1A + 1, P1, FF, MM, DD, K0, K1, K2 )
|
||||
Fxxyy(0:N1A,N2A) = MM(0:N1A)
|
||||
|
||||
|
||||
FF(0:N1-N1A-1) = Fyy(N1A:N1-1,N2-1 )
|
||||
call CreateSpline1 ( 3, 3, N1-N1A, P1, FF, MM, DD, K0, K1, K2 )
|
||||
Fxxyy(N1A:N1-1,N2-1) = MM(0:N1-N1A-1)
|
||||
|
||||
|
||||
do II = 1, N1A
|
||||
MM(0) = Fxxyy(II,0)
|
||||
MM(N2A) = Fxxyy(II,N2A)
|
||||
@ -131,7 +131,7 @@ contains !**********************************************************************
|
||||
call CreateSpline1 ( 2 , 2, N2A + 1, P2, FF, MM, DD, K0, K1, K2 )
|
||||
Fxxyy(II,0:N2A) = MM(0:N2A)
|
||||
end do
|
||||
|
||||
|
||||
do II = N1A + 1, N1 - 2
|
||||
MM(0) = Fxxyy(II,0)
|
||||
MM(N-1) = Fxxyy(II,N2-1)
|
||||
@ -139,9 +139,9 @@ contains !**********************************************************************
|
||||
call CreateSpline1 ( 2 , 2, N2, P2, FF, MM, DD, K0, K1, K2 )
|
||||
Fxxyy(II,0:N2-1) = MM(0:N2-1)
|
||||
end do
|
||||
|
||||
|
||||
end subroutine CreateSpline2Ext !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
real(c_double) function CalcSpline2_0 ( i, j, X, Y, N1, N2, P1, P2, F, Fxx, Fyy, Fxxyy ) !!!
|
||||
integer(c_int), intent(in) :: i, j, N1, N2
|
||||
real(c_double), intent(in) :: X, Y
|
||||
@ -182,5 +182,5 @@ contains !**********************************************************************
|
||||
call ValueSpline1_1 ( S, Sx1, X, P1(i), P1(i1), Gy_0, Gy_1,Gxxy_0, Gxxy_1, P1(i) - P1(i1) )
|
||||
Sy1 = ValueSpline1_0 ( X, P1(i), P1(i1), Gyy_0, Gyy_1,Gxxyy_0, Gxxyy_1, P1(i) - P1(i1) )
|
||||
end subroutine CalcSpline2_1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
end module Spline2 !********************************************************************************
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Alexey N. Volkov, UA, avolkov1@ua.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module TPMForceField !******************************************************************************
|
||||
!
|
||||
@ -32,32 +32,32 @@ use iso_c_binding, only : c_int, c_double, c_char
|
||||
implicit none
|
||||
|
||||
contains !******************************************************************************************
|
||||
|
||||
|
||||
subroutine TubeStretchingForceField ( U1, U2, F1, F2, S1, S2, X1, X2, R12, L12 ) !!!!!!!!!!!
|
||||
! Interaction energies associated with nodes X1 and X2
|
||||
real(c_double), intent(inout) :: U1, U2
|
||||
real(c_double), intent(inout) :: U1, U2
|
||||
! Forces exerted on nodes X1 and X2
|
||||
real(c_double), intent(inout), dimension(0:2) :: F1, F2
|
||||
real(c_double), intent(inout), dimension(0:2) :: F1, F2
|
||||
! Contributions of nodes X1 and X2 to the virial stress tensor
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2
|
||||
! Coordinates of the segment nodes
|
||||
real(c_double), intent(in), dimension(0:2) :: X1, X2
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2
|
||||
! Coordinates of the segment nodes
|
||||
real(c_double), intent(in), dimension(0:2) :: X1, X2
|
||||
! Radius of a nanotube the segment (X1,X2) belongs to
|
||||
real(c_double), intent(in) :: R12
|
||||
real(c_double), intent(in) :: R12
|
||||
! Equilibrium length of segment (X1,X2)
|
||||
real(c_double), intent(in) :: L12
|
||||
real(c_double), intent(in) :: L12
|
||||
!-------------------------------------------------------------------------------------------
|
||||
integer(c_int) :: ii, jj, Event
|
||||
real(c_double) :: U, F, LL, S, Ubcl
|
||||
real(c_double), dimension(0:2) :: DX, FF
|
||||
!-------------------------------------------------------------------------------------------
|
||||
DX = X2 - X1
|
||||
DX = X2 - X1
|
||||
LL = S_V3norm3 ( DX )
|
||||
Event = CNTSTRCalc ( U, F, LL, R12, L12, 0, Ubcl )
|
||||
|
||||
U = U / 2.0d+00
|
||||
FF = DX * F / LL
|
||||
|
||||
|
||||
F1 = F1 + FF
|
||||
U1 = U1 + U
|
||||
|
||||
@ -68,25 +68,25 @@ contains !**********************************************************************
|
||||
do ii = 0, 2
|
||||
do jj = 0, 2
|
||||
S = - 0.5d+00 * DX(ii) * FF(jj)
|
||||
S1(ii,jj) = S1(ii,jj) + S
|
||||
S2(ii,jj) = S2(ii,jj) + S
|
||||
S1(ii,jj) = S1(ii,jj) + S
|
||||
S2(ii,jj) = S2(ii,jj) + S
|
||||
end do
|
||||
end do
|
||||
end subroutine TubeStretchingForceField !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
subroutine TubeBendingForceField ( U1, U2, U3, F1, F2, F3, S1, S2, S3, X1, X2, X3, R123, L123, BBF2 )
|
||||
subroutine TubeBendingForceField ( U1, U2, U3, F1, F2, F3, S1, S2, S3, X1, X2, X3, R123, L123, BBF2 )
|
||||
! Interaction energies associated with nodes X1, X2, and X3
|
||||
real(c_double), intent(inout) :: U1, U2, U3
|
||||
real(c_double), intent(inout) :: U1, U2, U3
|
||||
! Forces exerted on nodes X1, X2, and X3
|
||||
real(c_double), intent(inout), dimension(0:2) :: F1, F2, F3
|
||||
real(c_double), intent(inout), dimension(0:2) :: F1, F2, F3
|
||||
! Contributions of nodes X1, X2, and X3 to the virial stress tensor
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2, S3
|
||||
! Coordinates of nodes
|
||||
real(c_double), intent(in), dimension(0:2) :: X1, X2, X3
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2, S3
|
||||
! Coordinates of nodes
|
||||
real(c_double), intent(in), dimension(0:2) :: X1, X2, X3
|
||||
! Radius of nanotube the segment (X1,X2) belongs to
|
||||
real(c_double), intent(in) :: R123
|
||||
real(c_double), intent(in) :: R123
|
||||
! Equilibrium length of segment (X1,X2) and (X2,X3) (It is assumed to be the same for both segments)
|
||||
real(c_double), intent(in) :: L123
|
||||
real(c_double), intent(in) :: L123
|
||||
integer(c_int), intent(inout) :: BBF2
|
||||
!-------------------------------------------------------------------------------------------
|
||||
integer(c_int) :: ii, jj, Event
|
||||
@ -105,9 +105,9 @@ contains !**********************************************************************
|
||||
U = U / 4.0d+00
|
||||
F = - F
|
||||
|
||||
F1 = F1 + G0 * F
|
||||
F2 = F2 + G1 * F
|
||||
F3 = F3 + G2 * F
|
||||
F1 = F1 + G0 * F
|
||||
F2 = F2 + G1 * F
|
||||
F3 = F3 + G2 * F
|
||||
|
||||
U1 = U1 + U
|
||||
U2 = U2 + 2.0d+00 * U
|
||||
@ -117,16 +117,16 @@ contains !**********************************************************************
|
||||
do ii = 0, 2
|
||||
do jj = 0, 2
|
||||
S = 0.5d+00 * ( X1(ii) - X2(ii) ) * G0(jj)
|
||||
S1(ii,jj) = S1(ii,jj) + S
|
||||
S2(ii,jj) = S2(ii,jj) + S
|
||||
S1(ii,jj) = S1(ii,jj) + S
|
||||
S2(ii,jj) = S2(ii,jj) + S
|
||||
S = 0.5d+00 * ( X3(ii) - X2(ii) ) * G2(jj)
|
||||
S3(ii,jj) = S3(ii,jj) + S
|
||||
S2(ii,jj) = S2(ii,jj) + S
|
||||
S3(ii,jj) = S3(ii,jj) + S
|
||||
S2(ii,jj) = S2(ii,jj) + S
|
||||
end do
|
||||
end do
|
||||
end subroutine TubeBendingForceField !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
! The purpose of subroutine SegmentTubeForceField is to calculate interaction forces
|
||||
! The purpose of subroutine SegmentTubeForceField is to calculate interaction forces
|
||||
! (as well potential energies and components of the virial stress tensor) between a segment
|
||||
! (X1,X2) and a sequence of segments which belongs to a single CNT.
|
||||
|
||||
@ -134,7 +134,7 @@ contains !**********************************************************************
|
||||
! neighbor list of segment (X1,X2).
|
||||
|
||||
! The nodes in X are assumed to be ordered according to their physical appearance in the nanotube.
|
||||
! It means that (X(i),X(i+1)) are either correspond to a real segment or divided by segments
|
||||
! It means that (X(i),X(i+1)) are either correspond to a real segment or divided by segments
|
||||
! that do not belong to a nanotube.
|
||||
|
||||
! Concept of the extended chain:
|
||||
@ -143,45 +143,45 @@ contains !**********************************************************************
|
||||
! If node Xe follows XN and Xe is the nanotube end, then the extended chain is (X1,...,XN,Xe) and Ee = 2.
|
||||
! In all other cases, the extended chain coincides with (X1,...,XN) and Ee = 0.
|
||||
! If the extended chain contains additional node, then non-zero force is exerted on this node.
|
||||
|
||||
|
||||
subroutine SegmentTubeForceField ( U1, U2, U, F1, F2, F, Fe, S1, S2, S, Se, X1, X2, R12, N, X, Xe,&
|
||||
BBF, R, E1, E2, Ee, TPMType )
|
||||
BBF, R, E1, E2, Ee, TPMType )
|
||||
! Number of nodes in array X
|
||||
integer(c_int), intent(in) :: N
|
||||
! Interaction energies associated with nodes X1 and X2
|
||||
real(c_double), intent(inout) :: U1, U2
|
||||
integer(c_int), intent(in) :: N
|
||||
! Interaction energies associated with nodes X1 and X2
|
||||
real(c_double), intent(inout) :: U1, U2
|
||||
! Interaction energies associated with nodes X
|
||||
real(c_double), intent(inout), dimension(0:N-1) :: U
|
||||
real(c_double), intent(inout), dimension(0:N-1) :: U
|
||||
! Forces exerted on nodes X1 and X2
|
||||
real(c_double), intent(inout), dimension(0:2) :: F1, F2
|
||||
real(c_double), intent(inout), dimension(0:2) :: F1, F2
|
||||
! Forces exerted on nodes X
|
||||
real(c_double), intent(inout), dimension(0:2,0:N-1) :: F
|
||||
real(c_double), intent(inout), dimension(0:2,0:N-1) :: F
|
||||
! Force exerted on node Xe (can be updated only if Ee > 0)
|
||||
real(c_double), intent(inout), dimension(0:2) :: Fe
|
||||
real(c_double), intent(inout), dimension(0:2) :: Fe
|
||||
! Contributions of nodes X1 and X2 to the virial stress tensor
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2
|
||||
! Contributions of nodes X to the virial stress tensor
|
||||
real(c_double), intent(inout), dimension(0:2,0:2,0:N-1) :: S
|
||||
real(c_double), intent(inout), dimension(0:2,0:2,0:N-1) :: S
|
||||
! Contributions of node Xe to the virial stress tensor (can be updated only if Ee > 0)
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: Se
|
||||
! Coordinates of the segment nodes
|
||||
real(c_double), intent(in), dimension(0:2) :: X1, X2
|
||||
real(c_double), intent(inout), dimension(0:2,0:2) :: Se
|
||||
! Coordinates of the segment nodes
|
||||
real(c_double), intent(in), dimension(0:2) :: X1, X2
|
||||
! Radius of a nanotube the segment (X1,X2) belongs to
|
||||
real(c_double), intent(in) :: R12
|
||||
real(c_double), intent(in) :: R12
|
||||
! Coordinates of the nanotube nodes
|
||||
real(c_double), intent(in), dimension(0:2,0:N-1) :: X
|
||||
real(c_double), intent(in), dimension(0:2,0:N-1) :: X
|
||||
! Additional node of the extended chain if Ee > 0
|
||||
real(c_double), intent(in), dimension(0:2) :: Xe
|
||||
real(c_double), intent(in), dimension(0:2) :: Xe
|
||||
! Bending buckling flags (BBF(i) = 1 in a case of buckling in node i)
|
||||
integer(c_int), intent(in), dimension(0:N-1) :: BBF
|
||||
integer(c_int), intent(in), dimension(0:N-1) :: BBF
|
||||
! Radius of nanotube X
|
||||
real(c_double), intent(in) :: R
|
||||
real(c_double), intent(in) :: R
|
||||
! E1 = 1 if the chain node 0 is a CNT end; E1 = 2 if the chain node N-1 is a CNT end
|
||||
integer(c_int), intent(in) :: E1, E2
|
||||
integer(c_int), intent(in) :: E1, E2
|
||||
! Parameter defining the type of the extended chain (0,1,2)
|
||||
integer(c_int), intent(in) :: Ee
|
||||
integer(c_int), intent(in) :: Ee
|
||||
! Type of the tubular potential (0 or 1)
|
||||
integer(c_int), intent(in) :: TPMType
|
||||
integer(c_int), intent(in) :: TPMType
|
||||
!-------------------------------------------------------------------------------------------
|
||||
integer(c_int) :: k, ii, jj, IntSign
|
||||
integer(c_int) :: BType, EType, LocalTPMType
|
||||
@ -191,18 +191,18 @@ contains !**********************************************************************
|
||||
real(c_double), dimension(0:2) :: G, DG, DQ, XX
|
||||
real(c_double) :: UT, DR, DS, DS1
|
||||
! Interaction energies associated with nodes X1 and X2
|
||||
real(c_double) :: xU1, xU2
|
||||
real(c_double) :: xU1, xU2
|
||||
! Interaction energies associated with nodes X
|
||||
real(c_double), dimension(0:N-1) :: xU
|
||||
real(c_double), dimension(0:N-1) :: xU
|
||||
! Forces exerted on nodes X1 and X2
|
||||
real(c_double), dimension(0:2) :: xF1, xF2
|
||||
real(c_double), dimension(0:2) :: xF1, xF2
|
||||
! Forces exerted on nodes X
|
||||
real(c_double), dimension(0:2,0:N-1) :: xF
|
||||
real(c_double), dimension(0:2,0:N-1) :: xF
|
||||
! Force exerted on node Xe (can be updated only if Ee > 0)
|
||||
real(c_double), dimension(0:2) :: xFe
|
||||
real(c_double), dimension(0:2) :: xFe
|
||||
!-------------------------------------------------------------------------------------------
|
||||
|
||||
! Looking for a buckling point
|
||||
! Looking for a buckling point
|
||||
BType = 0
|
||||
do k = 0, N - 1
|
||||
if ( BBF(k) == 1 ) then
|
||||
@ -212,7 +212,7 @@ contains !**********************************************************************
|
||||
end do
|
||||
|
||||
! Choosing the LocalTPMType and Etype.
|
||||
! LocalTPMType is set to 0 if both ends of the chain are nanotube ends or the chain contains a buckling point.
|
||||
! LocalTPMType is set to 0 if both ends of the chain are nanotube ends or the chain contains a buckling point.
|
||||
! Overwise, LocalTPMType = TPMType.
|
||||
if ( BType == 1 ) then
|
||||
LocalTPMType = 0
|
||||
@ -231,7 +231,7 @@ contains !**********************************************************************
|
||||
if ( EType1 .and. EType2 ) then
|
||||
LocalTPMType = 0
|
||||
else
|
||||
LocalTPMType = TPMType
|
||||
LocalTPMType = TPMType
|
||||
if ( EType1 ) then
|
||||
EType = 1
|
||||
else if ( EType2 ) then
|
||||
@ -241,7 +241,7 @@ contains !**********************************************************************
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
if ( LocalTPMType == 0 ) then
|
||||
IntSign = TPMInteractionFW0 ( QQ, UT, xU1, xU2, xU, xF1, xF2, xF, G1, G2, X1, X2, N, N, X )
|
||||
else
|
||||
@ -263,10 +263,10 @@ contains !**********************************************************************
|
||||
|
||||
! Contributions to the virial stresses tensor
|
||||
do ii = 0, 2
|
||||
DR = 0.125d+00 * ( X2(ii) - X1(ii) )
|
||||
DR = 0.125d+00 * ( X2(ii) - X1(ii) )
|
||||
do jj = 0, 2
|
||||
DS = DR * ( xF2(jj) - xF1(jj) )
|
||||
S1(ii,jj) = S1(ii,jj) + DS
|
||||
S1(ii,jj) = S1(ii,jj) + DS
|
||||
S2(ii,jj) = S2(ii,jj) + DS
|
||||
end do
|
||||
end do
|
||||
@ -278,24 +278,24 @@ contains !**********************************************************************
|
||||
do ii = 0, 2
|
||||
do jj = 0, 2
|
||||
DS = DQ(ii) * xFe(jj)
|
||||
S1(ii,jj) = S1(ii,jj) + DS
|
||||
S1(ii,jj) = S1(ii,jj) + DS
|
||||
S2(ii,jj) = S1(ii,jj) + DS
|
||||
Se(ii,jj) = Se(ii,jj) + DS
|
||||
end do
|
||||
end do
|
||||
end if
|
||||
do k = 0, N - 2
|
||||
DQ = 0.5d+00 * ( X(0:2,k+1) + X(0:2,k) ) - XX
|
||||
DQ = 0.5d+00 * ( X(0:2,k+1) + X(0:2,k) ) - XX
|
||||
call ApplyPeriodicBC ( DQ )
|
||||
DQ = 0.125d+00 * DQ
|
||||
G = G1(0:2,k+1) + G2(0:2,k)
|
||||
DQ = 0.125d+00 * DQ
|
||||
G = G1(0:2,k+1) + G2(0:2,k)
|
||||
DG = G1(0:2,k+1) - G2(0:2,k)
|
||||
do ii = 0, 2
|
||||
DR = 0.125d+00 * ( X(ii,k+1) - X(ii,k) )
|
||||
DR = 0.125d+00 * ( X(ii,k+1) - X(ii,k) )
|
||||
do jj = 0, 2
|
||||
DS = DQ(ii) * G(jj)
|
||||
DS1 = DS + DR * DG(jj)
|
||||
S1(ii,jj) = S1(ii,jj) + DS
|
||||
S1(ii,jj) = S1(ii,jj) + DS
|
||||
S2(ii,jj) = S2(ii,jj) + DS
|
||||
S(ii,jj,k) = S(ii,jj,k) + DS1
|
||||
S(ii,jj,k+1) = S(ii,jj,k+1) + DS1
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Alexey N. Volkov, UA, avolkov1@ua.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module TPMGeom !************************************************************************************
|
||||
!
|
||||
@ -39,20 +39,20 @@ implicit none
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Global variables
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
! Coordinates of the whole domain
|
||||
real(c_double) :: DomXmin, DomXmax, DomYmin, DomYmax, DomZmin, DomZmax
|
||||
real(c_double) :: DomLX, DomLY, DomLZ
|
||||
real(c_double) :: DomLXhalf, DomLYhalf, DomLZhalf
|
||||
|
||||
! Boundary conditions
|
||||
|
||||
! Boundary conditions
|
||||
integer(c_int) :: BC_X = 0
|
||||
integer(c_int) :: BC_Y = 0
|
||||
integer(c_int) :: BC_Z = 0
|
||||
|
||||
! Skin parameter in NBL and related algorithms
|
||||
real(c_double) :: Rskin = 1.0d+00
|
||||
|
||||
|
||||
contains !******************************************************************************************
|
||||
|
||||
subroutine ApplyPeriodicBC ( R ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
@ -111,12 +111,12 @@ contains !**********************************************************************
|
||||
! cosA, cosine of the angle between lines.
|
||||
! D1, D2, displacements.
|
||||
! L12, unit vector directed along the closest distance.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(inout) :: H, cosA, D1, D2
|
||||
real(c_double), dimension(0:2), intent(out) :: L12
|
||||
real(c_double), dimension(0:2), intent(in) :: R1, L1, R2, L2
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(in) :: Prec
|
||||
real(c_double), intent(in) :: Prec
|
||||
real(c_double), dimension(0:2) :: Q1, Q2, R
|
||||
real(c_double) :: C, DD1, DD2, C1, C2
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -151,5 +151,5 @@ contains !**********************************************************************
|
||||
L12 = L12 / H
|
||||
end if
|
||||
end function LineLine !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
end module TPMGeom !********************************************************************************
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Alexey N. Volkov, UA, avolkov1@ua.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module TPMLib !*************************************************************************************
|
||||
!
|
||||
@ -61,7 +61,7 @@ contains !**********************************************************************
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Simple mathematical functions
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
real(c_double) function rad ( X ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(in) :: X
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -76,7 +76,7 @@ contains !**********************************************************************
|
||||
|
||||
integer(c_int) function signum ( X ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(in) :: X
|
||||
!-------------------------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------------------------
|
||||
if ( X > 0 ) then
|
||||
signum = 1
|
||||
else if ( X < 0 ) then
|
||||
@ -111,7 +111,7 @@ contains !**********************************************************************
|
||||
subroutine V3_ort ( V ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), dimension(0:2), intent(inout) :: V
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double) :: Vabs
|
||||
real(c_double) :: Vabs
|
||||
!-------------------------------------------------------------------------------------------
|
||||
Vabs = S_V3norm3 ( V )
|
||||
V(0) = V(0) / Vabs
|
||||
@ -131,7 +131,7 @@ contains !**********************************************************************
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Handling of spherical and Euler angles
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
subroutine RotationMatrix3 ( M, Psi, Tet, Phi ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! Ksi, Tet and Phi are Euler angles
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -156,7 +156,7 @@ contains !**********************************************************************
|
||||
M(2,1) = - sT * cK
|
||||
M(2,2) = cT
|
||||
end subroutine RotationMatrix3 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine EulerAngles ( Psi, Tet, L ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(out) :: Tet, Psi
|
||||
real(c_double), dimension(0:2), intent(in) :: L
|
||||
@ -165,7 +165,7 @@ contains !**********************************************************************
|
||||
Psi = atan2 ( L(1), L(0) )
|
||||
if ( Psi > M_3PI_2 ) then
|
||||
Psi = Psi - M_3PI_2
|
||||
else
|
||||
else
|
||||
Psi = Psi + M_PI_2
|
||||
end if
|
||||
end subroutine EulerAngles !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
@ -211,5 +211,5 @@ contains !**********************************************************************
|
||||
close ( unit = Fuid )
|
||||
Fuid = -1
|
||||
end subroutine CloseFile !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
end module TPMLib !*********************************************************************************
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Alexey N. Volkov, UA, avolkov1@ua.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module TPMM0 !**************************************************************************************
|
||||
!
|
||||
@ -32,7 +32,7 @@ use iso_c_binding, only : c_int, c_double, c_char
|
||||
implicit none
|
||||
|
||||
contains !******************************************************************************************
|
||||
|
||||
|
||||
integer(c_int) function TPMInteractionFSS ( Q, U, F1_1, F1_2, F2_1, F2_2, R1_1, R1_2, R2_1, R2_2, EType )
|
||||
real(c_double), intent(inout) :: Q, U
|
||||
real(c_double), dimension(0:2), intent(inout) :: F1_1, F1_2, F2_1, F2_2
|
||||
@ -48,9 +48,9 @@ contains !**********************************************************************
|
||||
L2 = S_V3norm3 ( Laxis2 )
|
||||
Laxis2 = Laxis2 / L2
|
||||
if ( EType < 2 ) then
|
||||
TPMInteractionFSS = TPMInteractionF ( Q, U, F1_1, F1_2, F2_1, F2_2, Fd, R1_1, R1_2, R2_1, R2_2, 1 )
|
||||
TPMInteractionFSS = TPMInteractionF ( Q, U, F1_1, F1_2, F2_1, F2_2, Fd, R1_1, R1_2, R2_1, R2_2, 1 )
|
||||
R2_3 = R2_2 + R2_2 - R2_1
|
||||
IntSign = TPMInteractionF ( Qa, Ua, F1_1a, F1_2a, F2_1a, F2_2a, Fd, R1_1, R1_2, R2_2, R2_3, 1 )
|
||||
IntSign = TPMInteractionF ( Qa, Ua, F1_1a, F1_2a, F2_1a, F2_2a, Fd, R1_1, R1_2, R2_2, R2_3, 1 )
|
||||
if ( IntSign > 0 ) then
|
||||
TPMInteractionFSS = 1
|
||||
call TPMSegmentForces ( F2_1a, F2_2a, F1_1a, F1_2a, R1_1, R1_2, R2, Laxis2, L2 )
|
||||
@ -59,7 +59,7 @@ contains !**********************************************************************
|
||||
F2_1a = F2_1a - F
|
||||
end if
|
||||
else
|
||||
TPMInteractionFSS = TPMInteractionF ( Q, U, F1_1, F1_2, F2_1, F2_2, Fd, R1_1, R1_2, R2_1, R2_2, 2 )
|
||||
TPMInteractionFSS = TPMInteractionF ( Q, U, F1_1, F1_2, F2_1, F2_2, Fd, R1_1, R1_2, R2_1, R2_2, 2 )
|
||||
R2_3 = R2_1 + R2_1 - R2_2
|
||||
IntSign = TPMInteractionF ( Qa, Ua, F1_1a, F1_2a, F2_1a, F2_2a, Fd, R1_1, R1_2, R2_1, R2_3, 1 )
|
||||
if ( IntSign > 0 ) then
|
||||
@ -74,13 +74,13 @@ contains !**********************************************************************
|
||||
Q = Q - Qa
|
||||
if ( Q < 0.0d+00 ) Q = 0.0d+00
|
||||
U = U - Ua
|
||||
F2_1 = F2_1 - F2_1a
|
||||
F2_2 = F2_2 - F2_2a
|
||||
F2_1 = F2_1 - F2_1a
|
||||
F2_2 = F2_2 - F2_2a
|
||||
F1_1 = F1_1 - F1_1a
|
||||
F1_2 = F1_2 - F1_2a
|
||||
end if
|
||||
end function TPMInteractionFSS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function TPMInteractionFW0 ( QQ, U, U1, U2, UU, F1, F2, F, G1, G2, R1, R2, N, NMAX, R )
|
||||
real(c_double), intent(inout) :: U, U1, U2
|
||||
integer(c_int), intent(in) :: N, NMAX
|
||||
@ -142,7 +142,7 @@ contains !**********************************************************************
|
||||
if ( D < Dmina ) Dmina = D
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
DR = R1 - R(0:2,i+1)
|
||||
call ApplyPeriodicBC ( DR )
|
||||
Dminb = sqr ( DR(0) ) + sqr ( DR(1) ) + sqr ( DR(2) )
|
||||
@ -165,20 +165,20 @@ contains !**********************************************************************
|
||||
if ( D < Dminb ) Dminb = D
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
if ( Dmina < Dminb ) then
|
||||
EType = 1
|
||||
else
|
||||
EType = 2
|
||||
end if
|
||||
|
||||
if ( TPMInteractionFSS ( QQ(i), Ua, F1_1a, F1_2a, F2_1a, F2_2a, R1, R2, R(0:2,i), R(0:2,i+1), &
|
||||
|
||||
if ( TPMInteractionFSS ( QQ(i), Ua, F1_1a, F1_2a, F2_1a, F2_2a, R1, R2, R(0:2,i), R(0:2,i+1), &
|
||||
EType ) > 0 ) then
|
||||
TPMInteractionFW0 = 1
|
||||
U = U + Ua
|
||||
Ua = 0.25d+00 * Ua
|
||||
U1 = U1 + Ua
|
||||
U2 = U2 + Ua
|
||||
Ua = 0.25d+00 * Ua
|
||||
U1 = U1 + Ua
|
||||
U2 = U2 + Ua
|
||||
UU(i) = UU(i) + Ua
|
||||
UU(i+1) = UU(i+1) + Ua
|
||||
F1 = F1 + F1_1a
|
||||
@ -190,5 +190,5 @@ contains !**********************************************************************
|
||||
end if
|
||||
end do
|
||||
end function TPMInteractionFW0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
end module TPMM0 !**********************************************************************************
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Alexey N. Volkov, UA, avolkov1@ua.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module TPMM1 !**************************************************************************************
|
||||
!
|
||||
@ -56,9 +56,9 @@ implicit none
|
||||
real(c_double), dimension(0:TPM_MAX_CHAIN-1) :: W, C
|
||||
real(c_double), dimension(0:2) :: RR, E10
|
||||
real(c_double) :: L10, D10
|
||||
|
||||
|
||||
contains !******************************************************************************************
|
||||
|
||||
|
||||
subroutine PairWeight1 ( W, E1_1, E1_2, E2_1, E2_2, R2_1, R2_2 ) !!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(out) :: W
|
||||
real(c_double), dimension(0:2), intent(out) :: E1_1, E1_2, E2_1, E2_2
|
||||
@ -78,7 +78,7 @@ contains !**********************************************************************
|
||||
E2_2 = 0.0d+00
|
||||
return
|
||||
end if
|
||||
E20 = 0.5d+00 * ( R2_2 - R2_1 )
|
||||
E20 = 0.5d+00 * ( R2_2 - R2_1 )
|
||||
L20 = sqrt ( S_V3xx ( E20 ) + sqr ( TPMR2 ) )
|
||||
D20 = L10 + L20 + TPBRcutoff + RSkin
|
||||
if ( D > D20 * D20 ) then
|
||||
@ -96,12 +96,12 @@ contains !**********************************************************************
|
||||
t = ( D - D10 ) / D20
|
||||
W = 1.0d+00 - t * t * ( 3.0d+00 - 2.0d+00 * t )
|
||||
dWdD = 3.0d+00 * t * ( t - 1.0d+00 ) / D20
|
||||
E1_1 = dWdD * ( t * E10 - E )
|
||||
E1_2 = dWdD * ( - t * E10 - E )
|
||||
E2_1 = dWdD * ( E + t * E20 )
|
||||
E2_2 = dWdD * ( E - t * E20 )
|
||||
E1_1 = dWdD * ( t * E10 - E )
|
||||
E1_2 = dWdD * ( - t * E10 - E )
|
||||
E2_1 = dWdD * ( E + t * E20 )
|
||||
E2_2 = dWdD * ( E - t * E20 )
|
||||
end subroutine PairWeight1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function EndWeight1 ( W, E1_1, E1_2, E2_1, E2_2, R1_1, R1_2, R2_1, R2_2 ) !!!
|
||||
real(c_double), intent(out) :: W
|
||||
real(c_double), dimension(0:2), intent(out) :: E1_1, E1_2, E2_1, E2_2
|
||||
@ -114,7 +114,7 @@ contains !**********************************************************************
|
||||
E = 0.5d+00 * ( R2_1 + R2_2 - ( R1_1 + R1_2 ) )
|
||||
call ApplyPeriodicBC ( E )
|
||||
D = S_V3norm3 ( E )
|
||||
E20 = 0.5d+00 * ( R2_2 - R2_1 )
|
||||
E20 = 0.5d+00 * ( R2_2 - R2_1 )
|
||||
L20 = sqrt ( S_V3xx ( E20 ) + sqr ( TPMR2 ) )
|
||||
D1 = L10 + L20 + TPBRcutoff + RSkin
|
||||
if ( D < D1 ) then
|
||||
@ -126,7 +126,7 @@ contains !**********************************************************************
|
||||
E2_2 = 0.0d+00
|
||||
return
|
||||
end if
|
||||
D2 = D1 + TPMC3
|
||||
D2 = D1 + TPMC3
|
||||
if ( D > D2 ) then
|
||||
EndWeight1 = 2
|
||||
W = 0.0d+00
|
||||
@ -142,13 +142,13 @@ contains !**********************************************************************
|
||||
t = ( D - D1 ) / TPMC3
|
||||
W = 1.0d+00 - t * t * ( 3.0d+00 - 2.0d+00 * t )
|
||||
dWdD = 3.0d+00 * t * ( t - 1.0d+00 ) / TPMC3
|
||||
E1_1 = dWdD * ( E10 - E )
|
||||
E1_2 = dWdD * ( - E10 - E )
|
||||
E2_1 = dWdD * ( E + E20 )
|
||||
E2_2 = dWdD * ( E - E20 )
|
||||
E1_1 = dWdD * ( E10 - E )
|
||||
E1_2 = dWdD * ( - E10 - E )
|
||||
E2_1 = dWdD * ( E + E20 )
|
||||
E2_2 = dWdD * ( E - E20 )
|
||||
end function EndWeight1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
integer(c_int) function TPMInteractionFC1 ( Q, U, F1, F2, P1, P2, Pe, Pe1, R1, R2, Q1, Q2, Qe, Qe1, EType )
|
||||
integer(c_int) function TPMInteractionFC1 ( Q, U, F1, F2, P1, P2, Pe, Pe1, R1, R2, Q1, Q2, Qe, Qe1, EType )
|
||||
real(c_double), intent(out) :: Q, U
|
||||
real(c_double), dimension(0:2), intent(out) :: F1, F2, P1, P2, Pe, Pe1
|
||||
real(c_double), dimension(0:2), intent(in) :: R1, R2, Q1, Q2, Qe, Qe1
|
||||
@ -196,11 +196,11 @@ contains !**********************************************************************
|
||||
end if
|
||||
call TPMSegmentForces ( P1a, P2a, F1a, F2a, R1, R2, QX, M, L )
|
||||
end if
|
||||
|
||||
|
||||
if ( CaseID > 0 ) then
|
||||
IntSignb = TPMInteractionF ( Qb, Ub, F1b, F2b, P1b, P2b, Peeb, R1, R2, Q1, Q2, 0 )
|
||||
end if
|
||||
|
||||
|
||||
if ( CaseID == 0 ) then
|
||||
TPMInteractionFC1 = IntSigna
|
||||
Q = Qa
|
||||
@ -226,7 +226,7 @@ contains !**********************************************************************
|
||||
TPMInteractionFC1 = 0
|
||||
if ( IntSigna > 0 .or. IntSignb > 0 ) TPMInteractionFC1 = 1
|
||||
W1 = 1.0d+00 - W
|
||||
DU = Ub - Ua
|
||||
DU = Ub - Ua
|
||||
Q = W * Qa + W1 * Qb
|
||||
U = W * Ua + W1 * Ub
|
||||
Pe = ( W * Peea / D ) * Me
|
||||
@ -240,7 +240,7 @@ contains !**********************************************************************
|
||||
end if
|
||||
end if
|
||||
end function TPMInteractionFC1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function TPMInteractionFW1 ( QQ, U, U1, U2, UU, F1, F2, F, Fe, G1, G2, R1, R2, N, NMAX, R, Re, EType )
|
||||
real(c_double), intent(out) :: U, U1, U2
|
||||
integer(c_int), intent(in) :: N, NMAX, EType
|
||||
@ -251,7 +251,7 @@ contains !**********************************************************************
|
||||
real(c_double), dimension(0:2,0:NMAX-1), intent(in) :: R
|
||||
!-------------------------------------------------------------------------------------------
|
||||
integer(c_int) :: i, j
|
||||
real(c_double) :: Q, WW, DD
|
||||
real(c_double) :: Q, WW, DD
|
||||
!-------------------------------------------------------------------------------------------
|
||||
Q1 = 0.0d+00
|
||||
Q2 = 0.0d+00
|
||||
@ -259,7 +259,7 @@ contains !**********************************************************************
|
||||
Z1 = 0.0d+00
|
||||
Z2 = 0.0d+00
|
||||
TPMInteractionFW1 = 0
|
||||
E10 = 0.5d+00 * ( R2 - R1 )
|
||||
E10 = 0.5d+00 * ( R2 - R1 )
|
||||
L10 = sqrt ( S_V3xx ( E10 ) + sqr ( TPMR1 ) )
|
||||
D10 = TPMR1 + TPMR2 + TPMC123 * TPBRcutoff + RSkin
|
||||
E10 = E10 / L10
|
||||
@ -293,10 +293,10 @@ contains !**********************************************************************
|
||||
Qe = 0.0d+00
|
||||
Qe1 = 0.0d+00
|
||||
end if
|
||||
|
||||
TPMInteractionFW1 = TPMInteractionFC1 ( Q, U, F1, F2, S1, S2, Pe, Pe1, R1, R2, Q1, Q2, Qe, Qe1, EType )
|
||||
|
||||
TPMInteractionFW1 = TPMInteractionFC1 ( Q, U, F1, F2, S1, S2, Pe, Pe1, R1, R2, Q1, Q2, Qe, Qe1, EType )
|
||||
if ( TPMInteractionFW1 == 0 ) return
|
||||
|
||||
|
||||
W(0:N-2) = W(0:N-2) / WW
|
||||
E1(0:2,0:N-2) = E1(0:2,0:N-2) / WW
|
||||
E2(0:2,0:N-2) = E2(0:2,0:N-2) / WW
|
||||
@ -322,7 +322,7 @@ contains !**********************************************************************
|
||||
do j = 0, N - 2
|
||||
if ( j == 0 ) then
|
||||
DR = EE1(0:2,0) * ( 1.0d+00 - W(0) )
|
||||
else
|
||||
else
|
||||
DR = - W(j) * EE1(0:2,0)
|
||||
end if
|
||||
F(0:2,0) = F(0:2,0) + C(j) * DR
|
||||
@ -337,8 +337,8 @@ contains !**********************************************************************
|
||||
else if ( j == i - 1 ) then
|
||||
G1(0:2,i) = G1(0:2,i) + C(j) * ( EE2(0:2,j) - W(j) * EE2(0:2,i-1) )
|
||||
G2(0:2,i) = G2(0:2,i) - C(j) * W(j) * EE1(0:2,i)
|
||||
else
|
||||
G1(0:2,i) = G1(0:2,i) - C(j) * W(j) * EE2(0:2,i-1)
|
||||
else
|
||||
G1(0:2,i) = G1(0:2,i) - C(j) * W(j) * EE2(0:2,i-1)
|
||||
G2(0:2,i) = G2(0:2,i) - C(j) * W(j) * EE1(0:2,i)
|
||||
end if
|
||||
end do
|
||||
@ -348,7 +348,7 @@ contains !**********************************************************************
|
||||
do j = 0, N - 2
|
||||
if ( j == N - 2 ) then
|
||||
DR = EE2(0:2,N-2) * ( 1.0d+00 - W(N-2) )
|
||||
else
|
||||
else
|
||||
DR = - W(j) * EE2(0:2,N-2)
|
||||
end if
|
||||
F(0:2,N-1) = F(0:2,N-1) + C(j) * DR
|
||||
@ -368,5 +368,5 @@ contains !**********************************************************************
|
||||
G1(0:2,N-1) = F(0:2,N-1)
|
||||
G2(0:2,0) = F(0:2,0)
|
||||
end function TPMInteractionFW1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
end module TPMM1 !**********************************************************************************
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Alexey N. Volkov, UA, avolkov1@ua.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module TubePotBase !********************************************************************************
|
||||
!
|
||||
@ -25,10 +25,10 @@ module TubePotBase !************************************************************
|
||||
!
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
!
|
||||
! This module contains basic parameters for all modules involved into calculations of tubular
|
||||
! This module contains basic parameters for all modules involved into calculations of tubular
|
||||
! potentials.
|
||||
!
|
||||
! It includes definitions of
|
||||
!
|
||||
! It includes definitions of
|
||||
! -- TPBU, Lennard-Jones (12-6) potential
|
||||
! -- TPBQ, Transfer function
|
||||
!
|
||||
@ -43,7 +43,7 @@ implicit none
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Constants
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
! Types of the potential with respect to the breathing mode
|
||||
integer(c_int), parameter :: TP_POT_MONO_R = 0
|
||||
integer(c_int), parameter :: TP_POT_POLY_R = 1
|
||||
@ -56,7 +56,7 @@ implicit none
|
||||
|
||||
! Mass of C atom
|
||||
real(c_double), parameter :: TPBMc = 12.0107d+00 ! (Da)
|
||||
|
||||
|
||||
! Parameters of the Van der Waals interaction between carbon atoms in graphene sheets, see
|
||||
! Stuart S.J., Tutein A.B., Harrison J.A., J. Chem. Phys. 112(14), 2000
|
||||
real(c_double), parameter :: TPBEcc = 0.00284d+00 ! (eV)
|
||||
@ -66,73 +66,73 @@ implicit none
|
||||
! Dresselhaus et al, Carbon 33(7), 1995
|
||||
real(c_double), parameter :: TPBAcc = 1.421d+00 ! (A)
|
||||
real(c_double), parameter :: TPBDcc = 4.0d+00 / ( TPBConstD * TPBAcc * TPBAcc ) ! (1/A^2)
|
||||
|
||||
|
||||
! Specific heat of carbon nanotubes
|
||||
real(c_double), parameter :: TPBSHcc = 600.0d+00 / K_MDCU ! (eV/(Da*K))
|
||||
|
||||
|
||||
! Cutoff distances for the interactomic potential and transfer function.
|
||||
! Changes in these parameters can result in necessity to change some numerical parameters too.
|
||||
real(c_double), parameter :: TPBRmincc = 0.001d+00 * TPBScc ! (A)
|
||||
real(c_double), parameter :: TPBRcutoffcc = 3.0d+00 * TPBScc ! (A)
|
||||
real(c_double), parameter :: TPBRcutoff1cc = 2.16d+00 * TPBScc ! (A)
|
||||
|
||||
|
||||
! Parameters of the transfer function for non-bonded interaction between carbon atoms
|
||||
real(c_double), parameter :: TPBQScc = 7.0d+00 ! (A)
|
||||
real(c_double), parameter :: TPBQRcutoff1cc = 8.0d+00 ! (A)
|
||||
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Global variables
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
! Set to .true. to generate diagnostic and warning messages
|
||||
logical :: TPErrCheck = .true.
|
||||
character*512 :: TPErrMsg = ''
|
||||
|
||||
real(c_double) :: TPGeomPrec = 1.0d-06 ! Geometric precision, see TPInt
|
||||
logical :: TPErrCheck = .true.
|
||||
character*512 :: TPErrMsg = ''
|
||||
|
||||
real(c_double) :: TPGeomPrec = 1.0d-06 ! Geometric precision, see TPInt
|
||||
integer(c_int) :: TPPotType = TP_POT_MONO_R ! Type of the potential with respect to the breathing mode
|
||||
|
||||
|
||||
! Parameters of the interatomic potential and atoms distribution at the surface
|
||||
! of the tube
|
||||
|
||||
|
||||
real(c_double) :: TPBM = TPBMc ! Mass of an atom (Da)
|
||||
real(c_double) :: TPBE = TPBEcc ! Depth of the energy well in (12-6) LJ interatomic potential (eV)
|
||||
real(c_double) :: TPBS = TPBScc ! Sigma parameter of (12-6) LJ interatomic potential (A)
|
||||
real(c_double) :: TPBD = TPBDcc ! Numerical density of atoms at the tube surface (1/A^2)
|
||||
real(c_double) :: TPBSH = TPBSHcc ! Specific heat (eV/(Da*K))
|
||||
|
||||
|
||||
real(c_double) :: TPBRmin = TPBRmincc ! (A)
|
||||
real(c_double) :: TPBRcutoff = TPBRcutoffcc ! (A)
|
||||
real(c_double) :: TPBRcutoff1 = TPBRcutoff1cc ! (A)
|
||||
|
||||
! Parameters of the transfer function
|
||||
|
||||
|
||||
real(c_double) :: TPBQS = TPBQScc ! Sigma parameter of the transfer function (A)
|
||||
real(c_double) :: TPBQRcutoff1 = TPBQRcutoff1cc! (A)
|
||||
|
||||
|
||||
! Auxiliary variables
|
||||
|
||||
|
||||
real(c_double) :: TPBE4, TPBE24, TPBDRcutoff, TPBQDRcutoff
|
||||
real(c_double) :: TPBQR0 ! Constant-value distance for the transfer function (A)
|
||||
|
||||
|
||||
! Table of inter-particle potential, force, and transfer function
|
||||
|
||||
|
||||
integer(c_int) :: TPBN = TPBNMAX
|
||||
real(c_double) :: TPBDR
|
||||
real(c_double), dimension(0:TPBNMAX-1) :: TPBQ
|
||||
real(c_double), dimension(0:TPBNMAX-1) :: TPBU, TPBdUdR
|
||||
|
||||
|
||||
contains !******************************************************************************************
|
||||
|
||||
integer(c_int) function TPBsizeof () !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
TPBsizeof = 8 * ( size ( TPBQ ) + size ( TPBU ) + size ( TPBdUdR ) )
|
||||
end function TPBsizeof !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Interpolation
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
real(c_double) function TPBQInt0 ( R ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(in) :: R
|
||||
real(c_double), intent(in) :: R
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double) :: Z, RR
|
||||
integer(c_int) :: i
|
||||
@ -140,7 +140,7 @@ contains !**********************************************************************
|
||||
if ( R < TPBRmin ) then
|
||||
!call PrintStdLogMsg ( TPErrMsg )
|
||||
!write ( TPErrMsg, '(a,e20.10,a,e20.10)' ) ': R < Rmin: R=', R, ', Rmin=', TPBRmin
|
||||
!call Error ( 'TPBQInt0', TPErrMsg )
|
||||
!call Error ( 'TPBQInt0', TPErrMsg )
|
||||
elseif ( R > TPBRcutoff ) then
|
||||
TPBQInt0 = 0.0d+00
|
||||
return
|
||||
@ -149,11 +149,11 @@ contains !**********************************************************************
|
||||
i = int ( RR )
|
||||
RR = RR - i
|
||||
Z = 1.0d+00 - RR
|
||||
TPBQInt0 = TPBQ(i) * Z + TPBQ(i+1) * RR
|
||||
TPBQInt0 = TPBQ(i) * Z + TPBQ(i+1) * RR
|
||||
end function TPBQInt0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
real(c_double) function TPBUInt0 ( R ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(in) :: R
|
||||
real(c_double), intent(in) :: R
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double) :: Z, RR
|
||||
integer(c_int) :: i
|
||||
@ -161,7 +161,7 @@ contains !**********************************************************************
|
||||
if ( R < TPBRmin ) then
|
||||
!call PrintStdLogMsg ( TPErrMsg )
|
||||
!write ( TPErrMsg, '(a,e20.10,a,e20.10)' ) ': R < Rmin: R=', R, ', Rmin=', TPBRmin
|
||||
!call Error ( 'TPBUInt0', TPErrMsg )
|
||||
!call Error ( 'TPBUInt0', TPErrMsg )
|
||||
elseif ( R > TPBRcutoff ) then
|
||||
TPBUInt0 = 0.0d+00
|
||||
return
|
||||
@ -170,12 +170,12 @@ contains !**********************************************************************
|
||||
i = int ( RR )
|
||||
RR = RR - i
|
||||
Z = 1.0d+00 - RR
|
||||
TPBUInt0 = TPBU(i) * Z + TPBU(i+1) * RR
|
||||
TPBUInt0 = TPBU(i) * Z + TPBU(i+1) * RR
|
||||
end function TPBUInt0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine TPBUInt1 ( U, dUdR, R ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(out) :: U, dUdR
|
||||
real(c_double), intent(in) :: R
|
||||
real(c_double), intent(in) :: R
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double) :: Z, RR
|
||||
integer(c_int) :: i
|
||||
@ -183,7 +183,7 @@ contains !**********************************************************************
|
||||
if ( R < TPBRmin ) then
|
||||
!call PrintStdLogMsg ( TPErrMsg )
|
||||
!write ( TPErrMsg, '(a,e20.10,a,e20.10)' ) ': R < Rmin: R=', R, ', Rmin=', TPBRmin
|
||||
!call Error ( 'TPBUInt1', TPErrMsg )
|
||||
!call Error ( 'TPBUInt1', TPErrMsg )
|
||||
elseif ( R > TPBRcutoff ) then
|
||||
TPBU = 0.0d+00
|
||||
TPBdUdR = 0.0d+00
|
||||
@ -193,14 +193,14 @@ contains !**********************************************************************
|
||||
i = int ( RR )
|
||||
RR = RR - i
|
||||
Z = 1.0d+00 - RR
|
||||
U = TPBU(i) * Z + TPBU(i+1) * RR
|
||||
U = TPBU(i) * Z + TPBU(i+1) * RR
|
||||
dUdR = TPBdUdR(i) * Z + TPBdUdR(i+1) * RR
|
||||
end subroutine TPBUInt1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Calculation
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
real(c_double) function TPBQCalc0 ( R ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(in) :: R
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -210,7 +210,7 @@ contains !**********************************************************************
|
||||
TPBQCalc0 = 0.0d+00
|
||||
else if ( R < TPBQR0 ) then
|
||||
TPBQCalc0 = 1.0d+00
|
||||
else
|
||||
else
|
||||
Z = TPBQS / R
|
||||
Z = Z * Z * Z
|
||||
Z = Z * Z
|
||||
@ -222,7 +222,7 @@ contains !**********************************************************************
|
||||
endif
|
||||
endif
|
||||
end function TPBQCalc0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
real(c_double) function TPBUCalc0 ( R ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(in) :: R
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -230,7 +230,7 @@ contains !**********************************************************************
|
||||
!-------------------------------------------------------------------------------------------
|
||||
if ( R > TPBRcutoff ) then
|
||||
TPBUCalc0 = 0.0d+00
|
||||
else
|
||||
else
|
||||
Z = TPBS / R
|
||||
Z = Z * Z * Z
|
||||
Z = Z * Z
|
||||
@ -251,7 +251,7 @@ contains !**********************************************************************
|
||||
if ( R > TPBRcutoff ) then
|
||||
U = 0.0d+00
|
||||
dUdR = 0.0d+00
|
||||
else
|
||||
else
|
||||
Z = TPBS / R
|
||||
Z = Z * Z * Z
|
||||
Z = Z * Z
|
||||
@ -266,7 +266,7 @@ contains !**********************************************************************
|
||||
endif
|
||||
endif
|
||||
end subroutine TPBUCalc1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine TPBSegmentForces ( F1, F2, F, M, Laxis, L ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), dimension(0:2), intent(out) :: F1, F2
|
||||
real(c_double), dimension(0:2), intent(in) :: F, M, Laxis
|
||||
@ -284,7 +284,7 @@ contains !**********************************************************************
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Initialization
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
subroutine TPBInit () !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double) :: R
|
||||
integer(c_int) :: i
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Alexey N. Volkov, UA, avolkov1@ua.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module TubePotMono !********************************************************************************
|
||||
!
|
||||
@ -27,22 +27,22 @@ module TubePotMono !************************************************************
|
||||
!
|
||||
! Four potentials and transfer functions are calculated in this module:
|
||||
!
|
||||
! 1. SSTP (segment - semi-infinite tube parallel): Linear density of the potential along
|
||||
! the segment axis which is produced by a parallel semi-infinite tube. 2D tables for this potential
|
||||
! 1. SSTP (segment - semi-infinite tube parallel): Linear density of the potential along
|
||||
! the segment axis which is produced by a parallel semi-infinite tube. 2D tables for this potential
|
||||
! are generated at initialization or can be loaded from a file.
|
||||
!
|
||||
! 2. STP (segment - tube parallel): Linear density of the potential along the segment axis
|
||||
! which is produced by a parallel infinite tubes. This is only a particular case of the SSTP potential,
|
||||
! but it is considered separately for computational efficiency. 1D tables of this potential are taken
|
||||
! 2. STP (segment - tube parallel): Linear density of the potential along the segment axis
|
||||
! which is produced by a parallel infinite tubes. This is only a particular case of the SSTP potential,
|
||||
! but it is considered separately for computational efficiency. 1D tables of this potential are taken
|
||||
! from 2D tables of SSTP potential.
|
||||
!
|
||||
! 3. SST (segment - semi-infinite tube): Potential for a segment produced by an arbitrary-
|
||||
! oriented semi-infinite tube. This potential can not be kept in 2D tables, therefore, all
|
||||
! data are calculated 'on fly' with the help of SSTP potential and numerical integration along the
|
||||
! oriented semi-infinite tube. This potential can not be kept in 2D tables, therefore, all
|
||||
! data are calculated 'on fly' with the help of SSTP potential and numerical integration along the
|
||||
! segment axis
|
||||
!
|
||||
! 4. ST (segment - tube): Potential for a segment produced by an arbitrary-oriented
|
||||
! infinitely long tube. 2D tables for this potential are generated at initialization or can be
|
||||
! 4. ST (segment - tube): Potential for a segment produced by an arbitrary-oriented
|
||||
! infinitely long tube. 2D tables for this potential are generated at initialization or can be
|
||||
! loaded from a file.
|
||||
!
|
||||
!***************************************************************************************************
|
||||
@ -62,77 +62,77 @@ implicit none
|
||||
|
||||
integer(c_int), parameter :: TPMNZMAX = 129
|
||||
integer(c_int), parameter :: TPMNEMAX = 128
|
||||
|
||||
integer(c_int), parameter :: TPMNHMAX = 1001
|
||||
integer(c_int), parameter :: TPMNXMAX = 1001
|
||||
integer(c_int), parameter :: TPMNMAX = 1001
|
||||
|
||||
|
||||
integer(c_int), parameter :: TPMNHMAX = 1001
|
||||
integer(c_int), parameter :: TPMNXMAX = 1001
|
||||
integer(c_int), parameter :: TPMNMAX = 1001
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Global variables
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
integer(c_int) :: TPMStartMode = 1
|
||||
character*512 :: TPMFile = 'MESONT-TABTP.xrs'
|
||||
character(len=512) :: TPMFile = 'MESONT-TABTP.xrs'
|
||||
integer(c_int) :: TPMUnitID ! Unit for the tabulated potential file
|
||||
|
||||
|
||||
integer(c_int) :: TPMNZ = TPMNZMAX
|
||||
integer(c_int) :: TPMNZ1 = TPMNZMAX - 1
|
||||
integer(c_int) :: TPMNE = TPMNEMAX
|
||||
integer(c_int) :: TPMNE1 = TPMNEMAX - 1
|
||||
|
||||
|
||||
integer(c_int) :: TPMNH = TPMNHMAX
|
||||
integer(c_int) :: TPMNH1 = TPMNHMAX - 1
|
||||
integer(c_int) :: TPMNX = TPMNXMAX
|
||||
integer(c_int) :: TPMNX1 = TPMNXMAX - 1
|
||||
|
||||
integer :: TPMChiIndM ! Chirality index M
|
||||
|
||||
integer :: TPMChiIndM ! Chirality index M
|
||||
integer :: TPMChiIndN ! Chirality index N
|
||||
real(c_double) :: TPMR1
|
||||
real(c_double) :: TPMR2
|
||||
|
||||
|
||||
real(c_double) :: TPMHmax
|
||||
real(c_double) :: TPMDH
|
||||
|
||||
|
||||
! Parameters of empirical correction functions
|
||||
|
||||
|
||||
integer(c_int) :: TPMAN = 20
|
||||
real(c_double) :: TPMAHmin
|
||||
real(c_double) :: TPMAHmax
|
||||
real(c_double) :: TPMADH
|
||||
real(c_double), dimension(0:TPMNHMAX-1) :: TPMAH, TPMAF, TPMAFxx
|
||||
|
||||
|
||||
! Fitting parameters that depend on the SWCNT chirality
|
||||
|
||||
real(c_double) :: TPMCaA = 0.22d+00 ! 0.22 for (10,10) CNTs
|
||||
real(c_double) :: TPMCeA = 0.35d+00 ! 0.35 for (10,10) CNTs
|
||||
real(c_double) :: TPMAHmin0 = 10.0d+00 ! 10.0 A for (10,10) CNTs
|
||||
|
||||
|
||||
! Parameters of SSTP integrator
|
||||
|
||||
|
||||
real(c_double) :: TPMDE
|
||||
real(c_double), dimension(0:TPMNEMAX-1) :: TPMCE, TPMSE
|
||||
|
||||
|
||||
! Additional parameters for SSTP potential
|
||||
|
||||
real(c_double) :: TPMSSTPDelta = 0.25d+00
|
||||
integer(c_int) :: TPMSSTPNH
|
||||
integer(c_int) :: TPMSSTPNX
|
||||
|
||||
|
||||
real(c_double) :: TPMSSTPX1
|
||||
real(c_double) :: TPMSSTPXmax
|
||||
real(c_double) :: TPMSSTPDX
|
||||
|
||||
|
||||
real(c_double), dimension(0:TPMNHMAX-1,0:TPMNXMAX-1) :: TPMSSTPG
|
||||
real(c_double), dimension(0:TPMNHMAX-1,0:TPMNXMAX-1) :: TPMSSTPF, TPMSSTPFxx, TPMSSTPFyy, TPMSSTPFxxyy
|
||||
real(c_double), dimension(0:TPMNHMAX-1) :: TPMSSTPH
|
||||
real(c_double), dimension(0:TPMNXMAX-1) :: TPMSSTPX
|
||||
|
||||
|
||||
! Additional parameters for STP potential
|
||||
|
||||
|
||||
! In calculations of this potential, some parameters of SSTP potential are also used.
|
||||
! In particular, STP potential has no its own integrator. All data comes from SSTP integrator.
|
||||
! It does not result in any computational inefficiency unless the STP potential is used without SSTP one.
|
||||
|
||||
|
||||
integer(c_int) :: TPMNN = 10
|
||||
real(c_double), dimension(0:TPMNHMAX-1) :: TPMSTPG
|
||||
real(c_double), dimension(0:TPMNHMAX-1) :: TPMSTPF, TPMSTPFxx
|
||||
@ -140,25 +140,25 @@ implicit none
|
||||
! Parameters for ST potential
|
||||
|
||||
! Minimum gap dh for ST-potential
|
||||
real(c_double) :: TPMSTDelta = 1.0d+00
|
||||
real(c_double) :: TPMSTDelta = 1.0d+00
|
||||
! Number of subdivisions for every grid step in ST-integrator
|
||||
integer(c_int) :: TPMSTNXS = 10
|
||||
integer(c_int) :: TPMSTNXS = 10
|
||||
real(c_double) :: TPMSTXmax
|
||||
real(c_double) :: TPMSTH1
|
||||
real(c_double) :: TPMSTH2
|
||||
real(c_double) :: TPMSTDH12
|
||||
|
||||
|
||||
real(c_double), dimension(0:TPMNHMAX-1,0:TPMNXMAX-1) :: TPMSTG
|
||||
real(c_double), dimension(0:TPMNHMAX-1,0:TPMNXMAX-1) :: TPMSTF, TPMSTFxx, TPMSTFyy, TPMSTFxxyy
|
||||
real(c_double), dimension(0:TPMNHMAX-1) :: TPMSTH
|
||||
real(c_double), dimension(0:TPMNXMAX-1) :: TPMSTX
|
||||
|
||||
|
||||
! Switching parameters
|
||||
|
||||
|
||||
! Height switch (at H=0 in SST-potential)
|
||||
integer(c_int) :: TPMHSwitch = 0 ! 1, use h-switch; 0, do not use the switch
|
||||
real(c_double) :: TPMHS = 3.0d+00 ! Switch height, Angstrom
|
||||
|
||||
|
||||
! Angle switch
|
||||
integer(c_int) :: TPMASwitch = 0 ! 1, use a-switch; 0, do not use the switch
|
||||
real(c_double) :: TPMAS = 3.0d+00 ! Switch angle, degree
|
||||
@ -220,7 +220,7 @@ contains !**********************************************************************
|
||||
R2Y = TPMR1 * TPMSE(j)
|
||||
R2Z = Zmin - D
|
||||
do k = 0, TPMNZ1 ! Integration over the length of the second tube
|
||||
R = sqr ( R2X - R1X ) + sqr ( R2Y - R1Y ) + sqr ( R2Z )
|
||||
R = sqr ( R2X - R1X ) + sqr ( R2Y - R1Y ) + sqr ( R2Z )
|
||||
if ( R < Rcutoff2 ) then
|
||||
R = dsqrt ( R )
|
||||
if ( k == 0 .or. k == TPMNZ1 ) then
|
||||
@ -239,7 +239,7 @@ contains !**********************************************************************
|
||||
Q = Q * C
|
||||
U = U * sqr ( TPBD ) * C
|
||||
end subroutine TPMSSTPIntegrator !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function TPMSSTPInt0 ( Q, U, H, X ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! This function returns the transfer function Q and potential U for the SSTP potential
|
||||
! calculated by interpolation in the table without switch.
|
||||
@ -253,7 +253,7 @@ contains !**********************************************************************
|
||||
i = 1 + int ( H / TPMDH )
|
||||
j = 1 + int ( ( X + TPMSSTPXMax ) / TPMSSTPDX )
|
||||
if ( ( i < TPMSSTPNH ) .and. ( j > TPMSSTPNX ) ) then
|
||||
!call PrintTPErrMsg ()
|
||||
!call PrintTPErrMsg ()
|
||||
!!call PrintStdLogMsg (TPErrMsg )
|
||||
!write ( TPErrMsg, '(a,e20.10,a,e20.10)' ) 'Tubes intersect each other: H=', H, ', X=', X
|
||||
!call Error ( 'TPMSSTPInt0', TPErrMsg )
|
||||
@ -273,7 +273,7 @@ contains !**********************************************************************
|
||||
else
|
||||
XX = X
|
||||
end if
|
||||
Q = CalcLinFun2_0 ( i, j, H, XX, TPMNH, TPMNX, TPMSSTPH, TPMSSTPX, TPMSSTPG )
|
||||
Q = CalcLinFun2_0 ( i, j, H, XX, TPMNH, TPMNX, TPMSSTPH, TPMSSTPX, TPMSSTPG )
|
||||
U = CalcSpline2_0 ( i, j, H, XX, TPMNH, TPMNX, TPMSSTPH, TPMSSTPX, TPMSSTPF, TPMSSTPFxx, TPMSSTPFyy, TPMSSTPFxxyy )
|
||||
TPMSSTPInt0 = 1
|
||||
end function TPMSSTPInt0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
@ -303,7 +303,7 @@ contains !**********************************************************************
|
||||
end if
|
||||
end if
|
||||
end function TPMSSTPInt0S !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function TPMSSTPInt1 ( Q, U, Uh, Ux, H, X ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! This function returns the transfer function Q, potential U, and derivatives Uh=dU/dH and
|
||||
! Ux=dU/dX for the SSTP potential calculated by interpolation in the table without switch
|
||||
@ -317,7 +317,7 @@ contains !**********************************************************************
|
||||
i = 1 + int ( H / TPMDH )
|
||||
j = 1 + int ( ( X + TPMSSTPXMax ) / TPMSSTPDX )
|
||||
if ( ( i < TPMSSTPNH ) .and. ( j > TPMSSTPNX ) ) then
|
||||
!call PrintTPErrMsg ()
|
||||
!call PrintTPErrMsg ()
|
||||
!!call PrintStdLogMsg ( TPErrMsg )
|
||||
!write ( TPErrMsg, '(a,e20.10,a,e20.10)' ) 'Tubes intersect each other: H=', H, ', X=', X
|
||||
!call Error ( 'TPMSSTPInt1', TPErrMsg )
|
||||
@ -339,15 +339,15 @@ contains !**********************************************************************
|
||||
else
|
||||
XX = X
|
||||
end if
|
||||
Q = CalcLinFun2_0 ( i, j, H, XX, TPMNH, TPMNX, TPMSSTPH, TPMSSTPX, TPMSSTPG )
|
||||
Q = CalcLinFun2_0 ( i, j, H, XX, TPMNH, TPMNX, TPMSSTPH, TPMSSTPX, TPMSSTPG )
|
||||
call CalcSpline2_1 ( U, Uh, Ux, i, j, H, XX, TPMNH, TPMNX, TPMSSTPH, TPMSSTPX, TPMSSTPF, &
|
||||
TPMSSTPFxx, TPMSSTPFyy, TPMSSTPFxxyy )
|
||||
TPMSSTPFxx, TPMSSTPFyy, TPMSSTPFxxyy )
|
||||
TPMSSTPInt1 = 1
|
||||
end function TPMSSTPInt1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function TPMSSTPInt1S ( Q, U, Uh, Ux, H, X ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! This function returns the transfer function Q, potential U, and derivatives Uh=dU/dH and
|
||||
! Ux=dU/dX for the SSTP potential calculated by interpolation in the table and switch to
|
||||
! Ux=dU/dX for the SSTP potential calculated by interpolation in the table and switch to
|
||||
! the case of zero H.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(out) :: Q, U, Uh, Ux
|
||||
@ -375,7 +375,7 @@ contains !**********************************************************************
|
||||
end if
|
||||
end if
|
||||
end function TPMSSTPInt1S !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine TPMSSTPWrite () !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! This function writes the table of the SSTP potential to a disk file.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -412,7 +412,7 @@ contains !**********************************************************************
|
||||
end do
|
||||
end do
|
||||
end subroutine TPMSSTPRead !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine TPMSSTPInit () !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! This function calculates the table of the SSTP potential.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -424,7 +424,7 @@ contains !**********************************************************************
|
||||
TPMDE = M_2PI / TPMNE
|
||||
E = 0.0d+00
|
||||
do i = 0, TPMNE1
|
||||
TPMCE(i) = cos ( E )
|
||||
TPMCE(i) = cos ( E )
|
||||
TPMSE(i) = sin ( E )
|
||||
E = E + TPMDE
|
||||
end do
|
||||
@ -444,7 +444,7 @@ contains !**********************************************************************
|
||||
do j = 0, TPMNX1
|
||||
if ( ( i .ge. TPMSSTPNH ) .or. ( j .le. TPMSSTPNX ) ) then
|
||||
call TPMSSTPIntegrator ( TPMSSTPG(i,j), TPMSSTPF(i,j), TPMSSTPH(i), TPMSSTPX(j) )
|
||||
print '(2i5,a,e20.10,a,e20.10,a,e20.10,a,e20.10)', i, j, ' H=', TPMSSTPH(i), &
|
||||
print '(2i5,a,e20.10,a,e20.10,a,e20.10,a,e20.10)', i, j, ' H=', TPMSSTPH(i), &
|
||||
', X=', TPMSSTPX(j), ', Q=', TPMSSTPG(i,j), ', U=', TPMSSTPF(i,j)
|
||||
end if
|
||||
end do
|
||||
@ -454,11 +454,11 @@ contains !**********************************************************************
|
||||
call TPMSSTPRead ()
|
||||
end if
|
||||
call CreateSpline2Ext ( 3, 3, 3, 3, TPMNH, TPMSSTPNH, TPMNX, TPMSSTPNX, TPMNMAX, TPMSSTPH, TPMSSTPX, &
|
||||
TPMSSTPF, TPMSSTPFxx, TPMSSTPFyy, TPMSSTPFxxyy, FF, MM, DD, K0, K1, K2 )
|
||||
TPMSSTPF, TPMSSTPFxx, TPMSSTPFyy, TPMSSTPFxxyy, FF, MM, DD, K0, K1, K2 )
|
||||
end subroutine TPMSSTPInit !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! STP potential for an infinite tube interacting with a parallel segment. No actual initialization
|
||||
! STP potential for an infinite tube interacting with a parallel segment. No actual initialization
|
||||
! is necessary for this potential, since the data are taken from the table for the SSTP potential.
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -473,7 +473,7 @@ contains !**********************************************************************
|
||||
!-------------------------------------------------------------------------------------------
|
||||
i = 1 + int ( H / TPMDH )
|
||||
if ( i < TPMSSTPNH ) then
|
||||
!call PrintTPErrMsg ()
|
||||
!call PrintTPErrMsg ()
|
||||
!!call PrintStdLogMsg ( TPErrMsg )
|
||||
!write ( TPErrMsg, '(a,e20.10)' ) 'Tubes intersect each other: H=', H
|
||||
!call Error ( 'TPMSTPInt0', TPErrMsg )
|
||||
@ -485,13 +485,13 @@ contains !**********************************************************************
|
||||
return
|
||||
end if
|
||||
if ( i == TPMNH ) i = TPMNH - 1
|
||||
Q = CalcLinFun1_0 ( i, H, TPMNH, TPMSSTPH, TPMSTPG )
|
||||
U = CalcSpline1_0 ( i, H, TPMNH, TPMSSTPH, TPMSTPF, TPMSTPFxx )
|
||||
Q = CalcLinFun1_0 ( i, H, TPMNH, TPMSSTPH, TPMSTPG )
|
||||
U = CalcSpline1_0 ( i, H, TPMNH, TPMSSTPH, TPMSTPF, TPMSTPFxx )
|
||||
TPMSTPInt0 = 1
|
||||
end function TPMSTPInt0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
integer(c_int) function TPMSTPInt1 ( Q, U, dUdH, H ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! This function returns the transfer function Q, potential U, and derivative dUdH for
|
||||
! This function returns the transfer function Q, potential U, and derivative dUdH for
|
||||
! the STP potential calculated by interpolation in the table.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(out) :: Q, U, dUdH
|
||||
@ -500,7 +500,7 @@ contains !**********************************************************************
|
||||
!-------------------------------------------------------------------------------------------
|
||||
i = 1 + int ( H / TPMDH )
|
||||
if ( i < TPMSSTPNH ) then
|
||||
!call PrintTPErrMsg ()
|
||||
!call PrintTPErrMsg ()
|
||||
!!call PrintStdLogMsg ( TPErrMsg )
|
||||
!write ( TPErrMsg, '(a,e20.10)' ) 'Tubes intersect each other: H=', H
|
||||
!call Error ( 'TPMSTPInt0', TPErrMsg )
|
||||
@ -512,11 +512,11 @@ contains !**********************************************************************
|
||||
TPMSTPInt1 = 0
|
||||
return
|
||||
end if
|
||||
Q = CalcLinFun1_0 ( i, H, TPMNH, TPMSSTPH, TPMSTPG )
|
||||
call CalcSpline1_1 ( U, dUdH, i, H, TPMNH, TPMSSTPH, TPMSTPF, TPMSTPFxx )
|
||||
Q = CalcLinFun1_0 ( i, H, TPMNH, TPMSSTPH, TPMSTPG )
|
||||
call CalcSpline1_1 ( U, dUdH, i, H, TPMNH, TPMSSTPH, TPMSTPF, TPMSTPFxx )
|
||||
TPMSTPInt1 = 1
|
||||
end function TPMSTPInt1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine TPMSTPInit () !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! This function initializes the table of the STP potential
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -524,7 +524,7 @@ contains !**********************************************************************
|
||||
TPMSTPF(0:TPMNH1) = TPMSSTPF(0:TPMNH1,TPMNX1)
|
||||
TPMSTPFxx(0:TPMNH1) = TPMSSTPFxx(0:TPMNH1,TPMNX1)
|
||||
end subroutine TPMSTPInit !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Fitting functions for the SST and ST potentials.
|
||||
! This correction functions are chosen empirically to improve accuracy of the SST and ST potentials.
|
||||
@ -567,14 +567,14 @@ contains !**********************************************************************
|
||||
X = - ( X1_2 - X1_1 ) / 2.0d+00
|
||||
do j = 0, ( TPTNXMAX - 1 ) / 2
|
||||
HH = sqrt ( TPMAH(i) * TPMAH(i) + sqr ( X * sin ( M_PI_2 ) ) )
|
||||
IntSign = TPMSTPInt0 ( Qb, Ub, HH )
|
||||
IntSign = TPMSTPInt0 ( Qb, Ub, HH )
|
||||
call TPTSetSegPosition2 ( TPTSeg1, R1_1, R1_2 )
|
||||
call TPTSetSegPosition2 ( TPTSeg2, R2_1, R2_2 )
|
||||
IntSign = TPTSectionPotential ( Qa, Ua, Fa, Ma, TPTSeg1, j, TPTSeg2 )
|
||||
IntSign = TPTSectionPotential ( Qa, Ua, Fa, Ma, TPTSeg1, j, TPTSeg2 )
|
||||
if ( j == 0 ) then
|
||||
Uamin = Ua
|
||||
Ubmin = Ub
|
||||
else
|
||||
else
|
||||
if ( Ua < Uamin ) then
|
||||
Uamin = Ua
|
||||
end if
|
||||
@ -614,7 +614,7 @@ contains !**********************************************************************
|
||||
return
|
||||
end if
|
||||
i = 1 + int ( ( H - TPMAHmin ) / TPMADH )
|
||||
TPMA0 = CalcSpline1_0 ( i, H, TPMAN, TPMAH, TPMAF, TPMAFxx )
|
||||
TPMA0 = CalcSpline1_0 ( i, H, TPMAN, TPMAH, TPMAF, TPMAFxx )
|
||||
end function TPMA0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
subroutine TPMA1 ( A, Ah, H ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
@ -646,9 +646,9 @@ contains !**********************************************************************
|
||||
i = 1 + int ( ( H - TPMAHmin ) / TPMADH )
|
||||
call CalcSpline1_1 ( A, Ah, i, H, TPMAN, TPMAH, TPMAF, TPMAFxx )
|
||||
end subroutine TPMA1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
real(c_double) function TPMCu0 ( H, cosA, sinA ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! This function returns the correction function for the magnitude of the potential.
|
||||
! This function returns the correction function for the magnitude of the potential.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(in) :: H, cosA, sinA
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -656,7 +656,7 @@ contains !**********************************************************************
|
||||
end function TPMCu0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
subroutine TPMCu1 ( Cu, CuH, CuA, H, cosA, sinA ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! The subroutine calculates the correction function Cu for the magnitude of the potential and
|
||||
! The subroutine calculates the correction function Cu for the magnitude of the potential and
|
||||
! its derivatives CuH and CuA.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(ouT) :: Cu, CuH, CuA
|
||||
@ -664,7 +664,7 @@ contains !**********************************************************************
|
||||
real(c_double) :: AA, AAh, D
|
||||
!-------------------------------------------------------------------------------------------
|
||||
call TPMA1 ( AA, AAh, H )
|
||||
D = sqr ( sinA )
|
||||
D = sqr ( sinA )
|
||||
AA = AA - 1.0d+00
|
||||
Cu = 1.0d+00 + AA * D
|
||||
CuH = AAh * D
|
||||
@ -672,7 +672,7 @@ contains !**********************************************************************
|
||||
end subroutine TPMCu1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
real(c_double) function TPMCa0 ( cosA, sinA ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! This function returns the correction function for the argument of the potential.
|
||||
! This function returns the correction function for the argument of the potential.
|
||||
! If correction is not necessary, it should return sinA.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(in) :: cosA, sinA
|
||||
@ -681,21 +681,21 @@ contains !**********************************************************************
|
||||
end function TPMCa0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
subroutine TPMCa1 ( Ca, CaA, Ka, KaA, cosA, sinA ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! This subroutine calculates the correction function Cu for the depth of the potential well
|
||||
! and its derivatives CuH and CuA. If correction is not necessary, it returns Ca = sinA
|
||||
! This subroutine calculates the correction function Cu for the depth of the potential well
|
||||
! and its derivatives CuH and CuA. If correction is not necessary, it returns Ca = sinA
|
||||
! and CaA = cosA.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(out) :: Ca, CaA, Ka, KaA
|
||||
real(c_double), intent(in) :: cosA, sinA
|
||||
!-------------------------------------------------------------------------------------------
|
||||
Ka = 1.0d+00 / ( 1.0d+00 - TPMCaA * sqr ( sinA ) )
|
||||
Ca = sinA * Ka
|
||||
Ca = sinA * Ka
|
||||
KaA = 2.0d+00 * TPMCaA * sinA * cosA * sqr ( Ka )
|
||||
CaA = cosA * Ka + sinA * KaA
|
||||
end subroutine TPMCa1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
real(c_double) function TPMCe0 ( sinA ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! This function returns the correction function for the argument of the potential.
|
||||
! This function returns the correction function for the argument of the potential.
|
||||
! If correction is not necessary, it returns sinA.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(in) :: sinA
|
||||
@ -713,19 +713,19 @@ contains !**********************************************************************
|
||||
CeA = - 2.0d+00 * TPMCeA * sinA * cosA
|
||||
Ke = TPMCeA
|
||||
end subroutine TPMCe1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! SST potential for the semi-infinite tube interacting with segment.
|
||||
! This potential does not need any initialization. All necessary data is taken from tables of the
|
||||
! SST potential for the semi-infinite tube interacting with segment.
|
||||
! This potential does not need any initialization. All necessary data is taken from tables of the
|
||||
! SSTP potential.
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
integer(c_int) function TPMSSTPotential ( Q, U, X1, X2, H, cosA, D, N ) !!!!!!!!!!!!!!!!!!!!
|
||||
! This function calculates the transfer function Q and potential U applied to a segment
|
||||
! from a semi-infinite tube based on the numerical integration (trapezoidal rule) along the segment
|
||||
! axis for non-parallel objects.
|
||||
! This function calculates the transfer function Q and potential U applied to a segment
|
||||
! from a semi-infinite tube based on the numerical integration (trapezoidal rule) along the segment
|
||||
! axis for non-parallel objects.
|
||||
! Relative position of the nanotube and segment is given by axial positions of the segment
|
||||
! ends X1 and X2, height H, cosA= cos(A), where A is the cross-axis angle, and the displacement
|
||||
! ends X1 and X2, height H, cosA= cos(A), where A is the cross-axis angle, and the displacement
|
||||
! D of a nanotube end.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(out) :: Q, U
|
||||
@ -761,7 +761,7 @@ contains !**********************************************************************
|
||||
end function TPMSSTPotential !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
integer(c_int) function TPMSSTPotentialPar ( Q, U, R1_1, Laxis1, R2_1, Laxis2, L1, N ) !!!!!
|
||||
! Potential for a segment and a semi-infinite tube is calculated by the numerical
|
||||
! Potential for a segment and a semi-infinite tube is calculated by the numerical
|
||||
! integration (trapezoidal rule) along the segment axis for parallel objects.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(out) :: Q, U
|
||||
@ -799,9 +799,9 @@ contains !**********************************************************************
|
||||
Q = Q * DX
|
||||
U = U * DX
|
||||
end function TPMSSTPotentialPar !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function TPMSSTForces ( Q, U, F1, F2, Fd, X1, X2, H, cosA, D, N ) !!!!!!!!!!!
|
||||
! Potential and forces applied to the segment from a semi-infinite tube are calculated
|
||||
! Potential and forces applied to the segment from a semi-infinite tube are calculated
|
||||
! by the numerical integration (trapezoidal rule) along the segment axis.
|
||||
! Non-parallel case.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -859,7 +859,7 @@ contains !**********************************************************************
|
||||
X = X + DX
|
||||
end do
|
||||
if ( TPMSSTForces == 0 ) return
|
||||
|
||||
|
||||
C = DX * Cu
|
||||
I0 = I0 * C
|
||||
Ih = Ih * C
|
||||
@ -868,7 +868,7 @@ contains !**********************************************************************
|
||||
Ix = Ix * C
|
||||
Ix1 = Ix1 * C
|
||||
|
||||
DX = X2 - X1
|
||||
DX = X2 - X1
|
||||
|
||||
Q = Q * C
|
||||
U = I0
|
||||
@ -877,23 +877,23 @@ contains !**********************************************************************
|
||||
|
||||
C1 = Ka * Ka * Ih1
|
||||
C = h * ( C1 + cosA * Ke * Ix ) / DX
|
||||
F1(0) = X2 * Uh - C
|
||||
F1(0) = X2 * Uh - C
|
||||
F2(0) = C - X1 * Uh
|
||||
|
||||
|
||||
C = ( cosA * sinA * C1 + ( Ke * sinA - sinA ) * Ix ) / DX
|
||||
F1(1) = Ua - X2 * C
|
||||
F1(1) = Ua - X2 * C
|
||||
F2(1) = X1 * C - Ua
|
||||
|
||||
|
||||
C1 = Ca * Ca * Ih1 + cosA * Ix
|
||||
C2 = Ca * Ca * Ih2 + cosA * Ix1
|
||||
F1(2) = ( U - X2 * C1 + C2 ) / DX
|
||||
F2(2) = ( X1 * C1 - C2 - U ) / DX
|
||||
|
||||
|
||||
Fd = Ce * Ix
|
||||
end function TPMSSTForces !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
integer(c_int) function TPMSSTForcesPar ( Q, U, F1, F2, Fd, R1_1, Laxis1, R2_1, Laxis2, L1, N )
|
||||
! Potential and forces applied to the segment from a semi-infinite tube are calculated by
|
||||
integer(c_int) function TPMSSTForcesPar ( Q, U, F1, F2, Fd, R1_1, Laxis1, R2_1, Laxis2, L1, N )
|
||||
! Potential and forces applied to the segment from a semi-infinite tube are calculated by
|
||||
! the numerical integration (trapezoidal rule) along the segment axis.
|
||||
! Parallel case
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -942,8 +942,8 @@ contains !**********************************************************************
|
||||
U = U + Us
|
||||
Fd = Fd + Usx
|
||||
end if
|
||||
F1 = F1 + Gamma * Fs
|
||||
F2 = F2 + Beta * Fs
|
||||
F1 = F1 + Gamma * Fs
|
||||
F2 = F2 + Beta * Fs
|
||||
end if
|
||||
X = X + DX
|
||||
end do
|
||||
@ -954,15 +954,15 @@ contains !**********************************************************************
|
||||
F1 = DX * F1 + Fs
|
||||
F2 = DX * F2 - Fs
|
||||
end function TPMSSTForcesPar !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! ST: Potential for a infinite tube interacting with a segment
|
||||
!--------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
!
|
||||
! These functions are used to smooth boundaries in (H,X) domain for ST potential
|
||||
!
|
||||
|
||||
|
||||
real(c_double) function TPMSTXMin0 ( H ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(in) :: H
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -979,7 +979,7 @@ contains !**********************************************************************
|
||||
TPMSTXMin0 = sqrt ( TPMSTH2 * TPMSTH2 - H * H ) &
|
||||
* ( 1.0d+00 - X * X * X * ( 3.0d+00 * X * ( 2.0d+00 * X - 5.0d+00 ) + 10.0d+00 ) )
|
||||
end function TPMSTXMin0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
real(c_double) function TPMSTXMax0 ( H ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(in) :: H
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -1005,11 +1005,11 @@ contains !**********************************************************************
|
||||
F = 1.0d+00 - X * X * X * ( 3.0d+00 * X * ( 2.0d+00 * X - 5.0d+00 ) + 10.0d+00 )
|
||||
X = X * ( X - 1.0d+00 )
|
||||
dFdX = - 30.0d+00 * X * X
|
||||
XMin = sqrt ( TPMSTH2 * TPMSTH2 - H * H )
|
||||
XMin = sqrt ( TPMSTH2 * TPMSTH2 - H * H )
|
||||
dXMindH = - H * F / XMin + XMin * dFdX / TPMSTDH12
|
||||
XMin = XMin * F
|
||||
end subroutine TPMSTXMin1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine TPMSTXMax1 ( XMax, dXMaxdH, H ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(out) :: XMax, dXMaxdH
|
||||
real(c_double), intent(in) :: H
|
||||
@ -1017,11 +1017,11 @@ contains !**********************************************************************
|
||||
XMax = sqrt ( TPMSTXMax * TPMSTXMax - H * H )
|
||||
dXMaxdH = - H / XMax
|
||||
end subroutine TPMSTXMax1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!
|
||||
! ST (segment-tube) table
|
||||
!
|
||||
|
||||
|
||||
subroutine TPMSTIntegrator ( G, F, Q, U, H, X, DX ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(inout) :: G, F, Q, U
|
||||
real(c_double), intent(in) :: H, X, DX
|
||||
@ -1036,7 +1036,7 @@ contains !**********************************************************************
|
||||
U = 0.0d+00
|
||||
HH = dsqrt ( sqr ( H ) + sqr ( X ) )
|
||||
if ( HH > TPMHmax ) return
|
||||
IntSign = TPMSTPInt0 ( Q, U, HH )
|
||||
IntSign = TPMSTPInt0 ( Q, U, HH )
|
||||
if ( IntSign == 1 ) then
|
||||
G = G + Q * DDX
|
||||
F = F + U * DDX
|
||||
@ -1059,10 +1059,10 @@ contains !**********************************************************************
|
||||
G = 0.0d+00
|
||||
F = 0.0d+00
|
||||
TPMSTInt0 = 2
|
||||
!call PrintTPErrMsg ()
|
||||
!call PrintTPErrMsg ()
|
||||
!!call PrintStdLogMsg ( TPErrMsg )
|
||||
!all Error ( 'TPMSTInt0', 'H < 0' )
|
||||
!!return
|
||||
!!return
|
||||
end if
|
||||
S = signum ( X )
|
||||
XA = dabs ( X )
|
||||
@ -1074,7 +1074,7 @@ contains !**********************************************************************
|
||||
if ( XXX < 0.0d+00 ) then
|
||||
j = 1
|
||||
XXXX = 0.0d+00
|
||||
!call PrintTPErrMsg ()
|
||||
!call PrintTPErrMsg ()
|
||||
!write ( TPErrMsg, '(a,e20.10,a,e20.10,a,e20.10)' ) 'X < XMin, X=', XA, ', XMin=', XMin, ', H=', H
|
||||
!call Error ( 'TPMSTInt0', TPErrMsg )
|
||||
else if ( XXX .ge. 1.0d+00 ) then
|
||||
@ -1084,8 +1084,8 @@ contains !**********************************************************************
|
||||
XXXX = XXX
|
||||
j = 1 + int ( XXXX * TPMNX1 )
|
||||
end if
|
||||
G = S * CalcLinFun2_0 ( i, j, H, XXXX, TPMNH, TPMNX, TPMSTH, TPMSTX, TPMSTG )
|
||||
F = S * CalcSpline2_0 ( i, j, H, XXXX, TPMNH, TPMNX, TPMSTH, TPMSTX, TPMSTF, TPMSTFxx, TPMSTFyy, TPMSTFxxyy )
|
||||
G = S * CalcLinFun2_0 ( i, j, H, XXXX, TPMNH, TPMNX, TPMSTH, TPMSTX, TPMSTG )
|
||||
F = S * CalcSpline2_0 ( i, j, H, XXXX, TPMNH, TPMNX, TPMSTH, TPMSTX, TPMSTF, TPMSTFxx, TPMSTFyy, TPMSTFxxyy )
|
||||
TPMSTInt0 = 1
|
||||
end function TPMSTInt0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
@ -1109,10 +1109,10 @@ contains !**********************************************************************
|
||||
Fh = 0.0d+00
|
||||
Fx = 0.0d+00
|
||||
TPMSTInt1 = 2
|
||||
!call PrintTPErrMsg ()
|
||||
!call PrintTPErrMsg ()
|
||||
!!call PrintStdLogMsg ( trim ( TPErrMsg ) )
|
||||
!call Error ( 'TPMSTInt1', 'H < 0' )
|
||||
!!return
|
||||
!!return
|
||||
end if
|
||||
S = signum ( X )
|
||||
XA = dabs ( X )
|
||||
@ -1126,7 +1126,7 @@ contains !**********************************************************************
|
||||
j = 1
|
||||
XXX = 0.0d+00
|
||||
XXXX = 0.0d+00
|
||||
!call PrintTPErrMsg ()
|
||||
!call PrintTPErrMsg ()
|
||||
!write ( TPErrMsg, '(a,e20.10,a,e20.10,a,e20.10)' ) 'X < XMin, X=', XA, ', XMin=', XMin, ', H=', H
|
||||
!call Error ( 'TPMSTInt', TPErrMsg )
|
||||
else if ( XXX .ge. 1.0d+00 ) then
|
||||
@ -1134,19 +1134,19 @@ contains !**********************************************************************
|
||||
XXX = 1.0d+00
|
||||
XXXX = 1.0d+00
|
||||
else
|
||||
XXXX = XXX
|
||||
XXXX = XXX
|
||||
j = 1 + int ( XXXX * TPMNX1 )
|
||||
end if
|
||||
G = S * CalcLinFun2_0 ( i, j, H, XXXX, TPMNH, TPMNX, TPMSTH, TPMSTX, TPMSTG )
|
||||
G = S * CalcLinFun2_0 ( i, j, H, XXXX, TPMNH, TPMNX, TPMSTH, TPMSTX, TPMSTG )
|
||||
call CalcSpline2_1 ( F, Fh, Fx, i, j, H, XXXX, TPMNH, TPMNX, TPMSTH, TPMSTX, &
|
||||
TPMSTF, TPMSTFxx, TPMSTFyy, TPMSTFxxyy )
|
||||
TPMSTF, TPMSTFxx, TPMSTFyy, TPMSTFxxyy )
|
||||
Fx = Fx / DX
|
||||
Fh = Fh - Fx * ( dXMaxdH * XXX + dXMindH * ( 1.0d+00 - XXX ) )
|
||||
F = F * S
|
||||
Fh = Fh * S
|
||||
TPMSTInt1 = 1
|
||||
end function TPMSTInt1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function TPMSTPotential ( Q, U, X1, X2, H, cosA, CaseID ) !!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(out) :: Q, U
|
||||
real(c_double), intent(in) :: X1, X2, H, cosA
|
||||
@ -1157,7 +1157,7 @@ contains !**********************************************************************
|
||||
if ( CaseID == MD_LINES_PAR ) then
|
||||
TPMSTPotential = TPMSTPInt0 ( Q, U, H )
|
||||
U = U * ( X2 - X1 )
|
||||
return
|
||||
return
|
||||
end if
|
||||
TPMSTPotential = 0
|
||||
sinA = dsqrt ( 1.0d+00 - cosA * cosA )
|
||||
@ -1192,12 +1192,12 @@ contains !**********************************************************************
|
||||
F2(2) = - U
|
||||
Q = Q * DX
|
||||
U = U * DX
|
||||
return
|
||||
return
|
||||
end if
|
||||
|
||||
sinA = dsqrt ( 1.0d+00 - cosA * cosA )
|
||||
call TPMCa1 ( Ca, CaA, Ka, KaA, cosA, sinA )
|
||||
IntSign1 = TPMSTInt1 ( GG1, FF1, Fh1, Fx1, H, X1 * Ca )
|
||||
IntSign1 = TPMSTInt1 ( GG1, FF1, Fh1, Fx1, H, X1 * Ca )
|
||||
IntSign2 = TPMSTInt1 ( GG2, FF2, Fh2, Fx2, H, X2 * Ca )
|
||||
if ( ( IntSign1 .ne. 1 ) .and. ( IntSign2 .ne. 1 ) ) then
|
||||
Q = 0.0d+00
|
||||
@ -1205,11 +1205,11 @@ contains !**********************************************************************
|
||||
F1 = 0.0d+00
|
||||
F2 = 0.0d+00
|
||||
TPMSTForces = 0
|
||||
return
|
||||
return
|
||||
end if
|
||||
|
||||
|
||||
call TPMCu1 ( Cu, CuH, CuA, H, cosA, sinA )
|
||||
|
||||
|
||||
Q = Cu * ( GG2 - GG1 ) / Ca
|
||||
U = Cu * ( FF2 - FF1 ) / Ca
|
||||
|
||||
@ -1218,19 +1218,19 @@ contains !**********************************************************************
|
||||
D = CuH * U / Cu + Cu * ( Fh2 - Fh1 ) / Ca
|
||||
F1(0) = ( X2 * D - C ) / DX
|
||||
F2(0) = ( C - X1 * D ) / DX
|
||||
|
||||
|
||||
C = cosA * B
|
||||
D = ( CuA / Cu - CaA / Ca ) * U + CaA * Cu * ( X2 * Fx2 - X1 * Fx1 ) / Ca
|
||||
F1(1) = ( D - X2 * C ) / DX
|
||||
F2(1) = ( X1 * C - D ) / DX
|
||||
|
||||
|
||||
F1(2) = Cu * Fx1
|
||||
F2(2) = - Cu * Fx2
|
||||
|
||||
|
||||
TPMSTForces = 1
|
||||
end function TPMSTForces !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
integer(c_int) function TPMSTForceTorque( Qi, Ui, Fi, Ti, Q, U, F, T, Psi, PsiA, Cap, L, H, cosA, CaseID )
|
||||
integer(c_int) function TPMSTForceTorque( Qi, Ui, Fi, Ti, Q, U, F, T, Psi, PsiA, Cap, L, H, cosA, CaseID )
|
||||
real(c_double), intent(out) :: Qi, Ui, Fi, Ti, Q, U, F, T, Psi, PsiA, Cap
|
||||
real(c_double), intent(in) :: L, H, cosA
|
||||
integer(c_int), intent(in) :: CaseID
|
||||
@ -1254,14 +1254,14 @@ contains !**********************************************************************
|
||||
Psi = 0.0d+00
|
||||
PsiA = 0.0d+00
|
||||
Cap = 0.0d+00
|
||||
return
|
||||
return
|
||||
end if
|
||||
|
||||
|
||||
L2 = 0.5d+00 * L
|
||||
sinA = dsqrt ( 1.0d+00 - cosA * cosA )
|
||||
call TPMCa1 ( Ca, CaA, Ka, KaA, cosA, sinA )
|
||||
IntSign = TPMSTInt1 ( GG, FF, Fh, Fx, H, L2 * Ca )
|
||||
IntSign = TPMSTInt1 ( GGi, FFi, Fhi, Fxi, H, TPMSTXmax )
|
||||
IntSign = TPMSTInt1 ( GG, FF, Fh, Fx, H, L2 * Ca )
|
||||
IntSign = TPMSTInt1 ( GGi, FFi, Fhi, Fxi, H, TPMSTXmax )
|
||||
if ( IntSign .ne. 1 ) then
|
||||
Qi = 0.0d+00
|
||||
Ui = 0.0d+00
|
||||
@ -1275,11 +1275,11 @@ contains !**********************************************************************
|
||||
PsiA = 0.0d+00
|
||||
Cap = 0.0d+00
|
||||
TPMSTForceTorque = 0
|
||||
return
|
||||
return
|
||||
end if
|
||||
|
||||
|
||||
call TPMCu1 ( Cu, CuH, CuA, H, cosA, sinA )
|
||||
|
||||
|
||||
Psi = Cu / Ca
|
||||
PsiA = ( CuA * Ca - Cu * CaA ) / Ca / Ca
|
||||
Cap = CuA / Cu - KaA / Ka - cosA / sinA
|
||||
@ -1287,16 +1287,16 @@ contains !**********************************************************************
|
||||
Ui = 2.0d+00 * Psi * FFi
|
||||
Fi = - 2.0d+00 * ( CuH * FFi / Ca + Psi * Fhi )
|
||||
Ti = - Cap * Ui
|
||||
|
||||
|
||||
Q = 2.0d+00 * Cu * GG / Ca
|
||||
U = 2.0d+00 * Cu * FF / Ca
|
||||
F = - 2.0d+00 * ( CuH * FF / Ca + Psi * Fh )
|
||||
T = - 2.0d+00 * ( ( CuA * Ka - Cu * KaA ) / ( Ka * Ka * sinA ) - Cu * cosA / ( Ka * sinA * sinA ) ) * FF &
|
||||
- 2.0d+00 * Cu / ( Ka * sinA ) * Fx * L2 * ( KaA * sinA + Ka * cosA )
|
||||
|
||||
|
||||
TPMSTForceTorque = 1
|
||||
end function TPMSTForceTorque !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine TPMSTInit () !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double) :: X, Q, U, DX, DDX, XMin, XMax
|
||||
integer(c_int) :: i, j, k
|
||||
@ -1307,7 +1307,7 @@ contains !**********************************************************************
|
||||
TPMSTDH12 = TPMSTH2 - TPMSTH1
|
||||
TPMSTXmax = TPMHMax + TPMSTDelta
|
||||
DX = 1.0 / TPMNX1
|
||||
do j = 0, TPMNX1
|
||||
do j = 0, TPMNX1
|
||||
TPMSTX(j) = DX * j
|
||||
end do
|
||||
do i = 0, TPMNH1
|
||||
@ -1323,7 +1323,7 @@ contains !**********************************************************************
|
||||
TPMSTF(i,0) = 0.0d+00
|
||||
TPMSTFyy(i,0) = U
|
||||
TPMSTFyy(i,TPMNX1) = 0.0d+00
|
||||
do j = 1, TPMNX1
|
||||
do j = 1, TPMNX1
|
||||
TPMSTG(i,j) = TPMSTG(i,j-1)
|
||||
TPMSTF(i,j) = TPMSTF(i,j-1)
|
||||
do k = 0, TPMSTNXS - 1
|
||||
@ -1334,18 +1334,18 @@ contains !**********************************************************************
|
||||
end do
|
||||
end do
|
||||
call CreateSpline2 ( 3, 3, 3, 3, TPMNH, TPMNX, TPMNMAX, TPMSTH, TPMSTX, TPMSTF, TPMSTFxx, &
|
||||
TPMSTFyy, TPMSTFxxyy, FF, MM, DD, K0, K1, K2 )
|
||||
TPMSTFyy, TPMSTFxxyy, FF, MM, DD, K0, K1, K2 )
|
||||
end subroutine TPMSTInit !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Interaction functions: They can be used for calculation of the potential and forces between a
|
||||
! Interaction functions: They can be used for calculation of the potential and forces between a
|
||||
! segment and an infinite or semi-infinite nanotube.
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
subroutine TPMSegmentForces ( F2_1, F2_2, F1_1, F1_2, R1_1, R1_2, R2, Laxis2, L2 ) !!!!!!!!!
|
||||
real(c_double), dimension(0:2), intent(out) :: F2_1, F2_2
|
||||
real(c_double), dimension(0:2), intent(in) :: F1_1, F1_2, R1_1, R1_2, R2, Laxis2
|
||||
real(c_double), intent(in) :: L2
|
||||
real(c_double), intent(in) :: L2
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), dimension(0:2) :: F, M, RR
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -1389,11 +1389,11 @@ contains !**********************************************************************
|
||||
L2 = S_V3norm3 ( Laxis2 )
|
||||
Laxis1 = Laxis1 / L1
|
||||
Laxis2 = Laxis2 / L2
|
||||
L1 = 0.5d+00 * L1
|
||||
L1 = 0.5d+00 * L1
|
||||
L2 = 0.5d+00 * L2
|
||||
if ( SType2 == 2 ) Laxis2 = - Laxis2
|
||||
GeomID = LineLine ( H, cosA, D1, D2, L12, R1, Laxis1, R2, Laxis2, TPGeomPrec )
|
||||
|
||||
|
||||
! Angle switch
|
||||
if ( TPMASwitch == 0 ) then
|
||||
if ( GeomID == MD_LINES_PAR ) then
|
||||
@ -1414,7 +1414,7 @@ contains !**********************************************************************
|
||||
SwitchID = 1
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
if ( SwitchID < 2 ) then
|
||||
D2 = D2 - L2
|
||||
if ( SType2 == 0 ) then
|
||||
@ -1429,14 +1429,14 @@ contains !**********************************************************************
|
||||
Ly = Ly * S
|
||||
if ( IntSigna > 0 ) then
|
||||
F1_1a = F1(0) * L12 + F1(1) * Ly + F1(2) * Laxis1
|
||||
F1_2a = F2(0) * L12 + F2(1) * Ly + F2(2) * Laxis1
|
||||
F1_2a = F2(0) * L12 + F2(1) * Ly + F2(2) * Laxis1
|
||||
else
|
||||
F1_1a = 0.0d+00
|
||||
F1_2a = 0.0d+00
|
||||
end if
|
||||
end if
|
||||
|
||||
if ( SwitchID > 0 ) then
|
||||
|
||||
if ( SwitchID > 0 ) then
|
||||
if ( SType2 == 0 ) then
|
||||
call LinePoint ( H, L12, R2, Laxis2, R1 )
|
||||
L12 = L12 - R1
|
||||
@ -1451,7 +1451,7 @@ contains !**********************************************************************
|
||||
else
|
||||
L12 = L12 / H
|
||||
F1_1b = F1(0) * L12 + F1(2) * Laxis1
|
||||
F1_2b = F2(0) * L12 + F2(2) * Laxis1
|
||||
F1_2b = F2(0) * L12 + F2(2) * Laxis1
|
||||
end if
|
||||
else
|
||||
F1_1b = 0.0d+00
|
||||
@ -1480,7 +1480,7 @@ contains !**********************************************************************
|
||||
F1_2 = F1_2b
|
||||
Fd = Fdb
|
||||
TPMInteractionF = IntSignb
|
||||
else
|
||||
else
|
||||
W1 = 1.0d+00 - W
|
||||
Q = W * Qa + W1 * Qb
|
||||
U = W * Ua + W1 * Ub
|
||||
@ -1490,7 +1490,7 @@ contains !**********************************************************************
|
||||
Fd = W * Fda + W1 * Fdb
|
||||
TPMInteractionF = 0
|
||||
if ( IntSigna > 0 .or. IntSignb > 0 ) TPMInteractionF = 1
|
||||
end if
|
||||
end if
|
||||
|
||||
! Calculation of forces for the complimentary tube
|
||||
if ( SType2 == 2 ) Laxis2 = - Laxis2
|
||||
@ -1510,7 +1510,7 @@ contains !**********************************************************************
|
||||
F2_1 = F2_1 - DR
|
||||
end if
|
||||
end function TPMInteractionF !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function TPMInteractionU ( Q, U, R1_1, R1_2, R2_1, R2_2, SType2 ) !!!!!!!!!!!
|
||||
real(c_double), intent(inout) :: Q, U
|
||||
real(c_double), dimension(0:2), intent(in) :: R1_1, R1_2, R2_1, R2_2
|
||||
@ -1560,7 +1560,7 @@ contains !**********************************************************************
|
||||
IntSigna = TPMSSTPotential ( Qa, Ua, D1 - L1, D1 + L1, H, cosA, D2 - L2, TPMNN )
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
if ( SwitchID > 0 ) then
|
||||
if ( Stype2 == 0 ) then
|
||||
call LinePoint ( H, L12, R2, Laxis2, R1 )
|
||||
@ -1573,7 +1573,7 @@ contains !**********************************************************************
|
||||
IntSignb = TPMSSTPotentialPar ( Qb, Ub, R1_1, Laxis1, R2_2, Laxis2, 2.0d+00 * L1, TPMNN )
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
if ( SwitchID == 0 ) then
|
||||
Q = Qa
|
||||
U = Ua
|
||||
@ -1612,14 +1612,14 @@ contains !**********************************************************************
|
||||
D2 = 2.0d+00 * Delta
|
||||
do i = 0, 2
|
||||
DD = - Delta
|
||||
do j = 0 , 1
|
||||
RR = R1_1
|
||||
do j = 0 , 1
|
||||
RR = R1_1
|
||||
RR(i) = RR(i) + DD
|
||||
IntSign = TPMInteractionU ( QQ, U1_1(j,i), RR, R1_2, R2_1, R2_2, SType2 )
|
||||
RR = R1_2
|
||||
RR = R1_2
|
||||
RR(i) = RR(i) + DD
|
||||
IntSign = TPMInteractionU ( QQ, U1_2(j,i), R1_1, RR, R2_1, R2_2, SType2 )
|
||||
RR = R2_1
|
||||
RR = R2_1
|
||||
RR(i) = RR(i) + DD;
|
||||
IntSign = TPMInteractionU ( QQ, U2_1(j,i), R1_1, R1_2, RR, R2_2, SType2 )
|
||||
RR = R2_2
|
||||
@ -1635,7 +1635,7 @@ contains !**********************************************************************
|
||||
F2_2(i) = ( U2_2(0,i) - U2_2(1,i) ) / D2
|
||||
end do
|
||||
end function TPMInteractionFNum !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Initialization
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
@ -1643,10 +1643,10 @@ contains !**********************************************************************
|
||||
subroutine TPMInit ( ChiIndM, ChiIndN ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
integer(c_int), intent(in) :: ChiIndM, ChiIndN
|
||||
real(c_double) :: RT, DX
|
||||
character*512 :: PDate
|
||||
character(len=512) :: PDate
|
||||
!-------------------------------------------------------------------------------------------
|
||||
TPPotType = TP_POT_MONO_R
|
||||
|
||||
|
||||
! Here we calculate the radius of nanotubes
|
||||
RT = TPBAcc * sqrt ( 3.0d+00 * ( ChiIndM * ChiIndM + ChiIndN * ChiIndN + ChiIndM * ChiIndN ) ) / M_2PI
|
||||
|
||||
@ -1661,7 +1661,7 @@ contains !**********************************************************************
|
||||
|
||||
TPMHmax = TPMR1 + TPMR2 + TPBRcutoff
|
||||
TPMDH = TPMHmax / TPMNH1
|
||||
|
||||
|
||||
! Parameters of the angle switch
|
||||
TPMASMin = sqr ( cos ( rad ( TPMAS ) ) )
|
||||
TPMASMax = 1.0d+00 - TPGeomPrec
|
||||
@ -1669,30 +1669,29 @@ contains !**********************************************************************
|
||||
|
||||
if ( TPMStartMode == 1 ) then
|
||||
TPMUnitID = OpenFile ( TPMFile, 'rt', '' )
|
||||
read ( unit = TPMUnitID, fmt = '()' )
|
||||
read ( unit = TPMUnitID, fmt = '()' )
|
||||
read ( unit = TPMUnitID, fmt = '()' )
|
||||
read ( unit = TPMUnitID, fmt = '()' )
|
||||
read ( unit = TPMUnitID, fmt = '()' )
|
||||
read ( unit = TPMUnitID, fmt = '()' )
|
||||
else
|
||||
TPMUnitID = OpenFile ( TPMFile, 'wt', '' )
|
||||
call fdate( PDate )
|
||||
write ( unit = TPMUnitID, fmt = '(a,a)' ) 'DATE ', PDate
|
||||
write ( unit = TPMUnitID, fmt = '(a,a)' ) 'DATE (unknown)'
|
||||
write ( unit = TPMUnitID, fmt = '(a,i3,a,i3,a)' ) &
|
||||
'Tabulated data of the tubular potential for (', ChiIndM, ',', ChiIndN, ') CNTs'
|
||||
write ( unit = TPMUnitID, fmt = '(a)' ) &
|
||||
'A. N. Volkov, L. V. Zhigilei, J. Phys. Chem. C 114, 5513-5531, 2010. doi: 10.1021/jp906142h'
|
||||
end if
|
||||
|
||||
|
||||
call TPMSSTPInit ()
|
||||
|
||||
|
||||
call TPMSTPInit ()
|
||||
|
||||
|
||||
DX = TPMR1 + TPMR2 + TPBRcutoff
|
||||
call TPMAInit ( - DX, DX, - DX, DX )
|
||||
|
||||
call TPMAInit ( - DX, DX, - DX, DX )
|
||||
|
||||
call TPMSTInit ()
|
||||
|
||||
call CloseFile ( TPMUnitID )
|
||||
|
||||
|
||||
end subroutine TPMInit !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
end module TubePotMono !****************************************************************************
|
||||
|
||||
@ -9,9 +9,9 @@
|
||||
! the GNU General Public License.
|
||||
!
|
||||
! See the README file in the top-level LAMMPS directory.
|
||||
!
|
||||
!
|
||||
! Contributing author: Alexey N. Volkov, UA, avolkov1@ua.edu
|
||||
!-------------------------------------------------------------------------
|
||||
!-------------------------------------------------------------------------
|
||||
|
||||
module TubePotTrue !********************************************************************************
|
||||
!
|
||||
@ -25,8 +25,8 @@ module TubePotTrue !************************************************************
|
||||
!
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
!
|
||||
! This module implements calculation of the true potential and transfer functions for interaction
|
||||
! between two cylinder segments of nanotubes by direct integration over the surfaces of both
|
||||
! This module implements calculation of the true potential and transfer functions for interaction
|
||||
! between two cylinder segments of nanotubes by direct integration over the surfaces of both
|
||||
! segments.
|
||||
!
|
||||
!***************************************************************************************************
|
||||
@ -55,15 +55,15 @@ implicit none
|
||||
integer(c_int) :: NX, NE ! Number of nodes for numerical integration
|
||||
real(c_double) :: DX, DE ! Spacings
|
||||
real(c_double), dimension(0:2,0:2) :: M ! Transformation matrix
|
||||
real(c_double), dimension(0:TPTNXMAX-1,0:TPTNXMAX-1,0:2) :: Rtab! Node coordinates
|
||||
real(c_double), dimension(0:TPTNXMAX-1,0:TPTNXMAX-1,0:2) :: Rtab! Node coordinates
|
||||
end type TPTSEG !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Global variables
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
type(TPTSEG) :: TPTSeg1, TPTSeg2 ! Two segments
|
||||
|
||||
|
||||
contains !******************************************************************************************
|
||||
|
||||
subroutine TPTSegAxisVector ( S, Laxis ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
@ -96,11 +96,11 @@ contains !**********************************************************************
|
||||
!-------------------------------------------------------------------------------------------
|
||||
call TPTSegAxisVector ( S, Laxis )
|
||||
call TPTSegRadVector ( S, Lrad, Eps )
|
||||
R(0) = S%X + X * Laxis(0) + S%R * Lrad(0)
|
||||
R(0) = S%X + X * Laxis(0) + S%R * Lrad(0)
|
||||
R(1) = S%Y + X * Laxis(1) + S%R * Lrad(1)
|
||||
R(2) = S%Z + X * Laxis(2) + S%R * Lrad(2)
|
||||
end subroutine TPTRadiusVector !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine TPTCalcSegNodeTable ( S ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
type(TPTSEG), intent(inout) :: S
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -111,7 +111,7 @@ contains !**********************************************************************
|
||||
call RotationMatrix3 ( S%M, S%Psi, S%Theta, S%Phi )
|
||||
do i = 0, S%NX - 1
|
||||
Eps = 0.0d+00
|
||||
do j = 0, S%NE - 1
|
||||
do j = 0, S%NE - 1
|
||||
call TPTRadiusVector ( S, S%Rtab(i,j,0:2), X, Eps )
|
||||
Eps = Eps + S%DE
|
||||
end do
|
||||
@ -133,12 +133,12 @@ contains !**********************************************************************
|
||||
S%Z = Rcenter(2)
|
||||
call TPTCalcSegNodeTable ( S )
|
||||
end subroutine TPTSetSegPosition1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
subroutine TPTSetSegPosition2 ( S, R1, R2 ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
type(TPTSEG), intent(inout) :: S
|
||||
real(c_double), dimension(0:2), intent(in) :: R1, R2
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), dimension(0:2) :: R, Laxis
|
||||
real(c_double), dimension(0:2) :: R, Laxis
|
||||
real(c_double) :: L
|
||||
!-------------------------------------------------------------------------------------------
|
||||
R = 0.5 * ( R1 + R2 )
|
||||
@ -147,7 +147,7 @@ contains !**********************************************************************
|
||||
Laxis = Laxis / L
|
||||
call TPTSetSegPosition1 ( S, R, Laxis, L )
|
||||
end subroutine TPTSetSegPosition2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function TPTCheckIntersection ( S1, S2 ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
type(TPTSEG), intent(in) :: S1, S2
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -193,7 +193,7 @@ contains !**********************************************************************
|
||||
Xmin = 0.0d+00
|
||||
Xmax = 0.0d+00
|
||||
TPTCalcPointRange = 0
|
||||
return
|
||||
return
|
||||
end if
|
||||
Distance = sqrt ( TPBRcutoff * TPBRcutoff - Distance * Distance )
|
||||
Xmin = Displacement - Distance
|
||||
@ -218,13 +218,13 @@ contains !**********************************************************************
|
||||
R2_2(1) = - X2_2 * sin ( A )
|
||||
R2_2(2) = X2_2 * cos ( A )
|
||||
end subroutine TPTGetEnds !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Tubular potential
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
integer(c_int) function TPTPointPotential ( Q, U, F, R, S ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
! This function returns the potential U and force F applied to an atom in position R and
|
||||
! This function returns the potential U and force F applied to an atom in position R and
|
||||
! produced by the segment S.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(out) :: Q, U
|
||||
@ -243,7 +243,7 @@ contains !**********************************************************************
|
||||
F = 0.0d+00
|
||||
if ( TPTCalcPointRange ( S, Xmin, Xmax, R ) == 0 ) return
|
||||
X = - S%L / 2.0
|
||||
do i = 0, S%NX - 1
|
||||
do i = 0, S%NX - 1
|
||||
if ( X > Xmin .and. X < Xmax ) then
|
||||
QQ = 0.0d+00
|
||||
UU = 0.0d+00
|
||||
@ -264,7 +264,7 @@ contains !**********************************************************************
|
||||
Q = Q + 0.5d+00 * QQ
|
||||
U = U + 0.5d+00 * UU
|
||||
F = F + 0.5d+00 * FF
|
||||
else
|
||||
else
|
||||
Q = Q + QQ
|
||||
U = U + UU
|
||||
F = F + FF
|
||||
@ -279,7 +279,7 @@ contains !**********************************************************************
|
||||
end function TPTPointPotential !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
integer(c_int) function TPTSectionPotential ( Q, U, F, M, S, i, Ssource ) !!!!!!!!!!!!!!!!!!
|
||||
! This function returns the potential U, force F and torque M produced by the segment Ssource
|
||||
! This function returns the potential U, force F and torque M produced by the segment Ssource
|
||||
! and applied to the i-th circular cross-section of the segment S.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(out) :: Q, U
|
||||
@ -290,7 +290,7 @@ contains !**********************************************************************
|
||||
integer(c_int) :: j
|
||||
real(c_double), dimension(0:2) :: R, Fp, Mp, Lrad
|
||||
real(c_double) :: Qp, Up, Eps
|
||||
real(c_double) :: Coeff
|
||||
real(c_double) :: Coeff
|
||||
!-------------------------------------------------------------------------------------------
|
||||
TPTSectionPotential = 0
|
||||
Q = 0.0d+00
|
||||
@ -321,7 +321,7 @@ contains !**********************************************************************
|
||||
end function TPTSectionPotential !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
integer(c_int) function TPTSegmentPotential ( Q, U, F, M, S, Ssource ) !!!!!!!!!!!!!!!!!!!!!!
|
||||
! This function returns the potential U, force F and torque M produced by the segment
|
||||
! This function returns the potential U, force F and torque M produced by the segment
|
||||
! Ssource and applied to the segment S.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
real(c_double), intent(out) :: Q, U
|
||||
@ -340,7 +340,7 @@ contains !**********************************************************************
|
||||
TPTSegmentPotential = 2
|
||||
return
|
||||
end if
|
||||
do i = 0, S%NX - 1
|
||||
do i = 0, S%NX - 1
|
||||
if ( TPTSectionPotential ( Qc, Uc, Fc, Mc, S, i, Ssource ) == 1 ) then
|
||||
if ( i == 0 .or. i == S%NX - 1 ) then
|
||||
Q = Q + 0.5d+00 * Qc
|
||||
@ -355,17 +355,17 @@ contains !**********************************************************************
|
||||
end if
|
||||
TPTSegmentPotential = 1
|
||||
end if
|
||||
end do
|
||||
end do
|
||||
Q = Q * S%DX
|
||||
U = U * S%DX
|
||||
F = F * S%DX
|
||||
M = M * S%DX
|
||||
end function TPTSegmentPotential !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Forces
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
subroutine TPTSegmentForces ( F1, F2, F, M, Laxis, L ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), dimension(0:2), intent(out) :: F1, F2
|
||||
real(c_double), dimension(0:2), intent(in) :: F, M, Laxis
|
||||
@ -376,10 +376,10 @@ contains !**********************************************************************
|
||||
FF = 0.5d+00 * F
|
||||
MM = M / L
|
||||
call V3_V3xxV3 ( FFF, MM, Laxis )
|
||||
F1 = FF - FFF
|
||||
F2 = FF + FFF
|
||||
F1 = FF - FFF
|
||||
F2 = FF + FFF
|
||||
end subroutine TPTSegmentForces !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
integer(c_int) function TPTInteractionF ( Q, U, F1_1, F1_2, F2_1, F2_2, R1_1, R1_2, R2_1, R2_2 )
|
||||
! This function returns the potential and forces applied to the ends of segments.
|
||||
!-------------------------------------------------------------------------------------------
|
||||
@ -413,7 +413,7 @@ contains !**********************************************************************
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
! Initialization
|
||||
!---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
subroutine TPTInit ( R1, R2, NX, NE ) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
real(c_double), intent(in) :: R1, R2
|
||||
integer(c_int), intent(in) :: NX, NE
|
||||
|
||||
@ -47,6 +47,7 @@ using namespace InterLayer;
|
||||
#define PGDELTA 1
|
||||
|
||||
static const char cite_ilp[] =
|
||||
"ilp/graphene/hbn potential doi:10.1021/acs.nanolett.8b02848\n"
|
||||
"@Article{Ouyang2018\n"
|
||||
" author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod},\n"
|
||||
" title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials},\n"
|
||||
@ -482,7 +483,7 @@ void PairILPGrapheneHBN::calc_FRep(int eflag, int /* vflag */)
|
||||
double dprodnorm1[3] = {0.0, 0.0, 0.0};
|
||||
double fp1[3] = {0.0, 0.0, 0.0};
|
||||
double fprod1[3] = {0.0, 0.0, 0.0};
|
||||
double delkj[3] = {0.0, 0.0, 0.0};
|
||||
double delki[3] = {0.0, 0.0, 0.0};
|
||||
double fk[3] = {0.0, 0.0, 0.0};
|
||||
|
||||
inum = list->inum;
|
||||
@ -588,12 +589,12 @@ void PairILPGrapheneHBN::calc_FRep(int eflag, int /* vflag */)
|
||||
f[k][0] += fk[0];
|
||||
f[k][1] += fk[1];
|
||||
f[k][2] += fk[2];
|
||||
delkj[0] = x[k][0] - x[j][0];
|
||||
delkj[1] = x[k][1] - x[j][1];
|
||||
delkj[2] = x[k][2] - x[j][2];
|
||||
delki[0] = x[k][0] - x[i][0];
|
||||
delki[1] = x[k][1] - x[i][1];
|
||||
delki[2] = x[k][2] - x[i][2];
|
||||
if (evflag)
|
||||
ev_tally_xyz(k, j, nlocal, newton_pair, 0.0, 0.0, fk[0], fk[1], fk[2], delkj[0],
|
||||
delkj[1], delkj[2]);
|
||||
ev_tally_xyz(k, i, nlocal, newton_pair, 0.0, 0.0, fk[0], fk[1], fk[2], delki[0],
|
||||
delki[1], delki[2]);
|
||||
}
|
||||
|
||||
if (eflag) pvector[1] += evdwl = Tap * Vilp;
|
||||
|
||||
@ -47,6 +47,7 @@ using namespace InterLayer;
|
||||
#define PGDELTA 1
|
||||
|
||||
static const char cite_kc[] =
|
||||
"kolmogorov/crespi/full potential doi:10.1021/acs.nanolett.8b02848\n"
|
||||
"@Article{Ouyang2018\n"
|
||||
" author = {W. Ouyang, D. Mandelli, M. Urbakh, and O. Hod},\n"
|
||||
" title = {Nanoserpents: Graphene Nanoribbon Motion on Two-Dimensional Hexagonal Materials},\n"
|
||||
@ -478,7 +479,7 @@ void PairKolmogorovCrespiFull::calc_FRep(int eflag, int /* vflag */)
|
||||
double dprodnorm1[3] = {0.0, 0.0, 0.0};
|
||||
double fp1[3] = {0.0, 0.0, 0.0};
|
||||
double fprod1[3] = {0.0, 0.0, 0.0};
|
||||
double delkj[3] = {0.0, 0.0, 0.0};
|
||||
double delki[3] = {0.0, 0.0, 0.0};
|
||||
double fk[3] = {0.0, 0.0, 0.0};
|
||||
|
||||
inum = list->inum;
|
||||
@ -585,12 +586,12 @@ void PairKolmogorovCrespiFull::calc_FRep(int eflag, int /* vflag */)
|
||||
f[k][0] += fk[0];
|
||||
f[k][1] += fk[1];
|
||||
f[k][2] += fk[2];
|
||||
delkj[0] = x[k][0] - x[j][0];
|
||||
delkj[1] = x[k][1] - x[j][1];
|
||||
delkj[2] = x[k][2] - x[j][2];
|
||||
delki[0] = x[k][0] - x[i][0];
|
||||
delki[1] = x[k][1] - x[i][1];
|
||||
delki[2] = x[k][2] - x[i][2];
|
||||
if (evflag)
|
||||
ev_tally_xyz(k, j, nlocal, newton_pair, 0.0, 0.0, fk[0], fk[1], fk[2], delkj[0],
|
||||
delkj[1], delkj[2]);
|
||||
ev_tally_xyz(k, j, nlocal, newton_pair, 0.0, 0.0, fk[0], fk[1], fk[2], delki[0],
|
||||
delki[1], delki[2]);
|
||||
}
|
||||
|
||||
if (eflag) {
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
#include "error.h"
|
||||
#include "force.h"
|
||||
#include "memory.h"
|
||||
#include "neighbor.h"
|
||||
#include "neigh_list.h"
|
||||
#include "potential_file_reader.h"
|
||||
#include "tokenizer.h"
|
||||
@ -158,7 +159,18 @@ void PairKolmogorovCrespiZ::compute(int eflag, int vflag)
|
||||
if (eflag) { evdwl = -p.A * p.z06 / r6 + exp1 * sumCff - offset[itype][jtype]; }
|
||||
|
||||
if (evflag) {
|
||||
ev_tally_xyz(i, j, nlocal, newton_pair, evdwl, 0, fsum, fsum, fpair, delx, dely, delz);
|
||||
ev_tally(i, j, nlocal, newton_pair, evdwl, 0.0, fpair, delx, dely, delz);
|
||||
if (vflag_either) {
|
||||
double fi[3],fj[3];
|
||||
fi[0] = delx * fpair1;
|
||||
fi[1] = dely * fpair1;
|
||||
fi[2] = 0;
|
||||
fj[0] = -delx * fpair1;
|
||||
fj[1] = -dely * fpair1;
|
||||
fj[2] = 0;
|
||||
v_tally2_newton(i,fi,x[i]);
|
||||
v_tally2_newton(j,fj,x[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -228,6 +240,18 @@ void PairKolmogorovCrespiZ::coeff(int narg, char **arg)
|
||||
if (count == 0) error->all(FLERR, "Incorrect args for pair coefficients");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
init specific to this pair style
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairKolmogorovCrespiZ::init_style()
|
||||
{
|
||||
if (force->newton_pair == 0)
|
||||
error->all(FLERR,"Pair style kolmogorov/crespi/z requires newton pair on");
|
||||
|
||||
neighbor->request(this,instance_me);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
init for one type pair i,j and corresponding j,i
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -32,6 +32,7 @@ class PairKolmogorovCrespiZ : public Pair {
|
||||
virtual void compute(int, int);
|
||||
void settings(int, char **);
|
||||
void coeff(int, char **);
|
||||
void init_style();
|
||||
double init_one(int, int);
|
||||
|
||||
static constexpr int NPARAMS_PER_LINE = 11;
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
#include "error.h"
|
||||
#include "force.h"
|
||||
#include "memory.h"
|
||||
#include "neighbor.h"
|
||||
#include "neigh_list.h"
|
||||
#include "potential_file_reader.h"
|
||||
#include "tokenizer.h"
|
||||
@ -137,16 +138,16 @@ void PairLebedevaZ::compute(int eflag, int vflag)
|
||||
// derivatives
|
||||
fpair = -6.0*p.A*p.z06/r8+p.B*p.alpha*exp1/r; // used for x,y,z
|
||||
der = p.D1+2*p.D2*rhosq-p.lambda1*sumD; // used for x,y
|
||||
fxy = fpair - 2*p.C*exp2*exp3*der;
|
||||
fz = fpair + 2*p.C*p.lambda2*sumD*exp2*exp3;
|
||||
fxy = 2*p.C*exp2*exp3*der;
|
||||
fz = 2*p.C*p.lambda2*sumD*exp2*exp3;
|
||||
|
||||
f[i][0] += delx*fxy;
|
||||
f[i][1] += dely*fxy;
|
||||
f[i][2] += delz*fz;
|
||||
f[i][0] += delx*(fpair-fxy);
|
||||
f[i][1] += dely*(fpair-fxy);
|
||||
f[i][2] += delz*(fpair+fz);
|
||||
if (newton_pair || j < nlocal) {
|
||||
f[j][0] -= delx*fxy;
|
||||
f[j][1] -= dely*fxy;
|
||||
f[j][2] -= delz*fz;
|
||||
f[j][0] -= delx*(fpair-fxy);
|
||||
f[j][1] -= dely*(fpair-fxy);
|
||||
f[j][2] -= delz*(fpair+fz);
|
||||
}
|
||||
|
||||
if (eflag) {
|
||||
@ -154,8 +155,18 @@ void PairLebedevaZ::compute(int eflag, int vflag)
|
||||
}
|
||||
|
||||
if (evflag) {
|
||||
ev_tally_xyz(i,j,nlocal,newton_pair,evdwl,0,
|
||||
-fxy,-fxy,-fz,delx,dely,delz);
|
||||
ev_tally(i, j, nlocal, newton_pair, evdwl, 0.0, fpair, delx, dely, delz);
|
||||
if (vflag_either) {
|
||||
double fi[3],fj[3];
|
||||
fi[0] = -delx * fxy;
|
||||
fi[1] = -dely * fxy;
|
||||
fi[2] = delz * fz;
|
||||
fj[0] = delx * fxy;
|
||||
fj[1] = dely * fxy;
|
||||
fj[2] = -delz * fz;
|
||||
v_tally2_newton(i,fi,x[i]);
|
||||
v_tally2_newton(j,fj,x[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -226,6 +237,18 @@ void PairLebedevaZ::coeff(int narg, char **arg)
|
||||
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
init specific to this pair style
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairLebedevaZ::init_style()
|
||||
{
|
||||
if (force->newton_pair == 0)
|
||||
error->all(FLERR,"Pair style lebedeva/z requires newton pair on");
|
||||
|
||||
neighbor->request(this,instance_me);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
init for one type pair i,j and corresponding j,i
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -32,6 +32,7 @@ class PairLebedevaZ : public Pair {
|
||||
virtual void compute(int, int);
|
||||
void settings(int, char **);
|
||||
void coeff(int, char **);
|
||||
void init_style();
|
||||
double init_one(int, int);
|
||||
|
||||
static constexpr int NPARAMS_PER_LINE = 12;
|
||||
|
||||
@ -44,7 +44,8 @@ struct TagPairSNAPComputeForce{};
|
||||
struct TagPairSNAPComputeNeigh{};
|
||||
struct TagPairSNAPComputeCayleyKlein{};
|
||||
struct TagPairSNAPPreUi{};
|
||||
struct TagPairSNAPComputeUi{};
|
||||
struct TagPairSNAPComputeUiSmall{}; // more parallelism, more divergence
|
||||
struct TagPairSNAPComputeUiLarge{}; // less parallelism, no divergence
|
||||
struct TagPairSNAPTransformUi{}; // re-order ulisttot from SoA to AoSoA, zero ylist
|
||||
struct TagPairSNAPComputeZi{};
|
||||
struct TagPairSNAPBeta{};
|
||||
@ -53,7 +54,9 @@ struct TagPairSNAPTransformBi{}; // re-order blist from AoSoA to AoS
|
||||
struct TagPairSNAPComputeYi{};
|
||||
struct TagPairSNAPComputeYiWithZlist{};
|
||||
template<int dir>
|
||||
struct TagPairSNAPComputeFusedDeidrj{};
|
||||
struct TagPairSNAPComputeFusedDeidrjSmall{}; // more parallelism, more divergence
|
||||
template<int dir>
|
||||
struct TagPairSNAPComputeFusedDeidrjLarge{}; // less parallelism, no divergence
|
||||
|
||||
// CPU backend only
|
||||
struct TagPairSNAPComputeNeighCPU{};
|
||||
@ -143,7 +146,10 @@ public:
|
||||
void operator() (TagPairSNAPPreUi,const int iatom_mod, const int j, const int iatom_div) const;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator() (TagPairSNAPComputeUi,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAPComputeUi>::member_type& team) const;
|
||||
void operator() (TagPairSNAPComputeUiSmall,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAPComputeUiSmall>::member_type& team) const;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator() (TagPairSNAPComputeUiLarge,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAPComputeUiLarge>::member_type& team) const;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator() (TagPairSNAPTransformUi,const int iatom_mod, const int j, const int iatom_div) const;
|
||||
@ -168,7 +174,11 @@ public:
|
||||
|
||||
template<int dir>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator() (TagPairSNAPComputeFusedDeidrj<dir>,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAPComputeFusedDeidrj<dir> >::member_type& team) const;
|
||||
void operator() (TagPairSNAPComputeFusedDeidrjSmall<dir>,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAPComputeFusedDeidrjSmall<dir> >::member_type& team) const;
|
||||
|
||||
template<int dir>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator() (TagPairSNAPComputeFusedDeidrjLarge<dir>,const typename Kokkos::TeamPolicy<DeviceType, TagPairSNAPComputeFusedDeidrjLarge<dir> >::member_type& team) const;
|
||||
|
||||
// CPU backend only
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
|
||||
@ -341,18 +341,32 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::compute(int eflag_in,
|
||||
// ComputeUi w/vector parallelism, shared memory, direct atomicAdd into ulisttot
|
||||
{
|
||||
// team_size_compute_ui is defined in `pair_snap_kokkos.h`
|
||||
|
||||
// scratch size: 32 atoms * (twojmax+1) cached values, no double buffer
|
||||
const int tile_size = vector_length * (twojmax + 1);
|
||||
const int scratch_size = scratch_size_helper<complex>(team_size_compute_ui * tile_size);
|
||||
|
||||
// total number of teams needed: (natoms / 32) * (max_neighs) * ("bend" locations)
|
||||
const int n_teams = chunk_size_div * max_neighs * (twojmax + 1);
|
||||
const int n_teams_div = (n_teams + team_size_compute_ui - 1) / team_size_compute_ui;
|
||||
if (chunk_size < parallel_thresh)
|
||||
{
|
||||
// Version with parallelism over j_bend
|
||||
|
||||
SnapAoSoATeamPolicy<DeviceType, team_size_compute_ui, TagPairSNAPComputeUi> policy_ui(n_teams_div, team_size_compute_ui, vector_length);
|
||||
policy_ui = policy_ui.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
|
||||
Kokkos::parallel_for("ComputeUi",policy_ui,*this);
|
||||
// total number of teams needed: (natoms / 32) * (max_neighs) * ("bend" locations)
|
||||
const int n_teams = chunk_size_div * max_neighs * (twojmax + 1);
|
||||
const int n_teams_div = (n_teams + team_size_compute_ui - 1) / team_size_compute_ui;
|
||||
|
||||
SnapAoSoATeamPolicy<DeviceType, team_size_compute_ui, TagPairSNAPComputeUiSmall> policy_ui(n_teams_div, team_size_compute_ui, vector_length);
|
||||
policy_ui = policy_ui.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
|
||||
Kokkos::parallel_for("ComputeUiSmall",policy_ui,*this);
|
||||
} else {
|
||||
// Version w/out parallelism over j_bend
|
||||
|
||||
// total number of teams needed: (natoms / 32) * (max_neighs)
|
||||
const int n_teams = chunk_size_div * max_neighs;
|
||||
const int n_teams_div = (n_teams + team_size_compute_ui - 1) / team_size_compute_ui;
|
||||
|
||||
SnapAoSoATeamPolicy<DeviceType, team_size_compute_ui, TagPairSNAPComputeUiLarge> policy_ui(n_teams_div, team_size_compute_ui, vector_length);
|
||||
policy_ui = policy_ui.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
|
||||
Kokkos::parallel_for("ComputeUiLarge",policy_ui,*this);
|
||||
}
|
||||
}
|
||||
|
||||
//TransformUi: un-"fold" ulisttot, zero ylist
|
||||
@ -412,25 +426,51 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::compute(int eflag_in,
|
||||
const int tile_size = vector_length * (twojmax + 1);
|
||||
const int scratch_size = scratch_size_helper<complex>(2 * team_size_compute_fused_deidrj * tile_size);
|
||||
|
||||
// total number of teams needed: (natoms / 32) * (max_neighs) * ("bend" locations)
|
||||
const int n_teams = chunk_size_div * max_neighs * (twojmax + 1);
|
||||
const int n_teams_div = (n_teams + team_size_compute_fused_deidrj - 1) / team_size_compute_fused_deidrj;
|
||||
if (chunk_size < parallel_thresh)
|
||||
{
|
||||
// Version with parallelism over j_bend
|
||||
|
||||
// x direction
|
||||
SnapAoSoATeamPolicy<DeviceType, team_size_compute_fused_deidrj, TagPairSNAPComputeFusedDeidrj<0> > policy_fused_deidrj_x(n_teams_div,team_size_compute_fused_deidrj,vector_length);
|
||||
policy_fused_deidrj_x = policy_fused_deidrj_x.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
|
||||
Kokkos::parallel_for("ComputeFusedDeidrj<0>",policy_fused_deidrj_x,*this);
|
||||
// total number of teams needed: (natoms / 32) * (max_neighs) * ("bend" locations)
|
||||
const int n_teams = chunk_size_div * max_neighs * (twojmax + 1);
|
||||
const int n_teams_div = (n_teams + team_size_compute_fused_deidrj - 1) / team_size_compute_fused_deidrj;
|
||||
|
||||
// y direction
|
||||
SnapAoSoATeamPolicy<DeviceType, team_size_compute_fused_deidrj, TagPairSNAPComputeFusedDeidrj<1> > policy_fused_deidrj_y(n_teams_div,team_size_compute_fused_deidrj,vector_length);
|
||||
policy_fused_deidrj_y = policy_fused_deidrj_y.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
|
||||
Kokkos::parallel_for("ComputeFusedDeidrj<1>",policy_fused_deidrj_y,*this);
|
||||
// x direction
|
||||
SnapAoSoATeamPolicy<DeviceType, team_size_compute_fused_deidrj, TagPairSNAPComputeFusedDeidrjSmall<0> > policy_fused_deidrj_x(n_teams_div,team_size_compute_fused_deidrj,vector_length);
|
||||
policy_fused_deidrj_x = policy_fused_deidrj_x.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
|
||||
Kokkos::parallel_for("ComputeFusedDeidrjSmall<0>",policy_fused_deidrj_x,*this);
|
||||
|
||||
// z direction
|
||||
SnapAoSoATeamPolicy<DeviceType, team_size_compute_fused_deidrj, TagPairSNAPComputeFusedDeidrj<2> > policy_fused_deidrj_z(n_teams_div,team_size_compute_fused_deidrj,vector_length);
|
||||
policy_fused_deidrj_z = policy_fused_deidrj_z.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
|
||||
Kokkos::parallel_for("ComputeFusedDeidrj<2>",policy_fused_deidrj_z,*this);
|
||||
// y direction
|
||||
SnapAoSoATeamPolicy<DeviceType, team_size_compute_fused_deidrj, TagPairSNAPComputeFusedDeidrjSmall<1> > policy_fused_deidrj_y(n_teams_div,team_size_compute_fused_deidrj,vector_length);
|
||||
policy_fused_deidrj_y = policy_fused_deidrj_y.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
|
||||
Kokkos::parallel_for("ComputeFusedDeidrjSmall<1>",policy_fused_deidrj_y,*this);
|
||||
|
||||
// z direction
|
||||
SnapAoSoATeamPolicy<DeviceType, team_size_compute_fused_deidrj, TagPairSNAPComputeFusedDeidrjSmall<2> > policy_fused_deidrj_z(n_teams_div,team_size_compute_fused_deidrj,vector_length);
|
||||
policy_fused_deidrj_z = policy_fused_deidrj_z.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
|
||||
Kokkos::parallel_for("ComputeFusedDeidrjSmall<2>",policy_fused_deidrj_z,*this);
|
||||
} else {
|
||||
// Version w/out parallelism over j_bend
|
||||
|
||||
// total number of teams needed: (natoms / 32) * (max_neighs)
|
||||
const int n_teams = chunk_size_div * max_neighs;
|
||||
const int n_teams_div = (n_teams + team_size_compute_fused_deidrj - 1) / team_size_compute_fused_deidrj;
|
||||
|
||||
// x direction
|
||||
SnapAoSoATeamPolicy<DeviceType, team_size_compute_fused_deidrj, TagPairSNAPComputeFusedDeidrjLarge<0> > policy_fused_deidrj_x(n_teams_div,team_size_compute_fused_deidrj,vector_length);
|
||||
policy_fused_deidrj_x = policy_fused_deidrj_x.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
|
||||
Kokkos::parallel_for("ComputeFusedDeidrjLarge<0>",policy_fused_deidrj_x,*this);
|
||||
|
||||
// y direction
|
||||
SnapAoSoATeamPolicy<DeviceType, team_size_compute_fused_deidrj, TagPairSNAPComputeFusedDeidrjLarge<1> > policy_fused_deidrj_y(n_teams_div,team_size_compute_fused_deidrj,vector_length);
|
||||
policy_fused_deidrj_y = policy_fused_deidrj_y.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
|
||||
Kokkos::parallel_for("ComputeFusedDeidrjLarge<1>",policy_fused_deidrj_y,*this);
|
||||
|
||||
// z direction
|
||||
SnapAoSoATeamPolicy<DeviceType, team_size_compute_fused_deidrj, TagPairSNAPComputeFusedDeidrjLarge<2> > policy_fused_deidrj_z(n_teams_div,team_size_compute_fused_deidrj,vector_length);
|
||||
policy_fused_deidrj_z = policy_fused_deidrj_z.set_scratch_size(0, Kokkos::PerTeam(scratch_size));
|
||||
Kokkos::parallel_for("ComputeFusedDeidrjLarge<2>",policy_fused_deidrj_z,*this);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // LMP_KOKKOS_GPU
|
||||
@ -603,13 +643,13 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSN
|
||||
for (int icoeff = 0; icoeff < ncoeff; icoeff++) {
|
||||
const auto idxb = icoeff % idxb_max;
|
||||
const auto idx_chem = icoeff / idxb_max;
|
||||
auto bveci = my_sna.blist(idxb, idx_chem, ii);
|
||||
real_type bveci = my_sna.blist(ii, idx_chem, idxb);
|
||||
d_beta_pack(iatom_mod,icoeff,iatom_div) += d_coeffi[k]*bveci;
|
||||
k++;
|
||||
for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) {
|
||||
const auto jdxb = jcoeff % idxb_max;
|
||||
const auto jdx_chem = jcoeff / idxb_max;
|
||||
real_type bvecj = my_sna.blist(jdxb, jdx_chem, ii);
|
||||
real_type bvecj = my_sna.blist(ii, jdx_chem, jdxb);
|
||||
d_beta_pack(iatom_mod,icoeff,iatom_div) += d_coeffi[k]*bvecj;
|
||||
d_beta_pack(iatom_mod,jcoeff,iatom_div) += d_coeffi[k]*bveci;
|
||||
k++;
|
||||
@ -736,7 +776,7 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSN
|
||||
|
||||
template<class DeviceType, typename real_type, int vector_length>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSNAPComputeUi,const typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeUi>::member_type& team) const {
|
||||
void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSNAPComputeUiSmall,const typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeUiSmall>::member_type& team) const {
|
||||
SNAKokkos<DeviceType, real_type, vector_length> my_sna = snaKK;
|
||||
|
||||
// extract flattened atom_div / neighbor number / bend location
|
||||
@ -756,11 +796,37 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSN
|
||||
const int ninside = d_ninside(ii);
|
||||
if (jj >= ninside) return;
|
||||
|
||||
my_sna.compute_ui(team,iatom_mod, jbend, jj, iatom_div);
|
||||
my_sna.compute_ui_small(team, iatom_mod, jbend, jj, iatom_div);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
template<class DeviceType, typename real_type, int vector_length>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSNAPComputeUiLarge,const typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeUiLarge>::member_type& team) const {
|
||||
SNAKokkos<DeviceType, real_type, vector_length> my_sna = snaKK;
|
||||
|
||||
// extract flattened atom_div / neighbor number / bend location
|
||||
int flattened_idx = team.team_rank() + team.league_rank() * team_size_compute_ui;
|
||||
|
||||
// extract neighbor index, iatom_div
|
||||
int iatom_div = flattened_idx / max_neighs; // removed "const" to work around GCC 7 bug
|
||||
int jj = flattened_idx - iatom_div * max_neighs;
|
||||
|
||||
Kokkos::parallel_for(Kokkos::ThreadVectorRange(team, vector_length),
|
||||
[&] (const int iatom_mod) {
|
||||
const int ii = iatom_mod + vector_length * iatom_div;
|
||||
if (ii >= chunk_size) return;
|
||||
|
||||
const int ninside = d_ninside(ii);
|
||||
if (jj >= ninside) return;
|
||||
|
||||
my_sna.compute_ui_large(team,iatom_mod, jj, iatom_div);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
template<class DeviceType, typename real_type, int vector_length>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSNAPTransformUi,const int iatom_mod, const int idxu, const int iatom_div) const {
|
||||
@ -861,9 +927,9 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSN
|
||||
|
||||
for (int itriple = 0; itriple < ntriples; itriple++) {
|
||||
|
||||
const auto blocal = my_sna.blist_pack(iatom_mod, idxb, itriple, iatom_div);
|
||||
const real_type blocal = my_sna.blist_pack(iatom_mod, idxb, itriple, iatom_div);
|
||||
|
||||
my_sna.blist(idxb, itriple, iatom) = blocal;
|
||||
my_sna.blist(iatom, itriple, idxb) = blocal;
|
||||
}
|
||||
|
||||
}
|
||||
@ -871,7 +937,7 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSN
|
||||
template<class DeviceType, typename real_type, int vector_length>
|
||||
template<int dir>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSNAPComputeFusedDeidrj<dir>,const typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeFusedDeidrj<dir> >::member_type& team) const {
|
||||
void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSNAPComputeFusedDeidrjSmall<dir>,const typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeFusedDeidrjSmall<dir> >::member_type& team) const {
|
||||
SNAKokkos<DeviceType, real_type, vector_length> my_sna = snaKK;
|
||||
|
||||
// extract flattened atom_div / neighbor number / bend location
|
||||
@ -891,12 +957,38 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSN
|
||||
const int ninside = d_ninside(ii);
|
||||
if (jj >= ninside) return;
|
||||
|
||||
my_sna.template compute_fused_deidrj<dir>(team, iatom_mod, jbend, jj, iatom_div);
|
||||
my_sna.template compute_fused_deidrj_small<dir>(team, iatom_mod, jbend, jj, iatom_div);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
template<class DeviceType, typename real_type, int vector_length>
|
||||
template<int dir>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSNAPComputeFusedDeidrjLarge<dir>,const typename Kokkos::TeamPolicy<DeviceType,TagPairSNAPComputeFusedDeidrjLarge<dir> >::member_type& team) const {
|
||||
SNAKokkos<DeviceType, real_type, vector_length> my_sna = snaKK;
|
||||
|
||||
// extract flattened atom_div / neighbor number / bend location
|
||||
int flattened_idx = team.team_rank() + team.league_rank() * team_size_compute_fused_deidrj;
|
||||
|
||||
// extract neighbor index, iatom_div
|
||||
int iatom_div = flattened_idx / max_neighs; // removed "const" to work around GCC 7 bug
|
||||
int jj = flattened_idx - max_neighs * iatom_div;
|
||||
|
||||
Kokkos::parallel_for(Kokkos::ThreadVectorRange(team, vector_length),
|
||||
[&] (const int iatom_mod) {
|
||||
const int ii = iatom_mod + vector_length * iatom_div;
|
||||
if (ii >= chunk_size) return;
|
||||
|
||||
const int ninside = d_ninside(ii);
|
||||
if (jj >= ninside) return;
|
||||
|
||||
my_sna.template compute_fused_deidrj_large<dir>(team, iatom_mod, jj, iatom_div);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Begin routines that are unique to the CPU codepath. These do not take
|
||||
advantage of AoSoA data layouts, but that could be a good point of
|
||||
@ -925,13 +1017,13 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSN
|
||||
for (int icoeff = 0; icoeff < ncoeff; icoeff++) {
|
||||
const auto idxb = icoeff % idxb_max;
|
||||
const auto idx_chem = icoeff / idxb_max;
|
||||
auto bveci = my_sna.blist(idxb,idx_chem,ii);
|
||||
real_type bveci = my_sna.blist(ii,idx_chem,idxb);
|
||||
d_beta(icoeff,ii) += d_coeffi[k]*bveci;
|
||||
k++;
|
||||
for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) {
|
||||
const auto jdxb = jcoeff % idxb_max;
|
||||
const auto jdx_chem = jcoeff / idxb_max;
|
||||
auto bvecj = my_sna.blist(jdxb,jdx_chem,ii);
|
||||
real_type bvecj = my_sna.blist(ii,jdx_chem,jdxb);
|
||||
d_beta(icoeff,ii) += d_coeffi[k]*bvecj;
|
||||
d_beta(jcoeff,ii) += d_coeffi[k]*bveci;
|
||||
k++;
|
||||
@ -1221,7 +1313,7 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSN
|
||||
for (int icoeff = 0; icoeff < ncoeff; icoeff++) {
|
||||
const auto idxb = icoeff % idxb_max;
|
||||
const auto idx_chem = icoeff / idxb_max;
|
||||
evdwl += d_coeffi[icoeff+1]*my_sna.blist(idxb,idx_chem,ii);
|
||||
evdwl += d_coeffi[icoeff+1]*my_sna.blist(ii,idx_chem,idxb);
|
||||
}
|
||||
|
||||
// quadratic contributions
|
||||
@ -1230,12 +1322,12 @@ void PairSNAPKokkos<DeviceType, real_type, vector_length>::operator() (TagPairSN
|
||||
for (int icoeff = 0; icoeff < ncoeff; icoeff++) {
|
||||
const auto idxb = icoeff % idxb_max;
|
||||
const auto idx_chem = icoeff / idxb_max;
|
||||
auto bveci = my_sna.blist(idxb,idx_chem,ii);
|
||||
real_type bveci = my_sna.blist(ii,idx_chem,idxb);
|
||||
evdwl += 0.5*d_coeffi[k++]*bveci*bveci;
|
||||
for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) {
|
||||
auto jdxb = jcoeff % idxb_max;
|
||||
auto jdx_chem = jcoeff / idxb_max;
|
||||
auto bvecj = my_sna.blist(jdxb,jdx_chem,ii);
|
||||
auto bvecj = my_sna.blist(ii,jdx_chem,jdxb);
|
||||
evdwl += d_coeffi[k++]*bveci*bvecj;
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,12 +45,12 @@ struct WignerWrapper {
|
||||
{ ; }
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
complex get(const int& ma) {
|
||||
complex get(const int& ma) const {
|
||||
return complex(buffer[offset + 2 * vector_length * ma], buffer[offset + vector_length + 2 * vector_length * ma]);
|
||||
}
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void set(const int& ma, const complex& store) {
|
||||
void set(const int& ma, const complex& store) const {
|
||||
buffer[offset + 2 * vector_length * ma] = store.re;
|
||||
buffer[offset + vector_length + 2 * vector_length * ma] = store.im;
|
||||
}
|
||||
@ -122,8 +122,14 @@ inline
|
||||
void compute_cayley_klein(const int&, const int&, const int&);
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void pre_ui(const int&, const int&, const int&, const int&); // ForceSNAP
|
||||
|
||||
// version of the code with parallelism over j_bend
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void compute_ui(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, const int, const int, const int, const int); // ForceSNAP
|
||||
void compute_ui_small(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, const int, const int, const int, const int); // ForceSNAP
|
||||
// version of the code without parallelism over j_bend
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void compute_ui_large(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, const int, const int, const int); // ForceSNAP
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void compute_zi(const int&, const int&, const int&); // ForceSNAP
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
@ -135,6 +141,35 @@ inline
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void compute_bi(const int&, const int&, const int&); // ForceSNAP
|
||||
|
||||
// functions for derivatives, GPU only
|
||||
// version of the code with parallelism over j_bend
|
||||
template<int dir>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void compute_fused_deidrj_small(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, const int, const int, const int, const int); //ForceSNAP
|
||||
// version of the code without parallelism over j_bend
|
||||
template<int dir>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void compute_fused_deidrj_large(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, const int, const int, const int); //ForceSNAP
|
||||
|
||||
// core "evaluation" functions that get plugged into "compute" functions
|
||||
// plugged into compute_ui_small, compute_ui_large
|
||||
KOKKOS_FORCEINLINE_FUNCTION
|
||||
void evaluate_ui_jbend(const WignerWrapper<real_type, vector_length>&, const complex&, const complex&, const real_type&, const int&,
|
||||
const int&, const int&, const int&);
|
||||
// plugged into compute_zi, compute_yi
|
||||
KOKKOS_FORCEINLINE_FUNCTION
|
||||
complex evaluate_zi(const int&, const int&, const int&, const int&, const int&, const int&, const int&, const int&, const int&,
|
||||
const int&, const int&, const int&, const int&, const real_type*);
|
||||
// plugged into compute_yi, compute_yi_with_zlist
|
||||
KOKKOS_FORCEINLINE_FUNCTION
|
||||
real_type evaluate_beta_scaled(const int&, const int&, const int&, const int&, const int&, const int&, const int&, const int&,
|
||||
const Kokkos::View<real_type***, Kokkos::LayoutLeft, DeviceType> &);
|
||||
// plugged into compute_fused_deidrj_small, compute_fused_deidrj_large
|
||||
KOKKOS_FORCEINLINE_FUNCTION
|
||||
real_type evaluate_duidrj_jbend(const WignerWrapper<real_type, vector_length>&, const complex&, const complex&, const real_type&,
|
||||
const WignerWrapper<real_type, vector_length>&, const complex&, const complex&, const real_type&,
|
||||
const int&, const int&, const int&, const int&);
|
||||
|
||||
// functions for bispectrum coefficients, CPU only
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void pre_ui_cpu(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team,const int&,const int&); // ForceSNAP
|
||||
@ -148,11 +183,6 @@ inline
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void compute_bi_cpu(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, int); // ForceSNAP
|
||||
|
||||
// functions for derivatives, GPU only
|
||||
template<int dir>
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void compute_fused_deidrj(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, const int, const int, const int, const int); //ForceSNAP
|
||||
|
||||
// functions for derivatives, CPU only
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void compute_duidrj_cpu(const typename Kokkos::TeamPolicy<DeviceType>::member_type& team, int, int); //ForceSNAP
|
||||
@ -168,23 +198,6 @@ inline
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
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_) {
|
||||
#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_) {
|
||||
#ifdef __SYCL_DEVICE_ONLY__
|
||||
*sin_ = sycl::sincos(x, cos_);
|
||||
#else
|
||||
sincosf(x, sin_, cos_);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef TIMING_INFO
|
||||
double* timers;
|
||||
timespec starttime, endtime;
|
||||
@ -207,7 +220,7 @@ inline
|
||||
|
||||
int twojmax, diagonalstyle;
|
||||
|
||||
t_sna_3d_ll blist;
|
||||
t_sna_3d blist;
|
||||
t_sna_3c_ll ulisttot;
|
||||
t_sna_3c_ll ulisttot_full; // un-folded ulisttot, cpu only
|
||||
t_sna_3c_ll zlist;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -516,7 +516,6 @@ double FixAtomSwap::energy_full()
|
||||
if (force->kspace) force->kspace->compute(eflag,vflag);
|
||||
|
||||
if (modify->n_post_force) modify->post_force(vflag);
|
||||
if (modify->n_end_of_step) modify->end_of_step();
|
||||
|
||||
update->eflag_global = update->ntimestep;
|
||||
double total_energy = c_pe->compute_scalar();
|
||||
|
||||
@ -1108,7 +1108,7 @@ double FixChargeRegulation::energy_full() {
|
||||
|
||||
if (modify->n_pre_reverse) modify->pre_reverse(eflag,vflag);
|
||||
if (modify->n_post_force) modify->post_force(vflag);
|
||||
if (modify->n_end_of_step) modify->end_of_step();
|
||||
|
||||
update->eflag_global = update->ntimestep;
|
||||
double total_energy = c_pe->compute_scalar();
|
||||
return total_energy;
|
||||
|
||||
@ -2319,10 +2319,9 @@ double FixGCMC::energy_full()
|
||||
|
||||
if (modify->n_pre_reverse) modify->pre_reverse(eflag,vflag);
|
||||
if (modify->n_post_force) modify->post_force(vflag);
|
||||
if (modify->n_end_of_step) modify->end_of_step();
|
||||
|
||||
// NOTE: all fixes with energy_global_flag set and which
|
||||
// operate at pre_force() or post_force() or end_of_step()
|
||||
// operate at pre_force() or post_force()
|
||||
// and which user has enabled via fix_modify energy yes,
|
||||
// will contribute to total MC energy via pe->compute_scalar()
|
||||
|
||||
|
||||
@ -1053,10 +1053,9 @@ double FixWidom::energy_full()
|
||||
|
||||
if (modify->n_pre_reverse) modify->pre_reverse(eflag,vflag);
|
||||
if (modify->n_pre_force) modify->pre_force(vflag);
|
||||
if (modify->n_end_of_step) modify->end_of_step();
|
||||
|
||||
// NOTE: all fixes with energy_global_flag set and which
|
||||
// operate at pre_force() or post_force() or end_of_step()
|
||||
// operate at pre_force() or post_force()
|
||||
// and which user has enabled via fix_modify energy yes,
|
||||
// will contribute to total MC energy via pe->compute_scalar()
|
||||
|
||||
|
||||
@ -628,7 +628,8 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename)
|
||||
chemflag = 0;
|
||||
bnormflag = 0;
|
||||
wselfallflag = 0;
|
||||
chunksize = 4096;
|
||||
chunksize = 32768;
|
||||
parallel_thresh = 8192;
|
||||
|
||||
// open SNAP parameter file on proc 0
|
||||
|
||||
@ -696,6 +697,8 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename)
|
||||
wselfallflag = utils::inumeric(FLERR,keyval.c_str(),false,lmp);
|
||||
else if (keywd == "chunksize")
|
||||
chunksize = utils::inumeric(FLERR,keyval.c_str(),false,lmp);
|
||||
else if (keywd == "parallelthresh")
|
||||
parallel_thresh = utils::inumeric(FLERR,keyval.c_str(),false,lmp);
|
||||
else
|
||||
error->all(FLERR,"Unknown parameter '{}' in SNAP "
|
||||
"parameter file", keywd);
|
||||
|
||||
@ -59,7 +59,7 @@ class PairSNAP : public Pair {
|
||||
double **scale; // for thermodynamic integration
|
||||
int twojmax, switchflag, bzeroflag, bnormflag;
|
||||
int chemflag, wselfallflag;
|
||||
int chunksize;
|
||||
int chunksize,parallel_thresh;
|
||||
double rfac0, rmin0, wj1, wj2;
|
||||
int rcutfacflag, twojmaxflag; // flags for required parameters
|
||||
int beta_max; // length of beta
|
||||
|
||||
@ -20,7 +20,7 @@ charges (dsf and long-range treatment of charges)
|
||||
out-of-plane angle
|
||||
|
||||
See the file doc/drude_tutorial.html for getting started.
|
||||
See the doc pages for "pair_style buck6d/coul/gauss", "anlge_style class2",
|
||||
See the doc pages for "pair_style buck6d/coul/gauss", "angle_style class2",
|
||||
"angle_style cosine/buck6d", and "improper_style inversion/harmonic"
|
||||
commands to get started. Also see the above mentioned website and
|
||||
literature for further documentation about the force field.
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
// clang-format off
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
https://www.lammps.org/, Sandia National Laboratories
|
||||
@ -16,13 +15,16 @@
|
||||
Contributing author : Axel Kohlmeyer (Temple U)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "omp_compat.h"
|
||||
#include "accelerator_omp.h"
|
||||
#include "atom.h"
|
||||
#include "error.h"
|
||||
#include "omp_compat.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
typedef struct { double x,y,z; } dbl3_t;
|
||||
typedef struct {
|
||||
double x, y, z;
|
||||
} dbl3_t;
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
enforce PBC and modify box image flags for each atom
|
||||
@ -37,20 +39,35 @@ typedef struct { double x,y,z; } dbl3_t;
|
||||
|
||||
void DomainOMP::pbc()
|
||||
{
|
||||
dbl3_t * _noalias const x = (dbl3_t *)&atom->x[0][0];
|
||||
dbl3_t * _noalias const v = (dbl3_t *)&atom->v[0][0];
|
||||
const double * _noalias const lo = (triclinic == 0) ? boxlo : boxlo_lamda;
|
||||
const double * _noalias const hi = (triclinic == 0) ? boxhi : boxhi_lamda;
|
||||
const double * _noalias const period = (triclinic == 0) ? prd : prd_lamda;
|
||||
const int * _noalias const mask = atom->mask;
|
||||
imageint * _noalias const image = atom->image;
|
||||
const int nlocal = atom->nlocal;
|
||||
if (!nlocal) return;
|
||||
|
||||
// verify owned atoms have valid numerical coords
|
||||
// may not if computed pairwise force between 2 atoms at same location
|
||||
|
||||
const double *_noalias const coord = &atom->x[0][0];
|
||||
const int n3 = 3 * nlocal;
|
||||
int flag = 0;
|
||||
#if defined(_OPENMP) // clang-format off
|
||||
#pragma omp parallel for LMP_DEFAULT_NONE schedule(static) reduction(+:flag)
|
||||
#endif // clang-format on
|
||||
for (int i = 0; i < n3; i++)
|
||||
if (!std::isfinite(coord[i])) flag = 1;
|
||||
if (flag) error->one(FLERR, "Non-numeric atom coords - simulation unstable");
|
||||
|
||||
dbl3_t *_noalias const x = (dbl3_t *) &atom->x[0][0];
|
||||
dbl3_t *_noalias const v = (dbl3_t *) &atom->v[0][0];
|
||||
const double *_noalias const lo = (triclinic == 0) ? boxlo : boxlo_lamda;
|
||||
const double *_noalias const hi = (triclinic == 0) ? boxhi : boxhi_lamda;
|
||||
const double *_noalias const period = (triclinic == 0) ? prd : prd_lamda;
|
||||
const int *_noalias const mask = atom->mask;
|
||||
imageint *_noalias const image = atom->image;
|
||||
|
||||
#if defined(_OPENMP)
|
||||
#pragma omp parallel for LMP_DEFAULT_NONE schedule(static)
|
||||
#endif
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
imageint idim,otherdims;
|
||||
imageint idim, otherdims;
|
||||
|
||||
if (xperiodic) {
|
||||
if (x[i].x < lo[0]) {
|
||||
@ -64,7 +81,7 @@ void DomainOMP::pbc()
|
||||
}
|
||||
if (x[i].x >= hi[0]) {
|
||||
x[i].x -= period[0];
|
||||
x[i].x = MAX(x[i].x,lo[0]);
|
||||
x[i].x = MAX(x[i].x, lo[0]);
|
||||
if (deform_vremap && mask[i] & deform_groupbit) v[i].x -= h_rate[0];
|
||||
idim = image[i] & IMGMASK;
|
||||
otherdims = image[i] ^ idim;
|
||||
@ -89,7 +106,7 @@ void DomainOMP::pbc()
|
||||
}
|
||||
if (x[i].y >= hi[1]) {
|
||||
x[i].y -= period[1];
|
||||
x[i].y = MAX(x[i].y,lo[1]);
|
||||
x[i].y = MAX(x[i].y, lo[1]);
|
||||
if (deform_vremap && mask[i] & deform_groupbit) {
|
||||
v[i].x -= h_rate[5];
|
||||
v[i].y -= h_rate[1];
|
||||
@ -118,7 +135,7 @@ void DomainOMP::pbc()
|
||||
}
|
||||
if (x[i].z >= hi[2]) {
|
||||
x[i].z -= period[2];
|
||||
x[i].z = MAX(x[i].z,lo[2]);
|
||||
x[i].z = MAX(x[i].z, lo[2]);
|
||||
if (deform_vremap && mask[i] & deform_groupbit) {
|
||||
v[i].x -= h_rate[4];
|
||||
v[i].y -= h_rate[3];
|
||||
@ -141,16 +158,17 @@ void DomainOMP::pbc()
|
||||
|
||||
void DomainOMP::lamda2x(int n)
|
||||
{
|
||||
dbl3_t * _noalias const x = (dbl3_t *)&atom->x[0][0];
|
||||
const int num = n;
|
||||
if (!n) return;
|
||||
dbl3_t *_noalias const x = (dbl3_t *) &atom->x[0][0];
|
||||
|
||||
#if defined(_OPENMP)
|
||||
#pragma omp parallel for LMP_DEFAULT_NONE schedule(static)
|
||||
#endif
|
||||
for (int i = 0; i < num; i++) {
|
||||
x[i].x = h[0]*x[i].x + h[5]*x[i].y + h[4]*x[i].z + boxlo[0];
|
||||
x[i].y = h[1]*x[i].y + h[3]*x[i].z + boxlo[1];
|
||||
x[i].z = h[2]*x[i].z + boxlo[2];
|
||||
x[i].x = h[0] * x[i].x + h[5] * x[i].y + h[4] * x[i].z + boxlo[0];
|
||||
x[i].y = h[1] * x[i].y + h[3] * x[i].z + boxlo[1];
|
||||
x[i].z = h[2] * x[i].z + boxlo[2];
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,8 +179,9 @@ void DomainOMP::lamda2x(int n)
|
||||
|
||||
void DomainOMP::x2lamda(int n)
|
||||
{
|
||||
dbl3_t * _noalias const x = (dbl3_t *)&atom->x[0][0];
|
||||
const int num = n;
|
||||
if (!n) return;
|
||||
dbl3_t *_noalias const x = (dbl3_t *) &atom->x[0][0];
|
||||
|
||||
#if defined(_OPENMP)
|
||||
#pragma omp parallel for LMP_DEFAULT_NONE schedule(static)
|
||||
@ -172,9 +191,8 @@ void DomainOMP::x2lamda(int n)
|
||||
double delta1 = x[i].y - boxlo[1];
|
||||
double delta2 = x[i].z - boxlo[2];
|
||||
|
||||
x[i].x = h_inv[0]*delta0 + h_inv[5]*delta1 + h_inv[4]*delta2;
|
||||
x[i].y = h_inv[1]*delta1 + h_inv[3]*delta2;
|
||||
x[i].z = h_inv[2]*delta2;
|
||||
x[i].x = h_inv[0] * delta0 + h_inv[5] * delta1 + h_inv[4] * delta2;
|
||||
x[i].y = h_inv[1] * delta1 + h_inv[3] * delta2;
|
||||
x[i].z = h_inv[2] * delta2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -140,6 +140,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :
|
||||
rxnfunclist[0] = "rxnsum";
|
||||
rxnfunclist[1] = "rxnave";
|
||||
nvvec = 0;
|
||||
ncustomvars = 0;
|
||||
vvec = nullptr;
|
||||
|
||||
nxspecial = nullptr;
|
||||
@ -232,7 +233,6 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :
|
||||
memory->create(molecule_keyword,nreacts,"bond/react:molecule_keyword");
|
||||
memory->create(nconstraints,nreacts,"bond/react:nconstraints");
|
||||
memory->create(constraintstr,nreacts,MAXLINE,"bond/react:constraintstr");
|
||||
memory->create(constraints,0,nreacts,"bond/react:constraints");
|
||||
memory->create(var_flag,NUMVARVALS,nreacts,"bond/react:var_flag");
|
||||
memory->create(var_id,NUMVARVALS,nreacts,"bond/react:var_id");
|
||||
memory->create(iatomtype,nreacts,"bond/react:iatomtype");
|
||||
@ -488,6 +488,9 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (custom_charges_fragid[i] >= 0) CustomCharges(custom_charges_fragid[i],i);
|
||||
}
|
||||
|
||||
// get the names of per-atom variables needed by 'rxn' functions of custom constraint
|
||||
customvarnames();
|
||||
|
||||
// initialize Marsaglia RNG with processor-unique seed (Arrhenius prob)
|
||||
|
||||
rrhandom = new RanMars*[narrhenius];
|
||||
@ -617,7 +620,6 @@ FixBondReact::~FixBondReact()
|
||||
memory->destroy(stabilize_steps_flag);
|
||||
memory->destroy(custom_charges_fragid);
|
||||
memory->destroy(molecule_keyword);
|
||||
memory->destroy(constraints);
|
||||
memory->destroy(nconstraints);
|
||||
memory->destroy(constraintstr);
|
||||
memory->destroy(create_atoms_flag);
|
||||
@ -1020,6 +1022,11 @@ void FixBondReact::post_integrate()
|
||||
return;
|
||||
}
|
||||
|
||||
// evaluate custom constraint variable values here and forward_comm
|
||||
get_customvars();
|
||||
commflag = 1;
|
||||
comm->forward_comm_fix(this,ncustomvars);
|
||||
|
||||
// run through the superimpose algorithm
|
||||
// this checks if simulation topology matches unreacted mol template
|
||||
superimpose_algorithm();
|
||||
@ -2086,6 +2093,100 @@ double FixBondReact::get_temperature(tagint **myglove, int row_offset, int col)
|
||||
return t;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
get per-atom variable names used by custom constraint
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBondReact::customvarnames()
|
||||
{
|
||||
int pos,pos1,pos2,pos3,prev3;
|
||||
std::string varstr,argstr,varid;
|
||||
|
||||
// search all constraints' varstr for special 'rxn' functions
|
||||
// add variable names to customvarstrs
|
||||
// add values to customvars
|
||||
|
||||
for (rxnID = 0; rxnID < nreacts; rxnID++) {
|
||||
for (int i = 0; i < nconstraints[rxnID]; i++) {
|
||||
if (constraints[i][rxnID].type == CUSTOM) {
|
||||
varstr = constraints[i][rxnID].str;
|
||||
prev3 = -1;
|
||||
while (true) {
|
||||
// find next reaction special function occurrence
|
||||
pos1 = INT_MAX;
|
||||
for (int i = 0; i < nrxnfunction; i++) {
|
||||
pos = varstr.find(rxnfunclist[i],prev3+1);
|
||||
if (pos == std::string::npos) continue;
|
||||
if (pos < pos1) pos1 = pos;
|
||||
}
|
||||
if (pos1 == INT_MAX) break;
|
||||
|
||||
pos2 = varstr.find("(",pos1);
|
||||
pos3 = varstr.find(")",pos2);
|
||||
if (pos2 == std::string::npos || pos3 == std::string::npos)
|
||||
error->all(FLERR,"Bond/react: Illegal rxn function syntax\n");
|
||||
prev3 = pos3;
|
||||
argstr = varstr.substr(pos2+1,pos3-pos2-1);
|
||||
argstr.erase(remove_if(argstr.begin(), argstr.end(), isspace), argstr.end()); // remove whitespace
|
||||
pos2 = argstr.find(",");
|
||||
if (pos2 != std::string::npos) varid = argstr.substr(0,pos2);
|
||||
else varid = argstr;
|
||||
// check if we already know about this variable
|
||||
int varidflag = 0;
|
||||
for (int j = 0; j < ncustomvars; j++) {
|
||||
if (customvarstrs[j] == varid) {
|
||||
varidflag = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!varidflag) {
|
||||
customvarstrs.resize(ncustomvars+1);
|
||||
customvarstrs[ncustomvars++] = varid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
evaluate per-atom variables needed for custom constraint
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixBondReact::get_customvars()
|
||||
{
|
||||
double *tempvvec;
|
||||
std::string varid;
|
||||
int nall = atom->nlocal + atom->nghost;
|
||||
|
||||
memory->create(tempvvec,nall,"bond/react:tempvvec");
|
||||
if (vvec == nullptr) {
|
||||
memory->create(vvec,nall,ncustomvars,"bond/react:vvec");
|
||||
nvvec = nall;
|
||||
}
|
||||
if (nvvec < nall) {
|
||||
memory->grow(vvec,nall,ncustomvars,"bond/react:vvec");
|
||||
nvvec = nall;
|
||||
}
|
||||
for (int i = 0; i < ncustomvars; i++) {
|
||||
varid = customvarstrs[i];
|
||||
if (varid.substr(0,2) != "v_") error->all(FLERR,"Bond/react: Reaction special function variable "
|
||||
"name should begin with 'v_'");
|
||||
varid = varid.substr(2);
|
||||
int ivar = input->variable->find(varid.c_str());
|
||||
if (ivar < 0)
|
||||
error->all(FLERR,"Bond/react: Reaction special function variable "
|
||||
"name does not exist");
|
||||
if (!input->variable->atomstyle(ivar))
|
||||
error->all(FLERR,"Bond/react: Reaction special function must "
|
||||
"reference an atom-style variable");
|
||||
|
||||
input->variable->compute_atom(ivar,igroup,tempvvec,1,0);
|
||||
for (int j = 0; j < nall; j++) vvec[j][i] = tempvvec[j];
|
||||
}
|
||||
memory->destroy(tempvvec);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
evaulate expression for variable constraint
|
||||
------------------------------------------------------------------------- */
|
||||
@ -2120,6 +2221,7 @@ double FixBondReact::custom_constraint(std::string varstr)
|
||||
evlstr.push_back(varstr.substr(prev3+1,pos1-(prev3+1)));
|
||||
prev3 = pos3;
|
||||
argstr = varstr.substr(pos2+1,pos3-pos2-1);
|
||||
argstr.erase(remove_if(argstr.begin(), argstr.end(), isspace), argstr.end()); // remove whitespace
|
||||
pos2 = argstr.find(",");
|
||||
if (pos2 != std::string::npos) {
|
||||
varid = argstr.substr(0,pos2);
|
||||
@ -2145,25 +2247,19 @@ currently two 'rxn' functions: rxnsum and rxnave
|
||||
double FixBondReact::rxnfunction(std::string rxnfunc, std::string varid,
|
||||
std::string fragid)
|
||||
{
|
||||
if (varid.substr(0,2) != "v_") error->one(FLERR,"Bond/react: Reaction special function variable "
|
||||
"name should begin with 'v_'");
|
||||
varid = varid.substr(2);
|
||||
int ivar = input->variable->find(varid.c_str());
|
||||
int ivar = -1;
|
||||
for (int i = 0; i < ncustomvars; i++) {
|
||||
if (varid == customvarstrs[i]) {
|
||||
ivar = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// variable name should always be found, at this point
|
||||
// however, let's double check for completeness
|
||||
if (ivar < 0)
|
||||
error->one(FLERR,"Bond/react: Reaction special function variable "
|
||||
"name does not exist");
|
||||
if (!input->variable->atomstyle(ivar))
|
||||
error->one(FLERR,"Bond/react: Reaction special function must "
|
||||
"reference an atom-style variable");
|
||||
if (vvec == nullptr) {
|
||||
memory->create(vvec,atom->nlocal,"bond/react:vvec");
|
||||
nvvec = atom->nlocal;
|
||||
}
|
||||
if (nvvec < atom->nlocal) {
|
||||
memory->grow(vvec,atom->nlocal,"bond/react:vvec");
|
||||
nvvec = atom->nlocal;
|
||||
}
|
||||
input->variable->compute_atom(ivar,igroup,vvec,1,0);
|
||||
|
||||
int ifrag = -1;
|
||||
if (fragid != "all") {
|
||||
ifrag = onemol->findfragment(fragid.c_str());
|
||||
@ -2178,14 +2274,14 @@ double FixBondReact::rxnfunction(std::string rxnfunc, std::string varid,
|
||||
if (fragid == "all") {
|
||||
for (int i = 0; i < onemol->natoms; i++) {
|
||||
iatom = atom->map(glove[i][1]);
|
||||
sumvvec += vvec[iatom];
|
||||
sumvvec += vvec[iatom][ivar];
|
||||
}
|
||||
nsum = onemol->natoms;
|
||||
} else {
|
||||
for (int i = 0; i < onemol->natoms; i++) {
|
||||
if (onemol->fragmentmask[ifrag][i]) {
|
||||
iatom = atom->map(glove[i][1]);
|
||||
sumvvec += vvec[iatom];
|
||||
sumvvec += vvec[iatom][ivar];
|
||||
nsum++;
|
||||
}
|
||||
}
|
||||
@ -2830,6 +2926,19 @@ void FixBondReact::update_everything()
|
||||
rxnID = local_mega_glove[0][i];
|
||||
// reactions already shuffled from dedup procedure, so can skip first N
|
||||
if (iskip[rxnID]++ < nlocalskips[rxnID]) continue;
|
||||
|
||||
// atoms inserted here for serial MPI_STUBS build only
|
||||
if (create_atoms_flag[rxnID] == 1) {
|
||||
onemol = atom->molecules[unreacted_mol[rxnID]];
|
||||
twomol = atom->molecules[reacted_mol[rxnID]];
|
||||
if (insert_atoms(local_mega_glove,i)) {
|
||||
inserted_atoms_flag = 1;
|
||||
} else { // create aborted
|
||||
reaction_count_total[rxnID]--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < max_natoms+1; j++)
|
||||
update_mega_glove[j][update_num_mega] = local_mega_glove[j][i];
|
||||
update_num_mega++;
|
||||
@ -2842,7 +2951,7 @@ void FixBondReact::update_everything()
|
||||
|
||||
// we can insert atoms here, now that reactions are finalized
|
||||
// can't do it any earlier, due to skipped reactions (max_rxn)
|
||||
// reactions that create atoms are always treated as 'global'
|
||||
// for MPI build, reactions that create atoms are always treated as 'global'
|
||||
if (create_atoms_flag[rxnID] == 1) {
|
||||
onemol = atom->molecules[unreacted_mol[rxnID]];
|
||||
twomol = atom->molecules[reacted_mol[rxnID]];
|
||||
@ -2858,17 +2967,18 @@ void FixBondReact::update_everything()
|
||||
update_mega_glove[j][update_num_mega] = global_mega_glove[j][i];
|
||||
update_num_mega++;
|
||||
}
|
||||
// if inserted atoms and global map exists, reset map now instead
|
||||
// of waiting for comm since other pre-exchange fixes may use it
|
||||
// invoke map_init() b/c atom count has grown
|
||||
// do this once after all atom insertions
|
||||
if (inserted_atoms_flag == 1 && atom->map_style != Atom::MAP_NONE) {
|
||||
atom->map_init();
|
||||
atom->map_set();
|
||||
}
|
||||
}
|
||||
delete [] iskip;
|
||||
|
||||
// if inserted atoms and global map exists, reset map now instead
|
||||
// of waiting for comm since other pre-exchange fixes may use it
|
||||
// invoke map_init() b/c atom count has grown
|
||||
// do this once after all atom insertions
|
||||
if (inserted_atoms_flag == 1 && atom->map_style != Atom::MAP_NONE) {
|
||||
atom->map_init();
|
||||
atom->map_set();
|
||||
}
|
||||
|
||||
// mark to-delete atoms
|
||||
nlocal = atom->nlocal;
|
||||
if (nlocal > nmark) {
|
||||
@ -3668,7 +3778,7 @@ void FixBondReact::read(int myrxn)
|
||||
else if (strstr(line,"constraints")) {
|
||||
sscanf(line,"%d",&nconstraints[myrxn]);
|
||||
if (maxnconstraints < nconstraints[myrxn]) maxnconstraints = nconstraints[myrxn];
|
||||
memory->grow(constraints,maxnconstraints,nreacts,"bond/react:constraints");
|
||||
constraints.resize(maxnconstraints, std::vector<Constraint>(nreacts));
|
||||
} else break;
|
||||
}
|
||||
|
||||
@ -4027,6 +4137,15 @@ int FixBondReact::pack_forward_comm(int n, int *list, double *buf,
|
||||
|
||||
m = 0;
|
||||
|
||||
if (commflag == 1) {
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
for (k = 0; k < ncustomvars; k++)
|
||||
buf[m++] = vvec[j][k];
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
if (commflag == 2) {
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
@ -4051,12 +4170,16 @@ int FixBondReact::pack_forward_comm(int n, int *list, double *buf,
|
||||
|
||||
void FixBondReact::unpack_forward_comm(int n, int first, double *buf)
|
||||
{
|
||||
int i,j,m,ns,last;
|
||||
int i,j,k,m,ns,last;
|
||||
|
||||
m = 0;
|
||||
last = first + n;
|
||||
|
||||
if (commflag == 2) {
|
||||
if (commflag == 1) {
|
||||
for (i = first; i < last; i++)
|
||||
for (k = 0; k < ncustomvars; k++)
|
||||
vvec[i][k] = buf[m++];
|
||||
} else if (commflag == 2) {
|
||||
for (i = first; i < last; i++)
|
||||
partner[i] = (tagint) ubuf(buf[m++]).i;
|
||||
} else {
|
||||
|
||||
@ -139,8 +139,6 @@ class FixBondReact : public Fix {
|
||||
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
|
||||
|
||||
int **nxspecial, **onemol_nxspecial, **twomol_nxspecial; // full number of 1-4 neighbors
|
||||
tagint **xspecial, **onemol_xspecial, **twomol_xspecial; // full 1-4 neighbor list
|
||||
@ -151,14 +149,12 @@ class FixBondReact : public Fix {
|
||||
// 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
|
||||
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 *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);
|
||||
@ -180,8 +176,10 @@ class FixBondReact : public Fix {
|
||||
int check_constraints();
|
||||
void get_IDcoords(int, int, double *);
|
||||
double get_temperature(tagint **, int, int);
|
||||
double custom_constraint(std::string);
|
||||
double rxnfunction(std::string, std::string, std::string);
|
||||
void customvarnames(); // get per-atom variables names used by custom constraint
|
||||
void get_customvars(); // evaluate local values for variables names used by custom constraint
|
||||
double custom_constraint(std::string); // evaulate expression for custom constraint
|
||||
double rxnfunction(std::string, std::string, std::string); // eval rxn_sum and rxn_ave
|
||||
int get_chirality(double[12]); // get handedness given an ordered set of coordinates
|
||||
|
||||
void open(char *);
|
||||
@ -216,7 +214,11 @@ class FixBondReact : public Fix {
|
||||
double par[MAXCONPAR];
|
||||
std::string str;
|
||||
};
|
||||
Constraint **constraints;
|
||||
int ncustomvars;
|
||||
std::vector<std::string> customvarstrs;
|
||||
int nvvec;
|
||||
double **vvec; // per-atom vector to store variable constraint atom-style variable values
|
||||
std::vector<std::vector<Constraint>> constraints;
|
||||
|
||||
// DEBUG
|
||||
|
||||
|
||||
@ -2471,7 +2471,7 @@ This function is called, e.g. from :doc:`fix property/atom <fix_property_atom>`.
|
||||
*/
|
||||
int Atom::add_custom(const char *name, int flag, int cols)
|
||||
{
|
||||
int index;
|
||||
int index = -1;
|
||||
|
||||
if ((flag == 0) && (cols == 0)) {
|
||||
index = nivector;
|
||||
@ -2511,7 +2511,8 @@ int Atom::add_custom(const char *name, int flag, int cols)
|
||||
dcols = (int *) memory->srealloc(dcols,ndarray*sizeof(int),"atom:dcols");
|
||||
dcols[index] = cols;
|
||||
}
|
||||
|
||||
if (index < 0)
|
||||
error->all(FLERR,"Invalid call to Atom::add_custom()");
|
||||
return index;
|
||||
}
|
||||
|
||||
|
||||
@ -528,10 +528,11 @@ void Domain::reset_box()
|
||||
|
||||
void Domain::pbc()
|
||||
{
|
||||
int nlocal = atom->nlocal;
|
||||
if (!nlocal) return;
|
||||
int i;
|
||||
imageint idim,otherdims;
|
||||
double *lo,*hi,*period;
|
||||
int nlocal = atom->nlocal;
|
||||
double **x = atom->x;
|
||||
double **v = atom->v;
|
||||
int *mask = atom->mask;
|
||||
@ -542,7 +543,7 @@ void Domain::pbc()
|
||||
|
||||
double *coord;
|
||||
int n3 = 3*nlocal;
|
||||
coord = &x[0][0]; // note: x is always initialized to at least one element.
|
||||
coord = &x[0][0];
|
||||
int flag = 0;
|
||||
for (i = 0; i < n3; i++)
|
||||
if (!std::isfinite(*coord++)) flag = 1;
|
||||
|
||||
@ -100,7 +100,7 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp)
|
||||
maxsbuf = 0;
|
||||
sbuf = nullptr;
|
||||
|
||||
maxpbc = 0;
|
||||
maxpbc = -1;
|
||||
xpbc = vpbc = nullptr;
|
||||
imagepbc = nullptr;
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ enum{MOLECULE,CHARGE,RMASS,IVEC,DVEC,IARRAY,DARRAY};
|
||||
|
||||
FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg),
|
||||
nvalue(0), style(nullptr), index(nullptr), astyle(nullptr)
|
||||
nvalue(0), styles(nullptr), index(nullptr), astyle(nullptr)
|
||||
{
|
||||
if (narg < 4) error->all(FLERR,"Illegal fix property/atom command");
|
||||
|
||||
@ -40,7 +40,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
int iarg = 3;
|
||||
nvalue = narg-iarg;
|
||||
style = new int[nvalue];
|
||||
styles = new int[nvalue];
|
||||
cols = new int[nvalue];
|
||||
index = new int[nvalue];
|
||||
|
||||
@ -58,7 +58,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
"already has molecule attribute");
|
||||
if (molecule_flag)
|
||||
error->all(FLERR,"Fix property/atom cannot specify mol twice");
|
||||
style[nvalue] = MOLECULE;
|
||||
styles[nvalue] = MOLECULE;
|
||||
cols[nvalue] = 0;
|
||||
atom->molecule_flag = molecule_flag = 1;
|
||||
values_peratom++;
|
||||
@ -69,7 +69,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
error->all(FLERR,"Fix property/atom q when atom_style already has charge attribute");
|
||||
if (q_flag)
|
||||
error->all(FLERR,"Fix property/atom cannot specify q twice");
|
||||
style[nvalue] = CHARGE;
|
||||
styles[nvalue] = CHARGE;
|
||||
cols[nvalue] = 0;
|
||||
atom->q_flag = q_flag = 1;
|
||||
values_peratom++;
|
||||
@ -80,7 +80,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
error->all(FLERR,"Fix property/atom rmass when atom_style already has rmass attribute");
|
||||
if (rmass_flag)
|
||||
error->all(FLERR,"Fix property/atom cannot specify rmass twice");
|
||||
style[nvalue] = RMASS;
|
||||
styles[nvalue] = RMASS;
|
||||
cols[nvalue] = 0;
|
||||
atom->rmass_flag = rmass_flag = 1;
|
||||
values_peratom++;
|
||||
@ -90,7 +90,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
// custom atom vector
|
||||
|
||||
} else if (utils::strmatch(arg[iarg],"^i_")) {
|
||||
style[nvalue] = IVEC;
|
||||
styles[nvalue] = IVEC;
|
||||
int flag,ncols;
|
||||
index[nvalue] = atom->find_custom(&arg[iarg][2],flag,ncols);
|
||||
if (index[nvalue] >= 0)
|
||||
@ -102,7 +102,7 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
iarg++;
|
||||
|
||||
} else if (utils::strmatch(arg[iarg],"^d_")) {
|
||||
style[nvalue] = DVEC;
|
||||
styles[nvalue] = DVEC;
|
||||
int flag,ncols;
|
||||
index[nvalue] = atom->find_custom(&arg[iarg][2],flag,ncols);
|
||||
if (index[nvalue] >= 0)
|
||||
@ -129,10 +129,10 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
if (arg[iarg][0] == 'i') {
|
||||
which = 0;
|
||||
style[nvalue] = IARRAY;
|
||||
styles[nvalue] = IARRAY;
|
||||
} else {
|
||||
which = 1;
|
||||
style[nvalue] = DARRAY;
|
||||
styles[nvalue] = DARRAY;
|
||||
}
|
||||
index[nvalue] = atom->add_custom(&arg[iarg][3],which,ncols);
|
||||
cols[nvalue] = ncols;
|
||||
@ -165,9 +165,9 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (border == 0) {
|
||||
int flag = 0;
|
||||
for (int i = 0; i < nvalue; i++)
|
||||
if (style[i] == MOLECULE
|
||||
|| style[i] == CHARGE
|
||||
|| style[i] == RMASS) flag = 1;
|
||||
if (styles[i] == MOLECULE
|
||||
|| styles[i] == CHARGE
|
||||
|| styles[i] == RMASS) flag = 1;
|
||||
if (flag && comm->me == 0)
|
||||
error->warning(FLERR,"Fix property/atom mol or charge or rmass "
|
||||
"w/out ghost communication");
|
||||
@ -201,30 +201,30 @@ FixPropertyAtom::~FixPropertyAtom()
|
||||
// set ptrs to a null pointer, so they no longer exist for Atom class
|
||||
|
||||
for (int nv = 0; nv < nvalue; nv++) {
|
||||
if (style[nv] == MOLECULE) {
|
||||
if (styles[nv] == MOLECULE) {
|
||||
atom->molecule_flag = 0;
|
||||
memory->destroy(atom->molecule);
|
||||
atom->molecule = nullptr;
|
||||
} else if (style[nv] == CHARGE) {
|
||||
} else if (styles[nv] == CHARGE) {
|
||||
atom->q_flag = 0;
|
||||
memory->destroy(atom->q);
|
||||
atom->q = nullptr;
|
||||
} else if (style[nv] == RMASS) {
|
||||
} else if (styles[nv] == RMASS) {
|
||||
atom->rmass_flag = 0;
|
||||
memory->destroy(atom->rmass);
|
||||
atom->rmass = nullptr;
|
||||
} else if (style[nv] == IVEC) {
|
||||
} else if (styles[nv] == IVEC) {
|
||||
atom->remove_custom(index[nv],0,cols[nv]);
|
||||
} else if (style[nv] == DVEC) {
|
||||
} else if (styles[nv] == DVEC) {
|
||||
atom->remove_custom(index[nv],1,cols[nv]);
|
||||
} else if (style[nv] == IARRAY) {
|
||||
} else if (styles[nv] == IARRAY) {
|
||||
atom->remove_custom(index[nv],0,cols[nv]);
|
||||
} else if (style[nv] == DARRAY) {
|
||||
} else if (styles[nv] == DARRAY) {
|
||||
atom->remove_custom(index[nv],1,cols[nv]);
|
||||
}
|
||||
}
|
||||
|
||||
delete [] style;
|
||||
delete [] styles;
|
||||
delete [] cols;
|
||||
delete [] index;
|
||||
delete [] astyle;
|
||||
@ -291,21 +291,21 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, tagint
|
||||
|
||||
if ((m = atom->map(itag)) >= 0) {
|
||||
for (j = 0; j < nvalue; j++) {
|
||||
if (style[j] == MOLECULE) {
|
||||
if (styles[j] == MOLECULE) {
|
||||
atom->molecule[m] = values.next_tagint();
|
||||
} else if (style[j] == CHARGE) {
|
||||
} else if (styles[j] == CHARGE) {
|
||||
atom->q[m] = values.next_double();
|
||||
} else if (style[j] == RMASS) {
|
||||
} else if (styles[j] == RMASS) {
|
||||
atom->rmass[m] = values.next_double();
|
||||
} else if (style[j] == IVEC) {
|
||||
} else if (styles[j] == IVEC) {
|
||||
atom->ivector[index[j]][m] = values.next_int();
|
||||
} else if (style[j] == DVEC) {
|
||||
} else if (styles[j] == DVEC) {
|
||||
atom->dvector[index[j]][m] = values.next_double();
|
||||
} else if (style[j] == IARRAY) {
|
||||
} else if (styles[j] == IARRAY) {
|
||||
ncol = cols[j];
|
||||
for (k = 0; k < ncol; k++)
|
||||
atom->iarray[index[j]][m][k] = values.next_int();
|
||||
} else if (style[j] == DARRAY) {
|
||||
} else if (styles[j] == DARRAY) {
|
||||
ncol = cols[j];
|
||||
for (k = 0; k < ncol; k++)
|
||||
atom->darray[index[j]][m][k] = values.next_double();
|
||||
@ -365,34 +365,34 @@ void FixPropertyAtom::write_data_section_pack(int /*mth*/, double **buf)
|
||||
|
||||
int icol = 1;
|
||||
for (int nv = 0; nv < nvalue; nv++) {
|
||||
if (style[nv] == MOLECULE) {
|
||||
if (styles[nv] == MOLECULE) {
|
||||
tagint *molecule = atom->molecule;
|
||||
for (i = 0; i < nlocal; i++) buf[i][icol] = ubuf(molecule[i]).d;
|
||||
icol++;
|
||||
} else if (style[nv] == CHARGE) {
|
||||
} else if (styles[nv] == CHARGE) {
|
||||
double *q = atom->q;
|
||||
for (i = 0; i < nlocal; i++) buf[i][icol] = q[i];
|
||||
icol++;
|
||||
} else if (style[nv] == RMASS) {
|
||||
} else if (styles[nv] == RMASS) {
|
||||
double *rmass = atom->rmass;
|
||||
for (i = 0; i < nlocal; i++) buf[i][icol] = rmass[i];
|
||||
icol++;
|
||||
} else if (style[nv] == IVEC) {
|
||||
} else if (styles[nv] == IVEC) {
|
||||
int *ivec = atom->ivector[index[nv]];
|
||||
for (i = 0; i < nlocal; i++) buf[i][icol] = ubuf(ivec[i]).d;
|
||||
icol++;
|
||||
} else if (style[nv] == DVEC) {
|
||||
} else if (styles[nv] == DVEC) {
|
||||
double *dvec = atom->dvector[index[nv]];
|
||||
for (i = 0; i < nlocal; i++) buf[i][icol] = dvec[i];
|
||||
icol++;
|
||||
} else if (style[nv] == IARRAY) {
|
||||
} else if (styles[nv] == IARRAY) {
|
||||
int **iarray = atom->iarray[index[nv]];
|
||||
ncol = cols[nv];
|
||||
for (i = 0; i < nlocal; i++)
|
||||
for (k = 0; k < ncol; k++)
|
||||
buf[i][icol+k] = ubuf(iarray[i][k]).d;
|
||||
icol += ncol;
|
||||
} else if (style[nv] == DARRAY) {
|
||||
} else if (styles[nv] == DARRAY) {
|
||||
double **darray = atom->darray[index[nv]];
|
||||
ncol = cols[nv];
|
||||
for (i = 0; i < nlocal; i++)
|
||||
@ -412,19 +412,19 @@ void FixPropertyAtom::write_data_section_pack(int /*mth*/, double **buf)
|
||||
|
||||
void FixPropertyAtom::write_data_section_keyword(int /*mth*/, FILE *fp)
|
||||
{
|
||||
if (nvalue == 1 && style[0] == MOLECULE) fprintf(fp,"\nMolecules\n\n");
|
||||
else if (nvalue == 1 && style[0] == CHARGE) fprintf(fp,"\nCharges\n\n");
|
||||
if (nvalue == 1 && styles[0] == MOLECULE) fprintf(fp,"\nMolecules\n\n");
|
||||
else if (nvalue == 1 && styles[0] == CHARGE) fprintf(fp,"\nCharges\n\n");
|
||||
else {
|
||||
fprintf(fp,"\n%s #",id);
|
||||
// write column hint as comment
|
||||
for (int i = 0; i < nvalue; ++i) {
|
||||
if (style[i] == MOLECULE) fputs(" mol",fp);
|
||||
else if (style[i] == CHARGE) fputs(" q",fp);
|
||||
else if (style[i] == RMASS) fputs(" rmass",fp);
|
||||
else if (style[i] == IVEC) fprintf(fp," i_%s", atom->ivname[index[i]]);
|
||||
else if (style[i] == DVEC) fprintf(fp, " d_%s", atom->dvname[index[i]]);
|
||||
else if (style[i] == IARRAY) fprintf(fp, " i_%s", atom->ianame[index[i]]);
|
||||
else if (style[i] == DARRAY) fprintf(fp, " d_%s", atom->daname[index[i]]);
|
||||
if (styles[i] == MOLECULE) fputs(" mol",fp);
|
||||
else if (styles[i] == CHARGE) fputs(" q",fp);
|
||||
else if (styles[i] == RMASS) fputs(" rmass",fp);
|
||||
else if (styles[i] == IVEC) fprintf(fp," i_%s", atom->ivname[index[i]]);
|
||||
else if (styles[i] == DVEC) fprintf(fp, " d_%s", atom->dvname[index[i]]);
|
||||
else if (styles[i] == IARRAY) fprintf(fp, " i_%s", atom->ianame[index[i]]);
|
||||
else if (styles[i] == DARRAY) fprintf(fp, " d_%s", atom->daname[index[i]]);
|
||||
}
|
||||
fputs("\n\n",fp);
|
||||
}
|
||||
@ -446,22 +446,22 @@ void FixPropertyAtom::write_data_section(int /*mth*/, FILE *fp,
|
||||
fprintf(fp,TAGINT_FORMAT,(tagint) ubuf(buf[i][0]).i);
|
||||
icol = 1;
|
||||
for (nv = 0; nv < nvalue; nv++) {
|
||||
if (style[nv] == MOLECULE)
|
||||
if (styles[nv] == MOLECULE)
|
||||
fprintf(fp," " TAGINT_FORMAT,(tagint) ubuf(buf[i][icol++]).i);
|
||||
else if (style[nv] == CHARGE)
|
||||
else if (styles[nv] == CHARGE)
|
||||
fprintf(fp," %g",buf[i][icol++]);
|
||||
else if (style[nv] == RMASS)
|
||||
else if (styles[nv] == RMASS)
|
||||
fprintf(fp," %g",buf[i][icol++]);
|
||||
else if (style[nv] == IVEC)
|
||||
else if (styles[nv] == IVEC)
|
||||
fprintf(fp," %d",(int) ubuf(buf[i][icol++]).i);
|
||||
else if (style[nv] == DVEC)
|
||||
else if (styles[nv] == DVEC)
|
||||
fprintf(fp," %g",buf[i][icol++]);
|
||||
else if (style[nv] == IARRAY) {
|
||||
else if (styles[nv] == IARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
fprintf(fp," %d",(int) ubuf(buf[i][icol+k]).i);
|
||||
icol += ncol;
|
||||
} else if (style[nv] == DARRAY) {
|
||||
} else if (styles[nv] == DARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
fprintf(fp," %g",buf[i][icol+k]);
|
||||
@ -480,13 +480,13 @@ double FixPropertyAtom::memory_usage()
|
||||
{
|
||||
double bytes = 0.0;
|
||||
for (int m = 0; m < nvalue; m++) {
|
||||
if (style[m] == MOLECULE) bytes = atom->nmax * sizeof(tagint);
|
||||
else if (style[m] == CHARGE) bytes = atom->nmax * sizeof(double);
|
||||
else if (style[m] == RMASS) bytes = atom->nmax * sizeof(double);
|
||||
else if (style[m] == IVEC) bytes = atom->nmax * sizeof(int);
|
||||
else if (style[m] == DVEC) bytes = atom->nmax * sizeof(double);
|
||||
else if (style[m] == IARRAY) bytes = atom->nmax * cols[m] * sizeof(int);
|
||||
else if (style[m] == DARRAY) bytes = atom->nmax * cols[m] * sizeof(double);
|
||||
if (styles[m] == MOLECULE) bytes = atom->nmax * sizeof(tagint);
|
||||
else if (styles[m] == CHARGE) bytes = atom->nmax * sizeof(double);
|
||||
else if (styles[m] == RMASS) bytes = atom->nmax * sizeof(double);
|
||||
else if (styles[m] == IVEC) bytes = atom->nmax * sizeof(int);
|
||||
else if (styles[m] == DVEC) bytes = atom->nmax * sizeof(double);
|
||||
else if (styles[m] == IARRAY) bytes = (size_t) atom->nmax * cols[m] * sizeof(int);
|
||||
else if (styles[m] == DARRAY) bytes = (size_t) atom->nmax * cols[m] * sizeof(double);
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
@ -501,33 +501,33 @@ double FixPropertyAtom::memory_usage()
|
||||
void FixPropertyAtom::grow_arrays(int nmax)
|
||||
{
|
||||
for (int nv = 0; nv < nvalue; nv++) {
|
||||
if (style[nv] == MOLECULE) {
|
||||
if (styles[nv] == MOLECULE) {
|
||||
memory->grow(atom->molecule,nmax,"atom:molecule");
|
||||
size_t nbytes = (nmax-nmax_old) * sizeof(tagint);
|
||||
memset(&atom->molecule[nmax_old],0,nbytes);
|
||||
} else if (style[nv] == CHARGE) {
|
||||
} else if (styles[nv] == CHARGE) {
|
||||
memory->grow(atom->q,nmax,"atom:q");
|
||||
size_t nbytes = (nmax-nmax_old) * sizeof(double);
|
||||
memset(&atom->q[nmax_old],0,nbytes);
|
||||
} else if (style[nv] == RMASS) {
|
||||
} else if (styles[nv] == RMASS) {
|
||||
memory->grow(atom->rmass,nmax,"atom:rmass");
|
||||
size_t nbytes = (nmax-nmax_old) * sizeof(double);
|
||||
memset(&atom->rmass[nmax_old],0,nbytes);
|
||||
} else if (style[nv] == IVEC) {
|
||||
} else if (styles[nv] == IVEC) {
|
||||
memory->grow(atom->ivector[index[nv]],nmax,"atom:ivector");
|
||||
size_t nbytes = (nmax-nmax_old) * sizeof(int);
|
||||
memset(&atom->ivector[index[nv]][nmax_old],0,nbytes);
|
||||
} else if (style[nv] == DVEC) {
|
||||
} else if (styles[nv] == DVEC) {
|
||||
memory->grow(atom->dvector[index[nv]],nmax,"atom:dvector");
|
||||
size_t nbytes = (nmax-nmax_old) * sizeof(double);
|
||||
memset(&atom->dvector[index[nv]][nmax_old],0,nbytes);
|
||||
} else if (style[nv] == IARRAY) {
|
||||
} else if (styles[nv] == IARRAY) {
|
||||
memory->grow(atom->iarray[index[nv]],nmax,cols[nv],"atom:iarray");
|
||||
size_t nbytes = (nmax-nmax_old) * cols[nv] * sizeof(int);
|
||||
size_t nbytes = (size_t) (nmax-nmax_old) * cols[nv] * sizeof(int);
|
||||
if (nbytes) memset(&atom->iarray[index[nv]][nmax_old][0],0,nbytes);
|
||||
} else if (style[nv] == DARRAY) {
|
||||
} else if (styles[nv] == DARRAY) {
|
||||
memory->grow(atom->darray[index[nv]],nmax,cols[nv],"atom:darray");
|
||||
size_t nbytes = (nmax-nmax_old) * cols[nv] * sizeof(double);
|
||||
size_t nbytes = (size_t) (nmax-nmax_old) * cols[nv] * sizeof(double);
|
||||
if (nbytes) memset(&atom->darray[index[nv]][nmax_old][0],0,nbytes);
|
||||
}
|
||||
}
|
||||
@ -544,21 +544,21 @@ void FixPropertyAtom::copy_arrays(int i, int j, int /*delflag*/)
|
||||
int k,ncol;
|
||||
|
||||
for (int nv = 0; nv < nvalue; nv++) {
|
||||
if (style[nv] == MOLECULE)
|
||||
if (styles[nv] == MOLECULE)
|
||||
atom->molecule[j] = atom->molecule[i];
|
||||
else if (style[nv] == CHARGE)
|
||||
else if (styles[nv] == CHARGE)
|
||||
atom->q[j] = atom->q[i];
|
||||
else if (style[nv] == RMASS)
|
||||
else if (styles[nv] == RMASS)
|
||||
atom->rmass[j] = atom->rmass[i];
|
||||
else if (style[nv] == IVEC)
|
||||
else if (styles[nv] == IVEC)
|
||||
atom->ivector[index[nv]][j] = atom->ivector[index[nv]][i];
|
||||
else if (style[nv] == DVEC)
|
||||
else if (styles[nv] == DVEC)
|
||||
atom->dvector[index[nv]][j] = atom->dvector[index[nv]][i];
|
||||
else if (style[nv] == IARRAY) {
|
||||
else if (styles[nv] == IARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
atom->iarray[index[nv]][j][k] = atom->iarray[index[nv]][i][k];
|
||||
} else if (style[nv] == DARRAY) {
|
||||
} else if (styles[nv] == DARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
atom->darray[index[nv]][j][k] = atom->darray[index[nv]][i][k];
|
||||
@ -576,37 +576,37 @@ int FixPropertyAtom::pack_border(int n, int *list, double *buf)
|
||||
|
||||
int m = 0;
|
||||
for (int nv = 0; nv < nvalue; nv++) {
|
||||
if (style[nv] == MOLECULE) {
|
||||
if (styles[nv] == MOLECULE) {
|
||||
tagint *molecule = atom->molecule;
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = ubuf(molecule[j]).d;
|
||||
}
|
||||
} else if (style[nv] == CHARGE) {
|
||||
} else if (styles[nv] == CHARGE) {
|
||||
double *q = atom->q;
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = q[j];
|
||||
}
|
||||
} else if (style[nv] == RMASS) {
|
||||
} else if (styles[nv] == RMASS) {
|
||||
double *rmass = atom->rmass;
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = rmass[j];
|
||||
}
|
||||
} else if (style[nv] == IVEC) {
|
||||
} else if (styles[nv] == IVEC) {
|
||||
int *ivector = atom->ivector[index[nv]];
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = ubuf(ivector[j]).d;
|
||||
}
|
||||
} else if (style[nv] == DVEC) {
|
||||
} else if (styles[nv] == DVEC) {
|
||||
double *dvector = atom->dvector[index[nv]];
|
||||
for (i = 0; i < n; i++) {
|
||||
j = list[i];
|
||||
buf[m++] = dvector[j];
|
||||
}
|
||||
} else if (style[nv] == IARRAY) {
|
||||
} else if (styles[nv] == IARRAY) {
|
||||
int **iarray = atom->iarray[index[nv]];
|
||||
ncol = cols[nv];
|
||||
for (i = 0; i < n; i++) {
|
||||
@ -614,7 +614,7 @@ int FixPropertyAtom::pack_border(int n, int *list, double *buf)
|
||||
for (k = 0; k < ncol; k++)
|
||||
buf[m++] = ubuf(iarray[j][k]).d;
|
||||
}
|
||||
} else if (style[nv] == DARRAY) {
|
||||
} else if (styles[nv] == DARRAY) {
|
||||
double **darray = atom->darray[index[nv]];
|
||||
ncol = cols[nv];
|
||||
for (i = 0; i < n; i++) {
|
||||
@ -638,39 +638,39 @@ int FixPropertyAtom::unpack_border(int n, int first, double *buf)
|
||||
|
||||
int m = 0;
|
||||
for (int nv = 0; nv < nvalue; nv++) {
|
||||
if (style[nv] == MOLECULE) {
|
||||
if (styles[nv] == MOLECULE) {
|
||||
tagint *molecule = atom->molecule;
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++)
|
||||
molecule[i] = (tagint) ubuf(buf[m++]).i;
|
||||
} else if (style[nv] == CHARGE) {
|
||||
} else if (styles[nv] == CHARGE) {
|
||||
double *q = atom->q;
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++)
|
||||
q[i] = buf[m++];
|
||||
} else if (style[nv] == RMASS) {
|
||||
} else if (styles[nv] == RMASS) {
|
||||
double *rmass = atom->rmass;
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++)
|
||||
rmass[i] = buf[m++];
|
||||
} else if (style[nv] == IVEC) {
|
||||
} else if (styles[nv] == IVEC) {
|
||||
int *ivector = atom->ivector[index[nv]];
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++)
|
||||
ivector[i] = (int) ubuf(buf[m++]).i;
|
||||
} else if (style[nv] == DVEC) {
|
||||
} else if (styles[nv] == DVEC) {
|
||||
double *dvector = atom->dvector[index[nv]];
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++)
|
||||
dvector[i] = buf[m++];
|
||||
} else if (style[nv] == IARRAY) {
|
||||
} else if (styles[nv] == IARRAY) {
|
||||
int **iarray = atom->iarray[index[nv]];
|
||||
ncol = cols[nv];
|
||||
last = first + n;
|
||||
for (i = first; i < last; i++)
|
||||
for (k = 0; k < ncol; k++)
|
||||
iarray[i][k] = (int) ubuf(buf[m++]).i;
|
||||
} else if (style[nv] == DARRAY) {
|
||||
} else if (styles[nv] == DARRAY) {
|
||||
double **darray = atom->darray[index[nv]];
|
||||
ncol = cols[nv];
|
||||
last = first + n;
|
||||
@ -693,16 +693,16 @@ int FixPropertyAtom::pack_exchange(int i, double *buf)
|
||||
|
||||
int m = 0;
|
||||
for (int nv = 0; nv < nvalue; nv++) {
|
||||
if (style[nv] == MOLECULE) buf[m++] = ubuf(atom->molecule[i]).d;
|
||||
else if (style[nv] == CHARGE) buf[m++] = atom->q[i];
|
||||
else if (style[nv] == RMASS) buf[m++] = atom->rmass[i];
|
||||
else if (style[nv] == IVEC) buf[m++] = ubuf(atom->ivector[index[nv]][i]).d;
|
||||
else if (style[nv] == DVEC) buf[m++] = atom->dvector[index[nv]][i];
|
||||
else if (style[nv] == IARRAY) {
|
||||
if (styles[nv] == MOLECULE) buf[m++] = ubuf(atom->molecule[i]).d;
|
||||
else if (styles[nv] == CHARGE) buf[m++] = atom->q[i];
|
||||
else if (styles[nv] == RMASS) buf[m++] = atom->rmass[i];
|
||||
else if (styles[nv] == IVEC) buf[m++] = ubuf(atom->ivector[index[nv]][i]).d;
|
||||
else if (styles[nv] == DVEC) buf[m++] = atom->dvector[index[nv]][i];
|
||||
else if (styles[nv] == IARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
buf[m++] = ubuf(atom->iarray[index[nv]][i][k]).d;
|
||||
} else if (style[nv] == DARRAY) {
|
||||
} else if (styles[nv] == DARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
buf[m++] = atom->darray[index[nv]][i][k];
|
||||
@ -722,21 +722,21 @@ int FixPropertyAtom::unpack_exchange(int nlocal, double *buf)
|
||||
|
||||
int m = 0;
|
||||
for (int nv = 0; nv < nvalue; nv++) {
|
||||
if (style[nv] == MOLECULE)
|
||||
if (styles[nv] == MOLECULE)
|
||||
atom->molecule[nlocal] = (tagint) ubuf(buf[m++]).i;
|
||||
else if (style[nv] == CHARGE)
|
||||
else if (styles[nv] == CHARGE)
|
||||
atom->q[nlocal] = buf[m++];
|
||||
else if (style[nv] == RMASS)
|
||||
else if (styles[nv] == RMASS)
|
||||
atom->rmass[nlocal] = buf[m++];
|
||||
else if (style[nv] == IVEC)
|
||||
else if (styles[nv] == IVEC)
|
||||
atom->ivector[index[nv]][nlocal] = (int) ubuf(buf[m++]).i;
|
||||
else if (style[nv] == DVEC)
|
||||
else if (styles[nv] == DVEC)
|
||||
atom->dvector[index[nv]][nlocal] = buf[m++];
|
||||
else if (style[nv] == IARRAY) {
|
||||
else if (styles[nv] == IARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
atom->iarray[index[nv]][nlocal][k] = (int) ubuf(buf[m++]).i;
|
||||
} else if (style[nv] == DARRAY) {
|
||||
} else if (styles[nv] == DARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
atom->darray[index[nv]][nlocal][k] = buf[m++];
|
||||
@ -760,16 +760,16 @@ int FixPropertyAtom::pack_restart(int i, double *buf)
|
||||
|
||||
int m = 1;
|
||||
for (int nv = 0; nv < nvalue; nv++) {
|
||||
if (style[nv] == MOLECULE) buf[m++] = ubuf(atom->molecule[i]).d;
|
||||
else if (style[nv] == CHARGE) buf[m++] = atom->q[i];
|
||||
else if (style[nv] == RMASS) buf[m++] = atom->rmass[i];
|
||||
else if (style[nv] == IVEC) buf[m++] = ubuf(atom->ivector[index[nv]][i]).d;
|
||||
else if (style[nv] == DVEC) buf[m++] = atom->dvector[index[nv]][i];
|
||||
else if (style[nv] == IARRAY) {
|
||||
if (styles[nv] == MOLECULE) buf[m++] = ubuf(atom->molecule[i]).d;
|
||||
else if (styles[nv] == CHARGE) buf[m++] = atom->q[i];
|
||||
else if (styles[nv] == RMASS) buf[m++] = atom->rmass[i];
|
||||
else if (styles[nv] == IVEC) buf[m++] = ubuf(atom->ivector[index[nv]][i]).d;
|
||||
else if (styles[nv] == DVEC) buf[m++] = atom->dvector[index[nv]][i];
|
||||
else if (styles[nv] == IARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
buf[m++] = ubuf(atom->iarray[index[nv]][i][k]).d;
|
||||
} else if (style[nv] == DARRAY) {
|
||||
} else if (styles[nv] == DARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
buf[m++] = atom->darray[index[nv]][i][k];
|
||||
@ -796,21 +796,21 @@ void FixPropertyAtom::unpack_restart(int nlocal, int nth)
|
||||
m++;
|
||||
|
||||
for (int nv = 0; nv < nvalue; nv++) {
|
||||
if (style[nv] == MOLECULE)
|
||||
if (styles[nv] == MOLECULE)
|
||||
atom->molecule[nlocal] = (tagint) ubuf(extra[nlocal][m++]).i;
|
||||
else if (style[nv] == CHARGE)
|
||||
else if (styles[nv] == CHARGE)
|
||||
atom->q[nlocal] = extra[nlocal][m++];
|
||||
else if (style[nv] == RMASS)
|
||||
else if (styles[nv] == RMASS)
|
||||
atom->rmass[nlocal] = extra[nlocal][m++];
|
||||
else if (style[nv] == IVEC)
|
||||
else if (styles[nv] == IVEC)
|
||||
atom->ivector[index[nv]][nlocal] = (int) ubuf(extra[nlocal][m++]).i;
|
||||
else if (style[nv] == DVEC)
|
||||
else if (styles[nv] == DVEC)
|
||||
atom->dvector[index[nv]][nlocal] = extra[nlocal][m++];
|
||||
else if (style[nv] == IARRAY) {
|
||||
else if (styles[nv] == IARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
atom->iarray[index[nv]][nlocal][k] = (int) ubuf(extra[nlocal][m++]).i;
|
||||
} else if (style[nv] == DARRAY) {
|
||||
} else if (styles[nv] == DARRAY) {
|
||||
ncol = cols[nv];
|
||||
for (k = 0; k < ncol; k++)
|
||||
atom->darray[index[nv]][nlocal][k] = extra[nlocal][m++];
|
||||
|
||||
@ -53,7 +53,7 @@ class FixPropertyAtom : public Fix {
|
||||
protected:
|
||||
int nvalue, border;
|
||||
int molecule_flag, q_flag, rmass_flag; // flags for specific fields
|
||||
int *style; // style of each value, see enum
|
||||
int *styles; // style of each value, see enum
|
||||
int *index; // indices into atom custom data structs
|
||||
int *cols; // columns per value, for arrays
|
||||
char *astyle; // atom style at instantiation
|
||||
|
||||
@ -1356,8 +1356,10 @@ std::string Info::get_openmp_info()
|
||||
// Supported OpenMP version corresponds to the release date of the
|
||||
// specifications as posted at https://www.openmp.org/specifications/
|
||||
|
||||
#if _OPENMP > 201811
|
||||
return "OpenMP newer than version 5.0";
|
||||
#if _OPENMP > 202011
|
||||
return "OpenMP newer than version 5.1";
|
||||
#elif _OPENMP == 202011
|
||||
return "OpenMP 5.1";
|
||||
#elif _OPENMP == 201811
|
||||
return "OpenMP 5.0";
|
||||
#elif _OPENMP == 201611
|
||||
|
||||
@ -2712,7 +2712,7 @@ Below is a brief C code demonstrating accessing this collected bond information.
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include "library.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(LAMMPS_BIGBIG) || defined(LAMMPS_SMALLBIG)
|
||||
#include <inttypes.h> /* for int64_t */
|
||||
#include <stdint.h> /* for int64_t */
|
||||
#endif
|
||||
|
||||
/** Data type constants for extracting data from atoms, computes and fixes
|
||||
|
||||
110
src/memory.h
110
src/memory.h
@ -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,12 +36,15 @@ class Memory : protected Pointers {
|
||||
for these other cases, use smalloc/srealloc/sfree directly
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
create a 1d array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
template <typename TYPE> TYPE *create(TYPE *&array, int n, const char *name)
|
||||
{
|
||||
// POSSIBLE future change
|
||||
//if (n <= 0) return nullptr;
|
||||
|
||||
bigint nbytes = ((bigint) sizeof(TYPE)) * n;
|
||||
array = (TYPE *) smalloc(nbytes, name);
|
||||
return array;
|
||||
@ -53,12 +56,18 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
grow or shrink 1d array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
template <typename TYPE> TYPE *grow(TYPE *&array, int n, const char *name)
|
||||
{
|
||||
// POSSIBLE future change
|
||||
//if (n <= 0) {
|
||||
// destroy(array);
|
||||
// return nullptr;
|
||||
// }
|
||||
|
||||
if (array == nullptr) return create(array, n, name);
|
||||
|
||||
bigint nbytes = ((bigint) sizeof(TYPE)) * n;
|
||||
@ -72,7 +81,7 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
destroy a 1d array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -82,13 +91,16 @@ class Memory : protected Pointers {
|
||||
array = nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
create a 1d array with index from nlo to nhi inclusive
|
||||
cannot grow it
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
template <typename TYPE> TYPE *create1d_offset(TYPE *&array, int nlo, int nhi, const char *name)
|
||||
{
|
||||
// POSSIBLE future change
|
||||
// if (nlo > nhi) return nullptr;
|
||||
|
||||
bigint nbytes = ((bigint) sizeof(TYPE)) * (nhi - nlo + 1);
|
||||
array = (TYPE *) smalloc(nbytes, name);
|
||||
array -= nlo;
|
||||
@ -102,7 +114,7 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
destroy a 1d array with index offset
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -112,12 +124,15 @@ class Memory : protected Pointers {
|
||||
array = nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
create a 2d array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
template <typename TYPE> TYPE **create(TYPE **&array, int n1, int n2, const char *name)
|
||||
{
|
||||
// POSSIBLE future change
|
||||
//if (n1 <= 0 || n2 <= 0) return nullptr;
|
||||
|
||||
bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2;
|
||||
TYPE *data = (TYPE *) smalloc(nbytes, name);
|
||||
nbytes = ((bigint) sizeof(TYPE *)) * n1;
|
||||
@ -138,13 +153,19 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
grow or shrink 1st dim of a 2d array
|
||||
last dim must stay the same
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
template <typename TYPE> TYPE **grow(TYPE **&array, int n1, int n2, const char *name)
|
||||
{
|
||||
// POSSIBLE future change
|
||||
//if (n1 <= 0 || n2 <= 0) {
|
||||
// destroy(array);
|
||||
// return nullptr;
|
||||
// }
|
||||
|
||||
if (array == nullptr) return create(array, n1, n2, name);
|
||||
|
||||
bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2;
|
||||
@ -167,7 +188,7 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
destroy a 2d array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -179,12 +200,15 @@ class Memory : protected Pointers {
|
||||
array = nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
create a 2d array with a ragged 2nd dimension
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
template <typename TYPE> TYPE **create_ragged(TYPE **&array, int n1, int *n2, const char *name)
|
||||
{
|
||||
// POSSIBLE future change
|
||||
//if (n1 <= 0) return nullptr;
|
||||
|
||||
bigint n2sum = 0;
|
||||
for (int i = 0; i < n1; i++) n2sum += n2[i];
|
||||
|
||||
@ -208,7 +232,7 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
create a 2d array with 2nd index from n2lo to n2hi inclusive
|
||||
cannot grow it
|
||||
------------------------------------------------------------------------- */
|
||||
@ -216,6 +240,9 @@ class Memory : protected Pointers {
|
||||
template <typename TYPE>
|
||||
TYPE **create2d_offset(TYPE **&array, int n1, int n2lo, int n2hi, const char *name)
|
||||
{
|
||||
// POSSIBLE future change
|
||||
//if (n1 <= 0 || n2lo > n2hi) return nullptr;
|
||||
|
||||
int n2 = n2hi - n2lo + 1;
|
||||
create(array, n1, n2, name);
|
||||
for (int i = 0; i < n1; i++) array[i] -= n2lo;
|
||||
@ -230,7 +257,7 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
destroy a 2d array with 2nd index offset
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -242,12 +269,15 @@ class Memory : protected Pointers {
|
||||
array = nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
create a 3d array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
template <typename TYPE> TYPE ***create(TYPE ***&array, int n1, int n2, int n3, const char *name)
|
||||
{
|
||||
// POSSIBLE future change
|
||||
//if (n1 <= 0 || n2 <= 0 || n3 <= 0) return nullptr;
|
||||
|
||||
bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3;
|
||||
TYPE *data = (TYPE *) smalloc(nbytes, name);
|
||||
nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2;
|
||||
@ -276,13 +306,19 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
grow or shrink 1st dim of a 3d array
|
||||
last 2 dims must stay the same
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
template <typename TYPE> TYPE ***grow(TYPE ***&array, int n1, int n2, int n3, const char *name)
|
||||
{
|
||||
// POSSIBLE future change
|
||||
//if (n1 <= 0 || n2 <= 0 || n3 <= 0) {
|
||||
// destroy(array);
|
||||
// return nullptr;
|
||||
//};
|
||||
|
||||
if (array == nullptr) return create(array, n1, n2, n3, name);
|
||||
|
||||
bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3;
|
||||
@ -313,7 +349,7 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
destroy a 3d array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -326,7 +362,7 @@ class Memory : protected Pointers {
|
||||
array = nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
create a 3d array with 1st index from n1lo to n1hi inclusive
|
||||
cannot grow it
|
||||
------------------------------------------------------------------------- */
|
||||
@ -334,6 +370,8 @@ class Memory : protected Pointers {
|
||||
template <typename TYPE>
|
||||
TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi, int n2, int n3, const char *name)
|
||||
{
|
||||
if (n1lo > n1hi || n2 <= 0 || n3 <= 0) return nullptr;
|
||||
|
||||
int n1 = n1hi - n1lo + 1;
|
||||
create(array, n1, n2, n3, name);
|
||||
array -= n1lo;
|
||||
@ -348,7 +386,7 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
free a 3d array with 1st index offset
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -361,7 +399,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,
|
||||
@ -373,6 +411,8 @@ class Memory : protected Pointers {
|
||||
TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi, int n2lo, int n2hi, int n3lo,
|
||||
int n3hi, const char *name)
|
||||
{
|
||||
if (n1lo > n1hi || n2lo > n2hi || n3lo > n3hi) return nullptr;
|
||||
|
||||
int n1 = n1hi - n1lo + 1;
|
||||
int n2 = n2hi - n2lo + 1;
|
||||
int n3 = n3hi - n3lo + 1;
|
||||
@ -393,7 +433,7 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
free a 3d array with all 3 indices offset
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -407,13 +447,16 @@ class Memory : protected Pointers {
|
||||
array = nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
create a 4d array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
template <typename TYPE>
|
||||
TYPE ****create(TYPE ****&array, int n1, int n2, int n3, int n4, const char *name)
|
||||
{
|
||||
// POSSIBLE future change
|
||||
//if (n1 <= 0 || n2 <= 0 || n3 <= 0 || n4 <= 0) return nullptr;
|
||||
|
||||
bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3 * n4;
|
||||
TYPE *data = (TYPE *) smalloc(nbytes, name);
|
||||
nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2 * n3;
|
||||
@ -451,7 +494,7 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
grow or shrink 1st dim of a 4d array
|
||||
last 3 dims must stay the same
|
||||
------------------------------------------------------------------------- */
|
||||
@ -459,6 +502,12 @@ class Memory : protected Pointers {
|
||||
template <typename TYPE>
|
||||
TYPE ****grow(TYPE ****&array, int n1, int n2, int n3, int n4, const char *name)
|
||||
{
|
||||
// POSSIBLE future change
|
||||
//if (n1 <= 0 || n2 <= 0 || n3 <= 0 || n4 <= 0) {
|
||||
// destroy(array);
|
||||
// return nullptr;
|
||||
// }
|
||||
|
||||
if (array == nullptr) return create(array, n1, n2, n3, n4, name);
|
||||
|
||||
bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3 * n4;
|
||||
@ -498,7 +547,7 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
destroy a 4d array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -512,7 +561,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
|
||||
@ -524,6 +573,8 @@ class Memory : protected Pointers {
|
||||
TYPE ****create4d_offset(TYPE ****&array, int n1, int n2lo, int n2hi, int n3lo, int n3hi,
|
||||
int n4lo, int n4hi, const char *name)
|
||||
{
|
||||
if (n1 <= 0 || n2lo > n2hi || n3lo > n3hi || n4lo > n4hi) return nullptr;
|
||||
|
||||
int n2 = n2hi - n2lo + 1;
|
||||
int n3 = n3hi - n3lo + 1;
|
||||
int n4 = n4hi - n4lo + 1;
|
||||
@ -545,8 +596,8 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free a 4d array with indices 2,3, and 4 offset
|
||||
/* ----------------------------------------------------------------------
|
||||
free a 4d array with indices 2,3,4 offset
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
template <typename TYPE>
|
||||
@ -560,13 +611,16 @@ class Memory : protected Pointers {
|
||||
array = nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
create a 5d array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
template <typename TYPE>
|
||||
TYPE *****create(TYPE *****&array, int n1, int n2, int n3, int n4, int n5, const char *name)
|
||||
{
|
||||
// POSSIBLE future change
|
||||
//if (n1 <= 0 || n2 <= 0 || n3 <= 0 || n4 <= 0 || n5 <= 0) return nullptr;
|
||||
|
||||
bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3 * n4 * n5;
|
||||
TYPE *data = (TYPE *) smalloc(nbytes, name);
|
||||
nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2 * n3 * n4;
|
||||
@ -611,7 +665,7 @@ class Memory : protected Pointers {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
destroy a 5d array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -626,7 +680,7 @@ class Memory : protected Pointers {
|
||||
array = nullptr;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
/* ----------------------------------------------------------------------
|
||||
memory usage of arrays, including pointers
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -148,13 +148,15 @@ Molecule::Molecule(LAMMPS *lmp, int narg, char **arg, int &index) :
|
||||
|
||||
if (me == 0)
|
||||
utils::logmesg(lmp,"Read molecule template {}:\n {} molecules\n"
|
||||
" {} fragments\n"
|
||||
" {} atoms with max type {}\n"
|
||||
" {} bonds with max type {}\n"
|
||||
" {} angles with max type {}\n"
|
||||
" {} dihedrals with max type {}\n"
|
||||
" {} impropers with max type {}\n", id,nmolecules,
|
||||
natoms,ntypes,nbonds,nbondtypes,nangles,nangletypes,
|
||||
ndihedrals,ndihedraltypes,nimpropers,nimpropertypes);
|
||||
nfragments,natoms,ntypes,nbonds,nbondtypes,nangles,
|
||||
nangletypes,ndihedrals,ndihedraltypes,nimpropers,
|
||||
nimpropertypes);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -19,8 +19,8 @@
|
||||
// Syntax: binary2txt file1 file2 ...
|
||||
// Creates: file1.txt file2.txt ...
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
// these must match settings in src/lmptype.h which builds LAMMPS with
|
||||
// -DLAMMPS_SMALLBIG (the default), -DLAMMPS_BIGBIG, or -DLAMMPS_SMALLSMALL
|
||||
@ -57,10 +57,10 @@ typedef int64_t bigint;
|
||||
|
||||
int main(int narg, char **arg)
|
||||
{
|
||||
int i,j,k,m,n;
|
||||
bigint ntimestep,natoms;
|
||||
int size_one,nchunk,triclinic;
|
||||
double xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz;
|
||||
int i, j, k, m, n;
|
||||
bigint ntimestep, natoms;
|
||||
int size_one, nchunk, triclinic;
|
||||
double xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz;
|
||||
int boundary[3][2];
|
||||
char boundstr[9];
|
||||
|
||||
@ -75,25 +75,25 @@ int main(int narg, char **arg)
|
||||
// loop over files
|
||||
|
||||
for (int iarg = 1; iarg < narg; iarg++) {
|
||||
printf("%s:",arg[iarg]);
|
||||
printf("%s:", arg[iarg]);
|
||||
fflush(stdout);
|
||||
FILE *fp = fopen(arg[iarg],"rb");
|
||||
FILE *fp = fopen(arg[iarg], "rb");
|
||||
if (!fp) {
|
||||
printf("ERROR: Could not open %s\n",arg[iarg]);
|
||||
printf("ERROR: Could not open %s\n", arg[iarg]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
n = strlen(arg[iarg]) + 1 + 4;
|
||||
char *filetxt = new char[n];
|
||||
strcpy(filetxt,arg[iarg]);
|
||||
strcat(filetxt,".txt");
|
||||
FILE *fptxt = fopen(filetxt,"w");
|
||||
delete [] filetxt;
|
||||
strcpy(filetxt, arg[iarg]);
|
||||
strcat(filetxt, ".txt");
|
||||
FILE *fptxt = fopen(filetxt, "w");
|
||||
delete[] filetxt;
|
||||
|
||||
// detect newer format
|
||||
char * magic_string = nullptr;
|
||||
char * columns = nullptr;
|
||||
char * unit_style = nullptr;
|
||||
char *magic_string = nullptr;
|
||||
char *columns = nullptr;
|
||||
char *unit_style = nullptr;
|
||||
|
||||
// loop over snapshots in file
|
||||
|
||||
@ -101,7 +101,7 @@ int main(int narg, char **arg)
|
||||
int endian = 0x0001;
|
||||
int revision = 0x0001;
|
||||
|
||||
fread(&ntimestep,sizeof(bigint),1,fp);
|
||||
fread(&ntimestep, sizeof(bigint), 1, fp);
|
||||
|
||||
// detect end-of-file
|
||||
|
||||
@ -116,7 +116,7 @@ int main(int narg, char **arg)
|
||||
// first bigint encodes negative format name length
|
||||
bigint magic_string_len = -ntimestep;
|
||||
|
||||
delete [] magic_string;
|
||||
delete[] magic_string;
|
||||
magic_string = new char[magic_string_len + 1];
|
||||
fread(magic_string, sizeof(char), magic_string_len, fp);
|
||||
magic_string[magic_string_len] = '\0';
|
||||
@ -128,24 +128,24 @@ int main(int narg, char **arg)
|
||||
fread(&revision, sizeof(int), 1, fp);
|
||||
|
||||
// read the real ntimestep
|
||||
fread(&ntimestep,sizeof(bigint),1,fp);
|
||||
fread(&ntimestep, sizeof(bigint), 1, fp);
|
||||
}
|
||||
|
||||
fread(&natoms,sizeof(bigint),1,fp);
|
||||
fread(&triclinic,sizeof(int),1,fp);
|
||||
fread(&boundary[0][0],6*sizeof(int),1,fp);
|
||||
fread(&xlo,sizeof(double),1,fp);
|
||||
fread(&xhi,sizeof(double),1,fp);
|
||||
fread(&ylo,sizeof(double),1,fp);
|
||||
fread(&yhi,sizeof(double),1,fp);
|
||||
fread(&zlo,sizeof(double),1,fp);
|
||||
fread(&zhi,sizeof(double),1,fp);
|
||||
fread(&natoms, sizeof(bigint), 1, fp);
|
||||
fread(&triclinic, sizeof(int), 1, fp);
|
||||
fread(&boundary[0][0], 6 * sizeof(int), 1, fp);
|
||||
fread(&xlo, sizeof(double), 1, fp);
|
||||
fread(&xhi, sizeof(double), 1, fp);
|
||||
fread(&ylo, sizeof(double), 1, fp);
|
||||
fread(&yhi, sizeof(double), 1, fp);
|
||||
fread(&zlo, sizeof(double), 1, fp);
|
||||
fread(&zhi, sizeof(double), 1, fp);
|
||||
if (triclinic) {
|
||||
fread(&xy,sizeof(double),1,fp);
|
||||
fread(&xz,sizeof(double),1,fp);
|
||||
fread(&yz,sizeof(double),1,fp);
|
||||
fread(&xy, sizeof(double), 1, fp);
|
||||
fread(&xz, sizeof(double), 1, fp);
|
||||
fread(&yz, sizeof(double), 1, fp);
|
||||
}
|
||||
fread(&size_one,sizeof(int),1,fp);
|
||||
fread(&size_one, sizeof(int), 1, fp);
|
||||
|
||||
if (magic_string && revision > 0x0001) {
|
||||
// newer format includes units string, columns string
|
||||
@ -155,8 +155,8 @@ int main(int narg, char **arg)
|
||||
|
||||
if (len > 0) {
|
||||
// has units
|
||||
delete [] unit_style;
|
||||
unit_style = new char[len+1];
|
||||
delete[] unit_style;
|
||||
unit_style = new char[len + 1];
|
||||
fread(unit_style, sizeof(char), len, fp);
|
||||
unit_style[len] = '\0';
|
||||
fprintf(fptxt, "ITEM: UNITS\n");
|
||||
@ -173,90 +173,94 @@ int main(int narg, char **arg)
|
||||
}
|
||||
|
||||
fread(&len, sizeof(int), 1, fp);
|
||||
delete [] columns;
|
||||
columns = new char[len+1];
|
||||
delete[] columns;
|
||||
columns = new char[len + 1];
|
||||
fread(columns, sizeof(char), len, fp);
|
||||
columns[len] = '\0';
|
||||
}
|
||||
|
||||
fread(&nchunk,sizeof(int),1,fp);
|
||||
fread(&nchunk, sizeof(int), 1, fp);
|
||||
|
||||
fprintf(fptxt,"ITEM: TIMESTEP\n");
|
||||
fprintf(fptxt,BIGINT_FORMAT "\n",ntimestep);
|
||||
fprintf(fptxt,"ITEM: NUMBER OF ATOMS\n");
|
||||
fprintf(fptxt,BIGINT_FORMAT "\n",natoms);
|
||||
fprintf(fptxt, "ITEM: TIMESTEP\n");
|
||||
fprintf(fptxt, BIGINT_FORMAT "\n", ntimestep);
|
||||
fprintf(fptxt, "ITEM: NUMBER OF ATOMS\n");
|
||||
fprintf(fptxt, BIGINT_FORMAT "\n", natoms);
|
||||
|
||||
m = 0;
|
||||
for (int idim = 0; idim < 3; idim++) {
|
||||
for (int iside = 0; iside < 2; iside++) {
|
||||
if (boundary[idim][iside] == 0) boundstr[m++] = 'p';
|
||||
else if (boundary[idim][iside] == 1) boundstr[m++] = 'f';
|
||||
else if (boundary[idim][iside] == 2) boundstr[m++] = 's';
|
||||
else if (boundary[idim][iside] == 3) boundstr[m++] = 'm';
|
||||
if (boundary[idim][iside] == 0)
|
||||
boundstr[m++] = 'p';
|
||||
else if (boundary[idim][iside] == 1)
|
||||
boundstr[m++] = 'f';
|
||||
else if (boundary[idim][iside] == 2)
|
||||
boundstr[m++] = 's';
|
||||
else if (boundary[idim][iside] == 3)
|
||||
boundstr[m++] = 'm';
|
||||
}
|
||||
boundstr[m++] = ' ';
|
||||
}
|
||||
boundstr[8] = '\0';
|
||||
|
||||
if (!triclinic) {
|
||||
fprintf(fptxt,"ITEM: BOX BOUNDS %s\n",boundstr);
|
||||
fprintf(fptxt,"%-1.16e %-1.16e\n",xlo,xhi);
|
||||
fprintf(fptxt,"%-1.16e %-1.16e\n",ylo,yhi);
|
||||
fprintf(fptxt,"%-1.16e %-1.16e\n",zlo,zhi);
|
||||
fprintf(fptxt, "ITEM: BOX BOUNDS %s\n", boundstr);
|
||||
fprintf(fptxt, "%-1.16e %-1.16e\n", xlo, xhi);
|
||||
fprintf(fptxt, "%-1.16e %-1.16e\n", ylo, yhi);
|
||||
fprintf(fptxt, "%-1.16e %-1.16e\n", zlo, zhi);
|
||||
} else {
|
||||
fprintf(fptxt,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr);
|
||||
fprintf(fptxt,"%-1.16e %-1.16e %-1.16e\n",xlo,xhi,xy);
|
||||
fprintf(fptxt,"%-1.16e %-1.16e %-1.16e\n",ylo,yhi,xz);
|
||||
fprintf(fptxt,"%-1.16e %-1.16e %-1.16e\n",zlo,zhi,yz);
|
||||
fprintf(fptxt, "ITEM: BOX BOUNDS xy xz yz %s\n", boundstr);
|
||||
fprintf(fptxt, "%-1.16e %-1.16e %-1.16e\n", xlo, xhi, xy);
|
||||
fprintf(fptxt, "%-1.16e %-1.16e %-1.16e\n", ylo, yhi, xz);
|
||||
fprintf(fptxt, "%-1.16e %-1.16e %-1.16e\n", zlo, zhi, yz);
|
||||
}
|
||||
|
||||
if (columns)
|
||||
fprintf(fptxt,"ITEM: ATOMS %s\n", columns);
|
||||
fprintf(fptxt, "ITEM: ATOMS %s\n", columns);
|
||||
else
|
||||
fprintf(fptxt,"ITEM: ATOMS\n");
|
||||
fprintf(fptxt, "ITEM: ATOMS\n");
|
||||
|
||||
// loop over processor chunks in file
|
||||
|
||||
for (i = 0; i < nchunk; i++) {
|
||||
fread(&n,sizeof(int),1,fp);
|
||||
fread(&n, sizeof(int), 1, fp);
|
||||
|
||||
// extend buffer to fit chunk size
|
||||
|
||||
if (n > maxbuf) {
|
||||
if (buf) delete [] buf;
|
||||
if (buf) delete[] buf;
|
||||
buf = new double[n];
|
||||
maxbuf = n;
|
||||
}
|
||||
|
||||
// read chunk and write as size_one values per line
|
||||
|
||||
fread(buf,sizeof(double),n,fp);
|
||||
fread(buf, sizeof(double), n, fp);
|
||||
n /= size_one;
|
||||
m = 0;
|
||||
for (j = 0; j < n; j++) {
|
||||
for (k = 0; k < size_one; k++) {
|
||||
if(k+1 < size_one) {
|
||||
fprintf(fptxt,"%g ",buf[m++]);
|
||||
if (k + 1 < size_one) {
|
||||
fprintf(fptxt, "%g ", buf[m++]);
|
||||
} else {
|
||||
fprintf(fptxt,"%g",buf[m++]);
|
||||
fprintf(fptxt, "%g", buf[m++]);
|
||||
}
|
||||
}
|
||||
fprintf(fptxt,"\n");
|
||||
fprintf(fptxt, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
printf(" " BIGINT_FORMAT,ntimestep);
|
||||
printf(" " BIGINT_FORMAT, ntimestep);
|
||||
fflush(stdout);
|
||||
}
|
||||
printf("\n");
|
||||
delete [] columns;
|
||||
delete [] magic_string;
|
||||
delete [] unit_style;
|
||||
delete[] columns;
|
||||
delete[] magic_string;
|
||||
delete[] unit_style;
|
||||
columns = nullptr;
|
||||
magic_string = nullptr;
|
||||
unit_style = nullptr;
|
||||
}
|
||||
|
||||
if (buf) delete [] buf;
|
||||
if (buf) delete[] buf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
321
tools/chain.f
321
tools/chain.f
@ -1,321 +0,0 @@
|
||||
c Create LAMMPS data file for collection of
|
||||
c polymer bead-spring chains of various lengths and bead sizes
|
||||
c Syntax: chain < def.chain > data.file
|
||||
c def.chain is input file that specifies the chains
|
||||
c data.file is output file that will be input for LAMMPS
|
||||
c includes image flags in data file so chains can be unraveled later
|
||||
|
||||
program chain
|
||||
|
||||
integer swaptype
|
||||
integer, allocatable :: nchain(:),nmonomer(:)
|
||||
integer, allocatable :: ntype(:),nbondtype(:)
|
||||
integer, allocatable :: type(:),molecule(:)
|
||||
integer, allocatable :: imagex(:),imagey(:),imagez(:)
|
||||
real*8, allocatable :: x(:),y(:),z(:)
|
||||
real*8, allocatable :: bondlength(:),restrict(:)
|
||||
common xprd,yprd,zprd,xboundlo,xboundhi,
|
||||
$ yboundlo,yboundhi,zboundlo,zboundhi
|
||||
real*8 random
|
||||
900 format(a)
|
||||
901 format(2f15.6,a)
|
||||
902 format(i3,f5.1)
|
||||
903 format(i10,i8,i8,3f10.4,3i4)
|
||||
904 format(i9,i3,2i9)
|
||||
|
||||
c read chain definitions
|
||||
|
||||
read (5,*)
|
||||
read (5,*)
|
||||
read (5,*) rhostar
|
||||
read (5,*) iseed
|
||||
read (5,*) nsets
|
||||
read (5,*) swaptype
|
||||
|
||||
allocate(nchain(nsets))
|
||||
allocate(nmonomer(nsets))
|
||||
allocate(ntype(nsets))
|
||||
allocate(nbondtype(nsets))
|
||||
allocate(bondlength(nsets))
|
||||
allocate(restrict(nsets))
|
||||
|
||||
do iset = 1,nsets
|
||||
read (5,*)
|
||||
read (5,*) nchain(iset)
|
||||
read (5,*) nmonomer(iset)
|
||||
read (5,*) ntype(iset)
|
||||
read (5,*) nbondtype(iset)
|
||||
read (5,*) bondlength(iset)
|
||||
read (5,*) restrict(iset)
|
||||
enddo
|
||||
|
||||
c natoms = total # of monomers
|
||||
|
||||
natoms = 0
|
||||
do iset = 1,nsets
|
||||
natoms = natoms + nchain(iset)*nmonomer(iset)
|
||||
enddo
|
||||
|
||||
allocate(x(natoms))
|
||||
allocate(y(natoms))
|
||||
allocate(z(natoms))
|
||||
allocate(type(natoms))
|
||||
allocate(molecule(natoms))
|
||||
allocate(imagex(natoms))
|
||||
allocate(imagey(natoms))
|
||||
allocate(imagez(natoms))
|
||||
|
||||
c setup box size (sigma = 1.0)
|
||||
|
||||
volume = natoms/rhostar
|
||||
xprd = volume**(1.0/3.0)
|
||||
yprd = xprd
|
||||
zprd = xprd
|
||||
|
||||
xboundlo = -xprd/2.0
|
||||
xboundhi = -xboundlo
|
||||
yboundlo = xboundlo
|
||||
yboundhi = xboundhi
|
||||
zboundlo = xboundlo
|
||||
zboundhi = xboundhi
|
||||
|
||||
c generate random chains
|
||||
c loop over sets and chains in each set
|
||||
|
||||
n = 0
|
||||
nmolecule = 0
|
||||
|
||||
do iset = 1,nsets
|
||||
do ichain = 1,nchain(iset)
|
||||
nmolecule = nmolecule + 1
|
||||
|
||||
c random starting point for the chain in the box
|
||||
|
||||
x1 = 0.0
|
||||
y1 = 0.0
|
||||
z1 = 0.0
|
||||
x2 = xboundlo + random(iseed)*xprd
|
||||
y2 = yboundlo + random(iseed)*yprd
|
||||
z2 = zboundlo + random(iseed)*zprd
|
||||
|
||||
c store 1st monomer of chain
|
||||
c 1st monomer is always in original box (image = 0)
|
||||
|
||||
call pbc(x2,y2,z2)
|
||||
n = n + 1
|
||||
x(n) = x2
|
||||
y(n) = y2
|
||||
z(n) = z2
|
||||
type(n) = ntype(iset)
|
||||
imagex(n) = 0
|
||||
imagey(n) = 0
|
||||
imagez(n) = 0
|
||||
if (swaptype == 0) then
|
||||
molecule(n) = nmolecule
|
||||
else
|
||||
molecule(n) = 1
|
||||
endif
|
||||
|
||||
c generate rest of monomers in this chain
|
||||
|
||||
do imonomer = 2,nmonomer(iset)
|
||||
|
||||
x0 = x1
|
||||
y0 = y1
|
||||
z0 = z1
|
||||
x1 = x2
|
||||
y1 = y2
|
||||
z1 = z2
|
||||
|
||||
c random point inside sphere of unit radius
|
||||
|
||||
10 xinner = 2.0*random(iseed) - 1.0
|
||||
yinner = 2.0*random(iseed) - 1.0
|
||||
zinner = 2.0*random(iseed) - 1.0
|
||||
rsq = xinner*xinner + yinner*yinner + zinner*zinner
|
||||
if (rsq > 1.0) goto 10
|
||||
|
||||
c project point to surface of sphere of unit radius
|
||||
|
||||
r = sqrt(rsq)
|
||||
xsurf = xinner/r
|
||||
ysurf = yinner/r
|
||||
zsurf = zinner/r
|
||||
|
||||
c create new point by scaling unit offsets by bondlength (sigma = 1.0)
|
||||
|
||||
x2 = x1 + xsurf*bondlength(iset)
|
||||
y2 = y1 + ysurf*bondlength(iset)
|
||||
z2 = z1 + zsurf*bondlength(iset)
|
||||
|
||||
c check that new point meets restriction requirement
|
||||
c only for 3rd monomer and beyond
|
||||
|
||||
dx = x2 - x0
|
||||
dy = y2 - y0
|
||||
dz = z2 - z0
|
||||
r = sqrt(dx*dx + dy*dy + dz*dz)
|
||||
|
||||
if (imonomer > 2 .and. r <= restrict(iset)) goto 10
|
||||
|
||||
c store new point
|
||||
c if delta to previous bead is large, then increment/decrement image flag
|
||||
|
||||
call pbc(x2,y2,z2)
|
||||
n = n + 1
|
||||
x(n) = x2
|
||||
y(n) = y2
|
||||
z(n) = z2
|
||||
type(n) = ntype(iset)
|
||||
|
||||
if (abs(x(n)-x(n-1)) < 2.0*bondlength(iset)) then
|
||||
imagex(n) = imagex(n-1)
|
||||
else if (x(n) - x(n-1) < 0.0) then
|
||||
imagex(n) = imagex(n-1) + 1
|
||||
else if (x(n) - x(n-1) > 0.0) then
|
||||
imagex(n) = imagex(n-1) - 1
|
||||
endif
|
||||
|
||||
if (abs(y(n)-y(n-1)) < 2.0*bondlength(iset)) then
|
||||
imagey(n) = imagey(n-1)
|
||||
else if (y(n) - y(n-1) < 0.0) then
|
||||
imagey(n) = imagey(n-1) + 1
|
||||
else if (y(n) - y(n-1) > 0.0) then
|
||||
imagey(n) = imagey(n-1) - 1
|
||||
endif
|
||||
|
||||
if (abs(z(n)-z(n-1)) < 2.0*bondlength(iset)) then
|
||||
imagez(n) = imagez(n-1)
|
||||
else if (z(n) - z(n-1) < 0.0) then
|
||||
imagez(n) = imagez(n-1) + 1
|
||||
else if (z(n) - z(n-1) > 0.0) then
|
||||
imagez(n) = imagez(n-1) - 1
|
||||
endif
|
||||
|
||||
if (swaptype == 0) then
|
||||
molecule(n) = nmolecule
|
||||
else if (swaptype == 1) then
|
||||
molecule(n) = imonomer
|
||||
else if (swaptype == 2) then
|
||||
if (imonomer <= nmonomer(iset)/2) then
|
||||
molecule(n) = imonomer
|
||||
else
|
||||
molecule(n) = nmonomer(iset)+1-imonomer
|
||||
endif
|
||||
endif
|
||||
|
||||
enddo
|
||||
|
||||
enddo
|
||||
enddo
|
||||
|
||||
c compute quantities needed for LAMMPS file
|
||||
|
||||
nbonds = 0
|
||||
ntypes = 0
|
||||
nbondtypes = 0
|
||||
do iset = 1,nsets
|
||||
nbonds = nbonds + nchain(iset)*(nmonomer(iset)-1)
|
||||
if (ntype(iset) > ntypes) ntypes = ntype(iset)
|
||||
if (nbondtype(iset) > nbondtypes)
|
||||
$ nbondtypes = nbondtype(iset)
|
||||
enddo
|
||||
|
||||
c write out LAMMPS file
|
||||
|
||||
write (6,900) 'LAMMPS FENE chain data file'
|
||||
write (6,*)
|
||||
|
||||
write (6,*) natoms,' atoms'
|
||||
write (6,*) nbonds,' bonds'
|
||||
write (6,*) 0,' angles'
|
||||
write (6,*) 0,' dihedrals'
|
||||
write (6,*) 0,' impropers'
|
||||
write (6,*)
|
||||
|
||||
write (6,*) ntypes,' atom types'
|
||||
write (6,*) nbondtypes,' bond types'
|
||||
write (6,*) 0,' angle types'
|
||||
write (6,*) 0,' dihedral types'
|
||||
write (6,*) 0,' improper types'
|
||||
write (6,*)
|
||||
|
||||
write (6,901) xboundlo,xboundhi,' xlo xhi'
|
||||
write (6,901) yboundlo,yboundhi,' ylo yhi'
|
||||
write (6,901) zboundlo,zboundhi,' zlo zhi'
|
||||
|
||||
write (6,*)
|
||||
write (6,900) 'Masses'
|
||||
write (6,*)
|
||||
|
||||
do i = 1,ntypes
|
||||
write (6,902) i,1.0
|
||||
enddo
|
||||
|
||||
write (6,*)
|
||||
write (6,900) 'Atoms'
|
||||
write (6,*)
|
||||
|
||||
do i = 1,natoms
|
||||
write (6,903) i,molecule(i),type(i),x(i),y(i),z(i),
|
||||
$ imagex(i),imagey(i),imagez(i)
|
||||
enddo
|
||||
|
||||
if (nbonds > 0) then
|
||||
|
||||
write (6,*)
|
||||
write (6,900) 'Bonds'
|
||||
write (6,*)
|
||||
|
||||
n = 0
|
||||
m = 0
|
||||
do iset = 1,nsets
|
||||
do ichain = 1,nchain(iset)
|
||||
do imonomer = 1,nmonomer(iset)
|
||||
n = n + 1
|
||||
if (imonomer /= nmonomer(iset)) then
|
||||
m = m + 1
|
||||
write (6,904) m,nbondtype(iset),n,n+1
|
||||
endif
|
||||
enddo
|
||||
enddo
|
||||
enddo
|
||||
|
||||
endif
|
||||
|
||||
end
|
||||
|
||||
c ************
|
||||
c Subroutines
|
||||
c ************
|
||||
|
||||
c periodic boundary conditions - map atom back into periodic box
|
||||
|
||||
subroutine pbc(x,y,z)
|
||||
common xprd,yprd,zprd,xboundlo,xboundhi,
|
||||
$ yboundlo,yboundhi,zboundlo,zboundhi
|
||||
|
||||
if (x < xboundlo) x = x + xprd
|
||||
if (x >= xboundhi) x = x - xprd
|
||||
if (y < yboundlo) y = y + yprd
|
||||
if (y >= yboundhi) y = y - yprd
|
||||
if (z < zboundlo) z = z + zprd
|
||||
if (z >= zboundhi) z = z - zprd
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
c RNG from Numerical Recipes
|
||||
|
||||
real*8 function random(iseed)
|
||||
real*8 aa,mm,sseed
|
||||
parameter (aa=16807.0D0,mm=2147483647.0D0)
|
||||
|
||||
sseed = iseed
|
||||
sseed = mod(aa*sseed,mm)
|
||||
random = sseed/mm
|
||||
iseed = sseed
|
||||
|
||||
return
|
||||
end
|
||||
333
tools/chain.f90
Normal file
333
tools/chain.f90
Normal file
@ -0,0 +1,333 @@
|
||||
! Create LAMMPS data file for collection of
|
||||
! polymer bead-spring chains of various lengths and bead sizes
|
||||
! Syntax: chain < def.chain > data.file
|
||||
! def.chain is input file that specifies the chains
|
||||
! data.file is output file that will be input for LAMMPS
|
||||
! includes image flags in data file so chains can be unraveled later
|
||||
|
||||
MODULE boxchain
|
||||
IMPLICIT NONE
|
||||
PUBLIC
|
||||
REAL(KIND=8) :: xprd,yprd,zprd,xboundlo,xboundhi,yboundlo,yboundhi,zboundlo,zboundhi
|
||||
|
||||
CONTAINS
|
||||
|
||||
! periodic boundary conditions - map atom back into periodic box
|
||||
|
||||
SUBROUTINE pbc(x,y,z)
|
||||
REAL(KIND=8), INTENT(inout) :: x,y,z
|
||||
|
||||
IF (x < xboundlo) x = x + xprd
|
||||
IF (x >= xboundhi) x = x - xprd
|
||||
IF (y < yboundlo) y = y + yprd
|
||||
IF (y >= yboundhi) y = y - yprd
|
||||
IF (z < zboundlo) z = z + zprd
|
||||
IF (z >= zboundhi) z = z - zprd
|
||||
|
||||
END SUBROUTINE pbc
|
||||
END MODULE boxchain
|
||||
|
||||
MODULE rngchain
|
||||
IMPLICIT NONE
|
||||
|
||||
CONTAINS
|
||||
|
||||
! *very* minimal random number generator
|
||||
|
||||
REAL(KIND=8) FUNCTION random(iseed)
|
||||
IMPLICIT NONE
|
||||
INTEGER, INTENT(inout) :: iseed
|
||||
REAL(KIND=8), PARAMETER :: aa=16807.0_8, mm=2147483647.0_8
|
||||
REAL(KIND=8) :: sseed
|
||||
|
||||
sseed = REAL(iseed)
|
||||
sseed = MOD(aa*sseed,mm)
|
||||
random = sseed/mm
|
||||
iseed = INT(sseed)
|
||||
END FUNCTION random
|
||||
END MODULE rngchain
|
||||
|
||||
PROGRAM chain
|
||||
USE boxchain
|
||||
USE rngchain
|
||||
IMPLICIT NONE
|
||||
|
||||
INTEGER, ALLOCATABLE :: nchain(:),nmonomer(:)
|
||||
INTEGER, ALLOCATABLE :: ntype(:),nbondtype(:)
|
||||
INTEGER, ALLOCATABLE :: atomtype(:),molecule(:)
|
||||
INTEGER, ALLOCATABLE :: imagex(:),imagey(:),imagez(:)
|
||||
REAL(KIND=8), ALLOCATABLE :: x(:),y(:),z(:)
|
||||
REAL(KIND=8), ALLOCATABLE :: bondlength(:),restrict(:)
|
||||
INTEGER :: i, n, m, nmolecule, natoms, ntypes, nbonds, nbondtypes
|
||||
INTEGER :: swaptype, iseed, nsets, iset, ichain, imonomer
|
||||
REAL(KIND=8) :: r, rhostar, volume, rsq, xinner, yinner, zinner, xsurf, ysurf, zsurf
|
||||
REAL(KIND=8) :: x0, y0, z0, x1, y1, z1, x2, y2, z2, dx, dy, dz
|
||||
|
||||
LOGICAL :: again
|
||||
|
||||
! read chain definitions
|
||||
|
||||
READ (5,*)
|
||||
READ (5,*)
|
||||
READ (5,*) rhostar
|
||||
READ (5,*) iseed
|
||||
READ (5,*) nsets
|
||||
READ (5,*) swaptype
|
||||
|
||||
ALLOCATE(nchain(nsets))
|
||||
ALLOCATE(nmonomer(nsets))
|
||||
ALLOCATE(ntype(nsets))
|
||||
ALLOCATE(nbondtype(nsets))
|
||||
ALLOCATE(bondlength(nsets))
|
||||
ALLOCATE(restrict(nsets))
|
||||
|
||||
DO iset = 1,nsets
|
||||
READ (5,*)
|
||||
READ (5,*) nchain(iset)
|
||||
READ (5,*) nmonomer(iset)
|
||||
READ (5,*) ntype(iset)
|
||||
READ (5,*) nbondtype(iset)
|
||||
READ (5,*) bondlength(iset)
|
||||
READ (5,*) restrict(iset)
|
||||
ENDDO
|
||||
|
||||
! natoms = total # of monomers
|
||||
|
||||
natoms = 0
|
||||
DO iset = 1,nsets
|
||||
natoms = natoms + nchain(iset)*nmonomer(iset)
|
||||
ENDDO
|
||||
|
||||
ALLOCATE(x(natoms))
|
||||
ALLOCATE(y(natoms))
|
||||
ALLOCATE(z(natoms))
|
||||
ALLOCATE(atomtype(natoms))
|
||||
ALLOCATE(molecule(natoms))
|
||||
ALLOCATE(imagex(natoms))
|
||||
ALLOCATE(imagey(natoms))
|
||||
ALLOCATE(imagez(natoms))
|
||||
|
||||
! setup box size (sigma = 1.0)
|
||||
|
||||
volume = natoms/rhostar
|
||||
xprd = volume**(1.0/3.0)
|
||||
yprd = xprd
|
||||
zprd = xprd
|
||||
|
||||
xboundlo = -xprd/2.0
|
||||
xboundhi = -xboundlo
|
||||
yboundlo = xboundlo
|
||||
yboundhi = xboundhi
|
||||
zboundlo = xboundlo
|
||||
zboundhi = xboundhi
|
||||
|
||||
! generate random chains
|
||||
! loop over sets and chains in each set
|
||||
|
||||
n = 0
|
||||
nmolecule = 0
|
||||
|
||||
DO iset = 1,nsets
|
||||
DO ichain = 1,nchain(iset)
|
||||
nmolecule = nmolecule + 1
|
||||
|
||||
! random starting point for the chain in the box
|
||||
|
||||
x1 = 0.0
|
||||
y1 = 0.0
|
||||
z1 = 0.0
|
||||
x2 = xboundlo + random(iseed)*xprd
|
||||
y2 = yboundlo + random(iseed)*yprd
|
||||
z2 = zboundlo + random(iseed)*zprd
|
||||
|
||||
! store 1st monomer of chain
|
||||
! 1st monomer is always in original box (image = 0)
|
||||
|
||||
CALL pbc(x2,y2,z2)
|
||||
|
||||
n = n + 1
|
||||
x(n) = x2
|
||||
y(n) = y2
|
||||
z(n) = z2
|
||||
atomtype(n) = ntype(iset)
|
||||
imagex(n) = 0
|
||||
imagey(n) = 0
|
||||
imagez(n) = 0
|
||||
IF (swaptype == 0) THEN
|
||||
molecule(n) = nmolecule
|
||||
ELSE
|
||||
molecule(n) = 1
|
||||
END IF
|
||||
|
||||
! generate rest of monomers in this chain
|
||||
|
||||
DO imonomer = 2, nmonomer(iset)
|
||||
|
||||
x0 = x1
|
||||
y0 = y1
|
||||
z0 = z1
|
||||
x1 = x2
|
||||
y1 = y2
|
||||
z1 = z2
|
||||
|
||||
again = .TRUE.
|
||||
DO WHILE (again)
|
||||
! random point inside sphere of unit radius
|
||||
|
||||
xinner = 2.0*random(iseed) - 1.0
|
||||
yinner = 2.0*random(iseed) - 1.0
|
||||
zinner = 2.0*random(iseed) - 1.0
|
||||
rsq = xinner*xinner + yinner*yinner + zinner*zinner
|
||||
IF (rsq > 1.0) CYCLE
|
||||
|
||||
! project point to surface of sphere of unit radius
|
||||
|
||||
r = SQRT(rsq)
|
||||
xsurf = xinner/r
|
||||
ysurf = yinner/r
|
||||
zsurf = zinner/r
|
||||
|
||||
! create new point by scaling unit offsets by bondlength (sigma = 1.0)
|
||||
|
||||
x2 = x1 + xsurf*bondlength(iset)
|
||||
y2 = y1 + ysurf*bondlength(iset)
|
||||
z2 = z1 + zsurf*bondlength(iset)
|
||||
|
||||
! check that new point meets restriction requirement
|
||||
! only for 3rd monomer and beyond
|
||||
|
||||
dx = x2 - x0
|
||||
dy = y2 - y0
|
||||
dz = z2 - z0
|
||||
r = SQRT(dx*dx + dy*dy + dz*dz)
|
||||
|
||||
IF (imonomer > 2 .AND. r <= restrict(iset)) CYCLE
|
||||
|
||||
! store new point
|
||||
again = .FALSE.
|
||||
|
||||
! if delta to previous bead is large, then increment/decrement image flag
|
||||
|
||||
CALL pbc(x2,y2,z2)
|
||||
n = n + 1
|
||||
x(n) = x2
|
||||
y(n) = y2
|
||||
z(n) = z2
|
||||
atomtype(n) = ntype(iset)
|
||||
|
||||
IF (ABS(x(n)-x(n-1)) < 2.0*bondlength(iset)) THEN
|
||||
imagex(n) = imagex(n-1)
|
||||
ELSE IF (x(n) - x(n-1) < 0.0) THEN
|
||||
imagex(n) = imagex(n-1) + 1
|
||||
ELSE IF (x(n) - x(n-1) > 0.0) THEN
|
||||
imagex(n) = imagex(n-1) - 1
|
||||
ENDIF
|
||||
|
||||
IF (ABS(y(n)-y(n-1)) < 2.0*bondlength(iset)) THEN
|
||||
imagey(n) = imagey(n-1)
|
||||
ELSE IF (y(n) - y(n-1) < 0.0) THEN
|
||||
imagey(n) = imagey(n-1) + 1
|
||||
ELSE IF (y(n) - y(n-1) > 0.0) THEN
|
||||
imagey(n) = imagey(n-1) - 1
|
||||
ENDIF
|
||||
|
||||
IF (ABS(z(n)-z(n-1)) < 2.0*bondlength(iset)) THEN
|
||||
imagez(n) = imagez(n-1)
|
||||
ELSE IF (z(n) - z(n-1) < 0.0) THEN
|
||||
imagez(n) = imagez(n-1) + 1
|
||||
ELSE IF (z(n) - z(n-1) > 0.0) THEN
|
||||
imagez(n) = imagez(n-1) - 1
|
||||
ENDIF
|
||||
|
||||
IF (swaptype == 0) THEN
|
||||
molecule(n) = nmolecule
|
||||
ELSE IF (swaptype == 1) THEN
|
||||
molecule(n) = imonomer
|
||||
ELSE IF (swaptype == 2) THEN
|
||||
IF (imonomer <= nmonomer(iset)/2) THEN
|
||||
molecule(n) = imonomer
|
||||
ELSE
|
||||
molecule(n) = nmonomer(iset)+1-imonomer
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDDO
|
||||
ENDDO
|
||||
|
||||
ENDDO
|
||||
ENDDO
|
||||
|
||||
! compute quantities needed for LAMMPS file
|
||||
|
||||
nbonds = 0
|
||||
ntypes = 0
|
||||
nbondtypes = 0
|
||||
DO iset = 1,nsets
|
||||
nbonds = nbonds + nchain(iset)*(nmonomer(iset)-1)
|
||||
IF (ntype(iset) > ntypes) ntypes = ntype(iset)
|
||||
IF (nbondtype(iset) > nbondtypes) nbondtypes = nbondtype(iset)
|
||||
ENDDO
|
||||
|
||||
! write out LAMMPS file
|
||||
|
||||
WRITE (6,*) 'LAMMPS FENE chain data file'
|
||||
WRITE (6,*)
|
||||
|
||||
WRITE (6,*) natoms,' atoms'
|
||||
WRITE (6,*) nbonds,' bonds'
|
||||
WRITE (6,*) 0,' angles'
|
||||
WRITE (6,*) 0,' dihedrals'
|
||||
WRITE (6,*) 0,' impropers'
|
||||
WRITE (6,*)
|
||||
|
||||
WRITE (6,*) ntypes,' atom types'
|
||||
WRITE (6,*) nbondtypes,' bond types'
|
||||
WRITE (6,*) 0,' angle types'
|
||||
WRITE (6,*) 0,' dihedral types'
|
||||
WRITE (6,*) 0,' improper types'
|
||||
WRITE (6,*)
|
||||
|
||||
WRITE (6,'(2F15.6,A)') xboundlo,xboundhi,' xlo xhi'
|
||||
WRITE (6,'(2F15.6,A)') yboundlo,yboundhi,' ylo yhi'
|
||||
WRITE (6,'(2F15.6,A)') zboundlo,zboundhi,' zlo zhi'
|
||||
|
||||
WRITE (6,*)
|
||||
WRITE (6,*) 'Masses'
|
||||
WRITE (6,*)
|
||||
|
||||
DO i = 1,ntypes
|
||||
WRITE (6,'(i3,f5.1)') i,1.0
|
||||
ENDDO
|
||||
|
||||
WRITE (6,*)
|
||||
WRITE (6,*) 'Atoms # molecular'
|
||||
WRITE (6,*)
|
||||
|
||||
DO i = 1,natoms
|
||||
WRITE (6,'(I10,I8,I8,3F10.4,3I4)') i,molecule(i),atomtype(i),x(i),y(i),z(i), &
|
||||
imagex(i),imagey(i),imagez(i)
|
||||
ENDDO
|
||||
|
||||
IF (nbonds > 0) THEN
|
||||
WRITE (6,*)
|
||||
WRITE (6,*) 'Bonds'
|
||||
WRITE (6,*)
|
||||
|
||||
n = 0
|
||||
m = 0
|
||||
DO iset = 1,nsets
|
||||
DO ichain = 1,nchain(iset)
|
||||
DO imonomer = 1,nmonomer(iset)
|
||||
n = n + 1
|
||||
IF (imonomer /= nmonomer(iset)) THEN
|
||||
m = m + 1
|
||||
WRITE (6,'(i9,i3,2i9)') m,nbondtype(iset),n,n+1
|
||||
ENDIF
|
||||
ENDDO
|
||||
ENDDO
|
||||
ENDDO
|
||||
ENDIF
|
||||
|
||||
DEALLOCATE(nchain, nmonomer, ntype, nbondtype, bondlength, restrict)
|
||||
DEALLOCATE(x, y, z, atomtype, molecule, imagex, imagey, imagez)
|
||||
|
||||
END PROGRAM chain
|
||||
@ -34,6 +34,7 @@ exclude:
|
||||
- lib/hdnnp
|
||||
- lib/kim
|
||||
- lib/kokkos
|
||||
- lib/latte
|
||||
- lib/machdyn
|
||||
- lib/mdi
|
||||
- lib/mscg
|
||||
@ -41,6 +42,7 @@ exclude:
|
||||
- lib/plumed
|
||||
- lib/quip
|
||||
- lib/scafacos
|
||||
- lib/voronoi
|
||||
- src/Make.sh
|
||||
patterns:
|
||||
- "*.c"
|
||||
@ -51,6 +53,7 @@ patterns:
|
||||
- "*.py"
|
||||
- "*.rst"
|
||||
- "*.sh"
|
||||
- "*.f90"
|
||||
- ".gitignore"
|
||||
- "README"
|
||||
- "requirements.txt"
|
||||
|
||||
@ -1,233 +0,0 @@
|
||||
c Create LAMMPS 2003 input file for 2d LJ simulation of micelles
|
||||
c
|
||||
c Syntax: micelle2d < def.micelle2d > data.file
|
||||
c
|
||||
c def file contains size of system and number to turn into surfactants
|
||||
c attaches a random surfactant tail(s) to random head
|
||||
c if nonflag is set, will attach 2nd-neighbor bonds in surfactant
|
||||
c solvent atoms = type 1
|
||||
c micelle heads = type 2
|
||||
c micelle tails = type 3,4,5,etc.
|
||||
|
||||
program micelle2d
|
||||
parameter (maxatom=100000,maxbond=10000)
|
||||
real*4 x(2,maxatom)
|
||||
integer type(maxatom),molecule(maxatom)
|
||||
integer bondatom(2,maxbond),bondtype(maxbond)
|
||||
common xprd,yprd,zprd,xboundlo,xboundhi,yboundlo,yboundhi,
|
||||
$ zboundlo,zboundhi
|
||||
999 format (3i7,3f8.3)
|
||||
998 format (4i7)
|
||||
|
||||
read (5,*)
|
||||
read (5,*)
|
||||
read (5,*) rhostar
|
||||
read (5,*) iseed
|
||||
read (5,*) nx,ny
|
||||
read (5,*) nsurf
|
||||
read (5,*) r0
|
||||
read (5,*) ntails
|
||||
read (5,*) nonflag
|
||||
|
||||
natoms = nx*ny
|
||||
if (natoms+nsurf*ntails.gt.maxatom) then
|
||||
write (6,*) 'Too many atoms - boost maxatom'
|
||||
call exit(0)
|
||||
endif
|
||||
|
||||
nbonds = nsurf*ntails
|
||||
if (nonflag.eq.1) nbonds = nbonds + nsurf*(ntails-1)
|
||||
if (nbonds.gt.maxbond) then
|
||||
write (6,*) 'Too many surfactants - boost maxbond'
|
||||
call exit(0)
|
||||
endif
|
||||
|
||||
c box size
|
||||
|
||||
rlattice = (1.0/rhostar) ** 0.5
|
||||
|
||||
xboundlo = 0.0
|
||||
xboundhi = nx*rlattice
|
||||
yboundlo = 0.0
|
||||
yboundhi = ny*rlattice
|
||||
zboundlo = -0.1
|
||||
zboundhi = 0.1
|
||||
|
||||
sigma = 1.0
|
||||
|
||||
xprd = xboundhi - xboundlo
|
||||
yprd = yboundhi - yboundlo
|
||||
zprd = zboundhi - zboundlo
|
||||
|
||||
c initial square lattice of solvents
|
||||
|
||||
m = 0
|
||||
do j = 1,ny
|
||||
do i = 1,nx
|
||||
m = m + 1
|
||||
x(1,m) = xboundlo + (i-1)*rlattice
|
||||
x(2,m) = yboundlo + (j-1)*rlattice
|
||||
molecule(m) = 0
|
||||
type(m) = 1
|
||||
enddo
|
||||
enddo
|
||||
|
||||
c turn some into surfactants with molecule ID
|
||||
c head changes to type 2
|
||||
c create ntails for each head of types 3,4,...
|
||||
c each tail is at distance r0 away in straight line with random orientation
|
||||
|
||||
do i = 1,nsurf
|
||||
|
||||
10 m = random(iseed)*natoms + 1
|
||||
if (m.gt.natoms) m = natoms
|
||||
if (molecule(m) .ne. 0) goto 10
|
||||
|
||||
molecule(m) = i
|
||||
type(m) = 2
|
||||
|
||||
angle = random(iseed)*2.0*3.1415926
|
||||
do j = 1,ntails
|
||||
k = (i-1)*ntails + j
|
||||
x(1,natoms+k) = x(1,m) + cos(angle)*j*r0*sigma
|
||||
x(2,natoms+k) = x(2,m) + sin(angle)*j*r0*sigma
|
||||
molecule(natoms+k) = i
|
||||
type(natoms+k) = 2+j
|
||||
call pbc(x(1,natoms+k),x(2,natoms+k))
|
||||
if (j.eq.1) bondatom(1,k) = m
|
||||
if (j.ne.1) bondatom(1,k) = natoms+k-1
|
||||
bondatom(2,k) = natoms+k
|
||||
bondtype(k) = 1
|
||||
enddo
|
||||
|
||||
enddo
|
||||
|
||||
c if nonflag is set, add (ntails-1) 2nd nearest neighbor bonds to end
|
||||
c of bond list
|
||||
c k = location in bondatom list where nearest neighbor bonds for
|
||||
c this surfactant are stored
|
||||
|
||||
if (nonflag.eq.1) then
|
||||
|
||||
nbonds = nsurf*ntails
|
||||
do i = 1,nsurf
|
||||
do j = 1,ntails-1
|
||||
k = (i-1)*ntails + j
|
||||
nbonds = nbonds + 1
|
||||
bondatom(1,nbonds) = bondatom(1,k)
|
||||
bondatom(2,nbonds) = bondatom(2,k+1)
|
||||
bondtype(nbonds) = 2
|
||||
enddo
|
||||
enddo
|
||||
|
||||
endif
|
||||
|
||||
c write LAMMPS data file
|
||||
|
||||
natoms = natoms + nsurf*ntails
|
||||
nbonds = nsurf*ntails
|
||||
if (nonflag.eq.1) nbonds = nbonds + nsurf*(ntails-1)
|
||||
ntypes = 2 + ntails
|
||||
nbondtypes = 1
|
||||
if (nonflag.eq.1) nbondtypes = 2
|
||||
|
||||
if (nsurf.eq.0) then
|
||||
ntypes = 1
|
||||
nbondtypes = 0
|
||||
endif
|
||||
|
||||
write (6,*) 'LAMMPS 2d micelle data file'
|
||||
write (6,*)
|
||||
|
||||
write (6,*) natoms,' atoms'
|
||||
write (6,*) nbonds,' bonds'
|
||||
write (6,*) 0,' angles'
|
||||
write (6,*) 0,' dihedrals'
|
||||
write (6,*) 0,' impropers'
|
||||
write (6,*)
|
||||
|
||||
write (6,*) ntypes,' atom types'
|
||||
write (6,*) nbondtypes,' bond types'
|
||||
write (6,*) 0,' angle types'
|
||||
write (6,*) 0,' dihedral types'
|
||||
write (6,*) 0,' improper types'
|
||||
write (6,*)
|
||||
|
||||
write (6,*) xboundlo,xboundhi,' xlo xhi'
|
||||
write (6,*) yboundlo,yboundhi,' ylo yhi'
|
||||
write (6,*) zboundlo,zboundhi,' zlo zhi'
|
||||
|
||||
write (6,*)
|
||||
write (6,*) 'Masses'
|
||||
write (6,*)
|
||||
|
||||
do i = 1,ntypes
|
||||
write (6,*) i,1.0
|
||||
enddo
|
||||
|
||||
write (6,*)
|
||||
write (6,*) 'Atoms'
|
||||
write (6,*)
|
||||
|
||||
do i = 1,natoms
|
||||
write (6,999) i,molecule(i),type(i),x(1,i),x(2,i),0.0
|
||||
enddo
|
||||
|
||||
if (nsurf.gt.0) then
|
||||
|
||||
write (6,*)
|
||||
write (6,*) 'Bonds'
|
||||
write (6,*)
|
||||
|
||||
do i = 1,nbonds
|
||||
write (6,998) i,bondtype(i),bondatom(1,i),bondatom(2,i)
|
||||
enddo
|
||||
|
||||
endif
|
||||
|
||||
c write Xmovie bond geometry file
|
||||
|
||||
open(1,file='bond.micelle')
|
||||
|
||||
write (1,*) 'ITEM: BONDS'
|
||||
do i = 1,nbonds
|
||||
write (1,*) bondtype(i),bondatom(1,i),bondatom(2,i)
|
||||
enddo
|
||||
|
||||
close(1)
|
||||
|
||||
end
|
||||
|
||||
|
||||
c ************
|
||||
c Subroutines
|
||||
c ************
|
||||
|
||||
c periodic boundary conditions - map atom back into periodic box
|
||||
|
||||
subroutine pbc(x,y)
|
||||
common xprd,yprd,zprd,xboundlo,xboundhi,yboundlo,yboundhi,
|
||||
$ zboundlo,zboundhi
|
||||
|
||||
if (x.lt.xboundlo) x = x + xprd
|
||||
if (x.ge.xboundhi) x = x - xprd
|
||||
if (y.lt.yboundlo) y = y + yprd
|
||||
if (y.ge.yboundhi) y = y - yprd
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
c RNG - compute in double precision, return single
|
||||
|
||||
real*4 function random(iseed)
|
||||
real*8 aa,mm,sseed
|
||||
parameter (aa=16807.0D0,mm=2147483647.0D0)
|
||||
|
||||
sseed = iseed
|
||||
sseed = mod(aa*sseed,mm)
|
||||
random = sseed/mm
|
||||
iseed = sseed
|
||||
|
||||
return
|
||||
end
|
||||
231
tools/micelle2d.f90
Normal file
231
tools/micelle2d.f90
Normal file
@ -0,0 +1,231 @@
|
||||
! Create LAMMPS data file for 2d LJ simulation of micelles
|
||||
!
|
||||
! Syntax: micelle2d < def.micelle2d > data.file
|
||||
!
|
||||
! def file contains size of system and number to turn into surfactants
|
||||
! attaches a random surfactant tail(s) to random head
|
||||
! if nonflag is set, will attach 2nd-neighbor bonds in surfactant
|
||||
! solvent atoms = type 1
|
||||
! micelle heads = type 2
|
||||
! micelle tails = type 3,4,5,etc.
|
||||
|
||||
MODULE boxmicelle
|
||||
IMPLICIT NONE
|
||||
PUBLIC
|
||||
REAL(KIND=8) :: xprd,yprd,zprd,xboundlo,xboundhi,yboundlo,yboundhi,zboundlo,zboundhi
|
||||
|
||||
CONTAINS
|
||||
|
||||
! periodic boundary conditions - map atom back into periodic box
|
||||
|
||||
SUBROUTINE pbc(x,y)
|
||||
REAL(KIND=8), INTENT(inout) :: x,y
|
||||
|
||||
IF (x < xboundlo) x = x + xprd
|
||||
IF (x >= xboundhi) x = x - xprd
|
||||
IF (y < yboundlo) y = y + yprd
|
||||
IF (y >= yboundhi) y = y - yprd
|
||||
|
||||
END SUBROUTINE pbc
|
||||
END MODULE boxmicelle
|
||||
|
||||
MODULE rngmicelle
|
||||
IMPLICIT NONE
|
||||
|
||||
CONTAINS
|
||||
|
||||
! *very* minimal random number generator
|
||||
|
||||
REAL(KIND=8) FUNCTION random(iseed)
|
||||
IMPLICIT NONE
|
||||
INTEGER, INTENT(inout) :: iseed
|
||||
REAL(KIND=8), PARAMETER :: aa=16807.0_8, mm=2147483647.0_8
|
||||
REAL(KIND=8) :: sseed
|
||||
|
||||
sseed = REAL(iseed)
|
||||
sseed = MOD(aa*sseed,mm)
|
||||
random = sseed/mm
|
||||
iseed = INT(sseed)
|
||||
END FUNCTION random
|
||||
END MODULE rngmicelle
|
||||
|
||||
PROGRAM micelle2d
|
||||
USE boxmicelle
|
||||
USE rngmicelle
|
||||
IMPLICIT NONE
|
||||
|
||||
REAL(kind=8), ALLOCATABLE :: x(:,:)
|
||||
INTEGER, ALLOCATABLE :: atomtype(:), molecule(:)
|
||||
INTEGER, ALLOCATABLE :: bondatom(:,:),bondtype(:)
|
||||
INTEGER :: natoms, maxatom, ntypes, nbonds, nbondtypes, iseed
|
||||
INTEGER :: i, j, k, m, nx, ny, nsurf, ntails, nonflag
|
||||
REAL(kind=8) :: rhostar, rlattice, sigma, angle,r0
|
||||
REAL(kind=8), parameter :: pi = 3.14159265358979323846_8
|
||||
LOGICAL :: again
|
||||
|
||||
READ(5,*)
|
||||
READ(5,*)
|
||||
READ(5,*) rhostar
|
||||
READ(5,*) iseed
|
||||
READ(5,*) nx,ny
|
||||
READ(5,*) nsurf
|
||||
READ(5,*) r0
|
||||
READ(5,*) ntails
|
||||
READ(5,*) nonflag
|
||||
|
||||
natoms = nx*ny
|
||||
maxatom = natoms + nsurf*ntails
|
||||
ALLOCATE(x(2,maxatom), molecule(maxatom), atomtype(maxatom))
|
||||
|
||||
nbonds = nsurf*ntails
|
||||
IF (nonflag.EQ.1) nbonds = nbonds + nsurf*(ntails-1)
|
||||
ALLOCATE(bondatom(2,nbonds), bondtype(nbonds))
|
||||
|
||||
! box size
|
||||
|
||||
rlattice = (1.0_8/rhostar) ** 0.5_8
|
||||
|
||||
xboundlo = 0.0_8
|
||||
xboundhi = nx*rlattice
|
||||
yboundlo = 0.0_8
|
||||
yboundhi = ny*rlattice
|
||||
zboundlo = -0.1_8
|
||||
zboundhi = 0.1_8
|
||||
|
||||
sigma = 1.0_8
|
||||
|
||||
xprd = xboundhi - xboundlo
|
||||
yprd = yboundhi - yboundlo
|
||||
zprd = zboundhi - zboundlo
|
||||
|
||||
! initial square lattice of solvents
|
||||
|
||||
m = 0
|
||||
DO j = 1,ny
|
||||
DO i = 1,nx
|
||||
m = m + 1
|
||||
x(1,m) = xboundlo + (i-1)*rlattice
|
||||
x(2,m) = yboundlo + (j-1)*rlattice
|
||||
molecule(m) = 0
|
||||
atomtype(m) = 1
|
||||
ENDDO
|
||||
ENDDO
|
||||
|
||||
! turn some into surfactants with molecule ID
|
||||
! head changes to type 2
|
||||
! create ntails for each head of types 3,4,...
|
||||
! each tail is at distance r0 away in straight line with random orientation
|
||||
|
||||
DO i = 1,nsurf
|
||||
|
||||
again = .TRUE.
|
||||
DO WHILE(again)
|
||||
m = INT(random(iseed)*natoms + 1)
|
||||
IF (m > natoms) m = natoms
|
||||
IF (molecule(m) /= 0) CYCLE
|
||||
again = .FALSE.
|
||||
END DO
|
||||
molecule(m) = i
|
||||
atomtype(m) = 2
|
||||
|
||||
angle = random(iseed)*2.0_8*pi
|
||||
DO j = 1,ntails
|
||||
k = (i-1)*ntails + j
|
||||
x(1,natoms+k) = x(1,m) + COS(angle)*j*r0*sigma
|
||||
x(2,natoms+k) = x(2,m) + SIN(angle)*j*r0*sigma
|
||||
molecule(natoms+k) = i
|
||||
atomtype(natoms+k) = 2+j
|
||||
CALL pbc(x(1,natoms+k),x(2,natoms+k))
|
||||
IF (j == 1) bondatom(1,k) = m
|
||||
IF (j /= 1) bondatom(1,k) = natoms+k-1
|
||||
bondatom(2,k) = natoms+k
|
||||
bondtype(k) = 1
|
||||
ENDDO
|
||||
|
||||
ENDDO
|
||||
|
||||
! if nonflag is set, add (ntails-1) 2nd nearest neighbor bonds to end
|
||||
! of bond list
|
||||
! k = location in bondatom list where nearest neighbor bonds for
|
||||
! this surfactant are stored
|
||||
|
||||
IF (nonflag == 1) THEN
|
||||
|
||||
nbonds = nsurf*ntails
|
||||
DO i = 1,nsurf
|
||||
DO j = 1,ntails-1
|
||||
k = (i-1)*ntails + j
|
||||
nbonds = nbonds + 1
|
||||
bondatom(1,nbonds) = bondatom(1,k)
|
||||
bondatom(2,nbonds) = bondatom(2,k+1)
|
||||
bondtype(nbonds) = 2
|
||||
ENDDO
|
||||
ENDDO
|
||||
|
||||
ENDIF
|
||||
|
||||
! write LAMMPS data file
|
||||
|
||||
natoms = natoms + nsurf*ntails
|
||||
nbonds = nsurf*ntails
|
||||
IF (nonflag == 1) nbonds = nbonds + nsurf*(ntails-1)
|
||||
ntypes = 2 + ntails
|
||||
nbondtypes = 1
|
||||
IF (nonflag == 1) nbondtypes = 2
|
||||
|
||||
IF (nsurf == 0) THEN
|
||||
ntypes = 1
|
||||
nbondtypes = 0
|
||||
ENDIF
|
||||
|
||||
WRITE (6,*) 'LAMMPS 2d micelle data file'
|
||||
WRITE (6,*)
|
||||
|
||||
WRITE (6,*) natoms,' atoms'
|
||||
WRITE (6,*) nbonds,' bonds'
|
||||
WRITE (6,*) 0,' angles'
|
||||
WRITE (6,*) 0,' dihedrals'
|
||||
WRITE (6,*) 0,' impropers'
|
||||
WRITE (6,*)
|
||||
|
||||
WRITE (6,*) ntypes,' atom types'
|
||||
WRITE (6,*) nbondtypes,' bond types'
|
||||
WRITE (6,*) 0,' angle types'
|
||||
WRITE (6,*) 0,' dihedral types'
|
||||
WRITE (6,*) 0,' improper types'
|
||||
WRITE (6,*)
|
||||
|
||||
WRITE (6,*) xboundlo,xboundhi,' xlo xhi'
|
||||
WRITE (6,*) yboundlo,yboundhi,' ylo yhi'
|
||||
WRITE (6,*) zboundlo,zboundhi,' zlo zhi'
|
||||
|
||||
WRITE (6,*)
|
||||
WRITE (6,*) 'Masses'
|
||||
WRITE (6,*)
|
||||
|
||||
DO i = 1,ntypes
|
||||
WRITE (6,*) i,1.0
|
||||
ENDDO
|
||||
|
||||
WRITE (6,*)
|
||||
WRITE (6,*) 'Atoms # molecular'
|
||||
WRITE (6,*)
|
||||
|
||||
DO i = 1,natoms
|
||||
WRITE (6,'(3I7,3F8.3)') i,molecule(i),atomtype(i),x(1,i),x(2,i),0.0
|
||||
ENDDO
|
||||
|
||||
IF (nsurf > 0) THEN
|
||||
|
||||
WRITE (6,*)
|
||||
WRITE (6,*) 'Bonds'
|
||||
WRITE (6,*)
|
||||
|
||||
DO i = 1,nbonds
|
||||
WRITE (6,'(4I7)') i,bondtype(i),bondatom(1,i),bondatom(2,i)
|
||||
ENDDO
|
||||
|
||||
ENDIF
|
||||
|
||||
DEALLOCATE(x,molecule,atomtype,bondtype,bondatom)
|
||||
END PROGRAM micelle2d
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:09:03 2021
|
||||
epsilon: 5e-13
|
||||
epsilon: 2.5e-12
|
||||
prerequisites: ! |
|
||||
pair meam
|
||||
pre_commands: ! |
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:09:03 2021
|
||||
epsilon: 1e-14
|
||||
epsilon: 5e-14
|
||||
prerequisites: ! |
|
||||
pair meam/spline
|
||||
pre_commands: ! |
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:09:04 2021
|
||||
epsilon: 5e-14
|
||||
epsilon: 7.5e-14
|
||||
prerequisites: ! |
|
||||
pair polymorphic
|
||||
pre_commands: ! |
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:09:21 2021
|
||||
epsilon: 1e-13
|
||||
epsilon: 4e-13
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
bond class2
|
||||
|
||||
@ -1,72 +1,66 @@
|
||||
LAMMPS data file. CGCMM style. atom_style full generated by VMD/TopoTools v1.8 on Sun Aug 15 17:12:56 EDT 2021
|
||||
48 atoms
|
||||
0 bonds
|
||||
0 angles
|
||||
0 dihedrals
|
||||
0 impropers
|
||||
3 atom types
|
||||
0 bond types
|
||||
0 angle types
|
||||
0 dihedral types
|
||||
0 improper types
|
||||
0 7.38 xlo xhi
|
||||
0 8.58 ylo yhi
|
||||
0 10.0 zlo zhi
|
||||
LAMMPS data file via write_data, version 30 Jul 2021, timestep = 0
|
||||
|
||||
Masses
|
||||
48 atoms
|
||||
3 atom types
|
||||
|
||||
1 11.000000 # 1
|
||||
2 14.000000 # 2
|
||||
3 12.000000 # 3
|
||||
0 7.38 xlo xhi
|
||||
0 8.58 ylo yhi
|
||||
-0.010057298274271795 10 zlo zhi
|
||||
|
||||
Atoms # full
|
||||
Masses
|
||||
|
||||
1 1 2 -0.420000 0.000000 0.715000 0.000000 # 2
|
||||
2 1 1 0.420000 0.000000 2.145000 0.000000 # 1
|
||||
3 1 2 -0.420000 1.238416 2.860000 0.000000 # 2
|
||||
4 1 1 0.420000 1.238416 4.290000 0.000000 # 1
|
||||
5 1 2 -0.420000 0.000000 5.005000 0.000000 # 2
|
||||
6 1 1 0.420000 0.000000 6.435000 0.000000 # 1
|
||||
7 1 2 -0.420000 1.238416 7.150000 0.000000 # 2
|
||||
8 1 1 0.420000 1.238416 8.580000 0.000000 # 1
|
||||
9 1 2 -0.420000 2.476833 0.715000 0.000000 # 2
|
||||
10 1 1 0.420000 2.476833 2.145000 0.000000 # 1
|
||||
11 1 2 -0.420000 3.715249 2.860000 0.000000 # 2
|
||||
12 1 1 0.420000 3.715249 4.290000 0.000000 # 1
|
||||
13 1 2 -0.420000 2.476833 5.005000 0.000000 # 2
|
||||
14 1 1 0.420000 2.476833 6.435000 0.000000 # 1
|
||||
15 1 2 -0.420000 3.715249 7.150000 0.000000 # 2
|
||||
16 1 1 0.420000 3.715249 8.580000 0.000000 # 1
|
||||
17 1 2 -0.420000 4.953665 0.715000 0.000000 # 2
|
||||
18 1 1 0.420000 4.953665 2.145000 0.000000 # 1
|
||||
19 1 2 -0.420000 6.192081 2.860000 0.000000 # 2
|
||||
20 1 1 0.420000 6.192081 4.290000 0.000000 # 1
|
||||
21 1 2 -0.420000 4.953665 5.005000 0.000000 # 2
|
||||
22 1 1 0.420000 4.953665 6.435000 0.000000 # 1
|
||||
23 1 2 -0.420000 6.192081 7.150000 0.000000 # 2
|
||||
24 1 1 0.420000 6.192081 8.580000 0.000000 # 1
|
||||
25 2 3 0.000000 1.238416 1.430000 3.330000 # 3
|
||||
26 2 3 0.000000 0.000000 2.145000 3.330000 # 3
|
||||
27 2 3 0.000000 0.000000 3.575000 3.330000 # 3
|
||||
28 2 3 0.000000 1.238416 4.290000 3.330000 # 3
|
||||
29 2 3 0.000000 1.238416 5.720000 3.330000 # 3
|
||||
30 2 3 0.000000 0.000000 6.435000 3.330000 # 3
|
||||
31 2 3 0.000000 0.000000 7.865000 3.330000 # 3
|
||||
32 2 3 0.000000 1.238416 8.580000 3.330000 # 3
|
||||
33 2 3 0.000000 3.715249 1.430000 3.330000 # 3
|
||||
34 2 3 0.000000 2.476833 2.145000 3.330000 # 3
|
||||
35 2 3 0.000000 2.476833 3.575000 3.330000 # 3
|
||||
36 2 3 0.000000 3.715249 4.290000 3.330000 # 3
|
||||
37 2 3 0.000000 3.715249 5.720000 3.330000 # 3
|
||||
38 2 3 0.000000 2.476833 6.435000 3.330000 # 3
|
||||
39 2 3 0.000000 2.476833 7.865000 3.330000 # 3
|
||||
40 2 3 0.000000 3.715249 8.580000 3.330000 # 3
|
||||
41 2 3 0.000000 6.192081 1.430000 3.330000 # 3
|
||||
42 2 3 0.000000 4.953665 2.145000 3.330000 # 3
|
||||
43 2 3 0.000000 4.953665 3.575000 3.330000 # 3
|
||||
44 2 3 0.000000 6.192081 4.290000 3.330000 # 3
|
||||
45 2 3 0.000000 6.192081 5.720000 3.330000 # 3
|
||||
46 2 3 0.000000 4.953665 6.435000 3.330000 # 3
|
||||
47 2 3 0.000000 4.953665 7.865000 3.330000 # 3
|
||||
48 2 3 0.000000 6.192081 8.580000 3.330000 # 3
|
||||
1 11
|
||||
2 14
|
||||
3 12
|
||||
|
||||
Atoms # full
|
||||
|
||||
1 1 2 -0.42 7.377582386921897 0.7221769963191714 0.0037771363154878545 -1 0 0
|
||||
2 1 1 0.42 7.378315948261095 2.1411424242268047 0.005723979908844447 -1 0 0
|
||||
3 1 2 -0.42 1.2447887970776952 2.8676004848245533 0.001348446268284902 0 0 0
|
||||
4 1 1 0.42 1.2414656689644874 4.28578628613883 0.00011113531427045186 0 0 0
|
||||
5 1 2 -0.42 0.002474815180746286 4.9992187428028405 -0.005589712651255407 0 0 0
|
||||
6 1 1 0.42 7.379979983665971 6.4385854739759045 0.0010611130348691324 -1 0 0
|
||||
7 1 2 -0.42 1.2317585840471603 7.158810080624563 -0.008974942974268898 0 0 0
|
||||
8 1 1 0.42 1.2352508770341066 0.0037783122313107898 0.002093671640424837 0 1 0
|
||||
9 1 2 -0.42 2.4773332782542727 0.7231766195586773 0.004444922690486966 0 0 0
|
||||
10 1 1 0.42 2.4830271537615816 2.1501422709017723 0.006147046087378192 0 0 0
|
||||
11 1 2 -0.42 3.709595948985172 2.8691715937849 0.006976742817543793 0 0 0
|
||||
12 1 1 0.42 3.7240167199015244 4.289068384919813 0.002345347298470022 0 0 0
|
||||
13 1 2 -0.42 2.4712325868621394 4.998856391973726 0.004379902423536359 0 0 0
|
||||
14 1 1 0.42 2.474562437522464 6.433656440055303 -0.0012119905144032052 0 0 0
|
||||
15 1 2 -0.42 3.725038325222275 7.159189010774339 -0.0002959156829379106 0 0 0
|
||||
16 1 1 0.42 3.706133972373436 0.0037306803342563467 0.0015443778464311643 0 1 0
|
||||
17 1 2 -0.42 4.956689237720773 0.7233633730273523 0.0032104707105134024 0 0 0
|
||||
18 1 1 0.42 4.962115477057346 2.152167902820356 -0.009057298274271795 0 0 0
|
||||
19 1 2 -0.42 6.184281256484653 2.869710737578436 0.008366480776279456 0 0 0
|
||||
20 1 1 0.42 6.188803450864838 4.284231685327474 -0.008064701146476297 0 0 0
|
||||
21 1 2 -0.42 4.949812422011079 5.0147217402047115 -0.006712379416782586 0 0 0
|
||||
22 1 1 0.42 4.948281204520974 6.429549384016799 -0.00850282965158244 0 0 0
|
||||
23 1 2 -0.42 6.194837058886999 7.1510817137970974 0.0003637878086249291 0 0 0
|
||||
24 1 1 0.42 6.197894966950315 8.5753425339448 0.0019680102504640875 0 0 0
|
||||
25 2 3 0 1.2443079194694104 1.4354905223825436 3.3292096834113867 0 0 0
|
||||
26 2 3 0 0.005953551957362122 2.146347747385198 3.3215903030250176 0 0 0
|
||||
27 2 3 0 0.008405194319042002 3.581100920138928 3.3281647749562584 0 0 0
|
||||
28 2 3 0 1.2344840653089975 4.28597364831994 3.339107313230218 0 0 0
|
||||
29 2 3 0 1.2459826328321986 5.712398010763525 3.3233669025652888 0 0 0
|
||||
30 2 3 0 0.0011015360109049533 6.428515735279543 3.328962843282597 0 0 0
|
||||
31 2 3 0 0.0053187626578466785 7.857443990429139 3.336147142535144 0 0 0
|
||||
32 2 3 0 1.2375058991604755 0.003935190110437195 3.328740186117934 0 1 0
|
||||
33 2 3 0 3.722777594386544 1.4230858546509806 3.3239591190330495 0 0 0
|
||||
34 2 3 0 2.477738590136957 2.145253431839055 3.329428918999354 0 0 0
|
||||
35 2 3 0 2.47490377328119 3.5704865369598786 3.332226684676589 0 0 0
|
||||
36 2 3 0 3.7109409527732264 4.284650259616156 3.3369133687377506 0 0 0
|
||||
37 2 3 0 3.7215294678437676 5.715823050199925 3.3280047101471597 0 0 0
|
||||
38 2 3 0 2.4731365114325135 6.42811664625216 3.321473560073168 0 0 0
|
||||
39 2 3 0 2.4849857361078898 7.868035765305644 3.3321074919552114 0 0 0
|
||||
40 2 3 0 3.7175249488002753 8.571871486223243 3.334068954044054 0 0 0
|
||||
41 2 3 0 6.201483231089492 1.433297921099373 3.338159917163737 0 0 0
|
||||
42 2 3 0 4.951929076909173 2.149340612475919 3.3226738827688034 0 0 0
|
||||
43 2 3 0 4.960270928343071 3.580837662003859 3.3235852988546646 0 0 0
|
||||
44 2 3 0 6.190455345511372 4.287625009635288 3.3335369402978277 0 0 0
|
||||
45 2 3 0 6.192023154106657 5.727784070585754 3.3368743347641425 0 0 0
|
||||
46 2 3 0 4.951470112194179 6.42552064756887 3.3305236900088024 0 0 0
|
||||
47 2 3 0 4.954889130658072 7.858963970208524 3.3224472946591894 0 0 0
|
||||
48 2 3 0 6.191151024308316 0.00989854985843345 3.3349274706910026 0 1 0
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:09:35 2021
|
||||
epsilon: 2.5e-13
|
||||
epsilon: 5e-13
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
dihedral multi/harmonic
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:09:35 2021
|
||||
epsilon: 2.5e-13
|
||||
epsilon: 1e-12
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
dihedral quadratic
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 30 Jul 2021
|
||||
date_generated: Sun Aug 22 10:57:54 2021
|
||||
epsilon: 2.5e-14
|
||||
epsilon: 5e-14
|
||||
skip_tests:
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Mar 2021
|
||||
date_generated: Tue Mar 23 08:05:02 202
|
||||
epsilon: 2e-14
|
||||
epsilon: 5e-14
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
dihedral table/cut
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Mar 2021
|
||||
date_generated: Tue Mar 23 08:06:45 202
|
||||
epsilon: 2e-14
|
||||
epsilon: 2.5e-13
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
dihedral table/cut
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Mar 2021
|
||||
date_generated: Mon Mar 22 21:19:05 202
|
||||
epsilon: 1e-14
|
||||
epsilon: 7.5e-14
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
dihedral table
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Mar 2021
|
||||
date_generated: Mon Mar 22 21:19:05 202
|
||||
epsilon: 1e-14
|
||||
epsilon: 1e-13
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
dihedral table
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 30 Jul 2021
|
||||
date_generated: Sun Aug 22 14:22:56 2021
|
||||
epsilon: 9e-12
|
||||
epsilon: 2.5e-11
|
||||
skip_tests:
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:09:54 2021
|
||||
epsilon: 2e-14
|
||||
epsilon: 1e-13
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
fix momentum/chunk
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 30 Jul 2021
|
||||
date_generated: Sun Aug 22 14:13:03 2021
|
||||
epsilon: 5e-14
|
||||
epsilon: 2e-13
|
||||
skip_tests:
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 30 Jul 2021
|
||||
date_generated: Sun Aug 22 14:10:26 2021
|
||||
epsilon: 1e-13
|
||||
epsilon: 4e-13
|
||||
skip_tests:
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 30 Jul 2021
|
||||
date_generated: Sun Aug 22 14:07:35 2021
|
||||
epsilon: 5e-14
|
||||
epsilon: 2e-13
|
||||
skip_tests:
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 30 Jul 2021
|
||||
date_generated: Sun Aug 22 14:15:09 2021
|
||||
epsilon: 2e-13
|
||||
epsilon: 5e-13
|
||||
skip_tests:
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:09:55 2021
|
||||
epsilon: 4e-14
|
||||
epsilon: 7.5e-14
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
fix oneway
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:09:55 2021
|
||||
epsilon: 1e-10
|
||||
epsilon: 1.5e-10
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
fix rattle
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:09:58 2021
|
||||
epsilon: 3.5e-11
|
||||
epsilon: 5e-11
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
fix shake
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:09:59 2021
|
||||
epsilon: 3e-14
|
||||
epsilon: 4e-14
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
fix wall/harmonic
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Wed Feb 24 19:35:15 202
|
||||
epsilon: 1e-11
|
||||
epsilon: 2e-11
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
improper harmonic
|
||||
|
||||
94
unittest/force-styles/tests/kspace-ewald_tilted.yaml
Normal file
94
unittest/force-styles/tests/kspace-ewald_tilted.yaml
Normal file
@ -0,0 +1,94 @@
|
||||
---
|
||||
lammps_version: 30 Jul 2021
|
||||
date_generated: Tue Aug 24 16:00:03 2021
|
||||
epsilon: 8.5e-14
|
||||
skip_tests:
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
pair coul/long
|
||||
kspace ewald
|
||||
pre_commands: ! ""
|
||||
post_commands: ! |
|
||||
pair_modify mix arithmetic
|
||||
pair_modify table 0
|
||||
pair_modify compute no
|
||||
group none empty
|
||||
change_box all triclinic
|
||||
change_box none xy final 0.5 xz final 0.5 yz final 0.5
|
||||
kspace_style ewald 1.0e-6
|
||||
kspace_modify gewald 0.3
|
||||
input_file: in.fourmol
|
||||
pair_style: coul/long 8.0
|
||||
pair_coeff: ! |
|
||||
* *
|
||||
extract: ! ""
|
||||
natoms: 29
|
||||
init_vdwl: 0
|
||||
init_coul: 0
|
||||
init_stress: ! |2-
|
||||
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
init_forces: ! |2
|
||||
1 -5.3448670515756946e-01 7.8599782106382812e-02 2.0710927588803751e-01
|
||||
2 2.2178420089971082e-01 -2.7643402434627568e-01 -1.2760374351052742e-01
|
||||
3 -3.4754319998885001e-02 -9.3504708496478690e-03 1.9886382422593211e-02
|
||||
4 1.6445863380462616e-01 2.8359395290019698e-02 -7.8729303809635401e-02
|
||||
5 1.6233641307706351e-01 7.5986707200382503e-02 -3.6930511107003808e-02
|
||||
6 5.6637631370696451e-01 4.1893463304019041e-01 -6.7664491982745634e-01
|
||||
7 -3.3948920528780069e-01 -3.9999223701116160e-01 4.0048374439634377e-01
|
||||
8 -1.4238445302733072e-01 -6.2030995164738334e-01 3.3646022882523446e-01
|
||||
9 1.8321468690702236e-01 3.2329505791288987e-01 5.5419174179294289e-02
|
||||
10 -5.1536377515236292e-02 1.1099268040025226e-01 -1.4084559805296692e-02
|
||||
11 -8.4444394935712291e-02 1.5159947723172223e-01 -3.9463118427389220e-02
|
||||
12 4.5970202214672301e-01 -4.2545537704155284e-01 3.2406840753999723e-02
|
||||
13 -1.5666599035798093e-01 1.1527633374087305e-01 2.7654374124323384e-02
|
||||
14 -1.7363583497646881e-01 1.3581078235758284e-01 1.0662571297963025e-02
|
||||
15 -1.3881062069365652e-01 8.5530348257713926e-02 -1.3048746581823758e-02
|
||||
16 -3.3884433626020932e-01 4.3401859035700502e-01 5.3769217618752685e-01
|
||||
17 1.3001440137507966e-01 -4.1589115651366521e-01 -7.9670451166464484e-01
|
||||
18 7.5681379375335611e-01 1.5582935725479723e+00 -1.4210097554885777e+00
|
||||
19 -2.8085336420242663e-01 -7.8741407964003718e-01 7.8245857403750418e-01
|
||||
20 -4.0594967301158125e-01 -7.0553497589712044e-01 7.5613349420219689e-01
|
||||
21 5.0704592271800275e-01 5.6580880704147107e-01 -1.1619399232386021e+00
|
||||
22 -2.8704161808189710e-01 -1.3216031203060810e-01 5.8097825566381744e-01
|
||||
23 -2.8642030339820157e-01 -3.0776190804563458e-01 5.5724240346862619e-01
|
||||
24 8.9772331662676536e-02 1.7084621364125749e+00 -3.1646797639105334e-01
|
||||
25 1.3203890191695800e-01 -6.8368673665866730e-01 2.4609923757704671e-01
|
||||
26 -2.4575213176251201e-01 -9.4797999409036526e-01 8.5244090147042331e-02
|
||||
27 -8.6290089809075665e-01 1.6205604497958011e+00 -9.3012639603990466e-01
|
||||
28 5.6895188209221181e-01 -9.0851861726847494e-01 5.3413668936060954e-01
|
||||
29 4.2146072269782930e-01 -7.9103891265223736e-01 4.4268595335975636e-01
|
||||
run_vdwl: 0
|
||||
run_coul: 0
|
||||
run_stress: ! |2-
|
||||
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
run_forces: ! |2
|
||||
1 -5.3334348792473663e-01 7.8785708829614623e-02 2.0952494330848997e-01
|
||||
2 2.2047697818092868e-01 -2.7713623100478413e-01 -1.2893818878633795e-01
|
||||
3 -3.4736144178054582e-02 -9.3340960282083715e-03 1.9999043638795875e-02
|
||||
4 1.6460652383725125e-01 2.8241875764049424e-02 -7.9113572796586790e-02
|
||||
5 1.6215649863110154e-01 7.5978103359921431e-02 -3.7484057379720333e-02
|
||||
6 5.6599278205644532e-01 4.1851641614579382e-01 -6.7992950478127434e-01
|
||||
7 -3.3968790345085564e-01 -4.0048941901454138e-01 4.0256715056329251e-01
|
||||
8 -1.4127588913092420e-01 -6.2017022889258322e-01 3.3993571378136456e-01
|
||||
9 1.8227911587148210e-01 3.2295764963388313e-01 5.3201479166533922e-02
|
||||
10 -5.1700413623535821e-02 1.1111482057473794e-01 -1.4551185576318685e-02
|
||||
11 -8.4630638764449165e-02 1.5198576029820277e-01 -3.9867702658817644e-02
|
||||
12 4.6027933614580008e-01 -4.2553026862869375e-01 3.4381287211854843e-02
|
||||
13 -1.5686137135126832e-01 1.1537512460453701e-01 2.7055222353983506e-02
|
||||
14 -1.7378447342619111e-01 1.3594753630000173e-01 1.0206866580498939e-02
|
||||
15 -1.3885301533726085e-01 8.5409407767259818e-02 -1.3828540594015035e-02
|
||||
16 -3.4001275168031081e-01 4.3481964910483151e-01 5.3551094197240323e-01
|
||||
17 1.3095652292939247e-01 -4.1543488278945484e-01 -7.9439775989272843e-01
|
||||
18 7.6130155207510231e-01 1.5641161174020948e+00 -1.4166082689671402e+00
|
||||
19 -2.8201484020970297e-01 -7.8931009820541154e-01 7.8114406552076276e-01
|
||||
20 -4.0864600217287589e-01 -7.0869378747084499e-01 7.5398290929506750e-01
|
||||
21 5.0731879438820993e-01 5.5710526946109051e-01 -1.1569855994010214e+00
|
||||
22 -2.8670662557005039e-01 -1.2787743295502346e-01 5.7883709816985718e-01
|
||||
23 -2.8655446637042009e-01 -3.0420640641646041e-01 5.5485906877201041e-01
|
||||
24 9.1000147200901771e-02 1.7036643907704361e+00 -3.1478809556214382e-01
|
||||
25 1.3087682966252198e-01 -6.8159119768456733e-01 2.4475033518411687e-01
|
||||
26 -2.4585864030573110e-01 -9.4550397751699744e-01 8.4357627318536146e-02
|
||||
27 -8.6391407541084209e-01 1.6204449844939783e+00 -9.2544999434421571e-01
|
||||
28 5.6947333589361271e-01 -9.0807662135609435e-01 5.3159257072970112e-01
|
||||
29 4.2186232203445834e-01 -7.9110816654676352e-01 4.4003614717305051e-01
|
||||
...
|
||||
92
unittest/force-styles/tests/kspace-pppm_tilted.yaml
Normal file
92
unittest/force-styles/tests/kspace-pppm_tilted.yaml
Normal file
@ -0,0 +1,92 @@
|
||||
---
|
||||
lammps_version: 30 Jul 2021
|
||||
date_generated: Tue Aug 24 15:57:51 2021
|
||||
epsilon: 1e-13
|
||||
skip_tests: gpu
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
pair coul/long
|
||||
kspace pppm
|
||||
pre_commands: ! ""
|
||||
post_commands: ! |
|
||||
pair_modify compute no
|
||||
group none empty
|
||||
change_box all triclinic
|
||||
change_box none xy final 0.5 xz final 0.5 yz final 0.5
|
||||
kspace_style pppm 1.0e-6
|
||||
kspace_modify gewald 0.3
|
||||
input_file: in.fourmol
|
||||
pair_style: coul/long 8.0
|
||||
pair_coeff: ! |
|
||||
* *
|
||||
extract: ! ""
|
||||
natoms: 29
|
||||
init_vdwl: 0
|
||||
init_coul: 0
|
||||
init_stress: ! |2-
|
||||
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
init_forces: ! |2
|
||||
1 -5.3455805973222437e-01 7.8698684976257607e-02 2.0711314888470955e-01
|
||||
2 2.2184568573854779e-01 -2.7647431277628187e-01 -1.2757452052704132e-01
|
||||
3 -3.4757340736885710e-02 -9.3470470522295339e-03 1.9885688602828643e-02
|
||||
4 1.6445912101334906e-01 2.8345927313968042e-02 -7.8722927625643938e-02
|
||||
5 1.6234688533111721e-01 7.5972054420001711e-02 -3.6936297075666272e-02
|
||||
6 5.6653284543285287e-01 4.1888106452174662e-01 -6.7663104705782029e-01
|
||||
7 -3.3961547966725153e-01 -4.0001344965273866e-01 4.0047632273598788e-01
|
||||
8 -1.4242862568200385e-01 -6.2031296063117003e-01 3.3640454007119630e-01
|
||||
9 1.8322344081844300e-01 3.2327686261589661e-01 5.5386729810616965e-02
|
||||
10 -5.1553080010261633e-02 1.1100399113998416e-01 -1.4071507835405114e-02
|
||||
11 -8.4457368938472652e-02 1.5161839580411990e-01 -3.9440958631538105e-02
|
||||
12 4.5980547268228616e-01 -4.2545520083096022e-01 3.2346370702025180e-02
|
||||
13 -1.5668051885818224e-01 1.1528021365610482e-01 2.7670519478048963e-02
|
||||
14 -1.7366274753772379e-01 1.3580748800890222e-01 1.0678928186624024e-02
|
||||
15 -1.3885054474562650e-01 8.5524833610521669e-02 -1.3032936810854641e-02
|
||||
16 -3.3897150894267869e-01 4.3411449803827901e-01 5.3768221413168005e-01
|
||||
17 1.3014158705307541e-01 -4.1604199493225014e-01 -7.9661148361636958e-01
|
||||
18 7.5708876110784495e-01 1.5585543643937958e+00 -1.4210365830174345e+00
|
||||
19 -2.8092848433130602e-01 -7.8754421733994284e-01 7.8241552040791995e-01
|
||||
20 -4.0612757709741132e-01 -7.0559006327161899e-01 7.5613258856438037e-01
|
||||
21 5.0705834349462331e-01 5.6563606920657128e-01 -1.1618762247785586e+00
|
||||
22 -2.8713969353176505e-01 -1.3207924257384354e-01 5.8092858221716182e-01
|
||||
23 -2.8635179770885089e-01 -3.0768005507572388e-01 5.5725013443463101e-01
|
||||
24 8.9526815583228531e-02 1.7085267386261080e+00 -3.1637922752625725e-01
|
||||
25 1.3221275453613066e-01 -6.8367421676295925e-01 2.4606100899682085e-01
|
||||
26 -2.4566560537364829e-01 -9.4805075799955063e-01 8.5189439084190730e-02
|
||||
27 -8.6309787765015977e-01 1.6208482668327251e+00 -9.3002361778513165e-01
|
||||
28 5.6908530015070713e-01 -9.0863521385805213e-01 5.3409478726214277e-01
|
||||
29 4.2151929760224643e-01 -7.9119072040766358e-01 4.4262080871675447e-01
|
||||
run_vdwl: 0
|
||||
run_coul: 0
|
||||
run_stress: ! |2-
|
||||
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
|
||||
run_forces: ! |2
|
||||
1 -5.3341524273838670e-01 7.8884674939725091e-02 2.0952884187592027e-01
|
||||
2 2.2053862671009264e-01 -2.7717619362233042e-01 -1.2890890936582325e-01
|
||||
3 -3.4739178886093409e-02 -9.3306643617397569e-03 1.9998343085423885e-02
|
||||
4 1.6460700475024034e-01 2.8228421828984558e-02 -7.9107215740923997e-02
|
||||
5 1.6216701187759877e-01 7.5963404417154726e-02 -3.7489825158728236e-02
|
||||
6 5.6614970689446376e-01 4.1846264904575808e-01 -6.7991524653327151e-01
|
||||
7 -3.3981435908481461e-01 -4.0051061086052664e-01 4.0255950152039277e-01
|
||||
8 -1.4132007772975100e-01 -6.2017341508474122e-01 3.3987971621673863e-01
|
||||
9 1.8228775562277319e-01 3.2293964093791572e-01 5.3169053903539536e-02
|
||||
10 -5.1717127183107316e-02 1.1112616730977573e-01 -1.4538101134574682e-02
|
||||
11 -8.4643572966643127e-02 1.5200466657141215e-01 -3.9845494278253207e-02
|
||||
12 4.6038275088773778e-01 -4.2553018369271028e-01 3.4320674023104583e-02
|
||||
13 -1.5687586888416111e-01 1.1537899385275338e-01 2.7071393350961193e-02
|
||||
14 -1.7381133625143649e-01 1.3594429135543404e-01 1.0223314006551567e-02
|
||||
15 -1.3889297621381996e-01 8.5403895543124345e-02 -1.3812667490434579e-02
|
||||
16 -3.4014003160232759e-01 4.3491574681114664e-01 5.3550096704789363e-01
|
||||
17 1.3108396775726161e-01 -4.1558591174484305e-01 -7.9430457925084896e-01
|
||||
18 7.6157630236804819e-01 1.5643765431579519e+00 -1.4166351052972370e+00
|
||||
19 -2.8208991751960732e-01 -7.8944028837125158e-01 7.8110106092889642e-01
|
||||
20 -4.0882363546770967e-01 -7.0874851093129665e-01 7.5398203566194200e-01
|
||||
21 5.0733201140702333e-01 5.5693234394333690e-01 -1.1569217174451907e+00
|
||||
22 -2.8680524489422227e-01 -1.2779625227872668e-01 5.7878726247278034e-01
|
||||
23 -2.8648626378267200e-01 -3.0412446280189631e-01 5.5486674848935513e-01
|
||||
24 9.0753920598062088e-02 1.7037291068699667e+00 -3.1469859811934520e-01
|
||||
25 1.3105114795772563e-01 -6.8157888628951457e-01 2.4471165738173106e-01
|
||||
26 -2.4577186819945190e-01 -9.4557474632785432e-01 8.4302506574447683e-02
|
||||
27 -8.6411178235841868e-01 1.6207327144466275e+00 -9.2534662609109775e-01
|
||||
28 5.6960687175236380e-01 -9.0819316709272491e-01 5.3155039440194063e-01
|
||||
29 4.2192140517923227e-01 -7.9125996757091022e-01 4.3997061496410916e-01
|
||||
...
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 10 Feb 2021
|
||||
date_generated: Fri Feb 26 23:09:34 2021
|
||||
epsilon: 3e-13
|
||||
epsilon: 4e-13
|
||||
prerequisites: ! |
|
||||
atom full
|
||||
pair tip4p/long
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 8 Apr 2021
|
||||
date_generated: Wed May 5 11:50:15 2021
|
||||
epsilon: 2e-13
|
||||
epsilon: 5e-13
|
||||
prerequisites: ! |
|
||||
pair bop
|
||||
pre_commands: ! |
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 8 Apr 2021
|
||||
date_generated: Wed May 5 11:50:24 2021
|
||||
epsilon: 2e-14
|
||||
epsilon: 9e-13
|
||||
prerequisites: ! |
|
||||
pair bop
|
||||
pre_commands: ! |
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
lammps_version: 30 Jul 2021
|
||||
date_generated: Tue Aug 17 15:09:48 2021
|
||||
epsilon: 5e-14
|
||||
date_generated: Tue Aug 24 15:36:39 2021
|
||||
epsilon: 2e-13
|
||||
skip_tests: single
|
||||
prerequisites: ! |
|
||||
pair drip
|
||||
@ -16,110 +16,110 @@ pair_coeff: ! |
|
||||
* * drip C.drip C C C
|
||||
extract: ! ""
|
||||
natoms: 48
|
||||
init_vdwl: -1.1171061429439093
|
||||
init_vdwl: -1.1165820288113353
|
||||
init_coul: 0
|
||||
init_stress: ! |-
|
||||
-6.9372049706365035e-01 -6.9064113154966333e-01 1.1515233668963607e+00 0.0000000000000000e+00 0.0000000000000000e+00 -1.4292420626121039e-02
|
||||
-6.9202029395419495e-01 -6.8748326656871916e-01 1.1598469113436700e+00 -8.7520222366446450e-04 -7.4904268268328076e-03 -4.8018384975223698e-03
|
||||
init_forces: ! |2
|
||||
1 1.4969082430352958e-03 -3.2939836241196573e-05 -1.3240430862322900e-02
|
||||
2 8.0767187286290179e-04 1.0588928659053852e-03 -3.1123566690577253e-02
|
||||
3 -3.4497099855045673e-04 3.4248846132303140e-05 -1.0175437155229471e-02
|
||||
4 -2.4589156252144417e-04 1.8156645561760292e-05 -2.9695125191752228e-02
|
||||
5 1.4969082430352932e-03 -3.2939836241182343e-05 -1.3240430862323165e-02
|
||||
6 8.0767187286288694e-04 1.0588928659049949e-03 -3.1123566690577420e-02
|
||||
7 -3.4497099855038821e-04 3.4248846132523362e-05 -1.0175437155229110e-02
|
||||
8 -2.4589156252142683e-04 1.8156645561707817e-05 -2.9695125191752388e-02
|
||||
9 -1.3423014800966740e-04 7.4485503462573500e-08 -1.0127230298720345e-02
|
||||
10 -1.2282979196216780e-04 -5.3179137282562149e-06 -2.9857221873835556e-02
|
||||
11 1.3420646745295351e-04 7.2570324572774139e-08 -1.0127289412755367e-02
|
||||
12 1.2281957667447806e-04 -5.2981576756526129e-06 -2.9857246714720800e-02
|
||||
13 -1.3423014800966089e-04 7.4485503475472118e-08 -1.0127230298720606e-02
|
||||
14 -1.2282979196215913e-04 -5.3179137286977698e-06 -2.9857221873835549e-02
|
||||
15 1.3420646745295687e-04 7.2570324835217239e-08 -1.0127289412755180e-02
|
||||
16 1.2281957667447502e-04 -5.2981576756378754e-06 -2.9857246714720957e-02
|
||||
17 3.4500424726267094e-04 3.4247597717764226e-05 -1.0175497243327751e-02
|
||||
18 2.4590943990438825e-04 1.8176873676577221e-05 -2.9695147824251051e-02
|
||||
19 -1.4969178111888977e-03 -3.2939169475935731e-05 -1.3240431836380913e-02
|
||||
20 -8.0767953495986997e-04 1.0588933379664879e-03 -3.1123564482199977e-02
|
||||
21 3.4500424726266232e-04 3.4247597717770589e-05 -1.0175497243328002e-02
|
||||
22 2.4590943990438212e-04 1.8176873676178533e-05 -2.9695147824251072e-02
|
||||
23 -1.4969178111887745e-03 -3.2939169475980779e-05 -1.3240431836380712e-02
|
||||
24 -8.0767953495988450e-04 1.0588933379664870e-03 -3.1123564482199943e-02
|
||||
25 -3.4497099855045933e-04 -3.4248846132324567e-05 1.0175437155229457e-02
|
||||
26 8.0767187286290309e-04 -1.0588928659053826e-03 3.1123566690577247e-02
|
||||
27 1.4969082430351102e-03 3.2939836241083992e-05 1.3240430862322843e-02
|
||||
28 -2.4589156252142509e-04 -1.8156645561688708e-05 2.9695125191752263e-02
|
||||
29 -3.4497099855046193e-04 -3.4248846132538534e-05 1.0175437155229280e-02
|
||||
30 8.0767187286257902e-04 -1.0588928659051909e-03 3.1123566690576712e-02
|
||||
31 1.4969082430352915e-03 3.2939836241593784e-05 1.3240430862323165e-02
|
||||
32 -2.4589156252143897e-04 -1.8156645561741183e-05 2.9695125191752519e-02
|
||||
33 1.3420646745296197e-04 -7.2570324595813435e-08 1.0127289412755341e-02
|
||||
34 -1.2282979196217170e-04 5.3179137282585121e-06 2.9857221873835549e-02
|
||||
35 -1.3423014800966349e-04 -7.4485503448870201e-08 1.0127230298720332e-02
|
||||
36 1.2281957667447611e-04 5.2981576756533134e-06 2.9857246714720946e-02
|
||||
37 1.3420646745295709e-04 -7.2570324815599003e-08 1.0127289412755423e-02
|
||||
38 -1.2282979196223502e-04 5.3179137282683716e-06 2.9857221873835008e-02
|
||||
39 -1.3423014800966436e-04 -7.4485503047341829e-08 1.0127230298720473e-02
|
||||
40 1.2281957667448912e-04 5.2981576756629069e-06 2.9857246714721068e-02
|
||||
41 -1.4969178111890833e-03 3.2939169476025510e-05 1.3240431836380942e-02
|
||||
42 2.4590943990438738e-04 -1.8176873676568727e-05 2.9695147824251211e-02
|
||||
43 3.4500424726266921e-04 -3.4247597717747861e-05 1.0175497243327740e-02
|
||||
44 -8.0767953495988342e-04 -1.0588933379665052e-03 3.1123564482200137e-02
|
||||
45 -1.4969178111890772e-03 3.2939169475814605e-05 1.3240431836381151e-02
|
||||
46 2.4590943990439947e-04 -1.8176873676638302e-05 2.9695147824250822e-02
|
||||
47 3.4500424726267181e-04 -3.4247597717339300e-05 1.0175497243327872e-02
|
||||
48 -8.0767953495988081e-04 -1.0588933379665191e-03 3.1123564482200175e-02
|
||||
run_vdwl: -1.117107802396835
|
||||
1 1.4410960759987860e-03 -1.0169393511311969e-03 -1.4285790452588352e-02
|
||||
2 3.4022682581723486e-04 1.2797267794660613e-03 -3.1898882299555655e-02
|
||||
3 -2.6365196949846605e-04 2.0444656479657366e-04 -1.1310141731659772e-02
|
||||
4 3.2407051817817667e-04 -4.6232566789062061e-04 -2.9910736659103317e-02
|
||||
5 8.6245599980334670e-04 1.9925559001726770e-04 -1.2745556995400132e-02
|
||||
6 5.1905954665549387e-04 1.1276332993411060e-03 -3.0823356931780860e-02
|
||||
7 -1.6088212112039344e-04 1.4230630104907803e-04 -8.0118146476316210e-03
|
||||
8 -4.5244202184603708e-04 -1.4652059326166248e-04 -3.0139505526382837e-02
|
||||
9 -8.3793846695301086e-05 -4.1141009708683870e-04 -1.0952073086473545e-02
|
||||
10 1.0558775462631573e-04 3.2338361212355486e-04 -3.0862434540746431e-02
|
||||
11 6.9846394554382257e-05 1.7181288265826418e-05 -1.0563492234071459e-02
|
||||
12 -8.0680668202737346e-04 -4.0664776842267906e-04 -2.9407396519018757e-02
|
||||
13 4.1248090507395221e-04 -8.1127163583308737e-04 -1.1037445663309341e-02
|
||||
14 2.3332834021886836e-04 5.5940029155014345e-04 -2.9697888304764254e-02
|
||||
15 -4.4744269608917094e-04 -6.4403133698428692e-04 -1.0302570659537293e-02
|
||||
16 1.0107877556045320e-04 -1.7601743406948410e-04 -3.0441022553442356e-02
|
||||
17 7.8768348766012383e-04 -4.8291459018732613e-04 -1.0709636748495333e-02
|
||||
18 7.5773135601624533e-04 -1.0604660666195195e-04 -2.9052190107973087e-02
|
||||
19 -8.2398465651566956e-04 -5.1763577844063228e-04 -1.3883168800746705e-02
|
||||
20 -2.6540769941738171e-04 1.4544086540562453e-03 -2.9616876954433820e-02
|
||||
21 6.9059687932033500e-04 -6.1172176278914724e-04 -9.9930475935883847e-03
|
||||
22 5.1903723762132471e-04 -1.5794695217515297e-04 -2.8872098166177262e-02
|
||||
23 -1.2999619581249811e-03 5.3108588030229464e-04 -1.2422412311642437e-02
|
||||
24 -3.2646002927880701e-04 1.5480656986689182e-03 -3.0724921923396969e-02
|
||||
25 -4.4212417028449604e-04 -3.2702381810661659e-05 1.0257965385900172e-02
|
||||
26 1.2029502887653701e-03 -6.6888137281991044e-04 3.1679674370803115e-02
|
||||
27 1.1284078949731725e-03 -2.7744804554502567e-08 1.3174439787097793e-02
|
||||
28 -7.2378810157200900e-04 2.4335522727010964e-04 2.9873966714653963e-02
|
||||
29 -1.0532667049880620e-03 7.4516834828237087e-04 1.0732704837844071e-02
|
||||
30 1.3915165126589146e-03 -1.4093630775334669e-03 3.0800252954615828e-02
|
||||
31 1.5526924204556959e-03 3.4345958973841973e-04 1.3180996180850283e-02
|
||||
32 -9.2849293773583576e-05 -3.6968402535136977e-04 3.0310755683442978e-02
|
||||
33 7.8803390168056056e-04 6.3187665376786251e-04 1.1208481276473217e-02
|
||||
34 -4.4157950916471657e-04 -5.9161318279014972e-05 3.0896928862652544e-02
|
||||
35 1.4605341896907487e-06 5.5778782038553513e-04 1.0464193387876497e-02
|
||||
36 7.5306447932736915e-04 6.4063420801843522e-04 2.9446521968998895e-02
|
||||
37 -5.1528521366996614e-04 4.5022774275057587e-04 1.0102890474288698e-02
|
||||
38 -2.3334594837893120e-04 5.5982996138683090e-04 2.9312847420603871e-02
|
||||
39 -8.4030878956306652e-04 -8.2858897733969887e-04 9.9599841364338727e-03
|
||||
40 3.1176074857063333e-04 1.5729382377064493e-04 2.9568116551467322e-02
|
||||
41 -2.2702343316618858e-03 -1.0402600019059252e-04 1.2321255863902722e-02
|
||||
42 -1.6832158820563115e-04 -3.1137531486982874e-04 3.0275446479194841e-02
|
||||
43 5.5659858411658816e-05 1.9307504152509409e-04 1.1910098296920838e-02
|
||||
44 -9.5047806768623015e-04 -6.2997063031185760e-05 3.0133790104729902e-02
|
||||
45 -1.4273485464754289e-03 -8.2386789692773265e-04 1.1604494193079552e-02
|
||||
46 3.2400797488582719e-04 2.8804516968589326e-05 2.9006167509805069e-02
|
||||
47 4.4459915420986282e-04 2.0256445461834481e-04 1.0421995955857405e-02
|
||||
48 -1.0286699191962320e-03 -1.5188666002277826e-03 3.1020493014426428e-02
|
||||
run_vdwl: -1.116583686929748
|
||||
run_coul: 0
|
||||
run_stress: ! |-
|
||||
-6.9372331738514981e-01 -6.9064389597684106e-01 1.1514755915204005e+00 0.0000000000000000e+00 0.0000000000000000e+00 -1.4292266024218578e-02
|
||||
-6.9202313126699333e-01 -6.8748607721639632e-01 1.1597991092003139e+00 -8.7520711561815342e-04 -7.4903484534890319e-03 -4.8017742857855358e-03
|
||||
run_forces: ! |2
|
||||
1 1.4968783498999268e-03 -3.2942052376323016e-05 -1.3240066826206463e-02
|
||||
2 8.0765258918550525e-04 1.0588876993623385e-03 -3.1122680612106914e-02
|
||||
3 -3.4497601095719033e-04 3.4248722599748424e-05 -1.0175117216209249e-02
|
||||
4 -2.4589406964898274e-04 1.8152777475380989e-05 -2.9694273916151235e-02
|
||||
5 1.4968783498999624e-03 -3.2942052376244425e-05 -1.3240066826206844e-02
|
||||
6 8.0765258918545808e-04 1.0588876993621239e-03 -3.1122680612107538e-02
|
||||
7 -3.4497601095719900e-04 3.4248722599828465e-05 -1.0175117216209020e-02
|
||||
8 -2.4589406964903478e-04 1.8152777475390449e-05 -2.9694273916151363e-02
|
||||
9 -1.3423039571159017e-04 7.4352071961005858e-08 -1.0126910355491514e-02
|
||||
10 -1.2282852371682442e-04 -5.3193547176900636e-06 -2.9856374341201718e-02
|
||||
11 1.3420671579929917e-04 7.2436845184776077e-08 -1.0126969468728588e-02
|
||||
12 1.2281830883230783e-04 -5.2995986749039537e-06 -2.9856399181457216e-02
|
||||
13 -1.3423039571157673e-04 7.4352071584718248e-08 -1.0126910355491585e-02
|
||||
14 -1.2282852371668521e-04 -5.3193547179922104e-06 -2.9856374341201371e-02
|
||||
15 1.3420671579938970e-04 7.2436845150855372e-08 -1.0126969468727908e-02
|
||||
16 1.2281830883232204e-04 -5.2995986749016624e-06 -2.9856399181457466e-02
|
||||
17 3.4500925912102327e-04 3.4247474141055654e-05 -1.0175177303529336e-02
|
||||
18 2.4591194664583894e-04 1.8173005537505662e-05 -2.9694296547973523e-02
|
||||
19 -1.4968879181501723e-03 -3.2941385606868446e-05 -1.3240067800288987e-02
|
||||
20 -8.0766025129906183e-04 1.0588881713794161e-03 -3.1122678403683279e-02
|
||||
21 3.4500925912095290e-04 3.4247474141253548e-05 -1.0175177303529138e-02
|
||||
22 2.4591194664620069e-04 1.8173005537513167e-05 -2.9694296547973627e-02
|
||||
23 -1.4968879181501166e-03 -3.2941385606789733e-05 -1.3240067800288646e-02
|
||||
24 -8.0766025129901347e-04 1.0588881713797244e-03 -3.1122678403683594e-02
|
||||
25 -3.4497543410367832e-04 -3.4248542243049007e-05 1.0175095227569254e-02
|
||||
26 8.0765525409005174e-04 -1.0588882853031821e-03 3.1122706902410268e-02
|
||||
27 1.4968776819200879e-03 3.2942887158314040e-05 1.3240038417764373e-02
|
||||
28 -2.4589307728119323e-04 -1.8153131107501511e-05 2.9694296702257997e-02
|
||||
29 -3.4497543410356470e-04 -3.4248542242962311e-05 1.0175095227569283e-02
|
||||
30 8.0765525408991665e-04 -1.0588882853032810e-03 3.1122706902410369e-02
|
||||
31 1.4968776819200670e-03 3.2942887158584385e-05 1.3240038417764520e-02
|
||||
32 -2.4589307728105619e-04 -1.8153131107580197e-05 2.9694296702258274e-02
|
||||
33 1.3420649407712329e-04 -7.2457679971971299e-08 1.0126947778852728e-02
|
||||
34 -1.2282857182875856e-04 5.3192999898934757e-06 2.9856397351700922e-02
|
||||
35 -1.3423017399030691e-04 -7.4372916307303659e-08 1.0126888665729796e-02
|
||||
36 1.2281835687551147e-04 5.2995439452943477e-06 2.9856422192021229e-02
|
||||
37 1.3420649407688346e-04 -7.2457680016867857e-08 1.0126947778853273e-02
|
||||
38 -1.2282857182861024e-04 5.3192999901346361e-06 2.9856397351700859e-02
|
||||
39 -1.3423017399036286e-04 -7.4372916328267513e-08 1.0126888665730093e-02
|
||||
40 1.2281835687550854e-04 5.2995439452834599e-06 2.9856422192021292e-02
|
||||
41 -1.4968872501543050e-03 3.2942220392413755e-05 1.3240039391837519e-02
|
||||
42 2.4591095432896623e-04 -1.8173359176526104e-05 2.9694319334136906e-02
|
||||
43 3.4500868225182334e-04 -3.4247293770650532e-05 1.0175155314768796e-02
|
||||
44 -8.0766291618553391e-04 -1.0588887573257195e-03 3.1122704693977713e-02
|
||||
45 -1.4968872501544524e-03 3.2942220392554349e-05 1.3240039391837150e-02
|
||||
46 2.4591095432885027e-04 -1.8173359176560751e-05 2.9694319334136628e-02
|
||||
47 3.4500868225184405e-04 -3.4247293770696435e-05 1.0175155314768848e-02
|
||||
48 -8.0766291618553099e-04 -1.0588887573256150e-03 3.1122704693978008e-02
|
||||
1 1.4410673596325797e-03 -1.0169304521115965e-03 -1.4285401568186428e-02
|
||||
2 3.4021335312064239e-04 1.2797191122651606e-03 -3.1897958840992731e-02
|
||||
3 -2.6365414554435206e-04 2.0444568729883803e-04 -1.1309803039904094e-02
|
||||
4 3.2406270803533865e-04 -4.6232160096735283e-04 -2.9909889579305883e-02
|
||||
5 8.6243700250479213e-04 1.9924903099012974e-04 -1.2745204024321596e-02
|
||||
6 5.1904688928447039e-04 1.1276312199052507e-03 -3.0822480729154136e-02
|
||||
7 -1.6089060336456785e-04 1.4230793176456209e-04 -8.0115332340635770e-03
|
||||
8 -4.5244256523595955e-04 -1.4652373014613116e-04 -3.0138640813371177e-02
|
||||
9 -8.3793558681813027e-05 -4.1140467969865357e-04 -1.0951736791345751e-02
|
||||
10 1.0558934928096841e-04 3.2337794650378108e-04 -3.0861548668457323e-02
|
||||
11 6.9845541769924624e-05 1.7180670901979288e-05 -1.0563164513517073e-02
|
||||
12 -8.0679481796061916e-04 -4.0664748662187143e-04 -2.9406560679161624e-02
|
||||
13 4.1247302768956506e-04 -8.1126591131716001e-04 -1.1037106445845180e-02
|
||||
14 2.3332396247183456e-04 5.5939100731725207e-04 -2.9697039899835066e-02
|
||||
15 -4.4743716863518879e-04 -6.4402351400352417e-04 -1.0302248028000090e-02
|
||||
16 1.0107676498898814e-04 -1.7601612323562735e-04 -3.0440160861088226e-02
|
||||
17 7.8768398889356335e-04 -4.8290699580335434e-04 -1.0709307785601542e-02
|
||||
18 7.5772587814272661e-04 -1.0604331840892354e-04 -2.9051355476222663e-02
|
||||
19 -8.2396507652227567e-04 -5.1763481147044346e-04 -1.3882787481952484e-02
|
||||
20 -2.6539902077711439e-04 1.4543922016699269e-03 -2.9616038510215568e-02
|
||||
21 6.9059519132396775e-04 -6.1171669311730020e-04 -9.9927403128011426e-03
|
||||
22 5.1903378657992805e-04 -1.5794713465069979e-04 -2.8871277173751864e-02
|
||||
23 -1.2999304876387561e-03 5.3107732945463688e-04 -1.2422061766959291e-02
|
||||
24 -3.2644539359692542e-04 1.5480516514320667e-03 -3.0724047265085791e-02
|
||||
25 -4.4212891241347113e-04 -3.2697766181911145e-05 1.0257616370513183e-02
|
||||
26 1.2029313214847238e-03 -6.6888291982682407e-04 3.1678775972923956e-02
|
||||
27 1.1283890792386422e-03 -2.8542217957172600e-08 1.3174047524615399e-02
|
||||
28 -7.2378412563897741e-04 2.4335495682349174e-04 2.9873149619175456e-02
|
||||
29 -1.0532619377677580e-03 7.4515643613297378e-04 1.0732343526110863e-02
|
||||
30 1.3914911640253280e-03 -1.4093576056224714e-03 3.0799402494171169e-02
|
||||
31 1.5526628138436077e-03 3.4346152193312973e-04 1.3180608561349179e-02
|
||||
32 -9.2853455508014825e-05 -3.6966978881082394e-04 3.0309911553159243e-02
|
||||
33 7.8802353059772515e-04 6.3186818726301624e-04 1.1208113889006823e-02
|
||||
34 -4.4157767037679690e-04 -5.9159130843379026e-05 3.0896068470685031e-02
|
||||
35 1.4552473121265397e-06 5.5777693731219765e-04 1.0463857570582444e-02
|
||||
36 7.5305807476735965e-04 6.4063119252587969e-04 2.9445714727166269e-02
|
||||
37 -5.1527886711158206e-04 4.5022029011034236e-04 1.0102553591648427e-02
|
||||
38 -2.3334071714133271e-04 5.5981947321851779e-04 2.9312019903716846e-02
|
||||
39 -8.4029973392166224e-04 -8.2857530655882402e-04 9.9596391825485173e-03
|
||||
40 3.1175727776466388e-04 1.5729483520098114e-04 2.9567298942710162e-02
|
||||
41 -2.2701903109886260e-03 -1.0402124774515768e-04 1.2320885381156934e-02
|
||||
42 -1.6831498396996131e-04 -3.1136792853859915e-04 3.0274601848989606e-02
|
||||
43 5.5664724581996916e-05 1.9307476178885243e-04 1.1909723052594356e-02
|
||||
44 -9.5046209166255765e-04 -6.3004473120715018e-05 3.0132966879057418e-02
|
||||
45 -1.4273207846817208e-03 -8.2385448535969076e-04 1.1604140080847982e-02
|
||||
46 3.2400780661911109e-04 2.8806285981541469e-05 2.9005364916792991e-02
|
||||
47 4.4459996506777412e-04 2.0256574589517135e-04 1.0421645129745381e-02
|
||||
48 -1.0286493798823708e-03 -1.5188527673106898e-03 3.1019644299872643e-02
|
||||
...
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user