Displacing type of atoms if condition is met

Dear all,
I try to move a type of atoms (not all) when a condition is met, such as crossing some height.

If I want to do it for all atom, this is easy done using :

You can probably add a boolean to it, something like
(type==1) && (z>100)",
to also select on atom type. I cannot remember the exact syntax, but I think it is possible.

Dear all,
I try to move a type of atoms (not all) when a condition is met, such as
crossing some height.

If I want to do it for all atom, this is easy done using :

------
variable escapea atom "z > 100"
group store variable escapea
set group store z -35
velocity store set 0.0 0.0 0.0 units box
fix 4 store setforce 0.0 0.0 0.0
-------

In this case, I store all atoms that escape from a surface after
reflexion as soon as they cross the height z > 100 Angstroem.

​no, you don't. ​
you have a static group, so the atom style variable will be evaluated when
the group is defined and only atoms that have z>100 *at that point in time*
will be included into that group.
if you want to have the group be automatically adjusted, you have to define
a dynamic group. please also note, that the velocity command will act
*immediately*, while the fix setforce will only be applied during a run.

axel.

Thanks a lot
Ok I will check for dynamics group.
Setting force to zero each timestep result in permanently immobile atoms. I agree it is not an elegant way.
Regards

Pascal Brault
DR CNRS
INSIS
GREMI UMR7344
CNRS-Université d’Orléans
+33631498790

No, it doesn’t. At zero force atoms will continue to travel at constant velocity.

If you want to disregard atoms, once they reach a certain distance from a location of interest, it is easiest done to have a fixed boundary and then use:
thermo_modify lost ignore

Otherwise, you will accumulate atoms at your “cutoff” distance and thus build a wall, that will later reflect atoms, as they start to accumulate.

Axel.

Yes but while under the condition the velocity is set to zero, it remains constant with zero value.
My problem is that I send some particule towards a surface with some velocity and when reflecting I which to remove it when it crosses a height in the simulation box or when the velocity has changed its sign. I expect that thermo_modify lost ignore does not apply ?
Thanks again
Kind regards

Pascal Brault
DR CNRS
INSIS
GREMI UMR7344
CNRS-Université d’Orléans
+33631498790

As already explained, the velocity command - unlike a fix - is an immediate command and thus will not be applied to atoms that move toward the cutoff distance at a later point in time.

On the contrary. Using a fixed boundary and ignoring lost atoms is exactly how this kind of scenario is usually managed.

Axel

That’s fine
I understand
Thanks a lot again.
Pascal