code issues

This commit is contained in:
iafoss 2020-03-25 20:18:07 -04:00
parent c793db66d2
commit fa4ef70829
56 changed files with 1275 additions and 2252 deletions

View File

@ -421,7 +421,7 @@ endforeach()
##############################################
# add lib sources of (simple) enabled packages
############################################
foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-H5MD USER-MESONT)
foreach(SIMPLE_LIB POEMS USER-ATC USER-AWPMD USER-H5MD)
if(PKG_${SIMPLE_LIB})
string(REGEX REPLACE "^USER-" "" PKG_LIB "${SIMPLE_LIB}")
string(TOLOWER "${PKG_LIB}" PKG_LIB)

View File

@ -20,7 +20,7 @@ additional letters in parenthesis: g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.
.. table_from_list::
:columns: 6
:columns: 5
* :doc:`ackland/atom <compute_ackland_atom>`
* :doc:`adf <compute_adf>`
@ -79,16 +79,10 @@ KOKKOS, o = USER-OMP, t = OPT.
* :doc:`ke/atom/eff <compute_ke_atom_eff>`
* :doc:`ke/eff <compute_ke_eff>`
* :doc:`ke/rigid <compute_ke_rigid>`
* :doc:`mesont/Es <compute_mesont>`
* :doc:`mesont/Eb <compute_mesont>`
* :doc:`mesont/Et <compute_mesont>`
* :doc:`mesont/B <compute_mesont>`
* :doc:`mesont/Es_tot <compute_mesont>`
* :doc:`mesont/Eb_tot <compute_mesont>`
* :doc:`mesont/Et_tot <compute_mesont>`
* :doc:`meso/e/atom <compute_meso_e_atom>`
* :doc:`meso/rho/atom <compute_meso_rho_atom>`
* :doc:`meso/t/atom <compute_meso_t_atom>`
* :doc:`mesont <compute_mesont>`
* :doc:`momentum <compute_momentum>`
* :doc:`msd <compute_msd>`
* :doc:`msd/chunk <compute_msd_chunk>`
@ -170,4 +164,3 @@ KOKKOS, o = USER-OMP, t = OPT.
* :doc:`vcm/chunk <compute_vcm_chunk>`
* :doc:`voronoi/atom <compute_voronoi_atom>`
* :doc:`xrd <compute_xrd>`

View File

@ -26,6 +26,10 @@ OPT.
* :doc:`zero <pair_zero>`
* :doc:`hybrid (k) <pair_hybrid>`
* :doc:`hybrid/overlay (k) <pair_hybrid>`
* :doc:`kim <pair_kim>`
* :doc:`list <pair_list>`
*
*
*
*
*
@ -110,14 +114,12 @@ OPT.
* :doc:`hbond/dreiding/lj (o) <pair_hbond_dreiding>`
* :doc:`hbond/dreiding/morse (o) <pair_hbond_dreiding>`
* :doc:`ilp/graphene/hbn <pair_ilp_graphene_hbn>`
* :doc:`kim <pair_kim>`
* :doc:`kolmogorov/crespi/full <pair_kolmogorov_crespi_full>`
* :doc:`kolmogorov/crespi/z <pair_kolmogorov_crespi_z>`
* :doc:`lcbop <pair_lcbop>`
* :doc:`lebedeva/z <pair_lebedeva_z>`
* :doc:`lennard/mdf <pair_mdf>`
* :doc:`line/lj <pair_line_lj>`
* :doc:`list <pair_list>`
* :doc:`lj/charmm/coul/charmm (iko) <pair_charmm>`
* :doc:`lj/charmm/coul/charmm/implicit (ko) <pair_charmm>`
* :doc:`lj/charmm/coul/long (gikot) <pair_charmm>`

File diff suppressed because it is too large Load Diff

View File

@ -28,93 +28,93 @@ package:
* int = internal library: provided with LAMMPS, but you may need to build it
* ext = external library: you will need to download and install it on your machine
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| Package | Description | Doc page | Example | Library |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-ADIOS <PKG-USER-ADIOS>` | dump output via ADIOS | :doc:`dump adios <dump_adios>` | USER/adios | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-ATC <PKG-USER-ATC>` | Atom-to-Continuum coupling | :doc:`fix atc <fix_atc>` | USER/atc | int |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-AWPMD <PKG-USER-AWPMD>` | wave packet MD | :doc:`pair_style awpmd/cut <pair_awpmd>` | USER/awpmd | int |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-BOCS <PKG-USER-BOCS>` | BOCS bottom up coarse graining | :doc:`fix bocs <fix_bocs>` | USER/bocs | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-CGDNA <PKG-USER-CGDNA>` | coarse-grained DNA force fields | src/USER-CGDNA/README | USER/cgdna | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-CGSDK <PKG-USER-CGSDK>` | SDK coarse-graining model | :doc:`pair_style lj/sdk <pair_sdk>` | USER/cgsdk | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-COLVARS <PKG-USER-COLVARS>` | collective variables library | :doc:`fix colvars <fix_colvars>` | USER/colvars | int |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-DIFFRACTION <PKG-USER-DIFFRACTION>` | virtual x-ray and electron diffraction | :doc:`compute xrd <compute_xrd>` | USER/diffraction | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-DPD <PKG-USER-DPD>` | reactive dissipative particle dynamics | src/USER-DPD/README | USER/dpd | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-DRUDE <PKG-USER-DRUDE>` | Drude oscillators | :doc:`Howto drude <Howto_drude>` | USER/drude | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-EFF <PKG-USER-EFF>` | electron force field | :doc:`pair_style eff/cut <pair_eff>` | USER/eff | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-FEP <PKG-USER-FEP>` | free energy perturbation | :doc:`compute fep <compute_fep>` | USER/fep | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-H5MD <PKG-USER-H5MD>` | dump output via HDF5 | :doc:`dump h5md <dump_h5md>` | n/a | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-INTEL <PKG-USER-INTEL>` | optimized Intel CPU and KNL styles | :doc:`Speed intel <Speed_intel>` | `Benchmarks <https://lammps.sandia.gov/bench.html>`_ | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-LB <PKG-USER-LB>` | Lattice Boltzmann fluid | :doc:`fix lb/fluid <fix_lb_fluid>` | USER/lb | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-MANIFOLD <PKG-USER-MANIFOLD>` | motion on 2d surfaces | :doc:`fix manifoldforce <fix_manifoldforce>` | USER/manifold | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-MEAMC <PKG-USER-MEAMC>` | modified EAM potential (C++) | :doc:`pair_style meam/c <pair_meamc>` | meamc | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-MESODPD <PKG-USER-MESODPD>` | mesoscale DPD models | :doc:`pair_style edpd <pair_mesodpd>` | USER/mesodpd | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-MESONT <PKG-USER-MESONT>` | mesoscopic tubular potential model | :doc:`pair_style mesont/tpm <pair_mesont_tpm>` | USER/mesont | int |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-MGPT <PKG-USER-MGPT>` | fast MGPT multi-ion potentials | :doc:`pair_style mgpt <pair_mgpt>` | USER/mgpt | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-MISC <PKG-USER-MISC>` | single-file contributions | USER-MISC/README | USER/misc | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-MOFFF <PKG-USER-MOFFF>` | styles for `MOF-FF <MOFplus_>`_ force field | :doc:`pair_style buck6d/coul/gauss <pair_buck6d_coul_gauss>` | USER/mofff | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-MOLFILE <PKG-USER-MOLFILE>` | `VMD <https://www.ks.uiuc.edu/Research/vmd/>`_ molfile plug-ins | :doc:`dump molfile <dump_molfile>` | n/a | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-NETCDF <PKG-USER-NETCDF>` | dump output via NetCDF | :doc:`dump netcdf <dump_netcdf>` | n/a | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-OMP <PKG-USER-OMP>` | OpenMP-enabled styles | :doc:`Speed omp <Speed_omp>` | `Benchmarks <https://lammps.sandia.gov/bench.html>`_ | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-PHONON <PKG-USER-PHONON>` | phonon dynamical matrix | :doc:`fix phonon <fix_phonon>` | USER/phonon | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-PLUMED <PKG-USER-PLUMED>` | :ref:`PLUMED <PLUMED>` free energy library | :doc:`fix plumed <fix_plumed>` | USER/plumed | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-PTM <PKG-USER-PTM>` | Polyhedral Template Matching | :doc:`compute ptm/atom <compute_ptm_atom>` | n/a | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-QMMM <PKG-USER-QMMM>` | QM/MM coupling | :doc:`fix qmmm <fix_qmmm>` | USER/qmmm | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-QTB <PKG-USER-QTB>` | quantum nuclear effects | :doc:`fix qtb <fix_qtb>` :doc:`fix qbmsst <fix_qbmsst>` | qtb | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-QUIP <PKG-USER-QUIP>` | QUIP/libatoms interface | :doc:`pair_style quip <pair_quip>` | USER/quip | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-REACTION <PKG-USER-REACTION>` | chemical reactions in classical MD | :doc:`fix bond/react <fix_bond_react>` | USER/reaction | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-REAXC <PKG-USER-REAXC>` | ReaxFF potential (C/C++) | :doc:`pair_style reaxc <pair_reaxc>` | reax | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-SCAFACOS <PKG-USER-SCAFACOS>` | wrapper on ScaFaCoS solver | :doc:`kspace_style scafacos <kspace_style>` | USER/scafacos | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-SDPD <PKG-USER-SDPD>` | smoothed dissipative particle dynamics | :doc:`pair_style sdpd/taitwater/isothermal <pair_sdpd_taitwater_isothermal>` | USER/sdpd | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-SMD <PKG-USER-SMD>` | smoothed Mach dynamics | `SMD User Guide <PDF/SMD_LAMMPS_userguide.pdf>`_ | USER/smd | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-SMTBQ <PKG-USER-SMTBQ>` | second moment tight binding QEq potential | :doc:`pair_style smtbq <pair_smtbq>` | USER/smtbq | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-SPH <PKG-USER-SPH>` | smoothed particle hydrodynamics | `SPH User Guide <PDF/SPH_LAMMPS_userguide.pdf>`_ | USER/sph | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-TALLY <PKG-USER-TALLY>` | pairwise tally computes | :doc:`compute XXX/tally <compute_tally>` | USER/tally | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-UEF <PKG-USER-UEF>` | extensional flow | :doc:`fix nvt/uef <fix_nh_uef>` | USER/uef | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-VTK <PKG-USER-VTK>` | dump output via VTK | :doc:`compute vtk <dump_vtk>` | n/a | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
| :ref:`USER-YAFF <PKG-USER-YAFF>` | additional styles implemented in YAFF | :doc:`angle_style cross <angle_cross>` | USER/yaff | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+------------------------------------------------------+---------+
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| Package | Description | Doc page | Example | Library |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-ADIOS <PKG-USER-ADIOS>` | dump output via ADIOS | :doc:`dump adios <dump_adios>` | USER/adios | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-ATC <PKG-USER-ATC>` | Atom-to-Continuum coupling | :doc:`fix atc <fix_atc>` | USER/atc | int |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-AWPMD <PKG-USER-AWPMD>` | wave packet MD | :doc:`pair_style awpmd/cut <pair_awpmd>` | USER/awpmd | int |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-BOCS <PKG-USER-BOCS>` | BOCS bottom up coarse graining | :doc:`fix bocs <fix_bocs>` | USER/bocs | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-CGDNA <PKG-USER-CGDNA>` | coarse-grained DNA force fields | src/USER-CGDNA/README | USER/cgdna | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-CGSDK <PKG-USER-CGSDK>` | SDK coarse-graining model | :doc:`pair_style lj/sdk <pair_sdk>` | USER/cgsdk | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-COLVARS <PKG-USER-COLVARS>` | collective variables library | :doc:`fix colvars <fix_colvars>` | USER/colvars | int |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-DIFFRACTION <PKG-USER-DIFFRACTION>` | virtual x-ray and electron diffraction | :doc:`compute xrd <compute_xrd>` | USER/diffraction | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-DPD <PKG-USER-DPD>` | reactive dissipative particle dynamics | src/USER-DPD/README | USER/dpd | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-DRUDE <PKG-USER-DRUDE>` | Drude oscillators | :doc:`Howto drude <Howto_drude>` | USER/drude | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-EFF <PKG-USER-EFF>` | electron force field | :doc:`pair_style eff/cut <pair_eff>` | USER/eff | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-FEP <PKG-USER-FEP>` | free energy perturbation | :doc:`compute fep <compute_fep>` | USER/fep | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-H5MD <PKG-USER-H5MD>` | dump output via HDF5 | :doc:`dump h5md <dump_h5md>` | n/a | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-INTEL <PKG-USER-INTEL>` | optimized Intel CPU and KNL styles | :doc:`Speed intel <Speed_intel>` | `Benchmarks <http://lammps.sandia.gov/bench.html>`_ | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-LB <PKG-USER-LB>` | Lattice Boltzmann fluid | :doc:`fix lb/fluid <fix_lb_fluid>` | USER/lb | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-MANIFOLD <PKG-USER-MANIFOLD>` | motion on 2d surfaces | :doc:`fix manifoldforce <fix_manifoldforce>` | USER/manifold | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-MEAMC <PKG-USER-MEAMC>` | modified EAM potential (C++) | :doc:`pair_style meam/c <pair_meamc>` | meamc | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-MESO <PKG-USER-MESO>` | mesoscale DPD models | :doc:`pair_style edpd <pair_meso>` | USER/meso | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-MESONT <PKG-USER-MESONT>` | mesoscopic tubular potential model for nanotubes | :doc:`pair_style mesont/tpm <pair_mesont_tpm>` | USER/mesont | int |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-MGPT <PKG-USER-MGPT>` | fast MGPT multi-ion potentials | :doc:`pair_style mgpt <pair_mgpt>` | USER/mgpt | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-MISC <PKG-USER-MISC>` | single-file contributions | USER-MISC/README | USER/misc | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-MOFFF <PKG-USER-MOFFF>` | styles for `MOF-FF <MOFplus_>`_ force field | :doc:`pair_style buck6d/coul/gauss <pair_buck6d_coul_gauss>` | USER/mofff | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-MOLFILE <PKG-USER-MOLFILE>` | `VMD <https://www.ks.uiuc.edu/Research/vmd/>`_ molfile plug-ins | :doc:`dump molfile <dump_molfile>` | n/a | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-NETCDF <PKG-USER-NETCDF>` | dump output via NetCDF | :doc:`dump netcdf <dump_netcdf>` | n/a | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-OMP <PKG-USER-OMP>` | OpenMP-enabled styles | :doc:`Speed omp <Speed_omp>` | `Benchmarks <http://lammps.sandia.gov/bench.html>`_ | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-PHONON <PKG-USER-PHONON>` | phonon dynamical matrix | :doc:`fix phonon <fix_phonon>` | USER/phonon | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-PLUMED <PKG-USER-PLUMED>` | :ref:`PLUMED <PLUMED>` free energy library | :doc:`fix plumed <fix_plumed>` | USER/plumed | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-PTM <PKG-USER-PTM>` | Polyhedral Template Matching | :doc:`compute ptm/atom <compute_ptm_atom>` | n/a | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-QMMM <PKG-USER-QMMM>` | QM/MM coupling | :doc:`fix qmmm <fix_qmmm>` | USER/qmmm | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-QTB <PKG-USER-QTB>` | quantum nuclear effects | :doc:`fix qtb <fix_qtb>` :doc:`fix qbmsst <fix_qbmsst>` | qtb | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-QUIP <PKG-USER-QUIP>` | QUIP/libatoms interface | :doc:`pair_style quip <pair_quip>` | USER/quip | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-REACTION <PKG-USER-REACTION>` | chemical reactions in classical MD | :doc:`fix bond/react <fix_bond_react>` | USER/reaction | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-REAXC <PKG-USER-REAXC>` | ReaxFF potential (C/C++) | :doc:`pair_style reaxc <pair_reaxc>` | reax | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-SCAFACOS <PKG-USER-SCAFACOS>` | wrapper on ScaFaCoS solver | :doc:`kspace_style scafacos <kspace_style>` | USER/scafacos | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-SDPD <PKG-USER-SDPD>` | smoothed dissipative particle dynamics | :doc:`pair_style sdpd/taitwater/isothermal <pair_sdpd_taitwater_isothermal>` | USER/sdpd | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-SMD <PKG-USER-SMD>` | smoothed Mach dynamics | `SMD User Guide <PDF/SMD_LAMMPS_userguide.pdf>`_ | USER/smd | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-SMTBQ <PKG-USER-SMTBQ>` | second moment tight binding QEq potential | :doc:`pair_style smtbq <pair_smtbq>` | USER/smtbq | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-SPH <PKG-USER-SPH>` | smoothed particle hydrodynamics | `SPH User Guide <PDF/SPH_LAMMPS_userguide.pdf>`_ | USER/sph | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-TALLY <PKG-USER-TALLY>` | pairwise tally computes | :doc:`compute XXX/tally <compute_tally>` | USER/tally | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-UEF <PKG-USER-UEF>` | extensional flow | :doc:`fix nvt/uef <fix_nh_uef>` | USER/uef | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-VTK <PKG-USER-VTK>` | dump output via VTK | :doc:`compute vtk <dump_vtk>` | n/a | ext |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
| :ref:`USER-YAFF <PKG-USER-YAFF>` | additional styles implemented in YAFF | :doc:`angle_style cross <angle_cross>` | USER/yaff | no |
+------------------------------------------------+-----------------------------------------------------------------+-------------------------------------------------------------------------------+-----------------------------------------------------+---------+
.. _MOFplus: https://www.mofplus.org/content/show/MOF-FF
.. _PLUMED: https://www.plumed.org
.. _PLUMED: http://www.plumed.org

View File

@ -6,14 +6,15 @@ atom_style command
Syntax
""""""
.. code-block:: LAMMPS
atom_style style args
* style = *angle* or *atomic* or *body* or *bond* or *charge* or *dipole* or *dpd* or *edpd* or *mdpd* or *tdpd* or *electron* or *ellipsoid* or *full* or *line* or *meso* or *molecular* or *peri* or *smd* or *sphere* or *spin* or *tri* or *template* or *hybrid*
.. parsed-literal::
args = none for any style except the following
*body* args = bstyle bstyle-args
bstyle = style of body particles
@ -27,9 +28,11 @@ Syntax
* accelerated styles (with same args) = *angle/kk* or *atomic/kk* or *bond/kk* or *charge/kk* or *full/kk* or *molecular/kk*
Examples
""""""""
.. code-block:: LAMMPS
atom_style atomic
@ -85,8 +88,6 @@ quantities.
+--------------+-----------------------------------------------------+--------------------------------------+
| *charge* | charge | atomic system with charges |
+--------------+-----------------------------------------------------+--------------------------------------+
| *mesont* | mass, radius, length, buckling, connections, tube id| Carbon nanotubes |
+--------------+-----------------------------------------------------+--------------------------------------+
| *dipole* | charge and dipole moment | system with dipolar particles |
+--------------+-----------------------------------------------------+--------------------------------------+
| *dpd* | internal temperature and internal energies | DPD particles |
@ -107,6 +108,8 @@ quantities.
+--------------+-----------------------------------------------------+--------------------------------------+
| *meso* | rho, e, cv | SPH particles |
+--------------+-----------------------------------------------------+--------------------------------------+
| *mesont* | mass, radius, length, buckling, connections, tube id| mesoscopic nanotubes |
+--------------+-----------------------------------------------------+--------------------------------------+
| *molecular* | bonds, angles, dihedrals, impropers | uncharged molecules |
+--------------+-----------------------------------------------------+--------------------------------------+
| *peri* | mass, volume | mesoscopic Peridynamic models |
@ -121,10 +124,9 @@ quantities.
+--------------+-----------------------------------------------------+--------------------------------------+
| *tri* | corner points, angular momentum | rigid bodies |
+--------------+-----------------------------------------------------+--------------------------------------+
| *wavepacket* | charge, spin, eradius, etag, cs_re, cs_im | AWPMD |
| *wavepacket* | charge, spin, eradius, etag, cs\_re, cs\_im | AWPMD |
+--------------+-----------------------------------------------------+--------------------------------------+
.. note::
It is possible to add some attributes, such as a molecule ID, to
@ -161,7 +163,7 @@ For the *dipole* style, a point dipole is defined for each point
particle. Note that if you wish the particles to be finite-size
spheres as in a Stockmayer potential for a dipolar fluid, so that the
particles can rotate due to dipole-dipole interactions, then you need
to use atom_style hybrid sphere dipole, which will assign both a
to use atom\_style hybrid sphere dipole, which will assign both a
diameter and dipole moment to each particle.
For the *electron* style, the particles representing electrons are 3d
@ -174,14 +176,14 @@ per-particle mass and volume.
The *dpd* style is for dissipative particle dynamics (DPD) particles.
Note that it is part of the USER-DPD package, and is not for use with
the :doc:`pair_style dpd or dpd/stat <pair_dpd>` commands, which can
simply use atom_style atomic. Atom_style dpd extends DPD particle
simply use atom\_style atomic. Atom\_style dpd extends DPD particle
properties with internal temperature (dpdTheta), internal conductive
energy (uCond), internal mechanical energy (uMech), and internal
chemical energy (uChem).
The *edpd* style is for energy-conserving dissipative particle
dynamics (eDPD) particles which store a temperature (edpd_temp), and
heat capacity(edpd_cv).
dynamics (eDPD) particles which store a temperature (edpd\_temp), and
heat capacity(edpd\_cv).
The *mdpd* style is for many-body dissipative particle dynamics (mDPD)
particles which store a density (rho) for considering
@ -189,7 +191,7 @@ density-dependent many-body interactions.
The *tdpd* style is for transport dissipative particle dynamics (tDPD)
particles which store a set of chemical concentration. An integer
"cc_species" is required to specify the number of chemical species
"cc\_species" is required to specify the number of chemical species
involved in a tDPD system.
The *meso* style is for smoothed particle hydrodynamics (SPH)
@ -208,7 +210,7 @@ Those spins have a norm (their magnetic moment) and a direction.
The *wavepacket* style is similar to *electron*\ , but the electrons may
consist of several Gaussian wave packets, summed up with coefficients
cs= (cs_re,cs_im). Each of the wave packets is treated as a separate
cs= (cs\_re,cs\_im). Each of the wave packets is treated as a separate
particle in LAMMPS, wave packets belonging to the same electron must
have identical *etag* values.
@ -239,7 +241,7 @@ can be advantageous for large-scale coarse-grained systems.
.. note::
When using the *template* style with a :doc:`molecule template <molecule>` that contains multiple molecules, you should
insure the atom types, bond types, angle_types, etc in all the
insure the atom types, bond types, angle\_types, etc in all the
molecules are consistent. E.g. if one molecule represents H2O and
another CO2, then you probably do not want each molecule file to
define 2 atom types and a single bond type, because they will conflict
@ -263,11 +265,13 @@ orientation and position can be time integrated due to forces and
torques.
Note that there may be additional arguments required along with the
*bstyle* specification, in the atom_style body command. These
*bstyle* specification, in the atom\_style body command. These
arguments are described on the :doc:`Howto body <Howto_body>` doc page.
----------
Typically, simulations require only a single (non-hybrid) atom style.
If some atoms in the simulation do not have all the properties defined
by a particular style, use the simplest style that defines all the
@ -278,7 +282,7 @@ If some atoms have bonds, but others do not, use the *bond* style.
The only scenario where the *hybrid* style is needed is if there is no
single style which defines all needed properties of all atoms. For
example, as mentioned above, if you want dipolar particles which will
rotate due to torque, you need to use "atom_style hybrid sphere
rotate due to torque, you need to use "atom\_style hybrid sphere
dipole". When a hybrid style is used, atoms store and communicate the
union of all quantities implied by the individual styles.
@ -289,8 +293,10 @@ per-atom basis.
LAMMPS can be extended with new atom styles as well as new body
styles; see the :doc:`Modify <Modify>` doc page.
----------
Styles with a *kk* suffix are functionally the same as the
corresponding style without the suffix. They have been optimized to
run faster, depending on your available hardware, as discussed in on
@ -315,6 +321,7 @@ instructions on how to use the accelerated styles effectively.
Restrictions
""""""""""""
This command cannot be used after the simulation box is defined by a
:doc:`read_data <read_data>` or :doc:`create_box <create_box>` command.
@ -337,7 +344,7 @@ The *electron* style is part of the USER-EFF package for :doc:`electronic force
The *dpd* style is part of the USER-DPD package for dissipative
particle dynamics (DPD).
The *edpd*\ , *mdpd*\ , and *tdpd* styles are part of the USER-MESODPD package
The *edpd*\ , *mdpd*\ , and *tdpd* styles are part of the USER-MESO package
for energy-conserving dissipative particle dynamics (eDPD), many-body
dissipative particle dynamics (mDPD), and transport dissipative particle
dynamics (tDPD), respectively.
@ -345,13 +352,13 @@ dynamics (tDPD), respectively.
The *meso* style is part of the USER-SPH package for smoothed particle
hydrodynamics (SPH). See `this PDF guide <USER/sph/SPH_LAMMPS_userguide.pdf>`_ to using SPH in LAMMPS.
The *mesont* style is part of the USER-MESONT package.
The *spin* style is part of the SPIN package.
The *wavepacket* style is part of the USER-AWPMD package for the
:doc:`antisymmetrized wave packet MD method <pair_awpmd>`.
The *mesont* style is part of the USER-MESONT package.
Related commands
""""""""""""""""
@ -360,11 +367,15 @@ Related commands
Default
"""""""
atom_style atomic
atom\_style atomic
----------
.. _Grime:
**(Grime)** Grime and Voth, to appear in J Chem Theory & Computation
(2014).

View File

@ -6,6 +6,7 @@ compute command
Syntax
""""""
.. parsed-literal::
compute ID group-ID style args
@ -18,7 +19,8 @@ Syntax
Examples
""""""""
.. code-block:: LAMMPS
.. parsed-literal::
compute 1 all temp
compute newtemp flow temp/partial 1 1 0
@ -41,8 +43,10 @@ various LAMMPS output options, many of which involve computes.
The ID of a compute can only contain alphanumeric characters and
underscores.
----------
Computes calculate one of three styles of quantities: global,
per-atom, or local. A global quantity is one or more system-wide
values, e.g. the temperature of the system. A per-atom quantity is
@ -72,11 +76,11 @@ discussed below, it can be referenced via the following bracket
notation, where ID is the ID of the compute:
+-------------+--------------------------------------------+
| c_ID | entire scalar, vector, or array |
| c\_ID | entire scalar, vector, or array |
+-------------+--------------------------------------------+
| c_ID[I] | one element of vector, one column of array |
| c\_ID[I] | one element of vector, one column of array |
+-------------+--------------------------------------------+
| c_ID[I][J] | one element of array |
| c\_ID[I][J] | one element of array |
+-------------+--------------------------------------------+
In other words, using one bracket reduces the dimension of the
@ -88,12 +92,14 @@ vector or array.
Note that commands and :doc:`variables <variable>` which use compute
quantities typically do not allow for all kinds, e.g. a command may
require a vector of values, not a scalar. This means there is no
ambiguity about referring to a compute quantity as c_ID even if it
ambiguity about referring to a compute quantity as c\_ID even if it
produces, for example, both a scalar and vector. The doc pages for
various commands explain the details.
----------
In LAMMPS, the values generated by a compute can be used in several
ways:
@ -109,6 +115,7 @@ ways:
command. Or the per-atom values can be referenced in an :doc:`atom-style variable <variable>`.
* Local values can be reduced by the :doc:`compute reduce <compute_reduce>` command, or histogrammed by the :doc:`fix ave/histo <fix_ave_histo>` command, or output by the :doc:`dump local <dump>` command.
The results of computes that calculate global quantities can be either
"intensive" or "extensive" values. Intensive means the value is
independent of the number of atoms in the simulation,
@ -116,20 +123,23 @@ e.g. temperature. Extensive means the value scales with the number of
atoms in the simulation, e.g. total rotational kinetic energy.
:doc:`Thermodynamic output <thermo_style>` will normalize extensive
values by the number of atoms in the system, depending on the
"thermo_modify norm" setting. It will not normalize intensive values.
"thermo\_modify norm" setting. It will not normalize intensive values.
If a compute value is accessed in another way, e.g. by a
:doc:`variable <variable>`, you may want to know whether it is an
intensive or extensive value. See the doc page for individual
computes for further info.
----------
LAMMPS creates its own computes internally for thermodynamic output.
Three computes are always created, named "thermo_temp",
"thermo_press", and "thermo_pe", as if these commands had been invoked
Three computes are always created, named "thermo\_temp",
"thermo\_press", and "thermo\_pe", as if these commands had been invoked
in the input script:
.. code-block:: LAMMPS
.. parsed-literal::
compute thermo_temp all temp
compute thermo_press all pressure thermo_temp
@ -156,8 +166,10 @@ Code for new computes can be added to LAMMPS; see the
:doc:`Modify <Modify>` doc page for details. The results of their
calculations accessed in the various ways described above.
----------
Each compute style has its own doc page which describes its arguments
and what it does. Here is an alphabetic list of compute styles
available in LAMMPS. They are also listed in more compact form on the
@ -225,13 +237,7 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` doc
* :doc:`ke/atom/eff <compute_ke_atom_eff>` - per-atom translational and radial kinetic energy in the electron force field model
* :doc:`ke/eff <compute_ke_eff>` - kinetic energy of a group of nuclei and electrons in the electron force field model
* :doc:`ke/rigid <compute_ke_rigid>` - translational kinetic energy of rigid bodies
* :doc:`mesont/Es <compute_mesont>` - Nanotube (NT) stretching per node energy
* :doc:`mesont/Eb <compute_mesont>` - NT bending per node energy
* :doc:`mesont/Et <compute_mesont>` - NT intertube per node energy
* :doc:`mesont/B <compute_mesont>` - NT per node buckling flag
* :doc:`mesont/Es_tot <compute_mesont>` - NT stretching energy
* :doc:`mesont/Eb_tot <compute_mesont>` - NT bending energy
* :doc:`mesont/Et_tot <compute_mesont>` - NT intertube energy
* :doc:`mesont <compute_mesont>` - Nanotube bending,stretching, and intertube energies
* :doc:`meso/e/atom <compute_meso_e_atom>` - per-atom internal energy of Smooth-Particle Hydrodynamics atoms
* :doc:`meso/rho/atom <compute_meso_rho_atom>` - per-atom mesoscopic density of Smooth-Particle Hydrodynamics atoms
* :doc:`meso/t/atom <compute_meso_t_atom>` - per-atom internal temperature of Smooth-Particle Hydrodynamics atoms
@ -326,9 +332,4 @@ Related commands
:doc:`uncompute <uncompute>`, :doc:`compute_modify <compute_modify>`, :doc:`fix ave/atom <fix_ave_atom>`, :doc:`fix ave/time <fix_ave_time>`, :doc:`fix ave/histo <fix_ave_histo>`
**Default:** none
.. _lws: http://lammps.sandia.gov
.. _ld: Manual.html
.. _lc: Commands_all.html
**Default:** none

View File

@ -1,36 +1,19 @@
.. index:: compute mesont
compute mesont/Es command
compute mesont command
==========================
compute mesont/Eb command
==========================
compute mesont/Et command
==========================
compute mesont/B command
==========================
compute mesont/Es\_tot command
===============================
compute mesont/Eb\_tot command
===============================
compute mesont/Et\_tot command
===============================
Syntax
""""""
.. parsed-literal::
compute ID group-ID mesont/Es
compute ID group-ID mesont mode
* ID, group-ID are documented in :doc:`compute <compute>` command
* mesont/Es = style name of the compute command
* mesont = style name of the compute command
* mode = one of estretch, ebend, etube, stretch_tot, ebend_tot, and etube_tot (see details below)
Examples
""""""""
@ -38,23 +21,25 @@ Examples
.. parsed-literal::
compute 1 all mesont/Es
compute 1 all mesont estretch
Description
"""""""""""
These computes define computations for the per-node stretching (mesont/Es),
bending (mesont/Eb), and intertube (mesont/Et) energies, buckling flag (mesont/B),
as well as the total stretching (mesont/Es\_tot), bending (mesont/Eb\_tot), and
intertube (mesont/Et\_tot) energies for each atom (node) in a group.
These computes define computations for the per-node stretching (estretch),
bending (ebend), and intertube (etube) energies, as well as the total
stretching (estretch_tot), bending (ebend_tot), and intertube (etube_tot)
energies for each atom (node) in a group. The evaluated value is selected by
a parameter passed to the compute: estretch, ebend, etube, estretch_tot,
ebend_tot, and etube_tot.
**Output info:**
These computes calculate per-node (per-atom) vectors (mesont/Es, mesont/Eb, mesont/Et, mesont/B),
These computes calculate per-node (per-atom) vectors (estretch, ebend, etube),
which can be accessed by any command that uses per-atom values from a
compute as input, and global scalars (mesont/Es\_tot, mesont/Eb\_tot,
mesont/Et\_tot). See the :doc:`Howto output <Howto_output>` doc page for an
overview of LAMMPS output options.
compute as input, and global scalars (stretch_tot, ebend_tot, and etube_tot).
See the :doc:`Howto output <Howto_output>` doc page for an overview of LAMMPS
output options.
The per-atom vector values will be in energy :doc:`units <units>`.

View File

@ -30,6 +30,7 @@ Syntax
corner2x, corner2y, corner2z,
corner3x, corner3y, corner3z,
nbonds,
buckling,
vfrac, s0,
spin, eradius, ervel, erforce,
rho, drho, e, de, cv,
@ -63,6 +64,7 @@ Syntax
end12x, end12y, end12z = end points of line segment
corner123x, corner123y, corner123z = corner points of triangle
nbonds = number of bonds assigned to an atom
buckling = buckling flag used in mesoscopic simulation of nanotubes
.. parsed-literal::

View File

@ -1,272 +0,0 @@
.. index:: pair_style airebo
pair_style airebo command
=========================
pair_style airebo/intel command
===============================
pair_style airebo/omp command
=============================
pair_style airebo/morse command
===============================
pair_style airebo/morse/intel command
=====================================
pair_style airebo/morse/omp command
===================================
pair_style rebo command
=======================
pair_style rebo/intel command
=============================
pair_style rebo/omp command
===========================
Syntax
""""""
.. code-block:: LAMMPS
pair_style style cutoff LJ_flag TORSION_flag cutoff_min
* style = *airebo* or *airebo/morse* or *rebo*
* cutoff = LJ or Morse cutoff (:math:`\sigma` scale factor) (AIREBO and AIREBO-M only)
* LJ_flag = 0/1 to turn off/on the LJ or Morse term (AIREBO and AIREBO-M only, optional)
* TORSION_flag = 0/1 to turn off/on the torsion term (AIREBO and AIREBO-M only, optional)
* cutoff_min = Start of the transition region of cutoff (:math:`\sigma` scale factor) (AIREBO and AIREBO-M only, optional)
Examples
""""""""
.. code-block:: LAMMPS
pair_style airebo 3.0
pair_style airebo 2.5 1 0
pair_coeff * * ../potentials/CH.airebo H C
pair_style airebo/morse 3.0
pair_coeff * * ../potentials/CH.airebo-m H C
pair_style rebo
pair_coeff * * ../potentials/CH.rebo H C
Description
"""""""""""
The *airebo* pair style computes the Adaptive Intermolecular Reactive
Empirical Bond Order (AIREBO) Potential of :ref:`(Stuart) <Stuart>` for a
system of carbon and/or hydrogen atoms. Note that this is the initial
formulation of AIREBO from 2000, not the later formulation.
The *airebo/morse* pair style computes the AIREBO-M potential, which
is equivalent to AIREBO, but replaces the LJ term with a Morse potential.
The Morse potentials are parameterized by high-quality quantum chemistry
(MP2) calculations and do not diverge as quickly as particle density
increases. This allows AIREBO-M to retain accuracy to much higher pressures
than AIREBO (up to 40 GPa for Polyethylene). Details for this potential
and its parameterization are given in :ref:`(O'Conner) <OConnor>`.
The *rebo* pair style computes the Reactive Empirical Bond Order (REBO)
Potential of :ref:`(Brenner) <Brenner>`. Note that this is the so-called
2nd generation REBO from 2002, not the original REBO from 1990.
As discussed below, 2nd generation REBO is closely related to the
initial AIREBO; it is just a subset of the potential energy terms
with a few slightly different parameters
The AIREBO potential consists of three terms:
.. math::
E & = \frac{1}{2} \sum_i \sum_{j \neq i}
\left[ E^{\text{REBO}}_{ij} + E^{\text{LJ}}_{ij} +
\sum_{k \neq i,j} \sum_{l \neq i,j,k} E^{\text{TORSION}}_{kijl} \right] \\
By default, all three terms are included. For the *airebo* style, if
the first two optional flag arguments to the pair_style command are
included, the LJ and torsional terms can be turned off. Note that
both or neither of the flags must be included. If both of the LJ an
torsional terms are turned off, it becomes the 2nd-generation REBO
potential, with a small caveat on the spline fitting procedure
mentioned below. This can be specified directly as pair_style *rebo*
with no additional arguments.
The detailed formulas for this potential are given in
:ref:`(Stuart) <Stuart>`; here we provide only a brief description.
The :math:`E^{\text{REBO}}` term has the same functional form as the hydrocarbon REBO
potential developed in :ref:`(Brenner) <Brenner>`. The coefficients for
:math:`E^{\text{REBO}}` in AIREBO are essentially the same as Brenner's potential, but
a few fitted spline values are slightly different. For most cases the
:math:`E^{\text{REBO}}` term in AIREBO will produce the same energies, forces and
statistical averages as the original REBO potential from which it was
derived. The :math:`E^{\text{REBO}}` term in the AIREBO potential gives the model its
reactive capabilities and only describes short-ranged C-C, C-H and H-H
interactions (:math:`r < 2` Angstroms). These interactions have strong
coordination-dependence through a bond order parameter, which adjusts
the attraction between the I,J atoms based on the position of other
nearby atoms and thus has 3- and 4-body dependence.
The :math:`E^{\text{LJ}}` term adds longer-ranged interactions (:math:`2 < r < \text{cutoff}`) using a
form similar to the standard :doc:`Lennard Jones potential <pair_lj>`.
The :math:`E^{\text{LJ}}` term in AIREBO contains a series of switching functions so
that the short-ranged LJ repulsion (:math:`1/r^{12}`) does not interfere with
the energetics captured by the :math:`E^{\text{REBO}}` term. The extent of the :math:`E^{\text{LJ}}`
interactions is determined by the *cutoff* argument to the pair_style
command which is a scale factor. For each type pair (C-C, C-H, H-H)
the cutoff is obtained by multiplying the scale factor by the sigma
value defined in the potential file for that type pair. In the
standard AIREBO potential, :math:`\sigma_{CC} = 3.4` Angstroms, so with a scale
factor of 3.0 (the argument in pair_style), the resulting :math:`E^{\text{LJ}}` cutoff
would be 10.2 Angstroms.
By default, the longer-ranged interaction is smoothly switched off
between 2.16 and 3.0 :math:`\sigma`. By specifying *cutoff_min* in addition
to *cutoff*\ , the switching can be configured to take place between
*cutoff_min* and *cutoff*\ . *cutoff_min* can only be specified if all
optional arguments are given.
The :math:`E^{\text{TORSION}}` term is an explicit 4-body potential that describes
various dihedral angle preferences in hydrocarbon configurations.
----------
Only a single pair_coeff command is used with the *airebo*\ , *airebo*
or *rebo* style which specifies an AIREBO, REBO, or AIREBO-M potential
file with parameters for C and H. Note that as of LAMMPS version
15 May 2019 the *rebo* style in LAMMPS uses its own potential
file (CH.rebo). These are mapped to LAMMPS atom types by specifying
N additional arguments after the filename in the pair_coeff command,
where N is the number of LAMMPS atom types:
* filename
* :math:`N` element names = mapping of AIREBO elements to atom types
See the :doc:`pair_coeff <pair_coeff>` doc page for alternate ways
to specify the path for the potential file.
As an example, if your LAMMPS simulation has 4 atom types and you want
the 1st 3 to be C, and the 4th to be H, you would use the following
pair_coeff command:
.. code-block:: LAMMPS
pair_coeff * * CH.airebo C C C H
The 1st 2 arguments must be \* \* so as to span all LAMMPS atom types.
The first three C arguments map LAMMPS atom types 1,2,3 to the C
element in the AIREBO file. The final H argument maps LAMMPS atom
type 4 to the H element in the SW file. If a mapping value is
specified as NULL, the mapping is not performed. This can be used
when a *airebo* potential is used as part of the *hybrid* pair style.
The NULL values are placeholders for atom types that will be used with
other potentials.
The parameters/coefficients for the AIREBO potentials are listed in
the CH.airebo file to agree with the original :ref:`(Stuart) <Stuart>`
paper. Thus the parameters are specific to this potential and the way
it was fit, so modifying the file should be done cautiously.
Similarly the parameters/coefficients for the AIREBO-M potentials are
listed in the CH.airebo-m file to agree with the :ref:`(O'Connor) <OConnor>`
paper. Thus the parameters are specific to this potential and the way
it was fit, so modifying the file should be done cautiously. The
AIREBO-M Morse potentials were parameterized using a cutoff of
3.0 (:math:`\sigma`). Modifying this cutoff may impact simulation accuracy.
This pair style tallies a breakdown of the total AIREBO potential
energy into sub-categories, which can be accessed via the :doc:`compute pair <compute_pair>` command as a vector of values of length 3.
The 3 values correspond to the following sub-categories:
1. :math:`E_{\text{REBO}}` = REBO energy
2. :math:`E_{\text{LJ}}` = Lennard-Jones energy
3. :math:`E_{\text{TORSION}}` = Torsion energy
To print these quantities to the log file (with descriptive column
headings) the following commands could be included in an input script:
.. code-block:: LAMMPS
compute 0 all pair airebo
variable REBO equal c_0[1]
variable LJ equal c_0[2]
variable TORSION equal c_0[3]
thermo_style custom step temp epair v_REBO v_LJ v_TORSION
----------
Styles with a *gpu*\ , *intel*\ , *kk*\ , *omp*\ , or *opt* suffix are
functionally the same as the corresponding style without the suffix.
They have been optimized to run faster, depending on your available
hardware, as discussed on the :doc:`Speed packages <Speed_packages>` doc
page. The accelerated styles take the same arguments and should
produce the same results, except for round-off and precision issues.
These accelerated styles are part of the GPU, USER-INTEL, KOKKOS,
USER-OMP and OPT packages, respectively. They are only enabled if
LAMMPS was built with those packages. See the :doc:`Build package <Build_package>` doc page for more info.
You can specify the accelerated styles explicitly in your input script
by including their suffix, or you can use the :doc:`-suffix command-line switch <Run_options>` when you invoke LAMMPS, or you can use the
:doc:`suffix <suffix>` command in your input script.
See the :doc:`Speed packages <Speed_packages>` doc page for more
instructions on how to use the accelerated styles effectively.
----------
**Mixing, shift, table, tail correction, restart, rRESPA info**\ :
These pair styles do not support the :doc:`pair_modify <pair_modify>`
mix, shift, table, and tail options.
These pair styles do not write their information to :doc:`binary restart files <restart>`, since it is stored in potential files. Thus, you
need to re-specify the pair_style and pair_coeff commands in an input
script that reads a restart file.
These pair styles can only be used via the *pair* keyword of the
:doc:`run_style respa <run_style>` command. They do not support the
*inner* , *middle*, *outer* keywords.
Restrictions
""""""""""""
These pair styles are part of the MANYBODY package. They are only
enabled if LAMMPS was built with that package. See the :doc:`Build package <Build_package>` doc page for more info.
These pair potentials require the :doc:`newton <newton>` setting to be
"on" for pair interactions.
The CH.airebo and CH.airebo-m potential files provided with LAMMPS
(see the potentials directory) are parameterized for metal :doc:`units <units>`.
You can use the AIREBO, AIREBO-M or REBO potential with any LAMMPS units,
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.
Related commands
""""""""""""""""
:doc:`pair_coeff <pair_coeff>`
**Default:** none
----------
.. _Stuart:
**(Stuart)** Stuart, Tutein, Harrison, J Chem Phys, 112, 6472-6486
(2000).
.. _Brenner:
**(Brenner)** Brenner, Shenderova, Harrison, Stuart, Ni, Sinnott, J
Physics: Condensed Matter, 14, 783-802 (2002).
.. _OConnor:
**(O'Connor)** O'Connor et al., J. Chem. Phys. 142, 024903 (2015).

View File

@ -1,6 +1,6 @@
.. index:: pair\_style mesont/tpm
.. index:: pair_style mesont/tpm
pair\_style mesont/tpm command
pair_style mesont/tpm command
==============================
Syntax
@ -9,13 +9,14 @@ Syntax
.. parsed-literal::
pair_style mesont/tpm cut table\_path BendingMode TPMType
pair_style mesont/tpm cut table_path BendingMode TPMType
* cut = the cutoff distance
* table\_path = the path to the potential table, the default value is ./
* table_path = the path to the potential table, the default value is ./
* BendingMode = the parameter defining the type of the bending potential for nanotubes: 0 - harmonic bending :ref:`[1] <Srivastava>`, 1 - anharmonic potential of bending and bending-buckling :ref:`[2] <Zhigilei1>`
* TPMType = the parameter determining the type of the inter-tube interaction term: 0 - segment-segment approach, 1 - segment-chain approach :ref:`[3 <Zhigilei2>`, :ref:`4] <Zhigilei3>`
The segment-segment approach is approximetly 5 times slower than segment-chain approximation.
The parameter BendingMode also affects the calculation of the inter-tube interaction term when TPMType = 1. In this case, when BendingMode = 1, each continuous chain of segments is additionally replaced by a number of sub-chains divided by bending buckling kinks.
Examples
@ -160,77 +161,52 @@ Related commands
----------
.. _Srivastava:
**[1]** Zhigilei, Wei, Srivastava, Phys. Rev. B 71, 165417 (2005).
.. _Zhigilei1:
**[2]** Volkov and Zhigilei, ACS Nano 4, 6187 (2010).
.. _Zhigilei2:
**[3]** Volkov, Simov, Zhigilei, ASME paper IMECE2008, 68021 (2008).
.. _Zhigilei3:
**[4]** Volkov, Zhigilei, J. Phys. Chem. C 114, 5513 (2010).
.. _Zhigilei4:
**[5]** Wittmaack, Banna, Volkov, Zhigilei, Carbon 130, 69 (2018).
.. _Zhigilei5:
**[6]** Wittmaack, Volkov, Zhigilei, Compos. Sci. Technol. 166, 66 (2018).
.. _Zhigilei6:
**[7]** Wittmaack, Volkov, Zhigilei, Carbon 143, 587 (2019).
.. _Zhigilei7:
**[8]** Volkov, Zhigilei, Phys. Rev. Lett. 104, 215902 (2010).
.. _Zhigilei8:
**[9]** Volkov, Shiga, Nicholson, Shiomi, Zhigilei, J. Appl. Phys. 111, 053501 (2012).
.. _Zhigilei9:
**[10]** Volkov, Zhigilei, Appl. Phys. Lett. 101, 043113 (2012).
.. _Zhigilei10:
**[11]** Jacobs, Nicholson, Zemer, Volkov, Zhigilei, Phys. Rev. B 86, 165414 (2012).
.. _Banna:
**[12]** Volkov, Banna, Comp. Mater. Sci. 176, 109410 (2020).

View File

@ -1,7 +1,7 @@
.. index:: pair\_style
.. index:: pair_style
pair\_style command
===================
pair_style command
==================
Syntax
""""""
@ -127,7 +127,6 @@ accelerated styles exist.
* :doc:`buck/mdf <pair_mdf>` - Buckingham with a taper function
* :doc:`buck6d/coul/gauss/dsf <pair_buck6d_coul_gauss>` - dispersion-damped Buckingham with damped-shift-force model
* :doc:`buck6d/coul/gauss/long <pair_buck6d_coul_gauss>` - dispersion-damped Buckingham with long-range Coulombics
* :doc:`mesont/tpm <pair_mesont_tpm>` - nanotubes mesoscopic force field
* :doc:`colloid <pair_colloid>` - integrated colloidal potential
* :doc:`comb <pair_comb>` - charge-optimized many-body (COMB) potential
* :doc:`comb3 <pair_comb>` - charge-optimized many-body (COMB3) potential
@ -244,6 +243,7 @@ accelerated styles exist.
* :doc:`meam/spline <pair_meam_spline>` - splined version of MEAM
* :doc:`meam/sw/spline <pair_meam_sw_spline>` - splined version of MEAM with a Stillinger-Weber term
* :doc:`mesocnt <pair_mesocnt>` - mesoscale model for (carbon) nanotubes
* :doc:`mesont/tpm <pair_mesont_tpm>` - nanotubes mesoscopic force field
* :doc:`mgpt <pair_mgpt>` - simplified model generalized pseudopotential theory (MGPT) potential
* :doc:`mie/cut <pair_mie>` - Mie potential
* :doc:`mm3/switch3/coulgauss/long <pair_mm3_switch3_coulgauss_long>` - smoothed MM3 vdW potential with Gaussian electrostatics
@ -352,8 +352,3 @@ Default
.. code-block:: LAMMPS
pair_style none
.. _lws: http://lammps.sandia.gov
.. _ld: Manual.html
.. _lc: Commands_all.html

View File

@ -204,6 +204,7 @@ bcolor
bdiam
bdw
Beckman
behaviour
Belak
Bellott
benchmarking
@ -261,8 +262,6 @@ Bogaerts
Bogusz
Bohrs
Boltzman
BondAngle
BondBond
bondchk
bondmax
bondtype
@ -395,7 +394,6 @@ cmake
CMake
cmap
Cmax
cmd
cmdlist
Cmin
cmm
@ -491,7 +489,6 @@ cstring
cstyle
csvr
Ctypes
ctypes
cuda
Cuda
CUDA
@ -708,6 +705,7 @@ eatom
Eb
Eba
Ebeling
ebend
ebond
ebook
ebt
@ -752,8 +750,6 @@ electronegative
electronegativity
Eleftheriou
ElementN
elementset
elementsets
elif
Elj
Ellad
@ -779,7 +775,6 @@ engrot
engtrans
engvib
enobonds
EnSight
enthalpy
enums
envoke
@ -822,9 +817,8 @@ erotate
Ertas
ervel
Espanol
Eshelby
eshelby
eskm
estretch
esu
esub
esw
@ -836,8 +830,7 @@ ethernet
etol
etot
etotal
Eulerian
eulerian
etube
eulerimplicit
Europhys
ev
@ -858,8 +851,6 @@ extrema
exy
ey
ez
faceset
facesets
factorizable
factorizations
Fahrenberger
@ -877,7 +868,6 @@ fdotr
fdt
Fehlberg
Fellinger
fe
femtosecond
femtoseconds
fene
@ -901,7 +891,6 @@ fhg
Fi
Fichthorn
Fickian
fieldname
figshare
Fij
filelink
@ -1044,7 +1033,6 @@ Gmask
gneb
GNEB
Goldfarb
Gonzalez-Melchor
googlemail
Gordan
GPa
@ -1172,8 +1160,6 @@ Hugoniot
Hura
hux
hwloc
hx
hy
hydrophobicity
hydrostatic
hydrostatically
@ -1183,7 +1169,6 @@ hyperdynamics
hyperradius
hyperspherical
hysteretic
hz
Ibanez
ibar
ibm
@ -1312,7 +1297,6 @@ Izvekov
izz
Izz
Jacobsen
Jadhav
jagreat
Jalalvand
james
@ -1403,7 +1387,6 @@ Khvostov
Ki
Kikugawa
kim
kinetostats
kJ
kk
Klahn
@ -1607,7 +1590,6 @@ lucy
Luding
Lussetti
Lustig
lval
lwsock
lx
ly
@ -1619,7 +1601,7 @@ Mackay
Mackrodt
Macromolecules
macroparticle
MacOS
macOS
Madura
Magda
Magdeburg
@ -1688,7 +1670,6 @@ maxwell
Maxwellian
maxX
Mayergoyz
Mayoral
mbt
Mbytes
MBytes
@ -1717,7 +1698,6 @@ mediumvioletred
Mees
Mehl
Mei
Melchor
Meloni
Melrose
Mem
@ -1732,8 +1712,6 @@ Merz
meshless
meso
mesocnt
MESODPD
mesodpd
MESONT
mesont
mesoparticle
@ -1961,7 +1939,6 @@ Nelement
Nelements
nemd
netcdf
netstat
Nettleton
Neumann
Nevent
@ -2012,8 +1989,6 @@ Nocedal
nocite
nocoeff
nodeless
nodeset
nodesets
Noehring
noforce
Noid
@ -2083,7 +2058,6 @@ nucleotides
num
numa
numactl
numdiff
numericalfreedom
numerics
numpy
@ -2192,7 +2166,6 @@ parameterizations
parameterize
parameterized
params
ParaView
parmin
Parrinello
Partay
@ -2284,7 +2257,6 @@ pN
png
Podhorszki
Poiseuille
poisson
Polak
polarizabilities
polarizability
@ -2297,7 +2269,6 @@ polyA
polybond
polydisperse
polydispersity
polyelectrolyte
polyhedra
popen
Popov
@ -2318,6 +2289,8 @@ Prakash
pre
Pre
prec
preceed
preceeded
precession
prefactor
prefactors
@ -2369,7 +2342,6 @@ pymbar
pymodule
pymol
pypar
pythonic
Pyy
pz
Pz
@ -2592,7 +2564,8 @@ Salles
sandia
Sandia
sandybrown
sanitizer
Sanitizer
sanitizers
Sanyal
sc
scafacos
@ -2712,6 +2685,7 @@ smtbq
sna
snad
snapcoeff
snaphots
snapparam
snav
Snodin
@ -2796,8 +2770,6 @@ Stukowski
Su
subbox
subcutoff
subcycle
subcycling
Subramaniyan
subscripted
subscripting
@ -2812,7 +2784,6 @@ superset
supersphere
Supinski
Surblys
surfactant
surfactants
Suter
Sutmann
@ -2876,7 +2847,6 @@ tfmc
tfMC
th
Thakkar
Thaokar
thb
thei
Theodorou
@ -3067,13 +3037,11 @@ util
utils
utsa
Uttormark
uval
uvm
uwo
Uzdin
vacf
Vaid
Vaiwala
valent
Valeriu
valgrind
@ -3102,7 +3070,6 @@ Vectorization
vectorized
Vegt
vel
Velázquez
Verlag
verlet
Verlet
@ -3187,6 +3154,7 @@ Whelan
whitesmoke
Wi
Wicaksono
wih
Wijk
Wikipedia
wildcard
@ -3231,7 +3199,6 @@ xmax
Xmax
xmgrace
xMIC
xmin
xmovie
Xmovie
xmu
@ -3265,8 +3232,6 @@ yhi
yi
ylat
ylo
ymax
ymin
Yoshida
ys
ysu
@ -3301,8 +3266,6 @@ Ziegenhain
Zj
zlim
zlo
zmax
zmin
zmq
zN
zs

View File

@ -9,7 +9,6 @@ Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
"bundle" is an example with a single bundle composed of 7 nanotubes.
"system" is an example with a film composed of 396 200-nm-long
"film" is an example with a film composed of 396 200-nm-long
nanotubes (79596 nodes).

View File

@ -1,45 +0,0 @@
newton on
log cnt.log
echo both
units metal
lattice sc 1.0
boundary fs fs p
neighbor 1.0 bin
neigh_modify every 5 delay 0 check yes
atom_style mesont
# cut, path, BendingMode, TPMType
pair_style mesont/tpm 45.0 ../../../potentials/CNT_10_10 0 0
read_data bundle.init
pair_coeff * *
velocity all create 6000.0 2019
timestep 0.005
fix 1 all nve
#fix 1 all nvt temp 3000.0 3000.0 1.0
thermo_modify flush yes
thermo 10
reset_timestep 0
compute Es all mesont/Es
compute Eb all mesont/Eb
compute Et all mesont/Et
compute Ek all ke/atom
compute Es_tot all mesont/Es_tot
compute Eb_tot all mesont/Eb_tot
compute Et_tot all mesont/Et_tot
compute Ep_tot all pe
compute Ek_tot all ke
variable time_ equal time
variable Ep_ equal c_Ep_tot
variable Ek_ equal c_Ek_tot
variable Etot_ equal v_Ek_+v_Ep_
variable Es_ equal c_Es_tot
variable Eb_ equal c_Eb_tot
variable Et_ equal c_Et_tot
dump out_dump all custom 50 config.dump id type x y z c_Es c_Eb c_Et c_Ek ix iy iz
fix out_info all print 10 "${time_} ${Etot_} ${Ek_} ${Ep_} ${Es_} ${Eb_} ${Et_}" file "E.txt" screen no
run 10000
write_data system.data

View File

@ -1,46 +0,0 @@
newton on
log cnt.log
echo both
units metal
lattice sc 1.0
boundary p p p
neighbor 1.0 bin
neigh_modify every 5 delay 0 check yes
atom_style mesont
# cut, path, BendingMode, TPMType
pair_style hybrid mesont/tpm 45.0 ../../../potentials/CNT_10_10 0 0 lj/cut 7.5
read_data bundle_h.init
pair_coeff 1*2 2 lj/cut 0.1 3.0
pair_coeff 1 1 mesont/tpm
#velocity all create 6000.0 2019
timestep 0.005
fix 1 all nve
#fix 1 all nvt temp 3000.0 3000.0 1.0
thermo_modify flush yes
thermo 10
reset_timestep 0
compute Es all mesont/Es
compute Eb all mesont/Eb
compute Et all mesont/Et
compute Ek all ke/atom
compute Es_tot all mesont/Es_tot
compute Eb_tot all mesont/Eb_tot
compute Et_tot all mesont/Et_tot
compute Ep_tot all pe
compute Ek_tot all ke
variable time_ equal time
variable Ep_ equal c_Ep_tot
variable Ek_ equal c_Ek_tot
variable Etot_ equal v_Ek_+v_Ep_
variable Es_ equal c_Es_tot
variable Eb_ equal c_Eb_tot
variable Et_ equal c_Et_tot
dump out_dump all custom 50 config.dump id type x y z c_Es c_Eb c_Et c_Ek ix iy iz
fix out_info all print 10 "${time_} ${Etot_} ${Ek_} ${Ep_} ${Es_} ${Eb_} ${Et_}" file "E.txt" screen no
run 10000
write_data system.data

View File

@ -1,96 +0,0 @@
79 atoms
2 atom types
-143.89 143.89 xlo xhi
-143.89 143.89 ylo yhi
0 220 zlo zhi
Masses
1 1.0
2 1.0
Atoms
1 1 1 11 2 5860.43 6.785 20 0 0 0 0 0 0 0
2 1 1 1 3 5860.43 6.785 20 0 0 0 20 0 0 0
3 1 1 2 4 5860.43 6.785 20 0 0 0 40 0 0 0
4 1 1 3 5 5860.43 6.785 20 0 0 0 60 0 0 0
5 1 1 4 6 5860.43 6.785 20 0 0 0 80 0 0 0
6 1 1 5 7 5860.43 6.785 20 0 0 0 100 0 0 0
7 1 1 6 8 5860.43 6.785 20 0 0 0 120 0 0 0
8 1 1 7 9 5860.43 6.785 20 0 0 0 140 0 0 0
9 1 1 8 10 5860.43 6.785 20 0 0 0 160 0 0 0
10 1 1 9 11 5860.43 6.785 20 0 0 0 180 0 0 0
11 1 1 10 1 5860.43 6.785 20 0 0 0 200 0 0 0
12 2 1 22 13 5860.43 6.785 20 0 16.6992 0 0 0 0 0
13 2 1 12 14 5860.43 6.785 20 0 16.6992 0 20 0 0 0
14 2 1 13 15 5860.43 6.785 20 0 16.6992 0 40 0 0 0
15 2 1 14 16 5860.43 6.785 20 0 16.6992 0 60 0 0 0
16 2 1 15 17 5860.43 6.785 20 0 16.6992 0 80 0 0 0
17 2 1 16 18 5860.43 6.785 20 0 16.6992 0 100 0 0 0
18 2 1 17 19 5860.43 6.785 20 0 16.6992 0 120 0 0 0
19 2 1 18 20 5860.43 6.785 20 0 16.6992 0 140 0 0 0
20 2 1 19 21 5860.43 6.785 20 0 16.6992 0 160 0 0 0
21 2 1 20 22 5860.43 6.785 20 0 16.6992 0 180 0 0 0
22 2 1 21 12 5860.43 6.785 20 0 16.6992 0 200 0 0 0
23 3 1 33 24 5860.43 6.785 20 0 8.3496 14.4619 0 0 0 0
24 3 1 23 25 5860.43 6.785 20 0 8.3496 14.4619 20 0 0 0
25 3 1 24 26 5860.43 6.785 20 0 8.3496 14.4619 40 0 0 0
26 3 1 25 27 5860.43 6.785 20 0 8.3496 14.4619 60 0 0 0
27 3 1 26 28 5860.43 6.785 20 0 8.3496 14.4619 80 0 0 0
28 3 1 27 29 5860.43 6.785 20 0 8.3496 14.4619 100 0 0 0
29 3 1 28 30 5860.43 6.785 20 0 8.3496 14.4619 120 0 0 0
30 3 1 29 31 5860.43 6.785 20 0 8.3496 14.4619 140 0 0 0
31 3 1 30 32 5860.43 6.785 20 0 8.3496 14.4619 160 0 0 0
32 3 1 31 33 5860.43 6.785 20 0 8.3496 14.4619 180 0 0 0
33 3 1 32 23 5860.43 6.785 20 0 8.3496 14.4619 200 0 0 0
34 4 1 44 35 5860.43 6.785 20 0 -8.3496 14.4619 0 0 0 0
35 4 1 34 36 5860.43 6.785 20 0 -8.3496 14.4619 20 0 0 0
36 4 1 35 37 5860.43 6.785 20 0 -8.3496 14.4619 40 0 0 0
37 4 1 36 38 5860.43 6.785 20 0 -8.3496 14.4619 60 0 0 0
38 4 1 37 39 5860.43 6.785 20 0 -8.3496 14.4619 80 0 0 0
39 4 1 38 40 5860.43 6.785 20 0 -8.3496 14.4619 100 0 0 0
40 4 1 39 41 5860.43 6.785 20 0 -8.3496 14.4619 120 0 0 0
41 4 1 40 42 5860.43 6.785 20 0 -8.3496 14.4619 140 0 0 0
42 4 1 41 43 5860.43 6.785 20 0 -8.3496 14.4619 160 0 0 0
43 4 1 42 44 5860.43 6.785 20 0 -8.3496 14.4619 180 0 0 0
44 4 1 43 34 5860.43 6.785 20 0 -8.3496 14.4619 200 0 0 0
45 5 1 55 46 5860.43 6.785 20 0 -16.6992 0 0 0 0 0
46 5 1 45 47 5860.43 6.785 20 0 -16.6992 0 20 0 0 0
47 5 1 46 48 5860.43 6.785 20 0 -16.6992 0 40 0 0 0
48 5 1 47 49 5860.43 6.785 20 0 -16.6992 0 60 0 0 0
49 5 1 48 50 5860.43 6.785 20 0 -16.6992 0 80 0 0 0
50 5 1 49 51 5860.43 6.785 20 0 -16.6992 0 100 0 0 0
51 5 1 50 52 5860.43 6.785 20 0 -16.6992 0 120 0 0 0
52 5 1 51 53 5860.43 6.785 20 0 -16.6992 0 140 0 0 0
53 5 1 52 54 5860.43 6.785 20 0 -16.6992 0 160 0 0 0
54 5 1 53 55 5860.43 6.785 20 0 -16.6992 0 180 0 0 0
55 5 1 54 45 5860.43 6.785 20 0 -16.6992 0 200 0 0 0
56 6 1 66 57 5860.43 6.785 20 0 -8.3496 -14.4619 0 0 0 0
57 6 1 56 58 5860.43 6.785 20 0 -8.3496 -14.4619 20 0 0 0
58 6 1 57 59 5860.43 6.785 20 0 -8.3496 -14.4619 40 0 0 0
59 6 1 58 60 5860.43 6.785 20 0 -8.3496 -14.4619 60 0 0 0
60 6 1 59 61 5860.43 6.785 20 0 -8.3496 -14.4619 80 0 0 0
61 6 1 60 62 5860.43 6.785 20 0 -8.3496 -14.4619 100 0 0 0
62 6 1 61 63 5860.43 6.785 20 0 -8.3496 -14.4619 120 0 0 0
63 6 1 62 64 5860.43 6.785 20 0 -8.3496 -14.4619 140 0 0 0
64 6 1 63 65 5860.43 6.785 20 0 -8.3496 -14.4619 160 0 0 0
65 6 1 64 66 5860.43 6.785 20 0 -8.3496 -14.4619 180 0 0 0
66 6 1 65 56 5860.43 6.785 20 0 -8.3496 -14.4619 200 0 0 0
67 7 1 77 68 5860.43 6.785 20 0 8.3496 -14.4619 0 0 0 0
68 7 1 67 69 5860.43 6.785 20 0 8.3496 -14.4619 20 0 0 0
69 7 1 68 70 5860.43 6.785 20 0 8.3496 -14.4619 40 0 0 0
70 7 1 69 71 5860.43 6.785 20 0 8.3496 -14.4619 60 0 0 0
71 7 1 70 72 5860.43 6.785 20 0 8.3496 -14.4619 80 0 0 0
72 7 1 71 73 5860.43 6.785 20 0 8.3496 -14.4619 100 0 0 0
73 7 1 72 74 5860.43 6.785 20 0 8.3496 -14.4619 120 0 0 0
74 7 1 73 75 5860.43 6.785 20 0 8.3496 -14.4619 140 0 0 0
75 7 1 74 76 5860.43 6.785 20 0 8.3496 -14.4619 160 0 0 0
76 7 1 75 77 5860.43 6.785 20 0 8.3496 -14.4619 180 0 0 0
77 7 1 76 67 5860.43 6.785 20 0 8.3496 -14.4619 200 0 0 0
78 8 2 -1 -1 100.0 0.0 0 0 20.0 20.0 100.0 0 0 0
79 9 2 -1 -1 100.0 0.0 0 0 20.0 20.0 103.8 0 0 0

View File

@ -0,0 +1,32 @@
newton on
units metal
lattice sc 1.0
boundary fs fs p
neighbor 1.0 bin
neigh_modify every 5 delay 0 check yes
atom_style mesont
# cut, path, BendingMode, TPMType
pair_style mesont/tpm 45.0 ../../../potentials/CNT_10_10 0 0
read_data data.bundle
pair_coeff * *
velocity all create 6000.0 2019
timestep 0.005
fix 1 all nve
thermo_modify flush yes
thermo 10
reset_timestep 0
compute Es all mesont estretch
compute Eb all mesont ebend
compute Et all mesont etube
compute B all property/atom buckling
compute Es_tot all mesont estretch_tot
compute Eb_tot all mesont ebend_tot
compute Et_tot all mesont etube_tot
thermo_style custom step time temp etotal ke pe c_Es_tot c_Eb_tot c_Et_tot
#dump out_dump all custom 50 dump.bundle id type x y z c_Es c_Eb c_Et c_B ix iy iz
run 100

View File

@ -0,0 +1,32 @@
newton on
units metal
lattice sc 1.0
boundary p p fs
neighbor 1.0 bin
neigh_modify every 5 delay 0 check yes
atom_style mesont
# cut, path, BendingMode, TPMType
pair_style mesont/tpm 25.0 ../../../potentials/CNT_10_10 1 0
read_data data.film
pair_coeff * *
velocity all create 600.0 2019
timestep 0.01
fix 1 all nve
thermo_modify flush yes
thermo 10
reset_timestep 0
compute Es all mesont estretch
compute Eb all mesont ebend
compute Et all mesont etube
compute B all property/atom buckling
compute Es_tot all mesont estretch_tot
compute Eb_tot all mesont ebend_tot
compute Et_tot all mesont etube_tot
thermo_style custom step time temp etotal ke pe c_Es_tot c_Eb_tot c_Et_tot
#dump out_dump all custom 10 dump.film id type x y z c_Es c_Eb c_Et c_B ix iy iz
run 10

View File

@ -0,0 +1,94 @@
LAMMPS (3 Mar 2020)
newton on
units metal
lattice sc 1.0
Lattice spacing in x,y,z = 1 1 1
boundary fs fs p
neighbor 1.0 bin
neigh_modify every 5 delay 0 check yes
atom_style mesont
# cut, path, BendingMode, TPMType
pair_style mesont/tpm 45.0 ../../../potentials/CNT_10_10 0 0
read_data data.bundle
orthogonal box = (-143.89 -143.89 0) to (143.89 143.89 220)
1 by 1 by 1 MPI processor grid
reading atoms ...
77 atoms
read_data CPU = 0.442627 secs
pair_coeff * *
velocity all create 6000.0 2019
timestep 0.005
fix 1 all nve
thermo_modify flush yes
thermo 10
reset_timestep 0
compute Es all mesont estretch
compute Eb all mesont ebend
compute Et all mesont etube
compute B all property/atom buckling
compute Es_tot all mesont estretch_tot
compute Eb_tot all mesont ebend_tot
compute Et_tot all mesont etube_tot
thermo_style custom step time temp etotal ke pe c_Es_tot c_Eb_tot c_Et_tot
WARNING: New thermo_style command, previous thermo_modify settings will be lost (../output.cpp:708)
#dump out_dump all custom 50 dump.bundle id type x y z c_Es c_Eb c_Et c_B ix iy iz
run 100
Neighbor list info ...
update every 5 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 46
ghost atom cutoff = 46
binsize = 23, bins = 7 7 10
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair mesont/tpm, perpetual
attributes: full, newton on, ghost
pair build: full/bin/ghost
stencil: full/ghost/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 4.675 | 4.675 | 4.675 Mbytes
Step Time Temp TotEng KinEng PotEng c_Es_tot c_Eb_tot c_Et_tot
0 0 6000 -201.86935 58.942626 -260.81198 0 0 -260.81198
10 0.05 5114.1875 -201.86234 50.240607 -252.10295 4.8334861 2.3998206 -259.33626
20 0.1 3437.2958 -201.8522 33.767207 -235.61941 11.42384 8.3426957 -255.38594
30 0.15 2430.6571 -201.85242 23.878219 -225.73064 10.346152 14.72688 -250.80367
40 0.2 2154.4755 -201.85683 21.165074 -223.0219 6.8146112 18.325709 -248.16222
50 0.25 2021.7899 -201.85503 19.861601 -221.71663 9.2972022 17.644143 -248.65798
60 0.3 2234.553 -201.85193 21.951737 -223.80367 13.541921 13.673721 -251.01931
70 0.35 3099.6503 -201.85721 30.450255 -232.30747 11.833679 9.0583807 -253.19953
80 0.4 3849.9855 -201.8635 37.821376 -239.68487 7.9899173 6.4332848 -254.10807
90 0.45 3618.1311 -201.85967 35.543692 -237.40336 9.2616931 7.0452637 -253.71032
100 0.5 2866.2722 -201.85273 28.157602 -230.01033 12.204916 10.284525 -252.49977
Loop time of 0.455531 on 1 procs for 100 steps with 77 atoms
Performance: 94.834 ns/day, 0.253 hours/ns, 219.524 timesteps/s
99.7% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 0.4551 | 0.4551 | 0.4551 | 0.0 | 99.91
Neigh | 6.485e-05 | 6.485e-05 | 6.485e-05 | 0.0 | 0.01
Comm | 3.0994e-05 | 3.0994e-05 | 3.0994e-05 | 0.0 | 0.01
Output | 0.00020385 | 0.00020385 | 0.00020385 | 0.0 | 0.04
Modify | 8.6069e-05 | 8.6069e-05 | 8.6069e-05 | 0.0 | 0.02
Other | | 4.697e-05 | | | 0.01
Nlocal: 77 ave 77 max 77 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 35 ave 35 max 35 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 2222 ave 2222 max 2222 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 2222
Ave neighs/atom = 28.8571
Neighbor list builds = 1
Dangerous builds = 0
Total wall time: 0:00:01

View File

@ -0,0 +1,85 @@
LAMMPS (3 Mar 2020)
newton on
units metal
lattice sc 1.0
Lattice spacing in x,y,z = 1 1 1
boundary p p fs
neighbor 1.0 bin
neigh_modify every 5 delay 0 check yes
atom_style mesont
# cut, path, BendingMode, TPMType
pair_style mesont/tpm 25.0 ../../../potentials/CNT_10_10 1 0
read_data data.film
orthogonal box = (-2500 -2500 -300) to (2500 2500 402.42)
1 by 1 by 1 MPI processor grid
reading atoms ...
79596 atoms
read_data CPU = 0.0903821 secs
pair_coeff * *
velocity all create 600.0 2019
timestep 0.01
fix 1 all nve
thermo_modify flush yes
thermo 10
reset_timestep 0
compute Es all mesont estretch
compute Eb all mesont ebend
compute Et all mesont etube
compute B all property/atom buckling
compute Es_tot all mesont estretch_tot
compute Eb_tot all mesont ebend_tot
compute Et_tot all mesont etube_tot
thermo_style custom step time temp etotal ke pe c_Es_tot c_Eb_tot c_Et_tot
WARNING: New thermo_style command, previous thermo_modify settings will be lost (../output.cpp:708)
#dump out_dump all custom 10 dump.film id type x y z c_Es c_Eb c_Et c_B ix iy iz
run 10
Neighbor list info ...
update every 5 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 26
ghost atom cutoff = 26
binsize = 13, bins = 385 385 31
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair mesont/tpm, perpetual
attributes: full, newton on, ghost
pair build: full/bin/ghost
stencil: full/ghost/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 44.83 | 44.83 | 44.83 Mbytes
Step Time Temp TotEng KinEng PotEng c_Es_tot c_Eb_tot c_Et_tot
0 0 600 1347.2177 6173.0767 -4825.859 28.669574 21.29406 -4875.8226
10 0.1 389.40755 1373.7883 4006.4045 -2632.6161 848.00269 1404.4323 -4885.0511
Loop time of 4.21003 on 1 procs for 10 steps with 79596 atoms
Performance: 2.052 ns/day, 11.695 hours/ns, 2.375 timesteps/s
97.8% CPU use with 1 MPI tasks x no OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 4.1942 | 4.1942 | 4.1942 | 0.0 | 99.62
Neigh | 0 | 0 | 0 | 0.0 | 0.00
Comm | 0.00046039 | 0.00046039 | 0.00046039 | 0.0 | 0.01
Output | 0.00029182 | 0.00029182 | 0.00029182 | 0.0 | 0.01
Modify | 0.012385 | 0.012385 | 0.012385 | 0.0 | 0.29
Other | | 0.002726 | | | 0.06
Nlocal: 79596 ave 79596 max 79596 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost: 1567 ave 1567 max 1567 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs: 0 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs: 412798 ave 412798 max 412798 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Total # of neighbors = 412798
Ave neighs/atom = 5.18617
Neighbor list builds = 0
Dangerous builds = 0
Total wall time: 0:00:05

View File

@ -1,45 +0,0 @@
newton on
log cnt.log
echo both
units metal
lattice sc 1.0
boundary p p fs
neighbor 1.0 bin
neigh_modify every 5 delay 0 check yes
atom_style mesont
# cut, path, BendingMode, TPMType
pair_style mesont/tpm 25.0 ../../../potentials/CNT_10_10 0 0
read_data system.init
pair_coeff * *
velocity all create 600.0 2019
timestep 0.010
fix 1 all nve
#fix 1 all nvt temp 300.0 300.0 1.0
thermo_modify flush yes
thermo 10
reset_timestep 0
compute Es all mesont/Es
compute Eb all mesont/Eb
compute Et all mesont/Et
compute Ek all ke/atom
compute Es_tot all mesont/Es_tot
compute Eb_tot all mesont/Eb_tot
compute Et_tot all mesont/Et_tot
compute Ep_tot all pe
compute Ek_tot all ke
variable time_ equal time
variable Ep_ equal c_Ep_tot
variable Ek_ equal c_Ek_tot
variable Etot_ equal v_Ek_+v_Ep_
variable Es_ equal c_Es_tot
variable Eb_ equal c_Eb_tot
variable Et_ equal c_Et_tot
dump out_dump all custom 50 config_E.dump id type x y z c_Es c_Eb c_Et c_Ek ix iy iz
fix out_info all print 10 "${time_} ${Etot_} ${Ek_} ${Ep_} ${Es_} ${Eb_} ${Et_}" file "E.txt" screen no
run 50
write_data system_E.data

View File

@ -79,9 +79,9 @@ contains
real(c_double), intent(inout) :: U1, U2 ! Interaction energies associated with nodes X1 and X2
real(c_double), intent(inout), dimension(0:2) :: F1, F2 ! Forces exerted on nodes X1 and X2
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2 ! Contributions of nodes X1 and X2 to the virial stress tensor
real(c_double), intent(in), dimension(0:2) :: X1, X2 ! Coordinates of the segmnet nodes
real(c_double), intent(in), dimension(0:2) :: X1, X2 ! Coordinates of the segment nodes
real(c_double), intent(in) :: R12 ! Radius of nanotube the segment (X1,X2) belongs to
real(c_double), intent(in) :: L12 ! Equilubrium length of segment (X1,X2)
real(c_double), intent(in) :: L12 ! Equilibrium length of segment (X1,X2)
call TubeStretchingForceField(U1, U2, F1, F2, S1, S2, X1, X2, R12, L12)
endsubroutine
@ -93,7 +93,7 @@ contains
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2, S3 ! Contributions of nodes X1, X2, and X3 to the virial stress tensor
real(c_double), intent(in), dimension(0:2) :: X1, X2, X3 ! Coordinates of nodes
real(c_double), intent(in) :: R123 ! Radius of nanotube the segment (X1,X2) belongs to
real(c_double), intent(in) :: L123 ! Equilubrium length of segment (X1,X2) and (X2,X3) (It is assumed to be the same for both segments)
real(c_double), intent(in) :: L123 ! Equilibrium length of segment (X1,X2) and (X2,X3) (It is assumed to be the same for both segments)
integer(c_int), intent(inout) :: BBF2
call TubeBendingForceField(U1, U2, U3, F1, F2, F3, S1, S2, S3, X1, X2, X3, R123, L123, BBF2 )
@ -110,13 +110,13 @@ contains
real(c_double), intent(inout), dimension(0:2,0:2) :: S1, S2 ! Contributions of nodes X1 and X2 to the virial stress tensor
real(c_double), intent(inout), dimension(0:2,0:2,0:N-1) :: S ! Contributions of nodes X to the virial stress tensor
real(c_double), intent(inout), dimension(0:2,0:2) :: Se ! Contributions of node Xe to the virial stress tensor (can be updated only if Ee > 0)
real(c_double), intent(in), dimension(0:2) :: X1, X2 ! Coordinates of the segmnet nodes
real(c_double), intent(in), dimension(0:2) :: X1, X2 ! Coordinates of the segment nodes
real(c_double), intent(in) :: R12 ! Radius of nanotube the segment (X1,X2) belongs to
real(c_double), intent(in), dimension(0:2,0:N-1) :: X ! Coordinates of the nanotube nodes
real(c_double), intent(in), dimension(0:2) :: Xe ! Additional node of the extended chain if Ee > 0
integer(c_int), intent(in), dimension(0:N-1) :: BBF ! Bending buckling flags (BBF(i) = 1 in a case of buckling in node i)
real(c_double), intent(in) :: R ! Radius of nanotube X
integer(c_int), intent(in) :: E1, E2 ! E1 = 1 if the chnane node 0 is a CNT end; E2 = 1 if the chnane node N-1 is a CNT end;
integer(c_int), intent(in) :: E1, E2 ! 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) :: Ee ! Parameter defining the type of the extended chain (0,1,2)
integer(c_int), intent(in) :: TPMType ! Type of the tubular potential (0 or 1)

1
lib/mesont/Install.py Normal file
View File

@ -0,0 +1 @@
../Install.py

View File

@ -20,7 +20,7 @@ OBJ = $(SRC:.f90=.o)
F90 = gfortran
CC = gcc
F90FLAGS = -O3 -fPIC -ffast-math -ftree-vectorize -fexpensive-optimizations -fno-second-underscore -g -ffree-line-length-none -cpp
F90FLAGS = -O3 -fPIC -ffast-math -ftree-vectorize -fexpensive-optimizations -fno-second-underscore -g -ffree-line-length-none
#F90FLAGS = -O
ARCHIVE = ar
ARCHFLAG = -rc

View File

@ -19,7 +19,7 @@ OBJ = $(SRC:.f90=.o)
# ------ SETTINGS ------
F90 = ifort
F90FLAGS = -Ofast -fPIC -ipo -fpp
F90FLAGS = -Ofast -fPIC -ipo
ARCHIVE = ar
ARCHFLAG = -rc
USRLIB =

View File

@ -1,5 +1,5 @@
# Settings that the LAMMPS build will import when this package library is used
mesont_SYSINC =
mesont_SYSLIB = -lifcore -lsvml -limf -ldl -lstdc++ -lgfortran
mesont_SYSPATH = -L/opt/intel/fce/10.0.023/lib
mesont_SYSLIB = -lifcore -lsvml -limf -ldl -lstdc++
mesont_SYSPATH =

View File

@ -60,7 +60,7 @@ PACKAGE = asphere body class2 colloid compress coreshell dipole gpu \
PACKUSER = user-adios user-atc user-awpmd user-bocs user-cgdna user-cgsdk user-colvars \
user-diffraction user-dpd user-drude user-eff user-fep user-h5md \
user-intel user-lb user-manifold user-meamc user-mesodpd \
user-intel user-lb user-manifold user-meamc user-meso \
user-mgpt user-misc user-mofff user-molfile \
user-netcdf user-omp user-phonon user-plumed user-ptm user-qmmm \
user-qtb user-quip user-reaction user-reaxc user-scafacos user-smd user-smtbq \
@ -70,11 +70,11 @@ PACKLIB = compress gpu kim kokkos latte message mpiio mscg poems \
python voronoi \
user-adios user-atc user-awpmd user-colvars user-h5md user-lb user-molfile \
user-netcdf user-plumed user-qmmm user-quip user-scafacos \
user-smd user-vtk
user-smd user-vtk user-mesont
PACKSYS = compress mpiio python user-lb
PACKINT = gpu kokkos message poems user-atc user-awpmd user-colvars
PACKINT = gpu kokkos message poems user-atc user-awpmd user-colvars user-mesont
PACKEXT = kim latte mscg voronoi \
user-adios user-h5md user-molfile user-netcdf user-plumed user-qmmm user-quip \

View File

@ -32,14 +32,12 @@ pair_style mesont/tpm cut table_path BendingMode TPMType
and Tcut = 10.2 A is the maximum distance between surfaces of interacting
segments.
compute mesont/Es, mesont/Eb, mesont/Et, mesont/B
These commands allow for the evaluation of per atom values of stretching,
bending, and intertube interaction components of energies, and buckling
flags.
compute mesont/Es_tot, mesont/Eb_tot, mesont/Et_tot
These commands allow for the evaluation of total values of stretching,
bending, and intertube interaction energies.
compute mesont
This command allows evaluation of per atom and total values of stretching,
bending, and intertube interaction components of energies. Use the following
flags to obtain specific values: 'estretch' and 'estretch_tot' are per atom (node)
and total stretching energies, 'ebend' and 'ebend_tot' are per atom and total
bending energy, 'etube' and 'etube_tot' are per atom and total intertube energies
--

View File

@ -27,10 +27,12 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
AtomVecMESONT::AtomVecMESONT(LAMMPS *lmp) : AtomVec(lmp)
AtomVecMesoNT::AtomVecMesoNT(LAMMPS *lmp) : AtomVec(lmp)
{
mass_type = 1;
atom->mesont_flag = 1;
molecular = 0;
comm_x_only = comm_f_only = 1;
size_forward = 3;
size_reverse = 3;
@ -47,7 +49,7 @@ AtomVecMESONT::AtomVecMESONT(LAMMPS *lmp) : AtomVec(lmp)
n > 0 allocates arrays to size n
------------------------------------------------------------------------- */
void AtomVecMESONT::grow(int n)
void AtomVecMesoNT::grow(int n)
{
if (n == 0) grow_nmax();
else nmax = n;
@ -68,7 +70,7 @@ void AtomVecMESONT::grow(int n)
length = memory->grow(atom->length,nmax,"atom:length");
buckling = memory->grow(atom->buckling,nmax,"atom:buckling");
molecule = memory->grow(atom->molecule,nmax,"atom:molecule");
bond_cnt = memory->grow(atom->bond_cnt,nmax,2,"atom:bond_cnt");
bond_nt = memory->grow(atom->bond_nt,nmax,2,"atom:bond_nt");
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
@ -79,7 +81,7 @@ void AtomVecMESONT::grow(int n)
reset local array ptrs
------------------------------------------------------------------------- */
void AtomVecMESONT::grow_reset()
void AtomVecMesoNT::grow_reset()
{
tag = atom->tag; type = atom->type;
mask = atom->mask; image = atom->image;
@ -90,14 +92,14 @@ void AtomVecMESONT::grow_reset()
length = atom->length;
buckling = atom->buckling;
molecule = atom->molecule;
bond_cnt = atom->bond_cnt;
bond_nt = atom->bond_nt;
}
/* ----------------------------------------------------------------------
copy atom I info to atom J
------------------------------------------------------------------------- */
void AtomVecMESONT::copy(int i, int j, int delflag)
void AtomVecMesoNT::copy(int i, int j, int delflag)
{
tag[j] = tag[i];
type[j] = type[i];
@ -115,8 +117,8 @@ void AtomVecMESONT::copy(int i, int j, int delflag)
length[j] = length[i];
buckling[j] = buckling[i];
molecule[j] = molecule[i];
bond_cnt[j][0] = bond_cnt[i][0];
bond_cnt[j][1] = bond_cnt[i][1];
bond_nt[j][0] = bond_nt[i][0];
bond_nt[j][1] = bond_nt[i][1];
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
@ -125,7 +127,7 @@ void AtomVecMESONT::copy(int i, int j, int delflag)
/* ---------------------------------------------------------------------- */
int AtomVecMESONT::pack_comm(int n, int *list, double *buf,
int AtomVecMesoNT::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -161,7 +163,7 @@ int AtomVecMESONT::pack_comm(int n, int *list, double *buf,
/* ---------------------------------------------------------------------- */
int AtomVecMESONT::pack_comm_vel(int n, int *list, double *buf,
int AtomVecMesoNT::pack_comm_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -224,7 +226,7 @@ int AtomVecMESONT::pack_comm_vel(int n, int *list, double *buf,
/* ---------------------------------------------------------------------- */
void AtomVecMESONT::unpack_comm(int n, int first, double *buf)
void AtomVecMesoNT::unpack_comm(int n, int first, double *buf)
{
int i,m,last;
@ -239,7 +241,7 @@ void AtomVecMESONT::unpack_comm(int n, int first, double *buf)
/* ---------------------------------------------------------------------- */
void AtomVecMESONT::unpack_comm_vel(int n, int first, double *buf)
void AtomVecMesoNT::unpack_comm_vel(int n, int first, double *buf)
{
int i,m,last;
@ -257,7 +259,7 @@ void AtomVecMESONT::unpack_comm_vel(int n, int first, double *buf)
/* ---------------------------------------------------------------------- */
int AtomVecMESONT::pack_reverse(int n, int first, double *buf)
int AtomVecMesoNT::pack_reverse(int n, int first, double *buf)
{
int i,m,last;
@ -273,7 +275,7 @@ int AtomVecMESONT::pack_reverse(int n, int first, double *buf)
/* ---------------------------------------------------------------------- */
void AtomVecMESONT::unpack_reverse(int n, int *list, double *buf)
void AtomVecMesoNT::unpack_reverse(int n, int *list, double *buf)
{
int i,j,m;
@ -288,7 +290,7 @@ void AtomVecMESONT::unpack_reverse(int n, int *list, double *buf)
/* ---------------------------------------------------------------------- */
int AtomVecMESONT::pack_border(int n, int *list, double *buf,
int AtomVecMesoNT::pack_border(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -310,8 +312,8 @@ int AtomVecMESONT::pack_border(int n, int *list, double *buf,
buf[m++] = length[j];
buf[m++] = ubuf(buckling[j]).d;
buf[m++] = ubuf(molecule[j]).d;
buf[m++] = ubuf(bond_cnt[j][0]).d;
buf[m++] = ubuf(bond_cnt[j][1]).d;
buf[m++] = ubuf(bond_nt[j][0]).d;
buf[m++] = ubuf(bond_nt[j][1]).d;
}
} else {
if (domain->triclinic == 0) {
@ -337,8 +339,8 @@ int AtomVecMESONT::pack_border(int n, int *list, double *buf,
buf[m++] = length[j];
buf[m++] = ubuf(buckling[j]).d;
buf[m++] = ubuf(molecule[j]).d;
buf[m++] = ubuf(bond_cnt[j][0]).d;
buf[m++] = ubuf(bond_cnt[j][1]).d;
buf[m++] = ubuf(bond_nt[j][0]).d;
buf[m++] = ubuf(bond_nt[j][1]).d;
}
}
@ -352,7 +354,7 @@ int AtomVecMESONT::pack_border(int n, int *list, double *buf,
/* ---------------------------------------------------------------------- */
int AtomVecMESONT::pack_border_vel(int n, int *list, double *buf,
int AtomVecMesoNT::pack_border_vel(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
int i,j,m;
@ -373,8 +375,8 @@ int AtomVecMESONT::pack_border_vel(int n, int *list, double *buf,
buf[m++] = length[j];
buf[m++] = ubuf(buckling[j]).d;
buf[m++] = ubuf(molecule[j]).d;
buf[m++] = ubuf(bond_cnt[j][0]).d;
buf[m++] = ubuf(bond_cnt[j][1]).d;
buf[m++] = ubuf(bond_nt[j][0]).d;
buf[m++] = ubuf(bond_nt[j][1]).d;
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
@ -403,8 +405,8 @@ int AtomVecMESONT::pack_border_vel(int n, int *list, double *buf,
buf[m++] = length[j];
buf[m++] = ubuf(buckling[j]).d;
buf[m++] = ubuf(molecule[j]).d;
buf[m++] = ubuf(bond_cnt[j][0]).d;
buf[m++] = ubuf(bond_cnt[j][1]).d;
buf[m++] = ubuf(bond_nt[j][0]).d;
buf[m++] = ubuf(bond_nt[j][1]).d;
buf[m++] = v[j][0];
buf[m++] = v[j][1];
buf[m++] = v[j][2];
@ -426,8 +428,8 @@ int AtomVecMESONT::pack_border_vel(int n, int *list, double *buf,
buf[m++] = length[j];
buf[m++] = ubuf(buckling[j]).d;
buf[m++] = ubuf(molecule[j]).d;
buf[m++] = ubuf(bond_cnt[j][0]).d;
buf[m++] = ubuf(bond_cnt[j][1]).d;
buf[m++] = ubuf(bond_nt[j][0]).d;
buf[m++] = ubuf(bond_nt[j][1]).d;
if (mask[i] & deform_groupbit) {
buf[m++] = v[j][0] + dvx;
buf[m++] = v[j][1] + dvy;
@ -451,7 +453,7 @@ int AtomVecMESONT::pack_border_vel(int n, int *list, double *buf,
/* ---------------------------------------------------------------------- */
int AtomVecMESONT::pack_border_hybrid(int n, int *list, double *buf)
int AtomVecMesoNT::pack_border_hybrid(int n, int *list, double *buf)
{
int i,j,m;
@ -463,15 +465,15 @@ int AtomVecMESONT::pack_border_hybrid(int n, int *list, double *buf)
buf[m++] = length[j];
buf[m++] = ubuf(buckling[j]).d;
buf[m++] = ubuf(molecule[j]).d;
buf[m++] = ubuf(bond_cnt[j][0]).d;
buf[m++] = ubuf(bond_cnt[j][1]).d;
buf[m++] = ubuf(bond_nt[j][0]).d;
buf[m++] = ubuf(bond_nt[j][1]).d;
}
return m;
}
/* ---------------------------------------------------------------------- */
void AtomVecMESONT::unpack_border(int n, int first, double *buf)
void AtomVecMesoNT::unpack_border(int n, int first, double *buf)
{
int i,m,last;
@ -491,8 +493,8 @@ void AtomVecMESONT::unpack_border(int n, int first, double *buf)
length[i] = buf[m++];
buckling[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (tagint) ubuf(buf[m++]).i;
bond_cnt[i][0] = (tagint) ubuf(buf[m++]).i;
bond_cnt[i][1] = (tagint) ubuf(buf[m++]).i;
bond_nt[i][0] = (tagint) ubuf(buf[m++]).i;
bond_nt[i][1] = (tagint) ubuf(buf[m++]).i;
}
if (atom->nextra_border)
@ -503,7 +505,7 @@ void AtomVecMESONT::unpack_border(int n, int first, double *buf)
/* ---------------------------------------------------------------------- */
void AtomVecMESONT::unpack_border_vel(int n, int first, double *buf)
void AtomVecMesoNT::unpack_border_vel(int n, int first, double *buf)
{
int i,m,last;
@ -522,8 +524,8 @@ void AtomVecMESONT::unpack_border_vel(int n, int first, double *buf)
length[i] = buf[m++];
buckling[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (tagint) ubuf(buf[m++]).i;
bond_cnt[i][0] = (tagint) ubuf(buf[m++]).i;
bond_cnt[i][1] = (tagint) ubuf(buf[m++]).i;
bond_nt[i][0] = (tagint) ubuf(buf[m++]).i;
bond_nt[i][1] = (tagint) ubuf(buf[m++]).i;
v[i][0] = buf[m++];
v[i][1] = buf[m++];
v[i][2] = buf[m++];
@ -537,7 +539,7 @@ void AtomVecMESONT::unpack_border_vel(int n, int first, double *buf)
/* ---------------------------------------------------------------------- */
int AtomVecMESONT::unpack_border_hybrid(int n, int first, double *buf)
int AtomVecMesoNT::unpack_border_hybrid(int n, int first, double *buf)
{
int i,m,last;
@ -549,8 +551,8 @@ int AtomVecMESONT::unpack_border_hybrid(int n, int first, double *buf)
length[i] = buf[m++];
buckling[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (tagint) ubuf(buf[m++]).i;
bond_cnt[i][0] = (tagint) ubuf(buf[m++]).i;
bond_cnt[i][1] = (tagint) ubuf(buf[m++]).i;
bond_nt[i][0] = (tagint) ubuf(buf[m++]).i;
bond_nt[i][1] = (tagint) ubuf(buf[m++]).i;
}
return m;
}
@ -560,7 +562,7 @@ int AtomVecMESONT::unpack_border_hybrid(int n, int first, double *buf)
xyz must be 1st 3 values, so comm::exchange() can test on them
------------------------------------------------------------------------- */
int AtomVecMESONT::pack_exchange(int i, double *buf)
int AtomVecMesoNT::pack_exchange(int i, double *buf)
{
int m = 1;
buf[m++] = x[i][0];
@ -579,8 +581,8 @@ int AtomVecMESONT::pack_exchange(int i, double *buf)
buf[m++] = length[i];
buf[m++] = ubuf(buckling[i]).d;
buf[m++] = ubuf(molecule[i]).d;
buf[m++] = ubuf(bond_cnt[i][0]).d;
buf[m++] = ubuf(bond_cnt[i][1]).d;
buf[m++] = ubuf(bond_nt[i][0]).d;
buf[m++] = ubuf(bond_nt[i][1]).d;
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
@ -592,7 +594,7 @@ int AtomVecMESONT::pack_exchange(int i, double *buf)
/* ---------------------------------------------------------------------- */
int AtomVecMESONT::unpack_exchange(double *buf)
int AtomVecMesoNT::unpack_exchange(double *buf)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
@ -614,8 +616,8 @@ int AtomVecMESONT::unpack_exchange(double *buf)
length[nlocal] = buf[m++];
buckling[nlocal] = (int) ubuf(buf[m++]).i;
molecule[nlocal] = (tagint) ubuf(buf[m++]).i;
bond_cnt[nlocal][0] = (tagint) ubuf(buf[m++]).i;
bond_cnt[nlocal][1] = (tagint) ubuf(buf[m++]).i;
bond_nt[nlocal][0] = (tagint) ubuf(buf[m++]).i;
bond_nt[nlocal][1] = (tagint) ubuf(buf[m++]).i;
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
@ -631,7 +633,7 @@ int AtomVecMESONT::unpack_exchange(double *buf)
include extra data stored by fixes
------------------------------------------------------------------------- */
int AtomVecMESONT::size_restart()
int AtomVecMesoNT::size_restart()
{
int i;
@ -652,7 +654,7 @@ int AtomVecMESONT::size_restart()
molecular types may be negative, but write as positive
------------------------------------------------------------------------- */
int AtomVecMESONT::pack_restart(int i, double *buf)
int AtomVecMesoNT::pack_restart(int i, double *buf)
{
int m = 1;
buf[m++] = x[i][0];
@ -667,8 +669,8 @@ int AtomVecMESONT::pack_restart(int i, double *buf)
buf[m++] = length[i];
buf[m++] = ubuf(buckling[i]).d;
buf[m++] = ubuf(molecule[i]).d;
buf[m++] = ubuf(bond_cnt[i][0]).d;
buf[m++] = ubuf(bond_cnt[i][1]).d;
buf[m++] = ubuf(bond_nt[i][0]).d;
buf[m++] = ubuf(bond_nt[i][1]).d;
buf[m++] = v[i][0];
buf[m++] = v[i][1];
buf[m++] = v[i][2];
@ -685,7 +687,7 @@ int AtomVecMESONT::pack_restart(int i, double *buf)
unpack data for one atom from restart file including extra quantities
------------------------------------------------------------------------- */
int AtomVecMESONT::unpack_restart(double *buf)
int AtomVecMesoNT::unpack_restart(double *buf)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) {
@ -707,8 +709,8 @@ int AtomVecMESONT::unpack_restart(double *buf)
length[nlocal] = buf[m++];
buckling[nlocal] = (int) ubuf(buf[m++]).i;
molecule[nlocal] = (tagint) ubuf(buf[m++]).i;
bond_cnt[nlocal][0] = (tagint) ubuf(buf[m++]).i;
bond_cnt[nlocal][1] = (tagint) ubuf(buf[m++]).i;
bond_nt[nlocal][0] = (tagint) ubuf(buf[m++]).i;
bond_nt[nlocal][1] = (tagint) ubuf(buf[m++]).i;
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
@ -728,7 +730,7 @@ int AtomVecMESONT::unpack_restart(double *buf)
set other values to defaults
------------------------------------------------------------------------- */
void AtomVecMESONT::create_atom(int itype, double *coord)
void AtomVecMesoNT::create_atom(int itype, double *coord)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
@ -746,8 +748,8 @@ void AtomVecMESONT::create_atom(int itype, double *coord)
length[nlocal] = 1.0;
buckling[nlocal] = 0;
molecule[nlocal] = 0;
bond_cnt[nlocal][0] = -1;
bond_cnt[nlocal][1] = -1;
bond_nt[nlocal][0] = -1;
bond_nt[nlocal][1] = -1;
v[nlocal][0] = 0.0;
v[nlocal][1] = 0.0;
v[nlocal][2] = 0.0;
@ -760,7 +762,7 @@ void AtomVecMESONT::create_atom(int itype, double *coord)
initialize other atom quantities
------------------------------------------------------------------------- */
void AtomVecMESONT::data_atom(double *coord, imageint imagetmp, char **values)
void AtomVecMesoNT::data_atom(double *coord, imageint imagetmp, char **values)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
@ -770,8 +772,8 @@ void AtomVecMESONT::data_atom(double *coord, imageint imagetmp, char **values)
type[nlocal] = utils::inumeric(FLERR,values[2],true,lmp);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
bond_cnt[nlocal][0] = utils::inumeric(FLERR,values[3],true,lmp);
bond_cnt[nlocal][1] = utils::inumeric(FLERR,values[4],true,lmp);
bond_nt[nlocal][0] = utils::inumeric(FLERR,values[3],true,lmp);
bond_nt[nlocal][1] = utils::inumeric(FLERR,values[4],true,lmp);
rmass[nlocal] = utils::numeric(FLERR,values[5],true,lmp);
radius[nlocal] = utils::numeric(FLERR,values[6],true,lmp);
length[nlocal] = utils::numeric(FLERR,values[7],true,lmp);
@ -796,11 +798,11 @@ void AtomVecMESONT::data_atom(double *coord, imageint imagetmp, char **values)
initialize other atom quantities for this sub-style
------------------------------------------------------------------------- */
int AtomVecMESONT::data_atom_hybrid(int nlocal, char **values)
int AtomVecMesoNT::data_atom_hybrid(int nlocal, char **values)
{
molecule[nlocal] = utils::tnumeric(FLERR,values[0],true,lmp);
bond_cnt[nlocal][0] = utils::inumeric(FLERR,values[1],true,lmp);
bond_cnt[nlocal][1] = utils::inumeric(FLERR,values[2],true,lmp);
bond_nt[nlocal][0] = utils::inumeric(FLERR,values[1],true,lmp);
bond_nt[nlocal][1] = utils::inumeric(FLERR,values[2],true,lmp);
rmass[nlocal] = utils::numeric(FLERR,values[3],true,lmp);
radius[nlocal] = utils::numeric(FLERR,values[4],true,lmp);
length[nlocal] = utils::numeric(FLERR,values[5],true,lmp);
@ -813,7 +815,7 @@ int AtomVecMESONT::data_atom_hybrid(int nlocal, char **values)
pack atom info for data file including 3 image flags
------------------------------------------------------------------------- */
void AtomVecMESONT::pack_data(double **buf)
void AtomVecMesoNT::pack_data(double **buf)
{
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
@ -821,8 +823,8 @@ void AtomVecMESONT::pack_data(double **buf)
buf[i][m++] = ubuf(tag[i]).d;
buf[i][m++] = ubuf(molecule[i]).d;
buf[i][m++] = ubuf(type[i]).d;
buf[i][m++] = ubuf(bond_cnt[i][0]).d;
buf[i][m++] = ubuf(bond_cnt[i][1]).d;
buf[i][m++] = ubuf(bond_nt[i][0]).d;
buf[i][m++] = ubuf(bond_nt[i][1]).d;
buf[i][m++] = rmass[i];
buf[i][m++] = radius[i];
buf[i][m++] = length[i];
@ -840,12 +842,12 @@ void AtomVecMESONT::pack_data(double **buf)
pack hybrid atom info for data file
------------------------------------------------------------------------- */
int AtomVecMESONT::pack_data_hybrid(int i, double *buf)
int AtomVecMesoNT::pack_data_hybrid(int i, double *buf)
{
int m = 0;
buf[m++] = ubuf(molecule[i]).d;
buf[m++] = ubuf(bond_cnt[i][0]).d;
buf[m++] = ubuf(bond_cnt[i][1]).d;
buf[m++] = ubuf(bond_nt[i][0]).d;
buf[m++] = ubuf(bond_nt[i][1]).d;
buf[m++] = rmass[i];
buf[m++] = radius[i];
buf[m++] = length[i];
@ -857,7 +859,7 @@ int AtomVecMESONT::pack_data_hybrid(int i, double *buf)
write atom info to data file including 3 image flags
------------------------------------------------------------------------- */
void AtomVecMESONT::write_data(FILE *fp, int n, double **buf)
void AtomVecMesoNT::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
fprintf(fp, TAGINT_FORMAT " " TAGINT_FORMAT " %d "
@ -876,7 +878,7 @@ void AtomVecMESONT::write_data(FILE *fp, int n, double **buf)
write hybrid atom info to data file
------------------------------------------------------------------------- */
int AtomVecMESONT::write_data_hybrid(FILE *fp, double *buf)
int AtomVecMesoNT::write_data_hybrid(FILE *fp, double *buf)
{
fprintf(fp," " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT
" %-1.16e %-1.16e %-1.16e %d",
@ -889,7 +891,7 @@ int AtomVecMESONT::write_data_hybrid(FILE *fp, double *buf)
return # of bytes of allocated memory
------------------------------------------------------------------------- */
bigint AtomVecMESONT::memory_usage()
bigint AtomVecMesoNT::memory_usage()
{
bigint bytes = 0;
@ -906,7 +908,7 @@ bigint AtomVecMESONT::memory_usage()
if (atom->memcheck("length")) bytes += memory->usage(length,nmax);
if (atom->memcheck("buckling")) bytes += memory->usage(buckling,nmax);
if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
if (atom->memcheck("bond_cnt")) bytes += memory->usage(bond_cnt,nmax,2);
if (atom->memcheck("bond_nt")) bytes += memory->usage(bond_nt,nmax,2);
return bytes;
}

View File

@ -15,7 +15,7 @@
#ifdef ATOM_CLASS
AtomStyle(mesont,AtomVecMESONT)
AtomStyle(mesont,AtomVecMesoNT)
#else
@ -26,10 +26,10 @@ AtomStyle(mesont,AtomVecMESONT)
namespace LAMMPS_NS {
class AtomVecMESONT : public AtomVec {
class AtomVecMesoNT : public AtomVec {
public:
AtomVecMESONT(class LAMMPS *);
virtual ~AtomVecMESONT() {}
AtomVecMesoNT(class LAMMPS *);
virtual ~AtomVecMesoNT() {}
void grow(int);
void grow_reset();
void copy(int, int, int);
@ -66,7 +66,7 @@ class AtomVecMESONT : public AtomVec {
double **x,**v,**f;
double *rmass, *radius, *length;
int *buckling;
tagint **bond_cnt;
tagint **bond_nt;
tagint *molecule;
};

View File

@ -0,0 +1,163 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#include "compute_mesont.h"
#include <cstring>
#include "atom.h"
#include "update.h"
#include "comm.h"
#include "force.h"
#include "modify.h"
#include "memory.h"
#include "error.h"
#include "pair.h"
#include <string>
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeMesoNT::ComputeMesoNT(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg), energy(NULL) {
if (narg != 4) error->all(FLERR,"Illegal compute mesont command");
std::string ctype = arg[3];
if (ctype == "estretch") compute_type = ES;
else if (ctype == "estretch_tot") compute_type = ESTOT;
else if (ctype == "ebend") compute_type = EB;
else if (ctype == "ebend_tot") compute_type = EBTOT;
else if (ctype == "etube") compute_type = ET;
else if (ctype == "etube_tot") compute_type = ETTOT;
else error->all(FLERR,"Illegal compute mesont command");
if ((compute_type == ES) || (compute_type == EB) || (compute_type == ET)) {
peratom_flag = 1;
size_peratom_cols = 0;
peatomflag = 1;
timeflag = 1;
comm_reverse = 1;
nmax = 0;
} else {
timeflag = 1;
extscalar = 1;
scalar_flag = 1;
}
}
/* ---------------------------------------------------------------------- */
ComputeMesoNT::~ComputeMesoNT() {
memory->destroy(energy);
}
/* ---------------------------------------------------------------------- */
double ComputeMesoNT::compute_scalar() {
invoked_scalar = update->ntimestep;
if (update->eflag_global != invoked_scalar)
error->all(FLERR,"Energy was not tallied on needed timestep");
int i;
double* ptr = NULL;
if (compute_type == ESTOT)
ptr = static_cast<double*>(force->pair->extract("mesonttpm_Es_tot",i));
else if (compute_type == EBTOT)
ptr = static_cast<double*>(force->pair->extract("mesonttpm_Eb_tot",i));
else if (compute_type == ETTOT)
ptr = static_cast<double*>(force->pair->extract("mesonttpm_Et_tot",i));
else error->all(FLERR,"Illegal compute mesont command");
if (!ptr) error->all(FLERR,
"compute mesont is allowed only with mesont/tpm pair style");
MPI_Allreduce(ptr,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
return scalar;
}
/* ---------------------------------------------------------------------- */
void ComputeMesoNT::compute_peratom() {
invoked_peratom = update->ntimestep;
if (update->eflag_atom != invoked_peratom)
error->all(FLERR,"Per-atom energy was not tallied on needed timestep");
// grow local energy array if necessary
// needs to be atom->nmax in length
if (atom->nmax > nmax) {
memory->destroy(energy);
nmax = atom->nmax;
memory->create(energy,nmax,"mesont_Eb:energy");
vector_atom = energy;
}
// npair includes ghosts if newton_bond is set
// ntotal includes ghosts if either newton flag is set
int nlocal = atom->nlocal;
int npair = nlocal;
if (force->newton) npair += atom->nghost;
int ntotal = nlocal;
if (force->newton) ntotal += atom->nghost;
int i;
// clear local energy array
for (int i = 0; i < ntotal; i++) energy[i] = 0.0;
double* ptr = NULL;
if (compute_type == ES)
ptr = static_cast<double*>(force->pair->extract("mesonttpm_Es",i));
else if (compute_type == EB)
ptr = static_cast<double*>(force->pair->extract("mesonttpm_Eb",i));
else if (compute_type == ET)
ptr = static_cast<double*>(force->pair->extract("mesonttpm_Et",i));
else error->all(FLERR,"Illegal compute mesont command");
if (ptr) for (i = 0; i < npair; i++) energy[i] += ptr[i];
else error->all(FLERR,
"compute mesont is allowed only with mesont/tpm pair style");
// communicate ghost energy between neighbor procs
if (force->newton) comm->reverse_comm_compute(this);
// zero energy of atoms not in group
// only do this after comm since ghost contributions must be included
int *mask = atom->mask;
for (int i = 0; i < nlocal; i++)
if (!(mask[i] & groupbit)) energy[i] = 0.0;
}
/* ---------------------------------------------------------------------- */
int ComputeMesoNT::pack_reverse_comm(int n, int first, double *buf) {
int m = 0;
int last = first + n;
for (int i = first; i < last; i++) buf[m++] = energy[i];
return m;
}
/* ---------------------------------------------------------------------- */
void ComputeMesoNT::unpack_reverse_comm(int n, int *list, double *buf) {
int m = 0;
for (int i = 0; i < n; i++) {
int j = list[i];
energy[j] += buf[m++];
}
}
/* ----------------------------------------------------------------------
memory usage of local atom-based array
------------------------------------------------------------------------- */
double ComputeMesoNT::memory_usage() {
double bytes = nmax * sizeof(double);
return bytes;
}

View File

@ -15,30 +15,34 @@
#ifdef COMPUTE_CLASS
ComputeStyle(mesont/Et,ComputeMESONT_Et)
ComputeStyle(mesont,ComputeMesoNT)
#else
#ifndef LMP_COMPUTE_MESONT_ET_ATOM_H
#define LMP_COMPUTE_MESONT_ET_ATOM_H
#ifndef LMP_COMPUTE_MESONT_ATOM_H
#define LMP_COMPUTE_MESONT_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeMESONT_Et : public Compute {
class ComputeMesoNT : public Compute {
public:
ComputeMESONT_Et(class LAMMPS *, int, char **);
~ComputeMESONT_Et();
ComputeMesoNT(class LAMMPS *, int, char **);
~ComputeMesoNT();
void init() {}
void compute_peratom();
double compute_scalar();
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();
private:
int nmax;
double *energy;
enum ComputeType {ES, EB, ET, ESTOT, EBTOT, ETTOT};
ComputeType compute_type;
};
}
@ -48,7 +52,7 @@ class ComputeMESONT_Et : public Compute {
/* ERROR/WARNING messages:
E: Illegal compute mesont/Et command
E: Illegal compute mesont command
Incorrect argument list in the compute init.
@ -56,8 +60,8 @@ E: Per-atom energy was not tallied on needed timestep
UNSPECIFIED.
E: mesont/Et is allowed only with mesont/tpm pair style
E: compute mesont is allowed only with mesont/tpm pair style
Use mesont/tpm pair style.
Use mesont pair style.
*/

View File

@ -1,79 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#include "compute_mesont_B.h"
#include <cstring>
#include "atom.h"
#include "update.h"
#include "comm.h"
#include "force.h"
#include "bond.h"
#include "modify.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeMESONT_B::ComputeMESONT_B(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
buckling(NULL)
{
if (narg < 3) error->all(FLERR,"Illegal compute mesont/B command");
peratom_flag = 1;
size_peratom_cols = 0;
peatomflag = 1;
timeflag = 1;
comm_reverse = 0;
nmax = 0;
}
/* ---------------------------------------------------------------------- */
ComputeMESONT_B::~ComputeMESONT_B()
{
memory->destroy(buckling);
}
/* ---------------------------------------------------------------------- */
void ComputeMESONT_B::compute_peratom()
{
int i;
// grow local buckling array if necessary
// needs to be atom->nmax in length
if (atom->nmax > nmax) {
memory->destroy(buckling);
nmax = atom->nmax;
memory->create(buckling,nmax,"mesont_B:buckling");
vector_atom = buckling;
}
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++) buckling[i] = atom->buckling[i];
}
/* ---------------------------------------------------------------------
memory usage of local atom-based array
------------------------------------------------------------------------- */
double ComputeMESONT_B::memory_usage()
{
double bytes = nmax * sizeof(int);
return bytes;
}

View File

@ -1,51 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(mesont/B,ComputeMESONT_B)
#else
#ifndef LMP_COMPUTE_MESONT_B_ATOM_H
#define LMP_COMPUTE_MESONT_B_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeMESONT_B : public Compute {
public:
ComputeMESONT_B(class LAMMPS *, int, char **);
~ComputeMESONT_B();
void init() {}
void compute_peratom();
double memory_usage();
private:
int nmax;
double *buckling;
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal compute mesont/B command
*/

View File

@ -1,129 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#include "compute_mesont_Eb.h"
#include <cstring>
#include "atom.h"
#include "update.h"
#include "comm.h"
#include "force.h"
#include "modify.h"
#include "memory.h"
#include "error.h"
#include "pair.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeMESONT_Eb::ComputeMESONT_Eb(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
energy(NULL)
{
if (narg < 3) error->all(FLERR,"Illegal compute mesont/Eb command");
peratom_flag = 1;
size_peratom_cols = 0;
peatomflag = 1;
timeflag = 1;
comm_reverse = 1;
nmax = 0;
}
/* ---------------------------------------------------------------------- */
ComputeMESONT_Eb::~ComputeMESONT_Eb()
{
memory->destroy(energy);
}
/* ---------------------------------------------------------------------- */
void ComputeMESONT_Eb::compute_peratom()
{
int i;
invoked_peratom = update->ntimestep;
if (update->eflag_atom != invoked_peratom)
error->all(FLERR,"Per-atom energy was not tallied on needed timestep");
// grow local energy array if necessary
// needs to be atom->nmax in length
if (atom->nmax > nmax) {
memory->destroy(energy);
nmax = atom->nmax;
memory->create(energy,nmax,"mesont_Eb:energy");
vector_atom = energy;
}
// npair includes ghosts if newton_bond is set
// ntotal includes ghosts if either newton flag is set
int nlocal = atom->nlocal;
int npair = nlocal;
if (force->newton) npair += atom->nghost;
int ntotal = nlocal;
if (force->newton) ntotal += atom->nghost;
// clear local energy array
for (i = 0; i < ntotal; i++) energy[i] = 0.0;
double* ptr = static_cast<double*>(force->pair->extract("mesonttpm_Eb",i));
if(ptr) for (i = 0; i < npair; i++) energy[i] += ptr[i];
else error->all(FLERR,
"mesont/Eb is allowed only with mesont/tpm pair style");
// communicate ghost energy between neighbor procs
if (force->newton) comm->reverse_comm_compute(this);
// zero energy of atoms not in group
// only do this after comm since ghost contributions must be included
int *mask = atom->mask;
for (i = 0; i < nlocal; i++)
if (!(mask[i] & groupbit)) energy[i] = 0.0;
}
/* ---------------------------------------------------------------------- */
int ComputeMESONT_Eb::pack_reverse_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) buf[m++] = energy[i];
return m;
}
/* ---------------------------------------------------------------------- */
void ComputeMESONT_Eb::unpack_reverse_comm(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
energy[j] += buf[m++];
}
}
/* ----------------------------------------------------------------------
memory usage of local atom-based array
------------------------------------------------------------------------- */
double ComputeMESONT_Eb::memory_usage()
{
double bytes = nmax * sizeof(double);
return bytes;
}

View File

@ -1,63 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(mesont/Eb,ComputeMESONT_Eb)
#else
#ifndef LMP_COMPUTE_MESONT_EB_ATOM_H
#define LMP_COMPUTE_MESONT_EB_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeMESONT_Eb : public Compute {
public:
ComputeMESONT_Eb(class LAMMPS *, int, char **);
~ComputeMESONT_Eb();
void init() {}
void compute_peratom();
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();
private:
int nmax;
double *energy;
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal compute mesont/Eb command
Incorrect argument list in the compute init.
E: Per-atom energy was not tallied on needed timestep
UNSPECIFIED.
E: mesont/Eb is allowed only with mesont pair/tpm style
Use mesont/tpm pair style.
*/

View File

@ -1,56 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#include "compute_mesont_Eb_tot.h"
#include <mpi.h>
#include <cstring>
#include "atom.h"
#include "update.h"
#include "force.h"
#include "modify.h"
#include "domain.h"
#include "error.h"
#include "pair.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeMESONT_Eb_tot::ComputeMESONT_Eb_tot(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg < 3) error->all(FLERR,"Illegal compute mesont/Eb_tot command");
if (igroup) error->all(FLERR,"Compute mesont/Eb_tot must use group all");
timeflag = 1;
extscalar = 1;
scalar_flag = 1;
}
/* ---------------------------------------------------------------------- */
double ComputeMESONT_Eb_tot::compute_scalar()
{
invoked_scalar = update->ntimestep;
if (update->eflag_global != invoked_scalar)
error->all(FLERR,"Energy was not tallied on needed timestep");
int i;
double* ptr = static_cast<double*>(force->pair->extract("mesonttpm_Eb_tot",i));
if(!ptr) error->all(FLERR,
"mesont/Eb_tot is allowed only with mesont/tpm pair style");
MPI_Allreduce(ptr,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
return scalar;
}

View File

@ -1,56 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(mesont/Eb_tot,ComputeMESONT_Eb_tot)
#else
#ifndef LMP_COMPUTE_MESONT_EB_H
#define LMP_COMPUTE_MESONT_EB_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeMESONT_Eb_tot : public Compute {
public:
ComputeMESONT_Eb_tot(class LAMMPS *, int, char **);
~ComputeMESONT_Eb_tot() {}
void init() {}
double compute_scalar();
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal compute mesont/Eb_tot command
Incorrect argument list in the compute init.
E: Compute mesont/Eb_tot must use group all
UNSPECIFIED.
E: mesont/Eb_tot is allowed only with mesont pair/tpm style
Use mesont/tpm pair style.
*/

View File

@ -1,129 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#include "compute_mesont_Es.h"
#include <cstring>
#include "atom.h"
#include "update.h"
#include "comm.h"
#include "force.h"
#include "modify.h"
#include "memory.h"
#include "error.h"
#include "pair.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeMESONT_Es::ComputeMESONT_Es(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
energy(NULL)
{
if (narg < 3) error->all(FLERR,"Illegal compute mesont/Es command");
peratom_flag = 1;
size_peratom_cols = 0;
peatomflag = 1;
timeflag = 1;
comm_reverse = 1;
nmax = 0;
}
/* ---------------------------------------------------------------------- */
ComputeMESONT_Es::~ComputeMESONT_Es()
{
memory->destroy(energy);
}
/* ---------------------------------------------------------------------- */
void ComputeMESONT_Es::compute_peratom()
{
int i;
invoked_peratom = update->ntimestep;
if (update->eflag_atom != invoked_peratom)
error->all(FLERR,"Per-atom energy was not tallied on needed timestep");
// grow local energy array if necessary
// needs to be atom->nmax in length
if (atom->nmax > nmax) {
memory->destroy(energy);
nmax = atom->nmax;
memory->create(energy,nmax,"mesont_Es:energy");
vector_atom = energy;
}
// npair includes ghosts if newton_bond is set
// ntotal includes ghosts if either newton flag is set
int nlocal = atom->nlocal;
int npair = nlocal;
if (force->newton) npair += atom->nghost;
int ntotal = nlocal;
if (force->newton) ntotal += atom->nghost;
// clear local energy array
for (i = 0; i < ntotal; i++) energy[i] = 0.0;
double* ptr = static_cast<double*>(force->pair->extract("mesonttpm_Es",i));
if(ptr) for (i = 0; i < npair; i++) energy[i] += ptr[i];
else error->all(FLERR,
"mesont/Es is allowed only with mesont/tpm pair style");
// communicate ghost energy between neighbor procs
if (force->newton) comm->reverse_comm_compute(this);
// zero energy of atoms not in group
// only do this after comm since ghost contributions must be included
int *mask = atom->mask;
for (i = 0; i < nlocal; i++)
if (!(mask[i] & groupbit)) energy[i] = 0.0;
}
/* ---------------------------------------------------------------------- */
int ComputeMESONT_Es::pack_reverse_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) buf[m++] = energy[i];
return m;
}
/* ---------------------------------------------------------------------- */
void ComputeMESONT_Es::unpack_reverse_comm(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
energy[j] += buf[m++];
}
}
/* ----------------------------------------------------------------------
memory usage of local atom-based array
------------------------------------------------------------------------- */
double ComputeMESONT_Es::memory_usage()
{
double bytes = nmax * sizeof(double);
return bytes;
}

View File

@ -1,63 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(mesont/Es,ComputeMESONT_Es)
#else
#ifndef LMP_COMPUTE_MESONT_ES_ATOM_H
#define LMP_COMPUTE_MESONT_ES_ATOM_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeMESONT_Es : public Compute {
public:
ComputeMESONT_Es(class LAMMPS *, int, char **);
~ComputeMESONT_Es();
void init() {}
void compute_peratom();
int pack_reverse_comm(int, int, double *);
void unpack_reverse_comm(int, int *, double *);
double memory_usage();
private:
int nmax;
double *energy;
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal compute mesont/Es command
Incorrect argument list in the compute init.
E: Per-atom energy was not tallied on needed timestep
UNSPECIFIED.
E: mesont/Es is allowed only with mesont/tpm pair style
Use mesont/tpm pair style.
*/

View File

@ -1,56 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#include "compute_mesont_Es_tot.h"
#include <mpi.h>
#include <cstring>
#include "atom.h"
#include "update.h"
#include "force.h"
#include "modify.h"
#include "domain.h"
#include "error.h"
#include "pair.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeMESONT_Es_tot::ComputeMESONT_Es_tot(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg < 3) error->all(FLERR,"Illegal compute mesont/Es_tot command");
if (igroup) error->all(FLERR,"Compute mesont/Es_tot must use group all");
timeflag = 1;
extscalar = 1;
scalar_flag = 1;
}
/* ---------------------------------------------------------------------- */
double ComputeMESONT_Es_tot::compute_scalar()
{
invoked_scalar = update->ntimestep;
if (update->eflag_global != invoked_scalar)
error->all(FLERR,"Energy was not tallied on needed timestep");
int i;
double* ptr = static_cast<double*>(force->pair->extract("mesonttpm_Es_tot",i));
if(!ptr) error->all(FLERR,
"mesont/Es_tot is allowed only with mesont/tpm pair style");
MPI_Allreduce(ptr,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
return scalar;
}

View File

@ -1,56 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(mesont/Es_tot,ComputeMESONT_Es_tot)
#else
#ifndef LMP_COMPUTE_MESONT_ES_H
#define LMP_COMPUTE_MESONT_ES_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeMESONT_Es_tot : public Compute {
public:
ComputeMESONT_Es_tot(class LAMMPS *, int, char **);
~ComputeMESONT_Es_tot() {}
void init() {}
double compute_scalar();
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal compute mesont/Es_tot command
Incorrect argument list in the compute init.
E: Compute mesont/Es_tot must use group all
UNSPECIFIED.
E: mesont/Es_tot is allowed only with mesont/tpm pair style
Use mesont/tpm pair style.
*/

View File

@ -1,129 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#include "compute_mesont_Et.h"
#include <cstring>
#include "atom.h"
#include "update.h"
#include "comm.h"
#include "force.h"
#include "modify.h"
#include "memory.h"
#include "error.h"
#include "pair.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeMESONT_Et::ComputeMESONT_Et(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
energy(NULL)
{
if (narg < 3) error->all(FLERR,"Illegal compute mesont/Et command");
peratom_flag = 1;
size_peratom_cols = 0;
peatomflag = 1;
timeflag = 1;
comm_reverse = 1;
nmax = 0;
}
/* ---------------------------------------------------------------------- */
ComputeMESONT_Et::~ComputeMESONT_Et()
{
memory->destroy(energy);
}
/* ---------------------------------------------------------------------- */
void ComputeMESONT_Et::compute_peratom()
{
int i;
invoked_peratom = update->ntimestep;
if (update->eflag_atom != invoked_peratom)
error->all(FLERR,"Per-atom energy was not tallied on needed timestep");
// grow local energy array if necessary
// needs to be atom->nmax in length
if (atom->nmax > nmax) {
memory->destroy(energy);
nmax = atom->nmax;
memory->create(energy,nmax,"mesont_Et:energy");
vector_atom = energy;
}
// npair includes ghosts if newton_bond is set
// ntotal includes ghosts if either newton flag is set
int nlocal = atom->nlocal;
int npair = nlocal;
if (force->newton) npair += atom->nghost;
int ntotal = nlocal;
if (force->newton) ntotal += atom->nghost;
// clear local energy array
for (i = 0; i < ntotal; i++) energy[i] = 0.0;
double* ptr = static_cast<double*>(force->pair->extract("mesonttpm_Et",i));
if(ptr) for (i = 0; i < npair; i++) energy[i] += ptr[i];
else error->all(FLERR,
"mesont/Et is allowed only with mesont/tpm pair style");
// communicate ghost energy between neighbor procs
if (force->newton) comm->reverse_comm_compute(this);
// zero energy of atoms not in group
// only do this after comm since ghost contributions must be included
int *mask = atom->mask;
for (i = 0; i < nlocal; i++)
if (!(mask[i] & groupbit)) energy[i] = 0.0;
}
/* ---------------------------------------------------------------------- */
int ComputeMESONT_Et::pack_reverse_comm(int n, int first, double *buf)
{
int i,m,last;
m = 0;
last = first + n;
for (i = first; i < last; i++) buf[m++] = energy[i];
return m;
}
/* ---------------------------------------------------------------------- */
void ComputeMESONT_Et::unpack_reverse_comm(int n, int *list, double *buf)
{
int i,j,m;
m = 0;
for (i = 0; i < n; i++) {
j = list[i];
energy[j] += buf[m++];
}
}
/* ----------------------------------------------------------------------
memory usage of local atom-based array
------------------------------------------------------------------------- */
double ComputeMESONT_Et::memory_usage()
{
double bytes = nmax * sizeof(double);
return bytes;
}

View File

@ -1,56 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#include "compute_mesont_Et_tot.h"
#include <mpi.h>
#include <cstring>
#include "atom.h"
#include "update.h"
#include "force.h"
#include "modify.h"
#include "domain.h"
#include "error.h"
#include "pair.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeMESONT_Et_tot::ComputeMESONT_Et_tot(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg)
{
if (narg < 3) error->all(FLERR,"Illegal compute mesont/Et_tot command");
if (igroup) error->all(FLERR,"Compute mesont/Et_tot must use group all");
timeflag = 1;
extscalar = 1;
scalar_flag = 1;
}
/* ---------------------------------------------------------------------- */
double ComputeMESONT_Et_tot::compute_scalar()
{
invoked_scalar = update->ntimestep;
if (update->eflag_global != invoked_scalar)
error->all(FLERR,"Energy was not tallied on needed timestep");
int i;
double* ptr = static_cast<double*>(force->pair->extract("mesonttpm_Et_tot",i));
if(!ptr) error->all(FLERR,
"mesont/Et_tot is allowed only with mesont/tpm pair style");
MPI_Allreduce(ptr,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
return scalar;
}

View File

@ -1,56 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#ifdef COMPUTE_CLASS
ComputeStyle(mesont/Et_tot,ComputeMESONT_Et_tot)
#else
#ifndef LMP_COMPUTE_MESONT_ET_H
#define LMP_COMPUTE_MESONT_ET_H
#include "compute.h"
namespace LAMMPS_NS {
class ComputeMESONT_Et_tot : public Compute {
public:
ComputeMESONT_Et_tot(class LAMMPS *, int, char **);
~ComputeMESONT_Et_tot() {}
void init() {}
double compute_scalar();
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal compute mesont/Et_tot command
Incorrect argument list in the compute init.
E: Compute mesont/Et_tot must use group all
UNSPECIFIED.
E: mesont/Et_tot is allowed only with mesont/tpm pair style
Use mesont/tpm pair style.
*/

View File

@ -1,182 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#include "mesont_list.h"
#include <algorithm>
#include <cmath>
template<typename T>
void vector_union(std::vector<T>& v1, std::vector<T>& v2,
std::vector<T>& merged) {
std::sort(v1.begin(), v1.end());
std::sort(v2.begin(), v2.end());
merged.reserve(v1.size() + v2.size());
typename std::vector<T>::iterator it1 = v1.begin();
typename std::vector<T>::iterator it2 = v2.begin();
while (it1 != v1.end() && it2 != v2.end()) {
if (*it1 < *it2) {
if (merged.empty() || merged.back() < *it1) merged.push_back(*it1);
++it1;
}
else {
if (merged.empty() || merged.back() < *it2) merged.push_back(*it2);
++it2;
}
}
while (it1 != v1.end()) {
if (merged.empty() || merged.back() < *it1) merged.push_back(*it1);
++it1;
}
while (it2 != v2.end()) {
if (merged.empty() || merged.back() < *it2) merged.push_back(*it2);
++it2;
}
}
#ifndef NULL
#define NULL 0
#endif
MESONTList::MESONTList(const Atom* atom, const NeighList* nblist, double rc2){
if (atom == NULL || nblist == NULL) return;
//number of local atoms at the node
int nlocal = atom->nlocal;
//total number of atoms in the node and ghost shell
int nall = nblist->inum + nblist->gnum;
int ntot = atom->nlocal + atom->nghost;
tagint* const g_id = atom->tag;
tagint** const bonds = atom->bond_cnt;
tagint* const chain_id = atom->molecule;
int* ilist = nblist->ilist;
//convert bonds to local id representation
array2003<int, 2> tmp_arr;
tmp_arr[0] = not_cnt; tmp_arr[1] = not_cnt;
chain_list.resize(ntot, tmp_arr);
for (int ii = 0; ii < nall; ii++) {
int i = ilist[ii];
chain_list[i][0] = domain_end;
chain_list[i][1] = domain_end;
}
for (int ii = 0; ii < nall; ii++) {
int i = ilist[ii];
int nnb = nblist->numneigh[i];
for (int m = 0; m < 2; m++)
if (bonds[i][m] == cnt_end) chain_list[i][m] = cnt_end;
for (int j = 0; j < nnb; j++) {
int nb = nblist->firstneigh[i][j];
if (bonds[i][0] == g_id[nb]){
chain_list[i][0] = nb;
chain_list[nb][1] = i;
break;
}
}
}
//reorder chains: index list
//list of indexes for conversion FROM reordered representation
index_list.reserve(nall);
index_list_b.resize(ntot, -1); // convert index TO reordered representation
for (int i = 0; i < ntot; i++) {
if (chain_list[i][0] == cnt_end || chain_list[i][0] == domain_end) {
index_list.push_back(i);
index_list_b[i] = index_list.size() - 1;
int idx = i;
while (1) {
idx = chain_list[idx][1];
if (idx == cnt_end || idx == domain_end) break;
else index_list.push_back(idx);
index_list_b[idx] = index_list.size() - 1;
}
}
}
//segment list
for (int i = 0; i < nlocal; i++) {
if (chain_list[i][0] == not_cnt) continue;
if (chain_list[i][0] != cnt_end && chain_list[i][0] != domain_end &&
g_id[i] < g_id[chain_list[i][0]]){
array2003<int, 2> tmp_c;
tmp_c[0] = i; tmp_c[1] = chain_list[i][0];
segments.push_back(tmp_c);
}
if (chain_list[i][1] != cnt_end && chain_list[i][1] != domain_end &&
g_id[i] < g_id[chain_list[i][1]]){
array2003<int, 2> tmp_c;
tmp_c[0] = i; tmp_c[1] = chain_list[i][1];
segments.push_back(tmp_c);
}
}
int nbonds = segments.size();
//triplets
for (int i = 0; i < nlocal; i++){
if (chain_list[i][0] == not_cnt) continue;
if (chain_list[i][0] != cnt_end && chain_list[i][0] != domain_end &&
chain_list[i][1] != cnt_end && chain_list[i][1] != domain_end)
triplets.push_back(get_triplet(i));
}
//segment neighbor list
nb_chains.resize(nbonds);
std::vector<int> nb_list_i[2], nb_list;
for (int i = 0; i < nbonds; i++) {
//union of nb lists
for (int m = 0; m < 2; m++) {
nb_list_i[m].resize(0);
int idx = segments[i][m];
if (idx >= nlocal) continue;
int nnb = nblist->numneigh[idx];
for (int j = 0; j < nnb; j++) {
int jdx = nblist->firstneigh[idx][j];
//no selfinteractions for nbs within the same tube
if (chain_id[jdx] == chain_id[idx] &&
std::abs(index_list_b[idx] - index_list_b[jdx]) <= 5) continue;
nb_list_i[m].push_back(index_list_b[jdx]);
}
}
vector_union(nb_list_i[0], nb_list_i[1], nb_list);
int nnb = nb_list.size();
if (nnb > 0) {
int idx_s = nb_list[0];
for (int j = 0; j < nnb; j++) {
//if nodes are not continous in the sorted representation
//or represent chain ends, create a new neighbor chain
int idx_next = chain_list[index_list[nb_list[j]]][1];
if ((j == nnb - 1) || (nb_list[j] + 1 != nb_list[j+1]) ||
(idx_next == cnt_end) || (idx_next == domain_end)) {
int idx_f = nb_list[j];
array2003<int, 2> chain;
chain[0] = idx_s;
chain[1] = nb_list[j];
//make sure that segments having at least one node
//in the neighbor list are included
int idx0 = index_list[chain[0]]; // real id of the ends
int idx1 = index_list[chain[1]];
if (chain_list[idx0][0] != cnt_end &&
chain_list[idx0][0] != domain_end) chain[0] -= 1;
if (chain_list[idx1][1] != cnt_end &&
chain_list[idx1][1] != domain_end) chain[1] += 1;
if(chain[0] != chain[1]) nb_chains[i].push_back(chain);
idx_s = (j == nnb - 1) ? -1 : nb_list[j + 1];
}
}
}
nb_list.resize(0);
}
}

View File

@ -1,120 +0,0 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
Contributing author: Maxim Shugaev (UVA), mvs9t@virginia.edu
------------------------------------------------------------------------- */
#pragma once
#include "neigh_list.h"
#include "atom.h"
#include <vector>
using namespace LAMMPS_NS;
//since LAMMPS is compiled with C++ 2003, define a substitution for std::array
template<typename T, int N>
class array2003{
public:
T& operator[] (int idx){ return data[idx];};
const T& operator[] (int idx) const{ return data[idx];};
private:
T data[N];
};
class MESONTList {
public:
MESONTList(const Atom* atom, const NeighList* nblist, double rc2);
~MESONTList() {};
//list of segments
const std::vector<array2003<int,2> >& get_segments() const;
//list of triplets
const std::vector<array2003<int,3> >& get_triplets() const;
//list of neigbor chains [start,end] for segments
//(use idx() to get real indexes)
const std::vector<std::vector<array2003<int,2> > >& get_nbs() const;
//convert idx from sorted representation to real idx
int get_idx(int idx) const;
//return list of indexes for conversion from sorted representation
const std::vector<int>& get_idx_list() const;
//convert idx from real idx to sorted representation
int get_idxb(int idx) const;
//return list of indexes for conversion to sorted representation
const std::vector<int>& get_idxb_list() const;
//check if the node is the end of the tube
bool is_end(int idx) const;
array2003<int, 2> get_segment(int idx) const;
array2003<int, 3> get_triplet(int idx) const;
static const int cnt_end = -1;
static const int domain_end = -2;
static const int not_cnt = -3;
private:
std::vector<array2003<int, 2> > chain_list, segments;
std::vector<array2003<int, 3> > triplets;
std::vector<std::vector<array2003<int, 2> > > nb_chains;
std::vector<int> index_list, index_list_b;
};
//=============================================================================
inline const std::vector<std::vector<array2003<int, 2> > > &
MESONTList::get_nbs() const {
return nb_chains;
}
inline int MESONTList::get_idx(int idx) const {
return index_list[idx];
}
inline const std::vector<int>& MESONTList::get_idx_list() const {
return index_list;
};
inline int MESONTList::get_idxb(int idx) const {
return index_list_b[idx];
}
inline const std::vector<int>& MESONTList::get_idxb_list() const {
return index_list_b;
};
inline const std::vector<array2003<int, 2> > & MESONTList::get_segments()
const {
return segments;
}
inline const std::vector<array2003<int, 3> > & MESONTList::get_triplets()
const {
return triplets;
}
inline array2003<int, 2> MESONTList::get_segment(int idx) const {
array2003<int, 2> result;
result[0] = chain_list[idx][0];
result[1] = idx;
return result;
}
inline array2003<int, 3> MESONTList::get_triplet(int idx) const {
array2003<int, 3> result;
result[0] = chain_list[idx][0];
result[1] = idx;
result[2] = chain_list[idx][1];
return result;
}
inline bool MESONTList::is_end(int idx) const {
return chain_list[idx][0] == cnt_end || chain_list[idx][1] == cnt_end;
};

View File

@ -14,7 +14,6 @@
------------------------------------------------------------------------- */
#include "pair_mesont_tpm.h"
#include "mesont_list.h"
#include "export_mesont.h"
#include <mpi.h>
@ -28,14 +27,276 @@
#include "neigh_request.h"
#include <cstring>
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <fstream>
#include <sstream>
#include <algorithm>
using namespace LAMMPS_NS;
//since LAMMPS is compiled with C++ 2003, define a substitution for std::array
template<typename T, int N>
class array2003{
public:
T& operator[] (int idx){ return data[idx];};
const T& operator[] (int idx) const{ return data[idx];};
private:
T data[N];
};
class MESONTList {
public:
MESONTList(const Atom* atom, const NeighList* nblist, double rc2);
~MESONTList() {};
//list of segments
const std::vector<array2003<int,2> >& get_segments() const;
//list of triplets
const std::vector<array2003<int,3> >& get_triplets() const;
//list of neighbor chains [start,end] for segments
//(use idx() to get real indexes)
const std::vector<std::vector<array2003<int,2> > >& get_nbs() const;
//convert idx from sorted representation to real idx
int get_idx(int idx) const;
//return list of indexes for conversion from sorted representation
const std::vector<int>& get_idx_list() const;
//convert idx from real idx to sorted representation
int get_idxb(int idx) const;
//return list of indexes for conversion to sorted representation
const std::vector<int>& get_idxb_list() const;
//check if the node is the end of the tube
bool is_end(int idx) const;
array2003<int, 2> get_segment(int idx) const;
array2003<int, 3> get_triplet(int idx) const;
static const int cnt_end = -1;
static const int domain_end = -2;
static const int not_cnt = -3;
private:
std::vector<array2003<int, 2> > chain_list, segments;
std::vector<array2003<int, 3> > triplets;
std::vector<std::vector<array2003<int, 2> > > nb_chains;
std::vector<int> index_list, index_list_b;
};
//=============================================================================
inline const std::vector<std::vector<array2003<int, 2> > > &
MESONTList::get_nbs() const {
return nb_chains;
}
inline int MESONTList::get_idx(int idx) const {
return index_list[idx];
}
inline const std::vector<int>& MESONTList::get_idx_list() const {
return index_list;
};
inline int MESONTList::get_idxb(int idx) const {
return index_list_b[idx];
}
inline const std::vector<int>& MESONTList::get_idxb_list() const {
return index_list_b;
};
inline const std::vector<array2003<int, 2> > & MESONTList::get_segments()
const {
return segments;
}
inline const std::vector<array2003<int, 3> > & MESONTList::get_triplets()
const {
return triplets;
}
inline array2003<int, 2> MESONTList::get_segment(int idx) const {
array2003<int, 2> result;
result[0] = chain_list[idx][0];
result[1] = idx;
return result;
}
inline array2003<int, 3> MESONTList::get_triplet(int idx) const {
array2003<int, 3> result;
result[0] = chain_list[idx][0];
result[1] = idx;
result[2] = chain_list[idx][1];
return result;
}
inline bool MESONTList::is_end(int idx) const {
return chain_list[idx][0] == cnt_end || chain_list[idx][1] == cnt_end;
};
template<typename T>
void vector_union(std::vector<T>& v1, std::vector<T>& v2,
std::vector<T>& merged) {
std::sort(v1.begin(), v1.end());
std::sort(v2.begin(), v2.end());
merged.reserve(v1.size() + v2.size());
typename std::vector<T>::iterator it1 = v1.begin();
typename std::vector<T>::iterator it2 = v2.begin();
while (it1 != v1.end() && it2 != v2.end()) {
if (*it1 < *it2) {
if (merged.empty() || merged.back() < *it1) merged.push_back(*it1);
++it1;
}
else {
if (merged.empty() || merged.back() < *it2) merged.push_back(*it2);
++it2;
}
}
while (it1 != v1.end()) {
if (merged.empty() || merged.back() < *it1) merged.push_back(*it1);
++it1;
}
while (it2 != v2.end()) {
if (merged.empty() || merged.back() < *it2) merged.push_back(*it2);
++it2;
}
}
MESONTList::MESONTList(const Atom* atom, const NeighList* nblist, double rc2){
if (atom == NULL || nblist == NULL) return;
//number of local atoms at the node
int nlocal = atom->nlocal;
//total number of atoms in the node and ghost shell
int nall = nblist->inum + nblist->gnum;
int ntot = atom->nlocal + atom->nghost;
tagint* const g_id = atom->tag;
tagint** const bonds = atom->bond_nt;
tagint* const chain_id = atom->molecule;
int* ilist = nblist->ilist;
//convert bonds to local id representation
array2003<int, 2> tmp_arr;
tmp_arr[0] = not_cnt; tmp_arr[1] = not_cnt;
chain_list.resize(ntot, tmp_arr);
for (int ii = 0; ii < nall; ii++) {
int i = ilist[ii];
chain_list[i][0] = domain_end;
chain_list[i][1] = domain_end;
}
for (int ii = 0; ii < nall; ii++) {
int i = ilist[ii];
int nnb = nblist->numneigh[i];
for (int m = 0; m < 2; m++)
if (bonds[i][m] == cnt_end) chain_list[i][m] = cnt_end;
for (int j = 0; j < nnb; j++) {
int nb = nblist->firstneigh[i][j];
if (bonds[i][0] == g_id[nb]){
chain_list[i][0] = nb;
chain_list[nb][1] = i;
break;
}
}
}
//reorder chains: index list
//list of indexes for conversion FROM reordered representation
index_list.reserve(nall);
index_list_b.resize(ntot, -1); // convert index TO reordered representation
for (int i = 0; i < ntot; i++) {
if (chain_list[i][0] == cnt_end || chain_list[i][0] == domain_end) {
index_list.push_back(i);
index_list_b[i] = index_list.size() - 1;
int idx = i;
while (1) {
idx = chain_list[idx][1];
if (idx == cnt_end || idx == domain_end) break;
else index_list.push_back(idx);
index_list_b[idx] = index_list.size() - 1;
}
}
}
//segment list
for (int i = 0; i < nlocal; i++) {
if (chain_list[i][0] == not_cnt) continue;
if (chain_list[i][0] != cnt_end && chain_list[i][0] != domain_end &&
g_id[i] < g_id[chain_list[i][0]]){
array2003<int, 2> tmp_c;
tmp_c[0] = i; tmp_c[1] = chain_list[i][0];
segments.push_back(tmp_c);
}
if (chain_list[i][1] != cnt_end && chain_list[i][1] != domain_end &&
g_id[i] < g_id[chain_list[i][1]]){
array2003<int, 2> tmp_c;
tmp_c[0] = i; tmp_c[1] = chain_list[i][1];
segments.push_back(tmp_c);
}
}
int nbonds = segments.size();
//triplets
for (int i = 0; i < nlocal; i++){
if (chain_list[i][0] == not_cnt) continue;
if (chain_list[i][0] != cnt_end && chain_list[i][0] != domain_end &&
chain_list[i][1] != cnt_end && chain_list[i][1] != domain_end)
triplets.push_back(get_triplet(i));
}
//segment neighbor list
nb_chains.resize(nbonds);
std::vector<int> nb_list_i[2], nb_list;
for (int i = 0; i < nbonds; i++) {
//union of nb lists
for (int m = 0; m < 2; m++) {
nb_list_i[m].resize(0);
int idx = segments[i][m];
if (idx >= nlocal) continue;
int nnb = nblist->numneigh[idx];
for (int j = 0; j < nnb; j++) {
int jdx = nblist->firstneigh[idx][j];
//no self interactions for nbs within the same tube
if (chain_id[jdx] == chain_id[idx] &&
std::abs(index_list_b[idx] - index_list_b[jdx]) <= 5) continue;
nb_list_i[m].push_back(index_list_b[jdx]);
}
}
vector_union(nb_list_i[0], nb_list_i[1], nb_list);
int nnb = nb_list.size();
if (nnb > 0) {
int idx_s = nb_list[0];
for (int j = 0; j < nnb; j++) {
//if nodes are not continuous in the sorted representation
//or represent chain ends, create a new neighbor chain
int idx_next = chain_list[index_list[nb_list[j]]][1];
if ((j == nnb - 1) || (nb_list[j] + 1 != nb_list[j+1]) ||
(idx_next == cnt_end) || (idx_next == domain_end)) {
int idx_f = nb_list[j];
array2003<int, 2> chain;
chain[0] = idx_s;
chain[1] = nb_list[j];
//make sure that segments having at least one node
//in the neighbor list are included
int idx0 = index_list[chain[0]]; // real id of the ends
int idx1 = index_list[chain[1]];
if (chain_list[idx0][0] != cnt_end &&
chain_list[idx0][0] != domain_end) chain[0] -= 1;
if (chain_list[idx1][1] != cnt_end &&
chain_list[idx1][1] != domain_end) chain[1] += 1;
if(chain[0] != chain[1]) nb_chains[i].push_back(chain);
idx_s = (j == nnb - 1) ? -1 : nb_list[j + 1];
}
}
}
nb_list.resize(0);
}
}
/* ---------------------------------------------------------------------- */
// the cutoff distance between walls of tubes
static const double TPBRcutoff = 3.0*3.4;
int PairMESONTTPM::instance_count = 0;
@ -79,8 +340,9 @@ void PairMESONTTPM::compute(int eflag, int vflag){
//total number of atoms in the node and ghost shell
int nall = list->inum + list->gnum;
int ntot = atom->nlocal + atom->nghost;
int newton_pair = force->newton_pair; //check "newton command"
if(!newton_pair) error->all(FLERR,"set newton_pair");
int newton_pair = force->newton_pair;
if(!newton_pair)
error->all(FLERR,"Pair style mesont/tpm requires newton pair on");
double **x = atom->x;
double **f = atom->f;
@ -89,12 +351,30 @@ void PairMESONTTPM::compute(int eflag, int vflag){
double *l = atom->length;
int *buckling = atom->buckling;
tagint *g_id = atom->tag;
tagint **bonds = atom->bond_cnt;
tagint **bonds = atom->bond_nt;
//check if cutoff is chosen correctly
double RT = mesont_lib_get_R();
double Lmax = 0.0;
for (int ii = 0; ii < list->inum; ii++) {
int i = list->ilist[ii];
if (Lmax < l[i]) Lmax = l[i];
}
double Rcut_min = std::max(2.0*Lmax, std::sqrt(0.5*Lmax*Lmax +
std::pow((2.0*RT + TPBRcutoff),2)));
if (cut_global < Rcut_min){
std::stringstream err;
err << "The selected cutoff is too small for the current system : " <<
"L_max = " << Lmax << ", R_max = " << RT << ", Rc = " << cut_global <<
", Rcut_min = " << Rcut_min;
error->all(FLERR, err.str().c_str());
}
//generate bonds and chain nblist
MESONTList ntlist(atom, list, cut_global*cut_global);
//reorder data to make it contiguous within tubes
//and compatable with Fortran functions
//and compatible with Fortran functions
std::vector<double> x_sort(3*nall), f_sort(3*nall), s_sort(9*nall);
std::vector<double> u_ts_sort(nall), u_tb_sort(nall), u_tt_sort(nall);
std::vector<int> b_sort(nall);
@ -135,8 +415,8 @@ void PairMESONTTPM::compute(int eflag, int vflag){
//segment-segment and segment-tube interactions
int n_segments = ntlist.get_segments().size();
double Lmax = 0.0, Rmax = 0.0;
double RT = mesont_lib_get_R();
double Rmax = 0.0;
Lmax = 0.0;
for (int i = 0; i < n_segments; i++) {
const array2003<int,2>& s = ntlist.get_segments()[i];
//idx of a segment end 1 in sorted representation
@ -208,13 +488,14 @@ void PairMESONTTPM::compute(int eflag, int vflag){
}
//check if cutoff is chosen correctly
double Rcut_min = std::max(2.0*Lmax, std::sqrt(0.5*Lmax*Lmax +
Rcut_min = std::max(2.0*Lmax, std::sqrt(0.5*Lmax*Lmax +
std::pow((2.0*Rmax + TPBRcutoff),2)));
if (cut_global < Rcut_min){
std::cout << "L_max: = " << Lmax << ", R_max = " << Rmax << ", Rc = "
<< cut_global << ", Rcut_min = " << Rcut_min << std::endl;
error->all(FLERR,
"The selected cutoff is too small for the current system");
std::stringstream err;
err << "The selected cutoff is too small for the current system : " <<
"L_max = " << Lmax << ", R_max = " << RT << ", Rc = " << cut_global <<
", Rcut_min = " << Rcut_min;
error->all(FLERR, err.str().c_str());
}
// set per atom values and accumulators

View File

@ -66,9 +66,9 @@ class PairMESONTTPM : public Pair {
/* ERROR/WARNING messages:
E: set newton_pair
E: Pair style mesont/tpm requires newton pair on
newton_pair must be set to true
newton_pair must be set to on
E: The selected cutoff is too small for the current system

View File

@ -109,10 +109,11 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
edpd_temp = edpd_flux = edpd_cv = NULL;
// USER-MESONT package
mesont_flag = 0;
length = NULL;
buckling = NULL;
bond_cnt = NULL;
bond_nt = NULL;
// USER-SMD
@ -377,9 +378,10 @@ Atom::~Atom()
memory->sfree(molecules);
// USER-MESONT package
memory->destroy(length);
memory->destroy(buckling);
memory->destroy(bond_cnt);
memory->destroy(bond_nt);
// delete per-type arrays
@ -984,23 +986,16 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset,
error->all(FLERR,"Incorrect atom format in data file");
}
int imx = 0;
int imy = 0;
int imz = 0;
if (imageflag) {
imx = utils::inumeric(FLERR,values[iptr],false,lmp);
imy = utils::inumeric(FLERR,values[iptr+1],false,lmp);
imz = utils::inumeric(FLERR,values[iptr+2],false,lmp);
if ((domain->dimension == 2) && (imz != 0))
error->all(FLERR,"Z-direction image flag must be 0 for 2d-systems");
}
imagedata = ((imageint) (imx + IMGMAX) & IMGMASK) |
(((imageint) (imy + IMGMAX) & IMGMASK) << IMGBITS) |
(((imageint) (imz + IMGMAX) & IMGMASK) << IMG2BITS);
if (imageflag)
imagedata = ((imageint) (atoi(values[iptr]) + IMGMAX) & IMGMASK) |
(((imageint) (atoi(values[iptr+1]) + IMGMAX) & IMGMASK) << IMGBITS) |
(((imageint) (atoi(values[iptr+2]) + IMGMAX) & IMGMASK) << IMG2BITS);
else imagedata = ((imageint) IMGMAX << IMG2BITS) |
((imageint) IMGMAX << IMGBITS) | IMGMAX;
xdata[0] = utils::numeric(FLERR,values[xptr],false,lmp);
xdata[1] = utils::numeric(FLERR,values[xptr+1],false,lmp);
xdata[2] = utils::numeric(FLERR,values[xptr+2],false,lmp);
xdata[0] = atof(values[xptr]);
xdata[1] = atof(values[xptr+1]);
xdata[2] = atof(values[xptr+2]);
if (shiftflag) {
xdata[0] += shift[0];
xdata[1] += shift[1];
@ -2308,7 +2303,7 @@ void *Atom::extract(char *name)
// USER-MESONT package
if (strcmp(name,"length") == 0) return (void *) length;
if (strcmp(name,"buckling") == 0) return (void *) buckling;
if (strcmp(name,"bond_cnt") == 0) return (void *) bond_cnt;
if (strcmp(name,"bond_nt") == 0) return (void *) bond_nt;
return NULL;
}

View File

@ -114,7 +114,7 @@ class Atom : protected Pointers {
// USER-MESONT package
double *length;
int *buckling;
tagint **bond_cnt;
tagint **bond_nt;
// molecular info
@ -160,6 +160,7 @@ class Atom : protected Pointers {
int cs_flag,csforce_flag,vforce_flag,ervelforce_flag,etag_flag;
int rho_flag,e_flag,cv_flag,vest_flag;
int dpd_flag,edpd_flag,tdpd_flag;
int mesont_flag;
//USER-SPIN package

View File

@ -375,7 +375,12 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Compute property/atom floating point "
"vector does not exist");
pack_choice[i] = &ComputePropertyAtom::pack_dname;
}
else if (strcmp(arg[iarg],"buckling") == 0) {
if (!atom->mesont_flag)
error->all(FLERR,"Compute property/atom for "
"atom property that isn't allocated");
pack_choice[i] = &ComputePropertyAtom::pack_buckling;
// check if atom style recognizes keyword
} else {
@ -1774,6 +1779,21 @@ void ComputePropertyAtom::pack_corner3z(int n)
/* ---------------------------------------------------------------------- */
void ComputePropertyAtom::pack_buckling(int n)
{
int *buckling = atom->buckling;
int *mask = atom->mask;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) buf[n] = static_cast<double>(buckling[i]);
else buf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void ComputePropertyAtom::pack_nbonds(int n)
{
int *num_bond = atom->num_bond;

View File

@ -125,6 +125,7 @@ class ComputePropertyAtom : public Compute {
void pack_corner3x(int);
void pack_corner3y(int);
void pack_corner3z(int);
void pack_buckling(int);
void pack_nbonds(int);