How to define a wall using the outer surface of a cube?

Dear lammps users:
I have a question about how to define a wall using the outer surface of a cube and here is my system:
The system is non-periodic and simulation box A has a size of 200Å*200Å*200Å. At the center of the box, there is a block B with size of 20Å*20Å*20Å. I hope the atoms move in the space between A and B, i.e. in A and out of B.
However, if I create walls using fix walls all wall/region B, by default the atoms are allowed to move inside the box, rather than outside.
I can’t come up with an easy approach to define walls in this system, unless dividing the box into 27 regions like a magic cube and then union 26 of them (except block B) into a region to create walls.
Any suggestion is welcome if there is a better way to deal with the problem.

Please have a closer look at the “side” keyword of the region command. The default is “in”.

Here is a very simple example input of adding a cubic region wall to keep atoms outside the center of the box.

region box block 0 10 0 10 0 10
create_box 1 box
mass 1 1.0
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0

region outer block 3 7 3 7 3 7 side out
create_atoms 1 region outer
fix 1 all wall/region outer lj126 1.0 1.0 2.5

velocity all create 3.0 234234
fix 2 all nve
dump 1 all atom 100 cube.lammpstrj

run 1000

Dear Axel,
Thank you for your quick and professional reply, and that is indeed helpful to me!