NVE integration for remaining atoms in a simulation with region-specific thermostat

I need to apply NVT thermostat to roughly the middle 20% of the z
extent of the simulation box. I have created the following set of
commands for this purpose (after reading this forum):

variable tzlo equal zlo+0.4*lz
variable tzhi equal zlo+0.6*lz

region regthermo block EDGE EDGE EDGE EDGE \{tzlo\} {tzhi}
group gthermo region regthermo
group gnonthermo subtract all gthermo

fix 1 gthermo nvt temp \{Tstart\} {Tstop} ${Tdamp}
fix_modify 1 temp regthermo
fix 2 gnonthermo nve

I'm wondering if this will work as intended. Specifically, I have
doubts about the nve part. For nvt we use fix_modify to make it
thermostat a region instead of a group of atoms. However, when some of
those atoms leave that region during the simulation, I'm wondering how
fix nve knows that those new atoms now need to be included in
integration, when we specified nve to integrate based on group of
atoms only (gnonthermo) and not based on region (e.g., everywhere
except regthermo)?

Thanks in advance,
F

group definitions don’t change unless the group is made dynamic (which is inefficient and not supported by all fixes).

with LAMMPS to thermalize only a region you can use a temperature bias based on compute temp/region.
please see: https://lammps.sandia.gov/doc/Howto_thermostat.html and the links in it.

axel.