TAD using custom compute

Hello LAMMPS users,

I’m trying to run TAD on LAMMPS using the following script:

units           metal
boundary        p p p
atom_style      atomic
atom_modify     map yes
atom_modify     sort 0 0.0
newton          on

read_data       data.interface

pair_style      mace no_domain_decomposition
pair_coeff      * * MACE-matpes-r2scan-omat-ft.pt-lammps.pt A B C

timestep        0.001
thermo          100
thermo_style    custom step temp pe etotal vol press fmax

velocity        all create 3000.0 4928459 rot yes dist gaussian

variable        interface_z equal 50.5
variable        is_inside atom "type == 1 && z < v_interface_z"
fix             was_inside all store/state 1 v_is_inside
variable        just_entered atom "v_is_inside == 1 && f_was_inside == 0"
compute         event all reduce max v_just_entered

fix             1 all nvt temp 3000.0 3000.0 0.1
tad             10000 1 1123 3000 0.01 0.01 event &
                min 0.00 0.10 500 500 &
                neb 0.00 0.05 2000 2000 20 &
                neb_step 0.01 &
                neb_log neb.log
dump            tad all custom 100 tad.lammpstrj id type x y z```

data.interface consists an interface, and I want to trigger an event every time when atom type 1 enters a specific region (z < z_somevalue). I am getting the following error:

ERROR: Compute does not allow an extra compute or fix to be reset (src/compute.cpp:186)

How can I prevent this error and achieve the same functionality?
(I’m not sure if this error is because tad only works with compute event/displace only.)

Thanks.

The documentation for the tad command is explicit about this:

Currently there is only one compute that works with the TAD command, which is the compute event/displace command.

Under these circumstances, you cannot just use some other compute, but the compute has to be written specifically for the purpose of being used with TAD.

You would have to write a custom compute style in C++ that conforms to the requirements of TAD and implements your needs.

Thank you very much for the reply.
I’ll try to write a custom compute.