# How to create wall with specific length and angle, complex geometry

Hello all,

I am trying to create various geometries, like Y shape with different angles or X shape. Is it possible to create that using fix wall/lj126, is there a way to limit the length of a fix wall/lj126 and change its angle?
From reading the manual it seem it will only work if the wall is attached to a specific region, right?
If not, what command should I look to use to specify a specific region or can I use python to define the region and feed it to LAMMPS, any guides on how to do that?

Best

The information you are looking for is all contained in the manual: fix wall/region command — LAMMPS documentation, region command — LAMMPS documentation

If you want to use python, you would have to program the entire particle/wall interaction within Python using the LAMMPS python module and using the fix python/invoke command — LAMMPS documentation command to trigger the execution.

Particle/wall interactions can be rather tricky for complex geometries, specifically in corners and edges, so careful testing and consideration is advised.

Thank you, I have read the region command. I am starting with a simple region union like in the attached file to create a “T” using this
region box1 block -30 30 0 5 -0.2 0.2 units box
region box2 block 0 5 5 30 -0.2 0.2 units box
region box union 2 box1 box2
the result is a block with size 60*30, I am not sure if I should create space between the two blocks or a common part. the intersect option seems to work but I don’t know why the union option isn’t working!
Any help or guidance is appreciated.

Just to check that I understand region plane correctly. from the docs its says
plane args = px py pz nx ny nz
px,py,pz is the point on the plane and nx,ny,nz are the unit vector at that point, so if nx = 1 then its a yz plane at px and the side in is in the positive x-axis direction, right?
And by having nx,ny,nz with different values we define the angle of the plane,
is it possible to define the region by using intersect of planes like this, it should give a block?
region xp1 plane 5 0 0 -1 0 0
region xp2 plane -5 0 0 1 0 0
region yp1 plane 0 5 0 0 -1 0
region yp2 plane 0 -5 0 0 1 0
region zp1 plane 0 0 5 0 0 -1
region zp2 plane 0 0 -5 0 0 1
region box intersect 6 xp1 xp2 yp1 yp2 zp1 zp2

Is there a place where I can find examples for using union or planes?

in2d.point (1.6 KB)

The problem here seems to be that you are trying to use this construct as simulation box. That cannot work. The simulation box must be a parallelepiped, so it will be using the region to determine the dimensions, but not create “walls”. For those you need to use fix wall/region. As a demonstration for the resulting region’s shape you can use the create atoms command as in the simple example below:

``````lattice         fcc 0.8442
region          box block -10 10 -10 10 -10 10
create_box      1 box
mass            1 1.0

region          horiz block -9 9  5 9 -2 2
region          vert  block -2 2 -9 5 -2 2
region          tee union 2 horiz vert
create_atoms    1 region tee

velocity        all create 3.0 87287 loop geom
pair_style      lj/cut 2.5
pair_coeff      1 1 1.0 1.0 2.5

neighbor        0.3 bin
neigh_modify    every 20 delay 0 check no

fix             1 all nve
dump            2 all image 25 image.*.jpg type type &
axes yes 0.8 0.02 view 60 -30
run             0
``````

Which creates a “T” shaped set of atoms.

Yes. Using create_atoms is the simplest way to confirm that this works as expected:

Thank you very much Dr. Axel.
Thank you for the explanation. In order to confine the atoms to this region, I need to use fix wall/region. Which will use the region surface as a wall, and the region used for wall should be slightly larger than the region containing the atoms because we need r>0. I tried to put the atoms in small cube inside the T region and run the simulation with fix/wall Tregion lj126 with rcut = 1.122462048.

1. Is it something related to how I am using union to connect the two region, should the two region overlap by a small part or not?

2. Is it possible to use wall/reflect on the region surface (from the docs, it doesnt seem to be an option)?

in2d.geo (1.9 KB)

LAMMPS can do only what is mentioned in the documentation. If it is not mentioned, it cannot do it unless you modify the source code or figure out a way to combine other existing (and documented!) features to do the same. I don’t have the time to discuss with you every step until you have reached your goal, but only can point you in the right direction. The rest is up to you and how creative you are and how well you can debug and develop your inputs.