Welcome To Support Community

Materials Studio

Advanced Search
Ask Search:

Get Force of Chosen Atom in xtd File

Dear all,
When I finish forcite simulation, I will get a xtd file. If I want to get the position of chosen atom at each frame in xtd file, I can write a perl script as shown below:

User-added image

However, if I want to get force of chosen atom at each frame in xtd file, what should I do? How to write perl script to do so? Thanks.

Best regards,
Best Answer chosen by xuxu
Hi Cheng Xu,

First you need to ensure that force data is written to the trajectory, either by ticking “Include Forces” on the Forcite Dynamics dialog (Advanced tab), or in scripting by setting
WriteForces => "Yes"

Then you can use the script as you have it, just replace the print statement with:
my $force = $atom->Force;
printf "%f %f %f\n", $force->X, $force->Y, $force->Z;

Good luck,