I often get asked "How do I know I have the right trajectory or structure after a calculation has completed?"
Well, each module or function in MaterialsScript has “Return type” associated with it. These return types are essentially links to documents or information that is returned from the calculation and is called a “results object”.
The most reliable way to get the structure that is returned from a calculation is to use these results objects. For example, in the case of Amorphous Cell, you would set up a variable to store the results object called \$acResults. After this, you can assign the output trajectory to another variable that you can call later on.
To find what results are returned from a module task calculation, go to the module task in the online help and look at the Run page. For example, to find out what is returned from a Forcite Dynamics calculation, go to Scripting in Materials Studio | MaterialsScript API | Modules | Forcite | Dynamics | Run.
Return values are also really useful when performing smaller calculations such as getting the close contacts from a close contact calculation.
This gets all the close contacts that have just been calculated and you can then go through each close contact and do something with it!
Cheers
Stephen
Well, each module or function in MaterialsScript has “Return type” associated with it. These return types are essentially links to documents or information that is returned from the calculation and is called a “results object”.
The most reliable way to get the structure that is returned from a calculation is to use these results objects. For example, in the case of Amorphous Cell, you would set up a variable to store the results object called \$acResults. After this, you can assign the output trajectory to another variable that you can call later on.
my \$acResults = \$construction->Run(Settings(Temperature => 450)); my \$trajectory = \$acResults->Trajectory;
To find what results are returned from a module task calculation, go to the module task in the online help and look at the Run page. For example, to find out what is returned from a Forcite Dynamics calculation, go to Scripting in Materials Studio | MaterialsScript API | Modules | Forcite | Dynamics | Run.
Return values are also really useful when performing smaller calculations such as getting the close contacts from a close contact calculation.
my \$closeContacts = \$doc->CalculateCloseContacts
This gets all the close contacts that have just been calculated and you can then go through each close contact and do something with it!
Cheers
Stephen