rotate region problem

in windows version lammps

next code for 2d simulation

sorry, but i don't get what you are asking.
can you try to reformulate your problem?

thanks,
     axel.

ok, i try rotate region. but its not working. Value of variable do not affect on result. Аs if the rotation angle is set somewhere and does not change.

and i found a reason: in next code - variable "a" is affect on rotation angle, but not "f" as i expect.

variable a equal 5
units metal
dimension 2
boundary m m p
atom_style atomic

lattice hex 2.80
region box block -500 500 -1000 1000 -1 1 units box
create_box 2 box

variable f equal 0
region t block -500 500 -25 0 -1 1 units box rotate v_f -500 -25 0 0 0 1
create_atoms 1 region t

Аs if the rotation angle is set somewhere and does not change.

You didn't specify a variable that is time dependent. You just
specified a constant, so it doesn't change with time. See
the region doc page for details.

Steve

yes i do, i need once rotate, but in command i use variable "f" value, but really it set а variable "a" value. So if i change f - nothing change.

How would you know if a region rotated?
A region has nothing to do with atoms,
it's just a geometric region of volume.
If you want to rotate atoms you need
to use fix move or displace_atoms.

Steve

mmm, i know by visualization
in that script, variable "a" is affect on initial state, variable "f" is not affect. I think it should not be so. Variable "a" is not using in commands.

  variable a equal 5
  units metal
  dimension 2
  boundary m m p
  atom_style atomic

  lattice hex 2.80
  region box block -500 500 -1000 1000 -1 1 units box
  create_box 2 box

  variable f equal 0
  region t block -500 500 -25 0 -1 1 units box rotate v_f -500 -25 0 0 0 1
  create_atoms 1 region t
  pair_style eam/alloy
  pair_coeff * * FeFe.set Fe Fe
  fix 1 all nve
  dump 1 all atom 100 x.lammpstrj
  run 1

mmm, i know by visualization
in that script, variable "a" is affect on initial state, variable "f" is not affect. I think it should not be so. Variable "a" is not using in commands.

you are not making much sense here.
how can you learn anything about variable "a"
from dumping the coordinates, if it is not used
anywhere.

similarly f is set to 0, so the region is not rotated.

it seems that you are making some assumptions
about variables and regions that are not supported
by the documentation and implementation.

axel.

see attached log and result visualization. Region was rotate to 5 radians with "f"=0. but "a"=5 is not using in script.

log.lammps (1.45 KB)

x.jpg

thanks. this is a description that i can follow.
it looks like the variable initialization for the
region command is only done at the beginning
of a run. so you basically get the content of a
random variable, most often the very first one
that was defined. please try the following patch.

axel.

diff --git a/src/region.cpp b/src/region.cpp
index 9ce1d9f..7ab086a 100644
--- a/src/region.cpp
+++ b/src/region.cpp
@@ -379,4 +380,7 @@ void Region::options(int narg, char **arg)

   if (moveflag || rotateflag) dynamic = 1;
   else dynamic = 0;