1 "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
3 :link(lws,http://lammps.sandia.gov)
5 :link(lc,Section_commands.html#comm)
9 compute slice command :h3
13 compute ID group-ID slice Nstart Nstop Nskip input1 input2 ... :pre
15 ID, group-ID are documented in "compute"_compute.html command :ulb,l
16 slice = style name of this compute command :l
17 Nstart = starting index within input vector(s) :l
18 Nstop = stopping index within input vector(s) :l
19 Nskip = extract every Nskip elements from input vector(s) :l
20 input = c_ID, c_ID\[N\], f_ID, f_ID\[N\] :l
21 c_ID = global vector calculated by a compute with ID
22 c_ID\[I\] = Ith column of global array calculated by a compute with ID
23 f_ID = global vector calculated by a fix with ID
24 f_ID\[I\] = Ith column of global array calculated by a fix with ID
25 v_name = vector calculated by an vector-style variable with name :pre
30 compute 1 all slice 1 100 10 c_msdmol\[4\]
31 compute 1 all slice 301 400 1 c_msdmol\[4\] v_myVec :pre
35 Define a calculation that "slices" one or more vector inputs into
36 smaller vectors, one per listed input. The inputs can be global
37 quantities; they cannot be per-atom or local quantities.
38 "Computes"_compute.html and "fixes"_fix.html and vector-style
39 "variables"_variable.html can generate such global quantities. The
40 group specified with this command is ignored.
42 The values extracted from the input vector(s) are determined by the
43 {Nstart}, {Nstop}, and {Nskip} parameters. The elements of an input
44 vector of length N are indexed from 1 to N. Starting at element
45 {Nstart}, every Mth element is extracted, where M = {Nskip}, until
46 element {Nstop} is reached. The extracted quantities are stored as a
47 vector, which is typically shorter than the input vector.
49 Each listed input is operated on independently to produce one output
50 vector. Each listed input must be a global vector or column of a
51 global array calculated by another "compute"_compute.html or
54 If an input value begins with "c_", a compute ID must follow which has
55 been previously defined in the input script and which generates a
56 global vector or array. See the individual "compute"_compute.html doc
57 page for details. If no bracketed integer is appended, the vector
58 calculated by the compute is used. If a bracketed integer is
59 appended, the Ith column of the array calculated by the compute is
60 used. Users can also write code for their own compute styles and "add
61 them to LAMMPS"_Section_modify.html.
63 If a value begins with "f_", a fix ID must follow which has been
64 previously defined in the input script and which generates a global
65 vector or array. See the individual "fix"_fix.html doc page for
66 details. Note that some fixes only produce their values on certain
67 timesteps, which must be compatible with when compute slice references
68 the values, else an error results. If no bracketed integer is
69 appended, the vector calculated by the fix is used. If a bracketed
70 integer is appended, the Ith column of the array calculated by the fix
71 is used. Users can also write code for their own fix style and "add
72 them to LAMMPS"_Section_modify.html.
74 If an input value begins with "v_", a variable name must follow which
75 has been previously defined in the input script. Only vector-style
76 variables can be referenced. See the "variable"_variable.html command
77 for details. Note that variables of style {vector} define a formula
78 which can reference individual atom properties or thermodynamic
79 keywords, or they can invoke other computes, fixes, or variables when
80 they are evaluated, so this is a very general means of specifying
83 If a single input is specified this compute produces a global vector,
84 even if the length of the vector is 1. If multiple inputs are
85 specified, then a global array of values is produced, with the number
86 of columns equal to the number of inputs specified.
92 This compute calculates a global vector if a single input value is
93 specified or a global array with N columns where N is the number of
94 inputs. The length of the vector or the number of rows in the array
95 is equal to the number of values extracted from each input vector.
96 These values can be used by any command that uses global vector or
97 array values from a compute as input. See "this
98 section"_Section_howto.html#howto_15 for an overview of LAMMPS output
101 The vector or array values calculated by this compute are simply
102 copies of values generated by computes or fixes or variables that are
103 input vectors to this compute. If there is a single input vector of
104 intensive and/or extensive values, then each value in the vector of
105 values calculated by this compute will be "intensive" or "extensive",
106 depending on the corresponding input value. If there are multiple
107 input vectors, and all the values in them are intensive, then the
108 array values calculated by this compute are "intensive". If there are
109 multiple input vectors, and any value in them is extensive, then the
110 array values calculated by this compute are "extensive". Values
111 produced by a variable are treated as intensive.
113 The vector or array values will be in whatever "units"_units.html the
114 input quantities are in.
120 "compute"_compute.html, "fix"_fix.html, "compute
121 reduce"_compute_reduce.html