Fix indent

Hello,

Is there a command to know how many atoms are in the sphere created using the indent fix?

Thank you,

Hugo

Hello,

Is there a command to know how many atoms are in the sphere created using the indent fix?

No command needed. There can be no atoms where the indenter is.

It has to be because the force is F=-K(R-r)^2 when r<R

It has to be because the force is F=-K(R-r)^2 when r<R

​​OK. that is a matter of interpretation.

​regardless of that, ​
if you want to follow the​number of ​
atoms that are​interacting with the indenter, you would currently have to modify the fix​
to provide that information in addition to what it currently does.

​axel.​

You mean I have to modify the source code itself?

Hugo

You mean I have to modify the source code itself?

yes. count the interacting atoms and extend the computed output vector
by one more element containing this information. how else can you make
a software do something it doesn't do?

axel.

If all you want is a count of how many atoms are “inside” the indenter
radius, then the following should work. Define a spherical region
coincident with the indenter. Define a variable that uses the
count(group,region) function, with group = all.

Output the variable with thermo output, or to a file, or whatever you like.

Steve

To elaborate on Steve's suggestion, I think this should work:

region rSphere0 sphere 0 0 0 30.0 side in
variable n equal count(all,rSphere0)

This should count the particles in a region of radius 30.0.
(Please correct me if I'm wrong.)
Be careful to make sure the region does not intersect any periodic
boundary conditions.

---- fix wall/region ----

I realize this does not help answer your question at all, but also
take a look at fix wall/region. I attached two examples using fix
wall/region to apply inward radial forces on particles. (In one case
each particle is attracted to the origin using a soft harmonic inward
force (Uext(r)=k*r^2), and another example using a much harder wall
exerting a strong inward force when r>30. Verbose comments included.)

Cheers

Andrew

soft_confinement.in (3.19 KB)

hard_sphere_confinement.in (2.27 KB)