[lammps-users] Bugs (?) in region and temp/region command.

Hello,

1> Request:

If one reads data from an input file:
read_data data_file

-and then uses the region command:
region ID intersect N region_id_1 … region_id_N

One needs to append “units box”
region ID intersect N region_id_1 … region_id_N units box

else, one gets an error:
Use of region with undefined lattice

Though its no hassle, if this error is not popped by LAMMPS, it would be nice. :o)

2> Doubt:

If one uses:
compute compute_id group_id temp/region region_id

-and then prints the temperature via thermo modify,
the value of the temperature printed is what one would get using:

3/2 * (N-1) * kB * T = Sum( KE_of_atoms_in_group )

(So if a group contains only one atom, the temperature printed out would be 0)
I have checked this by dumping the values of velocity of atoms
in a particular region using dump_modify.

Is this by design? If so why?

Thanks in advance for your inputs.

Cheers!
Mario

Answers below.

Steve

Hello,

1> Request:

If one reads data from an input file:
read_data data_file

-and then uses the region command:
region ID intersect N region_id_1 ... region_id_N

One needs to append "units box"
region ID intersect N region_id_1 ... region_id_N units box

else, one gets an error:
Use of region with undefined lattice

Though its no hassle, if this error is not popped by LAMMPS, it would be
nice. :o)

Not sure what you mean. LAMMPS is giving you an error. If you
don't define a lattice via the lattice command first, you can't use the
region command with units = lattice (the default).

2> Doubt:

If one uses:
compute compute_id group_id temp/region region_id

-and then prints the temperature via thermo modify,
the value of the temperature printed is what one would get using:

3/2 * (N-1) * kB * T = Sum( KE_of_atoms_in_group )

(So if a group contains only one atom, the temperature printed out would be
0)
I have checked this by dumping the values of velocity of atoms
in a particular region using dump_modify.

Is this by design? If so why?

If you are asking why the N-1 instead of N, this is a standard way to
compute T in stat mech books (albeit for large N). You subtract 3
degrees-of-freedom for the center-of-mass motion of the collection of
atoms. This is discussed on the compute_modify extra doc page.
You can change the setting of 3 to 0 or whatever you want with
that command.

Thanks Steve for your inputs.

Warm Regards,
Mario