git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@16053 f3b2605a-c512-4ea7-a41b...
[lammps.git] / doc / src / compute_dipole_chunk.txt
blob75131ffbb113ad75802e88afb59c36f07f160ab5
1 "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
3 :link(lws,http://lammps.sandia.gov)
4 :link(ld,Manual.html)
5 :link(lc,Section_commands.html#comm)
7 :line
9 compute dipole/chunk command :h3
11 [Syntax:]
13 compute ID group-ID dipole/chunk chunkID charge-correction :pre
15 ID, group-ID are documented in "compute"_compute.html command
16 dipole/chunk = style name of this compute command
17 chunkID = ID of "compute chunk/atom"_compute_chunk_atom.html command
18 charge-correction = {mass} or {geometry}, use COM or geometric center for charged chunk correction (optional) :ul
20 [Examples:]
22 compute 1 fluid dipole/chunk molchunk
23 compute dw water dipole/chunk 1 geometry :pre
25 [Description:]
27 Define a computation that calculates the dipole vector and total dipole
28 for multiple chunks of atoms.
30 In LAMMPS, chunks are collections of atoms defined by a "compute
31 chunk/atom"_compute_chunk_atom.html command, which assigns each atom
32 to a single chunk (or no chunk).  The ID for this command is specified
33 as chunkID.  For example, a single chunk could be the atoms in a
34 molecule or atoms in a spatial bin.  See the "compute
35 chunk/atom"_compute_chunk_atom.html doc page and "Section
36 6.23"_Section_howto.html#howto_23 for details of how chunks can be
37 defined and examples of how they can be used to measure properties of
38 a system.
40 This compute calculates the x,y,z coordinates of the dipole vector
41 and the total dipole moment for each chunk, which includes all effects
42 due to atoms passing thru periodic boundaries. For chunks with a net
43 charge the resulting dipole is made position independent by subtracting
44 the position vector of the center of mass or geometric center times the
45 net charge from the computed dipole vector.
47 Note that only atoms in the specified group contribute to the
48 calculation.  The "compute chunk/atom"_compute_chunk_atom.html command
49 defines its own group; atoms will have a chunk ID = 0 if they are not
50 in that group, signifying they are not assigned to a chunk, and will
51 thus also not contribute to this calculation.  You can specify the
52 "all" group for this command if you simply want to include atoms with
53 non-zero chunk IDs.
55 NOTE: The coordinates of an atom contribute to the chunk's
56 dipole in "unwrapped" form, by using the image flags
57 associated with each atom.  See the "dump custom"_dump.html command
58 for a discussion of "unwrapped" coordinates.  See the Atoms section of
59 the "read_data"_read_data.html command for a discussion of image flags
60 and how they are set for each atom.  You can reset the image flags
61 (e.g. to 0) before invoking this compute by using the "set
62 image"_set.html command.
64 The simplest way to output the results of the compute com/chunk
65 calculation to a file is to use the "fix ave/time"_fix_ave_time.html
66 command, for example:
68 compute cc1 all chunk/atom molecule
69 compute myChunk all dipole/chunk cc1
70 fix 1 all ave/time 100 1 100 c_myChunk\[*\] file tmp.out mode vector :pre
72 [Output info:]
74 This compute calculates a global array where the number of rows = the
75 number of chunks {Nchunk} as calculated by the specified "compute
76 chunk/atom"_compute_chunk_atom.html command.  The number of columns =
77 4 for the x,y,z dipole vector components and the total dipole of each
78 chunk. These values can be accessed by any command that uses global
79 array values from a compute as input.  See "Section
80 6.15"_Section_howto.html#howto_15 for an overview of LAMMPS output
81 options.
83 The array values are "intensive".  The array values will be in
84 dipole units, i.e. charge units times distance "units"_units.html.
86 [Restrictions:] none
88 [Related commands:]
90 "compute com/chunk"_compute_com_chunk.html
92 [Default:] none