Unverified Commit 3ce020ea authored by Richard Berger's avatar Richard Berger Committed by GitHub
Browse files

Merge pull request #1779 from athomps/compute-snap

Compute snap
parents 3611a75c a171efa1
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -49,19 +49,19 @@ KOKKOS, o = USER-OMP, t = OPT.
+------------------------------------------------------------+--------------------------------------------------------+------------------------------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------------+
| :doc:`smd/tlsph/num/neighs <compute_smd_tlsph_num_neighs>` | :doc:`smd/tlsph/shape <compute_smd_tlsph_shape>`       | :doc:`smd/tlsph/strain <compute_smd_tlsph_strain>`               | :doc:`smd/tlsph/strain/rate <compute_smd_tlsph_strain_rate>` | :doc:`smd/tlsph/stress <compute_smd_tlsph_stress>`       | :doc:`smd/triangle/vertices <compute_smd_triangle_vertices>` |
+------------------------------------------------------------+--------------------------------------------------------+------------------------------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------------+
| :doc:`smd/ulsph/num/neighs <compute_smd_ulsph_num_neighs>` | :doc:`smd/ulsph/strain <compute_smd_ulsph_strain>`     | :doc:`smd/ulsph/strain/rate <compute_smd_ulsph_strain_rate>`     | :doc:`smd/ulsph/stress <compute_smd_ulsph_stress>`           | :doc:`smd/vol <compute_smd_vol>`                         | :doc:`sna/atom <compute_sna_atom>`                           |
| :doc:`smd/ulsph/num/neighs <compute_smd_ulsph_num_neighs>` | :doc:`smd/ulsph/strain <compute_smd_ulsph_strain>`     | :doc:`smd/ulsph/strain/rate <compute_smd_ulsph_strain_rate>`     | :doc:`smd/ulsph/stress <compute_smd_ulsph_stress>`           | :doc:`smd/vol <compute_smd_vol>`                         | :doc:`snap <compute_sna_atom>`                               |
+------------------------------------------------------------+--------------------------------------------------------+------------------------------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------------+
| :doc:`snad/atom <compute_sna_atom>`                        | :doc:`snav/atom <compute_sna_atom>`                    | :doc:`spin <compute_spin>`                                       | :doc:`stress/atom <compute_stress_atom>`                     | :doc:`stress/mop <compute_stress_mop>`                   | :doc:`stress/mop/profile <compute_stress_mop>`               |
| :doc:`sna/atom <compute_sna_atom>`                         | :doc:`snad/atom <compute_sna_atom>`                    | :doc:`snav/atom <compute_sna_atom>`                              | :doc:`spin <compute_spin>`                                   | :doc:`stress/atom <compute_stress_atom>`                 | :doc:`stress/mop <compute_stress_mop>`                       |
+------------------------------------------------------------+--------------------------------------------------------+------------------------------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------------+
| :doc:`stress/tally <compute_tally>`                        | :doc:`tdpd/cc/atom <compute_tdpd_cc_atom>`             | :doc:`temp (k) <compute_temp>`                                   | :doc:`temp/asphere <compute_temp_asphere>`                   | :doc:`temp/body <compute_temp_body>`                     | :doc:`temp/chunk <compute_temp_chunk>`                       |
| :doc:`stress/mop/profile <compute_stress_mop>`             | :doc:`stress/tally <compute_tally>`                    | :doc:`tdpd/cc/atom <compute_tdpd_cc_atom>`                       | :doc:`temp (k) <compute_temp>`                               | :doc:`temp/asphere <compute_temp_asphere>`               | :doc:`temp/body <compute_temp_body>`                         |
+------------------------------------------------------------+--------------------------------------------------------+------------------------------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------------+
| :doc:`temp/com <compute_temp_com>`                         | :doc:`temp/cs <compute_temp_cs>`                       | :doc:`temp/deform <compute_temp_deform>`                         | :doc:`temp/deform/eff <compute_temp_deform_eff>`             | :doc:`temp/drude <compute_temp_drude>`                   | :doc:`temp/eff <compute_temp_eff>`                           |
| :doc:`temp/chunk <compute_temp_chunk>`                     | :doc:`temp/com <compute_temp_com>`                     | :doc:`temp/cs <compute_temp_cs>`                                 | :doc:`temp/deform <compute_temp_deform>`                     | :doc:`temp/deform/eff <compute_temp_deform_eff>`         | :doc:`temp/drude <compute_temp_drude>`                       |
+------------------------------------------------------------+--------------------------------------------------------+------------------------------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------------+
| :doc:`temp/partial <compute_temp_partial>`                 | :doc:`temp/profile <compute_temp_profile>`             | :doc:`temp/ramp <compute_temp_ramp>`                             | :doc:`temp/region <compute_temp_region>`                     | :doc:`temp/region/eff <compute_temp_region_eff>`         | :doc:`temp/rotate <compute_temp_rotate>`                     |
| :doc:`temp/eff <compute_temp_eff>`                         | :doc:`temp/partial <compute_temp_partial>`             | :doc:`temp/profile <compute_temp_profile>`                       | :doc:`temp/ramp <compute_temp_ramp>`                         | :doc:`temp/region <compute_temp_region>`                 | :doc:`temp/region/eff <compute_temp_region_eff>`             |
+------------------------------------------------------------+--------------------------------------------------------+------------------------------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------------+
| :doc:`temp/sphere <compute_temp_sphere>`                   | :doc:`temp/uef <compute_temp_uef>`                     | :doc:`ti <compute_ti>`                                           | :doc:`torque/chunk <compute_torque_chunk>`                   | :doc:`vacf <compute_vacf>`                               | :doc:`vcm/chunk <compute_vcm_chunk>`                         |
| :doc:`temp/rotate <compute_temp_rotate>`                   | :doc:`temp/sphere <compute_temp_sphere>`               | :doc:`temp/uef <compute_temp_uef>`                               | :doc:`ti <compute_ti>`                                       | :doc:`torque/chunk <compute_torque_chunk>`               | :doc:`vacf <compute_vacf>`                                   |
+------------------------------------------------------------+--------------------------------------------------------+------------------------------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------------+
| :doc:`voronoi/atom <compute_voronoi_atom>`                 | :doc:`xrd <compute_xrd>`                               |                                                                  |                                                              |                                                          |                                                              |
| :doc:`vcm/chunk <compute_vcm_chunk>`                       | :doc:`voronoi/atom <compute_voronoi_atom>`             | :doc:`xrd <compute_xrd>`                                         |                                                              |                                                          |                                                              |
+------------------------------------------------------------+--------------------------------------------------------+------------------------------------------------------------------+--------------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------------+


+4 −3
Original line number Diff line number Diff line
@@ -287,9 +287,10 @@ The individual style names on the :doc:`Commands compute <Commands_compute>` doc
* :doc:`smd/ulsph/strain/rate <compute_smd_ulsph_strain_rate>` -
* :doc:`smd/ulsph/stress <compute_smd_ulsph_stress>` - per-particle Cauchy stress tensor and von Mises equivalent stress in Smooth Mach Dynamics
* :doc:`smd/vol <compute_smd_vol>` - per-particle volumes and their sum in Smooth Mach Dynamics
* :doc:`sna/atom <compute_sna_atom>` - calculate bispectrum coefficients for each atom
* :doc:`snad/atom <compute_sna_atom>` - derivative of bispectrum coefficients for each atom
* :doc:`snav/atom <compute_sna_atom>` - virial contribution from bispectrum coefficients for each atom
* :doc:`snap <compute_sna_atom>` - bispectrum components and related quantities for a group of atoms
* :doc:`sna/atom <compute_sna_atom>` - bispectrum components for each atom
* :doc:`snad/atom <compute_sna_atom>` - derivative of bispectrum components for each atom
* :doc:`snav/atom <compute_sna_atom>` - virial contribution from bispectrum components for each atom
* :doc:`spin <compute_spin>` - magnetic quantities for a system of atoms having spins
* :doc:`stress/atom <compute_stress_atom>` - stress tensor for each atom
* :doc:`stress/mop <compute_stress_mop>` - normal components of the local stress tensor using the method of planes
+51 −3
Original line number Diff line number Diff line
@@ -9,6 +9,9 @@ compute snad/atom command
compute snav/atom command
=========================

compute snap command
====================

Syntax
""""""

@@ -18,6 +21,7 @@ Syntax
   compute ID group-ID sna/atom rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ...
   compute ID group-ID snad/atom rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ...
   compute ID group-ID snav/atom rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ... 
   compute ID group-ID snap rcutfac rfac0 twojmax R_1 R_2 ... w_1 w_2 ... keyword values ...

* ID, group-ID are documented in :doc:`compute <compute>` command
* sna/atom = style name of this compute command
@@ -53,12 +57,17 @@ Examples
   compute b all sna/atom 1.4 0.99363 6 2.0 2.4 0.75 1.0 rmin0 0.0
   compute db all sna/atom 1.4 0.95 6 2.0 1.0
   compute vb all sna/atom 1.4 0.95 6 2.0 1.0
   compute snap all snap 1.4 0.95 6 2.0 1.0

Description
"""""""""""

Define a computation that calculates a set of bispectrum components
for each atom in a group.
Define a computation that calculates a set of quantities related to the
bispectrum components of the atoms in a group. These computes are
used primarily for calculating the dependence of energy, force, and
stress components on the linear coefficients in the 
:doc:`snap pair\_style <pair_snap>`, which is useful when training a
SNAP potential to match target data.

Bispectrum components of an atom are order parameters characterizing
the radial and angular distribution of neighbor atoms. The detailed
@@ -148,6 +157,30 @@ Again, the sum is over all atoms *i'* of atom type *I*\ . For each atom
virial components, each atom type, and each bispectrum component.  See
section below on output for a detailed explanation.

Compute *snap* calculates a global array contains information related
to all three of the above per-atom computes *sna/atom*\ , *snad/atom*\ ,
and *snav/atom*\ . The first row of the array contains the summation of 
*sna/atom* over all atoms, but broken out by type. The last six rows
of the array contain the summation of *snav/atom* over all atoms, broken
out by type. In between these are 3\*\ *N* rows containing the same values
computed by *snad/atom* (these are already summed over all atoms and
broken out by type). The element in the last column of each row contains
the potential energy, force, or stress, according to the row.
These quantities correspond to the user-specified reference potential
that must be subtracted from the target data when fitting SNAP.
The potential energy calculation uses the built in compute *thermo\_pe*.
The stress calculation uses a compute called *snap\_press* that is
automatically created behind the scenes, according to the following
command:


.. parsed-literal::

   compute snap_press all pressure NULL virial

See section below on output for a detailed explanation of the data
layout in the global array.

The value of all bispectrum components will be zero for atoms not in
the group. Neighbor atoms not in the group do not contribute to the
bispectrum of atoms in the group.
@@ -239,10 +272,25 @@ block contains six sub-blocks corresponding to the *xx*\ , *yy*\ , *zz*\ ,
notation.  Each of these sub-blocks contains one column for each
bispectrum component, the same as for compute *sna/atom*

Compute *snap* evaluates a global array. 
The columns are arranged into
*ntypes* blocks, listed in order of atom type *I*\ . Each block
contains one column for each bispectrum component, the same as for compute
*sna/atom*\ . A final column contains the corresponding energy, force component
on an atom, or virial stress component. The rows of the array appear 
in the following order:

* 1 row: *sna/atom* quantities summed for all atoms of type *I*
* 3\*\ *N* rows: *snad/atom* quantities, with derivatives w.r.t. x, y, and z coordinate of atom *i* appearing in consecutive rows. The atoms are sorted based on atom ID.
* 6 rows: *snav/atom* quantities summed for all atoms of type *I*

For example, if *K* =30 and ntypes=1, the number of columns in the per-atom
arrays generated by *sna/atom*\ , *snad/atom*\ , and *snav/atom*
are 30, 90, and 180, respectively. With *quadratic* value=1,
the numbers of columns are 930, 2790, and 5580, respectively.
The number of columns in the global array generated by *snap*
are 31, and 931, respectively, while the number of rows is
1+3\*\ *N*\ +6, where *N* is the total number of atoms.

If the *quadratic* keyword value is set to 1, then additional
columns are generated, corresponding to
+1 −0
Original line number Diff line number Diff line
@@ -131,6 +131,7 @@ KOKKOS, o = USER-OMP, t = OPT.
"smd/ulsph/strain/rate"_compute_smd_ulsph_strain_rate.html,
"smd/ulsph/stress"_compute_smd_ulsph_stress.html,
"smd/vol"_compute_smd_vol.html,
"snap"_compute_sna_atom.html,
"sna/atom"_compute_sna_atom.html,
"snad/atom"_compute_sna_atom.html,
"snav/atom"_compute_sna_atom.html,
+4 −3
Original line number Diff line number Diff line
@@ -278,9 +278,10 @@ compute"_Commands_compute.html doc page are followed by one or more of
"smd/ulsph/strain/rate"_compute_smd_ulsph_strain_rate.html -
"smd/ulsph/stress"_compute_smd_ulsph_stress.html - per-particle Cauchy stress tensor and von Mises equivalent stress in Smooth Mach Dynamics
"smd/vol"_compute_smd_vol.html - per-particle volumes and their sum in Smooth Mach Dynamics
"sna/atom"_compute_sna_atom.html - calculate bispectrum coefficients for each atom
"snad/atom"_compute_sna_atom.html - derivative of bispectrum coefficients for each atom
"snav/atom"_compute_sna_atom.html - virial contribution from bispectrum coefficients for each atom
"snap"_compute_sna_atom.html - bispectrum components and related quantities for a group of atoms
"sna/atom"_compute_sna_atom.html - bispectrum components for each atom
"snad/atom"_compute_sna_atom.html - derivative of bispectrum components for each atom
"snav/atom"_compute_sna_atom.html - virial contribution from bispectrum components for each atom
"spin"_compute_spin.html - magnetic quantities for a system of atoms having spins
"stress/atom"_compute_stress_atom.html - stress tensor for each atom
"stress/mop"_compute_stress_mop.html - normal components of the local stress tensor using the method of planes
Loading