Visualise ellipsoid

Dear all,

I’d like to ask is there any way to visualise ellipsoids using dump image or dump vtk? The input script in examples/APHERE/ellipsoid uses:
dump 1 all image 500 image.*.jpg type type zoom 1.6
but I think this command can be only used to render spheres, not ellipsoids.

Also, the script uses dump custom:
dump 1 all custom 500 dump.ellipsoid.mp id type x y z &
quatw quati quatj quatk
it seems that the keywords quatw/i/j/k are not defined.

I am using lammps_stable_23Jun2022_update4

Best regards,
Bowen

That is correct.

This is an old input and has not been updated in a long time (and probably nobody noticed because the dump command was commented out).
It is possible to visualize the ellipsoids using OVITO with some modification to the input according to: Non-spherical particle shapes — OVITO User Manual 3.10.6 documentation

You need the shape and orientation properties (shapex, shapey, shapez, quatw, quati, quatj, and quatk) for that you can add to your input:

compute         0 all property/atom quatw quati quatj quatk shapex shapey shapez

And then include those into the custom dump:

dump           1 all custom 10 dump.ellipsoid.equil id type x y z &
                 c_0[1] c_0[2] c_0[3] c_0[4] c_0[5] c_0[6] c_0[7]

This dump can be read by OVITO, but you would have to manually assign the compute output column to the corresponding properties. With a dump_modify command, you can make it so those are recognized automatically.

dump_modify    1 colname c_0[1] quatw colname c_0[2] quati colname c_0[3] quatj colname c_0[4] quatk &
                 colname c_0[5] shapex colname c_0[6] shapey colname c_0[7] shapez

Now, there is just one obstacle. The system here has a mix of point particles and extended particles, and that is not well supported by compute property/atom. It currently will output a zero for all properties, where there should be 1.0 0.0 0.0 0.0 1.0 1.0 1.0. This can be achieved with a small modification to the source of compute property atom:

diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp
index fc7089fa01..fbb9129b6e 100644
--- a/src/compute_property_atom.cpp
+++ b/src/compute_property_atom.cpp
@@ -1268,7 +1268,7 @@ void ComputePropertyAtom::pack_shapex(int n)
   for (int i = 0; i < nlocal; i++) {
     if ((mask[i] & groupbit) && ellipsoid[i] >= 0)
       buf[n] = 2.0*bonus[ellipsoid[i]].shape[0];
-    else buf[n] = 0.0;
+    else buf[n] = 1.0;
     n += nvalues;
   }
 }
@@ -1285,7 +1285,7 @@ void ComputePropertyAtom::pack_shapey(int n)
   for (int i = 0; i < nlocal; i++) {
     if ((mask[i] & groupbit) && ellipsoid[i] >= 0)
       buf[n] = 2.0*bonus[ellipsoid[i]].shape[1];
-    else buf[n] = 0.0;
+    else buf[n] = 1.0;
     n += nvalues;
   }
 }
@@ -1302,7 +1302,7 @@ void ComputePropertyAtom::pack_shapez(int n)
   for (int i = 0; i < nlocal; i++) {
     if ((mask[i] & groupbit) && ellipsoid[i] >= 0)
       buf[n] = 2.0*bonus[ellipsoid[i]].shape[2];
-    else buf[n] = 0.0;
+    else buf[n] = 1.0;
     n += nvalues;
   }
 }
@@ -1320,7 +1320,7 @@ void ComputePropertyAtom::pack_quatw(int n)
     for (int i = 0; i < nlocal; i++) {
       if ((mask[i] & groupbit) && ellipsoid[i] >= 0)
         buf[n] = bonus[ellipsoid[i]].quat[0];
-      else buf[n] = 0.0;
+      else buf[n] = 1.0;
       n += nvalues;
     }

Technically speaking, the same effect, without recompilation can be achieved by creatively using atom style variables.

When put all together this would then produce the following visualization:
ovito-ellipsoid

Thank you, Axel! That’s really helpful.
Is there any plan to add the ellipsoid support in dump vtk and dump image?
For vtk/paraview, I found one way is to represent ellipsoid as tensorGlyph:

Bowen

Not that I am aware of.