Commit daf95056 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3620 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent c1846571
Loading
Loading
Loading
Loading
+2 −41
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
</H3>
<P><B>Syntax:</B>
</P>
<PRE>compute ID group-ID style arg mode input1 input2 ... keyword args ... 
<PRE>compute ID group-ID style arg mode input1 input2 ... 
</PRE>
<UL><LI>ID, group-ID are documented in <A HREF = "compute.html">compute</A> command 

@@ -38,14 +38,6 @@
  f_ID[I] = Ith column of array calculated by a fix with ID
  v_name = per-atom vector calculated by an atom-style variable with name 
</PRE>
<LI>zero or more keyword/args pairs may be appended 

<LI>keyword = <I>replace</I> 

<PRE>  <I>replace</I> args = vec1 vec2
    vec1 = reduced value from this input vector will be replaced
    vec2 = replace it with vec1[N] where N is index of max/min value from vec2 
</PRE>

</UL>
<P><B>Examples:</B>
@@ -53,7 +45,6 @@
<PRE>compute 1 all reduce sum c_force
compute 1 all reduce/region subbox sum c_force
compute 2 all reduce min c_press<B>2</B> f_ave v_myKE 
compute 3 fluid reduce max c_index<B>1</B> c_index<B>2</B> c_dist replace 1 3 replace 2 3 
</PRE>
<P><B>Description:</B>
</P>
@@ -119,36 +110,6 @@ invoke other computes, fixes, or variables when they are evaluated, so
this is a very general means of generating per-atom quantities to
reduce.
</P>
<HR>

<P>If the <I>replace</I> keyword is used, two indices <I>vec1</I> and <I>vec2</I> are
specified, where each index ranges from 1 to the # of input values.
The replace keyword can only be used if the <I>mode</I> is <I>min</I> or <I>max</I>.
It works as follows.  A min/max is computed as usual on the <I>vec2</I>
input vector.  The index N of that value within <I>vec2</I> is also stored.
Then, instead of performing a min/max on the <I>vec1</I> input vector, the
stored index is used to select the Nth element of the <I>vec1</I> vector.
</P>
<P>Thus, for example, if you wish to use this compute to find the bond
with maximum stretch, you can do it as follows:
</P>
<PRE>compute 1 all property/local batom1 batom2
compute	2 all bond/local dist
compute	3 all reduce max c_1[1] c_1[2] c_2 replace 1 3 replace 2 3
thermo_style custom step temp c_3[1] c_3[2] c_3[3] 
</PRE>
<P>The first two input values in the compute reduce command are vectors
with the IDs of the 2 atoms in each bond, using the <A HREF = "compute_property_local.html">compute
property/local</A> command.  The last input
value is bond distance, using the <A HREF = "compute_bond_local.html">compute
bond/local</A> command.  Instead of taking the
max of the two atom ID vectors, which does not yield useful
information in this context, the <I>replace</I> keywords will extract the
atom IDs for the two atoms in the bond of maximum stretch.  These atom
IDs and the bond stretch will be printed with thermodynamic output.
</P>
<HR>

<P>If a single input is specified this compute produces a global scalar
value.  If multiple inputs are specified, this compute produces a
vector of global values, the length of which is equal to the number of
+2 −39
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ compute reduce/region command :h3

[Syntax:]

compute ID group-ID style arg mode input1 input2 ... keyword args ... :pre
compute ID group-ID style arg mode input1 input2 ... :pre

ID, group-ID are documented in "compute"_compute.html command :ulb,l
style = {reduce} or {reduce/region} :l
@@ -27,20 +27,13 @@ input = x, y, z, vx, vy, vz, fx, fy, fz, c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_nam
  f_ID = vector calculated by a fix with ID
  f_ID\[I\] = Ith column of array calculated by a fix with ID
  v_name = per-atom vector calculated by an atom-style variable with name :pre

zero or more keyword/args pairs may be appended :l
keyword = {replace} :l
  {replace} args = vec1 vec2
    vec1 = reduced value from this input vector will be replaced
    vec2 = replace it with vec1\[N\] where N is index of max/min value from vec2 :pre
:ule

[Examples:]

compute 1 all reduce sum c_force
compute 1 all reduce/region subbox sum c_force
compute 2 all reduce min c_press[2] f_ave v_myKE
compute 3 fluid reduce max c_index[1] c_index[2] c_dist replace 1 3 replace 2 3 :pre
compute 2 all reduce min c_press[2] f_ave v_myKE :pre

[Description:]

@@ -106,36 +99,6 @@ invoke other computes, fixes, or variables when they are evaluated, so
this is a very general means of generating per-atom quantities to
reduce.

:line

If the {replace} keyword is used, two indices {vec1} and {vec2} are
specified, where each index ranges from 1 to the # of input values.
The replace keyword can only be used if the {mode} is {min} or {max}.
It works as follows.  A min/max is computed as usual on the {vec2}
input vector.  The index N of that value within {vec2} is also stored.
Then, instead of performing a min/max on the {vec1} input vector, the
stored index is used to select the Nth element of the {vec1} vector.

Thus, for example, if you wish to use this compute to find the bond
with maximum stretch, you can do it as follows:

compute 1 all property/local batom1 batom2
compute	2 all bond/local dist
compute	3 all reduce max c_1\[1\] c_1\[2\] c_2 replace 1 3 replace 2 3
thermo_style custom step temp c_3\[1\] c_3\[2\] c_3\[3\] :pre

The first two input values in the compute reduce command are vectors
with the IDs of the 2 atoms in each bond, using the "compute
property/local"_compute_property_local.html command.  The last input
value is bond distance, using the "compute
bond/local"_compute_bond_local.html command.  Instead of taking the
max of the two atom ID vectors, which does not yield useful
information in this context, the {replace} keywords will extract the
atom IDs for the two atoms in the bond of maximum stretch.  These atom
IDs and the bond stretch will be printed with thermodynamic output.

:line

If a single input is specified this compute produces a global scalar
value.  If multiple inputs are specified, this compute produces a
vector of global values, the length of which is equal to the number of