Question about fix_modify

Dear all,

I am interested to control temperature and pressure for a specific region using the NPT ensemble assigned to the yellow atoms (Heat region) in the image attached and NVE everywhere else composed of red atoms (NVE region). So, I want to use the following commands where x and z are periodic directions, and I want to achieve zero pressure for x, z, xz, and yz components while keep the temperature of the Heat region at 100K:

compute CtrlTemp Heat temp
fix 1 Heat npt temp 100 100 (100.0*dt) x 0.0 0.0 (1000.0dt) z 0.0 0.0 (1000.0*dt) xz 0.0 0.0 (1000.0dt) yz 0.0 0.0 $(1000.0*dt) tchain 10 tloop 10 pchain 10 ploop 10 nreset 1000
fix_modify 1 temp CtrlTemp press ???
fix 2 NVE nve
run 10000

I appreciate it if someone can give me a hint on how to tune NPT command for the specific region Heat using fix_modify. By the way, are the commands above appropriate to control the temperature in the Heat region at 100K?

Many thanks in advance for your time and consideration,

Best regards,



You can define your own compute pressure command, which takes a temp-ID
argument so that it computes the pressure using that temperature for
the kinetic component of the pressure. Then you can use fix modify
to assign that specialized pressure computation to the fix npt command.

If you are thinking you want to compute pressure only in a region (like the
thermostat you are applying, then that won’t work. Pressure in LAMMPS
is always computed for the entire simulation box.