how to slice the lammps dump trajectory as a function of the nanoparticle's center of mass

Quote from dezhao huang on November 24, 2020, 1:56 amDear all,
I would like to slice the trajectory as a function of the moving nanoparticle's center of mass so that I can track the liquid flow condition at any time without worrying about the nanoparticle might move out of the slice plane.
I could not find any related information, can ovito do this?
Attachments contain the system setup view ( a nanoparticle immersed in a pool of liquids and there is a substrate at the bottom) and the corresponding trajectory.
Thank you very much!
Best,
******************************************************************************************************************************************************************************************************Dezhao Huang
Ph.D. candidate at University of Notre DameDepartment of Aerospace and Mechanical EngineeringB14 Fitzpatrick HallNotre Dame, IN 46556-5710Tel: (573)-578-0869
Dear all,
I would like to slice the trajectory as a function of the moving nanoparticle's center of mass so that I can track the liquid flow condition at any time without worrying about the nanoparticle might move out of the slice plane.
I could not find any related information, can ovito do this?
Attachments contain the system setup view ( a nanoparticle immersed in a pool of liquids and there is a substrate at the bottom) and the corresponding trajectory.
Thank you very much!
Best,
Uploaded files:

Quote from Constanze Kalcher on November 24, 2020, 11:02 amHi Dezhao,
yes, you can do that through the python scripting interface. Open the GUI of OVITO Pro, insert a python script modifier into your pipeline and try the following script as an example:
from ovito.data import * from ovito.modifiers import SelectTypeModifier, ClusterAnalysisModifier, SliceModifier, InvertSelectionModifier, ClearSelectionModifier def modify(frame, data): data.apply(SelectTypeModifier(property = 'Particle Type', types = {2})) data.apply(ClusterAnalysisModifier(compute_com = True, only_selected = True, cutoff = 4. )) data.apply(InvertSelectionModifier()) cluster_com = data.tables['clusters']['Center of Mass'][0] data.apply(SliceModifier(normal = (0,1,0), distance = cluster_com[1], only_selected = True )) data.apply(ClearSelectionModifier())This script will compute the center of mass of the nanoparticle, which you can pass to the SliceModifier as "distance" argument.
Let me know if you have questions.-Constanze
Hi Dezhao,
yes, you can do that through the python scripting interface. Open the GUI of OVITO Pro, insert a python script modifier into your pipeline and try the following script as an example:
from ovito.data import * from ovito.modifiers import SelectTypeModifier, ClusterAnalysisModifier, SliceModifier, InvertSelectionModifier, ClearSelectionModifier def modify(frame, data): data.apply(SelectTypeModifier(property = 'Particle Type', types = {2})) data.apply(ClusterAnalysisModifier(compute_com = True, only_selected = True, cutoff = 4. )) data.apply(InvertSelectionModifier()) cluster_com = data.tables['clusters']['Center of Mass'][0] data.apply(SliceModifier(normal = (0,1,0), distance = cluster_com[1], only_selected = True )) data.apply(ClearSelectionModifier())
This script will compute the center of mass of the nanoparticle, which you can pass to the SliceModifier as "distance" argument.
Let me know if you have questions.
-Constanze
Uploaded files:
Quote from dezhao huang on November 24, 2020, 4:46 pmThank you very much, Constanze!
This is very helpful!
Best,
Dezhao
Thank you very much, Constanze!
This is very helpful!
Best,
Dezhao